diff --git a/.clang-format b/.clang-format index 8ffd4ebe96..1cf581604c 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,6 @@ --- Language: Cpp -Standard: C++03 +Standard: c++20 AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000000..ab91aca242 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,116 @@ +name: Bug Report +description: Report an issue with Dusklight +type: Bug +body: +- type: checkboxes + id: official-build-certification + attributes: + label: Mods and Forks + description: Certify that this issue exists on the official builds of Dusklight + options: + - label: The bug occurs on an **official release** of Dusklight, without any forks or third-party patches installed + required: true + validations: + required: true + +- type: input + id: dusklight-version + attributes: + label: Dusklight Version + placeholder: ex. 1.3.1 + validations: + required: true + +- type: textarea + id: bug-description + attributes: + label: Bug Description + placeholder: Describe the bug you are encountering + validations: + required: true + +- type: textarea + id: repro-steps + attributes: + label: Steps to Reproduce + placeholder: | + 1. Load save + 2. Go to Hyrule Field + 3. See bug + +- type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + placeholder: Describe what should be happening + +- type: textarea + id: current-behavior + attributes: + label: Current Behavior + placeholder: Describe what is happening instead + +- type: dropdown + id: system-os-architecture + attributes: + label: OS / Architecture + description: The operating system and architecture you are running Dusklight on + options: + - Windows x86-64 + - Windows ARM64 + - MacOS ARM64 + - MacOS x86-64 + - Linux ARM64 + - Linux x84-64 + - Android ARM64 + - iOS ARM64 + validations: + required: true + +- type: dropdown + id: game-region + attributes: + label: Game Region + description: The game region you are playing on + options: + - NTSC-U (North America) + - PAL (Europe) + validations: + required: true + +- type: input + id: game-language + attributes: + label: Game Language + description: The language you are playing the game in + placeholder: ex. English, Spanish, etc. + +- type: dropdown + attributes: + label: Graphics Backend + options: + - Vulkan + - D3D12 + - Metal + - D3D11 + - OpenGL ES + - Unsure / Default + default: 5 + +- type: textarea + id: texture-packs-mods + attributes: + label: Texture Packs and Mods + placeholder: List any texture packs or mods you had installed + +- type: upload + id: logs-upload + attributes: + label: Logs and Other Files + description: Include any relevant logs, config files, or saves to reproduce the bug + +- type: textarea + id: additional-context + attributes: + label: Additional Context + placeholder: Any other information that might be helpful diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000000..91b85243d0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,24 @@ +name: Feature Request +description: Request a new Dusklight feature. Not all requests can/will be included, but we will take these ideas into consideration. +type: Feature +body: +- type: textarea + id: feature-description + attributes: + label: Feature Description + placeholder: Describe the feature you are requesting + validations: + required: true + +- type: input + id: feature-platform + attributes: + label: Platform + description: If applicable, list the platforms this feature applies to. If it is for all platforms, feel free to leave this field blank. + placeholder: ex. Mac, Android, Steam Deck, etc. + +- type: textarea + id: feature-related-info + attributes: + label: Additional Information + placeholder: Any other information that might be helpful (related features, existing implementations, open pull requests or issues, etc.) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 139b0654d3..4712b36439 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,16 @@ on: paths-ignore: - '*.md' - '*LICENSE' + - 'docs/**' pull_request: + paths-ignore: + - '*.md' + - '*LICENSE' + - 'docs/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: SCCACHE_GHA_ENABLED: "true" @@ -22,13 +31,13 @@ jobs: matrix: include: - name: GCC x86_64 - runner: ubuntu-latest + runner: ubuntu-24.04 preset: gcc artifact_arch: x86_64 - # - name: GCC aarch64 - # runner: ubuntu-24.04-arm - # preset: gcc - # artifact_arch: aarch64 + - name: GCC aarch64 + runner: ubuntu-24.04-arm + preset: gcc + artifact_arch: aarch64 # - name: Clang x86_64 # runner: ubuntu-latest # preset: clang @@ -43,7 +52,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \ + sudo apt-get -y install ninja-build clang lld mold openssl libcurl4-openssl-dev \ zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \ libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \ libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \ @@ -71,6 +80,7 @@ jobs: path: | build/install/Dusklight-*.AppImage build/install/debug.tar.* + build/install/sdk/ build-apple: name: Build Apple (${{matrix.name}}) @@ -139,6 +149,7 @@ jobs: path: | build/install/Dusklight.app build/install/debug.tar.* + build/install/sdk/ build-android: name: Build Android (${{matrix.name}}) @@ -194,6 +205,9 @@ jobs: - name: Build native library run: cmake --build --preset ${{matrix.preset}} --target dusklight + - name: Build bundled mods + run: cmake --build --preset ${{matrix.preset}} --target dusklight_mods + - name: Stage stripped JNI library run: ANDROID_STAGE_ABIS="${{matrix.abi}}" platforms/android/scripts/stage-jni-libs.sh @@ -201,11 +215,17 @@ jobs: working-directory: platforms/android run: ./gradlew :app:assembleRelease --rerun-tasks + - name: Stage artifacts + run: | + mkdir -p upload/sdk + cp build/*/stub-android-*.so upload/sdk/ + cp platforms/android/app/build/outputs/apk/release/app-${{matrix.abi}}-release-unsigned.apk upload/ + - name: Upload artifacts uses: actions/upload-artifact@v7 with: name: dusklight-${{env.DUSK_VERSION}}-android-${{matrix.artifact_arch}} - path: platforms/android/app/build/outputs/apk/release/app-${{matrix.abi}}-release-unsigned.apk + path: upload/ build-windows: name: Build Windows (${{matrix.name}}) @@ -221,12 +241,12 @@ jobs: msvc_arch: amd64 vcpkg_arch: x64 artifact_arch: x86_64 - # - name: MSVC arm64 - # runner: windows-11-arm - # preset: arm64-msvc - # msvc_arch: arm64 - # vcpkg_arch: arm64 - # artifact_arch: arm64 + - name: MSVC arm64 + runner: windows-latest + preset: arm64-msvc + msvc_arch: amd64_arm64 + vcpkg_arch: arm64 + artifact_arch: arm64 # - name: Clang x86_64 # runner: windows-latest # preset: clang @@ -255,7 +275,7 @@ jobs: - name: Install dependencies run: | choco install ninja - vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static + vcpkg install freetype:${{matrix.vcpkg_arch}}-windows zstd:${{matrix.vcpkg_arch}}-windows - name: Configure CMake run: cmake --preset x-windows-ci-${{matrix.preset}} @@ -271,4 +291,6 @@ jobs: build/install/*.exe build/install/*.dll build/install/res/ + build/install/mods/ build/install/debug.7z + build/install/sdk/ diff --git a/CMakeLists.txt b/CMakeLists.txt index cf69a8e2ac..75a8d01151 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,87 +5,15 @@ if (NOT CMAKE_BUILD_TYPE) "Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE) endif () -set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)") - -if (DUSK_VERSION_OVERRIDE) - set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}") - set(DUSK_VERSION_STRING "0.0.0.0") - set(DUSK_SHORT_VERSION_STRING "0.0.0") - set(DUSK_WC_REVISION "") - set(DUSK_WC_BRANCH "") - set(DUSK_WC_DATE "") - message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}") -else () - # obtain revision info from git - find_package(Git) -if (GIT_FOUND) - # make sure version information gets re-run when the current Git HEAD changes - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD - OUTPUT_VARIABLE dusk_git_head_filename - OUTPUT_STRIP_TRAILING_WHITESPACE) - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}") - - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD - OUTPUT_VARIABLE dusk_git_head_symbolic - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic} - OUTPUT_VARIABLE dusk_git_head_symbolic_filename - OUTPUT_STRIP_TRAILING_WHITESPACE) - set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}") - - # defines DUSK_WC_REVISION - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD - OUTPUT_VARIABLE DUSK_WC_REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE) - # defines DUSK_WC_DESCRIBE - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*" - OUTPUT_VARIABLE DUSK_WC_DESCRIBE - OUTPUT_STRIP_TRAILING_WHITESPACE) - - # remove the git hash, then collapse a clean "-0" suffix only - string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}") - string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}") - - # defines DUSK_WC_BRANCH - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - OUTPUT_VARIABLE DUSK_WC_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE) - # defines DUSK_WC_DATE - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad - OUTPUT_VARIABLE DUSK_WC_DATE - OUTPUT_STRIP_TRAILING_WHITESPACE) -else () - message(STATUS "Unable to find git, commit information will not be available") -endif () - -if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$") - set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") - set(DUSK_VERSION_TWEAK "0") - if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$") - set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}") - elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$") - set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}") - endif () - set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}") -else () - set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION") - set(DUSK_VERSION_STRING "0.0.0.0") - set(DUSK_SHORT_VERSION_STRING "0.0.0") -endif () - -endif () - -# Add version information to CI environment variables -if(DEFINED ENV{GITHUB_ENV}) - file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n") -endif() -message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}") +include(cmake/DetectVersion.cmake) +detect_version() message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING}) if (APPLE) enable_language(OBJC OBJCXX) endif () +# Adjust CMAKE_SYSTEM_PROCESSOR on Windows to match compiler target +include(cmake/WindowsTargetProcessor.cmake) if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS) # ios.toolchain.cmake hack for SDL set(TVOS ON) @@ -110,6 +38,33 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_cmake") +option(ENABLE_ASAN "Enable AddressSanitizer" OFF) +if (ENABLE_ASAN) + if (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" AND + CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") + add_compile_options($<$:/fsanitize=address>) + add_link_options(/fsanitize=address /INCREMENTAL:NO) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase") + foreach (_lang C CXX) + foreach (_rtc_flag /RTC1 /RTCc /RTCs /RTCu) + string(REPLACE "${_rtc_flag}" "" CMAKE_${_lang}_FLAGS_DEBUG "${CMAKE_${_lang}_FLAGS_DEBUG}") + endforeach () + endforeach () + elseif (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "GNU" AND + CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") + add_compile_options( + $<$:-fsanitize=address> + $<$:-fno-omit-frame-pointer> + ) + add_link_options(-fsanitize=address) + else () + message(FATAL_ERROR "ENABLE_ASAN requires GNU-like or MSVC-like C/C++ compiler frontends") + endif () + + add_compile_definitions(NDEBUG_SANITIZER) # Avoids absl issue with SwissTable debug code + message(STATUS "dusklight: Enabled AddressSanitizer") +endif () + if (CMAKE_SYSTEM_NAME STREQUAL Linux) set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE) endif () @@ -121,17 +76,25 @@ target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1) add_subdirectory(libs/freeverb) +if (CMAKE_BUILD_TYPE STREQUAL "Debug") + set(DUSK_GFX_DEBUG_GROUPS_DEFAULT ON) +else () + set(DUSK_GFX_DEBUG_GROUPS_DEFAULT OFF) +endif () + option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)") option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.") option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON) option(DUSK_ENABLE_UPDATE_CHECKER "Enable update checking support" ON) option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF) -set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN") -set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment") +option(DUSK_PACKAGE_INSTALL "Install Dusklight with a Linux-native file structure" OFF) +option(DUSK_GFX_DEBUG_GROUPS "Report debug groups to the native graphics API" ${DUSK_GFX_DEBUG_GROUPS_DEFAULT}) +option(DUSK_ENABLE_CODE_MODS "Enable code mods" OFF) # Edit & Continue if (MSVC) - if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug") + if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug" + AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue") endif () if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue") @@ -154,6 +117,7 @@ if (DUSK_MOVIE_SUPPORT) endif () set(_jpeg_cmake_args -DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir} + -DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsTargetProcessor.cmake -DENABLE_SHARED=OFF -DWITH_TURBOJPEG=ON -DWITH_JAVA=OFF @@ -172,6 +136,8 @@ if (DUSK_MOVIE_SUPPORT) CMAKE_MSVC_RUNTIME_LIBRARY CMAKE_MSVC_DEBUG_INFORMATION_FORMAT CMAKE_OSX_ARCHITECTURES + CMAKE_OSX_DEPLOYMENT_TARGET + CMAKE_OSX_SYSROOT DEPLOYMENT_TARGET ENABLE_ARC ENABLE_BITCODE @@ -202,10 +168,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux) # -Wno-multichar: Multi-character constants ('ABCD') are implementation-defined but all compilers # (CW, GCC, Clang, MSVC) encode them identically in big-endian order. # For >4-char literals (which GCC/Clang truncate to int), use the MULTI_CHAR() macro. - # -Wwrite-strings: Game code relies on implicit const char* -> char* conversions # -Wdeprecated-declarations: JSystem uses std::iterator, deprecated in C++17 - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar -Wno-write-strings") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Wno-write-strings -Wno-trigraphs -Wno-deprecated-declarations") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Wno-trigraphs -Wno-deprecated-declarations") set(CMAKE_INSTALL_RPATH "$ORIGIN") set(CMAKE_BUILD_RPATH "$ORIGIN") elseif (APPLE) @@ -215,7 +180,6 @@ elseif (APPLE) elseif (MSVC) add_compile_options( $<$:/bigobj> - $<$:/Zc:strictStrings-> $<$:/MP> $<$:/FS> ) @@ -232,7 +196,6 @@ elseif (MSVC) add_compile_options($<$:/utf-8>) endif () - include(FetchContent) # Declare all dependencies first so CMake can download them in parallel @@ -240,15 +203,55 @@ message(STATUS "dusklight: Fetching cxxopts") FetchContent_Declare(cxxopts URL https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.3.1.tar.gz URL_HASH SHA256=3bfc70542c521d4b55a46429d808178916a579b28d048bd8c727ee76c39e2072 - DOWNLOAD_EXTRACT_TIMESTAMP TRUE + DOWNLOAD_EXTRACT_TIMESTAMP FALSE ) message(STATUS "dusklight: Fetching nlohmann/json") FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa - DOWNLOAD_EXTRACT_TIMESTAMP TRUE + DOWNLOAD_EXTRACT_TIMESTAMP FALSE ) -FetchContent_MakeAvailable(cxxopts json) +message(STATUS "dusklight: Fetching miniz") +FetchContent_Declare(miniz + URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip + DOWNLOAD_EXTRACT_TIMESTAMP TRUE + EXCLUDE_FROM_ALL +) + +set(_fetch_content_deps cxxopts json miniz) +if (DUSK_ENABLE_CODE_MODS) + message(STATUS "dusklight: Fetching funchook") + # cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a + # PATCH_COMMAND into capstone's inner ExternalProject. That PATCH_COMMAND runs + # cmake/PatchCapstone.cmake after capstone is cloned, which removes the + # cmake_policy(SET CMP0048 OLD) line that CMake >= 3.27 rejects. + # This is incredibly scuffed and we should probably think of a better way to do this + set(CAPSTONE_FIX_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/PatchCapstone.cmake") + FetchContent_Declare(funchook + GIT_REPOSITORY https://github.com/kubo/funchook.git + GIT_TAG v1.1.3 + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE + PATCH_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR= -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/PatchFunchook.cmake + EXCLUDE_FROM_ALL + ) + set(FUNCHOOK_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set(FUNCHOOK_BUILD_SHARED OFF CACHE BOOL "" FORCE) + set(FUNCHOOK_INSTALL OFF CACHE BOOL "" FORCE) + if (APPLE AND CMAKE_OSX_ARCHITECTURES) + list(LENGTH CMAKE_OSX_ARCHITECTURES _osx_arch_count) + if (_osx_arch_count EQUAL 1) + list(GET CMAKE_OSX_ARCHITECTURES 0 _osx_arch) + if (_osx_arch MATCHES "^(arm64|aarch64|ARM64)$") + set(FUNCHOOK_CPU arm64 CACHE STRING "" FORCE) + elseif (_osx_arch MATCHES "^(x86_64|AMD64|amd64|i[3-6]86|x86)$") + set(FUNCHOOK_CPU x86 CACHE STRING "" FORCE) + endif () + endif () + endif () + list(APPEND _fetch_content_deps funchook) +endif () +FetchContent_MakeAvailable(${_fetch_content_deps}) if (DUSK_ENABLE_SENTRY_NATIVE) message(STATUS "dusklight: Fetching sentry-native") @@ -282,21 +285,7 @@ if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQU add_compile_options(-fsigned-char) endif() -if (CMAKE_SYSTEM_NAME STREQUAL Windows) - set(PLATFORM_NAME win32) -elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin) - if (IOS) - set(PLATFORM_NAME ios) - elseif (TVOS) - set(PLATFORM_NAME tvos) - else () - set(PLATFORM_NAME macos) - endif () -else () - string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME) -endif () - -configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h) +configure_version_header() include(files.cmake) @@ -312,24 +301,16 @@ set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors") source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES}) source_group("dusklight" FILES ${DUSK_FILES} ${DUSK_HTTP_BACKEND_FILES}) -set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1) - -set(GAME_INCLUDE_DIRS - include - src - assets/GZ2E01 # TODO: make this dynamic if needed? - libs/JSystem/include - libs - extern/aurora/include/dolphin - extern - ${CMAKE_BINARY_DIR}) +include(cmake/GameABIConfig.cmake) find_package(Threads REQUIRED) +set(GAME_COMPILE_DEFS DUSK_BUILDING_GAME=1) set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt - Threads::Threads) - -list(APPEND GAME_LIBS libzstd_static) + Threads::Threads zstd::libzstd dusklight_game_headers) +if (DUSK_ENABLE_CODE_MODS) + list(APPEND GAME_LIBS funchook-static) +endif () if (DUSK_ENABLE_SENTRY_NATIVE) list(APPEND GAME_LIBS sentry) @@ -338,6 +319,10 @@ endif () if (WIN32) list(APPEND GAME_LIBS Ws2_32) + if (CMAKE_BUILD_TYPE STREQUAL Debug) + list(APPEND GAME_LIBS dbghelp) + list(APPEND GAME_COMPILE_DEFS DUSK_CRASH_DBGHELP=1) + endif () endif () set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/no_backend.cpp) @@ -393,8 +378,18 @@ if (DUSK_ENABLE_DISCORD AND NOT ANDROID AND NOT IOS AND NOT TVOS) list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD=1) endif () -if(ANDROID) - list(APPEND GAME_COMPILE_DEFS TARGET_ANDROID=1) +if (DUSK_ENABLE_CODE_MODS) + list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1) +endif () + +if (DUSK_PACKAGE_INSTALL) + include(GNUInstallDirs) + list(APPEND GAME_COMPILE_DEFS DUSK_ASSET_DIR="${CMAKE_INSTALL_FULL_DATADIR}/dusklight/") +endif () + +if (DUSK_GFX_DEBUG_GROUPS) + list(APPEND GAME_COMPILE_DEFS DUSK_GFX_DEBUG_GROUPS=1) + target_compile_definitions(aurora_gx PRIVATE AURORA_GFX_DEBUG_GROUPS) endif () # game_debug is for game code files that we know work when compiled with DEBUG=1 @@ -411,7 +406,7 @@ set(GAME_DEBUG_FILES set_source_files_properties( ${GAME_DEBUG_FILES} PROPERTIES - COMPILE_DEFINITIONS "$<$:DEBUG=1>;$<$:PARTIAL_DEBUG=1>" + COMPILE_DEFINITIONS "$<$:DEBUG=1>" ) # game_base is for all other game code files @@ -425,16 +420,11 @@ set(GAME_BASE_FILES set_source_files_properties( ${GAME_BASE_FILES} PROPERTIES - COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0;$<$:PARTIAL_DEBUG=1>" + COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0" ) foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES) - target_compile_definitions(${jsystem_lib} PRIVATE - ${GAME_COMPILE_DEFS} - $<$:DEBUG=1> - $<$:PARTIAL_DEBUG=1> - ) - target_include_directories(${jsystem_lib} PRIVATE ${GAME_INCLUDE_DIRS}) + target_compile_definitions(${jsystem_lib} PRIVATE ${GAME_COMPILE_DEFS} $<$:DEBUG=1>) target_link_libraries(${jsystem_lib} PRIVATE ${GAME_LIBS}) set_target_properties(${jsystem_lib} PROPERTIES FOLDER "JSystem") endforeach() @@ -446,18 +436,70 @@ if (CMAKE_CXX_LINK_GROUP_USING_RESCAN_SUPPORTED OR CMAKE_LINK_GROUP_USING_RESCAN set(JSYSTEM_LINK_LIBRARIES "$") endif () -set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES}) +set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c) if(ANDROID) add_library(dusklight SHARED ${DUSK_FILES}) set_target_properties(dusklight PROPERTIES OUTPUT_NAME main) else () add_executable(dusklight ${DUSK_FILES}) endif () +if (ENABLE_ASAN) + target_sources(dusklight PRIVATE src/dusk/asan_options.c) +endif () target_compile_definitions(dusklight PRIVATE ${GAME_COMPILE_DEFS}) -target_include_directories(dusklight PRIVATE ${GAME_INCLUDE_DIRS}) +target_include_directories(dusklight PRIVATE ${miniz_SOURCE_DIR}) target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES}) target_precompile_headers(dusklight PRIVATE "$<$:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") + +if (DUSK_ENABLE_CODE_MODS) + include(cmake/SymbolManifest.cmake) + if (WIN32) + # Game ABI exports & import library for mod linking + include(cmake/WindowsExports.cmake) + setup_windows_exports(dusklight) + endif () + # Post-link symbol manifest: hookable-surface name->address map keyed to the build. + setup_symbol_manifest(dusklight) +endif () + +# Hook reliability: guaranteed patchable entries on the game ABI surface, and no identical-code folding. +if (MSVC) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(DUSK_PATCHABLE_ENTRY_FLAG $<$:/hotpatch>) + endif () + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64") + target_link_options(dusklight PRIVATE /FUNCTIONPADMIN:16 /OPT:NOICF) + else () + target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF) + endif () +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64") + set(DUSK_PATCHABLE_ENTRY_FLAG $<$:-fpatchable-function-entry=2,1>) + else () + set(DUSK_PATCHABLE_ENTRY_FLAG $<$:-fpatchable-function-entry=10,5>) + endif () +endif () +if (DEFINED DUSK_PATCHABLE_ENTRY_FLAG) + target_compile_options(dusklight PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG}) + foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES) + target_compile_options(${jsystem_lib} PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG}) + endforeach() +endif () + +if (WIN32) + target_link_libraries(dusklight PRIVATE Psapi) +endif () +if (APPLE) + include(cmake/AppleExports.cmake) + setup_apple_exports(dusklight) +elseif (ANDROID) + include(cmake/AndroidExports.cmake) + setup_android_exports(dusklight) +elseif (UNIX) + target_link_options(dusklight PRIVATE -rdynamic) +endif () + if (TARGET crashpad_handler) add_dependencies(dusklight crashpad_handler) add_custom_command(TARGET dusklight POST_BUILD @@ -474,6 +516,13 @@ if (ANDROID) target_link_options(dusklight PRIVATE "-Wl,-u,SDL_main") endif () +if (CMAKE_SYSTEM_NAME STREQUAL Linux) + target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1") + target_link_libraries(dusklight PRIVATE dl) +elseif (ANDROID) + target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1") +endif () + if (NOT APPLE) add_custom_command(TARGET dusklight POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory @@ -512,6 +561,15 @@ if (WIN32) endif () endif () +include(cmake/ModSDK.cmake) + +if (DUSK_ENABLE_CODE_MODS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + add_custom_target(dusklight_mods) # Aggregate target for all in-tree mods + add_subdirectory(mods/template_mod) + add_subdirectory(mods/ao_mod) + add_subdirectory(mods/shadow_mod) +endif () + if (APPLE) if (IOS) set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios) @@ -519,6 +577,7 @@ if (APPLE) set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos) else () set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos) + set(DUSK_ENTITLEMENTS ${DUSK_RESOURCE_DIR}/Dusklight.entitlements) endif () set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in) file(GLOB_RECURSE DUSK_RESOURCE_FILES @@ -538,8 +597,7 @@ if (APPLE) get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY) set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}") endforeach () - set_target_properties( - dusklight PROPERTIES + set(_apple_bundle_properties MACOSX_BUNDLE TRUE MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME} MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER} @@ -550,6 +608,31 @@ if (APPLE) XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES" XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES" ) + if (DUSK_ENTITLEMENTS) + list(APPEND _apple_bundle_properties + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${DUSK_ENTITLEMENTS}) + endif () + if (NOT IOS AND NOT TVOS) + list(APPEND _apple_bundle_properties + XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES") + endif () + set_target_properties(dusklight PROPERTIES ${_apple_bundle_properties}) + + if (NOT IOS AND NOT TVOS AND NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode") + set(_sign_nested_commands) + if (TARGET crashpad_handler) + list(APPEND _sign_nested_commands + COMMAND /usr/bin/codesign --force --sign - + "$/crashpad_handler") + endif () + add_custom_command(TARGET dusklight POST_BUILD + ${_sign_nested_commands} + COMMAND /usr/bin/codesign --force --sign - --entitlements + "${DUSK_ENTITLEMENTS}" "$" + COMMENT "Signing Dusklight.app with entitlements" + VERBATIM + ) + endif () endif () if (APPLE AND NOT IOS AND NOT TVOS) @@ -611,12 +694,20 @@ set(EXTRA_TARGETS "") if (TARGET crashpad_handler) list(APPEND EXTRA_TARGETS crashpad_handler) endif () -install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX}) +if (DUSK_PACKAGE_INSTALL) + install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_BINDIR}) +else() + install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX}) +endif() aurora_install_runtime_dlls(dusklight ${CMAKE_INSTALL_PREFIX}) if (NOT APPLE) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX}) + if (DUSK_PACKAGE_INSTALL) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dusklight) + else() + install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX}) + endif() endif () -if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo) +if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo AND NOT DUSK_PACKAGE_INSTALL) set(DEBUG_FILES_LIST "") foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS) get_target_output_name(${target} output_name) @@ -665,3 +756,5 @@ foreach (target IN LISTS BINARY_TARGETS) endif () endforeach () endforeach () + +install_bundled_mods() diff --git a/CMakePresets.json b/CMakePresets.json index 0201c61ed6..e6485ddac1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -19,7 +19,7 @@ "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded" + "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL" } }, { @@ -33,7 +33,21 @@ "value": true }, "DUSK_SENTRY_DSN": "$env{SENTRY_DSN}", - "DUSK_SENTRY_ENVIRONMENT": "production" + "DUSK_SENTRY_ENVIRONMENT": "production", + "Rust_RUSTUP_INSTALL_MISSING_TARGET": { + "type": "BOOL", + "value": true + } + } + }, + { + "name": "asan", + "hidden": true, + "cacheVariables": { + "ENABLE_ASAN": { + "type": "BOOL", + "value": true + } } }, { @@ -42,7 +56,15 @@ "generator": "Ninja", "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { - "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install" + "BUILD_SHARED_LIBS": { + "type": "BOOL", + "value": false + }, + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", + "DUSK_ENABLE_CODE_MODS": { + "type": "BOOL", + "value": true + } }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -63,6 +85,15 @@ "linux-default" ] }, + { + "name": "linux-default-debug-asan", + "displayName": "Linux (default) Debug ASan", + "inherits": [ + "debug", + "linux-default", + "asan" + ] + }, { "name": "linux-default-relwithdebinfo", "displayName": "Linux (default) RelWithDebInfo", @@ -90,6 +121,15 @@ "linux-clang" ] }, + { + "name": "linux-clang-debug-asan", + "displayName": "Linux (Clang) Debug ASan", + "inherits": [ + "debug", + "linux-clang", + "asan" + ] + }, { "name": "linux-clang-relwithdebinfo", "displayName": "Linux (Clang) RelWithDebInfo", @@ -110,7 +150,15 @@ "cacheVariables": { "CMAKE_C_COMPILER": "cl", "CMAKE_CXX_COMPILER": "cl", - "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install" + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", + "DUSK_ENABLE_CODE_MODS": { + "type": "BOOL", + "value": true + }, + "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { + "type": "BOOL", + "value": true + } }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -128,6 +176,15 @@ "windows-msvc" ] }, + { + "name": "windows-msvc-debug-asan", + "displayName": "Windows (MSVC) Debug ASan", + "inherits": [ + "debug", + "windows-msvc", + "asan" + ] + }, { "name": "windows-msvc-relwithdebinfo", "displayName": "Windows (MSVC) RelWithDebInfo", @@ -139,17 +196,13 @@ { "name": "windows-arm64-msvc", "displayName": "Windows ARM64 (MSVC)", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build/${presetName}", + "inherits": [ + "windows-msvc" + ], "architecture": { "value": "arm64", "strategy": "external" }, - "cacheVariables": { - "CMAKE_C_COMPILER": "cl", - "CMAKE_CXX_COMPILER": "cl", - "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install" - }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ @@ -197,7 +250,15 @@ "generator": "Ninja", "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { - "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install" + "BUILD_SHARED_LIBS": { + "type": "BOOL", + "value": false + }, + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", + "DUSK_ENABLE_CODE_MODS": { + "type": "BOOL", + "value": true + } }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -215,6 +276,15 @@ "macos-default" ] }, + { + "name": "macos-default-debug-asan", + "displayName": "macOS (default) Debug ASan", + "inherits": [ + "debug", + "macos-default", + "asan" + ] + }, { "name": "macos-default-relwithdebinfo", "displayName": "macOS (default) RelWithDebInfo", @@ -280,24 +350,21 @@ "type": "BOOL", "value": false }, + "ENABLE_ARC": { + "type": "BOOL", + "value": false + }, "Rust_CARGO_TARGET": "aarch64-apple-tvos", "Rust_TOOLCHAIN": "nightly", "BUILD_SHARED_LIBS": { "type": "BOOL", "value": false }, - "CMAKE_DISABLE_FIND_PACKAGE_BZip2": { + "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "type": "BOOL", "value": true }, - "CMAKE_DISABLE_FIND_PACKAGE_LibLZMA": { - "type": "BOOL", - "value": true - }, - "CMAKE_DISABLE_FIND_PACKAGE_zstd": { - "type": "BOOL", - "value": true - } + "CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew" }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -322,6 +389,18 @@ "BUILD_SHARED_LIBS": { "type": "BOOL", "value": false + }, + "DUSK_ENABLE_CODE_MODS": { + "type": "BOOL", + "value": true + }, + "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { + "type": "BOOL", + "value": true + }, + "CMAKE_DISABLE_FIND_PACKAGE_zstd": { + "type": "BOOL", + "value": true } } }, @@ -378,7 +457,8 @@ "ci" ], "cacheVariables": { - "AURORA_SDL3_PROVIDER": "vendor" + "AURORA_SDL3_PROVIDER": "vendor", + "CMAKE_LINKER_TYPE": "MOLD" } }, { @@ -407,12 +487,8 @@ "type": "BOOL", "value": true }, - "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0", - "CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew", - "BUILD_SHARED_LIBS": { - "type": "BOOL", - "value": false - } + "CMAKE_OSX_DEPLOYMENT_TARGET": "12.0", + "CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew" } }, { @@ -430,7 +506,6 @@ "x-macos-ci" ], "cacheVariables": { - "AURORA_DAWN_PROVIDER": "vendor", "CMAKE_OSX_ARCHITECTURES": "x86_64", "Rust_CARGO_TARGET": "x86_64-apple-darwin" } @@ -490,7 +565,10 @@ "inherits": [ "x-windows-ci", "windows-arm64-msvc" - ] + ], + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "arm64-windows" + } } ], "buildPresets": [ @@ -500,6 +578,12 @@ "description": "Linux (default) debug build", "displayName": "Linux (default) Debug" }, + { + "name": "linux-default-debug-asan", + "configurePreset": "linux-default-debug-asan", + "description": "Linux (default) debug build with AddressSanitizer", + "displayName": "Linux (default) Debug ASan" + }, { "name": "linux-default-relwithdebinfo", "configurePreset": "linux-default-relwithdebinfo", @@ -512,6 +596,12 @@ "description": "Linux (Clang) debug build", "displayName": "Linux (Clang) Debug" }, + { + "name": "linux-clang-debug-asan", + "configurePreset": "linux-clang-debug-asan", + "description": "Linux (Clang) debug build with AddressSanitizer", + "displayName": "Linux (Clang) Debug ASan" + }, { "name": "linux-clang-relwithdebinfo", "configurePreset": "linux-clang-relwithdebinfo", @@ -524,6 +614,12 @@ "description": "macOS debug build", "displayName": "macOS Debug" }, + { + "name": "macos-default-debug-asan", + "configurePreset": "macos-default-debug-asan", + "description": "macOS debug build with AddressSanitizer", + "displayName": "macOS Debug ASan" + }, { "name": "macos-default-relwithdebinfo", "configurePreset": "macos-default-relwithdebinfo", @@ -581,6 +677,12 @@ "description": "Windows (MSVC) debug build", "displayName": "Windows (MSVC) Debug" }, + { + "name": "windows-msvc-debug-asan", + "configurePreset": "windows-msvc-debug-asan", + "description": "Windows (MSVC) debug build with AddressSanitizer", + "displayName": "Windows (MSVC) Debug ASan" + }, { "name": "windows-msvc-relwithdebinfo", "configurePreset": "windows-msvc-relwithdebinfo", diff --git a/README.md b/README.md index 106d2c0a0e..7584c09c46 100644 --- a/README.md +++ b/README.md @@ -20,36 +20,17 @@ It aims to be as accurate as possible to the original while also providing new o > Dusklight does *not* provide any copyrighted assets. You must provide your own copy of the original game. > [!IMPORTANT] -> At a minimum, Dusklight requires a GPU with support for either D3D12, Vulkan, or Metal. Your experience with specific hardware, operating systems, and drivers may vary. In particular, older Intel iGPUs have a high likelihood of incompatibility. We are also aware of a number of issues on devices with Adreno GPUs and are working to resolve them. +> At a minimum, Dusklight requires a GPU with support for D3D12, Vulkan 1.1+, or Metal. For older devices, best-effort support is provided for D3D11 and OpenGL ES (Android), but will not achieve full accuracy or performance. Your experience with specific hardware, operating systems, and drivers may vary. -### 1. Verify your dump +### 1. Dump your game -First, make sure your dump of the game is clean and supported by Dusklight. You can do this by checking the SHA-1 hash of your dump against this list of supported versions: +You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space. -| Version | SHA-1 hash | -|--------------| ------------------------------------------ | -| GameCube USA | `75edd3ddff41f125d1b4ce1a40378f1b565519e7` | -| GameCube EUR | `2601822a488eeb86fb89db16ca8f29c2c953e1ca` | +Currently, only the GameCube USA and EUR releases are supported. Support for other versions of the game is planned in the future. -*Support for other versions of the game is planned in the future. +### 2. Install Dusklight -### 2. Download [Dusklight](https://github.com/TwilitRealm/dusklight/releases) - -### 3. Setup the game -**Windows / macOS / Linux** -- Extract the .zip file -- Launch Dusklight -- Press **Select Disc Image** and provide the path to your supported game dump -- Press **Play**! - -**iOS** -- Follow the [iOS setup guide](docs/ios-install-altstore.md) - -**Android** -- Install the Dusklight APK -- Launch Dusklight -- Press **Select Disc Image** and provide the path to your supported game dump -- Press **Play**! +Visit the [official installation guide](https://twilitrealm.dev/install/) for full instructions. # Building diff --git a/ci/build-appimage.sh b/ci/build-appimage.sh index 6653876f71..e12f1163b9 100755 --- a/ci/build-appimage.sh +++ b/ci/build-appimage.sh @@ -6,6 +6,7 @@ fi build_dir="$PWD/build" linuxdeploy="$build_dir/linuxdeploy-$(uname -m).AppImage" +lib_dir="/usr/lib/$(uname -m)-linux-gnu" # Get linuxdeploy mkdir -p "$build_dir" @@ -19,8 +20,8 @@ for install_path in build/install/*; do cp -r "$install_path" build/appdir/usr/bin done cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor -cp platforms/freedesktop/dusklight.desktop build/appdir/usr/share/applications +cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications cd build/install VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \ - -l /usr/lib/x86_64-linux-gnu/libusb-1.0.so --appdir "$build_dir/appdir" --output appimage + -l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage diff --git a/cmake/AndroidExports.cmake b/cmake/AndroidExports.cmake new file mode 100644 index 0000000000..66e80d3f4a --- /dev/null +++ b/cmake/AndroidExports.cmake @@ -0,0 +1,63 @@ +include_guard(GLOBAL) + +get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) + +# Android mod linking: symgen scans and filters the game's exports, generating a version script used for the executable +# link step, and generates a shared object stub that mods can link against without having to build the whole game. +function(setup_android_exports target) + include("${_dir}/SymbolManifest.cmake") + ensure_symgen(TRUE) + add_dependencies(${target} symgen) + + set(_rsp_lines "$") + foreach (_lib IN LISTS JSYSTEM_LIBRARIES) + list(APPEND _rsp_lines "$") + endforeach () + list(JOIN _rsp_lines "\n" _rsp_content) + set(_rsp "${CMAKE_BINARY_DIR}/dusklight_exports_input.rsp") + file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}") + + set(_sdk_args) + foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx + aurora_os aurora_pad aurora_si aurora_vi) + if (TARGET ${_lib}) + list(APPEND _sdk_args --sdk-lib "$") + endif () + endforeach () + if (TARGET dawn::webgpu_dawn) + get_target_property(_dawn_type dawn::webgpu_dawn TYPE) + if (_dawn_type STREQUAL "STATIC_LIBRARY") + list(APPEND _sdk_args --sdk-lib "$") + endif () + endif () + + set(_vscript "${CMAKE_BINARY_DIR}/dusklight_exports.ver") + add_custom_command(TARGET ${target} PRE_LINK + COMMAND "${SYMGEN_EXE}" exports + "@${_rsp}" + --out "${_vscript}" + --format version-script + --exclude cmake_pch + --exclude miniz + --exclude asan_options + --exclude src/dusk + # Resolved from the Java side; the SDL ones live in the statically-linked + # SDL archive, outside the provenance scan. + --extra-sym JNI_OnLoad + --extra-sym SDL_main + --extra-sym "Java_*" + ${_sdk_args} + COMMENT "Generating dusklight exports" + VERBATIM) + target_link_options(${target} PRIVATE "-Wl,--version-script=${_vscript}") + + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch) + set(_stub "${CMAKE_BINARY_DIR}/stub-android-${_arch}.so") + add_custom_command(TARGET ${target} POST_BUILD + COMMAND "${SYMGEN_EXE}" stub -f elf "$" -o "${_stub}" + --soname "$" --arch "${_arch}" + BYPRODUCTS "${_stub}" + COMMENT "Generating dusklight link stub" + VERBATIM) + install(FILES "${_stub}" DESTINATION sdk) +endfunction() diff --git a/cmake/AppleExports.cmake b/cmake/AppleExports.cmake new file mode 100644 index 0000000000..2c78939811 --- /dev/null +++ b/cmake/AppleExports.cmake @@ -0,0 +1,90 @@ +include_guard(GLOBAL) + +get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) + +# Apple mod linking: symgen scans and filters the game's exports, generating an exports list used for the executable +# link step, and generates a MH_EXECUTE Mach-O stub that mods can link against without having to build the whole game. +function(setup_apple_exports target) + include("${_dir}/SymbolManifest.cmake") + ensure_symgen(TRUE) + set(_symgen "${SYMGEN_EXE}") + add_dependencies(${target} symgen) + + set(_config_subdir "") + if (CMAKE_CONFIGURATION_TYPES) + set(_config_subdir "$/") + endif () + + set(_rsp_lines "$") + foreach (_lib IN LISTS JSYSTEM_LIBRARIES) + list(APPEND _rsp_lines "$") + endforeach () + list(JOIN _rsp_lines "\n" _rsp_content) + set(_rsp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports_input.rsp") + file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}") + + set(_sdk_args) + foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx + aurora_os aurora_pad aurora_si aurora_vi) + if (TARGET ${_lib}) + list(APPEND _sdk_args --sdk-lib "$") + endif () + endforeach () + + # Dawn is linked statically on Apple; mods reach wgpu* through the executable. + if (TARGET dawn::webgpu_dawn) + get_target_property(_dawn_type dawn::webgpu_dawn TYPE) + if (_dawn_type STREQUAL "STATIC_LIBRARY") + list(APPEND _sdk_args --sdk-lib "$") + endif () + endif () + + set(_exp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports.exp") + add_custom_command(TARGET ${target} PRE_LINK + COMMAND "${_symgen}" exports + "@${_rsp}" + --out "${_exp}" + --exclude cmake_pch + --exclude miniz + --exclude asan_options + --exclude src/dusk + ${_sdk_args} + COMMENT "Generating dusklight exports" + VERBATIM) + target_link_options(${target} PRIVATE -Xlinker -exported_symbols_list -Xlinker "${_exp}") + + # Generate the stub executable mods link against via -bundle_loader. + set(_stub_args) + if (IOS) + set(_stub_platform "ios") + list(APPEND _stub_args --platform ios) + elseif (TVOS) + set(_stub_platform "tvos") + list(APPEND _stub_args --platform tvos) + else () + set(_stub_platform "macos") + endif () + if (CMAKE_OSX_DEPLOYMENT_TARGET) + list(APPEND _stub_args --min-os "${CMAKE_OSX_DEPLOYMENT_TARGET}") + endif () + if (CMAKE_OSX_ARCHITECTURES) + set(_archs "${CMAKE_OSX_ARCHITECTURES}") + else () + set(_archs "${CMAKE_SYSTEM_PROCESSOR}") + endif () + set(_arch_names "") + foreach (_arch IN LISTS _archs) + string(TOLOWER "${_arch}" _arch) + list(APPEND _stub_args --arch "${_arch}") + list(APPEND _arch_names "${_arch}") + endforeach () + list(JOIN _arch_names "_" _arch_name) + + set(_stub "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight-stub") + add_custom_command(TARGET ${target} POST_BUILD + COMMAND "${_symgen}" stub -f macho "${_exp}" -o "${_stub}" ${_stub_args} + BYPRODUCTS "${_stub}" + COMMENT "Generating dusklight link stub" + VERBATIM) + install(FILES "${_stub}" DESTINATION sdk RENAME "stub-${_stub_platform}-${_arch_name}") +endfunction() diff --git a/cmake/CopyModAssets.cmake b/cmake/CopyModAssets.cmake new file mode 100644 index 0000000000..ca16da6018 --- /dev/null +++ b/cmake/CopyModAssets.cmake @@ -0,0 +1,10 @@ +# Copies a mod asset directory for packaging, skipping dotfiles and dot-directories +# (.gitkeep, .DS_Store, ...). Usage: cmake -DSRC= -DDST= -P CopyModAssets.cmake +file(MAKE_DIRECTORY "${DST}") +file(GLOB_RECURSE _files RELATIVE "${SRC}" "${SRC}/*") +foreach (_file IN LISTS _files) + if (NOT _file MATCHES "(^|/)\\.") + get_filename_component(_dir "${_file}" DIRECTORY) + file(COPY "${SRC}/${_file}" DESTINATION "${DST}/${_dir}") + endif () +endforeach () diff --git a/cmake/DetectVersion.cmake b/cmake/DetectVersion.cmake new file mode 100644 index 0000000000..ec72a97a2e --- /dev/null +++ b/cmake/DetectVersion.cmake @@ -0,0 +1,121 @@ +# Version detection shared by the main build and the mod SDK (sdk/CMakeLists.txt) +include_guard(GLOBAL) + +get_filename_component(_DUSK_VERSION_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) + +set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN") +set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment") + +set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)") + +macro(detect_version) + if (DUSK_VERSION_OVERRIDE) + set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}") + set(DUSK_VERSION_STRING "0.0.0.0") + set(DUSK_SHORT_VERSION_STRING "0.0.0") + set(DUSK_VERSION_CODE "1") + set(DUSK_WC_REVISION "") + set(DUSK_WC_BRANCH "") + set(DUSK_WC_DATE "") + message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}") + else () + # obtain revision info from git + find_package(Git) + if (GIT_FOUND) + # make sure version information gets re-run when the current Git HEAD changes + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD + OUTPUT_VARIABLE dusk_git_head_filename + OUTPUT_STRIP_TRAILING_WHITESPACE) + get_filename_component(dusk_git_head_filename "${dusk_git_head_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}") + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}") + + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD + OUTPUT_VARIABLE dusk_git_head_symbolic + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} + COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic} + OUTPUT_VARIABLE dusk_git_head_symbolic_filename + OUTPUT_STRIP_TRAILING_WHITESPACE) + get_filename_component(dusk_git_head_symbolic_filename "${dusk_git_head_symbolic_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}") + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}") + + # defines DUSK_WC_REVISION + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + OUTPUT_VARIABLE DUSK_WC_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE) + # defines DUSK_WC_DESCRIBE + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*" + OUTPUT_VARIABLE DUSK_WC_DESCRIBE + OUTPUT_STRIP_TRAILING_WHITESPACE) + + # remove the git hash, then collapse a clean "-0" suffix only + string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}") + string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}") + + # defines DUSK_WC_BRANCH + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD + OUTPUT_VARIABLE DUSK_WC_BRANCH + OUTPUT_STRIP_TRAILING_WHITESPACE) + # defines DUSK_WC_DATE + execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad + OUTPUT_VARIABLE DUSK_WC_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE) + else () + message(STATUS "Unable to find git, commit information will not be available") + endif () + + if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$") + set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") + set(_ver_major ${CMAKE_MATCH_1}) + set(_ver_minor ${CMAKE_MATCH_2}) + set(_ver_patch ${CMAKE_MATCH_3}) + set(DUSK_VERSION_TWEAK "0") + if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$") + set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}") + elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$") + set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}") + endif () + set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}") + if (DUSK_VERSION_TWEAK GREATER 999) + set(_tweak 999) + else () + set(_tweak ${DUSK_VERSION_TWEAK}) + endif () + # encoding: major*1e7 + minor*1e5 + patch*1e3 + tweak; collision-free for major<210, minor<100, patch<100, tweak<=999 + math(EXPR DUSK_VERSION_CODE + "${_ver_major} * 10000000 + ${_ver_minor} * 100000 + ${_ver_patch} * 1000 + ${_tweak}") + else () + set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION") + set(DUSK_VERSION_STRING "0.0.0.0") + set(DUSK_SHORT_VERSION_STRING "0.0.0") + set(DUSK_VERSION_CODE "1") + endif () + + endif () + + # Add version information to CI environment variables + if (DEFINED ENV{GITHUB_ENV}) + file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n") + file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION_CODE=${DUSK_VERSION_CODE}\n") + endif () + message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}") +endmacro() + +# Sets PLATFORM_NAME and configures version.h into the caller's binary dir. +macro(configure_version_header) + if (CMAKE_SYSTEM_NAME STREQUAL Windows) + set(PLATFORM_NAME win32) + elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin) + if (IOS) + set(PLATFORM_NAME ios) + elseif (TVOS) + set(PLATFORM_NAME tvos) + else () + set(PLATFORM_NAME macos) + endif () + else () + string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME) + endif () + + configure_file(${_DUSK_VERSION_ROOT}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) +endmacro() diff --git a/cmake/GameABIConfig.cmake b/cmake/GameABIConfig.cmake new file mode 100644 index 0000000000..0b965aa082 --- /dev/null +++ b/cmake/GameABIConfig.cmake @@ -0,0 +1,64 @@ +# The game ABI surface shared by the main build and the mod SDK (sdk/CMakeLists.txt) +include_guard(GLOBAL) + +get_filename_component(_game_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) + +# PARTIAL_DEBUG makes debug and release share one struct/vtable ABI so a mod binary loads into either +set(_game_compile_defs TARGET_PC=1 WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1 PARTIAL_DEBUG=1) +if (ANDROID) + list(APPEND _game_compile_defs TARGET_ANDROID=1) +endif () + +# Public game headers +set(_game_abi_include_dirs + ${_game_root}/include + ${_game_root}/assets/GZ2E01 + ${_game_root}/libs/JSystem/include + ${_game_root}/extern/aurora/include/dolphin + ${_game_root}/extern/aurora/include + ${_game_root}/sdk/include +) + +# Internal game headers +set(_game_include_dirs + ${_game_abi_include_dirs} + ${_game_root}/src + ${_game_root}/extern + ${CMAKE_CURRENT_BINARY_DIR} +) + +# Mod API, including services +add_library(dusklight_mod_api INTERFACE) +target_include_directories(dusklight_mod_api INTERFACE ${_game_root}/sdk/include) + +# Full internal headers used to build the game +add_library(dusklight_game_headers INTERFACE) +target_include_directories(dusklight_game_headers INTERFACE ${_game_include_dirs}) +target_compile_definitions(dusklight_game_headers INTERFACE ${_game_compile_defs}) + +# Public game ABI for mods +add_library(dusklight_game_abi_headers INTERFACE) +target_include_directories(dusklight_game_abi_headers INTERFACE ${_game_abi_include_dirs}) +target_compile_definitions(dusklight_game_abi_headers INTERFACE ${_game_compile_defs}) + +# Mod feature targets +add_library(dusklight_mod_feature_game INTERFACE) +target_link_libraries(dusklight_mod_feature_game INTERFACE + dusklight_mod_api + dusklight_game_abi_headers) +target_compile_definitions(dusklight_mod_feature_game INTERFACE DUSK_MOD_FEATURE_GAME=1) +# Game headers assume global.h comes first in the translation unit (it defines DUSK_GAME_DATA +# and friends); force-include it so mods don't depend on include order. +if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") + target_compile_options(dusklight_mod_feature_game INTERFACE + "$<$:/FIglobal.h>") +else () + target_compile_options(dusklight_mod_feature_game INTERFACE + "$<$:SHELL:-include global.h>") +endif () +target_sources(dusklight_mod_feature_game INTERFACE + ${_game_root}/sdk/src/game_feature.cpp) + +add_library(dusklight_mod_feature_webgpu INTERFACE) +target_link_libraries(dusklight_mod_feature_webgpu INTERFACE dusklight_mod_api) +target_compile_definitions(dusklight_mod_feature_webgpu INTERFACE DUSK_MOD_FEATURE_WEBGPU=1) diff --git a/cmake/ModSDK.cmake b/cmake/ModSDK.cmake new file mode 100644 index 0000000000..10a87e8525 --- /dev/null +++ b/cmake/ModSDK.cmake @@ -0,0 +1,459 @@ +# add_mod( [FEATURES ...] SOURCES ... MOD_JSON +# [RUNTIME_LIBRARIES ...] [RES_DIR ] [OVERLAY_DIR ] +# [TEXTURES_DIR ] [OUTPUT_DIR ] [BUNDLE]) +set(DUSK_MODS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/mods" CACHE PATH "Directory to write mod packages into") +set(DUSKLIGHT_SDK_STUB_URL "https://github.com/encounter/dusklight/releases/download/sdk" + CACHE STRING "Base URL for game link stubs downloaded by out-of-tree mod builds") + +function(_mod_lib_info out_platform_var out_name_var) + set(_arch "${CMAKE_SYSTEM_PROCESSOR}") + if (APPLE AND CMAKE_OSX_ARCHITECTURES) + list(LENGTH CMAKE_OSX_ARCHITECTURES _count) + if (_count GREATER 1) + message(FATAL_ERROR "add_mod: universal binaries are not supported") + endif () + set(_arch "${CMAKE_OSX_ARCHITECTURES}") + elseif (WIN32) + set(_arch_id "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}") + if (NOT _arch_id) + set(_arch_id "${CMAKE_C_COMPILER_ARCHITECTURE_ID}") + endif () + if (_arch_id MATCHES "^ARM64(EC)?$") + set(_arch "arm64") + elseif (_arch_id STREQUAL "x64") + set(_arch "amd64") + elseif (_arch_id STREQUAL "X86") + set(_arch "x86") + endif () + endif () + string(TOLOWER "${CMAKE_SYSTEM_NAME}" _platform) + if (_platform STREQUAL "darwin") + set(_platform "macos") + endif () + string(TOLOWER "${_arch}" _arch) + if (_arch MATCHES "^(i[3-6]86|x86)$") + set(_arch "x86") + endif () + if (WIN32) + set(_ext ".dll") + else () + set(_ext ".so") + endif () + set(${out_platform_var} "${_platform}-${_arch}" PARENT_SCOPE) + set(${out_name_var} "mod${_ext}" PARENT_SCOPE) +endfunction() + +# For out-of-tree builds without a game binary: download the version-independent link stub +# (generated by symgen) for the target platform. +function(_mod_download_link_stub out_var) + _mod_lib_info(_platform _lib_name) + if (WIN32) + set(_asset "${_platform}.lib") + elseif (ANDROID) + set(_asset "stub-${_platform}.so") + else () + set(_asset "stub-${_platform}") + endif () + set(_stub "${CMAKE_BINARY_DIR}/dusklight-sdk-stubs/${_asset}") + if (NOT EXISTS "${_stub}") + message(STATUS "Mod SDK: downloading link stub ${_asset}") + file(DOWNLOAD "${DUSKLIGHT_SDK_STUB_URL}/${_asset}" "${_stub}.tmp" STATUS _status) + list(GET _status 0 _code) + if (NOT _code EQUAL 0) + list(GET _status 1 _error) + file(REMOVE "${_stub}.tmp") + message(FATAL_ERROR + "Mod SDK: failed to download ${DUSKLIGHT_SDK_STUB_URL}/${_asset}: ${_error}\n" + "Set DUSK_GAME_EXE to a game binary or link stub to skip the download.") + endif () + file(RENAME "${_stub}.tmp" "${_stub}") + endif () + set(${out_var} "${_stub}" PARENT_SCOPE) +endfunction() + +function(_mod_resolve_source_path out_var path) + if (IS_ABSOLUTE "${path}") + set(_path "${path}") + else () + set(_path "${CMAKE_CURRENT_SOURCE_DIR}/${path}") + endif () + set(${out_var} "${_path}" PARENT_SCOPE) +endfunction() + +function(_mod_collect_assets out_var dir) + if (NOT IS_DIRECTORY "${dir}") + message(FATAL_ERROR "add_mod: asset directory does not exist: ${dir}") + endif () + + file(GLOB_RECURSE _files CONFIGURE_DEPENDS LIST_DIRECTORIES false "${dir}/*") + # Dotfiles (.gitkeep, .DS_Store, ...) are not packaged; see CopyModAssets.cmake. + set(_assets "") + foreach (_file IN LISTS _files) + file(RELATIVE_PATH _rel "${dir}" "${_file}") + if (NOT _rel MATCHES "(^|/)\\.") + list(APPEND _assets "${_file}") + endif () + endforeach () + set(${out_var} ${_assets} PARENT_SCOPE) +endfunction() + +function(_mod_add_webgpu_headers target_name) + if (NOT TARGET dawn::dawncpp_headers AND NOT TARGET dawn::webgpu_dawn) + include("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../extern/aurora/cmake/AuroraDependencyVersions.cmake") + set(AURORA_DAWN_PROVIDER "package" CACHE STRING "How to provide Dawn for the mod SDK") + include("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../extern/aurora/cmake/AuroraDawnProvider.cmake") + endif () + + if (TARGET dawn::dawncpp_headers) + target_link_libraries(${target_name} PRIVATE dawn::dawncpp_headers) + elseif (TARGET dawn::webgpu_dawn) + target_link_libraries(${target_name} PRIVATE dawn::webgpu_dawn) + else () + message(FATAL_ERROR "add_mod: FEATURES webgpu could not provide WebGPU headers") + endif () +endfunction() + +function(add_mod target_name) + cmake_parse_arguments(ARG "BUNDLE" "MOD_JSON;RES_DIR;OVERLAY_DIR;TEXTURES_DIR;OUTPUT_DIR" + "SOURCES;RUNTIME_LIBRARIES;FEATURES" ${ARGN}) + if (ARG_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "add_mod: unknown arguments: ${ARG_UNPARSED_ARGUMENTS}") + endif () + if (NOT ARG_MOD_JSON) + message(FATAL_ERROR "add_mod: MOD_JSON is required") + endif () + _mod_resolve_source_path(_mod_json "${ARG_MOD_JSON}") + if (NOT EXISTS "${_mod_json}") + message(FATAL_ERROR "add_mod: MOD_JSON does not exist: ${_mod_json}") + endif () + + set(_supported_features game webgpu) + set(_features "") + foreach (_feature IN LISTS ARG_FEATURES) + list(FIND _supported_features "${_feature}" _feature_index) + if (_feature_index EQUAL -1) + list(JOIN _supported_features ", " _supported_features_text) + message(FATAL_ERROR + "add_mod: unknown feature '${_feature}' (supported: ${_supported_features_text})") + endif () + list(FIND _features "${_feature}" _duplicate_index) + if (NOT _duplicate_index EQUAL -1) + message(FATAL_ERROR "add_mod: duplicate feature '${_feature}'") + endif () + list(APPEND _features "${_feature}") + endforeach () + if (_features AND NOT ARG_SOURCES) + message(FATAL_ERROR "add_mod: FEATURES requires SOURCES") + endif () + + set(_has_lib FALSE) + set(_needs_host_link FALSE) + set(_lib_platform "") + set(_lib_name "") + if (ARG_SOURCES) + set(_has_lib TRUE) + add_library(${target_name} MODULE ${ARG_SOURCES}) + _mod_lib_info(_lib_platform _lib_name) + set_target_properties(${target_name} PROPERTIES + PREFIX "" + C_VISIBILITY_PRESET hidden + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON + WINDOWS_EXPORT_ALL_SYMBOLS OFF) + target_compile_features(${target_name} PRIVATE cxx_std_20) + target_link_libraries(${target_name} PRIVATE dusklight_mod_api) + foreach (_feature IN LISTS _features) + target_link_libraries(${target_name} PRIVATE dusklight_mod_feature_${_feature}) + if (_feature STREQUAL "webgpu") + _mod_add_webgpu_headers(${target_name}) + endif () + if (_feature STREQUAL "game" OR _feature STREQUAL "webgpu") + set(_needs_host_link TRUE) + endif () + endforeach () + + if (NOT TARGET dusklight) + # Apply global compile options for out-of-tree mod builds + if (CMAKE_SYSTEM_NAME STREQUAL Linux) + target_compile_options(${target_name} PRIVATE + -Wno-multichar -Wno-trigraphs -Wno-deprecated-declarations) + elseif (APPLE) + target_compile_options(${target_name} PRIVATE + -Wno-declaration-after-statement -Wno-non-pod-varargs) + elseif (MSVC) + target_compile_options(${target_name} PRIVATE + "$<$:/bigobj>" + "$<$:/utf-8>") + endif () + # Use signed char on ARM to match the original game (and x86) + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _mod_arch) + if (_mod_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") + target_compile_options(${target_name} PRIVATE -fsigned-char) + endif () + endif () + + if (APPLE) + if (_needs_host_link) + if (TARGET dusklight) + set(_game_exe "$") + add_dependencies(${target_name} dusklight) + elseif (DUSK_GAME_EXE) + _mod_resolve_source_path(_game_exe "${DUSK_GAME_EXE}") + else () + _mod_download_link_stub(_game_exe) + endif () + target_link_options(${target_name} PRIVATE + -Xlinker -bundle_loader -Xlinker "${_game_exe}") + set_property(TARGET ${target_name} APPEND PROPERTY LINK_DEPENDS "${_game_exe}") + endif () + set_target_properties(${target_name} PROPERTIES + BUILD_RPATH "@loader_path" + INSTALL_RPATH "@loader_path") + elseif (ANDROID) + if (_needs_host_link) + if (TARGET dusklight) + target_link_libraries(${target_name} PRIVATE dusklight) + else () + if (DUSK_GAME_EXE) + _mod_resolve_source_path(_game_lib "${DUSK_GAME_EXE}") + else () + _mod_download_link_stub(_game_lib) + endif () + target_link_libraries(${target_name} PRIVATE "${_game_lib}") + endif () + endif () + set_target_properties(${target_name} PROPERTIES + BUILD_RPATH "$ORIGIN" + INSTALL_RPATH "$ORIGIN") + elseif (UNIX) + if (_needs_host_link) + target_link_options(${target_name} PRIVATE -Wl,--allow-shlib-undefined) + endif () + set_target_properties(${target_name} PROPERTIES + BUILD_RPATH "$ORIGIN" + INSTALL_RPATH "$ORIGIN") + elseif (WIN32) + # Mods link against the game's import library (sdk/windows-.lib, generated by + # setup_windows_exports); cl and clang-cl both consume it in MSVC mode. Function + # calls resolve through import thunks; game data is reachable only through + # __declspec(dllimport), i.e. DUSK_GAME_DATA-annotated declarations. + if (_needs_host_link) + if (TARGET dusklight) + if (NOT DUSK_GAME_IMPLIB) + message(FATAL_ERROR + "add_mod: DUSK_GAME_IMPLIB is not set (see setup_windows_exports)") + endif () + set(_game_lib "${DUSK_GAME_IMPLIB}") + elseif (DUSK_GAME_EXE) + _mod_resolve_source_path(_game_lib "${DUSK_GAME_EXE}") + if (NOT _game_lib MATCHES "\\.lib$") + message(FATAL_ERROR + "add_mod: DUSK_GAME_EXE must be an import library on Windows " + "(sdk/windows-.lib)") + endif () + else () + _mod_download_link_stub(_game_lib) + endif () + target_link_libraries(${target_name} PRIVATE "${_game_lib}") + endif () + set_target_properties(${target_name} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreadedDLL") + target_compile_definitions(${target_name} PRIVATE _ITERATOR_DEBUG_LEVEL=0) + endif () + endif () + if (ARG_RUNTIME_LIBRARIES AND NOT _has_lib) + message(FATAL_ERROR "add_mod: RUNTIME_LIBRARIES requires SOURCES") + endif () + + set(_output_dir "${DUSK_MODS_OUTPUT_DIR}") + if (ARG_OUTPUT_DIR) + set(_output_dir "${ARG_OUTPUT_DIR}") + endif () + set(_stage "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_stage") + set(_out "${_output_dir}/${target_name}.dusk") + + set(_zip_args mod.json) + set(_package_deps "${_mod_json}") + set(_package_inputs "${_mod_json}") + set(_extra_cmds "") + set(_lib_copy_cmd "") + set(_target_depend "") + if (_has_lib) + list(APPEND _zip_args lib) + set(_lib_copy_cmd + COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}/lib/${_lib_platform}" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "$" "${_stage}/lib/${_lib_platform}/${_lib_name}") + set(_target_depend ${target_name}) + endif () + string(TOLOWER "${_lib_name}" _lib_name_key) + set(_runtime_lib_name_keys "${_lib_name_key}") + foreach (_runtime_lib IN LISTS ARG_RUNTIME_LIBRARIES) + _mod_resolve_source_path(_runtime_lib_path "${_runtime_lib}") + if (NOT EXISTS "${_runtime_lib_path}" OR IS_DIRECTORY "${_runtime_lib_path}") + message(FATAL_ERROR "add_mod: runtime library does not exist or is not a file: ${_runtime_lib_path}") + endif () + get_filename_component(_runtime_lib_name "${_runtime_lib_path}" NAME) + string(TOLOWER "${_runtime_lib_name}" _runtime_lib_name_key) + list(FIND _runtime_lib_name_keys "${_runtime_lib_name_key}" _runtime_lib_name_index) + if (NOT _runtime_lib_name_index EQUAL -1) + message(FATAL_ERROR "add_mod: duplicate runtime library filename: ${_runtime_lib_name}") + endif () + list(APPEND _runtime_lib_name_keys "${_runtime_lib_name_key}") + list(APPEND _package_deps "${_runtime_lib_path}") + list(APPEND _package_inputs "${_runtime_lib_path}") + list(APPEND _lib_copy_cmd COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${_runtime_lib_path}" "${_stage}/lib/${_lib_platform}/${_runtime_lib_name}") + endforeach () + if (ARG_RES_DIR) + _mod_resolve_source_path(_res_dir "${ARG_RES_DIR}") + _mod_collect_assets(_res_deps "${_res_dir}") + list(APPEND _package_deps ${_res_deps}) + list(APPEND _package_inputs "${_res_dir}" ${_res_deps}) + list(APPEND _zip_args res) + list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} "-DSRC=${_res_dir}" + "-DDST=${_stage}/res" -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CopyModAssets.cmake") + endif () + if (ARG_OVERLAY_DIR) + _mod_resolve_source_path(_overlay_dir "${ARG_OVERLAY_DIR}") + _mod_collect_assets(_overlay_deps "${_overlay_dir}") + list(APPEND _package_deps ${_overlay_deps}) + list(APPEND _package_inputs "${_overlay_dir}" ${_overlay_deps}) + list(APPEND _zip_args overlay) + list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} "-DSRC=${_overlay_dir}" + "-DDST=${_stage}/overlay" -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CopyModAssets.cmake") + endif () + if (ARG_TEXTURES_DIR) + _mod_resolve_source_path(_textures_dir "${ARG_TEXTURES_DIR}") + _mod_collect_assets(_textures_deps "${_textures_dir}") + list(APPEND _package_deps ${_textures_deps}) + list(APPEND _package_inputs "${_textures_dir}" ${_textures_deps}) + list(APPEND _zip_args textures) + list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} "-DSRC=${_textures_dir}" + "-DDST=${_stage}/textures" -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CopyModAssets.cmake") + endif () + + set(_bundle_cmds "") + if (ARG_BUNDLE AND TARGET dusklight) + file(READ "${_mod_json}" _mod_json_text) + string(JSON _mod_id GET "${_mod_json_text}" id) + set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_TARGETS "${target_name}") + set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_IDS "${_mod_id}") + set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_STAGES "${_stage}") + set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_PACKAGES "${_out}") + set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_LIB_PLATFORMS "${_lib_platform}") + set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_LIB_NAMES "${_lib_name}") + set(_bundle_cmds + COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bundled_mods" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_out}" "${CMAKE_BINARY_DIR}/bundled_mods/${target_name}.dusk") + endif () + + set(_package_target "${target_name}_package") + set(_package_inputs_file "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_package_inputs.txt") + list(SORT _package_inputs) + set(_package_inputs_text "") + foreach (_package_input IN LISTS _package_inputs) + string(APPEND _package_inputs_text "${_package_input}\n") + endforeach () + file(GENERATE OUTPUT "${_package_inputs_file}" CONTENT "${_package_inputs_text}") + add_custom_command(OUTPUT "${_out}" + COMMAND ${CMAKE_COMMAND} -E rm -rf "${_stage}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}" "${_output_dir}" + ${_lib_copy_cmd} + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_mod_json}" "${_stage}/mod.json" + ${_extra_cmds} + COMMAND ${CMAKE_COMMAND} -E chdir "${_stage}" ${CMAKE_COMMAND} -E tar cvf "${_out}" --format=zip ${_zip_args} + ${_bundle_cmds} + DEPENDS ${_target_depend} ${_package_deps} "${_package_inputs_file}" + COMMENT "Packaging ${target_name} -> ${_out}" + COMMAND_EXPAND_LISTS + VERBATIM + ) + add_custom_target(${_package_target} ALL DEPENDS "${_out}") + if (TARGET dusklight_mods) + add_dependencies(dusklight_mods ${_package_target}) + endif () +endfunction() + +# Install rules for BUNDLE mods. +# - Windows: the .dusk archives into /mods (the loader extracts native libs to the +# user cache). +# - Linux: pre-extracted stage dirs into /mods so native libs dlopen in place from +# read-only installs. +# - macOS: pre-extracted stage dirs into the installed app's Contents/Resources/mods, native +# libs ad-hoc signed in place, then the whole bundle re-signed. +# - iOS/tvOS: assets into /mods/, the mod library into Frameworks/.so, +# and runtime libraries alongside it. +# - Android: nothing here; gradle packs ${CMAKE_BINARY_DIR}/bundled_mods into APK assets. +function(install_bundled_mods) + get_property(_targets GLOBAL PROPERTY DUSK_BUNDLED_MOD_TARGETS) + if (NOT _targets OR ANDROID) + return () + endif () + get_property(_ids GLOBAL PROPERTY DUSK_BUNDLED_MOD_IDS) + get_property(_stages GLOBAL PROPERTY DUSK_BUNDLED_MOD_STAGES) + get_property(_lib_platforms GLOBAL PROPERTY DUSK_BUNDLED_MOD_LIB_PLATFORMS) + get_property(_lib_names GLOBAL PROPERTY DUSK_BUNDLED_MOD_LIB_NAMES) + list(LENGTH _targets _count) + math(EXPR _last "${_count} - 1") + + if (APPLE) + get_target_property(_app_name dusklight OUTPUT_NAME) + if (NOT _app_name) + set(_app_name dusklight) + endif () + set(_bundle_dir "${CMAKE_INSTALL_PREFIX}/${_app_name}.app") + if (IOS OR TVOS) + foreach (_i RANGE ${_last}) + list(GET _targets ${_i} _target) + list(GET _ids ${_i} _id) + list(GET _stages ${_i} _stage) + list(GET _lib_platforms ${_i} _lib_platform) + list(GET _lib_names ${_i} _lib_name) + install(DIRECTORY "${_stage}/" DESTINATION "${_bundle_dir}/mods/${_id}" + PATTERN "lib" EXCLUDE) + install(PROGRAMS "$" + DESTINATION "${_bundle_dir}/Frameworks" RENAME "${_id}.so") + install(DIRECTORY "${_stage}/lib/${_lib_platform}/" + DESTINATION "${_bundle_dir}/Frameworks" + PATTERN "${_lib_name}" EXCLUDE) + endforeach () + else () + foreach (_i RANGE ${_last}) + list(GET _ids ${_i} _id) + list(GET _stages ${_i} _stage) + list(GET _lib_platforms ${_i} _lib_platform) + list(GET _lib_names ${_i} _lib_name) + install(DIRECTORY "${_stage}/" DESTINATION "${_bundle_dir}/Contents/Resources/mods/${_id}") + install(CODE " + file(GLOB _mod_libs \"${_bundle_dir}/Contents/Resources/mods/${_id}/lib/${_lib_platform}/*\") + foreach (_mod_lib IN LISTS _mod_libs) + if (NOT IS_DIRECTORY \"\${_mod_lib}\") + execute_process(COMMAND /usr/bin/codesign --force --sign - \"\${_mod_lib}\" COMMAND_ERROR_IS_FATAL ANY) + endif () + endforeach ()") + endforeach () + if (TARGET crashpad_handler) + install(CODE "execute_process(COMMAND /usr/bin/codesign --force --sign - \"${_bundle_dir}/Contents/MacOS/$\" COMMAND_ERROR_IS_FATAL ANY)") + endif () + install(CODE "execute_process(COMMAND /usr/bin/codesign --force --sign - --entitlements \"${DUSK_ENTITLEMENTS}\" \"${_bundle_dir}\" COMMAND_ERROR_IS_FATAL ANY)") + endif () + return () + endif () + + if (DUSK_PACKAGE_INSTALL) + set(_mods_dest "${CMAKE_INSTALL_DATAROOTDIR}/dusklight/mods") + else () + set(_mods_dest "${CMAKE_INSTALL_PREFIX}/mods") + endif () + if (WIN32) + foreach (_target IN LISTS _targets) + install(FILES "${CMAKE_BINARY_DIR}/bundled_mods/${_target}.dusk" DESTINATION "${_mods_dest}") + endforeach () + else () + foreach (_i RANGE ${_last}) + list(GET _ids ${_i} _id) + list(GET _stages ${_i} _stage) + install(DIRECTORY "${_stage}/" DESTINATION "${_mods_dest}/${_id}") + endforeach () + endif () +endfunction() diff --git a/cmake/PatchCapstone.cmake b/cmake/PatchCapstone.cmake new file mode 100644 index 0000000000..fa8a1dd160 --- /dev/null +++ b/cmake/PatchCapstone.cmake @@ -0,0 +1,13 @@ +# Patches capstone's CMakeLists.txt for compatibility with CMake >= 4.0: +# - Bumps cmake_minimum_required to 3.10 (CMake >= 4.0 dropped < 3.5 support; < 3.10 warns) +# - Removes cmake_policy(SET CMP0048 OLD) (rejected by CMake >= 3.27) +file(READ "${DIR}/CMakeLists.txt" _content) +string(REGEX REPLACE + "cmake_minimum_required[ \t]*\\([ \t]*VERSION[ \t]+[0-9]+\\.[0-9]+(\\.[0-9]+)?[ \t]*\\)" + "cmake_minimum_required(VERSION 3.10)" + _content "${_content}") +string(REGEX REPLACE + "cmake_policy[ \t]*\\([ \t]*SET[ \t]+CMP0048[ \t]+OLD[ \t]*\\)" + "# cmake_policy(SET CMP0048 OLD)" + _content "${_content}") +file(WRITE "${DIR}/CMakeLists.txt" "${_content}") diff --git a/cmake/PatchFunchook.cmake b/cmake/PatchFunchook.cmake new file mode 100644 index 0000000000..6d5a6e36b4 --- /dev/null +++ b/cmake/PatchFunchook.cmake @@ -0,0 +1,60 @@ +file(READ "${SOURCE_DIR}/cmake/capstone.cmake.in" _content) + +# Insert PATCH_COMMAND before CONFIGURE_COMMAND in the ExternalProject_Add. +# Bracket args prevent cmake from substituting ${...} while writing this file. +string(REPLACE + " CONFIGURE_COMMAND \"\"" + [=[ PATCH_COMMAND "${CMAKE_COMMAND}" -DDIR=${CMAKE_CURRENT_BINARY_DIR}/capstone-src -P "${CAPSTONE_FIX_SCRIPT}" + CONFIGURE_COMMAND ""]=] + _content "${_content}") + +file(WRITE "${SOURCE_DIR}/cmake/capstone.cmake.in" "${_content}") + +file(READ "${SOURCE_DIR}/src/funchook_unix.c" _unix_content) + +# macOS rejects the POSIX mprotect RWX/RW transition for executable image pages on arm64. +# Use Mach VM_PROT_COPY for the short patch window, then restore RX permissions. +if (NOT _unix_content MATCHES "VM_PROT_READ \\| VM_PROT_WRITE \\| VM_PROT_COPY") + string(REPLACE + [=[ rv = mprotect(mstate->addr, mstate->size, prot);]=] + [=[#ifdef __APPLE__ + kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)mstate->addr, + (vm_size_t)mstate->size, FALSE, + VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY); + if (kr == KERN_SUCCESS) { + funchook_log(funchook, " unprotect memory %p (size=%"PRIuPTR", prot=read,write,copy) <- %p (size=%"PRIuPTR")\n", + mstate->addr, mstate->size, start, len); + return 0; + } + funchook_set_error_message(funchook, "Failed to unprotect memory %p (size=%"PRIuPTR", prot=read,write,copy) <- %p (size=%"PRIuPTR", error=%s)", + mstate->addr, mstate->size, start, len, + mach_error_string(kr)); + return FUNCHOOK_ERROR_MEMORY_FUNCTION; +#endif + rv = mprotect(mstate->addr, mstate->size, prot);]=] + _unix_content "${_unix_content}") + + string(REPLACE + [=[ char errbuf[128]; + int rv = mprotect(mstate->addr, mstate->size, PROT_READ | PROT_EXEC);]=] + [=[ char errbuf[128]; +#ifdef __APPLE__ + kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)mstate->addr, + (vm_size_t)mstate->size, FALSE, + VM_PROT_READ | VM_PROT_EXECUTE); + + if (kr == KERN_SUCCESS) { + funchook_log(funchook, " protect memory %p (size=%"PRIuPTR", prot=read,exec)\n", + mstate->addr, mstate->size); + return 0; + } + funchook_set_error_message(funchook, "Failed to protect memory %p (size=%"PRIuPTR", prot=read,exec, error=%s)", + mstate->addr, mstate->size, + mach_error_string(kr)); + return FUNCHOOK_ERROR_MEMORY_FUNCTION; +#endif + int rv = mprotect(mstate->addr, mstate->size, PROT_READ | PROT_EXEC);]=] + _unix_content "${_unix_content}") +endif () + +file(WRITE "${SOURCE_DIR}/src/funchook_unix.c" "${_unix_content}") diff --git a/cmake/SymbolManifest.cmake b/cmake/SymbolManifest.cmake new file mode 100644 index 0000000000..657afa2a78 --- /dev/null +++ b/cmake/SymbolManifest.cmake @@ -0,0 +1,128 @@ +include_guard(GLOBAL) + +get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) + +set(_SYMGEN_VERSION "1.2.3") +set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}") +set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release") +mark_as_advanced(SYMGEN_PATH) + +function(symgen_host_asset out_name) + string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" _host_processor) + set(_asset "") + + if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + if (_host_processor MATCHES "^(arm64|aarch64)$") + set(_asset "symgen-macos-arm64") + elseif (_host_processor MATCHES "^(x86_64|amd64)$") + set(_asset "symgen-macos-x86_64") + endif () + elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + if (_host_processor MATCHES "^(aarch64|arm64)$") + set(_asset "symgen-linux-aarch64") + elseif (_host_processor MATCHES "^(x86_64|amd64)$") + set(_asset "symgen-linux-x86_64") + elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") + set(_asset "symgen-linux-i686") + endif () + elseif (CMAKE_HOST_WIN32) + if (_host_processor MATCHES "^(arm64|aarch64)$") + set(_asset "symgen-windows-arm64.exe") + elseif (_host_processor MATCHES "^(x86_64|amd64)$") + set(_asset "symgen-windows-x86_64.exe") + elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") + set(_asset "symgen-windows-x86.exe") + endif () + endif () + + set(${out_name} "${_asset}" PARENT_SCOPE) +endfunction() + +function(ensure_symgen required) + if (TARGET symgen) + return() + endif () + + if (SYMGEN_PATH) + get_filename_component(_symgen "${SYMGEN_PATH}" ABSOLUTE) + if (NOT EXISTS "${_symgen}") + if (required) + message(FATAL_ERROR "symgen: SYMGEN_PATH does not exist: ${_symgen}") + endif () + message(STATUS "symgen: SYMGEN_PATH does not exist, symbol manifest generation " + "skipped (by-name hook resolution will be unavailable)") + return() + endif () + else () + symgen_host_asset(_asset) + if (_asset STREQUAL "") + if (required) + message(FATAL_ERROR "symgen: no prebuilt binary for host " + "${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR} " + "(configure with -DDUSK_ENABLE_CODE_MODS=OFF)") + endif () + message(STATUS "symgen: no prebuilt binary for host " + "${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR}; " + "symbol manifest generation skipped (by-name hook resolution will be unavailable)") + return() + endif () + + set(_symgen_dir "${CMAKE_BINARY_DIR}/_deps/symgen") + set(_symgen "${_symgen_dir}/${_asset}") + set(_url "${_SYMGEN_RELEASE_BASE_URL}/${_asset}") + message(STATUS "dusklight: Fetching symgen ${_SYMGEN_VERSION} (${_asset})") + file(MAKE_DIRECTORY "${_symgen_dir}") + file(DOWNLOAD "${_url}" "${_symgen}" + TLS_VERIFY ON + STATUS _download_status + SHOW_PROGRESS) + list(GET _download_status 0 _download_code) + if (NOT _download_code EQUAL 0) + list(GET _download_status 1 _download_message) + file(REMOVE "${_symgen}") + if (required) + message(FATAL_ERROR "symgen: failed to download ${_url}: ${_download_message}") + endif () + message(STATUS "symgen: failed to download ${_url}: ${_download_message}; " + "symbol manifest generation skipped (by-name hook resolution will be unavailable)") + return() + endif () + if (NOT CMAKE_HOST_WIN32) + file(CHMOD "${_symgen}" PERMISSIONS + OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + endif () + endif () + + add_custom_target(symgen DEPENDS "${_symgen}") + set(SYMGEN_EXE "${_symgen}" CACHE INTERNAL "symgen executable" FORCE) +endfunction() + +function(setup_symbol_manifest target) + ensure_symgen(TRUE) + if (NOT TARGET symgen) + return() + endif () + add_dependencies(${target} symgen) + + if (WIN32) + set(_input --pdb "$") + else () + set(_input --binary "$") + endif () + + if (APPLE) + # Room for the load command `symgen manifest --embed` inserts post-link. + target_link_options(${target} PRIVATE "LINKER:-headerpad,0x200") + endif () + + # The manifest is embedded into the image as a new section, located at runtime through + # the descriptor manifest.cpp reserves. On Apple platforms this command must stay + # attached before the ad-hoc codesign POST_BUILD command: the patch invalidates any + # existing signature. + add_custom_command(TARGET ${target} POST_BUILD + COMMAND "${SYMGEN_EXE}" manifest ${_input} --embed "$" + COMMENT "Embedding symbol manifest" + VERBATIM) +endfunction() diff --git a/cmake/WindowsExports.cmake b/cmake/WindowsExports.cmake new file mode 100644 index 0000000000..4596ac7b69 --- /dev/null +++ b/cmake/WindowsExports.cmake @@ -0,0 +1,93 @@ +include_guard(GLOBAL) + +get_filename_component(_DUSK_WINDOWS_EXPORTS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) + +# Windows mod linking: generate the curated export surface for the game executable and the +# import library mods link against. symgen scans the built objects, filters by source, and +# writes a .def used by the main link and import library generation. +function(setup_windows_exports target) + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _implib_arch) + if (_implib_arch STREQUAL "arm64") + set(_dlltool_machine "arm64") + set(_lib_machine "arm64") + elseif (_implib_arch MATCHES "^(amd64|x86_64)$") + set(_dlltool_machine "i386:x86-64") + set(_lib_machine "x64") + else () + message(FATAL_ERROR + "dusklight: no Windows mod linking support for ${CMAKE_SYSTEM_PROCESSOR}") + endif () + + include("${_DUSK_WINDOWS_EXPORTS_CMAKE_DIR}/SymbolManifest.cmake") + ensure_symgen(TRUE) + set(_symgen "${SYMGEN_EXE}") + add_dependencies(${target} symgen) + + set(_config_subdir "") + if (CMAKE_CONFIGURATION_TYPES) + set(_config_subdir "$/") + endif () + + set(_rsp_lines "$") + foreach (_lib IN LISTS JSYSTEM_LIBRARIES) + list(APPEND _rsp_lines "$") + endforeach () + list(JOIN _rsp_lines "\n" _rsp_content) + set(_rsp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports_input.rsp") + file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}") + + set(_sdk_args) + foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx + aurora_os aurora_pad aurora_si aurora_vi) + if (TARGET ${_lib}) + list(APPEND _sdk_args --sdk-lib "$") + endif () + endforeach () + + set(_forward_args) + if (TARGET dawn::webgpu_dawn) + get_target_property(_dawn_type dawn::webgpu_dawn TYPE) + if (_dawn_type STREQUAL "SHARED_LIBRARY") + list(APPEND _forward_args + --forward-dll "$" + --forward-sym-prefix wgpu) + endif () + endif () + + # Generate curated exports list from the main binary + set(_def "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports.def") + add_custom_command(TARGET ${target} PRE_LINK + COMMAND "${_symgen}" def + "@${_rsp}" + --out "${_def}" + --exclude cmake_pch + --exclude miniz + --exclude asan_options + --exclude src/dusk + --max-exports 58000 + ${_sdk_args} + ${_forward_args} + COMMENT "Generating dusklight exports" + VERBATIM) + target_link_options(${target} PRIVATE "/DEF:${_def}") + + # Generate import library for mods to link against. + set(_implib "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_imports.lib") + get_filename_component(_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY) + find_program(DUSK_LLVM_DLLTOOL llvm-dlltool HINTS "${_compiler_dir}") + if (DUSK_LLVM_DLLTOOL) + set(_implib_cmd "${DUSK_LLVM_DLLTOOL}" -d "${_def}" -D dusklight.exe + -m "${_dlltool_machine}" -l "${_implib}") + else () + set(_implib_cmd "${CMAKE_AR}" /nologo "/def:${_def}" "/machine:${_lib_machine}" + /name:dusklight.exe "/out:${_implib}") + endif () + add_custom_command(TARGET ${target} POST_BUILD + COMMAND ${_implib_cmd} + BYPRODUCTS "${_implib}" + COMMENT "Generating dusklight import library" + VERBATIM) + set(DUSK_GAME_IMPLIB "${_implib}" CACHE INTERNAL "Import library for Windows mod linking") + + install(FILES "${_implib}" DESTINATION sdk RENAME "windows-${_implib_arch}.lib") +endfunction() diff --git a/cmake/WindowsTargetProcessor.cmake b/cmake/WindowsTargetProcessor.cmake new file mode 100644 index 0000000000..0fba82add5 --- /dev/null +++ b/cmake/WindowsTargetProcessor.cmake @@ -0,0 +1,9 @@ +if (CMAKE_SYSTEM_NAME STREQUAL "Windows") + if (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64" OR CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC") + set(CMAKE_SYSTEM_PROCESSOR "ARM64") + elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "x64") + set(CMAKE_SYSTEM_PROCESSOR "AMD64") + elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "X86") + set(CMAKE_SYSTEM_PROCESSOR "X86") + endif () +endif () diff --git a/docs/building.md b/docs/building.md index 1001c42788..31222df414 100644 --- a/docs/building.md +++ b/docs/building.md @@ -1,50 +1,164 @@ -### Building -#### Prerequisites +# Building Dusklight + +## Dependencies + +The following dependencies are required: + * [CMake 3.25+](https://cmake.org) - * Windows: Install `CMake Tools` in Visual Studio - * macOS: `brew install cmake` * [Python 3+](https://python.org) - * Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640) - * Verify it's added to `%PATH%` by typing `python` in `cmd`. - * macOS: `brew install python@3` -* **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx) - * Select `C++ Development` and verify the following packages are included: - * `Windows 11 SDK` - * `CMake Tools` - * `C++ Clang Compiler` - * `C++ Clang-cl` -* **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/) -* **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives. - * Ubuntu 24.04+ packages - ``` - build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \ - libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \ - libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \ - libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \ - libxss-dev libxtst-dev - ``` - * Arch Linux packages - ``` - base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2 - ``` - * Fedora packages - ``` - cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel - ``` - * It's also important that you install the developer tools and libraries - ``` - sudo dnf groupinstall "Development Tools" "Development Libraries" - ``` -#### Setup -Clone and initialize the Dusklight repository + +### Windows + +* Install [CMake 3.25+](https://cmake.org) by searching `CMake Tools` in Visual Studio +* Install Python 3 from the [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640) and verify it's added to `%PATH%` by typing `python` in `cmd`. + +Recommended IDEs: + +* [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx). During installation: + * Select `C++ Development` and verify the following packages are included: + * `Windows 11 SDK` + * `CMake Tools` + * `C++ Clang Compiler` + * `C++ Clang-cl` + +### macOS + +* Make sure [Homebrew](https://brew.sh) is installed +* Install [CMake 3.25+](https://cmake.org) + ```sh -git clone --recursive https://github.com/TwilitRealm/dusklight.git -cd dusklight -git pull -git submodule update --init --recursive +brew install cmake ``` -#### Building +* Install Python 3 + +```sh +brew install python@3 +``` + +Recommended IDEs: + +* [Xcode 16.4 or later](https://developer.apple.com/xcode/) +* [Visual Studio Code](https://code.visualstudio.com/download/) +* [CLion](https://www.jetbrains.com/clion/) + +### Linux + +Actively tested on Ubuntu 24.04, Arch Linux & derivatives. + +**Ubuntu 24.04+ packages** + +
+Click to expand + +* Run the following command to install the required dependencies: + +```sh +sudo apt update && sudo apt install -y \ + build-essential \ + clang \ + cmake \ + curl \ + git \ + libasound2-dev \ + libclang-dev \ + libcurl4-openssl-dev \ + libdbus-1-dev \ + libfreetype-dev \ + libglu1-mesa-dev \ + libgtk-3-dev \ + libncurses5-dev \ + libpng-dev \ + libpulse-dev \ + libudev-dev \ + libvulkan-dev \ + libx11-xcb-dev \ + libxcursor-dev \ + libxi-dev \ + libxinerama-dev \ + libxrandr-dev \ + libxss-dev \ + libxtst-dev \ + lld \ + ninja-build \ + python-is-python3 \ + python3 \ + python3-markupsafe \ + zlib1g-dev +``` + +
+
+ +**Arch Linux packages** + +
+Click to expand + +* Run the following command to install the required dependencies: + +```sh +sudo pacman -S --needed \ + alsa-lib \ + base-devel \ + clang \ + cmake \ + freetype2 \ + libpulse \ + libxrandr \ + lld \ + llvm \ + ninja \ + python \ + python-markupsafe \ + vulkan-headers +``` + +
+
+ +**Fedora packages** + +
+Click to expand + +* Run the following command to install the required dependencies: + +```sh +sudo dnf install -y \ + clang-devel \ + cmake \ + libpng-devel \ + llvm-devel \ + ninja-build \ + vulkan-headers +``` + +* It's also important that you install the developer tools and libraries + +```sh +sudo dnf groupinstall \ + "Development Libraries" "Development Tools" +``` + +
+
+ +Recommended IDEs: + +* [CLion](https://www.jetbrains.com/clion/) +* [Visual Studio Code](https://code.visualstudio.com/download/) + +## Building + +* Clone and initialize the Dusklight repository: + +```sh +git clone --recursive https://github.com/TwilitRealm/dusklight.git +git pull +cd dusklight +git submodule update --init --recursive +``` **CLion (Windows / macOS / Linux)** @@ -64,7 +178,9 @@ cmake --build --preset macos-default-relwithdebinfo ``` Alternate presets available: -- `macos-default-debug`: Clang, Debug + +* `macos-default-debug`: Clang, Debug +* `macos-default-debug-asan`: Clang, Debug, AddressSanitizer **ninja (Linux)** @@ -74,9 +190,12 @@ cmake --build --preset linux-default-relwithdebinfo ``` Alternate presets available: -- `linux-default-debug`: GCC, Debug -- `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo -- `linux-clang-debug`: Clang, Debug + +* `linux-default-debug`: GCC, Debug +* `linux-default-debug-asan`: GCC, Debug, AddressSanitizer +* `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo +* `linux-clang-debug`: Clang, Debug +* `linux-clang-debug-asan`: Clang, Debug, AddressSanitizer **ninja (Windows)** @@ -86,13 +205,28 @@ cmake --build --preset windows-msvc-relwithdebinfo ``` Alternate presets available: -- `windows-msvc-debug`: MSVC, Debug -- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo -- `windows-clang-debug`: Clang-cl, Debug -#### Running -Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ +* `windows-msvc-debug`: MSVC, Debug +* `windows-msvc-debug-asan`: MSVC, Debug, AddressSanitizer +* `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo +* `windows-clang-debug`: Clang-cl, Debug + +## Running + +**Windows / Linux** + +* Pass the disc image as a positional argument using the `--dvd` flag. Supported formats are: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ + ```sh -build/{preset}/dusklight/path/to/game.rvz +build/{preset}/dusklight --dvd /path/to/game.iso +``` + +**macOS** + +macOS builds an `.app` bundle which contains the executable and all necessary resources. + +* Pass the disc image as a positional argument using the `--dvd` flag. Supported formats are: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ + +```sh +build/{preset}/Dusklight.app/Contents/MacOS/Dusklight --dvd /path/to/game.iso ``` -If no path is specified, Dusklight defaults to `game.iso` in the current working directory. diff --git a/docs/ios-install-altstore.md b/docs/ios-install-altstore.md index c82bfec5c3..5c0f071878 100644 --- a/docs/ios-install-altstore.md +++ b/docs/ios-install-altstore.md @@ -4,10 +4,10 @@ - A Windows, Linux, or macOS device - iOS device connected to computer via USB -- Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusk/releases)) -- Game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL) +- Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases)) +- Legally acquired game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL) -## 1. Install AltServer +## 1. Install iloader - Executable bundles can be installed from [iloader's main page](https://iloader.app/) or [their GitHub](https://github.com/nab138/iloader) for Windows, Linux, and macOS. - Windows WILL require iTunes to be installed @@ -16,21 +16,21 @@ ## 2. Enable Developer Mode (iOS 16+) - On your iPhone, go to **Settings > Privacy & Security > Developer Mode** -- Toggle it on and restart when prompted +- Toggle it on, put in your device passcode, and restart when prompted ## 3. Install Dusklight on Your iPhone -1. Sign into your Apple ID (this is required for registering app IDs, it is sent securely and not stored by iloader) - * You may be prompted to put in a code from your iOS device, do so +1. Sign into your Apple ID (this is required for registering app IDs, it is sent securely directly to Apple and not stored by iloader) + * You may be prompted to put in a code from your iOS device if you have 2FA enabled, do so 2. Plug in your iOS device via USB into your PC. If you're missing a dependency, an error pop-up will tell you to install it * You will need to hit `Refresh` after plugging it in at this stage so that it can be detected, it does not automatically refresh 3. Leave settings unchanged (the Anisette server should stay Sidestore (.io)) 3.(a) Installing SideStore directly is not required, but provides you a way to install Dusklight on your phone without being plugged into a computer later -4. Press `Import IPA` and choose your downloaded `Dusk-v.X.X.X-ios-arm64.ipa`, it will begin installing on your device +4. Press `Import IPA` and choose your downloaded `Dusklight-v.X.X.X-ios-arm64.ipa`, it will begin installing on your device **NOTE:** *At various stages, you may be prompted to trust your device, do so* -## 3. Getting Dusk trusted +## 3. Getting Dusklight trusted When installing sideloaded iOS applications, at first you will need to manually trust the app due to Apple's security policies * Go to **Settings > General > VPN & Device Management** * Tap the Apple ID you signed into iloader with under "Developer App" and tap **Trust** @@ -38,11 +38,11 @@ When installing sideloaded iOS applications, at first you will need to manually ## 4. Copy Files to Your iPhone -Transfer the IPA and game disc to your iPhone so they're accessible in the Files app. A few ways to do this: +Transfer the game disc (and optionally, the Dusklight IPA) to your iPhone so they are accessible in the Files app. A few ways to do this: - **AirDrop** - Right-click the files on your Mac and choose Share > AirDrop - **iCloud Drive** - Place files in iCloud Drive on your Mac and they'll sync to Files on your iPhone - **USB transfer** - Connect your iPhone and drag files via Finder's sidebar - **Cloud storage** - Upload to Google Drive, Dropbox, etc. and download on your iPhone -You may now use Dusklight on iOS, iPadOS! \ No newline at end of file +You may now use Dusklight on iOS and iPadOS! \ No newline at end of file diff --git a/docs/modding.md b/docs/modding.md new file mode 100644 index 0000000000..2600b4721d --- /dev/null +++ b/docs/modding.md @@ -0,0 +1,778 @@ +# Dusklight Mod API + +Mods are `.dusk` bundles: zip archives that can contain code (in the form of native libraries), resources, DVD overlay +files, and texture replacements. Mods may be enabled, disabled and reloaded at runtime. + +When code mods are loaded, they get dynamically linked by the operating system to the running game process. The mod +exports lifecycle functions that Dusklight calls into (`mod_initialize`, `mod_update`, `mod_shutdown`), and the mod +communicates with the host via **services**: plain C APIs, individually versioned. Dusklight exports several built-in +services, and mods may export services of their own, permitting framework mods and cross-mod integration. + +Beyond services, mods have full access to the original game's code: include game headers, call directly into any public +function, read and write data fields, and hook the vast majority of game functions. + +## Table of Contents + +1. [Getting Started](#getting-started) +2. [mod.json](#modjson) +3. [Anatomy of a Code Mod](#anatomy-of-a-code-mod) +4. [Services](#services) +5. [Built-in Services](#built-in-services) +6. [Hooking Game Functions](#hooking-game-functions) +7. [Asset Overlays](#asset-overlays) +8. [Runtime Lifecycle](#runtime-lifecycle) +9. [Error Handling](#error-handling) +10. [Advanced](#advanced) + +--- + +## Getting Started + +Fork the [mod template](https://github.com/TwilitRealm/mod-template), a self-contained CMake project that uses the +Dusklight mod SDK. + +``` +my_mod/ +├── CMakeLists.txt +├── mod.json +├── src/mod.cpp +├── res/ (optional bundled resources) +├── overlay/ (optional game file overrides) +└── textures/ (optional texture replacements) +``` + +**CMakeLists.txt:** + +```cmake +cmake_minimum_required(VERSION 3.26) +project(my_mod CXX) + +if (NOT DUSKLIGHT_VERSION) + set(DUSKLIGHT_VERSION "76b56cd8b81809fce0a5c2a44e2f6d437591132f") +endif () +include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/FetchDusklight.cmake") +add_subdirectory("${DUSKLIGHT_DIR}/sdk" dusklight-sdk EXCLUDE_FROM_ALL) + +add_mod(my_mod + FEATURES game # remove for service/asset-only mods; add webgpu for GfxService + SOURCES src/mod.cpp + MOD_JSON mod.json + RES_DIR res # mod resources, including icon.png and banner.png + OVERLAY_DIR overlay # game file overlays; remove if unused + TEXTURES_DIR textures # texture replacements; remove if unused +) +``` + +Available features: +- `game`: Allows calling into and hooking game code. Mods that **only** use services may omit it, providing a wider + range of compatibility with Dusklight versions and a slightly faster build process. +- `webgpu`: Allows importing the WebGPU API (`webgpu/webgpu.h`). Must be enabled when using + [GfxService](#gfxservice-modssvcgfxh). + +Building produces `my_mod.dusk` in `build/mods/`. Copy the `.dusk` into the user mods folder: + +- Windows: `%APPDATA%\TwilitRealm\Dusklight\mods` +- Linux: `~/.local/share/TwilitRealm/Dusklight/mods` +- macOS: `~/Library/Application Support/TwilitRealm/Dusklight/mods` + +Passing `--mods ` on the command line replaces the user directory with one of your choosing. + +--- + +## mod.json + +```json +{ + "id": "com.example.my_mod", + "name": "My Mod", + "version": "1.0.0", + "author": "Your Name", + "description": "A short description shown in the mod manager.", + "icon": "res/my_icon.png", + "banner": "res/my_banner.png" +} +``` + +`id` is required: a unique, stable identifier (reverse-DNS style; periods, underscores, and alphanumerics). Everything +else is optional but recommended. + +`icon` and `banner` are bundle-relative paths to PNG images for the in-game mod manager: the square icon (e.g. +512x512), the banner (~3.5:1). If omitted, `res/icon.png` and `res/banner.png` are used automatically when present. + +--- + +## Anatomy of a Code Mod + +```cpp +#include "mods/service.hpp" +#include "mods/svc/log.h" + +DEFINE_MOD(); // once, in exactly one translation unit +IMPORT_SERVICE(LogService, svc_log); // resolved by the loader before mod_initialize + +extern "C" { + +MOD_EXPORT ModResult mod_initialize(ModError* error) { + svc_log->info(mod_ctx, "hello from my_mod"); + return MOD_OK; +} + +MOD_EXPORT ModResult mod_update(ModError* error) { // called every frame + return MOD_OK; +} + +MOD_EXPORT ModResult mod_shutdown(ModError* error) { + return MOD_OK; +} +} +``` + +All three lifecycle exports are required. `mod_ctx` is your mod's identity token, set by the loader before +`mod_initialize` runs. Pass it as the first argument to every service call. + +--- + +## Services + +A service is a struct of C function pointers with a version header. You declare what you use at file scope, and the +loader resolves it before your mod initializes: + +```cpp +IMPORT_SERVICE(LogService, svc_log); // required, latest minor version +IMPORT_SERVICE_VERSION(LogService, svc_log, 0); // required, minimum minor version 0 (for backwards compatibility) +IMPORT_OPTIONAL_SERVICE(SomeService, svc_maybe); // may be null +``` + +Each service is individually versioned, and there may be multiple major versions of a service provided at once, +allowing backwards compatibility with older mods while still changing services fundamentally if necessary. A **major** +bump is a breaking change, treated as a different service entirely. For **additive** changes, a service appends new +functions to the end of the struct without breaking existing callers and simply bumps the minor version. + +`IMPORT_SERVICE` and `IMPORT_OPTIONAL_SERVICE` require the latest minor version compiled against, making every field in +the service safe to call. A mod can use `IMPORT_SERVICE_VERSION` (or its optional counterpart) with an older minor +version to remain compatible with older Dusklight versions, then use `SERVICE_HAS` to check at runtime for fields added +after that explicitly requested version. + +The contract (see `sdk/include/mods/api.h` for the full version): + +- **A required import is guaranteed valid.** If the service is missing or too old, the mod fails to load with a clear + error. No need to null check at call sites. +- **Anything at or below the minor version you imported can be called unconditionally.** The default macros import + the service type's current minor version; the versioned macros explicitly override that minimum. +- Optional imports may be null; check once in `mod_initialize`. +- Fields newer than your imported minor version must be gated behind `SERVICE_HAS(service, ServiceType, field)` plus a + null check. + +--- + +## Built-in Services + +### LogService (`mods/svc/log.h`) + +```cpp +IMPORT_SERVICE(LogService, svc_log); + +svc_log->info(mod_ctx, "spawned the thing"); +svc_log->warn(mod_ctx, "that looks wrong"); +svc_log->error(mod_ctx, "very bad"); +svc_log->write(mod_ctx, LOG_LEVEL_DEBUG, "verbose details"); +``` + +Messages appear in the console prefixed with your mod ID. Messages are plain UTF-8 strings and are copied before the +call returns; use `snprintf` or `fmt::format` for formatting. + +### ResourceService (`mods/svc/resource.h`) + +Loads files from the `res/` tree of your `.dusk` archive. Paths are relative to `res/` (pass `"config.txt"`, not +`"res/config.txt"`); absolute paths and `..` are rejected. + +```cpp +IMPORT_SERVICE(ResourceService, svc_resource); + +ResourceBuffer buf = RESOURCE_BUFFER_INIT; +if (svc_resource->load(mod_ctx, "config.txt", &buf) == MOD_OK) { + // buf.data / buf.size + svc_resource->free(mod_ctx, &buf); +} +``` + +Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. Note that the bundle is read-only; for writable +storage, use the directory from `svc_host->mod_dir(mod_ctx)`. + +### HostService (`mods/svc/host.h`) + +Mod metadata and runtime interaction with the loader: + +```cpp +IMPORT_SERVICE(HostService, svc_host); + +const char* id = svc_host->mod_id(mod_ctx); +const char* dir = svc_host->mod_dir(mod_ctx); // writable per-mod directory +svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened"); // disables the mod +``` + +`get_service`/`publish_service` provide dynamic service lookup; see [Exporting Services](#exporting-services). + +**Lifecycle watches.** If your mod provides a service that hands out per-caller state (registrations, callbacks, +handles), watch other mods' lifecycle and drop what you hold for a mod when it detaches. + +```cpp +IMPORT_SERVICE(HostService, svc_host); + +void on_mod_lifecycle(ModContext* ctx, ModContext* subject, const char* subject_id, + ModLifecycleEvent event, void* user_data) { + if (event == MOD_LIFECYCLE_DETACHED) { + drop_state_for(subject); // same ModContext* the subject passed into your service + } +} + +uint64_t watch = 0; +svc_host->watch_mod_lifecycle(mod_ctx, on_mod_lifecycle, nullptr, &watch); +``` + +`MOD_LIFECYCLE_DETACHED` fires on the game thread at a lifecycle safe point, after the subject's `mod_shutdown` ran and +every service dropped its state. For your own mod's teardown, use `mod_shutdown` instead. + +### HookService (`mods/svc/hook.h`) + +Installs hooks on game functions and resolves symbols by name. You'll rarely call it directly; use the typed helpers in +`mods/hook.hpp` described in [Hooking Game Functions](#hooking-game-functions). + +### OverlayService (`mods/svc/overlay.h`) + +Registers DVD file overlays at runtime: the dynamic counterpart to the static `overlay/` directory (see +[Asset Overlays](#asset-overlays)). Overlay a disc path with a file from your bundle, or with a caller-owned buffer +(copied on registration): + +```cpp +IMPORT_SERVICE(OverlayService, svc_overlay); + +OverlayHandle handle = 0; +svc_overlay->add_file(mod_ctx, "/res/Msgus.arc", "res/replacement.arc", &handle); +svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr); +svc_overlay->remove(mod_ctx, handle); +``` + +`disc_path` must be absolute (leading `/`) and is matched against the disc case-insensitively. Paths that don't exist +on the disc are added as new files. Changes are applied at the next frame boundary, and data the game already read +stays in memory until the file is re-read: sometimes a scene reload, and in the worst case, a full restart. + +See [Asset Overlays](#asset-overlays) for priority and conflict handling. + +### TextureService (`mods/svc/texture.h`) + +Registers texture replacements at runtime: the dynamic counterpart to the static `textures/` directory (see +[Asset Overlays](#asset-overlays)). Two forms: raw texel data with an explicit key, or an encoded `.dds`/`.png` from +your bundle whose filename encodes the key: + +```cpp +IMPORT_SERVICE(TextureService, svc_texture); + +// Encoded file; filename follows the replacement naming convention. +TextureReplacementHandle handle = 0; +svc_texture->register_file(mod_ctx, "res/tex1_32x32_$_6.png", &handle); + +// Raw data: match by texel-data pointer or by content hash (TEXTURE_KEY_SOURCE). +TextureKey key = TEXTURE_KEY_INIT; +key.kind = TEXTURE_KEY_POINTER; +key.pointer = someTexObj.data; +TextureData data = TEXTURE_DATA_INIT; +data.data = pixels; data.size = pixelsSize; +data.width = 32; data.height = 32; data.gx_format = GX_TF_RGBA8_PC; +svc_texture->register_data(mod_ctx, &key, &data, nullptr); + +svc_texture->unregister(mod_ctx, handle); +``` + +Filenames use the same Dolphin-style convention as the user's `texture_replacements` directory: +`tex1_{w}x{h}_{texhash}[_{tluthash}]_{fmt}.dds|.png`, where hashes may be `$` (wildcard). `_mipN` sidecar files next to +a registered file are picked up automatically. Files are decoded lazily on first use by the renderer; raw data is copied +at registration. Registrations follow your mod's lifecycle. + +See [Asset Overlays](#asset-overlays) for priority and conflict handling. + +### ConfigService (`mods/svc/config.h`) + +Persistent, mod-scoped configuration variables. Each var is stored in the user's `config.json` under +`mod..` (escaping: `.` → `_`, `_` → `__`, so `com.example.my_mod` becomes `com_example_my__mod`), +next to the host's own settings: + +```cpp +IMPORT_SERVICE(ConfigService, svc_config); + +ConfigVarDesc desc = CONFIG_VAR_DESC_INIT; +desc.name = "speedMultiplier"; // 1-64 chars from [A-Za-z0-9_-]; "enabled" is reserved +desc.type = CONFIG_VAR_FLOAT; +desc.default_float = 1.0; +ConfigVarHandle var = 0; +svc_config->register_var(mod_ctx, &desc, &var); + +double speed = 1.0; +svc_config->get_float(mod_ctx, var, &speed); +svc_config->set_float(mod_ctx, var, 2.0); + +// Optional: get notified when the value changes. +void on_speed_changed(ModContext* ctx, ConfigVarHandle var, const ConfigVarValue* value, + const ConfigVarValue* previous, void* user_data) { + /* value->float_value is the new value, previous->float_value the old one */ +} +svc_config->subscribe(mod_ctx, var, on_speed_changed, nullptr, nullptr); +``` + +Types: `CONFIG_VAR_BOOL` (`bool`), `CONFIG_VAR_INT` (`int64_t`), `CONFIG_VAR_FLOAT` (`double`), `CONFIG_VAR_STRING` +(UTF-8; `get_string` copies into a caller buffer, pass a `NULL` buffer with size 0 to query the length). Accessors are +typed and must match the registration. + +Change callbacks fire on the game thread whenever the value changes at runtime (your own `set_*` calls included). +Writes that store the same value are silent. Values applied from `config.json` or `--cvar` at registration do +**not** fire callbacks; read the value after `register_var` for the starting state. + +### UiService (`mods/svc/ui.h`) + +Integrate seamlessly with Dusklight's UI system: add controls and buttons to your mod's detail pane in the Mods window, +create custom windows and modal dialogs, apply custom RCSS stylesheets (anywhere!), and add menu bar tabs. + +**Mod panel:** Registers or replaces the panel rendered in your mod's detail pane; `build` runs every time the detail +content is rebuilt, and `update` runs every frame while that mod is selected. While your mod is selected, the detail +pane carries your mod's id as a `mod-id` attribute (like custom window roots), so scoped RCSS can target it (e.g. +`[mod-id="com.example.mod"]`). + +```cpp +IMPORT_SERVICE(UiService, svc_ui); + +UiElementHandle statusText = 0; + +ModResult build(ModContext*, UiElementHandle panel, void*, ModError*) { + svc_ui->pane_add_section(mod_ctx, panel, "Status"); + svc_ui->pane_add_text(mod_ctx, panel, "starting...", &statusText); + svc_ui->pane_add_progress(mod_ctx, panel, 0.5f, nullptr); + return MOD_OK; +} + +ModResult update(ModContext*, void*, ModError*) { + svc_ui->elem_set_text(mod_ctx, statusText, "running"); + return MOD_OK; +} + +UiModsPanelDesc panel = UI_MODS_PANEL_DESC_INIT; +panel.build = build; +panel.update = update; +svc_ui->register_mods_panel(mod_ctx, &panel); +``` + +Element setters must match the element kind: `elem_set_text`/`elem_set_rml` on text rows, and `elem_set_progress` on +progress bars. `elem_set_class` sets or clears an RCSS class on any element handle, for styling via scoped or +per-window RCSS. A non-`MOD_OK` result from `build`/`update` fails your mod, as do exceptions thrown from any UI +callback. + +**Controls:** `pane_add_control` adds an input row described by a `UiControlDesc`: `UI_CONTROL_BUTTON`, +`UI_CONTROL_TOGGLE`, `UI_CONTROL_NUMBER`, `UI_CONTROL_STRING`, or `UI_CONTROL_SELECT`. Values bind with callbacks or +directly to a config var. + +```cpp +UiControlDesc control = UI_CONTROL_DESC_INIT; +control.kind = UI_CONTROL_TOGGLE; +control.label = "Enable rainbows"; +control.help_rml = "Shown in the help pane while focused."; +control.binding = UI_BINDING_CONFIG_VAR; +control.config_var = myBoolVar; // from svc_config->register_var +svc_ui->pane_add_control(mod_ctx, leftPane, &control, nullptr); +``` + +`UI_BINDING_CONFIG_VAR` wires persistence, change notifications, and the modified indicator automatically. The var +type must match the control: `TOGGLE` = bool, `NUMBER` and `SELECT` = int, `STRING` = string. Float vars are not +bindable; use callbacks and convert. `help_rml` and `SELECT` option lists render in a help pane, so `SELECT` controls +are only available inside window tabs. + +**Windows:** `window_push` pushes a tabbed two-pane window onto the document stack and shows it. Each tab's `build` +receives the window handle plus fresh left and right pane handles on every activation. The optional per-tab `update` +runs each frame while that tab is active. `on_closed` fires when the window is destroyed. `desc.rcss` optionally styles +that window's document only; custom windows carry the owning mod's id as a `mod-id` attribute on the window root, so +scoped RCSS can target your specific mod's windows (e.g. `window[mod-id="com.example.mod"]`). + +```cpp +UiTabDesc tabs[1] = {UI_TAB_DESC_INIT}; +tabs[0].title = "Options"; +tabs[0].build = build_options_tab; + +UiWindowDesc desc = UI_WINDOW_DESC_INIT; +desc.tabs = tabs; +desc.tab_count = 1; +desc.on_closed = options_window_closed; +UiWindowHandle window = 0; +svc_ui->window_push(mod_ctx, &desc, &window); +``` + +**Dialogs:** `dialog_push` shows a modal dialog. `variant` picks the style, `icon` optionally overrides the variant's +default icon, and actions become buttons. After an action's `on_pressed` returns, the dialog closes unless the action +sets `keep_open`. A `keep_open` action can close it later (or immediately) with `dialog_close`. Cancel fires +`on_dismiss` if present and always closes. `dialog_set_body`, `dialog_set_icon`, and `dialog_add_action` mutate a live +dialog. + +**Menu bar tabs:** `register_menu_tab` adds a tab to the in-game menu bar. `on_selected` fires when the user activates +the tab: typically you'd push a window from it. The tab is removed by `unregister_menu_tab`, or automatically when the +mod is disabled. + +**Custom styles:** `register_styles(scope, rcss, &handle)` applies an RCSS stylesheet to every document of a scope: +existing documents restyle immediately, and future ones pick it up when created. `register_styles_file(scope, path, +&handle)` reads the sheet from your bundle's `res/` directory. Scopes are `UI_SCOPE_PRELAUNCH`, `UI_SCOPE_WINDOW`, +`UI_SCOPE_MENU_BAR`, `UI_SCOPE_OVERLAY`, `UI_SCOPE_TOUCH_CONTROLS`, and `UI_SCOPE_GRAPHICS_TUNER`. Sheets apply after +host styles and may override them. Scope selectors tightly (use `[mod-id="..."]`!), especially for `UI_SCOPE_WINDOW`, +unless changing host UI is intentional. + +### GfxService (`mods/svc/gfx.h`) + +**Requires `add_mod(... FEATURES webgpu)`** + +Direct WebGPU access at various stages of the rendering pipeline. Mods use the `wgpu*` C API (via `webgpu/webgpu.h`) for +custom draws and compute dispatches. Mods must manage their own WebGPU state, including pipelines and bind groups. + +```cpp +IMPORT_SERVICE(GfxService, svc_gfx); + +GfxDeviceInfo info = GFX_DEVICE_INFO_INIT; +svc_gfx->get_device_info(mod_ctx, &info); +``` + +`register_stage_hook` runs a game-thread callback during frame recording. The public stages are: + +- `GFX_STAGE_SCENE_BEGIN`: world camera window after camera/projection/light setup +- `GFX_STAGE_SCENE_AFTER_TERRAIN`: after terrain/shadow lists, before object and translucent lists +- `GFX_STAGE_SCENE_AFTER_OPAQUE`: after sky/terrain/object opaque lists, before translucent lists +- `GFX_STAGE_FRAME_BEFORE_HUD`: 3D scene and wipe are complete, before 2D/HUD lists +- `GFX_STAGE_FRAME_AFTER_HUD`: full game scene, including HUD + +Inside a stage callback, record work with `push_draw`, stream per-frame data with `push_verts`, `push_indices`, +`push_uniform`, or `push_storage`, snapshot the current frame with `resolve_pass`, and use `create_pass`/`resolve_pass` +for temporary offscreen passes. Draw callbacks run later on the render worker thread with the live +`WGPURenderPassEncoder`; they may use only their `GfxDrawContext` handles and raw `wgpu*` calls. Compute callbacks +registered with `register_compute_type` follow the same worker-thread rule and run on the frame command encoder. + +All WGPU handles from the service are borrowed. Resolved target views are valid for the current frame only. GPU objects +created by a mod are owned by that mod and should be released in `mod_shutdown`. + +### CameraService (`mods/svc/camera.h`) + +Converts a game view provided by a render callback into WebGPU-convention camera data. Matrix fields are column-major +`float[16]` values using the matrix * column-vector convention (transpose of the game's row-major `Mtx`/`Mtx44` layout), +ready to copy into WGSL `mat4x4f` uniforms. + +```cpp +IMPORT_SERVICE(CameraService, svc_camera); + +CameraInfo camera = CAMERA_INFO_INIT; +if (svc_camera->get_camera(mod_ctx, game_view, &camera) == MOD_OK) { + // camera.view_from_world, camera.proj_from_view, camera.eye, ... +} +``` + +`get_camera` returns `MOD_UNAVAILABLE` while the view is not a valid perspective camera, such as before the +first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention +(reversed-Z by default). + +--- + +## Hooking Game Functions + +**Requires `add_mod(... FEATURES game)`** + +Mods may hook the vast majority of game functions, including file-local static, private and virtual functions. +`mods/hook.hpp` provides typed helpers over the hook service: + +```cpp +#include "mods/hook.hpp" +#include "mods/svc/hook.h" + +IMPORT_SERVICE(HookService, svc_hook); + +DEFINE_HOOK(&daAlink_c::posMove, LinkPosMove); +DEFINE_HOOK(&daAlink_c::execute, LinkExecute); +``` + +Every hook target must be **declared** at namespace scope with `DEFINE_HOOK` (a target you can name in C++) or +`DEFINE_HOOK_SYMBOL` (a symbol name). + +### Pre-hooks + +Run before the original. Return `HOOK_SKIP_ORIGINAL` to cancel it (post-hooks still run). + +```cpp +HookAction on_pos_move_pre(ModContext*, void* args, void* retval, void* userdata) { + daAlink_c* link = mods::arg(args, 0); // arg 0 is `this` + if (link->shape_angle.y > 10000) { + return HOOK_SKIP_ORIGINAL; + } + return HOOK_CONTINUE; +} + +mods::hook_add_pre(svc_hook, on_pos_move_pre); +``` + +### Post-hooks + +Run after the original (or after a replace-hook, or after a cancelled original). `retval` points to the return value, +if any. + +```cpp +void on_pos_move_post(ModContext*, void* args, void* retval, void* userdata) { ... } + +mods::hook_add_post(svc_hook, on_pos_move_post); +``` + +### Replace-hooks + +Substitute the original entirely. Call through to it via the declaration's `g_orig` if needed: + +```cpp +void on_execute_replace(ModContext*, void* args, void* retval, void*) { + int result = LinkExecute::g_orig(mods::arg(args, 0)); + if (retval != nullptr) { + *static_cast(retval) = result; + } +} + +mods::hook_replace(svc_hook, on_execute_replace); +``` + +By default a second replace-hook on the same function is a conflict; `HookOptions` (`replace_policy`, `priority`, +`userdata`) controls this and callback ordering. Multiple mods can attach pre/post hooks to the same function +independently. + +### Hooking by name + +Functions you can't name in C++ (file-local statics, private class members, anything not in a header) can be hooked by +symbol name instead. You must supply the signature along with the name. + +```cpp +DEFINE_HOOK_SYMBOL("daAlink_hookshotAtHitCallBack", + void(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*), HookshotHit); + +mods::hook_add_pre(svc_hook, on_hookshot_hit_pre); +... +HookshotHit::g_orig(link, atObjInf, target, tgObjInf); // call through to the original +``` + +Class member functions must include `Class*` as the first argument. + +Two spellings work on every platform: + +- **Display names** (`daAlink_c::posMove`, `fapGm_Before`): the qualified name with no parameter list. They carry no + signature, so overload sets (and file-local statics sharing a name) return `MOD_CONFLICT`. +- **Decorated names** (`_ZN9daAlink_c7posMoveEv` / `?posMove@daAlink_c@@...`): the platform's mangled spelling in + dlsym convention (no Mach-O leading underscore). The escape hatch for overloads. + +Installing fails with `MOD_UNAVAILABLE` when it didn't resolve (missing, ambiguous, or no symbol manifest). Unlike +`DEFINE_HOOK`, the signature is **not** compiler-checked: a mismatched signature will corrupt the +call. + +### Reading and writing arguments + +`args` is an array of pointers to the arguments. For member functions, index 0 is `this`; parameters follow in +declaration order. + +```cpp +T value = mods::arg(args, n); // copy +T& ref = mods::arg_ref(args, n); // read/write reference +``` + +```cpp +DEFINE_HOOK(fopAcM_createItem, CreateItem); + +// fpc_ProcID fopAcM_createItem(..., int itemNo, ...): turn heart drops into green rupees +HookAction on_create_item_pre(ModContext*, void* args, void*, void*) { + int& itemNo = mods::arg_ref(args, 1); + if (itemNo == dItemNo_HEART_e) { + itemNo = dItemNo_GREEN_RUPEE_e; + } + return HOOK_CONTINUE; +} + +mods::hook_add_pre(svc_hook, on_create_item_pre); +``` + +For reference parameters (e.g. `const cXyz& pos`), `arg_ref` yields a direct reference. + +--- + +## Asset Overlays + +Files placed under `overlay/` in the `.dusk` archive override game files at the corresponding path, equivalent to +replacing files in the .iso. This requires no code: an archive with just `mod.json` and `overlay/` is a complete mod. + +Files placed under `textures/` register as texture replacements, and act just like the user's general +`texture_replacements/` directory: Dolphin-style naming, matched by texture hash +(`tex1_{w}x{h}_{texhash}[_{tluthash}]_{fmt}.dds|.png`, `$` as a hash wildcard). Subdirectories are scanned recursively; +only the filename needs to match. + +Both mechanisms are tied to the mod's lifecycle: disabling the mod removes its overrides (files revert to the disc +contents on their next open; added files stop existing), and reloading serves the new bundle's content. However, game +data the engine already read stays as-is until it is loaded again, which may require a scene change or, in the worst +case, a full restart. Texture replacements usually take effect immediately. + +If multiple sources replace the same file or texture, the last one wins: runtime registrations override static +`textures/` or `overlay/` files, and later-loaded mods override earlier ones. Cross-mod conflicts log warnings. +**All** mod-provided texture replacements override the user's `texture_replacements/`. + +To configure overlays and texture replacements at runtime instead, see [OverlayService](#overlayservice-modssvcoverlayh) +and [TextureService](#textureservice-modssvctextureh). + +--- + +## Runtime Lifecycle + +Mods can be disabled, re-enabled, and reloaded at runtime without restarting the game (the enabled state persists as the +`mod..enabled` config var). Write your mod assuming this happens: + +- **Disable** calls `mod_shutdown`, removes your hooks, services, overlays, and texture replacements (both static and + runtime-registered), and unloads your library. +- **Enable** and **Reload** load a *fresh copy* of your library, imports are re-resolved, and `mod_initialize` runs + again. You never see a second `mod_initialize` on the same image, so just make `mod_shutdown` release anything the + loader doesn't manage for you (threads, files, game-side state you mutated). +- **Reload** additionally re-reads the `.dusk` from disk, picking up a rebuilt library and changed assets. This is the + fast iteration loop during development: rebuild, click Reload. + +**Dependents restart too.** Disabling or reloading a mod that exports services shuts down the mods importing them +first (in reverse dependency order) and brings them back afterward. A mod whose *required* provider is disabled stays +suspended and resumes automatically when the provider returns. Mods with an *optional* import of a disabled provider +restart with that import null. + +**One caution for hooks:** lifecycle changes are applied between frames, which is safe for hooks on functions +that return every frame (effectively everything you'd normally hook). Avoid hooking a function that stays on +the stack for the whole session (e.g. the outermost main loop); a mod that does cannot be safely unloaded. + +--- + +## Error Handling + +Service calls report failure through `ModResult` return values (`MOD_OK`, `MOD_UNAVAILABLE`, +`MOD_INVALID_ARGUMENT`, ...). Lifecycle exports additionally receive a `ModError*`: fill it (e.g. with +`mods::set_error(error, code, "message")`) and return the code, and the loader disables the mod and shows the +message to the user. + +```cpp +MOD_EXPORT ModResult mod_initialize(ModError* error) { + if (!load_my_data()) { + return mods::set_error(error, MOD_ERROR, "failed to load data"); + } + return MOD_OK; +} +``` + +Throwing exceptions out of lifecycle functions also disables the mod (they are caught by the loader), but prefer +explicit results. + +--- + +## Advanced + +### Exporting Services + +Mods may export services of their own, permitting framework mods and cross-mod integration. Define the interface in a +header both mods share: + +```cpp +// my_mod_api.h +#include "mods/api.h" + +#define MY_MOD_SERVICE_ID "com.example.my_mod.api" +#define MY_MOD_SERVICE_MAJOR 1u +#define MY_MOD_SERVICE_MINOR 0u + +typedef struct MyModService { + ServiceHeader header; + ModResult (*do_thing)(ModContext* ctx, int value); +} MyModService; + +#ifdef __cplusplus +#include "mods/service.hpp" +template <> +struct mods::ServiceTraits { + static constexpr const char* id = MY_MOD_SERVICE_ID; + static constexpr uint16_t major_version = MY_MOD_SERVICE_MAJOR; + static constexpr uint16_t minor_version = MY_MOD_SERVICE_MINOR; +}; +#endif +``` + +**Provider:** + +```cpp +ModResult do_thing(ModContext* ctx, int value) { ... } + +constexpr MyModService g_service{ + .header = SERVICE_HEADER(MyModService, MY_MOD_SERVICE_MAJOR, MY_MOD_SERVICE_MINOR), + .do_thing = do_thing, +}; +EXPORT_SERVICE(g_service); +``` + +**Consumer:** + +```cpp +IMPORT_SERVICE(MyModService, svc_my_mod); +// or IMPORT_OPTIONAL_SERVICE if the dependency is optional + +svc_my_mod->do_thing(mod_ctx, 42); +``` + +The loader registers all exports before resolving any imports, so declaration order between mods doesn't matter. Note +that the `ctx` a provider receives identifies the *calling* mod. + +#### Dependencies between mods + +Service imports are also dependency declarations: the loader initializes mods in dependency order, so by the time your +`mod_initialize` runs, every mod you import services from (required *or* optional) has already finished its own +`mod_initialize`. This includes deferred services: a service the provider publishes during its initialization resolves +into your import slot just like a static export. + +Consequences of that contract: + +- If a provider fails to load, every mod that *requires* one of its services is disabled too, with an error naming the + provider. Optional imports of a failed provider simply resolve to `NULL`. +- Mods whose **required** imports form a cycle all fail to load. If the cycle runs through an **optional** import, the + loader breaks it there: the optional import still resolves, but its provider may not be initialized yet when you run. +- `svc_host->get_service(...)` is outside this system. It sees whatever is published at call time and gives no + initialization-order guarantee, which also makes it the escape hatch for intentionally cyclic designs. + +Mods shut down in reverse initialization order, so services you import remain safe to call from `mod_shutdown`. + +Rules for providers: + +- Service IDs are global and use reverse-DNS names (e.g. `com.mydomain.mod.service`) +- Every function pointer covered by your declared minor version must be populated. +- Within a major version, only append fields; never reorder, remove, or repurpose them. Breaking changes require a major + bump (which is, in effect, a new service). +- Only one provider per `(id, major)` pair may be registered; duplicates are load errors. + +For services whose construction can't happen at static-init time, declare the export with `EXPORT_DEFERRED_SERVICE(...)` +and publish the pointer later via `svc_host->publish_service(...)`. Consumers can fetch services dynamically with +`svc_host->get_service(...)`; prefer manifest imports whenever possible, since they give the loader dependency +information and fail fast with good errors. + +### Native Runtime Libraries + +`RUNTIME_LIBRARIES` passed to `add_mod` are packaged beside the mod's native module in `lib//`. Dusklight +extracts the whole directory before loading the mod, so libraries linked by the mod resolve normally. The SDK links the +mod itself with `$ORIGIN` on Linux and `@loader_path` on Apple platforms; runtime libraries with their own non-system +dependencies must also be built with origin-relative lookup paths. On Windows, Dusklight uses an isolated DLL search +rooted at this directory. + +```cmake +add_mod(my_mod + SOURCES src/mod.cpp + MOD_JSON mod.json + RUNTIME_LIBRARIES "${VENDOR_RUNTIME_LIBRARY}") +``` + +SDKs that load plugins by directory can pass them the absolute runtime path from the current HostService: + +```cpp +IMPORT_SERVICE(HostService, svc_host); + +const char* nativeDir = svc_host->native_dir(mod_ctx); // read-only +``` + +Libraries loaded explicitly by the mod remain its responsibility: stop their threads and unload them during +`mod_shutdown`. Do not write into `native_dir`; use `mod_dir` for writable state. Native library namespaces are +process-wide on some platforms, so two mods cannot safely assume that incompatible libraries with the same filename +will remain isolated. diff --git a/extern/aurora b/extern/aurora index 40913d532e..81f12f31d2 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 40913d532e5859a68e56b88d8aaec6bff1b88a2e +Subproject commit 81f12f31d23ec822d8bde2031c91e94c470911eb diff --git a/files.cmake b/files.cmake index eb8c62bee5..c8c92c9b75 100644 --- a/files.cmake +++ b/files.cmake @@ -1411,56 +1411,101 @@ set(DOLPHIN_FILES ) set(DUSK_FILES - include/dusk/action_bindings.h - include/dusk/endian_gx.hpp - include/dusk/config.hpp - include/dusk/dvd_asset.hpp - include/dusk/scope_guard.hpp - src/dusk/dvd_asset.cpp + include/helpers/batch.hpp + include/helpers/endian_gx.hpp src/d/actor/d_a_alink_dusk.cpp + src/dusk/OSContext.cpp + src/dusk/OSMutex.cpp + src/dusk/OSReport.cpp + src/dusk/OSThread.cpp + src/dusk/achievements.cpp + src/dusk/action_bindings.cpp + src/dusk/action_bindings.h + src/dusk/android_frame_rate.cpp + src/dusk/android_frame_rate.hpp src/dusk/asserts.cpp + src/dusk/autosave.cpp src/dusk/config.cpp + src/dusk/config.hpp + src/dusk/crash_handler.cpp src/dusk/crash_reporting.cpp src/dusk/data.cpp src/dusk/data.hpp - src/dusk/endian.cpp + src/dusk/discord.cpp + src/dusk/discord.hpp + src/dusk/discord_presence.cpp + src/dusk/dvd_asset.cpp + src/dusk/dvd_asset.hpp src/dusk/extras.c src/dusk/file_select.cpp src/dusk/file_select.hpp src/dusk/frame_interpolation.cpp src/dusk/game_clock.cpp + src/dusk/gamepad_color.cpp src/dusk/globals.cpp src/dusk/gyro.cpp - src/dusk/gamepad_color.cpp - src/dusk/autosave.cpp src/dusk/http/http.hpp + src/dusk/imgui/ImGuiActorSpawner.cpp + src/dusk/imgui/ImGuiBloomWindow.cpp + src/dusk/imgui/ImGuiBloomWindow.hpp + src/dusk/imgui/ImGuiCameraOverlay.cpp + src/dusk/imgui/ImGuiConfig.hpp + src/dusk/imgui/ImGuiConsole.cpp + src/dusk/imgui/ImGuiConsole.hpp + src/dusk/imgui/ImGuiControllerOverlay.cpp + src/dusk/imgui/ImGuiEngine.cpp + src/dusk/imgui/ImGuiEngine.hpp + src/dusk/imgui/ImGuiHeapOverlay.cpp + src/dusk/imgui/ImGuiMenuTools.cpp + src/dusk/imgui/ImGuiMenuTools.hpp + src/dusk/imgui/ImGuiProcessOverlay.cpp + src/dusk/imgui/ImGuiSaveEditor.cpp + src/dusk/imgui/ImGuiStateShare.cpp + src/dusk/imgui/ImGuiStateShare.hpp + src/dusk/imgui/ImGuiStubLog.cpp src/dusk/io.cpp + src/dusk/iso_validate.cpp src/dusk/layout.cpp + src/dusk/livesplit.cpp src/dusk/logging.cpp + src/dusk/menu_pointer.cpp + src/dusk/menu_pointer.h + src/dusk/mods/loader/bundle_disk.cpp + src/dusk/mods/loader/bundle_zip.cpp + src/dusk/mods/loader/context.cpp + src/dusk/mods/loader/depgraph.cpp + src/dusk/mods/loader/depgraph.hpp + src/dusk/mods/loader/loader.cpp + src/dusk/mods/loader/loader.hpp + src/dusk/mods/loader/native_module.cpp + src/dusk/mods/loader/native_module.hpp + src/dusk/mods/log_buffer.cpp + src/dusk/mods/log_buffer.hpp + src/dusk/mods/manifest.cpp + src/dusk/mods/manifest.hpp + src/dusk/mods/svc/camera.cpp + src/dusk/mods/svc/config.cpp + src/dusk/mods/svc/config.hpp + src/dusk/mods/svc/game.cpp + src/dusk/mods/svc/gfx.cpp + src/dusk/mods/svc/hook.cpp + src/dusk/mods/svc/host.cpp + src/dusk/mods/svc/log.cpp + src/dusk/mods/svc/overlay.cpp + src/dusk/mods/svc/registry.cpp + src/dusk/mods/svc/registry.hpp + src/dusk/mods/svc/resource.cpp + src/dusk/mods/svc/texture.cpp + src/dusk/mods/svc/ui.cpp + src/dusk/mods/svc/ui.hpp + src/dusk/mouse.cpp + src/dusk/scope_guard.hpp src/dusk/settings.cpp src/dusk/speedrun.cpp src/dusk/stubs.cpp - src/dusk/update_check.cpp - src/dusk/update_check.hpp - #src/dusk/m_Do_ext_dusk.cpp - src/dusk/imgui/ImGuiConfig.hpp - src/dusk/imgui/ImGuiConsole.hpp - src/dusk/imgui/ImGuiConsole.cpp - src/dusk/imgui/ImGuiEngine.cpp - src/dusk/imgui/ImGuiEngine.hpp - src/dusk/imgui/ImGuiBloomWindow.cpp - src/dusk/imgui/ImGuiBloomWindow.hpp - src/dusk/imgui/ImGuiMenuTools.cpp - src/dusk/imgui/ImGuiMenuTools.hpp - src/dusk/imgui/ImGuiActorSpawner.cpp - src/dusk/imgui/ImGuiProcessOverlay.cpp - src/dusk/imgui/ImGuiCameraOverlay.cpp - src/dusk/imgui/ImGuiHeapOverlay.cpp - src/dusk/imgui/ImGuiControllerOverlay.cpp - src/dusk/imgui/ImGuiStubLog.cpp - src/dusk/imgui/ImGuiSaveEditor.cpp - src/dusk/imgui/ImGuiStateShare.hpp - src/dusk/imgui/ImGuiStateShare.cpp + src/dusk/texture_replacements.cpp + src/dusk/texture_replacements.hpp + src/dusk/touch_camera.cpp src/dusk/ui/achievements.cpp src/dusk/ui/achievements.hpp src/dusk/ui/bool_button.cpp @@ -1471,6 +1516,7 @@ set(DUSK_FILES src/dusk/ui/component.hpp src/dusk/ui/controller_config.cpp src/dusk/ui/controller_config.hpp + src/dusk/ui/controls.hpp src/dusk/ui/document.cpp src/dusk/ui/document.hpp src/dusk/ui/editor.cpp @@ -1479,10 +1525,22 @@ set(DUSK_FILES src/dusk/ui/event.hpp src/dusk/ui/graphics_tuner.cpp src/dusk/ui/graphics_tuner.hpp + src/dusk/ui/icon_provider.cpp + src/dusk/ui/icon_provider.hpp src/dusk/ui/input.cpp src/dusk/ui/input.hpp + src/dusk/ui/logs_window.cpp + src/dusk/ui/logs_window.hpp + src/dusk/ui/menu_bar.cpp + src/dusk/ui/menu_bar.hpp + src/dusk/ui/mod_texture_provider.cpp + src/dusk/ui/mod_texture_provider.hpp + src/dusk/ui/mod_window.cpp + src/dusk/ui/mod_window.hpp src/dusk/ui/modal.cpp src/dusk/ui/modal.hpp + src/dusk/ui/mods_window.cpp + src/dusk/ui/mods_window.hpp src/dusk/ui/nav_types.hpp src/dusk/ui/number_button.cpp src/dusk/ui/number_button.hpp @@ -1490,8 +1548,6 @@ set(DUSK_FILES src/dusk/ui/overlay.hpp src/dusk/ui/pane.cpp src/dusk/ui/pane.hpp - src/dusk/ui/menu_bar.cpp - src/dusk/ui/menu_bar.hpp src/dusk/ui/prelaunch.cpp src/dusk/ui/prelaunch.hpp src/dusk/ui/preset.cpp @@ -1506,25 +1562,25 @@ set(DUSK_FILES src/dusk/ui/string_button.hpp src/dusk/ui/tab_bar.cpp src/dusk/ui/tab_bar.hpp + src/dusk/ui/touch_controls.cpp + src/dusk/ui/touch_controls.hpp + src/dusk/ui/touch_controls_common.cpp + src/dusk/ui/touch_controls_common.hpp + src/dusk/ui/touch_controls_editor.cpp + src/dusk/ui/touch_controls_editor.hpp src/dusk/ui/ui.cpp src/dusk/ui/ui.hpp src/dusk/ui/warp.cpp src/dusk/ui/warp.hpp src/dusk/ui/window.cpp src/dusk/ui/window.hpp - src/dusk/achievements.cpp - src/dusk/iso_validate.cpp - src/dusk/livesplit.cpp - src/dusk/offset_ptr.cpp - src/dusk/OSContext.cpp - src/dusk/OSReport.cpp - src/dusk/OSThread.cpp - src/dusk/OSMutex.cpp - src/dusk/discord.cpp - src/dusk/discord.hpp - src/dusk/discord_presence.cpp + src/dusk/update_check.cpp + src/dusk/update_check.hpp src/dusk/version.cpp - src/dusk/action_bindings.cpp + src/helpers/batch.cpp + src/helpers/endian.cpp + src/helpers/offset_ptr.cpp + src/helpers/string.cpp ) set(DUSK_HTTP_BACKEND_FILES diff --git a/fix-cmake-paths.patch b/fix-cmake-paths.patch new file mode 100644 index 0000000000..202a42fbd6 --- /dev/null +++ b/fix-cmake-paths.patch @@ -0,0 +1,32 @@ +From f69d29614644f9963f5cb3f828b58575d60a1c5a Mon Sep 17 00:00:00 2001 +From: Joshua Trees +Date: Thu, 4 Jun 2026 01:04:04 +0100 +Subject: [PATCH] fix cmake paths + +--- + cmake/nodConfig.cmake.in | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/cmake/nodConfig.cmake.in b/cmake/nodConfig.cmake.in +index 0969382..2a24a88 100644 +--- a/cmake/nodConfig.cmake.in ++++ b/cmake/nodConfig.cmake.in +@@ -1,12 +1,12 @@ + @PACKAGE_INIT@ + +-set(_nod_libdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@") +-set(_nod_incdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") ++set(_nod_libdir "@CMAKE_INSTALL_FULL_LIBDIR@") ++set(_nod_incdir "@CMAKE_INSTALL_FULL_INCLUDEDIR@") + + if (NOT TARGET nod::nod_shared AND NOT TARGET nod::nod_static) + # Shared library + if (WIN32) +- set(_nod_dll "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_BINDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}nod${CMAKE_SHARED_LIBRARY_SUFFIX}") ++ set(_nod_dll "@CMAKE_INSTALL_FULL_BINDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}nod${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(_nod_implib "${_nod_libdir}/${CMAKE_IMPORT_LIBRARY_PREFIX}nod${CMAKE_IMPORT_LIBRARY_SUFFIX}") + if (EXISTS "${_nod_dll}") + add_library(nod::nod_shared SHARED IMPORTED) +-- +2.53.0 + diff --git a/flake.lock b/flake.lock index 8ec14d2852..08dc0f458c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1775710090, - "narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=", + "lastModified": 1778869304, + "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4c1018dae018162ec878d42fec712642d214fdfa", + "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index edba703a3d..6be8c03aef 100644 --- a/flake.nix +++ b/flake.nix @@ -1,228 +1,392 @@ { - inputs = { - nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; - }; - outputs = { self, nixpkgs }: + description = "Dusklight — native PC port of the Twilight Princess decompilation"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + outputs = + { self, nixpkgs }: let + inherit (nixpkgs) lib; + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - pkgsFor = system: import nixpkgs { inherit system; }; + forAllSystems = lib.genAttrs supportedSystems; - # Dependencies that are not packaged in nixpkgs (used by the Linux package build): - buildSources = pkgs: { - aurora-src = pkgs.fetchFromGitHub { - owner = "encounter"; - repo = "aurora"; - rev = "63606a43265a3bc18dafd500ab4d7a2108f109e6"; - hash = "sha256-xBvnAwGwNzav67Ac6oUz7RqDUwqgL2bsME3OOMn8Tqw="; + dawnVersion = "v20260618.032059"; + nodVersion = "v2.0.0-alpha.10"; + versionSuffix = "nix-" + (self.shortRev or self.dirtyShortRev or "dirty"); + + dawnInfo = { + "x86_64-linux" = { + triple = "linux-x86_64"; + hash = "sha256-GFSd573b+VQx/VmFdNQgWDd0V9ayQlcw0Zuopke12ak="; }; - dawn-src = pkgs.fetchzip { - url = "https://github.com/encounter/dawn-build/releases/download/v20260423.175430/dawn-linux-x86_64.tar.gz"; - hash = "sha256-HXfKTLHtMPwupnFnaflCARtXVPuS/0PoCePXidjE5xs="; - stripRoot = false; + "aarch64-linux" = { + triple = "linux-aarch64"; + hash = "sha256-ZaoP7BAjBMnfAv2/AMRi3FNH2ZtyqASCSFyU/oB2Mzg="; }; - nod-src = pkgs.fetchzip { - url = "https://github.com/encounter/nod/releases/download/v2.0.0-alpha.8/libnod-linux-x86_64.tar.gz"; - hash = "sha256-mUqvLsbsqaZ+HAjMmHYPYO+MgtanGRTw7Gzn5uXR5rE="; - stripRoot = false; + "aarch64-darwin" = { + triple = "darwin-arm64"; + hash = "sha256-HT+qtlLaSHyoXPrUcXgcTGa877X5YfzbxRD4bJb7i1Y="; }; - # The version of imgui on nixpkgs does not map cleanly. - imgui-src = pkgs.fetchFromGitHub { - owner = "ocornut"; - repo = "imgui"; - rev = "v1.91.9b-docking"; - hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ="; - }; - sqlite-src = pkgs.fetchzip { - url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip"; - hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM="; - }; - rmlui-src = pkgs.fetchzip { - url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz"; - hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg="; + "x86_64-darwin" = { + triple = "darwin-x86_64"; + hash = "sha256-cUNaCbA7rlKSukDVKGaVEVw0Zt1+mSbaHbmUCMvMVWc="; }; }; - # Dusklight Actual (Linux x86_64 only — relies on prebuilt dawn/nod binaries) - mkDusklight = pkgs: - let srcs = buildSources pkgs; - versionSuffix = if self ? shortRev && self.shortRev != null - then "nix-${self.shortRev}" - else "nix-dirty"; - in - pkgs.stdenv.mkDerivation { - name = "dusklight"; - src = ./.; - postUnpack = '' - mkdir -p $sourceRoot/extern/aurora - cp -r ${srcs.aurora-src}/. $sourceRoot/extern/aurora/ - chmod -R u+w $sourceRoot/extern/aurora - sed -i '/add_subdirectory(tests)/d' $sourceRoot/extern/aurora/CMakeLists.txt - ''; - # Remove last line to re-enable tests - cmakeFlags = [ - "-DDUSK_VERSION_OVERRIDE=${versionSuffix}" - "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" - "-DFETCHCONTENT_SOURCE_DIR_CXXOPTS=${pkgs.cxxopts.src}" - "-DFETCHCONTENT_SOURCE_DIR_JSON=${pkgs.nlohmann_json.src}" - "-DFETCHCONTENT_SOURCE_DIR_DAWN_PREBUILT=${srcs.dawn-src}" - "-DFETCHCONTENT_SOURCE_DIR_XXHASH=${pkgs.xxHash.src}" - "-DFETCHCONTENT_SOURCE_DIR_FMT=${pkgs.fmt.src}" - "-DFETCHCONTENT_SOURCE_DIR_TRACY=${pkgs.tracy.src}" - "-DAURORA_SDL3_PROVIDER=system" - "-DFETCHCONTENT_SOURCE_DIR_NOD_PREBUILT=${srcs.nod-src}" - "-DAURORA_NOD_PROVIDER=package" - "-DFETCHCONTENT_SOURCE_DIR_FREETYPE=${pkgs.freetype.src}" - "-DFETCHCONTENT_SOURCE_DIR_ZSTD=${pkgs.zstd.src}" - "-DFETCHCONTENT_SOURCE_DIR_SQLITE3=${srcs.sqlite-src}" - "-DFETCHCONTENT_SOURCE_DIR_IMGUI=${srcs.imgui-src}" - "-DFETCHCONTENT_SOURCE_DIR_RMLUI=${srcs.rmlui-src}" - "-DCMAKE_CROSSCOMPILING=ON" # Tests are not working as I didn't want to work through getting google's test suite working as well. This is the only guard I could find to disable it. - ]; - installPhase = '' - mkdir -p $out/bin - cp dusklight $out/bin/dusklight - cp -r ./res $out/bin/res + nodPrebuiltInfo = { + "x86_64-linux" = { + triple = "linux-x86_64"; + hash = "sha256-FVQWECVA2gWdc+n5OQ/Tvwn8z0qdgjSd1WlFt5HKOec="; + }; + "aarch64-darwin" = { + triple = "macos-arm64"; + hash = "sha256-8ZEejxksVgShNKUVRCBYaLOp9x/qOC9pAeVrElQUGUk="; + }; + }; - mkdir -p $out/share/applications - cp $src/platforms/freedesktop/dusklight.desktop $out/share/applications/dusklight.desktop + perSystem = + system: + let + pkgs = import nixpkgs { inherit system; }; + inherit (pkgs.stdenv.hostPlatform) isDarwin; + hasNodPrebuilt = nodPrebuiltInfo ? ${system}; - for size in 16 32 48 64 128 256 512 1024; do - install -Dm644 $src/platforms/freedesktop/''${size}x''${size}/apps/dusklight.png \ - $out/share/icons/hicolor/''${size}x''${size}/apps/dusklight.png - done + aurora = builtins.pathExists "${self}/extern/aurora/CMakeLists.txt"; + needSubmodules = '' + dusklight: The aurora submodule is not vendored. Add submodules=1 to build. + + As a flake input: + + dusklight.url = "git+https://github.com/TwilitRealm/dusklight?ref=main&submodules=1"; + + nix command: + + nix run 'git+https://github.com/TwilitRealm/dusklight?submodules=1' + + Local checkout: + + nix run '.?submodules=1#dusklight' ''; - nativeBuildInputs = [ + + dawn = pkgs.fetchzip { + url = "https://github.com/encounter/dawn/releases/download/${dawnVersion}/dawn-${dawnInfo.${system}.triple}.tar.gz"; + hash = dawnInfo.${system}.hash; + stripRoot = false; + }; + + corrosion = pkgs.fetchFromGitHub { + owner = "corrosion-rs"; + repo = "corrosion"; + rev = "v0.6.1"; + hash = "sha256-ppuDNObfKhneD9AlnPAvyCRHKW3BidXKglD1j/LE9CM="; + }; + + nodFromSource = pkgs.stdenv.mkDerivation (finalAttrs: { + pname = "nod"; + version = nodVersion; + src = pkgs.fetchFromGitHub { + owner = "encounter"; + repo = "nod"; + rev = nodVersion; + hash = "sha256-r8qDlOVxv5iKiFjJQrcBuL9HVoOM3yEjRVnQIMqaICs="; + }; + patches = [ ./fix-cmake-paths.patch ]; + cargoDeps = pkgs.rustPlatform.importCargoLock { + lockFile = "${finalAttrs.src}/Cargo.lock"; + }; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-warn "add_subdirectory(nod-ffi/examples)" "" + ''; + nativeBuildInputs = [ + pkgs.cmake + pkgs.ninja + pkgs.rustPlatform.cargoSetupHook + pkgs.cargo + pkgs.rustc + ]; + CARGO_NET_OFFLINE = "true"; + cmakeFlags = [ + "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" + "-DFETCHCONTENT_SOURCE_DIR_CORROSION=${corrosion}" + "-DNOD_ENABLE_INSTALL=ON" + "-DBUILD_SHARED_LIBS=OFF" + ]; + doCheck = false; + }); + + nod = + if hasNodPrebuilt then + pkgs.fetchzip { + url = "https://github.com/encounter/nod/releases/download/${nodVersion}/libnod-${ + nodPrebuiltInfo.${system}.triple + }.tar.gz"; + hash = nodPrebuiltInfo.${system}.hash; + stripRoot = false; + } + else + nodFromSource; + + fetchContentDirs = { + DAWN_PREBUILT = dawn; + NOD_PREBUILT = nod; + CXXOPTS = pkgs.cxxopts.src; + JSON = pkgs.nlohmann_json.src; + XXHASH = pkgs.xxhash.src; + ZSTD = pkgs.zstd.src; + FMT = pkgs.fetchzip { + url = "https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz"; + hash = "sha256-ZmI1Dv0ZabPlxa02OpERI47jp7zFfjpeWCy1WyuPYZ0="; + }; + TRACY = pkgs.fetchzip { + url = "https://github.com/wolfpld/tracy/archive/6789e7d6f9a65ec98926b602097a33a9676d2606.tar.gz"; + hash = "sha256-Xxyd7G/mnXEPpN+ehmwl0AkAhS3CwObpJNDgcqbdUJg="; + }; + IMGUI = pkgs.fetchFromGitHub { + owner = "ocornut"; + repo = "imgui"; + rev = "v1.91.9b-docking"; + hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ="; + }; + SQLITE3 = pkgs.fetchzip { + url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip"; + hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM="; + }; + RMLUI = pkgs.fetchzip { + url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz"; + hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg="; + }; + }; + + dusklight = + if !aurora then + throw needSubmodules + else + pkgs.stdenv.mkDerivation { + pname = "dusklight"; + version = versionSuffix; + src = ./.; + + postUnpack = '' + chmod -R u+w "$sourceRoot" + substituteInPlace "$sourceRoot/extern/aurora/CMakeLists.txt" \ + --replace-warn "add_subdirectory(tests)" "" + ''; + + nativeBuildInputs = [ + pkgs.cmake + pkgs.ninja + pkgs.pkg-config + pkgs.python3 + pkgs.python3Packages.markupsafe + ] + ++ lib.optionals (!isDarwin) [ pkgs.autoPatchelfHook ]; + + buildInputs = [ + pkgs.sdl3 + pkgs.freetype + pkgs.zstd + pkgs.cxxopts + pkgs.nlohmann_json + pkgs.xxhash + pkgs.abseil-cpp + pkgs.zlib + pkgs.libpng + pkgs.libjpeg_turbo + pkgs.curl + pkgs.openssl + ] + ++ lib.optionals isDarwin [ + pkgs.apple-sdk_15 + pkgs.libiconv + ] + ++ lib.optionals (!isDarwin) [ + pkgs.libGL + pkgs.libGLU + pkgs.libglvnd + pkgs.vulkan-loader + pkgs.libX11 + pkgs.libxcb + pkgs.libXcursor + pkgs.libxi + pkgs.libxrandr + pkgs.libxscrnsaver + pkgs.libxtst + pkgs.libxinerama + pkgs.libxkbcommon + pkgs.wayland + pkgs.libdecor + pkgs.alsa-lib + pkgs.libpulseaudio + pkgs.pipewire + pkgs.dbus + pkgs.udev + pkgs.libusb1 + pkgs.libunwind + pkgs.gtk3 + nod + ]; + + cmakeBuildType = "RelWithDebInfo"; + ninjaFlags = [ "dusklight" ]; + + cmakeFlags = [ + "-DDUSK_VERSION_OVERRIDE=${versionSuffix}" + "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" + "-DAURORA_DAWN_PROVIDER=package" + "-DAURORA_DAWN_LINKAGE=static" + "-DAURORA_NOD_PROVIDER=system" + "-DAURORA_SDL3_PROVIDER=system" + "-DBUILD_SHARED_LIBS=OFF" + ] + ++ lib.mapAttrsToList (key: src: "-DFETCHCONTENT_SOURCE_DIR_${key}=${src}") fetchContentDirs; + + installPhase = + if isDarwin then + '' + runHook preInstall + mkdir -p "$out/Applications" + cp -r Dusklight.app "$out/Applications/Dusklight.app" + runHook postInstall + '' + else + '' + runHook preInstall + install -Dm755 dusklight "$out/bin/dusklight" + cp -r "$src/res" "$out/bin/res" + install -Dm644 "$src/platforms/freedesktop/dev.twilitrealm.dusk.desktop" \ + "$out/share/applications/dev.twilitrealm.dusk.desktop" + for size in 16 32 48 64 128 256 512 1024; do + install -Dm644 "$src/platforms/freedesktop/''${size}x''${size}/apps/dev.twilitrealm.dusk.png" \ + "$out/share/icons/hicolor/''${size}x''${size}/apps/dev.twilitrealm.dusk.png" + done + runHook postInstall + ''; + + postFixup = lib.optionalString (!isDarwin) '' + patchelf \ + --add-needed "${pkgs.vulkan-loader}/lib/libvulkan.so" \ + $out/bin/dusklight + ''; + + dontStrip = true; + + meta = { + description = "Dusklight — native PC port of the Twilight Princess decompilation"; + homepage = "https://github.com/zeldaret/tp"; + platforms = supportedSystems; + mainProgram = "dusklight"; + }; + }; + + # Tooling common to every supported host (Linux and macOS). + commonDevTools = [ pkgs.cmake + pkgs.ninja pkgs.pkg-config - pkgs.wayland + pkgs.git + pkgs.python3 + pkgs.python3Packages.markupsafe + pkgs.rustc + pkgs.cargo + pkgs.sccache ]; - buildInputs = [ - pkgs.libGL - pkgs.libX11 - pkgs.libXcursor - pkgs.libxi - pkgs.libxcb - pkgs.libxrandr - pkgs.libxscrnsaver - pkgs.libxtst - pkgs.libjpeg8 - pkgs.libxkbcommon - pkgs.libglvnd + + # Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml + # so the cmake presets resolve the same set of headers as CI. + linuxDevDeps = [ + # Compilers / linkers + pkgs.clang + pkgs.lld + # C/C++ utilities + pkgs.curl + pkgs.openssl + pkgs.zlib + pkgs.libpng + pkgs.libjpeg_turbo + pkgs.freetype + pkgs.zstd + pkgs.fmt + pkgs.tracy pkgs.cxxopts pkgs.abseil-cpp pkgs.sdl3 - pkgs.fmt - pkgs.tracy - pkgs.freetype - pkgs.zstd + pkgs.ncurses + pkgs.libunwind + pkgs.libusb1 + pkgs.fuse + # Wayland / display server + pkgs.wayland + pkgs.wayland-protocols + pkgs.libxkbcommon + pkgs.libdecor + # OpenGL / Vulkan + pkgs.libGL + pkgs.libGLU + pkgs.libglvnd + pkgs.vulkan-headers + pkgs.vulkan-loader + # X11 + pkgs.libX11 + pkgs.libxcb + pkgs.libXcursor + pkgs.libxi + pkgs.libxrandr + pkgs.libxscrnsaver + pkgs.libxtst + pkgs.libxinerama + # Audio + pkgs.alsa-lib + pkgs.libpulseaudio + pkgs.pipewire + # System integration + pkgs.dbus + pkgs.udev + pkgs.gtk3 ]; + + # On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up + # Apple Clang and the Xcode SDK directly, matching the macOS CI workflow. + darwinShell = pkgs.mkShellNoCC { + packages = commonDevTools; + shellHook = '' + echo "Dusklight dev shell (macOS)" + echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK." + echo "Configure: cmake --preset macos-default-relwithdebinfo" + echo "Build: cmake --build --preset macos-default-relwithdebinfo" + ''; + }; + + linuxShell = pkgs.mkShell { + packages = commonDevTools ++ linuxDevDeps; + shellHook = '' + echo "Dusklight dev shell (Linux)" + echo "Configure: cmake --preset linux-default-relwithdebinfo" + echo " cmake --preset linux-clang-relwithdebinfo" + echo "Build: cmake --build --preset " + ''; + }; + in + { + packages = { + default = dusklight; + dusklight = dusklight; + } + // lib.optionalAttrs (!hasNodPrebuilt) { nod = nodFromSource; }; + + devShells.default = if isDarwin then darwinShell else linuxShell; }; - # Tooling common to every supported host (Linux and macOS). - commonDevTools = pkgs: [ - pkgs.cmake - pkgs.ninja - pkgs.pkg-config - pkgs.git - pkgs.python3 - pkgs.python3Packages.markupsafe - pkgs.rustc - pkgs.cargo - pkgs.sccache - ]; - - # Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml - # so the cmake presets resolve the same set of headers as CI. - linuxDevDeps = pkgs: [ - # Compilers / linkers - pkgs.clang - pkgs.lld - # C/C++ utilities - pkgs.curl - pkgs.openssl - pkgs.zlib - pkgs.libpng - pkgs.libjpeg_turbo - pkgs.freetype - pkgs.zstd - pkgs.fmt - pkgs.tracy - pkgs.cxxopts - pkgs.abseil-cpp - pkgs.sdl3 - pkgs.ncurses - pkgs.libunwind - pkgs.libusb1 - pkgs.fuse - # Wayland / display server - pkgs.wayland - pkgs.wayland-protocols - pkgs.libxkbcommon - pkgs.libdecor - # OpenGL / Vulkan - pkgs.libGL - pkgs.libGLU - pkgs.libglvnd - pkgs.vulkan-headers - pkgs.vulkan-loader - # X11 - pkgs.libX11 - pkgs.libxcb - pkgs.libXcursor - pkgs.libxi - pkgs.libxrandr - pkgs.libxscrnsaver - pkgs.libxtst - pkgs.libxinerama - # Audio - pkgs.alsa-lib - pkgs.libpulseaudio - pkgs.pipewire - # System integration - pkgs.dbus - pkgs.udev - pkgs.gtk3 - ]; - - # On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up - # Apple Clang and the Xcode SDK directly, matching the macOS CI workflow. - mkDarwinShell = pkgs: - pkgs.mkShellNoCC { - packages = commonDevTools pkgs; - shellHook = '' - echo "Dusklight dev shell (macOS)" - echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK." - echo "Configure: cmake --preset macos-default-relwithdebinfo" - echo "Build: cmake --build --preset macos-default-relwithdebinfo" - ''; - }; - - mkLinuxShell = pkgs: - pkgs.mkShell { - packages = (commonDevTools pkgs) ++ (linuxDevDeps pkgs); - shellHook = '' - echo "Dusklight dev shell (Linux)" - echo "Configure: cmake --preset linux-default-relwithdebinfo" - echo " cmake --preset linux-clang-relwithdebinfo" - echo "Build: cmake --build --preset " - ''; - }; - - mkDevShell = pkgs: - if pkgs.stdenv.isDarwin - then mkDarwinShell pkgs - else mkLinuxShell pkgs; - in { - packages.x86_64-linux.default = mkDusklight (pkgsFor "x86_64-linux"); - - devShells = forAllSystems (system: { - default = mkDevShell (pkgsFor system); - }); + systems = forAllSystems perSystem; + in + { + packages = lib.mapAttrs (_: s: s.packages) systems; + devShells = lib.mapAttrs (_: s: s.devShells) systems; }; -} \ No newline at end of file +} diff --git a/include/DynamicLink.h b/include/DynamicLink.h index 7f6d8568eb..1f9a1c8eeb 100644 --- a/include/DynamicLink.h +++ b/include/DynamicLink.h @@ -88,9 +88,9 @@ struct DynamicModuleControl : DynamicModuleControlBase { /* 0x24 */ s32 mSize; /* 0x28 */ mDoDvdThd_callback_c* mAsyncLoadCallback; - static u32 sAllocBytes; - static JKRArchive* sArchive; - static JKRFileCache* sFileCache; + static DUSK_GAME_DATA u32 sAllocBytes; + static DUSK_GAME_DATA JKRArchive* sArchive; + static DUSK_GAME_DATA JKRFileCache* sFileCache; }; #endif /* DYNAMICLINK_H */ diff --git a/include/SSystem/SComponent/c_API.h b/include/SSystem/SComponent/c_API.h index 8fcd246b2d..2bb68e5cdd 100644 --- a/include/SSystem/SComponent/c_API.h +++ b/include/SSystem/SComponent/c_API.h @@ -12,6 +12,6 @@ struct cAPI_Interface { /* 0x14 */ cAPIGph_Mthd blankingOffMtd; }; -extern cAPI_Interface g_cAPI_Interface; +DUSK_GAME_EXTERN cAPI_Interface g_cAPI_Interface; #endif /* C_API_H */ diff --git a/include/SSystem/SComponent/c_angle.h b/include/SSystem/SComponent/c_angle.h index f851033eab..f5788f75d2 100644 --- a/include/SSystem/SComponent/c_angle.h +++ b/include/SSystem/SComponent/c_angle.h @@ -24,11 +24,11 @@ private: s16 mAngle; public: - const static cSAngle _0; - const static cSAngle _1; - const static cSAngle _90; - const static cSAngle _180; - const static cSAngle _270; + const static DUSK_GAME_DATA cSAngle _0; + const static DUSK_GAME_DATA cSAngle _1; + const static DUSK_GAME_DATA cSAngle _90; + const static DUSK_GAME_DATA cSAngle _180; + const static DUSK_GAME_DATA cSAngle _270; #ifdef __MWERKS__ cSAngle() {} ~cSAngle() {} diff --git a/include/SSystem/SComponent/c_bg_s_chk.h b/include/SSystem/SComponent/c_bg_s_chk.h index adbc0c1807..6908ef80ed 100644 --- a/include/SSystem/SComponent/c_bg_s_chk.h +++ b/include/SSystem/SComponent/c_bg_s_chk.h @@ -5,7 +5,7 @@ #include "f_pc/f_pc_base.h" #include "SSystem/SComponent/c_bg_s_grp_pass_chk.h" #include "SSystem/SComponent/c_bg_s_poly_pass_chk.h" -#include "dusk/endian.h" +#include "helpers/endian.h" struct cBgD_Vtx_t : public Vec {}; diff --git a/include/SSystem/SComponent/c_bg_s_shdw_draw.h b/include/SSystem/SComponent/c_bg_s_shdw_draw.h index 9ec3023306..55792f8410 100644 --- a/include/SSystem/SComponent/c_bg_s_shdw_draw.h +++ b/include/SSystem/SComponent/c_bg_s_shdw_draw.h @@ -20,7 +20,7 @@ public: /* 0x14 */ cM3dGAab mM3dGAab; /* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun; - #if DEBUG + #if PARTIAL_DEBUG || DEBUG /* 0x34 */ int field_0x34; #endif }; diff --git a/include/SSystem/SComponent/c_cc_d.h b/include/SSystem/SComponent/c_cc_d.h index 66c71a4ead..7a8400a55a 100644 --- a/include/SSystem/SComponent/c_cc_d.h +++ b/include/SSystem/SComponent/c_cc_d.h @@ -435,7 +435,7 @@ public: cM3dGAab& GetWorkAab() { return mAab; } - static cXyz m_virtual_center; + static DUSK_GAME_DATA cXyz m_virtual_center; }; STATIC_ASSERT(0x20 == sizeof(cCcD_ShapeAttr)); diff --git a/include/SSystem/SComponent/c_counter.h b/include/SSystem/SComponent/c_counter.h index 864554b1a7..c67524fb73 100644 --- a/include/SSystem/SComponent/c_counter.h +++ b/include/SSystem/SComponent/c_counter.h @@ -9,7 +9,7 @@ struct counter_class { u32 mTimer; }; -extern counter_class g_Counter; +DUSK_GAME_EXTERN counter_class g_Counter; void cCt_Counter(int resetCounter1); diff --git a/include/SSystem/SComponent/c_lib.h b/include/SSystem/SComponent/c_lib.h index e3654846e0..4be9645bc4 100644 --- a/include/SSystem/SComponent/c_lib.h +++ b/include/SSystem/SComponent/c_lib.h @@ -98,10 +98,10 @@ T cLib_calcTimer(T* value) { void MtxInit(void); void MtxTrans(f32, f32, f32, u8); void MtxScale(f32, f32, f32, u8); -void MtxPosition(cXyz*, cXyz*); +void MtxPosition(cXyz DUSK_CONST*, cXyz*); void MtxPush(void); void MtxPull(void); -extern Mtx* calc_mtx; +DUSK_GAME_EXTERN Mtx* calc_mtx; #endif diff --git a/include/SSystem/SComponent/c_m3d.h b/include/SSystem/SComponent/c_m3d.h index 94762d5a29..50c92a2934 100644 --- a/include/SSystem/SComponent/c_m3d.h +++ b/include/SSystem/SComponent/c_m3d.h @@ -20,7 +20,7 @@ struct cM3d_Range { }; #define G_CM3D_F_INF (1000000000.0f) -extern const f32 G_CM3D_F_ABS_MIN; +DUSK_GAME_EXTERN const f32 G_CM3D_F_ABS_MIN; static void cM3d_InDivPos1(const Vec*, const Vec*, f32, Vec*); void cM3d_InDivPos2(const Vec*, const Vec*, f32, Vec*); diff --git a/include/SSystem/SComponent/c_m3d_g_tri.h b/include/SSystem/SComponent/c_m3d_g_tri.h index cac178e064..9947616d54 100644 --- a/include/SSystem/SComponent/c_m3d_g_tri.h +++ b/include/SSystem/SComponent/c_m3d_g_tri.h @@ -2,7 +2,7 @@ #define C_M3D_G_TRI_H_ #include "SSystem/SComponent/c_m3d_g_pla.h" -#include "dusk/endian.h" +#include "helpers/endian.h" class cM3dGCyl; diff --git a/include/SSystem/SComponent/c_malloc.h b/include/SSystem/SComponent/c_malloc.h index 95b2d8f298..5eb775e033 100644 --- a/include/SSystem/SComponent/c_malloc.h +++ b/include/SSystem/SComponent/c_malloc.h @@ -6,7 +6,7 @@ class JKRHeap; struct cMl { - static JKRHeap* Heap; + static DUSK_GAME_DATA JKRHeap* Heap; static void init(JKRHeap*); static void* memalignB(int, u32); static void free(void*); diff --git a/include/SSystem/SComponent/c_sxyz.h b/include/SSystem/SComponent/c_sxyz.h index bfaa035de9..4b2ea4dd45 100644 --- a/include/SSystem/SComponent/c_sxyz.h +++ b/include/SSystem/SComponent/c_sxyz.h @@ -9,7 +9,7 @@ struct SVec { class csXyz : public SVec { public: - static const csXyz Zero; + static DUSK_GAME_DATA const csXyz Zero; ~csXyz() {} csXyz() {} csXyz(s16, s16, s16); diff --git a/include/SSystem/SComponent/c_xyz.h b/include/SSystem/SComponent/c_xyz.h index 1f99737825..87cd6648d1 100644 --- a/include/SSystem/SComponent/c_xyz.h +++ b/include/SSystem/SComponent/c_xyz.h @@ -14,14 +14,14 @@ struct cXy { }; struct cXyz : Vec { - static const cXyz Zero; - static const cXyz BaseX; - static const cXyz BaseY; - static const cXyz BaseZ; - static const cXyz BaseXY; - static const cXyz BaseXZ; - static const cXyz BaseYZ; - static const cXyz BaseXYZ; + static DUSK_GAME_DATA const cXyz Zero; + static DUSK_GAME_DATA const cXyz BaseX; + static DUSK_GAME_DATA const cXyz BaseY; + static DUSK_GAME_DATA const cXyz BaseZ; + static DUSK_GAME_DATA const cXyz BaseXY; + static DUSK_GAME_DATA const cXyz BaseXZ; + static DUSK_GAME_DATA const cXyz BaseYZ; + static DUSK_GAME_DATA const cXyz BaseXYZ; #ifdef __MWERKS__ cXyz() {} ~cXyz() {} @@ -45,17 +45,17 @@ struct cXyz : Vec { ~cXyz() = default; cXyz(const cXyz& vec) = default; #endif - cXyz(f32 x, f32 y, f32 z) { + DUSK_CONSTEXPR cXyz(f32 x, f32 y, f32 z) { this->x = x; this->y = y; this->z = z; } - cXyz(const Vec& vec) { + DUSK_CONSTEXPR cXyz(const Vec& vec) { this->x = vec.x; this->y = vec.y; this->z = vec.z; } - cXyz& operator=(const Vec& vec) { + DUSK_CONSTEXPR cXyz& operator=(const Vec& vec) { this->x = vec.x; this->y = vec.y; this->z = vec.z; diff --git a/include/Z2AudioLib/Z2Audience.h b/include/Z2AudioLib/Z2Audience.h index 75998e878b..e6d2f7da3a 100644 --- a/include/Z2AudioLib/Z2Audience.h +++ b/include/Z2AudioLib/Z2Audience.h @@ -256,7 +256,7 @@ inline Z2Audience* Z2GetAudience() { return JASGlobalInstance::getInstance(); } -extern s8 data_80451358; -extern s8 data_80451359; +DUSK_GAME_EXTERN s8 data_80451358; +DUSK_GAME_EXTERN s8 data_80451359; #endif /* Z2AUDIENCE_H */ diff --git a/include/Z2AudioLib/Z2AudioMgr.h b/include/Z2AudioLib/Z2AudioMgr.h index e543bf6061..82fbdee7e4 100644 --- a/include/Z2AudioLib/Z2AudioMgr.h +++ b/include/Z2AudioLib/Z2AudioMgr.h @@ -34,7 +34,7 @@ public: bool isResetting() { return mResettingFlag; } static Z2AudioMgr* getInterface() { return mAudioMgrPtr; } - static Z2AudioMgr* mAudioMgrPtr; + static DUSK_GAME_DATA Z2AudioMgr* mAudioMgrPtr; /* 0x0514 */ virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3* posPtr); /* 0x0518 */ bool mResettingFlag; @@ -48,6 +48,8 @@ public: /* 0x1370 */ Z2FxLineMgr mFxLineMgr; #if DEBUG /* 0x13BC */ Z2DebugSys mDebugSys; + #elif PARTIAL_DEBUG + alignas(Z2DebugSys) u8 mDebugSys[sizeof(Z2DebugSys)]; #endif }; // Size: 0x138C diff --git a/include/Z2AudioLib/Z2Calc.h b/include/Z2AudioLib/Z2Calc.h index e8eee29571..ded419e9f4 100644 --- a/include/Z2AudioLib/Z2Calc.h +++ b/include/Z2AudioLib/Z2Calc.h @@ -42,8 +42,8 @@ f32 getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32 f32 getRandom(f32 magnitude, f32 exponent, f32 bias); f32 getRandom_0_1(); -extern const f32 cEqualCSlope; -extern const f32 cEqualPSlope; +DUSK_GAME_EXTERN const f32 cEqualCSlope; +DUSK_GAME_EXTERN const f32 cEqualPSlope; } // namespace Z2Calc #endif /* Z2CALC_H */ diff --git a/include/Z2AudioLib/Z2EnvSeMgr.h b/include/Z2AudioLib/Z2EnvSeMgr.h index 464da590de..f2f4dc175a 100644 --- a/include/Z2AudioLib/Z2EnvSeMgr.h +++ b/include/Z2AudioLib/Z2EnvSeMgr.h @@ -175,7 +175,7 @@ struct Z2EnvSeMgr : public JASGlobalInstance { STATIC_ASSERT(sizeof(Z2EnvSeMgr) == 0x30C); -extern Z2EnvSeMgr g_mEnvSeMgr; +DUSK_GAME_EXTERN Z2EnvSeMgr g_mEnvSeMgr; inline Z2EnvSeMgr* Z2GetEnvSeMgr() { return JASGlobalInstance::getInstance(); diff --git a/include/Z2AudioLib/Z2LinkMgr.h b/include/Z2AudioLib/Z2LinkMgr.h index cf05ed14d9..705394df5e 100644 --- a/include/Z2AudioLib/Z2LinkMgr.h +++ b/include/Z2AudioLib/Z2LinkMgr.h @@ -57,7 +57,7 @@ public: void setUsingIronBall(bool isUsingIronBall) { mUsingIronBall = isUsingIronBall; } void setMarkState(u8 state) { mMarkState = state; } - static Z2CreatureLink* mLinkPtr; + static DUSK_GAME_DATA Z2CreatureLink* mLinkPtr; static Z2CreatureLink* getLink() { return mLinkPtr; } friend class Z2LinkSoundStarter; diff --git a/include/Z2AudioLib/Z2Param.h b/include/Z2AudioLib/Z2Param.h index e6c8aac993..73e8b01256 100644 --- a/include/Z2AudioLib/Z2Param.h +++ b/include/Z2AudioLib/Z2Param.h @@ -4,72 +4,72 @@ #include struct Z2Param { - static f32 DISTANCE_MAX; - static f32 MAX_VOLUME_DISTANCE; - static f32 DOLBY_CENTER_VALUE; - static f32 DOLBY_FLONT_DISTANCE_MAX; - static f32 DOLBY_BEHIND_DISTANCE_MAX; - static f32 DISTANCE_FX_PARAM; - static f32 SONIC_SPEED; - static f32 VOL_BGM_DEFAULT; - static f32 VOL_SE_SYSTEM_DEFAULT; - static f32 VOL_SE_LINK_VOICE_DEFAULT; - static f32 VOL_SE_LINK_MOTION_DEFAULT; - static f32 VOL_SE_LINK_FOOTNOTE_DEFAULT; - static f32 VOL_SE_CHAR_VOICE_DEFAULT; - static f32 VOL_SE_CHAR_MOVE_DEFAULT; - static f32 VOL_SE_OBJECT_DEFAULT; - static f32 VOL_SE_ATMOSPHERE_DEFAULT; - static f32 VOL_BGM_TALKING; - static f32 VOL_SE_SYSTEM_TALKING; - static f32 VOL_SE_LINK_VOICE_TALKING; - static f32 VOL_SE_LINK_MOTION_TALKING; - static f32 VOL_SE_LINK_FOOTNOTE_TALKING; - static f32 VOL_SE_CHAR_VOICE_TALKING; - static f32 VOL_SE_CHAR_MOVE_TALKING; - static f32 VOL_SE_OBJECT_TALKING; - static f32 VOL_SE_ATMOSPHERE_TALKING; - static f32 VOL_BGM_PAUSING; - static f32 VOL_SE_SYSTEM_PAUSING; - static f32 VOL_SE_LINK_VOICE_PAUSING; - static f32 VOL_SE_LINK_MOTION_PAUSING; - static f32 VOL_SE_LINK_FOOTNOTE_PAUSING; - static f32 VOL_SE_CHAR_VOICE_PAUSING; - static f32 VOL_SE_CHAR_MOVE_PAUSING; - static f32 VOL_SE_OBJECT_PAUSING; - static f32 VOL_SE_ATMOSPHERE_PAUSING; - static f32 MIN_DISTANCE_VOLUME; - static f32 ENEMY_LASTHIT_MUTE_VOLUME; + static DUSK_GAME_DATA f32 DISTANCE_MAX; + static DUSK_GAME_DATA f32 MAX_VOLUME_DISTANCE; + static DUSK_GAME_DATA f32 DOLBY_CENTER_VALUE; + static DUSK_GAME_DATA f32 DOLBY_FLONT_DISTANCE_MAX; + static DUSK_GAME_DATA f32 DOLBY_BEHIND_DISTANCE_MAX; + static DUSK_GAME_DATA f32 DISTANCE_FX_PARAM; + static DUSK_GAME_DATA f32 SONIC_SPEED; + static DUSK_GAME_DATA f32 VOL_BGM_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_SYSTEM_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_LINK_VOICE_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_LINK_MOTION_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_LINK_FOOTNOTE_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_CHAR_VOICE_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_CHAR_MOVE_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_OBJECT_DEFAULT; + static DUSK_GAME_DATA f32 VOL_SE_ATMOSPHERE_DEFAULT; + static DUSK_GAME_DATA f32 VOL_BGM_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_SYSTEM_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_LINK_VOICE_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_LINK_MOTION_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_LINK_FOOTNOTE_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_CHAR_VOICE_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_CHAR_MOVE_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_OBJECT_TALKING; + static DUSK_GAME_DATA f32 VOL_SE_ATMOSPHERE_TALKING; + static DUSK_GAME_DATA f32 VOL_BGM_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_SYSTEM_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_LINK_VOICE_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_LINK_MOTION_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_LINK_FOOTNOTE_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_CHAR_VOICE_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_CHAR_MOVE_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_OBJECT_PAUSING; + static DUSK_GAME_DATA f32 VOL_SE_ATMOSPHERE_PAUSING; + static DUSK_GAME_DATA f32 MIN_DISTANCE_VOLUME; + static DUSK_GAME_DATA f32 ENEMY_LASTHIT_MUTE_VOLUME; // made up names based on HIO labels - static u8 SCENE_CHANGE_BGM_FADEOUT_TIME; - static u8 BGM_CROSS_FADEIN_TIME; - static u8 BGM_CROSS_FADEOUT_TIME; - static u8 BATTLE_BGM_WAIT_TIME; + static DUSK_GAME_DATA u8 SCENE_CHANGE_BGM_FADEOUT_TIME; + static DUSK_GAME_DATA u8 BGM_CROSS_FADEIN_TIME; + static DUSK_GAME_DATA u8 BGM_CROSS_FADEOUT_TIME; + static DUSK_GAME_DATA u8 BATTLE_BGM_WAIT_TIME; static f32 ENEMY_NEARBY_DIST; static f32 BATTLE_FADEIN_DIST; static f32 BATTLE_FADEOUT_DIST; - static u8 FOUND_TRACK_FI_TIME; - static u8 FOUND_TRACK_FO_TIME; - static u8 CLOSE_BATTLE_TRACK_FI_TIME; - static u8 CLOSE_BATTLE_TRACK_FO_TIME; + static DUSK_GAME_DATA u8 FOUND_TRACK_FI_TIME; + static DUSK_GAME_DATA u8 FOUND_TRACK_FO_TIME; + static DUSK_GAME_DATA u8 CLOSE_BATTLE_TRACK_FI_TIME; + static DUSK_GAME_DATA u8 CLOSE_BATTLE_TRACK_FO_TIME; - static u8 ENDING_BLOW_VOL_DOWN_TIME; - static u8 ENDING_BLOW_VOL_LOWER_TIME; - static u8 ENDING_BLOW_VOL_LOWER_RECOVER_TIME; - static u8 ENDING_BLOW_MIN_FINISH_TIME; + static DUSK_GAME_DATA u8 ENDING_BLOW_VOL_DOWN_TIME; + static DUSK_GAME_DATA u8 ENDING_BLOW_VOL_LOWER_TIME; + static DUSK_GAME_DATA u8 ENDING_BLOW_VOL_LOWER_RECOVER_TIME; + static DUSK_GAME_DATA u8 ENDING_BLOW_MIN_FINISH_TIME; - static u8 DARK_SE_FILTER_ON; - static u8 DARK_SE_LOW_PASS_FILTER_SETTING; - static u8 SYSTEM_SE_USE_DARK_SE_SETTING; + static DUSK_GAME_DATA u8 DARK_SE_FILTER_ON; + static DUSK_GAME_DATA u8 DARK_SE_LOW_PASS_FILTER_SETTING; + static DUSK_GAME_DATA u8 SYSTEM_SE_USE_DARK_SE_SETTING; static f32 AUDIBLE_DELTA_RANGE_VOLUME; static f32 AUDIBLE_DELTA_RANGE_PAN; static f32 AUDIBLE_DELTA_RANGE_DOLBY; }; -extern u8 data_8045086C; +DUSK_GAME_EXTERN u8 data_8045086C; #endif /* Z2PARAM_H */ diff --git a/include/Z2AudioLib/Z2SeqMgr.h b/include/Z2AudioLib/Z2SeqMgr.h index 76c2674697..94191a1318 100644 --- a/include/Z2AudioLib/Z2SeqMgr.h +++ b/include/Z2AudioLib/Z2SeqMgr.h @@ -194,7 +194,7 @@ public: JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; } JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; } - #if DEBUG + #if PARTIAL_DEBUG || DEBUG f32 field_0x00_debug; u8 field_0x04_debug; #endif diff --git a/include/Z2AudioLib/Z2SoundObjMgr.h b/include/Z2AudioLib/Z2SoundObjMgr.h index c0b4ed778c..687f9eaf0a 100644 --- a/include/Z2AudioLib/Z2SoundObjMgr.h +++ b/include/Z2AudioLib/Z2SoundObjMgr.h @@ -100,13 +100,13 @@ public: bool isForceBattle() { return forceBattle_; } JSUList* getEnemyList() { return &field_0x0; } - #if DEBUG + #if PARTIAL_DEBUG || DEBUG JSUList* getAllList() { return &allList_; } #endif private: /* 0x00 */ JSUList field_0x0; - #if DEBUG + #if PARTIAL_DEBUG || DEBUG /* 0x0C */ JSUList allList_; #endif /* 0x0C */ Z2EnemyArea enemyArea_; diff --git a/include/Z2AudioLib/Z2SoundObject.h b/include/Z2AudioLib/Z2SoundObject.h index ca4b69a520..2d85db34c0 100644 --- a/include/Z2AudioLib/Z2SoundObject.h +++ b/include/Z2AudioLib/Z2SoundObject.h @@ -7,7 +7,7 @@ struct Z2SoundStarter; class Z2SoundObjBase : public Z2SoundHandles -#if DEBUG +#if PARTIAL_DEBUG || DEBUG , public JSULink #endif { diff --git a/include/Z2AudioLib/Z2StatusMgr.h b/include/Z2AudioLib/Z2StatusMgr.h index 88bd393361..f4517bd55c 100644 --- a/include/Z2AudioLib/Z2StatusMgr.h +++ b/include/Z2AudioLib/Z2StatusMgr.h @@ -14,7 +14,7 @@ struct Z2StatusMgr : public JASGlobalInstance { void menuIn(); void menuOut(); bool isMovieDemo(); - void setDemoName(char* demoName); + void setDemoName(DUSK_CONST char* demoName); void processTime(); bool checkDayTime(); void setEventBit(void* eventBit); diff --git a/include/c/c_damagereaction.h b/include/c/c_damagereaction.h index e2c8bfe051..56b54825b7 100644 --- a/include/c/c_damagereaction.h +++ b/include/c/c_damagereaction.h @@ -12,18 +12,18 @@ public: BOOL cDmrNowMidnaTalk(); -extern u8 cDmr_SkipInfo; -extern u8 data_80450C99; -extern u8 data_80450C9A; -extern u8 data_80450C9B; -extern u8 data_80450C9C; -extern u8 data_80450C9D; -extern u8 data_80450C9E; -extern u8 cDmr_FishingWether; -extern u8 data_80450CA0; +DUSK_GAME_EXTERN u8 cDmr_SkipInfo; +DUSK_GAME_EXTERN u8 data_80450C99; +DUSK_GAME_EXTERN u8 data_80450C9A; +DUSK_GAME_EXTERN u8 data_80450C9B; +DUSK_GAME_EXTERN u8 data_80450C9C; +DUSK_GAME_EXTERN u8 data_80450C9D; +DUSK_GAME_EXTERN u8 data_80450C9E; +DUSK_GAME_EXTERN u8 cDmr_FishingWether; +DUSK_GAME_EXTERN u8 data_80450CA0; extern "C" { - extern JPTraceParticleCallBack4 JPTracePCB4; + DUSK_GAME_EXTERN JPTraceParticleCallBack4 JPTracePCB4; } void debug_actor_create(); diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index 107afc1ed3..8728bc16a8 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -57,8 +57,8 @@ public: void setNowOffsetX(f32 i_offset) { mNowOffsetX = i_offset; } void setNowOffsetY(f32 i_offset) { mNowOffsetY = i_offset; } - static bool m_eye_move_flg; - static u8 m_morf_frame; + static DUSK_GAME_DATA bool m_eye_move_flg; + static DUSK_GAME_DATA u8 m_morf_frame; /* 0x0F4 */ mutable f32 field_0xf4; /* 0x0F8 */ mutable f32 field_0xf8; @@ -88,6 +88,10 @@ public: /* 0x02C */ cXyz field_0x2c; /* 0x038 */ cXyz field_0x38[60]; /* 0x308 */ cXyz field_0x308[60]; +#if TARGET_PC + TGXTexObj mBlurTexObj; + ResTIMG* mpCachedBlurTex = nullptr; +#endif }; // Size = 0x5D8 class dAlink_bottleWaterPcallBack_c : public JPAParticleCallBack { @@ -3909,20 +3913,20 @@ public: static u32 getOtherHeapSize() { return 0xF0A60; } - static daAlink_BckData const m_mainBckShield[20]; - static daAlink_BckData const m_mainBckSword[5]; - static daAlink_BckData const m_mainBckFishing[28]; - static daAlink_AnmData const m_anmDataTable[ANM_MAX]; - static daAlink_WlAnmData const m_wlAnmDataTable[WANM_MAX]; - static daAlink_FaceTexData const m_faceTexDataTable[]; - static Vec const m_handLeftOutSidePos; - static Vec const m_handRightOutSidePos; - static Vec const m_handLeftInSidePos; - static Vec const m_handRightInSidePos; + static DUSK_GAME_DATA daAlink_BckData const m_mainBckShield[20]; + static DUSK_GAME_DATA daAlink_BckData const m_mainBckSword[5]; + static DUSK_GAME_DATA daAlink_BckData const m_mainBckFishing[28]; + static DUSK_GAME_DATA daAlink_AnmData const m_anmDataTable[ANM_MAX]; + static DUSK_GAME_DATA daAlink_WlAnmData const m_wlAnmDataTable[WANM_MAX]; + static DUSK_GAME_DATA daAlink_FaceTexData const m_faceTexDataTable[]; + static DUSK_GAME_DATA Vec const m_handLeftOutSidePos; + static DUSK_GAME_DATA Vec const m_handRightOutSidePos; + static DUSK_GAME_DATA Vec const m_handLeftInSidePos; + static DUSK_GAME_DATA Vec const m_handRightInSidePos; - static const daAlink_procInitTable m_procInitTable[]; - static daAlink_procFunc m_demoInitTable[]; - static const EffParamProc m_fEffParamProc[]; + static DUSK_GAME_DATA const daAlink_procInitTable m_procInitTable[]; + static DUSK_GAME_DATA daAlink_procFunc m_demoInitTable[]; + static DUSK_GAME_DATA const EffParamProc m_fEffParamProc[]; /* 0x0062C */ request_of_phase_process_class mPhaseReq; /* 0x00634 */ const char* mArcName; @@ -4545,13 +4549,14 @@ public: /* 0x03840 */ cXyz* mIronBallChainPos; /* 0x03844 */ csXyz* mIronBallChainAngle; /* 0x03848 */ cXyz* field_0x3848; - /* 0x0384C */ cXyz* field_0x384c; + /* 0x0384C */ cXyz DUSK_CONST* field_0x384c; /* 0x03850 */ daAlink_procFunc mpProcFunc; #if TARGET_PC void handleWolfHowl(); void handleQuickTransform(); - bool checkGyroAimContext(); + bool checkAimContext(); + bool checkAimInputContext(); void onIronBallChainInterpCallback(); @@ -4564,6 +4569,19 @@ public: cXyz mIBChainInterpCurrHandRoot; bool mIBChainInterpPrevValid; bool mIBChainInterpCurrValid; + + cXyz mHsChainInterpPrevTop; + cXyz mHsChainInterpCurrTop; + cXyz mHsChainInterpPrevRoot; + cXyz mHsChainInterpCurrRoot; + cXyz mHsChainInterpPrevSubRoot; + cXyz mHsChainInterpCurrSubRoot; + cXyz mHsChainInterpPrevSubTop; + cXyz mHsChainInterpCurrSubTop; + bool mHsChainInterpPrevValid; + bool mHsChainInterpCurrValid; + + bool mIsRollstab = false; #endif }; // Size: 0x385C @@ -4631,7 +4649,7 @@ struct daAlinkHIO_basic_c1 { class daAlinkHIO_basic_c0 { public: - static daAlinkHIO_basic_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_basic_c1 const m; }; class daAlinkHIO_basic_c : public daAlinkHIO_data_c { @@ -4682,7 +4700,7 @@ public: class daAlinkHIO_move_c0 { public: - static daAlinkHIO_move_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_move_c1 const m; }; class daAlinkHIO_move_c : public daAlinkHIO_data_c { @@ -4728,7 +4746,7 @@ public: class daAlinkHIO_atnMove_c0 { public: - static daAlinkHIO_atnMove_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_atnMove_c1 const m; }; class daAlinkHIO_atnMove_c : public daAlinkHIO_data_c { @@ -4774,7 +4792,7 @@ public: class daAlinkHIO_noActAtnMove_c0 { public: - static daAlinkHIO_noActAtnMove_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_noActAtnMove_c1 const m; }; class daAlinkHIO_noActAtnMove_c : public daAlinkHIO_data_c { @@ -4816,7 +4834,7 @@ public: class daAlinkHIO_frontRoll_c0 { public: - static daAlinkHIO_frontRoll_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_frontRoll_c1 const m; }; class daAlinkHIO_frontRoll_c : public daAlinkHIO_data_c { @@ -4846,7 +4864,7 @@ public: class daAlinkHIO_backJump_c0 { public: - static daAlinkHIO_backJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_backJump_c1 const m; }; class daAlinkHIO_backJump_c : public daAlinkHIO_data_c { @@ -4880,7 +4898,7 @@ public: class daAlinkHIO_sideStep_c0 { public: - static daAlinkHIO_sideStep_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_sideStep_c1 const m; }; class daAlinkHIO_sideStep_c : public daAlinkHIO_data_c { @@ -4918,7 +4936,7 @@ public: class daAlinkHIO_slide_c0 { public: - static daAlinkHIO_slide_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_slide_c1 const m; }; class daAlinkHIO_slide_c : public daAlinkHIO_data_c { @@ -4946,27 +4964,27 @@ public: class daAlinkHIO_cutNmV_c0 { public: - static daAlinkHIO_cutNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutNormal_c1 const m; }; class daAlinkHIO_cutNmL_c0 { public: - static daAlinkHIO_cutNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutNormal_c1 const m; }; class daAlinkHIO_cutNmR_c0 { public: - static daAlinkHIO_cutNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutNormal_c1 const m; }; class daAlinkHIO_cutNmSL_c0 { public: - static daAlinkHIO_cutNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutNormal_c1 const m; }; class daAlinkHIO_cutNmSR_c0 { public: - static daAlinkHIO_cutNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutNormal_c1 const m; }; class daAlinkHIO_cutNormal_c : public daAlinkHIO_data_c { @@ -4997,32 +5015,32 @@ public: class daAlinkHIO_cutFnL_c0 { public: - static daAlinkHIO_cutFinish_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFinish_c1 const m; }; class daAlinkHIO_cutFnV_c0 { public: - static daAlinkHIO_cutFinish_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFinish_c1 const m; }; class daAlinkHIO_cutFnS_c0 { public: - static daAlinkHIO_cutFinish_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFinish_c1 const m; }; class daAlinkHIO_cutFnSl_c0 { public: - static daAlinkHIO_cutFinish_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFinish_c1 const m; }; class daAlinkHIO_cutFnSm_c0 { public: - static daAlinkHIO_cutFinish_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFinish_c1 const m; }; class daAlinkHIO_cutFnR_c0 { public: - static daAlinkHIO_cutFinish_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFinish_c1 const m; }; class daAlinkHIO_cutFinish_c : public daAlinkHIO_data_c { @@ -5059,7 +5077,7 @@ public: class daAlinkHIO_cutFnJU_c0 { public: - static daAlinkHIO_cutFnJU_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutFnJU_c1 const m; }; class daAlinkHIO_cutFnJU_c : public daAlinkHIO_data_c { @@ -5086,17 +5104,17 @@ public: class daAlinkHIO_cutDaL_c0 { public: - static daAlinkHIO_cutDash_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutDash_c1 const m; }; class daAlinkHIO_cutDaR_c0 { public: - static daAlinkHIO_cutDash_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutDash_c1 const m; }; class daAlinkHIO_cutDaCharge_c0 { public: - static daAlinkHIO_cutDash_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutDash_c1 const m; }; class daAlinkHIO_cutDash_c : public daAlinkHIO_data_c { @@ -5128,7 +5146,7 @@ public: class daAlinkHIO_cutJump_c0 { public: - static daAlinkHIO_cutJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutJump_c1 const m; }; class daAlinkHIO_cutJump_c : public daAlinkHIO_data_c { @@ -5179,7 +5197,7 @@ public: class daAlinkHIO_cutTurn_c0 { public: - static daAlinkHIO_cutTurn_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutTurn_c1 const m; }; class daAlinkHIO_cutTurn_c : public daAlinkHIO_data_c { @@ -5207,22 +5225,22 @@ public: class daAlinkHIO_hoCutLA_c0 { public: - static daAlinkHIO_hoCut_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_hoCut_c1 const m; }; class daAlinkHIO_hoCutLB_c0 { public: - static daAlinkHIO_hoCut_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_hoCut_c1 const m; }; class daAlinkHIO_hoCutRA_c0 { public: - static daAlinkHIO_hoCut_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_hoCut_c1 const m; }; class daAlinkHIO_hoCutRB_c0 { public: - static daAlinkHIO_hoCut_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_hoCut_c1 const m; }; class daAlinkHIO_hoCut_c : public daAlinkHIO_data_c { @@ -5255,7 +5273,7 @@ public: class daAlinkHIO_hoCutCharge_c0 { public: - static daAlinkHIO_hoCutCharge_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_hoCutCharge_c1 const m; }; class daAlinkHIO_hoCutCharge_c : public daAlinkHIO_data_c { @@ -5289,7 +5307,7 @@ public: class daAlinkHIO_cutDown_c0 { public: - static daAlinkHIO_cutDown_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutDown_c1 const m; }; class daAlinkHIO_cutDown_c : public daAlinkHIO_data_c { @@ -5325,7 +5343,7 @@ public: class daAlinkHIO_cutHead_c0 { public: - static daAlinkHIO_cutHead_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutHead_c1 const m; }; class daAlinkHIO_cutHead_c : public daAlinkHIO_data_c { @@ -5362,7 +5380,7 @@ public: class daAlinkHIO_cutLargeJump_c0 { public: - static daAlinkHIO_cutLargeJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cutLargeJump_c1 const m; }; class daAlinkHIO_cutLargeJump_c : public daAlinkHIO_data_c { @@ -5439,7 +5457,7 @@ public: static daAlinkHIO_cutDown_c0 const mCutDown; static daAlinkHIO_cutHead_c0 const mCutHead; static daAlinkHIO_cutLargeJump_c0 const mCutLargeJump; - static daAlinkHIO_cut_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_cut_c1 const m; }; class daAlinkHIO_cut_c : public daAlinkHIO_data_c { @@ -5495,12 +5513,12 @@ public: class daAlinkHIO_gAtPush_c0 { public: - static daAlinkHIO_guardAttack_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_guardAttack_c1 const m; }; class daAlinkHIO_gAtKick_c0 { public: - static daAlinkHIO_guardAttack_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_guardAttack_c1 const m; }; class daAlinkHIO_guardAttack_c : public daAlinkHIO_data_c { @@ -5532,7 +5550,7 @@ public: class daAlinkHIO_turnMove_c0 { public: - static daAlinkHIO_turnMove_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_turnMove_c1 const m; }; class daAlinkHIO_turnMove_c : public daAlinkHIO_data_c { @@ -5577,7 +5595,7 @@ public: static daAlinkHIO_gAtPush_c0 const mAtPush; static daAlinkHIO_gAtKick_c0 const mAtKick; static daAlinkHIO_turnMove_c0 const mTurnMove; - static daAlinkHIO_guard_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_guard_c1 const m; }; class daAlinkHIO_guard_c : public daAlinkHIO_data_c { @@ -5616,7 +5634,7 @@ public: class daAlinkHIO_crouch_c0 { public: - static daAlinkHIO_crouch_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_crouch_c1 const m; }; class daAlinkHIO_crouch_c : public daAlinkHIO_data_c { @@ -5671,7 +5689,7 @@ public: class daAlinkHIO_autoJump_c0 { public: - static daAlinkHIO_autoJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_autoJump_c1 const m; }; class daAlinkHIO_autoJump_c : public daAlinkHIO_data_c { @@ -5701,7 +5719,7 @@ public: class daAlinkHIO_smallJump_c0 { public: - static daAlinkHIO_smallJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_smallJump_c1 const m; }; class daAlinkHIO_smallJump_c : public daAlinkHIO_data_c { @@ -5730,7 +5748,7 @@ public: class daAlinkHIO_wallCatch_c0 { public: - static daAlinkHIO_wallCatch_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wallCatch_c1 const m; }; class daAlinkHIO_wallCatch_c : public daAlinkHIO_data_c { @@ -5756,7 +5774,7 @@ public: class daAlinkHIO_wallFall_c0 { public: - static daAlinkHIO_wallFall_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wallFall_c1 const m; }; class daAlinkHIO_wallFall_c : public daAlinkHIO_data_c { @@ -5785,7 +5803,7 @@ public: class daAlinkHIO_wallMove_c0 { public: - static daAlinkHIO_wallMove_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wallMove_c1 const m; }; class daAlinkHIO_wallMove_c : public daAlinkHIO_data_c { @@ -5821,7 +5839,7 @@ public: static daAlinkHIO_wallCatch_c0 const mWallCatch; static daAlinkHIO_wallFall_c0 const mWallFall; static daAlinkHIO_wallMove_c0 const mWallMove; - static daAlinkHIO_wallHang_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wallHang_c1 const m; }; class daAlinkHIO_wallHang_c : public daAlinkHIO_data_c { @@ -5868,7 +5886,7 @@ public: class daAlinkHIO_pushpull_c0 { public: - static daAlinkHIO_pushpull_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_pushpull_c1 const m; }; class daAlinkHIO_pushpull_c : public daAlinkHIO_data_c { @@ -5902,7 +5920,7 @@ public: class daAlinkHIO_damNormal_c0 { public: - static daAlinkHIO_damNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damNormal_c1 const m; }; class daAlinkHIO_damNormal_c : public daAlinkHIO_data_c { @@ -5941,12 +5959,12 @@ public: class daAlinkHIO_damLarge_c0 { public: - static daAlinkHIO_damLaHu_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damLaHu_c1 const m; }; class daAlinkHIO_damHuge_c0 { public: - static daAlinkHIO_damLaHu_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damLaHu_c1 const m; }; class daAlinkHIO_damLaHu_c : public daAlinkHIO_data_c { @@ -5974,7 +5992,7 @@ public: class daAlinkHIO_damHorse_c0 { public: - static daAlinkHIO_damHorse_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damHorse_c1 const m; }; class daAlinkHIO_damHorse_c : public daAlinkHIO_data_c { @@ -6009,7 +6027,7 @@ public: class daAlinkHIO_damFall_c0 { public: - static daAlinkHIO_damFall_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damFall_c1 const m; }; class daAlinkHIO_damFall_c : public daAlinkHIO_data_c { @@ -6039,7 +6057,7 @@ public: class daAlinkHIO_damCaught_c0 { public: - static daAlinkHIO_damCaught_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damCaught_c1 const m; }; class daAlinkHIO_damCaught_c : public daAlinkHIO_data_c { @@ -6075,7 +6093,7 @@ public: class daAlinkHIO_damSwim_c0 { public: - static daAlinkHIO_damSwim_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damSwim_c1 const m; }; class daAlinkHIO_damSwim_c : public daAlinkHIO_data_c { @@ -6122,7 +6140,7 @@ public: class daAlinkHIO_damage_c0 { public: - static daAlinkHIO_damage_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_damage_c1 const m; static daAlinkHIO_damNormal_c0 const mDamNormal; static daAlinkHIO_damLarge_c0 const mDamLarge; static daAlinkHIO_damHuge_c0 const mDamHuge; @@ -6174,7 +6192,7 @@ public: class daAlinkHIO_horse_c0 { public: - static daAlinkHIO_horse_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_horse_c1 const m; }; class daAlinkHIO_horse_c : public daAlinkHIO_data_c { @@ -6213,7 +6231,7 @@ public: class daAlinkHIO_canoe_c0 { public: - static daAlinkHIO_canoe_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_canoe_c1 const m; }; class daAlinkHIO_canoe_c : public daAlinkHIO_data_c { @@ -6258,7 +6276,7 @@ public: class daAlinkHIO_bow_c0 { public: - static daAlinkHIO_bow_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_bow_c1 const m; }; class daAlinkHIO_bow_c : public daAlinkHIO_data_c { @@ -6294,7 +6312,7 @@ public: class daAlinkHIO_boom_c0 { public: - static daAlinkHIO_boom_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_boom_c1 const m; }; class daAlinkHIO_boom_c : public daAlinkHIO_data_c { @@ -6338,7 +6356,7 @@ public: class daAlinkHIO_bomb_c0 { public: - static daAlinkHIO_bomb_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_bomb_c1 const m; }; class daAlinkHIO_bomb_c : public daAlinkHIO_data_c { @@ -6373,7 +6391,7 @@ public: class daAlinkHIO_huLight_c0 { public: - static daAlinkHIO_huLight_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_huLight_c1 const m; }; class daAlinkHIO_wlLight_c1 { @@ -6392,7 +6410,7 @@ public: class daAlinkHIO_wlLight_c0 { public: - static daAlinkHIO_wlLight_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlLight_c1 const m; }; class daAlinkHIO_zwLight_c1 { // may be wrong @@ -6411,7 +6429,7 @@ public: class daAlinkHIO_zwLight_c0 { public: - static daAlinkHIO_zwLight_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_zwLight_c1 const m; }; class daAlinkHIO_light_c : public daAlinkHIO_data_c { @@ -6447,7 +6465,7 @@ public: class daAlinkHIO_kandelaar_c0 { public: - static daAlinkHIO_kandelaar_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_kandelaar_c1 const m; }; class daAlinkHIO_kandelaar_c : public daAlinkHIO_data_c { @@ -6486,7 +6504,7 @@ public: class daAlinkHIO_magneBoots_c0 { public: - static daAlinkHIO_magneBoots_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_magneBoots_c1 const m; }; class daAlinkHIO_magneBoots_c : public daAlinkHIO_data_c { @@ -6512,7 +6530,7 @@ public: class daAlinkHIO_fmChain_c0 { public: - static daAlinkHIO_fmChain_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_fmChain_c1 const m; }; class daAlinkHIO_fmChain_c : public daAlinkHIO_data_c { @@ -6552,7 +6570,7 @@ public: class daAlinkHIO_hookshot_c0 { public: - static daAlinkHIO_hookshot_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_hookshot_c1 const m; }; class daAlinkHIO_hookshot_c : public daAlinkHIO_data_c { @@ -6590,7 +6608,7 @@ public: class daAlinkHIO_spinner_c0 { public: - static daAlinkHIO_spinner_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_spinner_c1 const m; }; class daAlinkHIO_spinner_c : public daAlinkHIO_data_c { @@ -6646,7 +6664,7 @@ public: class daAlinkHIO_ironBall_c0 { public: - static daAlinkHIO_ironBall_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_ironBall_c1 const m; }; class daAlinkHIO_ironBall_c : public daAlinkHIO_data_c { @@ -6676,7 +6694,7 @@ public: class daAlinkHIO_copyRod_c0 { public: - static daAlinkHIO_copyRod_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_copyRod_c1 const m; }; class daAlinkHIO_copyRod_c : public daAlinkHIO_data_c { @@ -6704,7 +6722,7 @@ public: class daAlinkHIO_pickUp_c0 { public: - static daAlinkHIO_pickUp_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_pickUp_c1 const m; }; class daAlinkHIO_pickUp_c : public daAlinkHIO_data_c { @@ -6751,7 +6769,7 @@ public: class daAlinkHIO_board_c0 { public: - static daAlinkHIO_board_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_board_c1 const m; }; class daAlinkHIO_board_c : public daAlinkHIO_data_c { @@ -6784,7 +6802,7 @@ public: class daAlinkHIO_bottle_c0 { public: - static daAlinkHIO_bottle_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_bottle_c1 const m; }; class daAlinkHIO_bottle_c : public daAlinkHIO_data_c { @@ -6832,7 +6850,7 @@ public: static daAlinkHIO_ironBall_c0 const mIronBall; static daAlinkHIO_copyRod_c0 const mCopyRod; static daAlinkHIO_zwLight_c0 const mZoraArmorPL; - static daAlinkHIO_item_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_item_c1 const m; }; class daAlinkHIO_item_c : public daAlinkHIO_data_c { @@ -6891,7 +6909,7 @@ public: class daAlinkHIO_ladder_c0 { public: - static daAlinkHIO_ladder_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_ladder_c1 const m; }; class daAlinkHIO_ladder_c : public daAlinkHIO_data_c { @@ -6931,7 +6949,7 @@ public: class daAlinkHIO_roofHang_c0 { public: - static daAlinkHIO_roofHang_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_roofHang_c1 const m; }; class daAlinkHIO_roofHang_c : public daAlinkHIO_data_c { @@ -6969,7 +6987,7 @@ public: class daAlinkHIO_grab_c0 { public: - static daAlinkHIO_grab_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_grab_c1 const m; }; class daAlinkHIO_grab_c : public daAlinkHIO_data_c { @@ -7044,7 +7062,7 @@ public: class daAlinkHIO_swim_c0 { public: - static daAlinkHIO_swim_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_swim_c1 const m; }; class daAlinkHIO_swim_c : public daAlinkHIO_data_c { @@ -7120,7 +7138,7 @@ public: class daAlinkHIO_wlMove_c0 { public: - static daAlinkHIO_wlMove_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlMove_c1 const m; }; class daAlinkHIO_wlMove_c : public daAlinkHIO_data_c { @@ -7163,7 +7181,7 @@ public: class daAlinkHIO_wlMoveNoP_c0 { public: - static daAlinkHIO_wlMoveNoP_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlMoveNoP_c1 const m; }; class daAlinkHIO_wlMoveNoP_c : public daAlinkHIO_data_c { @@ -7202,7 +7220,7 @@ public: class daAlinkHIO_wlAtnMove_c0 { public: - static daAlinkHIO_wlAtnMove_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtnMove_c1 const m; }; class daAlinkHIO_wlAtnMove_c : public daAlinkHIO_data_c { @@ -7234,7 +7252,7 @@ public: class daAlinkHIO_wlHowl_c0 { public: - static daAlinkHIO_wlHowl_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlHowl_c1 const m; }; class daAlinkHIO_wlHowl_c : public daAlinkHIO_data_c { @@ -7268,7 +7286,7 @@ public: class daAlinkHIO_wlSideStep_c0 { public: - static daAlinkHIO_wlSideStep_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlSideStep_c1 const m; }; class daAlinkHIO_wlSideStep_c : public daAlinkHIO_data_c { @@ -7298,7 +7316,7 @@ public: class daAlinkHIO_wlBackJump_c0 { public: - static daAlinkHIO_wlBackJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlBackJump_c1 const m; }; class daAlinkHIO_wlBackJump_c : public daAlinkHIO_data_c { @@ -7343,7 +7361,7 @@ public: class daAlinkHIO_wlAutoJump_c0 { public: - static daAlinkHIO_wlAutoJump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAutoJump_c1 const m; }; class daAlinkHIO_wlAutoJump_c : public daAlinkHIO_data_c { @@ -7372,7 +7390,7 @@ public: class daAlinkHIO_wlPush_c0 { public: - static daAlinkHIO_wlPush_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlPush_c1 const m; }; class daAlinkHIO_wlPush_c : public daAlinkHIO_data_c { @@ -7408,7 +7426,7 @@ public: class daAlinkHIO_wlLie_c0 { public: - static daAlinkHIO_wlLie_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlLie_c1 const m; }; class daAlinkHIO_wlLie_c : public daAlinkHIO_data_c { @@ -7447,7 +7465,7 @@ public: class daAlinkHIO_wlWallHang_c0 { public: - static daAlinkHIO_wlWallHang_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlWallHang_c1 const m; }; class daAlinkHIO_wlWallHang_c : public daAlinkHIO_data_c { @@ -7479,7 +7497,7 @@ public: class daAlinkHIO_wlDamNormal_c0 { public: - static daAlinkHIO_wlDamNormal_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlDamNormal_c1 const m; }; class daAlinkHIO_wlDamNormal_c : public daAlinkHIO_data_c { @@ -7514,12 +7532,12 @@ public: class daAlinkHIO_wlDamLarge_c0 { public: - static daAlinkHIO_wlDamLaHu_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlDamLaHu_c1 const m; }; class daAlinkHIO_wlDamHuge_c0 { public: - static daAlinkHIO_wlDamLaHu_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlDamLaHu_c1 const m; }; class daAlinkHIO_wlDamLaHu_c : public daAlinkHIO_data_c { @@ -7548,7 +7566,7 @@ public: class daAlinkHIO_wlDamCaught_c0 { public: - static daAlinkHIO_wlDamCaught_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlDamCaught_c1 const m; }; class daAlinkHIO_wlDamCaught_c : public daAlinkHIO_data_c { @@ -7581,7 +7599,7 @@ public: class daAlinkHIO_wlDamFall_c0 { public: - static daAlinkHIO_wlDamFall_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlDamFall_c1 const m; }; class daAlinkHIO_wlDamFall_c : public daAlinkHIO_data_c { @@ -7608,7 +7626,7 @@ public: class daAlinkHIO_wlDamage_c0 { public: - static daAlinkHIO_wlDamage_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlDamage_c1 const m; static daAlinkHIO_wlDamNormal_c0 const mNormal; static daAlinkHIO_wlDamLarge_c0 const mLarge; static daAlinkHIO_wlDamHuge_c0 const mHuge; @@ -7658,7 +7676,7 @@ public: class daAlinkHIO_wlSlide_c0 { public: - static daAlinkHIO_wlSlide_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlSlide_c1 const m; }; class daAlinkHIO_wlSlide_c : public daAlinkHIO_data_c { @@ -7693,7 +7711,7 @@ public: class daAlinkHIO_wlRope_c0 { public: - static daAlinkHIO_wlRope_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlRope_c1 const m; }; class daAlinkHIO_wlRope_c : public daAlinkHIO_data_c { @@ -7729,17 +7747,17 @@ public: class daAlinkHIO_wlAtWaTl_c0 { public: - static daAlinkHIO_wlAtWait_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtWait_c1 const m; }; class daAlinkHIO_wlAtWaSc_c0 { public: - static daAlinkHIO_wlAtWait_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtWait_c1 const m; }; class daAlinkHIO_wlAtWaLr_c0 { public: - static daAlinkHIO_wlAtWait_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtWait_c1 const m; }; class daAlinkHIO_wlAtWait_c : public daAlinkHIO_data_c { @@ -7766,7 +7784,7 @@ public: class daAlinkHIO_wlAtRoll_c0 { public: - static daAlinkHIO_wlAtRoll_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtRoll_c1 const m; }; class daAlinkHIO_wlAtRoll_c : public daAlinkHIO_data_c { @@ -7801,7 +7819,7 @@ public: class daAlinkHIO_wlAtNjump_c0 { public: - static daAlinkHIO_wlAtNjump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtNjump_c1 const m; }; class daAlinkHIO_wlAtNjump_c : public daAlinkHIO_data_c { @@ -7842,7 +7860,7 @@ public: class daAlinkHIO_wlAtCjump_c0 { public: - static daAlinkHIO_wlAtCjump_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtCjump_c1 const m; }; class daAlinkHIO_wlAtCjump_c : public daAlinkHIO_data_c { @@ -7870,7 +7888,7 @@ public: class daAlinkHIO_wlAtLand_c0 { public: - static daAlinkHIO_wlAtLand_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtLand_c1 const m; }; class daAlinkHIO_wlAtLand_c : public daAlinkHIO_data_c { @@ -7906,7 +7924,7 @@ public: class daAlinkHIO_wlAtDown_c0 { public: - static daAlinkHIO_wlAtDown_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtDown_c1 const m; }; class daAlinkHIO_wlAtDown_c : public daAlinkHIO_data_c { @@ -7943,7 +7961,7 @@ public: class daAlinkHIO_wlAtLock_c0 { public: - static daAlinkHIO_wlAtLock_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtLock_c1 const m; }; class daAlinkHIO_wlAtLock_c : public daAlinkHIO_data_c { @@ -7983,7 +8001,7 @@ public: class daAlinkHIO_wlAtBite_c0 { public: - static daAlinkHIO_wlAtBite_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAtBite_c1 const m; }; class daAlinkHIO_wlAtBite_c : public daAlinkHIO_data_c { @@ -8028,7 +8046,7 @@ public: static daAlinkHIO_wlAtDown_c0 const mWlAtDown; static daAlinkHIO_wlAtLock_c0 const mWlAtLock; static daAlinkHIO_wlAtBite_c0 const mWlAtBite; - static daAlinkHIO_wlAttack_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlAttack_c1 const m; }; class daAlinkHIO_wlAttack_c : public daAlinkHIO_data_c { @@ -8075,7 +8093,7 @@ public: class daAlinkHIO_wlPoint_c0 { public: - static daAlinkHIO_wlPoint_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlPoint_c1 const m; }; class daAlinkHIO_wlPoint_c : public daAlinkHIO_data_c { @@ -8111,7 +8129,7 @@ public: class daAlinkHIO_wlChain_c0 { public: - static daAlinkHIO_wlChain_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlChain_c1 const m; }; class daAlinkHIO_wlChain_c : public daAlinkHIO_data_c { @@ -8168,7 +8186,7 @@ public: class daAlinkHIO_wlSwim_c0 { public: - static daAlinkHIO_wlSwim_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlSwim_c1 const m; }; class daAlinkHIO_wlSwim_c : public daAlinkHIO_data_c { @@ -8197,7 +8215,7 @@ public: class daAlinkHIO_wlGrab_c0 { public: - static daAlinkHIO_wlGrab_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlGrab_c1 const m; }; class daAlinkHIO_wlGrab_c : public daAlinkHIO_data_c { @@ -8227,7 +8245,7 @@ public: class daAlinkHIO_wlBall_c0 { public: - static daAlinkHIO_wlBall_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wlBall_c1 const m; }; class daAlinkHIO_wlBall_c : public daAlinkHIO_data_c { @@ -8282,7 +8300,7 @@ public: static daAlinkHIO_wlSwim_c0 const mWlSwim; static daAlinkHIO_wlGrab_c0 const mWlGrab; static daAlinkHIO_wlBall_c0 const mWlBall; - static daAlinkHIO_wolf_c1 const m; + static DUSK_GAME_DATA daAlinkHIO_wolf_c1 const m; }; class daAlinkHIO_wolf_c : public daAlinkHIO_data_c { diff --git a/include/d/actor/d_a_arrow.h b/include/d/actor/d_a_arrow.h index 682ffd43d7..47f86eeb50 100644 --- a/include/d/actor/d_a_arrow.h +++ b/include/d/actor/d_a_arrow.h @@ -161,7 +161,7 @@ private: /* 0xA10 */ dPa_hermiteEcallBack_c field_0xa10; /* 0xA28 */ int (daArrow_c::*mProcFunc)(); - static s16 m_count; + static DUSK_GAME_DATA s16 m_count; }; STATIC_ASSERT(sizeof(daArrow_c) == 0xA34); diff --git a/include/d/actor/d_a_b_tn.h b/include/d/actor/d_a_b_tn.h index 0a782d7f89..7de1007d28 100644 --- a/include/d/actor/d_a_b_tn.h +++ b/include/d/actor/d_a_b_tn.h @@ -203,7 +203,7 @@ private: /* 0x0AAD */ bool mStayNo2Flag; /* 0x0AAE */ u8 mBlendStatus; /* 0x0AB0 */ f32 mBlend; - /* 0x0AB4 */ char* mArcName; + /* 0x0AB4 */ char DUSK_CONST* mArcName; /* 0x0AB8 */ dBgS_AcchCir mAcchCir; /* 0x0AF8 */ dBgS_ObjAcch mAcch; /* 0x0CD0 */ dBgS_AcchCir mAcchCirArr[16]; diff --git a/include/d/actor/d_a_balloon_2D.h b/include/d/actor/d_a_balloon_2D.h index 193ecadbaa..80aa3e3b02 100644 --- a/include/d/actor/d_a_balloon_2D.h +++ b/include/d/actor/d_a_balloon_2D.h @@ -67,7 +67,7 @@ public: void hide() { mIsVisible = 0; } u8 isVisible() { return mIsVisible; } - static daBalloon2D_c* myclass; + static DUSK_GAME_DATA daBalloon2D_c* myclass; struct ScoreCount { cXyz field_0x0; diff --git a/include/d/actor/d_a_bg_obj.h b/include/d/actor/d_a_bg_obj.h index fc4df6ab4e..aab9572183 100644 --- a/include/d/actor/d_a_bg_obj.h +++ b/include/d/actor/d_a_bg_obj.h @@ -89,10 +89,10 @@ public: void setAction(u8 i_action) { mAction = i_action; } - static createHeapFunc mCreateHeapFunc[]; - static createInitFunc mCreateInitFunc[]; - static executeFunc mExecuteFunc[]; - static tgSetFunc mTgSetFunc[]; + static DUSK_GAME_DATA createHeapFunc mCreateHeapFunc[]; + static DUSK_GAME_DATA createInitFunc mCreateInitFunc[]; + static DUSK_GAME_DATA executeFunc mExecuteFunc[]; + static DUSK_GAME_DATA tgSetFunc mTgSetFunc[]; /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* field_0x5a8[2][2]; diff --git a/include/d/actor/d_a_boomerang.h b/include/d/actor/d_a_boomerang.h index 6dcff6ef9f..fe39f226b7 100644 --- a/include/d/actor/d_a_boomerang.h +++ b/include/d/actor/d_a_boomerang.h @@ -190,12 +190,12 @@ STATIC_ASSERT(sizeof(daBoomerang_c) == 0xDE4); class daBoomerang_HIO_c0 { public: - static u16 const m_lockWaitTime; - static f32 const m_minCircleR; - static f32 const m_middleCircleR; - static f32 const m_maxCircleR; - static f32 const m_scale; - static f32 const m_lockWindScale; + static DUSK_GAME_DATA u16 const m_lockWaitTime; + static DUSK_GAME_DATA f32 const m_minCircleR; + static DUSK_GAME_DATA f32 const m_middleCircleR; + static DUSK_GAME_DATA f32 const m_maxCircleR; + static DUSK_GAME_DATA f32 const m_scale; + static DUSK_GAME_DATA f32 const m_lockWindScale; }; #endif /* D_A_BOOMERANG_H */ diff --git a/include/d/actor/d_a_bullet.h b/include/d/actor/d_a_bullet.h index d6f9135654..d925502779 100644 --- a/include/d/actor/d_a_bullet.h +++ b/include/d/actor/d_a_bullet.h @@ -18,7 +18,7 @@ class daBullet_Param_c { public: virtual ~daBullet_Param_c() {} - static daBullet_HIOParam const m; + static DUSK_GAME_DATA daBullet_HIOParam const m; }; #if DEBUG @@ -80,8 +80,8 @@ public: int wait(void*); int move(void*); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; }; STATIC_ASSERT(sizeof(daBullet_c) == 0x95c); diff --git a/include/d/actor/d_a_coach_fire.h b/include/d/actor/d_a_coach_fire.h index c5f890dc3d..f669525e9c 100644 --- a/include/d/actor/d_a_coach_fire.h +++ b/include/d/actor/d_a_coach_fire.h @@ -33,7 +33,7 @@ public: const CoachFireAttr& attr() { return M_attr; } - static CoachFireAttr const M_attr; + static DUSK_GAME_DATA CoachFireAttr const M_attr; inline ~daCoachFire_c(); diff --git a/include/d/actor/d_a_cstaF.h b/include/d/actor/d_a_cstaF.h index 0e8b5c1ca7..9cb9e06ff7 100644 --- a/include/d/actor/d_a_cstaF.h +++ b/include/d/actor/d_a_cstaF.h @@ -38,7 +38,7 @@ public: struct BckTbl { u16 idx[4]; }; - static const BckTbl m_bckIdxTable[]; + static DUSK_GAME_DATA const BckTbl m_bckIdxTable[]; private: /* 0x5A0 */ const char* m_arcName; diff --git a/include/d/actor/d_a_cstatue.h b/include/d/actor/d_a_cstatue.h index e20e683398..ca0b3ca616 100644 --- a/include/d/actor/d_a_cstatue.h +++ b/include/d/actor/d_a_cstatue.h @@ -99,7 +99,7 @@ public: mWarpMode = daCstatueWarpMode_Active; } - static u16 const m_bckIdxTable[daCstatueType_N][7]; + static DUSK_GAME_DATA u16 const m_bckIdxTable[daCstatueType_N][7]; private: /* 0x568 */ const char* mResName; diff --git a/include/d/actor/d_a_door_boss.h b/include/d/actor/d_a_door_boss.h index ed7afe97d4..afd7984bf1 100644 --- a/include/d/actor/d_a_door_boss.h +++ b/include/d/actor/d_a_door_boss.h @@ -23,10 +23,10 @@ public: /* 3 */ ACT_END, }; - char* getArcName(); - char* getBmd(); - char* getDzb(); - char* getBmd2(); + DUSK_CONST char* getArcName(); + DUSK_CONST char* getBmd(); + DUSK_CONST char* getDzb(); + DUSK_CONST char* getBmd2(); J3DModelData* getDoorModelData(); int CreateHeap(); void calcMtx(); diff --git a/include/d/actor/d_a_door_bossL1.h b/include/d/actor/d_a_door_bossL1.h index 397b7d90ce..7e14025cd2 100644 --- a/include/d/actor/d_a_door_bossL1.h +++ b/include/d/actor/d_a_door_bossL1.h @@ -33,8 +33,8 @@ public: typedef int (daBdoorL1_c::*actionFunc)(); - char* getDoorEventName(); - char* getDoorEventName2(); + DUSK_CONST char* getDoorEventName(); + DUSK_CONST char* getDoorEventName2(); const char* getArcName(); const char* getAnmArcName(); int getDoorType(); diff --git a/include/d/actor/d_a_door_dbdoor00.h b/include/d/actor/d_a_door_dbdoor00.h index e635eb4f00..9b2f65e756 100644 --- a/include/d/actor/d_a_door_dbdoor00.h +++ b/include/d/actor/d_a_door_dbdoor00.h @@ -14,11 +14,11 @@ */ class daDbDoor00_c : public fopAc_ac_c { public: - char* getAlwaysArcName(); - char* getDzb(); - char* getDummyBmdName(); - char* getBmdArcName(); - char* getBmdName(); + DUSK_CONST char* getAlwaysArcName(); + DUSK_CONST char* getDzb(); + DUSK_CONST char* getDummyBmdName(); + DUSK_CONST char* getBmdArcName(); + DUSK_CONST char* getBmdName(); J3DModelData* getDoorModelData(); int CreateHeap(); void calcMtx(); diff --git a/include/d/actor/d_a_door_knob00.h b/include/d/actor/d_a_door_knob00.h index d6e0fd5db2..577b26b58e 100644 --- a/include/d/actor/d_a_door_knob00.h +++ b/include/d/actor/d_a_door_knob00.h @@ -29,11 +29,11 @@ public: typedef int (daKnob20_c::*actionFunc)(); - char* getAlwaysArcName(); - char* getEvArcName(); - char* getDzb(); - char* getDummyBmd(); - char* getBmd(); + DUSK_CONST char* getAlwaysArcName(); + DUSK_CONST char* getEvArcName(); + DUSK_CONST char* getDzb(); + DUSK_CONST char* getDummyBmd(); + DUSK_CONST char* getBmd(); J3DModelData* getDoorModelData(); int CreateHeap(); void calcMtx(); diff --git a/include/d/actor/d_a_door_mbossL1.h b/include/d/actor/d_a_door_mbossL1.h index fc49529018..2bd95d920b 100644 --- a/include/d/actor/d_a_door_mbossL1.h +++ b/include/d/actor/d_a_door_mbossL1.h @@ -54,15 +54,15 @@ public: typedef int (daMBdoorL1_c::*actionFunc)(); - char* getAnmArcName(); - char* getArcName(); - char* getAlwaysArcName(); + DUSK_CONST char* getAnmArcName(); + DUSK_CONST char* getArcName(); + DUSK_CONST char* getAlwaysArcName(); int getDoorType(); - char* getOpenAnm(); - char* getCloseAnm(); - char* getBmd(); - char* getBtk(); - char* getDzb(); + DUSK_CONST char* getOpenAnm(); + DUSK_CONST char* getCloseAnm(); + DUSK_CONST char* getBmd(); + DUSK_CONST char* getBtk(); + DUSK_CONST char* getDzb(); J3DModelData* getDoorModelData(); int CreateHeap(); void calcMtx(); diff --git a/include/d/actor/d_a_door_shutter.h b/include/d/actor/d_a_door_shutter.h index 1b32c7d357..a8e99f1295 100644 --- a/include/d/actor/d_a_door_shutter.h +++ b/include/d/actor/d_a_door_shutter.h @@ -45,12 +45,12 @@ public: ACTION_DEMO, }; - char* getStopBmdName(); + char DUSK_CONST* getStopBmdName(); J3DModelData* getStopModelData(); - char* getAlwaysArcName(); - char* getArcName(); - char* getBmdName(); - char* getBtk(); + char DUSK_CONST* getAlwaysArcName(); + char DUSK_CONST* getArcName(); + char DUSK_CONST* getBmdName(); + char DUSK_CONST* getBtk(); J3DModelData* getModelData(); f32 getSize2X(); int CreateHeap(); @@ -115,7 +115,7 @@ public: int chkStopOpen(); int chkMakeKey(); - virtual char* getDzbName(); + virtual char DUSK_CONST* getDzbName(); virtual int getDemoAction(); void onFlag(u16 flag) { field_0x68e |= flag; } diff --git a/include/d/actor/d_a_dshutter.h b/include/d/actor/d_a_dshutter.h index 479349c072..fb6d56ba97 100644 --- a/include/d/actor/d_a_dshutter.h +++ b/include/d/actor/d_a_dshutter.h @@ -65,15 +65,15 @@ public: f32 getCloseBoundSpeed() { return CLOSE_BOUND_SPEED; } f32 getCloseBoundRatio() { return CLOSE_BOUND_RATIO; } - static f32 const OPEN_SIZE; - static f32 const OPEN_ACCEL; - static f32 const OPEN_SPEED; - static f32 const OPEN_BOUND_SPEED; - static f32 const OPEN_BOUND_RATIO; - static f32 const CLOSE_ACCEL; - static f32 const CLOSE_SPEED; - static f32 const CLOSE_BOUND_SPEED; - static f32 const CLOSE_BOUND_RATIO; + static DUSK_GAME_DATA f32 const OPEN_SIZE; + static DUSK_GAME_DATA f32 const OPEN_ACCEL; + static DUSK_GAME_DATA f32 const OPEN_SPEED; + static DUSK_GAME_DATA f32 const OPEN_BOUND_SPEED; + static DUSK_GAME_DATA f32 const OPEN_BOUND_RATIO; + static DUSK_GAME_DATA f32 const CLOSE_ACCEL; + static DUSK_GAME_DATA f32 const CLOSE_SPEED; + static DUSK_GAME_DATA f32 const CLOSE_BOUND_SPEED; + static DUSK_GAME_DATA f32 const CLOSE_BOUND_RATIO; /* 0x5A0 */ dComIfG_resLoader_c mResLoader; /* 0x5B0 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_e_arrow.h b/include/d/actor/d_a_e_arrow.h index 4e592eef8e..00f3218783 100644 --- a/include/d/actor/d_a_e_arrow.h +++ b/include/d/actor/d_a_e_arrow.h @@ -32,7 +32,7 @@ public: /* 0x5B4 */ J3DModel* mpModel; /* 0x5B8 */ u8 mArrowType; /* 0x5B9 */ u8 mFlags; - /* 0x5BC */ char* mResName; + /* 0x5BC */ char DUSK_CONST* mResName; /* 0x5C0 */ s16 field_0x5c0; /* 0x5C2 */ s16 mAction; /* 0x5C4 */ s16 mMode; diff --git a/include/d/actor/d_a_e_ba.h b/include/d/actor/d_a_e_ba.h index aeb4b3506b..6bcb4758be 100644 --- a/include/d/actor/d_a_e_ba.h +++ b/include/d/actor/d_a_e_ba.h @@ -60,7 +60,7 @@ public: /* 0x5B5 */ u8 mDistanceParam; /* 0x5B6 */ u8 mType; /* 0x5B7 */ u8 mPathIndex; - /* 0x5B8 */ char* mArcName; + /* 0x5B8 */ DUSK_CONST char* mArcName; /* 0x5BC */ u8 field_0x5bc; /* 0x5BD */ s8 mPathPoint; /* 0x5BE */ s8 mPathStep; diff --git a/include/d/actor/d_a_e_dt.h b/include/d/actor/d_a_e_dt.h index 1296a78e5b..c5c83c76e0 100644 --- a/include/d/actor/d_a_e_dt.h +++ b/include/d/actor/d_a_e_dt.h @@ -175,14 +175,14 @@ private: STATIC_ASSERT(sizeof(daE_DT_c) == 0x1174); struct E_DT_n { - static f32 eDt_ShakeFrame[10]; - static f32 eDt_ShakeFrameDemo[10]; - static dCcD_SrcSph cc_dt_body_src; - static dCcD_SrcSph cc_dt_tongue_src; - static int mDt_OtamaNum; - static int mDt_OtamaNo[20]; - static int m_fall_no; - static cXyz m_tongue_pos; + static DUSK_GAME_DATA f32 eDt_ShakeFrame[10]; + static DUSK_GAME_DATA f32 eDt_ShakeFrameDemo[10]; + static DUSK_GAME_DATA dCcD_SrcSph cc_dt_body_src; + static DUSK_GAME_DATA dCcD_SrcSph cc_dt_tongue_src; + static DUSK_GAME_DATA int mDt_OtamaNum; + static DUSK_GAME_DATA int mDt_OtamaNo[20]; + static DUSK_GAME_DATA int m_fall_no; + static DUSK_GAME_DATA cXyz m_tongue_pos; }; diff --git a/include/d/actor/d_a_e_ge.h b/include/d/actor/d_a_e_ge.h index c202e75231..527e5bb5fa 100644 --- a/include/d/actor/d_a_e_ge.h +++ b/include/d/actor/d_a_e_ge.h @@ -101,7 +101,7 @@ private: /* 0xB9E */ u8 field_0xb9e; /* 0xB9F */ u8 mHIOInit; - static actionFunc l_actionmenu[9]; + static DUSK_GAME_DATA actionFunc l_actionmenu[9]; }; STATIC_ASSERT(sizeof(daE_GE_c) == 0xBA0); diff --git a/include/d/actor/d_a_e_oc.h b/include/d/actor/d_a_e_oc.h index ada1b5310b..7f60afa878 100644 --- a/include/d/actor/d_a_e_oc.h +++ b/include/d/actor/d_a_e_oc.h @@ -159,14 +159,14 @@ private: STATIC_ASSERT(sizeof(daE_OC_c) == 0xe88); struct E_OC_n { - static f32 const oc_attackb_trans[10]; - static f32 const oc_attackc_trans[10]; - static dCcD_SrcSph cc_sph_src; - static dCcD_SrcSph at_sph_src; - static daE_OC_c* m_battle_oc; - static daE_OC_c* m_damage_oc; - static daE_OC_c* m_death_oc; - static daE_OC_c* m_talk_oc; + static DUSK_GAME_DATA f32 const oc_attackb_trans[10]; + static DUSK_GAME_DATA f32 const oc_attackc_trans[10]; + static DUSK_GAME_DATA dCcD_SrcSph cc_sph_src; + static DUSK_GAME_DATA dCcD_SrcSph at_sph_src; + static DUSK_GAME_DATA daE_OC_c* m_battle_oc; + static DUSK_GAME_DATA daE_OC_c* m_damage_oc; + static DUSK_GAME_DATA daE_OC_c* m_death_oc; + static DUSK_GAME_DATA daE_OC_c* m_talk_oc; }; #endif /* D_A_E_OC_H */ diff --git a/include/d/actor/d_a_e_rd.h b/include/d/actor/d_a_e_rd.h index ad27501841..c84b412589 100644 --- a/include/d/actor/d_a_e_rd.h +++ b/include/d/actor/d_a_e_rd.h @@ -38,7 +38,7 @@ public: /* 0x05CC */ s16 target_ya; /* 0x05D0 */ mDoExt_McaMorfSO* anm_p; /* 0x05D4 */ Z2CreatureEnemy sound; - /* 0x0678 */ char* resName; + /* 0x0678 */ DUSK_CONST char* resName; /* 0x067C */ int anm; /* 0x0680 */ int field_0x680; /* 0x0684 */ dJntCol_c mJntCol; diff --git a/include/d/actor/d_a_e_rdy.h b/include/d/actor/d_a_e_rdy.h index 0a318f2b38..51037ecac9 100644 --- a/include/d/actor/d_a_e_rdy.h +++ b/include/d/actor/d_a_e_rdy.h @@ -36,7 +36,7 @@ public: /* 0x05C8 */ s16 mTargetAngleY; /* 0x05CC */ mDoExt_McaMorfSO* mpMorf; /* 0x05D0 */ Z2CreatureEnemy mSound; - /* 0x0674 */ char* mpArcName; + /* 0x0674 */ char DUSK_CONST* mpArcName; /* 0x0678 */ int mAnm; /* 0x067C */ u8 field_0x67c[0x680 - 0x67c]; /* 0x0680 */ dJntCol_c mJntCol; diff --git a/include/d/actor/d_a_e_tt.h b/include/d/actor/d_a_e_tt.h index 8798393740..f3b79a69b3 100644 --- a/include/d/actor/d_a_e_tt.h +++ b/include/d/actor/d_a_e_tt.h @@ -63,7 +63,7 @@ private: /* 0x6D4 */ f32 field_0x6d4; /* 0x6D8 */ s16 mFootJoints[4]; /* 0x6E0 */ s16 field_0x6e0; - /* 0x6E4 */ char* mpResName; + /* 0x6E4 */ char DUSK_CONST* mpResName; /* 0x6E8 */ u16 mDamageCooldownTimer; /* 0x6EA */ u8 mGenericTimer; /* 0x6EC */ int mAttackTimer; diff --git a/include/d/actor/d_a_e_wb.h b/include/d/actor/d_a_e_wb.h index ba680366fb..aecbac96a1 100644 --- a/include/d/actor/d_a_e_wb.h +++ b/include/d/actor/d_a_e_wb.h @@ -99,7 +99,7 @@ public: /* 0x0000 */ fopEn_enemy_c enemy; ///< @brief Base enemy class instance. /* 0x05AC */ request_of_phase_process_class phase; ///< @brief Phase process request handler. /* 0x05B4 */ s16 ride_mode; ///< @brief Current sub-action mode within the run action. - /* 0x05B8 */ char* resName; ///< @brief Resource name for loading models/animations. + /* 0x05B8 */ char DUSK_CONST* resName; ///< @brief Resource name for loading models/animations. /* 0x05BC */ u8 arg0; ///< @brief Creation parameter 1. /* 0x05BD */ u8 arg1; ///< @brief Creation parameter 2. /* 0x05BE */ u8 field_0x5be; diff --git a/include/d/actor/d_a_e_ym.h b/include/d/actor/d_a_e_ym.h index 3217592e13..9638736b46 100644 --- a/include/d/actor/d_a_e_ym.h +++ b/include/d/actor/d_a_e_ym.h @@ -215,7 +215,7 @@ private: STATIC_ASSERT(sizeof(daE_YM_c) == 0xAF8); struct E_YM_n { - static dCcD_SrcSph cc_sph_src; + static DUSK_GAME_DATA dCcD_SrcSph cc_sph_src; }; diff --git a/include/d/actor/d_a_formation_mng.h b/include/d/actor/d_a_formation_mng.h index 79163f9cec..c308eb5352 100644 --- a/include/d/actor/d_a_formation_mng.h +++ b/include/d/actor/d_a_formation_mng.h @@ -311,10 +311,10 @@ struct daFmtMng_c : public fopAc_ac_c { } static FmtMngAttributes const& attr() { return M_attr; } - static FmtMngAttributes const M_attr; + static DUSK_GAME_DATA FmtMngAttributes const M_attr; typedef void (daFmtMng_c::*ActionFunc)(); - static daFmtMng_c::ActionFunc ActionTable[10]; + static DUSK_GAME_DATA daFmtMng_c::ActionFunc ActionTable[10]; /* 0x568 */ FmtPos_c* mPos; /* 0x56C */ FmtMember_c* mMember; diff --git a/include/d/actor/d_a_grass.h b/include/d/actor/d_a_grass.h index 4b07bea1d5..fa887b546a 100644 --- a/include/d/actor/d_a_grass.h +++ b/include/d/actor/d_a_grass.h @@ -41,9 +41,9 @@ public: static void deleteRoomGrass(int); static void deleteRoomFlower(int); - static daGrass_c* m_myObj; - static dGrass_packet_c* m_grass; - static dFlower_packet_c* m_flower; + static DUSK_GAME_DATA daGrass_c* m_myObj; + static DUSK_GAME_DATA dGrass_packet_c* m_grass; + static DUSK_GAME_DATA dFlower_packet_c* m_flower; /* 0x568 */ u8 unk_0x568[0x570 - 0x568]; }; diff --git a/include/d/actor/d_a_horse.h b/include/d/actor/d_a_horse.h index 7e8ef8c343..bb7ce7ccb1 100644 --- a/include/d/actor/d_a_horse.h +++ b/include/d/actor/d_a_horse.h @@ -351,8 +351,8 @@ public: m_modelData->getMaterialNodePointer(5)->getShape()->hide(); } - static u16 const m_footJointTable[]; - static f32 const m_callLimitDistance2; + static DUSK_GAME_DATA u16 const m_footJointTable[]; + static DUSK_GAME_DATA f32 const m_callLimitDistance2; /* 0x0568 */ request_of_phase_process_class m_phase; /* 0x0570 */ J3DModel* m_model; @@ -567,7 +567,7 @@ public: class daHorse_hio_c0 { public: - static const daHorse_hio_c1 m; + static DUSK_GAME_DATA const daHorse_hio_c1 m; }; class daHorse_hio_c : public JORReflexible { diff --git a/include/d/actor/d_a_hozelda.h b/include/d/actor/d_a_hozelda.h index 0c640e779c..d87542ccbc 100644 --- a/include/d/actor/d_a_hozelda.h +++ b/include/d/actor/d_a_hozelda.h @@ -29,8 +29,8 @@ public: static void setMorfFrame(u8 i_frame) { mMorfFrame = i_frame; } static void decMorfFrame() { cLib_calcTimer(&mMorfFrame); } - static u8 mEyeMoveFlg; - static u8 mMorfFrame; + static DUSK_GAME_DATA u8 mEyeMoveFlg; + static DUSK_GAME_DATA u8 mMorfFrame; /* 0x0F4 */ f32 field_0xf4; /* 0x0F8 */ f32 field_0xf8; @@ -50,7 +50,7 @@ struct daHoZelda_hio_c1 { struct daHoZelda_hio_c0 { daHoZelda_hio_c0() {} - static daHoZelda_hio_c1 const m; + static DUSK_GAME_DATA daHoZelda_hio_c1 const m; }; class daHoZelda_hio_c : public JORReflexible { diff --git a/include/d/actor/d_a_itembase.h b/include/d/actor/d_a_itembase.h index fa4d246062..da1f541cd7 100644 --- a/include/d/actor/d_a_itembase.h +++ b/include/d/actor/d_a_itembase.h @@ -60,7 +60,7 @@ public: virtual u8 getCollisionH(); virtual u8 getCollisionR(); - static daItemBase_data const m_data; + static DUSK_GAME_DATA daItemBase_data const m_data; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_kago.h b/include/d/actor/d_a_kago.h index 90de3b74bf..33ec51672f 100644 --- a/include/d/actor/d_a_kago.h +++ b/include/d/actor/d_a_kago.h @@ -213,8 +213,8 @@ private: /* 0x750 */ int field_0x750; /* 0x754 */ int field_0x754; /* 0x758 */ int field_0x758; - /* 0x75C */ char* mArcName; - /* 0x760 */ char* mDemoName; + /* 0x75C */ DUSK_CONST char* mArcName; + /* 0x760 */ DUSK_CONST char* mDemoName; /* 0x764 */ u32 mShadowId; /* 0x768 */ dPath* mpPath1; /* 0x76C */ dPath* mpPath2; diff --git a/include/d/actor/d_a_mant.h b/include/d/actor/d_a_mant.h index 7514bc6fca..6d5b173d1a 100644 --- a/include/d/actor/d_a_mant.h +++ b/include/d/actor/d_a_mant.h @@ -88,9 +88,14 @@ public: /* 0x396A */ u8 field_0x396A[0x399E - 0x396A]; /* 0x399E */ s16 field_0x399e; /* 0x39A0 */ u8 field_0x39A0[0x39A4 - 0x39A0]; - +#if TARGET_PC + /* 0x39A4 */ cM_rnd_c mMantRng; +#endif }; - +#if TARGET_PC +STATIC_ASSERT(sizeof(mant_class) == 0x39ac); +#else STATIC_ASSERT(sizeof(mant_class) == 0x39a4); +#endif #endif /* D_A_MANT_H */ diff --git a/include/d/actor/d_a_mg_fish.h b/include/d/actor/d_a_mg_fish.h index b1102ee550..f02a34a778 100644 --- a/include/d/actor/d_a_mg_fish.h +++ b/include/d/actor/d_a_mg_fish.h @@ -49,7 +49,7 @@ public: /* 0x5F4 */ s16 mYawToPlayer; /* 0x5F6 */ s16 field_0x5f6; /* 0x5F8 */ s16 field_0x5f8; - /* 0x5FC */ char* mResName; + /* 0x5FC */ DUSK_CONST char* mResName; /* 0x600 */ mDoExt_McaMorf* mpMorf; /* 0x604 */ J3DAnmTransform* mAnmTransform; /* 0x608 */ u32 mShadowId; diff --git a/include/d/actor/d_a_mg_rod.h b/include/d/actor/d_a_mg_rod.h index e8ef9a6128..97a0bb1c72 100644 --- a/include/d/actor/d_a_mg_rod.h +++ b/include/d/actor/d_a_mg_rod.h @@ -90,7 +90,7 @@ public: /* 0x0000 */ fopAc_ac_c actor; /* 0x0568 */ request_of_phase_process_class phase; - /* 0x0570 */ char* arcname; + /* 0x0570 */ DUSK_CONST char* arcname; /* 0x0574 */ u8 arg0; /* 0x0575 */ u8 arg1; /* 0x0576 */ u8 arg2; @@ -299,8 +299,13 @@ public: /* 0x168C */ u8 field_0x168c; /* 0x168D */ u8 field_0x168d; /* 0x168E */ u8 HIOInit; + +#if TARGET_PC + cXyz mLineInterpPrev[MG_ROD_LURE_LINE_LEN]; + cXyz mLineInterpCurr[MG_ROD_LURE_LINE_LEN]; + bool mLineInterpPrevValid; + bool mLineInterpCurrValid; +#endif }; -STATIC_ASSERT(sizeof(dmg_rod_class) == 0x1690); - #endif /* D_A_MG_ROD_H */ diff --git a/include/d/actor/d_a_midna.h b/include/d/actor/d_a_midna.h index c9e84ee9d4..7793179066 100644 --- a/include/d/actor/d_a_midna.h +++ b/include/d/actor/d_a_midna.h @@ -32,7 +32,7 @@ public: class daMidna_hio_c0 { public: - static daMidna_hio_c1 const m; + static DUSK_GAME_DATA daMidna_hio_c1 const m; }; STATIC_ASSERT(sizeof(daMidna_hio_c0::m) == 0x20); @@ -87,8 +87,8 @@ public: /* 0x0FC */ f32 mNowOffsetX; /* 0x100 */ f32 mNowOffsetY; - static bool sEyeMoveFlg; - static u8 sMorfFrame; + static DUSK_GAME_DATA bool sEyeMoveFlg; + static DUSK_GAME_DATA u8 sMorfFrame; }; STATIC_ASSERT(sizeof(daMidna_matAnm_c) == 0x104); @@ -420,8 +420,8 @@ public: static u32 getOtherHeapSize() { return 0x1D0; } - static daMidna_texData_s const m_texDataTable[21]; - static daMidna_anmData_s const m_anmDataTable[53]; + static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21]; + static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53]; private: /* 0x568 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_mirror.h b/include/d/actor/d_a_mirror.h index e2f9a51e30..ecf1c127be 100644 --- a/include/d/actor/d_a_mirror.h +++ b/include/d/actor/d_a_mirror.h @@ -58,8 +58,8 @@ public: static u32 getMirrorRoomPrm() { return 0xFF03; } typedef int (daMirror_c::*entryModelFunc)(J3DModel*); - static entryModelFunc m_entryModel; - static daMirror_c* m_myObj; + static DUSK_GAME_DATA entryModelFunc m_entryModel; + static DUSK_GAME_DATA daMirror_c* m_myObj; /* 0x570 */ dMirror_packet_c mPacket; /* 0x6f8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_movie_player.h b/include/d/actor/d_a_movie_player.h index 0e666ae470..fbd8784d40 100644 --- a/include/d/actor/d_a_movie_player.h +++ b/include/d/actor/d_a_movie_player.h @@ -5,6 +5,7 @@ #include #else #include +#include #endif #include "f_op/f_op_actor.h" #include "d/d_drawlist.h" @@ -94,12 +95,6 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr); #define THP_TEXTURE_SET_COUNT 3 #endif -#if TARGET_PC -namespace dusk { - void MoviePlayerShutdown(); -} -#endif - struct daMP_THPPlayer { /* 0x000 */ DVDFileInfo fileInfo; /* 0x03C */ THPHeader header; @@ -125,6 +120,7 @@ struct daMP_THPPlayer { /* 0x0D4 */ s32 curCount; #if TARGET_PC /* 0x0D8 */ std::atomic videoDecodeCount; + std::chrono::steady_clock::time_point thpPlaybackClock; #else /* 0x0D8 */ s32 videoDecodeCount; #endif @@ -168,7 +164,7 @@ public: static int daMP_c_Callback_Main(daMP_c*); static int daMP_c_Callback_Draw(daMP_c*); - static daMP_c* m_myObj; + static DUSK_GAME_DATA daMP_c* m_myObj; private: /* 0x568 */ u32 (*mpGetMovieRestFrame)(void); diff --git a/include/d/actor/d_a_myna.h b/include/d/actor/d_a_myna.h index e93e28b2cd..511f7b11e6 100644 --- a/include/d/actor/d_a_myna.h +++ b/include/d/actor/d_a_myna.h @@ -103,8 +103,8 @@ public: void animePlay(); int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int); void setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); - J3DAnmTransformKey* getTrnsfrmKeyAnm(char*); - J3DAnmTexPattern* getTexPtrnAnm(char*); + J3DAnmTransformKey* getTrnsfrmKeyAnm(DUSK_CONST char*); + J3DAnmTexPattern* getTexPtrnAnm(DUSK_CONST char*); int checkEndAnm(J3DFrameCtrl*); int checkEndAnm(f32); u8 getItemNumMax(); @@ -131,8 +131,8 @@ public: typedef void (daMyna_c::*ProcFunc)(); typedef int (daMyna_c::*BaseMotionFunc)(int); - static dCcD_SrcSph const mCcDSph; - static daMyna_c::BaseMotionFunc mBaseMotionTBL[7]; + static DUSK_GAME_DATA dCcD_SrcSph const mCcDSph; + static DUSK_GAME_DATA daMyna_c::BaseMotionFunc mBaseMotionTBL[7]; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ mDoExt_McaMorfSO* mpMorf; diff --git a/include/d/actor/d_a_nbomb.h b/include/d/actor/d_a_nbomb.h index 4c5eb820ff..15c91043ff 100644 --- a/include/d/actor/d_a_nbomb.h +++ b/include/d/actor/d_a_nbomb.h @@ -91,7 +91,7 @@ public: s16 getExTime() { return mExTime; } - static const char* m_arcNameList[6]; + static DUSK_GAME_DATA const char* m_arcNameList[6]; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index f9ebfaaa47..7b99f1e2fe 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -519,7 +519,7 @@ public: /* 0x568 */ daNpcT_faceMotionAnmData_c const* mpFaceMotionAnmData; /* 0x56C */ daNpcT_motionAnmData_c const* mpMotionAnmData; /* 0x570 */ daNpcT_evtData_c const* mpEvtData; - /* 0x574 */ char** mpArcNames; + /* 0x574 */ DUSK_CONST char* DUSK_CONST* mpArcNames; /* 0x578 */ mDoExt_McaMorfSO* mpMorf[2]; /* 0x580 */ Z2Creature mSound; /* 0x610 */ mDoExt_bckAnm mBckAnm; @@ -627,7 +627,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, - int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames) + int i_motionStepNum, daNpcT_evtData_c const* i_evtData, DUSK_CONST char* DUSK_CONST* i_arcNames) : mpFaceMotionAnmData(i_faceMotionAnmData), mpMotionAnmData(i_motionAnmData), @@ -654,8 +654,8 @@ public: int setBtkAnm(J3DAnmTextureSRTKey*, J3DModelData*, f32, int); int setBrkAnm(J3DAnmTevRegKey*, J3DModelData*, f32, int); int setBpkAnm(J3DAnmColor*, J3DModelData*, f32, int); - int loadRes(s8 const*, char const**); - void deleteRes(s8 const*, char const**); + int loadRes(s8 const*, char const* DUSK_CONST*); + void deleteRes(s8 const*, char const* DUSK_CONST*); int execute(); int draw(BOOL, BOOL, f32, GXColorS10*, f32, BOOL, BOOL, BOOL); void setEnvTevColor(); @@ -776,12 +776,12 @@ public: return chkFindActor(daPy_getPlayerActorClass(), param_0, param_1); } - static dCcD_SrcGObjInf const mCcDObjData; - static dCcD_SrcCyl mCcDCyl; - static dCcD_SrcSph mCcDSph; - static fopAc_ac_c* mFindActorPtrs[50]; - static s16 mSrchName; - static int mFindCount; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjData; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA fopAc_ac_c* mFindActorPtrs[50]; + static DUSK_GAME_DATA s16 mSrchName; + static DUSK_GAME_DATA int mFindCount; enum Mode { /* 0 */ MODE_ENTER, diff --git a/include/d/actor/d_a_npc2.h b/include/d/actor/d_a_npc2.h index c940d14a87..0f8ab6ba20 100644 --- a/include/d/actor/d_a_npc2.h +++ b/include/d/actor/d_a_npc2.h @@ -86,12 +86,12 @@ public: class daBaseNpc_c : public fopAc_ac_c { public: daBaseNpc_c(); - J3DAnmTransform* getTrnsfrmKeyAnmP(char*, int); + J3DAnmTransform* getTrnsfrmKeyAnmP(char DUSK_CONST*, int); int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int); int setBckAnm(J3DAnmTransform*, f32, int, int, int, bool); - J3DAnmTransform* getTexPtrnAnmP(char*, int); + J3DAnmTransform* getTexPtrnAnmP(char DUSK_CONST*, int); int setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); - void orderEvent(int, char*); + void orderEvent(int, char DUSK_CONST*); void setEnvTevColor(); void setRoomNo(); int checkEndAnm(f32); @@ -113,9 +113,9 @@ public: virtual void drawOtherMdls(); virtual bool dbgDraw(); - static dCcD_SrcGObjInf const mCcDObj; - static dCcD_SrcCyl mCcDCyl; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObj; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; public: /* 0x56C */ dBgS_ObjAcch mAcch; @@ -128,7 +128,7 @@ public: /* 0x808 */ mDoExt_btpAnm mBtp; /* 0x820 */ mDoExt_btkAnm mBtk; /* 0x838 */ s16 field_0x838; - /* 0x83C */ u16* field_0x83c; + /* 0x83C */ u16 DUSK_CONST* field_0x83c; /* 0x840 */ u16 field_0x840; /* 0x842 */ u16 field_0x842; /* 0x844 */ u8 field_0x844; @@ -173,9 +173,9 @@ public: virtual int ToFore() { return 1; } virtual int ToBack() { return 1; } - static const char* m_name; - static int m_dzb_id; - static MoveBGActor_SetFunc m_set_func; + static DUSK_GAME_DATA const char* m_name; + static DUSK_GAME_DATA int m_dzb_id; + static DUSK_GAME_DATA MoveBGActor_SetFunc m_set_func; public: /* 0xA14 */ dBgW* mpBgw; diff --git a/include/d/actor/d_a_npc4.h b/include/d/actor/d_a_npc4.h index 952c023889..d195eb9669 100644 --- a/include/d/actor/d_a_npc4.h +++ b/include/d/actor/d_a_npc4.h @@ -311,10 +311,10 @@ public: static void* srchActor(void*, void*); void initialize(); - J3DAnmTransformKey* getTrnsfrmKeyAnmP(char*, int); - J3DAnmTexPattern* getTexPtrnAnmP(char*, int); - J3DAnmTextureSRTKey* getTexSRTKeyAnmP(char*, int); - J3DAnmTevRegKey* getTevRegKeyAnmP(char*, int); + J3DAnmTransformKey* getTrnsfrmKeyAnmP(DUSK_CONST char*, int); + J3DAnmTexPattern* getTexPtrnAnmP(DUSK_CONST char*, int); + J3DAnmTextureSRTKey* getTexSRTKeyAnmP(DUSK_CONST char*, int); + J3DAnmTevRegKey* getTevRegKeyAnmP(DUSK_CONST char*, int); BOOL setMcaMorfAnm(J3DAnmTransformKey* i_anm, f32 i_rate, f32 i_morf, int i_attr, int i_start, int i_end); BOOL setBckAnm(J3DAnmTransform* i_bck, f32 i_rate, int i_attr, int i_start, @@ -336,8 +336,8 @@ public: BOOL hitChk2(dCcD_Cyl*, BOOL, BOOL); void setDamage(int, int, int); int ctrlMsgAnm(int&, int&, fopAc_ac_c*, BOOL); - void orderEvent(int, char*, u16, u16, u8, u16); - void changeEvent(char*, char*, u16, u16); + void orderEvent(int, DUSK_CONST char*, u16, u16, u8, u16); + void changeEvent(DUSK_CONST char*, DUSK_CONST char*, u16, u16); BOOL chkActorInSight(fopAc_ac_c*, f32); BOOL chkActorInArea(fopAc_ac_c*, cXyz, cXyz, s16); BOOL chkActorInAttnArea(fopAc_ac_c*, fopAc_ac_c*, int); @@ -394,13 +394,13 @@ public: void onHide() { mHide = true; } void offHide() { mHide = false; } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; - static dCcD_SrcSph mCcDSph; - static fopAc_ac_c* mFindActorPList[100]; - static s32 mFindCount; - static s16 mSrchActorName; - static char mFileNameBuf[0x15]; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA fopAc_ac_c* mFindActorPList[100]; + static DUSK_GAME_DATA s32 mFindCount; + static DUSK_GAME_DATA s16 mSrchActorName; + static DUSK_GAME_DATA char mFileNameBuf[0x15]; }; STATIC_ASSERT(sizeof(daNpcF_c) == 0xB48); diff --git a/include/d/actor/d_a_npc_aru.h b/include/d/actor/d_a_npc_aru.h index 84496ea6d6..e822850a7e 100644 --- a/include/d/actor/d_a_npc_aru.h +++ b/include/d/actor/d_a_npc_aru.h @@ -17,7 +17,7 @@ class daNpc_Aru_Param_c { public: virtual ~daNpc_Aru_Param_c() {} - static daNpc_Aru_HIOParam const m; + static DUSK_GAME_DATA daNpc_Aru_HIOParam const m; }; #if DEBUG @@ -149,7 +149,7 @@ public: int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -171,8 +171,8 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } void setLastIn() { mLastGoatIn = true; } - static char* mCutNameList[7]; - static cutFunc mCutList[7]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[7]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; private: /* 0xE40 */ NPC_ARU_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_ash.h b/include/d/actor/d_a_npc_ash.h index 084569a66e..46c850a372 100644 --- a/include/d/actor/d_a_npc_ash.h +++ b/include/d/actor/d_a_npc_ash.h @@ -12,7 +12,7 @@ public: daNpcAsh_Param_c() {} virtual ~daNpcAsh_Param_c() {} - static const daNpcAsh_HIOParam m; + static DUSK_GAME_DATA const daNpcAsh_HIOParam m; }; #if DEBUG @@ -143,7 +143,7 @@ public: inline bool step(s16, bool); inline void playExpression(); - static EventFn mEvtSeqList[6]; + static DUSK_GAME_DATA EventFn mEvtSeqList[6]; private: /* 0xB48 */ Z2Creature mCreatureSound; diff --git a/include/d/actor/d_a_npc_ashB.h b/include/d/actor/d_a_npc_ashB.h index cbba17f4c5..e257db2402 100644 --- a/include/d/actor/d_a_npc_ashB.h +++ b/include/d/actor/d_a_npc_ashB.h @@ -12,7 +12,7 @@ class daNpcAshB_Param_c { public: virtual ~daNpcAshB_Param_c() {} - static const daNpcAshB_HIOParam m; + static DUSK_GAME_DATA const daNpcAshB_HIOParam m; }; #if DEBUG @@ -135,7 +135,7 @@ public: inline bool step(s16, int, f32); inline void playExpression(); - static EventFn mEvtSeqList[2]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[2]; private: /* 0xB48 */ Z2Creature mCreatureSound; diff --git a/include/d/actor/d_a_npc_bans.h b/include/d/actor/d_a_npc_bans.h index 7c60822f5e..0da1a71b92 100644 --- a/include/d/actor/d_a_npc_bans.h +++ b/include/d/actor/d_a_npc_bans.h @@ -22,7 +22,7 @@ class daNpc_Bans_Param_c { public: virtual ~daNpc_Bans_Param_c() {} - static daNpc_Bans_HIOParam const m; + static DUSK_GAME_DATA daNpc_Bans_HIOParam const m; }; #if DEBUG @@ -90,7 +90,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -117,8 +117,8 @@ public: return rv; } - static char* mCutNameList[4]; - static cutFunc mCutList[4]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[4]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[4]; /* 0x0F7C */ mDoExt_McaMorfSO* mpScoopMorf; /* 0x0F80 */ NPC_BANS_HIO_CLASS* mHIO; diff --git a/include/d/actor/d_a_npc_besu.h b/include/d/actor/d_a_npc_besu.h index c4b1e3cf91..646c4860bd 100644 --- a/include/d/actor/d_a_npc_besu.h +++ b/include/d/actor/d_a_npc_besu.h @@ -15,7 +15,7 @@ class daNpc_Besu_Param_c { public: virtual ~daNpc_Besu_Param_c() {} - static const daNpc_Besu_HIOParam m; + static DUSK_GAME_DATA const daNpc_Besu_HIOParam m; }; #if DEBUG @@ -112,7 +112,7 @@ public: int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -140,8 +140,8 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; } u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; } - static char* mCutNameList[15]; - static cutFunc mCutList[15]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[15]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[15]; private: /* 0x0E40 */ mDoExt_McaMorfSO* mpCupModelMorf; diff --git a/include/d/actor/d_a_npc_blue_ns.h b/include/d/actor/d_a_npc_blue_ns.h index fb30855c23..8235ad7b25 100644 --- a/include/d/actor/d_a_npc_blue_ns.h +++ b/include/d/actor/d_a_npc_blue_ns.h @@ -14,7 +14,7 @@ class daNpcBlueNS_Param_c { public: virtual ~daNpcBlueNS_Param_c() {} - static const daNpcBlueNS_HIOParam m; + static DUSK_GAME_DATA const daNpcBlueNS_HIOParam m; }; #if DEBUG @@ -124,7 +124,7 @@ public: return var_r30; } - static EventFn mEvtSeqList[]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[]; /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ u8 field_0xBD8[0xBDC - 0xBD8]; diff --git a/include/d/actor/d_a_npc_bou.h b/include/d/actor/d_a_npc_bou.h index ea597e23a9..d2c1c0ef2f 100644 --- a/include/d/actor/d_a_npc_bou.h +++ b/include/d/actor/d_a_npc_bou.h @@ -16,7 +16,7 @@ struct daNpc_Bou_HIOParam { public: virtual ~daNpc_Bou_Param_c() {} - static const daNpc_Bou_HIOParam m; + static DUSK_GAME_DATA const daNpc_Bou_HIOParam m; }; #if DEBUG @@ -89,7 +89,7 @@ public: daNpc_Bou_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} @@ -114,8 +114,8 @@ public: virtual int drawDbgInfo(); virtual void changeAnm(int*, int*); - static char* mCutNameList[9]; - static cutFunc mCutList[9]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[9]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[9]; int getFlowNodeNo() { u16 nodeNo = home.angle.x; diff --git a/include/d/actor/d_a_npc_bouS.h b/include/d/actor/d_a_npc_bouS.h index 27eafb48fd..a3431cfec7 100644 --- a/include/d/actor/d_a_npc_bouS.h +++ b/include/d/actor/d_a_npc_bouS.h @@ -29,7 +29,7 @@ class daNpcBouS_Param_c { public: virtual ~daNpcBouS_Param_c() {} - static daNpcBouS_HIOParam const m; + static DUSK_GAME_DATA daNpcBouS_HIOParam const m; }; #if DEBUG @@ -128,7 +128,7 @@ public: mForcibleTalk = 1; } - static eventFunc mEvtSeqList[4]; + static DUSK_GAME_DATA eventFunc mEvtSeqList[4]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_cd.h b/include/d/actor/d_a_npc_cd.h index 3f942a5988..21483c29c1 100644 --- a/include/d/actor/d_a_npc_cd.h +++ b/include/d/actor/d_a_npc_cd.h @@ -25,7 +25,7 @@ public: J3DModelData* getObjMdlDataP(int); virtual ~daNpcCd_c() {} - static dCcD_SrcCyl const m_cylDat; + static DUSK_GAME_DATA dCcD_SrcCyl const m_cylDat; /* 0x56C */ request_of_phase_process_class mPhase1; /* 0x574 */ request_of_phase_process_class mPhase2; @@ -101,7 +101,7 @@ public: STATIC_ASSERT(sizeof(daNpcCd_HIO_c) == 0x29BC); -extern daNpcCd_HIO_c l_Cd_HIO; +DUSK_GAME_EXTERN daNpcCd_HIO_c l_Cd_HIO; inline f32 HIO_atnOfs(int param_1) { s16 rv; if (param_1 < 16) { diff --git a/include/d/actor/d_a_npc_cd2.h b/include/d/actor/d_a_npc_cd2.h index 3d2eaa87c5..d37a09f99e 100644 --- a/include/d/actor/d_a_npc_cd2.h +++ b/include/d/actor/d_a_npc_cd2.h @@ -87,7 +87,7 @@ struct daNpcCd2_HIO_c : public fOpAcm_HIO_entry_c { /* 0x20C4 */ daNpcCd2_HIO_WChild_c field_0x20c4[14]; }; -extern daNpcCd2_HIO_c l_Cd2_HIO; +DUSK_GAME_EXTERN daNpcCd2_HIO_c l_Cd2_HIO; inline s16 Cd2_HIO_atnOfs(int param_1) { s16 rv; @@ -269,7 +269,7 @@ public: J3DAnmTexPattern* getTexAnmP(int); virtual ~daNpcCd2_c() {} - static dCcD_SrcCyl const m_cylDat; + static DUSK_GAME_DATA dCcD_SrcCyl const m_cylDat; /* 0x56C */ request_of_phase_process_class mPhase1; /* 0x574 */ request_of_phase_process_class mPhase2; diff --git a/include/d/actor/d_a_npc_cdn3.h b/include/d/actor/d_a_npc_cdn3.h index 84a98ebd74..f3b920c81c 100644 --- a/include/d/actor/d_a_npc_cdn3.h +++ b/include/d/actor/d_a_npc_cdn3.h @@ -334,52 +334,52 @@ public: actionFunc mExecFn; }; - static const ActionPair ActionTable[8]; - static seqFunc* m_funcTbl[44]; - static seqFunc m_seq00_funcTbl[2]; - static seqFunc m_seq01_funcTbl[2]; - static seqFunc m_seq02_funcTbl[2]; - static seqFunc m_seq03_funcTbl[2]; - static seqFunc m_seq04_funcTbl[2]; - static seqFunc m_seq05_funcTbl[4]; - static seqFunc m_seq06_funcTbl[4]; - static seqFunc m_seq07_funcTbl[2]; - static seqFunc m_seq08_funcTbl[7]; - static seqFunc m_seq09_funcTbl[2]; - static seqFunc m_seq10_funcTbl[2]; - static seqFunc m_seq11_funcTbl[6]; - static seqFunc m_seq12_funcTbl[2]; - static seqFunc m_seq13_funcTbl[6]; - static seqFunc m_seq14_funcTbl[2]; - static seqFunc m_seq15_funcTbl[2]; - static seqFunc m_seq16_funcTbl[7]; - static seqFunc m_seq17_funcTbl[2]; - static seqFunc m_seq18_funcTbl[2]; - static seqFunc m_seq19_funcTbl[7]; - static seqFunc m_seq20_funcTbl[2]; - static seqFunc m_seq21_funcTbl[2]; - static seqFunc m_seq22_funcTbl[4]; - static seqFunc m_seq23_funcTbl[7]; - static seqFunc m_seq24_funcTbl[5]; - static seqFunc m_seq25_funcTbl[7]; - static seqFunc m_seq26_funcTbl[3]; - static seqFunc m_seq27_funcTbl[2]; - static seqFunc m_seq28_funcTbl[3]; - static seqFunc m_seq29_funcTbl[3]; - static seqFunc m_seq30_funcTbl[6]; - static seqFunc m_seq31_funcTbl[6]; - static seqFunc m_seq32_funcTbl[7]; - static seqFunc m_seq33_funcTbl[7]; - static seqFunc m_seq34_funcTbl[9]; - static seqFunc m_seq35_funcTbl[2]; - static seqFunc m_seq36_funcTbl[4]; - static seqFunc m_seq37_funcTbl[2]; - static seqFunc m_seq38_funcTbl[2]; - static seqFunc m_seq39_funcTbl[2]; - static seqFunc m_seq40_funcTbl[3]; - static seqFunc m_seq41_funcTbl[2]; - static seqFunc m_seq42_funcTbl[2]; - static seqFunc m_seq43_funcTbl[3]; + static DUSK_GAME_DATA const ActionPair ActionTable[8]; + static DUSK_GAME_DATA seqFunc* m_funcTbl[44]; + static DUSK_GAME_DATA seqFunc m_seq00_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq01_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq02_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq03_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq04_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq05_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq06_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq07_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq08_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq09_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq10_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq11_funcTbl[6]; + static DUSK_GAME_DATA seqFunc m_seq12_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq13_funcTbl[6]; + static DUSK_GAME_DATA seqFunc m_seq14_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq15_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq16_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq17_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq18_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq19_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq20_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq21_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq22_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq23_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq24_funcTbl[5]; + static DUSK_GAME_DATA seqFunc m_seq25_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq26_funcTbl[3]; + static DUSK_GAME_DATA seqFunc m_seq27_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq28_funcTbl[3]; + static DUSK_GAME_DATA seqFunc m_seq29_funcTbl[3]; + static DUSK_GAME_DATA seqFunc m_seq30_funcTbl[6]; + static DUSK_GAME_DATA seqFunc m_seq31_funcTbl[6]; + static DUSK_GAME_DATA seqFunc m_seq32_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq33_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq34_funcTbl[9]; + static DUSK_GAME_DATA seqFunc m_seq35_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq36_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq37_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq38_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq39_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq40_funcTbl[3]; + static DUSK_GAME_DATA seqFunc m_seq41_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq42_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq43_funcTbl[3]; /* 0xAC8 */ J3DModel* field_0xac8; /* 0xACC */ J3DModel* field_0xacc; diff --git a/include/d/actor/d_a_npc_chat.h b/include/d/actor/d_a_npc_chat.h index 4ec81ee4c0..5bdbee8869 100644 --- a/include/d/actor/d_a_npc_chat.h +++ b/include/d/actor/d_a_npc_chat.h @@ -11,7 +11,7 @@ class daNpcChat_Param_c { public: virtual ~daNpcChat_Param_c() {} - static daNpcChat_HIOParam const m; + static DUSK_GAME_DATA daNpcChat_HIOParam const m; }; #if DEBUG @@ -102,7 +102,7 @@ public: void setFear() { mFear = true; } void setTalkFlag() { mTalkFlag = true; } - static eventFunc mEvtSeqList[1]; + static DUSK_GAME_DATA eventFunc DUSK_CONST mEvtSeqList[1]; private: /* 0xB48 */ Z2CreatureCitizen mSound; diff --git a/include/d/actor/d_a_npc_chin.h b/include/d/actor/d_a_npc_chin.h index e4bfdb6a61..1e87de4e9f 100644 --- a/include/d/actor/d_a_npc_chin.h +++ b/include/d/actor/d_a_npc_chin.h @@ -12,7 +12,7 @@ class daNpcChin_Param_c { public: virtual ~daNpcChin_Param_c() {} - static daNpcChin_HIOParam const m; + static DUSK_GAME_DATA daNpcChin_HIOParam const m; }; #if DEBUG @@ -183,7 +183,7 @@ public: inline void ForcibleTalk_Off() { field_0xe06 = 0; } inline u8 getForcibleTalk2() { return field_0xe06; } - static eventFunc mEvtSeqList[8]; + static DUSK_GAME_DATA eventFunc mEvtSeqList[8]; /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; diff --git a/include/d/actor/d_a_npc_clerka.h b/include/d/actor/d_a_npc_clerka.h index a20c12c001..12ef5a3b97 100644 --- a/include/d/actor/d_a_npc_clerka.h +++ b/include/d/actor/d_a_npc_clerka.h @@ -14,7 +14,7 @@ class daNpc_clerkA_Param_c { public: virtual ~daNpc_clerkA_Param_c() {} - static const daNpc_clerkA_HIOParam m; + static DUSK_GAME_DATA const daNpc_clerkA_HIOParam m; }; #if DEBUG @@ -100,7 +100,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, - int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames) + int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -124,8 +124,8 @@ public: u8 getMaxNumItem() { return (fopAcM_GetParam(this) & 0xF000000) >> 24; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0x0F7C */ NPC_CLERKA_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_clerkb.h b/include/d/actor/d_a_npc_clerkb.h index f83ec949d4..c6c2ef83fb 100644 --- a/include/d/actor/d_a_npc_clerkb.h +++ b/include/d/actor/d_a_npc_clerkb.h @@ -15,7 +15,7 @@ class daNpc_clerkB_Param_c { public: virtual ~daNpc_clerkB_Param_c() {} - static const daNpc_clerkB_HIOParam m; + static DUSK_GAME_DATA const daNpc_clerkB_HIOParam m; }; #if DEBUG @@ -113,7 +113,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, - int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames) + int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -137,8 +137,8 @@ public: u8 getMaxNumItem() { return (fopAcM_GetParam(this) & 0xF000000) >> 24; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0x0F7C */ mDoExt_bpkAnm mBpkAnm2; diff --git a/include/d/actor/d_a_npc_clerkt.h b/include/d/actor/d_a_npc_clerkt.h index 5480338e1e..6acfb8970f 100644 --- a/include/d/actor/d_a_npc_clerkt.h +++ b/include/d/actor/d_a_npc_clerkt.h @@ -12,7 +12,7 @@ class daNpcClerkt_Param_c { public: virtual ~daNpcClerkt_Param_c() {} - static const daNpcClerkt_HIOParam m; + static DUSK_GAME_DATA const daNpcClerkt_HIOParam m; }; #if DEBUG @@ -91,7 +91,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -125,8 +125,8 @@ public: } } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0x0F7C */ NPC_CLERKT_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_coach.h b/include/d/actor/d_a_npc_coach.h index 3917d6f11c..f50cbd87a5 100644 --- a/include/d/actor/d_a_npc_coach.h +++ b/include/d/actor/d_a_npc_coach.h @@ -295,7 +295,7 @@ public: const daNpcCoach_Attr_c& attr() const { return M_attr; } - static daNpcCoach_Attr_c const M_attr; + static DUSK_GAME_DATA daNpcCoach_Attr_c const M_attr; static u16 const ParticleName[10]; private: /* 0x0568 */ daNpcChHorse_c mChHorse; diff --git a/include/d/actor/d_a_npc_doc.h b/include/d/actor/d_a_npc_doc.h index 286405d074..417251e10b 100644 --- a/include/d/actor/d_a_npc_doc.h +++ b/include/d/actor/d_a_npc_doc.h @@ -12,7 +12,7 @@ class daNpc_Doc_Param_c { public: virtual ~daNpc_Doc_Param_c() {} - static const daNpc_Doc_HIOParam m; + static DUSK_GAME_DATA const daNpc_Doc_HIOParam m; }; #if DEBUG @@ -66,7 +66,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) @@ -133,8 +133,8 @@ public: return (fopAcM_GetParam(this) & 0xFF00) >> 8; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_DOC_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_doorboy.h b/include/d/actor/d_a_npc_doorboy.h index cc7261d64c..31568dd2f6 100644 --- a/include/d/actor/d_a_npc_doorboy.h +++ b/include/d/actor/d_a_npc_doorboy.h @@ -12,7 +12,7 @@ class daNpcDoorBoy_Param_c { public: virtual ~daNpcDoorBoy_Param_c() {} - static daNpcDoorBoy_HIOParam const m; + static DUSK_GAME_DATA daNpcDoorBoy_HIOParam const m; }; #if DEBUG @@ -78,7 +78,7 @@ public: inline int getTimeHour(); inline bool isDummyTalk(); - static EventFn mEvtSeqList[1]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[1]; private: /* 0xB48 */ Z2CreatureCitizen mSound; diff --git a/include/d/actor/d_a_npc_drainSol.h b/include/d/actor/d_a_npc_drainSol.h index d61fb243b3..7a197a8a1f 100644 --- a/include/d/actor/d_a_npc_drainSol.h +++ b/include/d/actor/d_a_npc_drainSol.h @@ -11,7 +11,7 @@ class daNpcDrSol_Param_c { public: virtual ~daNpcDrSol_Param_c() {} - static const daNpcDrSol_HIOParam m; + static DUSK_GAME_DATA const daNpcDrSol_HIOParam m; }; #if DEBUG diff --git a/include/d/actor/d_a_npc_fairy.h b/include/d/actor/d_a_npc_fairy.h index 139555950a..efa9d760c1 100644 --- a/include/d/actor/d_a_npc_fairy.h +++ b/include/d/actor/d_a_npc_fairy.h @@ -94,7 +94,7 @@ class daNpc_Fairy_Param_c { public: virtual ~daNpc_Fairy_Param_c() {} - static daNpc_Fairy_HIOParam const m; + static DUSK_GAME_DATA daNpc_Fairy_HIOParam const m; }; #if DEBUG @@ -256,7 +256,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -294,8 +294,8 @@ public: u8 getSceneNo1() { return (fopAcM_GetParam(this) >> 8) & 0xFF; } u8 getSceneNo2() { return (fopAcM_GetParam(this) >> 16) & 0xFF; } - static char* mCutNameList[18]; - static cutFunc mCutList[18]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[18]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[18]; private: /* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO; /* 0x0E44 */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_fairy_seirei.h b/include/d/actor/d_a_npc_fairy_seirei.h index d3b5a23823..a0ad9342ed 100644 --- a/include/d/actor/d_a_npc_fairy_seirei.h +++ b/include/d/actor/d_a_npc_fairy_seirei.h @@ -13,7 +13,7 @@ class daNpc_FairySeirei_Param_c { public: virtual ~daNpc_FairySeirei_Param_c() {} - static daNpc_FairySeirei_HIOParam const m; + static DUSK_GAME_DATA daNpc_FairySeirei_HIOParam const m; }; #if DEBUG @@ -71,7 +71,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, - int param_6, daNpcT_evtData_c const* param_7, char** param_8) + int param_6, daNpcT_evtData_c const* param_7, DUSK_CONST char* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u8 getType() { return fopAcM_GetParam(this) & 0xFF; } @@ -90,8 +90,8 @@ public: int getSeneNo() { return (fopAcM_GetParam(this) >> 8) & 0xFF; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA DUSK_CONST char* mCutNameList[1]; + static DUSK_GAME_DATA DUSK_CONST cutFunc mCutList[1]; private: /* 0xE40 */ NPC_FAIRY_SEIREI_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_gnd.h b/include/d/actor/d_a_npc_gnd.h index 983928570a..f61d7e0214 100644 --- a/include/d/actor/d_a_npc_gnd.h +++ b/include/d/actor/d_a_npc_gnd.h @@ -11,7 +11,7 @@ class daNpc_Gnd_Param_c { public: virtual ~daNpc_Gnd_Param_c() {} - static const daNpc_Gnd_HIOParam m; + static DUSK_GAME_DATA const daNpc_Gnd_HIOParam m; }; #if DEBUG @@ -83,7 +83,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -96,8 +96,8 @@ public: s32 getNeckJointNo() { return 3; } s32 getBackboneJointNo() { return 1; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_GND_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_gra.h b/include/d/actor/d_a_npc_gra.h index 236755aba7..333cf5d299 100644 --- a/include/d/actor/d_a_npc_gra.h +++ b/include/d/actor/d_a_npc_gra.h @@ -21,7 +21,7 @@ class daNpc_grA_Param_c { public: virtual ~daNpc_grA_Param_c() {} - static daNpc_grA_HIOParam const m; + static DUSK_GAME_DATA daNpc_grA_HIOParam const m; }; #if DEBUG @@ -138,9 +138,9 @@ public: void addCarryNum() { field_0x1692++; } u8 getPathNoFromParam() { return home.angle.z; } void setGateWalk() { field_0x14D0 = 1; } - static char* mEvtCutNameList[12]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[12]; typedef BOOL (daNpc_grA_c::*cut_type)(int); - static cut_type mEvtCutList[]; + static DUSK_GAME_DATA cut_type DUSK_CONST mEvtCutList[]; private: typedef BOOL (daNpc_grA_c::*daNpc_grA_c_Action)(void*); diff --git a/include/d/actor/d_a_npc_grc.h b/include/d/actor/d_a_npc_grc.h index 0375dbd17f..ac7dfa9869 100644 --- a/include/d/actor/d_a_npc_grc.h +++ b/include/d/actor/d_a_npc_grc.h @@ -12,7 +12,7 @@ class daNpc_grC_Param_c { public: virtual ~daNpc_grC_Param_c() {} - static daNpc_grC_HIOParam const m; + static DUSK_GAME_DATA daNpc_grC_HIOParam const m; }; #if DEBUG @@ -89,8 +89,8 @@ public: void setPrtcl(); void adjustShapeAngle() {} - static char* mEvtCutNameList; - static EventFn mEvtCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[1]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_grd.h b/include/d/actor/d_a_npc_grd.h index 95b23152ae..24871ab24c 100644 --- a/include/d/actor/d_a_npc_grd.h +++ b/include/d/actor/d_a_npc_grd.h @@ -11,7 +11,7 @@ class daNpc_Grd_Param_c { public: virtual ~daNpc_Grd_Param_c() {} - static daNpc_Grd_HIOParam const m; + static DUSK_GAME_DATA daNpc_Grd_HIOParam const m; }; #if DEBUG @@ -81,8 +81,8 @@ public: BOOL ECut_nodToGrz(int); void adjustShapeAngle() {} - static char* mEvtCutNameList[2]; - static cutFunc mEvtCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[2]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_grm.h b/include/d/actor/d_a_npc_grm.h index 866c4f342e..d7c30ba90f 100644 --- a/include/d/actor/d_a_npc_grm.h +++ b/include/d/actor/d_a_npc_grm.h @@ -12,7 +12,7 @@ class daNpc_grM_Param_c { public: virtual ~daNpc_grM_Param_c() {} - static daNpc_grM_HIOParam const m; + static DUSK_GAME_DATA daNpc_grM_HIOParam const m; }; #if DEBUG @@ -120,7 +120,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -131,8 +131,8 @@ public: BOOL checkChangeJoint(int param_0) { return param_0 == JNT_HEAD; } BOOL checkRemoveJoint(int param_0) { return param_0 == JNT_MOUTH; } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0x0F7C */ NPC_GRM_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_grmc.h b/include/d/actor/d_a_npc_grmc.h index b5c72e7d10..1761c82869 100644 --- a/include/d/actor/d_a_npc_grmc.h +++ b/include/d/actor/d_a_npc_grmc.h @@ -38,7 +38,7 @@ class daNpc_grMC_Param_c { public: virtual ~daNpc_grMC_Param_c() {} - static daNpc_grMC_HIOParam const m; + static DUSK_GAME_DATA daNpc_grMC_HIOParam const m; }; class daNpc_grMC_c : public dShopSystem_c { @@ -113,7 +113,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -124,8 +124,8 @@ public: BOOL checkRemoveJoint(int param_1) { return param_1 == JNT_MOUTH; } u16 getEyeballMaterialNo() { return 1; }; - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0x0F7C */ NPC_GRMC_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_gro.h b/include/d/actor/d_a_npc_gro.h index f83cf1957a..b2a5595bd9 100644 --- a/include/d/actor/d_a_npc_gro.h +++ b/include/d/actor/d_a_npc_gro.h @@ -20,7 +20,7 @@ class daNpc_grO_Param_c { public: virtual ~daNpc_grO_Param_c() {} - static daNpc_grO_HIOParam const m; + static DUSK_GAME_DATA daNpc_grO_HIOParam const m; }; #if DEBUG @@ -85,8 +85,8 @@ public: int test(void*); void adjustShapeAngle() {} - static char* mEvtCutNameList[3]; - static cutFunc mEvtCutList[3]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[3]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[3]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_grr.h b/include/d/actor/d_a_npc_grr.h index 0fdd240f9b..6dfa8512bc 100644 --- a/include/d/actor/d_a_npc_grr.h +++ b/include/d/actor/d_a_npc_grr.h @@ -11,7 +11,7 @@ class daNpc_grR_Param_c { public: virtual ~daNpc_grR_Param_c() {} - static daNpc_grR_HIOParam const m; + static DUSK_GAME_DATA daNpc_grR_HIOParam const m; }; #if DEBUG @@ -83,8 +83,8 @@ public: int test(void*); void adjustShapeAngle() {} - static char* mEvtCutNameList; - static cutFunc mEvtCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[1]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_grs.h b/include/d/actor/d_a_npc_grs.h index d2a0c5359d..5ec4354dd1 100644 --- a/include/d/actor/d_a_npc_grs.h +++ b/include/d/actor/d_a_npc_grs.h @@ -11,7 +11,7 @@ class daNpc_grS_Param_c { public: virtual ~daNpc_grS_Param_c() {} - static const daNpc_grS_HIOParam m; + static DUSK_GAME_DATA const daNpc_grS_HIOParam m; }; #if DEBUG @@ -84,8 +84,8 @@ public: void setPrtcl(); void adjustShapeAngle() {} - static char* mEvtCutNameList[2]; - static cutFunc mEvtCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[2]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_grz.h b/include/d/actor/d_a_npc_grz.h index d7c947f19e..f49c878ff7 100644 --- a/include/d/actor/d_a_npc_grz.h +++ b/include/d/actor/d_a_npc_grz.h @@ -28,7 +28,7 @@ class daNpc_Grz_Param_c { public: virtual ~daNpc_Grz_Param_c() {} - static daNpc_Grz_HIOParam const m; + static DUSK_GAME_DATA daNpc_Grz_HIOParam const m; }; #if DEBUG @@ -116,8 +116,8 @@ public: u8 getPathNoFromParam() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } - static char* mEvtCutNameList[7]; - static cutFunc mEvtCutList[7]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[7]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[7]; private: /* 0x0B48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_guard.h b/include/d/actor/d_a_npc_guard.h index bae98e223c..bceab108e5 100644 --- a/include/d/actor/d_a_npc_guard.h +++ b/include/d/actor/d_a_npc_guard.h @@ -60,7 +60,7 @@ public: u32 getPathID() { return fopAcM_GetParam(this) >> 0x10 & 0xFF; } - static actionFunc ActionTable[7][2]; + static DUSK_GAME_DATA actionFunc ActionTable[7][2]; private: /* 0xAC8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_npc_gwolf.h b/include/d/actor/d_a_npc_gwolf.h index fcf5d804d0..bd577e18e7 100644 --- a/include/d/actor/d_a_npc_gwolf.h +++ b/include/d/actor/d_a_npc_gwolf.h @@ -19,7 +19,7 @@ class daNpc_GWolf_Param_c { public: virtual ~daNpc_GWolf_Param_c() {} - static daNpc_GWolf_HIOParam const m; + static DUSK_GAME_DATA daNpc_GWolf_HIOParam const m; }; #if DEBUG @@ -104,8 +104,8 @@ public: void setHowlingEndFlag() { field_0xe1c = 2; } void setHowlingFlag() { field_0xe1c = 1; } - static char* mEvtCutNameList[5]; - static cutFunc mEvtCutList[5]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[5]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[5]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_hanjo.h b/include/d/actor/d_a_npc_hanjo.h index 867f4674b6..e9daf3bb0e 100644 --- a/include/d/actor/d_a_npc_hanjo.h +++ b/include/d/actor/d_a_npc_hanjo.h @@ -23,7 +23,7 @@ class daNpc_Hanjo_Param_c { public: virtual ~daNpc_Hanjo_Param_c() {} - static const daNpc_Hanjo_HIOParam m; + static DUSK_GAME_DATA const daNpc_Hanjo_HIOParam m; }; #if DEBUG @@ -194,7 +194,7 @@ public: daNpc_Hanjo_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u16 getEyeballMaterialNo() { return 2; } @@ -217,10 +217,10 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; } - static dCcD_SrcGObjInf const mStoneCcDObjInfo; - static char* mCutNameList[6]; - static cutFunc mCutList[6]; - static dCcD_SrcSph mStoneCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mStoneCcDObjInfo; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[6]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[6]; + static DUSK_GAME_DATA dCcD_SrcSph DUSK_CONST mStoneCcDSph; private: /* 0x0E40 */ NPC_HANJO_HIO_CLASS* mpHIO; /* 0x0E44 */ J3DModel* mModel1; diff --git a/include/d/actor/d_a_npc_hoz.h b/include/d/actor/d_a_npc_hoz.h index 645940b0cb..aec84cf761 100644 --- a/include/d/actor/d_a_npc_hoz.h +++ b/include/d/actor/d_a_npc_hoz.h @@ -13,7 +13,7 @@ class daNpc_Hoz_Param_c { public: virtual ~daNpc_Hoz_Param_c() {} - static const daNpc_Hoz_HIOParam m; + static DUSK_GAME_DATA const daNpc_Hoz_HIOParam m; }; #if DEBUG @@ -91,7 +91,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) @@ -125,8 +125,8 @@ public: bool getGameStartFlag() { return mGameStartFlag; } void setPotBreakFlag() { mPotBreakFlag = true; } - static char* mCutNameList[8]; - static cutFunc mCutList[]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[8]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[]; private: /* 0xE40 */ NPC_HOZ_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_impal.h b/include/d/actor/d_a_npc_impal.h index 7b8234717a..f0102ab698 100644 --- a/include/d/actor/d_a_npc_impal.h +++ b/include/d/actor/d_a_npc_impal.h @@ -12,7 +12,7 @@ class daNpcImpal_Param_c { public: virtual ~daNpcImpal_Param_c() {} - static const daNpcImpal_HIOParam m; + static DUSK_GAME_DATA const daNpcImpal_HIOParam m; }; #if DEBUG @@ -121,7 +121,7 @@ public: inline void setLookMode(int i_lookMode); inline void deleteObstacle(); - static EventFn mEvtSeqList[4]; + static DUSK_GAME_DATA EventFn mEvtSeqList[4]; private: /* 0xB48 */ Z2Creature mCreatureSound; diff --git a/include/d/actor/d_a_npc_ins.h b/include/d/actor/d_a_npc_ins.h index 3f8b40a9a0..620358a297 100644 --- a/include/d/actor/d_a_npc_ins.h +++ b/include/d/actor/d_a_npc_ins.h @@ -12,7 +12,7 @@ class daNpcIns_Param_c { public: virtual ~daNpcIns_Param_c() {} - static daNpcIns_HIOParam const m; + static DUSK_GAME_DATA daNpcIns_HIOParam const m; }; #if DEBUG @@ -119,7 +119,7 @@ public: inline void playExpression(); BOOL chkAction(actionFunc action) { return action == mAction; } - static eventFunc mEvtSeqList[1]; + static DUSK_GAME_DATA eventFunc mEvtSeqList[1]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_jagar.h b/include/d/actor/d_a_npc_jagar.h index fbedc8ca1e..13147762dd 100644 --- a/include/d/actor/d_a_npc_jagar.h +++ b/include/d/actor/d_a_npc_jagar.h @@ -25,7 +25,7 @@ class daNpc_Jagar_Param_c { public: virtual ~daNpc_Jagar_Param_c() {} - static const daNpc_Jagar_HIOParam m; + static DUSK_GAME_DATA const daNpc_Jagar_HIOParam m; }; #if DEBUG @@ -138,7 +138,7 @@ public: daNpc_Jagar_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u16 getEyeballMaterialNo() { return MAT_JAGA_EYEBALL; } @@ -223,8 +223,8 @@ public: return 0; } - static char* mCutNameList[7]; - static cutFunc mCutList[7]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[7]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; private: /* 0x0E40 */ NPC_JAGAR_HIO_CLASS* mpHIO; /* 0x0E44 */ dCcD_Cyl mCyl1; diff --git a/include/d/actor/d_a_npc_kakashi.h b/include/d/actor/d_a_npc_kakashi.h index 80dadc3e47..c3f57b383a 100644 --- a/include/d/actor/d_a_npc_kakashi.h +++ b/include/d/actor/d_a_npc_kakashi.h @@ -14,7 +14,7 @@ class daNpc_Kakashi_Param_c { public: virtual ~daNpc_Kakashi_Param_c() {} - static const daNpc_Kakashi_HIOParam m; + static DUSK_GAME_DATA const daNpc_Kakashi_HIOParam m; }; #if DEBUG @@ -76,7 +76,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) @@ -113,8 +113,8 @@ public: u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } u8 getBitSW2() { return (fopAcM_GetParam(this) & 0xFF0000) >> 16; } - static char* mCutNameList[4]; - static int (daNpc_Kakashi_c::*mCutList[])(int); + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[4]; + static DUSK_GAME_DATA int (daNpc_Kakashi_c::* DUSK_CONST mCutList[])(int); private: /* 0x0E40 */ NPC_KAKASHI_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_kasi_hana.h b/include/d/actor/d_a_npc_kasi_hana.h index e355ed8c55..625cb31845 100644 --- a/include/d/actor/d_a_npc_kasi_hana.h +++ b/include/d/actor/d_a_npc_kasi_hana.h @@ -25,7 +25,7 @@ class daNpcKasiHana_Param_c { public: virtual ~daNpcKasiHana_Param_c() {} - static daNpcKasiHana_HIOParam const m; + static DUSK_GAME_DATA daNpcKasiHana_HIOParam const m; }; #if DEBUG @@ -201,10 +201,10 @@ public: BOOL pl_front_check() { return actor_front_check(daPy_getPlayerActorClass()); } void setEscapePathDir() { if (pl_front_check()) mPath.reverse(); } - static EventFn mEvtSeqList[6]; - static daTagEscape_c* mTargetTag; - static f32 mTargetTagDist; - static s16 mWolfAngle; + static DUSK_GAME_DATA EventFn mEvtSeqList[6]; + static DUSK_GAME_DATA daTagEscape_c* mTargetTag; + static DUSK_GAME_DATA f32 mTargetTagDist; + static DUSK_GAME_DATA s16 mWolfAngle; private: /* 0x0B48 */ Z2CreatureCitizen mSound; diff --git a/include/d/actor/d_a_npc_kasi_kyu.h b/include/d/actor/d_a_npc_kasi_kyu.h index 0387c563b7..962a2e04cc 100644 --- a/include/d/actor/d_a_npc_kasi_kyu.h +++ b/include/d/actor/d_a_npc_kasi_kyu.h @@ -14,7 +14,7 @@ class daNpcKasiKyu_Param_c { public: virtual ~daNpcKasiKyu_Param_c() {} - static daNpcKasiKyu_HIOParam const m; + static DUSK_GAME_DATA daNpcKasiKyu_HIOParam const m; }; #if DEBUG @@ -120,10 +120,10 @@ public: void chgWeightLight() { mCcStts.SetWeight(0xD8); } BOOL pl_front_check() { return actor_front_check(daPy_getPlayerActorClass()); } - static EventFn mEvtSeqList[1]; - static daTagEscape_c* mTargetTag; - static f32 mTargetTagDist; - static s16 mWolfAngle; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[1]; + static DUSK_GAME_DATA daTagEscape_c* mTargetTag; + static DUSK_GAME_DATA f32 mTargetTagDist; + static DUSK_GAME_DATA s16 mWolfAngle; private: /* 0x0B48 */ Z2CreatureCitizen mSound; diff --git a/include/d/actor/d_a_npc_kasi_mich.h b/include/d/actor/d_a_npc_kasi_mich.h index e3782f1b27..efa1a221c6 100644 --- a/include/d/actor/d_a_npc_kasi_mich.h +++ b/include/d/actor/d_a_npc_kasi_mich.h @@ -23,7 +23,7 @@ class daNpcKasiMich_Param_c { public: virtual ~daNpcKasiMich_Param_c() {} - static daNpcKasiMich_HIOParam const m; + static DUSK_GAME_DATA daNpcKasiMich_HIOParam const m; }; #if DEBUG @@ -121,10 +121,10 @@ public: void chgWeightLight() { mCcStts.SetWeight(0xD8); } BOOL pl_front_check() { return actor_front_check(daPy_getPlayerActorClass()); } - static EventFn mEvtSeqList[1]; - static daTagEscape_c* mTargetTag; - static f32 mTargetTagDist; - static s16 mWolfAngle; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[1]; + static DUSK_GAME_DATA daTagEscape_c* mTargetTag; + static DUSK_GAME_DATA f32 mTargetTagDist; + static DUSK_GAME_DATA s16 mWolfAngle; private: /* 0x0B48 */ Z2CreatureCitizen mSound; diff --git a/include/d/actor/d_a_npc_kkri.h b/include/d/actor/d_a_npc_kkri.h index 964599d45e..c6e173480d 100644 --- a/include/d/actor/d_a_npc_kkri.h +++ b/include/d/actor/d_a_npc_kkri.h @@ -11,7 +11,7 @@ class daNpc_Kkri_Param_c { public: virtual ~daNpc_Kkri_Param_c() {} - static const daNpc_Kkri_HIOParam m; + static DUSK_GAME_DATA const daNpc_Kkri_HIOParam m; }; #if DEBUG @@ -71,7 +71,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) @@ -118,8 +118,8 @@ public: return mpMorf[0]->getModel()->getAnmMtx(5); } - static char* mCutNameList[3]; - static int (daNpc_Kkri_c::*mCutList[])(int); + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[3]; + static DUSK_GAME_DATA int (daNpc_Kkri_c::* DUSK_CONST mCutList[])(int); private: /* 0xE40 */ NPC_KKRI_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_kn.h b/include/d/actor/d_a_npc_kn.h index e97431baef..9e1794db97 100644 --- a/include/d/actor/d_a_npc_kn.h +++ b/include/d/actor/d_a_npc_kn.h @@ -25,7 +25,7 @@ class daNpc_Kn_Param_c { public: virtual ~daNpc_Kn_Param_c() {} - static const daNpc_Kn_HIOParam m; + static DUSK_GAME_DATA const daNpc_Kn_HIOParam m; }; #if DEBUG @@ -88,7 +88,7 @@ public: /* 0x05AC */ const daNpcT_faceMotionAnmData_c* mpFaceMotionAnmData; /* 0x05B0 */ const daNpcT_motionAnmData_c* mpMotionAnmData; /* 0x05B4 */ const daNpcT_evtData_c* mpEventData; - /* 0x05B8 */ char** mpArcNames; + /* 0x05B8 */ char DUSK_CONST* DUSK_CONST* mpArcNames; /* 0x05BC */ mDoExt_McaMorfSO* mpModelMorf[2]; /* 0x05C4 */ Z2Creature mSound; /* 0x0654 */ mDoExt_bckAnm mBckAnm; @@ -322,8 +322,8 @@ public: int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int); BOOL setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); BOOL setBtkAnm(J3DAnmTextureSRTKey*, J3DModelData*, f32, int); - int loadRes(s8 const*, char const**); - void deleteRes(s8 const*, char const**); + int loadRes(s8 const*, char const* DUSK_CONST*); + void deleteRes(s8 const*, char const* DUSK_CONST*); int execute(); int draw(int, int, f32, GXColorS10*, f32, int, int, int); void setEnvTevColor(); @@ -355,7 +355,7 @@ public: daNpcT_motionAnmData_c const* param_1, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_2, int param_3, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_4, int param_5, - daNpcT_evtData_c const* param_6, char** param_7) + daNpcT_evtData_c const* param_6, char DUSK_CONST* DUSK_CONST* param_7) : mpFaceMotionAnmData(param_0), mpMotionAnmData(param_1), mFaceMotionSeqMngr(param_2, param_3), mMotionSeqMngr(param_4, param_5), mpEventData(param_6), mpArcNames(param_7) { @@ -412,14 +412,14 @@ public: virtual ~daNpc_Kn_c(); virtual bool afterSetMotionAnm(int, int, f32, int); - static const dCcD_SrcGObjInf mCcDObjData; - static char* mCutNameList[21]; - static cutFunc mCutList[21]; - static dCcD_SrcCyl mCcDCyl; - static dCcD_SrcSph mCcDSph; - static s16 mSrchName; - static fopAc_ac_c* mFindActorPtrs[50]; - static int mFindCount; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjData; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[21]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[21]; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA s16 mSrchName; + static DUSK_GAME_DATA fopAc_ac_c* mFindActorPtrs[50]; + static DUSK_GAME_DATA int mFindCount; private: /* 0x0E44 */ J3DModel* mpPodModel; diff --git a/include/d/actor/d_a_npc_knj.h b/include/d/actor/d_a_npc_knj.h index b9677c7507..f8db1cdedb 100644 --- a/include/d/actor/d_a_npc_knj.h +++ b/include/d/actor/d_a_npc_knj.h @@ -11,7 +11,7 @@ class daNpc_Knj_Param_c { public: virtual ~daNpc_Knj_Param_c() {} - static const daNpc_Knj_HIOParam m; + static DUSK_GAME_DATA const daNpc_Knj_HIOParam m; }; #if DEBUG @@ -75,13 +75,13 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_KNJ_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_kolin.h b/include/d/actor/d_a_npc_kolin.h index b6fded937b..28f455be35 100644 --- a/include/d/actor/d_a_npc_kolin.h +++ b/include/d/actor/d_a_npc_kolin.h @@ -18,7 +18,7 @@ class daNpc_Kolin_Param_c { public: virtual ~daNpc_Kolin_Param_c() {} - static daNpc_Kolin_HIOParam const m; + static DUSK_GAME_DATA daNpc_Kolin_HIOParam const m; }; #if DEBUG @@ -93,7 +93,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -120,8 +120,8 @@ public: virtual void changeAnm(int*, int*); virtual void changeBck(int*, int*); - static char* mCutNameList[11]; - static cutFunc mCutList[11]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[11]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[11]; u32 getFlowNodeNo() { u16 nodeNo = home.angle.x; diff --git a/include/d/actor/d_a_npc_kolinb.h b/include/d/actor/d_a_npc_kolinb.h index cea3e7a3e2..bf4392a697 100644 --- a/include/d/actor/d_a_npc_kolinb.h +++ b/include/d/actor/d_a_npc_kolinb.h @@ -12,7 +12,7 @@ class daNpc_Kolinb_Param_c { public: virtual ~daNpc_Kolinb_Param_c() {} - static daNpc_Kolinb_HIOParam const m; + static DUSK_GAME_DATA daNpc_Kolinb_HIOParam const m; }; #if DEBUG @@ -140,7 +140,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -150,8 +150,8 @@ public: s32 getBackboneJointNo() { return mType == 2 ? ZRCB_JNT_BACKBONE1 : KOLINB_JNT_BACKBONE1; } s32 getNeckJointNo() { return mType == 2 ? ZRCB_JNT_NECK : KOLINB_JNT_NECK; } - static char* mCutNameList[7]; - static cutFunc mCutList[7]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[7]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; u32 getFlowNodeNo() { u16 nodeNo = home.angle.x; diff --git a/include/d/actor/d_a_npc_kyury.h b/include/d/actor/d_a_npc_kyury.h index 98d87398e1..8469dd3528 100644 --- a/include/d/actor/d_a_npc_kyury.h +++ b/include/d/actor/d_a_npc_kyury.h @@ -11,7 +11,7 @@ class daNpc_Kyury_Param_c { public: virtual ~daNpc_Kyury_Param_c() {} - static const daNpc_Kyury_HIOParam m; + static DUSK_GAME_DATA const daNpc_Kyury_HIOParam m; }; #if DEBUG @@ -106,7 +106,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, - int param_6, daNpcT_evtData_c const* param_7, char** param_8) + int param_6, daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u16 getEyeballMaterialNo() { return 2; } s32 getHeadJointNo() { return 4; } @@ -123,8 +123,8 @@ public: return nodeNo; } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0xE40 */ NPC_KYURY_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_len.h b/include/d/actor/d_a_npc_len.h index 71e659274a..13b959c3b7 100644 --- a/include/d/actor/d_a_npc_len.h +++ b/include/d/actor/d_a_npc_len.h @@ -14,7 +14,7 @@ class daNpc_Len_Param_c { public: virtual ~daNpc_Len_Param_c() {} - static const daNpc_Len_HIOParam m; + static DUSK_GAME_DATA const daNpc_Len_HIOParam m; }; #if DEBUG @@ -86,7 +86,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -100,8 +100,8 @@ public: s32 getFootRJointNo() { return 32; } BOOL chkXYItems() { return TRUE; } - static char* mCutNameList[4]; - static cutFunc mCutList[4]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[4]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[4]; int getFlowNodeNo() { u16 nodeNo = home.angle.x; diff --git a/include/d/actor/d_a_npc_lud.h b/include/d/actor/d_a_npc_lud.h index 1adad66e20..afecfdc0c7 100644 --- a/include/d/actor/d_a_npc_lud.h +++ b/include/d/actor/d_a_npc_lud.h @@ -12,7 +12,7 @@ class daNpc_Lud_Param_c { public: virtual ~daNpc_Lud_Param_c() {} - static const daNpc_Lud_HIOParam m; + static DUSK_GAME_DATA const daNpc_Lud_HIOParam m; }; #if DEBUG @@ -91,7 +91,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -111,8 +111,8 @@ public: } u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; } - static char* mCutNameList[8]; - static cutFunc mCutList[8]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[8]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[8]; private: /* 0xE40 */ mDoExt_McaMorfSO* mpBowlMorf; diff --git a/include/d/actor/d_a_npc_maro.h b/include/d/actor/d_a_npc_maro.h index 18944ad9d7..1c51a63b44 100644 --- a/include/d/actor/d_a_npc_maro.h +++ b/include/d/actor/d_a_npc_maro.h @@ -14,7 +14,7 @@ class daNpc_Maro_Param_c { public: virtual ~daNpc_Maro_Param_c() {} - static const daNpc_Maro_HIOParam m; + static DUSK_GAME_DATA const daNpc_Maro_HIOParam m; }; #if DEBUG @@ -132,7 +132,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -167,8 +167,8 @@ public: void startChoccai() { field_0x1134 = 1; } void endChoccai() { field_0x1134 = 0; } - static char* mCutNameList[17]; - static cutFunc mCutList[17]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[17]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[17]; u8 getGroupId() { return (fopAcM_GetParam(this) & 0xF0000000) >> 28; diff --git a/include/d/actor/d_a_npc_midp.h b/include/d/actor/d_a_npc_midp.h index fcbc4ed3fa..60efbbac80 100644 --- a/include/d/actor/d_a_npc_midp.h +++ b/include/d/actor/d_a_npc_midp.h @@ -20,7 +20,7 @@ class daNpc_midP_Param_c { public: virtual ~daNpc_midP_Param_c() {} - static const daNpc_midP_HIOParam m; + static DUSK_GAME_DATA const daNpc_midP_HIOParam m; }; #if DEBUG @@ -130,7 +130,7 @@ public: daNpc_midP_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u16 getEyeballRMaterialNo() { return 3; } u16 getEyeballLMaterialNo() { return 2; } @@ -148,8 +148,8 @@ public: return nodeNo; } - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_MIDP_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_moi.h b/include/d/actor/d_a_npc_moi.h index b387a58235..547c3a1dcd 100644 --- a/include/d/actor/d_a_npc_moi.h +++ b/include/d/actor/d_a_npc_moi.h @@ -26,7 +26,7 @@ class daNpc_Moi_Param_c { public: virtual ~daNpc_Moi_Param_c() {} - static const daNpc_Moi_HIOParam m; + static DUSK_GAME_DATA const daNpc_Moi_HIOParam m; }; #if DEBUG @@ -128,7 +128,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -158,8 +158,8 @@ public: bool chkSFight() { return field_0x166b == 1; } u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; } - static char* mCutNameList[5]; - static cutFunc mCutList[5]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[5]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[5]; private: /* 0x0E40 */ NPC_MOI_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_moir.h b/include/d/actor/d_a_npc_moir.h index 0cc8be336a..f9aa841a60 100644 --- a/include/d/actor/d_a_npc_moir.h +++ b/include/d/actor/d_a_npc_moir.h @@ -23,7 +23,7 @@ class daNpcMoiR_Param_c { public: virtual ~daNpcMoiR_Param_c() {} - static daNpcMoiR_HIOParam const m; + static DUSK_GAME_DATA daNpcMoiR_HIOParam const m; }; #if DEBUG @@ -212,7 +212,7 @@ public: inline void setLookMode(int i_lookMode); inline void searchActors(); - static EventFn mEvtSeqList[4]; + static DUSK_GAME_DATA EventFn mEvtSeqList[4]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_myna2.h b/include/d/actor/d_a_npc_myna2.h index ac6af4d8f7..e2172eb4cd 100644 --- a/include/d/actor/d_a_npc_myna2.h +++ b/include/d/actor/d_a_npc_myna2.h @@ -13,7 +13,7 @@ class daNpc_myna2_Param_c { public: virtual ~daNpc_myna2_Param_c() {} - static const daNpc_myna2_HIOParam m; + static DUSK_GAME_DATA const daNpc_myna2_HIOParam m; }; #if DEBUG @@ -87,8 +87,8 @@ public: int getType() { return mType; } - static char* mEvtCutNameList[5]; - static EventFn mEvtCutList[]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[5]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[]; /* 0xB48 */ u8 field_0xB48[0xB4C - 0xB48]; /* 0xB4C */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_pachi_besu.h b/include/d/actor/d_a_npc_pachi_besu.h index 2dd99f1b98..7fa17d8b2d 100644 --- a/include/d/actor/d_a_npc_pachi_besu.h +++ b/include/d/actor/d_a_npc_pachi_besu.h @@ -11,7 +11,7 @@ class daNpc_Pachi_Besu_Param_c { public: virtual ~daNpc_Pachi_Besu_Param_c() {} - static daNpc_Pachi_Besu_HIOParam const m; + static DUSK_GAME_DATA daNpc_Pachi_Besu_HIOParam const m; }; #if DEBUG @@ -115,7 +115,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -144,8 +144,8 @@ public: void setTagPos(cXyz const& i_pos) { mTagPos = i_pos; } void setLookPos(cXyz const& i_pos) { mLookPos = i_pos; } - static char* mCutNameList[11]; - static cutFunc mCutList[11]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[11]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[11]; private: /* 0xE40 */ NPC_PACHI_BESU_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_pachi_maro.h b/include/d/actor/d_a_npc_pachi_maro.h index 716e599ffd..379c2c204b 100644 --- a/include/d/actor/d_a_npc_pachi_maro.h +++ b/include/d/actor/d_a_npc_pachi_maro.h @@ -21,7 +21,7 @@ class daNpc_Pachi_Maro_Param_c { public: virtual ~daNpc_Pachi_Maro_Param_c() {} - static daNpc_Pachi_Maro_HIOParam const m; + static DUSK_GAME_DATA daNpc_Pachi_Maro_HIOParam const m; }; #if DEBUG @@ -149,7 +149,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -184,8 +184,8 @@ public: void setFMotion_Niramu_to_Besu() { mFMotion = 1; } void setFMotion_LookNone() { mFMotion = 2; } - static char* mCutNameList[11]; - static cutFunc mCutList[11]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[11]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[11]; private: /* 0xE40 */ NPC_PACHI_MARO_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_pachi_taro.h b/include/d/actor/d_a_npc_pachi_taro.h index b9c24cde8c..12de6aedf4 100644 --- a/include/d/actor/d_a_npc_pachi_taro.h +++ b/include/d/actor/d_a_npc_pachi_taro.h @@ -20,7 +20,7 @@ class daNpc_Pachi_Taro_Param_c { public: virtual ~daNpc_Pachi_Taro_Param_c() {} - static daNpc_Pachi_Taro_HIOParam const m; + static DUSK_GAME_DATA daNpc_Pachi_Taro_HIOParam const m; }; #if DEBUG @@ -166,7 +166,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -196,8 +196,8 @@ public: void setTagPos(cXyz const& i_pos) { mTagPos = i_pos; } void setLookPos(cXyz const& i_pos) { mLookPos = i_pos; } - static char* mCutNameList[11]; - static cutFunc mCutList[11]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[11]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[11]; private: /* 0x0E40 */ NPC_PACHI_TARO_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_passer.h b/include/d/actor/d_a_npc_passer.h index f6c05ae7a5..d2f6f0b764 100644 --- a/include/d/actor/d_a_npc_passer.h +++ b/include/d/actor/d_a_npc_passer.h @@ -92,36 +92,36 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) >> 16) & 0xFF; } BOOL isStop() { return TRUE; } - static actionFunc ActionTable[5][2]; - static seqFunc* m_funcTbl[28]; - static seqFunc m_seq00_funcTbl[2]; - static seqFunc m_seq01_funcTbl[2]; - static seqFunc m_seq02_funcTbl[2]; - static seqFunc m_seq03_funcTbl[2]; - static seqFunc m_seq04_funcTbl[2]; - static seqFunc m_seq05_funcTbl[4]; - static seqFunc m_seq06_funcTbl[4]; - static seqFunc m_seq07_funcTbl[2]; - static seqFunc m_seq08_funcTbl[7]; - static seqFunc m_seq09_funcTbl[2]; - static seqFunc m_seq10_funcTbl[2]; - static seqFunc m_seq11_funcTbl[6]; - static seqFunc m_seq12_funcTbl[2]; - static seqFunc m_seq13_funcTbl[6]; - static seqFunc m_seq14_funcTbl[2]; - static seqFunc m_seq15_funcTbl[2]; - static seqFunc m_seq16_funcTbl[7]; - static seqFunc m_seq17_funcTbl[2]; - static seqFunc m_seq18_funcTbl[2]; - static seqFunc m_seq19_funcTbl[7]; - static seqFunc m_seq20_funcTbl[2]; - static seqFunc m_seq21_funcTbl[2]; - static seqFunc m_seq22_funcTbl[4]; - static seqFunc m_seq23_funcTbl[7]; - static seqFunc m_seq24_funcTbl[5]; - static seqFunc m_seq25_funcTbl[7]; - static seqFunc m_seq26_funcTbl[3]; - static seqFunc m_seq27_funcTbl[1]; + static DUSK_GAME_DATA actionFunc ActionTable[5][2]; + static DUSK_GAME_DATA seqFunc* m_funcTbl[28]; + static DUSK_GAME_DATA seqFunc m_seq00_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq01_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq02_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq03_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq04_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq05_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq06_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq07_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq08_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq09_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq10_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq11_funcTbl[6]; + static DUSK_GAME_DATA seqFunc m_seq12_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq13_funcTbl[6]; + static DUSK_GAME_DATA seqFunc m_seq14_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq15_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq16_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq17_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq18_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq19_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq20_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq21_funcTbl[2]; + static DUSK_GAME_DATA seqFunc m_seq22_funcTbl[4]; + static DUSK_GAME_DATA seqFunc m_seq23_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq24_funcTbl[5]; + static DUSK_GAME_DATA seqFunc m_seq25_funcTbl[7]; + static DUSK_GAME_DATA seqFunc m_seq26_funcTbl[3]; + static DUSK_GAME_DATA seqFunc m_seq27_funcTbl[1]; private: /* 0xAC8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_npc_passer2.h b/include/d/actor/d_a_npc_passer2.h index 529b99fc35..792bbfd329 100644 --- a/include/d/actor/d_a_npc_passer2.h +++ b/include/d/actor/d_a_npc_passer2.h @@ -51,7 +51,7 @@ public: u8 getRunMotionType() { return fopAcM_GetParam(this) >> 30; } u8 getPathID() { return (fopAcM_GetParam(this) >> 16) & 0xFF; } - static actionFunc ActionTable[1][2]; + static DUSK_GAME_DATA actionFunc ActionTable[1][2]; private: /* 0x9EC */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_npc_post.h b/include/d/actor/d_a_npc_post.h index 91b6396ed8..7b31506513 100644 --- a/include/d/actor/d_a_npc_post.h +++ b/include/d/actor/d_a_npc_post.h @@ -22,7 +22,7 @@ class daNpc_Post_Param_c { public: virtual ~daNpc_Post_Param_c() {} - static daNpc_Post_HIOParam const m; + static DUSK_GAME_DATA daNpc_Post_HIOParam const m; }; #if DEBUG @@ -125,7 +125,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -153,8 +153,8 @@ public: u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0x0E40 */ mDoExt_McaMorfSO* mpFlagModelMorf; diff --git a/include/d/actor/d_a_npc_pouya.h b/include/d/actor/d_a_npc_pouya.h index 19cf0b94b8..c30b0e0199 100644 --- a/include/d/actor/d_a_npc_pouya.h +++ b/include/d/actor/d_a_npc_pouya.h @@ -11,7 +11,7 @@ class daNpc_Pouya_Param_c { public: virtual ~daNpc_Pouya_Param_c() {} - static const daNpc_Pouya_HIOParam m; + static DUSK_GAME_DATA const daNpc_Pouya_HIOParam m; }; #if DEBUG @@ -121,7 +121,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -146,8 +146,8 @@ public: MtxP getHeadMtx() { return mpMorf[0]->getModel()->getAnmMtx(4); } - static char* mCutNameList[3]; - static cutFunc mCutList[3]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[3]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[3]; private: /* 0xE40 */ NPC_POUYA_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_prayer.h b/include/d/actor/d_a_npc_prayer.h index 459710f049..bc2735a43f 100644 --- a/include/d/actor/d_a_npc_prayer.h +++ b/include/d/actor/d_a_npc_prayer.h @@ -11,7 +11,7 @@ class daNpcPray_Param_c { public: virtual ~daNpcPray_Param_c() {} - static const daNpcPray_HIOParam m; + static DUSK_GAME_DATA const daNpcPray_HIOParam m; }; #if DEBUG @@ -77,7 +77,7 @@ public: s16 getMessageNo() { return (fopAcM_GetParam(this) >> 8) & 0xFFFF; } - static EvtSeq mEvtSeqList[]; + static DUSK_GAME_DATA EvtSeq DUSK_CONST mEvtSeqList[]; private: /* 0xB48 */ Z2CreatureCitizen mSound; diff --git a/include/d/actor/d_a_npc_raca.h b/include/d/actor/d_a_npc_raca.h index 42a3229e8f..9cd1849880 100644 --- a/include/d/actor/d_a_npc_raca.h +++ b/include/d/actor/d_a_npc_raca.h @@ -20,7 +20,7 @@ class daNpc_Raca_Param_c { public: virtual ~daNpc_Raca_Param_c() {} - static daNpc_Raca_HIOParam const m; + static DUSK_GAME_DATA daNpc_Raca_HIOParam const m; }; #if DEBUG @@ -121,7 +121,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -145,8 +145,8 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF0000) >> 16; } - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_RACA_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_rafrel.h b/include/d/actor/d_a_npc_rafrel.h index ae804cf15a..3b3ac191bd 100644 --- a/include/d/actor/d_a_npc_rafrel.h +++ b/include/d/actor/d_a_npc_rafrel.h @@ -22,7 +22,7 @@ class daNpcRafrel_Param_c { public: virtual ~daNpcRafrel_Param_c() {} - static const daNpcRafrel_HIOParam m; + static DUSK_GAME_DATA const daNpcRafrel_HIOParam m; }; class daNpcRafrel_HIO_c : public mDoHIO_entry_c { @@ -105,7 +105,7 @@ public: s16 getMessageNo() { return (fopAcM_GetParam(this) >> 8) & 0xFFFF; } - static int (daNpcRafrel_c::*mEvtSeqList[])(int); + static DUSK_GAME_DATA int (daNpcRafrel_c::*mEvtSeqList[])(int); private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_saru.h b/include/d/actor/d_a_npc_saru.h index 14c36ec633..7f04c509e2 100644 --- a/include/d/actor/d_a_npc_saru.h +++ b/include/d/actor/d_a_npc_saru.h @@ -21,7 +21,7 @@ class daNpc_Saru_Param_c { public: virtual ~daNpc_Saru_Param_c() {} - static const daNpc_Saru_HIOParam m; + static DUSK_GAME_DATA const daNpc_Saru_HIOParam m; }; #if DEBUG @@ -115,7 +115,7 @@ public: daNpc_Saru_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} s32 getHeadJointNo() { return JNT_HEAD; } @@ -133,8 +133,8 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; } u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff00) >> 8; } - static char* mCutNameList[4]; - static cutFunc mCutList[4]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[4]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[4]; private: /* 0xE40 */ NPC_SARU_HIO_CLASS* mpHIO; /* 0xE44 */ J3DModel* mpRoseModels[2]; diff --git a/include/d/actor/d_a_npc_seib.h b/include/d/actor/d_a_npc_seib.h index 43e887dc64..f2d0e04820 100644 --- a/include/d/actor/d_a_npc_seib.h +++ b/include/d/actor/d_a_npc_seib.h @@ -13,7 +13,7 @@ class daNpc_seiB_Param_c { public: virtual ~daNpc_seiB_Param_c() {}; - static const daNpc_seiB_HIOParam m; + static DUSK_GAME_DATA const daNpc_seiB_HIOParam m; }; #if DEBUG @@ -80,12 +80,12 @@ public: daNpc_seiB_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_SEIB_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_seic.h b/include/d/actor/d_a_npc_seic.h index dd860a8869..526331f05e 100644 --- a/include/d/actor/d_a_npc_seic.h +++ b/include/d/actor/d_a_npc_seic.h @@ -22,7 +22,7 @@ class daNpc_seiC_Param_c { public: virtual ~daNpc_seiC_Param_c() {} - static const daNpc_seiC_HIOParam m; + static DUSK_GAME_DATA const daNpc_seiC_HIOParam m; }; #if DEBUG @@ -82,13 +82,13 @@ public: daNpc_seiC_c(daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData, daNpcT_motionAnmData_c const* i_motionAnmData, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {}; - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_SEIC_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_seid.h b/include/d/actor/d_a_npc_seid.h index 7119761b25..37cc6302d6 100644 --- a/include/d/actor/d_a_npc_seid.h +++ b/include/d/actor/d_a_npc_seid.h @@ -22,7 +22,7 @@ class daNpc_seiD_Param_c { public: virtual ~daNpc_seiD_Param_c() {} - static const daNpc_seiD_HIOParam m; + static DUSK_GAME_DATA const daNpc_seiD_HIOParam m; }; #if DEBUG @@ -81,13 +81,13 @@ public: daNpc_seiD_c(daNpcT_faceMotionAnmData_c const* i_faceMotionAnmData, daNpcT_motionAnmData_c const* i_motionAnmData, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {}; - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_SEID_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_seira.h b/include/d/actor/d_a_npc_seira.h index 5c387526d8..d750c70711 100644 --- a/include/d/actor/d_a_npc_seira.h +++ b/include/d/actor/d_a_npc_seira.h @@ -12,7 +12,7 @@ class daNpc_Seira_Param_c { public: virtual ~daNpc_Seira_Param_c() {} - static const daNpc_Seira_HIOParam m; + static DUSK_GAME_DATA const daNpc_Seira_HIOParam m; }; #if DEBUG @@ -100,7 +100,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -114,8 +114,8 @@ public: BOOL checkChangeJoint(int val) { return val == 4; } BOOL checkRemoveJoint(int val) { return val == 8; } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0x0F7C */ mDoExt_McaMorfSO* mpSeiraMorf; diff --git a/include/d/actor/d_a_npc_seira2.h b/include/d/actor/d_a_npc_seira2.h index 9743a2b7a3..496357af4e 100644 --- a/include/d/actor/d_a_npc_seira2.h +++ b/include/d/actor/d_a_npc_seira2.h @@ -12,7 +12,7 @@ class daNpc_Seira2_Param_c { public: virtual ~daNpc_Seira2_Param_c() {} - static const daNpc_Seira2_HIOParam m; + static DUSK_GAME_DATA const daNpc_Seira2_HIOParam m; }; #if DEBUG @@ -92,7 +92,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : dShopSystem_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -106,8 +106,8 @@ public: BOOL checkChangeJoint(int val) { return val == 4; } BOOL checkRemoveJoint(int val) { return val == 8; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0x0F7C */ mDoExt_McaMorfSO* mpSeiraMorf; diff --git a/include/d/actor/d_a_npc_seirei.h b/include/d/actor/d_a_npc_seirei.h index 8e42d1a035..a25c9671ae 100644 --- a/include/d/actor/d_a_npc_seirei.h +++ b/include/d/actor/d_a_npc_seirei.h @@ -13,7 +13,7 @@ class daNpc_Seirei_Param_c { public: virtual ~daNpc_Seirei_Param_c() {} - static daNpc_Seirei_HIOParam const m; + static DUSK_GAME_DATA daNpc_Seirei_HIOParam const m; }; #if DEBUG @@ -83,7 +83,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -99,8 +99,8 @@ public: u32 getBitSW() { return (fopAcM_GetParam(this) & 0xFF000) >> 12; } bool getDoBtnChkFlag() { return (fopAcM_GetParam(this) & 0x100) == 0; } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0xE40 */ NPC_SEIREI_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_shad.h b/include/d/actor/d_a_npc_shad.h index ba94bbe74e..7f4490c183 100644 --- a/include/d/actor/d_a_npc_shad.h +++ b/include/d/actor/d_a_npc_shad.h @@ -12,7 +12,7 @@ class daNpcShad_Param_c : public JORReflexible { public: virtual ~daNpcShad_Param_c() {} - static const daNpcShad_HIOParam m; + static DUSK_GAME_DATA const daNpcShad_HIOParam m; }; #if DEBUG @@ -184,7 +184,7 @@ public: void lookat(); BOOL drawDbgInfo(); - static EventFn mEvtSeqList[14]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[14]; u8 getPathID() { return (fopAcM_GetParam(this) >> 8) & 0xFF; } s16 getMessageNo() { return shape_angle.x; } diff --git a/include/d/actor/d_a_npc_shaman.h b/include/d/actor/d_a_npc_shaman.h index 5f0a26b52f..cdb7f7d7e9 100644 --- a/include/d/actor/d_a_npc_shaman.h +++ b/include/d/actor/d_a_npc_shaman.h @@ -20,7 +20,7 @@ class daNpc_Sha_Param_c { public: virtual ~daNpc_Sha_Param_c() {} - static daNpc_Sha_HIOParam const m; + static DUSK_GAME_DATA daNpc_Sha_HIOParam const m; }; #if DEBUG @@ -94,7 +94,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { OS_REPORT("|%06d:%x|daNpc_Sha_c -> コンストラクト\n", g_Counter.mCounter0, this); } @@ -110,12 +110,12 @@ public: return nodeNo == 0xFFFF ? -1 : nodeNo; } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; - static const u16 mEvtBitLabels[6]; - static const u16 mTmpBitLabels[6]; - static const int mSceneChangeNoTable[48]; - static queryFunc mQueries[48]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; + static DUSK_GAME_DATA const u16 mEvtBitLabels[6]; + static DUSK_GAME_DATA const u16 mTmpBitLabels[6]; + static DUSK_GAME_DATA const int mSceneChangeNoTable[48]; + static DUSK_GAME_DATA queryFunc mQueries[48]; private: /* 0xE40 */ NPC_SHA_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_shoe.h b/include/d/actor/d_a_npc_shoe.h index 0b96f8567b..f9bee53132 100644 --- a/include/d/actor/d_a_npc_shoe.h +++ b/include/d/actor/d_a_npc_shoe.h @@ -11,7 +11,7 @@ class daNpcShoe_Param_c { public: virtual ~daNpcShoe_Param_c() {} - static const daNpcShoe_HIOParam m; + static DUSK_GAME_DATA const daNpcShoe_HIOParam m; }; STATIC_ASSERT(sizeof(daNpcShoe_Param_c::m) == 0x6C); @@ -110,7 +110,7 @@ public: inline bool chkFindPlayer(); inline void playMotion(); - static EventFn mEvtSeqList[1]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[1]; private: /* 0xB48 */ J3DModel* mpModel1; diff --git a/include/d/actor/d_a_npc_shop0.h b/include/d/actor/d_a_npc_shop0.h index a2a1ac50a6..aa6d9cdf33 100644 --- a/include/d/actor/d_a_npc_shop0.h +++ b/include/d/actor/d_a_npc_shop0.h @@ -22,7 +22,7 @@ public: /* 0x8 */ u32 mParam3; }; - static param const mParam; + static DUSK_GAME_DATA param const mParam; }; @@ -34,12 +34,12 @@ public: int destroy(); int execute(); int draw(); - char* getResName(); + char DUSK_CONST* getResName(); void getParam(); int getFlowNodeNum(); int isDelete(); int init(); - J3DAnmTransform* getTrnsfrmAnmP(int, char**); + J3DAnmTransform* getTrnsfrmAnmP(int, char DUSK_CONST* DUSK_CONST*); int setBckAnm(J3DAnmTransform*, f32, int, int, int, bool); int setCollision(); int checkEvent(); @@ -52,7 +52,7 @@ public: int wait(void*); int talk(void*); - static dCcD_SrcCyl const mCylDat; + static DUSK_GAME_DATA dCcD_SrcCyl const mCylDat; /* 0x56c */ u8 mParam; /* 0x570 */ mDoExt_bckAnm mBckAnm; diff --git a/include/d/actor/d_a_npc_sola.h b/include/d/actor/d_a_npc_sola.h index 0b13842f9c..bfeb993cc7 100644 --- a/include/d/actor/d_a_npc_sola.h +++ b/include/d/actor/d_a_npc_sola.h @@ -11,7 +11,7 @@ class daNpc_solA_Param_c { public: virtual ~daNpc_solA_Param_c() {} - static daNpc_solA_HIOParam const m; + static DUSK_GAME_DATA daNpc_solA_HIOParam const m; }; #if DEBUG @@ -105,14 +105,14 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, - int param_6, daNpcT_evtData_c const* param_7, char** param_8) + int param_6, daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} s32 getHeadJointNo() { return JNT_HEAD; } s32 getNeckJointNo() { return JNT_NECK; } s32 getBackboneJointNo() { return JNT_BACKBONE1; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_SOLA_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_soldierA.h b/include/d/actor/d_a_npc_soldierA.h index cc841c7092..dfc114d97e 100644 --- a/include/d/actor/d_a_npc_soldierA.h +++ b/include/d/actor/d_a_npc_soldierA.h @@ -20,7 +20,7 @@ class daNpc_SoldierA_Param_c { public: virtual ~daNpc_SoldierA_Param_c() {} - static daNpc_SoldierA_HIOParam const m; + static DUSK_GAME_DATA daNpc_SoldierA_HIOParam const m; }; #if DEBUG @@ -79,8 +79,8 @@ public: u8 getType() { return mType; } - static char* mEvtCutNameList[3]; - static cutFunc mEvtCutList[3]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[3]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[3]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_soldierB.h b/include/d/actor/d_a_npc_soldierB.h index 6e864b0cd2..66813628f9 100644 --- a/include/d/actor/d_a_npc_soldierB.h +++ b/include/d/actor/d_a_npc_soldierB.h @@ -11,7 +11,7 @@ class daNpc_SoldierB_Param_c { public: virtual ~daNpc_SoldierB_Param_c() {} - static daNpc_SoldierB_HIOParam const m; + static DUSK_GAME_DATA daNpc_SoldierB_HIOParam const m; }; #if DEBUG @@ -75,8 +75,8 @@ public: int ECut_listenLake(int); int test(void*); - static char* mEvtCutNameList[2]; - static cutFunc mEvtCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[2]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_taro.h b/include/d/actor/d_a_npc_taro.h index 8db2ec3270..1d0fa6274b 100644 --- a/include/d/actor/d_a_npc_taro.h +++ b/include/d/actor/d_a_npc_taro.h @@ -14,7 +14,7 @@ class daNpc_Taro_Param_c { public: virtual ~daNpc_Taro_Param_c() {} - static daNpc_Taro_HIOParam const m; + static DUSK_GAME_DATA daNpc_Taro_HIOParam const m; }; #if DEBUG @@ -126,7 +126,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, - int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames) + int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -156,8 +156,8 @@ public: u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; } u8 getBitSW2() { return (fopAcM_GetParam(this) & 0xff000000) >> 24; } - static char* mCutNameList[17]; - static cutFunc mCutList[17]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[17]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[17]; private: /* 0x0E40 */ NPC_TARO_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_the.h b/include/d/actor/d_a_npc_the.h index bc78a93925..fba5678e01 100644 --- a/include/d/actor/d_a_npc_the.h +++ b/include/d/actor/d_a_npc_the.h @@ -12,7 +12,7 @@ class daNpcThe_Param_c { public: virtual ~daNpcThe_Param_c() {} - static const daNpcThe_HIOParam m; + static DUSK_GAME_DATA const daNpcThe_HIOParam m; }; STATIC_ASSERT(sizeof(daNpcThe_Param_c::m) == 0x6C); @@ -231,8 +231,8 @@ private: /* 0xE1D */ bool field_0xe1d; /* 0xE1E */ u8 mType; - static char* mEvtCutNameList[4]; - static EventFn mEvtCutList[4]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[4]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[4]; }; STATIC_ASSERT(sizeof(daNpcThe_c) == 0xE20); diff --git a/include/d/actor/d_a_npc_theB.h b/include/d/actor/d_a_npc_theB.h index 9179ddd652..92e0b0b3f0 100644 --- a/include/d/actor/d_a_npc_theB.h +++ b/include/d/actor/d_a_npc_theB.h @@ -19,7 +19,7 @@ struct daNpcTheB_HIOParam { struct daNpcTheB_Param_c { virtual ~daNpcTheB_Param_c() {} - static daNpcTheB_HIOParam const m; + static DUSK_GAME_DATA daNpcTheB_HIOParam const m; }; #if DEBUG @@ -149,7 +149,7 @@ public: } } - static cutFunc mEvtSeqList[6]; + static DUSK_GAME_DATA cutFunc mEvtSeqList[6]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_tkc.h b/include/d/actor/d_a_npc_tkc.h index ab2c871be2..3148354b36 100644 --- a/include/d/actor/d_a_npc_tkc.h +++ b/include/d/actor/d_a_npc_tkc.h @@ -36,7 +36,7 @@ class daNpcTkc_Param_c { public: virtual ~daNpcTkc_Param_c() {} - static daNpcTkc_HIOParam const m; + static DUSK_GAME_DATA daNpcTkc_HIOParam const m; }; #if DEBUG @@ -106,7 +106,7 @@ public: BOOL chkAction(actionFunc action) { return action == mAction; } void lookat(); - static evtFunc mEvtSeqList[4]; + static DUSK_GAME_DATA evtFunc mEvtSeqList[4]; private: /* 0xB48 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_tkj.h b/include/d/actor/d_a_npc_tkj.h index e2718d8b45..8e7e2567b1 100644 --- a/include/d/actor/d_a_npc_tkj.h +++ b/include/d/actor/d_a_npc_tkj.h @@ -11,7 +11,7 @@ class daNpc_Tkj_Param_c { public: virtual ~daNpc_Tkj_Param_c() {} - static const daNpc_Tkj_HIOParam m; + static DUSK_GAME_DATA const daNpc_Tkj_HIOParam m; }; #if DEBUG @@ -67,7 +67,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) @@ -94,8 +94,8 @@ public: int getPath() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } - static char* mCutNameList[2]; - static int (daNpcTkj_c::*mCutList[])(int); + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA int (daNpcTkj_c::* DUSK_CONST mCutList[])(int); private: /* 0xE40 */ NPC_TKJ_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_tks.h b/include/d/actor/d_a_npc_tks.h index c2f7e6ff53..0342a378fe 100644 --- a/include/d/actor/d_a_npc_tks.h +++ b/include/d/actor/d_a_npc_tks.h @@ -31,7 +31,7 @@ class daNpcTks_Param_c { public: virtual ~daNpcTks_Param_c() {} - static daNpcTks_HIOParam const m; + static DUSK_GAME_DATA daNpcTks_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_npc_toby.h b/include/d/actor/d_a_npc_toby.h index 0c3de69c6f..4f53117112 100644 --- a/include/d/actor/d_a_npc_toby.h +++ b/include/d/actor/d_a_npc_toby.h @@ -16,7 +16,7 @@ class daNpc_Toby_Param_c { public: virtual ~daNpc_Toby_Param_c() {} - static const daNpc_Toby_HIOParam m; + static DUSK_GAME_DATA const daNpc_Toby_HIOParam m; }; #if DEBUG @@ -97,7 +97,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -129,8 +129,8 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } u8 getBitSW() { return (fopAcM_GetParam(this) & 0xFF0000) >> 16; } - static char* mCutNameList[7]; - static cutFunc mCutList[7]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[7]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; private: /* 0x0E40 */ NPC_TOBY_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_uri.h b/include/d/actor/d_a_npc_uri.h index 5efde8c51d..78a327592a 100644 --- a/include/d/actor/d_a_npc_uri.h +++ b/include/d/actor/d_a_npc_uri.h @@ -22,7 +22,7 @@ class daNpc_Uri_Param_c { public: virtual ~daNpc_Uri_Param_c() {} - static const daNpc_Uri_HIOParam m; + static DUSK_GAME_DATA const daNpc_Uri_HIOParam m; }; #if DEBUG @@ -113,7 +113,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, - int param_6, daNpcT_evtData_c const* param_7, char** param_8) + int param_6, daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u16 getEyeballMaterialNo() { return 2; } s32 getHeadJointNo() { return 4; } @@ -136,8 +136,8 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xff00) >> 8; } - static const char* mCutNameList[7]; - static cutFunc mCutList[7]; + static DUSK_GAME_DATA const char* mCutNameList[7]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; private: /* 0x0E40 */ NPC_URI_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_wrestler.h b/include/d/actor/d_a_npc_wrestler.h index e9df8ff516..b910ed50f9 100644 --- a/include/d/actor/d_a_npc_wrestler.h +++ b/include/d/actor/d_a_npc_wrestler.h @@ -77,7 +77,7 @@ class daNpcWrestler_Param_c { public: virtual ~daNpcWrestler_Param_c() {} - static daNpcWrestler_HIOParam const m; + static DUSK_GAME_DATA daNpcWrestler_HIOParam const m; }; class daNpcWrestler_HIO_Node_c: public JORReflexible { @@ -110,10 +110,10 @@ public: #endif struct WrestlerParamList { - daNpc_GetParam1* bck_list; - daNpc_GetParam2* face_list; - daNpc_GetParam1* btp_list; - daNpc_GetParam1* btk_list; + DUSK_CONST daNpc_GetParam1* bck_list; + DUSK_CONST daNpc_GetParam2* face_list; + DUSK_CONST daNpc_GetParam1* btp_list; + DUSK_CONST daNpc_GetParam1* btk_list; }; struct DemoCamera_c { @@ -230,7 +230,7 @@ public: inline void initDemoCamera_ReadyWrestler(); inline void playExpression(); - static EventFn mEvtSeqList[7]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[7]; private: /* 0xB48 */ Z2Creature mSound; @@ -254,7 +254,7 @@ private: u8 chkFlag; } mArenaInfo; /* 0xE03 */ u8 field_0xe03; - /* 0xE04 */ WrestlerParamList* field_0xe04; + /* 0xE04 */ WrestlerParamList DUSK_CONST* field_0xe04; /* 0xE08 */ DemoCamera_c mDemoCam; /* 0xE50 */ f32 mDemoCamFovy; /* 0xE54 */ f32 field_0xe54; diff --git a/include/d/actor/d_a_npc_yamid.h b/include/d/actor/d_a_npc_yamid.h index 77287cb6a1..b175aa7a53 100644 --- a/include/d/actor/d_a_npc_yamid.h +++ b/include/d/actor/d_a_npc_yamid.h @@ -20,7 +20,7 @@ class daNpc_yamiD_Param_c { public: virtual ~daNpc_yamiD_Param_c() {} - static daNpc_yamiD_HIOParam const m; + static DUSK_GAME_DATA daNpc_yamiD_HIOParam const m; }; #if DEBUG @@ -84,7 +84,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -129,8 +129,8 @@ public: field_0xe44.OffTgSetBit(); } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0xE40 */ NPC_YAMID_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_yamis.h b/include/d/actor/d_a_npc_yamis.h index 1a8bc3a56b..4c23311c5e 100644 --- a/include/d/actor/d_a_npc_yamis.h +++ b/include/d/actor/d_a_npc_yamis.h @@ -11,7 +11,7 @@ class daNpc_yamiS_Param_c { public: virtual ~daNpc_yamiS_Param_c() {} - static const daNpc_yamiS_HIOParam m; + static DUSK_GAME_DATA const daNpc_yamiS_HIOParam m; }; #if DEBUG @@ -81,7 +81,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -124,8 +124,8 @@ public: field_0xe44.OffTgSetBit(); } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0xE40 */ NPC_YAMIS_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_yamit.h b/include/d/actor/d_a_npc_yamit.h index f2ddaea4b6..a59b6a841f 100644 --- a/include/d/actor/d_a_npc_yamit.h +++ b/include/d/actor/d_a_npc_yamit.h @@ -12,7 +12,7 @@ class daNpc_yamiT_Param_c { public: virtual ~daNpc_yamiT_Param_c() {} - static const daNpc_yamiT_HIOParam m; + static DUSK_GAME_DATA const daNpc_yamiT_HIOParam m; }; #if DEBUG @@ -84,7 +84,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -123,8 +123,8 @@ public: } u8 _is_stopper_off() { return fopAcM_isSwitch(this, 0x3D) && fopAcM_isSwitch(this, 0x3E); } - static char* mCutNameList[2]; - static cutFunc mCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[2]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[2]; private: /* 0xE40 */ NPC_YAMIT_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_yelia.h b/include/d/actor/d_a_npc_yelia.h index d512ad8d75..737a3b4e28 100644 --- a/include/d/actor/d_a_npc_yelia.h +++ b/include/d/actor/d_a_npc_yelia.h @@ -11,7 +11,7 @@ class daNpc_Yelia_Param_c { public: virtual ~daNpc_Yelia_Param_c() {} - static daNpc_Yelia_HIOParam const m; + static DUSK_GAME_DATA daNpc_Yelia_HIOParam const m; }; #if DEBUG @@ -82,7 +82,7 @@ public: int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -102,8 +102,8 @@ public: return no; } - static char* mCutNameList[6]; - static int (daNpc_Yelia_c::*mCutList[6])(int); + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[6]; + static DUSK_GAME_DATA int (daNpc_Yelia_c::*mCutList[6])(int); private: /* 0xE40 */ NPC_YELIA_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl mCcCyl; diff --git a/include/d/actor/d_a_npc_ykm.h b/include/d/actor/d_a_npc_ykm.h index 69c9d99858..d486d6fe6a 100644 --- a/include/d/actor/d_a_npc_ykm.h +++ b/include/d/actor/d_a_npc_ykm.h @@ -38,7 +38,7 @@ class daNpc_ykM_Param_c { public: virtual ~daNpc_ykM_Param_c() {} - static daNpc_ykM_HIOParam const m; + static DUSK_GAME_DATA daNpc_ykM_HIOParam const m; }; #if DEBUG @@ -258,7 +258,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, daNpcT_evtData_c const* i_evtData, - char** i_arcNames) + char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -285,8 +285,8 @@ public: int getBitTRB() { return (u8)((fopAcM_GetParam(this) & 0x3F0000) >> 16); } u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } - static char* mCutNameList[10]; - static cutFunc mCutList[10]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[10]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[10]; private: /* 0x0E40 */ mDoExt_McaMorfSO* mFishModelMorf; /* 0x0E44 */ mDoExt_McaMorfSO* mLeafModelMorf; diff --git a/include/d/actor/d_a_npc_ykw.h b/include/d/actor/d_a_npc_ykw.h index 770d452af2..43b3bca276 100644 --- a/include/d/actor/d_a_npc_ykw.h +++ b/include/d/actor/d_a_npc_ykw.h @@ -131,8 +131,8 @@ public: return (fopAcM_GetParam(this) & 0xf0) >> 4; } - static const char* mCutNameList[8]; - static cutFunc mCutList[8]; + static DUSK_GAME_DATA const char* mCutNameList[8]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[8]; void setDialogueTmr1(int param_1) { field_0x1024 = param_1; @@ -216,7 +216,7 @@ class daNpc_ykW_Param_c { public: virtual ~daNpc_ykW_Param_c() {} - static const daNpc_ykW_HIOParam m; + static DUSK_GAME_DATA const daNpc_ykW_HIOParam m; }; #endif /* D_A_NPC_YKW_H */ diff --git a/include/d/actor/d_a_npc_zanb.h b/include/d/actor/d_a_npc_zanb.h index b2c8aa704a..51d99c8253 100644 --- a/include/d/actor/d_a_npc_zanb.h +++ b/include/d/actor/d_a_npc_zanb.h @@ -20,7 +20,7 @@ class daNpc_zanB_Param_c { public: virtual ~daNpc_zanB_Param_c() {} - static daNpc_zanB_HIOParam const m; + static DUSK_GAME_DATA daNpc_zanB_HIOParam const m; }; #if DEBUG @@ -78,7 +78,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) { @@ -99,8 +99,8 @@ public: return nodeNo; } - static char* mCutNameList[1]; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[1]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_ZANB_HIO_CLASS* mHIO; diff --git a/include/d/actor/d_a_npc_zant.h b/include/d/actor/d_a_npc_zant.h index fb5d430694..cbd33863d2 100644 --- a/include/d/actor/d_a_npc_zant.h +++ b/include/d/actor/d_a_npc_zant.h @@ -11,7 +11,7 @@ class daNpc_Zant_Param_c { public: virtual ~daNpc_Zant_Param_c() {} - static const daNpc_Zant_HIOParam m; + static DUSK_GAME_DATA const daNpc_Zant_HIOParam m; }; #if DEBUG @@ -80,11 +80,11 @@ public: daNpc_Zant_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_ZANT_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_zelR.h b/include/d/actor/d_a_npc_zelR.h index 0c6fcd81b4..e7810c850c 100644 --- a/include/d/actor/d_a_npc_zelR.h +++ b/include/d/actor/d_a_npc_zelR.h @@ -20,7 +20,7 @@ class daNpc_ZelR_Param_c { public: virtual ~daNpc_ZelR_Param_c() {}; - static const daNpc_ZelR_HIOParam m; + static DUSK_GAME_DATA const daNpc_ZelR_HIOParam m; }; #if DEBUG @@ -83,7 +83,7 @@ public: daNpc_ZelR_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) : + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} u16 getEyeballRMaterialNo() { return 3; } @@ -93,8 +93,8 @@ public: BOOL checkChangeJoint(int param_1) { return param_1 == 3; }; BOOL checkRemoveJoint(int param_1) { return param_1 == 13; }; - static char* mCutNameList; - static EventFn mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA EventFn mCutList[1]; private: /* 0xE40 */ NPC_ZELR_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_zelRo.h b/include/d/actor/d_a_npc_zelRo.h index b137c3bedb..b3e2533999 100644 --- a/include/d/actor/d_a_npc_zelRo.h +++ b/include/d/actor/d_a_npc_zelRo.h @@ -20,7 +20,7 @@ class daNpc_ZelRo_Param_c { public: virtual ~daNpc_ZelRo_Param_c() {} - static daNpc_ZelRo_HIOParam const m; + static DUSK_GAME_DATA daNpc_ZelRo_HIOParam const m; }; #if DEBUG @@ -135,7 +135,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, int i_faceMotionStepNum, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, int i_motionStepNum, - daNpcT_evtData_c const* i_evtData, char** i_arcNames) + daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_arcNames) {} @@ -147,8 +147,8 @@ public: BOOL checkChangeJoint(int i_joint) { return i_joint == JNT_HEAD; } BOOL checkRemoveJoint(int i_joint) { return i_joint == JNT_MOUTH; } - static char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_ZELRO_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_zelda.h b/include/d/actor/d_a_npc_zelda.h index 78630dbb5b..6c3da5a2b3 100644 --- a/include/d/actor/d_a_npc_zelda.h +++ b/include/d/actor/d_a_npc_zelda.h @@ -14,7 +14,7 @@ class daNpc_Zelda_Param_c { public: virtual ~daNpc_Zelda_Param_c() {} - static const daNpc_Zelda_HIOParam m; + static DUSK_GAME_DATA const daNpc_Zelda_HIOParam m; }; #if DEBUG @@ -88,7 +88,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_2, int param_3, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_4, - int param_5, daNpcT_evtData_c const* param_6, char** param_7) : + int param_5, daNpcT_evtData_c const* param_6, char DUSK_CONST* DUSK_CONST* param_7) : daNpcT_c(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7) { OS_REPORT("|%06d:%x|daNpc_Zelda_c -> コンストラクト\n", g_Counter.mCounter0, this); } @@ -100,8 +100,8 @@ public: int checkChangeJoint(int param_0) { return param_0 == 4; } int checkRemoveJoint(int param_0) { return param_0 == 17; } - static const char* mCutNameList; - static cutFunc mCutList[1]; + static DUSK_GAME_DATA const char* mCutNameList; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; private: /* 0xE40 */ NPC_ZELDA_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_zra.h b/include/d/actor/d_a_npc_zra.h index 1760d3c41d..ee786522f9 100644 --- a/include/d/actor/d_a_npc_zra.h +++ b/include/d/actor/d_a_npc_zra.h @@ -32,7 +32,7 @@ class daNpc_zrA_Param_c { public: virtual ~daNpc_zrA_Param_c() {} - static daNpc_zrA_HIOParam const m; + static DUSK_GAME_DATA daNpc_zrA_HIOParam const m; }; #if DEBUG @@ -399,7 +399,7 @@ public: /* 0x14F0 */ int mBtkID; /* 0x14F4 */ int mBpkID; /* 0x14F8 */ u32 mWaterAnmFlags; - /* 0x14FC */ char* mStaffName; + /* 0x14FC */ DUSK_CONST char* mStaffName; /* 0x1500 */ cXyz field_0x1500; /* 0x150C */ u8 mMeterCount; /* 0x150D */ u8 mGameMode; @@ -443,8 +443,8 @@ public: /* 0x15C0 */ u8 field_0x15c0; /* 0x15C1 */ bool mBlastFlag; - static char* mEvtCutNameList[11]; - static EventFn mEvtCutList[11]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[11]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[11]; }; STATIC_ASSERT(sizeof(daNpc_zrA_c) == 0x15C4); diff --git a/include/d/actor/d_a_npc_zrc.h b/include/d/actor/d_a_npc_zrc.h index 327d87beb5..f4aeee6ac9 100644 --- a/include/d/actor/d_a_npc_zrc.h +++ b/include/d/actor/d_a_npc_zrc.h @@ -16,7 +16,7 @@ class daNpc_zrC_Param_c { public: virtual ~daNpc_zrC_Param_c() {} - static daNpc_zrC_HIOParam const m; + static DUSK_GAME_DATA daNpc_zrC_HIOParam const m; }; #if DEBUG @@ -93,8 +93,8 @@ public: BOOL ECut_earringGet(int); void adjustShapeAngle() {} - static char* mEvtCutNameList[2]; - static EventFn mEvtCutList[2]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[2]; private: /* 0xB48 */ Z2Creature mCreatureSound; diff --git a/include/d/actor/d_a_npc_zrz.h b/include/d/actor/d_a_npc_zrz.h index 4201047ed7..76c782b7d3 100644 --- a/include/d/actor/d_a_npc_zrz.h +++ b/include/d/actor/d_a_npc_zrz.h @@ -20,7 +20,7 @@ class daNpc_zrZ_Param_c { public: virtual ~daNpc_zrZ_Param_c() {} - static daNpc_zrZ_HIOParam const m; + static DUSK_GAME_DATA daNpc_zrZ_HIOParam const m; }; STATIC_ASSERT(sizeof(daNpc_zrZ_HIOParam) == 0x84); @@ -160,8 +160,8 @@ private: /* 0x14C0 */ BOOL mMusicSet; /* 0x14C4 */ bool mSealReleased; - static char* mEvtCutNameList[8]; - static EventFn mEvtCutList[8]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[8]; + static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[8]; enum Animation { /* 0x0 */ ANM_NONE, diff --git a/include/d/actor/d_a_obj_Turara.h b/include/d/actor/d_a_obj_Turara.h index d8a45097d9..99d5a3a245 100644 --- a/include/d/actor/d_a_obj_Turara.h +++ b/include/d/actor/d_a_obj_Turara.h @@ -53,8 +53,8 @@ public: int getItemTbleNum() { return shape_angle.x >> 8 & 0xff; } int getState() { return shape_angle.x; } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5b8 */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_TvCdlst.h b/include/d/actor/d_a_obj_TvCdlst.h index 7d94a35676..afe204bc03 100644 --- a/include/d/actor/d_a_obj_TvCdlst.h +++ b/include/d/actor/d_a_obj_TvCdlst.h @@ -26,8 +26,8 @@ public: int Draw(); int Delete(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; u8 getLightType() { return fopAcM_GetParamBit(this,8,8); } u8 getOnSw() { return fopAcM_GetParamBit(this,0,8); } diff --git a/include/d/actor/d_a_obj_automata.h b/include/d/actor/d_a_obj_automata.h index 3468ccc3e8..95fec65cff 100644 --- a/include/d/actor/d_a_obj_automata.h +++ b/include/d/actor/d_a_obj_automata.h @@ -15,7 +15,7 @@ class daObj_AutoMata_Param_c { public: virtual ~daObj_AutoMata_Param_c() {} - static daObj_AutoMata_HIOParam const m; + static DUSK_GAME_DATA daObj_AutoMata_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_barDesk.h b/include/d/actor/d_a_obj_barDesk.h index 427e18ebdb..fc4c1cf4df 100644 --- a/include/d/actor/d_a_obj_barDesk.h +++ b/include/d/actor/d_a_obj_barDesk.h @@ -36,8 +36,8 @@ public: /* 0x5EC */ dCcD_Cyl mColCyl; /* 0x728 */ u8 field_0x728[8]; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daBarDesk_c) == 0x730); diff --git a/include/d/actor/d_a_obj_bed.h b/include/d/actor/d_a_obj_bed.h index 68919a8461..c6d76f0005 100644 --- a/include/d/actor/d_a_obj_bed.h +++ b/include/d/actor/d_a_obj_bed.h @@ -19,7 +19,7 @@ class daObj_Bed_Param_c { public: virtual ~daObj_Bed_Param_c() {} - static daObj_Bed_HIOParam const m; + static DUSK_GAME_DATA daObj_Bed_HIOParam const m; }; #if DEBUG @@ -71,7 +71,7 @@ public: int Draw(); static int createHeapCallBack(fopAc_ac_c*); u8 getType(); - char* getResName(); + char DUSK_CONST* getResName(); int isDelete(); void setEnvTevColor(); void setRoomNo(); diff --git a/include/d/actor/d_a_obj_bemos.h b/include/d/actor/d_a_obj_bemos.h index 713794c3b1..38501b708b 100644 --- a/include/d/actor/d_a_obj_bemos.h +++ b/include/d/actor/d_a_obj_bemos.h @@ -50,12 +50,12 @@ public: void wall_pos(fopAc_ac_c const*, daObjBm_c::BgcSrc_c const*, int, s16, f32); bool chk_wall_pre(fopAc_ac_c const*, daObjBm_c::BgcSrc_c const*, int, s16); - static const daObjBm_c::BgcSrc_c M_lin5[]; - static const daObjBm_c::BgcSrc_c M_lin20[]; + static DUSK_GAME_DATA const daObjBm_c::BgcSrc_c M_lin5[]; + static DUSK_GAME_DATA const daObjBm_c::BgcSrc_c M_lin20[]; - static dBgS_ObjGndChk M_gnd_work[23]; - static dBgS_WtrChk M_wrt_work; - static dBgS_ObjLinChk M_wall_work[23]; + static DUSK_GAME_DATA dBgS_ObjGndChk M_gnd_work[23]; + static DUSK_GAME_DATA dBgS_WtrChk M_wrt_work; + static DUSK_GAME_DATA dBgS_ObjLinChk M_wall_work[23]; /* 0x000 */ f32 field_0x0[23]; /* 0x05C */ int field_0x5c; @@ -130,7 +130,7 @@ public: #endif int Delete(); - static s16 const M_dir_base[4]; + static DUSK_GAME_DATA s16 const M_dir_base[4]; // private: /* 0x05A0 */ request_of_phase_process_class mPhase; /* 0x05A8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_bky_rock.h b/include/d/actor/d_a_obj_bky_rock.h index 99f23557e4..1f5952c35e 100644 --- a/include/d/actor/d_a_obj_bky_rock.h +++ b/include/d/actor/d_a_obj_bky_rock.h @@ -60,8 +60,8 @@ public: u8 getSwBit1() { return fopAcM_GetParamBit(this, 12, 8); } s8 getNameNo() { return fopAcM_GetParamBit(this, 0, 4); } - static dCcD_SrcCyl const s_CcDCyl; - static exeProc s_exeProc[3]; + static DUSK_GAME_DATA dCcD_SrcCyl const s_CcDCyl; + static DUSK_GAME_DATA exeProc s_exeProc[3]; private: /* 0x568 */ int mVibrationTimer; diff --git a/include/d/actor/d_a_obj_bmWindow.h b/include/d/actor/d_a_obj_bmWindow.h index 85b5ab8f86..161f4768a9 100644 --- a/include/d/actor/d_a_obj_bmWindow.h +++ b/include/d/actor/d_a_obj_bmWindow.h @@ -66,8 +66,8 @@ private: /* 0xEDE */ u8 field_0xede; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daBmWindow_c) == 0xEE0); diff --git a/include/d/actor/d_a_obj_boumato.h b/include/d/actor/d_a_obj_boumato.h index 176832f24f..4852aee6f9 100644 --- a/include/d/actor/d_a_obj_boumato.h +++ b/include/d/actor/d_a_obj_boumato.h @@ -21,7 +21,7 @@ class daObj_BouMato_Param_c { public: virtual ~daObj_BouMato_Param_c() {} - static daObj_BouMato_HIOParam const m; + static DUSK_GAME_DATA daObj_BouMato_HIOParam const m; }; #if DEBUG @@ -89,7 +89,7 @@ public: static void tgHitCallBack(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*); static void* srchArrow(void*, void*); void deleteStuckArrow(); - char* getResName(); + char DUSK_CONST* getResName(); void setSwayParam(fopAc_ac_c*); void setEnvTevColor(); void setRoomNo(); diff --git a/include/d/actor/d_a_obj_bubblePilar.h b/include/d/actor/d_a_obj_bubblePilar.h index b9abdd1fdd..7fb8009564 100644 --- a/include/d/actor/d_a_obj_bubblePilar.h +++ b/include/d/actor/d_a_obj_bubblePilar.h @@ -36,8 +36,8 @@ public: u8 getArg0() { return fopAcM_GetParamBit(this, 8, 4); } u8 getSw() { return fopAcM_GetParamBit(this, 0, 8); } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5A0 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_carry.h b/include/d/actor/d_a_obj_carry.h index 0581dda831..8147cbfb60 100644 --- a/include/d/actor/d_a_obj_carry.h +++ b/include/d/actor/d_a_obj_carry.h @@ -111,8 +111,8 @@ public: static void setRoomNo(int, s8); static s8 getRoomNo(int); const daObjCarry_dt_t& data(); - char* getArcName(); - char* getBmdName(); + DUSK_CONST char* getArcName(); + DUSK_CONST char* getBmdName(); BOOL checkFlag(u8); void initBaseMtx(); void setBaseMtx(); @@ -304,11 +304,11 @@ public: make_prm(o_params, o_paramsEx, 6, i_itemNo, i_itemBit, i_itemType, param_5); } - static const daObjCarry_dt_t mData[]; - static cXyz mPos[5]; - static u8 mSttsFlag[5]; - static s8 mRoomNo[5]; - static bool mSaveFlag; + static DUSK_GAME_DATA const daObjCarry_dt_t mData[]; + static DUSK_GAME_DATA cXyz mPos[5]; + static DUSK_GAME_DATA u8 mSttsFlag[5]; + static DUSK_GAME_DATA s8 mRoomNo[5]; + static DUSK_GAME_DATA bool mSaveFlag; public: /* 0x568 */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_catdoor.h b/include/d/actor/d_a_obj_catdoor.h index dd7141d920..b7ed95bd14 100644 --- a/include/d/actor/d_a_obj_catdoor.h +++ b/include/d/actor/d_a_obj_catdoor.h @@ -88,7 +88,7 @@ private: /* 0x790 */ s16 mRotSpeed; public: - static const daObjCatDoor_Attr_c M_attr; + static DUSK_GAME_DATA const daObjCatDoor_Attr_c M_attr; }; #endif /* D_A_OBJ_CATDOOR_H */ diff --git a/include/d/actor/d_a_obj_chandelier.h b/include/d/actor/d_a_obj_chandelier.h index 4aae0160d8..45158dea34 100644 --- a/include/d/actor/d_a_obj_chandelier.h +++ b/include/d/actor/d_a_obj_chandelier.h @@ -67,7 +67,7 @@ private: /* 0x60A */ u8 field_0x60a; /* 0x60B */ u8 field_0x60b; - static daObjChandelier_proc s_exeProc[5]; + static DUSK_GAME_DATA daObjChandelier_proc s_exeProc[5]; }; STATIC_ASSERT(sizeof(daObjChandelier_c) == 0x60C); diff --git a/include/d/actor/d_a_obj_fireWood.h b/include/d/actor/d_a_obj_fireWood.h index 116af1203c..07a5d5334b 100644 --- a/include/d/actor/d_a_obj_fireWood.h +++ b/include/d/actor/d_a_obj_fireWood.h @@ -24,8 +24,8 @@ public: int Draw(); int Delete(); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x568 */ u8 field_0x568[0x574 - 0x568]; diff --git a/include/d/actor/d_a_obj_fireWood2.h b/include/d/actor/d_a_obj_fireWood2.h index 3b288edeeb..bcb1bee95d 100644 --- a/include/d/actor/d_a_obj_fireWood2.h +++ b/include/d/actor/d_a_obj_fireWood2.h @@ -25,8 +25,8 @@ public: int Draw(); int Delete(); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x568 */ u8 field_0x568[0x574 - 0x568]; diff --git a/include/d/actor/d_a_obj_flag.h b/include/d/actor/d_a_obj_flag.h index eee36b0842..8187fe33b2 100644 --- a/include/d/actor/d_a_obj_flag.h +++ b/include/d/actor/d_a_obj_flag.h @@ -86,7 +86,7 @@ public: /* 0x30 */ f32 field_0x30; }; - static M_attrs const M_attr; + static DUSK_GAME_DATA M_attrs const M_attr; M_attrs const& attr() const { return M_attr; } }; diff --git a/include/d/actor/d_a_obj_flag2.h b/include/d/actor/d_a_obj_flag2.h index 54b3777ac6..c9ef033190 100644 --- a/include/d/actor/d_a_obj_flag2.h +++ b/include/d/actor/d_a_obj_flag2.h @@ -81,7 +81,7 @@ public: const daObjFlag2_Attr_c& attr() const { return M_attr; } - static daObjFlag2_Attr_c const M_attr; + static DUSK_GAME_DATA daObjFlag2_Attr_c const M_attr; private: /* 0x0568 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_flag3.h b/include/d/actor/d_a_obj_flag3.h index c6a94f6538..b93394ce15 100644 --- a/include/d/actor/d_a_obj_flag3.h +++ b/include/d/actor/d_a_obj_flag3.h @@ -93,7 +93,7 @@ public: inline int draw(); inline void initBaseMtx(); - static daObjFlag3_Attr_c const M_attr; + static DUSK_GAME_DATA daObjFlag3_Attr_c const M_attr; const daObjFlag3_Attr_c& attr() const { return M_attr; } private: diff --git a/include/d/actor/d_a_obj_gadget.h b/include/d/actor/d_a_obj_gadget.h index db7f5a53f7..cb2c99af97 100644 --- a/include/d/actor/d_a_obj_gadget.h +++ b/include/d/actor/d_a_obj_gadget.h @@ -117,7 +117,7 @@ class daObj_Gadget_Param_c { public: virtual ~daObj_Gadget_Param_c() {} - static daObj_Gadget_HIOParam const m; + static DUSK_GAME_DATA daObj_Gadget_HIOParam const m; }; diff --git a/include/d/actor/d_a_obj_glowSphere.h b/include/d/actor/d_a_obj_glowSphere.h index f620306408..c6c2ee220e 100644 --- a/include/d/actor/d_a_obj_glowSphere.h +++ b/include/d/actor/d_a_obj_glowSphere.h @@ -68,8 +68,8 @@ public: _clrLstBuf(); } - static u16 mSphSe; - static s16 mSeClrTmr; + static DUSK_GAME_DATA u16 mSphSe; + static DUSK_GAME_DATA s16 mSeClrTmr; /* 0x0 */ int field_0x0; /* 0x4 */ _GlSph_LstInfo_c mListBuf[120]; @@ -135,9 +135,9 @@ public: saveGetFlag(); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcSph mCcDSph; - static _GlSph_Mng_c mSphMng; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA _GlSph_Mng_c mSphMng; /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_gpTaru.h b/include/d/actor/d_a_obj_gpTaru.h index 79ed31b3ae..b3b31a5c9d 100644 --- a/include/d/actor/d_a_obj_gpTaru.h +++ b/include/d/actor/d_a_obj_gpTaru.h @@ -43,8 +43,8 @@ public: virtual int Draw(); virtual int Delete(); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x56C */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 59fd35343b..3cf17e090c 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -234,8 +234,8 @@ public: void setCrazyThrowLeft() { field_0xa48 |= (u16)8; } void setCrazyThrowRight() { field_0xa48 |= (u16)0x10; } - static MotionFunc mBaseMotionList[22]; - static MotionFunc mFaceMotionList[14]; + static DUSK_GAME_DATA MotionFunc mBaseMotionList[22]; + static DUSK_GAME_DATA MotionFunc mFaceMotionList[14]; bool isFirstGra() { return isFisrtGra(); } bool isFisrtGra() { return field_0x1fe8 == 0; } diff --git a/include/d/actor/d_a_obj_gra_rock.h b/include/d/actor/d_a_obj_gra_rock.h index e3cf568871..24e816a829 100644 --- a/include/d/actor/d_a_obj_gra_rock.h +++ b/include/d/actor/d_a_obj_gra_rock.h @@ -31,7 +31,7 @@ public: int Draw(); int Delete(); - static dCcD_SrcCyl const mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcCyl const mCcDCyl; private: /* 0x5A0 */ request_of_phase_process_class mPhases[5]; diff --git a/include/d/actor/d_a_obj_grave_stone.h b/include/d/actor/d_a_obj_grave_stone.h index dee38757a3..d41d58348a 100644 --- a/include/d/actor/d_a_obj_grave_stone.h +++ b/include/d/actor/d_a_obj_grave_stone.h @@ -49,8 +49,8 @@ private: /* 0x978 */ daObj_GrvStn_prtclMngr_c mPrtclMngr[4]; /* 0xAE8 */ s16 mTimer; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl const mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl const mCcDCyl; }; STATIC_ASSERT(sizeof(daGraveStone_c) == 0xAEC); diff --git a/include/d/actor/d_a_obj_hakai_brl.h b/include/d/actor/d_a_obj_hakai_brl.h index 394cab0366..dba4b3cd3f 100644 --- a/include/d/actor/d_a_obj_hakai_brl.h +++ b/include/d/actor/d_a_obj_hakai_brl.h @@ -32,7 +32,7 @@ public: } void callEmt(); - static dCcD_SrcCyl const s_CcDCyl; + static DUSK_GAME_DATA dCcD_SrcCyl const s_CcDCyl; private: /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_hakai_ftr.h b/include/d/actor/d_a_obj_hakai_ftr.h index cc94ba6021..45c815c5f9 100644 --- a/include/d/actor/d_a_obj_hakai_ftr.h +++ b/include/d/actor/d_a_obj_hakai_ftr.h @@ -29,7 +29,7 @@ public: bool chkHit(); void callEmt(); - static dCcD_SrcCyl const s_CcDCyl; + static DUSK_GAME_DATA dCcD_SrcCyl const s_CcDCyl; private: /* 0x574 */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_itamato.h b/include/d/actor/d_a_obj_itamato.h index 0aece512cd..10c6459887 100644 --- a/include/d/actor/d_a_obj_itamato.h +++ b/include/d/actor/d_a_obj_itamato.h @@ -27,7 +27,7 @@ class daObj_ItaMato_Param_c { public: virtual ~daObj_ItaMato_Param_c() {} - static daObj_ItaMato_HIOParam const m; + static DUSK_GAME_DATA daObj_ItaMato_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_kago.h b/include/d/actor/d_a_obj_kago.h index c2ea85d8f2..265db41c57 100644 --- a/include/d/actor/d_a_obj_kago.h +++ b/include/d/actor/d_a_obj_kago.h @@ -24,7 +24,7 @@ class daObj_Kago_Param_c { public: virtual ~daObj_Kago_Param_c() {} - static const daObj_Kago_HIOParam m; + static DUSK_GAME_DATA const daObj_Kago_HIOParam m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_kazeneko.h b/include/d/actor/d_a_obj_kazeneko.h index 3ac12b40f3..73147b6fbe 100644 --- a/include/d/actor/d_a_obj_kazeneko.h +++ b/include/d/actor/d_a_obj_kazeneko.h @@ -45,7 +45,7 @@ public: const KazoNekoAttr& attr() { return M_attr; } - static KazoNekoAttr const M_attr; + static DUSK_GAME_DATA KazoNekoAttr const M_attr; private: /* 0x568 */ J3DModel* mModel; /* 0x56C */ J3DModel* mArmModels[4]; diff --git a/include/d/actor/d_a_obj_kbacket.h b/include/d/actor/d_a_obj_kbacket.h index f3855fc8ca..214c4dcc7c 100644 --- a/include/d/actor/d_a_obj_kbacket.h +++ b/include/d/actor/d_a_obj_kbacket.h @@ -25,7 +25,7 @@ class daObj_KBacket_Param_c { public: virtual ~daObj_KBacket_Param_c() {} - static const daObj_KBacket_HIOParam m; + static DUSK_GAME_DATA const daObj_KBacket_HIOParam m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_keyhole.h b/include/d/actor/d_a_obj_keyhole.h index 423cae4453..b8a813776d 100644 --- a/include/d/actor/d_a_obj_keyhole.h +++ b/include/d/actor/d_a_obj_keyhole.h @@ -34,7 +34,7 @@ public: /* 0x0000 */ fopAc_ac_c actor; /* 0x0568 */ request_of_phase_process_class phase; - /* 0x0570 */ char* arcname; + /* 0x0570 */ DUSK_CONST char* arcname; /* 0x0574 */ mDoExt_McaMorf* lock_modelMorf; /* 0x0578 */ J3DModel* lock_model; /* 0x057C */ int chain_num; @@ -66,9 +66,18 @@ public: /* 0x2CA7 */ s8 hide_lock; /* 0x2CA8 */ cXyz field_0x2ca8; /* 0x2CB4 */ u8 field_0x2cb4; + +#if TARGET_PC + Mtx mChainInterpPrev[6][16]; + Mtx mChainInterpCurr[6][16]; + bool mChainInterpPrevValid; + bool mChainInterpCurrValid; +#endif }; +#if !TARGET_PC STATIC_ASSERT(sizeof(obj_keyhole_class) == 0x2CB8); +#endif class daObj_Keyhole_HIO_c : public JORReflexible { public: diff --git a/include/d/actor/d_a_obj_ktOnFire.h b/include/d/actor/d_a_obj_ktOnFire.h index bd0e23a82d..39875e122e 100644 --- a/include/d/actor/d_a_obj_ktOnFire.h +++ b/include/d/actor/d_a_obj_ktOnFire.h @@ -23,8 +23,8 @@ public: int Draw(); int Delete(); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x568 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_kznkarm.h b/include/d/actor/d_a_obj_kznkarm.h index 343285f8f8..c70908fcb8 100644 --- a/include/d/actor/d_a_obj_kznkarm.h +++ b/include/d/actor/d_a_obj_kznkarm.h @@ -60,8 +60,8 @@ public: inline ~daObjKznkarm_c(); inline daObjKznkarm_Attr_c* attr() const; - static daObjKznkarm_Attr_c const M_attr; - static actionFunc ActionTable[4][2]; + static DUSK_GAME_DATA daObjKznkarm_Attr_c const M_attr; + static DUSK_GAME_DATA actionFunc ActionTable[4][2]; private: /* 0x568 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_ladder.h b/include/d/actor/d_a_obj_ladder.h index eb48cf0f16..72f6fce4d2 100644 --- a/include/d/actor/d_a_obj_ladder.h +++ b/include/d/actor/d_a_obj_ladder.h @@ -74,8 +74,8 @@ namespace daObjLadder { return(Type_e)daObj::PrmAbstract(this,PRM_3, PRM_0); } - static char const M_arcname[5]; - static Mtx M_tmp_mtx; + static DUSK_GAME_DATA char const M_arcname[5]; + static DUSK_GAME_DATA Mtx M_tmp_mtx; private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_laundry.h b/include/d/actor/d_a_obj_laundry.h index 7d50dfa28e..cc79bc4e05 100644 --- a/include/d/actor/d_a_obj_laundry.h +++ b/include/d/actor/d_a_obj_laundry.h @@ -57,7 +57,7 @@ public: inline int daObjLdy_Execute(); private: - static const daObjLdy_Attr_c mAttr; + static DUSK_GAME_DATA const daObjLdy_Attr_c mAttr; /* 0x568 */ J3DModel* mpModel; /* 0x56C */ mDoExt_btkAnm* mpBtkAnm; diff --git a/include/d/actor/d_a_obj_laundry_rope.h b/include/d/actor/d_a_obj_laundry_rope.h index 4dba2250dc..3ecab164b2 100644 --- a/include/d/actor/d_a_obj_laundry_rope.h +++ b/include/d/actor/d_a_obj_laundry_rope.h @@ -55,7 +55,7 @@ public: }; #endif - static const daObjLndRope_Attr_c mAttr; + static DUSK_GAME_DATA const daObjLndRope_Attr_c mAttr; static const daObjLndRope_Hio_c M_Hio; private: diff --git a/include/d/actor/d_a_obj_lv1Candle00.h b/include/d/actor/d_a_obj_lv1Candle00.h index 48fca4acb6..e9e62da388 100644 --- a/include/d/actor/d_a_obj_lv1Candle00.h +++ b/include/d/actor/d_a_obj_lv1Candle00.h @@ -46,8 +46,8 @@ private: /* 0x730 */ u8 mTgHit; /* 0x734 */ Z2SoundObjSimple mSound; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daLv1Cdl00_c) == 0x754); diff --git a/include/d/actor/d_a_obj_lv1Candle01.h b/include/d/actor/d_a_obj_lv1Candle01.h index 66524cc4dc..632c117f10 100644 --- a/include/d/actor/d_a_obj_lv1Candle01.h +++ b/include/d/actor/d_a_obj_lv1Candle01.h @@ -42,8 +42,8 @@ private: /* 0x768 */ u8 mTgHit; /* 0x76C */ Z2SoundObjSimple mSound; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daLv1Cdl01_c) == 0x78C); diff --git a/include/d/actor/d_a_obj_lv2Candle.h b/include/d/actor/d_a_obj_lv2Candle.h index 767480d550..19be29a16e 100644 --- a/include/d/actor/d_a_obj_lv2Candle.h +++ b/include/d/actor/d_a_obj_lv2Candle.h @@ -60,8 +60,8 @@ private: /* 0x738 */ u8 mTgHit; /* 0x73C */ Z2SoundObjSimple mSound; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daLv2Candle_c) == 0x75C); diff --git a/include/d/actor/d_a_obj_lv3Candle.h b/include/d/actor/d_a_obj_lv3Candle.h index b82ad0b8c4..7b9765136d 100644 --- a/include/d/actor/d_a_obj_lv3Candle.h +++ b/include/d/actor/d_a_obj_lv3Candle.h @@ -44,8 +44,8 @@ private: /* 0x730 */ u8 mTgHit; /* 0x734 */ Z2SoundObjSimple mSound; - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; }; // Size: 0x754 diff --git a/include/d/actor/d_a_obj_lv5FloorBoard.h b/include/d/actor/d_a_obj_lv5FloorBoard.h index f4f5c50582..1dcba0ade2 100644 --- a/include/d/actor/d_a_obj_lv5FloorBoard.h +++ b/include/d/actor/d_a_obj_lv5FloorBoard.h @@ -35,8 +35,8 @@ public: int getSwBit1() { return fopAcM_GetParamBit(this, 0, 8); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5A0 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_lv5IceWall.h b/include/d/actor/d_a_obj_lv5IceWall.h index 737aaf9318..c9f459e75d 100644 --- a/include/d/actor/d_a_obj_lv5IceWall.h +++ b/include/d/actor/d_a_obj_lv5IceWall.h @@ -39,8 +39,8 @@ public: int getScaleY() { return fopAcM_GetParamBit(this, 0x15, 5); } int getScaleZ() { return fopAcM_GetParamBit(this, 0x1A, 5); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5A0 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_lv5SwIce.h b/include/d/actor/d_a_obj_lv5SwIce.h index 7c61e04d3b..8adc14f2af 100644 --- a/include/d/actor/d_a_obj_lv5SwIce.h +++ b/include/d/actor/d_a_obj_lv5SwIce.h @@ -35,8 +35,8 @@ public: int getSwBit1() { return fopAcM_GetParamBit(this, 0, 8); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5A0 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_lv6ChangeGate.h b/include/d/actor/d_a_obj_lv6ChangeGate.h index b918037950..48f532da3f 100644 --- a/include/d/actor/d_a_obj_lv6ChangeGate.h +++ b/include/d/actor/d_a_obj_lv6ChangeGate.h @@ -45,8 +45,8 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } int getSw2() { return shape_angle.x & 0xFF; } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; /* 0x05B8 */ request_of_phase_process_class mPhase; /* 0x05C0 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_lv6FurikoTrap.h b/include/d/actor/d_a_obj_lv6FurikoTrap.h index b09952df78..8a5f17336d 100644 --- a/include/d/actor/d_a_obj_lv6FurikoTrap.h +++ b/include/d/actor/d_a_obj_lv6FurikoTrap.h @@ -25,8 +25,8 @@ public: int Draw(); int Delete(); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; private: /* 0x5A0 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv6SwGate.h b/include/d/actor/d_a_obj_lv6SwGate.h index 964c073c1d..331e7ae07d 100644 --- a/include/d/actor/d_a_obj_lv6SwGate.h +++ b/include/d/actor/d_a_obj_lv6SwGate.h @@ -36,8 +36,8 @@ public: int getSwState() { return fopAcM_GetParamBit(this, 12, 4); } int getSw2() { return fopAcM_GetParamBit(this, 16, 8); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5A0 */ dCcD_Stts mCcStts; /* 0x5DC */ dCcD_Cyl mCcDCyls[12]; diff --git a/include/d/actor/d_a_obj_lv6TogeRoll.h b/include/d/actor/d_a_obj_lv6TogeRoll.h index 6e6357d552..9fedcd5932 100644 --- a/include/d/actor/d_a_obj_lv6TogeRoll.h +++ b/include/d/actor/d_a_obj_lv6TogeRoll.h @@ -60,11 +60,11 @@ public: u32 getPathID() { return fopAcM_GetParamBit(this, 0, 8); } u32 getSpeed() { return fopAcM_GetParamBit(this, 8, 4); } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcGObjInf const mCcDObjInfo2; - static f32 const mSpeed[]; - static dCcD_SrcSph mCcDSph; - static dCcD_SrcCps mCcDCps; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo2; + static DUSK_GAME_DATA f32 const mSpeed[]; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcCps mCcDCps; private: /* 0x05A0 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv6TogeTrap.h b/include/d/actor/d_a_obj_lv6TogeTrap.h index 29e68aad24..e0f0a2102d 100644 --- a/include/d/actor/d_a_obj_lv6TogeTrap.h +++ b/include/d/actor/d_a_obj_lv6TogeTrap.h @@ -62,11 +62,11 @@ public: int getModelType() { return fopAcM_GetParamBit(this, 20, 4); } int getHankei2() { return fopAcM_GetParamBit(this, 24, 8); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static const dCcD_SrcGObjInf mCcDObjInfo2; - static const f32 mSpeed[16]; - static dCcD_SrcSph mCcDSph; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo2; + static DUSK_GAME_DATA const f32 mSpeed[16]; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_lv8Lift.h b/include/d/actor/d_a_obj_lv8Lift.h index c327f4cf3c..0b39e25e89 100644 --- a/include/d/actor/d_a_obj_lv8Lift.h +++ b/include/d/actor/d_a_obj_lv8Lift.h @@ -66,7 +66,7 @@ public: u8 getMoveSpeed() { return fopAcM_GetParamBit(this, 8, 4); } int getSw() { return fopAcM_GetParamBit(this, 12, 8); } - static f32 const mSpeed[16]; + static DUSK_GAME_DATA f32 const mSpeed[16]; private: /* 0x5A0 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv8OptiLift.h b/include/d/actor/d_a_obj_lv8OptiLift.h index 5a437079c7..cd33551685 100644 --- a/include/d/actor/d_a_obj_lv8OptiLift.h +++ b/include/d/actor/d_a_obj_lv8OptiLift.h @@ -62,7 +62,7 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } int getArg1() { return fopAcM_GetParamBit(this, 0x14, 4); } - static f32 const mSpeed[]; + static DUSK_GAME_DATA f32 const mSpeed[]; /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_magLift.h b/include/d/actor/d_a_obj_magLift.h index e9b4e8bcf3..a8f597bfef 100644 --- a/include/d/actor/d_a_obj_magLift.h +++ b/include/d/actor/d_a_obj_magLift.h @@ -47,7 +47,7 @@ public: int getMoveSpeed() { return fopAcM_GetParamBit(this, 0x8, 4); } - static f32 const mSpeed[16]; + static DUSK_GAME_DATA f32 const mSpeed[16]; private: /* 0x5a0 */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_master_sword.h b/include/d/actor/d_a_obj_master_sword.h index e99b8832d7..a971aa335c 100644 --- a/include/d/actor/d_a_obj_master_sword.h +++ b/include/d/actor/d_a_obj_master_sword.h @@ -48,8 +48,8 @@ public: u8 getEventID() { return (fopAcM_GetParam(this) >> 0x10) & 0xFF; } u16 getFlagNo() { return fopAcM_GetParam(this) & 0xFFFF; } - static daObjMasterSword_Attr_c const mAttr; - static actionFunc ActionTable[]; + static DUSK_GAME_DATA daObjMasterSword_Attr_c const mAttr; + static DUSK_GAME_DATA actionFunc ActionTable[]; private: /* 0x568 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_mie.h b/include/d/actor/d_a_obj_mie.h index 0f1df429be..6c95ed7f84 100644 --- a/include/d/actor/d_a_obj_mie.h +++ b/include/d/actor/d_a_obj_mie.h @@ -24,7 +24,7 @@ class daObj_Mie_Param_c { public: virtual ~daObj_Mie_Param_c() {} - static const daObj_Mie_HIOParam m; + static DUSK_GAME_DATA const daObj_Mie_HIOParam m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_mirror_6pole.h b/include/d/actor/d_a_obj_mirror_6pole.h index 702b1cb66b..17cf211be3 100644 --- a/include/d/actor/d_a_obj_mirror_6pole.h +++ b/include/d/actor/d_a_obj_mirror_6pole.h @@ -54,7 +54,7 @@ public: inline void callInit(); inline void callExecute(); - static const actionFunc ActionTable[][2]; + static DUSK_GAME_DATA const actionFunc ActionTable[][2]; private: /* 0x568 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_mirror_screw.h b/include/d/actor/d_a_obj_mirror_screw.h index feeb6bf294..482506ffc0 100644 --- a/include/d/actor/d_a_obj_mirror_screw.h +++ b/include/d/actor/d_a_obj_mirror_screw.h @@ -80,8 +80,8 @@ private: /* 0x5D0 */ u8 field_0x5d0[8]; /* 0x5D8 */ cBgS_PolyInfo field_0x5d8; - static attr const M_attr; - static daObjMirrorScrew_actionFunc ActionTable[2][2]; + static DUSK_GAME_DATA attr const M_attr; + static DUSK_GAME_DATA daObjMirrorScrew_actionFunc ActionTable[2][2]; }; STATIC_ASSERT(sizeof(daObjMirrorScrew_c) == 0x5E8); diff --git a/include/d/actor/d_a_obj_movebox.h b/include/d/actor/d_a_obj_movebox.h index 0e8bf4e87a..4007a46ecc 100644 --- a/include/d/actor/d_a_obj_movebox.h +++ b/include/d/actor/d_a_obj_movebox.h @@ -122,12 +122,12 @@ struct Bgc_c { bool chk_wall_touch(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, s16); bool chk_wall_touch2(daObjMovebox::Act_c const*, daObjMovebox::BgcSrc_c const*, int, s16); - static const daObjMovebox::BgcSrc_c M_lin5[]; - static const daObjMovebox::BgcSrc_c M_lin20[]; + static DUSK_GAME_DATA const daObjMovebox::BgcSrc_c M_lin5[]; + static DUSK_GAME_DATA const daObjMovebox::BgcSrc_c M_lin20[]; - static dBgS_ObjGndChk M_gnd_work[23]; - static dBgS_WtrChk M_wrt_work; - static dBgS_ObjLinChk M_wall_work[23]; + static DUSK_GAME_DATA dBgS_ObjGndChk M_gnd_work[23]; + static DUSK_GAME_DATA dBgS_WtrChk M_wrt_work; + static DUSK_GAME_DATA dBgS_ObjLinChk M_wall_work[23]; /* 0x000 */ f32 field_0x0[23]; /* 0x05C */ int field_0x5c; @@ -213,11 +213,11 @@ struct Act_c : public dBgS_MoveBgActor { int getType() { return prm_get_type(); } - static const s16 M_dir_base[4]; - static const char* const M_arcname[8]; - static const dCcD_SrcCyl M_cyl_src; + static DUSK_GAME_DATA const s16 M_dir_base[4]; + static DUSK_GAME_DATA const char* const M_arcname[8]; + static DUSK_GAME_DATA const dCcD_SrcCyl M_cyl_src; - static const daObjMovebox::Attr_c M_attr[8]; + static DUSK_GAME_DATA const daObjMovebox::Attr_c M_attr[8]; /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_nagaisu.h b/include/d/actor/d_a_obj_nagaisu.h index 107691d338..2d1e97dd17 100644 --- a/include/d/actor/d_a_obj_nagaisu.h +++ b/include/d/actor/d_a_obj_nagaisu.h @@ -29,7 +29,7 @@ public: mPos.z = i_pos.z; } - static const dCcD_SrcCyl s_CcDCyl; + static DUSK_GAME_DATA const dCcD_SrcCyl s_CcDCyl; /* 0x004 */ dMdl_obj_c mMdlObj; /* 0x038 */ Vec mPos; @@ -59,7 +59,7 @@ public: void init(); void setIsu(); - static const int REMOVE_ISU_IDX[]; + static DUSK_GAME_DATA const int REMOVE_ISU_IDX[]; /* 0x574 */ J3DModel* mpModel; /* 0x578 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_nameplate.h b/include/d/actor/d_a_obj_nameplate.h index 7c1c77cc3c..d6aa6356bb 100644 --- a/include/d/actor/d_a_obj_nameplate.h +++ b/include/d/actor/d_a_obj_nameplate.h @@ -40,10 +40,10 @@ public: /* 0x1F */ u8 field_0x1F; }; - static M_attrs const M_attr; + static DUSK_GAME_DATA M_attrs const M_attr; static M_attrs const& attr() { return M_attr; } - static char* l_arcName; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST l_arcName; ~daObjNameplate_c() { dComIfG_resDelete(&this->mPhase, l_arcName); } diff --git a/include/d/actor/d_a_obj_nougu.h b/include/d/actor/d_a_obj_nougu.h index 3e8e004e36..b8ea5aff06 100644 --- a/include/d/actor/d_a_obj_nougu.h +++ b/include/d/actor/d_a_obj_nougu.h @@ -16,7 +16,7 @@ class daObj_Nougu_Param_c { public: virtual ~daObj_Nougu_Param_c() {} - static const daObj_Nougu_HIOParam m; + static DUSK_GAME_DATA const daObj_Nougu_HIOParam m; }; #if DEBUG @@ -73,7 +73,7 @@ public: int getType() { return 0; } - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; }; STATIC_ASSERT(sizeof(daObj_Nougu_c) == 0xe30); diff --git a/include/d/actor/d_a_obj_oiltubo.h b/include/d/actor/d_a_obj_oiltubo.h index 35b102211e..b4ee8612bc 100644 --- a/include/d/actor/d_a_obj_oiltubo.h +++ b/include/d/actor/d_a_obj_oiltubo.h @@ -33,8 +33,8 @@ public: BOOL chkEvent(); int wait(void*); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST mCcDCyl; private: /* 0x568 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_onsenTaru.h b/include/d/actor/d_a_obj_onsenTaru.h index c7e992bb11..98c6d40aee 100644 --- a/include/d/actor/d_a_obj_onsenTaru.h +++ b/include/d/actor/d_a_obj_onsenTaru.h @@ -52,8 +52,8 @@ public: bool getTempStat() { return mTempStat; } void startTimer() { mStartTimer = true; } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_ornament_cloth.h b/include/d/actor/d_a_obj_ornament_cloth.h index e0ea54b63d..69f509ebb3 100644 --- a/include/d/actor/d_a_obj_ornament_cloth.h +++ b/include/d/actor/d_a_obj_ornament_cloth.h @@ -61,7 +61,7 @@ public: const daObjOnCloth_Attr_c& attr() const { return M_attr; } - static daObjOnCloth_Attr_c const M_attr; + static DUSK_GAME_DATA daObjOnCloth_Attr_c const M_attr; /* 0x568 */ J3DModel* mpModel; /* 0x56C */ mDoExt_btkAnm* mBtkAnm; diff --git a/include/d/actor/d_a_obj_pdtile.h b/include/d/actor/d_a_obj_pdtile.h index 36293fd0b8..1dcb327acc 100644 --- a/include/d/actor/d_a_obj_pdtile.h +++ b/include/d/actor/d_a_obj_pdtile.h @@ -55,10 +55,10 @@ private: /* 0x7B4 */ u8 field_0x7b4; /* 0x7B5 */ u8 field_0x7b5; /* 0x7B8 */ int field_0x7b8; - /* 0x7BC */ char* mArcName; + /* 0x7BC */ char DUSK_CONST* mArcName; /* 0x7C0 */ u32 mDzbId; /* 0x7C4 */ u32 mBmdId; - /* 0x7C8 */ cull_box* mCullBox; + /* 0x7C8 */ cull_box DUSK_CONST* mCullBox; /* 0x7CC */ f32 field_0x7cc; /* 0x7D0 */ u8 field_0x7d0; /* 0x7D4 */ int field_0x7d4; diff --git a/include/d/actor/d_a_obj_picture.h b/include/d/actor/d_a_obj_picture.h index 3460b60077..50d44d808b 100644 --- a/include/d/actor/d_a_obj_picture.h +++ b/include/d/actor/d_a_obj_picture.h @@ -39,11 +39,11 @@ public: #if DEBUG const #endif - static dCcD_SrcCps s_CcDCps; + static DUSK_GAME_DATA dCcD_SrcCps s_CcDCps; #if DEBUG const #endif - static dCcD_SrcCyl s_CcDCyl_pic_at; + static DUSK_GAME_DATA dCcD_SrcCyl s_CcDCyl_pic_at; private: /* 0x574 */ dCcD_Stts field_0x574; diff --git a/include/d/actor/d_a_obj_pleaf.h b/include/d/actor/d_a_obj_pleaf.h index 084f4f1543..5e7a5cde1c 100644 --- a/include/d/actor/d_a_obj_pleaf.h +++ b/include/d/actor/d_a_obj_pleaf.h @@ -15,7 +15,7 @@ class daObj_Pleaf_Param_c { public: virtual ~daObj_Pleaf_Param_c() {} - static daObj_Pleaf_HIOParam const m; + static DUSK_GAME_DATA daObj_Pleaf_HIOParam const m; }; #if DEBUG @@ -65,7 +65,7 @@ public: int Execute(); int Draw(); static int createHeapCallBack(fopAc_ac_c*); - char* getResName(); + char DUSK_CONST* getResName(); int isDelete(); void setEnvTevColor(); void setRoomNo(); diff --git a/include/d/actor/d_a_obj_pumpkin.h b/include/d/actor/d_a_obj_pumpkin.h index b1b36bfa1f..9dd015c00e 100644 --- a/include/d/actor/d_a_obj_pumpkin.h +++ b/include/d/actor/d_a_obj_pumpkin.h @@ -28,7 +28,7 @@ class daObj_Pumpkin_Param_c { public: virtual ~daObj_Pumpkin_Param_c() {} - static const daObj_Pumpkin_HIOParam m; + static DUSK_GAME_DATA const daObj_Pumpkin_HIOParam m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_rotTrap.h b/include/d/actor/d_a_obj_rotTrap.h index 4b7b669afc..9534358f4a 100644 --- a/include/d/actor/d_a_obj_rotTrap.h +++ b/include/d/actor/d_a_obj_rotTrap.h @@ -34,8 +34,8 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x05A0 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_roten.h b/include/d/actor/d_a_obj_roten.h index 91e786c1b8..9b4b17a19d 100644 --- a/include/d/actor/d_a_obj_roten.h +++ b/include/d/actor/d_a_obj_roten.h @@ -22,7 +22,7 @@ public: int Execute(Mtx**); int Draw(); int Delete(); - char* getResName(); + char DUSK_CONST* getResName(); virtual ~daObj_Roten_c(); private: diff --git a/include/d/actor/d_a_obj_sakuita.h b/include/d/actor/d_a_obj_sakuita.h index 29b101586d..e9e4e82120 100644 --- a/include/d/actor/d_a_obj_sakuita.h +++ b/include/d/actor/d_a_obj_sakuita.h @@ -43,7 +43,7 @@ public: const daObjSakuita_Attr_c& attr() const { return M_attr; } - static daObjSakuita_Attr_c const M_attr; + static DUSK_GAME_DATA daObjSakuita_Attr_c const M_attr; private: /* 0x568 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_sakuita_rope.h b/include/d/actor/d_a_obj_sakuita_rope.h index 9567b7f25f..dfbed5af0e 100644 --- a/include/d/actor/d_a_obj_sakuita_rope.h +++ b/include/d/actor/d_a_obj_sakuita_rope.h @@ -80,7 +80,7 @@ public: return field_0x62c * (pos->z - getRopeStartPos()->z); } - static daObjItaRope_Attr_c const M_attr; + static DUSK_GAME_DATA daObjItaRope_Attr_c const M_attr; private: /* 0x570 */ mDoExt_3DlineMat1_c mLineMat; diff --git a/include/d/actor/d_a_obj_scannon.h b/include/d/actor/d_a_obj_scannon.h index 4e054ed765..0b1a79e18f 100644 --- a/include/d/actor/d_a_obj_scannon.h +++ b/include/d/actor/d_a_obj_scannon.h @@ -14,8 +14,8 @@ class daSCannon_c : public fopAc_ac_c, public request_of_phase_process_class { public: struct demoTable_s { - /* 0x0 */ void (daSCannon_c::*(*demo_proc_table)[2])(); - /* 0x4 */ char** cut_table; + /* 0x0 */ void (daSCannon_c::*DUSK_CONST (*demo_proc_table)[2])(); + /* 0x4 */ char DUSK_CONST* DUSK_CONST* cut_table; /* 0x8 */ int cut_num; }; @@ -76,12 +76,12 @@ public: int getSw1() { return fopAcM_GetParamBit(this, 0, 8); } int getSw2() { return fopAcM_GetParamBit(this, 8, 8); } - static const demoTable_s s_demoTable[]; - static void (daSCannon_c::*s_exeProc[])(); - static void (daSCannon_c::*s_demoExeProc_WarpEnd[][2])(); - static void (daSCannon_c::*s_demoExeProc_FireTks[][2])(); - static void (daSCannon_c::*s_demoExeProc_FireFirst[][2])(); - static void (daSCannon_c::*s_demoExeProc_FireSecond[][2])(); + static DUSK_GAME_DATA const demoTable_s s_demoTable[]; + static DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST s_exeProc[])(); + static DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST s_demoExeProc_WarpEnd[][2])(); + static DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST s_demoExeProc_FireTks[][2])(); + static DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST s_demoExeProc_FireFirst[][2])(); + static DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST s_demoExeProc_FireSecond[][2])(); private: /* 0x574 */ request_of_phase_process_class mZevPhase; diff --git a/include/d/actor/d_a_obj_scannon_crs.h b/include/d/actor/d_a_obj_scannon_crs.h index e390c60128..d7eb7c8121 100644 --- a/include/d/actor/d_a_obj_scannon_crs.h +++ b/include/d/actor/d_a_obj_scannon_crs.h @@ -49,7 +49,7 @@ public: int getWarpId() { return fopAcM_GetParamBit(this, 8, 8); } u16 getMsgId() { return home.angle.x; } - static void (daSCannonCrs_c::*s_exeProc[])(daMidna_c*); + static DUSK_GAME_DATA void (daSCannonCrs_c::*s_exeProc[])(daMidna_c*); private: /* 0x574 */ cXyz mPortalWaitPos; diff --git a/include/d/actor/d_a_obj_scannon_ten.h b/include/d/actor/d_a_obj_scannon_ten.h index 503a1e0522..7bc5b24ed8 100644 --- a/include/d/actor/d_a_obj_scannon_ten.h +++ b/include/d/actor/d_a_obj_scannon_ten.h @@ -57,8 +57,8 @@ public: void exeEmtLine(); void delEmtAll(); - static const ExeProc s_exeProc[]; - static const ExeProc s_demoExeProc[][2]; + static DUSK_GAME_DATA const ExeProc s_exeProc[]; + static DUSK_GAME_DATA const ExeProc s_demoExeProc[][2]; private: /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_sekidoor.h b/include/d/actor/d_a_obj_sekidoor.h index ae4ff9acd4..46da5cb8a9 100644 --- a/include/d/actor/d_a_obj_sekidoor.h +++ b/include/d/actor/d_a_obj_sekidoor.h @@ -14,7 +14,7 @@ class daObj_SekiDoor_Param_c { public: virtual ~daObj_SekiDoor_Param_c() {}; - static daObj_SekiDoor_HIOParam const m; + static DUSK_GAME_DATA daObj_SekiDoor_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_sekizo.h b/include/d/actor/d_a_obj_sekizo.h index 54fa84f5df..0f0847dc24 100644 --- a/include/d/actor/d_a_obj_sekizo.h +++ b/include/d/actor/d_a_obj_sekizo.h @@ -10,7 +10,7 @@ struct daObj_Sekizo_HIOParam { class daObj_Sekizo_Param_c { public: virtual ~daObj_Sekizo_Param_c() {} - static daObj_Sekizo_HIOParam const m; + static DUSK_GAME_DATA daObj_Sekizo_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_sekizoa.h b/include/d/actor/d_a_obj_sekizoa.h index 8f01206e88..b5c6abd9c3 100644 --- a/include/d/actor/d_a_obj_sekizoa.h +++ b/include/d/actor/d_a_obj_sekizoa.h @@ -57,7 +57,7 @@ class daObj_Sekizoa_Param_c { public: virtual ~daObj_Sekizoa_Param_c() {} - static daObj_Sekizoa_HIOParam const m; + static DUSK_GAME_DATA daObj_Sekizoa_HIOParam const m; }; #if DEBUG @@ -169,7 +169,7 @@ public: daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, - int param_6, daNpcT_evtData_c const* param_7, char** param_8) + int param_6, daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) {} BOOL chkGoal() { daTag_EvtArea_c* evt_area_A = (daTag_EvtArea_c*)mActorMngrs[5].getActorP(); @@ -268,8 +268,8 @@ public: -300.0f, 0); } - static char* mCutNameList[9]; - static cutFunc mCutList[9]; + static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[9]; + static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[9]; /* 0x0E40 */ mDoExt_McaMorfSO* mpMcaMorf; /* 0x0E44 */ mDoExt_invisibleModel mInvModel; diff --git a/include/d/actor/d_a_obj_smtile.h b/include/d/actor/d_a_obj_smtile.h index 1832a7c4b8..735914f0a0 100644 --- a/include/d/actor/d_a_obj_smtile.h +++ b/include/d/actor/d_a_obj_smtile.h @@ -12,7 +12,7 @@ class daObj_SMTile_Param_c { public: virtual ~daObj_SMTile_Param_c() {} - static daObj_SMTile_HIOParam const m; + static DUSK_GAME_DATA daObj_SMTile_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_ss_drink.h b/include/d/actor/d_a_obj_ss_drink.h index f4865350a4..e49644f6b6 100644 --- a/include/d/actor/d_a_obj_ss_drink.h +++ b/include/d/actor/d_a_obj_ss_drink.h @@ -21,7 +21,7 @@ public: int Execute(); int Draw(); static int createHeapCallBack(fopAc_ac_c*); - char* getResName(); + char DUSK_CONST* getResName(); u8 getTypeFromParam(); u8 getSwitchFromParam(); u8 getCapacityFromParam(); @@ -47,8 +47,8 @@ public: virtual ~daObj_SSDrink_c(); virtual void setSoldOut(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST mCcDCyl; private: /* 0x578 */ mDoExt_btpAnm* mpBtpAnm; diff --git a/include/d/actor/d_a_obj_ss_item.h b/include/d/actor/d_a_obj_ss_item.h index bdf61d1ec8..cd219a1832 100644 --- a/include/d/actor/d_a_obj_ss_item.h +++ b/include/d/actor/d_a_obj_ss_item.h @@ -30,7 +30,7 @@ public: void setSoldOut(); u32 getProcessID(); daObj_SSItem_c* getExchangeItemPtr(); - char* getResName(); + char DUSK_CONST* getResName(); u8 getTypeFromParam(); u16 getFlowNodeNum(); u16 getValue(); @@ -46,8 +46,8 @@ public: int buy(void* param_0); int cancel(void* param_0); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST mCcDCyl; private: /* 0x578 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_stairBlock.h b/include/d/actor/d_a_obj_stairBlock.h index 63a0c5b178..3d3b8d5283 100644 --- a/include/d/actor/d_a_obj_stairBlock.h +++ b/include/d/actor/d_a_obj_stairBlock.h @@ -23,8 +23,8 @@ public: virtual int Draw(); virtual int Delete(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; private: /* 0x056C */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_stick.h b/include/d/actor/d_a_obj_stick.h index fe43aabd15..ebc08e08b8 100644 --- a/include/d/actor/d_a_obj_stick.h +++ b/include/d/actor/d_a_obj_stick.h @@ -16,7 +16,7 @@ class daObj_Stick_Param_c { public: virtual ~daObj_Stick_Param_c() {} - static const daObj_Stick_HIOParam m; + static DUSK_GAME_DATA const daObj_Stick_HIOParam m; }; #if DEBUG @@ -73,7 +73,7 @@ public: u32 getType() { return 0; } - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; }; STATIC_ASSERT(sizeof(daObj_Stick_c) == 0x950); diff --git a/include/d/actor/d_a_obj_swpush.h b/include/d/actor/d_a_obj_swpush.h index c222e0f833..77b7557d69 100644 --- a/include/d/actor/d_a_obj_swpush.h +++ b/include/d/actor/d_a_obj_swpush.h @@ -142,12 +142,12 @@ namespace daObjSwpush { int Mthd_Execute(); int Mthd_Draw(); - static s16 const M_bmd[3]; - static s16 const M_dzb[3]; - static u32 const M_heap_size[3]; - static Hio_c::Attr_c const M_attr[5]; - static u8 const M_op_vtx[4]; - static char* M_arcname[3]; + static DUSK_GAME_DATA s16 const M_bmd[3]; + static DUSK_GAME_DATA s16 const M_dzb[3]; + static DUSK_GAME_DATA u32 const M_heap_size[3]; + static DUSK_GAME_DATA Hio_c::Attr_c const M_attr[5]; + static DUSK_GAME_DATA u8 const M_op_vtx[4]; + static DUSK_GAME_DATA DUSK_CONST char* M_arcname[3]; /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ dBgWSv* mpBgW; diff --git a/include/d/actor/d_a_obj_swpush2.h b/include/d/actor/d_a_obj_swpush2.h index a99800e4c4..751c35abf6 100644 --- a/include/d/actor/d_a_obj_swpush2.h +++ b/include/d/actor/d_a_obj_swpush2.h @@ -128,8 +128,8 @@ namespace daObjSwpush2 { void off_switch() const { fopAcM_offSwitch(this, prm_get_swSave()); } void rev_switch() const { fopAcM_revSwitch(this, prm_get_swSave()); } - static const char M_arcname[]; - static const Attr_c M_attr[4]; + static DUSK_GAME_DATA const char M_arcname[]; + static DUSK_GAME_DATA const Attr_c M_attr[4]; #if DEBUG static Hio_c M_hio; diff --git a/include/d/actor/d_a_obj_syRock.h b/include/d/actor/d_a_obj_syRock.h index 0af85cbaa6..2c881585ed 100644 --- a/include/d/actor/d_a_obj_syRock.h +++ b/include/d/actor/d_a_obj_syRock.h @@ -43,8 +43,8 @@ public: int Draw(); int Delete(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5B8 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_taFence.h b/include/d/actor/d_a_obj_taFence.h index 5d18cf5cc0..6ab2e31f0a 100644 --- a/include/d/actor/d_a_obj_taFence.h +++ b/include/d/actor/d_a_obj_taFence.h @@ -32,8 +32,8 @@ public: virtual int Draw(); virtual int Delete(); - static const dCcD_SrcGObjInf mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; /* 0x05A0 */ request_of_phase_process_class mPhase; /* 0x05A8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_tks.h b/include/d/actor/d_a_obj_tks.h index 9d98f8cd0b..2180e99494 100644 --- a/include/d/actor/d_a_obj_tks.h +++ b/include/d/actor/d_a_obj_tks.h @@ -17,7 +17,7 @@ class daObjTks_Param_c { public: virtual ~daObjTks_Param_c() {} - static const daObjTks_HIOParam m; + static DUSK_GAME_DATA const daObjTks_HIOParam m; }; #if DEBUG diff --git a/include/d/actor/d_a_obj_toby.h b/include/d/actor/d_a_obj_toby.h index 6a3510b5d9..6f6124ed28 100644 --- a/include/d/actor/d_a_obj_toby.h +++ b/include/d/actor/d_a_obj_toby.h @@ -38,7 +38,7 @@ class obj_toby_class { public: /* 0x0000 */ fopAc_ac_c mBase; /* 0x0568 */ request_of_phase_process_class mPhase; - /* 0x0570 */ char* mArcName; + /* 0x0570 */ char DUSK_CONST* mArcName; /* 0x0574 */ u8 field_0x574; /* 0x0575 */ u8 field_0x575; /* 0x0576 */ u8 field_0x576; diff --git a/include/d/actor/d_a_obj_togeTrap.h b/include/d/actor/d_a_obj_togeTrap.h index 161c958ce0..4055d6a42e 100644 --- a/include/d/actor/d_a_obj_togeTrap.h +++ b/include/d/actor/d_a_obj_togeTrap.h @@ -44,8 +44,8 @@ public: u8 getSwBit() { return fopAcM_GetParamBit(this, 0, 8); } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; private: /* 0x5A0 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_waterPillar.h b/include/d/actor/d_a_obj_waterPillar.h index 6bcad283da..19b55971e8 100644 --- a/include/d/actor/d_a_obj_waterPillar.h +++ b/include/d/actor/d_a_obj_waterPillar.h @@ -55,10 +55,10 @@ public: int draw(); int _delete(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcGObjInf const mCcDObjCoInfo; - static dCcD_SrcCps mCcDCps; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjCoInfo; + static DUSK_GAME_DATA dCcD_SrcCps mCcDCps; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; void onRockFlag() { mCarryingStalactite = true; diff --git a/include/d/actor/d_a_obj_wdStick.h b/include/d/actor/d_a_obj_wdStick.h index c82b115b84..08bc2a1faf 100644 --- a/include/d/actor/d_a_obj_wdStick.h +++ b/include/d/actor/d_a_obj_wdStick.h @@ -50,8 +50,8 @@ public: virtual int Draw(); virtual int Delete(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; private: /* 0x56C */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_yel_bag.h b/include/d/actor/d_a_obj_yel_bag.h index 69b428da49..caeba24ae5 100644 --- a/include/d/actor/d_a_obj_yel_bag.h +++ b/include/d/actor/d_a_obj_yel_bag.h @@ -24,7 +24,7 @@ class daObj_YBag_Param_c { public: virtual ~daObj_YBag_Param_c() {} - static daObj_YBag_HIOParam const m; + static DUSK_GAME_DATA daObj_YBag_HIOParam const m; }; #if DEBUG @@ -109,8 +109,8 @@ public: void setWaterPrtcl(); void setHamonPrtcl(); - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daObj_YBag_c) == 0xa3c); diff --git a/include/d/actor/d_a_obj_yobikusa.h b/include/d/actor/d_a_obj_yobikusa.h index 9c1ee2a746..a3dfa944fa 100644 --- a/include/d/actor/d_a_obj_yobikusa.h +++ b/include/d/actor/d_a_obj_yobikusa.h @@ -76,8 +76,8 @@ public: inline cPhs_Step create(); inline ~daObjYobikusa_c(); - static attributes const M_attr; - static actionFuncEntry ActionTable[3]; + static DUSK_GAME_DATA attributes const M_attr; + static DUSK_GAME_DATA actionFuncEntry ActionTable[3]; const attributes* attr() const { return &M_attr; } int getType() { return argument & 0x7F; } diff --git a/include/d/actor/d_a_obj_zrTurara.h b/include/d/actor/d_a_obj_zrTurara.h index 9f48464cf9..679ae20635 100644 --- a/include/d/actor/d_a_obj_zrTurara.h +++ b/include/d/actor/d_a_obj_zrTurara.h @@ -50,8 +50,8 @@ public: int getSwBit2() { return fopAcM_GetParamBit(this, 8, 8); } int getScale() { return fopAcM_GetParamBit(this, 0x10, 8); } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcCyl mCcDCyl; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; }; STATIC_ASSERT(sizeof(daZrTurara_c) == 0x76C); diff --git a/include/d/actor/d_a_obj_zrTuraraRock.h b/include/d/actor/d_a_obj_zrTuraraRock.h index 4590cff2cf..1f92de6e82 100644 --- a/include/d/actor/d_a_obj_zrTuraraRock.h +++ b/include/d/actor/d_a_obj_zrTuraraRock.h @@ -45,8 +45,8 @@ private: public: u8 getScale() { return fopAcM_GetParamBit(this, 0, 8); } - static dCcD_SrcGObjInf const mCcDObjInfo; - static dCcD_SrcSph mCcDSph; + static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; + static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; }; STATIC_ASSERT(sizeof(daZrTuraRc_c) == 0x938); diff --git a/include/d/actor/d_a_passer_mng.h b/include/d/actor/d_a_passer_mng.h index 230432336c..ced02d9d1d 100644 --- a/include/d/actor/d_a_passer_mng.h +++ b/include/d/actor/d_a_passer_mng.h @@ -257,7 +257,7 @@ public: int field_0x04[0]; }; - static const Group* mGroupTbl[4]; + static DUSK_GAME_DATA const Group* mGroupTbl[4]; private: /* 0x568 */ fpc_ProcID* childProcIds; diff --git a/include/d/actor/d_a_peru.h b/include/d/actor/d_a_peru.h index df9f494936..771e879b10 100644 --- a/include/d/actor/d_a_peru.h +++ b/include/d/actor/d_a_peru.h @@ -59,7 +59,7 @@ class daPeru_Param_c { public: virtual ~daPeru_Param_c() {} - static daPeru_HIOParam const m; + static DUSK_GAME_DATA daPeru_HIOParam const m; }; #if DEBUG @@ -137,7 +137,7 @@ public: daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) { OS_REPORT("|%06d:%x|daPeru_c -> コンストラクト\n", g_Counter.mCounter0, this); } @@ -186,8 +186,8 @@ public: void setCnt(int cnt) { field_0xe6a = cnt; } int getCnt() { return field_0xe6a; } - static const char* mCutNameList[3]; - static cutAppearFunc mCutList[3]; + static DUSK_GAME_DATA const char* mCutNameList[3]; + static DUSK_GAME_DATA cutAppearFunc mCutList[3]; private: /* 0x0E40 */ daNpcT_ActorMngr_c mActors[3]; diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 41a11ff662..66139b54cf 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -50,6 +50,10 @@ public: /* 0x14 */ Mtx mProjMtx; /* 0x44 */ ResTIMG* mpImg; /* 0x48 */ u8* mpData; +#if TARGET_PC + TGXTexObj mTexObj; + ResTIMG* mpCachedImg = nullptr; +#endif }; class daPy_boomerangMove_c { @@ -63,8 +67,8 @@ public: static void offEventKeepFlg() { m_eventKeepFlg = 0; } static void onEventKeepFlg() { m_eventKeepFlg = 1; } - static s16 m_dropAngleY; - static s16 m_eventKeepFlg; + static DUSK_GAME_DATA s16 m_dropAngleY; + static DUSK_GAME_DATA s16 m_eventKeepFlg; private: /* 0x0 */ u8 field_0x0; @@ -77,7 +81,7 @@ private: #define PLAYER_CREATE_ANM_HEAP_F(heap, type, fmt, ...) \ { \ char pcah_name_buf[32]; \ - sprintf(pcah_name_buf, fmt, ##__VA_ARGS__); \ + snprintf(pcah_name_buf, sizeof(pcah_name_buf), fmt, ##__VA_ARGS__); \ (heap).createHeap(type, pcah_name_buf); \ \ } @@ -1209,7 +1213,7 @@ public: onEndResetFlg0(ERFLG0_FISHING_RELEASE); } - static daMidna_c* m_midnaActor; + static DUSK_GAME_DATA daMidna_c* m_midnaActor; void setGiantPuzzle() { mMode = SMODE_WOLF_PUZZLE; } void setGiantPuzzleEnd() { mMode = 0; } diff --git a/include/d/actor/d_a_suspend.h b/include/d/actor/d_a_suspend.h index 32cdf76864..9475aae38e 100644 --- a/include/d/actor/d_a_suspend.h +++ b/include/d/actor/d_a_suspend.h @@ -69,9 +69,9 @@ public: u8 getSw() { return fopAcM_GetParam(this) & 0xFF; } u8 getRoom() { return fopAcM_GetParam(this) >> 10; } - static data_c mData[0x20]; - static room_c mRoom[0x40]; - static s16 mSetTop; + static DUSK_GAME_DATA data_c mData[0x20]; + static DUSK_GAME_DATA room_c mRoom[0x40]; + static DUSK_GAME_DATA s16 mSetTop; }; #endif /* D_A_SUSPEND_H */ diff --git a/include/d/actor/d_a_tag_Lv7Gate.h b/include/d/actor/d_a_tag_Lv7Gate.h index efbb88b0cf..da9938f7bd 100644 --- a/include/d/actor/d_a_tag_Lv7Gate.h +++ b/include/d/actor/d_a_tag_Lv7Gate.h @@ -31,7 +31,7 @@ public: /* 0x57C */ cXyz mPos2; /* 0x588 */ cXyz mPos1; /* 0x594 */ csXyz field_0x594; - /* 0x59C */ char* mEvName; + /* 0x59C */ char DUSK_CONST* mEvName; /* 0x5A0 */ int field_0x5a0; /* 0x5A4 */ f32 mDistance; /* 0x5A8 */ f32 mLastFrame; diff --git a/include/d/actor/d_a_tag_TWgate.h b/include/d/actor/d_a_tag_TWgate.h index e5952da286..1886690db2 100644 --- a/include/d/actor/d_a_tag_TWgate.h +++ b/include/d/actor/d_a_tag_TWgate.h @@ -112,11 +112,11 @@ public: inline void setAction(Mode_e i_action); - static daTagTWGate_Attr_c const mAttr; + static DUSK_GAME_DATA daTagTWGate_Attr_c const mAttr; #if DEBUG static daTagTWGate_Hio_c mHio; #endif - static const actionFunc ActionTable[][2]; + static DUSK_GAME_DATA const actionFunc ActionTable[][2]; private: /* 0x568 */ mDoExt_McaMorfSO* mpMorf; diff --git a/include/d/actor/d_a_tag_evt.h b/include/d/actor/d_a_tag_evt.h index b9be601276..6d9b85221b 100644 --- a/include/d/actor/d_a_tag_evt.h +++ b/include/d/actor/d_a_tag_evt.h @@ -17,7 +17,7 @@ public: int doEvtCutTalk(int); int doEvtCutNext(int); - static char* mEvtCutList[3]; + static DUSK_GAME_DATA DUSK_CONST char* mEvtCutList[3]; /* 0x568 */ char field_0x568[8]; /* 0x570 */ u16 field_0x570; diff --git a/include/d/actor/d_a_tag_evtmsg.h b/include/d/actor/d_a_tag_evtmsg.h index 3ca4e03545..a1011ee8e4 100644 --- a/include/d/actor/d_a_tag_evtmsg.h +++ b/include/d/actor/d_a_tag_evtmsg.h @@ -32,8 +32,8 @@ public: virtual ~daTag_EvtMsg_c(); - static char* mEvtCutNameList[]; - static EvtCutFunc mEvtCutList[]; + static DUSK_GAME_DATA DUSK_CONST char* mEvtCutNameList[]; + static DUSK_GAME_DATA EvtCutFunc mEvtCutList[]; }; #endif /* D_A_TAG_EVTMSG_H */ diff --git a/include/d/actor/d_a_tag_hstop.h b/include/d/actor/d_a_tag_hstop.h index 6a5ae38beb..97b0a68f7b 100644 --- a/include/d/actor/d_a_tag_hstop.h +++ b/include/d/actor/d_a_tag_hstop.h @@ -22,8 +22,8 @@ public: } } - static daTagHstop_c* m_top; - static dMsgFlow_c m_msgFlow; + static DUSK_GAME_DATA daTagHstop_c* m_top; + static DUSK_GAME_DATA dMsgFlow_c m_msgFlow; /* 0x568 */ daTagHstop_c* mNext; /* 0x568 */ daTagHstop_c* mPrev; diff --git a/include/d/actor/d_a_tag_lantern.h b/include/d/actor/d_a_tag_lantern.h index c0e0c0d152..ed9cbef3e3 100644 --- a/include/d/actor/d_a_tag_lantern.h +++ b/include/d/actor/d_a_tag_lantern.h @@ -12,7 +12,7 @@ class daTag_Lantern_Param_c { public: inline virtual ~daTag_Lantern_Param_c() {} - static daTag_Lantern_HIOParam const m; + static DUSK_GAME_DATA daTag_Lantern_HIOParam const m; }; #if DEBUG diff --git a/include/d/actor/d_a_tag_magne.h b/include/d/actor/d_a_tag_magne.h index 2b2db66517..bfdc788e37 100644 --- a/include/d/actor/d_a_tag_magne.h +++ b/include/d/actor/d_a_tag_magne.h @@ -19,7 +19,7 @@ public: u8 getSwNo2() { return fopAcM_GetParamBit(this, 8, 8); } u8 getSwNo3() { return fopAcM_GetParamBit(this, 16, 8); } - static daTagMagne_c* mTagMagne; + static DUSK_GAME_DATA daTagMagne_c* mTagMagne; /* 0x568 */ u8 mSwNo1; /* 0x569 */ u8 mSwNo2; diff --git a/include/d/actor/d_a_tag_mist.h b/include/d/actor/d_a_tag_mist.h index 9579ff62d5..3c4973075a 100644 --- a/include/d/actor/d_a_tag_mist.h +++ b/include/d/actor/d_a_tag_mist.h @@ -17,7 +17,7 @@ public: static u8 getPlayerNo(); static void setPlayerNo(u8 i_playerNo) { mPlayerNo = i_playerNo; } - static u8 mPlayerNo; + static DUSK_GAME_DATA u8 mPlayerNo; /* 0x568 */ u8 unused_0x568[0x570 - 0x568]; /* 0x570 */ cXyz mVertices[4]; diff --git a/include/d/actor/d_a_tag_msg.h b/include/d/actor/d_a_tag_msg.h index 5ff6163559..b0b65e2795 100644 --- a/include/d/actor/d_a_tag_msg.h +++ b/include/d/actor/d_a_tag_msg.h @@ -13,7 +13,7 @@ class daTag_Msg_Param_c { public: virtual ~daTag_Msg_Param_c() {} - static const daTag_Msg_HIO_Param_c m; + static DUSK_GAME_DATA const daTag_Msg_HIO_Param_c m; }; #if DEBUG @@ -43,11 +43,11 @@ public: int draw(); BOOL rangeCheck(); BOOL otherCheck(); - char* getResName(); + DUSK_CONST char* getResName(); void getParam(); BOOL cut_speak(int, BOOL); - static char* mEvtCutTBL[2]; + static DUSK_GAME_DATA DUSK_CONST char* mEvtCutTBL[2]; /* 0x56C */ char mStaffName[8]; /* 0x574 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_tag_stream.h b/include/d/actor/d_a_tag_stream.h index 7c3b3eb4ac..f30abfec15 100644 --- a/include/d/actor/d_a_tag_stream.h +++ b/include/d/actor/d_a_tag_stream.h @@ -42,7 +42,7 @@ public: /* 0x570 */ daTagStream_c* field_0x570; /* 0x574 */ daTagStream_c* mNext; - static daTagStream_c* m_top; + static DUSK_GAME_DATA daTagStream_c* m_top; }; #endif /* D_A_TAG_STREAM_H */ diff --git a/include/d/actor/d_a_tbox.h b/include/d/actor/d_a_tbox.h index 798a1c8661..2b48a156eb 100644 --- a/include/d/actor/d_a_tbox.h +++ b/include/d/actor/d_a_tbox.h @@ -22,7 +22,7 @@ protected: STATIC_ASSERT(sizeof(daTboxBase_c) == 0x718); struct daTbox_ModelInfo { - /* 0x00 */ char* mArcName; + /* 0x00 */ DUSK_CONST char* mArcName; /* 0x04 */ int mModelResNo; /* 0x08 */ int mBckResNo; /* 0x0C */ int mClosedDzbResNo; @@ -58,7 +58,7 @@ public: MODE_EXEC = 1, }; - daTbox_ModelInfo* getModelInfo(); + DUSK_CONST daTbox_ModelInfo* getModelInfo(); cPhs_Step commonShapeSet(); cPhs_Step effectShapeSet(); cPhs_Step envShapeSet(); diff --git a/include/d/actor/d_a_ykgr.h b/include/d/actor/d_a_ykgr.h index 472ceefc4a..c23f530c67 100644 --- a/include/d/actor/d_a_ykgr.h +++ b/include/d/actor/d_a_ykgr.h @@ -57,12 +57,12 @@ public: int _execute(); bool _draw(); - static JPABaseEmitter* m_emitter; - static bool m_flag; - static bool m_alpha_flag; - static u8 m_alpha; - static f32 m_aim_rate; - static dPath* m_path; + static DUSK_GAME_DATA JPABaseEmitter* m_emitter; + static DUSK_GAME_DATA bool m_flag; + static DUSK_GAME_DATA bool m_alpha_flag; + static DUSK_GAME_DATA u8 m_alpha; + static DUSK_GAME_DATA f32 m_aim_rate; + static DUSK_GAME_DATA dPath* m_path; /* 0x568 */ u8 field_0x568[0x570 - 0x568]; /* 0x570 */ Mtx field_0x570; diff --git a/include/d/actor/d_flower.h b/include/d/actor/d_flower.h index cd505335a8..db8661b92f 100644 --- a/include/d/actor/d_flower.h +++ b/include/d/actor/d_flower.h @@ -4,6 +4,10 @@ #include "JSystem/J3DGraphBase/J3DPacket.h" #include "SSystem/SComponent/c_xyz.h" +#if TARGET_PC +#include "helpers/batch.hpp" +#endif + class cCcD_Obj; class dCcMassS_HitInf; class fopAc_ac_c; @@ -70,7 +74,7 @@ public: return m_deleteRoom; } - static deleteFunc m_deleteRoom; + static DUSK_GAME_DATA deleteFunc m_deleteRoom; dFlower_anm_c* getAnm(int i_idx) { return &m_anm[i_idx]; } dFlower_anm_c* getAnm() { return &m_anm[0]; } @@ -107,6 +111,12 @@ public: #if TARGET_PC TGXTexObj mTexObj_l_J_Ohana00_64TEX; TGXTexObj mTexObj_l_J_Ohana01_64128_0419TEX; + + batch::LeafTemplate mTplHana00; // l_J_hana00DL + batch::LeafTemplate mTplHana00Cut; // l_J_hana00_cDL + batch::LeafTemplate mTplHana01; // l_J_hana01DL + batch::LeafTemplate mTplHana01Cut00; // l_J_hana01_c_00DL + batch::LeafTemplate mTplHana01Cut; // l_J_hana01_c_01DL #endif }; // Size: 0x12A54 diff --git a/include/d/actor/d_grass.h b/include/d/actor/d_grass.h index 47b948679d..4eee08c0e8 100644 --- a/include/d/actor/d_grass.h +++ b/include/d/actor/d_grass.h @@ -4,6 +4,10 @@ #include "JSystem/J3DGraphBase/J3DPacket.h" #include "SSystem/SComponent/c_xyz.h" +#if TARGET_PC +#include +#endif + class cCcD_Obj; class csXyz; class dCcMassS_HitInf; @@ -80,7 +84,7 @@ public: return m_deleteRoom; } - static deleteFunc m_deleteRoom; + static DUSK_GAME_DATA deleteFunc m_deleteRoom; dGrass_anm_c* getAnm() { return m_anm; } dGrass_anm_c* getAnm(int i_no) { return &m_anm[i_no]; } @@ -110,6 +114,10 @@ public: #if TARGET_PC TGXTexObj mTexObj_l_M_Hijiki00TEX; TGXTexObj mTexObj_l_M_kusa05_RGBATEX; + + batch::LeafTemplate mTplKusa9q; // l_M_Kusa_9qDL + batch::LeafTemplate mTplKusa9qCut; // l_M_Kusa_9q_cDL + batch::LeafTemplate mTplTengusa; // l_M_TenGusaDL #endif }; // Size: 0x1D718 diff --git a/include/d/d_a_item_static.h b/include/d/d_a_item_static.h index 10869c5733..36c445d511 100644 --- a/include/d/d_a_item_static.h +++ b/include/d/d_a_item_static.h @@ -114,9 +114,9 @@ public: bool checkBoomWindTgTimer() { return mBoomWindTgTimer == 0; } - static procFunc mFuncPtr[]; - static const dCcD_SrcCyl m_cyl_src; - static s32 m_timer_max; + static DUSK_GAME_DATA procFunc mFuncPtr[]; + static DUSK_GAME_DATA const dCcD_SrcCyl m_cyl_src; + static DUSK_GAME_DATA s32 m_timer_max; /* 0x92C */ s16 field_0x92c; /* 0x92E */ u16 field_0x92e; diff --git a/include/d/d_a_shop_item_static.h b/include/d/d_a_shop_item_static.h index 0091c0b83c..eeda9185da 100644 --- a/include/d/d_a_shop_item_static.h +++ b/include/d/d_a_shop_item_static.h @@ -74,8 +74,8 @@ public: s16 getAngleY() const { return mAngleY; } void setAngleY(s16 angle) { mAngleY = angle;} - static ResourceData const mData[23]; - static f32 const m_cullfar_max; + static DUSK_GAME_DATA ResourceData const mData[23]; + static DUSK_GAME_DATA f32 const m_cullfar_max; enum { SHOP_ITEMNO_SOLD, diff --git a/include/d/d_attention.h b/include/d/d_attention.h index 455516e54f..8e3b8be1f5 100644 --- a/include/d/d_attention.h +++ b/include/d/d_attention.h @@ -45,7 +45,7 @@ private: class dAttParam_c : public JORReflexible { public: -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x04 */ s8 mHIOChildNo; #endif @@ -66,7 +66,7 @@ public: /* 0x35 */ u8 mAttnCursorDisappearFrames; /* 0x38 */ f32 field_0x38; /* 0x3C */ f32 field_0x3c; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x44 */ s32 mDebugDispPosX; /* 0x48 */ s32 mDebugDispPosY; #endif @@ -286,13 +286,13 @@ public: void keepLock(int timer) { mAttnBlockTimer = timer; } bool Lockon() { return LockonTruth() || chkFlag(0x20000000); } // only matches with -O2? - static type_tbl_entry loc_type_tbl[3]; - static type_tbl_entry act_type_tbl[5]; - static dist_entry dist_table[234]; - static int loc_type_num; - static int act_type_num; - static type_tbl_entry chk_type_tbl[1]; - static int chk_type_num; + static DUSK_GAME_DATA type_tbl_entry loc_type_tbl[3]; + static DUSK_GAME_DATA type_tbl_entry act_type_tbl[5]; + static DUSK_GAME_DATA dist_entry dist_table[234]; + static DUSK_GAME_DATA int loc_type_num; + static DUSK_GAME_DATA int act_type_num; + static DUSK_GAME_DATA type_tbl_entry chk_type_tbl[1]; + static DUSK_GAME_DATA int chk_type_num; public: /* 0x000 */ fopAc_ac_c* mpPlayer; diff --git a/include/d/d_bg_parts.h b/include/d/d_bg_parts.h index a8dba41165..b77199182f 100644 --- a/include/d/d_bg_parts.h +++ b/include/d/d_bg_parts.h @@ -237,8 +237,8 @@ public: static void drawShare(); static void entryShare(packet_c*); - static JKRSolidHeap* mShareHeap; - static share_c* mShare; + static DUSK_GAME_DATA JKRSolidHeap* mShareHeap; + static DUSK_GAME_DATA share_c* mShare; /* 0x000 */ void* mPointer; /* 0x004 */ char mArcName[8]; diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index 33bca24c0a..04a388c61b 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -201,7 +201,7 @@ private: /* 0x02C */ u32 m_flags; /* 0x030 */ cXyz* pm_pos; /* 0x034 */ cXyz* pm_old_pos; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x038 */ cXyz unk_0x38; #endif /* 0x038 */ cXyz* pm_speed; @@ -229,7 +229,7 @@ private: /* 0x0CC */ f32 field_0xcc; /* 0x0D0 */ f32 m_wtr_chk_offset; /* 0x0D4 */ cBgS_PolyInfo* pm_out_poly_info; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x0E4 */ cXyz unk_0xe4; #endif /* 0x0D8 */ f32 field_0xd8; diff --git a/include/d/d_bg_s_movebg_actor.h b/include/d/d_bg_s_movebg_actor.h index be09052ee5..bd9e5351b6 100644 --- a/include/d/d_bg_s_movebg_actor.h +++ b/include/d/d_bg_s_movebg_actor.h @@ -35,9 +35,9 @@ public: virtual int ToFore(); virtual int ToBack(); - static const char* m_name; - static int m_dzb_id; - static MoveBGActor_SetFunc m_set_func; + static DUSK_GAME_DATA const char* m_name; + static DUSK_GAME_DATA int m_dzb_id; + static DUSK_GAME_DATA MoveBGActor_SetFunc m_set_func; }; STATIC_ASSERT(sizeof(dBgS_MoveBgActor) == 0x5a0); diff --git a/include/d/d_bg_w.h b/include/d/d_bg_w.h index 580e22d904..ae37d1c6d9 100644 --- a/include/d/d_bg_w.h +++ b/include/d/d_bg_w.h @@ -6,9 +6,9 @@ #include "d/d_bg_w_base.h" #include #include -#include "dusk/offset_ptr.h" -#include "dusk/endian.h" -#include "dusk/endian_ssystem.h" +#include "helpers/offset_ptr.h" +#include "helpers/endian.h" +#include "helpers/endian_ssystem.h" class cBgS_GrpPassChk; class cBgS_PolyPassChk; diff --git a/include/d/d_bg_w_kcol.h b/include/d/d_bg_w_kcol.h index 1fc812dd98..84b0da03f2 100644 --- a/include/d/d_bg_w_kcol.h +++ b/include/d/d_bg_w_kcol.h @@ -6,7 +6,7 @@ #include "d/d_bg_plc.h" #include "d/d_bg_s_sph_chk.h" #include "d/d_bg_w_base.h" -#include "dusk/offset_ptr.h" +#include "helpers/offset_ptr.h" class cBgS_GrpPassChk; class cBgS_PolyPassChk; diff --git a/include/d/d_camera.h b/include/d/d_camera.h index c481262a46..6c95d1ce51 100644 --- a/include/d/d_camera.h +++ b/include/d/d_camera.h @@ -444,8 +444,7 @@ public: /* 0x1C */ f32 mFovy; /* 0x20 */ f32 mBank; /* 0x24 */ fopAc_ac_c* mRelActor; - /* 0x28 */ char mRelUseMask; - /* 0x29 */ char field_0x29; + /* 0x28 */ char mRelUseMask[4]; /* 0x2C */ int mTimer; /* 0x30 */ bool field_0x30; /* 0x34 */ cXyz mBasePos; @@ -526,7 +525,7 @@ public: /* 0x3C */ fopAc_ac_c* field_0x3c; /* 0x40 */ fopAc_ac_c* field_0x40; /* 0x44 */ fpc_ProcID field_0x44; - /* 0x48 */ char field_0x48; + /* 0x48 */ char field_0x48[4]; /* 0x4C */ int field_0x4c; }; @@ -541,11 +540,7 @@ public: /* 0x3C */ f32 field_0x3c; /* 0x40 */ fopAc_ac_c* mRelActor; /* 0x44 */ fpc_ProcID mRelActorID; - /* 0x48 */ char mRelUseMask; - /* 0x49 */ char field_0x49; - /* 0x4A */ char field_0x4a; - /* 0x4B */ char field_0x4b; - /* 0x4C */ u8 field_0x4c[4]; + /* 0x48 */ char mRelUseMask[8]; /* 0x50 */ int mTimer; /* 0x54 */ int mTransType; /* 0x58 */ f32 mCushion; @@ -696,8 +691,7 @@ public: /* 0x24 */ f32* field_0x24; /* 0x28 */ f32 field_0x28; /* 0x2C */ fopAc_ac_c* mRelActor; - /* 0x30 */ char mRelUseMask; - /* 0x31 */ char field_0x31; + /* 0x30 */ char mRelUseMask[4]; /* 0x34 */ int mTimer; /* 0x38 */ int field_0x38; /* 0x3C */ int mChoice; @@ -780,8 +774,7 @@ public: /* 0xAC */ f32 field_0xac; /* 0xB0 */ fopAc_ac_c* mRelActor; /* 0xB4 */ fpc_ProcID mRelActorID; - /* 0xB8 */ char mRelUseMask; - /* 0xB9 */ char field_0xb9; + /* 0xB8 */ char mRelUseMask[4]; /* 0xBC */ f32 mCushion; /* 0xC0 */ u32 field_0xc0[6]; }; @@ -907,19 +900,24 @@ public: int StartEventCamera(int, int, ...); int EndEventCamera(int); - int searchEventArgData(char*); - bool getEvIntData(int*, char*, int); - bool getEvIntData(int*, char*); - bool getEvFloatData(f32*, char*); - bool getEvFloatData(f32*, char*, f32); - int getEvFloatListData(f32**, char*); - int getEvXyzListData(cXyz**, char*); - char* getEvStringPntData(char*, char*); - char* getEvStringPntData(char*); - bool getEvXyzData(cXyz*, char*, cXyz); - bool getEvStringData(char*, char*, char*); - fopAc_ac_c* getEvActor(char*); - fopAc_ac_c* getEvActor(char*, char*); + int searchEventArgData(DUSK_CONST char*); + bool getEvIntData(int*, DUSK_CONST char*, int); + bool getEvIntData(int*, DUSK_CONST char*); + bool getEvFloatData(f32*, DUSK_CONST char*); + bool getEvFloatData(f32*, DUSK_CONST char*, f32); + int getEvFloatListData(f32**, DUSK_CONST char*); + int getEvXyzListData(cXyz**, DUSK_CONST char*); + char DUSK_CONST* getEvStringPntData(DUSK_CONST char*, char DUSK_CONST*); + char DUSK_CONST* getEvStringPntData(DUSK_CONST char*); + bool getEvXyzData(cXyz*, DUSK_CONST char*, cXyz); +#if TARGET_PC + template + bool getEvStringData(char (&)[N], DUSK_CONST char*, char DUSK_CONST*); +#else + bool getEvStringData(char*, DUSK_CONST char*, char DUSK_CONST*); +#endif + fopAc_ac_c* getEvActor(DUSK_CONST char*); + fopAc_ac_c* getEvActor(DUSK_CONST char*, char DUSK_CONST*); bool pauseEvCamera(); bool fixedFrameEvCamera(); bool stokerEvCamera(); @@ -1039,6 +1037,7 @@ public: bool test1Camera(s32); bool test2Camera(s32); #if TARGET_PC + static bool isAimActive(); bool freeCamera(); bool executeDebugFlyCam(); void deactivateDebugFlyCam(); @@ -1170,7 +1169,7 @@ public: return mCamSetup.Far(); } - static engine_fn engine_tbl[]; + static DUSK_GAME_DATA engine_fn engine_tbl[]; /* 0x000 */ camera_class* field_0x0; #if PARTIAL_DEBUG || DEBUG // Ensure struct layout consistent in all TUs. diff --git a/include/d/d_cc_d.h b/include/d/d_cc_d.h index 19f0430498..40ffae33da 100644 --- a/include/d/d_cc_d.h +++ b/include/d/d_cc_d.h @@ -424,7 +424,7 @@ public: bool ChkTgShieldHit() { return mGObjTg.ChkRPrm(2); } bool ChkTgSpinnerReflect() { return mGObjTg.ChkSPrm(0x200); } - static const Z2SoundID m_hitSeID[24]; + static DUSK_GAME_DATA const Z2SoundID m_hitSeID[24]; protected: /* 0x058 */ dCcD_GObjAt mGObjAt; diff --git a/include/d/d_cc_s.h b/include/d/d_cc_s.h index b4d90787ae..0ebf4a5265 100644 --- a/include/d/d_cc_s.h +++ b/include/d/d_cc_s.h @@ -75,11 +75,11 @@ public: BOOL ChkLine(cXyz&, cXyz&, f32, fopAc_ac_c**); #endif - static bool m_mtrl_hit_tbl[64]; + static DUSK_GAME_DATA bool m_mtrl_hit_tbl[64]; // /* 0x0000 */ cCcS mCCcS; /* 0x284C */ dCcMassS_Mng mMass_Mng; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x2AD0 */ u8 m_is_mass_all_timer; #endif }; // Size = 0x2AC4 diff --git a/include/d/d_com_inf_actor.h b/include/d/d_com_inf_actor.h index da5e5fc62f..5ebd30c33c 100644 --- a/include/d/d_com_inf_actor.h +++ b/include/d/d_com_inf_actor.h @@ -14,8 +14,8 @@ public: /* 0x4 */ bool mPause; }; -extern dComIfGoat_info_c g_dComIfGoat_gameInfo; -extern dComIfAc_info_c g_dComIfAc_gameInfo; +DUSK_GAME_EXTERN dComIfGoat_info_c g_dComIfGoat_gameInfo; +DUSK_GAME_EXTERN dComIfAc_info_c g_dComIfAc_gameInfo; inline bool dComIfA_PauseCheck() { return g_dComIfAc_gameInfo.mPause; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index d81fc5bc1e..a598cbcc10 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -17,7 +17,15 @@ #include "m_Do/m_Do_graphic.h" #include -#include "tracy/Tracy.hpp" +#if defined(DUSK_BUILDING_GAME) +#include +#include "dusk/settings.h" +#else +#ifndef ZoneScoped +#define ZoneScoped +#define ZoneScopedN(name) +#endif +#endif enum dComIfG_ButtonStatus { /* 0x00 */ BUTTON_STATUS_NONE, @@ -1037,7 +1045,7 @@ public: /* 0x1DE09 */ u8 field_0x1de09; /* 0x1DE0A */ u8 field_0x1de0a; /* 0x1DE0B */ u8 mIsDebugMode; - #if DEBUG + #if PARTIAL_DEBUG || DEBUG /* 0x1DE0C */ OSStopwatch mStopwatch; #endif @@ -1049,11 +1057,11 @@ public: STATIC_ASSERT(122384 == sizeof(dComIfG_inf_c)); -extern dComIfG_inf_c g_dComIfG_gameInfo; -extern GXColor g_blackColor; -extern GXColor g_clearColor; -extern GXColor g_whiteColor; -extern GXColor g_saftyWhiteColor; +DUSK_GAME_EXTERN dComIfG_inf_c g_dComIfG_gameInfo; +DUSK_GAME_EXTERN GXColor g_blackColor; +DUSK_GAME_EXTERN GXColor g_clearColor; +DUSK_GAME_EXTERN GXColor g_whiteColor; +DUSK_GAME_EXTERN GXColor g_saftyWhiteColor; int dComLbG_PhaseHandler(request_of_phase_process_class*, request_of_phase_process_fn*, void*); @@ -1851,7 +1859,7 @@ inline u16 dComIfGs_getDeathCount() { } #endif -inline char* dComIfGs_getPlayerName() { +inline TEXT_SPAN dComIfGs_getPlayerName() { return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getPlayerName(); } @@ -1859,7 +1867,7 @@ inline void dComIfGs_setPlayerName(const char* i_name) { g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setPlayerName(i_name); } -inline char* dComIfGs_getHorseName() { +inline TEXT_SPAN dComIfGs_getHorseName() { return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getHorseName(); } @@ -2830,27 +2838,27 @@ inline int dComIfGp_evmng_getIsAddvance(int i_staffId) { return dComIfGp_getPEvtManager()->getIsAddvance(i_staffId); } -inline int dComIfGp_evmng_getMyActIdx(int i_staffId, char** i_actions, int i_actionNum, BOOL param_3, BOOL param_4) { +inline int dComIfGp_evmng_getMyActIdx(int i_staffId, DUSK_CONST char* DUSK_CONST* i_actions, int i_actionNum, BOOL param_3, BOOL param_4) { return dComIfGp_getPEvtManager()->getMyActIdx(i_staffId, i_actions, i_actionNum, param_3, param_4); } -inline f32* dComIfGp_evmng_getMyFloatP(int i_staffId, char* i_dataname) { +inline f32* dComIfGp_evmng_getMyFloatP(int i_staffId, DUSK_CONST char* i_dataname) { return (f32*)dComIfGp_getPEvtManager()->getMySubstanceP(i_staffId, i_dataname, dEvDtData_c::TYPE_FLOAT); } -inline cXyz* dComIfGp_evmng_getMyXyzP(int i_staffId, char* i_dataname) { +inline cXyz* dComIfGp_evmng_getMyXyzP(int i_staffId, DUSK_CONST char* i_dataname) { return (cXyz*)dComIfGp_getPEvtManager()->getMySubstanceP(i_staffId, i_dataname, dEvDtData_c::TYPE_VEC); } -inline int* dComIfGp_evmng_getMyIntegerP(int i_staffId, char* i_dataname) { +inline int* dComIfGp_evmng_getMyIntegerP(int i_staffId, DUSK_CONST char* i_dataname) { return (int*)dComIfGp_getPEvtManager()->getMySubstanceP(i_staffId, i_dataname, dEvDtData_c::TYPE_INT); } -inline char* dComIfGp_evmng_getMyStringP(int i_staffId, char* i_dataname) { +inline char* dComIfGp_evmng_getMyStringP(int i_staffId, DUSK_CONST char* i_dataname) { return (char*)dComIfGp_getPEvtManager()->getMySubstanceP(i_staffId, i_dataname, dEvDtData_c::TYPE_STRING); } -inline int dComIfGp_evmng_getMySubstanceNum(int i_staffId, char* i_dataname) { +inline int dComIfGp_evmng_getMySubstanceNum(int i_staffId, DUSK_CONST char* i_dataname) { return dComIfGp_getPEvtManager()->getMySubstanceNum(i_staffId, i_dataname); } @@ -4837,27 +4845,23 @@ inline void dComIfGd_drawXluListDark() { g_dComIfG_gameInfo.drawlist.drawXluListDark(); } +#if TARGET_PC +void dComIfGd_drawXluListInvisible(); +#else inline void dComIfGd_drawXluListInvisible() { ZoneScoped; -#ifdef TARGET_PC - if (!dusk::getSettings().game.disableWaterRefraction) { -#endif - g_dComIfG_gameInfo.drawlist.drawXluListInvisible(); -#ifdef TARGET_PC - } -#endif + g_dComIfG_gameInfo.drawlist.drawXluListInvisible(); } +#endif +#if TARGET_PC +void dComIfGd_drawOpaListInvisible(); +#else inline void dComIfGd_drawOpaListInvisible() { ZoneScoped; -#ifdef TARGET_PC - if (!dusk::getSettings().game.disableWaterRefraction) { -#endif - g_dComIfG_gameInfo.drawlist.drawOpaListInvisible(); -#ifdef TARGET_PC - } -#endif + g_dComIfG_gameInfo.drawlist.drawOpaListInvisible(); } +#endif inline void dComIfGd_drawXluListZxlu() { ZoneScoped; diff --git a/include/d/d_debug_pad.h b/include/d/d_debug_pad.h index 4c5658adf4..b68e8f8b9b 100644 --- a/include/d/d_debug_pad.h +++ b/include/d/d_debug_pad.h @@ -29,6 +29,6 @@ public: /* 0x4 */ s32 mMode; }; -extern dDebugPad_c dDebugPad; +DUSK_GAME_EXTERN dDebugPad_c dDebugPad; #endif diff --git a/include/d/d_demo.h b/include/d/d_demo.h index e72698ed9a..8eef24d7e3 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -381,26 +381,26 @@ public: return m_object->getActiveCamera(); } - static s16 m_branchId; + static DUSK_GAME_DATA s16 m_branchId; static u16 m_branchNum; - static dDemo_system_c* m_system; - static JStudio::TControl* m_control; - static JStudio_JStage::TCreateObject* m_stage; - static JStudio_JAudio2::TCreateObject* m_audio; - static dDemo_particle_c* m_particle; - static JStudio::TCreateObject* m_message; - static JStudio::TFactory* m_factory; - static jmessage_tControl* m_mesgControl; - static dDemo_object_c* m_object; - static const u8* m_data; - static int m_frame; - static cXyz* m_translation; - static f32 m_rotationY; - static u32 m_frameNoMsg; - static s32 m_mode; - static u32 m_status; - static u16 m_branchType; - static const u8* m_branchData; + static DUSK_GAME_DATA dDemo_system_c* m_system; + static DUSK_GAME_DATA JStudio::TControl* m_control; + static DUSK_GAME_DATA JStudio_JStage::TCreateObject* m_stage; + static DUSK_GAME_DATA JStudio_JAudio2::TCreateObject* m_audio; + static DUSK_GAME_DATA dDemo_particle_c* m_particle; + static DUSK_GAME_DATA JStudio::TCreateObject* m_message; + static DUSK_GAME_DATA JStudio::TFactory* m_factory; + static DUSK_GAME_DATA jmessage_tControl* m_mesgControl; + static DUSK_GAME_DATA dDemo_object_c* m_object; + static DUSK_GAME_DATA const u8* m_data; + static DUSK_GAME_DATA int m_frame; + static DUSK_GAME_DATA cXyz* m_translation; + static DUSK_GAME_DATA f32 m_rotationY; + static DUSK_GAME_DATA u32 m_frameNoMsg; + static DUSK_GAME_DATA s32 m_mode; + static DUSK_GAME_DATA u32 m_status; + static DUSK_GAME_DATA u16 m_branchType; + static DUSK_GAME_DATA const u8* m_branchData; }; #endif /* D_D_DEMO_H */ diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 8368c9e92e..25d92aff54 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -5,7 +5,7 @@ #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/J3DGraphBase/J3DSys.h" #include "SSystem/SComponent/c_m3d_g_pla.h" -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" #include "f_op/f_op_view.h" #include "global.h" #include "m_Do/m_Do_ext.h" @@ -301,7 +301,7 @@ public: static TGXTexObj* getSimpleTex() { return &mSimpleTexObj; } - static TGXTexObj mSimpleTexObj; + static DUSK_GAME_DATA TGXTexObj mSimpleTexObj; private: /* 0x00000 */ u8 field_0x0; @@ -512,11 +512,11 @@ public: static void offWipe() { mWipe = 0; } static f32 getWipeRate() { return mWipeRate; } - static dDlst_2DT2_c mWipeDlst; - static GXColor mWipeColor; - static f32 mWipeRate; - static f32 mWipeSpeed; - static u8 mWipe; + static DUSK_GAME_DATA dDlst_2DT2_c mWipeDlst; + static DUSK_GAME_DATA GXColor mWipeColor; + static DUSK_GAME_DATA f32 mWipeRate; + static DUSK_GAME_DATA f32 mWipeSpeed; + static DUSK_GAME_DATA u8 mWipe; private: /* 0x00000 */ J3DDrawBuffer* mDrawBuffers[DB_LIST_MAX]; diff --git a/include/d/d_event.h b/include/d/d_event.h index ed0d749db4..203ec43423 100644 --- a/include/d/d_event.h +++ b/include/d/d_event.h @@ -84,7 +84,7 @@ public: void clearSkipSystem(); char* getSkipEventName(); void setSkipProc(void* skipActor, dEvt_SkipCb skipCb, int skipParameter); - void setSkipZev(void* skipActor, char* eventName); + void setSkipZev(void* skipActor, DUSK_CONST char* eventName); void onSkipFade(); void offSkipFade(); bool skipper(); @@ -196,8 +196,8 @@ public: /* 0x108 */ int mSkipTimer; /* 0x10C */ int mSkipParameter; /* 0x110 */ BOOL mIsSkipFade; -#if TARGET_PC - /* 0x114 */ char mSkipEventName[21]; +#if AVOID_UB + /* 0x114 */ char mSkipEventName[32]; #else /* 0x114 */ char mSkipEventName[20]; #endif diff --git a/include/d/d_event_data.h b/include/d/d_event_data.h index ee9b868af4..eef55b1164 100644 --- a/include/d/d_event_data.h +++ b/include/d/d_event_data.h @@ -3,7 +3,7 @@ #include "global.h" #include "f_pc/f_pc_base.h" -#include "dusk/endian.h" +#include "helpers/endian.h" struct msg_class; diff --git a/include/d/d_event_manager.h b/include/d/d_event_manager.h index 590d20f25c..de046797ff 100644 --- a/include/d/d_event_manager.h +++ b/include/d/d_event_manager.h @@ -41,7 +41,7 @@ public: BASE_ROOM5, BASE_DEMO, - #if DEBUG + #if PARTIAL_DEBUG || DEBUG BASE_DEBUG, #endif @@ -53,7 +53,7 @@ public: dEvent_manager_c(); ~dEvent_manager_c() {} int create(); - bool setObjectArchive(char* arcname); + bool setObjectArchive(DUSK_CONST char* arcname); void demoInit(); void roomInit(int roomNo); void roomFinish(int roomNo); diff --git a/include/d/d_eye_hl.h b/include/d/d_eye_hl.h index e7a4d82d3c..23f93cf83d 100644 --- a/include/d/d_eye_hl.h +++ b/include/d/d_eye_hl.h @@ -17,7 +17,7 @@ public: JUT_ASSERT(51, m_obj == NULL); } - static dEyeHL_c* m_obj; + static DUSK_GAME_DATA dEyeHL_c* m_obj; }; class dEyeHL_c { diff --git a/include/d/d_file_sel_info.h b/include/d/d_file_sel_info.h index 73641bc770..973349c469 100644 --- a/include/d/d_file_sel_info.h +++ b/include/d/d_file_sel_info.h @@ -46,10 +46,10 @@ private: /* 0x22 */ u8 field_0x22; /* 0x24 */ CPaneMgrAlpha* mDatBase; /* 0x28 */ CPaneMgrAlpha* mNoDatBase; - /* 0x2C */ char* mPlayerName; - /* 0x30 */ char* mSaveDate; - /* 0x34 */ char* mPlayTime; - /* 0x38 */ char* mSaveStatus; + /* 0x2C */ TEXT_SPAN mPlayerName; + /* 0x30 */ TEXT_SPAN mSaveDate; + /* 0x34 */ TEXT_SPAN mPlayTime; + /* 0x38 */ TEXT_SPAN mSaveStatus; }; typedef void (dFile_info_c::*warningFunc)(void); diff --git a/include/d/d_file_select.h b/include/d/d_file_select.h index cf081a3b10..634c0db352 100644 --- a/include/d/d_file_select.h +++ b/include/d/d_file_select.h @@ -12,6 +12,39 @@ class dFile_info_c; class J2DPicture; +#if TARGET_PC +static PaneCache mSelDtPanes[] = { + {MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false}, + {MULTI_CHAR('gray_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('b_base'), 0.0f, 0.0f, false}, + {MULTI_CHAR('b_base1'), 0.0f, 0.0f, false}, +}; + +static PaneCache fileSelPanes[] = { + {MULTI_CHAR('w_uzu00'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu01'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu02'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu03'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu04'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu05'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu06'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu07'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu08'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_uzu09'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_er_msg'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_er_msE'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_er_msR'), 0.0f, 0.0f, false}, + {MULTI_CHAR('er_for0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('er_for1'), 0.0f, 0.0f, false}, +}; +#endif + class dDlst_FileSel_c : public dDlst_base_c { public: void draw(); @@ -254,6 +287,11 @@ public: MEMCARDCHECKPROC_ERR_YESNO_CURSOR_MOVE_ANM, MEMCARDCHECKPROC_SAVEDATA_CLEAR, +#if TARGET_PC + MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE, + MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE_ERR_WAIT, +#endif + #if PLATFORM_WII || PLATFORM_SHIELD MEMCARDCHECKPROC_NAND_STAT_CHECK, MEMCARDCHECKPROC_GAMEFILE_INIT_SEL, @@ -378,6 +416,10 @@ public: bool yesnoWakuAlpahAnm(u8); #if TARGET_PC void fileSelectWide(); + bool pointerDataSelect(); + bool pointerMenuSelect(); + bool pointerCopyDataToSelect(); + bool pointerYesNoSelect(bool errorSelect); #endif void _draw(); void errorMoveAnmInitSet(int, int); @@ -412,6 +454,10 @@ public: void MemCardMakeGameFile(); void MemCardMakeGameFileWait(); void MemCardMakeGameFileCheck(); +#if TARGET_PC + void MemCardAutoMakeGameFile(); + void MemCardAutoMakeGameFileErrWait(); +#endif void MemCardMsgWindowInitOpen(); void MemCardMsgWindowOpen(); void MemCardMsgWindowClose(); @@ -530,7 +576,7 @@ public: /* 0x0130 */ int field_0x0130; /* 0x0134 */ int field_0x0134; /* 0x0138 */ CPaneMgrAlpha* mErrorMsgTxtPane[2]; - /* 0x0140 */ char* mErrorMsgStringPtr[2]; + /* 0x0140 */ TEXT_SPAN mErrorMsgStringPtr[2]; /* 0x0148 */ u8 mErrorTxtDispIdx; /* 0x0149 */ u8 field_0x0149; /* 0x014A */ bool field_0x014a; @@ -574,7 +620,7 @@ public: /* 0x020A */ u8 mFadeTimer; /* 0x020B */ u8 field_0x020b; /* 0x020C */ CPaneMgrAlpha* mHeaderTxtPane[2]; - /* 0x0214 */ char* mHeaderStringPtr[2]; + /* 0x0214 */ TEXT_SPAN mHeaderStringPtr[2]; /* 0x021C */ u8 mHeaderTxtDispIdx; /* 0x021D */ u8 field_0x021d; /* 0x021E */ u8 field_0x021e; @@ -591,7 +637,7 @@ public: /* 0x024B */ u8 field_0x024b; /* 0x024C */ u8 field_0x024c; /* 0x024B */ u8 field_0x024d[3]; - /* 0x0250 */ char* mModoruStringPtr; + /* 0x0250 */ TEXT_SPAN mModoruStringPtr; /* 0x0254 */ STControl* stick; /* 0x0258 */ u8 mIsDataNew[3]; /* 0x025B */ u8 mIsNoData[3]; diff --git a/include/d/d_item.h b/include/d/d_item.h index 0d379c0578..d9bdfd18c9 100644 --- a/include/d/d_item.h +++ b/include/d/d_item.h @@ -8,7 +8,7 @@ public: static void setItemData(u8* data) { mData = data; } static u8* getItemData() { return mData; } - static u8* mData; + static DUSK_GAME_DATA u8* mData; }; void execItemGet(u8 item_id); diff --git a/include/d/d_item_data.h b/include/d/d_item_data.h index a1770be241..0044573976 100644 --- a/include/d/d_item_data.h +++ b/include/d/d_item_data.h @@ -86,9 +86,9 @@ struct dItem_data { static u16 getFieldHeapSize(u8 index) { return field_item_res[index].mHeapSize; } - static dItem_itemResource item_resource[255]; - static dItem_fieldItemResource field_item_res[255]; - static dItem_itemInfo item_info[255]; + static DUSK_GAME_DATA dItem_itemResource item_resource[255]; + static DUSK_GAME_DATA dItem_fieldItemResource field_item_res[255]; + static DUSK_GAME_DATA dItem_itemInfo item_info[255]; }; enum { diff --git a/include/d/d_jnt_col.h b/include/d/d_jnt_col.h index cc67b7104d..7cd00459a2 100644 --- a/include/d/d_jnt_col.h +++ b/include/d/d_jnt_col.h @@ -14,7 +14,7 @@ public: /* 0x1 */ u8 mType; /* 0x2 */ s16 mJntNum; /* 0x4 */ f32 field_0x4; - /* 0x8 */ Vec* field_0x8; + /* 0x8 */ DUSK_CONST Vec* field_0x8; }; class dJntCol_c { diff --git a/include/d/d_k_wmark.h b/include/d/d_k_wmark.h index 0190c94467..b4f28d1263 100644 --- a/include/d/d_k_wmark.h +++ b/include/d/d_k_wmark.h @@ -13,7 +13,7 @@ public: inline int execute(); inline int draw(); - static int m_nowID; + static DUSK_GAME_DATA int m_nowID; static void setFootMark(cXyz* i_pos, s16 param_1, int param_2) { fopKyM_create(fpcNm_WMARK_e, param_2 | (param_1 << 0x10), i_pos, NULL, NULL); diff --git a/include/d/d_kankyo.h b/include/d/d_kankyo.h index 3c81f08d10..1a43d811f7 100644 --- a/include/d/d_kankyo.h +++ b/include/d/d_kankyo.h @@ -259,7 +259,7 @@ public: /* 0x09B8 */ DUNGEON_LIGHT dungeonlight[8]; /* 0x0C18 */ BOSS_LIGHT field_0x0c18[8]; /* 0x0D58 */ BOSS_LIGHT field_0x0d58[6]; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x0E48 */ NAVYCHAN navy; /* 0x0E58 */ u8 field_0xe58[0xE68 - 0xE58]; // part of NAVYCHAN? #endif @@ -471,7 +471,7 @@ public: /* 0x130C */ u8 staffroll_next_timer; }; // Size: 0x1310 -extern dScnKy_env_light_c g_env_light; +DUSK_GAME_EXTERN dScnKy_env_light_c g_env_light; STATIC_ASSERT(sizeof(dScnKy_env_light_c) == 4880); @@ -967,7 +967,7 @@ public: /* 0x7A0 */ dKankyo_ParticlelightHIO_c particleLight; }; -extern dKankyo_HIO_c g_kankyoHIO; +DUSK_GAME_EXTERN dKankyo_HIO_c g_kankyoHIO; enum dKy_dice_wether_mode { DICE_MODE_SUNNY_e, diff --git a/include/d/d_kankyo_wether.h b/include/d/d_kankyo_wether.h index 31aa1fd8e3..ff1ce7d9d5 100644 --- a/include/d/d_kankyo_wether.h +++ b/include/d/d_kankyo_wether.h @@ -198,6 +198,7 @@ struct HOUSI_EFF { /* 0x4C */ u16 field_0x4c; }; // Size: 0x50 +// Housi is the rising square particles in Twilight class dKankyo_housi_Packet : public J3DPacket { public: virtual void draw(); @@ -208,7 +209,7 @@ public: /* 0x0020 */ HOUSI_EFF mHousiEff[300]; /* 0x5DE0 */ u8 field_0x5de0[8]; /* 0x5DE8 */ f32 field_0x5de8; - /* 0x5DEC */ s16 field_0x5dec; + /* 0x5DEC */ s16 mHousiCount; }; // Size: 0x5DF0 struct CLOUD_EFF { diff --git a/include/d/d_lib.h b/include/d/d_lib.h index 1d3103ce96..c4f8fed7bb 100644 --- a/include/d/d_lib.h +++ b/include/d/d_lib.h @@ -85,11 +85,11 @@ struct dLib_time_c { static void stopTime(); static void startTime(); - static OSTime m_diffTime; - static OSTime m_stopTime; - static bool m_timeStopped; + static DUSK_GAME_DATA OSTime m_diffTime; + static DUSK_GAME_DATA OSTime m_stopTime; + static DUSK_GAME_DATA bool m_timeStopped; }; -extern Quaternion ZeroQuat; +DUSK_GAME_EXTERN Quaternion ZeroQuat; #endif /* D_D_LIB_H */ diff --git a/include/d/d_map.h b/include/d/d_map.h index 1acc7e4519..b42def27c7 100644 --- a/include/d/d_map.h +++ b/include/d/d_map.h @@ -87,7 +87,7 @@ struct dMap_HIO_prm_res_src_s { }; struct dMap_HIO_prm_res_dst_s { - static dMap_prm_res_s* m_res; + static DUSK_GAME_DATA dMap_prm_res_s* m_res; static dMap_HIO_prm_other_s m_other; }; @@ -157,6 +157,9 @@ public: int getDispType() const; void _move(f32, f32, int, f32); void _draw(); +#if TARGET_PC + bool refreshTextureSize(); +#endif virtual ~dMap_c() { #if DEBUG diff --git a/include/d/d_map_path.h b/include/d/d_map_path.h index 495fdf396a..885c7ade87 100644 --- a/include/d/d_map_path.h +++ b/include/d/d_map_path.h @@ -260,7 +260,7 @@ struct dMpath_n { /* 0x0 */ TGXTexObj* mp_texObj[TEX_OBJ_NUMBER]; }; - static dTexObjAggregate_c m_texObjAgg; + static DUSK_GAME_DATA dTexObjAggregate_c m_texObjAgg; }; STATIC_ASSERT(sizeof(dMpath_n::dTexObjAggregate_c) == 28); diff --git a/include/d/d_map_path_dmap.h b/include/d/d_map_path_dmap.h index bbffcd7809..7d23be73c9 100644 --- a/include/d/d_map_path_dmap.h +++ b/include/d/d_map_path_dmap.h @@ -33,17 +33,17 @@ public: static f32 getCenterX() { return mAllCenterX; } static f32 getCenterZ() { return mAllCenterZ; } - static dDrawPath_c::layer_data* mLayerList; // this doesn't seem right, but can't figure it out atm - static f32 mMinX; - static f32 mMaxX; - static f32 mMinZ; - static f32 mMaxZ; - static f32 mAllCenterX; - static f32 mAllCenterZ; - static f32 mAllSizeX; - static f32 mAllSizeZ; - static s8 mBottomFloorNo; - static s8 mTopFloorNo; + static DUSK_GAME_DATA dDrawPath_c::layer_data* mLayerList; // this doesn't seem right, but can't figure it out atm + static DUSK_GAME_DATA f32 mMinX; + static DUSK_GAME_DATA f32 mMaxX; + static DUSK_GAME_DATA f32 mMinZ; + static DUSK_GAME_DATA f32 mMaxZ; + static DUSK_GAME_DATA f32 mAllCenterX; + static DUSK_GAME_DATA f32 mAllCenterZ; + static DUSK_GAME_DATA f32 mAllSizeX; + static DUSK_GAME_DATA f32 mAllSizeZ; + static DUSK_GAME_DATA s8 mBottomFloorNo; + static DUSK_GAME_DATA s8 mTopFloorNo; }; struct dMapInfo_n { @@ -90,10 +90,10 @@ public: static void setNextRoomNoForMapPat0(int i_roomNo) { mNextRoomNo = i_roomNo; } static int getNextRoomNoForMapPat0() { return mNextRoomNo; } - static int mNextRoomNo; - static int mNowStayRoomNo; - static s8 mNowStayFloorNo; - static u8 mNowStayFloorNoDecisionFlg; + static DUSK_GAME_DATA int mNextRoomNo; + static DUSK_GAME_DATA int mNowStayRoomNo; + static DUSK_GAME_DATA s8 mNowStayFloorNo; + static DUSK_GAME_DATA u8 mNowStayFloorNoDecisionFlg; }; class renderingDAmap_c : public dRenderingFDAmap_c { diff --git a/include/d/d_menu_collect.h b/include/d/d_menu_collect.h index 55d5373c71..b7d5ec2976 100644 --- a/include/d/d_menu_collect.h +++ b/include/d/d_menu_collect.h @@ -16,6 +16,48 @@ class dMenu_Skill_c; class dMenu_Insect_c; class dSelect_cursor_c; +#if TARGET_PC +struct PaneCache { + u64 tag; + f32 origTransX; + f32 origTransY; + bool cached; +}; + +static PaneCache mpScreenPanes[] = { + {MULTI_CHAR('sa_tex_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('op_tex_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('heart_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('wolf_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('item_0_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('item_1_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('item_2_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fish_3_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('lett_4_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('maki_5_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false}, + {MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('kabu_6n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('t_t00'), 0.0f, 0.0f, false}, + {MULTI_CHAR('f_t00'), 0.0f, 0.0f, false}, + {MULTI_CHAR('itemn_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('infotxtn'), 0.0f, 0.0f, false}, + {MULTI_CHAR('sa_op_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('title_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('menu_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('w_er_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('center_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('info_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('lavel_n'), 0.0f, 0.0f, false}, + {MULTI_CHAR('modelbgn'), 0.0f, 0.0f, false}, +}; +#endif + class dMenu_Collect2D_c; class dMenu_Collect2DTop_c : public dDlst_base_c { public: @@ -32,6 +74,8 @@ public: #if TARGET_PC void menuCollectWide(); + bool pointerWait(); + void pointerActivateCurrent(); #endif void _create(); @@ -222,7 +266,7 @@ public: mViewOffsetY = i_offset; } - static f32 mViewOffsetY; + static DUSK_GAME_DATA f32 mViewOffsetY; private: /* 0x004 */ JKRExpHeap* mpHeap; diff --git a/include/d/d_menu_dmap.h b/include/d/d_menu_dmap.h index 81baea1446..4d1341cc67 100644 --- a/include/d/d_menu_dmap.h +++ b/include/d/d_menu_dmap.h @@ -183,6 +183,11 @@ public: /* 0xDD8 */ u8 field_0xdd8; /* 0xDD9 */ u8 field_0xdd9; /* 0xDDA */ u8 field_0xdda; + +#if TARGET_PC + J2DTextBox* mpPoeCountPane; + J2DPicture* mpPoeCountIcon; +#endif }; class dMenu_Dmap_c { @@ -248,7 +253,7 @@ public: s8 getFloorPos(s8 param_0) { return param_0 - mBottomFloor; } u16 getCMessageNum() { return mCMessageNum; } - static dMenu_Dmap_c* myclass; + static DUSK_GAME_DATA dMenu_Dmap_c* myclass; private: /* 0x004 */ dMenu_DmapMapCtrl_c* mMapCtrl; diff --git a/include/d/d_menu_dmap_map.h b/include/d/d_menu_dmap_map.h index f1a5432391..3f3eb37a0f 100644 --- a/include/d/d_menu_dmap_map.h +++ b/include/d/d_menu_dmap_map.h @@ -151,10 +151,10 @@ public: ResTIMG* getResTIMGPointer(int i_no) const { return dMenu_DmapMap_c::getResTIMGPointer(i_no); } - static f32 m_zoomCenterMinX; - static f32 m_zoomCenterMaxX; - static f32 m_zoomCenterMinZ; - static f32 m_zoomCenterMaxZ; + static DUSK_GAME_DATA f32 m_zoomCenterMinX; + static DUSK_GAME_DATA f32 m_zoomCenterMaxX; + static DUSK_GAME_DATA f32 m_zoomCenterMinZ; + static DUSK_GAME_DATA f32 m_zoomCenterMaxZ; /* 0x88 */ u8 field_0x88[0x8C - 0x88]; /* 0x8C */ dTres_c::typeGroupData_c* field_0x8c; diff --git a/include/d/d_menu_fmap.h b/include/d/d_menu_fmap.h index 48db37fef3..110298798a 100644 --- a/include/d/d_menu_fmap.h +++ b/include/d/d_menu_fmap.h @@ -268,7 +268,7 @@ public: /* 0x1D */ PROC_HOWL_DEMO3, }; - static dMenu_Fmap_c* MyClass; + static DUSK_GAME_DATA dMenu_Fmap_c* MyClass; private: /* 0x004 */ JKRExpHeap* mpHeap; @@ -356,7 +356,7 @@ public: /* 0x10 */ u8 mBaseBackAlpha; /* 0x11 */ u8 mMoyaAlpha; - static dMf_HIO_c* mMySelfPointer; + static DUSK_GAME_DATA dMf_HIO_c* mMySelfPointer; }; const char* dMenuFmap_getStartStageName(void* param_0); diff --git a/include/d/d_menu_fmap2D.h b/include/d/d_menu_fmap2D.h index 7df78bb6d0..3c37c3da74 100644 --- a/include/d/d_menu_fmap2D.h +++ b/include/d/d_menu_fmap2D.h @@ -421,6 +421,12 @@ public: /* 0xC2 */ u8 mAlphaButtonZ; /* 0xC3 */ u8 mAlphaAnalogStick; /* 0xC4 */ u8 mAlphaDpad; + +#if TARGET_PC + J2DTextBox* mpPoeCountPane; + J2DPicture* mpPoeCountIcon; + u8 mSelectRegionNo; +#endif }; #endif /* D_MENU_D_MENU_FMAP2D_H */ diff --git a/include/d/d_menu_fmap_map.h b/include/d/d_menu_fmap_map.h index 95294ffb35..b0d1063d18 100644 --- a/include/d/d_menu_fmap_map.h +++ b/include/d/d_menu_fmap_map.h @@ -28,7 +28,7 @@ struct dMfm_prm_res_s { struct dMfm_HIO_prm_res_src_s { /* 0x0 */ u8 mFlashDuration; - static const dMfm_HIO_prm_res_src_s m_other; + static DUSK_GAME_DATA const dMfm_HIO_prm_res_src_s m_other; }; struct dMfm_HIO_prm_res_dst_s { diff --git a/include/d/d_menu_insect.h b/include/d/d_menu_insect.h index 6b23a3845d..90cfca7d5a 100644 --- a/include/d/d_menu_insect.h +++ b/include/d/d_menu_insect.h @@ -51,6 +51,10 @@ public: void setBButtonString(u16); void setHIO(bool); +#if TARGET_PC + bool pointerWait(); +#endif + virtual void draw() { _draw(); } virtual ~dMenu_Insect_c(); diff --git a/include/d/d_menu_letter.h b/include/d/d_menu_letter.h index 163c381699..208f8b65a9 100644 --- a/include/d/d_menu_letter.h +++ b/include/d/d_menu_letter.h @@ -55,6 +55,10 @@ public: u8 getLetterNum(); void setHIO(bool); +#if TARGET_PC + bool pointerWait(); +#endif + virtual void draw() { _draw(); } virtual ~dMenu_Letter_c(); diff --git a/include/d/d_menu_map_common.h b/include/d/d_menu_map_common.h index de50d775ca..55de3d0f6c 100644 --- a/include/d/d_menu_map_common.h +++ b/include/d/d_menu_map_common.h @@ -76,6 +76,11 @@ public: } #endif +#if TARGET_PC + static void getDmapPoeCount(const std::string& stageName, int& nowCount, int& totalCount); + static void getFmapPoeCount(const int regionNo, int& nowCount, int& totalCount); +#endif + struct Stage_c { // Incomplete class diff --git a/include/d/d_menu_option.h b/include/d/d_menu_option.h index 7204d62974..03aca42808 100644 --- a/include/d/d_menu_option.h +++ b/include/d/d_menu_option.h @@ -80,6 +80,9 @@ public: void setBButtonString(u16); bool isRumbleSupported(); bool dpdMenuMove(); +#if TARGET_PC + bool pointerConfirmSelect(); +#endif void paneResize(u64); void initialize(); void yesnoMenuMoveAnmInitSet(int, int); diff --git a/include/d/d_menu_ring.h b/include/d/d_menu_ring.h index 74624eac80..c7467d2a4b 100644 --- a/include/d/d_menu_ring.h +++ b/include/d/d_menu_ring.h @@ -74,6 +74,9 @@ public: void clacEllipsePlotAverage(int, f32, f32); bool dpdMove(); u8 openExplain(u8); +#if TARGET_PC + bool pointerMove(); +#endif virtual void draw() { _draw(); } virtual ~dMenu_Ring_c(); @@ -215,6 +218,7 @@ private: bool mCursorInterpPrevAngular; bool mCursorInterpCurrAngular; bool mCursorInterpInit; + bool mPointerTouchPressHoveredCurrent; #endif }; diff --git a/include/d/d_menu_save.h b/include/d/d_menu_save.h index 4a70d1d045..d9d052aa33 100644 --- a/include/d/d_menu_save.h +++ b/include/d/d_menu_save.h @@ -266,6 +266,8 @@ public: #if TARGET_PC void menuSaveWide(); + bool pointerSaveSelect(); + bool pointerYesNoSelect(bool errorSelect, u8 errParam = 0, u8 soundParam = 0); #endif void _draw2(); @@ -313,7 +315,7 @@ private: /* 0x00B8 */ int field_0xb8; /* 0x00BC */ int field_0xbc; /* 0x00C0 */ CPaneMgrAlpha* mpErrTxtPane[2]; - /* 0x00C8 */ char* mpErrTxt[2]; + /* 0x00C8 */ TEXT_SPAN mpErrTxt[2]; /* 0x00D0 */ u8 mErrTxtType; /* 0x00D1 */ u8 mErrTxtAnmComplete; /* 0x00D2 */ u8 field_0xd2; @@ -344,7 +346,7 @@ private: /* 0x0160 */ J2DAnmTevRegKey* field_0x160; /* 0x0164 */ int field_0x164; /* 0x0168 */ CPaneMgrAlpha* mpHeaderTxtPane[2]; - /* 0x0170 */ char* mpHeaderTxt[2]; + /* 0x0170 */ TEXT_SPAN mpHeaderTxt[2]; /* 0x0178 */ u8 mHeaderTxtType; // 0: Select Menu 1: YesNo Menu /* 0x0179 */ u8 mHeaderAnmComplete; /* 0x017A */ u8 field_0x17a; diff --git a/include/d/d_menu_skill.h b/include/d/d_menu_skill.h index 9ea305163e..2f9097b165 100644 --- a/include/d/d_menu_skill.h +++ b/include/d/d_menu_skill.h @@ -49,6 +49,10 @@ public: u8 getSkillNum(); void setHIO(bool); +#if TARGET_PC + bool pointerWait(); +#endif + virtual void draw() { _draw(); } virtual ~dMenu_Skill_c(); diff --git a/include/d/d_menu_window_HIO.h b/include/d/d_menu_window_HIO.h index b5d5c81fb4..7ac32267c8 100644 --- a/include/d/d_menu_window_HIO.h +++ b/include/d/d_menu_window_HIO.h @@ -31,7 +31,7 @@ public: /* 0x1E5 */ u8 mMidBossClearCopy[32]; }; -extern dMw_DHIO_c g_mwDHIO; +DUSK_GAME_EXTERN dMw_DHIO_c g_mwDHIO; class dMw_HIO_c : public JORReflexible { public: @@ -131,6 +131,6 @@ public: /* 0x12A */ u8 mMirrorShardCopy[4]; }; // Size: 0x130 -extern dMw_HIO_c g_mwHIO; +DUSK_GAME_EXTERN dMw_HIO_c g_mwHIO; #endif /* D_MENU_D_MENU_WINDOW_HIO_H */ diff --git a/include/d/d_meter2_info.h b/include/d/d_meter2_info.h index 51f07f4dc3..410cf642b1 100644 --- a/include/d/d_meter2_info.h +++ b/include/d/d_meter2_info.h @@ -21,7 +21,7 @@ struct dMenu_Letter { static u16 getLetterText(int idx) { return letter_data[idx].mText; } static u16 getLetterEventFlag(int idx) { return letter_data[idx].mEventFlag; } - static dMenu_LetterData letter_data[64]; + static DUSK_GAME_DATA dMenu_LetterData letter_data[64]; }; class dMw_c; @@ -67,9 +67,9 @@ public: s16 decFloatingMessageTimer(); void resetFloatingMessage(); void decMsgKeyWaitTimer(); - void getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry); - void getStringKana(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry); - void getStringKanji(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry); + void getString(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry); + void getStringKana(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry); + void getStringKanji(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry); f32 getStringLength(J2DTextBox* i_textbox, char* i_string); f32 getStringLength(JUTFont* i_font, f32 param_2, f32 param_3, char* i_string); void onDirectUseItem(int); @@ -301,7 +301,7 @@ public: /* 0xF3 */ u8 unk_0xf3[5]; }; -extern dMeter2Info_c g_meter2_info; +DUSK_GAME_EXTERN dMeter2Info_c g_meter2_info; void dMeter2Info_setSword(u8 i_itemId, bool i_offItemBit); void dMeter2Info_setCloth(u8 i_clothId, bool i_offItemBit); @@ -348,15 +348,15 @@ inline CPaneMgr* dMeter2Info_getMeterItemPanePtr(s32 i_idx) { return g_meter2_info.getMeterItemPanePtr(i_idx); } -inline void dMeter2Info_getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) { +inline void dMeter2Info_getString(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { g_meter2_info.getString(i_stringID, o_string, i_msgEntry); } -inline void dMeter2Info_getStringKanji(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) { +inline void dMeter2Info_getStringKanji(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { g_meter2_info.getStringKanji(i_stringID, o_string, i_msgEntry); } -inline void dMeter2Info_getStringKana(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) { +inline void dMeter2Info_getStringKana(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { g_meter2_info.getStringKana(i_stringID, o_string, i_msgEntry); } diff --git a/include/d/d_meter_HIO.h b/include/d/d_meter_HIO.h index e52051095f..037b17779b 100644 --- a/include/d/d_meter_HIO.h +++ b/include/d/d_meter_HIO.h @@ -1332,10 +1332,10 @@ public: STATIC_ASSERT(sizeof(dMeter_cursorHIO_c) == 68); -extern dMeter_menuHIO_c g_menuHIO; -extern dMeter_drawHIO_c g_drawHIO; -extern dMeter_ringHIO_c g_ringHIO; -extern dMeter_fmapHIO_c g_fmapHIO; -extern dMeter_cursorHIO_c g_cursorHIO; +DUSK_GAME_EXTERN dMeter_menuHIO_c g_menuHIO; +DUSK_GAME_EXTERN dMeter_drawHIO_c g_drawHIO; +DUSK_GAME_EXTERN dMeter_ringHIO_c g_ringHIO; +DUSK_GAME_EXTERN dMeter_fmapHIO_c g_fmapHIO; +DUSK_GAME_EXTERN dMeter_cursorHIO_c g_cursorHIO; #endif /* D_METER_D_METER_HIO_H */ diff --git a/include/d/d_meter_button.h b/include/d/d_meter_button.h index 0f05d32440..2d9a4bb5d8 100644 --- a/include/d/d_meter_button.h +++ b/include/d/d_meter_button.h @@ -1,6 +1,7 @@ #ifndef D_METER_D_METER_BUTTON_H #define D_METER_D_METER_BUTTON_H +#include "global.h" #include "JSystem/J2DGraph/J2DScreen.h" #include "JSystem/J2DGraph/J2DTextBox.h" #include "d/d_drawlist.h" @@ -194,7 +195,7 @@ public: /* 0x0FC */ CPaneMgr* field_0x0fc[4]; /* 0x10C */ JKRHeap* mpHeap; /* 0x110 */ void* mpFishingTex; - /* 0x114 */ char mButtonText[2][15]; + /* 0x114 */ char mButtonText[2][DUSK_IF_ELSE(32, 15)]; /* 0x132 */ u8 field_0x132[0x134 - 0x132]; /* 0x134 */ f32 field_0x134; /* 0x138 */ f32 field_0x138; diff --git a/include/d/d_model.h b/include/d/d_model.h index 2dd1abaabf..72949f5f03 100644 --- a/include/d/d_model.h +++ b/include/d/d_model.h @@ -53,7 +53,7 @@ public: static void remove(); static void reset(); - static dMdl_mng_c* m_myObj; + static DUSK_GAME_DATA dMdl_mng_c* m_myObj; private: /* 0x00 */ dMdl_c field_0x0[4]; diff --git a/include/d/d_msg_class.h b/include/d/d_msg_class.h index 8ebf3ff5b7..5292eed5d3 100644 --- a/include/d/d_msg_class.h +++ b/include/d/d_msg_class.h @@ -4,7 +4,8 @@ #include "JSystem/JMessage/control.h" #include "JSystem/JMessage/JMessage.h" #include "SSystem/SComponent/c_xyz.h" -#include "dusk/endian.h" +#include "helpers/endian.h" +#include "helpers/string.hpp" #if REGION_JPN #define D_MSG_CLASS_PAGE_CNT_MAX 30 @@ -67,7 +68,7 @@ struct jmessage_tReference : public JMessage::TReference { void pageSend(); void selectMessage(); void inputNumber(); - char* getWord(int); + TEXT_SPAN getWord(int); void resetWord(); void setCharactor(u16); void addCharactor(u16); @@ -228,11 +229,11 @@ struct jmessage_tReference : public JMessage::TReference { f32 getSelRubyCharSpace() { return mSelRubyCharSpace; } f32 getRubySize() { return mRubySize; } f32 getRubyCharSpace() { return mRubyCharSpace; } - char* getSelTextPtr(int idx) { return mSelText[idx]; } - char* getSelRubyPtr(int idx) { return mSelRuby[idx]; } - char* getTextPtr() { return mText; } - char* getTextSPtr() { return mTextS; } - char* getRubyPtr() { return mRuby; } + TEXT_SPAN getSelTextPtr(int idx) { return mSelText[idx]; } + TEXT_SPAN getSelRubyPtr(int idx) { return mSelRuby[idx]; } + TEXT_SPAN getTextPtr() { return mText; } + TEXT_SPAN getTextSPtr() { return mTextS; } + TEXT_SPAN getRubyPtr() { return mRuby; } u8 getSelectRubyFlag() { return mSelectRubyFlag; } f32 getSelTBoxWidth() { return mSelTBoxWidth; } u8 getSelectPos() { return mSelectPos; } @@ -463,7 +464,7 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor { f32 getLineLength(int); void do_strcat(char*, bool, bool, bool); void do_rubyset(void const*, u32); - void do_rubystrcat(char*, char*, f32, f32); + void do_rubystrcat(char*, TEXT_SPAN, f32, f32); void do_name1(); void do_numset(s16); void push_word(); diff --git a/include/d/d_msg_flow.h b/include/d/d_msg_flow.h index cd9a7c4e5f..233dad7170 100644 --- a/include/d/d_msg_flow.h +++ b/include/d/d_msg_flow.h @@ -2,7 +2,7 @@ #define D_MSG_D_MSG_FLOW_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" enum { NODETYPE_MESSAGE_e = 1, @@ -185,8 +185,8 @@ public: void setMsg(u32 msg) { mMsg = msg; } bool checkEndFlow() { return (u32)field_0x26 == 1; } - static queryFunc mQueryList[53]; - static eventFunc mEventList[43]; + static DUSK_GAME_DATA queryFunc mQueryList[53]; + static DUSK_GAME_DATA eventFunc mEventList[43]; private: /* 0x04 */ u8* mFlow_p; diff --git a/include/d/d_msg_object.h b/include/d/d_msg_object.h index d2ac4ecb2a..7ca53064a7 100644 --- a/include/d/d_msg_object.h +++ b/include/d/d_msg_object.h @@ -53,8 +53,8 @@ public: void demoMessageGroupLocal(); void endFlowGroupLocal(); void changeGroupLocal(s16); - bool getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, char*, - char*, char*, s16*); + bool getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, TEXT_SPAN, + TEXT_SPAN, TEXT_SPAN, s16*); bool isGetItemMessage(); bool isKanbanMessage(); bool isHowlMessage(); @@ -121,7 +121,7 @@ public: static void endFlowGroup(); static void changeGroup(s16); static bool getString(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, - char*, char*, char*, s16*); + TEXT_SPAN, TEXT_SPAN, TEXT_SPAN, s16*); static void* getMsgDtPtr(); static void setProcessID(fpc_ProcID); static msg_class* getActor(); @@ -246,12 +246,12 @@ public: static void setWord(const char* i_word); void setWordLocal(const char* i_word) { - strcpy(mWord, i_word); + SAFE_STRCPY(mWord, i_word); } static void setSelectWord(int i_no, const char* i_word); void setSelectWordLocal(int i_no, const char* i_word) { - strcpy(mSelectWord[i_no], i_word); + SAFE_STRCPY(mSelectWord[i_no], i_word); } jmessage_tSequenceProcessor* getSequenceProcessor() { return mpSeqProc; } @@ -360,7 +360,12 @@ inline void dMsgObject_demoMessageGroup() { } inline bool dMsgObject_isTalkNowCheck() { +#if TARGET_PC + dMsgObject_c* msgObject = dMsgObject_getMsgObjectClass(); + return msgObject != NULL && msgObject->getStatus() != 1; +#else return dMsgObject_getMsgObjectClass()->getStatus() == 1 ? false : true; +#endif } inline bool dMsgObject_isKillMessageFlag() { @@ -426,8 +431,8 @@ inline void dMsgObject_setTalkActor(fopAc_ac_c* actor) { } inline bool dMsgObject_getString(u32 i_msgId, J2DTextBox* i_tbox, J2DTextBox* i_rubyTbox, - JUTFont* i_font, COutFont_c* i_outFont, char* o_text, - char* o_ruby, char* o_textS, s16* param_8) { + JUTFont* i_font, COutFont_c* i_outFont, TEXT_SPAN o_text, + TEXT_SPAN o_ruby, TEXT_SPAN o_textS, s16* param_8) { return dMsgObject_getMsgObjectClass()->getString(i_msgId, i_tbox, i_rubyTbox, i_font, i_outFont, o_text, o_ruby, o_textS, param_8); } @@ -497,7 +502,12 @@ inline void dMsgObject_onMsgSend() { } inline bool dMsgObject_isFukidashiCheck() { +#if TARGET_PC + dMsgObject_c* msgObject = dMsgObject_getMsgObjectClass(); + return msgObject != NULL && msgObject->getScrnDrawPtr() != NULL; +#else return dMsgObject_getMsgObjectClass()->getScrnDrawPtr() == NULL ? false : true; +#endif } inline void* dMsgObject_getTalkHeap() { @@ -761,6 +771,6 @@ public: /* 0x35C */ dMsgObject_HowlHIO_c mHowlHIO; }; -extern dMsgObject_HIO_c g_MsgObject_HIO_c; +DUSK_GAME_EXTERN dMsgObject_HIO_c g_MsgObject_HIO_c; #endif /* D_MSG_D_MSG_OBJECT_H */ diff --git a/include/d/d_msg_scrn_3select.h b/include/d/d_msg_scrn_3select.h index 90a64ead62..1cb92e5be6 100644 --- a/include/d/d_msg_scrn_3select.h +++ b/include/d/d_msg_scrn_3select.h @@ -26,8 +26,8 @@ public: dMsgScrn3Select_c(); virtual ~dMsgScrn3Select_c(); bool isSelect(); - void setString(char*, char*, char*); - void setRubyString(char*, char*, char*); + void setString(DUSK_CONST char*, DUSK_CONST char*, DUSK_CONST char*); + void setRubyString(DUSK_CONST char*, DUSK_CONST char*, DUSK_CONST char*); void translate(f32, f32); void draw(f32, f32); void selAnimeInit(u8, u8, u8, f32, u8); @@ -49,6 +49,10 @@ public: void selectScale(); void selectTrans(); void selectAnimeTransform(int); +#if TARGET_PC + bool pointerMove(); + bool consumePointerClick(); +#endif void setOffsetX(f32 i_offsetX) { mOffsetX = i_offsetX; } bool isAnimeUpdate(int param_0) { return (field_0x114 & (u8)(1 << param_0)) ? TRUE : FALSE; } diff --git a/include/d/d_msg_scrn_base.h b/include/d/d_msg_scrn_base.h index c1b9f16166..17fd7380d3 100644 --- a/include/d/d_msg_scrn_base.h +++ b/include/d/d_msg_scrn_base.h @@ -13,8 +13,8 @@ public: dMsgScrnBase_c(); void init(); void drawOutFont(f32, f32, f32); - void setString(char*, char*); - void setRubyString(char*); + void setString(char DUSK_CONST*, char DUSK_CONST*); + void setRubyString(char DUSK_CONST*); bool isTalkNow(); virtual void draw(); @@ -22,8 +22,8 @@ public: virtual void exec() {} virtual void multiDraw(); virtual void drawSelf(); - virtual void setSelectString(char*, char*, char*) {} - virtual void setSelectRubyString(char*, char*, char*) {} + virtual void setSelectString(char DUSK_CONST*, char DUSK_CONST*, char DUSK_CONST*) {} + virtual void setSelectRubyString(char DUSK_CONST*, char DUSK_CONST*, char DUSK_CONST*) {} virtual void arwAnimeInit() {} virtual void arwAnimeMove() {} virtual void dotAnimeInit() {} diff --git a/include/d/d_msg_scrn_item.h b/include/d/d_msg_scrn_item.h index 4b0e55cbd9..865071a2af 100644 --- a/include/d/d_msg_scrn_item.h +++ b/include/d/d_msg_scrn_item.h @@ -17,8 +17,8 @@ struct dMsgScrnItem_c : public dMsgScrnBase_c { void arwAnimeMove(); void dotAnimeInit(); void dotAnimeMove(); - void setSelectString(char*, char*, char*); - void setSelectRubyString(char*, char*, char*); + void setSelectString(char DUSK_CONST*, char DUSK_CONST*, char DUSK_CONST*); + void setSelectRubyString(char DUSK_CONST*, char DUSK_CONST*, char DUSK_CONST*); bool isSelect(); void selectAnimeInit(u8, u8, f32, u8); bool selectAnimeMove(u8, u8, bool); diff --git a/include/d/d_msg_scrn_talk.h b/include/d/d_msg_scrn_talk.h index 05b187e709..1c8283ad44 100644 --- a/include/d/d_msg_scrn_talk.h +++ b/include/d/d_msg_scrn_talk.h @@ -17,8 +17,8 @@ struct dMsgScrnTalk_c : public dMsgScrnBase_c { void arwAnimeMove(); void dotAnimeInit(); void dotAnimeMove(); - void setSelectString(char*, char*, char*); - void setSelectRubyString(char*, char*, char*); + void setSelectString(char DUSK_CONST*, char DUSK_CONST*, char DUSK_CONST*); + void setSelectRubyString(char DUSK_CONST*, char DUSK_CONST*, char DUSK_CONST*); bool isSelect(); void selectAnimeInit(u8, u8, f32, u8); bool selectAnimeMove(u8, u8, bool); diff --git a/include/d/d_msg_string_base.h b/include/d/d_msg_string_base.h index 6f3a751b22..4624393f06 100644 --- a/include/d/d_msg_string_base.h +++ b/include/d/d_msg_string_base.h @@ -20,12 +20,12 @@ public: f32 getStringPageLocal(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8); u8 getPageMax(int); - f32 getMessageLocal(u32, char*); + f32 getMessageLocal(u32, TEXT_SPAN); virtual f32 getString(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8); virtual f32 getStringPage(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8); - virtual f32 getMessage(u32, char*); + virtual f32 getMessage(u32, TEXT_SPAN); virtual void resetStringLocal(J2DTextBox*); virtual void drawOutFontLocal(J2DTextBox*, f32); virtual void drawFontLocal(J2DTextBox*, u8, f32, f32, f32, f32, u32, u8); diff --git a/include/d/d_msg_unit.h b/include/d/d_msg_unit.h index 400df98f25..c48d89d0e0 100644 --- a/include/d/d_msg_unit.h +++ b/include/d/d_msg_unit.h @@ -6,14 +6,14 @@ class dMsgUnit_c { public: dMsgUnit_c(); - void setTag(int, int, char*, bool); + void setTag(int, int, TEXT_SPAN, bool); virtual ~dMsgUnit_c(); }; -extern dMsgUnit_c g_msg_unit; +DUSK_GAME_EXTERN dMsgUnit_c g_msg_unit; -inline void dMsgUnit_setTag(int param_0, int param_1, char* param_2) { +inline void dMsgUnit_setTag(int param_0, int param_1, TEXT_SPAN param_2) { g_msg_unit.setTag(param_0, param_1, param_2, true); } diff --git a/include/d/d_name.h b/include/d/d_name.h index 3ac6592457..68a4930baf 100644 --- a/include/d/d_name.h +++ b/include/d/d_name.h @@ -12,6 +12,34 @@ class J2DTextBox; class JUTFont; class STControl; +#if TARGET_PC +struct PaneCache { + u64 tag; + f32 origTransX; + f32 origTransY; + bool cached; +}; + +static PaneCache l_tagName[] = { + {MULTI_CHAR('m_00_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_3'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m_01_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_2'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m03_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_1'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m_05_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_0'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m_07_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_4'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m_09_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_3'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m_10_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_2'), 0.0f, 0.0f, false}, + {MULTI_CHAR('m12_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_0'), 0.0f, 0.0f, false}, +}; + +static PaneCache l_nameTagName[] = { + {MULTI_CHAR('name_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_07'), 0.0f, 0.0f, false}, +}; + +static PaneCache l_nameCurTagName[] = { + {MULTI_CHAR('s__n_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_07'), 0.0f, 0.0f, false}, +}; +#endif + class dNm_HIO_c { public: dNm_HIO_c(); @@ -127,7 +155,7 @@ public: u8 isInputEnd() { return mIsInputEnd; } char* getInputStrPtr() { return mInputStr; } void hideIcon() { mSelIcon->setAlphaRate(0.0f); } - void setNextNameStr(char* i_name) { strcpy(mNextNameStr,i_name); } + void setNextNameStr(char* i_name) { SAFE_STRCPY(mNextNameStr,i_name); } void draw() { _draw(); } private: @@ -140,9 +168,9 @@ private: /* 0x02C */ J2DAnmTextureSRTKey* mCursorTexKey; /* 0x030 */ int mCurTexAnmF; /* 0x034 */ CPaneMgrAlpha* mNameCursor[8]; - /* 0x054 */ char* mNameText[8]; + /* 0x054 */ TEXT_SPAN mNameText[8]; /* 0x074 */ CPaneMgr* mMojiIcon[65]; - /* 0x178 */ char* mMojiText[65]; + /* 0x178 */ TEXT_SPAN mMojiText[65]; /* 0x27C */ J2DPane* mMojiPane; /* 0x280 */ J2DPane* mMenuPane; /* 0x284 */ CPaneMgr* mMenuIcon[4]; diff --git a/include/d/d_particle.h b/include/d/d_particle.h index c9db174fcd..7ae4d12c07 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -116,10 +116,10 @@ public: } static dPa_modelEcallBack& getEcallback() { return mEcallback; } - static dPa_modelEcallBack mEcallback; + static DUSK_GAME_DATA dPa_modelEcallBack mEcallback; - static dPa_modelPcallBack mPcallback; - static model_c* mModel; + static DUSK_GAME_DATA dPa_modelPcallBack mPcallback; + static DUSK_GAME_DATA model_c* mModel; #if DEBUG static u8 mNum; #endif @@ -495,20 +495,20 @@ public: return &mWaterBubblePcallBack; } - static dPa_selectTexEcallBack mTsubo[8]; - static dPa_setColorEcallBack mLifeBall[3]; - static Mtx mWindViewMatrix; - static JPAEmitterManager* mEmitterMng; - static dPa_wbPcallBack_c mWaterBubblePcallBack; - static dPa_fsenthPcallBack mFsenthPcallBack; - static dPa_light8EcallBack mLight8EcallBack; - static dPa_light8PcallBack mLight8PcallBack; - static dPa_gen_b_light8EcallBack m_b_Light8EcallBack; - static dPa_gen_b_light8PcallBack m_b_Light8PcallBack; - static dPa_gen_d_light8EcallBack m_d_Light8EcallBack; - static dPa_gen_d_light8PcallBack m_d_Light8PcallBack; - static dPa_particleTracePcallBack_c mParticleTracePCB; - static u8 mStatus; + static DUSK_GAME_DATA dPa_selectTexEcallBack mTsubo[8]; + static DUSK_GAME_DATA dPa_setColorEcallBack mLifeBall[3]; + static DUSK_GAME_DATA Mtx mWindViewMatrix; + static DUSK_GAME_DATA JPAEmitterManager* mEmitterMng; + static DUSK_GAME_DATA dPa_wbPcallBack_c mWaterBubblePcallBack; + static DUSK_GAME_DATA dPa_fsenthPcallBack mFsenthPcallBack; + static DUSK_GAME_DATA dPa_light8EcallBack mLight8EcallBack; + static DUSK_GAME_DATA dPa_light8PcallBack mLight8PcallBack; + static DUSK_GAME_DATA dPa_gen_b_light8EcallBack m_b_Light8EcallBack; + static DUSK_GAME_DATA dPa_gen_b_light8PcallBack m_b_Light8PcallBack; + static DUSK_GAME_DATA dPa_gen_d_light8EcallBack m_d_Light8EcallBack; + static DUSK_GAME_DATA dPa_gen_d_light8PcallBack m_d_Light8PcallBack; + static DUSK_GAME_DATA dPa_particleTracePcallBack_c mParticleTracePCB; + static DUSK_GAME_DATA u8 mStatus; private: /* 0x000 */ JKRSolidHeap* mHeap; @@ -521,13 +521,13 @@ private: /* 0x019 */ u8 field_0x19; /* 0x01A */ u8 field_0x1a; /* 0x01B */ u8 field_0x1b; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x01C */ dPa_simpleEcallBack field_0x1c[48]; #else /* 0x01C */ dPa_simpleEcallBack field_0x1c[25]; #endif /* 0x210 */ level_c field_0x210; - #if DEBUG + #if PARTIAL_DEBUG || DEBUG u8 mSceneCount; #endif }; diff --git a/include/d/d_particle_copoly.h b/include/d/d_particle_copoly.h index c50b71387e..7bc8621546 100644 --- a/include/d/d_particle_copoly.h +++ b/include/d/d_particle_copoly.h @@ -78,8 +78,8 @@ public: return (this->*m_emitterTwoData[param_0])(param_1, param_2); } - static const effTypeFunc m_typeTwoData[]; - static const emitterFunc m_emitterTwoData[]; + static DUSK_GAME_DATA const effTypeFunc m_typeTwoData[]; + static DUSK_GAME_DATA const emitterFunc m_emitterTwoData[]; /* 0x38 */ u32 mLeftEmitter[2][4]; /* 0x58 */ u32 mRightEmitter[2][4]; @@ -117,8 +117,8 @@ public: return (this->*m_emitterFourData[param_0])(param_1, param_2); } - static const effTypeFunc m_typeFourData[]; - static const emitterFunc m_emitterFourData[]; + static DUSK_GAME_DATA const effTypeFunc m_typeFourData[]; + static DUSK_GAME_DATA const emitterFunc m_emitterFourData[]; /* 0x80 */ u32 mBackLeftEmitter[2][4]; /* 0xA0 */ u32 mBackRightEmitter[2][4]; diff --git a/include/d/d_particle_name.h b/include/d/d_particle_name.h index 72a3332558..b5df5421a7 100644 --- a/include/d/d_particle_name.h +++ b/include/d/d_particle_name.h @@ -8,11 +8,11 @@ #define dPa_RM(id) (0x8000 | (id)) struct dPa_name { - static char* getName(u32 i_id); + static DUSK_CONST char* getName(u32 i_id); - static u16 j_o_id[5]; - static u16 s_o_id[14]; - static char* jpaName[]; + static DUSK_GAME_DATA u16 j_o_id[5]; + static DUSK_GAME_DATA u16 s_o_id[14]; + static DUSK_GAME_DATA DUSK_CONST char* jpaName[]; }; // enum names made up based on debug strings diff --git a/include/d/d_resorce.h b/include/d/d_resorce.h index 31d028a082..b70d2d5452 100644 --- a/include/d/d_resorce.h +++ b/include/d/d_resorce.h @@ -59,7 +59,7 @@ private: /* 0x18 */ JKRHeap* heap; /* 0x1C */ JKRSolidHeap* mDataHeap; /* 0x20 */ void** mRes; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x24 */ int mSize; #endif }; // Size: 0x24 diff --git a/include/d/d_s_play.h b/include/d/d_s_play.h index 45b60220b0..936f29b277 100644 --- a/include/d/d_s_play.h +++ b/include/d/d_s_play.h @@ -83,8 +83,8 @@ public: #endif static void setPauseTimer(s8 time) { nextPauseTimer = time; } - static s8 pauseTimer; - static s8 nextPauseTimer; + static DUSK_GAME_DATA s8 pauseTimer; + static DUSK_GAME_DATA s8 nextPauseTimer; #if DEBUG void onDebugPause() { @@ -104,8 +104,8 @@ public: /* 0x1D4 */ u8 field_0x1d4; }; -extern dScnPly_env_HIO_c g_envHIO; -extern dScnPly_reg_HIO_c g_regHIO; +DUSK_GAME_EXTERN dScnPly_env_HIO_c g_envHIO; +DUSK_GAME_EXTERN dScnPly_reg_HIO_c g_regHIO; #if DEBUG extern dScnPly_preset_HIO_c g_presetHIO; diff --git a/include/d/d_save.h b/include/d/d_save.h index e2719e0a98..06458890e4 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -8,7 +8,7 @@ #include "d/d_item_data.h" #include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JHostIO/JORReflexible.h" -#include "dusk/endian.h" +#include "helpers/endian.h" static const int DEFAULT_SELECT_ITEM_INDEX = 0; static const int MAX_SELECT_ITEM = 4; @@ -488,21 +488,25 @@ public: } #if TARGET_PC u16 getDeathCount() const { return mDeathCount; } -#endif + TEXT_SPAN getPlayerName() const { return const_cast(mPlayerName); } +#else char* getPlayerName() const { return const_cast(mPlayerName); } +#endif void setPlayerName(const char* i_name) { #if AVOID_UB - strncpy(mPlayerName, i_name, sizeof(mPlayerName) - 1); - mPlayerName[sizeof(mPlayerName) - 1] = '\0'; + SafeStringCopyTruncate(mPlayerName, i_name); #else strcpy(mPlayerName, i_name); #endif } +#if TARGET_PC + TEXT_SPAN getHorseName() const { return const_cast(mHorseName); } +#else char* getHorseName() const { return const_cast(mHorseName); } +#endif void setHorseName(const char* i_name) { #if AVOID_UB - strncpy(mHorseName, i_name, sizeof(mHorseName) - 1); - mHorseName[sizeof(mHorseName) - 1] = '\0'; + SafeStringCopyTruncate(mHorseName, i_name); #else strcpy(mHorseName, i_name); #endif @@ -1004,7 +1008,7 @@ public: static const int ZONE_MAX = 0x20; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x000 */ u8 unk_0x0; /* 0x001 */ char unk_0x1; /* 0x000 */ u8 unk_0x2[0x48 - 0x2]; @@ -1025,6 +1029,9 @@ public: /* 0xF30 */ s64 mSaveTotalTime; #if DEBUG /* 0xF80 */ flagFile_c mFlagFile; +#elif PARTIAL_DEBUG + // flagFile_c's ctor/virtuals are only defined under #if DEBUG (d_save.cpp) + alignas(flagFile_c) u8 mFlagFile[sizeof(flagFile_c)]; #endif }; // Size: 0xF38 @@ -1042,7 +1049,7 @@ public: #else u16 #endif - static saveBitLabels[822]; + static DUSK_GAME_DATA saveBitLabels[822]; }; class dSv_event_tmp_flag_c { @@ -1051,7 +1058,7 @@ public: #include "d/d_save_temp_bit_labels.inc" }; - static u16 const tempBitLabels[185]; + static DUSK_GAME_DATA u16 const tempBitLabels[185]; }; #endif /* D_SAVE_D_SAVE_H */ diff --git a/include/d/d_save_HIO.h b/include/d/d_save_HIO.h index e149f7fcb9..2ee6e4570b 100644 --- a/include/d/d_save_HIO.h +++ b/include/d/d_save_HIO.h @@ -229,6 +229,6 @@ public: STATIC_ASSERT(sizeof(dSvBit_HIO_c) == 0x4A0); -extern dSvBit_HIO_c g_save_bit_HIO; +DUSK_GAME_EXTERN dSvBit_HIO_c g_save_bit_HIO; #endif /* D_SAVE_D_SAVE_HIO_H */ diff --git a/include/d/d_select_cursor.h b/include/d/d_select_cursor.h index 1ca226611b..e98db19731 100644 --- a/include/d/d_select_cursor.h +++ b/include/d/d_select_cursor.h @@ -51,7 +51,7 @@ public: f32 getPositionX() const { return mPositionX; } f32 getPositionY() const { return mPositionY; } - void refreshAspectScale(); + void refreshAspectScale(f32 param_0); #endif void onUpdateFlag() { mUpdateFlag = true; } diff --git a/include/d/d_shop_system.h b/include/d/d_shop_system.h index 02f76074dd..f733a2979f 100644 --- a/include/d/d_shop_system.h +++ b/include/d/d_shop_system.h @@ -31,7 +31,7 @@ public: dShopSystem_c(daNpcT_faceMotionAnmData_c const* param_1, daNpcT_motionAnmData_c const* param_2, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_3, int param_4, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* param_5, int param_6, - daNpcT_evtData_c const* param_7, char** param_8) + daNpcT_evtData_c const* param_7, char DUSK_CONST* DUSK_CONST* param_8) : daNpcT_c(param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8) { OS_REPORT("|%06d:%x|dShopSystem_c -> コンストラクト\n", g_Counter.mCounter0, this); initShopSystem(); diff --git a/include/d/d_stage.h b/include/d/d_stage.h index bd8e7d5728..53fbbac0d9 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -4,7 +4,7 @@ #include "SSystem/SComponent/c_lib.h" #include "d/d_kankyo.h" #include "d/d_kankyo_data.h" -#include "dusk/offset_ptr.h" +#include "helpers/offset_ptr.h" #include "f_op/f_op_actor_mng.h" #include "global.h" #include "os_report.h" @@ -538,7 +538,7 @@ public: /* vt[86] */ virtual stage_tgsc_class* getDrTg(void) const = 0; /* vt[87] */ virtual void setDoor(stage_tgsc_class*) = 0; /* vt[88] */ virtual stage_tgsc_class* getDoor(void) const = 0; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG virtual void setUnit(void*) = 0; virtual void* getUnit() = 0; #endif @@ -796,7 +796,7 @@ public: virtual stage_tgsc_class* getDrTg(void) const { return mDrTg; } virtual void setDoor(stage_tgsc_class* i_Door) { mDoor = i_Door; } virtual stage_tgsc_class* getDoor(void) const { return mDoor; } -#if DEBUG +#if PARTIAL_DEBUG || DEBUG virtual void setUnit(void* i_Unit) { mUnit = i_Unit; } virtual void* getUnit() { return mUnit; } #endif @@ -845,7 +845,7 @@ public: /* 0x54 */ stage_tgsc_class* mDrTg; /* 0x58 */ stage_tgsc_class* mDoor; /* 0x5C */ dStage_FloorInfo_c* mFloorInfo; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x60 */ void* mUnit; #endif /* 0x60 */ u16 mPlayerNum; @@ -990,7 +990,7 @@ public: /* vt[86] */ virtual stage_tgsc_class* getDrTg(void) const { return mDrTg; } /* vt[87] */ virtual void setDoor(stage_tgsc_class* i_Door) { mDoor = i_Door; } /* vt[88] */ virtual stage_tgsc_class* getDoor(void) const { return mDoor; } -#if DEBUG +#if PARTIAL_DEBUG || DEBUG virtual void setUnit(void* i_Unit) { UNUSED(i_Unit); OSReport("stage non unit list data !!\n"); @@ -1225,7 +1225,7 @@ public: #endif } static JKRExpHeap* getMemoryBlockHeap(int i_no) { return mMemoryBlock[i_no]; } - static char* getDemoArcName() { return mDemoArcName; } + static TEXT_SPAN getDemoArcName() { return mDemoArcName; } static void offNoChangeRoom() { mNoChangeRoom = false; } static void onNoChangeRoom() { mNoChangeRoom = true; } @@ -1237,20 +1237,20 @@ public: static const int MEMORY_BLOCK_MAX = 19; - static JKRExpHeap* mMemoryBlock[MEMORY_BLOCK_MAX]; - static char mArcBank[32][10]; - static dStage_roomStatus_c mStatus[0x40]; - static char mDemoArcName[10]; - static fpc_ProcID mProcID; - static dStage_bankName* mArcBankName; - static dStage_bankData* mArcBankData; - static roomDzs_c m_roomDzs; - static s8 mStayNo; - static s8 mOldStayNo; - static s8 mNextStayNo; - static u8 m_time_pass; - static u8 mNoChangeRoom; - static s8 mRoomReadId; + static DUSK_GAME_DATA JKRExpHeap* mMemoryBlock[MEMORY_BLOCK_MAX]; + static DUSK_GAME_DATA char mArcBank[32][10]; + static DUSK_GAME_DATA dStage_roomStatus_c mStatus[0x40]; + static DUSK_GAME_DATA char mDemoArcName[10]; + static DUSK_GAME_DATA fpc_ProcID mProcID; + static DUSK_GAME_DATA dStage_bankName* mArcBankName; + static DUSK_GAME_DATA dStage_bankData* mArcBankData; + static DUSK_GAME_DATA roomDzs_c m_roomDzs; + static DUSK_GAME_DATA s8 mStayNo; + static DUSK_GAME_DATA s8 mOldStayNo; + static DUSK_GAME_DATA s8 mNextStayNo; + static DUSK_GAME_DATA u8 m_time_pass; + static DUSK_GAME_DATA u8 mNoChangeRoom; + static DUSK_GAME_DATA s8 mRoomReadId; #if DEBUG static void onNoArcBank() { diff --git a/include/d/d_tresure.h b/include/d/d_tresure.h index 236e2690c6..e043dd94fb 100644 --- a/include/d/d_tresure.h +++ b/include/d/d_tresure.h @@ -2,7 +2,7 @@ #define D_D_TRESURE_H #include -#include "dusk/offset_ptr.h" +#include "helpers/offset_ptr.h" class dTres_c { public: @@ -113,10 +113,10 @@ public: return mTypeGroupData; } - static u8 const typeToTypeGroup[17][2]; - static type_group_list mTypeGroupListAll[17]; - static typeGroupData_c* mTypeGroupData; - static u16 mNum; + static DUSK_GAME_DATA u8 const typeToTypeGroup[17][2]; + static DUSK_GAME_DATA type_group_list mTypeGroupListAll[17]; + static DUSK_GAME_DATA typeGroupData_c* mTypeGroupData; + static DUSK_GAME_DATA u16 mNum; static void setNpcYkmPosition(int param_1, Vec* param_2) { setPosition(param_1, 13, param_2, -1); diff --git a/include/d/d_vibration.h b/include/d/d_vibration.h index 4018acea50..b61d0099b4 100644 --- a/include/d/d_vibration.h +++ b/include/d/d_vibration.h @@ -89,14 +89,17 @@ public: int testShake(); #endif - static const vib_pattern MS_patt[VIBMODE_S_MAX]; - static const vib_pattern CS_patt[VIBMODE_S_MAX]; - static const vib_pattern MQ_patt[VIBMODE_Q_MAX]; - static const vib_pattern CQ_patt[VIBMODE_Q_MAX]; + static DUSK_GAME_DATA const vib_pattern MS_patt[VIBMODE_S_MAX]; + static DUSK_GAME_DATA const vib_pattern CS_patt[VIBMODE_S_MAX]; + static DUSK_GAME_DATA const vib_pattern MQ_patt[VIBMODE_Q_MAX]; + static DUSK_GAME_DATA const vib_pattern CQ_patt[VIBMODE_Q_MAX]; private: #if DEBUG /* 0x00 */ dVibTest_c mVibTest; +#elif PARTIAL_DEBUG + // dVibTest_c's ctor/virtuals are only defined under #if DEBUG (d_vibration.cpp) + alignas(dVibTest_c) u8 mVibTest[sizeof(dVibTest_c)]; #endif class { @@ -130,7 +133,7 @@ private: /* 0x8C */ s32 mMode; }; // Size: 0x90 -extern const char* shock_names[VIBMODE_S_MAX]; -extern const char* quake_names[VIBMODE_Q_MAX]; +DUSK_GAME_EXTERN const char* shock_names[VIBMODE_S_MAX]; +DUSK_GAME_EXTERN const char* quake_names[VIBMODE_Q_MAX]; #endif /* D_D_VIBRATION_H */ diff --git a/include/d/dolzel.h b/include/d/dolzel.h index d51eb22372..d4f53c842d 100644 --- a/include/d/dolzel.h +++ b/include/d/dolzel.h @@ -8,7 +8,7 @@ #endif #ifndef __MWERKS__ -#include "dusk/math.h" +#include "helpers/math.h" #endif #endif // dolzel.h diff --git a/include/dusk/gamepad_color.h b/include/dusk/gamepad_color.h deleted file mode 100644 index c7cfc1e716..0000000000 --- a/include/dusk/gamepad_color.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#ifndef GAMEPAD_COLOR_H -#define GAMEPAD_COLOR_H - -void handleGamepadColor(); - -#endif \ No newline at end of file diff --git a/include/dusk/imgui.h b/include/dusk/imgui.h deleted file mode 100644 index 5c761fb026..0000000000 --- a/include/dusk/imgui.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _SRC_IMGUI_H_ -#define _SRC_IMGUI_H_ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - void imgui_main(const AuroraInfo* info); - void frame_limiter(); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/dusk/string.hpp b/include/dusk/string.hpp deleted file mode 100644 index 7de1b1ad75..0000000000 --- a/include/dusk/string.hpp +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef DUSK_STRING_HPP -#define DUSK_STRING_HPP - -#include "global.h" -#include -#include - -namespace dusk { - -inline void strncpyProxy(char* dst, const char* src, size_t count) { -#if _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4996) -#endif - strncpy(dst, src, count); -#if _MSC_VER -#pragma warning(pop) -#endif -} - -/** - * Copy a string to a fixed-size array. - * Truncates if the destination is not large enough, always inserts a null terminator (padding the remainder of the buffer with zeroes.) - */ -template -void SafeStringCopyTruncate(char (&buffer)[BufSize], const char* src) { - static_assert(BufSize > 0, "Target buffer cannot be size zero"); - - if (buffer == src) { - CRASH("Cannot copy string to same buffer"); - } - - strncpyProxy(buffer, src, BufSize); - buffer[BufSize - 1] = 0; -} - -/** - * Copy a string to a fixed-size array. - * Aborts if the destination is not large enough, always inserts a null terminator (padding the remainder of the buffer with zeroes.) - */ -template -void SafeStringCopy(char (&buffer)[BufSize], const char* src) { - static_assert(BufSize > 0, "Target buffer cannot be size zero"); - if (buffer == src) { - CRASH("Cannot copy string to same buffer"); - } - - if (strlen(src) > BufSize - 1) { - CRASH("Destination buffer too small!"); - } - - strncpyProxy(buffer, src, BufSize); - buffer[BufSize - 1] = 0; -} - -} - -#endif // DUSK_STRING_HPP diff --git a/include/f_ap/f_ap_game.h b/include/f_ap/f_ap_game.h index fca2e70705..aa2c9dbd9d 100644 --- a/include/f_ap/f_ap_game.h +++ b/include/f_ap/f_ap_game.h @@ -75,7 +75,7 @@ public: static u8 mCaptureMagnification; - static u8 mCaptureScreenDivH; + static DUSK_GAME_DATA u8 mCaptureScreenDivH; static u8 mCaptureScreenDivV; static u8 mPackArchiveMode; @@ -115,7 +115,7 @@ public: /* 0x3E */ u8 mBackgroundAlpha; }; // Size: 0x40 -extern fapGm_HIO_c g_HIO; +DUSK_GAME_EXTERN fapGm_HIO_c g_HIO; inline void fapGmHIO_offMenu() { g_HIO.mDisplayPrint &= (u8)~2; diff --git a/include/f_op/f_op_actor.h b/include/f_op/f_op_actor.h index b8918eae57..1dce990866 100644 --- a/include/f_op/f_op_actor.h +++ b/include/f_op/f_op_actor.h @@ -15,7 +15,7 @@ struct actor_method_class { }; struct actor_process_profile_definition { /* 0x00 */ leaf_process_profile_definition base; - /* 0x24 */ actor_method_class* sub_method; + /* 0x24 */ DUSK_CONST actor_method_class* sub_method; /* 0x28 */ u32 status; /* 0x2C */ u8 group; /* 0x2D */ u8 cullType; @@ -202,7 +202,7 @@ class dEvt_info_c { public: dEvt_info_c(); virtual ~dEvt_info_c() {} - void setEventName(char*); + void setEventName(DUSK_CONST char*); char* getEventName(); void beforeProc(); void onCondition(u16 cond) { mCondition |= cond; } @@ -218,12 +218,12 @@ public: void setEventId(s16 id) { mEventId = id; } void setCondition(u16 condition) { mCondition = condition; } u16 getCondition() { return mCondition; } - void setArchiveName(char* name) { mArchiveName = name; } + void setArchiveName(DUSK_CONST char* name) { mArchiveName = name; } u8 getMapToolId() { return mMapToolId; } s16 getEventId() { return mEventId; } s16 getIdx() { return (s8)mIndex; } void setIdx(u8 i_idx) { mIndex = i_idx; } - char* getArchiveName() { return mArchiveName; } + DUSK_CONST char* getArchiveName() { return mArchiveName; } BOOL chkCondition(u16 condition) { return (mCondition & condition) == condition; } void suspendProc(void* actor) { @@ -237,7 +237,7 @@ public: /* 0x08 */ s16 mEventId; /* 0x0A */ u8 mMapToolId; /* 0x0B */ u8 mIndex; - /* 0x0C */ char* mArchiveName; + /* 0x0C */ DUSK_CONST char* mArchiveName; /* 0x10 */ u8 field_0x10; /* 0x14 */ void (*field_0x14)(void*); }; // Size = 0x18 @@ -279,7 +279,7 @@ public: /* 0x0C0 */ int actor_type; /* 0x0C4 */ create_tag_class actor_tag; /* 0x0D8 */ create_tag_class draw_tag; - /* 0x0EC */ profile_method_class* sub_method; + /* 0x0EC */ profile_method_class DUSK_CONST* sub_method; /* 0x0F0 */ JKRSolidHeap* heap; /* 0x0F4 */ dEvt_info_c eventInfo; /* 0x10C */ dKy_tevstr_c tevStr; @@ -332,7 +332,7 @@ public: static u32 getStopStatus() { return stopStatus; } static void setStopStatus(u32 status) { stopStatus = status; } - static u32 stopStatus; + static DUSK_GAME_DATA u32 stopStatus; }; // Size: 0x568 STATIC_ASSERT(sizeof(fopAc_ac_c) == 0x568); @@ -431,6 +431,6 @@ public: BOOL fopAc_IsActor(void* i_actor); -extern actor_method_class g_fopAc_Method; +DUSK_GAME_EXTERN actor_method_class g_fopAc_Method; #endif diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index 76a9f8517c..6461c823d1 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -12,7 +12,7 @@ #include "f_pc/f_pc_manager.h" #include "m_Do/m_Do_hostIO.h" #include "SSystem/SComponent/c_phase.h" -#include "dusk/endian_ssystem.h" +#include "helpers/endian_ssystem.h" #if !__MWERKS__ // mwerks compiler makes value initialization act like default initialization so we need @@ -50,14 +50,14 @@ class cM3dGPla; s8 dComIfGp_getReverb(int roomNo); namespace fopAcM { -extern u8 HeapAdjustEntry; -extern u8 HeapAdjustUnk; -extern u8 HeapAdjustVerbose; -extern u8 HeapAdjustQuiet; -extern u8 HeapDummyCreate; -extern u8 HeapDummyCheck; -extern u8 HeapSkipMargin; -extern int HeapAdjustMargin; +DUSK_GAME_EXTERN u8 HeapAdjustEntry; +DUSK_GAME_EXTERN u8 HeapAdjustUnk; +DUSK_GAME_EXTERN u8 HeapAdjustVerbose; +DUSK_GAME_EXTERN u8 HeapAdjustQuiet; +DUSK_GAME_EXTERN u8 HeapDummyCreate; +DUSK_GAME_EXTERN u8 HeapDummyCheck; +DUSK_GAME_EXTERN u8 HeapSkipMargin; +DUSK_GAME_EXTERN int HeapAdjustMargin; } // namespace fopAcM struct fopAcM_prmBase_class { @@ -826,8 +826,8 @@ BOOL fopAcM_getNameString(const fopAc_ac_c*, char*); inline void fopAcM_SetStatusMap(fopAc_ac_c*, u32) {} -extern cull_box l_cullSizeBox[fopAc_CULLBOX_MAX_e]; -extern cull_sphere l_cullSizeSphere[fopAc_CULLSPHERE_MAX_e]; +DUSK_GAME_EXTERN cull_box l_cullSizeBox[fopAc_CULLBOX_MAX_e]; +DUSK_GAME_EXTERN cull_sphere l_cullSizeSphere[fopAc_CULLSPHERE_MAX_e]; class fopAcM_lc_c { public: @@ -854,7 +854,7 @@ public: return cBgW_CheckBGround(poly.mNormal.y); } - static dBgS_ObjLinChk mLineCheck; + static DUSK_GAME_DATA dBgS_ObjLinChk mLineCheck; }; class dBgS_RoofChk; @@ -864,16 +864,16 @@ public: static f32 getRoofY() { return mRoofY; } static bool roofCheck(const cXyz*); - static dBgS_ObjRoofChk mRoofCheck; - static f32 mRoofY; + static DUSK_GAME_DATA dBgS_ObjRoofChk mRoofCheck; + static DUSK_GAME_DATA f32 mRoofY; }; class dBgS_GndChk; class fopAcM_gc_c { public: static bool gndCheck(const cXyz*); - static dBgS_ObjGndChk mGndCheck; - static f32 mGroundY; + static DUSK_GAME_DATA dBgS_ObjGndChk mGndCheck; + static DUSK_GAME_DATA f32 mGroundY; static bool getTriPla(cM3dGPla* i_plane) { return dComIfG_Bgsp().GetTriPla(mGndCheck, i_plane); @@ -900,8 +900,8 @@ public: static int getPolyAtt0() { return dComIfG_Bgsp().GetPolyAtt0(mWaterCheck); } static bool waterCheck(const cXyz*); - static dBgS_WtrChk mWaterCheck; - static f32 mWaterY; + static DUSK_GAME_DATA dBgS_WtrChk mWaterCheck; + static DUSK_GAME_DATA f32 mWaterY; }; #endif diff --git a/include/f_op/f_op_actor_tag.h b/include/f_op/f_op_actor_tag.h index a354178a8b..dfad5b5b83 100644 --- a/include/f_op/f_op_actor_tag.h +++ b/include/f_op/f_op_actor_tag.h @@ -7,6 +7,6 @@ void fopAcTg_ActorQTo(create_tag_class* i_createTag); int fopAcTg_Init(create_tag_class* i_createTag, void* i_data); int fopAcTg_ToActorQ(create_tag_class* i_createTag); -extern node_list_class g_fopAcTg_Queue; +DUSK_GAME_EXTERN node_list_class g_fopAcTg_Queue; #endif diff --git a/include/f_op/f_op_camera.h b/include/f_op/f_op_camera.h index 584bff29d4..30bcd3fe60 100644 --- a/include/f_op/f_op_camera.h +++ b/include/f_op/f_op_camera.h @@ -15,6 +15,6 @@ static s32 fopCam_Draw(camera_class* i_this); static int fopCam_Execute(camera_class* i_this); int fopCam_IsDelete(camera_class* i_this); -extern leafdraw_method_class g_fopCam_Method; +DUSK_GAME_EXTERN leafdraw_method_class g_fopCam_Method; #endif diff --git a/include/f_op/f_op_draw_tag.h b/include/f_op/f_op_draw_tag.h index 317cad1baf..1071616988 100644 --- a/include/f_op/f_op_draw_tag.h +++ b/include/f_op/f_op_draw_tag.h @@ -5,7 +5,7 @@ typedef struct create_tag_class create_tag_class; -extern node_lists_tree_class g_fopDwTg_Queue; +DUSK_GAME_EXTERN node_lists_tree_class g_fopDwTg_Queue; void fopDwTg_DrawQTo(create_tag_class* i_createTag); void fopDwTg_CreateQueue(); diff --git a/include/f_op/f_op_kankyo.h b/include/f_op/f_op_kankyo.h index 7741d6c09d..75833fe5ad 100644 --- a/include/f_op/f_op_kankyo.h +++ b/include/f_op/f_op_kankyo.h @@ -21,6 +21,6 @@ struct kankyo_process_profile_definition { BOOL fopKy_IsKankyo(void* i_this); -extern leafdraw_method_class g_fopKy_Method; +DUSK_GAME_EXTERN leafdraw_method_class g_fopKy_Method; #endif /* F_OP_F_OP_KANKYO_H */ diff --git a/include/f_op/f_op_msg.h b/include/f_op/f_op_msg.h index 72a57b594f..21694f0af1 100644 --- a/include/f_op/f_op_msg.h +++ b/include/f_op/f_op_msg.h @@ -36,7 +36,7 @@ struct msg_class { /* 0xFA */ u8 select_idx; }; // Size: 0xFC -extern leafdraw_method_class g_fopMsg_Method; +DUSK_GAME_EXTERN leafdraw_method_class g_fopMsg_Method; namespace fopMsg { extern u8 MemCheck; diff --git a/include/f_op/f_op_msg_mng.h b/include/f_op/f_op_msg_mng.h index 9bb8bc0ff3..330347fc18 100644 --- a/include/f_op/f_op_msg_mng.h +++ b/include/f_op/f_op_msg_mng.h @@ -50,7 +50,7 @@ fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_talkActor, u32 param_2 fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, u32 param_1); fpc_ProcID fopMsgM_messageSetDemo(u32 i_msgidx); msg_class* fopMsgM_SearchByID(fpc_ProcID i_id); -char* fopMsgM_messageGet(char* i_stringBuf, u32 i_msgId); +TEXT_SPAN fopMsgM_messageGet(TEXT_SPAN i_stringBuf, u32 i_msgId); fpc_ProcID fop_Timer_create(s16 i_procName, u8 i_mode, u32 i_limitMs, u8 i_type, u8 param_4, f32 param_5, f32 param_6, f32 param_7, f32 param_8, fopMsgCreateFunc i_createFunc); diff --git a/include/f_op/f_op_overlap.h b/include/f_op/f_op_overlap.h index c639ff38e0..275b86fc40 100644 --- a/include/f_op/f_op_overlap.h +++ b/include/f_op/f_op_overlap.h @@ -18,6 +18,6 @@ struct overlap_process_profile_definition { static s32 fopOvlp_Draw(void* param_1); -extern leafdraw_method_class g_fopOvlp_Method; +DUSK_GAME_EXTERN leafdraw_method_class g_fopOvlp_Method; #endif diff --git a/include/f_op/f_op_scene.h b/include/f_op/f_op_scene.h index 0e736093f1..b7e182e890 100644 --- a/include/f_op/f_op_scene.h +++ b/include/f_op/f_op_scene.h @@ -24,6 +24,6 @@ public: /* 0x1B0 */ scene_tag_class scene_tag; }; -extern leafdraw_method_class g_fopScn_Method; +DUSK_GAME_EXTERN leafdraw_method_class g_fopScn_Method; #endif diff --git a/include/f_op/f_op_scene_tag.h b/include/f_op/f_op_scene_tag.h index ad26ab3564..f4bb4ebad6 100644 --- a/include/f_op/f_op_scene_tag.h +++ b/include/f_op/f_op_scene_tag.h @@ -12,6 +12,6 @@ void fopScnTg_QueueTo(scene_tag_class* i_sceneTag); void fopScnTg_ToQueue(scene_tag_class* i_sceneTag); void fopScnTg_Init(scene_tag_class* i_sceneTag, void* i_data); -extern node_list_class g_fopScnTg_SceneList; +DUSK_GAME_EXTERN node_list_class g_fopScnTg_SceneList; #endif diff --git a/include/f_op/f_op_view.h b/include/f_op/f_op_view.h index a605923b2f..62c135fb68 100644 --- a/include/f_op/f_op_view.h +++ b/include/f_op/f_op_view.h @@ -56,6 +56,6 @@ struct view_class { /* 0x1E0 */ Mtx viewMtxNoTrans; }; -extern leafdraw_method_class g_fopVw_Method; +DUSK_GAME_EXTERN leafdraw_method_class g_fopVw_Method; #endif diff --git a/include/f_pc/f_pc_base.h b/include/f_pc/f_pc_base.h index 4910b1e86a..63c629e624 100644 --- a/include/f_pc/f_pc_base.h +++ b/include/f_pc/f_pc_base.h @@ -33,7 +33,7 @@ typedef struct base_process_class { /* 0x34 */ line_tag line_tag_; /* 0x4C */ delete_tag_class delete_tag; /* 0x68 */ process_priority_class priority; - /* 0xA8 */ process_method_class* methods; + /* 0xA8 */ process_method_class DUSK_CONST* methods; /* 0xAC */ void* append; /* 0xB0 */ u32 parameters; /* 0xB4 */ int subtype; @@ -57,6 +57,6 @@ int fpcBs_Delete(base_process_class* i_proc); base_process_class* fpcBs_Create(s16 i_profname, fpc_ProcID i_procID, void* i_append); int fpcBs_SubCreate(base_process_class* i_proc); -extern int g_fpcBs_type; +DUSK_GAME_EXTERN int g_fpcBs_type; #endif diff --git a/include/f_pc/f_pc_create_tag.h b/include/f_pc/f_pc_create_tag.h index 45b1f2ea8b..4706b3862a 100644 --- a/include/f_pc/f_pc_create_tag.h +++ b/include/f_pc/f_pc_create_tag.h @@ -13,6 +13,6 @@ void fpcCtTg_ToCreateQ(create_tag* i_createTag); void fpcCtTg_CreateQTo(create_tag* i_createTag); int fpcCtTg_Init(create_tag* i_createTag, void* i_data); -extern node_list_class g_fpcCtTg_Queue; +DUSK_GAME_EXTERN node_list_class g_fpcCtTg_Queue; #endif diff --git a/include/f_pc/f_pc_delete_tag.h b/include/f_pc/f_pc_delete_tag.h index 57b049c2f2..1dd0cd728a 100644 --- a/include/f_pc/f_pc_delete_tag.h +++ b/include/f_pc/f_pc_delete_tag.h @@ -25,6 +25,6 @@ void fpcDtTg_DeleteQTo(delete_tag_class* i_deleteTag); int fpcDtTg_Do(delete_tag_class* i_deleteTag, delete_tag_func i_func); int fpcDtTg_Init(delete_tag_class* i_deleteTag, void* i_data); -extern node_list_class g_fpcDtTg_Queue; +DUSK_GAME_EXTERN node_list_class g_fpcDtTg_Queue; #endif diff --git a/include/f_pc/f_pc_leaf.h b/include/f_pc/f_pc_leaf.h index 414d706b6a..99b176e73c 100644 --- a/include/f_pc/f_pc_leaf.h +++ b/include/f_pc/f_pc_leaf.h @@ -23,7 +23,7 @@ typedef struct leafdraw_class { typedef struct leafdraw_class : base_process_class { #endif - /* 0xB8 */ leafdraw_method_class* leaf_methods; + /* 0xB8 */ leafdraw_method_class DUSK_CONST* leaf_methods; /* 0xBC */ s8 unk_0xBC; /* 0xBD */ u8 draw_interp_frame; /* 0xBE */ draw_priority_class draw_priority; @@ -31,19 +31,19 @@ typedef struct leafdraw_class : base_process_class { typedef struct leaf_process_profile_definition { /* 0x00 */ process_profile_definition base; - /* 0x1C */ leafdraw_method_class* sub_method; // Subclass methods + /* 0x1C */ leafdraw_method_class DUSK_CONST* sub_method; // Subclass methods /* 0x20 */ s16 priority; // mDrawPriority } leaf_process_profile_definition; s16 fpcLf_GetPriority(const leafdraw_class* i_leaf); -int fpcLf_DrawMethod(leafdraw_method_class* i_method, void* i_process); +int fpcLf_DrawMethod(leafdraw_method_class DUSK_CONST* i_method, void* i_process); int fpcLf_Draw(leafdraw_class* i_method); int fpcLf_Execute(leafdraw_class* i_leaf); int fpcLf_IsDelete(leafdraw_class* i_leaf); int fpcLf_Delete(leafdraw_class* i_leaf); int fpcLf_Create(leafdraw_class* i_leaf); -extern int g_fpcLf_type; -extern leafdraw_method_class g_fpcLf_Method; +DUSK_GAME_EXTERN int g_fpcLf_type; +DUSK_GAME_EXTERN leafdraw_method_class DUSK_CONST g_fpcLf_Method; #endif diff --git a/include/f_pc/f_pc_line.h b/include/f_pc/f_pc_line.h index 47a8018792..4527653a90 100644 --- a/include/f_pc/f_pc_line.h +++ b/include/f_pc/f_pc_line.h @@ -5,6 +5,6 @@ void fpcLn_Create(); -extern node_lists_tree_class g_fpcLn_Queue; +DUSK_GAME_EXTERN node_lists_tree_class g_fpcLn_Queue; #endif diff --git a/include/f_pc/f_pc_method.h b/include/f_pc/f_pc_method.h index 342a41008c..420e89ec4a 100644 --- a/include/f_pc/f_pc_method.h +++ b/include/f_pc/f_pc_method.h @@ -13,9 +13,9 @@ typedef struct process_method_class { } process_method_class; int fpcMtd_Method(process_method_func i_method, void* i_process); -int fpcMtd_Execute(process_method_class* i_methods, void* i_process); -int fpcMtd_IsDelete(process_method_class* i_methods, void* i_process); -int fpcMtd_Delete(process_method_class* i_methods, void* i_process); -int fpcMtd_Create(process_method_class* i_methods, void* i_process); +int fpcMtd_Execute(process_method_class DUSK_CONST* i_methods, void* i_process); +int fpcMtd_IsDelete(process_method_class DUSK_CONST* i_methods, void* i_process); +int fpcMtd_Delete(process_method_class DUSK_CONST* i_methods, void* i_process); +int fpcMtd_Create(process_method_class DUSK_CONST* i_methods, void* i_process); #endif diff --git a/include/f_pc/f_pc_node.h b/include/f_pc/f_pc_node.h index 0d96fd2de5..a519393b1c 100644 --- a/include/f_pc/f_pc_node.h +++ b/include/f_pc/f_pc_node.h @@ -35,7 +35,7 @@ int fpcNd_IsDelete(process_node_class* pProcNode); int fpcNd_Delete(process_node_class* pProcNode); int fpcNd_Create(process_node_class* pProcNode); -extern int g_fpcNd_type; -extern nodedraw_method_class g_fpcNd_Method; +DUSK_GAME_EXTERN int g_fpcNd_type; +DUSK_GAME_EXTERN nodedraw_method_class g_fpcNd_Method; #endif diff --git a/include/f_pc/f_pc_node_req.h b/include/f_pc/f_pc_node_req.h index d710379c89..880e733ac9 100644 --- a/include/f_pc/f_pc_node_req.h +++ b/include/f_pc/f_pc_node_req.h @@ -36,7 +36,7 @@ typedef struct node_create_request { /* 0x58 */ s16 name; /* 0x5C */ void* data; /* 0x60 */ s16 unk_0x60; -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x64 */ int unk_0x64; /* 0x68 */ int unk_0x68; #endif diff --git a/include/f_pc/f_pc_profile.h b/include/f_pc/f_pc_profile.h index 865d9a9a4f..f1ebfa144e 100644 --- a/include/f_pc/f_pc_profile.h +++ b/include/f_pc/f_pc_profile.h @@ -3,6 +3,10 @@ #define F_PC_PROFILE_H_ #include +#include "global.h" + +// Putting const on these profiles make them have internal linkage. Make sure they're extern! +#define DUSK_PROFILE IF_DUSK(extern) DUSK_GAME_DATA typedef struct nodedraw_method_class nodedraw_method_class; typedef struct leafdraw_method_class leafdraw_method_class; @@ -13,7 +17,7 @@ typedef struct process_profile_definition { /* 0x04 */ u16 list_id; /* 0x06 */ u16 list_priority; /* 0x08 */ s16 name; - /* 0x0C */ process_method_class* methods; + /* 0x0C */ process_method_class DUSK_CONST* methods; /* 0x10 */ u32 process_size; /* 0x14 */ u32 unk_size; /* 0x18 */ u32 parameters; @@ -22,7 +26,7 @@ typedef struct process_profile_definition { #define LAYER_DEFAULT (-2) struct leaf_process_profile_definition; -process_profile_definition* fpcPf_Get(s16 i_profname); -extern process_profile_definition** g_fpcPf_ProfileList_p; +process_profile_definition DUSK_CONST* fpcPf_Get(s16 i_profname); +DUSK_GAME_EXTERN process_profile_definition DUSK_CONST* DUSK_CONST* DUSK_CONST g_fpcPf_ProfileList_p; #endif diff --git a/include/f_pc/f_pc_profile_lst.h b/include/f_pc/f_pc_profile_lst.h index a7f100b654..b5d6e461b5 100644 --- a/include/f_pc/f_pc_profile_lst.h +++ b/include/f_pc/f_pc_profile_lst.h @@ -13,1594 +13,1594 @@ #endif #ifdef __MWERKS__ -extern process_profile_definition g_profile_ALINK; -extern process_profile_definition g_profile_NO_CHG_ROOM; -extern process_profile_definition g_profile_ITEM; -extern process_profile_definition g_profile_CAMERA; -extern process_profile_definition g_profile_CAMERA2; -extern process_profile_definition g_profile_ENVSE; -extern process_profile_definition g_profile_GAMEOVER; -extern process_profile_definition g_profile_KANKYO; -extern process_profile_definition g_profile_KYEFF; -extern process_profile_definition g_profile_KYEFF2; -extern process_profile_definition g_profile_KY_THUNDER; -extern process_profile_definition g_profile_MENUWINDOW; -extern process_profile_definition g_profile_METER2; -extern process_profile_definition g_profile_MSG_OBJECT; -extern process_profile_definition g_profile_OVERLAP0; -extern process_profile_definition g_profile_OVERLAP1; -extern process_profile_definition g_profile_OVERLAP6; -extern process_profile_definition g_profile_OVERLAP7; -extern process_profile_definition g_profile_OVERLAP8; -extern process_profile_definition g_profile_OVERLAP9; -extern process_profile_definition g_profile_OVERLAP10; -extern process_profile_definition g_profile_OVERLAP11; -extern process_profile_definition g_profile_OVERLAP2; -extern process_profile_definition g_profile_OVERLAP3; -extern process_profile_definition g_profile_LOGO_SCENE; -extern process_profile_definition g_profile_MENU_SCENE; -extern process_profile_definition g_profile_NAME_SCENE; -extern process_profile_definition g_profile_NAMEEX_SCENE; -extern process_profile_definition g_profile_PLAY_SCENE; -extern process_profile_definition g_profile_OPENING_SCENE; -extern process_profile_definition g_profile_ROOM_SCENE; -extern process_profile_definition g_profile_WARNING_SCENE; -extern process_profile_definition g_profile_WARNING2_SCENE; -extern process_profile_definition g_profile_TIMER; -extern process_profile_definition g_profile_WMARK; -extern process_profile_definition g_profile_WPILLAR; -extern process_profile_definition g_profile_ANDSW; -extern process_profile_definition g_profile_BG; -extern process_profile_definition g_profile_BG_OBJ; -extern process_profile_definition g_profile_DMIDNA; -extern process_profile_definition g_profile_DBDOOR; -extern process_profile_definition g_profile_KNOB20; -extern process_profile_definition g_profile_DOOR20; -extern process_profile_definition g_profile_SPIRAL_DOOR; -extern process_profile_definition g_profile_DSHUTTER; -extern process_profile_definition g_profile_EP; -extern process_profile_definition g_profile_HITOBJ; -extern process_profile_definition g_profile_KYTAG00; -extern process_profile_definition g_profile_KYTAG04; -extern process_profile_definition g_profile_KYTAG17; -extern process_profile_definition g_profile_OBJ_BEF; -extern process_profile_definition g_profile_Obj_BurnBox; -extern process_profile_definition g_profile_Obj_Carry; -extern process_profile_definition g_profile_OBJ_ITO; -extern process_profile_definition g_profile_Obj_Movebox; -extern process_profile_definition g_profile_Obj_Swpush; -extern process_profile_definition g_profile_Obj_Timer; -extern process_profile_definition g_profile_PATH_LINE; -extern process_profile_definition g_profile_SCENE_EXIT; -extern process_profile_definition g_profile_SET_BG_OBJ; -extern process_profile_definition g_profile_SWHIT0; -extern process_profile_definition g_profile_TAG_ALLMATO; -extern process_profile_definition g_profile_TAG_CAMERA; -extern process_profile_definition g_profile_TAG_CHKPOINT; -extern process_profile_definition g_profile_TAG_EVENT; -extern process_profile_definition g_profile_TAG_EVT; -extern process_profile_definition g_profile_TAG_EVTAREA; -extern process_profile_definition g_profile_TAG_EVTMSG; -extern process_profile_definition g_profile_TAG_HOWL; -extern process_profile_definition g_profile_TAG_KMSG; -extern process_profile_definition g_profile_TAG_LANTERN; -extern process_profile_definition g_profile_Tag_Mist; -extern process_profile_definition g_profile_TAG_MSG; -extern process_profile_definition g_profile_TAG_PUSH; -extern process_profile_definition g_profile_TAG_TELOP; -extern process_profile_definition g_profile_TBOX; -extern process_profile_definition g_profile_TBOX2; -extern process_profile_definition g_profile_VRBOX; -extern process_profile_definition g_profile_VRBOX2; -extern process_profile_definition g_profile_ARROW; -extern process_profile_definition g_profile_BOOMERANG; -extern process_profile_definition g_profile_CROD; -extern process_profile_definition g_profile_DEMO00; -extern process_profile_definition g_profile_DISAPPEAR; -extern process_profile_definition g_profile_MG_ROD; -extern process_profile_definition g_profile_MIDNA; -extern process_profile_definition g_profile_NBOMB; -extern process_profile_definition g_profile_Obj_LifeContainer; -extern process_profile_definition g_profile_Obj_Yousei; -extern process_profile_definition g_profile_SPINNER; -extern process_profile_definition g_profile_SUSPEND; -extern process_profile_definition g_profile_Tag_Attp; -extern process_profile_definition g_profile_ALLDIE; -extern process_profile_definition g_profile_ANDSW2; -extern process_profile_definition g_profile_BD; -extern process_profile_definition g_profile_CANOE; -extern process_profile_definition g_profile_CSTAF; -extern process_profile_definition g_profile_Demo_Item; -extern process_profile_definition g_profile_L1BOSS_DOOR; -extern process_profile_definition g_profile_E_DN; -extern process_profile_definition g_profile_E_FM; -extern process_profile_definition g_profile_E_GA; -extern process_profile_definition g_profile_E_HB; -extern process_profile_definition g_profile_E_NEST; -extern process_profile_definition g_profile_E_RD; -extern process_profile_definition g_profile_ECONT; -extern process_profile_definition g_profile_FR; -extern process_profile_definition g_profile_GRASS; -extern process_profile_definition g_profile_KYTAG05; -extern process_profile_definition g_profile_KYTAG10; -extern process_profile_definition g_profile_KYTAG11; -extern process_profile_definition g_profile_KYTAG14; -extern process_profile_definition g_profile_MG_FISH; -extern process_profile_definition g_profile_NPC_BESU; -extern process_profile_definition g_profile_NPC_FAIRY_SEIREI; -extern process_profile_definition g_profile_NPC_FISH; -extern process_profile_definition g_profile_NPC_HENNA; -extern process_profile_definition g_profile_NPC_KAKASHI; -extern process_profile_definition g_profile_NPC_KKRI; -extern process_profile_definition g_profile_NPC_KOLIN; -extern process_profile_definition g_profile_NPC_MARO; -extern process_profile_definition g_profile_NPC_TARO; -extern process_profile_definition g_profile_NPC_TKJ; -extern process_profile_definition g_profile_Obj_BHASHI; -extern process_profile_definition g_profile_Obj_BkDoor; -extern process_profile_definition g_profile_Obj_BossWarp; -extern process_profile_definition g_profile_Obj_Cboard; -extern process_profile_definition g_profile_Obj_Digpl; -extern process_profile_definition g_profile_Obj_Eff; -extern process_profile_definition g_profile_OBJ_FMOBJ; -extern process_profile_definition g_profile_Obj_GpTaru; -extern process_profile_definition g_profile_Obj_HHASHI; -extern process_profile_definition g_profile_OBJ_KANBAN2; -extern process_profile_definition g_profile_OBJ_KBACKET; -extern process_profile_definition g_profile_Obj_KkrGate; -extern process_profile_definition g_profile_Obj_KLift00; -extern process_profile_definition g_profile_Tag_KtOnFire; -extern process_profile_definition g_profile_Obj_Ladder; -extern process_profile_definition g_profile_Obj_Lv2Candle; -extern process_profile_definition g_profile_Obj_MagneArm; -extern process_profile_definition g_profile_Obj_MetalBox; -extern process_profile_definition g_profile_Obj_MGate; -extern process_profile_definition g_profile_Obj_NamePlate; -extern process_profile_definition g_profile_Obj_OnCloth; -extern process_profile_definition g_profile_Obj_RopeBridge; -extern process_profile_definition g_profile_Obj_SwallShutter; -extern process_profile_definition g_profile_OBJ_STICK; -extern process_profile_definition g_profile_Obj_StoneMark; -extern process_profile_definition g_profile_Obj_Swpropeller; -extern process_profile_definition g_profile_Obj_Swpush5; -extern process_profile_definition g_profile_Obj_Yobikusa; -extern process_profile_definition g_profile_SCENE_EXIT2; -extern process_profile_definition g_profile_ShopItem; -extern process_profile_definition g_profile_SQ; -extern process_profile_definition g_profile_SWC00; -extern process_profile_definition g_profile_Tag_CstaSw; -extern process_profile_definition g_profile_Tag_AJnot; -extern process_profile_definition g_profile_Tag_AttackItem; -extern process_profile_definition g_profile_Tag_Gstart; -extern process_profile_definition g_profile_Tag_Hinit; -extern process_profile_definition g_profile_Tag_Hjump; -extern process_profile_definition g_profile_Tag_Hstop; -extern process_profile_definition g_profile_Tag_Lv2PrChk; -extern process_profile_definition g_profile_Tag_Magne; -extern process_profile_definition g_profile_Tag_Mhint; -extern process_profile_definition g_profile_Tag_Mstop; -extern process_profile_definition g_profile_Tag_Spring; -extern process_profile_definition g_profile_Tag_Statue; -extern process_profile_definition g_profile_Ykgr; -extern process_profile_definition g_profile_DR; -extern process_profile_definition g_profile_L7lowDr; -extern process_profile_definition g_profile_L7ODR; -extern process_profile_definition g_profile_B_BH; -extern process_profile_definition g_profile_B_BQ; -extern process_profile_definition g_profile_B_DR; -extern process_profile_definition g_profile_B_DRE; -extern process_profile_definition g_profile_B_DS; -extern process_profile_definition g_profile_B_GG; -extern process_profile_definition g_profile_B_GM; -extern process_profile_definition g_profile_B_GND; -extern process_profile_definition g_profile_B_GO; -extern process_profile_definition g_profile_B_GOS; -extern process_profile_definition g_profile_B_MGN; -extern process_profile_definition g_profile_B_OB; -extern process_profile_definition g_profile_B_OH; -extern process_profile_definition g_profile_B_OH2; -extern process_profile_definition g_profile_B_TN; -extern process_profile_definition g_profile_B_YO; -extern process_profile_definition g_profile_B_YOI; -extern process_profile_definition g_profile_B_ZANT; -extern process_profile_definition g_profile_B_ZANTM; -extern process_profile_definition g_profile_B_ZANTZ; -extern process_profile_definition g_profile_B_ZANTS; -extern process_profile_definition g_profile_BALLOON2D; -extern process_profile_definition g_profile_BULLET; -extern process_profile_definition g_profile_COACH2D; -extern process_profile_definition g_profile_COACH_FIRE; -extern process_profile_definition g_profile_COW; -extern process_profile_definition g_profile_CSTATUE; -extern process_profile_definition g_profile_DO; -extern process_profile_definition g_profile_BOSS_DOOR; -extern process_profile_definition g_profile_L5BOSS_DOOR; -extern process_profile_definition g_profile_L1MBOSS_DOOR; -extern process_profile_definition g_profile_PushDoor; -extern process_profile_definition g_profile_E_AI; -extern process_profile_definition g_profile_E_ARROW; -extern process_profile_definition g_profile_E_BA; -extern process_profile_definition g_profile_E_BEE; -extern process_profile_definition g_profile_E_BG; -extern process_profile_definition g_profile_E_BI; -extern process_profile_definition g_profile_E_BI_LEAF; -extern process_profile_definition g_profile_E_BS; -extern process_profile_definition g_profile_E_BU; -extern process_profile_definition g_profile_E_BUG; -extern process_profile_definition g_profile_E_CR; -extern process_profile_definition g_profile_E_CR_EGG; -extern process_profile_definition g_profile_E_DB; -extern process_profile_definition g_profile_E_DB_LEAF; -extern process_profile_definition g_profile_E_DD; -extern process_profile_definition g_profile_E_DF; -extern process_profile_definition g_profile_E_DK; -extern process_profile_definition g_profile_E_DT; -extern process_profile_definition g_profile_E_FB; -extern process_profile_definition g_profile_E_FK; -extern process_profile_definition g_profile_E_FS; -extern process_profile_definition g_profile_E_FZ; -extern process_profile_definition g_profile_E_GB; -extern process_profile_definition g_profile_E_GE; -extern process_profile_definition g_profile_E_GI; -extern process_profile_definition g_profile_E_GM; -extern process_profile_definition g_profile_E_GOB; -extern process_profile_definition g_profile_E_GS; -extern process_profile_definition g_profile_E_HB_LEAF; -extern process_profile_definition g_profile_E_HM; -extern process_profile_definition g_profile_E_HP; -extern process_profile_definition g_profile_E_HZ; -extern process_profile_definition g_profile_E_HZELDA; -extern process_profile_definition g_profile_E_IS; -extern process_profile_definition g_profile_E_KG; -extern process_profile_definition g_profile_E_KK; -extern process_profile_definition g_profile_E_KR; -extern process_profile_definition g_profile_E_MB; -extern process_profile_definition g_profile_E_MD; -extern process_profile_definition g_profile_E_MF; -extern process_profile_definition g_profile_E_MK; -extern process_profile_definition g_profile_E_MK_BO; -extern process_profile_definition g_profile_E_MM; -extern process_profile_definition g_profile_E_MM_MT; -extern process_profile_definition g_profile_E_MS; -extern process_profile_definition g_profile_E_NZ; -extern process_profile_definition g_profile_E_OC; -extern process_profile_definition g_profile_E_OctBg; -extern process_profile_definition g_profile_E_OT; -extern process_profile_definition g_profile_E_PH; -extern process_profile_definition g_profile_E_PM; -extern process_profile_definition g_profile_E_PO; -extern process_profile_definition g_profile_E_PZ; -extern process_profile_definition g_profile_E_RB; -extern process_profile_definition g_profile_E_RDB; -extern process_profile_definition g_profile_E_RDY; -extern process_profile_definition g_profile_E_S1; -extern process_profile_definition g_profile_E_SB; -extern process_profile_definition g_profile_E_SF; -extern process_profile_definition g_profile_E_SG; -extern process_profile_definition g_profile_E_SH; -extern process_profile_definition g_profile_E_SM; -extern process_profile_definition g_profile_E_SM2; -extern process_profile_definition g_profile_E_ST; -extern process_profile_definition g_profile_E_ST_LINE; -extern process_profile_definition g_profile_E_SW; -extern process_profile_definition g_profile_E_TH; -extern process_profile_definition g_profile_E_TH_BALL; -extern process_profile_definition g_profile_E_TK; -extern process_profile_definition g_profile_E_TK2; -extern process_profile_definition g_profile_E_TK_BALL; -extern process_profile_definition g_profile_E_TT; -extern process_profile_definition g_profile_E_VT; -extern process_profile_definition g_profile_E_WAP; -extern process_profile_definition g_profile_E_WB; -extern process_profile_definition g_profile_E_WS; -extern process_profile_definition g_profile_E_WW; -extern process_profile_definition g_profile_E_YC; -extern process_profile_definition g_profile_E_YD; -extern process_profile_definition g_profile_E_YD_LEAF; -extern process_profile_definition g_profile_E_YG; -extern process_profile_definition g_profile_E_YH; -extern process_profile_definition g_profile_E_YK; -extern process_profile_definition g_profile_E_YM; -extern process_profile_definition g_profile_E_YM_TAG; -extern process_profile_definition g_profile_E_YMB; -extern process_profile_definition g_profile_E_YR; -extern process_profile_definition g_profile_E_ZH; -extern process_profile_definition g_profile_E_ZM; -extern process_profile_definition g_profile_E_ZS; -extern process_profile_definition g_profile_FORMATION_MNG; -extern process_profile_definition g_profile_GUARD_MNG; -extern process_profile_definition g_profile_HORSE; -extern process_profile_definition g_profile_HOZELDA; -extern process_profile_definition g_profile_Izumi_Gate; -extern process_profile_definition g_profile_KAGO; -extern process_profile_definition g_profile_KYTAG01; -extern process_profile_definition g_profile_KYTAG02; -extern process_profile_definition g_profile_KYTAG03; -extern process_profile_definition g_profile_KYTAG06; -extern process_profile_definition g_profile_KYTAG07; -extern process_profile_definition g_profile_KYTAG08; -extern process_profile_definition g_profile_KYTAG09; -extern process_profile_definition g_profile_KYTAG12; -extern process_profile_definition g_profile_KYTAG13; -extern process_profile_definition g_profile_KYTAG15; -extern process_profile_definition g_profile_KYTAG16; -extern process_profile_definition g_profile_MANT; -extern process_profile_definition g_profile_FSHOP; -extern process_profile_definition g_profile_MIRROR; -extern process_profile_definition g_profile_MOVIE_PLAYER; -extern process_profile_definition g_profile_MYNA; -extern process_profile_definition g_profile_NI; -extern process_profile_definition g_profile_NPC_ARU; -extern process_profile_definition g_profile_NPC_ASH; -extern process_profile_definition g_profile_NPC_ASHB; -extern process_profile_definition g_profile_NPC_BANS; -extern process_profile_definition g_profile_NPC_BLUENS; -extern process_profile_definition g_profile_NPC_BOU; -extern process_profile_definition g_profile_NPC_BOU_S; -extern process_profile_definition g_profile_NPC_CD3; -extern process_profile_definition g_profile_NPC_CHAT; -extern process_profile_definition g_profile_NPC_CHIN; -extern process_profile_definition g_profile_NPC_CLERKA; -extern process_profile_definition g_profile_NPC_CLERKB; -extern process_profile_definition g_profile_NPC_CLERKT; -extern process_profile_definition g_profile_NPC_COACH; -extern process_profile_definition g_profile_NPC_DF; -extern process_profile_definition g_profile_NPC_DOC; -extern process_profile_definition g_profile_NPC_DOORBOY; -extern process_profile_definition g_profile_NPC_DRSOL; -extern process_profile_definition g_profile_NPC_DU; -extern process_profile_definition g_profile_NPC_FAIRY; -extern process_profile_definition g_profile_NPC_FGUARD; -extern process_profile_definition g_profile_NPC_GND; -extern process_profile_definition g_profile_NPC_GRA; -extern process_profile_definition g_profile_NPC_GRC; -extern process_profile_definition g_profile_NPC_GRD; -extern process_profile_definition g_profile_NPC_GRM; -extern process_profile_definition g_profile_NPC_GRMC; -extern process_profile_definition g_profile_NPC_GRO; -extern process_profile_definition g_profile_NPC_GRR; -extern process_profile_definition g_profile_NPC_GRS; -extern process_profile_definition g_profile_NPC_GRZ; -extern process_profile_definition g_profile_NPC_GUARD; -extern process_profile_definition g_profile_NPC_GWOLF; -extern process_profile_definition g_profile_NPC_HANJO; -extern process_profile_definition g_profile_NPC_HENNA0; -extern process_profile_definition g_profile_NPC_HOZ; -extern process_profile_definition g_profile_NPC_IMPAL; -extern process_profile_definition g_profile_NPC_INKO; -extern process_profile_definition g_profile_NPC_INS; -extern process_profile_definition g_profile_NPC_JAGAR; -extern process_profile_definition g_profile_NPC_KASIHANA; -extern process_profile_definition g_profile_NPC_KASIKYU; -extern process_profile_definition g_profile_NPC_KASIMICH; -extern process_profile_definition g_profile_NPC_KDK; -extern process_profile_definition g_profile_NPC_KN; -extern process_profile_definition g_profile_NPC_KNJ; -extern process_profile_definition g_profile_NPC_KOLINB; -extern process_profile_definition g_profile_NPC_KS; -extern process_profile_definition g_profile_NPC_KYURY; -extern process_profile_definition g_profile_NPC_LEN; -extern process_profile_definition g_profile_NPC_LF; -extern process_profile_definition g_profile_NPC_LUD; -extern process_profile_definition g_profile_NPC_MIDP; -extern process_profile_definition g_profile_NPC_MK; -extern process_profile_definition g_profile_NPC_MOI; -extern process_profile_definition g_profile_NPC_MOIR; -extern process_profile_definition g_profile_MYNA2; -extern process_profile_definition g_profile_NPC_NE; -extern process_profile_definition g_profile_NPC_P2; -extern process_profile_definition g_profile_NPC_PACHI_BESU; -extern process_profile_definition g_profile_NPC_PACHI_MARO; -extern process_profile_definition g_profile_NPC_PACHI_TARO; -extern process_profile_definition g_profile_NPC_PASSER; -extern process_profile_definition g_profile_NPC_PASSER2; -extern process_profile_definition g_profile_NPC_POST; -extern process_profile_definition g_profile_NPC_POUYA; -extern process_profile_definition g_profile_NPC_PRAYER; -extern process_profile_definition g_profile_NPC_RACA; -extern process_profile_definition g_profile_NPC_RAFREL; -extern process_profile_definition g_profile_NPC_SARU; -extern process_profile_definition g_profile_NPC_SEIB; -extern process_profile_definition g_profile_NPC_SEIC; -extern process_profile_definition g_profile_NPC_SEID; -extern process_profile_definition g_profile_NPC_SEIRA; -extern process_profile_definition g_profile_NPC_SERA2; -extern process_profile_definition g_profile_NPC_SEIREI; -extern process_profile_definition g_profile_NPC_SHAD; -extern process_profile_definition g_profile_NPC_SHAMAN; -extern process_profile_definition g_profile_NPC_SHOE; -extern process_profile_definition g_profile_NPC_SHOP0; -extern process_profile_definition g_profile_NPC_SMARO; -extern process_profile_definition g_profile_NPC_SOLA; -extern process_profile_definition g_profile_NPC_SOLDIERa; -extern process_profile_definition g_profile_NPC_SOLDIERb; -extern process_profile_definition g_profile_NPC_SQ; -extern process_profile_definition g_profile_NPC_THE; -extern process_profile_definition g_profile_NPC_THEB; -extern process_profile_definition g_profile_NPC_TK; -extern process_profile_definition g_profile_NPC_TKC; -extern process_profile_definition g_profile_NPC_TKJ2; -extern process_profile_definition g_profile_NPC_TKS; -extern process_profile_definition g_profile_NPC_TOBY; -extern process_profile_definition g_profile_NPC_TR; -extern process_profile_definition g_profile_NPC_URI; -extern process_profile_definition g_profile_NPC_WORM; -extern process_profile_definition g_profile_NPC_WRESTLER; -extern process_profile_definition g_profile_NPC_YAMID; -extern process_profile_definition g_profile_NPC_YAMIS; -extern process_profile_definition g_profile_NPC_YAMIT; -extern process_profile_definition g_profile_NPC_YELIA; -extern process_profile_definition g_profile_NPC_YKM; -extern process_profile_definition g_profile_NPC_YKW; -extern process_profile_definition g_profile_NPC_ZANB; -extern process_profile_definition g_profile_NPC_ZANT; -extern process_profile_definition g_profile_NPC_ZELR; -extern process_profile_definition g_profile_NPC_ZELRO; -extern process_profile_definition g_profile_NPC_ZELDA; -extern process_profile_definition g_profile_NPC_ZRA; -extern process_profile_definition g_profile_NPC_ZRC; -extern process_profile_definition g_profile_NPC_ZRZ; -extern process_profile_definition g_profile_Obj_Lv5Key; -extern process_profile_definition g_profile_Obj_Turara; -extern process_profile_definition g_profile_Obj_TvCdlst; -extern process_profile_definition g_profile_Obj_Ytaihou; -extern process_profile_definition g_profile_Obj_AmiShutter; -extern process_profile_definition g_profile_Obj_Ari; -extern process_profile_definition g_profile_OBJ_AUTOMATA; -extern process_profile_definition g_profile_Obj_Avalanche; -extern process_profile_definition g_profile_OBJ_BALLOON; -extern process_profile_definition g_profile_Obj_BarDesk; -extern process_profile_definition g_profile_Obj_Batta; -extern process_profile_definition g_profile_Obj_BBox; -extern process_profile_definition g_profile_OBJ_BED; -extern process_profile_definition g_profile_Obj_Bemos; -extern process_profile_definition g_profile_Obj_Bhbridge; -extern process_profile_definition g_profile_Obj_BkLeaf; -extern process_profile_definition g_profile_BkyRock; -extern process_profile_definition g_profile_Obj_BmWindow; -extern process_profile_definition g_profile_Obj_BoomShutter; -extern process_profile_definition g_profile_Obj_Bombf; -extern process_profile_definition g_profile_OBJ_BOUMATO; -extern process_profile_definition g_profile_OBJ_BRG; -extern process_profile_definition g_profile_Obj_BsGate; -extern process_profile_definition g_profile_Obj_awaPlar; -extern process_profile_definition g_profile_Obj_CatDoor; -extern process_profile_definition g_profile_OBJ_CB; -extern process_profile_definition g_profile_Obj_ChainBlock; -extern process_profile_definition g_profile_Obj_Cdoor; -extern process_profile_definition g_profile_Obj_Chandelier; -extern process_profile_definition g_profile_Obj_Chest; -extern process_profile_definition g_profile_Obj_Cho; -extern process_profile_definition g_profile_Obj_Cowdoor; -extern process_profile_definition g_profile_Obj_Crope; -extern process_profile_definition g_profile_Obj_CRVFENCE; -extern process_profile_definition g_profile_Obj_CRVGATE; -extern process_profile_definition g_profile_Obj_CRVHAHEN; -extern process_profile_definition g_profile_Obj_CRVLH_DW; -extern process_profile_definition g_profile_Obj_CRVLH_UP; -extern process_profile_definition g_profile_Obj_CRVSTEEL; -extern process_profile_definition g_profile_Obj_Crystal; -extern process_profile_definition g_profile_Obj_ChainWall; -extern process_profile_definition g_profile_Obj_DamCps; -extern process_profile_definition g_profile_Obj_Dan; -extern process_profile_definition g_profile_Obj_Digholl; -extern process_profile_definition g_profile_Obj_DigSnow; -extern process_profile_definition g_profile_Obj_Elevator; -extern process_profile_definition g_profile_Obj_Drop; -extern process_profile_definition g_profile_Obj_DUST; -extern process_profile_definition g_profile_Obj_E_CREATE; -extern process_profile_definition g_profile_Obj_FallObj; -extern process_profile_definition g_profile_Obj_Fan; -extern process_profile_definition g_profile_Obj_Fchain; -extern process_profile_definition g_profile_Obj_FireWood; -extern process_profile_definition g_profile_Obj_FireWood2; -extern process_profile_definition g_profile_Obj_FirePillar; -extern process_profile_definition g_profile_Obj_FirePillar2; -extern process_profile_definition g_profile_Obj_Flag; -extern process_profile_definition g_profile_Obj_Flag2; -extern process_profile_definition g_profile_Obj_Flag3; -extern process_profile_definition g_profile_OBJ_FOOD; -extern process_profile_definition g_profile_OBJ_FW; -extern process_profile_definition g_profile_OBJ_GADGET; -extern process_profile_definition g_profile_Obj_GanonWall; -extern process_profile_definition g_profile_Obj_GanonWall2; -extern process_profile_definition g_profile_OBJ_GB; -extern process_profile_definition g_profile_Obj_Geyser; -extern process_profile_definition g_profile_Obj_glowSphere; -extern process_profile_definition g_profile_OBJ_GM; -extern process_profile_definition g_profile_Obj_GoGate; -extern process_profile_definition g_profile_Obj_GOMIKABE; -extern process_profile_definition g_profile_OBJ_GRA; -extern process_profile_definition g_profile_GRA_WALL; -extern process_profile_definition g_profile_Obj_GraRock; -extern process_profile_definition g_profile_Obj_GraveStone; -extern process_profile_definition g_profile_GRDWATER; -extern process_profile_definition g_profile_Obj_GrzRock; -extern process_profile_definition g_profile_Obj_H_Saku; -extern process_profile_definition g_profile_Obj_HBarrel; -extern process_profile_definition g_profile_Obj_HFtr; -extern process_profile_definition g_profile_Obj_MHasu; -extern process_profile_definition g_profile_Obj_Hata; -extern process_profile_definition g_profile_OBJ_HB; -extern process_profile_definition g_profile_Obj_HBombkoya; -extern process_profile_definition g_profile_Obj_HeavySw; -extern process_profile_definition g_profile_Obj_Hfuta; -extern process_profile_definition g_profile_Obj_HsTarget; -extern process_profile_definition g_profile_Obj_Ice_l; -extern process_profile_definition g_profile_Obj_Ice_s; -extern process_profile_definition g_profile_Obj_IceBlock; -extern process_profile_definition g_profile_Obj_IceLeaf; -extern process_profile_definition g_profile_OBJ_IHASI; -extern process_profile_definition g_profile_Obj_Ikada; -extern process_profile_definition g_profile_Obj_InoBone; -extern process_profile_definition g_profile_Obj_ITA; -extern process_profile_definition g_profile_OBJ_ITAMATO; -extern process_profile_definition g_profile_Obj_Kabuto; -extern process_profile_definition g_profile_Obj_Kag; -extern process_profile_definition g_profile_OBJ_KAGE; -extern process_profile_definition g_profile_OBJ_KAGO; -extern process_profile_definition g_profile_Obj_Kaisou; -extern process_profile_definition g_profile_Obj_Kam; -extern process_profile_definition g_profile_Obj_Kantera; -extern process_profile_definition g_profile_Obj_Kat; -extern process_profile_definition g_profile_Obj_KazeNeko; -extern process_profile_definition g_profile_OBJ_KBOX; -extern process_profile_definition g_profile_OBJ_KEY; -extern process_profile_definition g_profile_OBJ_KEYHOLE; -extern process_profile_definition g_profile_OBJ_KI; -extern process_profile_definition g_profile_Obj_KiPot; -extern process_profile_definition g_profile_OBJ_KITA; -extern process_profile_definition g_profile_Obj_KJgjs; -extern process_profile_definition g_profile_Obj_KKanban; -extern process_profile_definition g_profile_KN_BULLET; -extern process_profile_definition g_profile_Obj_Kshutter; -extern process_profile_definition g_profile_Obj_Kuw; -extern process_profile_definition g_profile_Obj_KWheel00; -extern process_profile_definition g_profile_Obj_KWheel01; -extern process_profile_definition g_profile_Obj_KznkArm; -extern process_profile_definition g_profile_Obj_Laundry; -extern process_profile_definition g_profile_Obj_LndRope; -extern process_profile_definition g_profile_OBJ_LBOX; -extern process_profile_definition g_profile_OBJ_LP; -extern process_profile_definition g_profile_Obj_Lv1Cdl00; -extern process_profile_definition g_profile_Obj_Lv1Cdl01; -extern process_profile_definition g_profile_Obj_Lv3Candle; -extern process_profile_definition g_profile_Obj_Lv3Water; -extern process_profile_definition g_profile_Obj_Lv3Water2; -extern process_profile_definition g_profile_OBJ_LV3WATERB; -extern process_profile_definition g_profile_Obj_Lv3R10Saka; -extern process_profile_definition g_profile_Obj_WaterEff; -extern process_profile_definition g_profile_Tag_Lv4CandleDm; -extern process_profile_definition g_profile_Tag_Lv4Candle; -extern process_profile_definition g_profile_Obj_Lv4EdShutter; -extern process_profile_definition g_profile_Obj_Lv4Gate; -extern process_profile_definition g_profile_Obj_Lv4HsTarget; -extern process_profile_definition g_profile_Obj_Lv4PoGate; -extern process_profile_definition g_profile_Obj_Lv4RailWall; -extern process_profile_definition g_profile_Obj_Lv4SlideWall; -extern process_profile_definition g_profile_Obj_Lv4Bridge; -extern process_profile_definition g_profile_Obj_Lv4Chan; -extern process_profile_definition g_profile_Obj_Lv4DigSand; -extern process_profile_definition g_profile_Obj_Lv4Floor; -extern process_profile_definition g_profile_Obj_Lv4Gear; -extern process_profile_definition g_profile_Obj_PRElvtr; -extern process_profile_definition g_profile_Obj_Lv4PRwall; -extern process_profile_definition g_profile_Obj_Lv4Sand; -extern process_profile_definition g_profile_Obj_Lv5FBoard; -extern process_profile_definition g_profile_Obj_IceWall; -extern process_profile_definition g_profile_Obj_Lv5SwIce; -extern process_profile_definition g_profile_Obj_Ychndlr; -extern process_profile_definition g_profile_Obj_YIblltray; -extern process_profile_definition g_profile_Obj_Lv6ChgGate; -extern process_profile_definition g_profile_Obj_Lv6FuriTrap; -extern process_profile_definition g_profile_Obj_Lv6Lblock; -extern process_profile_definition g_profile_Obj_Lv6SwGate; -extern process_profile_definition g_profile_Obj_Lv6SzGate; -extern process_profile_definition g_profile_Obj_Lv6Tenbin; -extern process_profile_definition g_profile_Obj_Lv6TogeRoll; -extern process_profile_definition g_profile_Obj_Lv6TogeTrap; -extern process_profile_definition g_profile_Obj_Lv6bemos; -extern process_profile_definition g_profile_Obj_Lv6bemos2; -extern process_profile_definition g_profile_Obj_Lv6EGate; -extern process_profile_definition g_profile_Obj_Lv6ElevtA; -extern process_profile_definition g_profile_Obj_Lv6SwTurn; -extern process_profile_definition g_profile_Obj_Lv7BsGate; -extern process_profile_definition g_profile_Obj_Lv7PropY; -extern process_profile_definition g_profile_Obj_Lv7Bridge; -extern process_profile_definition g_profile_Obj_Lv8KekkaiTrap; -extern process_profile_definition g_profile_Obj_Lv8Lift; -extern process_profile_definition g_profile_Obj_Lv8OptiLift; -extern process_profile_definition g_profile_Obj_Lv8UdFloor; -extern process_profile_definition g_profile_Obj_Lv9SwShutter; -extern process_profile_definition g_profile_Obj_MagLift; -extern process_profile_definition g_profile_Obj_MagLiftRot; -extern process_profile_definition g_profile_OBJ_MAKI; -extern process_profile_definition g_profile_Obj_MasterSword; -extern process_profile_definition g_profile_Obj_Mato; -extern process_profile_definition g_profile_Obj_MHole; -extern process_profile_definition g_profile_OBJ_MIE; -extern process_profile_definition g_profile_Obj_Mirror6Pole; -extern process_profile_definition g_profile_Obj_MirrorChain; -extern process_profile_definition g_profile_Obj_MirrorSand; -extern process_profile_definition g_profile_Obj_MirrorScrew; -extern process_profile_definition g_profile_Obj_MirrorTable; -extern process_profile_definition g_profile_OBJ_MSIMA; -extern process_profile_definition g_profile_Obj_MvStair; -extern process_profile_definition g_profile_OBJ_MYOGAN; -extern process_profile_definition g_profile_Obj_Nagaisu; -extern process_profile_definition g_profile_Obj_Nan; -extern process_profile_definition g_profile_OBJ_NDOOR; -extern process_profile_definition g_profile_OBJ_NOUGU; -extern process_profile_definition g_profile_OCTHASHI; -extern process_profile_definition g_profile_OBJ_OILTUBO; -extern process_profile_definition g_profile_Obj_Onsen; -extern process_profile_definition g_profile_OBJ_ONSEN_FIRE; -extern process_profile_definition g_profile_Obj_OnsenTaru; -extern process_profile_definition g_profile_Obj_PushDoor; -extern process_profile_definition g_profile_Obj_PDtile; -extern process_profile_definition g_profile_Obj_PDwall; -extern process_profile_definition g_profile_Obj_Picture; -extern process_profile_definition g_profile_Obj_Pillar; -extern process_profile_definition g_profile_OBJ_PLEAF; -extern process_profile_definition g_profile_Obj_poCandle; -extern process_profile_definition g_profile_Obj_poFire; -extern process_profile_definition g_profile_Obj_poTbox; -extern process_profile_definition g_profile_Obj_Prop; -extern process_profile_definition g_profile_OBJ_PUMPKIN; -extern process_profile_definition g_profile_Obj_RCircle; -extern process_profile_definition g_profile_Obj_RfHole; -extern process_profile_definition g_profile_Obj_RiderGate; -extern process_profile_definition g_profile_Obj_RIVERROCK; -extern process_profile_definition g_profile_OBJ_ROCK; -extern process_profile_definition g_profile_Obj_RotBridge; -extern process_profile_definition g_profile_Obj_RotTrap; -extern process_profile_definition g_profile_OBJ_ROTEN; -extern process_profile_definition g_profile_Obj_RotStair; -extern process_profile_definition g_profile_OBJ_RW; -extern process_profile_definition g_profile_Obj_Saidan; -extern process_profile_definition g_profile_Obj_Sakuita; -extern process_profile_definition g_profile_Obj_ItaRope; -extern process_profile_definition g_profile_Obj_SCannon; -extern process_profile_definition g_profile_Obj_SCannonCrs; -extern process_profile_definition g_profile_Obj_SCannonTen; -extern process_profile_definition g_profile_OBJ_SEKIDOOR; -extern process_profile_definition g_profile_OBJ_SEKIZO; -extern process_profile_definition g_profile_OBJ_SEKIZOA; -extern process_profile_definition g_profile_Obj_Shield; -extern process_profile_definition g_profile_Obj_SM_DOOR; -extern process_profile_definition g_profile_Obj_SmallKey; -extern process_profile_definition g_profile_Obj_SmgDoor; -extern process_profile_definition g_profile_Obj_Smoke; -extern process_profile_definition g_profile_OBJ_SMTILE; -extern process_profile_definition g_profile_Obj_SmWStone; -extern process_profile_definition g_profile_Tag_SnowEff; -extern process_profile_definition g_profile_Obj_SnowSoup; -extern process_profile_definition g_profile_OBJ_SO; -extern process_profile_definition g_profile_Obj_SpinLift; -extern process_profile_definition g_profile_OBJ_SSDRINK; -extern process_profile_definition g_profile_OBJ_SSITEM; -extern process_profile_definition g_profile_Obj_StairBlock; -extern process_profile_definition g_profile_Obj_Stone; -extern process_profile_definition g_profile_Obj_Stopper; -extern process_profile_definition g_profile_Obj_Stopper2; -extern process_profile_definition g_profile_OBJ_SUISYA; -extern process_profile_definition g_profile_OBJ_SW; -extern process_profile_definition g_profile_Obj_SwBallA; -extern process_profile_definition g_profile_Obj_SwBallB; -extern process_profile_definition g_profile_Obj_SwBallC; -extern process_profile_definition g_profile_Obj_SwLight; -extern process_profile_definition g_profile_Obj_SwChain; -extern process_profile_definition g_profile_Obj_SwHang; -extern process_profile_definition g_profile_Obj_Sword; -extern process_profile_definition g_profile_Obj_Swpush2; -extern process_profile_definition g_profile_Obj_SwSpinner; -extern process_profile_definition g_profile_Obj_SwTurn; -extern process_profile_definition g_profile_Obj_SyRock; -extern process_profile_definition g_profile_Obj_SZbridge; -extern process_profile_definition g_profile_Obj_TaFence; -extern process_profile_definition g_profile_Obj_Table; -extern process_profile_definition g_profile_Obj_TakaraDai; -extern process_profile_definition g_profile_OBJ_TATIGI; -extern process_profile_definition g_profile_Obj_Ten; -extern process_profile_definition g_profile_Obj_TestCube; -extern process_profile_definition g_profile_Obj_Gake; -extern process_profile_definition g_profile_Obj_THASHI; -extern process_profile_definition g_profile_Obj_TDoor; -extern process_profile_definition g_profile_Obj_TimeFire; -extern process_profile_definition g_profile_OBJ_TKS; -extern process_profile_definition g_profile_Obj_TMoon; -extern process_profile_definition g_profile_Obj_ToaruMaki; -extern process_profile_definition g_profile_OBJ_TOBY; -extern process_profile_definition g_profile_Obj_TobyHouse; -extern process_profile_definition g_profile_Obj_TogeTrap; -extern process_profile_definition g_profile_Obj_Tombo; -extern process_profile_definition g_profile_Obj_Tornado; -extern process_profile_definition g_profile_Obj_Tornado2; -extern process_profile_definition g_profile_OBJ_TP; -extern process_profile_definition g_profile_TREESH; -extern process_profile_definition g_profile_Obj_TwGate; -extern process_profile_definition g_profile_OBJ_UDOOR; -extern process_profile_definition g_profile_OBJ_USAKU; -extern process_profile_definition g_profile_Obj_VolcGnd; -extern process_profile_definition g_profile_Obj_VolcanicBall; -extern process_profile_definition g_profile_Obj_VolcanicBomb; -extern process_profile_definition g_profile_Obj_KakarikoBrg; -extern process_profile_definition g_profile_Obj_OrdinBrg; -extern process_profile_definition g_profile_Obj_WtGate; -extern process_profile_definition g_profile_Obj_WaterPillar; -extern process_profile_definition g_profile_Obj_WaterFall; -extern process_profile_definition g_profile_Obj_Wchain; -extern process_profile_definition g_profile_Obj_WdStick; -extern process_profile_definition g_profile_OBJ_WEB0; -extern process_profile_definition g_profile_OBJ_WEB1; -extern process_profile_definition g_profile_Obj_WellCover; -extern process_profile_definition g_profile_OBJ_WFLAG; -extern process_profile_definition g_profile_Obj_WindStone; -extern process_profile_definition g_profile_Obj_Window; -extern process_profile_definition g_profile_Obj_WoodPendulum; -extern process_profile_definition g_profile_Obj_WoodStatue; -extern process_profile_definition g_profile_Obj_WoodenSword; -extern process_profile_definition g_profile_OBJ_YBAG; -extern process_profile_definition g_profile_OBJ_YSTONE; -extern process_profile_definition g_profile_Obj_ZoraCloth; -extern process_profile_definition g_profile_Obj_ZDoor; -extern process_profile_definition g_profile_Obj_zrTurara; -extern process_profile_definition g_profile_Obj_zrTuraraRc; -extern process_profile_definition g_profile_ZRA_MARK; -extern process_profile_definition g_profile_OBJ_ZRAFREEZE; -extern process_profile_definition g_profile_Obj_ZraRock; -extern process_profile_definition g_profile_PASSER_MNG; -extern process_profile_definition g_profile_PERU; -extern process_profile_definition g_profile_PPolamp; -extern process_profile_definition g_profile_SKIP2D; -extern process_profile_definition g_profile_START_AND_GOAL; -extern process_profile_definition g_profile_SwBall; -extern process_profile_definition g_profile_SwLBall; -extern process_profile_definition g_profile_SwTime; -extern process_profile_definition g_profile_Tag_Lv6Gate; -extern process_profile_definition g_profile_Tag_Lv7Gate; -extern process_profile_definition g_profile_Tag_Lv8Gate; -extern process_profile_definition g_profile_Tag_TWGate; -extern process_profile_definition g_profile_Tag_Arena; -extern process_profile_definition g_profile_Tag_Assist; -extern process_profile_definition g_profile_TAG_BTLITM; -extern process_profile_definition g_profile_Tag_ChgRestart; -extern process_profile_definition g_profile_TAG_CSW; -extern process_profile_definition g_profile_Tag_Escape; -extern process_profile_definition g_profile_Tag_FWall; -extern process_profile_definition g_profile_TAG_GRA; -extern process_profile_definition g_profile_TAG_GUARD; -extern process_profile_definition g_profile_Tag_Instruction; -extern process_profile_definition g_profile_Tag_KagoFall; -extern process_profile_definition g_profile_Tag_LightBall; -extern process_profile_definition g_profile_TAG_LV5SOUP; -extern process_profile_definition g_profile_Tag_Lv6CstaSw; -extern process_profile_definition g_profile_Tag_Mmsg; -extern process_profile_definition g_profile_Tag_Mwait; -extern process_profile_definition g_profile_TAG_MYNA2; -extern process_profile_definition g_profile_TAG_MNLIGHT; -extern process_profile_definition g_profile_TAG_PATI; -extern process_profile_definition g_profile_Tag_poFire; -extern process_profile_definition g_profile_TAG_QS; -extern process_profile_definition g_profile_Tag_RetRoom; -extern process_profile_definition g_profile_Tag_RiverBack; -extern process_profile_definition g_profile_Tag_RmbitSw; -extern process_profile_definition g_profile_Tag_Schedule; -extern process_profile_definition g_profile_Tag_SetBall; -extern process_profile_definition g_profile_Tag_Restart; -extern process_profile_definition g_profile_TAG_SHOPCAM; -extern process_profile_definition g_profile_TAG_SHOPITM; -extern process_profile_definition g_profile_Tag_SmkEmt; -extern process_profile_definition g_profile_Tag_Spinner; -extern process_profile_definition g_profile_Tag_Sppath; -extern process_profile_definition g_profile_TAG_SSDRINK; -extern process_profile_definition g_profile_Tag_Stream; -extern process_profile_definition g_profile_Tag_TheBHint; -extern process_profile_definition g_profile_Tag_WaraHowl; -extern process_profile_definition g_profile_Tag_WatchGe; -extern process_profile_definition g_profile_Tag_WaterFall; -extern process_profile_definition g_profile_Tag_Wljump; -extern process_profile_definition g_profile_TAG_YAMI; -extern process_profile_definition g_profile_TALK; -extern process_profile_definition g_profile_TBOX_SW; -extern process_profile_definition g_profile_TITLE; -extern process_profile_definition g_profile_WarpBug; +DUSK_GAME_EXTERN process_profile_definition g_profile_ALINK; +DUSK_GAME_EXTERN process_profile_definition g_profile_NO_CHG_ROOM; +DUSK_GAME_EXTERN process_profile_definition g_profile_ITEM; +DUSK_GAME_EXTERN process_profile_definition g_profile_CAMERA; +DUSK_GAME_EXTERN process_profile_definition g_profile_CAMERA2; +DUSK_GAME_EXTERN process_profile_definition g_profile_ENVSE; +DUSK_GAME_EXTERN process_profile_definition g_profile_GAMEOVER; +DUSK_GAME_EXTERN process_profile_definition g_profile_KANKYO; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYEFF; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYEFF2; +DUSK_GAME_EXTERN process_profile_definition g_profile_KY_THUNDER; +DUSK_GAME_EXTERN process_profile_definition g_profile_MENUWINDOW; +DUSK_GAME_EXTERN process_profile_definition g_profile_METER2; +DUSK_GAME_EXTERN process_profile_definition g_profile_MSG_OBJECT; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP0; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP1; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP6; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP7; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP8; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP9; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP10; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP11; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP2; +DUSK_GAME_EXTERN process_profile_definition g_profile_OVERLAP3; +DUSK_GAME_EXTERN process_profile_definition g_profile_LOGO_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_MENU_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_NAME_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_NAMEEX_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_PLAY_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_OPENING_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_ROOM_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_WARNING_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_WARNING2_SCENE; +DUSK_GAME_EXTERN process_profile_definition g_profile_TIMER; +DUSK_GAME_EXTERN process_profile_definition g_profile_WMARK; +DUSK_GAME_EXTERN process_profile_definition g_profile_WPILLAR; +DUSK_GAME_EXTERN process_profile_definition g_profile_ANDSW; +DUSK_GAME_EXTERN process_profile_definition g_profile_BG; +DUSK_GAME_EXTERN process_profile_definition g_profile_BG_OBJ; +DUSK_GAME_EXTERN process_profile_definition g_profile_DMIDNA; +DUSK_GAME_EXTERN process_profile_definition g_profile_DBDOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_KNOB20; +DUSK_GAME_EXTERN process_profile_definition g_profile_DOOR20; +DUSK_GAME_EXTERN process_profile_definition g_profile_SPIRAL_DOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_DSHUTTER; +DUSK_GAME_EXTERN process_profile_definition g_profile_EP; +DUSK_GAME_EXTERN process_profile_definition g_profile_HITOBJ; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG00; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG04; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG17; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_BEF; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BurnBox; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Carry; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_ITO; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Movebox; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Swpush; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Timer; +DUSK_GAME_EXTERN process_profile_definition g_profile_PATH_LINE; +DUSK_GAME_EXTERN process_profile_definition g_profile_SCENE_EXIT; +DUSK_GAME_EXTERN process_profile_definition g_profile_SET_BG_OBJ; +DUSK_GAME_EXTERN process_profile_definition g_profile_SWHIT0; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_ALLMATO; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_CAMERA; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_CHKPOINT; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_EVENT; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_EVT; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_EVTAREA; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_EVTMSG; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_HOWL; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_KMSG; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_LANTERN; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Mist; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_MSG; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_PUSH; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_TELOP; +DUSK_GAME_EXTERN process_profile_definition g_profile_TBOX; +DUSK_GAME_EXTERN process_profile_definition g_profile_TBOX2; +DUSK_GAME_EXTERN process_profile_definition g_profile_VRBOX; +DUSK_GAME_EXTERN process_profile_definition g_profile_VRBOX2; +DUSK_GAME_EXTERN process_profile_definition g_profile_ARROW; +DUSK_GAME_EXTERN process_profile_definition g_profile_BOOMERANG; +DUSK_GAME_EXTERN process_profile_definition g_profile_CROD; +DUSK_GAME_EXTERN process_profile_definition g_profile_DEMO00; +DUSK_GAME_EXTERN process_profile_definition g_profile_DISAPPEAR; +DUSK_GAME_EXTERN process_profile_definition g_profile_MG_ROD; +DUSK_GAME_EXTERN process_profile_definition g_profile_MIDNA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NBOMB; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_LifeContainer; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Yousei; +DUSK_GAME_EXTERN process_profile_definition g_profile_SPINNER; +DUSK_GAME_EXTERN process_profile_definition g_profile_SUSPEND; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Attp; +DUSK_GAME_EXTERN process_profile_definition g_profile_ALLDIE; +DUSK_GAME_EXTERN process_profile_definition g_profile_ANDSW2; +DUSK_GAME_EXTERN process_profile_definition g_profile_BD; +DUSK_GAME_EXTERN process_profile_definition g_profile_CANOE; +DUSK_GAME_EXTERN process_profile_definition g_profile_CSTAF; +DUSK_GAME_EXTERN process_profile_definition g_profile_Demo_Item; +DUSK_GAME_EXTERN process_profile_definition g_profile_L1BOSS_DOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DN; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_FM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GA; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_HB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_NEST; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_RD; +DUSK_GAME_EXTERN process_profile_definition g_profile_ECONT; +DUSK_GAME_EXTERN process_profile_definition g_profile_FR; +DUSK_GAME_EXTERN process_profile_definition g_profile_GRASS; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG05; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG10; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG11; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG14; +DUSK_GAME_EXTERN process_profile_definition g_profile_MG_FISH; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_BESU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_FAIRY_SEIREI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_FISH; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_HENNA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KAKASHI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KKRI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KOLIN; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_MARO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TARO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TKJ; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BHASHI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BkDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BossWarp; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Cboard; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Digpl; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Eff; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_FMOBJ; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GpTaru; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_HHASHI; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KANBAN2; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KBACKET; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KkrGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KLift00; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_KtOnFire; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ladder; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv2Candle; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MagneArm; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MetalBox; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_NamePlate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_OnCloth; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RopeBridge; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwallShutter; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_STICK; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_StoneMark; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Swpropeller; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Swpush5; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Yobikusa; +DUSK_GAME_EXTERN process_profile_definition g_profile_SCENE_EXIT2; +DUSK_GAME_EXTERN process_profile_definition g_profile_ShopItem; +DUSK_GAME_EXTERN process_profile_definition g_profile_SQ; +DUSK_GAME_EXTERN process_profile_definition g_profile_SWC00; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_CstaSw; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_AJnot; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_AttackItem; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Gstart; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Hinit; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Hjump; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Hstop; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv2PrChk; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Magne; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Mhint; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Mstop; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Spring; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Statue; +DUSK_GAME_EXTERN process_profile_definition g_profile_Ykgr; +DUSK_GAME_EXTERN process_profile_definition g_profile_DR; +DUSK_GAME_EXTERN process_profile_definition g_profile_L7lowDr; +DUSK_GAME_EXTERN process_profile_definition g_profile_L7ODR; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_BH; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_BQ; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_DR; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_DRE; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_DS; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_GG; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_GM; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_GND; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_GO; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_GOS; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_MGN; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_OB; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_OH; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_OH2; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_TN; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_YO; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_YOI; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_ZANT; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_ZANTM; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_ZANTZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_B_ZANTS; +DUSK_GAME_EXTERN process_profile_definition g_profile_BALLOON2D; +DUSK_GAME_EXTERN process_profile_definition g_profile_BULLET; +DUSK_GAME_EXTERN process_profile_definition g_profile_COACH2D; +DUSK_GAME_EXTERN process_profile_definition g_profile_COACH_FIRE; +DUSK_GAME_EXTERN process_profile_definition g_profile_COW; +DUSK_GAME_EXTERN process_profile_definition g_profile_CSTATUE; +DUSK_GAME_EXTERN process_profile_definition g_profile_DO; +DUSK_GAME_EXTERN process_profile_definition g_profile_BOSS_DOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_L5BOSS_DOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_L1MBOSS_DOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_PushDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_AI; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_ARROW; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BA; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BEE; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BI; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BI_LEAF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BS; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BU; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_BUG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_CR; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_CR_EGG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DB_LEAF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DD; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DK; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_DT; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_FB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_FK; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_FS; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_FZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GE; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GI; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GOB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_GS; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_HB_LEAF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_HM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_HP; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_HZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_HZELDA; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_IS; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_KG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_KK; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_KR; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MD; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MK; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MK_BO; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MM_MT; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_MS; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_NZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_OC; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_OctBg; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_OT; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_PH; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_PM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_PO; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_PZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_RB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_RDB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_RDY; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_S1; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SH; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SM2; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_ST; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_ST_LINE; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_SW; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_TH; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_TH_BALL; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_TK; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_TK2; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_TK_BALL; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_TT; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_VT; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_WAP; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_WB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_WS; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_WW; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YC; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YD; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YD_LEAF; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YH; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YK; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YM_TAG; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YMB; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_YR; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_ZH; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_ZM; +DUSK_GAME_EXTERN process_profile_definition g_profile_E_ZS; +DUSK_GAME_EXTERN process_profile_definition g_profile_FORMATION_MNG; +DUSK_GAME_EXTERN process_profile_definition g_profile_GUARD_MNG; +DUSK_GAME_EXTERN process_profile_definition g_profile_HORSE; +DUSK_GAME_EXTERN process_profile_definition g_profile_HOZELDA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Izumi_Gate; +DUSK_GAME_EXTERN process_profile_definition g_profile_KAGO; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG01; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG02; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG03; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG06; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG07; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG08; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG09; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG12; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG13; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG15; +DUSK_GAME_EXTERN process_profile_definition g_profile_KYTAG16; +DUSK_GAME_EXTERN process_profile_definition g_profile_MANT; +DUSK_GAME_EXTERN process_profile_definition g_profile_FSHOP; +DUSK_GAME_EXTERN process_profile_definition g_profile_MIRROR; +DUSK_GAME_EXTERN process_profile_definition g_profile_MOVIE_PLAYER; +DUSK_GAME_EXTERN process_profile_definition g_profile_MYNA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ARU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ASH; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ASHB; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_BANS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_BLUENS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_BOU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_BOU_S; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_CD3; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_CHAT; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_CHIN; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_CLERKA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_CLERKB; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_CLERKT; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_COACH; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_DF; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_DOC; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_DOORBOY; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_DRSOL; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_DU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_FAIRY; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_FGUARD; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GND; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRC; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRD; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRM; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRMC; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRR; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GRZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GUARD; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_GWOLF; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_HANJO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_HENNA0; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_HOZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_IMPAL; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_INKO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_INS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_JAGAR; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KASIHANA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KASIKYU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KASIMICH; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KDK; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KN; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KNJ; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KOLINB; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_KYURY; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_LEN; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_LF; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_LUD; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_MIDP; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_MK; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_MOI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_MOIR; +DUSK_GAME_EXTERN process_profile_definition g_profile_MYNA2; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_NE; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_P2; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_PACHI_BESU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_PACHI_MARO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_PACHI_TARO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_PASSER; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_PASSER2; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_POST; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_POUYA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_PRAYER; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_RACA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_RAFREL; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SARU; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SEIB; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SEIC; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SEID; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SEIRA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SERA2; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SEIREI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SHAD; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SHAMAN; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SHOE; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SHOP0; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SMARO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SOLA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SOLDIERa; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SOLDIERb; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_SQ; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_THE; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_THEB; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TK; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TKC; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TKJ2; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TKS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TOBY; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_TR; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_URI; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_WORM; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_WRESTLER; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_YAMID; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_YAMIS; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_YAMIT; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_YELIA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_YKM; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_YKW; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZANB; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZANT; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZELR; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZELRO; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZELDA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZRA; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZRC; +DUSK_GAME_EXTERN process_profile_definition g_profile_NPC_ZRZ; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv5Key; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Turara; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TvCdlst; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ytaihou; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_AmiShutter; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ari; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_AUTOMATA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Avalanche; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_BALLOON; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BarDesk; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Batta; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BBox; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_BED; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Bemos; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Bhbridge; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BkLeaf; +DUSK_GAME_EXTERN process_profile_definition g_profile_BkyRock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BmWindow; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BoomShutter; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Bombf; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_BOUMATO; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_BRG; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_BsGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_awaPlar; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CatDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_CB; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ChainBlock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Cdoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Chandelier; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Chest; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Cho; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Cowdoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Crope; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CRVFENCE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CRVGATE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CRVHAHEN; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CRVLH_DW; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CRVLH_UP; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_CRVSTEEL; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Crystal; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ChainWall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_DamCps; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Dan; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Digholl; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_DigSnow; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Elevator; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Drop; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_DUST; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_E_CREATE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_FallObj; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Fan; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Fchain; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_FireWood; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_FireWood2; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_FirePillar; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_FirePillar2; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Flag; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Flag2; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Flag3; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_FOOD; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_FW; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_GADGET; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GanonWall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GanonWall2; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_GB; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Geyser; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_glowSphere; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_GM; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GoGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GOMIKABE; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_GRA; +DUSK_GAME_EXTERN process_profile_definition g_profile_GRA_WALL; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GraRock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GraveStone; +DUSK_GAME_EXTERN process_profile_definition g_profile_GRDWATER; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_GrzRock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_H_Saku; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_HBarrel; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_HFtr; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MHasu; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Hata; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_HB; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_HBombkoya; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_HeavySw; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Hfuta; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_HsTarget; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ice_l; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ice_s; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_IceBlock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_IceLeaf; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_IHASI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ikada; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_InoBone; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ITA; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_ITAMATO; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kabuto; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kag; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KAGE; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KAGO; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kaisou; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kam; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kantera; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kat; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KazeNeko; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KBOX; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KEY; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KEYHOLE; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KiPot; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_KITA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KJgjs; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KKanban; +DUSK_GAME_EXTERN process_profile_definition g_profile_KN_BULLET; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kshutter; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Kuw; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KWheel00; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KWheel01; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KznkArm; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Laundry; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_LndRope; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_LBOX; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_LP; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv1Cdl00; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv1Cdl01; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv3Candle; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv3Water; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv3Water2; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_LV3WATERB; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv3R10Saka; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WaterEff; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv4CandleDm; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv4Candle; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4EdShutter; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4Gate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4HsTarget; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4PoGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4RailWall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4SlideWall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4Bridge; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4Chan; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4DigSand; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4Floor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4Gear; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_PRElvtr; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4PRwall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv4Sand; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv5FBoard; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_IceWall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv5SwIce; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ychndlr; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_YIblltray; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6ChgGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6FuriTrap; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6Lblock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6SwGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6SzGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6Tenbin; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6TogeRoll; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6TogeTrap; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6bemos; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6bemos2; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6EGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6ElevtA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv6SwTurn; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv7BsGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv7PropY; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv7Bridge; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv8KekkaiTrap; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv8Lift; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv8OptiLift; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv8UdFloor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Lv9SwShutter; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MagLift; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MagLiftRot; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_MAKI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MasterSword; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Mato; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MHole; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_MIE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Mirror6Pole; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MirrorChain; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MirrorSand; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MirrorScrew; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MirrorTable; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_MSIMA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_MvStair; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_MYOGAN; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Nagaisu; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Nan; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_NDOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_NOUGU; +DUSK_GAME_EXTERN process_profile_definition g_profile_OCTHASHI; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_OILTUBO; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Onsen; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_ONSEN_FIRE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_OnsenTaru; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_PushDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_PDtile; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_PDwall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Picture; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Pillar; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_PLEAF; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_poCandle; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_poFire; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_poTbox; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Prop; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_PUMPKIN; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RCircle; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RfHole; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RiderGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RIVERROCK; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_ROCK; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RotBridge; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RotTrap; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_ROTEN; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_RotStair; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_RW; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Saidan; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Sakuita; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ItaRope; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SCannon; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SCannonCrs; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SCannonTen; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SEKIDOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SEKIZO; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SEKIZOA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Shield; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SM_DOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SmallKey; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SmgDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Smoke; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SMTILE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SmWStone; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_SnowEff; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SnowSoup; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SO; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SpinLift; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SSDRINK; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SSITEM; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_StairBlock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Stone; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Stopper; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Stopper2; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SUISYA; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_SW; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwBallA; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwBallB; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwBallC; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwLight; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwChain; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwHang; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Sword; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Swpush2; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwSpinner; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SwTurn; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SyRock; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_SZbridge; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TaFence; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Table; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TakaraDai; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_TATIGI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Ten; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TestCube; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Gake; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_THASHI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TimeFire; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_TKS; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TMoon; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ToaruMaki; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_TOBY; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TobyHouse; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TogeTrap; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Tombo; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Tornado; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Tornado2; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_TP; +DUSK_GAME_EXTERN process_profile_definition g_profile_TREESH; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_TwGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_UDOOR; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_USAKU; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_VolcGnd; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_VolcanicBall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_VolcanicBomb; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_KakarikoBrg; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_OrdinBrg; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WtGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WaterPillar; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WaterFall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Wchain; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WdStick; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_WEB0; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_WEB1; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WellCover; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_WFLAG; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WindStone; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_Window; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WoodPendulum; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WoodStatue; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_WoodenSword; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_YBAG; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_YSTONE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ZoraCloth; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ZDoor; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_zrTurara; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_zrTuraraRc; +DUSK_GAME_EXTERN process_profile_definition g_profile_ZRA_MARK; +DUSK_GAME_EXTERN process_profile_definition g_profile_OBJ_ZRAFREEZE; +DUSK_GAME_EXTERN process_profile_definition g_profile_Obj_ZraRock; +DUSK_GAME_EXTERN process_profile_definition g_profile_PASSER_MNG; +DUSK_GAME_EXTERN process_profile_definition g_profile_PERU; +DUSK_GAME_EXTERN process_profile_definition g_profile_PPolamp; +DUSK_GAME_EXTERN process_profile_definition g_profile_SKIP2D; +DUSK_GAME_EXTERN process_profile_definition g_profile_START_AND_GOAL; +DUSK_GAME_EXTERN process_profile_definition g_profile_SwBall; +DUSK_GAME_EXTERN process_profile_definition g_profile_SwLBall; +DUSK_GAME_EXTERN process_profile_definition g_profile_SwTime; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv6Gate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv7Gate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv8Gate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_TWGate; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Arena; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Assist; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_BTLITM; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_ChgRestart; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_CSW; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Escape; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_FWall; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_GRA; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_GUARD; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Instruction; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_KagoFall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_LightBall; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_LV5SOUP; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Lv6CstaSw; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Mmsg; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Mwait; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_MYNA2; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_MNLIGHT; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_PATI; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_poFire; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_QS; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_RetRoom; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_RiverBack; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_RmbitSw; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Schedule; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_SetBall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Restart; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_SHOPCAM; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_SHOPITM; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_SmkEmt; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Spinner; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Sppath; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_SSDRINK; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Stream; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_TheBHint; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_WaraHowl; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_WatchGe; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_WaterFall; +DUSK_GAME_EXTERN process_profile_definition g_profile_Tag_Wljump; +DUSK_GAME_EXTERN process_profile_definition g_profile_TAG_YAMI; +DUSK_GAME_EXTERN process_profile_definition g_profile_TALK; +DUSK_GAME_EXTERN process_profile_definition g_profile_TBOX_SW; +DUSK_GAME_EXTERN process_profile_definition g_profile_TITLE; +DUSK_GAME_EXTERN process_profile_definition g_profile_WarpBug; #else -extern actor_process_profile_definition g_profile_ALINK; -extern actor_process_profile_definition g_profile_NO_CHG_ROOM; -extern actor_process_profile_definition g_profile_ITEM; -extern camera_process_profile_definition g_profile_CAMERA; -extern camera_process_profile_definition g_profile_CAMERA2; -extern kankyo_process_profile_definition g_profile_ENVSE; -extern msg_process_profile_definition g_profile_GAMEOVER; -extern kankyo_process_profile_definition g_profile_KANKYO; -extern kankyo_process_profile_definition g_profile_KYEFF; -extern kankyo_process_profile_definition g_profile_KYEFF2; -extern kankyo_process_profile_definition g_profile_KY_THUNDER; -extern msg_process_profile_definition g_profile_MENUWINDOW; -extern msg_process_profile_definition g_profile_METER2; -extern msg_process_profile_definition g_profile_MSG_OBJECT; -extern overlap_process_profile_definition g_profile_OVERLAP0; -extern overlap_process_profile_definition g_profile_OVERLAP1; -extern overlap_process_profile_definition g_profile_OVERLAP6; -extern overlap_process_profile_definition g_profile_OVERLAP7; -extern overlap_process_profile_definition g_profile_OVERLAP8; -extern overlap_process_profile_definition g_profile_OVERLAP9; -extern overlap_process_profile_definition g_profile_OVERLAP10; -extern overlap_process_profile_definition g_profile_OVERLAP11; -extern overlap_process_profile_definition g_profile_OVERLAP2; -extern overlap_process_profile_definition g_profile_OVERLAP3; -extern scene_process_profile_definition g_profile_LOGO_SCENE; -extern scene_process_profile_definition g_profile_MENU_SCENE; -extern scene_process_profile_definition g_profile_NAME_SCENE; -extern scene_process_profile_definition g_profile_NAMEEX_SCENE; -extern scene_process_profile_definition g_profile_PLAY_SCENE; -extern scene_process_profile_definition g_profile_OPENING_SCENE; -extern scene_process_profile_definition g_profile_ROOM_SCENE; -extern scene_process_profile_definition g_profile_WARNING_SCENE; -extern scene_process_profile_definition g_profile_WARNING2_SCENE; -extern msg_process_profile_definition g_profile_TIMER; -extern kankyo_process_profile_definition g_profile_WMARK; -extern kankyo_process_profile_definition g_profile_WPILLAR; -extern actor_process_profile_definition g_profile_ANDSW; -extern actor_process_profile_definition2 g_profile_BG; -extern actor_process_profile_definition g_profile_BG_OBJ; -extern actor_process_profile_definition g_profile_DMIDNA; -extern actor_process_profile_definition g_profile_DBDOOR; -extern actor_process_profile_definition g_profile_KNOB20; -extern actor_process_profile_definition g_profile_DOOR20; -extern actor_process_profile_definition g_profile_SPIRAL_DOOR; -extern actor_process_profile_definition2 g_profile_DSHUTTER; -extern actor_process_profile_definition g_profile_EP; -extern actor_process_profile_definition g_profile_HITOBJ; -extern actor_process_profile_definition g_profile_KYTAG00; -extern actor_process_profile_definition g_profile_KYTAG04; -extern actor_process_profile_definition g_profile_KYTAG17; -extern actor_process_profile_definition g_profile_OBJ_BEF; -extern actor_process_profile_definition g_profile_Obj_BurnBox; -extern actor_process_profile_definition g_profile_Obj_Carry; -extern actor_process_profile_definition g_profile_OBJ_ITO; -extern actor_process_profile_definition g_profile_Obj_Movebox; -extern actor_process_profile_definition g_profile_Obj_Swpush; -extern actor_process_profile_definition g_profile_Obj_Timer; -extern actor_process_profile_definition2 g_profile_PATH_LINE; -extern actor_process_profile_definition2 g_profile_SCENE_EXIT; -extern actor_process_profile_definition g_profile_SET_BG_OBJ; -extern actor_process_profile_definition g_profile_SWHIT0; -extern actor_process_profile_definition g_profile_TAG_ALLMATO; -extern actor_process_profile_definition g_profile_TAG_CAMERA; -extern actor_process_profile_definition g_profile_TAG_CHKPOINT; -extern actor_process_profile_definition g_profile_TAG_EVENT; -extern actor_process_profile_definition g_profile_TAG_EVT; -extern actor_process_profile_definition g_profile_TAG_EVTAREA; -extern actor_process_profile_definition g_profile_TAG_EVTMSG; -extern actor_process_profile_definition g_profile_TAG_HOWL; -extern actor_process_profile_definition g_profile_TAG_KMSG; -extern actor_process_profile_definition g_profile_TAG_LANTERN; -extern actor_process_profile_definition g_profile_Tag_Mist; -extern actor_process_profile_definition g_profile_TAG_MSG; -extern actor_process_profile_definition g_profile_TAG_PUSH; -extern actor_process_profile_definition g_profile_TAG_TELOP; -extern actor_process_profile_definition g_profile_TBOX; -extern actor_process_profile_definition g_profile_TBOX2; -extern actor_process_profile_definition g_profile_VRBOX; -extern actor_process_profile_definition g_profile_VRBOX2; -extern actor_process_profile_definition g_profile_ARROW; -extern actor_process_profile_definition g_profile_BOOMERANG; -extern actor_process_profile_definition g_profile_CROD; -extern actor_process_profile_definition g_profile_DEMO00; -extern actor_process_profile_definition g_profile_DISAPPEAR; -extern actor_process_profile_definition g_profile_MG_ROD; -extern actor_process_profile_definition g_profile_MIDNA; -extern actor_process_profile_definition g_profile_NBOMB; -extern actor_process_profile_definition g_profile_Obj_LifeContainer; -extern actor_process_profile_definition g_profile_Obj_Yousei; -extern actor_process_profile_definition g_profile_SPINNER; -extern actor_process_profile_definition g_profile_SUSPEND; -extern actor_process_profile_definition g_profile_Tag_Attp; -extern actor_process_profile_definition g_profile_ALLDIE; -extern actor_process_profile_definition g_profile_ANDSW2; -extern actor_process_profile_definition g_profile_BD; -extern actor_process_profile_definition g_profile_CANOE; -extern actor_process_profile_definition g_profile_CSTAF; -extern actor_process_profile_definition g_profile_Demo_Item; -extern actor_process_profile_definition g_profile_L1BOSS_DOOR; -extern actor_process_profile_definition g_profile_E_DN; -extern actor_process_profile_definition g_profile_E_FM; -extern actor_process_profile_definition g_profile_E_GA; -extern actor_process_profile_definition g_profile_E_HB; -extern actor_process_profile_definition g_profile_E_NEST; -extern actor_process_profile_definition g_profile_E_RD; -extern actor_process_profile_definition g_profile_ECONT; -extern actor_process_profile_definition g_profile_FR; -extern actor_process_profile_definition g_profile_GRASS; -extern actor_process_profile_definition g_profile_KYTAG05; -extern actor_process_profile_definition g_profile_KYTAG10; -extern actor_process_profile_definition g_profile_KYTAG11; -extern actor_process_profile_definition g_profile_KYTAG14; -extern actor_process_profile_definition g_profile_MG_FISH; -extern actor_process_profile_definition g_profile_NPC_BESU; -extern actor_process_profile_definition g_profile_NPC_FAIRY_SEIREI; -extern actor_process_profile_definition g_profile_NPC_FISH; -extern actor_process_profile_definition g_profile_NPC_HENNA; -extern actor_process_profile_definition g_profile_NPC_KAKASHI; -extern actor_process_profile_definition g_profile_NPC_KKRI; -extern actor_process_profile_definition g_profile_NPC_KOLIN; -extern actor_process_profile_definition g_profile_NPC_MARO; -extern actor_process_profile_definition g_profile_NPC_TARO; -extern actor_process_profile_definition g_profile_NPC_TKJ; -extern actor_process_profile_definition g_profile_Obj_BHASHI; -extern actor_process_profile_definition g_profile_Obj_BkDoor; -extern actor_process_profile_definition g_profile_Obj_BossWarp; -extern actor_process_profile_definition g_profile_Obj_Cboard; -extern actor_process_profile_definition g_profile_Obj_Digpl; -extern actor_process_profile_definition g_profile_Obj_Eff; -extern actor_process_profile_definition g_profile_OBJ_FMOBJ; -extern actor_process_profile_definition g_profile_Obj_GpTaru; -extern actor_process_profile_definition g_profile_Obj_HHASHI; -extern actor_process_profile_definition g_profile_OBJ_KANBAN2; -extern actor_process_profile_definition g_profile_OBJ_KBACKET; -extern actor_process_profile_definition g_profile_Obj_KkrGate; -extern actor_process_profile_definition g_profile_Obj_KLift00; -extern actor_process_profile_definition g_profile_Tag_KtOnFire; -extern actor_process_profile_definition g_profile_Obj_Ladder; -extern actor_process_profile_definition g_profile_Obj_Lv2Candle; -extern actor_process_profile_definition g_profile_Obj_MagneArm; -extern actor_process_profile_definition g_profile_Obj_MetalBox; -extern actor_process_profile_definition g_profile_Obj_MGate; -extern actor_process_profile_definition g_profile_Obj_NamePlate; -extern actor_process_profile_definition g_profile_Obj_OnCloth; -extern actor_process_profile_definition g_profile_Obj_RopeBridge; -extern actor_process_profile_definition g_profile_Obj_SwallShutter; -extern actor_process_profile_definition g_profile_OBJ_STICK; -extern actor_process_profile_definition g_profile_Obj_StoneMark; -extern actor_process_profile_definition g_profile_Obj_Swpropeller; -extern actor_process_profile_definition g_profile_Obj_Swpush5; -extern actor_process_profile_definition g_profile_Obj_Yobikusa; -extern actor_process_profile_definition g_profile_SCENE_EXIT2; -extern actor_process_profile_definition g_profile_ShopItem; -extern actor_process_profile_definition g_profile_SQ; -extern actor_process_profile_definition g_profile_SWC00; -extern actor_process_profile_definition g_profile_Tag_CstaSw; -extern actor_process_profile_definition g_profile_Tag_AJnot; -extern actor_process_profile_definition g_profile_Tag_AttackItem; -extern actor_process_profile_definition g_profile_Tag_Gstart; -extern actor_process_profile_definition g_profile_Tag_Hinit; -extern actor_process_profile_definition g_profile_Tag_Hjump; -extern actor_process_profile_definition g_profile_Tag_Hstop; -extern actor_process_profile_definition g_profile_Tag_Lv2PrChk; -extern actor_process_profile_definition g_profile_Tag_Magne; -extern actor_process_profile_definition g_profile_Tag_Mhint; -extern actor_process_profile_definition g_profile_Tag_Mstop; -extern actor_process_profile_definition g_profile_Tag_Spring; -extern actor_process_profile_definition g_profile_Tag_Statue; -extern actor_process_profile_definition g_profile_Ykgr; -extern actor_process_profile_definition g_profile_DR; -extern actor_process_profile_definition g_profile_L7lowDr; -extern actor_process_profile_definition g_profile_L7ODR; -extern actor_process_profile_definition g_profile_B_BH; -extern actor_process_profile_definition g_profile_B_BQ; -extern actor_process_profile_definition g_profile_B_DR; -extern actor_process_profile_definition g_profile_B_DRE; -extern actor_process_profile_definition g_profile_B_DS; -extern actor_process_profile_definition g_profile_B_GG; -extern actor_process_profile_definition g_profile_B_GM; -extern actor_process_profile_definition g_profile_B_GND; -extern actor_process_profile_definition g_profile_B_GO; -extern actor_process_profile_definition g_profile_B_GOS; -extern actor_process_profile_definition g_profile_B_MGN; -extern actor_process_profile_definition g_profile_B_OB; -extern actor_process_profile_definition g_profile_B_OH; -extern actor_process_profile_definition g_profile_B_OH2; -extern actor_process_profile_definition g_profile_B_TN; -extern actor_process_profile_definition g_profile_B_YO; -extern actor_process_profile_definition g_profile_B_YOI; -extern actor_process_profile_definition g_profile_B_ZANT; -extern actor_process_profile_definition g_profile_B_ZANTM; -extern actor_process_profile_definition g_profile_B_ZANTZ; -extern actor_process_profile_definition g_profile_B_ZANTS; -extern actor_process_profile_definition g_profile_BALLOON2D; -extern actor_process_profile_definition g_profile_BULLET; -extern actor_process_profile_definition g_profile_COACH2D; -extern actor_process_profile_definition g_profile_COACH_FIRE; -extern actor_process_profile_definition g_profile_COW; -extern actor_process_profile_definition g_profile_CSTATUE; -extern actor_process_profile_definition g_profile_DO; -extern actor_process_profile_definition g_profile_BOSS_DOOR; -extern actor_process_profile_definition g_profile_L5BOSS_DOOR; -extern actor_process_profile_definition g_profile_L1MBOSS_DOOR; -extern actor_process_profile_definition g_profile_PushDoor; -extern actor_process_profile_definition g_profile_E_AI; -extern actor_process_profile_definition g_profile_E_ARROW; -extern actor_process_profile_definition g_profile_E_BA; -extern actor_process_profile_definition g_profile_E_BEE; -extern actor_process_profile_definition g_profile_E_BG; -extern actor_process_profile_definition g_profile_E_BI; -extern actor_process_profile_definition g_profile_E_BI_LEAF; -extern actor_process_profile_definition g_profile_E_BS; -extern actor_process_profile_definition g_profile_E_BU; -extern actor_process_profile_definition g_profile_E_BUG; -extern actor_process_profile_definition g_profile_E_CR; -extern actor_process_profile_definition g_profile_E_CR_EGG; -extern actor_process_profile_definition g_profile_E_DB; -extern actor_process_profile_definition g_profile_E_DB_LEAF; -extern actor_process_profile_definition g_profile_E_DD; -extern actor_process_profile_definition g_profile_E_DF; -extern actor_process_profile_definition g_profile_E_DK; -extern actor_process_profile_definition g_profile_E_DT; -extern actor_process_profile_definition g_profile_E_FB; -extern actor_process_profile_definition g_profile_E_FK; -extern actor_process_profile_definition g_profile_E_FS; -extern actor_process_profile_definition g_profile_E_FZ; -extern actor_process_profile_definition g_profile_E_GB; -extern actor_process_profile_definition g_profile_E_GE; -extern actor_process_profile_definition g_profile_E_GI; -extern actor_process_profile_definition g_profile_E_GM; -extern actor_process_profile_definition g_profile_E_GOB; -extern actor_process_profile_definition g_profile_E_GS; -extern actor_process_profile_definition g_profile_E_HB_LEAF; -extern actor_process_profile_definition g_profile_E_HM; -extern actor_process_profile_definition g_profile_E_HP; -extern actor_process_profile_definition g_profile_E_HZ; -extern actor_process_profile_definition g_profile_E_HZELDA; -extern actor_process_profile_definition g_profile_E_IS; -extern actor_process_profile_definition g_profile_E_KG; -extern actor_process_profile_definition g_profile_E_KK; -extern actor_process_profile_definition g_profile_E_KR; -extern actor_process_profile_definition g_profile_E_MB; -extern actor_process_profile_definition g_profile_E_MD; -extern actor_process_profile_definition g_profile_E_MF; -extern actor_process_profile_definition g_profile_E_MK; -extern actor_process_profile_definition g_profile_E_MK_BO; -extern actor_process_profile_definition g_profile_E_MM; -extern actor_process_profile_definition g_profile_E_MM_MT; -extern actor_process_profile_definition g_profile_E_MS; -extern actor_process_profile_definition g_profile_E_NZ; -extern actor_process_profile_definition g_profile_E_OC; -extern actor_process_profile_definition g_profile_E_OctBg; -extern actor_process_profile_definition g_profile_E_OT; -extern actor_process_profile_definition g_profile_E_PH; -extern actor_process_profile_definition g_profile_E_PM; -extern actor_process_profile_definition g_profile_E_PO; -extern actor_process_profile_definition g_profile_E_PZ; -extern actor_process_profile_definition g_profile_E_RB; -extern actor_process_profile_definition g_profile_E_RDB; -extern actor_process_profile_definition g_profile_E_RDY; -extern actor_process_profile_definition g_profile_E_S1; -extern actor_process_profile_definition g_profile_E_SB; -extern actor_process_profile_definition g_profile_E_SF; -extern actor_process_profile_definition g_profile_E_SG; -extern actor_process_profile_definition g_profile_E_SH; -extern actor_process_profile_definition g_profile_E_SM; -extern actor_process_profile_definition g_profile_E_SM2; -extern actor_process_profile_definition g_profile_E_ST; -extern actor_process_profile_definition g_profile_E_ST_LINE; -extern actor_process_profile_definition g_profile_E_SW; -extern actor_process_profile_definition g_profile_E_TH; -extern actor_process_profile_definition g_profile_E_TH_BALL; -extern actor_process_profile_definition g_profile_E_TK; -extern actor_process_profile_definition g_profile_E_TK2; -extern actor_process_profile_definition g_profile_E_TK_BALL; -extern actor_process_profile_definition g_profile_E_TT; -extern actor_process_profile_definition g_profile_E_VT; -extern actor_process_profile_definition g_profile_E_WAP; -extern actor_process_profile_definition g_profile_E_WB; -extern actor_process_profile_definition g_profile_E_WS; -extern actor_process_profile_definition g_profile_E_WW; -extern actor_process_profile_definition g_profile_E_YC; -extern actor_process_profile_definition g_profile_E_YD; -extern actor_process_profile_definition g_profile_E_YD_LEAF; -extern actor_process_profile_definition g_profile_E_YG; -extern actor_process_profile_definition g_profile_E_YH; -extern actor_process_profile_definition g_profile_E_YK; -extern actor_process_profile_definition g_profile_E_YM; -extern actor_process_profile_definition g_profile_E_YM_TAG; -extern actor_process_profile_definition g_profile_E_YMB; -extern actor_process_profile_definition g_profile_E_YR; -extern actor_process_profile_definition g_profile_E_ZH; -extern actor_process_profile_definition g_profile_E_ZM; -extern actor_process_profile_definition g_profile_E_ZS; -extern actor_process_profile_definition g_profile_FORMATION_MNG; -extern actor_process_profile_definition g_profile_GUARD_MNG; -extern actor_process_profile_definition g_profile_HORSE; -extern actor_process_profile_definition g_profile_HOZELDA; -extern actor_process_profile_definition g_profile_Izumi_Gate; -extern actor_process_profile_definition g_profile_KAGO; -extern actor_process_profile_definition g_profile_KYTAG01; -extern actor_process_profile_definition g_profile_KYTAG02; -extern actor_process_profile_definition g_profile_KYTAG03; -extern actor_process_profile_definition g_profile_KYTAG06; -extern actor_process_profile_definition g_profile_KYTAG07; -extern actor_process_profile_definition g_profile_KYTAG08; -extern actor_process_profile_definition g_profile_KYTAG09; -extern actor_process_profile_definition g_profile_KYTAG12; -extern actor_process_profile_definition g_profile_KYTAG13; -extern actor_process_profile_definition g_profile_KYTAG15; -extern actor_process_profile_definition g_profile_KYTAG16; -extern actor_process_profile_definition g_profile_MANT; -extern actor_process_profile_definition g_profile_FSHOP; -extern actor_process_profile_definition g_profile_MIRROR; -extern actor_process_profile_definition g_profile_MOVIE_PLAYER; -extern actor_process_profile_definition g_profile_MYNA; -extern actor_process_profile_definition g_profile_NI; -extern actor_process_profile_definition g_profile_NPC_ARU; -extern actor_process_profile_definition g_profile_NPC_ASH; -extern actor_process_profile_definition g_profile_NPC_ASHB; -extern actor_process_profile_definition g_profile_NPC_BANS; -extern actor_process_profile_definition g_profile_NPC_BLUENS; -extern actor_process_profile_definition g_profile_NPC_BOU; -extern actor_process_profile_definition g_profile_NPC_BOU_S; -extern actor_process_profile_definition g_profile_NPC_CD3; -extern actor_process_profile_definition g_profile_NPC_CHAT; -extern actor_process_profile_definition g_profile_NPC_CHIN; -extern actor_process_profile_definition g_profile_NPC_CLERKA; -extern actor_process_profile_definition g_profile_NPC_CLERKB; -extern actor_process_profile_definition g_profile_NPC_CLERKT; -extern actor_process_profile_definition g_profile_NPC_COACH; -extern actor_process_profile_definition g_profile_NPC_DF; -extern actor_process_profile_definition g_profile_NPC_DOC; -extern actor_process_profile_definition g_profile_NPC_DOORBOY; -extern actor_process_profile_definition g_profile_NPC_DRSOL; -extern actor_process_profile_definition g_profile_NPC_DU; -extern actor_process_profile_definition g_profile_NPC_FAIRY; -extern actor_process_profile_definition g_profile_NPC_FGUARD; -extern actor_process_profile_definition g_profile_NPC_GND; -extern actor_process_profile_definition g_profile_NPC_GRA; -extern actor_process_profile_definition g_profile_NPC_GRC; -extern actor_process_profile_definition g_profile_NPC_GRD; -extern actor_process_profile_definition g_profile_NPC_GRM; -extern actor_process_profile_definition g_profile_NPC_GRMC; -extern actor_process_profile_definition g_profile_NPC_GRO; -extern actor_process_profile_definition g_profile_NPC_GRR; -extern actor_process_profile_definition g_profile_NPC_GRS; -extern actor_process_profile_definition g_profile_NPC_GRZ; -extern actor_process_profile_definition g_profile_NPC_GUARD; -extern actor_process_profile_definition g_profile_NPC_GWOLF; -extern actor_process_profile_definition g_profile_NPC_HANJO; -extern actor_process_profile_definition g_profile_NPC_HENNA0; -extern actor_process_profile_definition g_profile_NPC_HOZ; -extern actor_process_profile_definition g_profile_NPC_IMPAL; -extern actor_process_profile_definition g_profile_NPC_INKO; -extern actor_process_profile_definition g_profile_NPC_INS; -extern actor_process_profile_definition g_profile_NPC_JAGAR; -extern actor_process_profile_definition g_profile_NPC_KASIHANA; -extern actor_process_profile_definition g_profile_NPC_KASIKYU; -extern actor_process_profile_definition g_profile_NPC_KASIMICH; -extern actor_process_profile_definition g_profile_NPC_KDK; -extern actor_process_profile_definition g_profile_NPC_KN; -extern actor_process_profile_definition g_profile_NPC_KNJ; -extern actor_process_profile_definition g_profile_NPC_KOLINB; -extern actor_process_profile_definition g_profile_NPC_KS; -extern actor_process_profile_definition g_profile_NPC_KYURY; -extern actor_process_profile_definition g_profile_NPC_LEN; -extern actor_process_profile_definition g_profile_NPC_LF; -extern actor_process_profile_definition g_profile_NPC_LUD; -extern actor_process_profile_definition g_profile_NPC_MIDP; -extern actor_process_profile_definition g_profile_NPC_MK; -extern actor_process_profile_definition g_profile_NPC_MOI; -extern actor_process_profile_definition g_profile_NPC_MOIR; -extern actor_process_profile_definition g_profile_MYNA2; -extern actor_process_profile_definition g_profile_NPC_NE; -extern actor_process_profile_definition g_profile_NPC_P2; -extern actor_process_profile_definition g_profile_NPC_PACHI_BESU; -extern actor_process_profile_definition g_profile_NPC_PACHI_MARO; -extern actor_process_profile_definition g_profile_NPC_PACHI_TARO; -extern actor_process_profile_definition g_profile_NPC_PASSER; -extern actor_process_profile_definition g_profile_NPC_PASSER2; -extern actor_process_profile_definition g_profile_NPC_POST; -extern actor_process_profile_definition g_profile_NPC_POUYA; -extern actor_process_profile_definition g_profile_NPC_PRAYER; -extern actor_process_profile_definition g_profile_NPC_RACA; -extern actor_process_profile_definition g_profile_NPC_RAFREL; -extern actor_process_profile_definition g_profile_NPC_SARU; -extern actor_process_profile_definition g_profile_NPC_SEIB; -extern actor_process_profile_definition g_profile_NPC_SEIC; -extern actor_process_profile_definition g_profile_NPC_SEID; -extern actor_process_profile_definition g_profile_NPC_SEIRA; -extern actor_process_profile_definition g_profile_NPC_SERA2; -extern actor_process_profile_definition g_profile_NPC_SEIREI; -extern actor_process_profile_definition g_profile_NPC_SHAD; -extern actor_process_profile_definition g_profile_NPC_SHAMAN; -extern actor_process_profile_definition g_profile_NPC_SHOE; -extern actor_process_profile_definition g_profile_NPC_SHOP0; -extern actor_process_profile_definition g_profile_NPC_SMARO; -extern actor_process_profile_definition g_profile_NPC_SOLA; -extern actor_process_profile_definition g_profile_NPC_SOLDIERa; -extern actor_process_profile_definition g_profile_NPC_SOLDIERb; -extern actor_process_profile_definition g_profile_NPC_SQ; -extern actor_process_profile_definition g_profile_NPC_THE; -extern actor_process_profile_definition g_profile_NPC_THEB; -extern actor_process_profile_definition g_profile_NPC_TK; -extern actor_process_profile_definition g_profile_NPC_TKC; -extern actor_process_profile_definition g_profile_NPC_TKJ2; -extern actor_process_profile_definition g_profile_NPC_TKS; -extern actor_process_profile_definition g_profile_NPC_TOBY; -extern actor_process_profile_definition g_profile_NPC_TR; -extern actor_process_profile_definition g_profile_NPC_URI; -extern actor_process_profile_definition g_profile_NPC_WORM; -extern actor_process_profile_definition g_profile_NPC_WRESTLER; -extern actor_process_profile_definition g_profile_NPC_YAMID; -extern actor_process_profile_definition g_profile_NPC_YAMIS; -extern actor_process_profile_definition g_profile_NPC_YAMIT; -extern actor_process_profile_definition g_profile_NPC_YELIA; -extern actor_process_profile_definition g_profile_NPC_YKM; -extern actor_process_profile_definition g_profile_NPC_YKW; -extern actor_process_profile_definition g_profile_NPC_ZANB; -extern actor_process_profile_definition g_profile_NPC_ZANT; -extern actor_process_profile_definition g_profile_NPC_ZELR; -extern actor_process_profile_definition g_profile_NPC_ZELRO; -extern actor_process_profile_definition g_profile_NPC_ZELDA; -extern actor_process_profile_definition g_profile_NPC_ZRA; -extern actor_process_profile_definition g_profile_NPC_ZRC; -extern actor_process_profile_definition g_profile_NPC_ZRZ; -extern actor_process_profile_definition g_profile_Obj_Lv5Key; -extern actor_process_profile_definition g_profile_Obj_Turara; -extern actor_process_profile_definition g_profile_Obj_TvCdlst; -extern actor_process_profile_definition g_profile_Obj_Ytaihou; -extern actor_process_profile_definition g_profile_Obj_AmiShutter; -extern actor_process_profile_definition g_profile_Obj_Ari; -extern actor_process_profile_definition g_profile_OBJ_AUTOMATA; -extern actor_process_profile_definition g_profile_Obj_Avalanche; -extern actor_process_profile_definition g_profile_OBJ_BALLOON; -extern actor_process_profile_definition g_profile_Obj_BarDesk; -extern actor_process_profile_definition g_profile_Obj_Batta; -extern actor_process_profile_definition g_profile_Obj_BBox; -extern actor_process_profile_definition g_profile_OBJ_BED; -extern actor_process_profile_definition g_profile_Obj_Bemos; -extern actor_process_profile_definition g_profile_Obj_Bhbridge; -extern actor_process_profile_definition g_profile_Obj_BkLeaf; -extern actor_process_profile_definition g_profile_BkyRock; -extern actor_process_profile_definition g_profile_Obj_BmWindow; -extern actor_process_profile_definition g_profile_Obj_BoomShutter; -extern actor_process_profile_definition g_profile_Obj_Bombf; -extern actor_process_profile_definition g_profile_OBJ_BOUMATO; -extern actor_process_profile_definition g_profile_OBJ_BRG; -extern actor_process_profile_definition g_profile_Obj_BsGate; -extern actor_process_profile_definition g_profile_Obj_awaPlar; -extern actor_process_profile_definition g_profile_Obj_CatDoor; -extern actor_process_profile_definition g_profile_OBJ_CB; -extern actor_process_profile_definition g_profile_Obj_ChainBlock; -extern actor_process_profile_definition g_profile_Obj_Cdoor; -extern actor_process_profile_definition g_profile_Obj_Chandelier; -extern actor_process_profile_definition g_profile_Obj_Chest; -extern actor_process_profile_definition g_profile_Obj_Cho; -extern actor_process_profile_definition g_profile_Obj_Cowdoor; -extern actor_process_profile_definition g_profile_Obj_Crope; -extern actor_process_profile_definition g_profile_Obj_CRVFENCE; -extern actor_process_profile_definition g_profile_Obj_CRVGATE; -extern actor_process_profile_definition g_profile_Obj_CRVHAHEN; -extern actor_process_profile_definition g_profile_Obj_CRVLH_DW; -extern actor_process_profile_definition g_profile_Obj_CRVLH_UP; -extern actor_process_profile_definition g_profile_Obj_CRVSTEEL; -extern actor_process_profile_definition g_profile_Obj_Crystal; -extern actor_process_profile_definition g_profile_Obj_ChainWall; -extern actor_process_profile_definition g_profile_Obj_DamCps; -extern actor_process_profile_definition g_profile_Obj_Dan; -extern actor_process_profile_definition g_profile_Obj_Digholl; -extern actor_process_profile_definition g_profile_Obj_DigSnow; -extern actor_process_profile_definition g_profile_Obj_Elevator; -extern actor_process_profile_definition g_profile_Obj_Drop; -extern actor_process_profile_definition g_profile_Obj_DUST; -extern actor_process_profile_definition g_profile_Obj_E_CREATE; -extern actor_process_profile_definition g_profile_Obj_FallObj; -extern actor_process_profile_definition g_profile_Obj_Fan; -extern actor_process_profile_definition g_profile_Obj_Fchain; -extern actor_process_profile_definition g_profile_Obj_FireWood; -extern actor_process_profile_definition g_profile_Obj_FireWood2; -extern actor_process_profile_definition g_profile_Obj_FirePillar; -extern actor_process_profile_definition g_profile_Obj_FirePillar2; -extern actor_process_profile_definition g_profile_Obj_Flag; -extern actor_process_profile_definition g_profile_Obj_Flag2; -extern actor_process_profile_definition g_profile_Obj_Flag3; -extern actor_process_profile_definition g_profile_OBJ_FOOD; -extern actor_process_profile_definition g_profile_OBJ_FW; -extern actor_process_profile_definition g_profile_OBJ_GADGET; -extern actor_process_profile_definition g_profile_Obj_GanonWall; -extern actor_process_profile_definition g_profile_Obj_GanonWall2; -extern actor_process_profile_definition g_profile_OBJ_GB; -extern actor_process_profile_definition g_profile_Obj_Geyser; -extern actor_process_profile_definition g_profile_Obj_glowSphere; -extern actor_process_profile_definition g_profile_OBJ_GM; -extern actor_process_profile_definition g_profile_Obj_GoGate; -extern actor_process_profile_definition g_profile_Obj_GOMIKABE; -extern actor_process_profile_definition g_profile_OBJ_GRA; -extern actor_process_profile_definition g_profile_GRA_WALL; -extern actor_process_profile_definition g_profile_Obj_GraRock; -extern actor_process_profile_definition g_profile_Obj_GraveStone; -extern actor_process_profile_definition g_profile_GRDWATER; -extern actor_process_profile_definition g_profile_Obj_GrzRock; -extern actor_process_profile_definition g_profile_Obj_H_Saku; -extern actor_process_profile_definition g_profile_Obj_HBarrel; -extern actor_process_profile_definition g_profile_Obj_HFtr; -extern actor_process_profile_definition g_profile_Obj_MHasu; -extern actor_process_profile_definition g_profile_Obj_Hata; -extern actor_process_profile_definition g_profile_OBJ_HB; -extern actor_process_profile_definition g_profile_Obj_HBombkoya; -extern actor_process_profile_definition g_profile_Obj_HeavySw; -extern actor_process_profile_definition g_profile_Obj_Hfuta; -extern actor_process_profile_definition g_profile_Obj_HsTarget; -extern actor_process_profile_definition g_profile_Obj_Ice_l; -extern actor_process_profile_definition g_profile_Obj_Ice_s; -extern actor_process_profile_definition g_profile_Obj_IceBlock; -extern actor_process_profile_definition g_profile_Obj_IceLeaf; -extern actor_process_profile_definition g_profile_OBJ_IHASI; -extern actor_process_profile_definition g_profile_Obj_Ikada; -extern actor_process_profile_definition g_profile_Obj_InoBone; -extern actor_process_profile_definition g_profile_Obj_ITA; -extern actor_process_profile_definition g_profile_OBJ_ITAMATO; -extern actor_process_profile_definition g_profile_Obj_Kabuto; -extern actor_process_profile_definition g_profile_Obj_Kag; -extern actor_process_profile_definition g_profile_OBJ_KAGE; -extern actor_process_profile_definition g_profile_OBJ_KAGO; -extern actor_process_profile_definition g_profile_Obj_Kaisou; -extern actor_process_profile_definition g_profile_Obj_Kam; -extern actor_process_profile_definition g_profile_Obj_Kantera; -extern actor_process_profile_definition g_profile_Obj_Kat; -extern actor_process_profile_definition g_profile_Obj_KazeNeko; -extern actor_process_profile_definition g_profile_OBJ_KBOX; -extern actor_process_profile_definition g_profile_OBJ_KEY; -extern actor_process_profile_definition g_profile_OBJ_KEYHOLE; -extern actor_process_profile_definition g_profile_OBJ_KI; -extern actor_process_profile_definition g_profile_Obj_KiPot; -extern actor_process_profile_definition g_profile_OBJ_KITA; -extern actor_process_profile_definition g_profile_Obj_KJgjs; -extern actor_process_profile_definition g_profile_Obj_KKanban; -extern actor_process_profile_definition g_profile_KN_BULLET; -extern actor_process_profile_definition g_profile_Obj_Kshutter; -extern actor_process_profile_definition g_profile_Obj_Kuw; -extern actor_process_profile_definition g_profile_Obj_KWheel00; -extern actor_process_profile_definition g_profile_Obj_KWheel01; -extern actor_process_profile_definition g_profile_Obj_KznkArm; -extern actor_process_profile_definition g_profile_Obj_Laundry; -extern actor_process_profile_definition g_profile_Obj_LndRope; -extern actor_process_profile_definition g_profile_OBJ_LBOX; -extern actor_process_profile_definition g_profile_OBJ_LP; -extern actor_process_profile_definition g_profile_Obj_Lv1Cdl00; -extern actor_process_profile_definition g_profile_Obj_Lv1Cdl01; -extern actor_process_profile_definition g_profile_Obj_Lv3Candle; -extern actor_process_profile_definition g_profile_Obj_Lv3Water; -extern actor_process_profile_definition g_profile_Obj_Lv3Water2; -extern actor_process_profile_definition g_profile_OBJ_LV3WATERB; -extern actor_process_profile_definition g_profile_Obj_Lv3R10Saka; -extern actor_process_profile_definition g_profile_Obj_WaterEff; -extern actor_process_profile_definition g_profile_Tag_Lv4CandleDm; -extern actor_process_profile_definition g_profile_Tag_Lv4Candle; -extern actor_process_profile_definition g_profile_Obj_Lv4EdShutter; -extern actor_process_profile_definition g_profile_Obj_Lv4Gate; -extern actor_process_profile_definition g_profile_Obj_Lv4HsTarget; -extern actor_process_profile_definition g_profile_Obj_Lv4PoGate; -extern actor_process_profile_definition g_profile_Obj_Lv4RailWall; -extern actor_process_profile_definition g_profile_Obj_Lv4SlideWall; -extern actor_process_profile_definition g_profile_Obj_Lv4Bridge; -extern actor_process_profile_definition g_profile_Obj_Lv4Chan; -extern actor_process_profile_definition g_profile_Obj_Lv4DigSand; -extern actor_process_profile_definition g_profile_Obj_Lv4Floor; -extern actor_process_profile_definition g_profile_Obj_Lv4Gear; -extern actor_process_profile_definition g_profile_Obj_PRElvtr; -extern actor_process_profile_definition g_profile_Obj_Lv4PRwall; -extern actor_process_profile_definition g_profile_Obj_Lv4Sand; -extern actor_process_profile_definition g_profile_Obj_Lv5FBoard; -extern actor_process_profile_definition g_profile_Obj_IceWall; -extern actor_process_profile_definition g_profile_Obj_Lv5SwIce; -extern actor_process_profile_definition g_profile_Obj_Ychndlr; -extern actor_process_profile_definition g_profile_Obj_YIblltray; -extern actor_process_profile_definition g_profile_Obj_Lv6ChgGate; -extern actor_process_profile_definition g_profile_Obj_Lv6FuriTrap; -extern actor_process_profile_definition g_profile_Obj_Lv6Lblock; -extern actor_process_profile_definition g_profile_Obj_Lv6SwGate; -extern actor_process_profile_definition g_profile_Obj_Lv6SzGate; -extern actor_process_profile_definition g_profile_Obj_Lv6Tenbin; -extern actor_process_profile_definition g_profile_Obj_Lv6TogeRoll; -extern actor_process_profile_definition g_profile_Obj_Lv6TogeTrap; -extern actor_process_profile_definition g_profile_Obj_Lv6bemos; -extern actor_process_profile_definition g_profile_Obj_Lv6bemos2; -extern actor_process_profile_definition g_profile_Obj_Lv6EGate; -extern actor_process_profile_definition g_profile_Obj_Lv6ElevtA; -extern actor_process_profile_definition g_profile_Obj_Lv6SwTurn; -extern actor_process_profile_definition g_profile_Obj_Lv7BsGate; -extern actor_process_profile_definition g_profile_Obj_Lv7PropY; -extern actor_process_profile_definition g_profile_Obj_Lv7Bridge; -extern actor_process_profile_definition g_profile_Obj_Lv8KekkaiTrap; -extern actor_process_profile_definition g_profile_Obj_Lv8Lift; -extern actor_process_profile_definition g_profile_Obj_Lv8OptiLift; -extern actor_process_profile_definition g_profile_Obj_Lv8UdFloor; -extern actor_process_profile_definition g_profile_Obj_Lv9SwShutter; -extern actor_process_profile_definition g_profile_Obj_MagLift; -extern actor_process_profile_definition g_profile_Obj_MagLiftRot; -extern actor_process_profile_definition g_profile_OBJ_MAKI; -extern actor_process_profile_definition g_profile_Obj_MasterSword; -extern actor_process_profile_definition g_profile_Obj_Mato; -extern actor_process_profile_definition g_profile_Obj_MHole; -extern actor_process_profile_definition g_profile_OBJ_MIE; -extern actor_process_profile_definition g_profile_Obj_Mirror6Pole; -extern actor_process_profile_definition g_profile_Obj_MirrorChain; -extern actor_process_profile_definition g_profile_Obj_MirrorSand; -extern actor_process_profile_definition g_profile_Obj_MirrorScrew; -extern actor_process_profile_definition g_profile_Obj_MirrorTable; -extern actor_process_profile_definition g_profile_OBJ_MSIMA; -extern actor_process_profile_definition g_profile_Obj_MvStair; -extern actor_process_profile_definition g_profile_OBJ_MYOGAN; -extern actor_process_profile_definition g_profile_Obj_Nagaisu; -extern actor_process_profile_definition g_profile_Obj_Nan; -extern actor_process_profile_definition g_profile_OBJ_NDOOR; -extern actor_process_profile_definition g_profile_OBJ_NOUGU; -extern actor_process_profile_definition g_profile_OCTHASHI; -extern actor_process_profile_definition g_profile_OBJ_OILTUBO; -extern actor_process_profile_definition g_profile_Obj_Onsen; -extern actor_process_profile_definition g_profile_OBJ_ONSEN_FIRE; -extern actor_process_profile_definition g_profile_Obj_OnsenTaru; -extern actor_process_profile_definition g_profile_Obj_PushDoor; -extern actor_process_profile_definition g_profile_Obj_PDtile; -extern actor_process_profile_definition g_profile_Obj_PDwall; -extern actor_process_profile_definition g_profile_Obj_Picture; -extern actor_process_profile_definition g_profile_Obj_Pillar; -extern actor_process_profile_definition g_profile_OBJ_PLEAF; -extern actor_process_profile_definition g_profile_Obj_poCandle; -extern actor_process_profile_definition g_profile_Obj_poFire; -extern actor_process_profile_definition g_profile_Obj_poTbox; -extern actor_process_profile_definition g_profile_Obj_Prop; -extern actor_process_profile_definition g_profile_OBJ_PUMPKIN; -extern actor_process_profile_definition g_profile_Obj_RCircle; -extern actor_process_profile_definition g_profile_Obj_RfHole; -extern actor_process_profile_definition g_profile_Obj_RiderGate; -extern actor_process_profile_definition g_profile_Obj_RIVERROCK; -extern actor_process_profile_definition g_profile_OBJ_ROCK; -extern actor_process_profile_definition g_profile_Obj_RotBridge; -extern actor_process_profile_definition g_profile_Obj_RotTrap; -extern actor_process_profile_definition g_profile_OBJ_ROTEN; -extern actor_process_profile_definition g_profile_Obj_RotStair; -extern actor_process_profile_definition g_profile_OBJ_RW; -extern actor_process_profile_definition g_profile_Obj_Saidan; -extern actor_process_profile_definition g_profile_Obj_Sakuita; -extern actor_process_profile_definition g_profile_Obj_ItaRope; -extern actor_process_profile_definition g_profile_Obj_SCannon; -extern actor_process_profile_definition g_profile_Obj_SCannonCrs; -extern actor_process_profile_definition g_profile_Obj_SCannonTen; -extern actor_process_profile_definition g_profile_OBJ_SEKIDOOR; -extern actor_process_profile_definition g_profile_OBJ_SEKIZO; -extern actor_process_profile_definition g_profile_OBJ_SEKIZOA; -extern actor_process_profile_definition g_profile_Obj_Shield; -extern actor_process_profile_definition g_profile_Obj_SM_DOOR; -extern actor_process_profile_definition g_profile_Obj_SmallKey; -extern actor_process_profile_definition g_profile_Obj_SmgDoor; -extern actor_process_profile_definition g_profile_Obj_Smoke; -extern actor_process_profile_definition g_profile_OBJ_SMTILE; -extern actor_process_profile_definition g_profile_Obj_SmWStone; -extern actor_process_profile_definition g_profile_Tag_SnowEff; -extern actor_process_profile_definition g_profile_Obj_SnowSoup; -extern actor_process_profile_definition g_profile_OBJ_SO; -extern actor_process_profile_definition g_profile_Obj_SpinLift; -extern actor_process_profile_definition g_profile_OBJ_SSDRINK; -extern actor_process_profile_definition g_profile_OBJ_SSITEM; -extern actor_process_profile_definition g_profile_Obj_StairBlock; -extern actor_process_profile_definition g_profile_Obj_Stone; -extern actor_process_profile_definition g_profile_Obj_Stopper; -extern actor_process_profile_definition g_profile_Obj_Stopper2; -extern actor_process_profile_definition g_profile_OBJ_SUISYA; -extern actor_process_profile_definition g_profile_OBJ_SW; -extern actor_process_profile_definition g_profile_Obj_SwBallA; -extern actor_process_profile_definition g_profile_Obj_SwBallB; -extern actor_process_profile_definition g_profile_Obj_SwBallC; -extern actor_process_profile_definition g_profile_Obj_SwLight; -extern actor_process_profile_definition g_profile_Obj_SwChain; -extern actor_process_profile_definition g_profile_Obj_SwHang; -extern actor_process_profile_definition g_profile_Obj_Sword; -extern actor_process_profile_definition g_profile_Obj_Swpush2; -extern actor_process_profile_definition g_profile_Obj_SwSpinner; -extern actor_process_profile_definition g_profile_Obj_SwTurn; -extern actor_process_profile_definition g_profile_Obj_SyRock; -extern actor_process_profile_definition g_profile_Obj_SZbridge; -extern actor_process_profile_definition g_profile_Obj_TaFence; -extern actor_process_profile_definition g_profile_Obj_Table; -extern actor_process_profile_definition g_profile_Obj_TakaraDai; -extern actor_process_profile_definition g_profile_OBJ_TATIGI; -extern actor_process_profile_definition g_profile_Obj_Ten; -extern actor_process_profile_definition g_profile_Obj_TestCube; -extern actor_process_profile_definition g_profile_Obj_Gake; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ALINK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NO_CHG_ROOM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ITEM; +DUSK_GAME_EXTERN camera_process_profile_definition DUSK_CONST g_profile_CAMERA; +DUSK_GAME_EXTERN camera_process_profile_definition DUSK_CONST g_profile_CAMERA2; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_ENVSE; +DUSK_GAME_EXTERN msg_process_profile_definition DUSK_CONST g_profile_GAMEOVER; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_KANKYO; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_KYEFF; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_KYEFF2; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_KY_THUNDER; +DUSK_GAME_EXTERN msg_process_profile_definition DUSK_CONST g_profile_MENUWINDOW; +DUSK_GAME_EXTERN msg_process_profile_definition DUSK_CONST g_profile_METER2; +DUSK_GAME_EXTERN msg_process_profile_definition DUSK_CONST g_profile_MSG_OBJECT; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP0; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP1; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP6; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP7; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP8; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP9; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP10; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP11; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP2; +DUSK_GAME_EXTERN overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP3; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_LOGO_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_MENU_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_NAME_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_NAMEEX_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_PLAY_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_OPENING_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_ROOM_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_WARNING_SCENE; +DUSK_GAME_EXTERN scene_process_profile_definition DUSK_CONST g_profile_WARNING2_SCENE; +DUSK_GAME_EXTERN msg_process_profile_definition DUSK_CONST g_profile_TIMER; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_WMARK; +DUSK_GAME_EXTERN kankyo_process_profile_definition DUSK_CONST g_profile_WPILLAR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ANDSW; +DUSK_GAME_EXTERN actor_process_profile_definition2 DUSK_CONST g_profile_BG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BG_OBJ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DMIDNA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DBDOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KNOB20; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DOOR20; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SPIRAL_DOOR; +DUSK_GAME_EXTERN actor_process_profile_definition2 DUSK_CONST g_profile_DSHUTTER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_EP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_HITOBJ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG00; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG04; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG17; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_BEF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BurnBox; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Carry; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_ITO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Movebox; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpush; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Timer; +DUSK_GAME_EXTERN actor_process_profile_definition2 DUSK_CONST g_profile_PATH_LINE; +DUSK_GAME_EXTERN actor_process_profile_definition2 DUSK_CONST g_profile_SCENE_EXIT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SET_BG_OBJ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SWHIT0; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_ALLMATO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_CAMERA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_CHKPOINT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_EVENT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_EVT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_EVTAREA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_EVTMSG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_HOWL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_KMSG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_LANTERN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Mist; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_MSG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_PUSH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_TELOP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TBOX; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TBOX2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_VRBOX; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_VRBOX2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ARROW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BOOMERANG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_CROD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DEMO00; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DISAPPEAR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MG_ROD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MIDNA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NBOMB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_LifeContainer; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Yousei; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SPINNER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SUSPEND; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Attp; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ALLDIE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ANDSW2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_CANOE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_CSTAF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Demo_Item; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_L1BOSS_DOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_FM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_HB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_NEST; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_RD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ECONT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_FR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_GRASS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG05; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG10; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG11; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG14; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MG_FISH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_BESU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_FAIRY_SEIREI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_FISH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_HENNA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KAKASHI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KKRI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KOLIN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_MARO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TARO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TKJ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BHASHI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BkDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BossWarp; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Cboard; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Digpl; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Eff; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_FMOBJ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GpTaru; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_HHASHI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KANBAN2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KBACKET; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KkrGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KLift00; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_KtOnFire; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ladder; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv2Candle; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MagneArm; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MetalBox; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_NamePlate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_OnCloth; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RopeBridge; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwallShutter; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_STICK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_StoneMark; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpropeller; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpush5; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Yobikusa; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SCENE_EXIT2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ShopItem; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SQ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SWC00; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_CstaSw; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_AJnot; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_AttackItem; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Gstart; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Hinit; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Hjump; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Hstop; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv2PrChk; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Magne; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Mhint; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Mstop; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Spring; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Statue; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Ykgr; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_L7lowDr; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_L7ODR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_BH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_BQ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_DR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_DRE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_DS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_GG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_GM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_GND; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_GO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_GOS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_MGN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_OB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_OH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_OH2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_TN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_YO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_YOI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_ZANT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_ZANTM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_ZANTZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_B_ZANTS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BALLOON2D; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BULLET; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_COACH2D; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_COACH_FIRE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_COW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_CSTATUE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_DO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BOSS_DOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_L5BOSS_DOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_L1MBOSS_DOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_PushDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_AI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_ARROW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BEE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BI_LEAF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_BUG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_CR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_CR_EGG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DB_LEAF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_DT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_FB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_FK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_FS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_FZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GOB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_GS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_HB_LEAF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_HM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_HP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_HZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_HZELDA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_IS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_KG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_KK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_KR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MK_BO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MM_MT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_MS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_NZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_OC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_OctBg; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_OT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_PH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_PM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_PO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_PZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_RB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_RDB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_RDY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_S1; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SM2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_ST; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_ST_LINE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_SW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_TH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_TH_BALL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_TK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_TK2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_TK_BALL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_TT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_VT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_WAP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_WB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_WS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_WW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YD_LEAF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YM_TAG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YMB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_YR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_ZH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_ZM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_E_ZS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_FORMATION_MNG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_GUARD_MNG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_HORSE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_HOZELDA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Izumi_Gate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KAGO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG01; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG02; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG03; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG06; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG07; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG08; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG09; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG12; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG13; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG15; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KYTAG16; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MANT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_FSHOP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MIRROR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MOVIE_PLAYER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MYNA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ARU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ASH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ASHB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_BANS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_BLUENS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_BOU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_BOU_S; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_CD3; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_CHAT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_CHIN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_CLERKA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_CLERKB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_CLERKT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_COACH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_DF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_DOC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_DOORBOY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_DRSOL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_DU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_FAIRY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_FGUARD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GND; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRMC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GRZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GUARD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_GWOLF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_HANJO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_HENNA0; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_HOZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_IMPAL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_INKO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_INS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_JAGAR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KASIHANA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KASIKYU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KASIMICH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KDK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KNJ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KOLINB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_KYURY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_LEN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_LF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_LUD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_MIDP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_MK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_MOI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_MOIR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_MYNA2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_NE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_P2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_PACHI_BESU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_PACHI_MARO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_PACHI_TARO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_PASSER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_PASSER2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_POST; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_POUYA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_PRAYER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_RACA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_RAFREL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SARU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SEID; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIRA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SERA2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIREI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SHAD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SHAMAN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SHOE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SHOP0; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SMARO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SOLA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SOLDIERa; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SOLDIERb; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_SQ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_THE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_THEB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TKC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TKJ2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TKS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TOBY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_TR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_URI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_WORM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_WRESTLER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_YAMID; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_YAMIS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_YAMIT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_YELIA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_YKM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_YKW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZANB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZANT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZELR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZELRO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZELDA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZRA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZRC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_NPC_ZRZ; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv5Key; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Turara; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TvCdlst; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ytaihou; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_AmiShutter; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ari; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_AUTOMATA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Avalanche; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_BALLOON; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BarDesk; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Batta; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BBox; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_BED; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Bemos; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Bhbridge; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BkLeaf; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_BkyRock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BmWindow; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BoomShutter; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Bombf; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_BOUMATO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_BRG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_BsGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_awaPlar; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CatDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_CB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ChainBlock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Cdoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Chandelier; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Chest; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Cho; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Cowdoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Crope; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVFENCE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVGATE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVHAHEN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVLH_DW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVLH_UP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVSTEEL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Crystal; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ChainWall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_DamCps; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Dan; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Digholl; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_DigSnow; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Elevator; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Drop; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_DUST; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_E_CREATE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_FallObj; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Fan; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Fchain; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_FireWood; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_FireWood2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_FirePillar; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_FirePillar2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Flag; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Flag2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Flag3; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_FOOD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_FW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_GADGET; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GanonWall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GanonWall2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_GB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Geyser; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_glowSphere; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_GM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GoGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GOMIKABE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_GRA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_GRA_WALL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GraRock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GraveStone; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_GRDWATER; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_GrzRock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_H_Saku; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_HBarrel; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_HFtr; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MHasu; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Hata; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_HB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_HBombkoya; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_HeavySw; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Hfuta; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_HsTarget; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ice_l; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ice_s; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_IceBlock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_IceLeaf; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_IHASI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ikada; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_InoBone; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ITA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_ITAMATO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kabuto; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kag; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KAGE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KAGO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kaisou; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kam; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kantera; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kat; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KazeNeko; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KBOX; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KEY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KEYHOLE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KiPot; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_KITA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KJgjs; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KKanban; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_KN_BULLET; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kshutter; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Kuw; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KWheel00; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KWheel01; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KznkArm; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Laundry; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_LndRope; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_LBOX; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_LP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv1Cdl00; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv1Cdl01; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3Candle; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3Water; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3Water2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_LV3WATERB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3R10Saka; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WaterEff; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv4CandleDm; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv4Candle; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4EdShutter; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Gate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4HsTarget; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4PoGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4RailWall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4SlideWall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Bridge; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Chan; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4DigSand; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Floor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Gear; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_PRElvtr; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4PRwall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Sand; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv5FBoard; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_IceWall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv5SwIce; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ychndlr; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_YIblltray; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6ChgGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6FuriTrap; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6Lblock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6SwGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6SzGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6Tenbin; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6TogeRoll; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6TogeTrap; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6bemos; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6bemos2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6EGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6ElevtA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6SwTurn; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv7BsGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv7PropY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv7Bridge; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8KekkaiTrap; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8Lift; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8OptiLift; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8UdFloor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv9SwShutter; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MagLift; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MagLiftRot; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_MAKI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MasterSword; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Mato; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MHole; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_MIE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Mirror6Pole; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorChain; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorSand; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorScrew; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorTable; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_MSIMA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_MvStair; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_MYOGAN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Nagaisu; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Nan; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_NDOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_NOUGU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OCTHASHI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_OILTUBO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Onsen; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_ONSEN_FIRE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_OnsenTaru; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_PushDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_PDtile; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_PDwall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Picture; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Pillar; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_PLEAF; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_poCandle; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_poFire; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_poTbox; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Prop; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_PUMPKIN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RCircle; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RfHole; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RiderGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RIVERROCK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_ROCK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RotBridge; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RotTrap; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_ROTEN; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_RotStair; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_RW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Saidan; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Sakuita; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ItaRope; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SCannon; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SCannonCrs; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SCannonTen; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SEKIDOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SEKIZO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SEKIZOA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Shield; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SM_DOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SmallKey; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SmgDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Smoke; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SMTILE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SmWStone; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_SnowEff; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SnowSoup; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SO; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SpinLift; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SSDRINK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SSITEM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_StairBlock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Stone; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Stopper; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Stopper2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SUISYA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_SW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwBallA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwBallB; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwBallC; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwLight; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwChain; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwHang; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Sword; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpush2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwSpinner; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SwTurn; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SyRock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_SZbridge; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TaFence; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Table; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TakaraDai; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_TATIGI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Ten; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TestCube; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Gake; -extern actor_process_profile_definition g_profile_Obj_THASHI; -extern actor_process_profile_definition g_profile_Obj_TDoor; -extern actor_process_profile_definition g_profile_Obj_TimeFire; -extern actor_process_profile_definition g_profile_OBJ_TKS; -extern actor_process_profile_definition g_profile_Obj_TMoon; -extern actor_process_profile_definition g_profile_Obj_ToaruMaki; -extern actor_process_profile_definition g_profile_OBJ_TOBY; -extern actor_process_profile_definition g_profile_Obj_TobyHouse; -extern actor_process_profile_definition g_profile_Obj_TogeTrap; -extern actor_process_profile_definition g_profile_Obj_Tombo; -extern actor_process_profile_definition g_profile_Obj_Tornado; -extern actor_process_profile_definition g_profile_Obj_Tornado2; -extern actor_process_profile_definition g_profile_OBJ_TP; -extern actor_process_profile_definition g_profile_TREESH; -extern actor_process_profile_definition g_profile_Obj_TwGate; -extern actor_process_profile_definition g_profile_OBJ_UDOOR; -extern actor_process_profile_definition g_profile_OBJ_USAKU; -extern actor_process_profile_definition g_profile_Obj_VolcGnd; -extern actor_process_profile_definition g_profile_Obj_VolcanicBall; -extern actor_process_profile_definition g_profile_Obj_VolcanicBomb; -extern actor_process_profile_definition g_profile_Obj_KakarikoBrg; -extern actor_process_profile_definition g_profile_Obj_OrdinBrg; -extern actor_process_profile_definition g_profile_Obj_WtGate; -extern actor_process_profile_definition g_profile_Obj_WaterPillar; -extern actor_process_profile_definition g_profile_Obj_WaterFall; -extern actor_process_profile_definition g_profile_Obj_Wchain; -extern actor_process_profile_definition g_profile_Obj_WdStick; -extern actor_process_profile_definition g_profile_OBJ_WEB0; -extern actor_process_profile_definition g_profile_OBJ_WEB1; -extern actor_process_profile_definition g_profile_Obj_WellCover; -extern actor_process_profile_definition g_profile_OBJ_WFLAG; -extern actor_process_profile_definition g_profile_Obj_WindStone; -extern actor_process_profile_definition g_profile_Obj_Window; -extern actor_process_profile_definition g_profile_Obj_WoodPendulum; -extern actor_process_profile_definition g_profile_Obj_WoodStatue; -extern actor_process_profile_definition g_profile_Obj_WoodenSword; -extern actor_process_profile_definition g_profile_OBJ_YBAG; -extern actor_process_profile_definition g_profile_OBJ_YSTONE; -extern actor_process_profile_definition g_profile_Obj_ZoraCloth; -extern actor_process_profile_definition g_profile_Obj_ZDoor; -extern actor_process_profile_definition g_profile_Obj_zrTurara; -extern actor_process_profile_definition g_profile_Obj_zrTuraraRc; -extern actor_process_profile_definition g_profile_ZRA_MARK; -extern actor_process_profile_definition g_profile_OBJ_ZRAFREEZE; -extern actor_process_profile_definition g_profile_Obj_ZraRock; -extern actor_process_profile_definition g_profile_PASSER_MNG; -extern actor_process_profile_definition g_profile_PERU; -extern actor_process_profile_definition g_profile_PPolamp; -extern actor_process_profile_definition g_profile_SKIP2D; -extern actor_process_profile_definition g_profile_START_AND_GOAL; -extern actor_process_profile_definition g_profile_SwBall; -extern actor_process_profile_definition g_profile_SwLBall; -extern actor_process_profile_definition g_profile_SwTime; -extern actor_process_profile_definition g_profile_Tag_Lv6Gate; -extern actor_process_profile_definition g_profile_Tag_Lv7Gate; -extern actor_process_profile_definition g_profile_Tag_Lv8Gate; -extern actor_process_profile_definition g_profile_Tag_TWGate; -extern actor_process_profile_definition g_profile_Tag_Arena; -extern actor_process_profile_definition g_profile_Tag_Assist; -extern actor_process_profile_definition g_profile_TAG_BTLITM; -extern actor_process_profile_definition g_profile_Tag_ChgRestart; -extern actor_process_profile_definition g_profile_TAG_CSW; -extern actor_process_profile_definition g_profile_Tag_Escape; -extern actor_process_profile_definition g_profile_Tag_FWall; -extern actor_process_profile_definition g_profile_TAG_GRA; -extern actor_process_profile_definition g_profile_TAG_GUARD; -extern actor_process_profile_definition g_profile_Tag_Instruction; -extern actor_process_profile_definition g_profile_Tag_KagoFall; -extern actor_process_profile_definition g_profile_Tag_LightBall; -extern actor_process_profile_definition g_profile_TAG_LV5SOUP; -extern actor_process_profile_definition g_profile_Tag_Lv6CstaSw; -extern actor_process_profile_definition g_profile_Tag_Mmsg; -extern actor_process_profile_definition g_profile_Tag_Mwait; -extern actor_process_profile_definition g_profile_TAG_MYNA2; -extern actor_process_profile_definition g_profile_TAG_MNLIGHT; -extern actor_process_profile_definition g_profile_TAG_PATI; -extern actor_process_profile_definition g_profile_Tag_poFire; -extern actor_process_profile_definition g_profile_TAG_QS; -extern actor_process_profile_definition g_profile_Tag_RetRoom; -extern actor_process_profile_definition g_profile_Tag_RiverBack; -extern actor_process_profile_definition g_profile_Tag_RmbitSw; -extern actor_process_profile_definition g_profile_Tag_Schedule; -extern actor_process_profile_definition g_profile_Tag_SetBall; -extern actor_process_profile_definition g_profile_Tag_Restart; -extern actor_process_profile_definition g_profile_TAG_SHOPCAM; -extern actor_process_profile_definition g_profile_TAG_SHOPITM; -extern actor_process_profile_definition g_profile_Tag_SmkEmt; -extern actor_process_profile_definition g_profile_Tag_Spinner; -extern actor_process_profile_definition g_profile_Tag_Sppath; -extern actor_process_profile_definition g_profile_TAG_SSDRINK; -extern actor_process_profile_definition g_profile_Tag_Stream; -extern actor_process_profile_definition g_profile_Tag_TheBHint; -extern actor_process_profile_definition g_profile_Tag_WaraHowl; -extern actor_process_profile_definition g_profile_Tag_WatchGe; -extern actor_process_profile_definition g_profile_Tag_WaterFall; -extern actor_process_profile_definition g_profile_Tag_Wljump; -extern actor_process_profile_definition g_profile_TAG_YAMI; -extern actor_process_profile_definition g_profile_TALK; -extern actor_process_profile_definition g_profile_TBOX_SW; -extern actor_process_profile_definition g_profile_TITLE; -extern actor_process_profile_definition g_profile_WarpBug; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_THASHI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TimeFire; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_TKS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TMoon; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ToaruMaki; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_TOBY; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TobyHouse; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TogeTrap; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Tombo; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Tornado; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Tornado2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_TP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TREESH; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_TwGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_UDOOR; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_USAKU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_VolcGnd; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_VolcanicBall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_VolcanicBomb; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_KakarikoBrg; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_OrdinBrg; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WtGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WaterPillar; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WaterFall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Wchain; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WdStick; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_WEB0; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_WEB1; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WellCover; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_WFLAG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WindStone; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_Window; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WoodPendulum; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WoodStatue; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_WoodenSword; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_YBAG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_YSTONE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ZoraCloth; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ZDoor; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_zrTurara; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_zrTuraraRc; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_ZRA_MARK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_OBJ_ZRAFREEZE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Obj_ZraRock; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_PASSER_MNG; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_PERU; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_PPolamp; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SKIP2D; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_START_AND_GOAL; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SwBall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SwLBall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_SwTime; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv6Gate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv7Gate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv8Gate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_TWGate; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Arena; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Assist; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_BTLITM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_ChgRestart; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_CSW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Escape; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_FWall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_GRA; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_GUARD; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Instruction; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_KagoFall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_LightBall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_LV5SOUP; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv6CstaSw; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Mmsg; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Mwait; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_MYNA2; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_MNLIGHT; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_PATI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_poFire; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_QS; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_RetRoom; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_RiverBack; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_RmbitSw; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Schedule; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_SetBall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Restart; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_SHOPCAM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_SHOPITM; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_SmkEmt; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Spinner; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Sppath; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_SSDRINK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Stream; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_TheBHint; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_WaraHowl; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_WatchGe; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_WaterFall; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_Tag_Wljump; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TAG_YAMI; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TALK; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TBOX_SW; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_TITLE; +DUSK_GAME_EXTERN actor_process_profile_definition DUSK_CONST g_profile_WarpBug; #endif -extern process_profile_definition* g_fpcPfLst_ProfileList[]; +DUSK_GAME_EXTERN process_profile_definition DUSK_CONST* DUSK_CONST g_fpcPfLst_ProfileList[]; #endif /* F_PC_PROFILE_LST_H_ */ diff --git a/include/global.h b/include/global.h index 556c5f6207..f77694c133 100644 --- a/include/global.h +++ b/include/global.h @@ -114,6 +114,15 @@ inline int __builtin_clz(unsigned int v) { #endif +// Data symbols exported from the main exe need dllimport on the mod side. The game itself +// exports them through its generated .def, so the annotation is otherwise intentionally empty. +#if defined(TARGET_PC) && defined(_WIN32) && !defined(DUSK_BUILDING_GAME) +#define DUSK_GAME_DATA __declspec(dllimport) +#else +#define DUSK_GAME_DATA +#endif +#define DUSK_GAME_EXTERN extern DUSK_GAME_DATA + #define FAST_DIV(x, n) (x >> (n / 2)) #define SQUARE(x) ((x) * (x)) @@ -225,7 +234,7 @@ using std::isnan; #define IS_REF_NONNULL(r) (1) #endif -#define CRASH(msg, ...) OSPanic(__FILE__, __LINE__, "%s", msg, ##__VA_ARGS__) +#define CRASH(msg) OSPanic(__FILE__, __LINE__, "%s", msg) // Some basic macros that are more convenient than putting down #if blocks for one-line changes. #if TARGET_PC @@ -244,4 +253,7 @@ using std::isnan; #define DUSK_IF_ELSE(dusk, orig) orig #endif +#define DUSK_CONST IF_DUSK(const) +#define DUSK_CONSTEXPR IF_DUSK(constexpr) + #endif diff --git a/include/helpers/README.md b/include/helpers/README.md new file mode 100644 index 0000000000..d14f1e1b36 --- /dev/null +++ b/include/helpers/README.md @@ -0,0 +1,12 @@ +# Public game helpers + +Headers in this directory provide port-specific types and utilities used by ordinary game +headers. Their corresponding implementations live in `src/helpers/`. + +These helpers **must not** depend on internal `src/dusk/` declarations in their public interface. +Unlike the internal `dusk::` namespace, they are exposed to mods that use the `game` feature +and therefore must remain ABI stable within `GameService` major versions. + +APIs _specifically_ for mod use do not belong here; instead they belong in mod services, +which are individually versioned, can provide backwards compatibility, and are designed to +keep track of per-mod runtime state. diff --git a/include/helpers/batch.hpp b/include/helpers/batch.hpp new file mode 100644 index 0000000000..0eaeb17a2c --- /dev/null +++ b/include/helpers/batch.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include + +namespace batch { + +struct LeafTemplate { + static constexpr u32 kMaxVtx = 192; + static constexpr u32 kMaxPosRefs = 64; + + struct Vtx { + u8 pos; + u8 nrm; + u8 clr; + u8 tex; + }; + Vtx vtx[kMaxVtx]; + u16 vtxCount = 0; + u8 posRefs[kMaxPosRefs]; + u8 posRefCount = 0; +}; + +void decode_leaf_template(const u8* dl, u32 size, LeafTemplate& out); + +} // namespace batch diff --git a/include/dusk/endian.h b/include/helpers/endian.h similarity index 92% rename from include/dusk/endian.h rename to include/helpers/endian.h index 0fec59411f..689f9f0dab 100644 --- a/include/dusk/endian.h +++ b/include/helpers/endian.h @@ -1,5 +1,4 @@ -#ifndef DOLPHIN_ENDIAN_H -#define DOLPHIN_ENDIAN_H +#pragma once #include @@ -227,6 +226,28 @@ struct BE { } }; +typedef f32 Mtx23[2][3]; +template <> +struct BE { + BE contents[2][3]; + + auto& operator[](int x) { + return contents[x]; + } + + auto& operator[](int x) const { + return contents[x]; + } + + void to_host(Mtx23& mtx) const { + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 3; j++) { + mtx[i][j] = contents[i][j]; + } + } + } +}; + template void be_swap(T& val) { val = BE::swap(val); @@ -270,6 +291,3 @@ inline void be_swap(Mtx& val) { #define BE(T) T #define BE_HOST(T) (T) #endif - - -#endif // DOLPHIN_ENDIAN_H diff --git a/include/dusk/endian_gx.hpp b/include/helpers/endian_gx.hpp similarity index 100% rename from include/dusk/endian_gx.hpp rename to include/helpers/endian_gx.hpp diff --git a/include/dusk/endian_ssystem.h b/include/helpers/endian_ssystem.h similarity index 93% rename from include/dusk/endian_ssystem.h rename to include/helpers/endian_ssystem.h index fe9248ffa4..b383ef6e43 100644 --- a/include/dusk/endian_ssystem.h +++ b/include/helpers/endian_ssystem.h @@ -1,5 +1,4 @@ -#ifndef _DUSK_ENDIAN_SSYSTEM_H_ -#define _DUSK_ENDIAN_SSYSTEM_H_ +#pragma once #include "SSystem/SComponent/c_sxyz.h" #include "endian.h" @@ -61,5 +60,3 @@ struct BE { }; } }; - -#endif \ No newline at end of file diff --git a/include/dusk/gx_helper.h b/include/helpers/gx_helper.h similarity index 63% rename from include/dusk/gx_helper.h rename to include/helpers/gx_helper.h index 8f71cbdf26..32cf340ed5 100644 --- a/include/dusk/gx_helper.h +++ b/include/helpers/gx_helper.h @@ -1,18 +1,28 @@ -#ifndef DUSK_GX_HELPER_H -#define DUSK_GX_HELPER_H +#pragma once #include #include #include -#include "tracy/Tracy.hpp" +#if defined(DUSK_BUILDING_GAME) +#include +#else +#ifndef ZoneScopedN +#define ZoneScopedN(name) +#endif +#endif + +#if DUSK_GFX_DEBUG_GROUPS #define GX_DEBUG_GROUP(name, ...) \ do { \ GXPushDebugGroup(#name); \ name(__VA_ARGS__); \ GXPopDebugGroup(); \ } while (0) +#else +#define GX_DEBUG_GROUP(name, ...) name(__VA_ARGS__) +#endif #ifdef TARGET_PC class GXTexObjRAII : public GXTexObj { @@ -39,19 +49,38 @@ public: static_assert(sizeof(GXTexObjRAII) == sizeof(GXTexObj), "GXTexObjRAII should have the same size as GXTexObj"); typedef GXTexObjRAII TGXTexObj; + +class GXTlutObjRAII : public GXTlutObj { +public: + GXTlutObjRAII() : GXTlutObj() {} + ~GXTlutObjRAII() { GXDestroyTlutObj(this); } + + void reset() { GXDestroyTlutObj(this); } + + GXTlutObjRAII(const GXTlutObjRAII&) = delete; + GXTlutObjRAII& operator=(const GXTlutObjRAII&) = delete; + GXTlutObjRAII(GXTlutObjRAII&&) = delete; + GXTlutObjRAII& operator=(GXTlutObjRAII&&) = delete; +}; +static_assert(sizeof(GXTlutObjRAII) == sizeof(GXTlutObj), + "GXTlutObjRAII should have the same size as GXTlutObj"); +typedef GXTlutObjRAII TGXTlutObj; #else typedef GXTexObj TGXTexObj; +typedef GXTlutObj TGXTlutObj; #endif struct GXScopedDebugGroup { explicit GXScopedDebugGroup(const char* text) { +#if DUSK_GFX_DEBUG_GROUPS GXPushDebugGroup(text); +#endif } ~GXScopedDebugGroup() { +#if DUSK_GFX_DEBUG_GROUPS GXPopDebugGroup(); +#endif } }; #define GX_AND_TRACY_SCOPED(name) GXScopedDebugGroup scope(name); ZoneScopedN(name); - -#endif // DUSK_GX_HELPER_H diff --git a/include/dusk/math.h b/include/helpers/math.h similarity index 84% rename from include/dusk/math.h rename to include/helpers/math.h index 04f1087670..c1e966951a 100644 --- a/include/dusk/math.h +++ b/include/helpers/math.h @@ -1,5 +1,4 @@ -#ifndef _SRC_DUSK_MATH_H_ -#define _SRC_DUSK_MATH_H_ +#pragma once #include @@ -17,5 +16,3 @@ inline float i_tanf(float x) { return tan(x); } inline float i_acosf(float x) { return acos(x); } #include - -#endif // _SRC_DUSK_MATH_H_ diff --git a/include/dusk/offset_ptr.h b/include/helpers/offset_ptr.h similarity index 89% rename from include/dusk/offset_ptr.h rename to include/helpers/offset_ptr.h index 3a940804c2..924b840659 100644 --- a/include/dusk/offset_ptr.h +++ b/include/helpers/offset_ptr.h @@ -1,5 +1,4 @@ -#ifndef DUSK_OFFSET_PTR_H -#define DUSK_OFFSET_PTR_H +#pragma once #if TARGET_PC @@ -47,21 +46,17 @@ struct OffsetPtrT { } operator T*() const { - return (T*) value; - } + return (T*)value; } - template + template explicit operator TOther*() const { - return (TOther*) value; + return (TOther*)value; } }; - #define OFFSET_PTR(T) OffsetPtrT #define OFFSET_PTR_RAW OffsetPtr #else #define OFFSET_PTR(T) T* #define OFFSET_PTR_RAW u32 #endif - -#endif // DUSK_OFFSET_PTR_H diff --git a/include/helpers/string.hpp b/include/helpers/string.hpp new file mode 100644 index 0000000000..b7ba0ef3b7 --- /dev/null +++ b/include/helpers/string.hpp @@ -0,0 +1,124 @@ +#pragma once + +#include +#include + +struct TextSpan { + char* buffer; + size_t size; + + constexpr operator char*() const { + return buffer; + } + + constexpr TextSpan(char* buffer, size_t size) : buffer(buffer), size(size) { } + + template + constexpr TextSpan(char (&buffer)[BufSize]) : buffer(buffer), size(BufSize) { + } + + constexpr TextSpan() : buffer(nullptr), size(0) { } + + constexpr TextSpan operator++(int) { + const auto prev = *this; + + if (size > 0) [[likely]] { + size--; + } + buffer++; + + return prev; + } + + constexpr char& operator*() const { + if (size == 0) [[unlikely]] { + CrashSpawnEmpty(); + } + + return *buffer; + } + +private: + static void CrashSpawnEmpty(); +}; + +#if TARGET_PC +#define TEXT_SPAN TextSpan +#else +#define TEXT_SPAN char* +#endif + +void SafeStringCopyTruncate(char* buffer, size_t bufSize, const char* src); + +/** + * Copy a string to a fixed-size array. + * Truncates if the destination is not large enough, always inserts a null terminator (padding the remainder of the buffer with zeroes.) + */ +template +void SafeStringCopyTruncate(char (&buffer)[BufSize], const char* src) { + static_assert(BufSize > 0, "Target buffer cannot be size zero"); + SafeStringCopyTruncate(buffer, BufSize, src); +} + +void SafeStringCopy(char* buffer, size_t bufSize, const char* src); +void SafeStringCat(char* buffer, size_t bufSize, const char* src); +int SafeStringVPrintf(char* buffer, size_t bufSize, const char* src, std::va_list args); + +inline void SafeStringCopy(TextSpan dst, const char* src) { + SafeStringCopy(dst.buffer, dst.size, src); +} + +inline void SafeStringCat(TextSpan dst, const char* src) { + SafeStringCat(dst.buffer, dst.size, src); +} + +inline int SafeStringPrintf(TextSpan dst, const char* format, ...) { + std::va_list args; + va_start(args, format); + const auto ret = SafeStringVPrintf(dst.buffer, dst.size, format, args); + va_end(args); + + return ret; +} + +/** + * Copy a string to a fixed-size array. + * Aborts if the destination is not large enough, always inserts a null terminator (padding the remainder of the buffer with zeroes.) + */ +template +void SafeStringCopy(char (&buffer)[BufSize], const char* src) { + static_assert(BufSize > 0, "Target buffer cannot be size zero"); + SafeStringCopy(buffer, BufSize, src); +} + +template +void SafeStringCat(char (&buffer)[BufSize], const char* src) { + static_assert(BufSize > 0, "Target buffer cannot be size zero"); + SafeStringCat(buffer, BufSize, src); +} + +template +int SafeStringPrintf(char (&buffer)[BufSize], const char* format, ...) { + static_assert(BufSize > 0, "Target buffer cannot be size zero"); + + std::va_list args; + va_start(args, format); + const auto ret = SafeStringVPrintf(buffer, BufSize, format, args); + va_end(args); + + return ret; +} + +#if TARGET_PC +#define SAFE_STRCPY SafeStringCopy +#define SAFE_STRCAT SafeStringCat +#define SAFE_SPRINTF SafeStringPrintf +#define SAFE_STRCPY_BOUNDED SafeStringCopy +#define SAFE_STRCAT_BOUNDED SafeStringCat +#else +#define SAFE_STRCPY strcpy +#define SAFE_STRCAT strcat +#define SAFE_SPRINTF sprintf +#define SAFE_STRCPY_BOUNDED strcpy +#define SAFE_STRCPY_BOUNDED strcat +#endif diff --git a/include/m_Do/m_Do_MemCard.h b/include/m_Do/m_Do_MemCard.h index f369bf2f2f..555d7a6a9f 100644 --- a/include/m_Do/m_Do_MemCard.h +++ b/include/m_Do/m_Do_MemCard.h @@ -130,7 +130,7 @@ STATIC_ASSERT(sizeof(mDoMemCd_Ctrl_c) == 8192); static int mDoMemCd_main(void*); -extern mDoMemCd_Ctrl_c g_mDoMemCd_control; +DUSK_GAME_EXTERN mDoMemCd_Ctrl_c g_mDoMemCd_control; inline bool mDoMemCd_isCardCommNone() { return g_mDoMemCd_control.isCardCommNone(); diff --git a/include/m_Do/m_Do_Reset.h b/include/m_Do/m_Do_Reset.h index a426460ba9..85a986263a 100644 --- a/include/m_Do/m_Do_Reset.h +++ b/include/m_Do/m_Do_Reset.h @@ -54,9 +54,9 @@ public: static mDoRstData* getResetData() { return mResetData; } static void setResetData(mDoRstData* rstData) { mResetData = rstData; } - static mDoRstData* mResetData; + static DUSK_GAME_DATA mDoRstData* mResetData; }; -extern bool mDoDvdErr_initialized; +DUSK_GAME_EXTERN bool mDoDvdErr_initialized; #endif /* M_DO_M_DO_RESET_H */ diff --git a/include/m_Do/m_Do_audio.h b/include/m_Do/m_Do_audio.h index 4bc2f20c94..43d0b81766 100644 --- a/include/m_Do/m_Do_audio.h +++ b/include/m_Do/m_Do_audio.h @@ -4,20 +4,24 @@ #include "Z2AudioLib/Z2AudioMgr.h" #include "Z2AudioLib/Z2EnvSeMgr.h" #include "Z2AudioLib/Z2LinkMgr.h" +#if defined(DUSK_BUILDING_GAME) #include "dusk/audio.h" #include "dusk/settings.h" +#else +#define DUSK_AUDIO_SKIP(...) +#endif class mDoAud_zelAudio_c : public Z2AudioMgr { public: void reset(); mDoAud_zelAudio_c() { -#if DEBUG +#if PARTIAL_DEBUG || DEBUG setMode(2); #endif } ~mDoAud_zelAudio_c() {} -#if DEBUG +#if PARTIAL_DEBUG || DEBUG u8 getMode() { return field_0x13bd; } void setMode(u8 mode) { field_0x13bd = mode; } @@ -33,12 +37,12 @@ public: static void onBgmSet() { mBgmSet = true; } static void offBgmSet() { mBgmSet = false; } - static u8 mInitFlag; - static u8 mResetFlag; - static u8 mBgmSet; + static DUSK_GAME_DATA u8 mInitFlag; + static DUSK_GAME_DATA u8 mResetFlag; + static DUSK_GAME_DATA u8 mBgmSet; }; -extern JKRSolidHeap* g_mDoAud_audioHeap; +DUSK_GAME_EXTERN JKRSolidHeap* g_mDoAud_audioHeap; void mDoAud_Execute(); void mDoAud_resetProcess(); @@ -134,15 +138,7 @@ inline void mDoAud_seStart(u32 i_sfxID, const Vec* i_sePos, u32 param_2, s8 i_re } #if TARGET_PC -inline void mDoAud_seStartMenu(u32 i_sfxID) { - if (!mDoAud_zelAudio_c::isInitFlag()) { - return; - } - if (!dusk::getSettings().audio.menuSounds.getValue()) { - return; - } - mDoAud_seStart(i_sfxID, nullptr, 0, 0); -} +void mDoAud_seStartMenu(u32 i_sfxID); #endif inline void mDoAud_seStartLevel(u32 i_sfxID, const Vec* i_sePos, u32 param_2, s8 i_reverb) { diff --git a/include/m_Do/m_Do_controller_pad.h b/include/m_Do/m_Do_controller_pad.h index e187efd17d..f63c1c8d1c 100644 --- a/include/m_Do/m_Do_controller_pad.h +++ b/include/m_Do/m_Do_controller_pad.h @@ -3,7 +3,10 @@ #include "JSystem/JUtility/JUTGamePad.h" #include "SSystem/SComponent/c_API_controller_pad.h" + +#if defined(DUSK_BUILDING_GAME) #include "dusk/settings.h" +#endif // Controller Ports 1 - 4 enum { PAD_1, PAD_2, PAD_3, PAD_4 }; @@ -54,29 +57,21 @@ public: static f32 getStickValue(u32 pad) { return getCpadInfo(pad).mMainStickValue; } static s16 getStickAngle(u32 pad) { return getCpadInfo(pad).mMainStickAngle; } +#if TARGET_PC + static s16 getStickAngle3D(u32 pad); +#else static s16 getStickAngle3D(u32 pad) { - #if TARGET_PC - if (dusk::getSettings().game.enableMirrorMode) { - return -getCpadInfo(pad).mMainStickAngle; - } else { - return getCpadInfo(pad).mMainStickAngle; - } - #else return getCpadInfo(pad).mMainStickAngle; - #endif } +#endif +#if TARGET_PC + static f32 getSubStickX3D(u32 pad); +#else static f32 getSubStickX3D(u32 pad) { - #if TARGET_PC - if (dusk::getSettings().game.enableMirrorMode) { - return -getCpadInfo(pad).mCStickPosX; - } else { - return getCpadInfo(pad).mCStickPosX; - } - #else return getCpadInfo(pad).mCStickPosX; - #endif } +#endif static f32 getSubStickX(u32 pad) { return getCpadInfo(pad).mCStickPosX; } static f32 getSubStickY(u32 pad) { return getCpadInfo(pad).mCStickPosY; } @@ -93,9 +88,9 @@ public: static void stopMotorHard(u32 pad) { return m_gamePad[pad]->stopMotorHard(); } static void stopMotorWaveHard(u32 pad) { return m_gamePad[pad]->stopMotorWaveHard(); } - static JUTGamePad* m_gamePad[4]; - static interface_of_controller_pad m_cpadInfo[4]; - static interface_of_controller_pad m_debugCpadInfo[4]; + static DUSK_GAME_DATA JUTGamePad* m_gamePad[4]; + static DUSK_GAME_DATA interface_of_controller_pad m_cpadInfo[4]; + static DUSK_GAME_DATA interface_of_controller_pad m_debugCpadInfo[4]; }; inline void mDoCPd_ANALOG_CONV(u8 analog, f32& param_1) { diff --git a/include/m_Do/m_Do_dvd_thread.h b/include/m_Do/m_Do_dvd_thread.h index 8af8c520b5..83dd4dec1e 100644 --- a/include/m_Do/m_Do_dvd_thread.h +++ b/include/m_Do/m_Do_dvd_thread.h @@ -138,13 +138,13 @@ struct mDoDvdThd { static void create(s32); static void suspend(); - static OSThread l_thread; - static mDoDvdThdStack l_threadStack; - static mDoDvdThd_param_c l_param; + static DUSK_GAME_DATA OSThread l_thread; + static DUSK_GAME_DATA mDoDvdThdStack l_threadStack; + static DUSK_GAME_DATA mDoDvdThd_param_c l_param; static u8 verbose; - static u8 DVDLogoMode; - static bool SyncWidthSound; + static DUSK_GAME_DATA u8 DVDLogoMode; + static DUSK_GAME_DATA bool SyncWidthSound; static u8 Report_DVDRead; }; diff --git a/include/m_Do/m_Do_ext.h b/include/m_Do/m_Do_ext.h index 77d046f0de..bd1baac2df 100644 --- a/include/m_Do/m_Do_ext.h +++ b/include/m_Do/m_Do_ext.h @@ -19,9 +19,9 @@ class Z2Creature; struct cXy; namespace mDoExt { - extern u8 CurrentHeapAdjustVerbose; - extern u8 HeapAdjustVerbose; - extern u8 HeapAdjustQuiet; + DUSK_GAME_EXTERN u8 CurrentHeapAdjustVerbose; + DUSK_GAME_EXTERN u8 HeapAdjustVerbose; + DUSK_GAME_EXTERN u8 HeapAdjustQuiet; }; class mDoExt_baseAnm { @@ -840,7 +840,7 @@ void mDoExt_modelUpdateDL(J3DModel* i_model); J3DModel* mDoExt_J3DModel__create(J3DModelData* i_modelData, u32 i_modelFlag, u32 i_differedDlistFlag); -extern u32 aram_cache_size; +DUSK_GAME_EXTERN u32 aram_cache_size; u32 mDoExt_getAraCacheSize(); void mDoExt_setAraCacheSize(u32 size); @@ -889,10 +889,10 @@ int DummyCheckHeap_isVirgin(); void DummyCheckHeap_check(); -extern JKRExpHeap* zeldaHeap; -extern JKRExpHeap* gameHeap; -extern JKRExpHeap* archiveHeap; -extern JKRExpHeap* commandHeap; -extern DummyCheckHeap* dch; +DUSK_GAME_EXTERN JKRExpHeap* zeldaHeap; +DUSK_GAME_EXTERN JKRExpHeap* gameHeap; +DUSK_GAME_EXTERN JKRExpHeap* archiveHeap; +DUSK_GAME_EXTERN JKRExpHeap* commandHeap; +DUSK_GAME_EXTERN DummyCheckHeap* dch; #endif /* M_DO_M_DO_EXT_H */ diff --git a/include/m_Do/m_Do_graphic.h b/include/m_Do/m_Do_graphic.h index 5d29049520..dbda35d9c2 100644 --- a/include/m_Do/m_Do_graphic.h +++ b/include/m_Do/m_Do_graphic.h @@ -123,8 +123,8 @@ public: static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); } #if TARGET_PC - static f32 hudAspectScaleDown; - static f32 hudAspectScaleUp; + static DUSK_GAME_DATA f32 hudAspectScaleDown; + static DUSK_GAME_DATA f32 hudAspectScaleUp; static void updateSafeAreaBounds(); static f32 getSafeMinXF() { return m_safeMinXF; } static f32 getSafeMinYF() { return m_safeMinYF; } @@ -302,23 +302,23 @@ public: static void updateRenderSize(); #endif - static TGXTexObj mFrameBufferTexObj; - static TGXTexObj mZbufferTexObj; - static bloom_c m_bloom; - static Mtx mBlureMtx; - static GXColor mBackColor; - static GXColor mFadeColor; - static JUTFader* mFader; - static ResTIMG* mFrameBufferTimg; - static void* mFrameBufferTex; - static ResTIMG* mZbufferTimg; - static void* mZbufferTex; - static f32 mFadeRate; - static f32 mFadeSpeed; - static u8 mBlureFlag; - static u8 mBlureRate; - static u8 mFade; - static bool mAutoForcus; + static DUSK_GAME_DATA TGXTexObj mFrameBufferTexObj; + static DUSK_GAME_DATA TGXTexObj mZbufferTexObj; + static DUSK_GAME_DATA bloom_c m_bloom; + static DUSK_GAME_DATA Mtx mBlureMtx; + static DUSK_GAME_DATA GXColor mBackColor; + static DUSK_GAME_DATA GXColor mFadeColor; + static DUSK_GAME_DATA JUTFader* mFader; + static DUSK_GAME_DATA ResTIMG* mFrameBufferTimg; + static DUSK_GAME_DATA void* mFrameBufferTex; + static DUSK_GAME_DATA ResTIMG* mZbufferTimg; + static DUSK_GAME_DATA void* mZbufferTex; + static DUSK_GAME_DATA f32 mFadeRate; + static DUSK_GAME_DATA f32 mFadeSpeed; + static DUSK_GAME_DATA u8 mBlureFlag; + static DUSK_GAME_DATA u8 mBlureRate; + static DUSK_GAME_DATA u8 mFade; + static DUSK_GAME_DATA bool mAutoForcus; #if PLATFORM_SHIELD static JKRHeap* getHeap() { @@ -333,9 +333,9 @@ public: #endif #if PLATFORM_WII || PLATFORM_SHIELD || TARGET_PC - static ResTIMG* m_fullFrameBufferTimg; - static void* m_fullFrameBufferTex; - static TGXTexObj m_fullFrameBufferTexObj; + static DUSK_GAME_DATA ResTIMG* m_fullFrameBufferTimg; + static DUSK_GAME_DATA void* m_fullFrameBufferTex; + static DUSK_GAME_DATA TGXTexObj m_fullFrameBufferTexObj; #endif #if PLATFORM_WII || PLATFORM_SHIELD @@ -350,35 +350,35 @@ public: #endif #if WIDESCREEN_SUPPORT - static u8 mWide; - static u8 mWideZoom; + static DUSK_GAME_DATA u8 mWide; + static DUSK_GAME_DATA u8 mWideZoom; - static f32 m_aspect; - static f32 m_scale; - static f32 m_invScale; + static DUSK_GAME_DATA f32 m_aspect; + static DUSK_GAME_DATA f32 m_scale; + static DUSK_GAME_DATA f32 m_invScale; - static f32 m_minXF; - static f32 m_minYF; - static int m_minX; - static int m_minY; + static DUSK_GAME_DATA f32 m_minXF; + static DUSK_GAME_DATA f32 m_minYF; + static DUSK_GAME_DATA int m_minX; + static DUSK_GAME_DATA int m_minY; - static f32 m_maxXF; - static f32 m_maxYF; - static int m_maxX; - static int m_maxY; + static DUSK_GAME_DATA f32 m_maxXF; + static DUSK_GAME_DATA f32 m_maxYF; + static DUSK_GAME_DATA int m_maxX; + static DUSK_GAME_DATA int m_maxY; - static int m_width; - static int m_height; - static f32 m_heightF; - static f32 m_widthF; + static DUSK_GAME_DATA int m_width; + static DUSK_GAME_DATA int m_height; + static DUSK_GAME_DATA f32 m_heightF; + static DUSK_GAME_DATA f32 m_widthF; #if TARGET_PC - static f32 m_safeMinXF; - static f32 m_safeMinYF; - static f32 m_safeMaxXF; - static f32 m_safeMaxYF; - static f32 m_safeWidthF; - static f32 m_safeHeightF; + static DUSK_GAME_DATA f32 m_safeMinXF; + static DUSK_GAME_DATA f32 m_safeMinYF; + static DUSK_GAME_DATA f32 m_safeMaxXF; + static DUSK_GAME_DATA f32 m_safeMaxYF; + static DUSK_GAME_DATA f32 m_safeWidthF; + static DUSK_GAME_DATA f32 m_safeHeightF; #endif #endif }; diff --git a/include/m_Do/m_Do_hostIO.h b/include/m_Do/m_Do_hostIO.h index fa4eb8b1af..d88a0a9853 100644 --- a/include/m_Do/m_Do_hostIO.h +++ b/include/m_Do/m_Do_hostIO.h @@ -35,6 +35,11 @@ public: /* 0x4 */ s8 mNo; /* 0x5 */ u8 mCount; #else +#if PARTIAL_DEBUG + // Initialized here since the DEBUG ctor doesn't run. + /* 0x4 */ s8 mNo = -1; + /* 0x5 */ u8 mCount = 0; +#endif virtual ~mDoHIO_entry_c() {} #endif }; diff --git a/include/m_Do/m_Do_lib.h b/include/m_Do/m_Do_lib.h index 14e57ddf5a..6b85cc0660 100644 --- a/include/m_Do/m_Do_lib.h +++ b/include/m_Do/m_Do_lib.h @@ -8,7 +8,7 @@ #include "JSystem/JGeometry.h" #endif -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" typedef struct Vec Vec; struct ResTIMG; @@ -37,14 +37,14 @@ struct mDoLib_clipper { mClipper.calcViewFrustum(); } - static J3DUClipper mClipper; - static f32 mSystemFar; - static f32 mFovyRate; + static DUSK_GAME_DATA J3DUClipper mClipper; + static DUSK_GAME_DATA f32 mSystemFar; + static DUSK_GAME_DATA f32 mFovyRate; }; void mDoLib_project(Vec* src, Vec* dst); u32 mDoLib_setResTimgObj(ResTIMG const* res, TGXTexObj* o_texObj, u32 tlut_name, - GXTlutObj* o_tlutObj); + TGXTlutObj* o_tlutObj); void mDoLib_pos2camera(Vec* src, Vec* dst); #if PLATFORM_WII diff --git a/include/m_Do/m_Do_machine.h b/include/m_Do/m_Do_machine.h index eeea7e77ce..5469a29b5b 100644 --- a/include/m_Do/m_Do_machine.h +++ b/include/m_Do/m_Do_machine.h @@ -19,7 +19,7 @@ int mDoMch_Create(); void mDoMch_Destroy(); #endif -extern GXRenderModeObj g_ntscZeldaProg; +DUSK_GAME_EXTERN GXRenderModeObj g_ntscZeldaProg; class mDoMch_render_c { public: @@ -30,11 +30,11 @@ public: static GXRenderModeObj* getRenderModeObj() { return mRenderModeObj; } - static GXRenderModeObj* mRenderModeObj; + static DUSK_GAME_DATA GXRenderModeObj* mRenderModeObj; }; namespace mDoMch { - extern u8 mDebugFill; + DUSK_GAME_EXTERN u8 mDebugFill; extern u8 mDebugFillNotUse; extern u8 mDebugFillNew; extern u8 mDebugFillDelete; diff --git a/include/m_Do/m_Do_main.h b/include/m_Do/m_Do_main.h index 9bedc21a39..e3b8f1acf7 100644 --- a/include/m_Do/m_Do_main.h +++ b/include/m_Do/m_Do_main.h @@ -6,12 +6,12 @@ class JKRExpHeap; -extern OSThread mainThread; +DUSK_GAME_EXTERN OSThread mainThread; void version_check(); s32 LOAD_COPYDATE(void*); -extern OSThread mainThread; +DUSK_GAME_EXTERN OSThread mainThread; const int HeapCheckTableNum = 8; class HeapCheck { @@ -70,11 +70,11 @@ struct mDoMain { static u32 archiveHeapSize; static u32 gameHeapSize; - static char COPYDATE_STRING[18]; - static u32 memMargin; - static OSTime sPowerOnTime; - static OSTime sHungUpTime; - static s8 developmentMode; + static DUSK_GAME_DATA char COPYDATE_STRING[18]; + static DUSK_GAME_DATA u32 memMargin; + static DUSK_GAME_DATA OSTime sPowerOnTime; + static DUSK_GAME_DATA OSTime sHungUpTime; + static DUSK_GAME_DATA s8 developmentMode; }; #endif /* M_DO_M_DO_MAIN_H */ diff --git a/include/m_Do/m_Do_mtx.h b/include/m_Do/m_Do_mtx.h index 23db8b6d94..89e7e8b7cf 100644 --- a/include/m_Do/m_Do_mtx.h +++ b/include/m_Do/m_Do_mtx.h @@ -6,10 +6,10 @@ #include #include "JSystem/JMath/JMath.h" -#include "dusk/endian.h" +#include "helpers/endian.h" extern u8 g_printCurrentHeapDebug; -extern u8 g_printOtherHeapDebug; +DUSK_GAME_EXTERN u8 g_printOtherHeapDebug; void mDoMtx_XYZrotS(Mtx, s16, s16, s16); void mDoMtx_XYZrotM(Mtx, s16, s16, s16); @@ -373,13 +373,13 @@ public: PSMTXIdentity(now); } - static Mtx now; - static Mtx buffer[16]; - static Mtx* next; - static Mtx* end; + static DUSK_GAME_DATA Mtx now; + static DUSK_GAME_DATA Mtx buffer[16]; + static DUSK_GAME_DATA Mtx* next; + static DUSK_GAME_DATA Mtx* end; }; -extern Mtx g_mDoMtx_identity; +DUSK_GAME_EXTERN Mtx g_mDoMtx_identity; inline MtxP mDoMtx_getIdentity() { return g_mDoMtx_identity; diff --git a/include/m_Do/m_Do_printf.h b/include/m_Do/m_Do_printf.h index 527be3d58a..a71669f432 100644 --- a/include/m_Do/m_Do_printf.h +++ b/include/m_Do/m_Do_printf.h @@ -2,7 +2,7 @@ #define M_DO_M_DO_PRINTF_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" void my_PutString(const char*); void mDoPrintf_vprintf_Interrupt(char const*, va_list); diff --git a/include/os_report.h b/include/os_report.h index 78177a199d..0831e45396 100644 --- a/include/os_report.h +++ b/include/os_report.h @@ -25,16 +25,10 @@ DECL_WEAK void OSReportForceEnableOn(void); #define OS_PANIC(...) #endif -extern u8 __OSReport_disable; +DUSK_GAME_EXTERN u8 __OSReport_disable; extern u8 __OSReport_Error_disable; extern u8 __OSReport_Warning_disable; extern u8 __OSReport_System_disable; extern u8 __OSReport_enable; -#if TARGET_PC -namespace dusk { - extern bool OSReportReallyForceEnable; -} -#endif - #endif // _OS_REPORT_H diff --git a/ios.toolchain.cmake b/ios.toolchain.cmake index fb6052fc9b..73d617ae45 100644 --- a/ios.toolchain.cmake +++ b/ios.toolchain.cmake @@ -952,45 +952,70 @@ if(DEFINED APPLE_TARGET_TRIPLE) set(APPLE_TARGET_TRIPLE_FLAG "-target ${APPLE_TARGET_TRIPLE}") endif() +function(ios_toolchain_set_cached_flags variable description) + set(clean_flags "${${variable}}") + foreach(toolchain_flag IN LISTS ARGN) + if(NOT "${toolchain_flag}" STREQUAL "") + string(REPLACE "${toolchain_flag}" "" clean_flags "${clean_flags}") + endif() + endforeach() + string(REGEX REPLACE "[ \t]+" " " clean_flags "${clean_flags}") + string(STRIP "${clean_flags}" clean_flags) + + set(final_flags "") + foreach(toolchain_flag IN LISTS ARGN) + if(NOT "${toolchain_flag}" STREQUAL "") + string(APPEND final_flags " ${toolchain_flag}") + endif() + endforeach() + if(NOT "${clean_flags}" STREQUAL "") + string(APPEND final_flags " ${clean_flags}") + endif() + string(REGEX REPLACE "[ \t]+" " " final_flags "${final_flags}") + string(STRIP "${final_flags}" final_flags) + + set(${variable} "${final_flags}" CACHE INTERNAL "${description}") +endfunction() + #Check if Xcode generator is used since that will handle these flags automagically if(CMAKE_GENERATOR MATCHES "Xcode") message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as the generator. Modifying the Xcode build-settings directly instead.") else() - set(CMAKE_C_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${OBJC_LEGACY_VARS} ${BITCODE} ${VISIBILITY} ${CMAKE_C_FLAGS}" CACHE INTERNAL - "Flags used by the compiler during all C build types.") + ios_toolchain_set_cached_flags(CMAKE_C_FLAGS "Flags used by the compiler during all C build types." + "${C_TARGET_FLAGS}" "${APPLE_TARGET_TRIPLE_FLAG}" "${SDK_NAME_VERSION_FLAGS}" "${OBJC_LEGACY_VARS}" "${BITCODE}" "${VISIBILITY}") set(CMAKE_C_FLAGS_DEBUG "-O0 -g ${CMAKE_C_FLAGS_DEBUG}") set(CMAKE_C_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_C_FLAGS_MINSIZEREL}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_C_FLAGS_RELWITHDEBINFO}") set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_C_FLAGS_RELEASE}") - set(CMAKE_CXX_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${OBJC_LEGACY_VARS} ${BITCODE} ${VISIBILITY} ${CMAKE_CXX_FLAGS}" CACHE INTERNAL - "Flags used by the compiler during all CXX build types.") + ios_toolchain_set_cached_flags(CMAKE_CXX_FLAGS "Flags used by the compiler during all CXX build types." + "${C_TARGET_FLAGS}" "${APPLE_TARGET_TRIPLE_FLAG}" "${SDK_NAME_VERSION_FLAGS}" "${OBJC_LEGACY_VARS}" "${BITCODE}" "${VISIBILITY}") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g ${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_CXX_FLAGS_MINSIZEREL}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_CXX_FLAGS_RELEASE}") if(NAMED_LANGUAGE_SUPPORT_INT) - set(CMAKE_OBJC_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${FOBJC_ARC} ${OBJC_VARS} ${CMAKE_OBJC_FLAGS}" CACHE INTERNAL - "Flags used by the compiler during all OBJC build types.") + ios_toolchain_set_cached_flags(CMAKE_OBJC_FLAGS "Flags used by the compiler during all OBJC build types." + "${C_TARGET_FLAGS}" "${APPLE_TARGET_TRIPLE_FLAG}" "${SDK_NAME_VERSION_FLAGS}" "${BITCODE}" "${VISIBILITY}" "${FOBJC_ARC}" "${OBJC_VARS}") set(CMAKE_OBJC_FLAGS_DEBUG "-O0 -g ${CMAKE_OBJC_FLAGS_DEBUG}") set(CMAKE_OBJC_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_OBJC_FLAGS_MINSIZEREL}") set(CMAKE_OBJC_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_OBJC_FLAGS_RELWITHDEBINFO}") set(CMAKE_OBJC_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_OBJC_FLAGS_RELEASE}") - set(CMAKE_OBJCXX_FLAGS "${C_TARGET_FLAGS} ${APPLE_TARGET_TRIPLE_FLAG} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} ${FOBJC_ARC} ${OBJC_VARS} ${CMAKE_OBJCXX_FLAGS}" CACHE INTERNAL - "Flags used by the compiler during all OBJCXX build types.") + ios_toolchain_set_cached_flags(CMAKE_OBJCXX_FLAGS "Flags used by the compiler during all OBJCXX build types." + "${C_TARGET_FLAGS}" "${APPLE_TARGET_TRIPLE_FLAG}" "${SDK_NAME_VERSION_FLAGS}" "${BITCODE}" "${VISIBILITY}" "${FOBJC_ARC}" "${OBJC_VARS}") set(CMAKE_OBJCXX_FLAGS_DEBUG "-O0 -g ${CMAKE_OBJCXX_FLAGS_DEBUG}") set(CMAKE_OBJCXX_FLAGS_MINSIZEREL "-DNDEBUG -Os ${CMAKE_OBJCXX_FLAGS_MINSIZEREL}") set(CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O2 -g ${CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO}") set(CMAKE_OBJCXX_FLAGS_RELEASE "-DNDEBUG -O3 ${CMAKE_OBJCXX_FLAGS_RELEASE}") endif() - set(CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}" CACHE INTERNAL - "Flags used by the compiler for all C link types.") - set(CMAKE_CXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}" CACHE INTERNAL - "Flags used by the compiler for all CXX link types.") + ios_toolchain_set_cached_flags(CMAKE_C_LINK_FLAGS "Flags used by the compiler for all C link types." + "${C_TARGET_FLAGS}" "${SDK_NAME_VERSION_FLAGS}" "-Wl,-search_paths_first") + ios_toolchain_set_cached_flags(CMAKE_CXX_LINK_FLAGS "Flags used by the compiler for all CXX link types." + "${C_TARGET_FLAGS}" "${SDK_NAME_VERSION_FLAGS}" "-Wl,-search_paths_first") if(NAMED_LANGUAGE_SUPPORT_INT) - set(CMAKE_OBJC_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJC_LINK_FLAGS}" CACHE INTERNAL - "Flags used by the compiler for all OBJC link types.") - set(CMAKE_OBJCXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_OBJCXX_LINK_FLAGS}" CACHE INTERNAL - "Flags used by the compiler for all OBJCXX link types.") + ios_toolchain_set_cached_flags(CMAKE_OBJC_LINK_FLAGS "Flags used by the compiler for all OBJC link types." + "${C_TARGET_FLAGS}" "${SDK_NAME_VERSION_FLAGS}" "-Wl,-search_paths_first") + ios_toolchain_set_cached_flags(CMAKE_OBJCXX_LINK_FLAGS "Flags used by the compiler for all OBJCXX link types." + "${C_TARGET_FLAGS}" "${SDK_NAME_VERSION_FLAGS}" "-Wl,-search_paths_first") endif() set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "Flags used by the compiler for all ASM build types.") diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DMatBlock.h b/libs/JSystem/include/JSystem/J2DGraph/J2DMatBlock.h index 7a5a3e594a..340f4014ed 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DMatBlock.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DMatBlock.h @@ -892,7 +892,7 @@ struct J2DBlendInfo { /* 0x3 */ u8 mOp; }; -extern const J2DBlendInfo j2dDefaultBlendInfo; +DUSK_GAME_EXTERN const J2DBlendInfo j2dDefaultBlendInfo; /** * @ingroup jsystem-j2d diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DMaterialFactory.h b/libs/JSystem/include/JSystem/J2DGraph/J2DMaterialFactory.h index f82788d57c..1eddcb943a 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DMaterialFactory.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DMaterialFactory.h @@ -4,7 +4,7 @@ #include "JSystem/J2DGraph/J2DManage.h" #include "JSystem/J2DGraph/J2DMatBlock.h" -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-j2d diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DPane.h b/libs/JSystem/include/JSystem/J2DGraph/J2DPane.h index 60f382f064..a588b4e7f7 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DPane.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DPane.h @@ -5,7 +5,7 @@ #include "JSystem/JSupport/JSUList.h" #include #include -#include "dusk/endian.h" +#include "helpers/endian.h" class J2DAnmBase; class J2DAnmColor; @@ -201,7 +201,7 @@ public: static s16 J2DCast_F32_to_S16(f32 value, u8 arg2); - static JGeometry::TBox2 static_mBounds; + static DUSK_GAME_DATA JGeometry::TBox2 static_mBounds; public: /* 0x04 */ u16 field_0x4; diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DPicture.h b/libs/JSystem/include/JSystem/J2DGraph/J2DPicture.h index b054c97fae..f311e191fa 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DPicture.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DPicture.h @@ -4,7 +4,7 @@ #include "JSystem/J2DGraph/J2DPane.h" #include "JSystem/JUtility/JUTTexture.h" #include "JSystem/JUtility/TColor.h" -#include "dusk/endian.h" +#include "helpers/endian.h" class J2DMaterial; class JUTPalette; @@ -212,6 +212,9 @@ public: void setCornerColor(JUtility::TColor c0) { setCornerColor(c0, c0, c0, c0); } +#if TARGET_PC + JUtility::TColor corner(size_t index) const { return mCornerColor[index]; } +#endif protected: /* 0x100 */ JUTTexture* mTexture[2]; diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DPrint.h b/libs/JSystem/include/JSystem/J2DGraph/J2DPrint.h index aa0ffbdcf1..64e1b25139 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DPrint.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DPrint.h @@ -67,8 +67,8 @@ public: mFontSizeY = y; } - static char* mStrBuff; - static size_t mStrBuffSize; + static DUSK_GAME_DATA char* mStrBuff; + static DUSK_GAME_DATA size_t mStrBuffSize; private: void private_initiate(JUTFont*, f32, f32, JUtility::TColor, JUtility::TColor, diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DScreen.h b/libs/JSystem/include/JSystem/J2DGraph/J2DScreen.h index ef83eee36e..ffc7568846 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DScreen.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DScreen.h @@ -4,7 +4,7 @@ #include "JSystem/J2DGraph/J2DManage.h" #include "JSystem/J2DGraph/J2DPane.h" #include "JSystem/JUtility/TColor.h" -#include "dusk/endian.h" +#include "helpers/endian.h" class J2DMaterial; class JUTNameTab; @@ -90,7 +90,7 @@ public: static J2DDataManage* getDataManage() { return mDataManage; } - static J2DDataManage* mDataManage; + static DUSK_GAME_DATA J2DDataManage* mDataManage; /* 0x100 */ bool mScissor; /* 0x102 */ u16 mMaterialNum; diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DTevs.h b/libs/JSystem/include/JSystem/J2DGraph/J2DTevs.h index 2d5f3ca2d6..e515321188 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DTevs.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DTevs.h @@ -4,7 +4,7 @@ #include #include #include "global.h" -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-j2d @@ -46,7 +46,7 @@ struct J2DTexMtxInfo { }; // Size: 0x24 -extern J2DTexMtxInfo const j2dDefaultTexMtxInfo; +DUSK_GAME_EXTERN J2DTexMtxInfo const j2dDefaultTexMtxInfo; /** * @ingroup jsystem-j2d @@ -86,7 +86,7 @@ struct J2DIndTexOrderInfo { GXTexMapID getTexMapID() const { return (GXTexMapID)mTexMapID; } }; -extern const J2DIndTexOrderInfo j2dDefaultIndTexOrderNull; +DUSK_GAME_EXTERN const J2DIndTexOrderInfo j2dDefaultIndTexOrderNull; /** * @ingroup jsystem-j2d @@ -116,7 +116,7 @@ private: * */ struct J2DIndTexMtxInfo { - /* 0x00 */ Mtx23 mMtx; + /* 0x00 */ BE(Mtx23) mMtx; /* 0x18 */ s8 mScaleExp; J2DIndTexMtxInfo& operator=(const J2DIndTexMtxInfo& other) { @@ -130,7 +130,7 @@ struct J2DIndTexMtxInfo { } }; -extern J2DIndTexMtxInfo const j2dDefaultIndTexMtxInfo; +DUSK_GAME_EXTERN J2DIndTexMtxInfo const j2dDefaultIndTexMtxInfo; /** * @ingroup jsystem-j2d @@ -175,7 +175,7 @@ struct J2DIndTexCoordScaleInfo { GXIndTexScale getScaleT() const { return (GXIndTexScale)mScaleT; } }; -extern const J2DIndTexCoordScaleInfo j2dDefaultIndTexCoordScaleInfo; +DUSK_GAME_EXTERN const J2DIndTexCoordScaleInfo j2dDefaultIndTexCoordScaleInfo; /** * @ingroup jsystem-j2d @@ -239,7 +239,7 @@ inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) { (info.mBiasSel << 4) | (info.mIndFormat << 2) | (info.mIndStage); } -extern const J2DIndTevStageInfo j2dDefaultIndTevStageInfo; +DUSK_GAME_EXTERN const J2DIndTevStageInfo j2dDefaultIndTevStageInfo; /** * @ingroup jsystem-j2d @@ -289,7 +289,7 @@ struct J2DTexCoordInfo { } }; -extern J2DTexCoordInfo const j2dDefaultTexCoordInfo[8]; +DUSK_GAME_EXTERN J2DTexCoordInfo const j2dDefaultTexCoordInfo[8]; /** * @ingroup jsystem-j2d @@ -332,7 +332,7 @@ struct J2DTevOrderInfo { } }; -extern const J2DTevOrderInfo j2dDefaultTevOrderInfoNull; +DUSK_GAME_EXTERN const J2DTevOrderInfo j2dDefaultTevOrderInfoNull; /** * @ingroup jsystem-j2d @@ -383,7 +383,7 @@ struct J2DTevStageInfo { /* 0x13 */ u8 field_0x13; }; -extern J2DTevStageInfo const j2dDefaultTevStageInfo; +DUSK_GAME_EXTERN J2DTevStageInfo const j2dDefaultTevStageInfo; /** * @ingroup jsystem-j2d @@ -396,7 +396,7 @@ struct J2DTevSwapModeInfo { /* 0x3 */ u8 field_0x3; }; -extern const J2DTevSwapModeInfo j2dDefaultTevSwapMode; +DUSK_GAME_EXTERN const J2DTevSwapModeInfo j2dDefaultTevSwapMode; /** * @ingroup jsystem-j2d @@ -565,8 +565,8 @@ inline u8 J2DCalcTevSwapTable(u8 param_0, u8 param_1, u8 param_2, u8 param_3) { return (param_0 << 6) + (param_1 << 4) + (param_2 << 2) + param_3; } -extern const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable; -extern const u8 j2dDefaultTevSwapTableID; +DUSK_GAME_EXTERN const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable; +DUSK_GAME_EXTERN const u8 j2dDefaultTevSwapTableID; /** * @ingroup jsystem-j2d @@ -615,7 +615,7 @@ struct J2DColorChanInfo { }; inline u16 J2DCalcColorChanID(u8 param_0) { return param_0; } -extern const J2DColorChanInfo j2dDefaultColorChanInfo; +DUSK_GAME_EXTERN const J2DColorChanInfo j2dDefaultColorChanInfo; /** * @ingroup jsystem-j2d @@ -644,12 +644,12 @@ private: /* 0x0 */ u16 mColorChan; }; -extern const GXColor j2dDefaultColInfo; -extern const GXColorS10 j2dDefaultTevColor; -extern const GXColor j2dDefaultTevKColor; -extern const J2DTevOrderInfo j2dDefaultTevOrderInfoNull; -extern const u8 j2dDefaultPEBlockDither; -extern const u8 j2dDefaultTevSwapTableID; -extern const u16 j2dDefaultAlphaCmp; +DUSK_GAME_EXTERN const GXColor j2dDefaultColInfo; +DUSK_GAME_EXTERN const GXColorS10 j2dDefaultTevColor; +DUSK_GAME_EXTERN const GXColor j2dDefaultTevKColor; +DUSK_GAME_EXTERN const J2DTevOrderInfo j2dDefaultTevOrderInfoNull; +DUSK_GAME_EXTERN const u8 j2dDefaultPEBlockDither; +DUSK_GAME_EXTERN const u8 j2dDefaultTevSwapTableID; +DUSK_GAME_EXTERN const u16 j2dDefaultAlphaCmp; #endif /* J2DTEVS_H */ diff --git a/libs/JSystem/include/JSystem/J2DGraph/J2DTextBox.h b/libs/JSystem/include/JSystem/J2DGraph/J2DTextBox.h index f4d5345507..96a53c5a16 100644 --- a/libs/JSystem/include/JSystem/J2DGraph/J2DTextBox.h +++ b/libs/JSystem/include/JSystem/J2DGraph/J2DTextBox.h @@ -3,7 +3,8 @@ #include "JSystem/J2DGraph/J2DMaterial.h" #include "JSystem/J2DGraph/J2DPane.h" -#include "dusk/endian.h" +#include "helpers/endian.h" +#include "helpers/string.hpp" class J2DMaterial; class JUTFont; @@ -98,7 +99,8 @@ public: void initiate(ResFONT const*, char const*, s16, J2DTextBoxHBinding, J2DTextBoxVBinding); void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*); - char* getStringPtr() const; + TEXT_SPAN getStringPtr() const; + TextSpan getSpan() const; s32 setString(s16, char const*, ...); s32 setString(char const*, ...); diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DAnimation.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DAnimation.h index 3c5133e880..f006183d07 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DAnimation.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DAnimation.h @@ -6,7 +6,7 @@ #include #include "global.h" -#include "dusk/endian.h" +#include "helpers/endian.h" #if TARGET_PC #define OFFSET_PTR_V0 BE(u32) diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DCluster.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DCluster.h index 2a71ada3dd..4704fe1ee1 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DCluster.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DCluster.h @@ -3,7 +3,7 @@ #include "JSystem/J3DAssert.h" #include "JSystem/J3DGraphLoader/J3DClusterLoader.h" -#include "dusk/endian.h" +#include "helpers/endian.h" class J3DDeformer; class J3DClusterKey; diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJoint.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJoint.h index 0a10f035be..7f57ed877b 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJoint.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJoint.h @@ -53,8 +53,8 @@ public: } static void setJoint(J3DJoint* joint) { mJoint = joint; } - static J3DMtxBuffer* mMtxBuffer; - static J3DJoint* mJoint; + static DUSK_GAME_DATA J3DMtxBuffer* mMtxBuffer; + static DUSK_GAME_DATA J3DJoint* mJoint; }; // Size: 0x4 typedef int (*J3DJointCallBack)(J3DJoint*, int); @@ -100,7 +100,7 @@ public: void setMtxType(u8 type) { mKind = (mKind & ~0xf0) | (type << 4); } f32 getRadius() const { return mBoundingSphereRadius; } - static J3DMtxCalc* mCurrentMtxCalc; + static DUSK_GAME_DATA J3DMtxCalc* mCurrentMtxCalc; u8 getKind() const { return mKind & 15; } diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJointTree.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJointTree.h index 92b252fb7a..e4018f1ea2 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJointTree.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DJointTree.h @@ -3,7 +3,7 @@ #include "JSystem/J3DAssert.h" #include "JSystem/J3DGraphBase/J3DTransform.h" -#include "dusk/endian.h" +#include "helpers/endian.h" class J3DJoint; class J3DMtxBuffer; diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DModel.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DModel.h index 2e5b3bd38d..d55bb82465 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DModel.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DModel.h @@ -3,7 +3,6 @@ #include "JSystem/J3DGraphAnimator/J3DSkinDeform.h" #include "JSystem/J3DGraphBase/J3DPacket.h" -#include "dusk/frame_interpolation.h" #include enum J3DMdlFlag { @@ -106,12 +105,13 @@ public: void setUserArea(uintptr_t area) { mUserArea = area; } uintptr_t getUserArea() const { return mUserArea; } Vec* getBaseScale() { return &mBaseScale; } +#if TARGET_PC + void setAnmMtx(int jointNo, Mtx m); +#else void setAnmMtx(int jointNo, Mtx m) { mMtxBuffer->setAnmMtx(jointNo, m); -#ifdef TARGET_PC - dusk::frame_interp::record_final_mtx(mMtxBuffer->getAnmMtx(jointNo)); -#endif } +#endif MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); } MtxP getWeightAnmMtx(int i) { return mMtxBuffer->getWeightAnmMtx(i); } J3DSkinDeform* getSkinDeform() { return mSkinDeform; } diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h index e61bbbe231..3a9538a58d 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DMtxBuffer.h @@ -62,10 +62,10 @@ public: mpNrmMtxArr[1][mCurrentViewNo] = tmp; } - static Mtx sNoUseDrawMtx; - static Mtx33 sNoUseNrmMtx; - static Mtx* sNoUseDrawMtxPtr; - static Mtx33* sNoUseNrmMtxPtr; + static DUSK_GAME_DATA Mtx sNoUseDrawMtx; + static DUSK_GAME_DATA Mtx33 sNoUseNrmMtx; + static DUSK_GAME_DATA Mtx* sNoUseDrawMtxPtr; + static DUSK_GAME_DATA Mtx33* sNoUseNrmMtxPtr; /* 0x00 */ J3DJointTree* mJointTree; /* 0x04 */ u8* mpScaleFlagArr; diff --git a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h index e68b3ab02c..3799687f93 100644 --- a/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h +++ b/libs/JSystem/include/JSystem/J3DGraphAnimator/J3DSkinDeform.h @@ -59,9 +59,9 @@ public: virtual void deform(J3DVertexBuffer*, J3DMtxBuffer*); virtual ~J3DSkinDeform(); - static BE(u16)* sWorkArea_WEvlpMixMtx[1024]; - static BE(f32)* sWorkArea_WEvlpMixWeight[1024]; - static u16 sWorkArea_MtxReg[1024]; + static DUSK_GAME_DATA BE(u16)* sWorkArea_WEvlpMixMtx[1024]; + static DUSK_GAME_DATA BE(f32)* sWorkArea_WEvlpMixWeight[1024]; + static DUSK_GAME_DATA u16 sWorkArea_MtxReg[1024]; private: /* 0x04 */ u16* mPosData; diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DDrawBuffer.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DDrawBuffer.h index 68be132081..a55f9ebcf1 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DDrawBuffer.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DDrawBuffer.h @@ -99,9 +99,9 @@ public: /* 0x1C */ MtxP mpZMtx; /* 0x20 */ J3DPacket* mpCallBackPacket; - static sortFunc sortFuncTable[6]; - static drawFunc drawFuncTable[2]; - static int entryNum; + static DUSK_GAME_DATA sortFunc sortFuncTable[6]; + static DUSK_GAME_DATA drawFunc drawFuncTable[2]; + static DUSK_GAME_DATA int entryNum; }; #endif /* J3DDRAWBUFFER_H */ diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DMatBlock.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DMatBlock.h index a959609f45..dbb3877dc3 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DMatBlock.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DMatBlock.h @@ -1437,7 +1437,7 @@ inline u16 calcZModeID(u8 param_0, u8 param_1, u8 param_2) { return param_1 * 2 + param_0 * 0x10 + param_2; } -extern u8 j3dZModeTable[96]; +DUSK_GAME_EXTERN u8 j3dZModeTable[96]; /** * @ingroup jsystem-j3d @@ -1575,6 +1575,12 @@ struct J3DAlphaComp { u8 getRef1() const { return mRef1; } void load() const { +#ifdef AVOID_UB + if (mID > 255) { + J3DGDSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0); + return; + } +#endif J3DGDSetAlphaCompare((GXCompare)getComp0(), mRef0, (GXAlphaOp)getOp(), (GXCompare)getComp1(), mRef1); } diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DPacket.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DPacket.h index 4be9fe1f17..992d96b255 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DPacket.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DPacket.h @@ -125,8 +125,8 @@ public: u8* getDisplayList(int idx) { return (u8*)mpDisplayList[idx]; } u32 getDisplayListSize() { return mSize; } - static GDLObj sGDLObj; - static s32 sInterruptFlag; + static DUSK_GAME_DATA GDLObj sGDLObj; + static DUSK_GAME_DATA s32 sInterruptFlag; /* 0x0 */ void* mpDisplayList[2]; /* 0x8 */ u32 mSize; diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DShape.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DShape.h index 5477868596..4ba3cc8023 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DShape.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DShape.h @@ -4,8 +4,10 @@ #include "JSystem/J3DGraphBase/J3DShapeDraw.h" #include "JSystem/J3DAssert.h" #include "JSystem/J3DGraphBase/J3DFifo.h" +#include "JSystem/JMath/JMath.h" +#include "global.h" #include -#include "dusk/endian_gx.hpp" +#include "helpers/endian_gx.hpp" class J3DShapeMtx; @@ -78,13 +80,13 @@ public: virtual void load() const; virtual void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]); - static J3DShapeMtx_LoadFunc sMtxLoadPipeline[4]; - static u16 sMtxLoadCache[10]; - static u32 sCurrentPipeline; - static u8* sCurrentScaleFlag; - static bool sNBTFlag; - static bool sLODFlag; - static u32 sTexMtxLoadType; + static DUSK_GAME_DATA J3DShapeMtx_LoadFunc sMtxLoadPipeline[4]; + static DUSK_GAME_DATA u16 sMtxLoadCache[10]; + static DUSK_GAME_DATA u32 sCurrentPipeline; + static DUSK_GAME_DATA u8* sCurrentScaleFlag; + static DUSK_GAME_DATA bool sNBTFlag; + static DUSK_GAME_DATA bool sLODFlag; + static DUSK_GAME_DATA u32 sTexMtxLoadType; static void setCurrentPipeline(u32 pipeline) { J3D_ASSERT_RANGE(91, pipeline < 4); @@ -202,8 +204,8 @@ public: static void resetVcdVatCache() { sOldVcdVatCmd = NULL; } - static void* sOldVcdVatCmd; - static bool sEnvelopeFlag; + static DUSK_GAME_DATA void* sOldVcdVatCmd; + static DUSK_GAME_DATA bool sEnvelopeFlag; private: friend struct J3DShapeFactory; diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeDraw.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeDraw.h index e6e8d61786..feff2b4991 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeDraw.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeDraw.h @@ -1,6 +1,7 @@ #ifndef J3DSHAPEDRAW_H #define J3DSHAPEDRAW_H +#include #include /** @@ -12,6 +13,9 @@ public: u32 countVertex(u32); void addTexMtxIndexInDL(u32, u32, u32); J3DShapeDraw(u8 const*, u32); +#if TARGET_PC + J3DShapeDraw(u8 const*, u32, const GXVtxDescList*); +#endif void draw() const; virtual ~J3DShapeDraw(); diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeMtx.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeMtx.h index 313fa1ef30..2b7ad8ad35 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeMtx.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DShapeMtx.h @@ -4,7 +4,7 @@ #include "JSystem/J3DGraphBase/J3DShape.h" #include "JSystem/J3DAssert.h" #include -#include "dusk/endian.h" +#include "helpers/endian.h" class J3DTexMtx; class J3DTexGenBlock; @@ -22,8 +22,8 @@ public: loadExecute(m); } - static J3DTexGenBlock* sTexGenBlock; - static J3DTexMtxObj* sTexMtxObj; + static DUSK_GAME_DATA J3DTexGenBlock* sTexGenBlock; + static DUSK_GAME_DATA J3DTexMtxObj* sTexMtxObj; }; class J3DShapeMtxConcatView; @@ -75,9 +75,9 @@ public: void loadMtxConcatView_PNCPU(int, u16) const; void loadMtxConcatView_PNGP_LOD(int, u16) const; - static J3DShapeMtxConcatView_LoadFunc sMtxLoadPipeline[4]; - static J3DShapeMtxConcatView_LoadFunc sMtxLoadLODPipeline[4]; - static MtxP sMtxPtrTbl[2]; + static DUSK_GAME_DATA J3DShapeMtxConcatView_LoadFunc sMtxLoadPipeline[4]; + static DUSK_GAME_DATA J3DShapeMtxConcatView_LoadFunc sMtxLoadLODPipeline[4]; + static DUSK_GAME_DATA MtxP sMtxPtrTbl[2]; }; /** diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DStruct.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DStruct.h index 05663fd84e..0de93bcaf5 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DStruct.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DStruct.h @@ -7,7 +7,7 @@ #include "global.h" #include "JSystem/JMath/JMath.h" -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-j3d diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DSys.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DSys.h index 8c4bbd06e3..a4750e5d29 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DSys.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DSys.h @@ -6,8 +6,8 @@ #include "JSystem/J3DAssert.h" #include "JSystem/JMath/JMath.h" -#include "dusk/frame_interpolation.h" -#include "dusk/endian.h" +#include "helpers/endian.h" +#include "global.h" enum J3DSysDrawBuf { /* 0x0 */ J3DSysDrawBuf_Opa, @@ -189,25 +189,23 @@ struct J3DSys { Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; } J3DShapePacket* getShapePacket() { return mShapePacket; } +#if TARGET_PC + void setViewMtx(const Mtx m); +#else void setViewMtx(const Mtx m) { -#ifdef TARGET_PC - Mtx patched; - if (dusk::frame_interp::lookup_replacement(m, patched)) { - m = patched; - } -#endif MTXCopy(m, mViewMtx); } +#endif J3DModel* getModel() { return mModel; } - static Mtx mCurrentMtx; - static Vec mCurrentS; - static Vec mParentS; - static J3DTexCoordScaleInfo sTexCoordScaleTable[8]; + static DUSK_GAME_DATA Mtx mCurrentMtx; + static DUSK_GAME_DATA Vec mCurrentS; + static DUSK_GAME_DATA Vec mParentS; + static DUSK_GAME_DATA J3DTexCoordScaleInfo sTexCoordScaleTable[8]; }; -extern u32 j3dDefaultViewNo; -extern J3DSys j3dSys; +DUSK_GAME_EXTERN u32 j3dDefaultViewNo; +DUSK_GAME_EXTERN J3DSys j3dSys; #endif /* J3DSYS_H */ diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DTevs.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DTevs.h index b0e2abfaae..c3d8dde2a4 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DTevs.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DTevs.h @@ -6,32 +6,32 @@ #include "JSystem/J3DGraphBase/J3DGD.h" #include "JSystem/J3DGraphBase/J3DStruct.h" -extern u8 j3dTevSwapTableTable[1024]; +DUSK_GAME_EXTERN u8 j3dTevSwapTableTable[1024]; -extern const J3DLightInfo j3dDefaultLightInfo; -extern const J3DTexCoordInfo j3dDefaultTexCoordInfo[8]; -extern const J3DTexMtxInfo j3dDefaultTexMtxInfo; -extern const J3DIndTexMtxInfo j3dDefaultIndTexMtxInfo; -extern const J3DTevStageInfo j3dDefaultTevStageInfo; -extern const J3DIndTevStageInfo j3dDefaultIndTevStageInfo; -extern const J3DFogInfo j3dDefaultFogInfo; -extern const J3DNBTScaleInfo j3dDefaultNBTScaleInfo; +DUSK_GAME_EXTERN const J3DLightInfo j3dDefaultLightInfo; +DUSK_GAME_EXTERN const J3DTexCoordInfo j3dDefaultTexCoordInfo[8]; +DUSK_GAME_EXTERN const J3DTexMtxInfo j3dDefaultTexMtxInfo; +DUSK_GAME_EXTERN const J3DIndTexMtxInfo j3dDefaultIndTexMtxInfo; +DUSK_GAME_EXTERN const J3DTevStageInfo j3dDefaultTevStageInfo; +DUSK_GAME_EXTERN const J3DIndTevStageInfo j3dDefaultIndTevStageInfo; +DUSK_GAME_EXTERN const J3DFogInfo j3dDefaultFogInfo; +DUSK_GAME_EXTERN const J3DNBTScaleInfo j3dDefaultNBTScaleInfo; -extern const GXColor j3dDefaultColInfo; -extern const GXColor j3dDefaultAmbInfo; +DUSK_GAME_EXTERN const GXColor j3dDefaultColInfo; +DUSK_GAME_EXTERN const GXColor j3dDefaultAmbInfo; extern const u8 j3dDefaultColorChanNum; -extern const J3DTevOrderInfo j3dDefaultTevOrderInfoNull; -extern const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull; -extern const GXColorS10 j3dDefaultTevColor; -extern const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo; -extern const GXColor j3dDefaultTevKColor; -extern const J3DTevSwapModeInfo j3dDefaultTevSwapMode; -extern const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable; -extern const J3DBlendInfo j3dDefaultBlendInfo; -extern const J3DColorChanInfo j3dDefaultColorChanInfo; -extern const u8 j3dDefaultTevSwapTableID; -extern const u16 j3dDefaultAlphaCmpID; -extern const u16 j3dDefaultZModeID; +DUSK_GAME_EXTERN const J3DTevOrderInfo j3dDefaultTevOrderInfoNull; +DUSK_GAME_EXTERN const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull; +DUSK_GAME_EXTERN const GXColorS10 j3dDefaultTevColor; +DUSK_GAME_EXTERN const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo; +DUSK_GAME_EXTERN const GXColor j3dDefaultTevKColor; +DUSK_GAME_EXTERN const J3DTevSwapModeInfo j3dDefaultTevSwapMode; +DUSK_GAME_EXTERN const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable; +DUSK_GAME_EXTERN const J3DBlendInfo j3dDefaultBlendInfo; +DUSK_GAME_EXTERN const J3DColorChanInfo j3dDefaultColorChanInfo; +DUSK_GAME_EXTERN const u8 j3dDefaultTevSwapTableID; +DUSK_GAME_EXTERN const u16 j3dDefaultAlphaCmpID; +DUSK_GAME_EXTERN const u16 j3dDefaultZModeID; /** * @ingroup jsystem-j3d @@ -191,7 +191,7 @@ struct J3DIndTevStage { /* 0x0 */ u32 mInfo; }; -extern const J3DTevOrderInfo j3dDefaultTevOrderInfoNull; +DUSK_GAME_EXTERN const J3DTevOrderInfo j3dDefaultTevOrderInfoNull; /** * @ingroup jsystem-j3d @@ -209,8 +209,8 @@ struct J3DTevOrder : public J3DTevOrderInfo { u8 getTexMap() const { return mTexMap; } }; -extern u8 j3dTevSwapTableTable[1024]; -extern u8 const j3dDefaultTevSwapTableID; +DUSK_GAME_EXTERN u8 j3dTevSwapTableTable[1024]; +DUSK_GAME_EXTERN u8 const j3dDefaultTevSwapTableID; inline u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3) { return 0x40 * (u8)param_0 + 0x10 * (u8)param_1 + 4 * (u8)param_2 + param_3; @@ -263,7 +263,7 @@ public: /* 0x34 */ GXLightObj mLightObj; }; // Size = 0x74 -extern const J3DNBTScaleInfo j3dDefaultNBTScaleInfo; +DUSK_GAME_EXTERN const J3DNBTScaleInfo j3dDefaultNBTScaleInfo; /** * @ingroup jsystem-j3d @@ -287,12 +287,12 @@ struct J3DNBTScale : public J3DNBTScaleInfo { BE(Vec)* getScale() { return &mScale; } }; -extern const GXColor j3dDefaultColInfo; -extern const GXColor j3dDefaultAmbInfo; -extern const GXColorS10 j3dDefaultTevColor; -extern const GXColor j3dDefaultTevKColor; -extern u8 j3dAlphaCmpTable[768]; -extern const u8 j3dDefaultNumChans; +DUSK_GAME_EXTERN const GXColor j3dDefaultColInfo; +DUSK_GAME_EXTERN const GXColor j3dDefaultAmbInfo; +DUSK_GAME_EXTERN const GXColorS10 j3dDefaultTevColor; +DUSK_GAME_EXTERN const GXColor j3dDefaultTevKColor; +DUSK_GAME_EXTERN u8 j3dAlphaCmpTable[768]; +DUSK_GAME_EXTERN const u8 j3dDefaultNumChans; struct J3DNBTScale; struct J3DTexCoord; diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DTexture.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DTexture.h index e407db84b4..5b05b08bcc 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DTexture.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DTexture.h @@ -7,7 +7,7 @@ #include "global.h" #include -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" /** * @ingroup jsystem-j3d @@ -85,7 +85,7 @@ public: } }; -extern J3DTexMtxInfo const j3dDefaultTexMtxInfo; +DUSK_GAME_EXTERN J3DTexMtxInfo const j3dDefaultTexMtxInfo; /** * @ingroup jsystem-j3d @@ -117,7 +117,7 @@ private: /* 0x64 */ Mtx mMtx; }; // Size: 0x94 -extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8]; +DUSK_GAME_EXTERN J3DTexCoordInfo const j3dDefaultTexCoordInfo[8]; /** * @ingroup jsystem-j3d diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DTransform.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DTransform.h index f8f27b26d9..dfe439fbfb 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DTransform.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DTransform.h @@ -45,10 +45,10 @@ struct J3DTransformInfo { #endif }; // Size: 0x20 -extern J3DTransformInfo const j3dDefaultTransformInfo; -extern Vec const j3dDefaultScale; -extern Mtx const j3dDefaultMtx; -extern f32 const PSMulUnit01[]; +DUSK_GAME_EXTERN J3DTransformInfo const j3dDefaultTransformInfo; +DUSK_GAME_EXTERN Vec const j3dDefaultScale; +DUSK_GAME_EXTERN Mtx const j3dDefaultMtx; +DUSK_GAME_EXTERN f32 const PSMulUnit01[]; void J3DGQRSetup7(u32 param_0, u32 param_1, u32 param_2, u32 param_3); void J3DCalcBBoardMtx(f32 (*)[4]); diff --git a/libs/JSystem/include/JSystem/J3DGraphBase/J3DVertex.h b/libs/JSystem/include/JSystem/J3DGraphBase/J3DVertex.h index 1638e316e9..f7ad92afb8 100644 --- a/libs/JSystem/include/JSystem/J3DGraphBase/J3DVertex.h +++ b/libs/JSystem/include/JSystem/J3DGraphBase/J3DVertex.h @@ -3,7 +3,7 @@ #include #include -#include "dusk/endian_gx.hpp" +#include "helpers/endian_gx.hpp" class J3DModel; class J3DAnmVtxColor; diff --git a/libs/JSystem/include/JSystem/J3DGraphLoader/J3DClusterLoader.h b/libs/JSystem/include/JSystem/J3DGraphLoader/J3DClusterLoader.h index 2899065150..75ba644be8 100644 --- a/libs/JSystem/include/JSystem/J3DGraphLoader/J3DClusterLoader.h +++ b/libs/JSystem/include/JSystem/J3DGraphLoader/J3DClusterLoader.h @@ -4,7 +4,7 @@ #include "JSystem/J3DGraphAnimator/J3DAnimation.h" #include "JSystem/J3DGraphAnimator/J3DAnimation.h" -#include "dusk/endian.h" +#include "helpers/endian.h" #if TARGET_PC #define OFFSET_PTR_V0 BE(u32) diff --git a/libs/JSystem/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/libs/JSystem/include/JSystem/J3DGraphLoader/J3DModelLoader.h index 6c856f1a3d..05fc99785b 100644 --- a/libs/JSystem/include/JSystem/J3DGraphLoader/J3DModelLoader.h +++ b/libs/JSystem/include/JSystem/J3DGraphLoader/J3DModelLoader.h @@ -4,7 +4,7 @@ #include "JSystem/J3DGraphBase/J3DSys.h" #include -#include "dusk/endian.h" +#include "helpers/endian.h" class J3DModelData; class J3DMaterialTable; diff --git a/libs/JSystem/include/JSystem/JAHostIO/JAHUpdate.h b/libs/JSystem/include/JSystem/JAHostIO/JAHUpdate.h index 84efd7e539..8ef1c84577 100644 --- a/libs/JSystem/include/JSystem/JAHostIO/JAHUpdate.h +++ b/libs/JSystem/include/JSystem/JAHostIO/JAHUpdate.h @@ -8,8 +8,8 @@ namespace JAHUpdate { -extern JAHioNode* spNode; -extern JORMContext* spMc; +DUSK_GAME_EXTERN JAHioNode* spNode; +DUSK_GAME_EXTERN JORMContext* spMc; inline void startUpdateNode(JAHioNode* param_1) { spMc = attachJORMContext(8); diff --git a/libs/JSystem/include/JSystem/JAHostIO/JAHVirtualNode.h b/libs/JSystem/include/JSystem/JAHostIO/JAHVirtualNode.h index eee0ed94c0..535c01f881 100644 --- a/libs/JSystem/include/JSystem/JAHostIO/JAHVirtualNode.h +++ b/libs/JSystem/include/JSystem/JAHostIO/JAHVirtualNode.h @@ -29,7 +29,7 @@ public: JSUTree* getVirTree() { return &mTree; } static u32 getVirNodeNum() { return smVirNodeNum; } - static u32 smVirNodeNum; + static DUSK_GAME_DATA u32 smVirNodeNum; /* 0x04 */ JSUTree mTree; /* 0x20 */ char mName[32]; diff --git a/libs/JSystem/include/JSystem/JAHostIO/JAHioMessage.h b/libs/JSystem/include/JSystem/JAHostIO/JAHioMessage.h index 5a323dacd0..1b27be95b4 100644 --- a/libs/JSystem/include/JSystem/JAHostIO/JAHioMessage.h +++ b/libs/JSystem/include/JSystem/JAHostIO/JAHioMessage.h @@ -38,17 +38,17 @@ public: static u32 getIntervalX() { return smIntX; } static u32 getNameWidth() { return smNameWidth; } - static u16 smButtonWidth[]; - static u16 smCommentWidth[]; - static u16 smComboWidth[]; - static u16 smYTop; - static u16 smXLeft; - static u16 smIndentSize; - static u16 smLineHeight; - static u16 smContWidth; - static u16 smIntX; - static u16 smIntY; - static u16 smNameWidth; + static DUSK_GAME_DATA u16 smButtonWidth[]; + static DUSK_GAME_DATA u16 smCommentWidth[]; + static DUSK_GAME_DATA u16 smComboWidth[]; + static DUSK_GAME_DATA u16 smYTop; + static DUSK_GAME_DATA u16 smXLeft; + static DUSK_GAME_DATA u16 smIndentSize; + static DUSK_GAME_DATA u16 smLineHeight; + static DUSK_GAME_DATA u16 smContWidth; + static DUSK_GAME_DATA u16 smIntX; + static DUSK_GAME_DATA u16 smIntY; + static DUSK_GAME_DATA u16 smNameWidth; u16 getX() { return mX; } u16 getY() { return mY; } diff --git a/libs/JSystem/include/JSystem/JAHostIO/JAHioNode.h b/libs/JSystem/include/JSystem/JAHostIO/JAHioNode.h index 70fb1d07b5..d0e294a959 100644 --- a/libs/JSystem/include/JSystem/JAHostIO/JAHioNode.h +++ b/libs/JSystem/include/JSystem/JAHostIO/JAHioNode.h @@ -41,7 +41,7 @@ public: static JAHioNode* getCurrentNode() { return smCurrentNode; } - static JAHioNode* smCurrentNode; + static DUSK_GAME_DATA JAHioNode* smCurrentNode; JSUTree* getTree() { return &mTree; } char* getNodeName() { return mName; } diff --git a/libs/JSystem/include/JSystem/JAHostIO/JAHioUtil.h b/libs/JSystem/include/JSystem/JAHostIO/JAHioUtil.h index 08522c8ba1..2342f030ec 100644 --- a/libs/JSystem/include/JSystem/JAHostIO/JAHioUtil.h +++ b/libs/JSystem/include/JSystem/JAHostIO/JAHioUtil.h @@ -4,7 +4,7 @@ namespace JAHioUtil { char* getString(const char* msg, ...); - extern char mStringBuffer[]; + DUSK_GAME_EXTERN char mStringBuffer[]; } #endif /* JAHIOUTIL_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JAISound.h b/libs/JSystem/include/JSystem/JAudio2/JAISound.h index e96053fc9f..fa262a7426 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAISound.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAISound.h @@ -5,7 +5,7 @@ #include "JSystem/JAudio2/JAIAudible.h" #include "JSystem/JUtility/JUTAssert.h" #include "global.h" -#include "dusk/endian.h" +#include "helpers/endian.h" #include class JAISound; diff --git a/libs/JSystem/include/JSystem/JAudio2/JASAiCtrl.h b/libs/JSystem/include/JSystem/JAudio2/JASAiCtrl.h index 5bba1b94ee..2ae0f82c0a 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASAiCtrl.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASAiCtrl.h @@ -41,21 +41,21 @@ namespace JASDriver { void subframeCallback(); void DSPSyncCallback(); - extern const MixFunc sMixFuncs[4]; - extern s16* sDmaDacBuffer[3]; - extern JASMixMode sMixMode; - extern f32 sDacRate; - extern u32 sSubFrames; - extern s16** sDspDacBuffer; - extern s32 sDspDacWriteBuffer; - extern s32 sDspDacReadBuffer; - extern s32 sDspStatus; - extern DSPBufCallback sDspDacCallback; - extern s16* lastRspMadep; - extern void (*dacCallbackFunc)(s16*, u32); - extern MixCallback extMixCallback; - extern u32 sOutputRate; - extern u32 sSubFrameCounter; + DUSK_GAME_EXTERN const MixFunc sMixFuncs[4]; + DUSK_GAME_EXTERN s16* sDmaDacBuffer[3]; + DUSK_GAME_EXTERN JASMixMode sMixMode; + DUSK_GAME_EXTERN f32 sDacRate; + DUSK_GAME_EXTERN u32 sSubFrames; + DUSK_GAME_EXTERN s16** sDspDacBuffer; + DUSK_GAME_EXTERN s32 sDspDacWriteBuffer; + DUSK_GAME_EXTERN s32 sDspDacReadBuffer; + DUSK_GAME_EXTERN s32 sDspStatus; + DUSK_GAME_EXTERN DSPBufCallback sDspDacCallback; + DUSK_GAME_EXTERN s16* lastRspMadep; + DUSK_GAME_EXTERN void (*dacCallbackFunc)(s16*, u32); + DUSK_GAME_EXTERN MixCallback extMixCallback; + DUSK_GAME_EXTERN u32 sOutputRate; + DUSK_GAME_EXTERN u32 sSubFrameCounter; }; #endif /* JASAICTRL_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASAramStream.h b/libs/JSystem/include/JSystem/JAudio2/JASAramStream.h index dcfcebd30a..46a30d2616 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASAramStream.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASAramStream.h @@ -4,7 +4,7 @@ #include "JSystem/JAudio2/JASTaskThread.h" #include "JSystem/JUtility/JUTAssert.h" #include -#include "dusk/endian.h" +#include "helpers/endian.h" class JASChannel; @@ -256,24 +256,24 @@ public: * Thread that will be sent DVD load commands. * This is the JASDvd thread in practice. */ - static JASTaskThread* sLoadThread; + static DUSK_GAME_DATA JASTaskThread* sLoadThread; /** * Buffer used to read DVD data. Can store the size of an entire streamed audio block. */ - static u8* sReadBuffer; + static DUSK_GAME_DATA u8* sReadBuffer; /** * Block size used by all streamed music in the game. * This is 0x2760 for TP. */ - static u32 sBlockSize; + static DUSK_GAME_DATA u32 sBlockSize; /** * Maximum amount of output channels for all streamed music in the game. * This is 2 for TP (stereo). */ - static u32 sChannelMax; + static DUSK_GAME_DATA u32 sChannelMax; }; #endif /* JASARAMSTREAM_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASAudioThread.h b/libs/JSystem/include/JSystem/JAudio2/JASAudioThread.h index dd9fed2183..f633d58708 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASAudioThread.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASAudioThread.h @@ -30,7 +30,7 @@ struct JASAudioThread : public JKRThread, public JASGlobalInstance { Command mFunc; JASPortArgs* mArgs; - static TPortHead sCommandListOnce; - static TPortHead sCommandListStay; + static DUSK_GAME_DATA TPortHead sCommandListOnce; + static DUSK_GAME_DATA TPortHead sCommandListStay; }; #endif /* JASCMDSTACK_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASDSPChannel.h b/libs/JSystem/include/JSystem/JAudio2/JASDSPChannel.h index 8204ab0838..f2ee2c3e49 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASDSPChannel.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASDSPChannel.h @@ -63,7 +63,7 @@ struct JASDSPChannel { static u32 getNumFree(); static u32 getNumBreak(); - static JASDSPChannel* sDspChannels; + static DUSK_GAME_DATA JASDSPChannel* sDspChannels; /* 0x00 */ s32 mStatus; diff --git a/libs/JSystem/include/JSystem/JAudio2/JASDSPInterface.h b/libs/JSystem/include/JSystem/JAudio2/JASDSPInterface.h index a9a9b2d11e..b413052da7 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASDSPInterface.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASDSPInterface.h @@ -196,15 +196,15 @@ namespace JASDsp { int setFXLine(u8, s16*, JASDsp::FxlineConfig_*); BOOL changeFXLineParam(u8, u8, uintptr_t); - extern u8 const DSPADPCM_FILTER[64]; - extern u32 const DSPRES_FILTER[320]; - extern u16 SEND_TABLE[]; - extern TChannel* CH_BUF; - extern FxBuf* FX_BUF; - extern f32 sDSPVolume; + DUSK_GAME_EXTERN u8 const DSPADPCM_FILTER[64]; + DUSK_GAME_EXTERN u32 const DSPRES_FILTER[320]; + DUSK_GAME_EXTERN u16 SEND_TABLE[]; + DUSK_GAME_EXTERN TChannel* CH_BUF; + DUSK_GAME_EXTERN FxBuf* FX_BUF; + DUSK_GAME_EXTERN f32 sDSPVolume; #if DEBUG - extern s32 dspMutex; + DUSK_GAME_EXTERN s32 dspMutex; #endif }; diff --git a/libs/JSystem/include/JSystem/JAudio2/JASDriverIF.h b/libs/JSystem/include/JSystem/JAudio2/JASDriverIF.h index 5cddc38596..6401c0783a 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASDriverIF.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASDriverIF.h @@ -24,11 +24,11 @@ namespace JASDriver { void DSPSyncCallback(); void updateDacCallback(); - extern JASCallbackMgr sDspSyncCallback; - extern JASCallbackMgr sSubFrameCallback; - extern JASCallbackMgr sUpdateDacCallback; - extern u16 MAX_MIXERLEVEL; - extern u32 JAS_SYSTEM_OUTPUT_MODE; + DUSK_GAME_EXTERN JASCallbackMgr sDspSyncCallback; + DUSK_GAME_EXTERN JASCallbackMgr sSubFrameCallback; + DUSK_GAME_EXTERN JASCallbackMgr sUpdateDacCallback; + DUSK_GAME_EXTERN u16 MAX_MIXERLEVEL; + DUSK_GAME_EXTERN u32 JAS_SYSTEM_OUTPUT_MODE; }; inline void JAISetOutputMode(u32 mode) { diff --git a/libs/JSystem/include/JSystem/JAudio2/JASDvdThread.h b/libs/JSystem/include/JSystem/JAudio2/JASDvdThread.h index 553dffb7ca..c238413f8d 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASDvdThread.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASDvdThread.h @@ -14,7 +14,7 @@ public: static JASTaskThread* getThreadPointer(); static bool createThread(s32 priority, int msgCount, u32 stackSize); - static JASTaskThread* sThread; + static DUSK_GAME_DATA JASTaskThread* sThread; }; #endif /* JASDVDTHREAD_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASHeapCtrl.h b/libs/JSystem/include/JSystem/JAudio2/JASHeapCtrl.h index 7a3ae12470..353e0c4315 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASHeapCtrl.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASHeapCtrl.h @@ -273,10 +273,10 @@ namespace JASKernel { u32 getAramFreeSize(); u32 getAramSize(); - extern JASHeap audioAramHeap; - extern uintptr_t sAramBase; - extern JKRHeap* sSystemHeap; - extern JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* sCommandHeap; + DUSK_GAME_EXTERN JASHeap audioAramHeap; + DUSK_GAME_EXTERN uintptr_t sAramBase; + DUSK_GAME_EXTERN JKRHeap* sSystemHeap; + DUSK_GAME_EXTERN JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* sCommandHeap; }; /** @@ -287,28 +287,28 @@ template class JASPoolAllocObject { public: #if TARGET_PC - static void* operator new(size_t n, JKRHeapToken) { + static void* operator new(size_t n, JKRHeapToken) IF_DUSK(noexcept) { return operator new(n); } #endif - static void* operator new(size_t n) { + static void* operator new(size_t n) IF_DUSK(noexcept) { #if PLATFORM_GCN JASMemPool& memPool_ = getMemPool_(); #endif return memPool_.alloc(n); } - static void* operator new(size_t n, void* ptr) { + static void* operator new(size_t n, void* ptr) IF_DUSK(noexcept) { return ptr; } #if TARGET_PC - static void operator delete(void* ptr, size_t n, JKRHeapToken) { + static void operator delete(void* ptr, size_t n, JKRHeapToken) IF_DUSK(noexcept) { operator delete(ptr, n); } #endif - static void operator delete(void* ptr, size_t n) { + static void operator delete(void* ptr, size_t n) IF_DUSK(noexcept) { #if PLATFORM_GCN JASMemPool& memPool_ = getMemPool_(); #endif @@ -402,28 +402,28 @@ template class JASPoolAllocObject_MultiThreaded { public: #if TARGET_PC - static void* operator new(size_t n, JKRHeapToken) { + static void* operator new(size_t n, JKRHeapToken) IF_DUSK(noexcept) { return operator new(n); } #endif - static void* operator new(size_t n) { + static void* operator new(size_t n) IF_DUSK(noexcept) { #if PLATFORM_GCN JASMemPool_MultiThreaded& memPool_ = getMemPool(); #endif return memPool_.alloc(n); } - static void* operator new(size_t n, void* ptr) { + static void* operator new(size_t n, void* ptr) IF_DUSK(noexcept) { return ptr; } #if TARGET_PC - static void operator delete(void* ptr, size_t n, JKRHeapToken) { + static void operator delete(void* ptr, size_t n, JKRHeapToken) IF_DUSK(noexcept) { return operator delete(ptr, n); } #endif - static void operator delete(void* ptr, size_t n) { + static void operator delete(void* ptr, size_t n) IF_DUSK(noexcept) { #if PLATFORM_GCN JASMemPool_MultiThreaded& memPool_ = getMemPool(); #endif @@ -452,6 +452,6 @@ private: template JASMemPool_MultiThreaded JASPoolAllocObject_MultiThreaded::memPool_; #endif -extern JKRSolidHeap* JASDram; +DUSK_GAME_EXTERN JKRSolidHeap* JASDram; #endif /* JASHEAPCTRL_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASLfo.h b/libs/JSystem/include/JSystem/JAudio2/JASLfo.h index adc27a8325..5177a40f97 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASLfo.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASLfo.h @@ -19,7 +19,7 @@ struct JASLfo { static void updateFreeRun(f32 param_0) { sFreeRunLfo.incCounter(param_0); } - static JASLfo sFreeRunLfo; + static DUSK_GAME_DATA JASLfo sFreeRunLfo; /* 0x00 */ u32 field_0x0; /* 0x04 */ u32 field_0x4; diff --git a/libs/JSystem/include/JSystem/JAudio2/JASOscillator.h b/libs/JSystem/include/JSystem/JAudio2/JASOscillator.h index e811e890ab..8ac20ce1ca 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASOscillator.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASOscillator.h @@ -2,7 +2,7 @@ #define JASOSCILLATOR_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-jaudio @@ -92,10 +92,10 @@ struct JASOscillator { /* 0x1A */ u16 _1A; /* 0x1C */ int _1C; - static const f32 sCurveTableLinear[17]; - static const f32 sCurveTableSampleCell[17]; - static const f32 sCurveTableSqRoot[17]; - static const f32 sCurveTableSquare[17]; + static DUSK_GAME_DATA const f32 sCurveTableLinear[17]; + static DUSK_GAME_DATA const f32 sCurveTableSampleCell[17]; + static DUSK_GAME_DATA const f32 sCurveTableSqRoot[17]; + static DUSK_GAME_DATA const f32 sCurveTableSquare[17]; }; #endif /* JASOSCILLATOR_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASProbe.h b/libs/JSystem/include/JSystem/JAudio2/JASProbe.h index 03337adce7..1aacf96b4a 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASProbe.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASProbe.h @@ -13,7 +13,7 @@ struct JASProbe { void stop(); static void stop(s32); - static JASProbe* sProbeTable[16]; + static DUSK_GAME_DATA JASProbe* sProbeTable[16]; /* 0x000 */ char const* mName; /* 0x004 */ s32 mStartTime; diff --git a/libs/JSystem/include/JSystem/JAudio2/JASSeqCtrl.h b/libs/JSystem/include/JSystem/JAudio2/JASSeqCtrl.h index d481192d6f..ce184e400d 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASSeqCtrl.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASSeqCtrl.h @@ -73,7 +73,7 @@ public: /* 0x52 */ u16 field_0x52; /* 0x54 */ u32 field_0x54; /* 0x58 */ u32 field_0x58; - static JASSeqParser sDefaultParser; + static DUSK_GAME_DATA JASSeqParser sDefaultParser; }; #endif /* JASSEQCTRL_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASSeqParser.h b/libs/JSystem/include/JSystem/JAudio2/JASSeqParser.h index 51db04ba26..8040e07228 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASSeqParser.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASSeqParser.h @@ -92,9 +92,9 @@ public: static void registerSeqCallback(u16 (*param_0)(JASTrack*, u16)) { sCallBackFunc = param_0; } - static CmdInfo sCmdInfo[96]; - static CmdInfo sExtCmdInfo[255]; - static u16 (*sCallBackFunc)(JASTrack*, u16); + static DUSK_GAME_DATA CmdInfo sCmdInfo[96]; + static DUSK_GAME_DATA CmdInfo sExtCmdInfo[255]; + static DUSK_GAME_DATA u16 (*sCallBackFunc)(JASTrack*, u16); }; #endif /* JASSEQPARSER_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASTrack.h b/libs/JSystem/include/JSystem/JAudio2/JASTrack.h index b54a98aa77..eb8010be52 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASTrack.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASTrack.h @@ -14,7 +14,7 @@ struct JASSoundParams; namespace JASDsp { struct TChannel; - extern const u32 FILTER_MODE_IIR; + DUSK_GAME_EXTERN const u32 FILTER_MODE_IIR; }; #if !BIT_64 @@ -136,12 +136,12 @@ struct JASTrack : public JASPoolAllocObject_MultiThreaded { static void channelUpdateCallback(u32, JASChannel*, JASDsp::TChannel*, void*); - static JASOscillator::Point const sAdsTable[4]; - static JASOscillator::Data const sEnvOsc; - static JASOscillator::Data const sPitchEnvOsc; + static DUSK_GAME_DATA JASOscillator::Point const sAdsTable[4]; + static DUSK_GAME_DATA JASOscillator::Data const sEnvOsc; + static DUSK_GAME_DATA JASOscillator::Data const sPitchEnvOsc; - static JASDefaultBankTable sDefaultBankTable; - static TList sTrackList; + static DUSK_GAME_DATA JASDefaultBankTable sDefaultBankTable; + static DUSK_GAME_DATA TList sTrackList; static const int MAX_CHILDREN = 16; diff --git a/libs/JSystem/include/JSystem/JAudio2/JASVoiceBank.h b/libs/JSystem/include/JSystem/JAudio2/JASVoiceBank.h index f54273e962..ee40ea1074 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASVoiceBank.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASVoiceBank.h @@ -14,8 +14,8 @@ public: virtual ~JASVoiceBank(); virtual u32 getType() const; - static const JASOscillator::Data sOscData; - static JASOscillator::Data* sOscTable; + static DUSK_GAME_DATA const JASOscillator::Data sOscData; + static DUSK_GAME_DATA JASOscillator::Data* sOscTable; }; #endif /* JASVOICEBANK_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASWSParser.h b/libs/JSystem/include/JSystem/JAudio2/JASWSParser.h index 68d91006ba..9fe201308c 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASWSParser.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASWSParser.h @@ -89,7 +89,7 @@ public: static JASBasicWaveBank* createBasicWaveBank(void const*, JKRHeap*); static JASSimpleWaveBank* createSimpleWaveBank(void const*, JKRHeap*); - static u32 sUsedHeapSize; + static DUSK_GAME_DATA u32 sUsedHeapSize; }; #endif /* JASWSPARSER_H */ diff --git a/libs/JSystem/include/JSystem/JAudio2/JASWaveArcLoader.h b/libs/JSystem/include/JSystem/JAudio2/JASWaveArcLoader.h index eea3eddac3..0ad4e044c8 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASWaveArcLoader.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASWaveArcLoader.h @@ -28,8 +28,8 @@ struct JASWaveArcLoader { static void setCurrentDir(char const*); static char* getCurrentDir(); - static char sCurrentDir[DIR_MAX]; - static JASHeap* sAramHeap; + static DUSK_GAME_DATA char sCurrentDir[DIR_MAX]; + static DUSK_GAME_DATA JASHeap* sAramHeap; }; /** diff --git a/libs/JSystem/include/JSystem/JAudio2/JASWaveInfo.h b/libs/JSystem/include/JSystem/JAudio2/JASWaveInfo.h index cac518836e..04bd541204 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JASWaveInfo.h +++ b/libs/JSystem/include/JSystem/JAudio2/JASWaveInfo.h @@ -33,7 +33,7 @@ struct JASWaveInfo { /* 0x1E */ s16 mpPenult; /* 0x20 */ const u32* field_0x20; - static u32 one; + static DUSK_GAME_DATA u32 one; }; /** diff --git a/libs/JSystem/include/JSystem/JAudio2/JAUAudibleParam.h b/libs/JSystem/include/JSystem/JAudio2/JAUAudibleParam.h index 44d4137d9b..cc5653fe25 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAUAudibleParam.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAUAudibleParam.h @@ -2,7 +2,7 @@ #define JAUAUDIBLEPARAM_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-jaudio diff --git a/libs/JSystem/include/JSystem/JAudio2/JAUAudioArcInterpreter.h b/libs/JSystem/include/JSystem/JAudio2/JAUAudioArcInterpreter.h index c36ad44b22..33a31adb9f 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAUAudioArcInterpreter.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAUAudioArcInterpreter.h @@ -2,7 +2,7 @@ #define JAUAUDIOARCINTERPRETER_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-jaudio diff --git a/libs/JSystem/include/JSystem/JAudio2/JAUInitializer.h b/libs/JSystem/include/JSystem/JAudio2/JAUInitializer.h index 9f9e5bc6fd..4753a9212d 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAUInitializer.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAUInitializer.h @@ -2,6 +2,7 @@ #define JAUINITIALIZER_H #include +#include "global.h" class JKRSolidHeap; @@ -26,7 +27,7 @@ public: /* 0x24 */ int aramBlockSize_; /* 0x28 */ int aramChannelNum_; /* 0x2C */ f32 dspLevel_; - /* 0x30 */ char* waveArcDir_; + /* 0x30 */ DUSK_CONST char* waveArcDir_; }; /** diff --git a/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h b/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h index e81cd70ee4..f590815af5 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAUSoundAnimator.h @@ -2,7 +2,7 @@ #define JAUSOUNDANIMATOR_H #include "JSystem/JAudio2/JAISound.h" -#include "dusk/offset_ptr.h" +#include "helpers/offset_ptr.h" class JAUSoundAnimation; diff --git a/libs/JSystem/include/JSystem/JAudio2/JAUSoundTable.h b/libs/JSystem/include/JSystem/JAudio2/JAUSoundTable.h index 4cc48f2a0b..fbd3427649 100644 --- a/libs/JSystem/include/JSystem/JAudio2/JAUSoundTable.h +++ b/libs/JSystem/include/JSystem/JAudio2/JAUSoundTable.h @@ -3,7 +3,7 @@ #include "JSystem/JAudio2/JAISound.h" #include "JSystem/JAudio2/JASGadget.h" -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-jaudio diff --git a/libs/JSystem/include/JSystem/JFramework/JFWDisplay.h b/libs/JSystem/include/JSystem/JFramework/JFWDisplay.h index 28967cc0a2..c9fc602b29 100644 --- a/libs/JSystem/include/JSystem/JFramework/JFWDisplay.h +++ b/libs/JSystem/include/JSystem/JFramework/JFWDisplay.h @@ -27,7 +27,7 @@ public: OSThread* getThread() const { return mThread; } void setThread(OSThread* thread) { mThread = thread; } - static JSUList sList; + static DUSK_GAME_DATA JSUList sList; public: /* 0x28 */ OSThread* mThread; @@ -108,7 +108,7 @@ public: int getEfbHeight() const { return JUTVideo::getManager()->getEfbHeight(); } JUTXfb* getXfbManager() const { return mXfbManager; } - static JFWDisplay* sManager; + static DUSK_GAME_DATA JFWDisplay* sManager; private: /* 0x04 */ JUTFader* mFader; diff --git a/libs/JSystem/include/JSystem/JFramework/JFWSystem.h b/libs/JSystem/include/JSystem/JFramework/JFWSystem.h index 288b5f03d8..c8d3940331 100644 --- a/libs/JSystem/include/JSystem/JFramework/JFWSystem.h +++ b/libs/JSystem/include/JSystem/JFramework/JFWSystem.h @@ -18,17 +18,17 @@ struct ResFONT; */ struct JFWSystem { struct CSetUpParam { - static s32 maxStdHeaps; - static u32 sysHeapSize; - static u32 fifoBufSize; - static u32 aramAudioBufSize; - static u32 aramGraphBufSize; - static s32 streamPriority; - static s32 decompPriority; - static s32 aPiecePriority; - static ResFONT* systemFontRes; - static const GXRenderModeObj* renderMode; - static u32 exConsoleBufferSize; + static DUSK_GAME_DATA s32 maxStdHeaps; + static DUSK_GAME_DATA u32 sysHeapSize; + static DUSK_GAME_DATA u32 fifoBufSize; + static DUSK_GAME_DATA u32 aramAudioBufSize; + static DUSK_GAME_DATA u32 aramGraphBufSize; + static DUSK_GAME_DATA s32 streamPriority; + static DUSK_GAME_DATA s32 decompPriority; + static DUSK_GAME_DATA s32 aPiecePriority; + static DUSK_GAME_DATA ResFONT* systemFontRes; + static DUSK_GAME_DATA const GXRenderModeObj* renderMode; + static DUSK_GAME_DATA u32 exConsoleBufferSize; }; static void firstInit(); @@ -67,14 +67,14 @@ struct JFWSystem { CSetUpParam::renderMode = p_modeObj; } - static JKRExpHeap* rootHeap; - static JKRExpHeap* systemHeap; - static JKRThread* mainThread; - static JUTDbPrint* debugPrint; - static JUTResFont* systemFont; - static JUTConsoleManager* systemConsoleManager; - static JUTConsole* systemConsole; - static bool sInitCalled; + static DUSK_GAME_DATA JKRExpHeap* rootHeap; + static DUSK_GAME_DATA JKRExpHeap* systemHeap; + static DUSK_GAME_DATA JKRThread* mainThread; + static DUSK_GAME_DATA JUTDbPrint* debugPrint; + static DUSK_GAME_DATA JUTResFont* systemFont; + static DUSK_GAME_DATA JUTConsoleManager* systemConsoleManager; + static DUSK_GAME_DATA JUTConsole* systemConsole; + static DUSK_GAME_DATA bool sInitCalled; }; #endif /* JFWSYSTEM_H */ diff --git a/libs/JSystem/include/JSystem/JGadget/binary.h b/libs/JSystem/include/JSystem/JGadget/binary.h index f93e548f88..eb0ddfb1d0 100644 --- a/libs/JSystem/include/JSystem/JGadget/binary.h +++ b/libs/JSystem/include/JSystem/JGadget/binary.h @@ -3,7 +3,7 @@ #include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JGadget/search.h" -#include "dusk/endian.h" +#include "helpers/endian.h" namespace JGadget { namespace binary { diff --git a/libs/JSystem/include/JSystem/JHostIO/JHICommonMem.h b/libs/JSystem/include/JSystem/JHostIO/JHICommonMem.h index 3d8c452c72..e5a3e11553 100644 --- a/libs/JSystem/include/JSystem/JHostIO/JHICommonMem.h +++ b/libs/JSystem/include/JSystem/JHostIO/JHICommonMem.h @@ -2,7 +2,7 @@ #define JHICOMMONMEM_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" inline u32 JHIhtonl(u32 v) { return BSWAP32(v); diff --git a/libs/JSystem/include/JSystem/JHostIO/JHIMccBuf.h b/libs/JSystem/include/JSystem/JHostIO/JHIMccBuf.h index 7343b88376..a7b4544980 100644 --- a/libs/JSystem/include/JSystem/JHostIO/JHIMccBuf.h +++ b/libs/JSystem/include/JSystem/JHostIO/JHIMccBuf.h @@ -27,8 +27,8 @@ public: virtual void disablePort() { mPortEnabled = false; } virtual bool isPort() { return mPortEnabled; } - static u8* mTempBuf; - static u16 mRefCount; + static DUSK_GAME_DATA u8* mTempBuf; + static DUSK_GAME_DATA u16 mRefCount; /* 0x04 */ u32 mTag; /* 0x08 */ u16 field_0x8; diff --git a/libs/JSystem/include/JSystem/JHostIO/JORReflexible.h b/libs/JSystem/include/JSystem/JHostIO/JORReflexible.h index 533a3184ba..84894de275 100644 --- a/libs/JSystem/include/JSystem/JHostIO/JORReflexible.h +++ b/libs/JSystem/include/JSystem/JHostIO/JORReflexible.h @@ -12,12 +12,23 @@ struct JORNodeEvent; class JORMContext; class JORServer; +// NOTE (stable game ABI): these classes stay non-polymorphic outside DEBUG +// on purpose. Making them polymorphic under PARTIAL_DEBUG would give every one of the ~250 +// derived HIO classes a vptr and turn their plain `void genMessage(JORMContext*);` +// declarations into implicit virtual overrides whose definitions are #if DEBUG-gated; every +// instantiated one then fails to link (missing vtable). Closure types shared with DEBUG TUs +// either declare their own unconditional virtuals (vptr in all TUs anyway) or add a +// PARTIAL_DEBUG-only virtual dtor for vptr parity (see dAttParam_c). class JOREventListener { public: #if DEBUG JOREventListener() {} +#if TARGET_PC + virtual void listenPropertyEvent(const JORPropertyEvent*) {} +#else virtual void listenPropertyEvent(const JORPropertyEvent*) = 0; #endif +#endif }; class JORReflexible : public JOREventListener { @@ -30,7 +41,11 @@ public: virtual void listenPropertyEvent(const JORPropertyEvent*); virtual void listen(u32, const JOREvent*); virtual void genObjectInfo(const JORGenEvent*); +#if TARGET_PC + virtual void genMessage(JORMContext*) {} +#else virtual void genMessage(JORMContext*) = 0; +#endif virtual void listenNodeEvent(const JORNodeEvent*); #endif }; diff --git a/libs/JSystem/include/JSystem/JHostIO/JORServer.h b/libs/JSystem/include/JSystem/JHostIO/JORServer.h index 53f3283f6c..ecb6225650 100644 --- a/libs/JSystem/include/JSystem/JHostIO/JORServer.h +++ b/libs/JSystem/include/JSystem/JHostIO/JORServer.h @@ -120,7 +120,7 @@ public: CallbackLinkList* referEventCallbackList() { return &m_eventCallbackList; } static JORServer* getInstance() { return instance; } - static JORServer* instance; + static DUSK_GAME_DATA JORServer* instance; /* 0x0000C */ JORMContext m_context; /* 0x10020 */ JORReflexible* mp_rootObj; diff --git a/libs/JSystem/include/JSystem/JKernel/JKRAram.h b/libs/JSystem/include/JSystem/JKernel/JKRAram.h index dd3bf54f9c..c934820b13 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRAram.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRAram.h @@ -65,13 +65,13 @@ public: static u32 getSZSBufferSize() { return sSZSBufferSize; } static void setSZSBufferSize(u32 size) { sSZSBufferSize = size; } - static OSMessageQueue sMessageQueue; + static DUSK_GAME_DATA OSMessageQueue sMessageQueue; private: - static JKRAram* sAramObject; - static u32 sSZSBufferSize; - static OSMessage sMessageBuffer[4]; - static JSUList sAramCommandList; + static DUSK_GAME_DATA JKRAram* sAramObject; + static DUSK_GAME_DATA u32 sSZSBufferSize; + static DUSK_GAME_DATA OSMessage sMessageBuffer[4]; + static DUSK_GAME_DATA JSUList sAramCommandList; }; inline JKRAramBlock* JKRAllocFromAram(u32 size, JKRAramHeap::EAllocMode allocMode) { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRAramHeap.h b/libs/JSystem/include/JSystem/JKernel/JKRAramHeap.h index 0d7734f6f4..b502e21aa7 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRAramHeap.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRAramHeap.h @@ -19,7 +19,7 @@ public: }; public: - static JSUList sAramList; + static DUSK_GAME_DATA JSUList sAramList; JKRAramHeap(u32, u32); virtual ~JKRAramHeap(); diff --git a/libs/JSystem/include/JSystem/JKernel/JKRAramPiece.h b/libs/JSystem/include/JSystem/JKernel/JKRAramPiece.h index 51eeef27e9..f701afd08f 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRAramPiece.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRAramPiece.h @@ -62,9 +62,9 @@ struct JKRAramCommand { */ class JKRAramPiece { public: - static OSMutex mMutex; + static DUSK_GAME_DATA OSMutex mMutex; // TODO: fix type - static JSUList sAramPieceCommandList; + static DUSK_GAME_DATA JSUList sAramPieceCommandList; public: static JKRAMCommand* prepareCommand(int, uintptr_t, uintptr_t, u32, JKRAramBlock*, diff --git a/libs/JSystem/include/JSystem/JKernel/JKRAramStream.h b/libs/JSystem/include/JSystem/JKernel/JKRAramStream.h index 47d9257229..9ea3fb4eb6 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRAramStream.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRAramStream.h @@ -60,13 +60,13 @@ public: static void setTransBuffer(u8*, u32, JKRHeap*); private: - static JKRAramStream* sAramStreamObject; - static OSMessage sMessageBuffer[4]; - static OSMessageQueue sMessageQueue; + static DUSK_GAME_DATA JKRAramStream* sAramStreamObject; + static DUSK_GAME_DATA OSMessage sMessageBuffer[4]; + static DUSK_GAME_DATA OSMessageQueue sMessageQueue; - static u8* transBuffer; - static u32 transSize; - static JKRHeap* transHeap; + static DUSK_GAME_DATA u8* transBuffer; + static DUSK_GAME_DATA u32 transSize; + static DUSK_GAME_DATA JKRHeap* transHeap; }; inline JKRAramStream* JKRCreateAramStreamManager(s32 priority) { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRArchive.h b/libs/JSystem/include/JSystem/JKernel/JKRArchive.h index 6397955a3d..4ac5de7a46 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRArchive.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRArchive.h @@ -4,7 +4,7 @@ #include "JSystem/JKernel/JKRCompression.h" #include "JSystem/JKernel/JKRFileLoader.h" #include "global.h" -#include "dusk/endian.h" +#include "helpers/endian.h" class JKRHeap; @@ -39,13 +39,13 @@ struct SArcDataInfo { /* 0x1B */ u8 field_1b[5]; }; -inline u32 read_big_endian_u32(void* ptr) { - u8* uptr = (u8*)ptr; +inline u32 read_big_endian_u32(void DUSK_CONST* ptr) { + u8 DUSK_CONST* uptr = (u8 DUSK_CONST*)ptr; return ((u32)uptr[0] << 0x18) | ((u32)uptr[1] << 0x10) | ((u32)uptr[2] << 8) | (u32)uptr[3]; } -inline u16 read_big_endian_u16(void* ptr) { - u8* uptr = (u8*)ptr; +inline u16 read_big_endian_u16(void DUSK_CONST* ptr) { + u8 DUSK_CONST* uptr = (u8 DUSK_CONST*)ptr; return ((u16)uptr[0] << 8) | ((u16)uptr[1]); } @@ -242,7 +242,7 @@ public: static void setCurrentDirID(u32 dirID) { sCurrentDirID = dirID; } protected: - static u32 sCurrentDirID; + static DUSK_GAME_DATA u32 sCurrentDirID; }; inline JKRCompression JKRConvertAttrToCompressionType(int attr) { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRDecomp.h b/libs/JSystem/include/JSystem/JKernel/JKRDecomp.h index 2e7ce0ef1c..f7b4581993 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRDecomp.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRDecomp.h @@ -61,9 +61,9 @@ public: static void decodeSZS(u8*, u8*, u32, u32); static JKRCompression checkCompressed(u8*); - static JKRDecomp* sDecompObject; - static OSMessage sMessageBuffer[8]; - static OSMessageQueue sMessageQueue; + static DUSK_GAME_DATA JKRDecomp* sDecompObject; + static DUSK_GAME_DATA OSMessage sMessageBuffer[8]; + static DUSK_GAME_DATA OSMessageQueue sMessageQueue; }; inline void JKRDecompress(u8* srcBuffer, u8* dstBuffer, u32 srcLength, u32 dstLength) { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRDvdAramRipper.h b/libs/JSystem/include/JSystem/JKernel/JKRDvdAramRipper.h index 110827dc0b..20e8001e50 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRDvdAramRipper.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRDvdAramRipper.h @@ -55,9 +55,9 @@ public: static bool isErrorRetry() { return errorRetry; } // TODO: fix type - static JSUList sDvdAramAsyncList; - static u32 sSZSBufferSize; - static bool errorRetry; + static DUSK_GAME_DATA JSUList sDvdAramAsyncList; + static DUSK_GAME_DATA u32 sSZSBufferSize; + static DUSK_GAME_DATA bool errorRetry; }; inline JKRAramBlock *JKRDvdToAram(s32 entrynum, u32 p2, JKRExpandSwitch expSwitch, u32 p4, u32 p5, u32 *p6) { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRDvdFile.h b/libs/JSystem/include/JSystem/JKernel/JKRDvdFile.h index f32c8c6778..d5d439d363 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRDvdFile.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRDvdFile.h @@ -62,7 +62,7 @@ public: static JSUList& getDvdList() { return sDvdList; } private: - static JSUList sDvdList; + static DUSK_GAME_DATA JSUList sDvdList; }; #endif /* JKRDVDFILE_H */ diff --git a/libs/JSystem/include/JSystem/JKernel/JKRDvdRipper.h b/libs/JSystem/include/JSystem/JKernel/JKRDvdRipper.h index 0720605efb..aafecf063b 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRDvdRipper.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRDvdRipper.h @@ -33,11 +33,11 @@ class JKRDvdFile; */ class JKRDvdRipper { public: - static JSUList sDvdAsyncList; - static u32 sSZSBufferSize; - static bool errorRetry; + static DUSK_GAME_DATA JSUList sDvdAsyncList; + static DUSK_GAME_DATA u32 sSZSBufferSize; + static DUSK_GAME_DATA bool errorRetry; #if TARGET_PC - static JKRHeap* sHeap; + static DUSK_GAME_DATA JKRHeap* sHeap; #endif enum EAllocDirection { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRFileLoader.h b/libs/JSystem/include/JSystem/JKernel/JKRFileLoader.h index 7e3e4cd1c5..cd1483ed1f 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRFileLoader.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRFileLoader.h @@ -53,8 +53,8 @@ public: static void setCurrentVolume(JKRFileLoader* fileLoader) { sCurrentVolume = fileLoader; } static JSUList& getVolumeList() { return sVolumeList; } - static JKRFileLoader* sCurrentVolume; - static JSUList sVolumeList; + static DUSK_GAME_DATA JKRFileLoader* sCurrentVolume; + static DUSK_GAME_DATA JSUList sVolumeList; }; inline bool JKRDetachResource(void* resource, JKRFileLoader* fileLoader) { diff --git a/libs/JSystem/include/JSystem/JKernel/JKRHeap.h b/libs/JSystem/include/JSystem/JKernel/JKRHeap.h index d3710bd5df..ace28de6e3 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRHeap.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRHeap.h @@ -11,12 +11,12 @@ class JKRHeap; typedef void (*JKRErrorHandler)(void*, u32, int); -extern u8 JKRValue_DEBUGFILL_NOTUSE; -extern u8 JKRValue_DEBUGFILL_NEW; -extern u8 JKRValue_DEBUGFILL_DELETE; +DUSK_GAME_EXTERN u8 JKRValue_DEBUGFILL_NOTUSE; +DUSK_GAME_EXTERN u8 JKRValue_DEBUGFILL_NEW; +DUSK_GAME_EXTERN u8 JKRValue_DEBUGFILL_DELETE; -extern s32 fillcheck_dispcount; -extern bool data_8074A8D0_debug; +DUSK_GAME_EXTERN s32 fillcheck_dispcount; +DUSK_GAME_EXTERN bool data_8074A8D0_debug; #if BIT_64 #define MEM_BLOCK_SIZE 0x20 @@ -194,26 +194,26 @@ public: } static void* getState_buf_(TState* state) { return &state->mBuf; } - static void* mCodeStart; - static void* mCodeEnd; - static void* mUserRamStart; - static void* mUserRamEnd; - static u32 mMemorySize; - static JKRAllocCallback sAllocCallback; - static JKRFreeCallback sFreeCallback; + static DUSK_GAME_DATA void* mCodeStart; + static DUSK_GAME_DATA void* mCodeEnd; + static DUSK_GAME_DATA void* mUserRamStart; + static DUSK_GAME_DATA void* mUserRamEnd; + static DUSK_GAME_DATA u32 mMemorySize; + static DUSK_GAME_DATA JKRAllocCallback sAllocCallback; + static DUSK_GAME_DATA JKRFreeCallback sFreeCallback; - static bool sDefaultFillFlag; + static DUSK_GAME_DATA bool sDefaultFillFlag; - static JKRHeap* sRootHeap; + static DUSK_GAME_DATA JKRHeap* sRootHeap; - static JKRHeap* sRootHeap2; + static DUSK_GAME_DATA JKRHeap* sRootHeap2; - static JKRHeap* sSystemHeap; + static DUSK_GAME_DATA JKRHeap* sSystemHeap; #if !TARGET_PC // Hide sCurrentHeap, we need to make it thread local. static JKRHeap* sCurrentHeap; #endif - static JKRErrorHandler mErrorHandler; + static DUSK_GAME_DATA JKRErrorHandler mErrorHandler; #if TARGET_PC void setName(const char* name); @@ -237,11 +237,11 @@ enum class JKRHeapToken { Dummy }; -inline void* operator new(size_t, JKRHeapToken, void* where) { +inline void* operator new(size_t, JKRHeapToken, void* where) noexcept { return where; } -inline void* operator new[](size_t, JKRHeapToken, void* where) { +inline void* operator new[](size_t, JKRHeapToken, void* where) noexcept { return where; } @@ -264,21 +264,21 @@ inline void* operator new[](size_t, JKRHeapToken, void* where) { #define JKR_HEAP_TOKEN_PARAM #endif -void* operator new(size_t size JKR_HEAP_TOKEN_PARAM); -void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment); -void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment); +void* operator new(size_t size JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept); +void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) IF_DUSK(noexcept); +void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) IF_DUSK(noexcept); // On PC, these new[] overloads are only used to catch usages of JKR_NEW with []. -void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM); -void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment); -void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment); +void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept); +void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment) IF_DUSK(noexcept); +void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) IF_DUSK(noexcept); -void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM); -void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM); +void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept); +void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept); #if TARGET_PC template -void jkrDelete(T* ptr) { +void jkrDelete(T* ptr) IF_DUSK(noexcept) { if (ptr == nullptr) { return; } @@ -298,7 +298,7 @@ void jkrDelete(T* ptr) { } template<> -inline void jkrDelete(void* ptr) { +inline void jkrDelete(void* ptr) IF_DUSK(noexcept) { if (ptr == nullptr) { return; } @@ -322,7 +322,7 @@ constexpr bool newArgsHasCustomAlignment() { } template -T* jkrNewArray(size_t count, std::in_place_type_t, Args&&... args) { +T* jkrNewArray(size_t count, std::in_place_type_t, Args&&... args) IF_DUSK(noexcept) { size_t allocSize = count * sizeof(T); if constexpr (!std::is_trivially_destructible()) { static_assert( @@ -333,6 +333,10 @@ T* jkrNewArray(size_t count, std::in_place_type_t, Args&&... args) { } void* ptr = operator new(allocSize, JKRHeapToken::Dummy, args...); + if (!ptr) { + return nullptr; + } + T* dataPtr; if constexpr (!std::is_trivially_destructible()) { auto length = static_cast(ptr); @@ -352,7 +356,7 @@ T* jkrNewArray(size_t count, std::in_place_type_t, Args&&... args) { } template -void jkrDeleteArray(T* pointer) { +void jkrDeleteArray(T* pointer) IF_DUSK(noexcept) { if (pointer == nullptr) { return; } @@ -372,7 +376,7 @@ void jkrDeleteArray(T* pointer) { } template<> -inline void jkrDeleteArray(void* pointer) { +inline void jkrDeleteArray(void* pointer) IF_DUSK(noexcept) { if (pointer == nullptr) { return; } diff --git a/libs/JSystem/include/JSystem/JKernel/JKRThread.h b/libs/JSystem/include/JSystem/JKernel/JKRThread.h index 79217f3675..b77b40c74e 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRThread.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRThread.h @@ -141,7 +141,7 @@ public: static JKRThread* searchThread(OSThread* thread); static JSUList& getList() { return (JSUList&)sThreadList; } - static JSUList sThreadList; + static DUSK_GAME_DATA JSUList sThreadList; // static u8 sThreadList[12]; #if TARGET_PC @@ -155,7 +155,7 @@ public: virtual ~JKRIdleThread() { sThread = NULL; } virtual void* run() { while (true); } - static void* sThread; + static DUSK_GAME_DATA void* sThread; }; typedef void (*JKRThreadSwitch_PreCallback)(OSThread* current, OSThread* next); @@ -181,11 +181,11 @@ public: static u32 getTotalCount() { return sTotalCount; } private: - static JKRThreadSwitch* sManager; - static u32 sTotalCount; - static u64 sTotalStart; - static JKRThreadSwitch_PreCallback mUserPreCallback; - static JKRThreadSwitch_PostCallback mUserPostCallback; + static DUSK_GAME_DATA JKRThreadSwitch* sManager; + static DUSK_GAME_DATA u32 sTotalCount; + static DUSK_GAME_DATA u64 sTotalStart; + static DUSK_GAME_DATA JKRThreadSwitch_PreCallback mUserPreCallback; + static DUSK_GAME_DATA JKRThreadSwitch_PostCallback mUserPostCallback; private: /* 0x00 */ // vtable @@ -207,8 +207,8 @@ public: int check(); - static JSUList sTaskList; - static u8 sEndMesgQueue[32]; + static DUSK_GAME_DATA JSUList sTaskList; + static DUSK_GAME_DATA u8 sEndMesgQueue[32]; /* 0x7C */ JSULink mTaskLink; /* 0x8C */ u8 field_0x8c[0x94 - 0x8C]; diff --git a/libs/JSystem/include/JSystem/JMath/JMATrigonometric.h b/libs/JSystem/include/JSystem/JMath/JMATrigonometric.h index e51296ba3b..520f18810d 100644 --- a/libs/JSystem/include/JSystem/JMath/JMATrigonometric.h +++ b/libs/JSystem/include/JSystem/JMath/JMATrigonometric.h @@ -141,9 +141,9 @@ struct TAsinAcosTable { } }; -extern TSinCosTable<13, f32> sincosTable_; -extern TAtanTable<1024, f32> atanTable_; -extern TAsinAcosTable<1024, f32> asinAcosTable_; +DUSK_GAME_EXTERN TSinCosTable<13, f32> sincosTable_; +DUSK_GAME_EXTERN TAtanTable<1024, f32> atanTable_; +DUSK_GAME_EXTERN TAsinAcosTable<1024, f32> asinAcosTable_; inline f32 acosDegree(f32 x) { return asinAcosTable_.acosDegree(x); diff --git a/libs/JSystem/include/JSystem/JMath/JMath.h b/libs/JSystem/include/JSystem/JMath/JMath.h index 5d0263d669..8a7efc3f32 100644 --- a/libs/JSystem/include/JSystem/JMath/JMath.h +++ b/libs/JSystem/include/JSystem/JMath/JMath.h @@ -4,7 +4,7 @@ #include #include -#include "dusk/math.h" +#include "helpers/math.h" typedef f32 Mtx33[3][3]; typedef f32 Mtx23[2][3]; diff --git a/libs/JSystem/include/JSystem/JMessage/JMessage.h b/libs/JSystem/include/JSystem/JMessage/JMessage.h index 0b3d1c64c8..7218c7f4a9 100644 --- a/libs/JSystem/include/JSystem/JMessage/JMessage.h +++ b/libs/JSystem/include/JSystem/JMessage/JMessage.h @@ -6,7 +6,7 @@ #else #include #endif -#include "dusk/endian.h" +#include "helpers/endian.h" // Struct definitions might be wrong typedef struct bmg_header_t { diff --git a/libs/JSystem/include/JSystem/JMessage/data.h b/libs/JSystem/include/JSystem/JMessage/data.h index 0f7e4fda95..bfb3303056 100644 --- a/libs/JSystem/include/JSystem/JMessage/data.h +++ b/libs/JSystem/include/JSystem/JMessage/data.h @@ -81,8 +81,8 @@ struct data { static unsigned int getTagCode(u32 tag) { return tag & 0xFFFF; } static u8 getTagGroup(u32 tag) { return tag >> 0x10; } - static const BE(u32) ga4cSignature; - static const BE(u32) ga4cSignature_color; + static DUSK_GAME_DATA const BE(u32) ga4cSignature; + static DUSK_GAME_DATA const BE(u32) ga4cSignature_color; static const int gcTagBegin = '\x1A'; // All text Control Tags will begin with this character diff --git a/libs/JSystem/include/JSystem/JMessage/resource.h b/libs/JSystem/include/JSystem/JMessage/resource.h index 6e4acdd6a7..cecfe9dbbb 100644 --- a/libs/JSystem/include/JSystem/JMessage/resource.h +++ b/libs/JSystem/include/JSystem/JMessage/resource.h @@ -144,7 +144,7 @@ struct TResourceContainer { destroyResource_color(); } - static JMessage::locale::parseCharacter_function sapfnParseCharacter_[5]; + static DUSK_GAME_DATA JMessage::locale::parseCharacter_function sapfnParseCharacter_[5]; /* 0x00 */ u8 encodingType_; /* 0x04 */ JMessage::locale::parseCharacter_function pfnParseCharacter_; diff --git a/libs/JSystem/include/JSystem/JParticle/JPABaseShape.h b/libs/JSystem/include/JSystem/JParticle/JPABaseShape.h index 795a5a2628..84fc657387 100644 --- a/libs/JSystem/include/JSystem/JParticle/JPABaseShape.h +++ b/libs/JSystem/include/JSystem/JParticle/JPABaseShape.h @@ -3,6 +3,20 @@ #include +#if TARGET_PC +#include + +struct ParticleDrawCtx { + bool batch; // off = immediate mode + bool useTexMtx; // UVs transformed by texMtx + bool useClr0; // prm color in GX_VA_CLR0 + bool useClr1; // env color in GX_VA_CLR1 + Mtx texMtx; + GXColor clr0; + GXColor clr1; +}; +#endif + struct JPAEmitterWorkData; class JPABaseParticle; class JKRHeap; @@ -49,13 +63,13 @@ public: JPABaseShape(u8 const*, JKRHeap*); void setGX(JPAEmitterWorkData*) const; - static GXBlendMode st_bm[3]; - static GXBlendFactor st_bf[10]; - static GXLogicOp st_lo[16]; - static GXCompare st_c[8]; - static GXAlphaOp st_ao[4]; - static GXTevColorArg st_ca[6][4]; - static GXTevAlphaArg st_aa[2][4]; + static DUSK_GAME_DATA GXBlendMode st_bm[3]; + static DUSK_GAME_DATA GXBlendFactor st_bf[10]; + static DUSK_GAME_DATA GXLogicOp st_lo[16]; + static DUSK_GAME_DATA GXCompare st_c[8]; + static DUSK_GAME_DATA GXAlphaOp st_ao[4]; + static DUSK_GAME_DATA GXTevColorArg st_ca[6][4]; + static DUSK_GAME_DATA GXTevAlphaArg st_aa[2][4]; GXBlendMode getBlendMode() const { return st_bm[pBsd->mBlendModeCfg & 0x03]; } GXBlendFactor getBlendSrc() const { return st_bf[(pBsd->mBlendModeCfg >> 2) & 0x0F]; } @@ -75,6 +89,9 @@ public: const GXTevColorArg* getTevColorArg() const { return st_ca[(pBsd->mFlags >> 0x0F) & 0x07]; } const GXTevAlphaArg* getTevAlphaArg() const { return st_aa[(pBsd->mFlags >> 0x12) & 0x01]; } +#if TARGET_PC + u32 getTevColorArgSel() const { return (pBsd->mFlags >> 0x0F) & 0x07; } +#endif u32 getType() const { return (pBsd->mFlags >> 0) & 0x0F; } u32 getDirType() const { return (pBsd->mFlags >> 4) & 0x07; } @@ -186,26 +203,34 @@ void JPARegistPrm(JPAEmitterWorkData*); void JPARegistEnv(JPAEmitterWorkData*); void JPARegistPrmEnv(JPAEmitterWorkData*); -void JPADrawPoint(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawLine(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawRotBillboard(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawBillboard(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawRotDirection(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawDirection(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawRotation(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawDBillboard(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawRotYBillboard(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawYBillboard(JPAEmitterWorkData*, JPABaseParticle*); -void JPADrawParticleCallBack(JPAEmitterWorkData*, JPABaseParticle*); -void JPALoadTexAnm(JPAEmitterWorkData*, JPABaseParticle*); -void JPASetPointSize(JPAEmitterWorkData*, JPABaseParticle*); -void JPASetLineWidth(JPAEmitterWorkData*, JPABaseParticle*); -void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData*, JPABaseParticle*); -void JPARegistAlpha(JPAEmitterWorkData*, JPABaseParticle*); -void JPARegistEnv(JPAEmitterWorkData*, JPABaseParticle*); -void JPARegistAlphaEnv(JPAEmitterWorkData*, JPABaseParticle*); -void JPARegistPrmAlpha(JPAEmitterWorkData*, JPABaseParticle*); -void JPARegistPrmAlphaEnv(JPAEmitterWorkData*, JPABaseParticle*); +#if TARGET_PC +#define JPA_DRAW_PARTICLE_ARGS JPAEmitterWorkData*, JPABaseParticle*, ParticleDrawCtx* +#else +#define JPA_DRAW_PARTICLE_ARGS JPAEmitterWorkData*, JPABaseParticle* +#endif + +void JPADrawPoint(JPA_DRAW_PARTICLE_ARGS); +void JPADrawLine(JPA_DRAW_PARTICLE_ARGS); +void JPADrawRotBillboard(JPA_DRAW_PARTICLE_ARGS); +void JPADrawBillboard(JPA_DRAW_PARTICLE_ARGS); +void JPADrawRotDirection(JPA_DRAW_PARTICLE_ARGS); +void JPADrawDirection(JPA_DRAW_PARTICLE_ARGS); +void JPADrawRotation(JPA_DRAW_PARTICLE_ARGS); +void JPADrawDBillboard(JPA_DRAW_PARTICLE_ARGS); +void JPADrawRotYBillboard(JPA_DRAW_PARTICLE_ARGS); +void JPADrawYBillboard(JPA_DRAW_PARTICLE_ARGS); +void JPADrawParticleCallBack(JPA_DRAW_PARTICLE_ARGS); +void JPALoadTexAnm(JPA_DRAW_PARTICLE_ARGS); +void JPASetPointSize(JPA_DRAW_PARTICLE_ARGS); +void JPASetLineWidth(JPA_DRAW_PARTICLE_ARGS); +void JPALoadCalcTexCrdMtxAnm(JPA_DRAW_PARTICLE_ARGS); +void JPARegistAlpha(JPA_DRAW_PARTICLE_ARGS); +void JPARegistEnv(JPA_DRAW_PARTICLE_ARGS); +void JPARegistAlphaEnv(JPA_DRAW_PARTICLE_ARGS); +void JPARegistPrmAlpha(JPA_DRAW_PARTICLE_ARGS); +void JPARegistPrmAlphaEnv(JPA_DRAW_PARTICLE_ARGS); + +#undef JPA_DRAW_PARTICLE_ARGS #if TARGET_PC void JPAInterpBillboard(JPAEmitterWorkData*, JPABaseParticle*); diff --git a/libs/JSystem/include/JSystem/JParticle/JPADynamicsBlock.h b/libs/JSystem/include/JSystem/JParticle/JPADynamicsBlock.h index c69ddc07cb..eb08e4ff9f 100644 --- a/libs/JSystem/include/JSystem/JParticle/JPADynamicsBlock.h +++ b/libs/JSystem/include/JSystem/JParticle/JPADynamicsBlock.h @@ -4,7 +4,7 @@ #include "JSystem/JGeometry.h" #include -#include "dusk/endian.h" +#include "helpers/endian.h" struct JPAEmitterWorkData; diff --git a/libs/JSystem/include/JSystem/JParticle/JPAResource.h b/libs/JSystem/include/JSystem/JParticle/JPAResource.h index ebf2127033..ba52564b95 100644 --- a/libs/JSystem/include/JSystem/JParticle/JPAResource.h +++ b/libs/JSystem/include/JSystem/JParticle/JPAResource.h @@ -2,7 +2,7 @@ #define JPARESOURCE_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" class JKRHeap; struct JPAEmitterWorkData; @@ -17,6 +17,10 @@ class JPADynamicsBlock; class JPAFieldBlock; class JPAKeyBlock; +#if TARGET_PC +struct ParticleDrawCtx; +#endif + /** * @ingroup jsystem-jparticle * @@ -50,13 +54,19 @@ public: public: typedef void (*EmitterFunc)(JPAEmitterWorkData*); typedef void (*ParticleFunc)(JPAEmitterWorkData*, JPABaseParticle*); +#if TARGET_PC + typedef void (*DrawParticleFunc)(JPAEmitterWorkData*, JPABaseParticle*, + ParticleDrawCtx*); +#else + typedef ParticleFunc DrawParticleFunc; +#endif /* 0x00 */ EmitterFunc* mpCalcEmitterFuncList; /* 0x04 */ EmitterFunc* mpDrawEmitterFuncList; /* 0x08 */ EmitterFunc* mpDrawEmitterChildFuncList; /* 0x0C */ ParticleFunc* mpCalcParticleFuncList; - /* 0x10 */ ParticleFunc* mpDrawParticleFuncList; + /* 0x10 */ DrawParticleFunc* mpDrawParticleFuncList; /* 0x14 */ ParticleFunc* mpCalcParticleChildFuncList; - /* 0x18 */ ParticleFunc* mpDrawParticleChildFuncList; + /* 0x18 */ DrawParticleFunc* mpDrawParticleChildFuncList; /* 0x1C */ JPABaseShape* pBsp; /* 0x20 */ JPAExtraShape* pEsp; @@ -77,6 +87,20 @@ public: /* 0x45 */ u8 mpDrawParticleFuncListNum; /* 0x46 */ u8 mpCalcParticleChildFuncListNum; /* 0x47 */ u8 mpDrawParticleChildFuncListNum; + +#if TARGET_PC + struct BatchInfo { + f32 vtxPos[8][3]; + f32 vtxUv[8][2]; + u8 vtxCount; // 4 (quad) or 8 (cross) + bool supported; // draw func list contains only batchable funcs + bool hasPtclColor; // per-particle JPARegist* func is present + bool hasPtclTexMtx; // JPALoadCalcTexCrdMtxAnm is present + }; + BatchInfo mBatchInfo; + + void initBatchInfo(); +#endif }; #endif /* JPARESOURCE_H */ diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h b/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h index da03389c25..f01a170bde 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/ctb.h @@ -109,7 +109,7 @@ struct data { } }; - static const u32 ga4cSignature; + static DUSK_GAME_DATA const u32 ga4cSignature; }; struct TObject_TxyzRy : public TObject { diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/functionvalue.h b/libs/JSystem/include/JSystem/JStudio/JStudio/functionvalue.h index 7b2c935272..8acdbe1623 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/functionvalue.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/functionvalue.h @@ -314,7 +314,7 @@ public: > { TIterator_data_(const TFunctionValue_list_parameter& rParent, const f32* value) { -#if DEBUG +#if PARTIAL_DEBUG || DEBUG pOwn_ = &rParent; #endif pf_ = value; @@ -372,7 +372,7 @@ public: return (r1.pf_ - r2.pf_) / suData_size; } -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x00 */ const TFunctionValue_list_parameter* pOwn_; #endif /* 0x00 */ const f32* pf_; @@ -425,7 +425,7 @@ public: > { TIterator_data_(const TFunctionValue_hermite& rParent, const f32* value) { -#if DEBUG +#if PARTIAL_DEBUG || DEBUG pOwn_ = &rParent; #endif pf_ = value; @@ -491,7 +491,7 @@ public: return (r1.pf_ - r2.pf_) / r1.uSize_; } -#if DEBUG +#if PARTIAL_DEBUG || DEBUG /* 0x00 */ const TFunctionValue_hermite* pOwn_; /* 0x04 */ const f32* pf_; /* 0x08 */ u32 uSize_; diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/fvb-data.h b/libs/JSystem/include/JSystem/JStudio/JStudio/fvb-data.h index 8e82a0c031..e0a337a51a 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/fvb-data.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/fvb-data.h @@ -10,7 +10,7 @@ namespace JStudio { namespace fvb { namespace data { -extern const char ga4cSignature[4]; +DUSK_GAME_EXTERN const char ga4cSignature[4]; const int PARAGRAPH_DATA = 1; diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-data.h b/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-data.h index 9dc95fae97..4956d1c150 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-data.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-data.h @@ -4,7 +4,7 @@ namespace JStudio { namespace data { - extern const char ga8cSignature[8]; + DUSK_GAME_EXTERN const char ga8cSignature[8]; } // namespace data } // namespace JStudio diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-math.h b/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-math.h index a23eed44e9..826e0948c1 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-math.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-math.h @@ -6,7 +6,7 @@ #define m_PI_D 3.141592653589793 #ifndef __MWERKS__ -#include "dusk/math.h" +#include "helpers/math.h" #endif namespace JStudio { diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-object.h b/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-object.h index 2fe984853f..914ce66397 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-object.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/jstudio-object.h @@ -91,7 +91,7 @@ struct TVariableValue { pOutput_ = (param_1 != NULL) ? param_1 : &soOutput_none_; } - static TOutput_none_ soOutput_none_; + static DUSK_GAME_DATA TOutput_none_ soOutput_none_; /* 0x00 */ f32 mValue; /* 0x04 */ u32 field_0x4; @@ -249,9 +249,9 @@ struct TAdaptor_actor : public TAdaptor { /* 0x10 */ TVariableValue mValue[14]; - static u32 const sauVariableValue_3_TRANSLATION_XYZ[3]; - static u32 const sauVariableValue_3_ROTATION_XYZ[3]; - static u32 const sauVariableValue_3_SCALING_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_TRANSLATION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_ROTATION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_SCALING_XYZ[3]; }; // Size: 0x128 struct TObject_actor : public TObject { @@ -267,8 +267,8 @@ struct TAdaptor_ambientLight : public TAdaptor { /* 0x10 */ TVariableValue mValue[4]; - static u32 const sauVariableValue_3_COLOR_RGB[3]; - static u32 const sauVariableValue_4_COLOR_RGBA[4]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_COLOR_RGB[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_4_COLOR_RGBA[4]; }; struct TObject_ambientLight : public TObject { @@ -299,9 +299,9 @@ struct TAdaptor_camera : public TAdaptor { /* 0x10 */ TVariableValue mValue[12]; - static u32 const sauVariableValue_3_POSITION_XYZ[3]; - static u32 const sauVariableValue_3_TARGET_POSITION_XYZ[3]; - static u32 const sauVariableValue_2_DISTANCE_NEAR_FAR[2]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_POSITION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_TARGET_POSITION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_2_DISTANCE_NEAR_FAR[2]; }; struct TObject_camera : public TObject { @@ -322,9 +322,9 @@ struct TAdaptor_fog : public TAdaptor { /* 0x10 */ TVariableValue mValue[6]; - static u32 const sauVariableValue_3_COLOR_RGB[3]; - static u32 const sauVariableValue_4_COLOR_RGBA[4]; - static u32 const sauVariableValue_2_RANGE_BEGIN_END[2]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_COLOR_RGB[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_4_COLOR_RGBA[4]; + static DUSK_GAME_DATA u32 const sauVariableValue_2_RANGE_BEGIN_END[2]; }; struct TObject_fog : public TObject { @@ -351,11 +351,11 @@ struct TAdaptor_light : public TAdaptor { /* 0x10 */ TVariableValue mValue[13]; - static u32 const sauVariableValue_3_COLOR_RGB[3]; - static u32 const sauVariableValue_4_COLOR_RGBA[4]; - static u32 const sauVariableValue_3_POSITION_XYZ[3]; - static u32 const sauVariableValue_3_TARGET_POSITION_XYZ[3]; - static u32 const sauVariableValue_2_DIRECTION_THETA_PHI[2]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_COLOR_RGB[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_4_COLOR_RGBA[4]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_POSITION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_TARGET_POSITION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_2_DIRECTION_THETA_PHI[2]; }; struct TObject_light : public TObject { @@ -396,13 +396,13 @@ struct TAdaptor_particle : public TAdaptor { /* 0x10 */ TVariableValue mValue[20]; - static u32 const sauVariableValue_3_TRANSLATION_XYZ[3]; - static u32 const sauVariableValue_3_ROTATION_XYZ[3]; - static u32 const sauVariableValue_3_SCALING_XYZ[3]; - static u32 const sauVariableValue_3_COLOR_RGB[3]; - static u32 const sauVariableValue_4_COLOR_RGBA[4]; - static u32 const sauVariableValue_3_COLOR1_RGB[3]; - static u32 const sauVariableValue_4_COLOR1_RGBA[4]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_TRANSLATION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_ROTATION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_SCALING_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_COLOR_RGB[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_4_COLOR_RGBA[4]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_COLOR1_RGB[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_4_COLOR1_RGBA[4]; }; struct TObject_particle : public TObject { @@ -440,7 +440,7 @@ struct TAdaptor_sound : public TAdaptor { /* 0x10 */ TVariableValue mValue[13]; - static u32 const sauVariableValue_3_POSITION_XYZ[3]; + static DUSK_GAME_DATA u32 const sauVariableValue_3_POSITION_XYZ[3]; }; // Size: 0x114 struct TObject_sound : public TObject { diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio/stb-data.h b/libs/JSystem/include/JSystem/JStudio/JStudio/stb-data.h index b7e3cd0f7b..5da61e1575 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio/stb-data.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio/stb-data.h @@ -21,8 +21,8 @@ const int BLOCK_NONE = -1; // Used to expand a signed 24 int to a signed 32 int const u32 gu32Mask_TSequence_value_signExpansion = 0xFF000000; -extern const BE(u32) ga4cSignature; // 'STB/0' -extern const s32 gauDataSize_TEParagraph_data[8]; +DUSK_GAME_EXTERN const BE(u32) ga4cSignature; // 'STB/0' +DUSK_GAME_EXTERN const s32 gauDataSize_TEParagraph_data[8]; inline void toString_block(char* a5c, u32 arg1) { // from debug, todo diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio_JAudio2/control.h b/libs/JSystem/include/JSystem/JStudio/JStudio_JAudio2/control.h index effefaef18..884aeb9da5 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio_JAudio2/control.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio_JAudio2/control.h @@ -94,7 +94,7 @@ struct TAdaptor_sound : public JStudio::TAdaptor_sound { void set_bPermit_onExit_notEnd_(bool param_1) { field_0x11c = param_1; } - static TVVOSetValue_ saoVVOSetValue_[6]; + static DUSK_GAME_DATA TVVOSetValue_ saoVVOSetValue_[6]; /* 0x114 */ TCreateObject* pCreateObject_; /* 0x118 */ JAISoundHandle opJAISoundHandle_; diff --git a/libs/JSystem/include/JSystem/JStudio/JStudio_JStage/control.h b/libs/JSystem/include/JSystem/JStudio/JStudio_JStage/control.h index 1e8331206b..050088722e 100644 --- a/libs/JSystem/include/JSystem/JStudio/JStudio_JStage/control.h +++ b/libs/JSystem/include/JSystem/JStudio/JStudio_JStage/control.h @@ -131,8 +131,8 @@ struct TAdaptor_actor : public JStudio::TAdaptor_actor, public JStudio_JStage::T JStage::TActor* get_pJSG_() { return (JStage::TActor*) pJSGObject_; } - static const TVVOutputObject saoVVOutput_[]; - static const TVVOutput_ANIMATION_FRAME_ saoVVOutput_ANIMATION_FRAME_[]; + static DUSK_GAME_DATA const TVVOutputObject saoVVOutput_[]; + static DUSK_GAME_DATA const TVVOutput_ANIMATION_FRAME_ saoVVOutput_ANIMATION_FRAME_[]; /* 0x130 */ u32 field_0x130; /* 0x134 */ u32 field_0x134; @@ -187,7 +187,7 @@ struct TAdaptor_camera : public JStudio::TAdaptor_camera, public TAdaptor_object JStage::TCamera* get_pJSG_() { return (JStage::TCamera*)pJSGObject_; } - static TVVOutput saoVVOutput_[]; + static DUSK_GAME_DATA TVVOutput saoVVOutput_[]; /* 0x108 */ int field_0x108; /* 0x10C */ JStage::TObject* field_0x10c; @@ -211,7 +211,7 @@ struct TAdaptor_fog : public JStudio::TAdaptor_fog, public TAdaptor_object_ { JStage::TFog* get_pJSG_() { return (JStage::TFog*)pJSGObject_; } - static TVariableValueOutput_object_ saoVVOutput_[]; + static DUSK_GAME_DATA TVariableValueOutput_object_ saoVVOutput_[]; }; template @@ -285,7 +285,7 @@ struct TAdaptor_light : public JStudio::TAdaptor_light, public TAdaptor_object_ int field_0x11c; - static TVVOutput_direction_ saoVVOutput_direction_[6]; + static DUSK_GAME_DATA TVVOutput_direction_ saoVVOutput_direction_[6]; }; bool diff --git a/libs/JSystem/include/JSystem/JSupport/JSUInputStream.h b/libs/JSystem/include/JSystem/JSupport/JSUInputStream.h index 77c27d0530..07d5a29b69 100644 --- a/libs/JSystem/include/JSystem/JSupport/JSUInputStream.h +++ b/libs/JSystem/include/JSystem/JSupport/JSUInputStream.h @@ -2,7 +2,7 @@ #define JSUINPUTSTREAM_H #include "JSystem/JSupport/JSUIosBase.h" -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-jsupport diff --git a/libs/JSystem/include/JSystem/JUtility/JUTConsole.h b/libs/JSystem/include/JSystem/JUtility/JUTConsole.h index 0f95feb2a1..1bc56f0d6d 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTConsole.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTConsole.h @@ -152,7 +152,7 @@ public: static JUTConsoleManager* const getManager() { return sManager; } - static JUTConsoleManager* sManager; + static DUSK_GAME_DATA JUTConsoleManager* sManager; #ifdef __MWERKS__ typedef JGadget::TLinkList ConsoleList; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTDbPrint.h b/libs/JSystem/include/JSystem/JUtility/JUTDbPrint.h index 14714df16e..67c7f8e89c 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTDbPrint.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTDbPrint.h @@ -40,7 +40,7 @@ public: void setCharColor(JUtility::TColor color) { mColor = color; }; - static JUTDbPrint* sDebugPrint; + static DUSK_GAME_DATA JUTDbPrint* sDebugPrint; private: /* 0x00 */ unk_print* mFirst; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTDirectPrint.h b/libs/JSystem/include/JSystem/JUtility/JUTDirectPrint.h index 14ed2c28b8..a1dd45efe2 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTDirectPrint.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTDirectPrint.h @@ -33,10 +33,10 @@ public: static JUTDirectPrint* getManager() { return sDirectPrint; } private: - static u8 sAsciiTable[128]; - static u32 sFontData[64]; - static u32 sFontData2[77]; - static JUTDirectPrint* sDirectPrint; + static DUSK_GAME_DATA u8 sAsciiTable[128]; + static DUSK_GAME_DATA u32 sFontData[64]; + static DUSK_GAME_DATA u32 sFontData2[77]; + static DUSK_GAME_DATA JUTDirectPrint* sDirectPrint; static u8 sDirectPrint_padding[4 /* padding */]; private: diff --git a/libs/JSystem/include/JSystem/JUtility/JUTException.h b/libs/JSystem/include/JSystem/JUtility/JUTException.h index 698a02ed44..b4504e68c0 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTException.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTException.h @@ -117,18 +117,18 @@ public: } private: - static OSMessageQueue sMessageQueue; - static const char* sCpuExpName[17]; - static JSUList sMapFileList; - static OSMessage sMessageBuffer[1]; - static JUTException* sErrorManager; - static JUTExceptionUserCallback sPreUserCallback; - static JUTExceptionUserCallback sPostUserCallback; - static void* sConsoleBuffer; - static u32 sConsoleBufferSize; - static JUTConsole* sConsole; - static u32 msr; - static u32 fpscr; + static DUSK_GAME_DATA OSMessageQueue sMessageQueue; + static DUSK_GAME_DATA const char* sCpuExpName[17]; + static DUSK_GAME_DATA JSUList sMapFileList; + static DUSK_GAME_DATA OSMessage sMessageBuffer[1]; + static DUSK_GAME_DATA JUTException* sErrorManager; + static DUSK_GAME_DATA JUTExceptionUserCallback sPreUserCallback; + static DUSK_GAME_DATA JUTExceptionUserCallback sPostUserCallback; + static DUSK_GAME_DATA void* sConsoleBuffer; + static DUSK_GAME_DATA u32 sConsoleBufferSize; + static DUSK_GAME_DATA JUTConsole* sConsole; + static DUSK_GAME_DATA u32 msr; + static DUSK_GAME_DATA u32 fpscr; private: /* 0x7C */ JUTExternalFB* mFrameMemory; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTFont.h b/libs/JSystem/include/JSystem/JUtility/JUTFont.h index 3c1cd0bf1f..0b262c0ac4 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTFont.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTFont.h @@ -3,7 +3,7 @@ #include "JSystem/JUtility/TColor.h" #include -#include "dusk/endian.h" +#include "helpers/endian.h" #if TARGET_PC struct FontDrawContext { diff --git a/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h b/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h index 45e7227fe3..76e0780d9b 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTGamePad.h @@ -151,21 +151,21 @@ public: struct C3ButtonReset { C3ButtonReset() { mReset = false; } - static u32 sResetPattern; - static u32 sResetMaskPattern; - static callbackFn sCallback; - static void* sCallbackArg; - static OSTime sThreshold; - static s32 sResetOccurredPort; - static bool sResetOccurred; - static bool sResetSwitchPushing; + static DUSK_GAME_DATA u32 sResetPattern; + static DUSK_GAME_DATA u32 sResetMaskPattern; + static DUSK_GAME_DATA callbackFn sCallback; + static DUSK_GAME_DATA void* sCallbackArg; + static DUSK_GAME_DATA OSTime sThreshold; + static DUSK_GAME_DATA s32 sResetOccurredPort; + static DUSK_GAME_DATA bool sResetOccurred; + static DUSK_GAME_DATA bool sResetSwitchPushing; /* 0x0 */ bool mReset; }; // Size: 0x4 struct CStick { - static f32 sPressPoint; - static f32 sReleasePoint; + static DUSK_GAME_DATA f32 sPressPoint; + static DUSK_GAME_DATA f32 sReleasePoint; CStick() { clear(); } void clear(); @@ -187,9 +187,9 @@ public: struct CRumble { CRumble(JUTGamePad* pad) { clear(pad); } - static u32 sChannelMask[4]; - static u8 mStatus[4]; - static u32 mEnabled; + static DUSK_GAME_DATA u32 sChannelMask[4]; + static DUSK_GAME_DATA u8 mStatus[4]; + static DUSK_GAME_DATA u32 mEnabled; enum ERumble { VAL_0 = 0, @@ -237,18 +237,18 @@ public: mRumble.startPatternedRumble(data, rumble, length); } - static JSUList mPadList; - static bool mListInitialized; - static PADStatus mPadStatus[4]; - static CButton mPadButton[4]; - static CStick mPadMStick[4]; - static CStick mPadSStick[4]; - static EStickMode sStickMode; - static int sClampMode; - static u8 mPadAssign[4]; - static u32 sSuppressPadReset; - static s32 sAnalogMode; - static u32 sRumbleSupported; + static DUSK_GAME_DATA JSUList mPadList; + static DUSK_GAME_DATA bool mListInitialized; + static DUSK_GAME_DATA PADStatus mPadStatus[4]; + static DUSK_GAME_DATA CButton mPadButton[4]; + static DUSK_GAME_DATA CStick mPadMStick[4]; + static DUSK_GAME_DATA CStick mPadSStick[4]; + static DUSK_GAME_DATA EStickMode sStickMode; + static DUSK_GAME_DATA int sClampMode; + static DUSK_GAME_DATA u8 mPadAssign[4]; + static DUSK_GAME_DATA u32 sSuppressPadReset; + static DUSK_GAME_DATA s32 sAnalogMode; + static DUSK_GAME_DATA u32 sRumbleSupported; /* 0x18 */ CButton mButton; /* 0x48 */ CStick mMainStick; @@ -273,7 +273,7 @@ public: * */ struct JUTGamePadLongPress { - static JSUList sPatternList; + static DUSK_GAME_DATA JSUList sPatternList; void checkCallback(int port, u32 hold_time); u32 getMaskPattern() const { return mMaskPattern; } diff --git a/libs/JSystem/include/JSystem/JUtility/JUTGraphFifo.h b/libs/JSystem/include/JSystem/JUtility/JUTGraphFifo.h index 3ea6d2ec97..ababb1b83d 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTGraphFifo.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTGraphFifo.h @@ -32,8 +32,8 @@ public: #endif } - static JUTGraphFifo* sCurrentFifo; - static bool mGpStatus[5]; + static DUSK_GAME_DATA JUTGraphFifo* sCurrentFifo; + static DUSK_GAME_DATA bool mGpStatus[5]; private: /* 0x04 */ GXFifoObj* mFifo; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTNameTab.h b/libs/JSystem/include/JSystem/JUtility/JUTNameTab.h index 6affae8ecb..6d4994d3f3 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTNameTab.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTNameTab.h @@ -2,7 +2,7 @@ #define JUTNAMETAB_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" /** * @ingroup jsystem-jutility diff --git a/libs/JSystem/include/JSystem/JUtility/JUTPalette.h b/libs/JSystem/include/JSystem/JUtility/JUTPalette.h index 5d29005a92..8987c28f13 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTPalette.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTPalette.h @@ -3,7 +3,7 @@ #include -#include "dusk/endian.h" +#include "helpers/endian.h" enum JUTTransparency { UNK0, UNK1 }; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTProcBar.h b/libs/JSystem/include/JSystem/JUtility/JUTProcBar.h index c491641218..13f249213a 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTProcBar.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTProcBar.h @@ -102,7 +102,7 @@ public: static JUTProcBar* getManager() { return sManager; } - static JUTProcBar* sManager; + static DUSK_GAME_DATA JUTProcBar* sManager; private: /* 0x000 */ CTime mIdle; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTResFont.h b/libs/JSystem/include/JSystem/JUtility/JUTResFont.h index 29d8a77b92..5e1cfa0011 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTResFont.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTResFont.h @@ -2,7 +2,7 @@ #define JUTRESFONT_H #include "JSystem/JUtility/JUTFont.h" -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" class JKRHeap; @@ -64,7 +64,7 @@ public: } static const int suAboutEncoding_ = 3; - static IsLeadByte_func const saoAboutEncoding_[suAboutEncoding_]; + static DUSK_GAME_DATA IsLeadByte_func const saoAboutEncoding_[suAboutEncoding_]; // some types uncertain, may need to be fixed /* 0x1C */ int mWidth; @@ -95,7 +95,7 @@ public: #endif }; -extern u8 const JUTResFONT_Ascfont_fix12[]; +DUSK_GAME_EXTERN u8 const JUTResFONT_Ascfont_fix12[]; extern u8 const JUTResFONT_Ascfont_fix16[]; #endif /* JUTRESFONT_H */ diff --git a/libs/JSystem/include/JSystem/JUtility/JUTTexture.h b/libs/JSystem/include/JSystem/JUtility/JUTTexture.h index 6a7a8f9a0e..c4356b0bf9 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTTexture.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTTexture.h @@ -3,8 +3,8 @@ #include #include -#include "dusk/endian.h" -#include "dusk/gx_helper.h" +#include "helpers/endian.h" +#include "helpers/gx_helper.h" class JUTPalette; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTVideo.h b/libs/JSystem/include/JSystem/JUtility/JUTVideo.h index dfc6fd0b6c..6e6edecd19 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTVideo.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTVideo.h @@ -59,9 +59,9 @@ public: #endif private: - static JUTVideo* sManager; - static OSTick sVideoLastTick; - static OSTick sVideoInterval; + static DUSK_GAME_DATA JUTVideo* sManager; + static DUSK_GAME_DATA OSTick sVideoLastTick; + static DUSK_GAME_DATA OSTick sVideoInterval; private: /* 0x04 */ GXRenderModeObj* mRenderObj; diff --git a/libs/JSystem/include/JSystem/JUtility/JUTXfb.h b/libs/JSystem/include/JSystem/JUtility/JUTXfb.h index acc48739fc..358f559b73 100644 --- a/libs/JSystem/include/JSystem/JUtility/JUTXfb.h +++ b/libs/JSystem/include/JSystem/JUtility/JUTXfb.h @@ -71,7 +71,7 @@ public: static JUTXfb* getManager() { return sManager; } private: - static JUTXfb* sManager; + static DUSK_GAME_DATA JUTXfb* sManager; private: /* 0x00 */ u8* mBuffer[3]; diff --git a/libs/JSystem/include/JSystem/JUtility/TColor.h b/libs/JSystem/include/JSystem/JUtility/TColor.h index d4a615b5b4..5ec7afa42a 100644 --- a/libs/JSystem/include/JSystem/JUtility/TColor.h +++ b/libs/JSystem/include/JSystem/JUtility/TColor.h @@ -2,7 +2,7 @@ #define TCOLOR_H #include -#include "dusk/endian.h" +#include "helpers/endian.h" namespace JUtility { diff --git a/libs/JSystem/src/J2DGraph/J2DGrafContext.cpp b/libs/JSystem/src/J2DGraph/J2DGrafContext.cpp index 3ac3e5d197..7bc9a90780 100644 --- a/libs/JSystem/src/J2DGraph/J2DGrafContext.cpp +++ b/libs/JSystem/src/J2DGraph/J2DGrafContext.cpp @@ -3,6 +3,8 @@ #include "JSystem/J2DGraph/J2DGrafContext.h" #include +#include + J2DGrafContext::J2DGrafContext(f32 x, f32 y, f32 width, f32 height) : mBounds(x, y, x + width, y + height), mScissorBounds(x, y, x + width, y + height) { if (x < 0.0f || y < 0.0f) { @@ -137,6 +139,7 @@ void J2DGrafContext::setLineWidth(u8 lineWidth) { } void J2DGrafContext::fillBox(JGeometry::TBox2 const& box) { + ZoneScoped; GXSetBlendMode((GXBlendMode)mBoxPart.mType, (GXBlendFactor)mBoxPart.mSrcFactor, (GXBlendFactor)mBoxPart.mDstFactor, GX_LO_SET); GXLoadPosMtxImm(mPosMtx, 0); @@ -155,6 +158,7 @@ void J2DGrafContext::fillBox(JGeometry::TBox2 const& box) { } void J2DGrafContext::drawFrame(JGeometry::TBox2 const& box) { + ZoneScoped; GXSetBlendMode((GXBlendMode)mBoxPart.mType, (GXBlendFactor)mBoxPart.mSrcFactor, (GXBlendFactor)mBoxPart.mDstFactor, GX_LO_SET); GXLoadPosMtxImm(mPosMtx, 0); @@ -175,6 +179,7 @@ void J2DGrafContext::drawFrame(JGeometry::TBox2 const& box) { } void J2DGrafContext::line(JGeometry::TVec2 start, JGeometry::TVec2 end) { + ZoneScoped; GXSetBlendMode((GXBlendMode)mLinePart.mType, (GXBlendFactor)mLinePart.mSrcFactor, (GXBlendFactor)mLinePart.mDstFactor, GX_LO_SET); GXLoadPosMtxImm(mPosMtx, 0); diff --git a/libs/JSystem/src/J2DGraph/J2DMaterialFactory.cpp b/libs/JSystem/src/J2DGraph/J2DMaterialFactory.cpp index beb9e0075a..34e33bc03d 100644 --- a/libs/JSystem/src/J2DGraph/J2DMaterialFactory.cpp +++ b/libs/JSystem/src/J2DGraph/J2DMaterialFactory.cpp @@ -8,6 +8,8 @@ #include #include +#include "helpers/string.hpp" + J2DMaterialFactory::J2DMaterialFactory(J2DMaterialBlock const& param_0) { mMaterialNum = param_0.field_0x8; mpMaterialInitData = JSUConvertOffsetToPtr(¶m_0, param_0.field_0xc); @@ -92,7 +94,7 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par } if (local_380 == NULL && J2DScreen::getDataManage() != NULL) { char acStack_230[257]; - strcpy(acStack_230, param_3->getName(texNo)); + SAFE_STRCPY(acStack_230, param_3->getName(texNo)); local_380 = J2DScreen::getDataManage()->get(acStack_230); } } @@ -111,7 +113,7 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par } if (local_388 == NULL && J2DScreen::getDataManage() != NULL) { char acStack_334[257]; - strcpy(acStack_334, param_4->getName(param_0->getTevBlock()->getFontNo())); + SAFE_STRCPY(acStack_334, param_4->getName(param_0->getTevBlock()->getFontNo())); local_388 = J2DScreen::getDataManage()->get(acStack_334); } } diff --git a/libs/JSystem/src/J2DGraph/J2DPane.cpp b/libs/JSystem/src/J2DGraph/J2DPane.cpp index 3ba9b6e85c..01ab0e5444 100644 --- a/libs/JSystem/src/J2DGraph/J2DPane.cpp +++ b/libs/JSystem/src/J2DGraph/J2DPane.cpp @@ -8,7 +8,7 @@ #include "JSystem/JSupport/JSURandomInputStream.h" #include "JSystem/JUtility/JUTResource.h" #ifndef __MWERKS__ -#include "dusk/math.h" +#include "helpers/math.h" #endif J2DPane::J2DPane() : mBounds(), mGlobalBounds(), mClipRect(), mPaneTree(this) { @@ -424,7 +424,7 @@ void J2DPane::resize(f32 x, f32 y) { place(box); } -JGeometry::TBox2 J2DPane::static_mBounds(0, 0, 0, 0); +DUSK_GAME_DATA JGeometry::TBox2 J2DPane::static_mBounds(0, 0, 0, 0); JGeometry::TBox2& J2DPane::getBounds() { static_mBounds = mBounds; diff --git a/libs/JSystem/src/J2DGraph/J2DPrint.cpp b/libs/JSystem/src/J2DGraph/J2DPrint.cpp index 69d71aa6c5..ac6bfb7099 100644 --- a/libs/JSystem/src/J2DGraph/J2DPrint.cpp +++ b/libs/JSystem/src/J2DGraph/J2DPrint.cpp @@ -7,11 +7,11 @@ #include #include -char* J2DPrint::mStrBuff; +DUSK_GAME_DATA char* J2DPrint::mStrBuff; static bool sStrBufInitialized; -size_t J2DPrint::mStrBuffSize; +DUSK_GAME_DATA size_t J2DPrint::mStrBuffSize; static u8 data_8045158C[4]; diff --git a/libs/JSystem/src/J2DGraph/J2DScreen.cpp b/libs/JSystem/src/J2DGraph/J2DScreen.cpp index c44859046d..603ab512f7 100644 --- a/libs/JSystem/src/J2DGraph/J2DScreen.cpp +++ b/libs/JSystem/src/J2DGraph/J2DScreen.cpp @@ -408,7 +408,7 @@ bool J2DScreen::isUsed(ResFONT const* p_font) { return J2DPane::isUsed(p_font); } -J2DDataManage* J2DScreen::mDataManage; +DUSK_GAME_DATA J2DDataManage* J2DScreen::mDataManage; void* J2DScreen::getNameResource(char const* resName) { void* res = JKRGetNameResource(resName, NULL); diff --git a/libs/JSystem/src/J2DGraph/J2DTevs.cpp b/libs/JSystem/src/J2DGraph/J2DTevs.cpp index 8daf82872c..bda5576cee 100644 --- a/libs/JSystem/src/J2DGraph/J2DTevs.cpp +++ b/libs/JSystem/src/J2DGraph/J2DTevs.cpp @@ -9,7 +9,7 @@ #ifdef __MWERKS__ #include #else -#include +#include #endif #include @@ -68,8 +68,14 @@ void J2DIndTevStage::load(u8 tevStage) { } void J2DIndTexMtx::load(u8 indTexMtx) { +#ifdef TARGET_PC + Mtx23 mtx; + mIndTexMtxInfo.mMtx.to_host(mtx); + GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + indTexMtx), mtx, mIndTexMtxInfo.mScaleExp); +#else GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + indTexMtx), mIndTexMtxInfo.mMtx, mIndTexMtxInfo.mScaleExp); +#endif } void J2DIndTexCoordScale::load(u8 indTexStage) { @@ -111,60 +117,60 @@ static void dummyVirtual(J2DMaterial* material) { block->getTevSwapModeTable(0); } -J2DTexCoordInfo const j2dDefaultTexCoordInfo[8] = { +DUSK_GAME_DATA J2DTexCoordInfo const j2dDefaultTexCoordInfo[8] = { {GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX1, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX2, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX3, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX4, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX5, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX6, GX_IDENTITY, 0}, {GX_TG_MTX2x4, GX_TG_TEX7, GX_IDENTITY, 0}, }; -J2DTexMtxInfo const j2dDefaultTexMtxInfo = {1, 1, 255, 255, {0.5f, 0.5f, +DUSK_GAME_DATA J2DTexMtxInfo const j2dDefaultTexMtxInfo = {1, 1, 255, 255, {0.5f, 0.5f, 0.0f}, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f}; -J2DIndTexMtxInfo const j2dDefaultIndTexMtxInfo = {{0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f}, 1}; +DUSK_GAME_DATA J2DIndTexMtxInfo const j2dDefaultIndTexMtxInfo = {{0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f}, 1}; -J2DTevStageInfo const j2dDefaultTevStageInfo = { +DUSK_GAME_DATA J2DTevStageInfo const j2dDefaultTevStageInfo = { 4, GX_CC_RASC, GX_CC_ZERO, GX_CC_ZERO, GX_CC_CPREV, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV, GX_CA_RASA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV}; -const J2DIndTevStageInfo j2dDefaultIndTevStageInfo = { +DUSK_GAME_DATA const J2DIndTevStageInfo j2dDefaultIndTevStageInfo = { GX_INDTEXSTAGE0, GX_ITB_NONE, GX_ITB_NONE, GX_ITM_OFF, GX_ITW_OFF, GX_ITW_OFF, 0, 0, GX_ITBA_OFF, }; -const GXColor j2dDefaultColInfo = {255, 255, 255, 255}; +DUSK_GAME_DATA const GXColor j2dDefaultColInfo = {255, 255, 255, 255}; -const J2DTevOrderInfo j2dDefaultTevOrderInfoNull = { +DUSK_GAME_DATA const J2DTevOrderInfo j2dDefaultTevOrderInfoNull = { GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL, 0}; -const J2DIndTexOrderInfo j2dDefaultIndTexOrderNull = { +DUSK_GAME_DATA const J2DIndTexOrderInfo j2dDefaultIndTexOrderNull = { GX_TEXCOORD_NULL, GX_TEXMAP_NULL, }; -const GXColorS10 j2dDefaultTevColor = {255, 255, 255, 255}; +DUSK_GAME_DATA const GXColorS10 j2dDefaultTevColor = {255, 255, 255, 255}; -const J2DIndTexCoordScaleInfo j2dDefaultIndTexCoordScaleInfo = { +DUSK_GAME_DATA const J2DIndTexCoordScaleInfo j2dDefaultIndTexCoordScaleInfo = { GX_ITS_1, GX_ITS_1, }; -const GXColor j2dDefaultTevKColor = {255, 255, 255, 255}; +DUSK_GAME_DATA const GXColor j2dDefaultTevKColor = {255, 255, 255, 255}; -const J2DTevSwapModeInfo j2dDefaultTevSwapMode = {GX_TEV_SWAP0, GX_TEV_SWAP0, 0, 0}; +DUSK_GAME_DATA const J2DTevSwapModeInfo j2dDefaultTevSwapMode = {GX_TEV_SWAP0, GX_TEV_SWAP0, 0, 0}; -const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable = { +DUSK_GAME_DATA const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable = { GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA}; -const J2DBlendInfo j2dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, +DUSK_GAME_DATA const J2DBlendInfo j2dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP}; -const u8 j2dDefaultPEBlockDither = 0; +DUSK_GAME_DATA const u8 j2dDefaultPEBlockDither = 0; -const J2DColorChanInfo j2dDefaultColorChanInfo = {0, 3, 0, 0}; +DUSK_GAME_DATA const J2DColorChanInfo j2dDefaultColorChanInfo = {0, 3, 0, 0}; -const u8 j2dDefaultTevSwapTableID = 0x1B; +DUSK_GAME_DATA const u8 j2dDefaultTevSwapTableID = 0x1B; -const u16 j2dDefaultAlphaCmp = 0x00E7; +DUSK_GAME_DATA const u16 j2dDefaultAlphaCmp = 0x00E7; diff --git a/libs/JSystem/src/J2DGraph/J2DTextBox.cpp b/libs/JSystem/src/J2DGraph/J2DTextBox.cpp index 970f120140..d999b51b9f 100644 --- a/libs/JSystem/src/J2DGraph/J2DTextBox.cpp +++ b/libs/JSystem/src/J2DGraph/J2DTextBox.cpp @@ -309,8 +309,12 @@ void J2DTextBox::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBind) } } -char* J2DTextBox::getStringPtr() const { +TEXT_SPAN J2DTextBox::getStringPtr() const { +#if TARGET_PC + return { mStringPtr, mStringLength }; +#else return mStringPtr; +#endif } s32 J2DTextBox::setString(char const* string, ...) { @@ -330,7 +334,7 @@ s32 J2DTextBox::setString(char const* string, ...) { if (mStringPtr) { mStringLength = len + 1; - strcpy(mStringPtr, string); + SAFE_STRCPY_BOUNDED(mStringPtr, mStringLength, string); } va_end(args); diff --git a/libs/JSystem/src/J2DGraph/J2DWindowEx.cpp b/libs/JSystem/src/J2DGraph/J2DWindowEx.cpp index fe4c5df9e6..284d7ea220 100644 --- a/libs/JSystem/src/J2DGraph/J2DWindowEx.cpp +++ b/libs/JSystem/src/J2DGraph/J2DWindowEx.cpp @@ -3,7 +3,7 @@ #include "JSystem/J2DGraph/J2DWindowEx.h" #include "JSystem/JUtility/JUTTexture.h" #include "JSystem/JSupport/JSURandomInputStream.h" -#include "dusk/endian.h" +#include "helpers/endian.h" struct J2DWindowExDef { BE(u32) field_0x0[4]; diff --git a/libs/JSystem/src/J3DGraphAnimator/J3DJoint.cpp b/libs/JSystem/src/J3DGraphAnimator/J3DJoint.cpp index 4091a3b7a1..a943940d84 100644 --- a/libs/JSystem/src/J3DGraphAnimator/J3DJoint.cpp +++ b/libs/JSystem/src/J3DGraphAnimator/J3DJoint.cpp @@ -22,9 +22,9 @@ void J3DMtxCalcJ3DSysInitMaya::init(Vec const& scale, Mtx const& mtx) { JMAMTXApplyScale(mtx, J3DSys::mCurrentMtx, scale.x, scale.y, scale.z); } -J3DMtxBuffer* J3DMtxCalc::mMtxBuffer; +DUSK_GAME_DATA J3DMtxBuffer* J3DMtxCalc::mMtxBuffer; -J3DJoint* J3DMtxCalc::mJoint; +DUSK_GAME_DATA J3DJoint* J3DMtxCalc::mJoint; void J3DMtxCalcCalcTransformBasic::calcTransform(J3DTransformInfo const& transInfo) { J3DJoint* joint = J3DMtxCalc::getJoint(); @@ -189,7 +189,7 @@ void J3DJoint::entryIn() { } } -J3DMtxCalc* J3DJoint::mCurrentMtxCalc; +DUSK_GAME_DATA J3DMtxCalc* J3DJoint::mCurrentMtxCalc; void J3DJoint::recursiveCalc() { J3DMtxCalc* prevMtxCalc = NULL; diff --git a/libs/JSystem/src/J3DGraphAnimator/J3DModel.cpp b/libs/JSystem/src/J3DGraphAnimator/J3DModel.cpp index 8c895d5077..51f3951e38 100644 --- a/libs/JSystem/src/J3DGraphAnimator/J3DModel.cpp +++ b/libs/JSystem/src/J3DGraphAnimator/J3DModel.cpp @@ -8,7 +8,10 @@ #include "JSystem/J3DGraphBase/J3DShapeMtx.h" #include "JSystem/J3DGraphBase/J3DSys.h" #include "JSystem/JKernel/JKRHeap.h" + +#if TARGET_PC #include "dusk/frame_interpolation.h" +#endif #define J3D_ASSERTMSG(LINE, COND, MSG) JUT_ASSERT_MSG(LINE, (COND) != 0, MSG) #define J3D_WARN1(LINE, MSG, ARG1) JUT_WARN(LINE, MSG, ARG1) @@ -105,6 +108,11 @@ void J3DModel::interp_callback(bool isSimFrame, void* pUserWork) { i_this->diff(); } } + +void J3DModel::setAnmMtx(int jointNo, Mtx m) { + mMtxBuffer->setAnmMtx(jointNo, m); + dusk::frame_interp::record_final_mtx(mMtxBuffer->getAnmMtx(jointNo)); +} #endif s32 J3DModel::createShapePacket(J3DModelData* pModelData) { @@ -542,8 +550,11 @@ void J3DModel::viewCalc() { } #ifdef TARGET_PC - for (u16 i = 0; i < mModelData->getDrawMtxNum(); ++i) { - dusk::frame_interp::record_final_mtx(getDrawMtxPtr()[i]); + Mtx* drawMtx = getDrawMtxPtr(); + if (drawMtx != J3DMtxBuffer::sNoUseDrawMtxPtr) { + for (u16 i = 0; i < mModelData->getDrawMtxNum(); ++i) { + dusk::frame_interp::record_final_mtx(drawMtx[i]); + } } #endif diff --git a/libs/JSystem/src/J3DGraphAnimator/J3DMtxBuffer.cpp b/libs/JSystem/src/J3DGraphAnimator/J3DMtxBuffer.cpp index a1765acce4..a2c0a7f2d6 100644 --- a/libs/JSystem/src/J3DGraphAnimator/J3DMtxBuffer.cpp +++ b/libs/JSystem/src/J3DGraphAnimator/J3DMtxBuffer.cpp @@ -6,13 +6,13 @@ #include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "JSystem/JKernel/JKRHeap.h" -Mtx J3DMtxBuffer::sNoUseDrawMtx; +DUSK_GAME_DATA Mtx J3DMtxBuffer::sNoUseDrawMtx; -Mtx33 J3DMtxBuffer::sNoUseNrmMtx; +DUSK_GAME_DATA Mtx33 J3DMtxBuffer::sNoUseNrmMtx; -Mtx* J3DMtxBuffer::sNoUseDrawMtxPtr = &J3DMtxBuffer::sNoUseDrawMtx; +DUSK_GAME_DATA Mtx* J3DMtxBuffer::sNoUseDrawMtxPtr = &J3DMtxBuffer::sNoUseDrawMtx; -Mtx33* J3DMtxBuffer::sNoUseNrmMtxPtr = &J3DMtxBuffer::sNoUseNrmMtx; +DUSK_GAME_DATA Mtx33* J3DMtxBuffer::sNoUseNrmMtxPtr = &J3DMtxBuffer::sNoUseNrmMtx; // force .sdata2 order static f32 dummy1() { diff --git a/libs/JSystem/src/J3DGraphAnimator/J3DSkinDeform.cpp b/libs/JSystem/src/J3DGraphAnimator/J3DSkinDeform.cpp index 76002c0a38..e262797a25 100644 --- a/libs/JSystem/src/J3DGraphAnimator/J3DSkinDeform.cpp +++ b/libs/JSystem/src/J3DGraphAnimator/J3DSkinDeform.cpp @@ -79,9 +79,9 @@ J3DSkinDeform::J3DSkinDeform() { mSkinNList = NULL; } -BE(u16)* J3DSkinDeform::sWorkArea_WEvlpMixMtx[1024]; +DUSK_GAME_DATA BE(u16)* J3DSkinDeform::sWorkArea_WEvlpMixMtx[1024]; -BE(f32)* J3DSkinDeform::sWorkArea_WEvlpMixWeight[1024]; +DUSK_GAME_DATA BE(f32)* J3DSkinDeform::sWorkArea_WEvlpMixWeight[1024]; void J3DSkinDeform::initSkinInfo(J3DModelData* pModelData) { J3D_ASSERT_NULLPTR(322, pModelData != NULL); @@ -194,7 +194,7 @@ void J3DSkinDeform::initSkinInfo(J3DModelData* pModelData) { } } -u16 J3DSkinDeform::sWorkArea_MtxReg[1024]; +DUSK_GAME_DATA u16 J3DSkinDeform::sWorkArea_MtxReg[1024]; int J3DSkinDeform::initMtxIndexArray(J3DModelData* pModelData) { J3D_ASSERT_NULLPTR(507, pModelData != NULL); diff --git a/libs/JSystem/src/J3DGraphBase/J3DDrawBuffer.cpp b/libs/JSystem/src/J3DGraphBase/J3DDrawBuffer.cpp index c533face96..40c523643e 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DDrawBuffer.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DDrawBuffer.cpp @@ -205,17 +205,17 @@ int J3DDrawBuffer::entryImm(J3DPacket* pPacket, u16 index) { return 1; } -J3DDrawBuffer::sortFunc J3DDrawBuffer::sortFuncTable[6] = { +DUSK_GAME_DATA J3DDrawBuffer::sortFunc J3DDrawBuffer::sortFuncTable[6] = { &J3DDrawBuffer::entryMatSort, &J3DDrawBuffer::entryMatAnmSort, &J3DDrawBuffer::entryZSort, &J3DDrawBuffer::entryModelSort, &J3DDrawBuffer::entryInvalidSort, &J3DDrawBuffer::entryNonSort, }; -J3DDrawBuffer::drawFunc J3DDrawBuffer::drawFuncTable[2] = { +DUSK_GAME_DATA J3DDrawBuffer::drawFunc J3DDrawBuffer::drawFuncTable[2] = { &J3DDrawBuffer::drawHead, &J3DDrawBuffer::drawTail, }; -int J3DDrawBuffer::entryNum; +DUSK_GAME_DATA int J3DDrawBuffer::entryNum; void J3DDrawBuffer::draw() const { J3D_ASSERT_RANGE(411, mDrawMode < J3DDrawBufDrawMode_MAX); diff --git a/libs/JSystem/src/J3DGraphBase/J3DPacket.cpp b/libs/JSystem/src/J3DGraphBase/J3DPacket.cpp index 9e28a7f7cb..f87283df47 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DPacket.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DPacket.cpp @@ -68,9 +68,9 @@ void J3DDisplayListObj::callDL() const { GXCallDisplayList(mpDisplayList[0], mSize); } -GDLObj J3DDisplayListObj::sGDLObj; +DUSK_GAME_DATA GDLObj J3DDisplayListObj::sGDLObj; -s32 J3DDisplayListObj::sInterruptFlag; +DUSK_GAME_DATA s32 J3DDisplayListObj::sInterruptFlag; void J3DDisplayListObj::beginDL() { swapBuffer(); diff --git a/libs/JSystem/src/J3DGraphBase/J3DShape.cpp b/libs/JSystem/src/J3DGraphBase/J3DShape.cpp index fc7ac5b727..22eb76a533 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DShape.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DShape.cpp @@ -136,8 +136,8 @@ void J3DLoadCPCmd(u8 addr, u32 val) { #if TARGET_PC static void J3DLoadArrayBasePtr(GXAttr attr, void* data, u32 size, bool le) { u32 idx = (attr == GX_VA_NBT) ? 1 : (attr - GX_VA_POS); - GXCmd1u8(GX_LOAD_AURORA); - GXCmd1u16(GX_LOAD_AURORA_ARRAYBASE | idx); + GXCmd1u8(GX_AURORA); + GXCmd1u16(GX_AURORA_LOAD_ARRAYBASE | idx); GXCmd1u64((u64)data); GXCmd1u32(size); GXCmd1u8(le ? 1 : 0); @@ -289,7 +289,7 @@ void J3DShape::makeVcdVatCmd() { OSRestoreInterrupts(sInterruptFlag); } -void* J3DShape::sOldVcdVatCmd; +DUSK_GAME_DATA void* J3DShape::sOldVcdVatCmd; void J3DShape::loadCurrentMtx() const { mCurrentMtx.load(); @@ -304,7 +304,7 @@ void J3DShape::loadPreDrawSetting() const { mCurrentMtx.load(); } -bool J3DShape::sEnvelopeFlag; +DUSK_GAME_DATA bool J3DShape::sEnvelopeFlag; void J3DShape::setArrayAndBindPipeline() const { J3DShapeMtx::setCurrentPipeline((mFlags & 0x1C) >> 2); diff --git a/libs/JSystem/src/J3DGraphBase/J3DShapeDraw.cpp b/libs/JSystem/src/J3DGraphBase/J3DShapeDraw.cpp index a1bd69438c..e9abdc85f1 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DShapeDraw.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DShapeDraw.cpp @@ -1,15 +1,47 @@ -#include "JSystem/JSystem.h" // IWYU pragma: keep +#include "JSystem/JSystem.h" // IWYU pragma: keep +#include +#include +#include #include "JSystem/J3DGraphBase/J3DShapeDraw.h" #include "JSystem/JKernel/JKRHeap.h" -#include -#include -#include + +#if TARGET_PC +#include +#include + +namespace { + +void set_display_list_copy(void*& displayList, u32& displayListSize, const u8* data, u32 size) { + const u32 alignedSize = ALIGN_NEXT(size, 0x20); + u8* newDL = JKR_NEW_ARRAY_ARGS(u8, alignedSize, 0x20); + if (size != 0) { + std::memcpy(newDL, data, size); + } + for (u32 i = size; i < alignedSize; i++) { + newDL[i] = 0; + } + + displayList = newDL; + displayListSize = alignedSize; + DCStoreRange(newDL, displayListSize); +} + +} // namespace +#endif u32 J3DShapeDraw::countVertex(u32 stride) { u32 count = 0; u8* dlStart = (u8*)getDisplayList(); +#if TARGET_PC + aurora::gx::dl::Reader reader{dlStart, getDisplayListSize(), static_cast(stride)}; + while (const auto cmd = reader.next()) { + if (cmd->kind != aurora::gx::dl::Command::Kind::Passthrough) { + count += cmd->draw.vtxCount; + } + } +#else for (u8* dl = dlStart; (dl - dlStart) < getDisplayListSize();) { u8 cmd = *(u8*)dl; dl++; @@ -20,10 +52,58 @@ u32 J3DShapeDraw::countVertex(u32 stride) { count += vtxNum; dl = (u8*)dl + stride * vtxNum; } +#endif return count; } +#if TARGET_PC +void J3DShapeDraw::addTexMtxIndexInDL(u32 stride, u32 attrOffs, u32 valueBase) { + u32 byteNum = countVertex(stride); + u32 oldSize = mDisplayListSize; + u32 newSize = ALIGN_NEXT(oldSize + byteNum, 0x20); + u8* newDLStart = JKR_NEW_ARRAY_ARGS(u8, newSize, 0x20); + u8* oldDLStart = (u8*)mDisplayList; + u8* newDL = newDLStart; + + aurora::gx::dl::Reader reader{oldDLStart, mDisplayListSize, static_cast(stride)}; + while (const auto cmd = reader.next()) { + if (cmd->kind == aurora::gx::dl::Command::Kind::Passthrough) { + std::memcpy(newDL, cmd->data, cmd->size); + newDL += cmd->size; + continue; + } + + const auto& draw = cmd->draw; + const u32 headerSize = draw.vertices - cmd->data; + std::memcpy(newDL, cmd->data, headerSize); + newDL += headerSize; + + for (u32 i = 0; i < draw.vtxCount; i++) { + const u8* oldVtx = draw.vertices + stride * i; + u8 pnmtxidx = oldVtx[0]; + std::memcpy(newDL, oldVtx, attrOffs); + newDL += attrOffs; + *newDL++ = valueBase + pnmtxidx; + std::memcpy(newDL, oldVtx + attrOffs, stride - attrOffs); + newDL += stride - attrOffs; + } + } + if (reader.failed()) { + // preserve the remainder untouched + std::memcpy(newDL, oldDLStart + reader.pos(), mDisplayListSize - reader.pos()); + newDL += mDisplayListSize - reader.pos(); + } + + u32 realSize = ALIGN_NEXT((uintptr_t)newDL - (uintptr_t)newDLStart, 0x20); + for (; (newDL - newDLStart) < newSize; newDL++) + *newDL = 0; + + mDisplayListSize = realSize; + mDisplayList = newDLStart; + DCStoreRange(newDLStart, mDisplayListSize); +} +#else void J3DShapeDraw::addTexMtxIndexInDL(u32 stride, u32 attrOffs, u32 valueBase) { u32 byteNum = countVertex(stride); u32 oldSize = mDisplayListSize; @@ -69,13 +149,30 @@ void J3DShapeDraw::addTexMtxIndexInDL(u32 stride, u32 attrOffs, u32 valueBase) { mDisplayList = newDLStart; DCStoreRange(newDLStart, mDisplayListSize); } +#endif J3DShapeDraw::J3DShapeDraw(const u8* displayList, u32 displayListSize) { +#if TARGET_PC + set_display_list_copy(mDisplayList, mDisplayListSize, displayList, displayListSize); +#else mDisplayList = (void*)displayList; mDisplayListSize = displayListSize; +#endif } +#if TARGET_PC +J3DShapeDraw::J3DShapeDraw( + const u8* displayList, u32 displayListSize, const GXVtxDescList* vtxDesc) { + if (const auto optimized = aurora::gx::dl::optimize(displayList, displayListSize, vtxDesc)) { + set_display_list_copy(mDisplayList, mDisplayListSize, optimized->data(), optimized->size()); + } else { + set_display_list_copy(mDisplayList, mDisplayListSize, displayList, displayListSize); + } +} +#endif + void J3DShapeDraw::draw() const { + ZoneScoped; GXCallDisplayList(mDisplayList, mDisplayListSize); } diff --git a/libs/JSystem/src/J3DGraphBase/J3DShapeMtx.cpp b/libs/JSystem/src/J3DGraphBase/J3DShapeMtx.cpp index d9af135999..41d2e96ef0 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DShapeMtx.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DShapeMtx.cpp @@ -8,7 +8,7 @@ #include "JSystem/J3DGraphBase/J3DTexture.h" #include "dusk/frame_interpolation.h" -u16 J3DShapeMtx::sMtxLoadCache[10]; +DUSK_GAME_DATA u16 J3DShapeMtx::sMtxLoadCache[10]; #ifdef TARGET_PC static void J3DFrameInterpConcat(MtxP lhs, MtxP rhs, Mtx out) { @@ -54,42 +54,42 @@ void J3DShapeMtx::loadMtxIndx_PNCPU(int slot, u16 indx) const { J3DFifoLoadNrmMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3); } -J3DShapeMtx_LoadFunc J3DShapeMtx::sMtxLoadPipeline[4] = { +DUSK_GAME_DATA J3DShapeMtx_LoadFunc J3DShapeMtx::sMtxLoadPipeline[4] = { &J3DShapeMtx::loadMtxIndx_PNGP, &J3DShapeMtx::loadMtxIndx_PCPU, &J3DShapeMtx::loadMtxIndx_NCPU, &J3DShapeMtx::loadMtxIndx_PNCPU, }; -J3DShapeMtxConcatView_LoadFunc J3DShapeMtxConcatView::sMtxLoadPipeline[4] = { +DUSK_GAME_DATA J3DShapeMtxConcatView_LoadFunc J3DShapeMtxConcatView::sMtxLoadPipeline[4] = { &J3DShapeMtxConcatView::loadMtxConcatView_PNGP, &J3DShapeMtxConcatView::loadMtxConcatView_PCPU, &J3DShapeMtxConcatView::loadMtxConcatView_NCPU, &J3DShapeMtxConcatView::loadMtxConcatView_PNCPU, }; -J3DShapeMtxConcatView_LoadFunc J3DShapeMtxConcatView::sMtxLoadLODPipeline[4] = { +DUSK_GAME_DATA J3DShapeMtxConcatView_LoadFunc J3DShapeMtxConcatView::sMtxLoadLODPipeline[4] = { &J3DShapeMtxConcatView::loadMtxConcatView_PNGP_LOD, &J3DShapeMtxConcatView::loadMtxConcatView_PCPU, &J3DShapeMtxConcatView::loadMtxConcatView_NCPU, &J3DShapeMtxConcatView::loadMtxConcatView_PNCPU, }; -u32 J3DShapeMtx::sCurrentPipeline; +DUSK_GAME_DATA u32 J3DShapeMtx::sCurrentPipeline; -u8* J3DShapeMtx::sCurrentScaleFlag; +DUSK_GAME_DATA u8* J3DShapeMtx::sCurrentScaleFlag; -bool J3DShapeMtx::sNBTFlag; +DUSK_GAME_DATA bool J3DShapeMtx::sNBTFlag; -bool J3DShapeMtx::sLODFlag; +DUSK_GAME_DATA bool J3DShapeMtx::sLODFlag; -u32 J3DShapeMtx::sTexMtxLoadType; +DUSK_GAME_DATA u32 J3DShapeMtx::sTexMtxLoadType; -MtxP J3DShapeMtxConcatView::sMtxPtrTbl[2]; +DUSK_GAME_DATA MtxP J3DShapeMtxConcatView::sMtxPtrTbl[2]; -J3DTexGenBlock* J3DDifferedTexMtx::sTexGenBlock; +DUSK_GAME_DATA J3DTexGenBlock* J3DDifferedTexMtx::sTexGenBlock; -J3DTexMtxObj* J3DDifferedTexMtx::sTexMtxObj; +DUSK_GAME_DATA J3DTexMtxObj* J3DDifferedTexMtx::sTexMtxObj; void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) { static Mtx qMtx = { diff --git a/libs/JSystem/src/J3DGraphBase/J3DSys.cpp b/libs/JSystem/src/J3DGraphBase/J3DSys.cpp index b4598bfa7a..d37b4608bf 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DSys.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DSys.cpp @@ -4,19 +4,23 @@ #include "JSystem/J3DGraphBase/J3DSys.h" #include "JSystem/J3DGraphBase/J3DTevs.h" #include "JSystem/J3DGraphBase/J3DTexture.h" -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" #include "global.h" #include "tracy/Tracy.hpp" -J3DSys j3dSys; +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#endif -Mtx J3DSys::mCurrentMtx; +DUSK_GAME_DATA J3DSys j3dSys; -Vec J3DSys::mCurrentS; +DUSK_GAME_DATA Mtx J3DSys::mCurrentMtx; -Vec J3DSys::mParentS; +DUSK_GAME_DATA Vec J3DSys::mCurrentS; -J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8]; +DUSK_GAME_DATA Vec J3DSys::mParentS; + +DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8]; #if TARGET_PC // Original game bug, array is too small. static u8 NullTexData[0x20] ATTRIBUTE_ALIGN(32) = {0}; @@ -35,7 +39,7 @@ static Mtx23 IndMtx = { 0.0f, 0.5f, 0.0f, }; -u32 j3dDefaultViewNo; +DUSK_GAME_DATA u32 j3dDefaultViewNo; static GXColor ColorBlack = {0x00, 0x00, 0x00, 0x00}; @@ -370,3 +374,13 @@ void J3DSys::reinitPixelProc() { GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); GXSetZCompLoc(GX_TRUE); } + +#if TARGET_PC +void J3DSys::setViewMtx(const Mtx m) { + Mtx patched; + if (dusk::frame_interp::lookup_replacement(m, patched)) { + m = patched; + } + MTXCopy(m, mViewMtx); +} +#endif diff --git a/libs/JSystem/src/J3DGraphBase/J3DTevs.cpp b/libs/JSystem/src/J3DGraphBase/J3DTevs.cpp index 719976770b..1bfb22e73e 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DTevs.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DTevs.cpp @@ -315,7 +315,7 @@ void loadNBTScale(J3DNBTScale& NBTScale) { } } -const J3DLightInfo j3dDefaultLightInfo = { +DUSK_GAME_DATA const J3DLightInfo j3dDefaultLightInfo = { 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0xff, 0xff, 0xff, 0xff, @@ -323,14 +323,14 @@ const J3DLightInfo j3dDefaultLightInfo = { 1.0f, 0.0f, 0.0f, }; -J3DTexCoordInfo const j3dDefaultTexCoordInfo[8] = { +DUSK_GAME_DATA J3DTexCoordInfo const j3dDefaultTexCoordInfo[8] = { {GX_MTX2x4, GX_TG_TEX0, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX1, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX2, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX3, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX4, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX5, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX6, GX_IDENTITY, 0}, {GX_MTX2x4, GX_TG_TEX7, GX_IDENTITY, 0}, }; -J3DTexMtxInfo const j3dDefaultTexMtxInfo = { +DUSK_GAME_DATA J3DTexMtxInfo const j3dDefaultTexMtxInfo = { 0x01, 0x00, 0xFF, @@ -341,27 +341,27 @@ J3DTexMtxInfo const j3dDefaultTexMtxInfo = { 1.0f}, }; -J3DIndTexMtxInfo const j3dDefaultIndTexMtxInfo = { +DUSK_GAME_DATA J3DIndTexMtxInfo const j3dDefaultIndTexMtxInfo = { 0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 1 }; -J3DTevStageInfo const j3dDefaultTevStageInfo = { +DUSK_GAME_DATA J3DTevStageInfo const j3dDefaultTevStageInfo = { 0x04, 0x0A, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, }; -J3DIndTevStageInfo const j3dDefaultIndTevStageInfo = { +DUSK_GAME_DATA J3DIndTevStageInfo const j3dDefaultIndTevStageInfo = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -J3DFogInfo const j3dDefaultFogInfo = { +DUSK_GAME_DATA J3DFogInfo const j3dDefaultFogInfo = { 0x00, 0x00, 0x0140, 0.0f, 0.0f, 0.1f, 10000.0f, 0xFF, 0xFF, 0xFF, 0x00, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; -J3DNBTScaleInfo const j3dDefaultNBTScaleInfo = { +DUSK_GAME_DATA J3DNBTScaleInfo const j3dDefaultNBTScaleInfo = { #if TARGET_PC 0x00, {1.0f, 1.0f, 1.0f}, #else @@ -399,9 +399,9 @@ void makeTexCoordTable() { } } -u8 j3dTevSwapTableTable[1024]; +DUSK_GAME_DATA u8 j3dTevSwapTableTable[1024]; -u8 j3dAlphaCmpTable[768]; +DUSK_GAME_DATA u8 j3dAlphaCmpTable[768]; void makeAlphaCmpTable() { u8* table = j3dAlphaCmpTable; @@ -417,7 +417,7 @@ void makeAlphaCmpTable() { } } -u8 j3dZModeTable[96]; +DUSK_GAME_DATA u8 j3dZModeTable[96]; void makeZModeTable() { u8* table = j3dZModeTable; @@ -495,44 +495,44 @@ static void J3DGDLoadPostTexMtxImm(f32 (*param_1)[4], u32 param_2) { J3DGDWrite_f32(param_1[2][3]); } -const GXColor j3dDefaultColInfo = {0xFF, 0xFF, 0xFF, 0xFF}; +DUSK_GAME_DATA const GXColor j3dDefaultColInfo = {0xFF, 0xFF, 0xFF, 0xFF}; -const GXColor j3dDefaultAmbInfo = {0x32, 0x32, 0x32, 0x32}; +DUSK_GAME_DATA const GXColor j3dDefaultAmbInfo = {0x32, 0x32, 0x32, 0x32}; -const u8 j3dDefaultNumChans = 1; +DUSK_GAME_DATA const u8 j3dDefaultNumChans = 1; -const J3DTevOrderInfo j3dDefaultTevOrderInfoNull = {0xFF, 0xFF, 0xFF, 0x00}; +DUSK_GAME_DATA const J3DTevOrderInfo j3dDefaultTevOrderInfoNull = {0xFF, 0xFF, 0xFF, 0x00}; -const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull = {0xFF, 0xFF, 0x00, 0x00}; +DUSK_GAME_DATA const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull = {0xFF, 0xFF, 0x00, 0x00}; -const GXColorS10 j3dDefaultTevColor = {0xFF, 0xFF, 0xFF, 0xFF}; +DUSK_GAME_DATA const GXColorS10 j3dDefaultTevColor = {0xFF, 0xFF, 0xFF, 0xFF}; -const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo = { +DUSK_GAME_DATA const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo = { 0x00, 0x00, 0x00, 0x00, }; -const GXColor j3dDefaultTevKColor = {0xFF, 0xFF, 0xFF, 0xFF}; +DUSK_GAME_DATA const GXColor j3dDefaultTevKColor = {0xFF, 0xFF, 0xFF, 0xFF}; -J3DTevSwapModeInfo const j3dDefaultTevSwapMode = { +DUSK_GAME_DATA J3DTevSwapModeInfo const j3dDefaultTevSwapMode = { 0x00, 0x00, 0x00, 0x00, }; -const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable = {0x00, 0x01, 0x02, 0x03}; +DUSK_GAME_DATA const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable = {0x00, 0x01, 0x02, 0x03}; -const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP}; +DUSK_GAME_DATA const J3DBlendInfo j3dDefaultBlendInfo = {GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_NOOP}; -const J3DColorChanInfo j3dDefaultColorChanInfo = { +DUSK_GAME_DATA const J3DColorChanInfo j3dDefaultColorChanInfo = { 0x00, 0x00, 0x00, 0x02, 0x02, 0x00, 0xFF, 0xFF, }; -const u8 j3dDefaultTevSwapTableID = 0x1B; +DUSK_GAME_DATA const u8 j3dDefaultTevSwapTableID = 0x1B; -const u16 j3dDefaultAlphaCmpID = 0x00E7; +DUSK_GAME_DATA const u16 j3dDefaultAlphaCmpID = 0x00E7; -const u16 j3dDefaultZModeID = 0x0017; +DUSK_GAME_DATA const u16 j3dDefaultZModeID = 0x0017; diff --git a/libs/JSystem/src/J3DGraphBase/J3DTransform.cpp b/libs/JSystem/src/J3DGraphBase/J3DTransform.cpp index 44e0711337..5a7099e6dc 100644 --- a/libs/JSystem/src/J3DGraphBase/J3DTransform.cpp +++ b/libs/JSystem/src/J3DGraphBase/J3DTransform.cpp @@ -74,12 +74,12 @@ void J3DCalcBBoardMtx(__REGISTER Mtx mtx) { mtx[2][2] = z; } -J3DTransformInfo const j3dDefaultTransformInfo = { +DUSK_GAME_DATA J3DTransformInfo const j3dDefaultTransformInfo = { {1.0f, 1.0f, 1.0f}, {0, 0, 0}, {0.0f, 0.0f, 0.0f}}; -Vec const j3dDefaultScale = {1.0f, 1.0f, 1.0f}; +DUSK_GAME_DATA Vec const j3dDefaultScale = {1.0f, 1.0f, 1.0f}; -Mtx const j3dDefaultMtx = { +DUSK_GAME_DATA Mtx const j3dDefaultMtx = { {1.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 1.0f, 0.0f}}; void J3DCalcYBBoardMtx(Mtx mtx) { @@ -610,7 +610,7 @@ void J3DPSMtxArrayConcat(Mtx mA, Mtx mB, Mtx mAB, u32 count) { } #endif // clang-format on -f32 const PSMulUnit01[] = { +DUSK_GAME_DATA f32 const PSMulUnit01[] = { 0.0f, -1.0f, }; diff --git a/libs/JSystem/src/J3DGraphLoader/J3DShapeFactory.cpp b/libs/JSystem/src/J3DGraphLoader/J3DShapeFactory.cpp index f283cb8932..b8b3b14c36 100644 --- a/libs/JSystem/src/J3DGraphLoader/J3DShapeFactory.cpp +++ b/libs/JSystem/src/J3DGraphLoader/J3DShapeFactory.cpp @@ -132,7 +132,12 @@ J3DShapeDraw* J3DShapeFactory::newShapeDraw(int shapeNo, int mtxGroupNo) const { const J3DShapeInitData& shapeInitData = mShapeInitData[mIndexTable[shapeNo]]; const J3DShapeDrawInitData& drawInitData = (&mDrawInitData[shapeInitData.mDrawInitDataIndex])[mtxGroupNo]; +#if TARGET_PC + shapeDraw = JKR_NEW J3DShapeDraw(&mDisplayListData[drawInitData.mDisplayListIndex], drawInitData.mDisplayListSize, + getVtxDescList(shapeNo)); +#else shapeDraw = JKR_NEW J3DShapeDraw(&mDisplayListData[drawInitData.mDisplayListIndex], drawInitData.mDisplayListSize); +#endif J3D_ASSERT_ALLOCMEM(193, shapeDraw); return shapeDraw; } @@ -154,7 +159,7 @@ s32 J3DShapeFactory::calcSize(int shapeNo, u32 flag) { for (u32 i = 0; i < mtxGroupNo; i++) { size += calcSizeShapeMtx(flag, shapeNo, i); - size += 0x0C; + size += sizeof(J3DShapeDraw); } return size; diff --git a/libs/JSystem/src/JAHostIO/JAHVirtualNode.cpp b/libs/JSystem/src/JAHostIO/JAHVirtualNode.cpp index b9cd8acb15..1459a705cd 100644 --- a/libs/JSystem/src/JAHostIO/JAHVirtualNode.cpp +++ b/libs/JSystem/src/JAHostIO/JAHVirtualNode.cpp @@ -2,7 +2,9 @@ #include #include -u32 JAHVirtualNode::smVirNodeNum; +#include "helpers/string.hpp" + +DUSK_GAME_DATA u32 JAHVirtualNode::smVirNodeNum; void JAHVirtualNode::virtualMessage(JAHControl& control) { message(control); @@ -77,7 +79,7 @@ void JAHVirtualNode::setVirNodeName(const char* name) { // clang-format off JUT_ASSERT(141, size<32); // clang-format on - strcpy(mName, name); + SAFE_STRCPY(mName, name); } JAHVirtualNode::JAHVirtualNode(const char* name) : mTree(this) { diff --git a/libs/JSystem/src/JAHostIO/JAHioMessage.cpp b/libs/JSystem/src/JAHostIO/JAHioMessage.cpp index bc0e26e211..a32c20962e 100644 --- a/libs/JSystem/src/JAHostIO/JAHioMessage.cpp +++ b/libs/JSystem/src/JAHostIO/JAHioMessage.cpp @@ -5,17 +5,17 @@ #include "JSystem/JAHostIO/JAHioUtil.h" #include "JSystem/JHostIO/JORMContext.h" -u16 JAHControl::smButtonWidth[] = {20, 50, 100, 150, 300, 600}; -u16 JAHControl::smCommentWidth[] = {20, 50, 100, 200, 400, 800}; -u16 JAHControl::smComboWidth[] = {50, 100, 150, 200, 300, 600}; -u16 JAHControl::smYTop = 5; -u16 JAHControl::smXLeft = 5; -u16 JAHControl::smIndentSize = 30; -u16 JAHControl::smLineHeight = 23; -u16 JAHControl::smContWidth = 450; -u16 JAHControl::smIntX = 2; -u16 JAHControl::smIntY = 5; -u16 JAHControl::smNameWidth = 150; +DUSK_GAME_DATA u16 JAHControl::smButtonWidth[] = {20, 50, 100, 150, 300, 600}; +DUSK_GAME_DATA u16 JAHControl::smCommentWidth[] = {20, 50, 100, 200, 400, 800}; +DUSK_GAME_DATA u16 JAHControl::smComboWidth[] = {50, 100, 150, 200, 300, 600}; +DUSK_GAME_DATA u16 JAHControl::smYTop = 5; +DUSK_GAME_DATA u16 JAHControl::smXLeft = 5; +DUSK_GAME_DATA u16 JAHControl::smIndentSize = 30; +DUSK_GAME_DATA u16 JAHControl::smLineHeight = 23; +DUSK_GAME_DATA u16 JAHControl::smContWidth = 450; +DUSK_GAME_DATA u16 JAHControl::smIntX = 2; +DUSK_GAME_DATA u16 JAHControl::smIntY = 5; +DUSK_GAME_DATA u16 JAHControl::smNameWidth = 150; void JAHControl::returnY(u16 param_1) { mY += u16(smIntY + smLineHeight * param_1); diff --git a/libs/JSystem/src/JAHostIO/JAHioMgr.cpp b/libs/JSystem/src/JAHostIO/JAHioMgr.cpp index 91b0a030e6..9b404b6bef 100644 --- a/libs/JSystem/src/JAHostIO/JAHioMgr.cpp +++ b/libs/JSystem/src/JAHostIO/JAHioMgr.cpp @@ -5,7 +5,7 @@ #include "JSystem/JHostIO/JORServer.h" template <> -JAHioMgr* JAHSingletonBase::sInstance = NULL; +DUSK_GAME_DATA JAHioMgr* JAHSingletonBase::sInstance = NULL; JAHioMgr::JAHioMgr() : field_0x4(0), field_0x8(0) {} diff --git a/libs/JSystem/src/JAHostIO/JAHioNode.cpp b/libs/JSystem/src/JAHostIO/JAHioNode.cpp index 9a30991e4f..6e6ea2a320 100644 --- a/libs/JSystem/src/JAHostIO/JAHioNode.cpp +++ b/libs/JSystem/src/JAHostIO/JAHioNode.cpp @@ -4,9 +4,11 @@ #include "JSystem/JAHostIO/JAHioMessage.h" #include "JSystem/JAHostIO/JAHioMgr.h" #include "JSystem/JAHostIO/JAHioNode.h" -#include "JSystem/JHostIO/JORServer.h" -JAHioNode* JAHioNode::smCurrentNode; +#include "JSystem/JHostIO/JORServer.h" +#include "helpers/string.hpp" + +DUSK_GAME_DATA JAHioNode* JAHioNode::smCurrentNode; JAHioNode::JAHioNode(const char* name) : mTree(this) { mLastChild = NULL; @@ -32,7 +34,7 @@ void JAHioNode::updateNode() { void JAHioNode::setNodeName(const char* name) { int size = strlen(name) + 1; JUT_ASSERT(51, size < 32); - strcpy(mName, name); + SAFE_STRCPY(mName, name); } void JAHioNode::genMessage(JORMContext* mctx) { diff --git a/libs/JSystem/src/JAHostIO/JAHioUtil.cpp b/libs/JSystem/src/JAHostIO/JAHioUtil.cpp index 9a0fdf027a..6f1935744d 100644 --- a/libs/JSystem/src/JAHostIO/JAHioUtil.cpp +++ b/libs/JSystem/src/JAHostIO/JAHioUtil.cpp @@ -6,10 +6,10 @@ #include "JSystem/JAHostIO/JAHioUtil.h" #include "JSystem/JHostIO/JORFile.h" -char JAHioUtil::mStringBuffer[256]; +DUSK_GAME_DATA char JAHioUtil::mStringBuffer[256]; -JAHioNode* JAHUpdate::spNode; -JORMContext* JAHUpdate::spMc; +DUSK_GAME_DATA JAHioNode* JAHUpdate::spNode; +DUSK_GAME_DATA JORMContext* JAHUpdate::spMc; static char* dummy(JORDir* dir) { return std::strrchr(dir->getFilename(), '\n'); diff --git a/libs/JSystem/src/JAudio2/JASAiCtrl.cpp b/libs/JSystem/src/JAudio2/JASAiCtrl.cpp index 3764700149..545b0d41dc 100644 --- a/libs/JSystem/src/JAudio2/JASAiCtrl.cpp +++ b/libs/JSystem/src/JAudio2/JASAiCtrl.cpp @@ -20,33 +20,33 @@ #include "tracy/Tracy.hpp" -s16* JASDriver::sDmaDacBuffer[3]; +DUSK_GAME_DATA s16* JASDriver::sDmaDacBuffer[3]; static u8 data_804507A8 = 3; -s16** JASDriver::sDspDacBuffer; +DUSK_GAME_DATA s16** JASDriver::sDspDacBuffer; -s32 JASDriver::sDspDacWriteBuffer; +DUSK_GAME_DATA s32 JASDriver::sDspDacWriteBuffer; -s32 JASDriver::sDspDacReadBuffer; +DUSK_GAME_DATA s32 JASDriver::sDspDacReadBuffer; -s32 JASDriver::sDspStatus; +DUSK_GAME_DATA s32 JASDriver::sDspStatus; -JASDriver::DSPBufCallback JASDriver::sDspDacCallback; +DUSK_GAME_DATA JASDriver::DSPBufCallback JASDriver::sDspDacCallback; -s16* JASDriver::lastRspMadep; +DUSK_GAME_DATA s16* JASDriver::lastRspMadep; -void (*JASDriver::dacCallbackFunc)(s16*, u32); +DUSK_GAME_DATA void (*JASDriver::dacCallbackFunc)(s16*, u32); -JASDriver::MixCallback JASDriver::extMixCallback; +DUSK_GAME_DATA JASDriver::MixCallback JASDriver::extMixCallback; -u32 JASDriver::sOutputRate; +DUSK_GAME_DATA u32 JASDriver::sOutputRate; -JASMixMode JASDriver::sMixMode = MIX_MODE_EXTRA; +DUSK_GAME_DATA JASMixMode JASDriver::sMixMode = MIX_MODE_EXTRA; -f32 JASDriver::sDacRate = 32028.5f; +DUSK_GAME_DATA f32 JASDriver::sDacRate = 32028.5f; -u32 JASDriver::sSubFrames = 0x00000007; +DUSK_GAME_DATA u32 JASDriver::sSubFrames = 0x00000007; void JASDriver::initAI(void (*param_0)(void)) { setOutputRate(OUTPUT_RATE_0); @@ -114,14 +114,14 @@ void JASDriver::setOutputRate(JASOutputRate param_0) { #endif } -const JASDriver::MixFunc JASDriver::sMixFuncs[4] = { +DUSK_GAME_DATA const JASDriver::MixFunc JASDriver::sMixFuncs[4] = { mixMonoTrack, mixMonoTrackWide, mixExtraTrack, mixInterleaveTrack, }; -u32 JASDriver::sSubFrameCounter; +DUSK_GAME_DATA u32 JASDriver::sSubFrameCounter; void JASDriver::updateDac() { static u32 dacp = 0; @@ -227,7 +227,7 @@ void JASDriver::readDspBuffer(s16* param_0, u32 param_1) { JASCalc::imixcopy(endDacBuffer, dacBuffer, param_0, param_1); } -u32 sDspUpCount; +DUSK_GAME_DATA u32 sDspUpCount; void JASDriver::finishDSPFrame() { static u32 waitcount; diff --git a/libs/JSystem/src/JAudio2/JASAramStream.cpp b/libs/JSystem/src/JAudio2/JASAramStream.cpp index 64ddfc467e..6a15869a7c 100644 --- a/libs/JSystem/src/JAudio2/JASAramStream.cpp +++ b/libs/JSystem/src/JAudio2/JASAramStream.cpp @@ -12,16 +12,16 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include "JSystem/JSupport/JSupport.h" -JASTaskThread* JASAramStream::sLoadThread; +DUSK_GAME_DATA JASTaskThread* JASAramStream::sLoadThread; -u8* JASAramStream::sReadBuffer; +DUSK_GAME_DATA u8* JASAramStream::sReadBuffer; -u32 JASAramStream::sBlockSize; +DUSK_GAME_DATA u32 JASAramStream::sBlockSize; -u32 JASAramStream::sChannelMax; +DUSK_GAME_DATA u32 JASAramStream::sChannelMax; -bool dvdHasErrored; -bool hasErrored; +DUSK_GAME_DATA bool dvdHasErrored; +DUSK_GAME_DATA bool hasErrored; #define PAUSE_REQUESTED 1 #define PAUSE_DVD_ERROR 2 diff --git a/libs/JSystem/src/JAudio2/JASAudioThread.cpp b/libs/JSystem/src/JAudio2/JASAudioThread.cpp index fa476d1cb4..bd95337c44 100644 --- a/libs/JSystem/src/JAudio2/JASAudioThread.cpp +++ b/libs/JSystem/src/JAudio2/JASAudioThread.cpp @@ -41,7 +41,7 @@ void JASAudioThread::stop() { jamMessageBlock((void*)2); } -volatile int JASAudioThread::snIntCount; +DUSK_GAME_DATA volatile int JASAudioThread::snIntCount; class Lock { public: diff --git a/libs/JSystem/src/JAudio2/JASBNKParser.cpp b/libs/JSystem/src/JAudio2/JASBNKParser.cpp index 7898eedd48..ad8aa1ee46 100644 --- a/libs/JSystem/src/JAudio2/JASBNKParser.cpp +++ b/libs/JSystem/src/JAudio2/JASBNKParser.cpp @@ -13,7 +13,7 @@ JASBank* JASBNKParser::createBank(void const* stream, JKRHeap* heap) { return createBasicBank(stream, heap); } -u32 JASBNKParser::sUsedHeapSize; +DUSK_GAME_DATA u32 JASBNKParser::sUsedHeapSize; JASBasicBank* JASBNKParser::createBasicBank(void const* stream, JKRHeap* heap) { if (heap == NULL) { diff --git a/libs/JSystem/src/JAudio2/JASBasicWaveBank.cpp b/libs/JSystem/src/JAudio2/JASBasicWaveBank.cpp index 9170e59ed1..ac11742e6b 100644 --- a/libs/JSystem/src/JAudio2/JASBasicWaveBank.cpp +++ b/libs/JSystem/src/JAudio2/JASBasicWaveBank.cpp @@ -55,7 +55,7 @@ void JASBasicWaveBank::incWaveTable(JASBasicWaveBank::TWaveGroup const* param_0) } } -u32 JASBasicWaveBank::mNoLoad; +DUSK_GAME_DATA u32 JASBasicWaveBank::mNoLoad; void JASBasicWaveBank::decWaveTable(JASBasicWaveBank::TWaveGroup const* param_0) { JASMutexLock lock(&field_0x4); diff --git a/libs/JSystem/src/JAudio2/JASCalc.cpp b/libs/JSystem/src/JAudio2/JASCalc.cpp index 69369192fe..ba13c983e6 100644 --- a/libs/JSystem/src/JAudio2/JASCalc.cpp +++ b/libs/JSystem/src/JAudio2/JASCalc.cpp @@ -141,7 +141,7 @@ void JASCalc::bzero(void* dest, u32 size) { } #if AVOID_UB -s16 const JASCalc::CUTOFF_TO_IIR_TABLE[129][4] = { +DUSK_GAME_DATA s16 const JASCalc::CUTOFF_TO_IIR_TABLE[129][4] = { #else s16 const JASCalc::CUTOFF_TO_IIR_TABLE[128][4] = { #endif diff --git a/libs/JSystem/src/JAudio2/JASChannel.cpp b/libs/JSystem/src/JAudio2/JASChannel.cpp index 758167cc5c..a99c13ce63 100644 --- a/libs/JSystem/src/JAudio2/JASChannel.cpp +++ b/libs/JSystem/src/JAudio2/JASChannel.cpp @@ -12,13 +12,13 @@ #include "JSystem/JMath/JMATrigonometric.h" #include "JSystem/JGeometry.h" -OSMessageQueue JASChannel::sBankDisposeMsgQ; +DUSK_GAME_DATA OSMessageQueue JASChannel::sBankDisposeMsgQ; -OSMessage JASChannel::sBankDisposeMsg[16]; +DUSK_GAME_DATA OSMessage JASChannel::sBankDisposeMsg[16]; -OSMessage JASChannel::sBankDisposeList[16]; +DUSK_GAME_DATA OSMessage JASChannel::sBankDisposeList[16]; -int JASChannel::sBankDisposeListSize; +DUSK_GAME_DATA int JASChannel::sBankDisposeListSize; JASChannel::JASChannel(Callback i_callback, void* i_callbackData) : mStatus(STATUS_STOP), diff --git a/libs/JSystem/src/JAudio2/JASCmdStack.cpp b/libs/JSystem/src/JAudio2/JASCmdStack.cpp index beaeee492e..90c56150ce 100644 --- a/libs/JSystem/src/JAudio2/JASCmdStack.cpp +++ b/libs/JSystem/src/JAudio2/JASCmdStack.cpp @@ -8,9 +8,9 @@ #include "JSystem/JAudio2/JASCriticalSection.h" #include -JASPortCmd::TPortHead JASPortCmd::sCommandListOnce; +DUSK_GAME_DATA JASPortCmd::TPortHead JASPortCmd::sCommandListOnce; -JASPortCmd::TPortHead JASPortCmd::sCommandListStay; +DUSK_GAME_DATA JASPortCmd::TPortHead JASPortCmd::sCommandListStay; bool JASPortCmd::addPortCmdOnce() { JASCriticalSection cs; diff --git a/libs/JSystem/src/JAudio2/JASDSPChannel.cpp b/libs/JSystem/src/JAudio2/JASDSPChannel.cpp index 62c983248c..7c35ce8e94 100644 --- a/libs/JSystem/src/JAudio2/JASDSPChannel.cpp +++ b/libs/JSystem/src/JAudio2/JASDSPChannel.cpp @@ -4,7 +4,7 @@ #include "JSystem/JAudio2/JASHeapCtrl.h" #include "JSystem/JKernel/JKRSolidHeap.h" -JASDSPChannel* JASDSPChannel::sDspChannels; +DUSK_GAME_DATA JASDSPChannel* JASDSPChannel::sDspChannels; JASDSPChannel::JASDSPChannel() : mStatus(STATUS_INACTIVE), diff --git a/libs/JSystem/src/JAudio2/JASDSPInterface.cpp b/libs/JSystem/src/JAudio2/JASDSPInterface.cpp index 14a723e27d..554660f6dc 100644 --- a/libs/JSystem/src/JAudio2/JASDSPInterface.cpp +++ b/libs/JSystem/src/JAudio2/JASDSPInterface.cpp @@ -11,13 +11,13 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include -JASDsp::TChannel* JASDsp::CH_BUF; +DUSK_GAME_DATA JASDsp::TChannel* JASDsp::CH_BUF; -JASDsp::FxBuf* JASDsp::FX_BUF; +DUSK_GAME_DATA JASDsp::FxBuf* JASDsp::FX_BUF; -f32 JASDsp::sDSPVolume; +DUSK_GAME_DATA f32 JASDsp::sDSPVolume; -u16 JASDsp::SEND_TABLE[] = { +DUSK_GAME_DATA u16 JASDsp::SEND_TABLE[] = { 0x0D00, 0x0D60, 0x0DC8, @@ -32,10 +32,10 @@ u16 JASDsp::SEND_TABLE[] = { 0x0000, }; -u32 JASWaveInfo::one = 1; +DUSK_GAME_DATA u32 JASWaveInfo::one = 1; #if DEBUG -s32 JASDsp::dspMutex = 1; +DUSK_GAME_DATA s32 JASDsp::dspMutex = 1; #endif void JASDsp::boot(void (*param_0)(void*)) { @@ -99,14 +99,14 @@ void JASDsp::invalChannelAll() { DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS); } -u8 const ATTRIBUTE_ALIGN(32) JASDsp::DSPADPCM_FILTER[64] = { +DUSK_GAME_DATA u8 const ATTRIBUTE_ALIGN(32) JASDsp::DSPADPCM_FILTER[64] = { 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00, 0x10, 0x00, 0xF8, 0x00, 0x0E, 0x00, 0xFA, 0x00, 0x0C, 0x00, 0xFC, 0x00, 0x12, 0x00, 0xF6, 0x00, 0x10, 0x68, 0xF7, 0x38, 0x12, 0xC0, 0xF7, 0x04, 0x14, 0x00, 0xF4, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x04, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, }; -u32 const ATTRIBUTE_ALIGN(32) JASDsp::DSPRES_FILTER[320] = { +DUSK_GAME_DATA u32 const ATTRIBUTE_ALIGN(32) JASDsp::DSPRES_FILTER[320] = { 0x0C3966AD, 0x0D46FFDF, 0x0B396696, diff --git a/libs/JSystem/src/JAudio2/JASDriverIF.cpp b/libs/JSystem/src/JAudio2/JASDriverIF.cpp index 7d602a8856..87a88adca0 100644 --- a/libs/JSystem/src/JAudio2/JASDriverIF.cpp +++ b/libs/JSystem/src/JAudio2/JASDriverIF.cpp @@ -9,7 +9,7 @@ void JASDriver::setDSPLevel(f32 param_0) { JASDsp::setDSPMixerLevel(param_0); } -u16 JASDriver::MAX_MIXERLEVEL = 0x2EE0; +DUSK_GAME_DATA u16 JASDriver::MAX_MIXERLEVEL = 0x2EE0; u16 JASDriver::getChannelLevel_dsp() { return JASDriver::MAX_MIXERLEVEL; @@ -23,7 +23,7 @@ f32 JASDriver::getDSPLevel() { return JASDsp::getDSPMixerLevel(); } -u32 JASDriver::JAS_SYSTEM_OUTPUT_MODE = JAS_OUTPUT_STEREO; +DUSK_GAME_DATA u32 JASDriver::JAS_SYSTEM_OUTPUT_MODE = JAS_OUTPUT_STEREO; void JASDriver::setOutputMode(u32 mode) { JAS_SYSTEM_OUTPUT_MODE = mode; @@ -40,11 +40,11 @@ void JASDriver::waitSubFrame() { } while (r31 == getSubFrameCounter()); } -JASCallbackMgr JASDriver::sDspSyncCallback; +DUSK_GAME_DATA JASCallbackMgr JASDriver::sDspSyncCallback; -JASCallbackMgr JASDriver::sSubFrameCallback; +DUSK_GAME_DATA JASCallbackMgr JASDriver::sSubFrameCallback; -JASCallbackMgr JASDriver::sUpdateDacCallback; +DUSK_GAME_DATA JASCallbackMgr JASDriver::sUpdateDacCallback; int JASDriver::rejectCallback(DriverCallback callback, void* param_1) { int r31 = sDspSyncCallback.reject(callback, param_1); diff --git a/libs/JSystem/src/JAudio2/JASDvdThread.cpp b/libs/JSystem/src/JAudio2/JASDvdThread.cpp index 31a313a8b1..dfa85d3166 100644 --- a/libs/JSystem/src/JAudio2/JASDvdThread.cpp +++ b/libs/JSystem/src/JAudio2/JASDvdThread.cpp @@ -4,7 +4,7 @@ #include "JSystem/JAudio2/JASTaskThread.h" #include "JSystem/JKernel/JKRSolidHeap.h" -JASTaskThread* JASDvd::sThread; +DUSK_GAME_DATA JASTaskThread* JASDvd::sThread; JASTaskThread* JASDvd::getThreadPointer() { return JASDvd::sThread; diff --git a/libs/JSystem/src/JAudio2/JASHeapCtrl.cpp b/libs/JSystem/src/JAudio2/JASHeapCtrl.cpp index e3722e3726..ef2d26256a 100644 --- a/libs/JSystem/src/JAudio2/JASHeapCtrl.cpp +++ b/libs/JSystem/src/JAudio2/JASHeapCtrl.cpp @@ -247,7 +247,7 @@ JASGenericMemPool::~JASGenericMemPool() { } } -JKRSolidHeap* JASDram; +DUSK_GAME_DATA JKRSolidHeap* JASDram; // TODO: What is this and Where does it go? struct TNextOnFreeList { @@ -290,11 +290,11 @@ void JASGenericMemPool::free(void* ptr, u32 param_1) { freeMemCount++; } -uintptr_t JASKernel::sAramBase; +DUSK_GAME_DATA uintptr_t JASKernel::sAramBase; -JKRHeap* JASKernel::sSystemHeap; +DUSK_GAME_DATA JKRHeap* JASKernel::sSystemHeap; -JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* JASKernel::sCommandHeap; +DUSK_GAME_DATA JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* JASKernel::sCommandHeap; void JASKernel::setupRootHeap(JKRSolidHeap* heap, u32 size) { JUT_ASSERT(784, heap); @@ -314,7 +314,7 @@ JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>* JASKernel::getCom return JASKernel::sCommandHeap; } -JASHeap JASKernel::audioAramHeap; +DUSK_GAME_DATA JASHeap JASKernel::audioAramHeap; void JASKernel::setupAramHeap(uintptr_t param_0, u32 param_1) { #if !PLATFORM_GCN diff --git a/libs/JSystem/src/JAudio2/JASLfo.cpp b/libs/JSystem/src/JAudio2/JASLfo.cpp index d369072a15..4a9af0c3c9 100644 --- a/libs/JSystem/src/JAudio2/JASLfo.cpp +++ b/libs/JSystem/src/JAudio2/JASLfo.cpp @@ -40,7 +40,7 @@ void JASLfo::incCounter(f32 param_0) { } } -JASLfo JASLfo::sFreeRunLfo; +DUSK_GAME_DATA JASLfo JASLfo::sFreeRunLfo; void JASLfo::resetCounter() { field_0x16 = mDelay; diff --git a/libs/JSystem/src/JAudio2/JASOscillator.cpp b/libs/JSystem/src/JAudio2/JASOscillator.cpp index f4bf2ade6f..666b2dd439 100644 --- a/libs/JSystem/src/JAudio2/JASOscillator.cpp +++ b/libs/JSystem/src/JAudio2/JASOscillator.cpp @@ -131,25 +131,25 @@ void JASOscillator::update() { updateCurrentValue(psVar1[mCurPoint].mTime); } -f32 const JASOscillator::sCurveTableLinear[17] = { +DUSK_GAME_DATA f32 const JASOscillator::sCurveTableLinear[17] = { 1.0, 0.9375, 0.875, 0.8125, 0.75, 0.6875, 0.625, 0.5625, 0.5, 0.4375, 0.375, 0.3125, 0.25, 0.1875, 0.125, 0.0625, 0.0, }; -f32 const JASOscillator::sCurveTableSampleCell[17] = { +DUSK_GAME_DATA f32 const JASOscillator::sCurveTableSampleCell[17] = { 1.0, 0.9704890251159668, 0.7812740206718445, 0.5462809801101685, 0.39979198575019836, 0.28931498527526855, 0.21210399270057678, 0.15747599303722382, 0.1126129999756813, 0.08178959786891937, 0.057985201478004456, 0.04364150017499924, 0.03082370012998581, 0.023712899535894394, 0.015259300358593464, 0.00915555004030466, 0.0 }; -f32 const JASOscillator::sCurveTableSqRoot[17] = { +DUSK_GAME_DATA f32 const JASOscillator::sCurveTableSqRoot[17] = { 1.0, 0.8789060115814209, 0.765625, 0.6601560115814209, 0.5625, 0.4726560115814209, 0.390625, 0.3164060115814209, 0.25, 0.1914059966802597, 0.140625, 0.09765619784593582, 0.0625, 0.03515620157122612, 0.015625, 0.00390625, 0.0 }; -f32 const JASOscillator::sCurveTableSquare[17] = { +DUSK_GAME_DATA f32 const JASOscillator::sCurveTableSquare[17] = { 1.0, 0.9682459831237793, 0.9354140162467957, 0.9013879895210266, 0.8660249710083008, 0.8291559815406799, 0.790569007396698, 0.75, 0.7071070075035095, 0.66143798828125, 0.6123719811439514, 0.55901700258255, 0.5, 0.433012992143631, 0.35355299711227417, 0.25, 0.0, diff --git a/libs/JSystem/src/JAudio2/JASProbe.cpp b/libs/JSystem/src/JAudio2/JASProbe.cpp index 55a63e67c8..70e930c2bb 100644 --- a/libs/JSystem/src/JAudio2/JASProbe.cpp +++ b/libs/JSystem/src/JAudio2/JASProbe.cpp @@ -26,7 +26,7 @@ void JASProbe::stop() { _1A8++; } -JASProbe* JASProbe::sProbeTable[16]; +DUSK_GAME_DATA JASProbe* JASProbe::sProbeTable[16]; void JASProbe::start(s32 index, char const* name) { JASProbe* probe; diff --git a/libs/JSystem/src/JAudio2/JASSeqCtrl.cpp b/libs/JSystem/src/JAudio2/JASSeqCtrl.cpp index a4e4a4b441..d9fe9d6698 100644 --- a/libs/JSystem/src/JAudio2/JASSeqCtrl.cpp +++ b/libs/JSystem/src/JAudio2/JASSeqCtrl.cpp @@ -4,7 +4,7 @@ #include "JSystem/JAudio2/JASSeqParser.h" #include "JSystem/JAudio2/JASTrack.h" -JASSeqParser JASSeqCtrl::sDefaultParser; +DUSK_GAME_DATA JASSeqParser JASSeqCtrl::sDefaultParser; JASSeqCtrl::JASSeqCtrl() { field_0x3c = &sDefaultParser; diff --git a/libs/JSystem/src/JAudio2/JASSeqParser.cpp b/libs/JSystem/src/JAudio2/JASSeqParser.cpp index b2077ce499..92288cbc4e 100644 --- a/libs/JSystem/src/JAudio2/JASSeqParser.cpp +++ b/libs/JSystem/src/JAudio2/JASSeqParser.cpp @@ -9,7 +9,7 @@ #include "JSystem/JUtility/JUTAssert.h" -JASSeqParser::CmdInfo JASSeqParser::sCmdInfo[96] = { +DUSK_GAME_DATA JASSeqParser::CmdInfo JASSeqParser::sCmdInfo[96] = { NULL, 0x0000, 0x0000, NULL, 0x0000, 0x0000, NULL, 0x0000, 0x0000, @@ -108,7 +108,7 @@ JASSeqParser::CmdInfo JASSeqParser::sCmdInfo[96] = { &JASSeqParser::cmdFinish, 0x0000, 0x0000, }; -JASSeqParser::CmdInfo JASSeqParser::sExtCmdInfo[255] = { +DUSK_GAME_DATA JASSeqParser::CmdInfo JASSeqParser::sExtCmdInfo[255] = { NULL, 0x0000, 0x0000, &JASSeqParser::cmdDump, 0x0000, 0x0000, NULL, 0x0000, 0x0000, @@ -589,7 +589,7 @@ s32 JASSeqParser::cmdIntTimer(JASTrack* param_0, u32* param_1) { return 0; } -u16 (*JASSeqParser::sCallBackFunc)(JASTrack*, u16); +DUSK_GAME_DATA u16 (*JASSeqParser::sCallBackFunc)(JASTrack*, u16); s32 JASSeqParser::cmdSyncCPU(JASTrack* param_0, u32* param_1) { u16 r31 = 0xffff; diff --git a/libs/JSystem/src/JAudio2/JASTrack.cpp b/libs/JSystem/src/JAudio2/JASTrack.cpp index 68fbee63e5..4b1a7ba7aa 100644 --- a/libs/JSystem/src/JAudio2/JASTrack.cpp +++ b/libs/JSystem/src/JAudio2/JASTrack.cpp @@ -15,9 +15,9 @@ JASTrack::JASTrack() : mDefaultChannelMgr(this), mChannelMgrCount(1), mStatus(0) init(); } -JASDefaultBankTable JASTrack::sDefaultBankTable; +DUSK_GAME_DATA JASDefaultBankTable JASTrack::sDefaultBankTable; -JASTrack::TList JASTrack::sTrackList; +DUSK_GAME_DATA JASTrack::TList JASTrack::sTrackList; // NONMATCHING JASPoolAllocObject_MultiThreaded<_> locations JASTrack::~JASTrack() { @@ -50,16 +50,16 @@ void JASTrack::setChannelMgrCount(u32 count) { } } -JASOscillator::Point const JASTrack::sAdsTable[4] = { +DUSK_GAME_DATA JASOscillator::Point const JASTrack::sAdsTable[4] = { {0, 0, 0x7fff}, {0, 0, 0x7fff}, {0, 0, 0}, {0xe, 0, 0}, }; -JASOscillator::Data const JASTrack::sEnvOsc = {0, 1.0f, NULL, NULL, 1.0f, 0.0f}; +DUSK_GAME_DATA JASOscillator::Data const JASTrack::sEnvOsc = {0, 1.0f, NULL, NULL, 1.0f, 0.0f}; -JASOscillator::Data const JASTrack::sPitchEnvOsc = {1, 1.0f, NULL, NULL, 1.0f, 0.0f}; +DUSK_GAME_DATA JASOscillator::Data const JASTrack::sPitchEnvOsc = {1, 1.0f, NULL, NULL, 1.0f, 0.0f}; // NONMATCHING JASPoolAllocObject_MultiThreaded<_> locations void JASTrack::init() { @@ -552,7 +552,7 @@ void JASTrack::setOscAdsr(s16 param_0, s16 param_1, s16 param_2, s16 param_3, u1 mDirectRelease = i_directRelease; } -const u32 JASDsp::FILTER_MODE_IIR = 0x00000020; +DUSK_GAME_DATA const u32 JASDsp::FILTER_MODE_IIR = 0x00000020; void JASTrack::setFIR(s16 const* i_FIR) { for (int i = 0; i < 8; i++) { diff --git a/libs/JSystem/src/JAudio2/JASVoiceBank.cpp b/libs/JSystem/src/JAudio2/JASVoiceBank.cpp index f69616a3af..0d3cd3adb2 100644 --- a/libs/JSystem/src/JAudio2/JASVoiceBank.cpp +++ b/libs/JSystem/src/JAudio2/JASVoiceBank.cpp @@ -3,11 +3,11 @@ #include "JSystem/JAudio2/JASVoiceBank.h" #include "JSystem/JAudio2/JASBasicInst.h" -const JASOscillator::Data JASVoiceBank::sOscData = { +DUSK_GAME_DATA const JASOscillator::Data JASVoiceBank::sOscData = { 0, 1.0f, NULL, NULL, 1.0f, 0.0f, }; -JASOscillator::Data* JASVoiceBank::sOscTable; +DUSK_GAME_DATA JASOscillator::Data* JASVoiceBank::sOscTable; bool JASVoiceBank::getInstParam(int param_0, int param_1, int param_2, JASInstParam* param_3) const { diff --git a/libs/JSystem/src/JAudio2/JASWSParser.cpp b/libs/JSystem/src/JAudio2/JASWSParser.cpp index 4288377548..519eaa3307 100644 --- a/libs/JSystem/src/JAudio2/JASWSParser.cpp +++ b/libs/JSystem/src/JAudio2/JASWSParser.cpp @@ -21,7 +21,7 @@ JASWaveBank* JASWSParser::createWaveBank(void const* stream, JKRHeap* heap) { } } -u32 JASWSParser::sUsedHeapSize; +DUSK_GAME_DATA u32 JASWSParser::sUsedHeapSize; JASBasicWaveBank* JASWSParser::createBasicWaveBank(void const* stream, JKRHeap* heap) { if (heap == NULL) { diff --git a/libs/JSystem/src/JAudio2/JASWaveArcLoader.cpp b/libs/JSystem/src/JAudio2/JASWaveArcLoader.cpp index d14ff70298..02730f46b4 100644 --- a/libs/JSystem/src/JAudio2/JASWaveArcLoader.cpp +++ b/libs/JSystem/src/JAudio2/JASWaveArcLoader.cpp @@ -9,7 +9,9 @@ #include #include -JASHeap* JASWaveArcLoader::sAramHeap; +#include "helpers/string.hpp" + +DUSK_GAME_DATA JASHeap* JASWaveArcLoader::sAramHeap; JASHeap* JASWaveArcLoader::getRootHeap() { if (JASWaveArcLoader::sAramHeap) { @@ -18,11 +20,11 @@ JASHeap* JASWaveArcLoader::getRootHeap() { return JASKernel::getAramHeap(); } -char JASWaveArcLoader::sCurrentDir[DIR_MAX] = "/AudioRes/Waves/"; +DUSK_GAME_DATA char JASWaveArcLoader::sCurrentDir[DIR_MAX] = "/AudioRes/Waves/"; void JASWaveArcLoader::setCurrentDir(char const* dir) { JUT_ASSERT(40, std::strlen(dir) < DIR_MAX - 1); - strcpy(sCurrentDir, dir); + SAFE_STRCPY(sCurrentDir, dir); u32 len = strlen(sCurrentDir); if (sCurrentDir[len - 1] != '/') { JUT_ASSERT(45, len + 1 < DIR_MAX); @@ -170,8 +172,8 @@ void JASWaveArc::setFileName(char const* fileName) { length = length + strlen(fileName); char* path = JKR_NEW_ARRAY_ARGS(char, length + 1, JASKernel::getSystemHeap(), -4); JUT_ASSERT(322, path); - strcpy(path, currentDir); - strcat(path, fileName); + SAFE_STRCPY_BOUNDED(path, length + 1, currentDir); + SAFE_STRCAT_BOUNDED(path, length + 1, fileName); path[length] = '\0'; int entryNum = DVDConvertPathToEntrynum(path); JKR_DELETE_ARRAY(path); diff --git a/libs/JSystem/src/JAudio2/osdsp_task.cpp b/libs/JSystem/src/JAudio2/osdsp_task.cpp index 7ec8f3f855..c7d24eaca8 100644 --- a/libs/JSystem/src/JAudio2/osdsp_task.cpp +++ b/libs/JSystem/src/JAudio2/osdsp_task.cpp @@ -5,8 +5,8 @@ #include #include -extern DSPTaskInfo* __DSP_first_task; -extern DSPTaskInfo* __DSP_curr_task; +DUSK_GAME_EXTERN DSPTaskInfo* __DSP_first_task; +DUSK_GAME_EXTERN DSPTaskInfo* __DSP_curr_task; extern "C" void __DSP_exec_task(DSPTaskInfo*, DSPTaskInfo*); extern "C" void __DSP_remove_task(DSPTaskInfo* task); diff --git a/libs/JSystem/src/JFramework/JFWDisplay.cpp b/libs/JSystem/src/JFramework/JFWDisplay.cpp index b8054e2130..99b1e63364 100644 --- a/libs/JSystem/src/JFramework/JFWDisplay.cpp +++ b/libs/JSystem/src/JFramework/JFWDisplay.cpp @@ -14,11 +14,12 @@ #ifdef TARGET_PC #include "dusk/dusk.h" -#include "dusk/gx_helper.h" +#include "dusk/frame_interpolation.h" #include "dusk/logging.h" #include "dusk/settings.h" #include "dusk/time.h" #include "f_op/f_op_overlap_mng.h" +#include "helpers/gx_helper.h" #include "SDL3/SDL_timer.h" #include "tracy/Tracy.hpp" @@ -65,7 +66,7 @@ JFWDisplay::~JFWDisplay() { mXfbManager = NULL; } -JFWDisplay* JFWDisplay::sManager; +DUSK_GAME_DATA JFWDisplay* JFWDisplay::sManager; JFWDisplay* JFWDisplay::createManager(GXRenderModeObj const* p_rObj, JKRHeap* p_heap, JUTXfb::EXfbNumber xfb_num, bool enableAlpha) { @@ -370,28 +371,28 @@ constexpr auto FRAME_PERIOD = std::chrono::duration_cast(sleepTime) / static_cast(targetNs)); - limiter.Sleep(targetNs); } #endif static void waitForTick(u32 p1, u16 p2) { #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) { - dusk::frameUsagePct = 0.f; - return; + static Limiter limiter; + + if (dusk::frame_interp::is_enabled() && !dusk::getTransientSettings().skipFrameRateLimit) { + dusk::frameUsagePct = 0.f; + return; } + if (dusk::getTransientSettings().skipFrameRateLimit) { p1 = OS_TIMER_CLOCK / 120; } - #if TARGET_PC if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) { return; } - #endif ZoneScopedC(tracy::Color::DimGray); #endif @@ -428,7 +429,7 @@ static void waitForTick(u32 p1, u16 p2) { } } -JSUList JFWAlarm::sList(false); +DUSK_GAME_DATA JSUList JFWAlarm::sList(false); static void JFWThreadAlarmHandler(OSAlarm* p_alarm, OSContext* p_ctx) { JFWAlarm* alarm = static_cast(p_alarm); alarm->removeLink(); diff --git a/libs/JSystem/src/JFramework/JFWSystem.cpp b/libs/JSystem/src/JFramework/JFWSystem.cpp index d6322f34c9..e0f9f58ef6 100644 --- a/libs/JSystem/src/JFramework/JFWSystem.cpp +++ b/libs/JSystem/src/JFramework/JFWSystem.cpp @@ -13,32 +13,32 @@ #include "JSystem/JUtility/JUTResFont.h" #include "JSystem/JUtility/JUTDbPrint.h" -s32 JFWSystem::CSetUpParam::maxStdHeaps = 2; +DUSK_GAME_DATA s32 JFWSystem::CSetUpParam::maxStdHeaps = 2; -u32 JFWSystem::CSetUpParam::sysHeapSize = 0x400000; +DUSK_GAME_DATA u32 JFWSystem::CSetUpParam::sysHeapSize = 0x400000; -JKRExpHeap* JFWSystem::rootHeap; +DUSK_GAME_DATA JKRExpHeap* JFWSystem::rootHeap; -JKRExpHeap* JFWSystem::systemHeap; +DUSK_GAME_DATA JKRExpHeap* JFWSystem::systemHeap; -u32 JFWSystem::CSetUpParam::fifoBufSize = 0x40000; +DUSK_GAME_DATA u32 JFWSystem::CSetUpParam::fifoBufSize = 0x40000; -u32 JFWSystem::CSetUpParam::aramAudioBufSize = 0x800000; +DUSK_GAME_DATA u32 JFWSystem::CSetUpParam::aramAudioBufSize = 0x800000; -u32 JFWSystem::CSetUpParam::aramGraphBufSize = 0x600000; +DUSK_GAME_DATA u32 JFWSystem::CSetUpParam::aramGraphBufSize = 0x600000; -s32 JFWSystem::CSetUpParam::streamPriority = 8; +DUSK_GAME_DATA s32 JFWSystem::CSetUpParam::streamPriority = 8; -s32 JFWSystem::CSetUpParam::decompPriority = 7; +DUSK_GAME_DATA s32 JFWSystem::CSetUpParam::decompPriority = 7; -s32 JFWSystem::CSetUpParam::aPiecePriority = 6; +DUSK_GAME_DATA s32 JFWSystem::CSetUpParam::aPiecePriority = 6; -ResFONT* JFWSystem::CSetUpParam::systemFontRes = (ResFONT*)&JUTResFONT_Ascfont_fix12; +DUSK_GAME_DATA ResFONT* JFWSystem::CSetUpParam::systemFontRes = (ResFONT*)&JUTResFONT_Ascfont_fix12; -const GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = &GXNtsc480IntDf; +DUSK_GAME_DATA const GXRenderModeObj* JFWSystem::CSetUpParam::renderMode = &GXNtsc480IntDf; -u32 JFWSystem::CSetUpParam::exConsoleBufferSize = 0x24FC; +DUSK_GAME_DATA u32 JFWSystem::CSetUpParam::exConsoleBufferSize = 0x24FC; void JFWSystem::firstInit() { JUT_ASSERT(80, rootHeap == NULL); @@ -49,17 +49,17 @@ void JFWSystem::firstInit() { JKRHEAP_NAME(systemHeap, "System"); } -JKRThread* JFWSystem::mainThread; +DUSK_GAME_DATA JKRThread* JFWSystem::mainThread; -JUTDbPrint* JFWSystem::debugPrint; +DUSK_GAME_DATA JUTDbPrint* JFWSystem::debugPrint; -JUTResFont* JFWSystem::systemFont; +DUSK_GAME_DATA JUTResFont* JFWSystem::systemFont; -JUTConsoleManager* JFWSystem::systemConsoleManager; +DUSK_GAME_DATA JUTConsoleManager* JFWSystem::systemConsoleManager; -JUTConsole* JFWSystem::systemConsole; +DUSK_GAME_DATA JUTConsole* JFWSystem::systemConsole; -bool JFWSystem::sInitCalled = false; +DUSK_GAME_DATA bool JFWSystem::sInitCalled = false; void JFWSystem::init() { JUT_ASSERT(101, sInitCalled == false); diff --git a/libs/JSystem/src/JHostIO/JHIMccBuf.cpp b/libs/JSystem/src/JHostIO/JHIMccBuf.cpp index 363eb23dd8..1f9df6be7b 100644 --- a/libs/JSystem/src/JHostIO/JHIMccBuf.cpp +++ b/libs/JSystem/src/JHostIO/JHIMccBuf.cpp @@ -14,8 +14,8 @@ void JHIReport(const char* fmt, ...) {} void JHIHalt(const char* fmt, ...) {} -u8* JHIMccBuf::mTempBuf; -u16 JHIMccBuf::mRefCount; +DUSK_GAME_DATA u8* JHIMccBuf::mTempBuf; +DUSK_GAME_DATA u16 JHIMccBuf::mRefCount; JHIMccBuf::JHIMccBuf(u16 channel, u16 param_1, u32 param_2) { initInstance(channel, param_1, param_2); diff --git a/libs/JSystem/src/JHostIO/JHIRMcc.cpp b/libs/JSystem/src/JHostIO/JHIRMcc.cpp index fc1b295181..f3892f6520 100644 --- a/libs/JSystem/src/JHostIO/JHIRMcc.cpp +++ b/libs/JSystem/src/JHostIO/JHIRMcc.cpp @@ -7,14 +7,14 @@ #include #endif -HIO2DeviceType gExiDevice = HIO2_DEVICE_INVALID; -u8 data_8074bd04 = 1; +DUSK_GAME_DATA HIO2DeviceType gExiDevice = HIO2_DEVICE_INVALID; +DUSK_GAME_DATA u8 data_8074bd04 = 1; -s32 ghHIO2; -JHIMccContext tContext_old; -JHIMccContext tContext_new; -bool data_8074d138; -u8 data_8074d139; +DUSK_GAME_DATA s32 ghHIO2; +DUSK_GAME_DATA JHIMccContext tContext_old; +DUSK_GAME_DATA JHIMccContext tContext_new; +DUSK_GAME_DATA bool data_8074d138; +DUSK_GAME_DATA u8 data_8074d139; BOOL JHIhio2CallbackEnum(HIO2DeviceType type) { gExiDevice = type; diff --git a/libs/JSystem/src/JHostIO/JHIhioASync.cpp b/libs/JSystem/src/JHostIO/JHIhioASync.cpp index b423c366fe..a25e5bd136 100644 --- a/libs/JSystem/src/JHostIO/JHIhioASync.cpp +++ b/libs/JSystem/src/JHostIO/JHIhioASync.cpp @@ -9,16 +9,16 @@ #endif #include "global.h" -u32 gsEnableHostio; -u32 gsEnableInterface; -u32 gsDataToRead; +DUSK_GAME_DATA u32 gsEnableHostio; +DUSK_GAME_DATA u32 gsEnableInterface; +DUSK_GAME_DATA u32 gsDataToRead; -u8* gsReadBuf; -u8* gsWriteBuf; -JHICommBufReader* gsJHIrecvBuf; -JHICommBufWriter* gsJHIsendBuf; +DUSK_GAME_DATA u8* gsReadBuf; +DUSK_GAME_DATA u8* gsWriteBuf; +DUSK_GAME_DATA JHICommBufReader* gsJHIrecvBuf; +DUSK_GAME_DATA JHICommBufWriter* gsJHIsendBuf; -JHIMccContext gMccContext; +DUSK_GAME_DATA JHIMccContext gMccContext; BOOL JHIInit(u32 enabled) { gsEnableHostio = enabled; diff --git a/libs/JSystem/src/JHostIO/JORServer.cpp b/libs/JSystem/src/JHostIO/JORServer.cpp index 62086b259c..cabcf10bb3 100644 --- a/libs/JSystem/src/JHostIO/JORServer.cpp +++ b/libs/JSystem/src/JHostIO/JORServer.cpp @@ -113,7 +113,7 @@ void JORReflexible::listenPropertyEvent(const JORPropertyEvent* pEvent) { } #endif -JORServer* JORServer::instance; +DUSK_GAME_DATA JORServer* JORServer::instance; JORServer* JORServer::create() { if (instance == NULL) { diff --git a/libs/JSystem/src/JKernel/JKRAram.cpp b/libs/JSystem/src/JKernel/JKRAram.cpp index 2770328afa..98829765bc 100644 --- a/libs/JSystem/src/JKernel/JKRAram.cpp +++ b/libs/JSystem/src/JKernel/JKRAram.cpp @@ -27,7 +27,7 @@ static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 u32 offset, u32* resourceSize); int decompSZS_subroutine(u8* src, u8* dest); -JKRAram* JKRAram::sAramObject; +DUSK_GAME_DATA JKRAram* JKRAram::sAramObject; JKRAram* JKRAram::create(u32 aram_audio_buffer_size, u32 aram_audio_graph_size, s32 stream_priority, s32 decomp_priority, s32 piece_priority) { @@ -48,14 +48,14 @@ void JKRAram::destroy() { } #endif -OSMessage JKRAram::sMessageBuffer[4] = { +DUSK_GAME_DATA OSMessage JKRAram::sMessageBuffer[4] = { NULL, NULL, NULL, NULL, }; -OSMessageQueue JKRAram::sMessageQueue = {0}; +DUSK_GAME_DATA OSMessageQueue JKRAram::sMessageQueue = {0}; JKRAram::JKRAram(u32 audio_buffer_size, u32 audio_graph_size, s32 priority) : JKRThread(stack_size, 0x10, priority) { @@ -279,11 +279,11 @@ u8* JKRAram::aramToMainRam(u32 address, u8* buf, u32 p3, JKRExpandSwitch expandS } } -JSUList JKRAram::sAramCommandList; +DUSK_GAME_DATA JSUList JKRAram::sAramCommandList; static OSMutex decompMutex; -u32 JKRAram::sSZSBufferSize = 0x00000400; +DUSK_GAME_DATA u32 JKRAram::sSZSBufferSize = 0x00000400; static u8* szpBuf; diff --git a/libs/JSystem/src/JKernel/JKRAramHeap.cpp b/libs/JSystem/src/JKernel/JKRAramHeap.cpp index 83e5cc9ac7..7b3406383b 100644 --- a/libs/JSystem/src/JKernel/JKRAramHeap.cpp +++ b/libs/JSystem/src/JKernel/JKRAramHeap.cpp @@ -6,7 +6,7 @@ #include #include "os_report.h" -JSUList JKRAramHeap::sAramList; +DUSK_GAME_DATA JSUList JKRAramHeap::sAramList; JKRAramHeap::JKRAramHeap(u32 startAddress, u32 size) { OSInitMutex(&mMutex); diff --git a/libs/JSystem/src/JKernel/JKRAramPiece.cpp b/libs/JSystem/src/JKernel/JKRAramPiece.cpp index 0946275b83..bfbabfd478 100644 --- a/libs/JSystem/src/JKernel/JKRAramPiece.cpp +++ b/libs/JSystem/src/JKernel/JKRAramPiece.cpp @@ -23,12 +23,12 @@ void JKRAramPiece::sendCommand(JKRAMCommand* command) { startDMA(command); } -JSUList JKRAramPiece::sAramPieceCommandList; +DUSK_GAME_DATA JSUList JKRAramPiece::sAramPieceCommandList; -OSMutex JKRAramPiece::mMutex; +DUSK_GAME_DATA OSMutex JKRAramPiece::mMutex; #if DEBUG && TARGET_PC -volatile u8 forceRead; +DUSK_GAME_DATA volatile u8 forceRead; #endif JKRAMCommand* JKRAramPiece::orderAsync(int direction, uintptr_t source, uintptr_t destination, u32 length, diff --git a/libs/JSystem/src/JKernel/JKRAramStream.cpp b/libs/JSystem/src/JKernel/JKRAramStream.cpp index a30f23dfaa..548a044571 100644 --- a/libs/JSystem/src/JKernel/JKRAramStream.cpp +++ b/libs/JSystem/src/JKernel/JKRAramStream.cpp @@ -12,7 +12,7 @@ const u32 stack_size = 0xc00; const u32 stack_size = 0x4000; #endif -JKRAramStream* JKRAramStream::sAramStreamObject; +DUSK_GAME_DATA JKRAramStream* JKRAramStream::sAramStreamObject; JKRAramStream* JKRAramStream::create(s32 priority) { if (!sAramStreamObject) { @@ -23,14 +23,14 @@ JKRAramStream* JKRAramStream::create(s32 priority) { return sAramStreamObject; } -void* JKRAramStream::sMessageBuffer[4] = { +DUSK_GAME_DATA void* JKRAramStream::sMessageBuffer[4] = { NULL, NULL, NULL, NULL, }; -OSMessageQueue JKRAramStream::sMessageQueue = {0}; +DUSK_GAME_DATA OSMessageQueue JKRAramStream::sMessageQueue = {0}; JKRAramStream::JKRAramStream(s32 priority) : JKRThread(stack_size, 0x10, priority) { resume(); @@ -141,11 +141,11 @@ s32 JKRAramStream::writeToAram(JKRAramStreamCommand* command) { return writtenLength; } -u8* JKRAramStream::transBuffer; +DUSK_GAME_DATA u8* JKRAramStream::transBuffer; -u32 JKRAramStream::transSize; +DUSK_GAME_DATA u32 JKRAramStream::transSize; -JKRHeap* JKRAramStream::transHeap; +DUSK_GAME_DATA JKRHeap* JKRAramStream::transHeap; JKRAramStreamCommand* JKRAramStream::write_StreamToAram_Async(JSUFileInputStream* stream, u32 addr, u32 size, u32 offset, diff --git a/libs/JSystem/src/JKernel/JKRArchivePri.cpp b/libs/JSystem/src/JKernel/JKRArchivePri.cpp index 9da4c2d1aa..a14ab763b0 100644 --- a/libs/JSystem/src/JKernel/JKRArchivePri.cpp +++ b/libs/JSystem/src/JKernel/JKRArchivePri.cpp @@ -9,7 +9,7 @@ #include #endif -u32 JKRArchive::sCurrentDirID; +DUSK_GAME_DATA u32 JKRArchive::sCurrentDirID; JKRArchive::JKRArchive() { mIsMounted = false; diff --git a/libs/JSystem/src/JKernel/JKRDecomp.cpp b/libs/JSystem/src/JKernel/JKRDecomp.cpp index a97edea0a3..2f8b9a68d7 100644 --- a/libs/JSystem/src/JKernel/JKRDecomp.cpp +++ b/libs/JSystem/src/JKernel/JKRDecomp.cpp @@ -10,7 +10,7 @@ const u32 stack_size = 0x800; const u32 stack_size = 0x4000; #endif -JKRDecomp* JKRDecomp::sDecompObject; +DUSK_GAME_DATA JKRDecomp* JKRDecomp::sDecompObject; JKRDecomp* JKRDecomp::create(s32 priority) { if (!sDecompObject) { @@ -29,9 +29,9 @@ void JKRDecomp::destroy() { } #endif -OSMessage JKRDecomp::sMessageBuffer[8] = {0}; +DUSK_GAME_DATA OSMessage JKRDecomp::sMessageBuffer[8] = {0}; -OSMessageQueue JKRDecomp::sMessageQueue = {0}; +DUSK_GAME_DATA OSMessageQueue JKRDecomp::sMessageQueue = {0}; JKRDecomp::JKRDecomp(s32 priority) : JKRThread(stack_size, 0x10, priority) { resume(); diff --git a/libs/JSystem/src/JKernel/JKRDvdAramRipper.cpp b/libs/JSystem/src/JKernel/JKRDvdAramRipper.cpp index 9472539e24..22f040b360 100644 --- a/libs/JSystem/src/JKernel/JKRDvdAramRipper.cpp +++ b/libs/JSystem/src/JKernel/JKRDvdAramRipper.cpp @@ -75,9 +75,9 @@ JKRADCommand* JKRDvdAramRipper::loadToAram_Async(JKRDvdFile* dvdFile, u32 addres return command; } -JSUList JKRDvdAramRipper::sDvdAramAsyncList; +DUSK_GAME_DATA JSUList JKRDvdAramRipper::sDvdAramAsyncList; -bool JKRDvdAramRipper::errorRetry = true; +DUSK_GAME_DATA bool JKRDvdAramRipper::errorRetry = true; JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) { s32 compression; @@ -228,7 +228,7 @@ JKRADCommand::~JKRADCommand() { static OSMutex decompMutex; -u32 JKRDvdAramRipper::sSZSBufferSize = 0x00000400; +DUSK_GAME_DATA u32 JKRDvdAramRipper::sSZSBufferSize = 0x00000400; static u8* szpBuf; diff --git a/libs/JSystem/src/JKernel/JKRDvdFile.cpp b/libs/JSystem/src/JKernel/JKRDvdFile.cpp index face6c824b..83f7d4d333 100644 --- a/libs/JSystem/src/JKernel/JKRDvdFile.cpp +++ b/libs/JSystem/src/JKernel/JKRDvdFile.cpp @@ -5,7 +5,7 @@ #include "JSystem/JUtility/JUTException.h" #include -JSUList JKRDvdFile::sDvdList; +DUSK_GAME_DATA JSUList JKRDvdFile::sDvdList; JKRDvdFile::JKRDvdFile() : mDvdLink(this) { initiate(); diff --git a/libs/JSystem/src/JKernel/JKRDvdRipper.cpp b/libs/JSystem/src/JKernel/JKRDvdRipper.cpp index ae65f42ba3..2c2d521b3a 100644 --- a/libs/JSystem/src/JKernel/JKRDvdRipper.cpp +++ b/libs/JSystem/src/JKernel/JKRDvdRipper.cpp @@ -44,7 +44,7 @@ void* JKRDvdRipper::loadToMainRAM(s32 entryNumber, u8* dst, JKRExpandSwitch expa pCompression, param_8); } -bool JKRDvdRipper::errorRetry = true; +DUSK_GAME_DATA bool JKRDvdRipper::errorRetry = true; void* JKRDvdRipper::loadToMainRAM(JKRDvdFile* dvdFile, u8* dst, JKRExpandSwitch expandSwitch, u32 dstLength, JKRHeap* heap, @@ -236,13 +236,13 @@ void* JKRDvdRipper::loadToMainRAM(JKRDvdFile* dvdFile, u8* dst, JKRExpandSwitch static u8 lit_491[12]; -JSUList JKRDvdRipper::sDvdAsyncList; +DUSK_GAME_DATA JSUList JKRDvdRipper::sDvdAsyncList; static OSMutex decompMutex; -u32 JKRDvdRipper::sSZSBufferSize = 0x00000400; +DUSK_GAME_DATA u32 JKRDvdRipper::sSZSBufferSize = 0x00000400; -JKRHeap* JKRDvdRipper::sHeap = NULL; +DUSK_GAME_DATA JKRHeap* JKRDvdRipper::sHeap = NULL; static u8* szpBuf; diff --git a/libs/JSystem/src/JKernel/JKRFileCache.cpp b/libs/JSystem/src/JKernel/JKRFileCache.cpp index 97b0d6fdde..a4795602c0 100644 --- a/libs/JSystem/src/JKernel/JKRFileCache.cpp +++ b/libs/JSystem/src/JKernel/JKRFileCache.cpp @@ -8,6 +8,7 @@ #include #include +#include "helpers/string.hpp" #include "global.h" JKRFileCache* JKRFileCache::mount(const char* path, JKRHeap* heap, const char* param_3) { diff --git a/libs/JSystem/src/JKernel/JKRFileLoader.cpp b/libs/JSystem/src/JKernel/JKRFileLoader.cpp index e0e531aaa9..0ff00f5f84 100644 --- a/libs/JSystem/src/JKernel/JKRFileLoader.cpp +++ b/libs/JSystem/src/JKernel/JKRFileLoader.cpp @@ -4,14 +4,15 @@ #define MSL_USE_INLINES 1 // needed to inline tolower call. not inlined elsewhere in the repo -#include #include +#include #include #include "JSystem/JKernel/JKRHeap.h" +#include "helpers/string.hpp" #include "global.h" -JKRFileLoader* JKRFileLoader::sCurrentVolume; -JSUList JKRFileLoader::sVolumeList; +DUSK_GAME_DATA JKRFileLoader* JKRFileLoader::sCurrentVolume; +DUSK_GAME_DATA JSUList JKRFileLoader::sVolumeList; JKRFileLoader::JKRFileLoader(void) : mFileLoaderLink(this), mVolumeName(NULL), mVolumeType(0), mMountCount(0) {} @@ -104,7 +105,7 @@ const char* JKRFileLoader::fetchVolumeName(char* buffer, s32 bufferSize, const c static char rootPath[2] = "/"; if (strcmp(path, "/") == 0) { - strcpy(buffer, rootPath); + SAFE_STRCPY_BOUNDED(buffer, bufferSize, rootPath); return rootPath; } diff --git a/libs/JSystem/src/JKernel/JKRHeap.cpp b/libs/JSystem/src/JKernel/JKRHeap.cpp index ce1899a4ba..3c329e0a43 100644 --- a/libs/JSystem/src/JKernel/JKRHeap.cpp +++ b/libs/JSystem/src/JKernel/JKRHeap.cpp @@ -15,7 +15,7 @@ #include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JUtility/JUTException.h" -#include "dusk/string.hpp" +#include "helpers/string.hpp" #ifdef __MWERKS__ #include #else @@ -28,14 +28,14 @@ #include "os_report.h" #if DEBUG -u8 JKRValue_DEBUGFILL_NOTUSE = 0xFD; -u8 JKRValue_DEBUGFILL_NEW = 0xCD; -u8 JKRValue_DEBUGFILL_DELETE = 0xDD; +DUSK_GAME_DATA u8 JKRValue_DEBUGFILL_NOTUSE = 0xFD; +DUSK_GAME_DATA u8 JKRValue_DEBUGFILL_NEW = 0xCD; +DUSK_GAME_DATA u8 JKRValue_DEBUGFILL_DELETE = 0xDD; #endif -bool JKRHeap::sDefaultFillFlag = true; +DUSK_GAME_DATA bool JKRHeap::sDefaultFillFlag = true; -JKRHeap* JKRHeap::sSystemHeap; +DUSK_GAME_DATA JKRHeap* JKRHeap::sSystemHeap; #if TARGET_PC // JSystem normally has a thread switch callback to track the correct heap. @@ -52,13 +52,13 @@ static thread_local TLS_GLOBAL_DYNAMIC JKRHeap* sCurrentHeap; JKRHeap* JKRHeap::sCurrentHeap; #endif -JKRHeap* JKRHeap::sRootHeap; +DUSK_GAME_DATA JKRHeap* JKRHeap::sRootHeap; #if PLATFORM_WII || PLATFORM_SHIELD JKRHeap* JKRHeap::sRootHeap2; #endif -JKRErrorHandler JKRHeap::mErrorHandler; +DUSK_GAME_DATA JKRErrorHandler JKRHeap::mErrorHandler; static bool data_80451380; @@ -111,19 +111,19 @@ JKRHeap::~JKRHeap() { } } -void* JKRHeap::mCodeStart; +DUSK_GAME_DATA void* JKRHeap::mCodeStart; -void* JKRHeap::mCodeEnd; +DUSK_GAME_DATA void* JKRHeap::mCodeEnd; -void* JKRHeap::mUserRamStart; +DUSK_GAME_DATA void* JKRHeap::mUserRamStart; -void* JKRHeap::mUserRamEnd; +DUSK_GAME_DATA void* JKRHeap::mUserRamEnd; -u32 JKRHeap::mMemorySize; +DUSK_GAME_DATA u32 JKRHeap::mMemorySize; -JKRHeap::JKRAllocCallback JKRHeap::sAllocCallback; +DUSK_GAME_DATA JKRHeap::JKRAllocCallback JKRHeap::sAllocCallback; -JKRHeap::JKRFreeCallback JKRHeap::sFreeCallback; +DUSK_GAME_DATA JKRHeap::JKRFreeCallback JKRHeap::sFreeCallback; bool JKRHeap::initArena(char** memory, u32* size, int maxHeaps) { void* arenaLo = OSGetArenaLo(); @@ -559,7 +559,7 @@ void* operator new(size_t size) { return JKRHeap::alloc(size, 4, NULL); } #else -void* operator new(size_t size JKR_HEAP_TOKEN_PARAM) { +void* operator new(size_t size JKR_HEAP_TOKEN_PARAM) noexcept { if (sCurrentHeap == NULL) { return fallback_alloc(size, 0, false); } @@ -576,7 +576,7 @@ void* operator new(size_t size, int alignment) { return JKRHeap::alloc(size, alignment, NULL); } #else -void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) { +void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) noexcept { void* mem = JKRHeap::alloc(size, alignment, nullptr); if (mem == nullptr) { return fallback_alloc(size, abs(alignment), true); @@ -585,7 +585,7 @@ void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) { } #endif -void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) { +void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) IF_DUSK(noexcept) { void* mem = JKRHeap::alloc(size, alignment, heap); #if TARGET_PC if (mem == nullptr) { @@ -600,7 +600,7 @@ void* operator new[](size_t size) { return JKRHeap::alloc(size, 4, NULL); } #else -void* operator new[](size_t JKR_HEAP_TOKEN_PARAM) { +void* operator new[](size_t JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept) { OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead"); } #endif @@ -610,12 +610,12 @@ void* operator new[](size_t size, int alignment) { return JKRHeap::alloc(size, alignment, NULL); } #else -void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, int) { +void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, int) IF_DUSK(noexcept) { OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead"); } #endif -void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, JKRHeap*, int) { +void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, JKRHeap*, int) IF_DUSK(noexcept) { OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead"); } @@ -624,7 +624,7 @@ void operator delete(void* ptr) { JKRHeap::free(ptr, NULL); } #else -void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM) { +void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept) { if (ptr == NULL) return; JKRHeap* heap = JKRHeap::findFromRoot(ptr); @@ -645,7 +645,7 @@ void operator delete[](void* ptr) { JKRHeap::free(ptr, NULL); } #else -void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) { +void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept) { if (ptr == NULL) return; JKRHeap* heap = JKRHeap::findFromRoot(ptr); @@ -661,8 +661,8 @@ void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) { } #endif -s32 fillcheck_dispcount = 100; -bool data_8074A8D0_debug = true; +DUSK_GAME_DATA s32 fillcheck_dispcount = 100; +DUSK_GAME_DATA bool data_8074A8D0_debug = true; void JKRHeap::state_register(JKRHeap::TState* p, u32 id) const { JUT_ASSERT(1213, p != NULL); @@ -680,7 +680,7 @@ void JKRHeap::state_dump(const JKRHeap::TState& p) const { JUT_LOG(1248, "used size : %u", p.getUsedSize()); } -void* ARALT_AramStartAdr = (void*)0x90000000; +DUSK_GAME_DATA void* ARALT_AramStartAdr = (void*)0x90000000; void* JKRHeap::getAltAramStartAdr() { return ARALT_AramStartAdr; } @@ -702,7 +702,7 @@ JKRHeap* JKRHeap::getCurrentHeap() { } void JKRHeap::setName(const char* name) { - dusk::SafeStringCopyTruncate(mName, name); + SafeStringCopyTruncate(mName, name); } void JKRHeap::setNamef(const char* fmt, ...) { diff --git a/libs/JSystem/src/JKernel/JKRThread.cpp b/libs/JSystem/src/JKernel/JKRThread.cpp index 31c2cbe6e5..73135381eb 100644 --- a/libs/JSystem/src/JKernel/JKRThread.cpp +++ b/libs/JSystem/src/JKernel/JKRThread.cpp @@ -7,23 +7,25 @@ #include "global.h" #include +#include "helpers/string.hpp" + #if TARGET_PC #include "dusk/os.h" #endif -JSUList JKRThread::sThreadList(0); +DUSK_GAME_DATA JSUList JKRThread::sThreadList(0); -void* JKRIdleThread::sThread; +DUSK_GAME_DATA void* JKRIdleThread::sThread; -JKRThreadSwitch* JKRThreadSwitch::sManager; +DUSK_GAME_DATA JKRThreadSwitch* JKRThreadSwitch::sManager; -u32 JKRThreadSwitch::sTotalCount; +DUSK_GAME_DATA u32 JKRThreadSwitch::sTotalCount; -u64 JKRThreadSwitch::sTotalStart; +DUSK_GAME_DATA u64 JKRThreadSwitch::sTotalStart; -JKRThreadSwitch_PreCallback JKRThreadSwitch::mUserPreCallback; +DUSK_GAME_DATA JKRThreadSwitch_PreCallback JKRThreadSwitch::mUserPreCallback; -JKRThreadSwitch_PostCallback JKRThreadSwitch::mUserPostCallback; +DUSK_GAME_DATA JKRThreadSwitch_PostCallback JKRThreadSwitch::mUserPostCallback; JKRThread::JKRThread(u32 stack_size, int message_count, int param_3) : mThreadListLink(this) { JKRHeap* heap = JKRHeap::findFromRoot(this); @@ -274,7 +276,7 @@ void JKRThreadSwitch::draw(JKRThreadName_* thread_name_list, JUTConsole* console if (!thread_print_name) { char buffer[16]; - sprintf(buffer, "%d", loadInfo->getId()); + SAFE_SPRINTF(buffer, "%d", loadInfo->getId()); thread_print_name = buffer; } @@ -356,10 +358,10 @@ static void dummy(JKRIdleThread* thread) { #pragma push #pragma force_active on -JSUList JKRTask::sTaskList; +DUSK_GAME_DATA JSUList JKRTask::sTaskList; #pragma pop #pragma push #pragma force_active on -u8 JKRTask::sEndMesgQueue[32]; +DUSK_GAME_DATA u8 JKRTask::sEndMesgQueue[32]; #pragma pop diff --git a/libs/JSystem/src/JMath/JMATrigonometric.cpp b/libs/JSystem/src/JMath/JMATrigonometric.cpp index 5d394ac9c2..8ebdb57ebc 100644 --- a/libs/JSystem/src/JMath/JMATrigonometric.cpp +++ b/libs/JSystem/src/JMath/JMATrigonometric.cpp @@ -16,10 +16,10 @@ inline f64 getConst2() { return 9.765625E-4; } -TSinCosTable<13, f32> sincosTable_ ATTRIBUTE_ALIGN(32); +DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_ ATTRIBUTE_ALIGN(32); -TAtanTable<1024, f32> atanTable_ ATTRIBUTE_ALIGN(32); +DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_ ATTRIBUTE_ALIGN(32); -TAsinAcosTable<1024, f32> asinAcosTable_ ATTRIBUTE_ALIGN(32); +DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_ ATTRIBUTE_ALIGN(32); } // namespace JMath diff --git a/libs/JSystem/src/JMessage/data.cpp b/libs/JSystem/src/JMessage/data.cpp index 29c96c18c7..4ff9919594 100644 --- a/libs/JSystem/src/JMessage/data.cpp +++ b/libs/JSystem/src/JMessage/data.cpp @@ -2,6 +2,6 @@ #include "JSystem/JMessage/data.h" -const BE(u32) JMessage::data::ga4cSignature = 'MESG'; +DUSK_GAME_DATA const BE(u32) JMessage::data::ga4cSignature = 'MESG'; -const BE(u32) JMessage::data::ga4cSignature_color = 'MGCL'; +DUSK_GAME_DATA const BE(u32) JMessage::data::ga4cSignature_color = 'MGCL'; diff --git a/libs/JSystem/src/JMessage/resource.cpp b/libs/JSystem/src/JMessage/resource.cpp index 4e48701c11..fc8d011af7 100644 --- a/libs/JSystem/src/JMessage/resource.cpp +++ b/libs/JSystem/src/JMessage/resource.cpp @@ -89,7 +89,7 @@ u16 JMessage::TResource::toMessageIndex_messageID(u32 uMsgID, u32 upperHalf, boo return nIndex; } -JMessage::locale::parseCharacter_function JMessage::TResourceContainer::sapfnParseCharacter_[5] = { +DUSK_GAME_DATA JMessage::locale::parseCharacter_function JMessage::TResourceContainer::sapfnParseCharacter_[5] = { NULL, JMessage::locale::parseCharacter_1Byte, JMessage::locale::parseCharacter_2Byte, diff --git a/libs/JSystem/src/JParticle/JPABaseShape.cpp b/libs/JSystem/src/JParticle/JPABaseShape.cpp index ff346984cd..c47d978b00 100644 --- a/libs/JSystem/src/JParticle/JPABaseShape.cpp +++ b/libs/JSystem/src/JParticle/JPABaseShape.cpp @@ -14,6 +14,33 @@ #endif #include "tracy/Tracy.hpp" +#if TARGET_PC +#define JPA_DRAW_CTX_PARAM , ParticleDrawCtx* ctx + +namespace { +GXColor emitter_prm_color(JPAEmitterWorkData* work) { + JPABaseEmitter* emtr = work->mpEmtr; + GXColor prm = emtr->mPrmClr; + prm.r = COLOR_MULTI(prm.r, emtr->mGlobalPrmClr.r); + prm.g = COLOR_MULTI(prm.g, emtr->mGlobalPrmClr.g); + prm.b = COLOR_MULTI(prm.b, emtr->mGlobalPrmClr.b); + prm.a = COLOR_MULTI(prm.a, emtr->mGlobalPrmClr.a); + return prm; +} + +GXColor emitter_env_color(JPAEmitterWorkData* work) { + JPABaseEmitter* emtr = work->mpEmtr; + GXColor env = emtr->mEnvClr; + env.r = COLOR_MULTI(env.r, emtr->mGlobalEnvClr.r); + env.g = COLOR_MULTI(env.g, emtr->mGlobalEnvClr.g); + env.b = COLOR_MULTI(env.b, emtr->mGlobalEnvClr.b); + return env; +} +} // namespace +#else +#define JPA_DRAW_CTX_PARAM +#endif + void JPASetPointSize(JPAEmitterWorkData* work) { GXSetPointSize((u8)(25.0f * work->mGlobalPtclScl.x), GX_TO_ONE); } @@ -22,15 +49,16 @@ void JPASetLineWidth(JPAEmitterWorkData* work) { GXSetLineWidth((u8)(25.0f * work->mGlobalPtclScl.x), GX_TO_ONE); } -void JPASetPointSize(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPASetPointSize(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { GXSetPointSize((u8)(ptcl->mParticleScaleX * (25.0f * work->mGlobalPtclScl.x)), GX_TO_ONE); } -void JPASetLineWidth(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPASetLineWidth(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { GXSetLineWidth((u8)(ptcl->mParticleScaleX * (25.0f * work->mGlobalPtclScl.x)), GX_TO_ONE); } void JPARegistPrm(JPAEmitterWorkData* work) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor prm = emtr->mPrmClr; prm.r = COLOR_MULTI(prm.r, emtr->mGlobalPrmClr.r); @@ -41,6 +69,7 @@ void JPARegistPrm(JPAEmitterWorkData* work) { } void JPARegistEnv(JPAEmitterWorkData* work) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor env = emtr->mEnvClr; env.r = COLOR_MULTI(env.r, emtr->mGlobalEnvClr.r); @@ -50,6 +79,7 @@ void JPARegistEnv(JPAEmitterWorkData* work) { } void JPARegistPrmEnv(JPAEmitterWorkData* work) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor prm = emtr->mPrmClr; GXColor env = emtr->mEnvClr; @@ -64,7 +94,8 @@ void JPARegistPrmEnv(JPAEmitterWorkData* work) { GXSetTevColor(GX_TEVREG1, env); } -void JPARegistAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPARegistAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor prm = emtr->mPrmClr; prm.r = COLOR_MULTI(prm.r, emtr->mGlobalPrmClr.r); @@ -72,10 +103,20 @@ void JPARegistAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { prm.b = COLOR_MULTI(prm.b, emtr->mGlobalPrmClr.b); prm.a = COLOR_MULTI(prm.a, emtr->mGlobalPrmClr.a); prm.a = COLOR_MULTI(prm.a, ptcl->mPrmColorAlphaAnm); +#if TARGET_PC + if (ctx->batch) { + ctx->clr0 = prm; + if (ctx->useClr1) { + ctx->clr1 = emitter_env_color(work); + } + return; + } +#endif GXSetTevColor(GX_TEVREG0, prm); } -void JPARegistPrmAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPARegistPrmAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor prm = ptcl->mPrmClr; prm.r = COLOR_MULTI(prm.r, emtr->mGlobalPrmClr.r); @@ -83,10 +124,20 @@ void JPARegistPrmAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { prm.b = COLOR_MULTI(prm.b, emtr->mGlobalPrmClr.b); prm.a = COLOR_MULTI(prm.a, emtr->mGlobalPrmClr.a); prm.a = COLOR_MULTI(prm.a, ptcl->mPrmColorAlphaAnm); +#if TARGET_PC + if (ctx->batch) { + ctx->clr0 = prm; + if (ctx->useClr1) { + ctx->clr1 = emitter_env_color(work); + } + return; + } +#endif GXSetTevColor(GX_TEVREG0, prm); } -void JPARegistPrmAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPARegistPrmAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor prm = ptcl->mPrmClr; GXColor env = ptcl->mEnvClr; @@ -98,11 +149,19 @@ void JPARegistPrmAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { env.r = COLOR_MULTI(env.r, emtr->mGlobalEnvClr.r); env.g = COLOR_MULTI(env.g, emtr->mGlobalEnvClr.g); env.b = COLOR_MULTI(env.b, emtr->mGlobalEnvClr.b); +#if TARGET_PC + if (ctx->batch) { + ctx->clr0 = prm; + ctx->clr1 = env; + return; + } +#endif GXSetTevColor(GX_TEVREG0, prm); GXSetTevColor(GX_TEVREG1, env); } -void JPARegistAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPARegistAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor prm = emtr->mPrmClr; GXColor env = ptcl->mEnvClr; @@ -114,16 +173,31 @@ void JPARegistAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { env.r = COLOR_MULTI(env.r, emtr->mGlobalEnvClr.r); env.g = COLOR_MULTI(env.g, emtr->mGlobalEnvClr.g); env.b = COLOR_MULTI(env.b, emtr->mGlobalEnvClr.b); +#if TARGET_PC + if (ctx->batch) { + ctx->clr0 = prm; + ctx->clr1 = env; + return; + } +#endif GXSetTevColor(GX_TEVREG0, prm); GXSetTevColor(GX_TEVREG1, env); } -void JPARegistEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPARegistEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { + ZoneScoped; JPABaseEmitter* emtr = work->mpEmtr; GXColor env = ptcl->mEnvClr; env.r = COLOR_MULTI(env.r, emtr->mGlobalEnvClr.r); env.g = COLOR_MULTI(env.g, emtr->mGlobalEnvClr.g); env.b = COLOR_MULTI(env.b, emtr->mGlobalEnvClr.b); +#if TARGET_PC + if (ctx->batch) { + ctx->clr0 = emitter_prm_color(work); + ctx->clr1 = env; + return; + } +#endif GXSetTevColor(GX_TEVREG1, env); } @@ -225,6 +299,7 @@ void JPAGenTexCrdMtxPrj(JPAEmitterWorkData* param_0) { } void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData* work) { + ZoneScoped; JPABaseShape* shape = work->mpRes->getBsp(); f32 dVar16 = work->mpEmtr->mTick; f32 dVar15 = 0.5f * (1.0f + shape->getTilingS()); @@ -255,7 +330,8 @@ void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData* work) { GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX0); } -void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData* work, JPABaseParticle* param_1) { +void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData* work, JPABaseParticle* param_1 JPA_DRAW_CTX_PARAM) { + ZoneScoped; JPABaseShape* shape = work->mpRes->getBsp(); f32 dVar16 = param_1->mAge; f32 dVar15 = 0.5f * (1.0f + shape->getTilingS()); @@ -282,18 +358,27 @@ void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData* work, JPABaseParticle* param_1) local_108[2][1] = 0.0f; local_108[2][2] = 1.0f; local_108[2][3] = 0.0f; +#if TARGET_PC + if (ctx->batch) { + MTXCopy(local_108, ctx->texMtx); + return; + } +#endif GXLoadTexMtxImm(local_108, 0x1e, GX_MTX2x4); } void JPALoadTex(JPAEmitterWorkData* work) { + ZoneScoped; work->mpResMgr->load(work->mpRes->getTexIdx(work->mpRes->getBsp()->getTexIdx()), GX_TEXMAP0); } void JPALoadTexAnm(JPAEmitterWorkData* work) { + ZoneScoped; work->mpResMgr->load(work->mpRes->getTexIdx(work->mpEmtr->mTexAnmIdx), GX_TEXMAP0); } -void JPALoadTexAnm(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPALoadTexAnm(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { + ZoneScoped; work->mpResMgr->load(work->mpRes->getTexIdx(ptcl->mTexAnmIdx), GX_TEXMAP0); } @@ -422,6 +507,47 @@ static projectionFunc p_prj[3] = { }; #if TARGET_PC +static void emit_batch_quad(JPAEmitterWorkData* work, const ParticleDrawCtx* ctx, + const Mtx posMtx) { + const JPAResource::BatchInfo& info = work->mpRes->mBatchInfo; + + for (int i = 0; i < info.vtxCount; i++) { + Vec localPos = {info.vtxPos[i][0], info.vtxPos[i][1], info.vtxPos[i][2]}; + Vec drawPos; + MTXMultVec(posMtx, &localPos, &drawPos); + + f32 texS = info.vtxUv[i][0]; + f32 texT = info.vtxUv[i][1]; + if (ctx->useTexMtx) { + f32 srcS = texS; + f32 srcT = texT; + texS = ctx->texMtx[0][0] * srcS + ctx->texMtx[0][1] * srcT + ctx->texMtx[0][3]; + texT = ctx->texMtx[1][0] * srcS + ctx->texMtx[1][1] * srcT + ctx->texMtx[1][3]; + } + + GXPosition3f32(drawPos.x, drawPos.y, drawPos.z); + if (ctx->useClr0) { + GXColor4u8(ctx->clr0.r, ctx->clr0.g, ctx->clr0.b, ctx->clr0.a); + } + if (ctx->useClr1) { + GXColor4u8(ctx->clr1.r, ctx->clr1.g, ctx->clr1.b, ctx->clr1.a); + } + GXTexCoord2f32(texS, texT); + } +} + +static void submit_particle_quad( + JPAEmitterWorkData* work, ParticleDrawCtx* ctx, const Mtx posMtx, const u8* dl, u32 dlSize) { + if (ctx->batch) { + emit_batch_quad(work, ctx, posMtx); + return; + } + + GXLoadPosMtxImm(posMtx, GX_PNMTX0); + p_prj[work->mPrjType](work, posMtx); + GXCallDisplayList(dl, dlSize); +} + void JPAInterpBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { Mtx ptclPosMtx; MTXTrans(ptclPosMtx, ptcl->mPosition.x, ptcl->mPosition.y, ptcl->mPosition.z); @@ -441,11 +567,12 @@ void JPAInterpRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { } #endif -void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { if (ptcl->checkStatus(JPAPtclStts_Invisible)) { return; } + ZoneScoped; JGeometry::TVec3 pos; #if TARGET_PC Mtx ptclPosMtx; @@ -465,16 +592,21 @@ void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { posMtx[2][2] = 1.0f; posMtx[2][3] = pos.z; posMtx[0][1] = posMtx[0][2] = posMtx[1][0] = posMtx[1][2] = posMtx[2][0] = posMtx[2][1] = 0.0f; +#if TARGET_PC + submit_particle_quad(work, ctx, posMtx, jpa_dl, sizeof(jpa_dl)); +#else GXLoadPosMtxImm(posMtx, GX_PNMTX0); p_prj[work->mPrjType](work, posMtx); GXCallDisplayList(jpa_dl, sizeof(jpa_dl)); +#endif } -void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { if (ptcl->checkStatus(JPAPtclStts_Invisible)) { return; } + ZoneScoped; if (work->mpRes->getUsrIdx() == 0x89d7) { int a = 0; } @@ -508,16 +640,21 @@ void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { posMtx[2][2] = 1.0f; posMtx[2][3] = pos.z; posMtx[0][2] = posMtx[1][2] = posMtx[2][0] = posMtx[2][1] = 0.0f; +#if TARGET_PC + submit_particle_quad(work, ctx, posMtx, jpa_dl, sizeof(jpa_dl)); +#else GXLoadPosMtxImm(posMtx, GX_PNMTX0); p_prj[work->mPrjType](work, posMtx); GXCallDisplayList(jpa_dl, sizeof(jpa_dl)); +#endif } -void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) { +void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1 JPA_DRAW_CTX_PARAM) { if (param_1->checkStatus(JPAPtclStts_Invisible)) { return; } + ZoneScoped; JGeometry::TVec3 local_48; MTXMultVec(work->mPosCamMtx, ¶m_1->mPosition, &local_48); Mtx local_38; @@ -532,16 +669,21 @@ void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) { local_38[2][2] = work->mYBBCamMtx[2][2]; local_38[2][3] = local_48.z; local_38[0][1] = local_38[0][2] = local_38[1][0] = local_38[2][0] = 0.0f; +#if TARGET_PC + submit_particle_quad(work, ctx, local_38, jpa_dl, sizeof(jpa_dl)); +#else GXLoadPosMtxImm(local_38, GX_PNMTX0); p_prj[work->mPrjType](work, local_38); GXCallDisplayList(jpa_dl, sizeof(jpa_dl)); +#endif } -void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) { +void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1 JPA_DRAW_CTX_PARAM) { if (param_1->checkStatus(JPAPtclStts_Invisible)) { return; } + ZoneScoped; JGeometry::TVec3 local_48; MTXMultVec(work->mPosCamMtx, ¶m_1->mPosition, &local_48); f32 sinRot = JMASSin(param_1->mRotateAngle); @@ -565,9 +707,13 @@ void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) { local_38[2][1] = local_94 * fVar1; local_38[2][2] = local_90; local_38[2][3] = local_48.z; +#if TARGET_PC + submit_particle_quad(work, ctx, local_38, jpa_dl, sizeof(jpa_dl)); +#else GXLoadPosMtxImm(local_38, GX_PNMTX0); p_prj[work->mPrjType](work, local_38); GXCallDisplayList(jpa_dl, sizeof(jpa_dl)); +#endif } void dirTypeVel(JPAEmitterWorkData const* work, JPABaseParticle const* param_1, @@ -730,6 +876,88 @@ static u8* p_dl[2] = { }; #if TARGET_PC +static bool make_direction_mtx(JPAEmitterWorkData* work, JPABaseParticle* ptcl, Mtx posMtx) { + JGeometry::TVec3 axisY; + JGeometry::TVec3 axisZ; + JGeometry::TVec3 baseAxis(ptcl->mBaseAxis); + p_direction[work->mDirType](work, ptcl, &axisY); + if (axisY.isZero()) { + return false; + } + + axisY.normalize(); + axisZ.cross(baseAxis, axisY); + if (axisZ.isZero()) { + return false; + } + + axisZ.normalize(); + baseAxis.cross(axisY, axisZ); + baseAxis.normalize(); + ptcl->mBaseAxis.set(baseAxis); + + f32 scaleX = work->mGlobalPtclScl.x * ptcl->mParticleScaleX; + f32 scaleY = work->mGlobalPtclScl.y * ptcl->mParticleScaleY; + posMtx[0][0] = baseAxis.x; + posMtx[0][1] = axisY.x; + posMtx[0][2] = axisZ.x; + posMtx[0][3] = ptcl->mPosition.x; + posMtx[1][0] = baseAxis.y; + posMtx[1][1] = axisY.y; + posMtx[1][2] = axisZ.y; + posMtx[1][3] = ptcl->mPosition.y; + posMtx[2][0] = baseAxis.z; + posMtx[2][1] = axisY.z; + posMtx[2][2] = axisZ.z; + posMtx[2][3] = ptcl->mPosition.z; + p_plane[work->mPlaneType](posMtx, scaleX, scaleY); + return true; +} + +static bool make_rot_direction_mtx(JPAEmitterWorkData* work, JPABaseParticle* ptcl, Mtx posMtx) { + f32 sinRot = JMASSin(ptcl->mRotateAngle); + f32 cosRot = JMASCos(ptcl->mRotateAngle); + JGeometry::TVec3 axisY; + JGeometry::TVec3 axisZ; + JGeometry::TVec3 baseAxis(ptcl->mBaseAxis); + p_direction[work->mDirType](work, ptcl, &axisY); + if (axisY.isZero()) { + return false; + } + + axisY.normalize(); + axisZ.cross(baseAxis, axisY); + if (axisZ.isZero()) { + return false; + } + + axisZ.normalize(); + baseAxis.cross(axisY, axisZ); + baseAxis.normalize(); + ptcl->mBaseAxis.set(baseAxis); + + f32 scaleX = work->mGlobalPtclScl.x * ptcl->mParticleScaleX; + f32 scaleY = work->mGlobalPtclScl.y * ptcl->mParticleScaleY; + Mtx rotMtx; + Mtx dirMtx; + p_rot[work->mRotType](sinRot, cosRot, rotMtx); + p_plane[work->mPlaneType](rotMtx, scaleX, scaleY); + dirMtx[0][0] = baseAxis.x; + dirMtx[0][1] = axisY.x; + dirMtx[0][2] = axisZ.x; + dirMtx[0][3] = ptcl->mPosition.x; + dirMtx[1][0] = baseAxis.y; + dirMtx[1][1] = axisY.y; + dirMtx[1][2] = axisZ.y; + dirMtx[1][3] = ptcl->mPosition.y; + dirMtx[2][0] = baseAxis.z; + dirMtx[2][1] = axisY.z; + dirMtx[2][2] = axisZ.z; + dirMtx[2][3] = ptcl->mPosition.z; + MTXConcat(dirMtx, rotMtx, posMtx); + return true; +} + void JPAInterpDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { JGeometry::TVec3 axisY; JGeometry::TVec3 axisZ; @@ -812,7 +1040,7 @@ void JPAInterpRotDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { } #endif -void JPADrawDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPADrawDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { if (ptcl->checkStatus(JPAPtclStts_Invisible)) { return; } @@ -821,8 +1049,12 @@ void JPADrawDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { Mtx posMtx; #if TARGET_PC - if (!dusk::frame_interp::lookup_replacement(ptcl, posMtx)) -#endif + if (!dusk::frame_interp::lookup_replacement(ptcl, posMtx) && + !make_direction_mtx(work, ptcl, posMtx)) + { + return; + } +#else { JGeometry::TVec3 axisY; JGeometry::TVec3 axisZ; @@ -858,14 +1090,19 @@ void JPADrawDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { posMtx[2][3] = ptcl->mPosition.z; p_plane[work->mPlaneType](posMtx, scaleX, scaleY); } +#endif MTXConcat(work->mPosCamMtx, posMtx, posMtx); +#if TARGET_PC + submit_particle_quad(work, ctx, posMtx, p_dl[work->mDLType], sizeof(jpa_dl)); +#else GXLoadPosMtxImm(posMtx, GX_PNMTX0); p_prj[work->mPrjType](work, posMtx); GXCallDisplayList(p_dl[work->mDLType], sizeof(jpa_dl)); +#endif } -void JPADrawRotDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPADrawRotDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { if (ptcl->checkStatus(JPAPtclStts_Invisible)) { return; } @@ -875,8 +1112,12 @@ void JPADrawRotDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { Mtx mtx1; Mtx mtx2; #if TARGET_PC - if (!dusk::frame_interp::lookup_replacement(ptcl, mtx1)) -#endif + if (!dusk::frame_interp::lookup_replacement(ptcl, mtx1) && + !make_rot_direction_mtx(work, ptcl, mtx1)) + { + return; + } +#else { f32 sinRot = JMASSin(ptcl->mRotateAngle); f32 cosRot = JMASCos(ptcl->mRotateAngle); @@ -916,13 +1157,18 @@ void JPADrawRotDirection(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { mtx2[2][3] = ptcl->mPosition.z; MTXConcat(mtx2, mtx1, mtx1); } +#endif MTXConcat(work->mPosCamMtx, mtx1, mtx2); +#if TARGET_PC + submit_particle_quad(work, ctx, mtx2, p_dl[work->mDLType], sizeof(jpa_dl)); +#else GXLoadPosMtxImm(mtx2, GX_PNMTX0); p_prj[work->mPrjType](work, mtx2); GXCallDisplayList(p_dl[work->mDLType], sizeof(jpa_dl)); +#endif } -void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) { +void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1 JPA_DRAW_CTX_PARAM) { if (param_1->checkStatus(JPAPtclStts_Invisible)) { return; } @@ -959,7 +1205,7 @@ void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) { GXCallDisplayList(jpa_dl, sizeof(jpa_dl)); } -void JPADrawRotation(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) { +void JPADrawRotation(JPAEmitterWorkData* param_0, JPABaseParticle* param_1 JPA_DRAW_CTX_PARAM) { if (param_1->checkStatus(JPAPtclStts_Invisible)) { return; } @@ -977,12 +1223,16 @@ void JPADrawRotation(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) { auStack_88[1][3] = param_1->mPosition.y; auStack_88[2][3] = param_1->mPosition.z; MTXConcat(param_0->mPosCamMtx, auStack_88, auStack_88); +#if TARGET_PC + submit_particle_quad(param_0, ctx, auStack_88, p_dl[param_0->mDLType], sizeof(jpa_dl)); +#else GXLoadPosMtxImm(auStack_88, 0); p_prj[param_0->mPrjType](param_0, auStack_88); GXCallDisplayList(p_dl[param_0->mDLType], sizeof(jpa_dl)); +#endif } -void JPADrawPoint(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPADrawPoint(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { if (ptcl->checkStatus(JPAPtclStts_Invisible)) { return; } @@ -999,7 +1249,7 @@ void JPADrawPoint(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8); } -void JPADrawLine(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) { +void JPADrawLine(JPAEmitterWorkData* param_0, JPABaseParticle* param_1 JPA_DRAW_CTX_PARAM) { if (param_1->checkStatus(JPAPtclStts_Invisible)) { return; } @@ -1075,7 +1325,7 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) { GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT1, ptcl_num << 1); - for (JPANode* node = startNode; node != param_0->mpAlivePtcl->getEnd(); + for (JPANode* node = startNode; node != param_0->mpAlivePtcl->getEnd(); node = node_func(node), coord += step) { param_0->mpCurNode = node; JPABaseParticle* particle = node->getObject(); @@ -1100,7 +1350,7 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) { } particle->mBaseAxis.cross(local_f8, local_104); particle->mBaseAxis.normalize(); - + local_c8[0][0] = local_104.x; local_c8[0][1] = local_f8.x; local_c8[0][2] = particle->mBaseAxis.x; @@ -1166,7 +1416,7 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) { GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT1, ptcl_num << 1); - for (JPANode* node = startNode; node != param_0->mpAlivePtcl->getEnd(); + for (JPANode* node = startNode; node != param_0->mpAlivePtcl->getEnd(); node = node_func(node), coord += step) { param_0->mpCurNode = node; JPABaseParticle* particle = node->getObject(); @@ -1191,7 +1441,7 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) { } particle->mBaseAxis.cross(local_c0, local_cc); particle->mBaseAxis.normalize(); - + local_90[0][0] = local_cc.x; local_90[0][1] = local_c0.x; local_90[0][2] = particle->mBaseAxis.x; @@ -1216,7 +1466,7 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) { coord = start_coord; GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT1, ptcl_num << 1); - for (JPANode* node = startNode; node != param_0->mpAlivePtcl->getEnd(); + for (JPANode* node = startNode; node != param_0->mpAlivePtcl->getEnd(); node = node_func(node), coord += step) { param_0->mpCurNode = node; JPABaseParticle* particle = node->getObject(); @@ -1241,7 +1491,7 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) { } particle->mBaseAxis.cross(local_c0, local_cc); particle->mBaseAxis.normalize(); - + local_90[0][0] = local_cc.x; local_90[0][1] = local_c0.x; local_90[0][2] = particle->mBaseAxis.x; @@ -1268,6 +1518,8 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) { } void JPADrawEmitterCallBackB(JPAEmitterWorkData* work) { + ZoneScoped; + JPABaseEmitter* emtr = work->mpEmtr; if (emtr->mpEmtrCallBack == NULL) { return; @@ -1276,12 +1528,13 @@ void JPADrawEmitterCallBackB(JPAEmitterWorkData* work) { emtr->mpEmtrCallBack->draw(emtr); } -void JPADrawParticleCallBack(JPAEmitterWorkData* work, JPABaseParticle* ptcl) { +void JPADrawParticleCallBack(JPAEmitterWorkData* work, JPABaseParticle* ptcl JPA_DRAW_CTX_PARAM) { JPABaseEmitter* emtr = work->mpEmtr; if (emtr->mpPtclCallBack == NULL) { return; } + ZoneScoped; emtr->mpPtclCallBack->draw(emtr, ptcl); } @@ -1327,36 +1580,36 @@ static void makeColorTable(GXColor** o_color_table, JPAClrAnmKeyData const* i_da *o_color_table = p_clr_tbl; } -GXBlendMode JPABaseShape::st_bm[3] = { +DUSK_GAME_DATA GXBlendMode JPABaseShape::st_bm[3] = { GX_BM_NONE, GX_BM_BLEND, GX_BM_LOGIC, }; -GXBlendFactor JPABaseShape::st_bf[10] = { +DUSK_GAME_DATA GXBlendFactor JPABaseShape::st_bf[10] = { GX_BL_ZERO, GX_BL_ONE, GX_BL_SRCCLR, GX_BL_INVSRCCLR, GX_BL_DSTCLR, GX_BL_INVDSTCLR, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_BL_DSTALPHA, GX_BL_INVDSTALPHA, }; -GXLogicOp JPABaseShape::st_lo[16] = { +DUSK_GAME_DATA GXLogicOp JPABaseShape::st_lo[16] = { GX_LO_CLEAR, GX_LO_SET, GX_LO_COPY, GX_LO_INVCOPY, GX_LO_NOOP, GX_LO_INV, GX_LO_AND, GX_LO_NAND, GX_LO_OR, GX_LO_NOR, GX_LO_XOR, GX_LO_EQUIV, GX_LO_REVAND, GX_LO_INVAND, GX_LO_REVOR, GX_LO_INVOR, }; -GXCompare JPABaseShape::st_c[8] = { +DUSK_GAME_DATA GXCompare JPABaseShape::st_c[8] = { GX_NEVER, GX_LESS, GX_LEQUAL, GX_EQUAL, GX_NEQUAL, GX_GEQUAL, GX_GREATER, GX_ALWAYS, }; -GXAlphaOp JPABaseShape::st_ao[4] = { +DUSK_GAME_DATA GXAlphaOp JPABaseShape::st_ao[4] = { GX_AOP_AND, GX_AOP_OR, GX_AOP_XOR, GX_AOP_XNOR, }; -GXTevColorArg JPABaseShape::st_ca[6][4] = { +DUSK_GAME_DATA GXTevColorArg JPABaseShape::st_ca[6][4] = { { GX_CC_ZERO, GX_CC_TEXC, @@ -1395,7 +1648,7 @@ GXTevColorArg JPABaseShape::st_ca[6][4] = { }, }; -GXTevAlphaArg JPABaseShape::st_aa[2][4] = { +DUSK_GAME_DATA GXTevAlphaArg JPABaseShape::st_aa[2][4] = { { GX_CA_ZERO, GX_CA_TEXA, diff --git a/libs/JSystem/src/JParticle/JPAExTexShape.cpp b/libs/JSystem/src/JParticle/JPAExTexShape.cpp index bb9510050e..cba10eb119 100644 --- a/libs/JSystem/src/JParticle/JPAExTexShape.cpp +++ b/libs/JSystem/src/JParticle/JPAExTexShape.cpp @@ -6,6 +6,8 @@ #include void JPALoadExTex(JPAEmitterWorkData* work) { + ZoneScoped; + JPAExTexShape* ets = work->mpRes->getEts(); GXTexCoordID secTexCoordID = GX_TEXCOORD1; diff --git a/libs/JSystem/src/JParticle/JPAParticle.cpp b/libs/JSystem/src/JParticle/JPAParticle.cpp index d3490ab294..99ba95453c 100644 --- a/libs/JSystem/src/JParticle/JPAParticle.cpp +++ b/libs/JSystem/src/JParticle/JPAParticle.cpp @@ -7,6 +7,10 @@ #include "JSystem/JParticle/JPAEmitterManager.h" #include "JSystem/JParticle/JPAExtraShape.h" +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#endif + JPAParticleCallBack::~JPAParticleCallBack() { /* empty function */ } @@ -206,8 +210,7 @@ void JPABaseParticle::init_c(JPAEmitterWorkData* work, JPABaseParticle* parent) #if TARGET_PC void JPABaseParticle::interp(JPAEmitterWorkData* work, void const* drawFunc) { - static bool enable = false; - if (!enable) + if (!dusk::frame_interp::is_enabled()) return; // don't interpolate the first frame diff --git a/libs/JSystem/src/JParticle/JPAResource.cpp b/libs/JSystem/src/JParticle/JPAResource.cpp index 2ae4709fc3..9385b258e7 100644 --- a/libs/JSystem/src/JParticle/JPAResource.cpp +++ b/libs/JSystem/src/JParticle/JPAResource.cpp @@ -18,9 +18,23 @@ #include "global.h" #include "tracy/Tracy.hpp" +#if TARGET_PC +#include "dusk/frame_interpolation.h" + +#define JPA_DRAW_CTX_ARG , &ctx +#else +#define JPA_DRAW_CTX_ARG +#endif + JPAResource::JPAResource() { mpCalcEmitterFuncList = mpDrawEmitterFuncList = mpDrawEmitterChildFuncList = NULL; +#if TARGET_PC + mpCalcParticleFuncList = mpCalcParticleChildFuncList = NULL; + mpDrawParticleFuncList = mpDrawParticleChildFuncList = NULL; + mBatchInfo = {}; +#else mpCalcParticleFuncList = mpDrawParticleFuncList = mpCalcParticleChildFuncList = mpDrawParticleChildFuncList = NULL; +#endif pBsp = NULL; pEsp = NULL; pCsp = NULL; @@ -61,6 +75,60 @@ static u8 jpa_crd[32] ATTRIBUTE_ALIGN(32) = { 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02, }; +#if TARGET_PC +void JPAResource::initBatchInfo() { + mBatchInfo = {}; + + bool hasDrawFunc = false; + for (int i = 0; i < mpDrawParticleFuncListNum; i++) { + DrawParticleFunc func = mpDrawParticleFuncList[i]; + if (func == JPADrawBillboard || func == JPADrawRotBillboard || + func == JPADrawYBillboard || func == JPADrawRotYBillboard || + func == JPADrawDirection || func == JPADrawRotDirection || func == JPADrawRotation) + { + hasDrawFunc = true; + } else if (func == JPADrawParticleCallBack) { + // Batchable only for emitters without a particle callback; checked per draw + } else if (func == JPALoadCalcTexCrdMtxAnm) { + mBatchInfo.hasPtclTexMtx = true; + } else if (func == JPARegistAlpha || func == JPARegistPrmAlpha || + func == JPARegistPrmAlphaEnv || func == JPARegistAlphaEnv || + func == static_cast(JPARegistEnv)) // overloaded + { + mBatchInfo.hasPtclColor = true; + } else { + // JPADrawPoint, JPADrawLine, JPADrawDBillboard, JPALoadTexAnm, + // JPASetPointSize, JPASetLineWidth + return; + } + } + if (!hasDrawFunc) { + return; + } + + // Template array offsets, same math as setPTev + int base_plane_type = (pBsp->getType() == 3 || pBsp->getType() == 7) ? + pBsp->getBasePlaneType() : 0; + int center_offset = pEsp != nullptr ? (pEsp->getScaleCenterX() + 3 * pEsp->getScaleCenterY()) * 0xC : 0x30; + const s8* pos = reinterpret_cast(jpa_pos) + center_offset + base_plane_type * 0x6C; + const s8* crd = reinterpret_cast(jpa_crd) + (pBsp->getTilingS() + 2 * pBsp->getTilingT()) * 8; + + bool cross = pBsp->getType() == 4 || pBsp->getType() == 8; + mBatchInfo.vtxCount = cross ? 8 : 4; + for (int i = 0; i < mBatchInfo.vtxCount; i++) { + int posIdx = i < 4 ? i : 72 + (i - 4); + int crdIdx = i & 3; + mBatchInfo.vtxPos[i][0] = pos[posIdx * 3 + 0]; + mBatchInfo.vtxPos[i][1] = pos[posIdx * 3 + 1]; + mBatchInfo.vtxPos[i][2] = pos[posIdx * 3 + 2]; + mBatchInfo.vtxUv[i][0] = crd[crdIdx * 2 + 0]; + mBatchInfo.vtxUv[i][1] = crd[crdIdx * 2 + 1]; + } + + mBatchInfo.supported = true; +} +#endif + void JPAResource::init(JKRHeap* heap) { BOOL is_glbl_clr_anm = pBsp->isGlblClrAnm(); BOOL is_glbl_tex_anm = pBsp->isGlblTexAnm(); @@ -525,7 +593,10 @@ void JPAResource::init(JKRHeap* heap) { if (mpDrawParticleFuncListNum != 0) { mpDrawParticleFuncList = - (ParticleFunc*)JKRAllocFromHeap(heap, mpDrawParticleFuncListNum * sizeof(ParticleFunc), alignof(ParticleFunc)); + (DrawParticleFunc*)JKRAllocFromHeap( + heap, + mpDrawParticleFuncListNum * sizeof(DrawParticleFunc), + alignof(DrawParticleFunc)); } func_no = 0; @@ -635,7 +706,10 @@ void JPAResource::init(JKRHeap* heap) { if (mpDrawParticleChildFuncListNum != 0) { mpDrawParticleChildFuncList = - (ParticleFunc*)JKRAllocFromHeap(heap, mpDrawParticleChildFuncListNum * sizeof(ParticleFunc), sizeof(EmitterFunc)); + (DrawParticleFunc*)JKRAllocFromHeap( + heap, + mpDrawParticleChildFuncListNum * sizeof(DrawParticleFunc), + alignof(DrawParticleFunc)); } func_no = 0; @@ -699,6 +773,10 @@ void JPAResource::init(JKRHeap* heap) { mpDrawParticleChildFuncList[func_no] = &JPARegistPrmAlphaEnv; func_no++; } + +#if TARGET_PC + initBatchInfo(); +#endif } bool JPAResource::calc(JPAEmitterWorkData* work, JPABaseEmitter* emtr) { @@ -761,6 +839,15 @@ bool JPAResource::calc(JPAEmitterWorkData* work, JPABaseEmitter* emtr) { } } +#ifdef TARGET_PC + if (((pBsp && pBsp->getDirType() == 3) || (pCsp && pCsp->getDirType() == 3)) && + dusk::frame_interp::is_enabled()) + { + // ensure mGlobalEmtrDir is valid + calcWorkData_d(work); + } +#endif + JPANode* next = NULL; for (JPANode* node = emtr->mAlivePtclBase.getFirst(); node != emtr->mAlivePtclBase.getEnd(); node = next) { next = node->getNext(); @@ -799,6 +886,183 @@ void JPAResource::draw(JPAEmitterWorkData* work, JPABaseEmitter* emtr) { } } +#if TARGET_PC +static GXTevAlphaArg to_vtx_alpha_arg(GXTevAlphaArg arg) { + return arg == GX_CA_A0 ? GX_CA_RASA : arg; +} + +static void batch_set_tev_op(GXTevStageID stage) { + GXSetTevColorOp(stage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaOp(stage, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); +} + +static void batch_setup_tev(JPAEmitterWorkData* work, bool useClr1) { + JPABaseShape* shape = work->mpRes->getBsp(); + JPAExTexShape* ets = work->mpRes->getEts(); + bool useIndirect = ets != nullptr && ets->isUseIndirect(); + + // JPAEmitterManager::draw configures both channels to pass vertex color through + GXSetNumChans(useClr1 ? 2 : 1); + + const GXTevAlphaArg* alphaArg = shape->getTevAlphaArg(); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); + GXSetTevAlphaIn(GX_TEVSTAGE0, to_vtx_alpha_arg(alphaArg[0]), to_vtx_alpha_arg(alphaArg[1]), + to_vtx_alpha_arg(alphaArg[2]), to_vtx_alpha_arg(alphaArg[3])); + batch_set_tev_op(GX_TEVSTAGE0); + if (!useIndirect) { + GXSetTevDirect(GX_TEVSTAGE0); + } + GXTevStageID nextStage = GX_TEVSTAGE1; + + switch (shape->getTevColorArgSel()) { + case 0: // TEXC + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_ONE, GX_CC_ZERO); + break; + case 1: // C0 * TEXC + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO); + break; + case 2: // lerp(C0, 1, TEXC) + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_RASC, GX_CC_ONE, GX_CC_TEXC, GX_CC_ZERO); + break; + case 3: // lerp(C1, C0, TEXC) = C0 * TEXC (stage 0) + C1 * (1 - TEXC) (stage 1) + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO); + GXSetTevOrder(nextStage, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR1A1); + GXSetTevColorIn(nextStage, GX_CC_RASC, GX_CC_ZERO, GX_CC_TEXC, GX_CC_CPREV); + GXSetTevAlphaIn(nextStage, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV); + batch_set_tev_op(nextStage); + GXSetTevDirect(nextStage); + nextStage = static_cast(nextStage + 1); + break; + case 4: // TEXC * C0 + C1: C0 * TEXC (stage 0), + C1 (stage 1) + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_RASC, GX_CC_TEXC, GX_CC_ZERO); + GXSetTevOrder(nextStage, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR1A1); + GXSetTevColorIn(nextStage, GX_CC_CPREV, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC); + GXSetTevAlphaIn(nextStage, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_APREV); + batch_set_tev_op(nextStage); + GXSetTevDirect(nextStage); + nextStage = static_cast(nextStage + 1); + break; + case 5: // C0 + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC); + break; + } + + if (ets != nullptr && ets->isUseSecTex()) { + // Mirrors setPTev's secondary texture stage, at the next free stage + GXTexCoordID texCoord = useIndirect ? GX_TEXCOORD2 : GX_TEXCOORD1; + GXSetTevOrder(nextStage, texCoord, GX_TEXMAP3, GX_COLOR_NULL); + GXSetTevColorIn(nextStage, GX_CC_ZERO, GX_CC_TEXC, GX_CC_CPREV, GX_CC_ZERO); + GXSetTevAlphaIn(nextStage, GX_CA_ZERO, GX_CA_TEXA, GX_CA_APREV, GX_CA_ZERO); + batch_set_tev_op(nextStage); + GXSetTevDirect(nextStage); + nextStage = static_cast(nextStage + 1); + } + + GXSetNumTevStages(nextStage); +} + +static void batch_setup_vtx_desc(bool useClr0, bool useClr1) { + static Mtx identityMtx = { + {1.0f, 0.0f, 0.0f, 0.0f}, + {0.0f, 1.0f, 0.0f, 0.0f}, + {0.0f, 0.0f, 1.0f, 0.0f}, + }; + + GXLoadPosMtxImm(identityMtx, GX_PNMTX0); + GXSetCurrentMtx(GX_PNMTX0); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_DIRECT); + if (useClr0) { + GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT); + } + if (useClr1) { + GXSetVtxDesc(GX_VA_CLR1, GX_DIRECT); + } + GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + if (useClr0) { + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + } + if (useClr1) { + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_CLR1, GX_CLR_RGBA, GX_RGBA8, 0); + } + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); +} + +static void batch_restore_gx(JPAEmitterWorkData* work, bool changedTev, bool changedTexMtx) { + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_INDEX8); + GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_S8, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GXSetCurrentMtx(GX_PNMTX0); + + if (changedTexMtx) { + GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_TEXMTX0); + } + + if (changedTev) { + GXSetNumChans(0); + work->mpRes->getBsp()->setGX(work); + work->mpRes->setPTev(); + } +} + +static bool draw_particle_batch(JPAEmitterWorkData* work) { + ZoneScoped; + + JPAResource* res = work->mpRes; + const JPAResource::BatchInfo& info = res->mBatchInfo; + if (!info.supported || work->mPrjType != 0 || work->mpEmtr->mpPtclCallBack != nullptr) { + return false; + } + + bool useClr0 = false; + bool useClr1 = false; + if (info.hasPtclColor) { + u32 colorSel = res->getBsp()->getTevColorArgSel(); + if (colorSel >= 6) { + return false; + } + useClr0 = true; + useClr1 = colorSel == 3 || colorSel == 4; + batch_setup_tev(work, useClr1); + } + + if (info.hasPtclTexMtx) { + // UVs are CPU-transformed; drop the texgen + GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY); + } + + batch_setup_vtx_desc(useClr0, useClr1); + + ParticleDrawCtx ctx{}; + ctx.batch = true; + ctx.useTexMtx = info.hasPtclTexMtx; + ctx.useClr0 = useClr0; + ctx.useClr1 = useClr1; + + bool fwdAhead = res->getBsp()->isDrawFwdAhead(); + JPANode* node = fwdAhead ? work->mpEmtr->mAlivePtclBase.getLast() : + work->mpEmtr->mAlivePtclBase.getFirst(); + + GXBegin(GX_QUADS, GX_VTXFMT1, GX_AUTO); + while (node != work->mpEmtr->mAlivePtclBase.getEnd()) { + work->mpCurNode = node; + for (int i = res->mpDrawParticleFuncListNum - 1; i >= 0; i--) { + (*res->mpDrawParticleFuncList[i])(work, node->getObject(), &ctx); + } + node = fwdAhead ? node->getPrev() : node->getNext(); + } + GXEnd(); + + batch_restore_gx(work, useClr0, info.hasPtclTexMtx); + return true; +} +#endif + void JPAResource::drawP(JPAEmitterWorkData* work) { ZoneScoped; work->mpEmtr->clearStatus(0x80); @@ -833,13 +1097,25 @@ void JPAResource::drawP(JPAEmitterWorkData* work) { (*mpDrawEmitterFuncList[i])(work); } +#if TARGET_PC + if (draw_particle_batch(work)) { + GXSetMisc(GX_MT_XF_FLUSH, 0); + if (work->mpEmtr->mpEmtrCallBack != nullptr) { + work->mpEmtr->mpEmtrCallBack->drawAfter(work->mpEmtr); + } + return; + } + + ParticleDrawCtx ctx{}; // immediate mode +#endif + if (pBsp->isDrawFwdAhead()) { JPANode* node = work->mpEmtr->mAlivePtclBase.getLast(); for (; node != work->mpEmtr->mAlivePtclBase.getEnd(); node = node->getPrev()) { work->mpCurNode = node; if (mpDrawParticleFuncList != NULL) { for (int i = mpDrawParticleFuncListNum - 1; i >= 0; i--) { - (*mpDrawParticleFuncList[i])(work, node->getObject()); + (*mpDrawParticleFuncList[i])(work, node->getObject() JPA_DRAW_CTX_ARG); } } } @@ -849,7 +1125,7 @@ void JPAResource::drawP(JPAEmitterWorkData* work) { work->mpCurNode = node; if (mpDrawParticleFuncList != NULL) { for (int i = mpDrawParticleFuncListNum - 1; i >= 0; i--) { - (*mpDrawParticleFuncList[i])(work, node->getObject()); + (*mpDrawParticleFuncList[i])(work, node->getObject() JPA_DRAW_CTX_ARG); } } } @@ -896,13 +1172,17 @@ void JPAResource::drawC(JPAEmitterWorkData* work) { (*mpDrawEmitterChildFuncList[i])(work); } +#if TARGET_PC + ParticleDrawCtx ctx{}; // immediate mode +#endif + if (pBsp->isDrawFwdAhead()) { JPANode* node = work->mpEmtr->mAlivePtclChld.getLast(); for (; node != work->mpEmtr->mAlivePtclChld.getEnd(); node = node->getPrev()) { work->mpCurNode = node; if (mpDrawParticleChildFuncList != NULL) { for (int i = mpDrawParticleChildFuncListNum - 1; i >= 0; i--) { - (*mpDrawParticleChildFuncList[i])(work, node->getObject()); + (*mpDrawParticleChildFuncList[i])(work, node->getObject() JPA_DRAW_CTX_ARG); } } } @@ -912,7 +1192,7 @@ void JPAResource::drawC(JPAEmitterWorkData* work) { work->mpCurNode = node; if (mpDrawParticleChildFuncList != NULL) { for (int i = mpDrawParticleChildFuncListNum - 1; i >= 0; i--) { - (*mpDrawParticleChildFuncList[i])(work, node->getObject()); + (*mpDrawParticleChildFuncList[i])(work, node->getObject() JPA_DRAW_CTX_ARG); } } } diff --git a/libs/JSystem/src/JStudio/JStudio/ctb-data.cpp b/libs/JSystem/src/JStudio/JStudio/ctb-data.cpp index 629d542457..8f7fa348ba 100644 --- a/libs/JSystem/src/JStudio/JStudio/ctb-data.cpp +++ b/libs/JSystem/src/JStudio/JStudio/ctb-data.cpp @@ -2,4 +2,4 @@ #include "JSystem/JStudio/JStudio/ctb.h" -const u32 JStudio::ctb::data::ga4cSignature = BSWAP32('CTB\0'); +DUSK_GAME_DATA const u32 JStudio::ctb::data::ga4cSignature = BSWAP32('CTB\0'); diff --git a/libs/JSystem/src/JStudio/JStudio/fvb-data.cpp b/libs/JSystem/src/JStudio/JStudio/fvb-data.cpp index deee81198e..ef9f785165 100644 --- a/libs/JSystem/src/JStudio/JStudio/fvb-data.cpp +++ b/libs/JSystem/src/JStudio/JStudio/fvb-data.cpp @@ -2,4 +2,4 @@ #include "JSystem/JStudio/JStudio/fvb-data.h" -const char JStudio::fvb::data::ga4cSignature[4] = "FVB"; +DUSK_GAME_DATA const char JStudio::fvb::data::ga4cSignature[4] = "FVB"; diff --git a/libs/JSystem/src/JStudio/JStudio/jstudio-data.cpp b/libs/JSystem/src/JStudio/JStudio/jstudio-data.cpp index c6f90bc45f..2d361f5acd 100644 --- a/libs/JSystem/src/JStudio/JStudio/jstudio-data.cpp +++ b/libs/JSystem/src/JStudio/JStudio/jstudio-data.cpp @@ -2,4 +2,4 @@ #include "JSystem/JStudio/JStudio/jstudio-data.h" -const char JStudio::data::ga8cSignature[8] = "jstudio"; +DUSK_GAME_DATA const char JStudio::data::ga8cSignature[8] = "jstudio"; diff --git a/libs/JSystem/src/JStudio/JStudio/jstudio-object.cpp b/libs/JSystem/src/JStudio/JStudio/jstudio-object.cpp index ee99429ee2..2f408d6184 100644 --- a/libs/JSystem/src/JStudio/JStudio/jstudio-object.cpp +++ b/libs/JSystem/src/JStudio/JStudio/jstudio-object.cpp @@ -326,19 +326,19 @@ JStudio::TObject_actor::TObject_actor(JStudio::stb::data::TParse_TBlock_object c } -u32 const JStudio::TAdaptor_actor::sauVariableValue_3_TRANSLATION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_actor::sauVariableValue_3_TRANSLATION_XYZ[3] = { 3, 4, 5, }; - u32 const JStudio::TAdaptor_actor::sauVariableValue_3_ROTATION_XYZ[3] = { + DUSK_GAME_DATA u32 const JStudio::TAdaptor_actor::sauVariableValue_3_ROTATION_XYZ[3] = { 6, 7, 8, }; -u32 const JStudio::TAdaptor_actor::sauVariableValue_3_SCALING_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_actor::sauVariableValue_3_SCALING_XYZ[3] = { 9, 10, 11, }; - JStudio::TVariableValue::TOutput_none_ JStudio::TVariableValue::soOutput_none_; + DUSK_GAME_DATA JStudio::TVariableValue::TOutput_none_ JStudio::TVariableValue::soOutput_none_; void JStudio::TObject_actor::do_paragraph(u32 param_1, void const* param_2, u32 param_3) { TAdaptor* adaptor = getAdaptor(); @@ -479,11 +479,11 @@ JStudio::TObject_ambientLight::TObject_ambientLight( JStudio::TAdaptor_ambientLight* param_1) : TObject(param_0, param_1) { } -u32 const JStudio::TAdaptor_ambientLight::sauVariableValue_3_COLOR_RGB[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_ambientLight::sauVariableValue_3_COLOR_RGB[3] = { 0, 1, 2, }; -u32 const JStudio::TAdaptor_ambientLight::sauVariableValue_4_COLOR_RGBA[4] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_ambientLight::sauVariableValue_4_COLOR_RGBA[4] = { 0, 1, 2, 3, }; @@ -540,15 +540,15 @@ JStudio::TObject_camera::TObject_camera(JStudio::stb::data::TParse_TBlock_object JStudio::TAdaptor_camera* param_1) : TObject(param_0, param_1) {} -u32 const JStudio::TAdaptor_camera::sauVariableValue_3_POSITION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_camera::sauVariableValue_3_POSITION_XYZ[3] = { 0, 1, 2, }; -u32 const JStudio::TAdaptor_camera::sauVariableValue_3_TARGET_POSITION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_camera::sauVariableValue_3_TARGET_POSITION_XYZ[3] = { 3, 4, 5, }; -u32 const JStudio::TAdaptor_camera::sauVariableValue_2_DISTANCE_NEAR_FAR[2] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_camera::sauVariableValue_2_DISTANCE_NEAR_FAR[2] = { 8, 9, }; @@ -655,7 +655,7 @@ value_or_fun: value: #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation && u <= 5 && + if (dusk::frame_interp::is_enabled() && u <= 5 && (operation == data::UNK_0x2 || operation == data::UNK_0x3 || operation == data::UNK_0x12)) { dusk::frame_interp::request_presentation_sync(); @@ -666,7 +666,7 @@ value: value_n: #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation && + if (dusk::frame_interp::is_enabled() && (pN == TAdaptor_camera::sauVariableValue_3_POSITION_XYZ || pN == TAdaptor_camera::sauVariableValue_3_TARGET_POSITION_XYZ) && (operation == data::UNK_0x2 || operation == data::UNK_0x3 || operation == data::UNK_0x12)) { @@ -686,15 +686,15 @@ JStudio::TAdaptor_fog::~TAdaptor_fog() {} JStudio::TObject_fog::TObject_fog(JStudio::stb::data::TParse_TBlock_object const& param_0, JStudio::TAdaptor_fog* param_1) : TObject(param_0, param_1) {} -u32 const JStudio::TAdaptor_fog::sauVariableValue_3_COLOR_RGB[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_fog::sauVariableValue_3_COLOR_RGB[3] = { 0, 1, 2, }; -u32 const JStudio::TAdaptor_fog::sauVariableValue_4_COLOR_RGBA[4] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_fog::sauVariableValue_4_COLOR_RGBA[4] = { 0, 1, 2, 3, }; -u32 const JStudio::TAdaptor_fog::sauVariableValue_2_RANGE_BEGIN_END[2] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_fog::sauVariableValue_2_RANGE_BEGIN_END[2] = { 4, 5, }; @@ -759,23 +759,23 @@ JStudio::TAdaptor_light::~TAdaptor_light() {} JStudio::TObject_light::TObject_light(JStudio::stb::data::TParse_TBlock_object const& param_0, JStudio::TAdaptor_light* param_1) : TObject(param_0, param_1) {} -u32 const JStudio::TAdaptor_light::sauVariableValue_2_DIRECTION_THETA_PHI[2] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_light::sauVariableValue_2_DIRECTION_THETA_PHI[2] = { 10, 11, }; - u32 const JStudio::TAdaptor_light::sauVariableValue_3_COLOR_RGB[3] = { + DUSK_GAME_DATA u32 const JStudio::TAdaptor_light::sauVariableValue_3_COLOR_RGB[3] = { 0, 1, 2, }; -u32 const JStudio::TAdaptor_light::sauVariableValue_4_COLOR_RGBA[4] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_light::sauVariableValue_4_COLOR_RGBA[4] = { 0, 1, 2, 3, }; -u32 const JStudio::TAdaptor_light::sauVariableValue_3_POSITION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_light::sauVariableValue_3_POSITION_XYZ[3] = { 4, 5, 6, }; -u32 const JStudio::TAdaptor_light::sauVariableValue_3_TARGET_POSITION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_light::sauVariableValue_3_TARGET_POSITION_XYZ[3] = { 7, 8, 9, }; @@ -921,31 +921,31 @@ JStudio::TAdaptor_particle::~TAdaptor_particle() {} JStudio::TObject_particle::TObject_particle( JStudio::stb::data::TParse_TBlock_object const& param_0, JStudio::TAdaptor_particle* param_1) : TObject(param_0, param_1) {} - u32 const JStudio::TAdaptor_particle::sauVariableValue_3_TRANSLATION_XYZ[3] = { + DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_3_TRANSLATION_XYZ[3] = { 0, 1, 2, }; -u32 const JStudio::TAdaptor_particle::sauVariableValue_3_ROTATION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_3_ROTATION_XYZ[3] = { 3, 4, 5, }; -u32 const JStudio::TAdaptor_particle::sauVariableValue_3_SCALING_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_3_SCALING_XYZ[3] = { 6, 7, 8, }; -u32 const JStudio::TAdaptor_particle::sauVariableValue_3_COLOR_RGB[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_3_COLOR_RGB[3] = { 9, 10, 11, }; -u32 const JStudio::TAdaptor_particle::sauVariableValue_4_COLOR_RGBA[4] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_4_COLOR_RGBA[4] = { 9, 10, 11, 12, }; -u32 const JStudio::TAdaptor_particle::sauVariableValue_3_COLOR1_RGB[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_3_COLOR1_RGB[3] = { 9, 10, 11, }; -u32 const JStudio::TAdaptor_particle::sauVariableValue_4_COLOR1_RGBA[4] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_particle::sauVariableValue_4_COLOR1_RGBA[4] = { 9, 10, 11, 12, }; @@ -1119,7 +1119,7 @@ JStudio::TAdaptor_sound::~TAdaptor_sound() {} JStudio::TObject_sound::TObject_sound(JStudio::stb::data::TParse_TBlock_object const& param_0, JStudio::TAdaptor_sound* param_1) : TObject(param_0, param_1) {} -u32 const JStudio::TAdaptor_sound::sauVariableValue_3_POSITION_XYZ[3] = { +DUSK_GAME_DATA u32 const JStudio::TAdaptor_sound::sauVariableValue_3_POSITION_XYZ[3] = { 0, 1, 2, }; diff --git a/libs/JSystem/src/JStudio/JStudio/stb-data.cpp b/libs/JSystem/src/JStudio/JStudio/stb-data.cpp index 79df1744d9..5de2b8f7bf 100644 --- a/libs/JSystem/src/JStudio/JStudio/stb-data.cpp +++ b/libs/JSystem/src/JStudio/JStudio/stb-data.cpp @@ -1,6 +1,6 @@ #include "JSystem/JSystem.h" // IWYU pragma: keep -#include "dusk/endian.h" +#include "helpers/endian.h" #include "JSystem/JStudio/JStudio/stb-data.h" -const s32 JStudio::stb::data::gauDataSize_TEParagraph_data[8] = {0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40}; -const BE(u32) JStudio::stb::data::ga4cSignature = 'STB\0'; +DUSK_GAME_DATA const s32 JStudio::stb::data::gauDataSize_TEParagraph_data[8] = {0x0, 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40}; +DUSK_GAME_DATA const BE(u32) JStudio::stb::data::ga4cSignature = 'STB\0'; diff --git a/libs/JSystem/src/JStudio/JStudio_JAudio2/object-sound.cpp b/libs/JSystem/src/JStudio/JStudio_JAudio2/object-sound.cpp index 9bdde8b5cc..14eb3a74a4 100644 --- a/libs/JSystem/src/JStudio/JStudio_JAudio2/object-sound.cpp +++ b/libs/JSystem/src/JStudio/JStudio_JAudio2/object-sound.cpp @@ -80,7 +80,7 @@ void JStudio_JAudio2::TAdaptor_sound::adaptor_do_prepare() { } } -JStudio_JAudio2::TAdaptor_sound::TVVOSetValue_ JStudio_JAudio2::TAdaptor_sound::saoVVOSetValue_[6] = { +DUSK_GAME_DATA JStudio_JAudio2::TAdaptor_sound::TVVOSetValue_ JStudio_JAudio2::TAdaptor_sound::saoVVOSetValue_[6] = { JStudio_JAudio2::TAdaptor_sound::TVVOSetValue_( JStudio_JAudio2::TAdaptor_sound::UNK_7, setValue_VOLUME_ ), diff --git a/libs/JSystem/src/JStudio/JStudio_JStage/object-actor.cpp b/libs/JSystem/src/JStudio/JStudio_JStage/object-actor.cpp index 0ee7d53fb7..603cf30319 100644 --- a/libs/JSystem/src/JStudio/JStudio_JStage/object-actor.cpp +++ b/libs/JSystem/src/JStudio/JStudio_JStage/object-actor.cpp @@ -348,12 +348,12 @@ JStudio_JStage::TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::~TVVOutput_ANIMATION namespace JStudio_JStage { -const TAdaptor_actor::TVVOutputObject TAdaptor_actor::saoVVOutput_[] = { +DUSK_GAME_DATA const TAdaptor_actor::TVVOutputObject TAdaptor_actor::saoVVOutput_[] = { TVVOutputObject(TAdaptor_actor::TEACTOR_1, &JStage::TActor::JSGSetAnimationTransition, &JStage::TActor::JSGGetAnimationTransition), TVVOutputObject() }; -const TAdaptor_actor::TVVOutput_ANIMATION_FRAME_ TAdaptor_actor::saoVVOutput_ANIMATION_FRAME_[] = { +DUSK_GAME_DATA const TAdaptor_actor::TVVOutput_ANIMATION_FRAME_ TAdaptor_actor::saoVVOutput_ANIMATION_FRAME_[] = { TVVOutput_ANIMATION_FRAME_(0, 305, &JStage::TActor::JSGSetAnimationFrame, &JStage::TActor::JSGGetAnimationFrame, &JStage::TActor::JSGGetAnimationFrameMax), TVVOutput_ANIMATION_FRAME_(2, 309, &JStage::TActor::JSGSetTextureAnimationFrame, &JStage::TActor::JSGGetTextureAnimationFrame, &JStage::TActor::JSGGetTextureAnimationFrameMax), TVVOutput_ANIMATION_FRAME_() diff --git a/libs/JSystem/src/JStudio/JStudio_JStage/object-camera.cpp b/libs/JSystem/src/JStudio/JStudio_JStage/object-camera.cpp index afa1fb8ab4..c29aea47fa 100644 --- a/libs/JSystem/src/JStudio/JStudio_JStage/object-camera.cpp +++ b/libs/JSystem/src/JStudio/JStudio_JStage/object-camera.cpp @@ -22,7 +22,7 @@ JStudio_JStage::TAdaptor_camera::~TAdaptor_camera() { adaptor_do_end(); } -JStudio_JStage::TAdaptor_camera::TVVOutput JStudio_JStage::TAdaptor_camera::saoVVOutput_[5] = { +DUSK_GAME_DATA JStudio_JStage::TAdaptor_camera::TVVOutput JStudio_JStage::TAdaptor_camera::saoVVOutput_[5] = { TVVOutput(JStudio_JStage::TAdaptor_camera::TECAMERA_7, &JStage::TCamera::JSGSetViewRoll, &JStage::TCamera::JSGGetViewRoll), TVVOutput(JStudio_JStage::TAdaptor_camera::TECAMERA_6, &JStage::TCamera::JSGSetProjectionFovy, diff --git a/libs/JSystem/src/JStudio/JStudio_JStage/object-fog.cpp b/libs/JSystem/src/JStudio/JStudio_JStage/object-fog.cpp index ba1f2391e3..43cd94229a 100644 --- a/libs/JSystem/src/JStudio/JStudio_JStage/object-fog.cpp +++ b/libs/JSystem/src/JStudio/JStudio_JStage/object-fog.cpp @@ -13,7 +13,7 @@ JStudio_JStage::TAdaptor_fog::~TAdaptor_fog() { adaptor_do_end(); } -JStudio_JStage::TVariableValueOutput_object_ JStudio_JStage::TAdaptor_fog::saoVVOutput_[3] = { +DUSK_GAME_DATA JStudio_JStage::TVariableValueOutput_object_ JStudio_JStage::TAdaptor_fog::saoVVOutput_[3] = { JStudio_JStage::TVariableValueOutput_object_(JStudio_JStage::TAdaptor_fog::TEFOG_4, &JStage::TFog::JSGSetStartZ, &JStage::TFog::JSGGetStartZ), JStudio_JStage::TVariableValueOutput_object_(JStudio_JStage::TAdaptor_fog::TEFOG_5, &JStage::TFog::JSGSetEndZ, &JStage::TFog::JSGGetEndZ), JStudio_JStage::TVariableValueOutput_object_(), diff --git a/libs/JSystem/src/JStudio/JStudio_JStage/object-light.cpp b/libs/JSystem/src/JStudio/JStudio_JStage/object-light.cpp index 19a02f09df..9b3b2e608d 100644 --- a/libs/JSystem/src/JStudio/JStudio_JStage/object-light.cpp +++ b/libs/JSystem/src/JStudio/JStudio_JStage/object-light.cpp @@ -12,7 +12,7 @@ JStudio_JStage::TAdaptor_light::~TAdaptor_light() { adaptor_do_end(); } -JStudio_JStage::TAdaptor_light::TVVOutput_direction_ +DUSK_GAME_DATA JStudio_JStage::TAdaptor_light::TVVOutput_direction_ JStudio_JStage::TAdaptor_light::saoVVOutput_direction_[6] = { JStudio_JStage::TAdaptor_light::TVVOutput_direction_( JStudio_JStage::TAdaptor_light::TE_VALUE_10, diff --git a/libs/JSystem/src/JUtility/JUTConsole.cpp b/libs/JSystem/src/JUtility/JUTConsole.cpp index 3be4a370ef..75150cb498 100644 --- a/libs/JSystem/src/JUtility/JUTConsole.cpp +++ b/libs/JSystem/src/JUtility/JUTConsole.cpp @@ -1,16 +1,17 @@ #include "JSystem/JSystem.h" // IWYU pragma: keep -#include "JSystem/JUtility/JUTConsole.h" +#include +#include #include "JSystem/J2DGraph/J2DOrthoGraph.h" #include "JSystem/JKernel/JKRHeap.h" #include "JSystem/JUtility/JUTAssert.h" +#include "JSystem/JUtility/JUTConsole.h" #include "JSystem/JUtility/JUTDirectPrint.h" #include "JSystem/JUtility/JUTVideo.h" -#include -#include +#include "helpers/string.hpp" #include "global.h" -JUTConsoleManager* JUTConsoleManager::sManager; +DUSK_GAME_DATA JUTConsoleManager* JUTConsoleManager::sManager; JUTConsole* JUTConsole::create(unsigned int param_0, unsigned int maxLines, JKRHeap* pHeap) { JUTConsoleManager* pManager = JUTConsoleManager::getManager(); @@ -204,10 +205,10 @@ void JUTConsole::doDraw(JUTConsole::EConsoleType consoleType) const { mFont->drawString_scale((int)f31, sp94, mFontSizeX, mFontSizeY, spA8, TRUE); f31 += mFontSizeX * 13.0f; if (sp88) { - sprintf(spB8, "ALL"); + SAFE_SPRINTF(spB8, "ALL"); } else { f32 f29 = sp8C / (f32)(sp90 - mHeight); - sprintf(spB8, "%3d%%(%dL)", (int)(100.0 * f29), sp90); + SAFE_SPRINTF(spB8, "%3d%%(%dL)", (int)(100.0 * f29), sp90); } mFont->drawString_scale(f31, sp94, mFontSizeX, mFontSizeY, spB8, TRUE); } diff --git a/libs/JSystem/src/JUtility/JUTDbPrint.cpp b/libs/JSystem/src/JUtility/JUTDbPrint.cpp index cdf4c08d29..03535f2d15 100644 --- a/libs/JSystem/src/JUtility/JUTDbPrint.cpp +++ b/libs/JSystem/src/JUtility/JUTDbPrint.cpp @@ -16,7 +16,7 @@ JUTDbPrint::JUTDbPrint(JUTFont* pFont, JKRHeap* pHeap) { mVisible = true; } -JUTDbPrint* JUTDbPrint::sDebugPrint; +DUSK_GAME_DATA JUTDbPrint* JUTDbPrint::sDebugPrint; JUTDbPrint* JUTDbPrint::start(JUTFont* pFont, JKRHeap* pHeap) { if (sDebugPrint == NULL) { diff --git a/libs/JSystem/src/JUtility/JUTDirectPrint.cpp b/libs/JSystem/src/JUtility/JUTDirectPrint.cpp index 1b5993c5bd..745862dfbc 100644 --- a/libs/JSystem/src/JUtility/JUTDirectPrint.cpp +++ b/libs/JSystem/src/JUtility/JUTDirectPrint.cpp @@ -7,7 +7,7 @@ #include "global.h" #include "angle_utils.h" -JUTDirectPrint* JUTDirectPrint::sDirectPrint; +DUSK_GAME_DATA JUTDirectPrint* JUTDirectPrint::sDirectPrint; JUTDirectPrint::JUTDirectPrint() { changeFrameBuffer(NULL, 0, 0); @@ -48,7 +48,7 @@ void JUTDirectPrint::erase(int x, int y, int width, int height) { } } -u8 JUTDirectPrint::sAsciiTable[128] = { +DUSK_GAME_DATA u8 JUTDirectPrint::sAsciiTable[128] = { 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0xFD, 0xFE, 0x7A, 0x7A, 0x7A, 0x7A, 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x29, 0x64, 0x65, 0x66, 0x2B, 0x67, 0x68, 0x25, 0x26, 0x69, 0x2A, 0x6A, 0x27, 0x2C, 0x6B, @@ -59,7 +59,7 @@ u8 JUTDirectPrint::sAsciiTable[128] = { 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x76, 0x77, 0x78, 0x79, 0x7A, }; -u32 JUTDirectPrint::sFontData[64] = { +DUSK_GAME_DATA u32 JUTDirectPrint::sFontData[64] = { 0x70871C30, 0x8988A250, 0x88808290, 0x88830C90, 0x888402F8, 0x88882210, 0x71CF9C10, 0xF9CF9C70, 0x8208A288, 0xF200A288, 0x0BC11C78, 0x0A222208, 0x8A222208, 0x71C21C70, 0x23C738F8, 0x5228A480, 0x8A282280, 0x8BC822F0, 0xFA282280, 0x8A28A480, 0x8BC738F8, 0xF9C89C08, 0x82288808, 0x82088808, @@ -70,7 +70,7 @@ u32 JUTDirectPrint::sFontData[64] = { 0x70800000, 0x88822200, 0x08820400, 0x108F8800, 0x20821000, 0x00022200, 0x20800020, 0x00000000, }; -u32 JUTDirectPrint::sFontData2[77] = { +DUSK_GAME_DATA u32 JUTDirectPrint::sFontData2[77] = { 0x51421820, 0x53E7A420, 0x014A2C40, 0x01471000, 0x0142AA00, 0x03EAA400, 0x01471A78, 0x00000000, 0x50008010, 0x20010820, 0xF8020040, 0x20420820, 0x50441010, 0x00880000, 0x00070E00, 0x01088840, 0x78898820, 0x004A8810, 0x788A8810, 0x01098808, 0x00040E04, 0x70800620, 0x11400820, 0x12200820, diff --git a/libs/JSystem/src/JUtility/JUTException.cpp b/libs/JSystem/src/JUtility/JUTException.cpp index 514ec6dd8a..9e00bce739 100644 --- a/libs/JSystem/src/JUtility/JUTException.cpp +++ b/libs/JSystem/src/JUtility/JUTException.cpp @@ -9,6 +9,8 @@ #include #include #include + +#include "helpers/string.hpp" #ifdef __REVOLUTION_SDK__ #include #else @@ -25,16 +27,16 @@ struct CallbackObject { /* 0x10 */ int param_4; }; -OSMessageQueue JUTException::sMessageQueue = {0}; +DUSK_GAME_DATA OSMessageQueue JUTException::sMessageQueue = {0}; STATIC_ASSERT(sizeof(CallbackObject) == 0x14); static CallbackObject exCallbackObject; -JSUList JUTException::sMapFileList(false); +DUSK_GAME_DATA JSUList JUTException::sMapFileList(false); static OSTime c3bcnt[4] = {0, 0, 0, 0}; -const char* JUTException::sCpuExpName[17] = { +DUSK_GAME_DATA const char* JUTException::sCpuExpName[17] = { "SYSTEM RESET", "MACHINE CHECK", "DSI", @@ -54,11 +56,11 @@ const char* JUTException::sCpuExpName[17] = { "FLOATING POINT", }; -JUTException* JUTException::sErrorManager; +DUSK_GAME_DATA JUTException* JUTException::sErrorManager; -JUTExceptionUserCallback JUTException::sPreUserCallback; +DUSK_GAME_DATA JUTExceptionUserCallback JUTException::sPreUserCallback; -JUTExceptionUserCallback JUTException::sPostUserCallback; +DUSK_GAME_DATA JUTExceptionUserCallback JUTException::sPostUserCallback; #if PLATFORM_GCN const int stack_size = 0x1C00; @@ -98,7 +100,7 @@ JUTException* JUTException::create(JUTDirectPrint* directPrint) { return sErrorManager; } -OSMessage JUTException::sMessageBuffer[1] = {0}; +DUSK_GAME_DATA OSMessage JUTException::sMessageBuffer[1] = {0}; void* JUTException::run() { #ifdef TARGET_PC @@ -138,15 +140,15 @@ void* JUTException::run() { #endif } -void* JUTException::sConsoleBuffer; +DUSK_GAME_DATA void* JUTException::sConsoleBuffer; -u32 JUTException::sConsoleBufferSize; +DUSK_GAME_DATA u32 JUTException::sConsoleBufferSize; -JUTConsole* JUTException::sConsole; +DUSK_GAME_DATA JUTConsole* JUTException::sConsole; -u32 JUTException::msr; +DUSK_GAME_DATA u32 JUTException::msr; -u32 JUTException::fpscr; +DUSK_GAME_DATA u32 JUTException::fpscr; void JUTException::errorHandler(OSError error, OSContext* context, u32 param_3, u32 param_4) { #ifndef TARGET_PC @@ -845,8 +847,8 @@ bool JUTException::queryMapAddress(char* mapPath, u32 address, s32 section_id, u bool begin_with_newline) { if (mapPath) { char buffer[80]; - strcpy(buffer, mapPath); - strcat(buffer, ".map"); + SAFE_STRCPY(buffer, mapPath); + SAFE_STRCAT(buffer, ".map"); if (queryMapAddress_single(buffer, address, section_id, out_addr, out_size, out_line, line_length, print, begin_with_newline) == true) { diff --git a/libs/JSystem/src/JUtility/JUTFader.cpp b/libs/JSystem/src/JUtility/JUTFader.cpp index e7d33454b7..a8d9fe6028 100644 --- a/libs/JSystem/src/JUtility/JUTFader.cpp +++ b/libs/JSystem/src/JUtility/JUTFader.cpp @@ -10,6 +10,7 @@ #ifdef TARGET_PC #include +#include "dusk/frame_interpolation.h" #endif JUTFader::JUTFader(int x, int y, int width, int height, JUtility::TColor pColor) diff --git a/libs/JSystem/src/JUtility/JUTFontData_Ascfont_fix12.cpp b/libs/JSystem/src/JUtility/JUTFontData_Ascfont_fix12.cpp index 35979ebc9f..64ee2c61d8 100644 --- a/libs/JSystem/src/JUtility/JUTFontData_Ascfont_fix12.cpp +++ b/libs/JSystem/src/JUtility/JUTFontData_Ascfont_fix12.cpp @@ -8,7 +8,7 @@ #endif #include "global.h" -u8 const JUTResFONT_Ascfont_fix12[] ATTRIBUTE_ALIGN(32) = { +DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] ATTRIBUTE_ALIGN(32) = { 0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, diff --git a/libs/JSystem/src/JUtility/JUTGamePad.cpp b/libs/JSystem/src/JUtility/JUTGamePad.cpp index 48ed5f130e..c7e078b893 100644 --- a/libs/JSystem/src/JUtility/JUTGamePad.cpp +++ b/libs/JSystem/src/JUtility/JUTGamePad.cpp @@ -8,7 +8,7 @@ #include "dusk/action_bindings.h" #endif -u32 JUTGamePad::CRumble::sChannelMask[4] = { +DUSK_GAME_DATA u32 JUTGamePad::CRumble::sChannelMask[4] = { PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, @@ -17,11 +17,11 @@ u32 JUTGamePad::CRumble::sChannelMask[4] = { static u32 channel_mask[4] = {PAD_CHAN0_BIT, PAD_CHAN1_BIT, PAD_CHAN2_BIT, PAD_CHAN3_BIT}; -JSUList JUTGamePad::mPadList(false); +DUSK_GAME_DATA JSUList JUTGamePad::mPadList(false); -bool JUTGamePad::mListInitialized; +DUSK_GAME_DATA bool JUTGamePad::mListInitialized; -u8 JUTGamePad::mPadAssign[4]; +DUSK_GAME_DATA u8 JUTGamePad::mPadAssign[4]; JUTGamePad::JUTGamePad(EPadPort port) : mRumble(this), mLink(this) { mPortNum = port; @@ -53,11 +53,11 @@ void JUTGamePad::initList() { } } -u32 JUTGamePad::sSuppressPadReset; +DUSK_GAME_DATA u32 JUTGamePad::sSuppressPadReset; -u8 data_8074CFA4_debug; +DUSK_GAME_DATA u8 data_8074CFA4_debug; -s32 JUTGamePad::sAnalogMode; +DUSK_GAME_DATA s32 JUTGamePad::sAnalogMode; BOOL JUTGamePad::init() { PADSetSpec(PAD_SPEC_5); @@ -73,19 +73,19 @@ void JUTGamePad::clear() { #endif } -PADStatus JUTGamePad::mPadStatus[4]; +DUSK_GAME_DATA PADStatus JUTGamePad::mPadStatus[4]; -JUTGamePad::CButton JUTGamePad::mPadButton[4]; +DUSK_GAME_DATA JUTGamePad::CButton JUTGamePad::mPadButton[4]; -JUTGamePad::CStick JUTGamePad::mPadMStick[4]; +DUSK_GAME_DATA JUTGamePad::CStick JUTGamePad::mPadMStick[4]; -JUTGamePad::CStick JUTGamePad::mPadSStick[4]; +DUSK_GAME_DATA JUTGamePad::CStick JUTGamePad::mPadSStick[4]; -JUTGamePad::EStickMode JUTGamePad::sStickMode = EStickMode1; +DUSK_GAME_DATA JUTGamePad::EStickMode JUTGamePad::sStickMode = EStickMode1; -int JUTGamePad::sClampMode = EClampStick; +DUSK_GAME_DATA int JUTGamePad::sClampMode = EClampStick; -u32 JUTGamePad::sRumbleSupported; +DUSK_GAME_DATA u32 JUTGamePad::sRumbleSupported; u32 JUTGamePad::read() { sRumbleSupported = PADRead(mPadStatus); @@ -181,21 +181,21 @@ void JUTGamePad::assign() { } } -u8 JUTGamePad::CRumble::mStatus[4]; +DUSK_GAME_DATA u8 JUTGamePad::CRumble::mStatus[4]; -u32 JUTGamePad::CRumble::mEnabled; +DUSK_GAME_DATA u32 JUTGamePad::CRumble::mEnabled; -callbackFn JUTGamePad::C3ButtonReset::sCallback; +DUSK_GAME_DATA callbackFn JUTGamePad::C3ButtonReset::sCallback; -void* JUTGamePad::C3ButtonReset::sCallbackArg; +DUSK_GAME_DATA void* JUTGamePad::C3ButtonReset::sCallbackArg; -OSTime JUTGamePad::C3ButtonReset::sThreshold = (OSTime)(OS_TIMER_CLOCK / 60) * 30; +DUSK_GAME_DATA OSTime JUTGamePad::C3ButtonReset::sThreshold = (OSTime)(OS_TIMER_CLOCK / 60) * 30; -bool JUTGamePad::C3ButtonReset::sResetSwitchPushing; +DUSK_GAME_DATA bool JUTGamePad::C3ButtonReset::sResetSwitchPushing; -bool JUTGamePad::C3ButtonReset::sResetOccurred; +DUSK_GAME_DATA bool JUTGamePad::C3ButtonReset::sResetOccurred; -s32 JUTGamePad::C3ButtonReset::sResetOccurredPort; +DUSK_GAME_DATA s32 JUTGamePad::C3ButtonReset::sResetOccurredPort; void JUTGamePad::checkResetCallback(OSTime holdTime) { if (holdTime >= JUTGamePad::C3ButtonReset::sThreshold) { @@ -208,13 +208,13 @@ void JUTGamePad::checkResetCallback(OSTime holdTime) { } } -f32 JUTGamePad::CStick::sPressPoint = 0.5f; +DUSK_GAME_DATA f32 JUTGamePad::CStick::sPressPoint = 0.5f; -f32 JUTGamePad::CStick::sReleasePoint = 0.25f; +DUSK_GAME_DATA f32 JUTGamePad::CStick::sReleasePoint = 0.25f; -u32 JUTGamePad::C3ButtonReset::sResetPattern = PAD_BUTTON_START | PAD_BUTTON_X | PAD_BUTTON_B; +DUSK_GAME_DATA u32 JUTGamePad::C3ButtonReset::sResetPattern = PAD_BUTTON_START | PAD_BUTTON_X | PAD_BUTTON_B; -u32 JUTGamePad::C3ButtonReset::sResetMaskPattern = 0x0000FFFF; +DUSK_GAME_DATA u32 JUTGamePad::C3ButtonReset::sResetMaskPattern = 0x0000FFFF; void JUTGamePad::update() { if (mPortNum != EPortInvalid) { @@ -269,7 +269,7 @@ void JUTGamePad::update() { } } -JSUList JUTGamePadLongPress::sPatternList(false); +DUSK_GAME_DATA JSUList JUTGamePadLongPress::sPatternList(false); void JUTGamePad::checkResetSwitch() { if (!JUTGamePad::C3ButtonReset::sResetOccurred) { diff --git a/libs/JSystem/src/JUtility/JUTGraphFifo.cpp b/libs/JSystem/src/JUtility/JUTGraphFifo.cpp index 1ffc0da27d..99bbfe7156 100644 --- a/libs/JSystem/src/JUtility/JUTGraphFifo.cpp +++ b/libs/JSystem/src/JUtility/JUTGraphFifo.cpp @@ -6,7 +6,7 @@ static bool data_804514B8; -JUTGraphFifo* JUTGraphFifo::sCurrentFifo; +DUSK_GAME_DATA JUTGraphFifo* JUTGraphFifo::sCurrentFifo; JUTGraphFifo::JUTGraphFifo(u32 size) { mSize = ROUND(size, 0x20); @@ -26,7 +26,7 @@ JUTGraphFifo::JUTGraphFifo(u32 size) { } } -bool JUTGraphFifo::mGpStatus[5]; +DUSK_GAME_DATA bool JUTGraphFifo::mGpStatus[5]; JUTGraphFifo::~JUTGraphFifo() { sCurrentFifo->save(); diff --git a/libs/JSystem/src/JUtility/JUTProcBar.cpp b/libs/JSystem/src/JUtility/JUTProcBar.cpp index 81d55ed3f1..cfcf58fb5c 100644 --- a/libs/JSystem/src/JUtility/JUTProcBar.cpp +++ b/libs/JSystem/src/JUtility/JUTProcBar.cpp @@ -27,7 +27,7 @@ JUTProcBar::JUTProcBar() { mWatchHeap = NULL; } -JUTProcBar* JUTProcBar::sManager; +DUSK_GAME_DATA JUTProcBar* JUTProcBar::sManager; JUTProcBar::~JUTProcBar() { sManager = NULL; diff --git a/libs/JSystem/src/JUtility/JUTResFont.cpp b/libs/JSystem/src/JUtility/JUTResFont.cpp index 3ef83b227e..02b59aa739 100644 --- a/libs/JSystem/src/JUtility/JUTResFont.cpp +++ b/libs/JSystem/src/JUtility/JUTResFont.cpp @@ -143,7 +143,7 @@ void JUTResFont::countBlock() { } } -IsLeadByte_func const JUTResFont::saoAboutEncoding_[3] = { +DUSK_GAME_DATA IsLeadByte_func const JUTResFont::saoAboutEncoding_[3] = { JUTFont::isLeadByte_1Byte, JUTFont::isLeadByte_2Byte, JUTFont::isLeadByte_ShiftJIS, @@ -249,6 +249,7 @@ f32 JUTResFont::drawChar_scale(f32 pos_x, f32 pos_y, f32 scale_x, f32 scale_y, i f32 x2; f32 y1; + ZoneScoped; JUT_ASSERT(378, mValid); JUTFont::TWidth width; loadFont(str_int, GX_TEXMAP0, &width FONT_DRAW_CTX_ARG); diff --git a/libs/JSystem/src/JUtility/JUTVideo.cpp b/libs/JSystem/src/JUtility/JUTVideo.cpp index 5586342f0e..2135c8fc22 100644 --- a/libs/JSystem/src/JUtility/JUTVideo.cpp +++ b/libs/JSystem/src/JUtility/JUTVideo.cpp @@ -8,11 +8,11 @@ #include "JSystem/JKernel/JKRHeap.h" -JUTVideo* JUTVideo::sManager; +DUSK_GAME_DATA JUTVideo* JUTVideo::sManager; -OSTick JUTVideo::sVideoLastTick; +DUSK_GAME_DATA OSTick JUTVideo::sVideoLastTick; -OSTick JUTVideo::sVideoInterval; +DUSK_GAME_DATA OSTick JUTVideo::sVideoInterval; static bool data_80451544; diff --git a/libs/JSystem/src/JUtility/JUTXfb.cpp b/libs/JSystem/src/JUtility/JUTXfb.cpp index f04a5e93fc..ac66621243 100644 --- a/libs/JSystem/src/JUtility/JUTXfb.cpp +++ b/libs/JSystem/src/JUtility/JUTXfb.cpp @@ -33,7 +33,7 @@ JUTXfb::JUTXfb(GXRenderModeObj const* pObj, JKRHeap* pHeap, JUTXfb::EXfbNumber x } } -JUTXfb* JUTXfb::sManager; +DUSK_GAME_DATA JUTXfb* JUTXfb::sManager; JUTXfb::~JUTXfb() { for (int i = 0; i < 3; i++) { diff --git a/libs/freeverb/CMakeLists.txt b/libs/freeverb/CMakeLists.txt index c0c12da293..d0275f62ac 100644 --- a/libs/freeverb/CMakeLists.txt +++ b/libs/freeverb/CMakeLists.txt @@ -7,3 +7,5 @@ add_library(freeverb allpass.cpp revmodel.cpp ) +target_include_directories(freeverb PRIVATE include/freeverb) +target_include_directories(freeverb INTERFACE include) diff --git a/libs/freeverb/allpass.hpp b/libs/freeverb/include/freeverb/allpass.hpp similarity index 100% rename from libs/freeverb/allpass.hpp rename to libs/freeverb/include/freeverb/allpass.hpp diff --git a/libs/freeverb/comb.hpp b/libs/freeverb/include/freeverb/comb.hpp similarity index 100% rename from libs/freeverb/comb.hpp rename to libs/freeverb/include/freeverb/comb.hpp diff --git a/libs/freeverb/denormals.h b/libs/freeverb/include/freeverb/denormals.h similarity index 69% rename from libs/freeverb/denormals.h rename to libs/freeverb/include/freeverb/denormals.h index d68cb444f7..9193798abe 100644 --- a/libs/freeverb/denormals.h +++ b/libs/freeverb/include/freeverb/denormals.h @@ -13,20 +13,33 @@ inline denormal_state denormals_enable() } inline void denormals_restore(denormal_state saved) { _mm_setcsr(saved); } -#elif defined(__aarch64__) || defined(_M_ARM64) +#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) #include +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC)) +#include +#endif using denormal_state = uint64_t; inline denormal_state denormals_enable() { +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC)) + denormal_state saved = static_cast(_ReadStatusReg(ARM64_FPCR)); + _WriteStatusReg(ARM64_FPCR, static_cast<__int64>(saved | (1ULL << 24))); // FZ + return saved; +#else denormal_state saved; asm volatile("mrs %0, fpcr" : "=r"(saved)); asm volatile("msr fpcr, %0" :: "r"(saved | (1ULL << 24))); // FZ return saved; +#endif } inline void denormals_restore(denormal_state saved) { +#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC)) + _WriteStatusReg(ARM64_FPCR, static_cast<__int64>(saved)); +#else asm volatile("msr fpcr, %0" :: "r"(saved)); +#endif } #elif defined(__arm__) || defined(_M_ARM) diff --git a/libs/freeverb/revmodel.hpp b/libs/freeverb/include/freeverb/revmodel.hpp similarity index 100% rename from libs/freeverb/revmodel.hpp rename to libs/freeverb/include/freeverb/revmodel.hpp diff --git a/libs/freeverb/tuning.h b/libs/freeverb/include/freeverb/tuning.h similarity index 100% rename from libs/freeverb/tuning.h rename to libs/freeverb/include/freeverb/tuning.h diff --git a/mods/ao_mod/CMakeLists.txt b/mods/ao_mod/CMakeLists.txt new file mode 100644 index 0000000000..723ed55006 --- /dev/null +++ b/mods/ao_mod/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.25) +project(ao_mod CXX) + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(DUSK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE PATH "Path to dusk source root") + option(DUSK_MOD_USE_FULL_TREE "Use full build instead of the minimal mod SDK" OFF) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if (DUSK_MOD_USE_FULL_TREE) + add_subdirectory("${DUSK_DIR}" dusk EXCLUDE_FROM_ALL) + else () + add_subdirectory("${DUSK_DIR}/sdk" dusk-sdk EXCLUDE_FROM_ALL) + endif () +endif () + +add_mod(ao_mod + FEATURES webgpu + SOURCES src/mod.cpp + MOD_JSON mod.json + RES_DIR res + BUNDLE +) diff --git a/mods/ao_mod/mod.json b/mods/ao_mod/mod.json new file mode 100644 index 0000000000..9019cf335d --- /dev/null +++ b/mods/ao_mod/mod.json @@ -0,0 +1,7 @@ +{ + "id": "dev.twilitrealm.ao_mod", + "name": "[Demo] Ambient Occlusion", + "version": "1.0.0", + "author": "Twilit Realm", + "description": "Ground-truth ambient occlusion (GTAO) computed from the scene depth buffer and composited over the game. Ported from Bevy Engine's SSAO and Intel XeGTAO." +} diff --git a/mods/ao_mod/res/composite.wgsl b/mods/ao_mod/res/composite.wgsl new file mode 100644 index 0000000000..fa3a0101b8 --- /dev/null +++ b/mods/ao_mod/res/composite.wgsl @@ -0,0 +1,161 @@ +// Fullscreen composite: multiplies the denoised ambient-occlusion visibility over the scene. +// +// Debug views: +// 1 = raw AO visibility as grayscale +// 2 = view-space normals reconstructed from depth (keep in sync with gtao.wgsl) +// 3 = the preprocessed depth input +// 4 = depth staircase detector + +struct Uniforms { + projection: mat4x4f, + inverse_projection: mat4x4f, + size: vec2f, // AO texture size in pixels (may be half the render size) + inv_size: vec2f, + depth_scale: vec2f, + effect_radius: f32, + intensity: f32, + slice_count: f32, + samples_per_slice_side: f32, + debug_view: u32, + _pad: f32, +} + +@group(0) @binding(0) var ambient_occlusion: texture_2d; +@group(0) @binding(1) var preprocessed_depth: texture_2d; +@group(0) @binding(2) var scene_depth_raw: texture_2d; +@group(0) @binding(3) var uniforms: Uniforms; + +struct VertexOutput { + @builtin(position) position: vec4f, + @location(0) uv: vec2f, +} + +@vertex +fn vs_main(@builtin(vertex_index) index: u32) -> VertexOutput { + // Fullscreen triangle + var out: VertexOutput; + let uv = vec2f(f32((index << 1u) & 2u), f32(index & 2u)); + out.position = vec4f(uv * vec2f(2.0, -2.0) + vec2f(-1.0, 1.0), 0.0, 1.0); + out.uv = uv; + return out; +} + +// Manual bilinear sample (r32float is unfilterable without optional device features) +fn sample_visibility(uv: vec2f) -> f32 { + let coordinates = uv * uniforms.size - 0.5; + let base = floor(coordinates); + let fraction = coordinates - base; + let max_coordinates = vec2i(uniforms.size) - 1i; + let p00 = clamp(vec2i(base), vec2i(0i), max_coordinates); + let p11 = clamp(vec2i(base) + 1i, vec2i(0i), max_coordinates); + let v00 = textureLoad(ambient_occlusion, vec2i(p00.x, p00.y), 0i).r; + let v10 = textureLoad(ambient_occlusion, vec2i(p11.x, p00.y), 0i).r; + let v01 = textureLoad(ambient_occlusion, vec2i(p00.x, p11.y), 0i).r; + let v11 = textureLoad(ambient_occlusion, vec2i(p11.x, p11.y), 0i).r; + let top = mix(v00, v10, fraction.x); + let bottom = mix(v01, v11, fraction.x); + return mix(top, bottom, fraction.y); +} + +fn load_depth(pixel_coordinates: vec2) -> f32 { + let coordinates = clamp(pixel_coordinates, vec2(0i), vec2(uniforms.size) - 1i); + return textureLoad(preprocessed_depth, coordinates, 0i).r; +} + +fn reconstruct_view_space_position(depth: f32, uv: vec2f) -> vec3f { + let clip_xy = vec2f(uv.x * 2.0 - 1.0, 1.0 - 2.0 * uv.y); + let t = uniforms.inverse_projection * vec4f(clip_xy, depth, 1.0); + return t.xyz / t.w; +} + +fn view_position_at(pixel_coordinates: vec2) -> vec3f { + let depth = load_depth(pixel_coordinates); + let uv = (vec2f(pixel_coordinates) + 0.5) * uniforms.inv_size; + return reconstruct_view_space_position(depth, uv); +} + +fn reconstruct_normal(pixel_coordinates: vec2, pixel_position: vec3f, depth_center: f32) -> vec3f { + let depth_left1 = load_depth(pixel_coordinates + vec2(-1i, 0i)); + let depth_left2 = load_depth(pixel_coordinates + vec2(-2i, 0i)); + let depth_right1 = load_depth(pixel_coordinates + vec2(1i, 0i)); + let depth_right2 = load_depth(pixel_coordinates + vec2(2i, 0i)); + let depth_top1 = load_depth(pixel_coordinates + vec2(0i, -1i)); + let depth_top2 = load_depth(pixel_coordinates + vec2(0i, -2i)); + let depth_bottom1 = load_depth(pixel_coordinates + vec2(0i, 1i)); + let depth_bottom2 = load_depth(pixel_coordinates + vec2(0i, 2i)); + + let use_left = abs(2.0 * depth_left1 - depth_left2 - depth_center) < + abs(2.0 * depth_right1 - depth_right2 - depth_center); + let use_top = abs(2.0 * depth_top1 - depth_top2 - depth_center) < + abs(2.0 * depth_bottom1 - depth_bottom2 - depth_center); + + var ddx: vec3f; + if use_left { + ddx = pixel_position - view_position_at(pixel_coordinates + vec2(-1i, 0i)); + } else { + ddx = view_position_at(pixel_coordinates + vec2(1i, 0i)) - pixel_position; + } + var ddy: vec3f; + if use_top { + ddy = pixel_position - view_position_at(pixel_coordinates + vec2(0i, -1i)); + } else { + ddy = view_position_at(pixel_coordinates + vec2(0i, 1i)) - pixel_position; + } + + var normal = normalize(cross(ddy, ddx)); + if dot(normal, pixel_position) > 0.0 { + normal = -normal; + } + return normal; +} + +// Raw-snapshot variant of load_depth for the staircase view +fn load_raw_depth(pixel_coordinates: vec2) -> f32 { + let size = vec2(textureDimensions(scene_depth_raw)); + let coordinates = clamp(pixel_coordinates, vec2(0i), size - 1i); + return textureLoad(scene_depth_raw, coordinates, 0i).r; +} + +@fragment +fn fs_main(in: VertexOutput) -> @location(0) vec4f { + if uniforms.debug_view == 2u { + // Reconstructed view-space normals, [-1,1] -> RGB + let pixel = vec2(in.uv * uniforms.size); + let depth = load_depth(pixel); + let uv = (vec2f(pixel) + 0.5) * uniforms.inv_size; + let position = reconstruct_view_space_position(depth, uv); + let normal = reconstruct_normal(pixel, position, depth); + return vec4f(normal * 0.5 + 0.5, 1.0); + } + if uniforms.debug_view == 3u { + // Preprocessed depth as an exponential distance gradient (white = near, black = far) + let pixel = vec2(in.uv * uniforms.size); + let position = view_position_at(pixel); + let value = exp(-max(-position.z, 0.0) * 0.0003); + return vec4f(value, value, value, 1.0); + } + if uniforms.debug_view == 4u { + // Staircase detector on the raw snapshot depth + let size = vec2f(textureDimensions(scene_depth_raw)); + let pixel = vec2(in.uv * size); + let d_center = load_raw_depth(pixel); + let d_left = load_raw_depth(pixel + vec2(-1i, 0i)); + let d_right = load_raw_depth(pixel + vec2(1i, 0i)); + let d_top = load_raw_depth(pixel + vec2(0i, -1i)); + let d_bottom = load_raw_depth(pixel + vec2(0i, 1i)); + let gradient_x = abs(d_right - d_left) * 0.5; + let curvature_x = abs(d_right - 2.0 * d_center + d_left); + let gradient_y = abs(d_bottom - d_top) * 0.5; + let curvature_y = abs(d_bottom - 2.0 * d_center + d_top); + let ratio_x = curvature_x / max(gradient_x, 1e-12); + let ratio_y = curvature_y / max(gradient_y, 1e-12); + return vec4f(saturate(ratio_x), saturate(ratio_y), 0.0, 1.0); + } + + let visibility = sample_visibility(in.uv); + if uniforms.debug_view == 1u { + return vec4f(visibility, visibility, visibility, 1.0); + } + let value = mix(1.0, visibility, uniforms.intensity); + return vec4f(value, value, value, 1.0); +} diff --git a/mods/ao_mod/res/denoise.wgsl b/mods/ao_mod/res/denoise.wgsl new file mode 100644 index 0000000000..b947b1bd04 --- /dev/null +++ b/mods/ao_mod/res/denoise.wgsl @@ -0,0 +1,108 @@ +// 3x3 bilaterial filter (edge-preserving blur) +// https://people.csail.mit.edu/sparis/bf_course/course_notes.pdf +// +// Note: Does not use the Gaussian kernel part of a typical bilateral blur +// From the paper: "use the information gathered on a neighborhood of 4 x 4 using a bilateral filter for +// reconstruction, using _uniform_ convolution weights" +// +// Note: The paper does a 4x4 (not quite centered) filter, offset by +/- 1 pixel every other frame +// XeGTAO does a 3x3 filter, on two pixels at a time per compute thread, applied twice +// We do a 3x3 filter, on 1 pixel per compute thread, applied once +// +// Ported from Bevy Engine, crates/bevy_pbr/src/ssao/spatial_denoise.wgsl (v0.13.2), licensed +// MIT OR Apache-2.0 (see res/licenses/), itself derived from Intel XeGTAO (MIT). +// +// PORT: the textureGather calls are rewritten as explicit per-neighbor textureLoads (r32float +// and r32uint are unfilterable); Bevy view uniforms -> the mod's uniform block; r16float -> r32float. + +struct Uniforms { + projection: mat4x4f, + inverse_projection: mat4x4f, + size: vec2f, + inv_size: vec2f, + depth_scale: vec2f, + effect_radius: f32, + intensity: f32, + slice_count: f32, + samples_per_slice_side: f32, + debug_view: u32, + _pad: f32, +} + +@group(0) @binding(0) var ambient_occlusion_noisy: texture_2d; +@group(0) @binding(1) var depth_differences: texture_2d; +@group(0) @binding(2) var ambient_occlusion: texture_storage_2d; +@group(0) @binding(3) var uniforms: Uniforms; + +fn clamp_coordinates(pixel_coordinates: vec2) -> vec2 { + return clamp(pixel_coordinates, vec2(0i), vec2(uniforms.size) - 1i); +} + +// Each pixel's packed edge info is (left, right, top, bottom) weights, packed by the GTAO pass. +fn load_edges(pixel_coordinates: vec2) -> vec4 { + return unpack4x8unorm(textureLoad(depth_differences, clamp_coordinates(pixel_coordinates), 0i).r); +} + +fn load_visibility(pixel_coordinates: vec2) -> f32 { + return textureLoad(ambient_occlusion_noisy, clamp_coordinates(pixel_coordinates), 0i).r; +} + +@compute +@workgroup_size(8, 8, 1) +fn spatial_denoise(@builtin(global_invocation_id) global_id: vec3) { + let pixel_coordinates = vec2(global_id.xy); + + let left_edges = load_edges(pixel_coordinates + vec2(-1i, 0i)); + let right_edges = load_edges(pixel_coordinates + vec2(1i, 0i)); + let top_edges = load_edges(pixel_coordinates + vec2(0i, -1i)); + let bottom_edges = load_edges(pixel_coordinates + vec2(0i, 1i)); + var center_edges = load_edges(pixel_coordinates); + // Cross-check each edge against the neighbor's opposing edge weight. + center_edges *= vec4(left_edges.y, right_edges.x, top_edges.w, bottom_edges.z); + + let center_weight = 1.2; + let left_weight = center_edges.x; + let right_weight = center_edges.y; + let top_weight = center_edges.z; + let bottom_weight = center_edges.w; + let top_left_weight = 0.425 * (top_weight * top_edges.x + left_weight * left_edges.z); + let top_right_weight = 0.425 * (top_weight * top_edges.y + right_weight * right_edges.z); + let bottom_left_weight = 0.425 * (bottom_weight * bottom_edges.x + left_weight * left_edges.w); + let bottom_right_weight = 0.425 * (bottom_weight * bottom_edges.y + right_weight * right_edges.w); + + let center_visibility = load_visibility(pixel_coordinates); + let left_visibility = load_visibility(pixel_coordinates + vec2(-1i, 0i)); + let right_visibility = load_visibility(pixel_coordinates + vec2(1i, 0i)); + let top_visibility = load_visibility(pixel_coordinates + vec2(0i, -1i)); + let bottom_visibility = load_visibility(pixel_coordinates + vec2(0i, 1i)); + let top_left_visibility = load_visibility(pixel_coordinates + vec2(-1i, -1i)); + let top_right_visibility = load_visibility(pixel_coordinates + vec2(1i, -1i)); + let bottom_left_visibility = load_visibility(pixel_coordinates + vec2(-1i, 1i)); + let bottom_right_visibility = load_visibility(pixel_coordinates + vec2(1i, 1i)); + + // PORT: Bevy sums the center sample unweighted while still counting center_weight in the + // denominator; XeGTAO's original weights the value too, which is what we do here. + var sum = center_visibility * center_weight; + sum += left_visibility * left_weight; + sum += right_visibility * right_weight; + sum += top_visibility * top_weight; + sum += bottom_visibility * bottom_weight; + sum += top_left_visibility * top_left_weight; + sum += top_right_visibility * top_right_weight; + sum += bottom_left_visibility * bottom_left_weight; + sum += bottom_right_visibility * bottom_right_weight; + + var sum_weight = center_weight; + sum_weight += left_weight; + sum_weight += right_weight; + sum_weight += top_weight; + sum_weight += bottom_weight; + sum_weight += top_left_weight; + sum_weight += top_right_weight; + sum_weight += bottom_left_weight; + sum_weight += bottom_right_weight; + + let denoised_visibility = sum / sum_weight; + + textureStore(ambient_occlusion, pixel_coordinates, vec4(denoised_visibility, 0.0, 0.0, 0.0)); +} diff --git a/mods/ao_mod/res/gtao.wgsl b/mods/ao_mod/res/gtao.wgsl new file mode 100644 index 0000000000..ee23774681 --- /dev/null +++ b/mods/ao_mod/res/gtao.wgsl @@ -0,0 +1,247 @@ +// Ground Truth-based Ambient Occlusion (GTAO) +// Paper: https://www.activision.com/cdn/research/Practical_Real_Time_Strategies_for_Accurate_Indirect_Occlusion_NEW%20VERSION_COLOR.pdf +// Presentation: https://blog.selfshadow.com/publications/s2016-shading-course/activision/s2016_pbs_activision_occlusion.pdf +// +// Ported from Bevy Engine, crates/bevy_pbr/src/ssao/gtao.wgsl (v0.13.2), licensed +// MIT OR Apache-2.0 (see res/licenses/), itself heavily based on XeGTAO v1.30 from Intel (MIT): +// https://github.com/GameTechDev/XeGTAO/blob/0d177ce06bfa642f64d8af4de1197ad1bcb862d4/Source/Rendering/Shaders/XeGTAO.hlsli +// +// PORT: +// - Bevy view/globals bindings -> the mod's own uniform block (matrices from Dusklight's +// CameraService, WebGPU clip convention, reversed-Z - the same convention Bevy uses). +// - Prepass normals -> normals reconstructed from depth (atyuwen's accurate 5-tap method, +// https://atyuwen.github.io/posts/normal-reconstruction/). +// - Sampler-based reads -> textureLoad (r32float is unfilterable without optional features); +// the mip level for the XeGTAO bandwidth optimization is selected explicitly per load. +// - effect_radius and slice/sample counts come from uniforms instead of constants/shader defs +// (game world units are ~100x larger than Bevy's meters, and quality is a live setting). +// - No TEMPORAL_JITTER: the noise index is pinned (no TAA; the spatial denoiser is the only +// filter, a configuration XeGTAO supports). +// - Storage format r16float -> r32float (core WebGPU storage format). + +struct Uniforms { + projection: mat4x4f, + inverse_projection: mat4x4f, + size: vec2f, + inv_size: vec2f, + depth_scale: vec2f, + effect_radius: f32, + intensity: f32, + slice_count: f32, + samples_per_slice_side: f32, + debug_view: u32, + _pad: f32, +} + +@group(0) @binding(0) var preprocessed_depth: texture_2d; +@group(0) @binding(1) var hilbert_index_lut: texture_2d; +@group(0) @binding(2) var ambient_occlusion: texture_storage_2d; +@group(0) @binding(3) var depth_differences: texture_storage_2d; +@group(0) @binding(4) var uniforms: Uniforms; + +const PI: f32 = 3.141592653589793; +const HALF_PI: f32 = 1.5707963267948966; + +fn fast_sqrt(x: f32) -> f32 { + return bitcast(0x1fbd1df5 + (bitcast(x) >> 1u)); +} + +fn fast_acos(in_x: f32) -> f32 { + let x = abs(in_x); + var res = -0.156583 * x + HALF_PI; + res *= fast_sqrt(1.0 - x); + return select(PI - res, res, in_x >= 0.0); +} + +fn load_noise(pixel_coordinates: vec2) -> vec2 { + let index = textureLoad(hilbert_index_lut, pixel_coordinates % 64, 0).r; + // R2 sequence - http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences + return fract(0.5 + f32(index) * vec2(0.75487766624669276005, 0.5698402909980532659114)); +} + +fn load_depth(pixel_coordinates: vec2, mip_level: i32) -> f32 { + let mip_size = max(vec2(uniforms.size) >> vec2(u32(mip_level)), vec2(1i)); + let coordinates = clamp(pixel_coordinates, vec2(0i), mip_size - 1i); + return textureLoad(preprocessed_depth, coordinates, mip_level).r; +} + +// Calculate differences in depth between neighbor pixels (later used by the spatial denoiser pass to preserve object edges) +fn calculate_neighboring_depth_differences(pixel_coordinates: vec2) -> f32 { + // Sample the pixel's depth and 4 depths around it + // PORT: explicit loads instead of two textureGathers. + let depth_center = load_depth(pixel_coordinates, 0i); + let depth_left = load_depth(pixel_coordinates + vec2(-1i, 0i), 0i); + let depth_top = load_depth(pixel_coordinates + vec2(0i, -1i), 0i); + let depth_bottom = load_depth(pixel_coordinates + vec2(0i, 1i), 0i); + let depth_right = load_depth(pixel_coordinates + vec2(1i, 0i), 0i); + + // Calculate the depth differences (large differences represent object edges) + var edge_info = vec4(depth_left, depth_right, depth_top, depth_bottom) - depth_center; + let slope_left_right = (edge_info.y - edge_info.x) * 0.5; + let slope_top_bottom = (edge_info.w - edge_info.z) * 0.5; + let edge_info_slope_adjusted = edge_info + vec4(slope_left_right, -slope_left_right, slope_top_bottom, -slope_top_bottom); + edge_info = min(abs(edge_info), abs(edge_info_slope_adjusted)); + let bias = 0.25; // Using the bias and then saturating nudges the values a bit + let scale = depth_center * 0.011; // Weight the edges by their distance from the camera + edge_info = saturate((1.0 + bias) - edge_info / scale); // Apply the bias and scale, and invert edge_info so that small values become large, and vice versa + + // Pack the edge info into the texture + let edge_info_packed = vec4(pack4x8unorm(edge_info), 0u, 0u, 0u); + textureStore(depth_differences, pixel_coordinates, edge_info_packed); + + return depth_center; +} + +fn reconstruct_view_space_position(depth: f32, uv: vec2) -> vec3 { + let clip_xy = vec2(uv.x * 2.0 - 1.0, 1.0 - 2.0 * uv.y); + let t = uniforms.inverse_projection * vec4(clip_xy, depth, 1.0); + let view_xyz = t.xyz / t.w; + return view_xyz; +} + +fn view_position_at(pixel_coordinates: vec2) -> vec3 { + let depth = load_depth(pixel_coordinates, 0i); + let uv = (vec2(pixel_coordinates) + 0.5) * uniforms.inv_size; + return reconstruct_view_space_position(depth, uv); +} + +// PORT: replaces Bevy's load_normal_view_space (which reads a prepass normal texture we do +// not have). Accurate view-space normal reconstruction from depth, atyuwen's 5-tap method: +// for each axis, extrapolate the center depth from the two taps on each side and derive the +// tangent from whichever side predicts it better. This keeps normals stable across depth +// discontinuities where naive derivatives smear. +fn reconstruct_normal(pixel_coordinates: vec2, pixel_position: vec3, depth_center: f32) -> vec3 { + let depth_left1 = load_depth(pixel_coordinates + vec2(-1i, 0i), 0i); + let depth_left2 = load_depth(pixel_coordinates + vec2(-2i, 0i), 0i); + let depth_right1 = load_depth(pixel_coordinates + vec2(1i, 0i), 0i); + let depth_right2 = load_depth(pixel_coordinates + vec2(2i, 0i), 0i); + let depth_top1 = load_depth(pixel_coordinates + vec2(0i, -1i), 0i); + let depth_top2 = load_depth(pixel_coordinates + vec2(0i, -2i), 0i); + let depth_bottom1 = load_depth(pixel_coordinates + vec2(0i, 1i), 0i); + let depth_bottom2 = load_depth(pixel_coordinates + vec2(0i, 2i), 0i); + + let use_left = abs(2.0 * depth_left1 - depth_left2 - depth_center) < + abs(2.0 * depth_right1 - depth_right2 - depth_center); + let use_top = abs(2.0 * depth_top1 - depth_top2 - depth_center) < + abs(2.0 * depth_bottom1 - depth_bottom2 - depth_center); + + var ddx: vec3; + if use_left { + ddx = pixel_position - view_position_at(pixel_coordinates + vec2(-1i, 0i)); + } else { + ddx = view_position_at(pixel_coordinates + vec2(1i, 0i)) - pixel_position; + } + var ddy: vec3; + if use_top { + ddy = pixel_position - view_position_at(pixel_coordinates + vec2(0i, -1i)); + } else { + ddy = view_position_at(pixel_coordinates + vec2(0i, 1i)) - pixel_position; + } + + var normal = normalize(cross(ddy, ddx)); + // Guard the orientation: the normal must face the camera. + if dot(normal, pixel_position) > 0.0 { + normal = -normal; + } + return normal; +} + +fn load_and_reconstruct_view_space_position(uv: vec2, sample_mip_level: f32) -> vec3 { + // PORT: point-sample the selected mip explicitly instead of textureSampleLevel. + let mip_level = i32(sample_mip_level + 0.5); + let mip_size = max(vec2(uniforms.size) >> vec2(u32(mip_level)), vec2(1i)); + let depth = load_depth(vec2(uv * vec2(mip_size)), mip_level); + return reconstruct_view_space_position(depth, uv); +} + +@compute +@workgroup_size(8, 8, 1) +fn gtao(@builtin(global_invocation_id) global_id: vec3) { + let slice_count = uniforms.slice_count; + let samples_per_slice_side = uniforms.samples_per_slice_side; + let effect_radius = uniforms.effect_radius; + let falloff_range = 0.615 * effect_radius; + let falloff_from = effect_radius * (1.0 - 0.615); + let falloff_mul = -1.0 / falloff_range; + let falloff_add = falloff_from / falloff_range + 1.0; + + let pixel_coordinates = vec2(global_id.xy); + let uv = (vec2(pixel_coordinates) + 0.5) * uniforms.inv_size; + + var pixel_depth = calculate_neighboring_depth_differences(pixel_coordinates); + let raw_depth = pixel_depth; + pixel_depth += 0.00001; // Avoid depth precision issues + + let pixel_position = reconstruct_view_space_position(pixel_depth, uv); + // PORT: the reconstruction differences the center position against neighbor positions + // built from unbiased depths, so its center must use the raw depth too: at this game's + // depth scale (far plane 200000 -> depth ~5e-3) Bevy's +0.00001 bias is comparable to a + // one-pixel depth step, and a biased center corrupts both tangents. + let pixel_normal = reconstruct_normal( + pixel_coordinates, reconstruct_view_space_position(raw_depth, uv), raw_depth); + let view_vec = normalize(-pixel_position); + + let noise = load_noise(pixel_coordinates); + let sample_scale = (-0.5 * effect_radius * uniforms.projection[0][0]) / pixel_position.z; + + var visibility = 0.0; + for (var slice_t = 0.0; slice_t < slice_count; slice_t += 1.0) { + let slice = slice_t + noise.x; + let phi = (PI / slice_count) * slice; + let omega = vec2(cos(phi), sin(phi)); + + let direction = vec3(omega.xy, 0.0); + let orthographic_direction = direction - (dot(direction, view_vec) * view_vec); + let axis = cross(direction, view_vec); + let projected_normal = pixel_normal - axis * dot(pixel_normal, axis); + let projected_normal_length = length(projected_normal); + + let sign_norm = sign(dot(orthographic_direction, projected_normal)); + let cos_norm = saturate(dot(projected_normal, view_vec) / projected_normal_length); + let n = sign_norm * fast_acos(cos_norm); + + let min_cos_horizon_1 = cos(n + HALF_PI); + let min_cos_horizon_2 = cos(n - HALF_PI); + var cos_horizon_1 = min_cos_horizon_1; + var cos_horizon_2 = min_cos_horizon_2; + let sample_mul = vec2(omega.x, -omega.y) * sample_scale; + for (var sample_t = 0.0; sample_t < samples_per_slice_side; sample_t += 1.0) { + var sample_noise = (slice_t + sample_t * samples_per_slice_side) * 0.6180339887498948482; + sample_noise = fract(noise.y + sample_noise); + + var s = (sample_t + sample_noise) / samples_per_slice_side; + s *= s; // https://github.com/GameTechDev/XeGTAO#sample-distribution + let sample = s * sample_mul; + + // * uniforms.size gets us from [0, 1] to [0, viewport_size], which is needed for this to get the correct mip levels + let sample_mip_level = clamp(log2(length(sample * uniforms.size)) - 3.3, 0.0, 4.0); // https://github.com/GameTechDev/XeGTAO#memory-bandwidth-bottleneck + let sample_position_1 = load_and_reconstruct_view_space_position(uv + sample, sample_mip_level); + let sample_position_2 = load_and_reconstruct_view_space_position(uv - sample, sample_mip_level); + + let sample_difference_1 = sample_position_1 - pixel_position; + let sample_difference_2 = sample_position_2 - pixel_position; + let sample_distance_1 = length(sample_difference_1); + let sample_distance_2 = length(sample_difference_2); + var sample_cos_horizon_1 = dot(sample_difference_1 / sample_distance_1, view_vec); + var sample_cos_horizon_2 = dot(sample_difference_2 / sample_distance_2, view_vec); + + let weight_1 = saturate(sample_distance_1 * falloff_mul + falloff_add); + let weight_2 = saturate(sample_distance_2 * falloff_mul + falloff_add); + sample_cos_horizon_1 = mix(min_cos_horizon_1, sample_cos_horizon_1, weight_1); + sample_cos_horizon_2 = mix(min_cos_horizon_2, sample_cos_horizon_2, weight_2); + + cos_horizon_1 = max(cos_horizon_1, sample_cos_horizon_1); + cos_horizon_2 = max(cos_horizon_2, sample_cos_horizon_2); + } + + let horizon_1 = fast_acos(cos_horizon_1); + let horizon_2 = -fast_acos(cos_horizon_2); + let v1 = (cos_norm + 2.0 * horizon_1 * sin(n) - cos(2.0 * horizon_1 - n)) / 4.0; + let v2 = (cos_norm + 2.0 * horizon_2 * sin(n) - cos(2.0 * horizon_2 - n)) / 4.0; + visibility += projected_normal_length * (v1 + v2); + } + visibility /= slice_count; + visibility = clamp(visibility, 0.03, 1.0); + + textureStore(ambient_occlusion, pixel_coordinates, vec4(visibility, 0.0, 0.0, 0.0)); +} diff --git a/mods/ao_mod/res/licenses/BEVY-APACHE-2.0.txt b/mods/ao_mod/res/licenses/BEVY-APACHE-2.0.txt new file mode 100644 index 0000000000..d9a10c0d8e --- /dev/null +++ b/mods/ao_mod/res/licenses/BEVY-APACHE-2.0.txt @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/mods/ao_mod/res/licenses/BEVY-MIT.txt b/mods/ao_mod/res/licenses/BEVY-MIT.txt new file mode 100644 index 0000000000..9cf106272a --- /dev/null +++ b/mods/ao_mod/res/licenses/BEVY-MIT.txt @@ -0,0 +1,19 @@ +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mods/ao_mod/res/licenses/XEGTAO-MIT.txt b/mods/ao_mod/res/licenses/XEGTAO-MIT.txt new file mode 100644 index 0000000000..2b1bd1561b --- /dev/null +++ b/mods/ao_mod/res/licenses/XEGTAO-MIT.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2016-2021, Intel Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mods/ao_mod/res/preprocess_depth.wgsl b/mods/ao_mod/res/preprocess_depth.wgsl new file mode 100644 index 0000000000..98fe1d5400 --- /dev/null +++ b/mods/ao_mod/res/preprocess_depth.wgsl @@ -0,0 +1,138 @@ +// Inputs a depth texture and outputs a MIP-chain of depths. +// +// Because SSAO's performance is bound by texture reads, this increases +// performance over using the full resolution depth for every sample. +// +// Reference: https://research.nvidia.com/sites/default/files/pubs/2012-06_Scalable-Ambient-Obscurance/McGuire12SAO.pdf, section 2.2 +// +// Ported from Bevy Engine, crates/bevy_pbr/src/ssao/preprocess_depth.wgsl (v0.13.2), +// licensed MIT OR Apache-2.0 (see res/licenses/), itself derived from Intel XeGTAO (MIT). +// +// PORT: sampler-based gathers replaced with textureLoad (r32float is not filterable without +// optional device features), Bevy view uniforms replaced with the mod's own uniform block, +// storage format r16float -> r32float (core WebGPU storage format). MIP 4 moved into its own +// entry point (core WebGPU limit is 4 storage textures per stage). + +struct Uniforms { + projection: mat4x4f, + inverse_projection: mat4x4f, + size: vec2f, // AO chain size in pixels (MIP 0 of the preprocessed depth) + inv_size: vec2f, + depth_scale: vec2f, // input depth snapshot pixels per chain pixel (1 or 2) + effect_radius: f32, // view-space units + intensity: f32, + slice_count: f32, + samples_per_slice_side: f32, + debug_view: u32, + _pad: f32, +} + +@group(0) @binding(0) var input_depth: texture_2d; +@group(0) @binding(1) var preprocessed_depth_mip0: texture_storage_2d; +@group(0) @binding(2) var preprocessed_depth_mip1: texture_storage_2d; +@group(0) @binding(3) var preprocessed_depth_mip2: texture_storage_2d; +@group(0) @binding(4) var preprocessed_depth_mip3: texture_storage_2d; +@group(0) @binding(5) var uniforms: Uniforms; +// downsample_mip4 entry point only (disjoint subresources of the same texture). +@group(0) @binding(6) var preprocessed_depth_mip3_in: texture_2d; +@group(0) @binding(7) var preprocessed_depth_mip4: texture_storage_2d; + +// PORT: replaces the textureGather of the input depth with explicit loads (also handles the +// half-resolution case, where one chain texel covers depth_scale snapshot texels). +fn load_input_depth(pixel_coordinates: vec2) -> f32 { + let input_size = vec2(uniforms.size * uniforms.depth_scale); + let coordinates = clamp(vec2(vec2(pixel_coordinates) * uniforms.depth_scale), + vec2(0i), input_size - 1i); + return textureLoad(input_depth, coordinates, 0i).r; +} + +// Using 4 depths from the previous MIP, compute a weighted average for the depth of the current MIP +fn weighted_average(depth0: f32, depth1: f32, depth2: f32, depth3: f32) -> f32 { + let depth_range_scale_factor = 0.75; + let effect_radius = depth_range_scale_factor * 0.5 * 1.457; + let falloff_range = 0.615 * effect_radius; + let falloff_from = effect_radius * (1.0 - 0.615); + let falloff_mul = -1.0 / falloff_range; + let falloff_add = falloff_from / falloff_range + 1.0; + + let min_depth = min(min(depth0, depth1), min(depth2, depth3)); + let weight0 = saturate((depth0 - min_depth) * falloff_mul + falloff_add); + let weight1 = saturate((depth1 - min_depth) * falloff_mul + falloff_add); + let weight2 = saturate((depth2 - min_depth) * falloff_mul + falloff_add); + let weight3 = saturate((depth3 - min_depth) * falloff_mul + falloff_add); + let weight_total = weight0 + weight1 + weight2 + weight3; + + return ((weight0 * depth0) + (weight1 * depth1) + (weight2 * depth2) + (weight3 * depth3)) / weight_total; +} + +// Used to share the depths from the previous MIP level between all invocations in a workgroup +var previous_mip_depth: array, 8>; + +@compute +@workgroup_size(8, 8, 1) +fn preprocess_depth(@builtin(global_invocation_id) global_id: vec3, @builtin(local_invocation_id) local_id: vec3) { + let base_coordinates = vec2(global_id.xy); + + // MIP 0 - Copy 4 texels from the input depth (per invocation, 8x8 invocations per workgroup) + let pixel_coordinates0 = base_coordinates * 2i; + let pixel_coordinates1 = pixel_coordinates0 + vec2(1i, 0i); + let pixel_coordinates2 = pixel_coordinates0 + vec2(0i, 1i); + let pixel_coordinates3 = pixel_coordinates0 + vec2(1i, 1i); + let depth0 = load_input_depth(pixel_coordinates0); + let depth1 = load_input_depth(pixel_coordinates1); + let depth2 = load_input_depth(pixel_coordinates2); + let depth3 = load_input_depth(pixel_coordinates3); + textureStore(preprocessed_depth_mip0, pixel_coordinates0, vec4(depth0, 0.0, 0.0, 0.0)); + textureStore(preprocessed_depth_mip0, pixel_coordinates1, vec4(depth1, 0.0, 0.0, 0.0)); + textureStore(preprocessed_depth_mip0, pixel_coordinates2, vec4(depth2, 0.0, 0.0, 0.0)); + textureStore(preprocessed_depth_mip0, pixel_coordinates3, vec4(depth3, 0.0, 0.0, 0.0)); + + // MIP 1 - Weighted average of MIP 0's depth values (per invocation, 8x8 invocations per workgroup) + let depth_mip1 = weighted_average(depth0, depth1, depth2, depth3); + textureStore(preprocessed_depth_mip1, base_coordinates, vec4(depth_mip1, 0.0, 0.0, 0.0)); + previous_mip_depth[local_id.x][local_id.y] = depth_mip1; + + workgroupBarrier(); + + // MIP 2 - Weighted average of MIP 1's depth values (per invocation, 4x4 invocations per workgroup) + if all(local_id.xy % vec2(2u) == vec2(0u)) { + let mip2_depth0 = previous_mip_depth[local_id.x + 0u][local_id.y + 0u]; + let mip2_depth1 = previous_mip_depth[local_id.x + 1u][local_id.y + 0u]; + let mip2_depth2 = previous_mip_depth[local_id.x + 0u][local_id.y + 1u]; + let mip2_depth3 = previous_mip_depth[local_id.x + 1u][local_id.y + 1u]; + let depth_mip2 = weighted_average(mip2_depth0, mip2_depth1, mip2_depth2, mip2_depth3); + textureStore(preprocessed_depth_mip2, base_coordinates / 2i, vec4(depth_mip2, 0.0, 0.0, 0.0)); + previous_mip_depth[local_id.x][local_id.y] = depth_mip2; + } + + workgroupBarrier(); + + // MIP 3 - Weighted average of MIP 2's depth values (per invocation, 2x2 invocations per workgroup) + if all(local_id.xy % vec2(4u) == vec2(0u)) { + let mip3_depth0 = previous_mip_depth[local_id.x + 0u][local_id.y + 0u]; + let mip3_depth1 = previous_mip_depth[local_id.x + 2u][local_id.y + 0u]; + let mip3_depth2 = previous_mip_depth[local_id.x + 0u][local_id.y + 2u]; + let mip3_depth3 = previous_mip_depth[local_id.x + 2u][local_id.y + 2u]; + let depth_mip3 = weighted_average(mip3_depth0, mip3_depth1, mip3_depth2, mip3_depth3); + textureStore(preprocessed_depth_mip3, base_coordinates / 4i, vec4(depth_mip3, 0.0, 0.0, 0.0)); + previous_mip_depth[local_id.x][local_id.y] = depth_mip3; + } +} + +// MIP 4: weighted average of MIP 3's depth values, as a second (tiny) dispatch. +@compute +@workgroup_size(8, 8, 1) +fn downsample_mip4(@builtin(global_invocation_id) global_id: vec3) { + let base_coordinates = vec2(global_id.xy); + let mip3_size = max(vec2(textureDimensions(preprocessed_depth_mip3_in)), vec2(1i)); + let coordinates0 = clamp(base_coordinates * 2i, vec2(0i), mip3_size - 1i); + let coordinates1 = clamp(base_coordinates * 2i + vec2(1i, 0i), vec2(0i), mip3_size - 1i); + let coordinates2 = clamp(base_coordinates * 2i + vec2(0i, 1i), vec2(0i), mip3_size - 1i); + let coordinates3 = clamp(base_coordinates * 2i + vec2(1i, 1i), vec2(0i), mip3_size - 1i); + let depth0 = textureLoad(preprocessed_depth_mip3_in, coordinates0, 0i).r; + let depth1 = textureLoad(preprocessed_depth_mip3_in, coordinates1, 0i).r; + let depth2 = textureLoad(preprocessed_depth_mip3_in, coordinates2, 0i).r; + let depth3 = textureLoad(preprocessed_depth_mip3_in, coordinates3, 0i).r; + let depth_mip4 = weighted_average(depth0, depth1, depth2, depth3); + textureStore(preprocessed_depth_mip4, base_coordinates, vec4(depth_mip4, 0.0, 0.0, 0.0)); +} diff --git a/mods/ao_mod/src/mod.cpp b/mods/ao_mod/src/mod.cpp new file mode 100644 index 0000000000..fb36ddb40c --- /dev/null +++ b/mods/ao_mod/src/mod.cpp @@ -0,0 +1,931 @@ +// Ambient occlusion (GTAO) example mod. +// +// Showcases the gfx service's compute tasks and the camera service: after opaque scene draws, +// before translucent/fog overlays, the scene depth is resolved and a three-dispatch compute +// chain (depth MIP prefilter, GTAO, spatial denoise) produces a visibility texture that a +// fullscreen draw multiplies over the world. +// +// The WGSL in res/ is ported from Bevy Engine's SSAO implementation (MIT OR Apache-2.0), +// itself based on Intel XeGTAO (MIT); see res/licenses/ and the `PORT:` notes in the shaders. + +#include "mods/service.hpp" +#include "mods/svc/camera.h" +#include "mods/svc/config.h" +#include "mods/svc/gfx.h" +#include "mods/svc/log.h" +#include "mods/svc/resource.h" +#include "mods/svc/ui.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +DEFINE_MOD(); +IMPORT_SERVICE(LogService, svc_log); +IMPORT_SERVICE(ConfigService, svc_config); +IMPORT_SERVICE(ResourceService, svc_resource); +IMPORT_SERVICE(UiService, svc_ui); +IMPORT_SERVICE(GfxService, svc_gfx); +IMPORT_SERVICE(CameraService, svc_camera); + +namespace { + +ConfigVarHandle g_cvarEnabled = 0; +ConfigVarHandle g_cvarQuality = 0; +ConfigVarHandle g_cvarRadius = 0; +ConfigVarHandle g_cvarIntensity = 0; +ConfigVarHandle g_cvarHalfRes = 0; +ConfigVarHandle g_cvarDebugView = 0; + +GfxComputeTypeHandle g_computeType = 0; +GfxDrawTypeHandle g_drawType = 0; +GfxStageHookHandle g_afterOpaqueHook = 0; +UiWindowHandle g_controlsWindow = 0; + +ResourceBuffer g_preprocessSource = RESOURCE_BUFFER_INIT; +ResourceBuffer g_gtaoSource = RESOURCE_BUFFER_INIT; +ResourceBuffer g_denoiseSource = RESOURCE_BUFFER_INIT; +ResourceBuffer g_compositeSource = RESOURCE_BUFFER_INIT; + +GfxDeviceInfo g_deviceInfo = GFX_DEVICE_INFO_INIT; +WGPUComputePipeline g_preprocessPipeline = nullptr; +WGPUComputePipeline g_mip4Pipeline = nullptr; +WGPUComputePipeline g_gtaoPipeline = nullptr; +WGPUComputePipeline g_denoisePipeline = nullptr; +WGPUBindGroupLayout g_preprocessLayout = nullptr; +WGPUBindGroupLayout g_mip4Layout = nullptr; +WGPUBindGroupLayout g_gtaoLayout = nullptr; +WGPUBindGroupLayout g_denoiseLayout = nullptr; +WGPURenderPipeline g_compositePipeline = nullptr; +WGPURenderPipeline g_compositeDebugPipeline = nullptr; +WGPUBindGroupLayout g_compositeLayout = nullptr; +WGPUBindGroupLayout g_compositeDebugLayout = nullptr; +WGPUTexture g_hilbertLut = nullptr; +WGPUTextureView g_hilbertLutView = nullptr; + +// AO chain targets, recreated when the render size (or halfRes) changes. Old sets are retired +// for a few frames instead of released immediately: payloads embedding their views may still +// be in flight on the render worker. +struct AoTargets { + uint32_t width = 0; + uint32_t height = 0; + WGPUTexture preprocessedDepth = nullptr; + WGPUTextureView preprocessedDepthMips[5] = {}; + WGPUTextureView preprocessedDepthAll = nullptr; + WGPUTexture aoNoisy = nullptr; + WGPUTextureView aoNoisyView = nullptr; + WGPUTexture depthDifferences = nullptr; + WGPUTextureView depthDifferencesView = nullptr; + WGPUTexture aoFinal = nullptr; + WGPUTextureView aoFinalView = nullptr; +}; +AoTargets g_targets; +struct RetiredTargets { + AoTargets targets; + int framesLeft = 0; +}; +std::vector g_retiredTargets; + +bool g_warnedNoDepth = false; +bool g_loggedChain = false; +std::atomic g_chainExecuted{false}; + +// Mirror of the WGSL Uniforms struct (keep in sync with res/*.wgsl). +struct AoUniforms { + float projection[16]; + float inverse_projection[16]; + float size[2]; + float inv_size[2]; + float depth_scale[2]; + float effect_radius; + float intensity; + float slice_count; + float samples_per_slice_side; + uint32_t debug_view; + float _pad; +}; +static_assert(sizeof(AoUniforms) % 16 == 0); + +struct ComputePayload { + WGPUTextureView depth; // frame-pooled scene depth snapshot + WGPUTextureView preprocessedDepthMips[5]; + WGPUTextureView preprocessedDepthAll; + WGPUTextureView aoNoisy; + WGPUTextureView depthDifferences; + WGPUTextureView aoFinal; + uint32_t uniform_offset; + uint32_t uniform_size; + uint32_t width; + uint32_t height; +}; +static_assert(sizeof(ComputePayload) <= GFX_INLINE_DRAW_PAYLOAD_SIZE); +static_assert(std::is_trivially_copyable_v); + +struct CompositePayload { + WGPUTextureView aoFinal; + WGPUTextureView preprocessedDepth; // debug views reconstruct normals/depth from it + WGPUTextureView sceneDepth; // raw snapshot, for the bypass debug views + uint32_t uniform_offset; + uint32_t uniform_size; + uint32_t debug_view; +}; +static_assert(sizeof(CompositePayload) <= GFX_INLINE_DRAW_PAYLOAD_SIZE); +static_assert(std::is_trivially_copyable_v); + +int64_t get_int_option(ConfigVarHandle handle, int64_t fallback) { + int64_t value = fallback; + if (handle == 0 || svc_config->get_int(mod_ctx, handle, &value) != MOD_OK) { + return fallback; + } + return value; +} + +bool get_bool_option(ConfigVarHandle handle, bool fallback) { + bool value = fallback; + if (handle == 0 || svc_config->get_bool(mod_ctx, handle, &value) != MOD_OK) { + return fallback; + } + return value; +} + +// XeGTAO/Bevy quality presets: slices x (samples per slice side * 2). +void quality_counts(int64_t quality, float& sliceCount, float& samplesPerSliceSide) { + switch (std::clamp(quality, 0, 3)) { + case 0: + sliceCount = 1.0f; + samplesPerSliceSide = 2.0f; + break; + case 1: + sliceCount = 2.0f; + samplesPerSliceSide = 2.0f; + break; + default: + case 2: + sliceCount = 3.0f; + samplesPerSliceSide = 3.0f; + break; + case 3: + sliceCount = 9.0f; + samplesPerSliceSide = 3.0f; + break; + } +} + +WGPUShaderModule create_shader_module(const char* label, const ResourceBuffer& source) { + WGPUShaderSourceWGSL wgsl = WGPU_SHADER_SOURCE_WGSL_INIT; + wgsl.code = {static_cast(source.data), source.size}; + WGPUShaderModuleDescriptor moduleDesc = WGPU_SHADER_MODULE_DESCRIPTOR_INIT; + moduleDesc.nextInChain = &wgsl.chain; + moduleDesc.label = {label, WGPU_STRLEN}; + return wgpuDeviceCreateShaderModule(g_deviceInfo.device, &moduleDesc); +} + +bool build_compute_pipeline(const char* label, const ResourceBuffer& source, const char* entry, + WGPUComputePipeline& outPipeline, WGPUBindGroupLayout& outLayout) { + WGPUShaderModule module = create_shader_module(label, source); + if (module == nullptr) { + return false; + } + WGPUComputePipelineDescriptor pipelineDesc = WGPU_COMPUTE_PIPELINE_DESCRIPTOR_INIT; + pipelineDesc.label = {label, WGPU_STRLEN}; + pipelineDesc.compute.module = module; + pipelineDesc.compute.entryPoint = {entry, WGPU_STRLEN}; + outPipeline = wgpuDeviceCreateComputePipeline(g_deviceInfo.device, &pipelineDesc); + wgpuShaderModuleRelease(module); + if (outPipeline == nullptr) { + return false; + } + outLayout = wgpuComputePipelineGetBindGroupLayout(outPipeline, 0); + return outLayout != nullptr; +} + +bool build_composite_pipeline( + bool blend, WGPURenderPipeline& outPipeline, WGPUBindGroupLayout& outLayout) { + WGPUShaderModule module = create_shader_module("AO composite", g_compositeSource); + if (module == nullptr) { + return false; + } + + // Multiply blend + WGPUBlendState blendState{ + .color = + { + .operation = WGPUBlendOperation_Add, + .srcFactor = WGPUBlendFactor_Dst, + .dstFactor = WGPUBlendFactor_Zero, + }, + .alpha = + { + .operation = WGPUBlendOperation_Add, + .srcFactor = WGPUBlendFactor_Zero, + .dstFactor = WGPUBlendFactor_One, + }, + }; + WGPUColorTargetState colorTarget = WGPU_COLOR_TARGET_STATE_INIT; + colorTarget.format = g_deviceInfo.color_format; + if (blend) { + colorTarget.blend = &blendState; + } + WGPUFragmentState fragment = WGPU_FRAGMENT_STATE_INIT; + fragment.module = module; + fragment.entryPoint = {"fs_main", WGPU_STRLEN}; + fragment.targetCount = 1; + fragment.targets = &colorTarget; + // Depth state must match the EFB pass despite never touching depth. + WGPUDepthStencilState depthStencil = WGPU_DEPTH_STENCIL_STATE_INIT; + depthStencil.format = g_deviceInfo.depth_format; + depthStencil.depthWriteEnabled = WGPUOptionalBool_False; + depthStencil.depthCompare = WGPUCompareFunction_Always; + + WGPURenderPipelineDescriptor pipelineDesc = WGPU_RENDER_PIPELINE_DESCRIPTOR_INIT; + pipelineDesc.label = {blend ? "AO composite" : "AO composite (debug)", WGPU_STRLEN}; + pipelineDesc.vertex.module = module; + pipelineDesc.vertex.entryPoint = {"vs_main", WGPU_STRLEN}; + pipelineDesc.primitive.topology = WGPUPrimitiveTopology_TriangleList; + pipelineDesc.depthStencil = &depthStencil; + pipelineDesc.multisample.count = g_deviceInfo.sample_count; + pipelineDesc.fragment = &fragment; + outPipeline = wgpuDeviceCreateRenderPipeline(g_deviceInfo.device, &pipelineDesc); + wgpuShaderModuleRelease(module); + if (outPipeline == nullptr) { + return false; + } + outLayout = wgpuRenderPipelineGetBindGroupLayout(outPipeline, 0); + return outLayout != nullptr; +} + +// Hilbert curve index LUT for the R2 noise sequence, generated once at init. +// Ported from Bevy's generate_hilbert_index_lut (https://www.shadertoy.com/view/3tB3z3). +uint16_t hilbert_index(uint16_t x, uint16_t y) { + uint16_t index = 0; + for (uint16_t level = 32; level > 0; level /= 2) { + const uint16_t regionX = (x & level) > 0 ? 1 : 0; + const uint16_t regionY = (y & level) > 0 ? 1 : 0; + index += level * level * ((3 * regionX) ^ regionY); + if (regionY == 0) { + if (regionX == 1) { + x = 63 - x; + y = 63 - y; + } + std::swap(x, y); + } + } + return index; +} + +bool build_hilbert_lut() { + WGPUTextureDescriptor texDesc = WGPU_TEXTURE_DESCRIPTOR_INIT; + texDesc.label = {"AO hilbert LUT", WGPU_STRLEN}; + texDesc.usage = WGPUTextureUsage_TextureBinding | WGPUTextureUsage_CopyDst; + texDesc.size = {64, 64, 1}; + texDesc.format = WGPUTextureFormat_R16Uint; + g_hilbertLut = wgpuDeviceCreateTexture(g_deviceInfo.device, &texDesc); + if (g_hilbertLut == nullptr) { + return false; + } + g_hilbertLutView = wgpuTextureCreateView(g_hilbertLut, nullptr); + if (g_hilbertLutView == nullptr) { + return false; + } + + uint16_t lut[64 * 64]; + for (uint16_t y = 0; y < 64; ++y) { + for (uint16_t x = 0; x < 64; ++x) { + lut[y * 64 + x] = hilbert_index(x, y); + } + } + WGPUTexelCopyTextureInfo dst = WGPU_TEXEL_COPY_TEXTURE_INFO_INIT; + dst.texture = g_hilbertLut; + WGPUTexelCopyBufferLayout layout{.offset = 0, .bytesPerRow = 64 * 2, .rowsPerImage = 64}; + WGPUExtent3D extent{64, 64, 1}; + wgpuQueueWriteTexture(g_deviceInfo.queue, &dst, lut, sizeof(lut), &layout, &extent); + return true; +} + +void release_targets(AoTargets& targets) { + for (auto*& view : targets.preprocessedDepthMips) { + if (view != nullptr) { + wgpuTextureViewRelease(view); + view = nullptr; + } + } + const auto releaseView = [](WGPUTextureView& view) { + if (view != nullptr) { + wgpuTextureViewRelease(view); + view = nullptr; + } + }; + const auto releaseTexture = [](WGPUTexture& texture) { + if (texture != nullptr) { + wgpuTextureRelease(texture); + texture = nullptr; + } + }; + releaseView(targets.preprocessedDepthAll); + releaseView(targets.aoNoisyView); + releaseView(targets.depthDifferencesView); + releaseView(targets.aoFinalView); + releaseTexture(targets.preprocessedDepth); + releaseTexture(targets.aoNoisy); + releaseTexture(targets.depthDifferences); + releaseTexture(targets.aoFinal); + targets.width = targets.height = 0; +} + +void tick_retired_targets() { + for (auto it = g_retiredTargets.begin(); it != g_retiredTargets.end();) { + if (--it->framesLeft <= 0) { + release_targets(it->targets); + it = g_retiredTargets.erase(it); + } else { + ++it; + } + } +} + +bool ensure_targets(uint32_t width, uint32_t height) { + if (g_targets.width == width && g_targets.height == height) { + return true; + } + if (g_targets.width != 0) { + g_retiredTargets.push_back(RetiredTargets{std::exchange(g_targets, AoTargets{}), 4}); + } + + const auto createStorageTexture = [&](const char* label, WGPUTextureFormat format, + uint32_t mipCount, WGPUTexture& outTexture) { + WGPUTextureDescriptor texDesc = WGPU_TEXTURE_DESCRIPTOR_INIT; + texDesc.label = {label, WGPU_STRLEN}; + texDesc.usage = WGPUTextureUsage_StorageBinding | WGPUTextureUsage_TextureBinding; + texDesc.size = {width, height, 1}; + texDesc.format = format; + texDesc.mipLevelCount = mipCount; + outTexture = wgpuDeviceCreateTexture(g_deviceInfo.device, &texDesc); + return outTexture != nullptr; + }; + + bool ok = createStorageTexture("AO preprocessed depth", WGPUTextureFormat_R32Float, 5, + g_targets.preprocessedDepth) && + createStorageTexture("AO noisy", WGPUTextureFormat_R32Float, 1, g_targets.aoNoisy) && + createStorageTexture("AO depth differences", WGPUTextureFormat_R32Uint, 1, + g_targets.depthDifferences) && + createStorageTexture("AO final", WGPUTextureFormat_R32Float, 1, g_targets.aoFinal); + if (ok) { + for (uint32_t mip = 0; mip < 5 && ok; ++mip) { + WGPUTextureViewDescriptor viewDesc = WGPU_TEXTURE_VIEW_DESCRIPTOR_INIT; + viewDesc.baseMipLevel = mip; + viewDesc.mipLevelCount = 1; + g_targets.preprocessedDepthMips[mip] = + wgpuTextureCreateView(g_targets.preprocessedDepth, &viewDesc); + ok = g_targets.preprocessedDepthMips[mip] != nullptr; + } + } + if (ok) { + g_targets.preprocessedDepthAll = + wgpuTextureCreateView(g_targets.preprocessedDepth, nullptr); + g_targets.aoNoisyView = wgpuTextureCreateView(g_targets.aoNoisy, nullptr); + g_targets.depthDifferencesView = wgpuTextureCreateView(g_targets.depthDifferences, nullptr); + g_targets.aoFinalView = wgpuTextureCreateView(g_targets.aoFinal, nullptr); + ok = g_targets.preprocessedDepthAll != nullptr && g_targets.aoNoisyView != nullptr && + g_targets.depthDifferencesView != nullptr && g_targets.aoFinalView != nullptr; + } + if (!ok) { + release_targets(g_targets); + return false; + } + g_targets.width = width; + g_targets.height = height; + return true; +} + +constexpr uint32_t div_ceil(uint32_t numerator, uint32_t denominator) { + return (numerator + denominator - 1) / denominator; +} + +// Render worker thread: the AO chain as one compute pass with three dispatches. +void on_compute( + ModContext*, const GfxComputeContext* ctx, const void* payload, size_t payloadSize, void*) { + if (payloadSize != sizeof(ComputePayload)) { + return; + } + ComputePayload data; + std::memcpy(&data, payload, sizeof(data)); + if (data.depth == nullptr || g_preprocessPipeline == nullptr) { + return; + } + + const auto makeBindGroup = [&](WGPUBindGroupLayout layout, + std::initializer_list entries) { + WGPUBindGroupDescriptor bindGroupDesc = WGPU_BIND_GROUP_DESCRIPTOR_INIT; + bindGroupDesc.layout = layout; + bindGroupDesc.entryCount = entries.size(); + bindGroupDesc.entries = entries.begin(); + return wgpuDeviceCreateBindGroup(ctx->device, &bindGroupDesc); + }; + const auto textureEntry = [](uint32_t binding, WGPUTextureView view) { + WGPUBindGroupEntry entry = WGPU_BIND_GROUP_ENTRY_INIT; + entry.binding = binding; + entry.textureView = view; + return entry; + }; + const auto uniformEntry = [&](uint32_t binding) { + WGPUBindGroupEntry entry = WGPU_BIND_GROUP_ENTRY_INIT; + entry.binding = binding; + entry.buffer = ctx->uniform_buffer; + entry.offset = data.uniform_offset; + entry.size = data.uniform_size; + return entry; + }; + + WGPUBindGroup preprocessGroup = makeBindGroup(g_preprocessLayout, + {textureEntry(0, data.depth), textureEntry(1, data.preprocessedDepthMips[0]), + textureEntry(2, data.preprocessedDepthMips[1]), + textureEntry(3, data.preprocessedDepthMips[2]), + textureEntry(4, data.preprocessedDepthMips[3]), uniformEntry(5)}); + WGPUBindGroup mip4Group = + makeBindGroup(g_mip4Layout, {textureEntry(6, data.preprocessedDepthMips[3]), + textureEntry(7, data.preprocessedDepthMips[4])}); + WGPUBindGroup gtaoGroup = makeBindGroup( + g_gtaoLayout, {textureEntry(0, data.preprocessedDepthAll), + textureEntry(1, g_hilbertLutView), textureEntry(2, data.aoNoisy), + textureEntry(3, data.depthDifferences), uniformEntry(4)}); + WGPUBindGroup denoiseGroup = makeBindGroup( + g_denoiseLayout, {textureEntry(0, data.aoNoisy), textureEntry(1, data.depthDifferences), + textureEntry(2, data.aoFinal), uniformEntry(3)}); + if (preprocessGroup == nullptr || mip4Group == nullptr || gtaoGroup == nullptr || + denoiseGroup == nullptr) + { + const auto release = [](WGPUBindGroup group) { + if (group != nullptr) { + wgpuBindGroupRelease(group); + } + }; + release(preprocessGroup); + release(mip4Group); + release(gtaoGroup); + release(denoiseGroup); + return; + } + + WGPUComputePassDescriptor passDesc = WGPU_COMPUTE_PASS_DESCRIPTOR_INIT; + passDesc.label = {"AO chain", WGPU_STRLEN}; + WGPUComputePassEncoder pass = wgpuCommandEncoderBeginComputePass(ctx->encoder, &passDesc); + // Each preprocess workgroup covers 16x16 MIP-0 texels (8x8 invocations, 2x2 texels each). + wgpuComputePassEncoderSetPipeline(pass, g_preprocessPipeline); + wgpuComputePassEncoderSetBindGroup(pass, 0, preprocessGroup, 0, nullptr); + wgpuComputePassEncoderDispatchWorkgroups( + pass, div_ceil(data.width, 16), div_ceil(data.height, 16), 1); + wgpuComputePassEncoderSetPipeline(pass, g_mip4Pipeline); + wgpuComputePassEncoderSetBindGroup(pass, 0, mip4Group, 0, nullptr); + wgpuComputePassEncoderDispatchWorkgroups(pass, div_ceil(std::max(data.width >> 4, 1u), 8), + div_ceil(std::max(data.height >> 4, 1u), 8), 1); + wgpuComputePassEncoderSetPipeline(pass, g_gtaoPipeline); + wgpuComputePassEncoderSetBindGroup(pass, 0, gtaoGroup, 0, nullptr); + wgpuComputePassEncoderDispatchWorkgroups( + pass, div_ceil(data.width, 8), div_ceil(data.height, 8), 1); + wgpuComputePassEncoderSetPipeline(pass, g_denoisePipeline); + wgpuComputePassEncoderSetBindGroup(pass, 0, denoiseGroup, 0, nullptr); + wgpuComputePassEncoderDispatchWorkgroups( + pass, div_ceil(data.width, 8), div_ceil(data.height, 8), 1); + wgpuComputePassEncoderEnd(pass); + wgpuComputePassEncoderRelease(pass); + + wgpuBindGroupRelease(preprocessGroup); + wgpuBindGroupRelease(mip4Group); + wgpuBindGroupRelease(gtaoGroup); + wgpuBindGroupRelease(denoiseGroup); + g_chainExecuted.store(true, std::memory_order_release); +} + +// Render worker thread: composite the AO over the scene (or show it, in debug view). +void on_draw( + ModContext*, const GfxDrawContext* ctx, const void* payload, size_t payloadSize, void*) { + if (payloadSize != sizeof(CompositePayload)) { + return; + } + CompositePayload data; + std::memcpy(&data, payload, sizeof(data)); + WGPURenderPipeline pipeline = + data.debug_view != 0 ? g_compositeDebugPipeline : g_compositePipeline; + WGPUBindGroupLayout layout = data.debug_view != 0 ? g_compositeDebugLayout : g_compositeLayout; + if (data.aoFinal == nullptr || data.preprocessedDepth == nullptr || + data.sceneDepth == nullptr || pipeline == nullptr) + { + return; + } + + WGPUBindGroupEntry entries[4] = {WGPU_BIND_GROUP_ENTRY_INIT, WGPU_BIND_GROUP_ENTRY_INIT, + WGPU_BIND_GROUP_ENTRY_INIT, WGPU_BIND_GROUP_ENTRY_INIT}; + entries[0].binding = 0; + entries[0].textureView = data.aoFinal; + entries[1].binding = 1; + entries[1].textureView = data.preprocessedDepth; + entries[2].binding = 2; + entries[2].textureView = data.sceneDepth; + entries[3].binding = 3; + entries[3].buffer = ctx->uniform_buffer; + entries[3].offset = data.uniform_offset; + entries[3].size = data.uniform_size; + WGPUBindGroupDescriptor bindGroupDesc = WGPU_BIND_GROUP_DESCRIPTOR_INIT; + bindGroupDesc.layout = layout; + bindGroupDesc.entryCount = 4; + bindGroupDesc.entries = entries; + WGPUBindGroup bindGroup = wgpuDeviceCreateBindGroup(ctx->device, &bindGroupDesc); + if (bindGroup == nullptr) { + return; + } + + wgpuRenderPassEncoderSetPipeline(ctx->pass, pipeline); + wgpuRenderPassEncoderSetBindGroup(ctx->pass, 0, bindGroup, 0, nullptr); + wgpuRenderPassEncoderDraw(ctx->pass, 3, 1, 0, 0); + wgpuBindGroupRelease(bindGroup); +} + +// Game thread, after opaque scene draws and before translucent/fog overlay lists. +void on_scene_after_opaque(ModContext*, const GfxStageContext* stageCtx, void*) { + tick_retired_targets(); + if (!get_bool_option(g_cvarEnabled, true)) { + return; + } + if (stageCtx == nullptr || stageCtx->struct_size < sizeof(GfxStageContext) || + stageCtx->game_view == nullptr) + { + return; + } + + CameraInfo camera = CAMERA_INFO_INIT; + if (svc_camera->get_camera(mod_ctx, stageCtx->game_view, &camera) != MOD_OK) { + return; + } + + GfxResolveDesc resolveDesc = GFX_RESOLVE_DESC_INIT; + resolveDesc.color = false; + resolveDesc.depth = true; + GfxResolvedTargets resolved = GFX_RESOLVED_TARGETS_INIT; + if (svc_gfx->resolve_pass(mod_ctx, &resolveDesc, &resolved) != MOD_OK || + resolved.depth == nullptr) + { + if (!g_warnedNoDepth) { + g_warnedNoDepth = true; + svc_log->warn(mod_ctx, "depth snapshots unavailable; AO disabled"); + } + return; + } + + const bool halfRes = get_bool_option(g_cvarHalfRes, false); + const uint32_t divisor = halfRes ? 2 : 1; + const uint32_t width = resolved.width / divisor; + const uint32_t height = resolved.height / divisor; + if (width < 32 || height < 32 || !ensure_targets(width, height)) { + return; + } + + AoUniforms uniforms{}; + std::memcpy(uniforms.projection, camera.proj_from_view, sizeof(uniforms.projection)); + std::memcpy( + uniforms.inverse_projection, camera.view_from_proj, sizeof(uniforms.inverse_projection)); + uniforms.size[0] = static_cast(width); + uniforms.size[1] = static_cast(height); + uniforms.inv_size[0] = 1.0f / uniforms.size[0]; + uniforms.inv_size[1] = 1.0f / uniforms.size[1]; + uniforms.depth_scale[0] = static_cast(resolved.width) / uniforms.size[0]; + uniforms.depth_scale[1] = static_cast(resolved.height) / uniforms.size[1]; + uniforms.effect_radius = + static_cast(std::clamp(get_int_option(g_cvarRadius, 70), 10, 500)); + uniforms.intensity = + static_cast(std::clamp(get_int_option(g_cvarIntensity, 100), 0, 100)) / + 100.0f; + quality_counts( + get_int_option(g_cvarQuality, 2), uniforms.slice_count, uniforms.samples_per_slice_side); + const uint32_t debugMode = + static_cast(std::clamp(get_int_option(g_cvarDebugView, 0), 0, 4)); + uniforms.debug_view = debugMode; + + GfxRange uniformRange{0, 0}; + if (svc_gfx->push_uniform(mod_ctx, &uniforms, sizeof(uniforms), &uniformRange) != MOD_OK) { + return; + } + + ComputePayload computePayload{}; + computePayload.depth = resolved.depth; + for (int mip = 0; mip < 5; ++mip) { + computePayload.preprocessedDepthMips[mip] = g_targets.preprocessedDepthMips[mip]; + } + computePayload.preprocessedDepthAll = g_targets.preprocessedDepthAll; + computePayload.aoNoisy = g_targets.aoNoisyView; + computePayload.depthDifferences = g_targets.depthDifferencesView; + computePayload.aoFinal = g_targets.aoFinalView; + computePayload.uniform_offset = uniformRange.offset; + computePayload.uniform_size = uniformRange.size; + computePayload.width = width; + computePayload.height = height; + if (svc_gfx->push_compute(mod_ctx, g_computeType, &computePayload, sizeof(computePayload)) != + MOD_OK) + { + return; + } + + const CompositePayload drawPayload{g_targets.aoFinalView, g_targets.preprocessedDepthAll, + resolved.depth, uniformRange.offset, uniformRange.size, debugMode}; + svc_gfx->push_draw(mod_ctx, g_drawType, &drawPayload, sizeof(drawPayload)); +} + +void add_control(UiElementHandle pane, const UiControlDesc& desc) { + svc_ui->pane_add_control(mod_ctx, pane, &desc, nullptr); +} + +void add_toggle(UiElementHandle pane, const char* label, ConfigVarHandle cvar, const char* help) { + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_TOGGLE; + control.label = label; + control.help_rml = help; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = cvar; + add_control(pane, control); +} + +ModResult build_controls_tab( + ModContext*, UiWindowHandle, UiElementHandle left, UiElementHandle right, void*, ModError*) { + (void)right; + + svc_ui->pane_add_section(mod_ctx, left, "Ambient Occlusion"); + add_toggle(left, "Enabled", g_cvarEnabled, "Enables the GTAO pass."); + + static const char* kQualityOptions[] = {"Low", "Medium", "High", "Ultra"}; + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_SELECT; + control.label = "Quality"; + control.help_rml = "Horizon slices and samples per pixel (XeGTAO presets: 4/8/18/54 spp)."; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = g_cvarQuality; + control.options = kQualityOptions; + control.option_count = 4; + add_control(left, control); + + control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_NUMBER; + control.label = "Radius"; + control.help_rml = "Occlusion sampling radius in world units."; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = g_cvarRadius; + control.min = 10; + control.max = 500; + control.step = 10; + add_control(left, control); + + control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_NUMBER; + control.label = "Intensity"; + control.help_rml = "How strongly occlusion darkens the scene."; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = g_cvarIntensity; + control.min = 0; + control.max = 100; + control.step = 5; + control.suffix = "%"; + add_control(left, control); + + add_toggle(left, "Half Resolution", g_cvarHalfRes, + "Computes AO at half resolution and upscales; faster, slightly softer."); + + static const char* kDebugOptions[] = {"Off", "AO", "Normals", "Depth", "Staircase"}; + control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_SELECT; + control.label = "Debug View"; + control.help_rml = "AO: raw visibility as grayscale.
Normals: the view-space " + "normals the GTAO pass consumes.
Depth: the preprocessed depth " + "as a distance gradient.
Staircase: detects quantized depth - smooth " + "depth is near-black with thin triangle edges, quantized depth lights " + "up across surfaces."; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = g_cvarDebugView; + control.options = kDebugOptions; + control.option_count = 5; + add_control(left, control); + return MOD_OK; +} + +void on_controls_window_closed(ModContext*, UiWindowHandle, void*) { + g_controlsWindow = 0; +} + +void on_open_controls(ModContext*, void*) { + if (g_controlsWindow != 0) { + return; + } + UiTabDesc tabs[1] = {UI_TAB_DESC_INIT}; + tabs[0].title = "Controls"; + tabs[0].build = build_controls_tab; + UiWindowDesc desc = UI_WINDOW_DESC_INIT; + desc.tabs = tabs; + desc.tab_count = 1; + desc.on_closed = on_controls_window_closed; + if (svc_ui->window_push(mod_ctx, &desc, &g_controlsWindow) != MOD_OK) { + svc_log->error(mod_ctx, "failed to open AO controls window"); + } +} + +ModResult build_panel(ModContext*, UiElementHandle panel, void*, ModError*) { + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_TOGGLE; + control.label = "Enabled"; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = g_cvarEnabled; + add_control(panel, control); + + control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_BUTTON; + control.label = "Open Controls"; + control.on_pressed = on_open_controls; + add_control(panel, control); + return MOD_OK; +} + +ModResult register_bool_option( + const char* name, bool defaultValue, ConfigVarHandle& outHandle, ModError* error) { + ConfigVarDesc cvarDesc = CONFIG_VAR_DESC_INIT; + cvarDesc.name = name; + cvarDesc.type = CONFIG_VAR_BOOL; + cvarDesc.default_bool = defaultValue; + if (svc_config->register_var(mod_ctx, &cvarDesc, &outHandle) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register AO option"); + } + return MOD_OK; +} + +ModResult register_int_option( + const char* name, int64_t defaultValue, ConfigVarHandle& outHandle, ModError* error) { + ConfigVarDesc cvarDesc = CONFIG_VAR_DESC_INIT; + cvarDesc.name = name; + cvarDesc.type = CONFIG_VAR_INT; + cvarDesc.default_int = defaultValue; + if (svc_config->register_var(mod_ctx, &cvarDesc, &outHandle) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register AO option"); + } + return MOD_OK; +} + +} // namespace + +extern "C" { + +MOD_EXPORT ModResult mod_initialize(ModError* error) { + ModResult result = svc_resource->load(mod_ctx, "preprocess_depth.wgsl", &g_preprocessSource); + if (result == MOD_OK) { + result = svc_resource->load(mod_ctx, "gtao.wgsl", &g_gtaoSource); + } + if (result == MOD_OK) { + result = svc_resource->load(mod_ctx, "denoise.wgsl", &g_denoiseSource); + } + if (result == MOD_OK) { + result = svc_resource->load(mod_ctx, "composite.wgsl", &g_compositeSource); + } + if (result != MOD_OK) { + return mods::set_error(error, result, "failed to load AO shaders"); + } + + result = register_bool_option("effectEnabled", false, g_cvarEnabled, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("quality", 2, g_cvarQuality, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("radius", 70, g_cvarRadius, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("intensity", 100, g_cvarIntensity, error); + if (result != MOD_OK) { + return result; + } + result = register_bool_option("halfRes", false, g_cvarHalfRes, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("debugMode", 0, g_cvarDebugView, error); + if (result != MOD_OK) { + return result; + } + + if (svc_gfx->get_device_info(mod_ctx, &g_deviceInfo) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to query device info"); + } + if (!build_compute_pipeline("AO preprocess depth", g_preprocessSource, "preprocess_depth", + g_preprocessPipeline, g_preprocessLayout) || + !build_compute_pipeline("AO downsample mip4", g_preprocessSource, "downsample_mip4", + g_mip4Pipeline, g_mip4Layout) || + !build_compute_pipeline("AO gtao", g_gtaoSource, "gtao", g_gtaoPipeline, g_gtaoLayout) || + !build_compute_pipeline( + "AO denoise", g_denoiseSource, "spatial_denoise", g_denoisePipeline, g_denoiseLayout)) + { + return mods::set_error(error, MOD_ERROR, "failed to create AO compute pipelines"); + } + if (!build_composite_pipeline(true, g_compositePipeline, g_compositeLayout) || + !build_composite_pipeline(false, g_compositeDebugPipeline, g_compositeDebugLayout)) + { + return mods::set_error(error, MOD_ERROR, "failed to create AO composite pipeline"); + } + if (!build_hilbert_lut()) { + return mods::set_error(error, MOD_ERROR, "failed to create AO noise LUT"); + } + + GfxComputeTypeDesc computeDesc = GFX_COMPUTE_TYPE_DESC_INIT; + computeDesc.label = "AO chain"; + computeDesc.callback = on_compute; + if (svc_gfx->register_compute_type(mod_ctx, &computeDesc, &g_computeType) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register compute type"); + } + GfxDrawTypeDesc drawDesc = GFX_DRAW_TYPE_DESC_INIT; + drawDesc.label = "AO composite"; + drawDesc.draw = on_draw; + if (svc_gfx->register_draw_type(mod_ctx, &drawDesc, &g_drawType) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register draw type"); + } + GfxStageHookDesc stageDesc = GFX_STAGE_HOOK_DESC_INIT; + stageDesc.callback = on_scene_after_opaque; + if (svc_gfx->register_stage_hook( + mod_ctx, GFX_STAGE_SCENE_AFTER_OPAQUE, &stageDesc, &g_afterOpaqueHook) != MOD_OK) + { + return mods::set_error(error, MOD_ERROR, "failed to register stage hook"); + } + + UiModsPanelDesc panelDesc = UI_MODS_PANEL_DESC_INIT; + panelDesc.build = build_panel; + svc_ui->register_mods_panel(mod_ctx, &panelDesc); + + svc_log->info(mod_ctx, "ao_mod ready"); + return MOD_OK; +} + +MOD_EXPORT ModResult mod_update(ModError*) { + if (!g_loggedChain && g_chainExecuted.load(std::memory_order_acquire)) { + g_loggedChain = true; + svc_log->info(mod_ctx, "AO chain executed OK"); + } + return MOD_OK; +} + +MOD_EXPORT ModResult mod_shutdown(ModError*) { + svc_resource->free(mod_ctx, &g_preprocessSource); + svc_resource->free(mod_ctx, &g_gtaoSource); + svc_resource->free(mod_ctx, &g_denoiseSource); + svc_resource->free(mod_ctx, &g_compositeSource); + + release_targets(g_targets); + for (auto& retired : g_retiredTargets) { + release_targets(retired.targets); + } + g_retiredTargets.clear(); + + const auto releasePipeline = [](WGPUComputePipeline& pipeline) { + if (pipeline != nullptr) { + wgpuComputePipelineRelease(pipeline); + pipeline = nullptr; + } + }; + const auto releaseLayout = [](WGPUBindGroupLayout& layout) { + if (layout != nullptr) { + wgpuBindGroupLayoutRelease(layout); + layout = nullptr; + } + }; + releasePipeline(g_preprocessPipeline); + releasePipeline(g_mip4Pipeline); + releasePipeline(g_gtaoPipeline); + releasePipeline(g_denoisePipeline); + releaseLayout(g_preprocessLayout); + releaseLayout(g_mip4Layout); + releaseLayout(g_gtaoLayout); + releaseLayout(g_denoiseLayout); + if (g_compositePipeline != nullptr) { + wgpuRenderPipelineRelease(g_compositePipeline); + g_compositePipeline = nullptr; + } + if (g_compositeDebugPipeline != nullptr) { + wgpuRenderPipelineRelease(g_compositeDebugPipeline); + g_compositeDebugPipeline = nullptr; + } + releaseLayout(g_compositeLayout); + releaseLayout(g_compositeDebugLayout); + if (g_hilbertLutView != nullptr) { + wgpuTextureViewRelease(g_hilbertLutView); + g_hilbertLutView = nullptr; + } + if (g_hilbertLut != nullptr) { + wgpuTextureRelease(g_hilbertLut); + g_hilbertLut = nullptr; + } + g_cvarEnabled = g_cvarQuality = g_cvarRadius = g_cvarIntensity = 0; + g_cvarHalfRes = g_cvarDebugView = 0; + g_computeType = g_drawType = 0; + g_afterOpaqueHook = 0; + g_controlsWindow = 0; + return MOD_OK; +} +} diff --git a/mods/shadow_mod/CMakeLists.txt b/mods/shadow_mod/CMakeLists.txt new file mode 100644 index 0000000000..ae44eca49c --- /dev/null +++ b/mods/shadow_mod/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.25) +project(shadow_mod CXX) + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(DUSK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE PATH "Path to dusk source root") + option(DUSK_MOD_USE_FULL_TREE "Use full build instead of the minimal mod SDK" OFF) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if (DUSK_MOD_USE_FULL_TREE) + add_subdirectory("${DUSK_DIR}" dusk EXCLUDE_FROM_ALL) + else () + add_subdirectory("${DUSK_DIR}/sdk" dusk-sdk EXCLUDE_FROM_ALL) + endif () +endif () + +add_mod(shadow_mod + FEATURES game webgpu + SOURCES src/mod.cpp + MOD_JSON mod.json + RES_DIR res + BUNDLE +) diff --git a/mods/shadow_mod/mod.json b/mods/shadow_mod/mod.json new file mode 100644 index 0000000000..09fe8a3a84 --- /dev/null +++ b/mods/shadow_mod/mod.json @@ -0,0 +1,7 @@ +{ + "id": "dev.twilitrealm.shadow_mod", + "name": "[Demo] Dynamic Shadows", + "version": "1.0.0", + "author": "encounter", + "description": "Demo showcasing dynamic shadow maps: re-renders geometry from the sun (or moon) point of view and composites real-time shadows over the world, with screen-space contact shadows for fine detail." +} diff --git a/mods/shadow_mod/res/shadow.wgsl b/mods/shadow_mod/res/shadow.wgsl new file mode 100644 index 0000000000..fe69b5bc3a --- /dev/null +++ b/mods/shadow_mod/res/shadow.wgsl @@ -0,0 +1,273 @@ +// Deferred shadow composite: reconstructs the world position of every scene pixel from the +// depth snapshot (CameraService matrices), transforms it into the light's clip space, and +// PCF-compares against the shadow map rendered earlier this frame. Drawn as a fullscreen +// triangle with multiply blending (srcFactor = Dst, dstFactor = Zero) before the HUD. +// +// Depth conventions (both reversed-Z): the scene snapshot has 1.0 at the camera near plane; +// the shadow map, rendered through the game's GX pipeline with a GC-convention light matrix, +// stores clip.z, i.e. 1.0 nearest to the light and 0.0 at the light frustum far plane. +// +// The optional contact-shadow raymarch follows Panos Karabelas' screen-space shadows +// (https://panoskarabelas.com/blog/posts/screen_space_shadows/, MIT via Spartan Engine): +// march from the pixel toward the light in view space and mark occlusion when the ray dips +// behind the depth buffer within a thickness threshold. + +struct Uniforms { + world_from_proj: mat4x4f, // scene depth unproject (camera) + view_from_proj: mat4x4f, // scene depth -> view space (contact shadows) + proj_from_view: mat4x4f, // view -> clip (contact shadows re-projection) + light_vp: mat4x4f, // world -> light receiver projection (UV/depth basis) + light_dir_view: vec3f, // direction *toward* the light, view space, normalized + bias: f32, // shadow-map depth bias (reversed-depth units) + size: vec2f, // shadow map size in texels + inv_size: vec2f, + edge_fade_width: f32, + strength: f32, // final darkening amount, horizon fade baked in + pcf_taps: f32, // 0 = single tap, 1 = 3x3, 2 = 5x5 + contact_enabled: f32, + contact_thickness: f32, // view-space thickness threshold + contact_length: f32, // view-space march distance + debug_mode: u32, // 0 = composite; nonzero modes are diagnostic views + _pad0: f32, +} + +@group(0) @binding(0) var scene_depth: texture_2d; +@group(0) @binding(1) var shadow_map: texture_2d; +@group(0) @binding(2) var uniforms: Uniforms; +@group(0) @binding(3) var light_color: texture_2d; + +struct VertexOutput { + @builtin(position) position: vec4f, + @location(0) uv: vec2f, +} + +@vertex +fn vs_main(@builtin(vertex_index) index: u32) -> VertexOutput { + var out: VertexOutput; + let uv = vec2f(f32((index << 1u) & 2u), f32(index & 2u)); + out.position = vec4f(uv * vec2f(2.0, -2.0) + vec2f(-1.0, 1.0), 0.0, 1.0); + out.uv = uv; + return out; +} + +fn load_shadow(texel: vec2) -> f32 { + let clamped = clamp(texel, vec2(0i), vec2(uniforms.size) - 1i); + return textureLoad(shadow_map, clamped, 0i).r; +} + +// Returns 1.0 when the pixel at light-space depth `receiver` is shadowed by the map texel. +fn shadow_test(texel: vec2, receiver: f32) -> f32 { + // Reversed depth: a larger stored value is closer to the light, i.e. an occluder. + return select(0.0, 1.0, load_shadow(texel) > receiver + uniforms.bias); +} + +// Bilinearly weighted comparison (what a hardware comparison sampler would do): filter the +// four *comparison results*, never the depths themselves. This is what turns per-texel +// staircases into smooth penumbra edges. +fn shadow_compare_bilinear(light_uv: vec2f, receiver: f32) -> f32 { + let coordinates = light_uv * uniforms.size - 0.5; + let base = floor(coordinates); + let fraction = coordinates - base; + let texel = vec2(base); + let s00 = shadow_test(texel, receiver); + let s10 = shadow_test(texel + vec2(1i, 0i), receiver); + let s01 = shadow_test(texel + vec2(0i, 1i), receiver); + let s11 = shadow_test(texel + vec2(1i, 1i), receiver); + let top = mix(s00, s10, fraction.x); + let bottom = mix(s01, s11, fraction.x); + return mix(top, bottom, fraction.y); +} + +fn sample_shadow_pcf(light_uv: vec2f, receiver: f32) -> f32 { + let radius = i32(uniforms.pcf_taps); + var sum = 0.0; + var count = 0.0; + for (var y = -radius; y <= radius; y += 1i) { + for (var x = -radius; x <= radius; x += 1i) { + let offset = vec2f(f32(x), f32(y)) * uniforms.inv_size; + sum += shadow_compare_bilinear(light_uv + offset, receiver); + count += 1.0; + } + } + return sum / count; +} + +// Softly fades shadows out over a small band near the shadow-map edge so receivers do not +// disappear abruptly when they leave the light's coverage area. +fn shadow_edge_fade(light_uv: vec2f) -> f32 { + let edge_texels = uniforms.edge_fade_width; + let edge_uv = edge_texels * max(uniforms.inv_size.x, uniforms.inv_size.y); + let distance_to_edge = min(min(light_uv.x, 1.0 - light_uv.x), min(light_uv.y, 1.0 - light_uv.y)); + // Avoid division by zero when the fade width is zero (no fade). + return select(1.0, saturate(distance_to_edge / edge_uv), edge_uv > 0.0); +} + +fn scene_depth_at(uv: vec2f) -> f32 { + let size = vec2(textureDimensions(scene_depth)); + let texel = clamp(vec2(uv * vec2f(size)), vec2(0i), size - 1i); + return textureLoad(scene_depth, texel, 0i).r; +} + +fn light_color_at(uv: vec2f) -> vec4f { + let size = vec2(textureDimensions(light_color)); + let texel = clamp(vec2(uv * vec2f(size)), vec2(0i), size - 1i); + return textureLoad(light_color, texel, 0i); +} + +fn light_depth_debug_at(uv: vec2f) -> vec3f { + let texel = vec2(uv * uniforms.size); + let depth = load_shadow(texel); + if depth <= 0.0 { + return vec3f(0.0); + } + + let dx = abs(depth - load_shadow(texel + vec2(1i, 0i))); + let dy = abs(depth - load_shadow(texel + vec2(0i, 1i))); + let edge = saturate((dx + dy) * 500.0); + let shade = saturate(depth * 1.5); + let bands = 0.08 * (0.5 + 0.5 * cos(depth * 96.0)); + return vec3f(saturate(shade + bands + edge)); +} + +fn view_position(uv: vec2f, depth: f32) -> vec3f { + let ndc = vec4f(uv.x * 2.0 - 1.0, 1.0 - 2.0 * uv.y, depth, 1.0); + let position = uniforms.view_from_proj * ndc; + return position.xyz / position.w; +} + +// Interleaved gradient noise (Jimenez); fixed per-pixel dither, no temporal rotation. +fn ign(pixel: vec2f) -> f32 { + return fract(52.9829189 * fract(dot(pixel, vec2f(0.06711056, 0.00583715)))); +} + +// Screen-space contact shadows: march toward the light in view space; occluded when the ray +// passes behind the depth buffer by less than the thickness threshold. Faded out with view +// distance: position reconstruction error grows with distance while the thickness threshold +// is fixed, so far surfaces (and anything translucent composited over them - clouds, fog) +// would otherwise pick up dithered false occlusion. Contact shadows are a near-field effect. +fn contact_shadow_fade(view_distance: f32) -> f32 { + return saturate(1.0 - (view_distance - 3000.0) / 5000.0); +} + +fn contact_shadow(origin: vec3f, pixel: vec2f) -> f32 { + let steps = 24; + let step_vec = uniforms.light_dir_view * (uniforms.contact_length / f32(steps)); + var ray = origin + step_vec * ign(pixel); + for (var i = 0; i < steps; i += 1) { + ray += step_vec; + // Project the ray position back to screen space. + let clip = uniforms.proj_from_view * vec4f(ray, 1.0); + if clip.w <= 0.0 { + break; + } + let ray_ndc = clip.xyz / clip.w; + let ray_uv = vec2f(0.5 + 0.5 * ray_ndc.x, 0.5 - 0.5 * ray_ndc.y); + if any(ray_uv < vec2f(0.0)) || any(ray_uv > vec2f(1.0)) { + break; + } + let scene = scene_depth_at(ray_uv); + if scene <= 0.0 { + continue; + } + // Compare in view space: positive delta = the ray is behind the scene surface. + let scene_z = view_position(ray_uv, scene).z; + let delta = scene_z - ray.z; // view space looks down -z; larger z = closer + if delta > 0.0 && delta < uniforms.contact_thickness { + return 1.0; + } + } + return 0.0; +} + +@fragment +fn fs_main(in: VertexOutput) -> @location(0) vec4f { + let depth = scene_depth_at(in.uv); + if uniforms.debug_mode == 1u { + let value = load_shadow(vec2(in.uv * uniforms.size)); + return vec4f(value, value, value, 1.0); + } + if uniforms.debug_mode == 9u || uniforms.debug_mode == 10u { + let color = light_color_at(in.uv); + let color_luma = max(color.r, max(color.g, color.b)); + let depth_color = light_depth_debug_at(in.uv); + let rgb = select(depth_color, color.rgb, color_luma > (1.0 / 255.0)); + return vec4f(rgb, 1.0); + } + + if depth <= 0.0 { + // Sky / cleared pixels receive no shadow. + if uniforms.debug_mode >= 3u { + return vec4f(0.0, 0.0, 0.0, 1.0); + } + return vec4f(1.0); + } + + let ndc = vec4f(in.uv.x * 2.0 - 1.0, 1.0 - 2.0 * in.uv.y, depth, 1.0); + let world4 = uniforms.world_from_proj * ndc; + let world = world4.xyz / world4.w; + + let light_clip = uniforms.light_vp * vec4f(world, 1.0); + let light_ndc = light_clip.xyz / light_clip.w; + let receiver = light_ndc.z; // reversed light depth, 1 = nearest to the light + let light_uv = vec2f(0.5 + 0.5 * light_ndc.x, 0.5 - 0.5 * light_ndc.y); + let in_shadow_bounds = all(light_uv >= vec2f(0.0)) && all(light_uv <= vec2f(1.0)) && + receiver > 0.0 && receiver <= 1.0; + let shadow_depth = load_shadow(vec2(light_uv * uniforms.size)); + + if uniforms.debug_mode == 4u { + let valid = select(0.0, 1.0, in_shadow_bounds); + return vec4f(saturate(light_uv.x), saturate(light_uv.y), valid, 1.0); + } + + if uniforms.debug_mode == 5u { + if !in_shadow_bounds { + return vec4f(0.0, 0.0, 0.0, 1.0); + } + let current_compare = select(0.0, 1.0, shadow_depth > receiver + uniforms.bias); + let opposite_compare = select(0.0, 1.0, shadow_depth < receiver - uniforms.bias); + return vec4f(current_compare, 0.0, opposite_compare, 1.0); + } + + if uniforms.debug_mode == 6u { + let valid = select(0.0, 1.0, in_shadow_bounds); + return vec4f(saturate(receiver), shadow_depth, valid, 1.0); + } + + if uniforms.debug_mode == 7u { + let beyond_far = select(0.0, 1.0, receiver <= 0.0); + let valid_depth = select(0.0, 1.0, receiver > 0.0 && receiver <= 1.0); + let before_near = select(0.0, 1.0, receiver > 1.0); + return vec4f(beyond_far, valid_depth, before_near, 1.0); + } + + if uniforms.debug_mode == 8u { + let valid_x = select(0.0, 1.0, light_uv.x >= 0.0 && light_uv.x <= 1.0); + let valid_y = select(0.0, 1.0, light_uv.y >= 0.0 && light_uv.y <= 1.0); + let valid_depth = select(0.0, 1.0, receiver > 0.0 && receiver <= 1.0); + return vec4f(valid_x, valid_y, valid_depth, 1.0); + } + + var occlusion = 0.0; + if in_shadow_bounds { + occlusion = sample_shadow_pcf(light_uv, receiver); + occlusion *= shadow_edge_fade(light_uv); + } + + if uniforms.debug_mode == 3u { + return vec4f(occlusion, occlusion, occlusion, 1.0); + } + + if uniforms.contact_enabled != 0.0 && occlusion < 1.0 { + let origin = view_position(in.uv, depth); + let fade = contact_shadow_fade(-origin.z); + if fade > 0.0 { + occlusion = max(occlusion, fade * contact_shadow(origin, in.position.xy)); + } + } + + let value = 1.0 - uniforms.strength * occlusion; + if uniforms.debug_mode == 2u { + return vec4f(value, value, value, 1.0); + } + return vec4f(value, value, value, 1.0); +} diff --git a/mods/shadow_mod/src/mod.cpp b/mods/shadow_mod/src/mod.cpp new file mode 100644 index 0000000000..97439d7015 --- /dev/null +++ b/mods/shadow_mod/src/mod.cpp @@ -0,0 +1,1109 @@ +// Dynamic shadows example mod. +// +// Replays the game's populated opaque scene draw lists into an offscreen pass with a light-space +// projection to produce a shadow map of the live scene, then composites deferred shadows over the +// world (scene depth + CameraService unproject + PCF against the map). +// +// The optional contact-shadow raymarch in the composite is reimplemented from Panos Karabelas' +// screen-space shadows (MIT, via Spartan Engine); see res/shadow.wgsl. + +#include "global.h" + +#include "JSystem/J3DGraphBase/J3DShape.h" +#include "JSystem/J3DU/J3DUClipper.h" +#include "JSystem/JMath/JMath.h" +#include "d/d_com_inf_game.h" +#include "d/d_kankyo.h" +#include "d/d_kankyo_rain.h" +#include "dolphin/gx/GXAurora.h" +#include "dolphin/gx/GXGet.h" +#include "dolphin/gx/GXPixel.h" +#include "dolphin/gx/GXTransform.h" +#include "m_Do/m_Do_mtx.h" +#include "mods/hook.hpp" +#include "mods/service.hpp" +#include "mods/svc/camera.h" +#include "mods/svc/config.h" +#include "mods/svc/gfx.h" +#include "mods/svc/hook.h" +#include "mods/svc/log.h" +#include "mods/svc/resource.h" +#include "mods/svc/ui.h" + +#include +#include +#include +#include +#include +#include + +DEFINE_MOD(); +IMPORT_SERVICE(ConfigService, svc_config); +IMPORT_SERVICE(ResourceService, svc_resource); +IMPORT_SERVICE(UiService, svc_ui); +IMPORT_SERVICE(GfxService, svc_gfx); +IMPORT_SERVICE(CameraService, svc_camera); +IMPORT_SERVICE(HookService, svc_hook); +IMPORT_SERVICE(LogService, svc_log); + +namespace { + +ConfigVarHandle g_cvarEnabled = 0; +ConfigVarHandle g_cvarMapSize = 0; +ConfigVarHandle g_cvarNoFrustumClipping = 0; +ConfigVarHandle g_cvarStrength = 0; +ConfigVarHandle g_cvarPcf = 0; +ConfigVarHandle g_cvarBias = 0; +ConfigVarHandle g_cvarBoxRadius = 0; +ConfigVarHandle g_cvarEdgeFadeWidth = 0; +ConfigVarHandle g_cvarContactShadows = 0; +ConfigVarHandle g_cvarDebugView = 0; + +GfxDrawTypeHandle g_drawType = 0; +GfxStageHookHandle g_sceneBeginHook = 0; +GfxStageHookHandle g_sceneAfterTerrainHook = 0; +GfxStageHookHandle g_frameBeforeHudHook = 0; +UiWindowHandle g_controlsWindow = 0; +ResourceBuffer g_shaderSource = RESOURCE_BUFFER_INIT; +GfxDeviceInfo g_deviceInfo = GFX_DEVICE_INFO_INIT; +WGPURenderPipeline g_compositePipeline = nullptr; // multiply blend +WGPURenderPipeline g_compositeDebugPipeline = nullptr; // no blend (debug views) +WGPUBindGroupLayout g_compositeLayout = nullptr; +WGPUBindGroupLayout g_compositeDebugLayout = nullptr; + +struct MapPassOutput { + bool ready = false; + WGPUTextureView shadowMap = nullptr; // frame-pooled + WGPUTextureView lightColor = nullptr; // frame-pooled + uint32_t mapSize = 0; + Mtx44 lightVp; // world -> light receiver projection, row-major game convention + float dirToLightWorld[3]; // toward the light, normalized + float fade = 0.0f; +}; + +MapPassOutput g_mapPass; +bool g_replayingSceneLists = false; + +constexpr float kLightDistance = 30000.0f; +constexpr float kLightNear = 100.0f; +constexpr float kLightFar = 60000.0f; +constexpr float kMaxLightLookahead = 10000.0f; +constexpr float kSunMoonDistance = 80000.0f; +constexpr float kSunMoonZDistance = -48000.0f; + +DEFINE_HOOK(&dDlst_shadowControl_c::imageDraw, GameShadowImageDraw); +DEFINE_HOOK(&dDlst_shadowControl_c::draw, GameShadowDraw); +DEFINE_HOOK(&drawCloudShadow, CloudShadowDraw); +DEFINE_HOOK(static_cast(&J3DUClipper::clip), + ClipperSphereClip); +DEFINE_HOOK( + static_cast(&J3DUClipper::clip), + ClipperBoxClip); +DEFINE_HOOK(GXCopyTex, CopyTex); + +// Mirror of the WGSL Uniforms struct (keep in sync with res/shadow.wgsl). +struct ShadowUniforms { + float world_from_proj[16]; + float view_from_proj[16]; + float proj_from_view[16]; + float light_vp[16]; + float light_dir_view[3]; + float bias; + float size[2]; + float inv_size[2]; + float edge_fade_width; + float strength; + float pcf_taps; + float contact_enabled; + float contact_thickness; + float contact_length; + uint32_t debug_mode; + float _pad0; +}; +static_assert(sizeof(ShadowUniforms) % 16 == 0); + +struct DrawPayload { + WGPUTextureView sceneDepth; // frame-pooled + WGPUTextureView shadowMap; // frame-pooled + WGPUTextureView lightColor; // frame-pooled + uint32_t uniform_offset; + uint32_t uniform_size; + uint32_t debug_mode; +}; +static_assert(sizeof(DrawPayload) <= GFX_INLINE_DRAW_PAYLOAD_SIZE); +static_assert(std::is_trivially_copyable_v); + +struct LightCamera { + Mtx view; + Mtx44 ortho; + Mtx44 vp; + float dirToLight[3]; + float fade = 0.0f; +}; + +struct SceneCamera { + bool valid = false; + bool raw_valid = false; + CameraInfo info = CAMERA_INFO_INIT; + Mtx raw_view; + f32 raw_projection[7]{}; + Mtx44 raw_projection_mtx; +}; + +SceneCamera g_sceneCamera; + +struct ActualLightDebugState { + bool active = false; + Mtx savedView; + f32 savedProjection[7]; + f32 savedViewport[6]; + u32 savedScissor[4]; +}; + +ActualLightDebugState g_actualLightDebug; + +struct replay_scope { + replay_scope() { g_replayingSceneLists = true; } + ~replay_scope() { g_replayingSceneLists = false; } +}; + +int64_t get_int_option(ConfigVarHandle handle, int64_t fallback) { + int64_t value = fallback; + if (handle == 0 || svc_config->get_int(mod_ctx, handle, &value) != MOD_OK) { + return fallback; + } + return value; +} + +bool get_bool_option(ConfigVarHandle handle, bool fallback) { + bool value = fallback; + if (handle == 0 || svc_config->get_bool(mod_ctx, handle, &value) != MOD_OK) { + return fallback; + } + return value; +} + +int64_t get_debug_mode() { + return std::clamp(get_int_option(g_cvarDebugView, 0), 0, 10); +} + +bool matrix_ready(const Mtx m) { + float basis = 0.0f; + for (int r = 0; r < 3; ++r) { + for (int c = 0; c < 4; ++c) { + if (!std::isfinite(m[r][c])) { + return false; + } + if (c < 3) { + basis += std::fabs(m[r][c]); + } + } + } + return basis > 0.001f; +} + +bool projection_vector_ready(const f32 projection[7]) { + if (projection[0] != 0.0f) { + return false; + } + for (int i = 1; i < 7; ++i) { + if (!std::isfinite(projection[i])) { + return false; + } + } + return std::fabs(projection[1]) > 0.001f && std::fabs(projection[3]) > 0.001f && + std::fabs(projection[6]) > 0.001f; +} + +// Row-major game matrix -> column-major WGSL layout (matching CameraService). +void store_column_major(const Mtx44 in, float out[16]) { + for (int c = 0; c < 4; ++c) { + for (int r = 0; r < 4; ++r) { + out[c * 4 + r] = in[r][c]; + } + } +} + +void copy_projection(const Mtx44 in, Mtx44 out) { + std::memcpy(out, in, sizeof(Mtx44)); + // TODO: check GfxDeviceInfo.uses_reversed_z + for (int c = 0; c < 4; ++c) { + out[2][c] = -out[2][c]; + } +} + +void projection_vector_from_perspective(const Mtx44 projection, f32 out[7]) { + out[0] = 0.0f; + out[1] = projection[0][0]; + out[2] = projection[0][2]; + out[3] = projection[1][1]; + out[4] = projection[1][2]; + out[5] = projection[2][2]; + out[6] = projection[2][3]; +} + +const view_class* stage_game_view(const GfxStageContext* stageCtx) { + if (stageCtx == nullptr || stageCtx->struct_size < sizeof(GfxStageContext) || + stageCtx->game_view == nullptr) + { + return nullptr; + } + return static_cast(stageCtx->game_view); +} + +bool capture_raw_camera( + const view_class* gameView, Mtx outView, Mtx44 outProjectionMtx, f32 outProjection[7]) { + if (gameView == nullptr || !matrix_ready(gameView->viewMtx)) { + return false; + } + std::memcpy(outProjectionMtx, gameView->projMtx, sizeof(Mtx44)); + projection_vector_from_perspective(outProjectionMtx, outProjection); + if (!projection_vector_ready(outProjection)) { + return false; + } + cMtx_copy(gameView->viewMtx, outView); + return true; +} + +bool capture_scene_camera(const GfxStageContext* stageCtx) { + g_sceneCamera.valid = false; + g_sceneCamera.raw_valid = false; + const view_class* gameView = stage_game_view(stageCtx); + if (gameView == nullptr) { + return false; + } + CameraInfo info = CAMERA_INFO_INIT; + if (svc_camera->get_camera(mod_ctx, stageCtx->game_view, &info) != MOD_OK) { + return false; + } + g_sceneCamera.info = info; + g_sceneCamera.valid = true; + g_sceneCamera.raw_valid = capture_raw_camera(gameView, g_sceneCamera.raw_view, + g_sceneCamera.raw_projection_mtx, g_sceneCamera.raw_projection); + return true; +} + +bool get_replay_camera(Mtx outView, Mtx44 outProjectionMtx, f32 outProjection[7]) { + if (g_sceneCamera.raw_valid && matrix_ready(g_sceneCamera.raw_view)) { + cMtx_copy(g_sceneCamera.raw_view, outView); + std::memcpy(outProjectionMtx, g_sceneCamera.raw_projection_mtx, + sizeof(g_sceneCamera.raw_projection_mtx)); + std::memcpy( + outProjection, g_sceneCamera.raw_projection, sizeof(g_sceneCamera.raw_projection)); + return projection_vector_ready(outProjection); + } + + return false; +} + +float wrap_daytime(float daytime) { + if (!std::isfinite(daytime)) { + return 180.0f; + } + float wrapped = std::fmod(daytime, 360.0f); + if (wrapped < 0.0f) { + wrapped += 360.0f; + } + return wrapped; +} + +float daytime_percent(float max, float min, float value) { + const float range = max - min; + if (range == 0.0f) { + return 1.0f; + } + const float percent = 1.0f - ((max - value) / range); + return percent < 1.0f ? percent : 1.0f; +} + +float sun_moon_angle(float daytime) { + daytime = wrap_daytime(daytime); + if (daytime >= 90.0f && daytime <= 270.0f) { + return daytime_percent(270.0f, 90.0f, daytime) * 150.0f + 105.0f; + } + + float angle = daytime; + if (angle < 90.0f) { + angle += 360.0f; + } + + angle = daytime_percent(450.0f, 270.0f, angle) * 210.0f + 255.0f; + if (angle > 360.0f) { + angle -= 360.0f; + } + return angle; +} + +cXyz sun_moon_offset(float daytime) { + const float angle = DEG_TO_RAD(sun_moon_angle(daytime)); + const float angleSin = sinf(angle); + const float angleCos = cosf(angle); + return cXyz{ + angleSin * kSunMoonDistance, -angleCos * kSunMoonDistance, angleCos * kSunMoonZDistance}; +} + +bool build_composite_pipeline( + bool blend, WGPURenderPipeline& outPipeline, WGPUBindGroupLayout& outLayout) { + WGPUShaderSourceWGSL wgsl = WGPU_SHADER_SOURCE_WGSL_INIT; + wgsl.code = {static_cast(g_shaderSource.data), g_shaderSource.size}; + WGPUShaderModuleDescriptor moduleDesc = WGPU_SHADER_MODULE_DESCRIPTOR_INIT; + moduleDesc.nextInChain = &wgsl.chain; + moduleDesc.label = {"shadow composite", WGPU_STRLEN}; + WGPUShaderModule module = wgpuDeviceCreateShaderModule(g_deviceInfo.device, &moduleDesc); + if (module == nullptr) { + return false; + } + + // Multiply blend: fragment output is the darkening multiplier (result = dst * src). + WGPUBlendState blendState{ + .color = {.operation = WGPUBlendOperation_Add, + .srcFactor = WGPUBlendFactor_Dst, + .dstFactor = WGPUBlendFactor_Zero}, + .alpha = {.operation = WGPUBlendOperation_Add, + .srcFactor = WGPUBlendFactor_Zero, + .dstFactor = WGPUBlendFactor_One}, + }; + WGPUColorTargetState colorTarget = WGPU_COLOR_TARGET_STATE_INIT; + colorTarget.format = g_deviceInfo.color_format; + if (blend) { + colorTarget.blend = &blendState; + } + WGPUFragmentState fragment = WGPU_FRAGMENT_STATE_INIT; + fragment.module = module; + fragment.entryPoint = {"fs_main", WGPU_STRLEN}; + fragment.targetCount = 1; + fragment.targets = &colorTarget; + WGPUDepthStencilState depthStencil = WGPU_DEPTH_STENCIL_STATE_INIT; + depthStencil.format = g_deviceInfo.depth_format; + depthStencil.depthWriteEnabled = WGPUOptionalBool_False; + depthStencil.depthCompare = WGPUCompareFunction_Always; + + WGPURenderPipelineDescriptor pipelineDesc = WGPU_RENDER_PIPELINE_DESCRIPTOR_INIT; + pipelineDesc.label = {blend ? "shadow composite" : "shadow composite (debug)", WGPU_STRLEN}; + pipelineDesc.vertex.module = module; + pipelineDesc.vertex.entryPoint = {"vs_main", WGPU_STRLEN}; + pipelineDesc.primitive.topology = WGPUPrimitiveTopology_TriangleList; + pipelineDesc.depthStencil = &depthStencil; + pipelineDesc.multisample.count = g_deviceInfo.sample_count; + pipelineDesc.fragment = &fragment; + outPipeline = wgpuDeviceCreateRenderPipeline(g_deviceInfo.device, &pipelineDesc); + wgpuShaderModuleRelease(module); + if (outPipeline == nullptr) { + return false; + } + outLayout = wgpuRenderPipelineGetBindGroupLayout(outPipeline, 0); + return outLayout != nullptr; +} + +// Render worker thread: fullscreen deferred-shadow composite. +void on_draw( + ModContext*, const GfxDrawContext* ctx, const void* payload, size_t payloadSize, void*) { + if (payloadSize != sizeof(DrawPayload)) { + return; + } + DrawPayload data; + std::memcpy(&data, payload, sizeof(data)); + + WGPURenderPipeline pipeline = + data.debug_mode != 0 ? g_compositeDebugPipeline : g_compositePipeline; + WGPUBindGroupLayout layout = data.debug_mode != 0 ? g_compositeDebugLayout : g_compositeLayout; + if (data.sceneDepth == nullptr || data.shadowMap == nullptr || data.lightColor == nullptr || + pipeline == nullptr) + { + return; + } + + WGPUBindGroupEntry entries[4] = {WGPU_BIND_GROUP_ENTRY_INIT, WGPU_BIND_GROUP_ENTRY_INIT, + WGPU_BIND_GROUP_ENTRY_INIT, WGPU_BIND_GROUP_ENTRY_INIT}; + entries[0].binding = 0; + entries[0].textureView = data.sceneDepth; + entries[1].binding = 1; + entries[1].textureView = data.shadowMap; + entries[2].binding = 2; + entries[2].buffer = ctx->uniform_buffer; + entries[2].offset = data.uniform_offset; + entries[2].size = data.uniform_size; + entries[3].binding = 3; + entries[3].textureView = data.lightColor; + WGPUBindGroupDescriptor bindGroupDesc = WGPU_BIND_GROUP_DESCRIPTOR_INIT; + bindGroupDesc.layout = layout; + bindGroupDesc.entryCount = 4; + bindGroupDesc.entries = entries; + WGPUBindGroup bindGroup = wgpuDeviceCreateBindGroup(ctx->device, &bindGroupDesc); + if (bindGroup == nullptr) { + return; + } + + wgpuRenderPassEncoderSetPipeline(ctx->pass, pipeline); + wgpuRenderPassEncoderSetBindGroup(ctx->pass, 0, bindGroup, 0, nullptr); + wgpuRenderPassEncoderDraw(ctx->pass, 3, 1, 0, 0); + wgpuBindGroupRelease(bindGroup); +} + +// Picks the sun or moon (whichever is above the horizon) and returns the normalized +// world-space direction *toward* the light plus a horizon fade factor. False = no light. +bool compute_light(float outDirToLight[3], float& outFade) { + dScnKy_env_light_c* envLight = dKy_getEnvlight(); + if (envLight == nullptr) { + return false; + } + + // The packet positions can be stale when this runs before the world lists are consumed. + // Mirror dScnKy_env_light_c::setSunpos() so --time-of-day directly moves the debug light. + const float daytime = wrap_daytime(dComIfGs_getTime()); + cXyz offset = sun_moon_offset(daytime); + if (offset.y <= 0.0f) { + offset = sun_moon_offset(daytime + 180.0f); + } + const float length = std::sqrt(offset.x * offset.x + offset.y * offset.y + offset.z * offset.z); + if (length < 1.0f) { + return false; + } + outDirToLight[0] = offset.x / length; + outDirToLight[1] = offset.y / length; + outDirToLight[2] = offset.z / length; + // Fade shadows out as the light approaches the horizon (elevation below ~11 degrees). + outFade = std::clamp((outDirToLight[1] - 0.05f) / 0.15f, 0.0f, 1.0f); + return outFade > 0.0f; +} + +bool build_light_camera(const Mtx cameraView, uint32_t mapSize, float radius, LightCamera& out) { + Mtx cameraInvView; + cMtx_inverse(cameraView, cameraInvView); + if (!matrix_ready(cameraInvView)) { + return false; + } + if (!compute_light(out.dirToLight, out.fade)) { + return false; + } + + // Fit a fixed-radius ortho box around the visible play space. The camera target alone can sit + // behind the receiver field, while a far-horizon center drops foreground receivers. + const cXyz eye{cameraInvView[0][3], cameraInvView[1][3], cameraInvView[2][3]}; + cXyz forward{-cameraInvView[0][2], -cameraInvView[1][2], -cameraInvView[2][2]}; + const float forwardLength = + std::sqrt(forward.x * forward.x + forward.y * forward.y + forward.z * forward.z); + if (forwardLength > 0.001f) { + forward = forward / forwardLength; + } else { + forward = cXyz{0.0f, 0.0f, -1.0f}; + } + const float lookahead = std::min(radius * 0.75f, kMaxLightLookahead); + const cXyz center = eye + forward * lookahead; + const cXyz lightEye{center.x + out.dirToLight[0] * kLightDistance, + center.y + out.dirToLight[1] * kLightDistance, + center.z + out.dirToLight[2] * kLightDistance}; + const bool nearlyVertical = std::fabs(out.dirToLight[1]) > 0.99f; + cXyz up = nearlyVertical ? cXyz{0.0f, 0.0f, 1.0f} : cXyz{0.0f, 1.0f, 0.0f}; + + cMtx_lookAt(out.view, &lightEye, ¢er, &up, 0); + const float unitsPerTexel = (2.0f * radius) / static_cast(mapSize); + out.view[0][3] = std::round(out.view[0][3] / unitsPerTexel) * unitsPerTexel; + out.view[1][3] = std::round(out.view[1][3] / unitsPerTexel) * unitsPerTexel; + + C_MTXOrtho(out.ortho, radius, -radius, -radius, radius, kLightNear, kLightFar); + cMtx_concatProjView(out.ortho, out.view, out.vp); + return true; +} + +bool build_light_replay_projection( + const LightCamera& lightCamera, const Mtx cameraView, Mtx44 out) { + Mtx cameraInvView; + cMtx_inverse(cameraView, cameraInvView); + if (!matrix_ready(cameraInvView)) { + return false; + } + + Mtx lightFromCamera; + cMtx_concat(lightCamera.view, cameraInvView, lightFromCamera); + cMtx_concatProjView(lightCamera.ortho, lightFromCamera, out); + return true; +} + +// True when the dynamic shadow pass will run this frame: enabled, a camera exists, and the +// sun or moon is above the horizon. Also gates the game-shadow skip hooks, which fire earlier +// in the painter than our SCENE_AFTER_TERRAIN hook. +bool dynamic_shadows_wanted() { + if (!get_bool_option(g_cvarEnabled, true)) { + return false; + } + if (!g_sceneCamera.raw_valid) { + return false; + } + float dirToLight[3]; + float fade = 0.0f; + return compute_light(dirToLight, fade); +} + +HookAction on_game_shadow_pre(ModContext*, void*, void*, void*) { + if (!dynamic_shadows_wanted()) { + return HOOK_CONTINUE; + } + return HOOK_SKIP_ORIGINAL; +} + +HookAction on_frustum_clip_pre(ModContext*, void*, void* retval, void*) { + if (!get_bool_option(g_cvarNoFrustumClipping, false) || !dynamic_shadows_wanted()) { + return HOOK_CONTINUE; + } + if (retval != nullptr) { + *static_cast(retval) = 0; + } + return HOOK_SKIP_ORIGINAL; +} + +HookAction on_copy_tex_pre(ModContext*, void*, void*, void*) { + return g_replayingSceneLists ? HOOK_SKIP_ORIGINAL : HOOK_CONTINUE; +} + +void draw_opaque_scene_lists() { + dComIfGd_drawOpaListBG(); + dComIfGd_drawOpaListDarkBG(); + dComIfGd_drawOpaListMiddle(); + dComIfGd_drawOpaList(); + dComIfGd_drawOpaListDark(); + dComIfGd_drawOpaListPacket(); +} + +bool draw_lists_ready() { + return dComIfGd_getOpaListBG() != nullptr && dComIfGd_getOpaList() != nullptr && + dComIfGd_getOpaListDark() != nullptr && dComIfGd_getXluListBG() != nullptr && + dComIfGd_getListPacket() != nullptr; +} + +void render_shadow_map( + const Mtx replayView, const Mtx44 replayProjectionMtx, const f32 replayProjection[7]); + +void restore_actual_light_debug() { + if (!g_actualLightDebug.active) { + return; + } + + j3dSys.setViewMtx(g_actualLightDebug.savedView); + GXSetProjectionv(g_actualLightDebug.savedProjection); + GXSetViewport(g_actualLightDebug.savedViewport[0], g_actualLightDebug.savedViewport[1], + g_actualLightDebug.savedViewport[2], g_actualLightDebug.savedViewport[3], + g_actualLightDebug.savedViewport[4], g_actualLightDebug.savedViewport[5]); + GXSetScissor(g_actualLightDebug.savedScissor[0], g_actualLightDebug.savedScissor[1], + g_actualLightDebug.savedScissor[2], g_actualLightDebug.savedScissor[3]); + dKy_setLight(); + J3DShape::resetVcdVatCache(); + + g_actualLightDebug.active = false; +} + +void on_scene_begin(ModContext*, const GfxStageContext* stageCtx, void*) { + restore_actual_light_debug(); + capture_scene_camera(stageCtx); + if (!get_bool_option(g_cvarEnabled, true) || get_debug_mode() != 9) { + return; + } + + Mtx cameraView; + if (!g_sceneCamera.raw_valid || !matrix_ready(g_sceneCamera.raw_view)) { + return; + } + cMtx_copy(g_sceneCamera.raw_view, cameraView); + + const uint32_t mapSize = 1024u << std::clamp(get_int_option(g_cvarMapSize, 1), 0, 2); + const float radius = + static_cast(std::clamp(get_int_option(g_cvarBoxRadius, 6000), 1000, 20000)); + LightCamera lightCamera{}; + if (!build_light_camera(cameraView, mapSize, radius, lightCamera)) { + return; + } + Mtx44 lightProjection; + if (!build_light_replay_projection(lightCamera, cameraView, lightProjection)) { + return; + } + + cMtx_copy(cameraView, g_actualLightDebug.savedView); + GXGetProjectionv(g_actualLightDebug.savedProjection); + GXGetViewportv(g_actualLightDebug.savedViewport); + GXGetScissor(&g_actualLightDebug.savedScissor[0], &g_actualLightDebug.savedScissor[1], + &g_actualLightDebug.savedScissor[2], &g_actualLightDebug.savedScissor[3]); + g_actualLightDebug.active = true; + + j3dSys.setViewMtx(g_actualLightDebug.savedView); + GXSetProjectionFull(lightProjection); + dKy_setLight(); + J3DShape::resetVcdVatCache(); +} + +void on_scene_after_terrain(ModContext*, const GfxStageContext* stageCtx, void*) { + if (g_mapPass.ready) { + return; + } + + const view_class* gameView = stage_game_view(stageCtx); + Mtx replayView; + Mtx44 replayProjectionMtx; + f32 replayProjection[7]; + if (!capture_raw_camera(gameView, replayView, replayProjectionMtx, replayProjection)) { + return; + } + render_shadow_map(replayView, replayProjectionMtx, replayProjection); +} + +// Game thread, after the draw handlers have populated next frame's scene lists: replay opaque scene +// geometry from the light's point of view. +void render_shadow_map( + const Mtx replayView, const Mtx44 replayProjectionMtx, const f32 replayProjection[7]) { + if (g_mapPass.ready || !get_bool_option(g_cvarEnabled, true)) { + return; + } + const int64_t debugMode = get_debug_mode(); + if (debugMode == 9) { + return; + } + if (!matrix_ready(replayView)) { + return; + } + Mtx replayViewMtx; + cMtx_copy(replayView, replayViewMtx); + + const uint32_t mapSize = 1024u << std::clamp(get_int_option(g_cvarMapSize, 1), 0, 2); + const bool cameraReplayDebug = debugMode == 10; + const float radius = + static_cast(std::clamp(get_int_option(g_cvarBoxRadius, 6000), 1000, 20000)); + LightCamera lightCamera{}; + if (!build_light_camera(replayViewMtx, mapSize, radius, lightCamera)) { + return; + } + Mtx44 lightReplayProjection; + if (!build_light_replay_projection(lightCamera, replayViewMtx, lightReplayProjection)) { + return; + } + f32 savedProjection[7]; + GXGetProjectionv(savedProjection); + f32 savedViewport[6]; + GXGetViewportv(savedViewport); + u32 savedScissor[4]; + GXGetScissor(&savedScissor[0], &savedScissor[1], &savedScissor[2], &savedScissor[3]); + Mtx savedView; + cMtx_copy(j3dSys.getViewMtx(), savedView); + + auto restore_game_camera = [&]() { + j3dSys.setViewMtx(savedView); + GXSetProjectionv(savedProjection); + GXSetViewport(savedViewport[0], savedViewport[1], savedViewport[2], savedViewport[3], + savedViewport[4], savedViewport[5]); + GXSetScissor(savedScissor[0], savedScissor[1], savedScissor[2], savedScissor[3]); + dKy_setLight(); + }; + auto set_replay_camera = [&]() { + j3dSys.setViewMtx(replayViewMtx); + if (cameraReplayDebug) { + GXSetProjectionv(replayProjection); + } else { + GXSetProjectionFull(lightReplayProjection); + } + dKy_setLight(); + }; + if (!draw_lists_ready()) { + return; + } + if (svc_gfx->create_pass(mod_ctx, mapSize, mapSize) != MOD_OK) { + return; + } + J3DShape::resetVcdVatCache(); + + set_replay_camera(); + GXSetViewport(0.0f, 0.0f, static_cast(mapSize), static_cast(mapSize), 0.0f, 1.0f); + GXSetViewportRender( + 0.0f, 0.0f, static_cast(mapSize), static_cast(mapSize), 0.0f, 1.0f); + GXSetScissorRender(0, 0, mapSize, mapSize); + dKy_setLight(); + GXSetColorUpdate(GX_TRUE); + GXSetAlphaUpdate(GX_TRUE); + GXSetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); + { + replay_scope replay; + draw_opaque_scene_lists(); + } + j3dSys.reinitGX(); + J3DShape::resetVcdVatCache(); + restore_game_camera(); + + GfxResolveDesc resolveDesc = GFX_RESOLVE_DESC_INIT; + resolveDesc.color = true; + resolveDesc.depth = true; + GfxResolvedTargets resolved = GFX_RESOLVED_TARGETS_INIT; + if (svc_gfx->resolve_pass(mod_ctx, &resolveDesc, &resolved) != MOD_OK || + resolved.color == nullptr || resolved.depth == nullptr) + { + return; + } + + j3dSys.reinitGX(); + J3DShape::resetVcdVatCache(); + restore_game_camera(); + + g_mapPass.lightColor = resolved.color; + g_mapPass.shadowMap = resolved.depth; + g_mapPass.mapSize = mapSize; + copy_projection(lightCamera.vp, g_mapPass.lightVp); + std::memcpy( + g_mapPass.dirToLightWorld, lightCamera.dirToLight, sizeof(g_mapPass.dirToLightWorld)); + g_mapPass.fade = lightCamera.fade; + g_mapPass.ready = true; +} + +// Game thread, after the full 3D scene: deferred composite. +void on_frame_before_hud(ModContext*, const GfxStageContext*, void*) { + const int64_t debugMode = get_debug_mode(); + restore_actual_light_debug(); + + const MapPassOutput mapPass = std::exchange(g_mapPass, {}); + if (debugMode == 9) { + return; + } + if (!mapPass.ready || mapPass.shadowMap == nullptr || mapPass.lightColor == nullptr) { + return; + } + if (!g_sceneCamera.valid) { + return; + } + const CameraInfo& camera = g_sceneCamera.info; + + GfxResolveDesc resolveDesc = GFX_RESOLVE_DESC_INIT; + resolveDesc.color = false; + resolveDesc.depth = true; + GfxResolvedTargets resolved = GFX_RESOLVED_TARGETS_INIT; + if (svc_gfx->resolve_pass(mod_ctx, &resolveDesc, &resolved) != MOD_OK || + resolved.depth == nullptr) + { + return; + } + + ShadowUniforms uniforms{}; + std::memcpy(uniforms.world_from_proj, camera.world_from_proj, sizeof(uniforms.world_from_proj)); + std::memcpy(uniforms.view_from_proj, camera.view_from_proj, sizeof(uniforms.view_from_proj)); + std::memcpy(uniforms.proj_from_view, camera.proj_from_view, sizeof(uniforms.proj_from_view)); + store_column_major(mapPass.lightVp, uniforms.light_vp); + // Rotate the world-space light direction into view space (w = 0). + for (int r = 0; r < 3; ++r) { + uniforms.light_dir_view[r] = + camera.view_from_world[0 * 4 + r] * mapPass.dirToLightWorld[0] + + camera.view_from_world[1 * 4 + r] * mapPass.dirToLightWorld[1] + + camera.view_from_world[2 * 4 + r] * mapPass.dirToLightWorld[2]; + } + // Bias is configured in world units along the light direction. + uniforms.bias = + static_cast(std::clamp(get_int_option(g_cvarBias, 15), 0, 200)) / + (kLightFar - kLightNear); + uniforms.size[0] = static_cast(mapPass.mapSize); + uniforms.size[1] = static_cast(mapPass.mapSize); + uniforms.inv_size[0] = 1.0f / uniforms.size[0]; + uniforms.inv_size[1] = 1.0f / uniforms.size[1]; + uniforms.edge_fade_width = + static_cast(std::clamp(get_int_option(g_cvarEdgeFadeWidth, 32), 0, 128)); + uniforms.strength = + mapPass.fade * + static_cast(std::clamp(get_int_option(g_cvarStrength, 45), 0, 100)) / + 100.0f; + uniforms.pcf_taps = static_cast(std::clamp(get_int_option(g_cvarPcf, 1), 0, 2)); + uniforms.contact_enabled = get_bool_option(g_cvarContactShadows, false) ? 1.0f : 0.0f; + uniforms.contact_thickness = 25.0f; + uniforms.contact_length = 60.0f; + uniforms.debug_mode = static_cast(debugMode); + + GfxRange uniformRange{0, 0}; + if (svc_gfx->push_uniform(mod_ctx, &uniforms, sizeof(uniforms), &uniformRange) != MOD_OK) { + return; + } + const DrawPayload payload{resolved.depth, mapPass.shadowMap, mapPass.lightColor, + uniformRange.offset, uniformRange.size, static_cast(debugMode)}; + svc_gfx->push_draw(mod_ctx, g_drawType, &payload, sizeof(payload)); +} + +void add_control(UiElementHandle pane, const UiControlDesc& desc) { + svc_ui->pane_add_control(mod_ctx, pane, &desc, nullptr); +} + +void add_toggle(UiElementHandle pane, const char* label, ConfigVarHandle cvar, const char* help) { + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_TOGGLE; + control.label = label; + control.help_rml = help; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = cvar; + add_control(pane, control); +} + +void add_select(UiElementHandle pane, const char* label, ConfigVarHandle cvar, const char** options, + uint32_t optionCount, const char* help) { + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_SELECT; + control.label = label; + control.help_rml = help; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = cvar; + control.options = options; + control.option_count = optionCount; + add_control(pane, control); +} + +void add_number(UiElementHandle pane, const char* label, ConfigVarHandle cvar, int64_t min, + int64_t max, int64_t step, const char* suffix, const char* help) { + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_NUMBER; + control.label = label; + control.help_rml = help; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = cvar; + control.min = min; + control.max = max; + control.step = step; + control.suffix = suffix; + add_control(pane, control); +} + +ModResult build_controls_tab( + ModContext*, UiWindowHandle, UiElementHandle left, UiElementHandle right, void*, ModError*) { + (void)right; + + svc_ui->pane_add_section(mod_ctx, left, "Shadow Map"); + add_toggle(left, "Enabled", g_cvarEnabled, "Enables dynamic shadows."); + static const char* kMapSizes[] = {"1024", "2048", "4096"}; + add_select(left, "Map Size", g_cvarMapSize, kMapSizes, 3, + "Shadow map resolution. Larger is sharper and slower."); + add_toggle(left, "No Frustum Clipping", g_cvarNoFrustumClipping, + "Keeps camera-frustum-culled objects in draw lists so off-screen objects can cast " + "dynamic shadows. This can be expensive."); + add_number(left, "Coverage", g_cvarBoxRadius, 1000, 20000, 500, nullptr, + "Radius of the shadowed area around the camera, in world units. Smaller is sharper."); + add_number(left, "Fade Out", g_cvarEdgeFadeWidth, 0, 128, 32, " texels", + "Fade out shadows gradually near the edge of the coverage area."); + + svc_ui->pane_add_section(mod_ctx, left, "Appearance"); + add_number(left, "Strength", g_cvarStrength, 0, 100, 5, "%", "How dark shadowed areas become."); + static const char* kPcfOptions[] = {"Off", "3x3", "5x5"}; + add_select(left, "Soft Shadows", g_cvarPcf, kPcfOptions, 3, + "Percentage-closer filtering tap pattern; softens shadow edges."); + add_number(left, "Bias", g_cvarBias, 0, 200, 5, nullptr, + "Depth bias in world units. Raise to remove shadow acne; lower to reduce peter-panning."); + add_toggle(left, "Contact Shadows", g_cvarContactShadows, + "Adds a screen-space raymarch for small-scale contact darkening the map misses."); + + svc_ui->pane_add_section(mod_ctx, left, "Debug"); + static const char* kDebugOptions[] = {"Off", "Shadow Map", "Shadow Factor", "Occlusion", + "Light UV", "Compare Sign", "Depth Values", "Receiver Range", "Bounds", "Light View", + "Camera Replay"}; + add_select(left, "Debug View", g_cvarDebugView, kDebugOptions, 11, + "Shadow Map: light-space depth buffer
Shadow Factor: final " + "darkening term
Occlusion: map comparison result
Light UV: receiver " + "projection coverage
Compare Sign: current comparison in red and opposite " + "comparison in blue
Depth Values: receiver depth in red and map depth in green
" + "Receiver Range: beyond-far in red, valid depth in green, and before-near in blue
" + "Bounds: valid X in red, valid Y in green, and valid depth in blue
Light View: " + "renders the game world directly from the light camera
Camera Replay: " + "captures the same draw-list replay from the gameplay camera"); + return MOD_OK; +} + +void on_controls_window_closed(ModContext*, UiWindowHandle, void*) { + g_controlsWindow = 0; +} + +void on_open_controls(ModContext*, void*) { + if (g_controlsWindow != 0) { + return; + } + UiTabDesc tabs[1] = {UI_TAB_DESC_INIT}; + tabs[0].title = "Controls"; + tabs[0].build = build_controls_tab; + UiWindowDesc desc = UI_WINDOW_DESC_INIT; + desc.tabs = tabs; + desc.tab_count = 1; + desc.on_closed = on_controls_window_closed; + if (svc_ui->window_push(mod_ctx, &desc, &g_controlsWindow) != MOD_OK) { + svc_log->error(mod_ctx, "failed to open shadow controls window"); + } +} + +ModResult build_panel(ModContext*, UiElementHandle panel, void*, ModError*) { + UiControlDesc control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_TOGGLE; + control.label = "Enabled"; + control.binding = UI_BINDING_CONFIG_VAR; + control.config_var = g_cvarEnabled; + add_control(panel, control); + + control = UI_CONTROL_DESC_INIT; + control.kind = UI_CONTROL_BUTTON; + control.label = "Open Controls"; + control.on_pressed = on_open_controls; + add_control(panel, control); + return MOD_OK; +} + +ModResult register_bool_option( + const char* name, bool defaultValue, ConfigVarHandle& outHandle, ModError* error) { + ConfigVarDesc cvarDesc = CONFIG_VAR_DESC_INIT; + cvarDesc.name = name; + cvarDesc.type = CONFIG_VAR_BOOL; + cvarDesc.default_bool = defaultValue; + if (svc_config->register_var(mod_ctx, &cvarDesc, &outHandle) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register shadow option"); + } + return MOD_OK; +} + +ModResult register_int_option( + const char* name, int64_t defaultValue, ConfigVarHandle& outHandle, ModError* error) { + ConfigVarDesc cvarDesc = CONFIG_VAR_DESC_INIT; + cvarDesc.name = name; + cvarDesc.type = CONFIG_VAR_INT; + cvarDesc.default_int = defaultValue; + if (svc_config->register_var(mod_ctx, &cvarDesc, &outHandle) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register shadow option"); + } + return MOD_OK; +} + +} // namespace + +extern "C" { + +MOD_EXPORT ModResult mod_initialize(ModError* error) { + ModResult result = svc_resource->load(mod_ctx, "shadow.wgsl", &g_shaderSource); + if (result != MOD_OK || g_shaderSource.data == nullptr) { + return mods::set_error(error, result, "failed to load shadow.wgsl"); + } + + result = register_bool_option("effectEnabled", false, g_cvarEnabled, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("mapSize", 2, g_cvarMapSize, error); + if (result != MOD_OK) { + return result; + } + result = register_bool_option("noFrustumClipping", true, g_cvarNoFrustumClipping, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("strength", 45, g_cvarStrength, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("pcf", 2, g_cvarPcf, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("bias", 55, g_cvarBias, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("boxRadius", 6000, g_cvarBoxRadius, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("edgeFadeWidth", 32, g_cvarEdgeFadeWidth, error); + if (result != MOD_OK) { + return result; + } + result = register_bool_option("contactShadows", true, g_cvarContactShadows, error); + if (result != MOD_OK) { + return result; + } + result = register_int_option("debugView", 0, g_cvarDebugView, error); + if (result != MOD_OK) { + return result; + } + + if (svc_gfx->get_device_info(mod_ctx, &g_deviceInfo) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to query device info"); + } + if (!build_composite_pipeline(true, g_compositePipeline, g_compositeLayout) || + !build_composite_pipeline(false, g_compositeDebugPipeline, g_compositeDebugLayout)) + { + return mods::set_error(error, MOD_ERROR, "failed to create composite pipeline"); + } + + GfxDrawTypeDesc drawDesc = GFX_DRAW_TYPE_DESC_INIT; + drawDesc.label = "shadow composite"; + drawDesc.draw = on_draw; + if (svc_gfx->register_draw_type(mod_ctx, &drawDesc, &g_drawType) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to register draw type"); + } + GfxStageHookDesc stageDesc = GFX_STAGE_HOOK_DESC_INIT; + stageDesc.callback = on_scene_begin; + if (svc_gfx->register_stage_hook( + mod_ctx, GFX_STAGE_SCENE_BEGIN, &stageDesc, &g_sceneBeginHook) != MOD_OK) + { + return mods::set_error(error, MOD_ERROR, "failed to register stage hook"); + } + stageDesc.callback = on_scene_after_terrain; + if (svc_gfx->register_stage_hook( + mod_ctx, GFX_STAGE_SCENE_AFTER_TERRAIN, &stageDesc, &g_sceneAfterTerrainHook) != MOD_OK) + { + return mods::set_error(error, MOD_ERROR, "failed to register stage hook"); + } + stageDesc.callback = on_frame_before_hud; + if (svc_gfx->register_stage_hook( + mod_ctx, GFX_STAGE_FRAME_BEFORE_HUD, &stageDesc, &g_frameBeforeHudHook) != MOD_OK) + { + return mods::set_error(error, MOD_ERROR, "failed to register stage hook"); + } + + // Skip the game's own shadow rendering while the dynamic pass is active: the + // shadowControl pair covers the actor real/blob shadows, drawCloudShadow the weather + // cloud shadows. + if (mods::hook_add_pre(svc_hook, on_game_shadow_pre) != MOD_OK || + mods::hook_add_pre(svc_hook, on_game_shadow_pre) != MOD_OK || + mods::hook_add_pre(svc_hook, on_game_shadow_pre) != MOD_OK) + { + return mods::set_error(error, MOD_ERROR, "failed to hook game shadow rendering"); + } + if (mods::hook_add_pre(svc_hook, on_frustum_clip_pre) != MOD_OK || + mods::hook_add_pre(svc_hook, on_frustum_clip_pre) != MOD_OK) + { + return mods::set_error(error, MOD_ERROR, "failed to hook frustum clipping"); + } + if (mods::hook_add_pre(svc_hook, on_copy_tex_pre) != MOD_OK) { + return mods::set_error(error, MOD_ERROR, "failed to hook GXCopyTex"); + } + UiModsPanelDesc panelDesc = UI_MODS_PANEL_DESC_INIT; + panelDesc.build = build_panel; + svc_ui->register_mods_panel(mod_ctx, &panelDesc); + + return MOD_OK; +} + +MOD_EXPORT ModResult mod_update(ModError*) { + return MOD_OK; +} + +MOD_EXPORT ModResult mod_shutdown(ModError*) { + restore_actual_light_debug(); + svc_resource->free(mod_ctx, &g_shaderSource); + if (g_compositePipeline != nullptr) { + wgpuRenderPipelineRelease(g_compositePipeline); + g_compositePipeline = nullptr; + } + if (g_compositeDebugPipeline != nullptr) { + wgpuRenderPipelineRelease(g_compositeDebugPipeline); + g_compositeDebugPipeline = nullptr; + } + if (g_compositeLayout != nullptr) { + wgpuBindGroupLayoutRelease(g_compositeLayout); + g_compositeLayout = nullptr; + } + if (g_compositeDebugLayout != nullptr) { + wgpuBindGroupLayoutRelease(g_compositeDebugLayout); + g_compositeDebugLayout = nullptr; + } + g_cvarEnabled = g_cvarMapSize = g_cvarNoFrustumClipping = 0; + g_cvarStrength = 0; + g_cvarPcf = g_cvarBias = g_cvarBoxRadius = g_cvarEdgeFadeWidth = g_cvarContactShadows = + g_cvarDebugView = 0; + g_drawType = g_sceneBeginHook = g_sceneAfterTerrainHook = g_frameBeforeHudHook = 0; + g_controlsWindow = 0; + g_mapPass = {}; + g_sceneCamera.valid = false; + g_sceneCamera.raw_valid = false; + return MOD_OK; +} +} diff --git a/mods/template_mod/CMakeLists.txt b/mods/template_mod/CMakeLists.txt new file mode 100644 index 0000000000..3d40c3c5c4 --- /dev/null +++ b/mods/template_mod/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.25) +project(template_mod CXX) + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + set(DUSK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE PATH "Path to dusk source root") + option(DUSK_MOD_USE_FULL_TREE "Use full build instead of the minimal mod SDK" OFF) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if (DUSK_MOD_USE_FULL_TREE) + add_subdirectory("${DUSK_DIR}" dusk EXCLUDE_FROM_ALL) + else () + add_subdirectory("${DUSK_DIR}/sdk" dusk-sdk EXCLUDE_FROM_ALL) + endif () +endif () + +add_mod(template_mod + SOURCES src/mod.cpp + MOD_JSON mod.json + RES_DIR res +) diff --git a/mods/template_mod/mod.json b/mods/template_mod/mod.json new file mode 100644 index 0000000000..e60714edf5 --- /dev/null +++ b/mods/template_mod/mod.json @@ -0,0 +1,7 @@ +{ + "id": "com.example.mod", + "name": "Template Mod", + "version": "1.0.0", + "author": "You", + "description": "An example Dusklight mod" +} diff --git a/mods/template_mod/res/.gitkeep b/mods/template_mod/res/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mods/template_mod/src/mod.cpp b/mods/template_mod/src/mod.cpp new file mode 100644 index 0000000000..35d19331fd --- /dev/null +++ b/mods/template_mod/src/mod.cpp @@ -0,0 +1,22 @@ +#include "mods/service.hpp" +#include "mods/svc/log.h" + +DEFINE_MOD(); +IMPORT_SERVICE(LogService, svc_log); + +extern "C" { + +MOD_EXPORT ModResult mod_initialize(ModError*) { + svc_log->info(mod_ctx, "template_mod initialized"); + return MOD_OK; +} + +MOD_EXPORT ModResult mod_update(ModError*) { + return MOD_OK; +} + +MOD_EXPORT ModResult mod_shutdown(ModError*) { + svc_log->info(mod_ctx, "template_mod unloaded"); + return MOD_OK; +} +} diff --git a/platforms/android/.gitignore b/platforms/android/.gitignore index 7775e3c7f4..002aaa86aa 100644 --- a/platforms/android/.gitignore +++ b/platforms/android/.gitignore @@ -3,3 +3,4 @@ build/ app/build/ local.properties app/src/main/jniLibs/*/*.so +app/src/main/bundled_mods/ diff --git a/platforms/android/app/build.gradle b/platforms/android/app/build.gradle index 2dc8575f86..c7a25e732b 100644 --- a/platforms/android/app/build.gradle +++ b/platforms/android/app/build.gradle @@ -2,6 +2,9 @@ plugins { id 'com.android.application' } +def versionNameStr = (System.getenv("DUSK_VERSION") ?: "v0.1.0").replaceFirst("^v", "") +def versionCodeInt = (System.getenv("DUSK_VERSION_CODE") ?: "100000").toInteger() + def duskRepoDir = rootProject.projectDir.parentFile.parentFile def duskGeneratedAssetsDir = layout.buildDirectory.dir('generated/assets/dusklight').get().asFile def syncDuskAssets = tasks.register('syncDuskAssets', Sync) { @@ -9,6 +12,11 @@ def syncDuskAssets = tasks.register('syncDuskAssets', Sync) { into 'res' exclude '**/.DS_Store' } + // Staged by platforms/android/scripts/stage-jni-libs.sh + from(new File(projectDir, 'src/main/bundled_mods')) { + into 'mods' + include '*.dusk' + } into duskGeneratedAssetsDir } @@ -20,8 +28,8 @@ android { applicationId 'dev.twilitrealm.dusk' minSdk 26 targetSdk 36 - versionCode 1 - versionName '0.1.0' + versionCode versionCodeInt + versionName versionNameStr } buildTypes { diff --git a/platforms/android/app/src/main/AndroidManifest.xml b/platforms/android/app/src/main/AndroidManifest.xml index f5a0365856..cd687963e1 100644 --- a/platforms/android/app/src/main/AndroidManifest.xml +++ b/platforms/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ + 0) { + out.write(buffer, 0, count); + } + } + } + } catch (IOException e) { + Log.w(TAG, "Failed to extract bundled mods", e); + } + } + + private static void deleteRecursively(File file) { + File[] children = file.listFiles(); + if (children != null) { + for (File child : children) { + deleteRecursively(child); + } + } + file.delete(); + } + + @Override + protected SDLSurface createSDLSurface(Context context) { + return new DuskSurface(context); + } + @Override protected void onResume() { super.onResume(); hideSystemBars(); + if (awaitingManageStoragePermission) { + resumeFolderDialogAfterPermissionGrant(); + } } @Override @@ -133,6 +199,77 @@ public class DuskActivity extends SDLActivity { }; } + public void setPreferredSurfaceFrameRate(float frameRate) { + runOnUiThread(() -> { + if (mSurface instanceof DuskSurface) { + ((DuskSurface)mSurface).setPreferredFrameRate(frameRate); + } + }); + } + + private static final class DuskSurface extends SDLSurface { + private float preferredFrameRate = DEFAULT_SURFACE_FRAME_RATE; + + DuskSurface(Context context) { + super(context); + } + + @Override + public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { + super.surfaceChanged(holder, format, width, height); + setTargetFrameRate(holder); + } + + void setPreferredFrameRate(float frameRate) { + preferredFrameRate = frameRate; + setTargetFrameRate(getHolder()); + } + + private void setTargetFrameRate(SurfaceHolder holder) { + if (!mIsSurfaceReady || Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + return; + } + + Surface surface = holder != null ? holder.getSurface() : getHolder().getSurface(); + if (surface == null || !surface.isValid()) { + return; + } + + float targetFrameRate = getMaxSupportedFrameRate(); + if (preferredFrameRate > 0.0f) { + targetFrameRate = preferredFrameRate; + } + if (targetFrameRate <= 0.0f) { + return; + } + + try { + surface.setFrameRate( + targetFrameRate, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT); + Log.v(TAG, "Requested surface frame rate " + targetFrameRate + " fps"); + } catch (RuntimeException e) { + Log.w(TAG, "Failed to request surface frame rate", e); + } + } + + private float getMaxSupportedFrameRate() { + if (mDisplay == null) { + return 0.0f; + } + + float maxFrameRate = mDisplay.getRefreshRate(); + Display.Mode[] modes = mDisplay.getSupportedModes(); + if (modes == null) { + return maxFrameRate; + } + + for (Display.Mode mode : modes) { + maxFrameRate = Math.max(maxFrameRate, mode.getRefreshRate()); + } + return maxFrameRate; + } + } + @Override protected String[] getArguments() { Intent intent = getIntent(); @@ -171,6 +308,19 @@ public class DuskActivity extends SDLActivity { } folderDialogUserdata = userdata; + if (requiresManageStoragePermission() && !hasManageStoragePermission()) { + if (!requestManageStoragePermission()) { + finishFolderDialogWithError("Unable to request Android file access permission"); + return false; + } + return true; + } + + openFolderDialog(); + return true; + } + + private void openFolderDialog() { runOnUiThread(() -> { Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | @@ -185,9 +335,71 @@ public class DuskActivity extends SDLActivity { finishFolderDialog(Activity.RESULT_CANCELED, null); } }); + } + + private boolean requiresManageStoragePermission() { + return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R; + } + + private boolean hasManageStoragePermission() { + return !requiresManageStoragePermission() || Environment.isExternalStorageManager(); + } + + private boolean requestManageStoragePermission() { + if (!requiresManageStoragePermission()) { + return true; + } + + awaitingManageStoragePermission = true; + runOnUiThread(() -> { + if (tryStartManageStorageIntent( + new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION) + .setData(Uri.parse("package:" + getPackageName()))) || + tryStartManageStorageIntent( + new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION))) + { + return; + } + + finishFolderDialogWithError("Unable to request Android file access permission"); + }); return true; } + private boolean tryStartManageStorageIntent(Intent intent) { + try { + startActivityForResult(intent, MANAGE_STORAGE_REQUEST_CODE); + return true; + } catch (ActivityNotFoundException e) { + Log.w(TAG, "Unable to open all-files access settings.", e); + return false; + } + } + + private void resumeFolderDialogAfterPermissionGrant() { + awaitingManageStoragePermission = false; + if (folderDialogUserdata == 0) { + return; + } + + if (hasManageStoragePermission()) { + openFolderDialog(); + return; + } + + finishFolderDialogWithError( + "Allow \"All files access\" for Dusklight before choosing a custom data folder"); + } + + private void finishFolderDialogWithError(String error) { + long userdata = folderDialogUserdata; + folderDialogUserdata = 0; + awaitingManageStoragePermission = false; + if (userdata != 0) { + nativeFolderDialogResult(userdata, null, error); + } + } + private void finishFolderDialog(int resultCode, Intent data) { long userdata = folderDialogUserdata; folderDialogUserdata = 0; diff --git a/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java b/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java index bf1ca2149d..bcd8806c41 100644 --- a/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java +++ b/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceBLESteamController.java @@ -19,9 +19,13 @@ import android.os.*; import java.lang.Runnable; import java.util.Arrays; +import java.util.HashMap; import java.util.LinkedList; import java.util.UUID; +import java.util.regex.Pattern; +import java.util.regex.Matcher; + class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDevice { private static final String TAG = "hidapi"; @@ -33,10 +37,19 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe private boolean mIsConnected = false; private boolean mIsChromebook = false; private boolean mIsReconnecting = false; + private boolean mHasEnabledNotifications = false; + private boolean mHasSeenInputUpdate = false; private boolean mFrozen = false; private LinkedList mOperations; GattOperation mCurrentOperation = null; private Handler mHandler; + private int mProductId = -1; + private int mReportId = 0; + private UUID mInputCharacteristic; + + private static final int D0G_BLE2_PID = 0x1106; + private static final int TRITON_BLE_PID = 0x1303; + private static final int TRANSPORT_AUTO = 0; private static final int TRANSPORT_BREDR = 1; @@ -45,10 +58,14 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe private static final int CHROMEBOOK_CONNECTION_CHECK_INTERVAL = 10000; static final UUID steamControllerService = UUID.fromString("100F6C32-1735-4313-B402-38567131E5F3"); - static final UUID inputCharacteristic = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3"); + static final UUID inputCharacteristicD0G = UUID.fromString("100F6C33-1735-4313-B402-38567131E5F3"); + static final UUID inputCharacteristicTriton_0x45 = UUID.fromString("100F6C7A-1735-4313-B402-38567131E5F3"); + static final UUID inputCharacteristicTriton_0x47 = UUID.fromString("100F6C7C-1735-4313-B402-38567131E5F3"); static final UUID reportCharacteristic = UUID.fromString("100F6C34-1735-4313-B402-38567131E5F3"); static private final byte[] enterValveMode = new byte[] { (byte)0xC0, (byte)0x87, 0x03, 0x08, 0x07, 0x00 }; + private HashMap mOutputReportChars = new HashMap(); + static class GattOperation { private enum Operation { CHR_READ, @@ -61,6 +78,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe byte[] mValue; BluetoothGatt mGatt; boolean mResult = true; + int mDelayMs = 0; private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid) { mGatt = gatt; @@ -68,6 +86,13 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe mUuid = uuid; } + private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, int delayMs) { + mGatt = gatt; + mOp = operation; + mUuid = uuid; + mDelayMs = delayMs; + } + private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value) { mGatt = gatt; mOp = operation; @@ -75,6 +100,14 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe mValue = value; } + private GattOperation(BluetoothGatt gatt, GattOperation.Operation operation, UUID uuid, byte[] value, int delayMs) { + mGatt = gatt; + mOp = operation; + mUuid = uuid; + mValue = value; + mDelayMs = delayMs; + } + public void run() { // This is executed in main thread BluetoothGattCharacteristic chr; @@ -136,6 +169,8 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe return mResult; } + public int getDelayMs() { return mDelayMs; } + private BluetoothGattCharacteristic getCharacteristic(UUID uuid) { BluetoothGattService valveService = mGatt.getService(steamControllerService); if (valveService == null) @@ -154,6 +189,10 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid) { return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid); } + + static public GattOperation enableNotification(BluetoothGatt gatt, UUID uuid, int delayMs) { + return new GattOperation(gatt, Operation.ENABLE_NOTIFICATION, uuid, delayMs); + } } HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice device) { @@ -166,6 +205,8 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe mHandler = new Handler(Looper.getMainLooper()); mGatt = connectGatt(); + mHasEnabledNotifications = false; + mHasSeenInputUpdate = false; // final HIDDeviceBLESteamController finalThis = this; // mHandler.postDelayed(new Runnable() { // @Override @@ -314,8 +355,45 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe Log.v(TAG, "Found Valve steam controller service " + service.getUuid()); for (BluetoothGattCharacteristic chr : service.getCharacteristics()) { - if (chr.getUuid().equals(inputCharacteristic)) { - Log.v(TAG, "Found input characteristic"); + if (chr.getUuid().equals(inputCharacteristicTriton_0x45)) { + Log.v(TAG, "Found Triton input characteristic 0x45"); + mProductId = TRITON_BLE_PID; + mReportId = 0x45; + mInputCharacteristic = chr.getUuid(); + } else if (chr.getUuid().equals(inputCharacteristicTriton_0x47)) { + Log.v(TAG, "Found Triton input characteristic 0x47"); + mProductId = TRITON_BLE_PID; + mReportId = 0x47; + mInputCharacteristic = chr.getUuid(); + } else if (chr.getUuid().equals(inputCharacteristicD0G)) { + Log.v(TAG, "Found D0G input characteristic"); + mProductId = D0G_BLE2_PID; + mReportId = 0x03; + mInputCharacteristic = chr.getUuid(); + } else { + Pattern reportPattern = Pattern.compile("100F6C([0-9A-Z]{2})", Pattern.CASE_INSENSITIVE); + Matcher matcher = reportPattern.matcher(chr.getUuid().toString()); + + if (matcher.find()) { + try { + int reportId = Integer.parseInt(matcher.group(1), 16); + + reportId -= 0x35; + if (reportId >= 0x80) { + // This is a Triton output report characteristic that we need to care about. + Log.v(TAG, "Found Triton output report 0x" + Integer.toString(reportId, 16)); + mOutputReportChars.put(reportId, chr); + } + } + catch (NumberFormatException nfe) { + Log.w(TAG, "Could not parse report characteristic " + chr.getUuid().toString() + ": " + nfe.toString()); + } + } + } + } + + for (BluetoothGattCharacteristic chr : service.getCharacteristics()) { + if (chr.getUuid().equals(mInputCharacteristic)) { // Start notifications BluetoothGattDescriptor cccd = chr.getDescriptor(UUID.fromString("00002902-0000-1000-8000-00805f9b34fb")); if (cccd != null) { @@ -372,21 +450,30 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe mCurrentOperation = mOperations.removeFirst(); } - // Run in main thread - mHandler.post(new Runnable() { - @Override - public void run() { - synchronized (mOperations) { - if (mCurrentOperation == null) { - Log.e(TAG, "Current operation null in executor?"); - return; - } + Runnable gattOperationRunnable = new Runnable() { + @Override + public void run() { + synchronized (mOperations) { + if (mCurrentOperation == null) { + Log.e(TAG, "Current operation null in executor?"); + return; + } - mCurrentOperation.run(); - // now wait for the GATT callback and when it comes, finish this operation + mCurrentOperation.run(); + // now wait for the GATT callback and when it comes, finish this operation + } } - } - }); + }; + + if (mCurrentOperation.getDelayMs() == 0) { + // Run in main thread + mHandler.post(gattOperationRunnable); + } + else { + // If we have a delay on this operation, wait before we post it. + mHandler.postDelayed(gattOperationRunnable, mCurrentOperation.getDelayMs()); + } + } private void queueGattOperation(GattOperation op) { @@ -397,8 +484,39 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe } private void enableNotification(UUID chrUuid) { - GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid); + // Add a 500ms delay to notification write for Amazon Fire TV devices, as otherwise if we do this too quickly after connecting + // it will return success and then silently drop the operation on the floor. + GattOperation op = HIDDeviceBLESteamController.GattOperation.enableNotification(mGatt, chrUuid, 500); queueGattOperation(op); + + // Amazon Fire devices can also silently timeout on writeDescriptor, so + // set up a little delayed check that will attempt to write a second time. + // + // While this only seems to be needed on Amazon Fire TV devices at present, it + // doesn't hurt to have a retry on other devices as well. + // + final HIDDeviceBLESteamController finalThis = this; + final UUID finalUuid = chrUuid; + mHandler.postDelayed(new Runnable() { + @Override + public void run() { + if (!finalThis.mHasEnabledNotifications) { + + if (finalThis.mHasSeenInputUpdate) { + // Amazon Five devices may have enabled notifications on the input characteristic and not given us a callback. If we've seen + // input reports, though, somewhat by definition notifications are enabled. + Log.w(TAG, "WriteDescriptor has never returned, but we've seen input reports. Moving on with controller initialization."); + finalThis.mHasEnabledNotifications = true; + finalThis.enableValveMode(); + return; + } + + // Give one more try. + GattOperation retry = HIDDeviceBLESteamController.GattOperation.enableNotification(finalThis.mGatt, finalUuid, 500); + finalThis.queueGattOperation(retry); + } + } + }, 1000); } void writeCharacteristic(UUID uuid, byte[] value) { @@ -448,8 +566,16 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe mIsConnected = false; gatt.disconnect(); mGatt = connectGatt(false); - } - else { + } else { + if (getProductId() == TRITON_BLE_PID) { + // Android will not properly play well with Data Length Extensions without manually requesting a large MTU, + // and Triton controllers require DLE support. + // + // 517 is basically a "magic number" as far as Android's bluetooth code is concerned, so do not change + // this value. It is functionally "please enable data length extensions" on some Android builds. + mGatt.requestMtu(517); + } + probeService(this); } } @@ -474,7 +600,7 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe // Only register controller with the native side once it has been fully configured if (!isRegistered()) { Log.v(TAG, "Registering Steam Controller with ID: " + getId()); - mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0, true); + mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0, true, mReportId); setRegistered(); } } @@ -487,7 +613,8 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe // Enable this for verbose logging of controller input reports //Log.v(TAG, "onCharacteristicChanged uuid=" + characteristic.getUuid() + " data=" + HexDump.dumpHexString(characteristic.getValue())); - if (characteristic.getUuid().equals(inputCharacteristic) && !mFrozen) { + if (characteristic.getUuid().equals(mInputCharacteristic) && !mFrozen) { + mHasSeenInputUpdate = true; mManager.HIDDeviceInputReport(getId(), characteristic.getValue()); } } @@ -497,19 +624,36 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe //Log.v(TAG, "onDescriptorRead status=" + status); } + private void enableValveMode() + { + BluetoothGattService valveService = mGatt.getService(steamControllerService); + if (valveService == null) + return; + + BluetoothGattCharacteristic reportChr = valveService.getCharacteristic(reportCharacteristic); + if (reportChr != null) { + if (getProductId() == TRITON_BLE_PID) { + // For Triton we just mark things registered. + Log.v(TAG, "Registering Triton Steam Controller with ID: " + getId()); + mManager.HIDDeviceConnected(getId(), getIdentifier(), getVendorId(), getProductId(), getSerialNumber(), getVersion(), getManufacturerName(), getProductName(), 0, 0, 0, 0, true, mReportId); + setRegistered(); + } else { + // For the original controller, we need to manually enter Valve mode. + Log.v(TAG, "Writing report characteristic to enter valve mode"); + reportChr.setValue(enterValveMode); + mGatt.writeCharacteristic(reportChr); + } + } + } + @Override public void onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status) { BluetoothGattCharacteristic chr = descriptor.getCharacteristic(); //Log.v(TAG, "onDescriptorWrite status=" + status + " uuid=" + chr.getUuid() + " descriptor=" + descriptor.getUuid()); - if (chr.getUuid().equals(inputCharacteristic)) { - boolean hasWrittenInputDescriptor = true; - BluetoothGattCharacteristic reportChr = chr.getService().getCharacteristic(reportCharacteristic); - if (reportChr != null) { - Log.v(TAG, "Writing report characteristic to enter valve mode"); - reportChr.setValue(enterValveMode); - gatt.writeCharacteristic(reportChr); - } + if (chr.getUuid().equals(mInputCharacteristic)) { + mHasEnabledNotifications = true; + enableValveMode(); } finishCurrentGattOperation(); @@ -548,9 +692,20 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe @Override public int getProductId() { - // We don't have an easy way to query from the Bluetooth device, but we know what it is - final int D0G_BLE2_PID = 0x1106; - return D0G_BLE2_PID; + if (mProductId > 0) { + // We've already set a product ID. + return mProductId; + } + + if (mDevice.getName().startsWith("Steam Ctrl")) { + // We're a newer Triton device + mProductId = TRITON_BLE_PID; + } else { + // We're an OG Steam Controller + mProductId = D0G_BLE2_PID; + } + + return mProductId; } @Override @@ -601,10 +756,29 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe writeCharacteristic(reportCharacteristic, actual_report); return report.length; } else { - //Log.v(TAG, "writeOutputReport " + HexDump.dumpHexString(report)); - writeCharacteristic(reportCharacteristic, report); - return report.length; + // If we're an original-recipe Steam Controller we just write to the characteristic directly. + if (getProductId() == D0G_BLE2_PID) { + //Log.v(TAG, "writeOutputReport " + HexDump.dumpHexString(report)); + writeCharacteristic(reportCharacteristic, report); + return report.length; + } + + // If we're a Triton, we need to find the correct report characteristic. + if (report.length > 0) { + int reportId = report[0] & 0xFF; + BluetoothGattCharacteristic targetedReportCharacteristic = mOutputReportChars.get(reportId); + if (targetedReportCharacteristic != null) { + byte[] actual_report = Arrays.copyOfRange(report, 1, report.length - 1); + //Log.v(TAG, "writeOutputReport 0x" + Integer.toString(reportId, 16) + " " + HexDump.dumpHexString(report)); + writeCharacteristic(targetedReportCharacteristic.getUuid(), actual_report); + return report.length; + } else { + Log.w(TAG, "Got report write request for unknown report type 0x" + Integer.toString(reportId, 16)); + } + } } + + return -1; } @Override diff --git a/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java index 1fb2bfb4a7..691416c1c9 100644 --- a/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +++ b/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceManager.java @@ -256,6 +256,7 @@ public class HIDDeviceManager { 0x24c6, // PowerA 0x2c22, // Qanba 0x2dc8, // 8BitDo + 0x3537, // GameSir 0x37d7, // Flydigi 0x9886, // ASTRO Gaming }; @@ -360,7 +361,7 @@ public class HIDDeviceManager { HIDDeviceUSB device = new HIDDeviceUSB(this, usbDevice, interface_index); int id = device.getId(); mDevicesById.put(id, device); - HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol(), false); + HIDDeviceConnected(id, device.getIdentifier(), device.getVendorId(), device.getProductId(), device.getSerialNumber(), device.getVersion(), device.getManufacturerName(), device.getProductName(), usbInterface.getId(), usbInterface.getInterfaceClass(), usbInterface.getInterfaceSubclass(), usbInterface.getInterfaceProtocol(), false, 0); } } } @@ -529,7 +530,13 @@ public class HIDDeviceManager { return false; } - return bluetoothDevice.getName().equals("SteamController") && ((bluetoothDevice.getType() & BluetoothDevice.DEVICE_TYPE_LE) != 0); + // Steam Controllers will always support Bluetooth Low Energy + if ((bluetoothDevice.getType() & BluetoothDevice.DEVICE_TYPE_LE) == 0) { + return false; + } + + // Match on the name either the original Steam Controller or the new second-generation one advertise with. + return bluetoothDevice.getName().equals("SteamController") || bluetoothDevice.getName().startsWith("Steam Ctrl"); } private void close() { @@ -681,7 +688,7 @@ public class HIDDeviceManager { private native void HIDDeviceRegisterCallback(); private native void HIDDeviceReleaseCallback(); - native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol, boolean bBluetooth); + native void HIDDeviceConnected(int deviceID, String identifier, int vendorId, int productId, String serial_number, int release_number, String manufacturer_string, String product_string, int interface_number, int interface_class, int interface_subclass, int interface_protocol, boolean bBluetooth, int reportID); native void HIDDeviceOpenPending(int deviceID); native void HIDDeviceOpenResult(int deviceID, boolean opened); native void HIDDeviceDisconnected(int deviceID); diff --git a/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java b/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java index f9e9389802..8954639733 100644 --- a/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java +++ b/platforms/android/app/src/main/java/org/libsdl/app/HIDDeviceUSB.java @@ -21,6 +21,7 @@ class HIDDeviceUSB implements HIDDevice { protected InputThread mInputThread; protected boolean mRunning; protected boolean mFrozen; + protected boolean mClaimed; public HIDDeviceUSB(HIDDeviceManager manager, UsbDevice usbDevice, int interface_index) { mManager = manager; @@ -29,6 +30,7 @@ class HIDDeviceUSB implements HIDDevice { mInterface = mDevice.getInterface(mInterfaceIndex).getId(); mDeviceId = manager.getDeviceIDForIdentifier(getIdentifier()); mRunning = false; + mClaimed = false; } String getIdentifier() { @@ -114,6 +116,7 @@ class HIDDeviceUSB implements HIDDevice { close(); return false; } + mClaimed = true; // Find the endpoints for (int j = 0; j < iface.getEndpointCount(); j++) { @@ -132,9 +135,12 @@ class HIDDeviceUSB implements HIDDevice { } } - // Make sure the required endpoints were present - if (mInputEndpoint == null || mOutputEndpoint == null) { + // Make sure the required endpoints were present. The original Steam Controller and the wireless dongle for it do NOT + // actually have -- or require -- output endpoints, so we need to accept only an input one for them or else we'll fall + // back to the Android system gamepad functionality (and lose our paddles et al). + if (mInputEndpoint == null) { Log.w(TAG, "Missing required endpoint on USB device " + getDeviceName()); + mConnection.releaseInterface(iface); close(); return false; } @@ -154,6 +160,11 @@ class HIDDeviceUSB implements HIDDevice { return -1; } + if (!mClaimed) { + Log.w(TAG, "writeReport() called but some other process currently owns the USB device"); + return -1; + } + if (feature) { int res = -1; int offset = 0; @@ -185,6 +196,11 @@ class HIDDeviceUSB implements HIDDevice { } return length; } else { + if (mOutputEndpoint == null) + { + Log.e(TAG, "Tried to write an output report to an interface with no output endpoint!"); + return -1; + } int res = mConnection.bulkTransfer(mOutputEndpoint, report, report.length, 1000); if (res != report.length) { Log.w(TAG, "writeOutputReport() returned " + res + " on device " + getDeviceName()); @@ -205,6 +221,12 @@ class HIDDeviceUSB implements HIDDevice { Log.w(TAG, "readReport() called with no device connection"); return false; } + if (!mClaimed) { + if (feature) { + return false; + } + return true; + } if (report_number == 0x0) { /* Offset the return buffer by 1, so that the report ID @@ -258,10 +280,13 @@ class HIDDeviceUSB implements HIDDevice { mInputThread = null; } if (mConnection != null) { - UsbInterface iface = mDevice.getInterface(mInterfaceIndex); - mConnection.releaseInterface(iface); + if (mClaimed) { + UsbInterface iface = mDevice.getInterface(mInterfaceIndex); + mConnection.releaseInterface(iface); + } mConnection.close(); mConnection = null; + mClaimed = false; } } @@ -274,6 +299,22 @@ class HIDDeviceUSB implements HIDDevice { @Override public void setFrozen(boolean frozen) { mFrozen = frozen; + + /* If we have a valid device connection and the claim state doesn't match what we want, try to correct that. */ + if (mConnection != null && mClaimed == mFrozen) { + UsbInterface iface = mDevice.getInterface(mInterfaceIndex); + if (frozen) { + mClaimed = !mConnection.releaseInterface(iface); + if (mClaimed) { + Log.e(TAG, "Tried to release claim on USB device, but failed!"); + } + } else { + mClaimed = mConnection.claimInterface(iface, true); + if (!mClaimed) { + Log.e(TAG, "Tried to regain claim on USB device, but failed!"); + } + } + } } protected class InputThread extends Thread { diff --git a/platforms/android/app/src/main/java/org/libsdl/app/SDLActivity.java b/platforms/android/app/src/main/java/org/libsdl/app/SDLActivity.java index 42f5a911f7..dcc49852ac 100644 --- a/platforms/android/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/platforms/android/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh private static final String TAG = "SDL"; private static final int SDL_MAJOR_VERSION = 3; private static final int SDL_MINOR_VERSION = 4; - private static final int SDL_MICRO_VERSION = 4; + private static final int SDL_MICRO_VERSION = 10; /* // Display InputType.SOURCE/CLASS of events and devices // @@ -530,7 +530,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh if (mHIDDeviceManager != null) { mHIDDeviceManager.setFrozen(true); - } + } + if (!mHasMultiWindow) { pauseNativeThread(); } @@ -543,7 +544,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh if (mHIDDeviceManager != null) { mHIDDeviceManager.setFrozen(false); - } + } + if (!mHasMultiWindow) { resumeNativeThread(); } @@ -570,7 +572,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh public static int getNaturalOrientation() { int result = SDL_ORIENTATION_UNKNOWN; - Activity activity = (Activity)getContext(); + Activity activity = getContext(); if (activity != null) { Configuration config = activity.getResources().getConfiguration(); Display display = activity.getWindowManager().getDefaultDisplay(); @@ -590,7 +592,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh public static int getCurrentRotation() { int result = 0; - Activity activity = (Activity)getContext(); + Activity activity = getContext(); if (activity != null) { Display display = activity.getWindowManager().getDefaultDisplay(); switch (display.getRotation()) { @@ -616,6 +618,14 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh super.onWindowFocusChanged(hasFocus); Log.v(TAG, "onWindowFocusChanged(): " + hasFocus); + // If we are gaining focus, we can always try to restore our USB devices. If we are losing focus, + // only try to relinquish them if we don't have background events allowed (for multi-window Android setups). + if (hasFocus || !SDLActivity.nativeGetHintBoolean("SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS", false)) { + if (mHIDDeviceManager != null) { + mHIDDeviceManager.setFrozen(!hasFocus); + } + } + if (SDLActivity.mBrokenLibraries) { return; } @@ -1292,7 +1302,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh public static double getDiagonal() { DisplayMetrics metrics = new DisplayMetrics(); - Activity activity = (Activity)getContext(); + Activity activity = getContext(); if (activity == null) { return 0.0; } @@ -1481,11 +1491,11 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh if (SDLControllerManager.isDeviceSDLJoystick(deviceId)) { // Note that we process events with specific key codes here if (event.getAction() == KeyEvent.ACTION_DOWN) { - if (SDLControllerManager.onNativePadDown(deviceId, keyCode)) { + if (SDLControllerManager.onNativePadDown(deviceId, keyCode, event.getScanCode())) { return true; } } else if (event.getAction() == KeyEvent.ACTION_UP) { - if (SDLControllerManager.onNativePadUp(deviceId, keyCode)) { + if (SDLControllerManager.onNativePadUp(deviceId, keyCode, event.getScanCode())) { return true; } } @@ -1940,7 +1950,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh return; } - Activity activity = (Activity)getContext(); + Activity activity = getContext(); if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) { activity.requestPermissions(new String[]{permission}, requestCode); } else { @@ -1963,7 +1973,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); - int flags = Intent.FLAG_ACTIVITY_NO_HISTORY + int flags = Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_NEW_DOCUMENT; i.addFlags(flags); @@ -2227,3 +2237,4 @@ class SDLClipboardHandler implements SDLActivity.onNativeClipboardChanged(); } } + diff --git a/platforms/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java b/platforms/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java index 7655ecfd6f..8681d050b7 100644 --- a/platforms/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java +++ b/platforms/android/app/src/main/java/org/libsdl/app/SDLControllerManager.java @@ -10,6 +10,10 @@ import android.hardware.lights.Light; import android.hardware.lights.LightsRequest; import android.hardware.lights.LightsManager; import android.hardware.lights.LightState; +import android.hardware.Sensor; +import android.hardware.SensorEvent; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; import android.graphics.Color; import android.os.Build; import android.os.VibrationEffect; @@ -30,16 +34,18 @@ public class SDLControllerManager static native void nativeAddJoystick(int device_id, String name, String desc, int vendor_id, int product_id, int button_mask, - int naxes, int axis_mask, int nhats, boolean can_rumble, boolean has_rgb_led); + int naxes, int axis_mask, int nhats, boolean can_rumble, boolean has_rgb_led, + boolean has_accelerometer, boolean has_gyroscope); static native void nativeRemoveJoystick(int device_id); static native void nativeAddHaptic(int device_id, String name); static native void nativeRemoveHaptic(int device_id); - static public native boolean onNativePadDown(int device_id, int keycode); - static public native boolean onNativePadUp(int device_id, int keycode); + static public native boolean onNativePadDown(int device_id, int keycode, int scancode); + static public native boolean onNativePadUp(int device_id, int keycode, int scancode); static native void onNativeJoy(int device_id, int axis, float value); static native void onNativeHat(int device_id, int hat_id, int x, int y); + static native void onNativeJoySensor(int device_id, int sensor_type, long sensor_timestamp, float x, float y, float z); protected static SDLJoystickHandler mJoystickHandler; protected static SDLHapticHandler mHapticHandler; @@ -81,6 +87,13 @@ public class SDLControllerManager mJoystickHandler.setLED(device_id, red, green, blue); } + /** + * This method is called by SDL using JNI. + */ + static void joystickSetSensorsEnabled(int device_id, boolean enabled) { + mJoystickHandler.setSensorsEnabled(device_id, enabled); + } + /** * This method is called by SDL using JNI. */ @@ -153,6 +166,10 @@ class SDLJoystickHandler { ArrayList hats; ArrayList lights; LightsManager.LightsSession lightsSession; + SensorManager sensorManager; + SDLJoySensorListener sensorListener; + Sensor accelerometerSensor; + Sensor gyroscopeSensor; } static class RangeComparator implements Comparator { @Override @@ -225,12 +242,13 @@ class SDLJoystickHandler { joystick.desc = getJoystickDescriptor(joystickDevice); joystick.axes = new ArrayList(); joystick.hats = new ArrayList(); + java.util.Set axisStrsSet = new java.util.HashSet(); joystick.lights = new ArrayList(); List ranges = joystickDevice.getMotionRanges(); Collections.sort(ranges, new RangeComparator()); for (InputDevice.MotionRange range : ranges) { - if ((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) { + if (((range.getSource() & InputDevice.SOURCE_CLASS_JOYSTICK) != 0) && axisStrsSet.add(range.getAxis())) { if (range.getAxis() == MotionEvent.AXIS_HAT_X || range.getAxis() == MotionEvent.AXIS_HAT_Y) { joystick.hats.add(range); } else { @@ -241,6 +259,8 @@ class SDLJoystickHandler { boolean can_rumble = false; boolean has_rgb_led = false; + boolean has_accelerometer = false; + boolean has_gyroscope = false; if (Build.VERSION.SDK_INT >= 31 /* Android 12.0 (S) */) { VibratorManager vibratorManager = joystickDevice.getVibratorManager(); int[] vibrators = vibratorManager.getVibratorIds(); @@ -258,12 +278,26 @@ class SDLJoystickHandler { joystick.lightsSession = lightsManager.openSession(); has_rgb_led = true; } + SensorManager sensorManager = joystickDevice.getSensorManager(); + if (sensorManager != null) { + joystick.sensorManager = sensorManager; + joystick.sensorListener = new SDLJoySensorListener(joystick.device_id); + joystick.accelerometerSensor = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); + if (joystick.accelerometerSensor != null) { + has_accelerometer = true; + } + joystick.gyroscopeSensor = sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); + if (joystick.gyroscopeSensor != null) { + has_gyroscope = true; + } + } } mJoysticks.add(joystick); SDLControllerManager.nativeAddJoystick(joystick.device_id, joystick.name, joystick.desc, getVendorId(joystickDevice), getProductId(joystickDevice), - getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, can_rumble, has_rgb_led); + getButtonMask(joystickDevice), joystick.axes.size(), getAxisMask(joystick.axes), joystick.hats.size()/2, can_rumble, has_rgb_led, + has_accelerometer, has_gyroscope); } } } @@ -508,6 +542,31 @@ class SDLJoystickHandler { } joystick.lightsSession.requestLights(lightsRequest.build()); } + + void setSensorsEnabled(int device_id, boolean enabled) { + if (Build.VERSION.SDK_INT < 31 /* Android 12.0 (S) */) { + return; + } + SDLJoystick joystick = getJoystick(device_id); + if (joystick == null || joystick.sensorManager == null) { + return; + } + if (enabled) { + if (joystick.accelerometerSensor != null) { + SDLSensorManager.registerListener(joystick.sensorManager, joystick.sensorListener, joystick.accelerometerSensor, SensorManager.SENSOR_DELAY_GAME); + } + if (joystick.gyroscopeSensor != null) { + SDLSensorManager.registerListener(joystick.sensorManager, joystick.sensorListener, joystick.gyroscopeSensor, SensorManager.SENSOR_DELAY_GAME); + } + } else { + if (joystick.accelerometerSensor != null) { + SDLSensorManager.unregisterListener(joystick.sensorManager, joystick.sensorListener, joystick.accelerometerSensor); + } + if (joystick.gyroscopeSensor != null) { + SDLSensorManager.unregisterListener(joystick.sensorManager, joystick.sensorListener, joystick.gyroscopeSensor); + } + } + } } class SDLHapticHandler_API31 extends SDLHapticHandler { @@ -933,3 +992,19 @@ class SDLGenericMotionListener_API29 extends SDLGenericMotionListener_API26 { return penDevice.isExternal() ? SDL_PEN_DEVICE_TYPE_INDIRECT : SDL_PEN_DEVICE_TYPE_DIRECT; } } + +class SDLJoySensorListener implements SensorEventListener { + int device_id; + + public SDLJoySensorListener(int device_id) { + this.device_id = device_id; + } + + @Override + public void onAccuracyChanged(Sensor sensor, int accuracy) {} + + @Override + public void onSensorChanged(SensorEvent event) { + SDLControllerManager.onNativeJoySensor(device_id, event.sensor.getType(), event.timestamp, event.values[0], event.values[1], event.values[2]); + } +} diff --git a/platforms/android/app/src/main/java/org/libsdl/app/SDLSensorManager.java b/platforms/android/app/src/main/java/org/libsdl/app/SDLSensorManager.java new file mode 100644 index 0000000000..586e3fab6e --- /dev/null +++ b/platforms/android/app/src/main/java/org/libsdl/app/SDLSensorManager.java @@ -0,0 +1,32 @@ +package org.libsdl.app; + +import android.hardware.Sensor; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; + +// This class coordinates synchronized access to sensor manager registration +// +// This prevents a java.util.ConcurrentModificationException exception on +// Android 16, specifically on the Samsung Tab S9 Ultra. + +class SDLSensorManager +{ + static private SDLSensorManager mManager = new SDLSensorManager(); + + public static void registerListener(SensorManager manager, SensorEventListener listener, Sensor sensor, int samplingPeriodUs) { + mManager.RegisterListener(manager, listener, sensor, samplingPeriodUs); + } + + public static void unregisterListener(SensorManager manager, SensorEventListener listener, Sensor sensor) { + mManager.UnregisterListener(manager, listener, sensor); + } + + private synchronized void RegisterListener(SensorManager manager, SensorEventListener listener, Sensor sensor, int samplingPeriodUs) { + manager.registerListener(listener, sensor, samplingPeriodUs, null); + } + + private synchronized void UnregisterListener(SensorManager manager, SensorEventListener listener, Sensor sensor) { + manager.unregisterListener(listener, sensor); + } +} + diff --git a/platforms/android/app/src/main/java/org/libsdl/app/SDLSurface.java b/platforms/android/app/src/main/java/org/libsdl/app/SDLSurface.java index 5ed335ac39..8d56658958 100644 --- a/platforms/android/app/src/main/java/org/libsdl/app/SDLSurface.java +++ b/platforms/android/app/src/main/java/org/libsdl/app/SDLSurface.java @@ -47,6 +47,9 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, // Is SurfaceView ready for rendering protected boolean mIsSurfaceReady; + // Is on-screen keyboard visible + protected boolean mKeyboardVisible; + // Pinch events private final ScaleGestureDetector scaleGestureDetector; @@ -213,6 +216,18 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, WindowInsets.Type.displayCutout()); SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom); + + if (insets.isVisible(WindowInsets.Type.ime())) { + if (!mKeyboardVisible) { + mKeyboardVisible = true; + SDLActivity.onNativeScreenKeyboardShown(); + } + } else { + if (mKeyboardVisible) { + mKeyboardVisible = false; + SDLActivity.onNativeScreenKeyboardHidden(); + } + } } // Pass these to any child views in case they need them @@ -318,11 +333,11 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback, protected void enableSensor(int sensortype, boolean enabled) { // TODO: This uses getDefaultSensor - what if we have >1 accels? if (enabled) { - mSensorManager.registerListener(this, + SDLSensorManager.registerListener(mSensorManager, this, mSensorManager.getDefaultSensor(sensortype), - SensorManager.SENSOR_DELAY_GAME, null); + SensorManager.SENSOR_DELAY_GAME); } else { - mSensorManager.unregisterListener(this, + SDLSensorManager.unregisterListener(mSensorManager, this, mSensorManager.getDefaultSensor(sensortype)); } } diff --git a/platforms/android/scripts/stage-jni-libs.sh b/platforms/android/scripts/stage-jni-libs.sh index 42b08c13e6..3984cf03ee 100755 --- a/platforms/android/scripts/stage-jni-libs.sh +++ b/platforms/android/scripts/stage-jni-libs.sh @@ -61,12 +61,55 @@ rm -rf "$APP_DIR/x86" "$APP_DIR/arm64-v8a" "$APP_DIR/x86_64" for abi in $ANDROID_STAGE_ABIS; do case "$abi" in - arm64-v8a) src="$ROOT_DIR/build/android-arm64/libmain.so" ;; - x86_64) src="$ROOT_DIR/build/android-x86_64/libmain.so" ;; + arm64-v8a) + src="$ROOT_DIR/build/android-arm64/libmain.so" + triple="aarch64-linux-android" + ;; + x86_64) + src="$ROOT_DIR/build/android-x86_64/libmain.so" + triple="x86_64-linux-android" + ;; *) echo "Unsupported ABI '$abi'. Supported ABIs: arm64-v8a x86_64" >&2 exit 1 ;; esac copy_lib "$abi" "$src" + if [[ -n "$STRIP_TOOL" ]]; then + stl="$(dirname "$STRIP_TOOL")/../sysroot/usr/lib/$triple/libc++_shared.so" + if [[ -f "$stl" ]]; then + cp -f "$stl" "$APP_DIR/$abi/libc++_shared.so" + echo "Staged $stl -> $APP_DIR/$abi/libc++_shared.so" + else + echo "Missing libc++_shared.so for $abi at $stl" >&2 + exit 1 + fi + else + echo "Cannot stage libc++_shared.so for $abi (NDK not found)" >&2 + exit 1 + fi +done + +# Stage bundled mod packages into the app's assets source dir. +MODS_STAGING_DIR="$ROOT_DIR/platforms/android/app/src/main/bundled_mods" +rm -rf "$MODS_STAGING_DIR" +mkdir -p "$MODS_STAGING_DIR" +for abi in $ANDROID_STAGE_ABIS; do + case "$abi" in + arm64-v8a) build_dir="$ROOT_DIR/build/android-arm64" ;; + x86_64) build_dir="$ROOT_DIR/build/android-x86_64" ;; + esac + [[ -d "$build_dir/bundled_mods" ]] || continue + for pkg in "$build_dir/bundled_mods"/*.dusk; do + [[ -f "$pkg" ]] || continue + name="$(basename "$pkg")" + if [[ ! -f "$MODS_STAGING_DIR/$name" ]]; then + cp -f "$pkg" "$MODS_STAGING_DIR/$name" + echo "Staged bundled mod $pkg" + else + stage_dir="$build_dir/mods/${name%.dusk}/${name%.dusk}_stage" + (cd "$stage_dir" && zip -q -r "$MODS_STAGING_DIR/$name" lib) + echo "Appended $abi libraries to bundled mod $name" + fi + done done diff --git a/platforms/freedesktop/1024x1024/apps/dusklight.png b/platforms/freedesktop/1024x1024/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/1024x1024/apps/dusklight.png rename to platforms/freedesktop/1024x1024/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/128x128/apps/dusklight.png b/platforms/freedesktop/128x128/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/128x128/apps/dusklight.png rename to platforms/freedesktop/128x128/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/16x16/apps/dusklight.png b/platforms/freedesktop/16x16/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/16x16/apps/dusklight.png rename to platforms/freedesktop/16x16/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/256x256/apps/dusklight.png b/platforms/freedesktop/256x256/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/256x256/apps/dusklight.png rename to platforms/freedesktop/256x256/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/32x32/apps/dusklight.png b/platforms/freedesktop/32x32/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/32x32/apps/dusklight.png rename to platforms/freedesktop/32x32/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/48x48/apps/dusklight.png b/platforms/freedesktop/48x48/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/48x48/apps/dusklight.png rename to platforms/freedesktop/48x48/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/512x512/apps/dusklight.png b/platforms/freedesktop/512x512/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/512x512/apps/dusklight.png rename to platforms/freedesktop/512x512/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/64x64/apps/dusklight.png b/platforms/freedesktop/64x64/apps/dev.twilitrealm.dusk.png similarity index 100% rename from platforms/freedesktop/64x64/apps/dusklight.png rename to platforms/freedesktop/64x64/apps/dev.twilitrealm.dusk.png diff --git a/platforms/freedesktop/dusklight.desktop b/platforms/freedesktop/dev.twilitrealm.dusk.desktop similarity index 86% rename from platforms/freedesktop/dusklight.desktop rename to platforms/freedesktop/dev.twilitrealm.dusk.desktop index 4f6ba034a9..b1ad2831a2 100644 --- a/platforms/freedesktop/dusklight.desktop +++ b/platforms/freedesktop/dev.twilitrealm.dusk.desktop @@ -3,7 +3,7 @@ Name=Dusklight GenericName=Dusklight Comment=PC port of a classic adventure game Exec=dusklight -Icon=dusklight +Icon=dev.twilitrealm.dusk Terminal=false Type=Application Categories=Game; diff --git a/platforms/freedesktop/dev.twilitrealm.dusk.metainfo.xml b/platforms/freedesktop/dev.twilitrealm.dusk.metainfo.xml new file mode 100644 index 0000000000..ac99f15ddc --- /dev/null +++ b/platforms/freedesktop/dev.twilitrealm.dusk.metainfo.xml @@ -0,0 +1,38 @@ + + + dev.twilitrealm.dusk + dev.twilitrealm.dusk.desktop + Dusklight + Native port of a classic adventure game + + Twilit Realm + + https://twilitrealm.dev + https://github.com/TwilitRealm/dusklight/issues + CC0-1.0 + CC0-1.0 + + + console + gamepad + + +

+ Dusklight is a reverse-engineered reimplementation of a classic adventure game. + It aims to be as accurate as possible to the original while also providing new options, enhancements, and tools to customize your experience. +

+
+ + + dusklight + dev.twilitrealm.dusk.desktop + + + + + +

Initial Flatpak release.

+
+
+
+
diff --git a/platforms/macos/Dusklight.entitlements b/platforms/macos/Dusklight.entitlements new file mode 100644 index 0000000000..123d12a53e --- /dev/null +++ b/platforms/macos/Dusklight.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.cs.disable-library-validation + + + diff --git a/res/gamecontrollerdb.txt b/res/gamecontrollerdb.txt deleted file mode 100644 index 030c167638..0000000000 --- a/res/gamecontrollerdb.txt +++ /dev/null @@ -1,2239 +0,0 @@ -# Game Controller DB for SDL in 2.0.16 format -# Source: https://github.com/mdqinc/SDL_GameControllerDB - -# Windows -03000000300f00000a01000000000000,3 In 1 Conversion 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:a3,righty:a2,start:b8,x:b3,y:b0,platform:Windows, -03000000fa190000918d000000000000,3 In 1 Conversion 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:a3,righty:a2,start:b8,x:b3,y:b0,platform: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, -03000000c82d00001930000000000000,8BitDo 64,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,righttrigger:b9,rightx:a3,righty:a4,start:b11,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,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a2,rightx:a3,righty:a5,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, -03000000c82d00006a28000000000000,8BitDo GameCube,a:b0,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b9,paddle2:b8,rightshoulder:b10,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b1,y:b4,platform:Windows, -03000000c82d00001251000000000000,8BitDo Lite 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, -03000000c82d00001151000000000000,8BitDo Lite SE,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, -03000000c82d00000150000000000000,8BitDo M30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a3,righty:a5,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00000151000000000000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a2,rightshoulder:b6,righttrigger:b7,rightx:a3,righty:a5,start:b11,x:b3,y:b4,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,rightx:a3,righty:a4,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, -03000000c82d00002090000000000000,8BitDo Micro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,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, -03000000c82d00000451000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a2,rightx:a3,righty:a5,start:b11,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, -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, -03000000c82d00006928000000000000,8BitDo N64,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b11,platform:Windows, -03000000c82d00002590000000000000,8BitDo NEOGEO,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -030000003512000012ab000000000000,8BitDo NES30,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: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:a2,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a5,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00000851000000000000,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:a2,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a5,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,paddle1:b2,paddle2:b5,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, -03000000c82d00000960000000000000,8BitDo Pro 3,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,paddle1:b17,paddle2:b16,paddle3:b2,paddle4:b5,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,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a2,rightshoulder:b6,righttrigger:b7,rightx:a3,righty:a5,start:b10,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d000021ab000000000000,8BitDo SFC30,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, -03000000c82d00003028000000000000,8BitDo SFC30,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, -030000003512000020ab000000000000,8BitDo SN30,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b11,x:b4,y:b3,platform:Windows, -03000000c82d00000030000000000000,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,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a2,rightshoulder:b7,rightx:a3,righty:a5,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, -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, -03000000c82d00000260000000000000,8BitDo SN30 Pro Plus,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 Plus,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, -03000000c82d00001130000000000000,8BitDo Ultimate,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,misc1:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001230000000000000,8BitDo Ultimate,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,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001330000000000000,8BitDo Ultimate,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:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001260000000000000,8BitDo Ultimate 2,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,paddle1:b17,paddle2:b16,paddle3:b2,paddle4:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001b30000000000000,8BitDo Ultimate 2C,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,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001c30000000000000,8BitDo Ultimate 2C,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,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001d30000000000000,8BitDo Ultimate 2C,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,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000c82d00001530000000000000,8BitDo Ultimate C,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, -03000000c82d00001630000000000000,8BitDo Ultimate C,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, -03000000c82d00001730000000000000,8BitDo Ultimate C,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, -03000000c82d00000121000000000000,8BitDo Xbox One SN30 Pro,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, -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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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, -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, -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, -030000006f0e00008801000000000000,Afterglow 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,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, -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, -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, -0300000008100000e501000000000000,Anbernic Game Pad,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:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000020500000913000000000000,Anbernic RG P01,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:a5,start:b11,x:b3,y:b4,platform:Windows, -03000000373500000710000000000000,Anbernic RG P01,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, -03000000373500004610000000000000,Anbernic RG P01,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,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000190e00000110000000000000,Aquaplus Piece,a:b1,b:b0,back:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start: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,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, -03000000a30c00002700000000000000,Astro City Mini,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-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, -03000000050b00000579000000000000,ASUS ROG Kunai 3,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, -03000000050b00000679000000000000,ASUS ROG Kunai 3,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,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -030000006a0e00001140000000000000,Atari CX Controller,a:b0,leftx:a0,lefty:a1,platform:Windows, -03000000503200000110000000000000,Atari VCS Classic Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,start:b3,platform:Windows, -03000000503200000210000000000000,Atari VCS Modern Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows, -03000000380800001889000000000000,AtGames Legends Gamer Pro,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b13,lefttrigger:b14,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, -030000008a3500000102000000000000,Backbone One,a:b4,b:b5,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b10,leftstick:b17,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b18,righttrigger:b13,rightx:a3,righty:a4,start:b15,x:b7,y:b8,platform:Windows, -030000008a3500000201000000000000,Backbone One,a:b4,b:b5,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b10,leftstick:b17,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b18,righttrigger:b13,rightx:a3,righty:a4,start:b15,x:b7,y:b8,platform:Windows, -030000008a3500000302000000000000,Backbone One,a:b4,b:b5,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b10,leftstick:b17,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b18,righttrigger:b13,rightx:a3,righty:a4,start:b15,x:b7,y:b8,platform:Windows, -030000008a3500000402000000000000,Backbone One,a:b4,b:b5,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b10,leftstick:b17,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b18,righttrigger:b13,rightx:a3,righty:a4,start:b15,x:b7,y:b8,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,touchpad:b13,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, -030000000d0500000308000000000000,Belkin 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, -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, -03000000790000000700000000000000,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:a4,start:b9,x:b3,y:b0,platform:Windows, -03000000808300000300000000000000,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:a4,start:b9,x:b3,y:b0,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, -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,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,touchpad:b13,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,touchpad:b13,x:b0,y:b3,platform:Windows, -03000000120c0000f10e000000000000,Brook PS2 Adapter,a:b1,b:b2,back:b13,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, -03000000120c0000310c000000000000,Brook Super Converter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,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, -030000005a1c00002400000000000000,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, -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, -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, -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, -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, -03000000151a00006222000000000000,Dual Plus 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, -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, -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, -03000000bc2000000091000000000000,EasySMX 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, -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, -03000095090000010000000000000000,Elecom JC-U609,a:b0,b:b1,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b8,x:b3,y:b4,platform:Windows, -0300004112000000e500000000000000,Elecom JC-U909Z,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b8,x:b3,y:b4,platform:Windows, -03000041120000001050000000000000,Elecom JC-U911,a:b1,b:b2,back:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,start:b0,x:b4,y:b5,platform:Windows, -030000006e0500000520000000000000,Elecom P301U PlayStation 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, -03000000250900000218000000000000,Elecom 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, -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, -030000007d0400000640000000000000,Eliminator AfterShock,a:b1,b:b2,back:b9,dpdown:+a3,dpleft:-a5,dpright:+a5,dpup:-a3,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a4,righty:a2,start:b8,x:b0,y:b3,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, -03000000062000001801000000000000,EMS TrioLinker Plus II,a:b0,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:b2,y:b3,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, -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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -030000006f0e00008101000000000000,Faceoff Deluxe 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,misc1:b13,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,misc1:b13,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, -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, -03005036852100000000000000000000,Final Fantasy XIV Online 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, -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:b27,b:b26,back:b19,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b23,leftstick:b17,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b22,rightstick:b16,righttrigger:b20,rightx:a3,righty:a4,start:b18,x:b25,y:b24,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,misc1:b14,paddle1:b4,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,platform:Windows, -03000000b40400001224000000000000,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,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -030000008305000000a0000000000000,G08XU,a:b0,b:b1,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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, -03000000790000004618000000000000,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: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, -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, -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, -03000000373500002210000000000000,GameSir G7 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:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000ac0500001a06000000000000,GameSir T3 2.02,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, -03000000373500000410000000000000,GameSir T4 Kaleid,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, -03000000373500009410000000000000,GameSir Tegenaria Lite,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, -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,touchpad:b13,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, -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, -03000000f025000031c1000000000000,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, -03000000d11800000094000000000000,Google 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, -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, -030000007d0400000840000000000000,Gravis Destroyer Tilt,+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, -030000007d0400000540000000000000,Gravis Eliminator 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:Windows, -03000000280400000140000000000000,Gravis GamePad Pro,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a3,dpup:-a4,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,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, -030000008a2e0000dd10000000000000,Hand Held Legend GC Ultimate,a:b0,b:b2,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,misc2:b24,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b1,y:b3,platform:Windows, -030000008a2e0000df10000000000000,Hand Held Legend ProGCC,a:b1,b:b0,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b3,y:b2,platform:Windows, -030000000d0f00004900000000000000,Hatsune Miku Sho 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, -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, -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,touchpad:b13,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, -030000000d0f00006201000000000000,Hori Fighting Commander Octa,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,start:b9,x:b0,y:b3,platform:Windows, -030000000d0f00006401000000000000,Hori Fighting Commander Octa,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,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, -030000000d0f00008800000000000000,Hori Fighting Stick mini 4 PS3,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, -030000000d0f00008700000000000000,Hori Fighting Stick mini 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:b6,rightshoulder:b5,righttrigger:b7,start:b9,touchpad:b13,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, -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, -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, -030000000d0f0000a500000000000000,Hori Miku Project Diva X HD 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:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows, -030000000d0f0000a600000000000000,Hori Miku Project Diva X HD 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,touchpad: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,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,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, -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,touchpad:b13,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, -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, -030000000d0f0000c100000000000000,Horipad 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -030000000d0f0000f600000000000000,Horipad Nintendo Switch 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:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, -030000000d0f00000202000000000000,Horipad O Nintendo Switch 2 Controller,a:b1,b:b0,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,misc2:b14,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,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, -030000000d0f00009601000000000000,Horipad Steam,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,misc2:b2,paddle1:b5,paddle2:b15,paddle3:b18,paddle4:b19,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,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, -03000000242e00000b20000000000000,Hyperkin Admiral N64 Controller,+rightx:b11,+righty:b13,-rightx:b8,-righty:b12,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,platform:Windows, -03000000242e0000ff0b000000000000,Hyperkin N64 Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b9,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, -03000000242e00006a48000000000000,Hyperkin RetroN Sq,a:b3,b:b7,back:b5,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b0,rightshoulder:b1,start:b4,x:b2,y:b6,platform:Windows, -03000000242f00000a20000000000000,Hyperkin Scout,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, -03000000242e00000a20000000000000,Hyperkin Scout Premium SNES Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, -03000000242e00006a38000000000000,Hyperkin Trooper 2,a:b0,b:b1,back:b4,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b3,start:b5,platform:Windows, -03000000f00300008d04000000000000,HyperX Clutch,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:-a2,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:+a5,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,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, -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, -03000000511d00000230000000000000,iGUGU Gamecore,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b1,leftstick:b4,lefttrigger:b3,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b2,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,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, -03000000fd0500000030000000000000,Interact GoPad,a:b3,b:b4,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,x:b0,y:b1,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, -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,guide:b12,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, -03000000250900000017000000000000,Joypad 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, -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, -030000008b0100002301000000000000,Joytech JS-112,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a2,lefty:a3,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a0,righty:a1,start:b9,x:b0,y:b1,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, -03000000c4ac00001c80000000000000,KidzPlay Adventure PlayStation Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b0,y:b3,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, -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,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,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, -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, -030000006d04000011c2000000000000,Logitech WingMan Cordless,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, -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,touchpad:b13,x:b0,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, -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,touchpad:b13,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,touchpad:b13,x:b0,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,touchpad:b13,x:b0,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, -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,touchpad:b13,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, -030000008f0e00001330000000000000,Mayflash Adapter,a:b1,b:b2,back:b8,dpdown:h0.8,dpleft:h0.2,dpright:h0.1,dpup:h0.4,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a3~,righty:a2,start:b9,x:b0,y:b3,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, -03000000242f00003700000000000000,Mayflash F101,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, -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, -03000000790000004318000000000000,Mayflash GameCube 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, -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, -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, -03000000242f0000f400000000000000,Mayflash N64 Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a5,start:b9,platform:Windows, -03000000242f0000f500000000000000,Mayflash N64 Adapter,a:b2,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a5,start:b9,platform:Windows, -03000000790000007918000000000000,Mayflash N64 Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,righttrigger:b7,rightx:a3,righty:a2,start:b8,platform:Windows, -030000008f0e00001030000000000000,Mayflash Saturn Adapter,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, -0300000025090000e803000000000000,Mayflash Wii Classic Adapter,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:Windows, -03000000790000000318000000000000,Mayflash Wii DolphinBar,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, -03000000790000000018000000000000,Mayflash Wii U 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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-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, -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, -030000004523000015e0000000000000,Mobapad Chitu HD,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, -03000000491900000904000000000000,Mobapad Chitu HD,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,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,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, -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, -03000000091200004488000000000000,MUSIA PlayStation 2 Input Display,a:b0,b:b2,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b6,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:b11,rightx:a2,righty:a3,start:b5,x:b1,y:b3,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, -03000000c9110000f055000000000000,Nacon 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, -03000000c21100000791000000000000,Nacon GC101 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:Windows, -030000006b140000010c000000000000,Nacon GC400ES,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,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows, -0300000085320000170d000000000000,Nacon Revolution 5 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,touchpad:b13,x:b0,y:b3,platform:Windows, -0300000085320000190d000000000000,Nacon Revolution 5 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,touchpad:b13,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,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,touchpad:b13,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 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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b3,platform:Windows, -03000000921200004346000000000000,NES Controller,a:b0,b:b1,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b3,platform:Windows, -03000000790000004518000000000000,NEXiLUX 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: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, -03000000ec110000e1a7000000000000,Nintendo Switch,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, -030000007e0500006920000000000000,Nintendo Switch 2 Pro Controller,a:b0,b:b1,back:b14,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b12,leftstick:b15,lefttrigger:b13,leftx:a0,lefty:a1~,misc1:b17,misc2:b20,paddle1:b18,paddle2:b19,rightshoulder:b4,rightstick:b7,righttrigger:b5,rightx:a2,righty:a3~,start:b6,x:b2,y:b3,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, -030000007e0500007320000000000000,NSO GameCube Controller,a:b1,b:b3,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b13,lefttrigger:b12,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b4,rightx:a2,righty:a3~,start:b6,x:b0,y:b2,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, -030000004b120000014d000000000000,Nyko Airflo EX,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:a3,righty:a2,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, -03000000120c00000288000000000000,Nyko Airflo 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, -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, -0300000009120000072f000000000000,OrangeFox86 DreamPicoPort,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:-a2,leftx:a0,lefty:a1,righttrigger:-a5,rightx:a3,righty:a4,start:b11,x:b3,y:b4,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:a5,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 GameCube Controller,a:b1,b:b0,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, -030000006f0e00000901000000000000,PDP PS3 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, -030000006f0e00008901000000000000,PDP Realmz 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, -030000008f0e00004100000000000000,PlaySega,a:b1,b:b0,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b8,x:b4,y:b3,platform:Windows, -03000000d620000011a7000000000000,PowerA Core 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -03000000dd62000015a7000000000000,PowerA Fusion Nintendo Switch 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:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -03000000d620000012a7000000000000,PowerA Fusion Nintendo Switch Fight Pad,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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -03000000dd62000016a7000000000000,PowerA Fusion 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -03000000d620000013a7000000000000,PowerA 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, -03000000d62000002640000000000000,PowerA OPS 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, -03000000d62000003340000000000000,PowerA OPS Pro 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, -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, -0300000062060000d570000000000000,PowerA 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:b0,y:b3,platform:Windows, -03000000d620000014a7000000000000,PowerA Spectra 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,misc1:b13,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, -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, -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.4,dpleft:h0.8,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:b3,y:b0,platform:Windows, -03000000888800000804000000000000,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: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,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, -03000000120c0000111e000000000000,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, -03000000120c0000121e000000000000,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, -03000000120c0000130e000000000000,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, -03000000120c0000150e000000000000,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, -03000000120c0000180e000000000000,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, -03000000120c0000181e000000000000,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, -03000000120c0000191e000000000000,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, -03000000120c00001e0e000000000000,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, -03000000120c0000a957000000000000,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, -03000000120c0000aa57000000000000,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, -03000000120c0000f21c000000000000,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, -03000000120c0000f31c000000000000,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, -03000000120c0000f41c000000000000,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, -03000000120c0000f51c000000000000,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, -03000000120c0000f70e000000000000,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, -03000000120e0000120c000000000000,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, -03000000160e0000120c000000000000,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, -030000001a1e0000120c000000000000,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, -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,touchpad:b13,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,touchpad:b13,x:b0,y:b3,platform:Windows, -030000004c0500005f0e000000000000,PS5 Access 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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Windows, -030000004c050000f20d000000000000,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,misc1:b14,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, -03000000222c00000025000000000000,Qanba Dragon Arcade Joystick,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, -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,touchpad:b13,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, -03000000ff1100004733000000000000,Ramox FPS 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,righttrigger:b7,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, -030000009b280000d000000000000000,Raphnet Dreamcast Adapter,a:b1,b:b0,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,lefttrigger:+a5,leftx:a0,lefty:a1,righttrigger:+a2,start:b3,x:b5,y:b4,platform:Windows, -030000009b2800006200000000000000,Raphnet GameCube 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: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, -030000009b2800003c00000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows, -030000009b2800006100000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows, -030000009b2800006300000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Windows, -030000009b2800006400000000000000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,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, -030000009b2800004400000000000000,Raphnet PlayStation Adapter,a:b1,b:b2,back:b5,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b9,rightx:a3,righty:a4,start:b4,x:b0,y:b3,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,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, -030000009b2800002600000000000000,Raphnet SNES Adapter,a:b1,b:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Windows, -030000009b2800002e00000000000000,Raphnet SNES Adapter,a:b1,b:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Windows, -030000009b2800002f00000000000000,Raphnet SNES Adapter,a:b1,b:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Windows, -030000009b2800005600000000000000,Raphnet SNES Adapter,a:b1,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Windows, -030000009b2800005700000000000000,Raphnet SNES Adapter,a:b1,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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,guide:b10,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,guide:b10,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b3,x:b0,y:b5,platform:Windows, -030000009b2800008000000000000000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b3,x:b0,y:b5,platform:Windows, -03000000790000008f18000000000000,Rapoo Gamepad,a:b2,b:b1,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:b3,y:b0,platform:Windows, -0300000032150000a602000000000000,Razer Huntsman V3 Pro,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b12,dpright:b13,dpup:b11,guide:b10,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, -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, -03000000f8270000bf0b000000000000,Razer Kishi,a:b6,b:b7,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b18,leftshoulder:b12,leftstick:b19,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b13,rightstick:b20,righttrigger:b15,rightx:a3,righty:a4,start:b17,x:b9,y:b10,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,touchpad:b13,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,touchpad:b13,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, -03000000921200004547000000000000,Retro Bit Sega Genesis Adapter,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b6,x:b3,y:b4,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, -03000000632500007805000000000000,Retro Fighters 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, -0300000003040000c197000000000000,Retrode Adapter,a:b0,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b1,y:b5,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, -03000000341200000400000000000000,RetroUSB N64 RetroPort,+rightx:b8,+righty:b10,-rightx:b9,-righty:b11,a:b7,b:b6,dpdown:b2,dpleft:b1,dpright:b0,dpup:b3,leftshoulder:b13,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b12,start:b4,platform:Windows, -0300000000f000000300000000000000,RetroUSB RetroPad,a:b1,b:b5,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, -0300000000f00000f100000000000000,RetroUSB Super RetroPort,a:b1,b:b5,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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, -030000006f0e00008701000000000000,Rock Candy 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,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, -03000000830500000052000000000000,Rockfire CosmoVoyager,a:b0,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b10,leftshoulder:b6,lefttrigger:b7,misc1:b11,rightshoulder:b5,righttrigger:b2,start:b9,x:b3,y:b4,platform:Windows, -03000000830500007030000000000000,Rockfire Space Ranger,a:b0,b:b1,back:b5,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b9,righttrigger:b8,start:b2,x:b3,y:b4,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, -030000000d0f0000ad00000000000000,RX Gamepad,a:b0,b:b4,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b3,rightshoulder:b6,start:b9,x:b2,y:b1,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, -030000006f0e00001311000000000000,Saffun Controller,a:b2,b:b3,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:b1,y:b0,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,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, -03000000bd12000010d1000000000000,Sanwa 4Button,a:b0,b:b1,x:b2,y:b3,dpup:-a1,dpdown:+a1,dpleft:-a0,dpright:+a0,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b3,platform:Windows, -030000009d0d00001130000000000000,Sanwa PlayStation Adapter,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, -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, -03000000630600000201000000000000,Sanwa Virtua Grip,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b2,b:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,x:b0,y:b1,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,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, -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, -03000000d804000086e6000000000000,Sega Multi Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a2,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Windows, -0300000000050000289b000000000000,Sega Saturn Adapter,a:b1,b:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, -0300000000f000000800000000000000,Sega Saturn Controller,a:b1,b:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,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, -03000000632500002705000000000000,ShanWan Q36,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,rightshoulder:b7,righttrigger:b9,start:b11,x:b3,y:b4,platform:Windows, -03000000f82100001900000000000000,Shogun Bros Chameleon X1,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,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,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, -03000000140300000918000000000000,SNES Controller,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:Windows, -0300000081170000960a000000000000,SNES Controller,a:b4,b:b0,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Windows, -030000008f0e00000910000000000000,Sony 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,Sony 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, -03000000666600006706000000000000,Sony PlayStation Adapter,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, -03000000d9040000160f000000000000,Sony PlayStation 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, -03000000e30500009605000000000000,Sony 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, -03000000fe1400002a23000000000000,Sony PlayStation Adapter,a:b0,b:b1,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,x:b2,y:b3,platform:Windows, -030000004c050000da0c000000000000,Sony 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,Sony 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,Sony 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, -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, -030000004c0500003713000000000000,Sony 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, -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, -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,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, -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, -03000000381000003014000000000000,SteelSeries Stratus Duo,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, -03000000381000003114000000000000,SteelSeries Stratus Duo,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, -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, -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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,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, -03000000341200001300000000000000,Super Racer,a:b2,b:b3,back:b8,leftshoulder:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b7,x:b0,y:b1,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, -03000000e40a00000307000000000000,Taito Egret II Mini Control Panel,a:b4,b:b2,back:b6,guide:b9,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b1,start:b7,x:b8,y:b3,platform:Windows, -03000000e40a00000207000000000000,Taito Egret II Mini Controller,a:b4,b:b2,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b9,rightshoulder:b0,righttrigger:b1,start:b7,x:b8,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, -03000000790000001c18000000000000,TGZ 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:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000790000002601000000000000,TGZ 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, -03000000591c00002400000000000000,THEC64 Joystick,a:b0,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Windows, -03000000591c00002600000000000000,THEGamepad,a:b2,b:b1,back:b6,leftx:a0,lefty:a1,start:b7,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, -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,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,leftshoulder:b4,leftstick:b10,lefttrigger:-a3,leftx:a0,lefty:a1,paddle1:b6,paddle2:b7,rightshoulder:b5,rightstick:b11,righttrigger:-a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, -030000004f04000008d0000000000000,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:a3~,leftx:a0,lefty:a1,paddle1:b7,paddle2:b6,rightshoulder:b5,rightstick:b11,righttrigger:a4~,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, -03000000011000000200000000000000,ThundeRobot G30,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, -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, -03000000666600000288000000000000,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, -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, -03000000571d00002100000000000000,Tomee NES Adapter,a:b1,b:b0,back:b2,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,start:b3,platform:Windows, -03000000571d00002000000000000000,Tomee SNES Adapter,a:b0,b:b1,back:b6,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,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, -03000000d60600002a00000000000000,Trust 850F,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,x:b3,y:b4,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, -030000005f1400002a01000000000000,Trust Predator GM1200,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,x:b3,y:b4,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, -03000000151900005678000000000000,Uniplay U6,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, -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, -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, -03000000882800000305000000000000,V5 Game Pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,x:b2,y:b3,platform:Windows, -03000000790000001a18000000000000,Venom PS4 Arcade Joystick,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 PS4 Arcade Joystick,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, -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,touchpad:b13,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,touchpad:b13,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,Wii U 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, -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, -030000005e040000a102000000000000,Xbox 360 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, -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, -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,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, -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, -03000000e0ff00000201000000000000,Xiaomi Black Shark (L),back:b0,dpdown:b11,dpleft:b9,dpright:b10,dpup:b8,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,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, -03000000172700003350000000000000,Xiaomi XMGP01YM,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, -03000000bc2000005060000000000000,Xiaomi XMGP01YM,+lefty:+a2,+righty:+a5,-lefty:-a1,-righty:-a4,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,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,start:b11,x:b3,y:b4,platform:Windows, -03000000c0160000e105000000000000,XinMo Dual Arcade,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, -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, -030000007d0400000340000000000000,Xterminator Digital Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:-a4,lefttrigger:+a4,leftx:a0,lefty:a1,paddle1:b7,paddle2:b6,rightshoulder:b5,rightstick:b9,righttrigger:b2,rightx:a3,righty:a5,start:b8,x:b3,y:b4,platform:Windows, -030000002c3600000100000000000000,Yawman Arrow,+rightx:h0.2,+righty:h0.4,-rightx:h0.8,-righty:h0.1,a:b4,b:b5,back:b6,dpdown:b15,dpleft:b14,dpright:b16,dpup:b13,leftshoulder:b10,leftstick:b0,lefttrigger:-a4,leftx:a0,lefty:a1,paddle1:b11,paddle2:b12,rightshoulder:b8,rightstick:b9,righttrigger:+a4,start:b3,x:b1,y:b2,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, -03000000073500000400000000000000,Zenaim Arcade 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,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, -03000000120c00000500000000000000,Zeroplus Adapter,a:b2,b:b1,back:b11,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:b0,righttrigger:b5,rightx:a3,righty:a2,start:b8,x:b3,y:b0,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,2 In 1 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, -03000000c82d00001930000000000000,8BitDo 64,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,righttrigger:b9,rightx:a2,righty:a3,start:b11,platform:Mac OS X, -03000000c82d00001930000000020000,8BitDo 64,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,righttrigger:b9,rightx:a2,righty:a3,start:b11,platform:Mac OS X, -03000000c82d00001930000001000000,8BitDo 64,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,righttrigger:b9,rightx:a2,righty:a3,start:b11,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, -03000000c82d00000951000000010000,8BitDo Dogbone,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b11,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, -03000000c82d00006a28000000010000,8BitDo GameCube,a:b0,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b9,paddle2:b8,rightshoulder:b10,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b1,y:b4,platform:Mac OS X, -03000000c82d00001251000000010000,8BitDo Lite 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, -03000000c82d00001251000000020000,8BitDo Lite 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, -03000000c82d00001151000000010000,8BitDo Lite SE,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, -03000000c82d00001151000000020000,8BitDo Lite SE,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, -03000000a30c00002400000006020000,8BitDo M30,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,guide:b9,leftshoulder:b6,lefttrigger:b5,rightshoulder:b4,righttrigger:b7,start:b8,x:b3,y:b0,platform:Mac OS X, -03000000c82d00000151000000010000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,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,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00005106000000010000,8BitDo M30,a:b1,b:b0,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b2,leftshoulder:b6,lefttrigger:a5,rightshoulder:b7,righttrigger:a4,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000c82d00002090000000010000,8BitDo Micro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000c82d00000451000000010000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b11,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, -03000000c82d00006928000000010000,8BitDo N64,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,platform:Mac OS X, -03000000c82d00002590000000010000,8BitDo NEOGEO,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:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00002590000001000000,8BitDo NEOGEO,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00002690000000010000,8BitDo NEOGEO,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b10,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,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, -03000000c82d00000751000000010000,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,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00000851000000010000,8BitDo P30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,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, -03000000c82d00000960000000000000,8BitDo Pro 3,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,paddle1:b17,paddle2:b16,paddle3:b2,paddle4:b5,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,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, -03000000c82d00002867000000010000,8BitDo S30,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,rightx:a2,righty:a3,start:b10,x:b3,y:b4,platform:Mac OS X, -03000000c82d00003028000000010000,8Bitdo SFC30 Gamepad,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, -03000000102800000900000000000000,8BitDo SFC30 Joystick,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, -03000000c82d00000351000000010000,8BitDo SN30,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:Mac OS X, -03000000c82d00001290000001000000,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, -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:a3,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000c82d00000260000001000000,8BitDo SN30 Pro Plus,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 Plus,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, -03000000c82d00001230000000010000,8BitDo Ultimate,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,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00001b30000001000000,8BitDo Ultimate 2C,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,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00001d30000001000000,8BitDo Ultimate 2C,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,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00001530000001000000,8BitDo Ultimate C,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:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00001630000001000000,8BitDo Ultimate C,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, -03000000c82d00001730000001000000,8BitDo Ultimate C,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:Mac OS X, -03000000c82d00001130000000020000,8BitDo Ultimate Wired,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:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00001330000000020000,8BitDo Ultimate Wireless,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:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000c82d00001330000001000000,8BitDo Ultimate Wireless,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:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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, -0300000008100000e501000019040000,Anbernic Handheld,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:a4,start:b11,x:b4,y:b3,platform:Mac OS X, -03000000373500004610000001000000,Anbernic RG P01,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:Mac OS X, -03000000a30c00002700000003030000,Astro City Mini,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-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, -03000000050b00000579000000010000,ASUS ROG Kunai 3,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,misc1:b42,paddle1:b9,paddle2:b11,rightshoulder:b7,rightstick:b16,righttrigger:a4,rightx:a2,righty:a3,start:b13,x:b3,y:b4,platform:Mac OS X, -03000000050b00000679000000010000,ASUS ROG Kunai 3,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,misc1:b23,rightshoulder:b7,rightstick:b16,righttrigger:a4,rightx:a2,righty:a3,start:b13,x:b3,y:b4,platform:Mac OS X, -030000006a0e00001140000001000000,Atari CX Wireless Controller,a:b0,leftx:a0,lefty:a1,platform:Mac OS X, -03000000503200000110000045010000,Atari VCS Classic,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b3,start:b2,platform:Mac OS X, -03000000503200000110000047010000,Atari VCS Classic Controller,a:b0,b:b1,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b3,start:b2,platform:Mac OS X, -03000000503200000210000047010000,Atari VCS Modern Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,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:Mac OS X, -030000008a3500000102000000010000,Backbone One,a:b0,b:b1,back:b16,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b17,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b15,x:b2,y:b3,platform:Mac OS X, -030000008a3500000201000000010000,Backbone One,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, -030000008a3500000202000000010000,Backbone One,a:b0,b:b1,back:b16,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b17,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b15,x:b2,y:b3,platform:Mac OS X, -030000008a3500000402000000010000,Backbone One,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, -030000008a3500000302000000010000,Backbone One PlayStation Edition,a:b0,b:b1,back:b16,dpdown:b11,dpleft:b13,dpright:b12,dpup:b10,guide:b17,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3~,start:b15,x:b2,y:b3,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,touchpad:b13,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,touchpad:b13,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,touchpad:b13,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, -03000000501d00009e61000001000000,CoreOrbits GamerPad,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:a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,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, -030000006e0500000720000010020000,Elecom JC-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:Mac OS X, -030000006f0e00008401000003010000,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:b13,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, -03000000151900004000000001000000,Flydigi Vader 2,a:b14,b:b15,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Mac OS X, -03000000b40400001124000001040000,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,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000b40400001224000003030000,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,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -03000000790000004618000000010000,GameCube 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, -03000000ac0500001a06000002020000,GameSir T3 2.02,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: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, -03000000373500000411000023000000,GameSir X4A Xbox 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, -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,touchpad:b13,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, -03000000ff1100003133000007010000,GameWare PC Control Pad,a:b2,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:a3,righty:a4,start:b11,x:b3,y:b0,platform:Mac OS X, -03000000d11800000094000000010000,Google 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, -030000007d0400000540000001010000,Gravis Eliminator 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, -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,touchpad:b13,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,touchpad:b13,x:b0,y:b3,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, -03000000341a00000302000014010000,Hori Fighting Stick Mini,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, -030000000d0f00008800000000010000,Hori Fighting Stick mini 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,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, -030000000d0f00008700000000010000,Hori Fighting Stick mini 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,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,touchpad:b13,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, -030000000d0f00003801000008010000,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: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, -030000000d0f0000aa00000072050000,Hori Real Arcade Pro for Nintendo Switch,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, -030000000d0f00000002000017010000,Hori Split Pad Fit,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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, -030000000d0f00000002000015010000,Hori Switch Split Pad 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,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,touchpad:b13,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, -030000000d0f0000c100000072050000,Horipad 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, -030000000d0f0000f600000000010000,Horipad Switch 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:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, -03000000242e0000ff0b000000010000,Hyperkin N64 Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b9,platform:Mac OS X, -03000000790000004e95000000010000,Hyperkin N64 Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a5,righty:a2,start:b9,platform:Mac OS X, -03000000830500006020000000000000,iBuffalo Super Famicom Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,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, -03000000fd0500000030000010010000,Interact GoPad,a:b3,b:b4,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,x:b0,y:b1,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, -030000006d04000019c2000000020000,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: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, -030000006d0400001ac2000004000000,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: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 Plus,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,touchpad:b13,x:b0,y:b3,platform:Mac OS X, -03000000380700008483000000010000,Mad Catz PS4 Fightstick TE S Plus,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, -0300000049190000020400001b010000,Manba One,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: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, -030000008f0e00001330000011010000,Mayflash Adapter,a:b2,b:b4,back:b16,dpdown:h0.8,dpleft:h0.2,dpright:h0.1,dpup:h0.4,leftshoulder:b12,lefttrigger:b16,leftx:a0,lefty:a2,rightshoulder:b14,rightx:a6~,righty:a4,start:b18,x:b0,y:b6,platform:Mac OS X, -03000000790000004318000000010000,Mayflash GameCube Adapter,a:b4,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a12,leftx:a0,lefty:a4,rightshoulder:b28,righttrigger:a16,rightx:a20,righty:a8,start:b36,x:b8,y:b12,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, -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, -030000008f0e00001030000011010000,Mayflash Saturn Adapter,a:b0,b:b2,dpdown:b28,dpleft:b30,dpright:b26,dpup:b24,leftshoulder:b10,lefttrigger:b14,rightshoulder:b12,righttrigger:b4,start:b18,x:b6,y:b8,platform:Mac OS X, -0300000025090000e803000000000000,Mayflash Wii Classic Adapter,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, -03000000790000000318000000010000,Mayflash Wii DolphinBar,a:b8,b:b12,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b44,leftshoulder:b16,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b4,platform:Mac OS X, -03000000790000000018000000000000,Mayflash Wii U 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, -03000000790000000018000000010000,Mayflash Wii U 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, -030000005e0400000300000006010000,Microsoft SideWinder,a:b0,b:b1,back:b9,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Mac OS X, -030000005e0400000700000006010000,Microsoft SideWinder,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: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, -030000004523000015e0000072050000,Mobapad Chitu HD,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: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, -03000000853200008906000000010000,Nacon Revolution X Unlimited,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 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, -03000000ec110000e1a7000001010000,Nintendo Switch,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, -030000007e0500006920000001010000,Nintendo Switch 2 Pro Controller,a:b0,b:b1,back:b14,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b12,leftstick:b15,lefttrigger:b13,leftx:a0,lefty:a1~,misc1:b17,misc2:b20,paddle1:b18,paddle2:b19,rightshoulder:b4,rightstick:b7,righttrigger:b5,rightx:a2,righty:a3~,start:b6,x:b2,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, -030000007e0500000920000010020000,Nintendo Switch Pro 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:Mac OS X, -050000007e05000009200000ff070000,Nintendo Switch Pro 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:Mac OS X, -030000007e0500007320000001010000,NSO GameCube Controller,a:b1,b:b3,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b13,lefttrigger:b12,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b4,rightx:a2,righty:a3~,start:b6,x:b0,y:b2,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, -030000004b120000014d000000010000,Nyko Airflo EX,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:a3,righty:a2,start:b9,x:b2,y:b3,platform:Mac OS X, -0300000009120000072f000000010000,OrangeFox86 DreamPicoPort,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a2,leftx:a0,lefty:a1,righttrigger:a5,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Mac OS X, -030000006f0e00000901000002010000,PDP PS3 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, -03000000100800000300000006010000,PlayStation 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, -03000000d620000011a7000000020000,PowerA Core Plus Gamecube Controller,a:b1,b:b0,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, -03000000d620000011a7000010050000,PowerA 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: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, -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,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, -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,touchpad:b13,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,touchpad:b13,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,touchpad:b13,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,touchpad:b13,x:b0,y:b3,platform:Mac OS X, -0300004b4c0500005f0e000000010000,PS5 Access 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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Mac OS X, -030000004c050000f20d000000010000,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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,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, -050000004c050000f20d000000010000,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, -030000005e040000e002000001000000,PXN P30 Pro Mobile,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:Mac OS X, -03000000222c00000225000000010000,Qanba Dragon Arcade Joystick 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, -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, -030000009b2800005600000020020000,Raphnet SNES Adapter,a:b1,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Mac OS X, -030000009b2800008000000022020000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a3,righty:a4,start:b3,x:b0,y:b5,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,touchpad:b13,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,touchpad:b13,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, -03000000632500008005000000010000,Redgear,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, -03000000632500002305000000010000,Redragon Saturn,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, -03000000921200004547000000020000,Retro Bit Sega Genesis Adapter,a:b0,b:b2,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,lefttrigger:b14,rightshoulder:b10,righttrigger:b4,start:b12,x:b6,y:b8,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, -0300000003040000c197000000000000,Retrode Adapter,a:b0,b:b4,back:b2,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b6,rightshoulder:b7,start:b3,x:b1,y:b5,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, -03000000341200000400000000000000,RetroUSB N64 RetroPort,+rightx:b8,+righty:b10,-rightx:b9,-righty:b11,a:b7,b:b6,dpdown:b2,dpleft:b1,dpright:b0,dpup:b3,leftshoulder:b13,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b12,start:b4,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, -030000004c0500006802000002100000,Rii RK707,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b2,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b3,righttrigger:b9,rightx:a2,righty:a3,start:b1,x:b15,y:b12,platform:Mac OS X, -030000006f0e00008701000005010000,Rock Candy Nintendo Switch 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, -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, -03000000e804000000a000001b010000,Samsung EIGP20,a:b1,b:b3,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b11,leftx:a1,lefty:a3,rightshoulder:b12,rightx:a4,righty:a5,start:b16,x:b7,y:b9,platform:Mac OS X, -03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b3,platform:Mac OS X, -03000000a30c00002500000006020000,Sega Genesis Mini 3B Controller,a:b2,b:b1,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,righttrigger:b5,start:b9,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b2,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X, -030000003512000021ab000000000000,SFC30 Joystick,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, -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, -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,touchpad:b13,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,touchpad:b13,x:b0,y:b3,platform:Mac OS X, -03000000666600006706000088020000,Sony PlayStation Adapter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Mac OS X, -030000004c050000da0c000000010000,Sony 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:Mac OS X, -030000004c0500003713000000010000,Sony 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, -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,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, -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, -03000000381000003014000000000000,SteelSeries Stratus Duo,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, -03000000381000003114000000000000,SteelSeries Stratus Duo,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, -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, -03000000e40a00000307000001000000,Taito Egret II Mini Control Panel,a:b4,b:b2,back:b6,guide:b9,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b1,start:b7,x:b8,y:b3,platform:Mac OS X, -03000000e40a00000207000001000000,Taito Egret II Mini Controller,a:b4,b:b2,back:b6,guide:b9,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b1,start:b7,x:b8,y:b3,platform:Mac OS X, -03000000790000001c18000000010000,TGZ 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: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, -03000000790000001c18000003100000,TGZ Controller,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:Mac OS X, -03000000591c00002400000021000000,THEC64 Joystick,a:b0,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a4,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Mac OS X, -03000000591c00002600000021000000,THEGamepad,a:b2,b:b1,back:b6,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b0,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, -03000000571d00002100000021000000,Tomee NES Adapter,a:b1,b:b0,back:b2,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,start: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, -03000000571d00002000000021000000,Tomee SNES Adapter,a:b0,b:b1,back:b6,dpdown:+a4,dpleft:-a0,dpright:+a0,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b7,x:b2,y:b3,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, -030000005f140000c501000000020000,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: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, -03000000632500002605000000010000,Uberwith Controller,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:Mac OS X, -03000000c0160000e105000000040000,Ultimate Atari Fight Stick,a:b2,b:b4,back:b18,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,rightshoulder:b8,righttrigger:b10,start:b16,x:b0,y:b6,platform:Mac OS X, -03000000151900005678000010010000,Uniplay U6,a:b3,b:b6,back:b25,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b17,leftstick:b31,lefttrigger:b21,leftx:a1,lefty:a3,rightshoulder:b19,rightstick:b33,righttrigger:b23,rightx:a4,righty:a5,start:b27,x:b11,y:b13,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,touchpad:b13,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,touchpad:b13,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, -030000005e0400008e02000010010000,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, -030000005e040000200b000013050000,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, -030000005e040000200b000015050000,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: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, -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, -030000005e040000220b000013050000,Xbox One Elite 2 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,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,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,misc1:b15,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, -030000005e040000130b000013050000,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, -030000005e040000130b000015050000,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, -030000005e040000130b000007050000,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:Mac OS X, -030000005e040000130b000017050000,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:Mac OS X, -030000005e040000130b000022050000,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:Mac OS X, -030000005e040000220b000017050000,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:Mac OS X, -030000005e040000220b000021050000,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: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 -03000000c82d00001930000011010000,8BitDo 64,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,righttrigger:b9,rightx:a2,righty:a3,start:b11,platform:Linux, -05000000c82d00001930000001000000,8BitDo 64,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,righttrigger:b9,rightx:a2,righty:a3,start:b11,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, -03000000c82d00000631000000010000,8BitDo Adapter 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, -03000000c82d00000951000000010000,8BitDo Dogbone,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b11,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, -05000000c82d00006a28000000010000,8BitDo GameCube,a:b0,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b9,paddle2:b8,rightshoulder:b10,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b1,y:b4,platform:Linux, -03000000c82d00001251000011010000,8BitDo Lite 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, -05000000c82d00001251000000010000,8BitDo Lite 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, -03000000c82d00001151000011010000,8BitDo Lite SE,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, -05000000c82d00001151000000010000,8BitDo Lite SE,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, -03000000c82d00000151000000010000,8BitDo M30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,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,rightx:a2,righty:a3,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, -03000000c82d00000a20000000020000,8BitDo M30 Xbox,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,start:b7,x:b2,y:b3,platform:Linux, -03000000c82d00002090000011010000,8BitDo Micro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -05000000c82d00002090000000010000,8BitDo Micro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, -03000000c82d00000451000000010000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b11,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, -03000000c82d00006928000011010000,8BitDo N64,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,platform:Linux, -05000000c82d00006928000000010000,8BitDo N64,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,platform:Linux, -05000000c82d00002590000001000000,8BitDo NEOGEO,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000008000000210000011010000,8BitDo NES30,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: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, -03000000c82d00000751000000010000,8BitDo P30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:a8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -05000000c82d00000851000000010000,8BitDo P30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:a8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,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, -03000000c82d00001030000011010000,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, -03000000c82d00000020000000000000,8BitDo Pro 2 for Xbox,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, -06000000c82d00000020000006010000,8BitDo Pro 2 for Xbox,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, -03000000c82d00000960000011010000,8BitDo Pro 3,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,paddle1:b17,paddle2:b16,paddle3:b2,paddle4:b5,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, -03000000c82d00002867000000010000,8BitDo S30,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,rightx:a2,righty:a3,start:b10,x:b3,y:b4,platform:Linux, -03000000c82d00000060000011010000,8BitDo SF30 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, -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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, -05000000102800000900000000010000,8BitDo SFC30,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:Linux, -05000000c82d00003028000000010000,8BitDo SFC30,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:Linux, -05000000c82d00000351000000010000,8BitDo SN30,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, -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 Plus,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 Plus,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, -03000000c82d00000631000010010000,8BitDo Ultimate,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, -03000000c82d00000631000014010000,8BitDo Ultimate,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, -03000000c82d00000760000011010000,8BitDo Ultimate,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:Linux, -03000000c82d00001130000011010000,8BitDo Ultimate,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:b26,paddle1:b24,paddle2:b25,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000c82d00001230000011010000,8BitDo Ultimate,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,paddle1:b2,paddle2:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000c82d00001330000011010000,8BitDo Ultimate,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:b26,paddle1:b23,paddle2:b19,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -05000000c82d00001230000000010000,8BitDo Ultimate,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, -03000000c82d00000a31000014010000,8BitDo Ultimate 2C,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, -03000000c82d00001d30000011010000,8BitDo Ultimate 2C,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,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -05000000c82d00001b30000001000000,8BitDo Ultimate 2C,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,paddle1:b5,paddle2:b2,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000c82d00001530000011010000,8BitDo Ultimate C,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, -03000000c82d00001630000011010000,8BitDo Ultimate C,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, -03000000c82d00001730000011010000,8BitDo Ultimate C,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, -03000000c82d00000121000011010000,8BitDo Xbox One SN30 Pro,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, -05000000c82d00000121000000010000,8BitDo Xbox One SN30 Pro,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, -05000000a00500003232000001000000,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, -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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b4,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, -030000006f0e00008801000011010000,Afterglow 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,misc1:b13,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, -0300000008100000e501000001010000,Anbernic Handheld,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:a4,start:b11,x:b3,y:b4,platform:Linux, -03000000020500000913000010010000,Anbernic RG P01,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, -03000000373500000710000010010000,Anbernic RG P01,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, -05000000373500004610000001000000,Anbernic RG P01,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, -03000000190e00000110000010010000,Aquaplus Piece,a:b1,b:b0,back:b3,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b2,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-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, -03000000050b00000579000011010000,ASUS ROG Kunai 3,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:b36,paddle1:b52,paddle2:b53,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -05000000050b00000679000000010000,ASUS ROG Kunai 3,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:b21,paddle1:b22,paddle2:b23,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -030000006a0e00001140000010010000,Atari CX Controller,a:b0,leftx:a0,lefty:a1,platform:Linux, -03000000503200000110000000000000,Atari VCS Classic Controller,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,platform:Linux, -03000000503200000110000011010000,Atari VCS Classic Controller,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,platform:Linux, -05000000503200000110000000000000,Atari VCS Classic Controller,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,platform:Linux, -05000000503200000110000044010000,Atari VCS Classic Controller,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,platform:Linux, -05000000503200000110000046010000,Atari VCS Classic Controller,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b4,start:b3,platform:Linux, -03000000503200000210000000000000,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, -03000000503200000210000011010000,Atari VCS Modern 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 VCS Modern 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 VCS Modern 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 VCS Modern 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, -030000008a3500000201000011010000,Backbone One,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, -030000008a3500000202000011010000,Backbone One,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, -030000008a3500000302000011010000,Backbone One,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, -030000008a3500000402000011010000,Backbone One,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, -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,touchpad:b13,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, -03000000bc2000004d50000011010000,Beitong A1T2 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, -030000000d0500000308000010010000,Belkin 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: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, -03000000120c0000300e000011010000,Brook Audio Fighting Board 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, -03000000120c0000310e000011010000,Brook Audio Fighting Board 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,touchpad:b13,x:b0,y:b3,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,touchpad:b13,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,touchpad:b13,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, -03000000d81d00000b00000010010000,Buffalo BSGP1601,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,misc1:b14,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,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, -03000000af1e00002400000010010000,Clockwork Pi DevTerm,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,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, -03000000632500007a05000001020000,Cosmic Byte Ares Wired 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: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, -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, -030000007d0400000640000010010000,Eliminator AfterShock,a:b1,b:b2,back:b9,dpdown:+a3,dpleft:-a5,dpright:+a5,dpup:-a3,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a4,righty:a2,start:b8,x:b0,y:b3,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, -030000006f0e00008401000011010000,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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, -030000006f0e00008101000011010000,Faceoff Deluxe 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, -030000006f0e00008001000011010000,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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, -03000000852100000201000010010000,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:Linux, -05000000b40400001224000001010000,Flydigi APEX 4,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b14,leftshoulder:b4,leftstick:b10,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b20,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,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,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000b40400001224000011010000,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,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,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:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -06000000d73700000124000000000000,Flydigi Vader 5 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,misc1:b11,misc2:b12,misc3:b13,misc4:b14,misc5:b19,paddle1:b15,paddle2:b17,paddle3:b16,paddle4:b18,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, -030000007e0500003703000000000000,GameCube Adapter,a:b0,b:b1,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b2,platform:Linux, -19000000030000000300000002030000,GameForce Controller,a:b1,b:b0,back:b8,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b16,leftshoulder:b4,leftstick:b14,lefttrigger:b6,leftx:a1,lefty:a0,rightshoulder:b5,rightstick:b15,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, -03000000373500000b10000019010000,GameSir Cyclone 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, -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, -03000000ac0500007a05000011010000,GameSir G5,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:b16,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000373500009710000001020000,GameSir Kaleid Flux,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, -03000000ac0500001a06000011010000,GameSir T3 2.02,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:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000373500000410000044010000,GameSir T4 Kaleid,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, -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, -03000000373500009410000010010000,GameSir Tegenaria Lite,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, -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, -03000000f025000021c1000010010000,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, -03000000f0250000c283000010010000,Gioteck VX2 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, -190000004b4800000010000000010000,GO-Advance Controller,a:b1,b:b0,back:b10,dpdown:b7,dpleft:b8,dpright:b9,dpup:b6,leftshoulder:b4,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b13,start:b15,x:b2,y:b3,platform:Linux, -190000004b4800000010000001010000,GO-Advance Controller,a:b1,b:b0,back:b12,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,leftshoulder:b4,leftstick:b13,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b16,righttrigger:b15,start:b17,x:b2,y:b3,platform:Linux, -190000004b4800000011000000010000,GO-Super Gamepad,a:b0,b:b1,back:b12,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b16,leftshoulder:b4,leftstick:b14,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b3,y:b2,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, -03000000d11800000094000011010000,Google 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, -05000000d11800000094000000010000,Google 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, -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, -030000005e0400008e02000001010000,GPD Win Max 2 6800U 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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, -03000000280400000140000000010000,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: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, -030000008a2e0000dd10000011010000,Hand Held Legend GC Ultimate,a:b0,b:b2,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,misc2:b24,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b1,y:b3,platform:Linux, -030000008a2e0000df10000011010000,Hand Held Legend ProGCC,a:b1,b:b0,back:b17,dpdown:b5,dpleft:b6,dpright:b7,dpup:b4,guide:b18,leftshoulder:b10,leftstick:b8,lefttrigger:a3,leftx:a0,lefty:a1,misc1:b19,paddle1:b13,paddle2:b12,rightshoulder:b11,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b3,y:b2,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b9,leftshoulder:b4,lefttrigger:b6,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, -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, -030000000d0f00008400000011010000,Hori Fighting Commander,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, -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,touchpad:b13,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, -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, -030000000d0f00003701000013010000,Hori Fighting Stick Mini,a:b1,b:b0,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:b3,y:b2,platform:Linux, -030000000d0f00008800000011010000,Hori Fighting Stick mini 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,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, -030000000d0f00008700000011010000,Hori Fighting Stick mini 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,rightshoulder:b5,rightstick:b11,righttrigger:a4,start:b9,touchpad:b13,x:b0,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, -030000000d0f00001100000011010000,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,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,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, -030000000d0f0000aa00000011010000,Hori Real Arcade Pro for Nintendo Switch,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, -030000000d0f00008501000017010000,Hori Split Pad Fit,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, -030000000d0f00008501000015010000,Hori Switch Split Pad 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, -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,touchpad:b13,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: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, -030000000d0f0000c100000011010000,Horipad 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,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, -030000000d0f0000ab01000011010000,Horipad Steam,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,misc2:b2,paddle1:b19,paddle2:b18,paddle3:b15,paddle4:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -050000000d0f00009601000091000000,Horipad Steam,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,misc2:b2,paddle1:b19,paddle2:b18,paddle3:b15,paddle4:b5,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -050000000d0f0000f600000001000000,Horipad 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, -03000000341a000005f7000010010000,HuiJia GameCube 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, -05000000242e00000b20000001000000,Hyperkin Admiral N64 Controller,+rightx:b11,+righty:b13,-rightx:b8,-righty:b12,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b14,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,platform:Linux, -03000000242e0000ff0b000011010000,Hyperkin N64 Adapter,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightx:a2,righty:a3,start:b9,platform:Linux, -03000000242e00006a38000010010000,Hyperkin Trooper 2,a:b0,b:b1,back:b4,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b3,start:b5,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, -03000000f00300008d03000011010000,HyperX Clutch,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, -05000000f00300008d04000000010000,HyperX Clutch,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, -03000000830500006020000010010000,iBuffalo Super Famicom Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, -03000000d80400004aea000011010000,icedragon.io STAC Dance Pad,a:b0,b:b1,back:b4,x:b2,y:b3,platform:Linux, -03000000d80400004bea000011010000,icedragon.io STAC Dance Pad,a:b0,b:b1,back:b4,x:b2,y:b3,platform:Linux, -030000008a2e0000d910000011010000,icedragon.io STAC2 Dance Pad,a:b0,b:b1,back:b4,x:b2,y:b3,platform:Linux, -030000008a2e0000e910000011010000,icedragon.io STAC2 Dance Pad,a:b8,b:b9,back:b12,x:b10,y:b11,platform:Linux, -030000008f0e00001330000001010000,iCode Retro Adapter,b:b3,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b9,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b1,start:b7,x:b2,y:b0,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, -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, -03000000fd0500000030000000010000,InterAct GoPad,a:b3,b:b4,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,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,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, -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, -03000000300f00001101000010010000,Jess Tech Colour Rumble Pad,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, -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, -03000000314100001935000000010000,LeadJoy Xeno Plus,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:a4,righty:a4,start:b7,x:b2,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, -030000006d040000d1ca000011010000,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, -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, -030000006d04000019c2000010010000,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, -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, -030000006d04000011c2000010010000,Logitech WingMan 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, -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,touchpad:b13,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, -03000000380700008031000011010000,Mad Catz FightStick Alpha 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, -03000000380700008081000011010000,Mad Catz 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,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, -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,touchpad:b13,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,touchpad:b13,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, -030000008f0e00001330000010010000,Mayflash Adapter,a:b1,b:b2,back:b8,dpdown:h0.8,dpleft:h0.2,dpright:h0.1,dpup:h0.4,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a3~,righty:a2,start:b9,x:b0,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, -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, -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, -030000008f0e00001030000010010000,Mayflash Saturn Adapter,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b2,start:b9,x:b3,y:b4,platform:Linux, -0300000025090000e803000001010000,Mayflash Wii Classic Adapter,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, -03000000790000000318000011010000,Mayflash Wii DolphinBar,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Linux, -03000000790000000018000011010000,Mayflash Wii U 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:Linux, -03000000b50700001203000010010000,Mega World Logic 3 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:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, -03000000b50700004f00000000010000,Mega World Logic 3 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:a2,righty:a3,start:b9,x:b0,y:b1,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, -030000005e0400000300000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,leftshoulder:b6,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,platform:Linux, -030000005e0400000700000000010000,Microsoft SideWinder,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, -030000005e0400000e00000000010000,Microsoft SideWinder Freestyle Pro,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, -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, -030000005e0400008902000021010000,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, -030000005e040000dd02000003020000,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, -030000005e040000ea02000008040000,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, -030000005e040000ea0200000f050000,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,misc1:b11,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, -060000005e040000120b000014050000,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, -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, -030000005e040000000b000007040000,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,paddle1:b12,paddle2:b14,paddle3:b13,paddle4:b15,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,paddle1:b12,paddle2:b14,paddle3:b13,paddle4:b15,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, -050000005e0400008e02000030110000,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,paddle1:b11,paddle2:b13,paddle3:b12,paddle4:b14,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, -030000005e040000120b00000b050000,Microsoft 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, -030000005e040000120b000016050000,Microsoft 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, -030000005e040000120b000017050000,Microsoft 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, -060000005e040000120b000001050000,Microsoft 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, -03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, -03000000790000001c18000010010000,Mobapad Chitu HD,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, -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, -05000000e80400006e0400001b010000,Mocute 053X M59,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, -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, -030000005e0400008e02000010020000,MSI GC20 V2,a:b0,b:b1,back:b6,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,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, -03000000f70600000100000000010000,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:Linux, -030000006b1400000906000014010000,Nacon Asymmetric PS4 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, -0300000085320000030c000011010000,Nacon GC100,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, -03000000853200000706000012010000,Nacon GC100,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, -030000006b140000010c000010010000,Nacon GC400ES,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, -05000000853200000503000000010000,Nacon MGX Pro,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, -0300000085320000170d000011010000,Nacon Revolution 5 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,touchpad:b13,x:b0,y:b3,platform:Linux, -0300000085320000190d000011010000,Nacon Revolution 5 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,touchpad:b13,x:b0,y:b3,platform:Linux, -0300000085320000180d000011010000,Nacon Revolution 5 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:Linux, -0300000085320000160d000011010000,Nacon Revolution 5 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,touchpad:b13,x:b0,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 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, -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, -03000000790000004618000010010000,Nintendo GameCube 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, -03000000ec110000e1a7000010010000,Nintendo Switch,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, -030000007e0500006920000011010000,Nintendo Switch 2 Pro Controller,a:b0,b:b1,back:b14,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b12,leftstick:b15,lefttrigger:b13,leftx:a0,lefty:a1~,misc1:b17,misc2:b20,paddle1:b18,paddle2:b19,rightshoulder:b4,rightstick:b7,righttrigger:b5,rightx:a2,righty:a3~,start:b6,x:b2,y:b3,platform:Linux, -060000004e696e74656e646f20537700,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,misc1:b4,rightshoulder:b6,rightstick:b13,righttrigger:b8,rightx:a2,righty:a3,start:b10,x:b3,y:b2,platform:Linux, -060000007e0500000620000000000000,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,misc1:b4,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,misc1:b4,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,misc1:b13,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, -030000007e0500000920000000026803,Nintendo Switch Pro Controller,a:b1,b:b0,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:b3,y:b2,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,misc1:b4,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,misc1:b13,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,misc1:b4,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 U 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, -050000005a1d00000218000003000000,Nokia GC 5000,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, -030000007e0500007320000011010000,NSO GameCube Controller,a:b1,b:b3,dpdown:b8,dpleft:b10,dpright:b9,dpup:b11,guide:b16,leftshoulder:b13,lefttrigger:b12,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b4,rightx:a2,righty:a3~,start:b6,x:b0,y:b2,platform:Linux, -030000007e0500001920000011810000,NSO N64 Controller,+rightx:b2,+righty:b3,-rightx:b4,-righty:b10,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b7,righttrigger:b9,start:b11,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, -050000007e0500001920000001800000,NSO N64 Controller,+rightx:b2,+righty:b3,-rightx:b4,-righty:b10,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b7,righttrigger:b9,start:b11,platform:Linux, -030000007e0500001e20000011810000,NSO Sega Genesis Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,misc1:b3,rightshoulder:b2,righttrigger:b4,start:b5,platform:Linux, -030000007e0500001720000011810000,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:b7,start:b9,x:b3,y:b2,platform:Linux, -050000007e0500001720000001000000,NSO SNES Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,lefttrigger:b7,rightshoulder:b6,righttrigger:b8,start:b10,x:b3,y:b2,platform:Linux, -050000007e0500001720000001800000,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:b7,start:b9,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,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,misc1:b8,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, -05000000550900001472000001000000,NVIDIA Controller,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,misc1:b8,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, -030000004b120000014d000000010000,Nyko Airflo EX,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:a3,righty:a2,start:b9,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,ODROID Go 2,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,ODROID Go 2,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, -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, -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, -030000006f0e0000d702000006640000,PDP Black Camo Wired Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:b13,dpleft:b14,dpright:b13,dpup:b14,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, -030000006f0e00008501000011010000,PDP Fightpad Pro Gamecube Controller,a:b1,b:b0,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, -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, -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, -030000006f0e00000901000011010000,PDP PS3 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, -030000006f0e00002f01000011010000,PDP Wired 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, -03000000ad1b000004f9000000010000,PDP Xbox 360 Versus Fighting,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, -030000006f0e0000f102000000000000,PDP Xbox Atomic,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, -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, -030000006f0e0000d802000006640000,PDP 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, -030000006f0e0000ef02000007640000,PDP Xbox Series Kinetic Wired 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, -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, -03000000d62000000540000001010000,PowerA Advantage 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, -03000000d620000011a7000011010000,PowerA Core 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, -03000000dd62000015a7000011010000,PowerA Fusion Nintendo Switch 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:b6,leftx:a0,lefty:a1,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, -03000000d620000012a7000011010000,PowerA Fusion Nintendo Switch Fight Pad,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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, -03000000d62000000140000001010000,PowerA Fusion Pro 2 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:Linux, -03000000dd62000016a7000000000000,PowerA Fusion 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,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, -03000000d620000013a7000011010000,PowerA 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,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, -03000000d620000014a7000011010000,PowerA Spectra 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,misc1:b13,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, -03000000d62000000240000001010000,PowerA Xbox One Spectra Infinity,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:Linux, -03000000d62000000520000050010000,PowerA 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, -03000000d62000000b20000001010000,PowerA 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, -03000000d62000000f20000001010000,PowerA Xbox Series Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,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, -03000000250900000017000010010000,PS SS N64 Adapter,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b5,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2~,righty:a3,start:b8,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, -03000000120c0000160e000011010000,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:a5,start:b9,x:b0,y:b3,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,touchpad:b13,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, -030000004c050000c405000000810000,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,touchpad:b13,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,touchpad:b13,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,touchpad:b13,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,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,touchpad:b13,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,touchpad:b13,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,touchpad:b13,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, -0300004b4c0500005f0e000011010000,PS5 Access 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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,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, -030000004c050000f20d000011010000,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,misc1:b14,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,touchpad:b13,x:b0,y:b3,platform:Linux, -030000004c050000f20d000011810000,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, -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, -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, -050000004c050000f20d000000010000,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, -050000004c050000f20d000000810000,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, -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, -03000000222c00000225000011010000,Qanba Dragon Arcade Joystick 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, -03000000222c00000025000011010000,Qanba Dragon Arcade Joystick 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,touchpad:b13,x:b0,y:b3,platform:Linux, -03000000222c00001220000011010000,Qanba Drone 2 Arcade Joystick 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:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, -03000000222c00001020000011010000,Qanba Drone 2 Arcade Joystick PS5,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, -03000000222c00000020000011010000,Qanba Drone Arcade PS4 Joystick,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,rightshoulder:b5,righttrigger:a4,start:b9,touchpad:b13,x:b0,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, -03000000222c00000223000011010000,Qanba Obsidian Arcade Joystick 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, -03000000222c00000023000011010000,Qanba Obsidian Arcade Joystick 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,touchpad:b13,x:b0,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, -030000009b2800006500000000000000,Raphnet GameCube 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, -030000009b2800006500000001010000,Raphnet GameCube 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, -03000000401700007f05000001010000,Raphnet GC and N64 Adapter,a:b5,b:b3,back:b8,dpdown:b10,dpleft:b12,dpright:b11,dpup:b9,leftshoulder:b6,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:-a5,rightx:a2,righty:a3,start:b1,x:b4,y:b2,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, -030000009b2800003c00000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux, -030000009b2800006100000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux, -030000009b2800006300000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux, -030000009b2800006400000001010000,Raphnet N64 Adapter,+rightx:b9,+righty:b7,-rightx:b8,-righty:b6,a:b0,b:b1,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,leftshoulder:b4,lefttrigger:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Linux, -030000009b2800008000000020020000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux, -030000009b2800008000000001010000,Raphnet Wii Classic Adapter V3,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux, -03000000f8270000bf0b000011010000,Razer Kishi,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, -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, -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,touchpad:b13,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,touchpad:b13,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,touchpad:b13,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, -03000000321500000b10000011010000,Razer Wolverine 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, -0300000032150000140a000001010000,Razer Wolverine Ultimate Xbox,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, -030000000d0f0000c100000010010000,Retro Bit Legacy16,a:b1,b:b2,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b12,leftshoulder:b4,lefttrigger:b6,misc1:b13,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,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, -0300000003040000c197000011010000,Retrode Adapter,a:b0,b:b4,back:b2,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Linux, -190000004b4800000111000000010000,RetroGame Joypad,a:b1,b:b0,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,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, -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, -03000000341200000400000000010000,RetroUSB N64 RetroPort,+rightx:b8,+righty:b10,-rightx:b9,-righty:b11,a:b7,b:b6,dpdown:b2,dpleft:b1,dpright:b0,dpup:b3,leftshoulder:b13,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b12,start:b4,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, -030000006f0e00008701000011010000,Rock Candy 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,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, -030000006f0e00001311000011010000,Saffun Controller,a:b2,b:b3,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:b1,y:b0,platform:Linux, -03000000a306000023f6000011010000,Saitek Cyborg 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, -03000000a30600000d5f000010010000,Saitek P2600,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,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, -05000000e804000000a000001b010000,Samsung EIGP20,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,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, -03000000952e00004b43000011010000,Scuf Envision,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:a3,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Linux, -03000000952e00004d43000011010000,Scuf Envision,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:a3,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,platform:Linux, -03000000952e00004e43000011010000,Scuf Envision,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:a3,leftx:a0,lefty:a1,misc1:b11,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a5,start:b7,x:b2,y:b3,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, -03000000b40400000a01000000010000,Sega Saturn,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b7,rightshoulder:b5,righttrigger:b2,start:b8,x:b3,y:b4,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, -03000000632500002605000010010000,ShanWan Gamepad,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, -03000000632500007505000010010000,ShanWan 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, -03000000bc2000000055000010010000,ShanWan Gamepad,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, -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, -03000000250900000500000000010000,SmartJoy 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:Linux, -030000004b2900000430000011000000,Snakebyte 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, -03000000790000002601000011010000,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, -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,touchpad:b13,x:b0,y:b3,platform:Linux, -03000000666600006706000000010000,Sony PlayStation Adapter,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, -03000000d9040000160f000000010000,Sony PlayStation 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, -030000004c050000da0c000011010000,Sony 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, -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, -030000004c0500003713000011010000,Sony 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, -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, -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, -050000004e696d6275732b0000000000,SteelSeries 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, -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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b9,righttrigger:b5,start:b8,x:b1,y:b3,platform:Linux, -030000001f08000001e4000010010000,Super Famicom 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, -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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,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, -03000000457500000401000011010000,SZMY Power DS4 Wired 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,misc1:b13,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,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, -03000000e40a00000307000011010000,Taito Egret II Mini Control Panel,a:b4,b:b2,back:b6,guide:b9,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b1,start:b7,x:b8,y:b3,platform:Linux, -03000000e40a00000207000011010000,Taito Egret II Mini Controller,a:b4,b:b2,back:b6,guide:b9,leftx:a0,lefty:a1,rightshoulder:b0,righttrigger:b1,start:b7,x:b8,y:b3,platform:Linux, -03000000ba2200000701000001010000,Technology Innovation PlayStation 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, -03000000790000001c18000011010000,TGZ 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:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, -03000000591c00002400000010010000,THEC64 Joystick,a:b0,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b2,y:b3,platform:Linux, -03000000591c00002600000010010000,THEGamepad,a:b2,b:b1,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b0,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, -030000004f04000004b3000010010000,Thrustmaster Firestorm Dual Power,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, -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 Gamepad,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, -03000000680a00000300000003000000,TRBot Virtual Joypad,a:b11,b:b12,back:b15,dpdown:b6,dpleft:b3,dpright:b4,dpup:b5,leftshoulder:b17,leftstick:b21,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b22,righttrigger:a2,rightx:a3,righty:a4,start:b16,x:b13,y:b14,platform:Linux, -03000000780300000300000003000000,TRBot Virtual Joypad,a:b11,b:b12,back:b15,dpdown:b6,dpleft:b3,dpright:b4,dpup:b5,leftshoulder:b17,leftstick:b21,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b22,righttrigger:a2,rightx:a3,righty:a4,start:b16,x:b13,y:b14,platform:Linux, -03000000e00d00000300000003000000,TRBot Virtual Joypad,a:b11,b:b12,back:b15,dpdown:b6,dpleft:b3,dpright:b4,dpup:b5,leftshoulder:b17,leftstick:b21,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b22,righttrigger:a2,rightx:a3,righty:a4,start:b16,x:b13,y:b14,platform:Linux, -03000000f00600000300000003000000,TRBot Virtual Joypad,a:b11,b:b12,back:b15,dpdown:b6,dpleft:b3,dpright:b4,dpup:b5,leftshoulder:b17,leftstick:b21,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b22,righttrigger:a2,rightx:a3,righty:a4,start:b16,x:b13,y:b14,platform:Linux, -030000005f140000c501000010010000,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:Linux, -06000000f51000000870000003010000,Turtle Beach Recon,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, -03000000f51000001370000000010000,Turtle Beach ReactR,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, -03000000f51000001370000000000000,Turtle Beach ReactR,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, -03000000100800000100000010010000,Twin PlayStation 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, -03000000c0160000e105000010010000,Ultimate Atari Fight Stick,a:b1,b:b2,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b4,righttrigger:b5,start:b8,x:b0,y:b3,platform:Linux, -03000000151900005678000010010000,Uniplay U6,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, -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, -03000000de2800000112000001000000,Valve 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, -03000000de2800000112000011010000,Valve Steam Controller,a:b2,b:b3,back:b10,dpdown:+a5,dpleft:-a4,dpright:+a4,dpup:-a5,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,paddle1:b15,paddle2:b16,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux, -03000000de2800000211000001000000,Valve 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,Valve 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,Valve 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,Valve Steam Controller,a:b2,b:b3,back:b10,dpdown:b18,dpleft:b19,dpright:b20,dpup:b17,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,paddle1:b16,paddle2:b15,rightshoulder:b7,righttrigger:a6,rightx:a2,righty:a3,start:b11,x:b4,y:b5,platform:Linux, -03000000de280000fc11000001000000,Valve 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,Valve 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,Valve 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,Valve 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, -03000000de2800000512000010010000,Valve Steam Deck,a:b3,b:b4,back:b11,dpdown:b17,dpleft:b18,dpright:b19,dpup:b16,guide:b13,leftshoulder:b7,leftstick:b14,lefttrigger:a9,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b15,righttrigger:a8,rightx:a2,righty:a3,start:b12,x:b5,y:b6,platform:Linux, -03000000de2800000512000011010000,Valve Steam Deck,a:b3,b:b4,back:b11,dpdown:b17,dpleft:b18,dpright:b19,dpup:b16,guide:b13,leftshoulder:b7,leftstick:b14,lefttrigger:a9,leftx:a0,lefty:a1,misc1:b2,paddle1:b21,paddle2:b20,paddle3:b23,paddle4:b22,rightshoulder:b8,rightstick:b15,righttrigger:a8,rightx:a2,righty:a3,start:b12,x:b5,y:b6,platform:Linux, -03000000790000001a18000011010000,Venom PS4 Arcade Joystick,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, -03000000790000001b18000011010000,Venom PS4 Arcade Joystick,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, -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,touchpad:b13,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,touchpad:b13,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, -05000000434f4d4d414e440000000000,VX Gaming Command Series,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, -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, -030000005e0400008e02000000010000,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, -030000005e0400008e02000002010000,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, -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, -030000005e0400008e02000047010000,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, -030000005e0400008e02000072050000,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, -030000005e040000a102000030060000,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, -030000006f0e00001503000000020000,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, -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, -0000000058626f782047616d65706100,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:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,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, -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, -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, -050000005e040000200b000013050000,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:Linux, -050000005e040000200b000017050000,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:Linux, -050000005e040000200b000023050000,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:Linux, -050000005e040000220b000017050000,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: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, -060000005e040000dd02000003020000,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, -050000005e040000220b000013050000,Xbox One Elite 2 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, -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, -030000005e040000ea02000011050000,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, -030000005e040000ea02000015050000,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, -030000005e040000ea02000017050000,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, -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, -060000005e040000ea0200000d050000,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, -060000005e040000ea02000016050000,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, -030000005e040000120b000007050000,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, -030000005e040000120b000009050000,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, -030000005e040000120b00000f050000,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, -030000005e040000120b000011050000,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, -030000005e040000120b000014050000,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, -030000005e040000120b000015050000,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, -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, -050000005e040000130b000007050000,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, -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, -050000005e040000130b000011050000,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, -050000005e040000130b000015050000,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, -050000005e040000130b000017050000,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, -060000005e040000120b000007050000,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, -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, -060000005e040000120b00000d050000,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, -060000005e040000120b00000f050000,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, -050000005e040000130b000022050000,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, -060000005e040000120b000011050000,Xbox Series X 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, -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, -030000005e0400008e02000020010000,XInput 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, -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, -03000000120c0000182e000011010000,Zeroplus 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, -03000000790000002201000011010000,ZhiXu GuliKit D,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, - -# Android -38653964633230666463343334313533,8BitDo Adapter,a:b0,b:b1,back:b15,dpdown:b12,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, -36666264316630653965636634386234,8BitDo Adapter 2,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b5,leftshoulder:b9,lefttrigger:a4,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b19,y:b2,platform:Android, -33313433353539306634656436353432,8BitDo Dogbone,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -38426974446f20446f67626f6e65204d,8BitDo Dogbone,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,platform:Android, -34343439373236623466343934376233,8BitDo FC30 Pro,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b28,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b29,righttrigger:b7,start:b5,x:b30,y:b2,platform:Android, -38426974446f204e4743204d6f646b69,8BitDo GameCube,a:b0,b:b2,back:b4,dpdown:b12,dpleft:b13,dpright:b14,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b18,paddle2:b17,rightshoulder:b15,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b1,y:b3,platform:Android, -38426974446f2038426974446f204c69,8BitDo Lite,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -30643332373663313263316637356631,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -38426974446f204c6974652032000000,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -62656331626461363634633735353032,8BitDo Lite 2,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -38393936616436383062666232653338,8BitDo Lite SE,a:b1,b:b0,back:b15,dpdown:b12,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:b3,y:b2,platform:Android, -38426974446f204c6974652053450000,8BitDo Lite SE,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -39356430616562366466646636643435,8BitDo Lite SE,a:b1,b:b0,back:b15,dpdown:b12,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:b3,y:b2,platform:Android, -05000000c82d000006500000ffff3f00,8BitDo M30,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b17,leftshoulder:b9,lefttrigger:a5,rightshoulder:b10,righttrigger:a4,start:b6,x:b3,y:b2,platform:Android, -05000000c82d000051060000ffff3f00,8BitDo M30,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,guide:b17,leftshoulder:b9,lefttrigger:a4,rightshoulder:b10,righttrigger:a5,start:b6,x:b3,y:b2,platform:Android, -32323161363037623637326438643634,8BitDo M30,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -33656266353630643966653238646264,8BitDo M30,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:a5,start:b10,x:b19,y:b2,platform:Android, -38426974446f204d3330204d6f646b69,8BitDo M30,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -39366630663062373237616566353437,8BitDo M30,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:a5,start:b6,x:b2,y:b3,platform:Android, -38426974446f204d6963726f2067616d,8BitDo Micro,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:a4,leftx:b0,lefty:b1,rightshoulder:b10,righttrigger:a5,rightx:b2,righty:b3,start:b6,x:b3,y:b2,platform:Android, -61653365323561356263373333643266,8BitDo Micro,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:a4,leftx:b0,lefty:b1,rightshoulder:b10,righttrigger:a5,rightx:b2,righty:b3,start:b6,x:b3,y:b2,platform:Android, -62613137616239666338343866326336,8BitDo Micro,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:a4,leftx:b0,lefty:b1,rightshoulder:b10,righttrigger:a5,rightx:b2,righty:b3,start:b6,x:b3,y:b2,platform:Android, -33663431326134333366393233616633,8BitDo N30,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,platform:Android, -38426974446f204e3330204d6f646b69,8BitDo N30,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,start:b6,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, -38323035343766666239373834336637,8BitDo N64,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,platform:Android, -38426974446f204e3634204d6f646b69,8BitDo N64,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,platform:Android, -32363135613966656338666638666237,8BitDo NEOGEO,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -35363534633333373639386466346631,8BitDo NEOGEO,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -38426974446f204e454f47454f204750,8BitDo NEOGEO,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -39383963623932353561633733306334,8BitDo NEOGEO,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,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, -38313433643131656262306631373166,8BitDo P30,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -38326536643339353865323063616339,8BitDo P30,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -38426974446f2050333020636c617373,8BitDo P30,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,righttrigger:b18,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -35376664343164386333616535333434,8BitDo Pro 2,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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, -61333362366131643730353063616330,8BitDo Pro 2,a:b1,b:b0,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:b3,y:b2,platform:Android, -62373739366537363166326238653463,8BitDo Pro 2,a:b1,b:b0,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,x:b3,y:b2,platform:Android, -38386464613034326435626130396565,8BitDo Receiver,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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, -38426974446f20533330204d6f646b69,8BitDo S30,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -66316462353561376330346462316137,8BitDo S30,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b9,righttrigger:b10,rightx:a2,righty:a3,start:b6,x:b2,y:b3,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: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:b2,y:b17,platform:Android, -61623334636338643233383735326439,8BitDo SFC30,a:b0,b:b1,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b3,rightshoulder:b31,start:b5,x:b30,y:b2,platform:Android, -05000000c82d000012900000ffff3f00,8BitDo SN30,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, -05000000c82d000062280000ffff3f00,8BitDo SN30,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, -38316230613931613964356666353839,8BitDo SN30,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, -38426974446f20534e3330204d6f646b,8BitDo SN30,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, -65323563303231646531383162646335,8BitDo SN30,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, -35383531346263653330306238353131,8BitDo SN30 PP,a:b0,b:b1,back:b15,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, -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, -05000000c82d000002600000ffff0f00,8BitDo SN30 Pro Plus,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, -36653638656632326235346264663661,8BitDo SN30 Pro Plus,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,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:b3,y:b2,platform:Android, -38426974446f20534e33302050726f2b,8BitDo SN30 Pro Plus,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -66306331643531333230306437353936,8BitDo SN30 Pro Plus,a:b1,b:b0,back:b15,dpdown:b12,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: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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b2,y:b3,platform:Android, -38426974646f205a65726f2047616d65,8BitDo Zero,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, -05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, -05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, -33663434393362303033616630346337,8BitDo Zero 2,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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: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,x:b2,y:b3,platform:Android, -4c696e757820342e31392e3137322077,Anbernic Handheld,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,righty:a4,start:b6,x:b2,y:b3,platform:Android, -417374726f2063697479206d696e6920,Astro City Mini,a:b23,b:b22,back:b29,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b25,righttrigger:b26,start:b30,x:b24,y:b21,platform:Android, -35643263313264386134376362363435,Atari VCS Classic Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,start:b6,platform:Android, -32353831643566306563643065356239,Atari VCS Modern 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, -4f64696e20436f6e74726f6c6c657200,AYN Odin,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b14,dpright:b13,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, -32303165626138343962363666346165,Brook Mars PS4 Controller,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -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, -34313430343161653665353737323365,Elecom JC-W01U,a:b23,b:b24,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b25,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,rightx:a2,righty:a3,start:b30,x:b21,y:b22,platform:Android, -4875694a6961204a432d573031550000,Elecom JC-W01U,a:b23,b:b24,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b25,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,rightx:a2,righty:a3,start:b30,x:b21,y:b22,platform:Android, -30363230653635633863366338623265,Evo VR,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -35383633353935396534393230616564,Google Stadia Controller,a:b0,b:b1,back:b15,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, -476f6f676c65204c4c43205374616469,Google Stadia 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, -5374616469614e3848532d6532633400,Google Stadia Controller,a:b0,b:b1,back:b15,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, -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, -05000000d6020000e5890000dfff3f80,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,platform:Android, -66633030656131663837396562323935,Hori Battle,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,start:b18,platform:Android, -31303433326562636431653534636633,Hori Real Arcade Pro 3,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, -32656664353964393561366362333636,Hori Switch Split Pad Pro,a:b0,b:b1,back:b15,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, -30306539356238653637313730656134,Horipad Switch Pro Controller,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -48797065726b696e2050616400000000,Hyperkin Admiral N64 Controller,+rightx:b6,+righty:b7,-rightx:b17,-righty:b5,a:b1,b:b0,leftshoulder:b3,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b20,start:b18,platform:Android, -62333331353131353034386136626636,Hyperkin Admiral N64 Controller,+rightx:b6,+righty:b7,-rightx:b17,-righty:b5,a:b1,b:b0,leftshoulder:b3,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b20,start:b18,platform:Android, -31306635363562663834633739396333,Hyperkin N64 Adapter,a:b1,b:b19,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a2,righty:a3,start:b18,platform:Android, -5368616e57616e202020202048797065,Hyperkin N64 Adapter,a:b1,b:b19,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a2,righty:a3,start:b18,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, -5553422c322d6178697320382d627574,iBuffalo Super Famicom Controller,a:b1,b:b0,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b17,rightshoulder:b18,start:b10,x:b3,y:b2,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android, -4a6f792d436f6e20284c290000000000,Joy-Con (L),a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b17,x:b19,y:b2,platform:Android, -38383665633039363066383334653465,Joy-Con (R),a:b0,b:b1,back:b5,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, -39373064396565646338333134303131,Joy-Con (R),a:b1,b:b2,back:b5,leftstick:b8,leftx:a1~,lefty:a0,start:b6,x:b0,y:b3,platform:Android, -4a6f792d436f6e202852290000000000,Joy-Con (R),a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, -39656136363638323036303865326464,JYS Aapter,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,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:b0,y:b2,platform:Android, -64623163333561643339623235373232,Logitech F310,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, -35623364393661626231343866613337,Logitech F710,a:b0,b:b1,back:b4,dpdown:b12,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, -4c6f6769746563682047616d65706164,Logitech F710,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, -64396331333230326333313330336533,Logitech F710,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, -39653365373864633935383236363438,Logitech G Cloud,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, -33373336396634316434323337666361,Logitech RumblePad 2,a:b22,b:b23,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b25,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,rightx:a2,righty:a3,start:b30,x:b21,y:b24,platform:Android, -416d617a6f6e2047616d6520436f6e74,Luna Controller,a:b0,b:b1,back:b15,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, -4c756e612047616d6570616400000000,Luna 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, -30363066623539323534363639323363,Magic NS,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,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:b0,y:b2,platform:Android, -6d6179666c617368206c696d69746564,Mayflash GameCube Adapter,a:b22,b:b21,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,lefttrigger:b25,leftx:a0,lefty:a1,rightshoulder:b28,righttrigger:b26,rightx:a5,righty:a2,start:b30,x:b23,y:b24,platform:Android, -436f6e74726f6c6c6572000000000000,Mayflash N64 Adapter,a:b1,b:b19,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a2,righty:a3,start:b18,platform:Android, -65666330633838383061313633326461,Mayflash N64 Adapter,a:b1,b:b19,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a2,righty:a3,start:b18,platform:Android, -37316565396364386635383230353365,Mayflash Saturn Adapter,a:b21,b:b22,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b26,lefttrigger:b28,rightshoulder:b27,righttrigger:b23,start:b30,x:b24,y:b25,platform:Android, -4875694a696120205553422047616d65,Mayflash Saturn Adapter,a:b21,b:b22,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b26,lefttrigger:b28,rightshoulder:b27,righttrigger:b23,start:b30,x:b24,y:b25,platform:Android, -535a4d792d706f776572204c54442043,Mayflash Wii Classic Adapter,a:b23,b:b22,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b31,leftshoulder:b27,lefttrigger:b25,leftx:a0,lefty:a1,rightshoulder:b28,righttrigger:b26,rightx:a2,righty:a3,start:b30,x:b24,y:b21,platform:Android, -30653962643666303631376438373532,Mayflash Wii DolphinBar,a:b23,b:b24,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b0,leftshoulder:b25,lefttrigger:b27,leftx:a0,lefty:a1,rightshoulder:b26,righttrigger:b28,rightx:a2,righty:a3,start:b30,x:b21,y:b22,platform:Android, -39346131396233376535393665363161,Mayflash Wii U Pro Adapter,a:b22,b:b23,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b25,leftstick:b31,lefttrigger:b27,rightshoulder:b26,rightstick:b0,righttrigger:b28,rightx:a0,righty:a1,start:b30,x:b21,y:b24,platform:Android, -31323564663862633234646330373138,Mega Drive,a:b23,b:b22,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,rightshoulder:b25,righttrigger:b26,start:b30,x:b24,y:b21,platform:Android, -37333564393261653735306132613061,Mega Drive,a:b21,b:b22,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b26,lefttrigger:b28,rightshoulder:b27,righttrigger:b23,start:b30,x:b24,y:b25,platform:Android, -64363363336633363736393038313464,Mega Drive,a:b1,b:b0,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,start:b9,x:b2,y:b3,platform:Android, -33323763323132376537376266393366,Microsoft Dual Strike,a:b24,b:b23,back:b25,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b20,lefttrigger:b9,rightshoulder:b19,righttrigger:b10,start:b17,x:b2,y:b3,platform:Android, -32386235353630393033393135613831,Microsoft Xbox Series 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, -4d4f42415041442050726f2d48440000,Mobapad Chitu HD,a:b0,b:b1,back:b15,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, -4d4f435554452d303533582d4d35312d,Mocute 053X,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, -33343361376163623438613466616531,Mocute M053,a:b0,b:b1,back:b15,dpdown:b12,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, -39306635663061636563316166303966,Mocute M053,a:b0,b:b1,back:b15,dpdown:b12,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, -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, -31316661666466633938376335383661,Nintendo Switch Pro Controller,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,leftshoulder:b9,leftstick:b7,lefttrigger:b17,leftx:a0,lefty:a1,misc1:b5,rightshoulder:b10,rightstick:b8,righttrigger:b18,rightx:a2,start:b6,x:b3,y:b2,platform:Android, -34323437396534643531326161633738,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,leftstick:b7,lefttrigger:b17,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,rightshoulder:b20,start:b18,x:b19,y:b2,platform:Android, -64623863346133633561626136366634,NSO SNES Controller,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -050000005509000014720000df7f3f80,NVIDIA Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,platform:Android, -37336435666338653565313731303834,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, -4e564944494120436f72706f72617469,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, -61363931656135336130663561616264,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, -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:b12,dpleft:b13,dpright:b14,dpup:b11,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, -61653962353232366130326530363061,Pokken,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,lefttrigger:b9,rightshoulder:b20,righttrigger:b10,start:b18,x:b0,y:b2,platform:Android, -32666633663735353234363064386132,PS2 Controller,a:b23,b:b22,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,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, -050000004c050000c4050000fffe3f80,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a3,rightx:a4,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -31663838336334393132303338353963,PS4 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -35643031303033326130316330353564,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, -37626233336235343937333961353732,PS4 Controller,a:b0,b:b1,back:b15,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, -37626464343430636562316661643863,PS4 Controller,a:b0,b:b1,back:b15,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, -38393161636261653636653532386639,PS4 Controller,a:b0,b:b1,back:b15,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, -63313733393535663339656564343962,PS4 Controller,a:b0,b:b1,back:b15,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, -63393662363836383439353064663939,PS4 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, -65366465656364636137653363376531,PS4 Controller,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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, -050000004c050000e60c0000fffe3f80,PS5 Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a3,rightx:a4,righty:a5,start:b16,x:b2,y:b17,platform:Android, -050000004c050000e60c0000ffff3f00,PS5 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, -32346465346533616263386539323932,PS5 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, -32633532643734376632656664383733,PS5 Controller,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -37363764353731323963323639666565,PS5 Controller,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,misc1:b8,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a5,start:b18,x:b0,y:b2,platform:Android, -64336263393933626535303339616332,Qanba 4RAF,a:b0,b:b1,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -05000000f8270000bf0b0000ffff3f00,Razer Kishi,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, -62653861643333663663383332396665,Razer Kishi,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b17,rightshoulder:b18,start:b10,x:b2,y:b3,platform:Android, -61343739353764363165343237303336,Retro Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b17,lefttrigger:b18,leftx:a0,lefty:a1,start:b10,x:b2,y:b3,platform:Android, -526574726f696420506f636b65742043,Retroid Pocket,a:b1,b:b0,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, -582d426f7820436f6e74726f6c6c6572,Retroid Pocket,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -64633735616665613536653363336132,Retroid Pocket,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b19,paddle2:b20,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b3,y:b2,platform:Android, -38653130373365613538333235303036,Retroid Pocket 2,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,start:b6,platform:Android, -37393234373533633333323633646531,RetroUSB N64 RetroPort,+rightx:b17,+righty:b15,-rightx:b18,-righty:b6,a:b10,b:b9,dpdown:b19,dpleft:b1,dpright:b0,dpup:b2,leftshoulder:b7,lefttrigger:b20,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Android, -5365616c6965436f6d707574696e6720,RetroUSB N64 RetroPort,+rightx:b17,+righty:b15,-rightx:b18,-righty:b6,a:b10,b:b9,dpdown:b19,dpleft:b1,dpright:b0,dpup:b2,leftshoulder:b7,lefttrigger:b20,leftx:a0,lefty:a1,rightshoulder:b5,start:b3,platform:Android, -526574726f5553422e636f6d20534e45,RetroUSB SNES RetroPort,a:b1,b:b20,back:b19,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b2,x:b0,y:b3,platform:Android, -64643037633038386238303966376137,RetroUSB SNES RetroPort,a:b1,b:b20,back:b19,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,rightshoulder:b10,start:b2,x:b0,y:b3,platform:Android, -37656564346533643138636436356230,Rock Candy Switch Controller,a:b1,b:b19,back:b17,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b15,lefttrigger:b9,leftx:a0,lefty:a1,misc1:b7,rightshoulder:b20,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b18,x:b0,y:b2,platform:Android, -36363537303435333566386638366333,Samsung EIGP20,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -53616d73756e672047616d6520506164,Samsung EIGP20,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -66386565396238363534313863353065,Sanwa PlayOnline Mobile,a:b21,b:b22,back:b23,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b24,platform:Android, -32383165316333383766336338373261,Saturn,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,lefttrigger:b10,leftx:a0,lefty:a1,rightshoulder:a4,righttrigger:a5,x:b2,y:b3,platform:Android, -38613865396530353338373763623431,Saturn,a:b0,b:b1,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,lefttrigger:b10,rightshoulder:b20,righttrigger:b19,start:b17,x:b2,y:b3,platform:Android, -61316232336262373631343137633631,Saturn,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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: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,x:b2,y:b3,platform:Android, -66633132393363353531373465633064,SG H510,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,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:b3,y:b2,platform:Android, -38376662666661636265313264613039,SNES,a:b0,b:b1,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b3,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, -5346432f555342205061640000000000,SNES Adapter,a:b0,b:b1,back:b9,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b3,rightshoulder:b20,start:b10,x:b19,y:b2,platform:Android, -5553422047616d657061642000000000,SNES Controller,a:b1,b:b0,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,rightshoulder:b10,start:b6,x:b3,y:b2,platform:Android, -62653335326261303663356263626339,Sony PlayStation Classic Controller,a:b19,b:b1,back:b17,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b9,lefttrigger:b3,rightshoulder:b10,righttrigger:b20,start:b18,x:b2,y:b0,platform:Android, -536f6e7920496e746572616374697665,Sony PlayStation 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,misc1:b8,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -576972656c65737320436f6e74726f6c,Sony PlayStation 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, -63303964303462366136616266653561,Sony PSP,a:b21,b:b22,back:b27,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftx:a0,lefty:a1,rightshoulder:b20,rightx:a3,righty:a4,start:b18,x:b0,y:b2,platform:Android, -0500000011010000201400000f7e0f00,SteelSeries Nimbus,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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, -33313930373536613937326534303931,Taito Egret II Mini Control Panel,a:b25,b:b23,back:b27,guide:b30,leftx:a0,lefty:a1,rightshoulder:b21,righttrigger:b22,start:b28,x:b29,y:b24,platform:Android, -54475a20436f6e74726f6c6c65720000,TGZ Controller,a:b0,b:b1,back:b15,dpdown:b12,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, -62363434353532386238336663643836,TGZ Controller,a:b0,b:b1,back:b15,dpdown:b12,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, -37323236633763666465316365313236,THEC64 Joystick,a:b21,b:b22,back:b27,leftshoulder:b25,leftx:a0,lefty:a1,rightshoulder:b26,start:b27,x:b23,y:b24,platform:Android, -38346162326232346533316164363336,THEGamepad,a:b23,b:b22,back:b27,leftshoulder:b25,leftx:a0,lefty:a1,rightshoulder:b26,start:b28,x:b24,y:b21,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:b12,dpleft:b13,dpright:b14,dpup:b11,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, -05000000de2800000511000001000000,Valve 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,Valve 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, -30623739343039643830333266346439,Valve Steam Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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 Adapter,a:b23,b:b22,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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 Adapter,a:b23,b:b22,back:b29,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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:b12,dpleft:b13,dpright:b14,dpup:b11,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, -050000005e04000091020000ff073f80,Xbox One Controller,a:b0,b:b1,back:b4,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, -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, -050000005e040000e00200000ffe3f80,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a2,righty:a3,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, -050000005e040000e0020000ffff3f80,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b4,leftshoulder:b3,leftstick:b8,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,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: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, -34356136633366613530316338376136,Xbox One Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,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: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, -36616131643361333337396261666433,Xbox One Controller,a:b0,b:b1,back:b15,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, -58626f7820576972656c65737320436f,Xbox One 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, -65316262316265373335666131623538,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, -050000005e040000000b000000783f80,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:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -050000005e040000050b0000ffff3f00,Xbox One Elite 2 Controller,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:a6,rightx:a2,righty:a3,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, -050000005e040000120b000000783f80,Xbox Series 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,misc1:b15,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, -050000005e040000130b0000ffff3f00,Xbox Series 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,misc1:b15,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: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, -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, -05000000ac05000004000000a8986d04,8BitDo Micro,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,lefttrigger:b12,rightshoulder:b13,righttrigger:b14,start:b3,x:b6,y:b5,platform:iOS, -05000000ac05000004000000fd216d04,8BitDo Pro 2,a:b3,b:b2,back:b6,dpdown:b9,dpleft:b10,dpright:b11,dpup:b12,guide:b4,leftshoulder:b13,leftstick:b14,lefttrigger:+a2,leftx:a0,lefty:a1~,paddle1:b1,paddle2:b0,rightshoulder:b16,rightstick:b17,righttrigger:+a5,rightx:a3,righty:a4~,start:b5,x:b8,y:b7,platform:iOS, -05000000ac05000004000000209f6d04,8Bitdo SN30 Pro,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,leftstick:b12,lefttrigger:b13,leftx:a0,lefty:a1~,rightshoulder:b14,rightstick:b15,righttrigger:b16,rightx:a2,righty:a3~,start:b3,x:b6,y:b5,platform:iOS, -05000000ac050000040000003b8a6d04,8BitDo SN30 Pro+,a:b1,b:b0,back:b4,dpdown:b7,dpleft:b8,dpright:b9,dpup:b10,guide:b2,leftshoulder:b11,leftstick:b12,lefttrigger:b13,leftx:a0,lefty:a1~,rightshoulder:b14,rightstick:b15,righttrigger:b16,rightx:a2,righty:a3~,start:b3,x:b6,y:b5,platform:iOS, -050000008a35000003010000ff070000,Backbone One,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:b10,x:b2,y:b3,platform:iOS, -050000008a35000004010000ff070000,Backbone One,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:b10,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, -050000007e050000062000000f060000,Nintendo Switch Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS, -050000007e050000062000004f060000,Nintendo Switch Joy-Con (L),+leftx:h0.1,+lefty:h0.2,-leftx:h0.4,-lefty:h0.8,dpdown:b2,dpleft:b0,dpright:b3,dpup:b1,leftshoulder:b4,misc1:b6,rightshoulder:b5,platform:iOS, -050000007e05000008200000df070000,Nintendo Switch Joy-Con (L/R),a:b1,b:b0,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:b3,y:b2,platform:iOS, -050000007e0500000e200000df070000,Nintendo Switch Joy-Con (L/R),a:b1,b:b0,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:b3,y:b2,platform:iOS, -050000007e050000072000000f060000,Nintendo Switch Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS, -050000007e050000072000004f060000,Nintendo Switch Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b2,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b1,y:b3,platform:iOS, -050000007e05000009200000df870000,Nintendo Switch Pro Controller,a:b1,b:b0,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:b3,y:b2,platform:iOS, -050000007e05000009200000ff870000,Nintendo Switch Pro Controller,a:b1,b:b0,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:b3,y:b2,platform:iOS, -05000000ac050000040000008e586d04,PlayStation VR2 Sense Controller (L),+leftx:+a3,+lefty:+a1,-leftx:+a2,-lefty:+a4,back:b2,leftstick:b4,lefttrigger:+a7,paddle2:b3,x:b0,y:b1,platform:iOS, -05000000ac050000040000000eb86d04,PlayStation VR2 Sense Controller (R),+rightx:+a3,+righty:+a1,-rightx:+a2,-righty:+a4,a:b0,b:b1,paddle1:b3,rightstick:b4,righttrigger:+a7,start:b2,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,Valve 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,Valve 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/res/rml/logs.rcss b/res/rml/logs.rcss new file mode 100644 index 0000000000..126684f9d2 --- /dev/null +++ b/res/rml/logs.rcss @@ -0,0 +1,97 @@ +window.logs content { + flex-flow: column; +} + +window.logs .log-toolbar { + display: flex; + flex-flow: row; + flex: 0 0 64dp; + height: 64dp; + align-items: center; + gap: 8dp; + padding-right: 72dp; + background-color: rgba(217, 217, 217, 10%); + border-bottom: 2dp #92875B; + font-family: "Fira Sans Condensed"; + font-weight: bold; + font-size: 18dp; +} + +window.logs > close { + top: 8dp; + right: 8dp; +} + +window.logs .log-title { + align-self: stretch; + flex: 0 0 auto; + padding: 0 24dp; + line-height: 64dp; + text-transform: uppercase; + border-bottom: 4dp #C2A42D; + font-effect: glow(0dp 4dp 0dp 4dp black); +} + +window.logs .log-title-mod { + flex: 0 1 auto; + min-width: 0; + white-space: nowrap; + overflow: hidden; + font-family: "Fira Sans"; + font-weight: normal; + font-size: 15dp; + color: rgba(224, 219, 200, 55%); +} + +.log-toolbar-spacer { + flex: 1 1 0; +} + +.log-toolbar button { + flex: 0 0 auto; + font-family: "Fira Sans"; + font-weight: normal; + font-size: 15dp; + padding: 5dp 12dp; +} + +window.logs content pane.log-view { + flex: 1 1 0; + padding: 12dp 16dp; + padding-bottom: 0dp; + gap: 0dp; +} + +.log-lines { + display: block; +} + +.log-line { + display: block; + font-family: "Noto Mono"; + font-size: 13dp; + line-height: 1.5; + word-break: break-word; + white-space: pre-wrap; +} + +.log-line .log-time { + color: rgba(224, 219, 200, 45%); +} + +.log-line .log-mod { + color: rgba(194, 164, 45, 80%); +} + +.log-line.lvl-trace, +.log-line.lvl-debug { + opacity: 0.55; +} + +.log-line.lvl-warn .log-msg { + color: #ffa826; +} + +.log-line.lvl-error .log-msg { + color: #cc4444; +} diff --git a/res/rml/mods.rcss b/res/rml/mods.rcss new file mode 100644 index 0000000000..6042e35c0f --- /dev/null +++ b/res/rml/mods.rcss @@ -0,0 +1,219 @@ +window.mods content pane.mod-list { + flex: 0 0 360dp; + padding: 16dp; + padding-bottom: 0dp; + gap: 4dp; +} + +@media (max-height: 640dp) { + window.mods content pane.mod-list { + flex: 1 1 0; + } +} + +window.mods content pane.mod-detail { + gap: 12dp; +} + +.mod-info-row { + display: flex; + align-items: center; + gap: 12dp; + padding: 4dp 0; +} + +.mod-info-label { + font-family: "Fira Sans Condensed"; + font-weight: bold; + opacity: 0.55; + flex: 0 0 auto; +} + +.mod-info-value { + flex: 1 1 0; +} + +.mod-path { + font-size: 14dp; + word-break: break-all; + opacity: 0.7; +} + +mod-entry { + display: flex; + flex-flow: row; + gap: 12dp; + padding: 10dp; + border-radius: 10dp; + decorator: vertical-gradient(#c2a42d00 #c2a42d00); + transition: decorator 0.1s linear-in-out; + cursor: pointer; + focus: auto; +} + +mod-entry.current { + box-shadow: rgba(146, 135, 91, 40%) 0 0 0 1dp; +} + +mod-entry:hover, +mod-entry:focus-visible { + decorator: vertical-gradient(#c2a42d00 #c2a42d26); +} + +mod-entry:selected { + decorator: vertical-gradient(#c2a42d10 #c2a42d40); +} + +mod-entry .mod-icon { + flex: 0 0 auto; + width: 56dp; + height: 56dp; + border-radius: 8dp; +} + +mod-entry icon.mod-icon { + font-size: 36dp; + background-color: rgba(17, 16, 10, 20%); + color: rgba(224, 219, 200, 45%); + decorator: text("" center center); +} + +mod-entry .mod-entry-info { + display: flex; + flex-flow: column; + flex: 1 1 0; + min-width: 0; + gap: 2dp; +} + +mod-entry .mod-entry-name { + display: flex; + flex-flow: row; + align-items: baseline; + gap: 6dp; +} + +mod-entry .mod-entry-name-text { + flex: 0 1 auto; + min-width: 0; + font-weight: bold; + white-space: nowrap; + overflow: hidden; +} + +mod-entry .mod-entry-version { + flex: 0 0 auto; + font-size: 13dp; + color: rgba(224, 219, 200, 50%); +} + +mod-entry .mod-entry-status.active { + color: #44cc55; +} + +mod-entry .mod-entry-status.failed { + color: #cc4444; +} + +mod-entry .mod-entry-desc { + font-size: 14dp; + line-height: 1.3; + color: rgba(224, 219, 200, 65%); + max-height: 2.6em; + overflow: hidden; + white-space: pre-wrap; +} + +mod-entry .mod-entry-sub { + font-size: 13dp; + color: rgba(224, 219, 200, 50%); +} + +mod-entry.inactive .mod-icon { + filter: grayscale(1); +} + +mod-entry.inactive .mod-entry-info { + opacity: 0.5; +} + +mod-header { + position: relative; + flex: 0 0 auto; +} + +mod-header.has-banner { + height: 180dp; + margin: -24dp -24dp 0dp -24dp; +} + +mod-header .mod-actions { + position: absolute; + top: 24dp; + left: 24dp; + display: flex; + flex-flow: row; + gap: 8dp; +} + +mod-header .mod-actions button { + font-size: 16dp; + padding: 6dp 14dp; + background-color: rgba(21, 22, 16, 80%); + box-shadow: rgba(146, 135, 91, 60%) 0 0 0 1dp; +} + +mod-header.no-banner { + display: flex; + flex-flow: row; + align-items: center; +} + +mod-header.no-banner .mod-actions { + position: static; +} + +window.mods .mod-title { + display: block; + font-size: 28dp; + font-weight: bold; +} + +window.mods .mod-title .mod-title-version { + font-weight: normal; + font-size: 16dp; + color: rgba(224, 219, 200, 55%); +} + +window.mods .mod-author { + display: block; + font-size: 15dp; + color: rgba(224, 219, 200, 55%); +} + +window.mods .mod-restart-note { + font-size: 15dp; + color: #ffa826; + opacity: 0.85; +} + +window.mods .mod-description { + line-height: 1.5; +} + +.status-badge { + font-size: 14dp; + opacity: 0.7; +} + +.status-badge.active, +.mod-info-label.active { + color: #44cc55; + opacity: 1; +} + +.status-badge.failed, +.mod-info-label.failed { + color: #cc4444; + opacity: 1; +} \ No newline at end of file diff --git a/res/rml/overlay.rcss b/res/rml/overlay.rcss index 8927e1a01c..98f8bfa27a 100644 --- a/res/rml/overlay.rcss +++ b/res/rml/overlay.rcss @@ -16,11 +16,12 @@ body { flex-direction: column; justify-content: flex-end; align-items: stretch; - z-index: 1; + z-index: 2; pointer-events: none; } fps, +pipeline-progress, toast { position: absolute; border: 1dp #92875B; @@ -98,7 +99,7 @@ toast message row.muted { opacity: 0.5; } -toast progress { +progress { height: 4dp; position: absolute; left: 0; @@ -106,10 +107,50 @@ toast progress { width: 100%; } -toast progress fill { +progress fill { background-color: rgba(194, 164, 45, 80%); } +pipeline-progress { + left: 12dp; + bottom: 12dp; + display: flex; + flex-flow: column; + z-index: 100; + min-width: 260dp; + max-width: 90%; + padding: 10dp 16dp 12dp; + border-radius: 7dp; + overflow: hidden; + filter: opacity(0); + transition: filter 0.2s linear-in-out; + pointer-events: none; +} + +pipeline-progress[open] { + filter: opacity(1); +} + +pipeline-status { + display: flex; + align-items: center; + gap: 8dp; + font-size: 18dp; + font-weight: normal; + white-space: nowrap; +} + +icon.pipeline-spinner { + width: 1.2em; + height: 1.2em; + line-height: 1.2em; + font-size: 1.2em; + color: #C2A42D; + text-align: center; + transform-origin: center; + animation: 1s linear infinite pipeline-spinner-spin; +} + toast.achievement { border: 1dp #C2A42D; } @@ -118,6 +159,14 @@ toast.achievement heading { color: #C2A42D; } +toast.warning { + border: 1dp #C2A42D; +} + +toast.warning heading { + color: #C2A42D; +} + toast.controller-warning { top: auto; right: auto; @@ -310,6 +359,15 @@ logo img.outer { } } +@keyframes pipeline-spinner-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + @media (max-height: 640dp) { toast { top: 20dp; diff --git a/res/rml/prelaunch.rcss b/res/rml/prelaunch.rcss index f5d7240d56..054b6e0183 100644 --- a/res/rml/prelaunch.rcss +++ b/res/rml/prelaunch.rcss @@ -362,6 +362,10 @@ body.animate-in .intro-item { transition: opacity transform 0.3s 0.6s cubic-in-out; } +.delay-6 { + transition: opacity transform 0.3s 0.7s cubic-in-out; +} + /* Mobile layout */ @media (max-height: 640dp) { .gradient { @@ -447,6 +451,7 @@ body.animate-in .intro-item { top: auto; text-align: right; font-size: 16dp; + gap: 8dp; } #disc-status { @@ -468,6 +473,7 @@ body.animate-in .intro-item { top: 32dp; text-align: right; font-size: 16dp; + gap: 8dp; } .update { diff --git a/res/rml/tabbing.rcss b/res/rml/tabbing.rcss index 194ca89f05..8f42dd84d5 100644 --- a/res/rml/tabbing.rcss +++ b/res/rml/tabbing.rcss @@ -50,7 +50,8 @@ tab-bar[closable] tab-end-spacer { pointer-events: none; } -tab-bar[closable] close { +tab-bar[closable] close, +window > close { display: block; position: fixed; top: 8dp; @@ -70,12 +71,20 @@ tab-bar[closable] close { } tab-bar[closable] close:hover, -tab-bar[closable] close:focus-visible { +tab-bar[closable] close:focus-visible, +window > close:hover, +window > close:focus-visible { color: #fff; background-color: rgba(194, 164, 45, 24%); } -tab-bar[closable] close:active { +window > close { + top: 16dp; + right: 16dp; +} + +tab-bar[closable] close:active, +window > close:active { color: #fff; background-color: rgba(194, 164, 45, 40%); } diff --git a/res/rml/touch_controls.rcss b/res/rml/touch_controls.rcss new file mode 100644 index 0000000000..4c8057d6c0 --- /dev/null +++ b/res/rml/touch_controls.rcss @@ -0,0 +1,339 @@ +*, *:before, *:after { + box-sizing: border-box; +} + +body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: hidden; + font-family: "Fira Sans Condensed"; + font-weight: bold; + color: rgba(248, 244, 232, 90%); + z-index: 1; + filter: opacity(0); + transition: filter 0.2s linear-in-out; +} + +body[open] { + filter: opacity(1); +} + +body:not([open]) { + pointer-events: none; +} + +button { + display: flex; + align-items: center; + justify-content: center; + decorator: none; + padding: 0; + border: 1dp rgba(255, 255, 255, 22%); + background-color: rgba(22, 24, 28, 48%); + color: rgba(248, 244, 232, 90%); + text-align: center; + /* backdrop-filter: blur(7dp); */ + /* box-shadow: 0 6dp 18dp rgba(0, 0, 0, 28%); */ + transform-origin: center; + transition: background-color border-color filter transform 0.08s linear-in-out, + opacity 0.2s linear-in-out; +} + +button.pressed, +button.active { + background-color: rgba(63, 78, 90, 68%); + border-color: rgba(255, 255, 255, 48%); + filter: brightness(1.18); +} + +button:hidden { + opacity: 0; + pointer-events: none; +} + +button span { + display: block; + line-height: 1; +} + +button icon { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; +} + +button icon glyph { + display: block; + font-family: "Material Symbols Rounded"; + font-weight: normal; + font-size: 24dp; + line-height: 1; +} + +.midna-icon, +.item-icon, +.item-count, +.oil-meter { + display: none; +} + +.midna-icon.visible, +.item-icon.visible, +.item-count.visible, +.oil-meter.visible { + display: block; +} + +.control { + position: absolute; +} + +.trigger-l.active { + background-color: rgba(57, 116, 133, 74%); + border-color: rgba(128, 222, 234, 72%); +} + +.trigger, +.skip { + border-radius: 23dp; +} + +.trigger { + font-size: 22dp; +} + +.button-z { + background-color: rgba(118, 79, 158, 58%); + border-color: rgba(203, 170, 255, 36%); +} + +.midna-icon { + position: absolute; + left: 9dp; + top: -1dp; + height: 48dp; +} + +.button-z.has-icon span, +.face.has-item span { + position: absolute; + font-size: 13dp; + line-height: 1; +} + +.button-z.has-icon span { + right: 9dp; + bottom: 7dp; +} + +.button-z.pressed { + background-color: rgba(139, 91, 187, 82%); + border-color: rgba(220, 194, 255, 70%); +} + +action-bar { + position: absolute; + display: flex; + align-items: center; + border: 1dp rgba(255, 255, 255, 22%); + border-radius: 23dp; + background-color: rgba(22, 24, 28, 48%); + /* backdrop-filter: blur(7dp); */ + /* box-shadow: 0 -6dp 18dp rgba(0, 0, 0, 28%); */ + overflow: hidden; + opacity: 1; + transform-origin: center; + transition: opacity 0.2s linear-in-out; +} + +action-bar:hidden, +action-bar:hidden button, +action-bar:hidden separator { + opacity: 0; + pointer-events: none; +} + +.utility { + position: relative; + flex: 1 1 auto; + width: 56dp; + height: 44dp; + margin: 0; + border-width: 0dp; + border-radius: 0; + background-color: transparent; + box-shadow: none; +} + +.utility, +.skip { + opacity: 0.55; +} + +.utility.pressed { + background-color: rgba(63, 78, 90, 68%); +} + +.utility.pressed, +.skip.pressed { + opacity: 1; +} + +.skip { + z-index: 1; + border-color: rgba(255, 255, 255, 36%); +} + +separator { + display: block; + flex: 0 0 1dp; + width: 1dp; + height: 24dp; + background-color: rgba(255, 255, 255, 18%); + opacity: 1; + transition: opacity 0.2s linear-in-out; +} + +.face { + position: absolute; + border-radius: 29dp; + font-size: 24dp; + overflow: visible; +} + +.item-icon { + width: auto; + height: auto; + max-width: 76%; + max-height: 76%; +} + +.item-count { + position: absolute; + left: 6dp; + bottom: 5dp; + min-width: 17dp; + height: 15dp; + padding: 1dp 3dp; + border-radius: 7dp; + background-color: rgba(0, 0, 0, 52%); + color: rgba(255, 255, 255, 92%); + font-size: 12dp; + line-height: 13dp; + text-align: center; +} + +.oil-meter { + position: absolute; + left: 12dp; + bottom: -5dp; + width: 34dp; + height: 8dp; + padding: 2dp; + border: 1dp rgba(42, 32, 18, 82%); + border-radius: 4dp; + background-color: rgba(18, 14, 10, 70%); + /* box-shadow: 0 2dp 6dp rgba(0, 0, 0, 35%); */ +} + +oil-fill { + display: block; + width: 0%; + height: 100%; + border-radius: 2dp; + background-color: rgb(255, 232, 74); +} + +.face.has-item span { + right: 6dp; + bottom: 6dp; + color: rgba(255, 255, 255, 88%); +} + +.face.a { + border-radius: 37dp; + font-size: 31dp; + background-color: rgba(34, 112, 123, 62%); +} + +.face.b { + background-color: rgba(161, 61, 66, 58%); +} + +.face.x { + background-color: rgba(83, 115, 151, 56%); +} + +.face.y { + background-color: rgba(113, 91, 150, 54%); +} + +button.control.docked-top, +action-bar.docked-top { + border-top-width: 0dp; + border-top-left-radius: 0dp; + border-top-right-radius: 0dp; +} + +button.control.docked-bottom, +action-bar.docked-bottom { + border-bottom-width: 0dp; + border-bottom-left-radius: 0dp; + border-bottom-right-radius: 0dp; +} + +button.control.docked-left, +action-bar.docked-left { + border-left-width: 0dp; + border-top-left-radius: 0dp; + border-bottom-left-radius: 0dp; +} + +button.control.docked-right, +action-bar.docked-right { + border-right-width: 0dp; + border-top-right-radius: 0dp; + border-bottom-right-radius: 0dp; +} + +touch-stick { + display: block; + position: absolute; + width: 124dp; + height: 124dp; + border-radius: 62dp; + background-color: rgba(18, 20, 24, 35%); + border: 1dp rgba(255, 255, 255, 20%); + /* backdrop-filter: blur(7dp); */ + /* box-shadow: 0 8dp 24dp rgba(0, 0, 0, 24%); */ + opacity: 0; + pointer-events: none; + transition: opacity 0.18s linear-in-out; +} + +touch-stick.active { + opacity: 1; +} + +stick-ring { + position: absolute; + left: 18dp; + top: 18dp; + width: 88dp; + height: 88dp; + border-radius: 44dp; + border: 1dp rgba(255, 255, 255, 18%); +} + +stick-knob { + position: absolute; + width: 48dp; + height: 48dp; + border-radius: 24dp; + background-color: rgba(238, 236, 226, 55%); + border: 1dp rgba(255, 255, 255, 45%); +} diff --git a/res/rml/touch_controls_editor.rcss b/res/rml/touch_controls_editor.rcss new file mode 100644 index 0000000000..2ca99d935a --- /dev/null +++ b/res/rml/touch_controls_editor.rcss @@ -0,0 +1,138 @@ +body.touch-editor { + background-color: rgba(4, 6, 8, 34%); + z-index: 8; +} + +body.touch-editor .control, +body.touch-editor action-bar { + opacity: 0.88; + cursor: move; + pointer-events: auto; +} + +body.touch-editor .control:hover, +body.touch-editor action-bar:hover, +body.touch-editor .control.editor-selected, +body.touch-editor action-bar.editor-selected { + border-color: rgba(255, 232, 128, 80%); + filter: brightness(1.15); +} + +body.touch-editor action-bar button, +body.touch-editor action-bar separator { + pointer-events: none; +} + +selection-frame { + display: none; + position: absolute; + z-index: 20; + border: 2dp rgba(255, 232, 128, 88%); + background-color: rgba(255, 232, 128, 7%); + pointer-events: none; +} + +selection-frame.visible { + display: block; +} + +resize-handle { + display: block; + position: absolute; + width: 22dp; + height: 22dp; + border: 2dp rgba(255, 244, 190, 96%); + border-radius: 11dp; + background-color: rgba(34, 37, 42, 86%); + pointer-events: auto; +} + +resize-handle.left { + left: -12dp; +} + +resize-handle.right { + right: -12dp; +} + +resize-handle.top { + top: -12dp; +} + +resize-handle.bottom { + bottom: -12dp; +} + +resize-handle.horizontal { + top: 50%; + margin-top: -11dp; +} + +resize-handle.vertical { + left: 50%; + margin-left: -11dp; +} + +resize-handle.corner.left { + left: -12dp; +} + +resize-handle.corner.right { + right: -12dp; +} + +resize-handle.corner.top { + top: -12dp; +} + +resize-handle.corner.bottom { + bottom: -12dp; +} + +editor-toolbar { + display: flex; + position: absolute; + left: 24dp; + right: 24dp; + top: 50%; + z-index: 30; + height: 48dp; + margin-top: -24dp; + gap: 8dp; + justify-content: center; + pointer-events: auto; +} + +editor-toolbar button.editor-command { + flex: 0 1 150dp; + min-width: 96dp; + height: 48dp; + padding: 0 14dp; + border-radius: 8dp; + border: 1dp rgba(255, 255, 255, 26%); + background-color: rgba(17, 19, 24, 88%); + color: rgba(255, 250, 232, 94%); + font-family: "Fira Sans"; + font-size: 18dp; + line-height: 48dp; + opacity: 1; + cursor: pointer; +} + +editor-toolbar button.editor-command span { + display: block; + width: 100%; + line-height: 48dp; + text-align: center; +} + +editor-toolbar button.editor-command.primary { + border-color: rgba(255, 232, 128, 70%); + background-color: rgba(96, 82, 38, 90%); +} + +editor-toolbar button.editor-command:hover, +editor-toolbar button.editor-command:focus-visible { + border-color: rgba(255, 244, 190, 92%); + background-color: rgba(78, 85, 96, 92%); +} diff --git a/sdk/CMakeLists.txt b/sdk/CMakeLists.txt new file mode 100644 index 0000000000..cd80781eb6 --- /dev/null +++ b/sdk/CMakeLists.txt @@ -0,0 +1,43 @@ +# Dusklight Mod SDK entry point +# +# Provides selectable mod service, game ABI, and WebGPU header surfaces without configuring the +# full game tree. +# +# Usage (from a mod project): +# add_subdirectory(/sdk dusk-sdk EXCLUDE_FROM_ALL) +# add_mod(my_mod FEATURES game webgpu SOURCES ... MOD_JSON mod.json) +# +# On platforms where mods link against the game binary (Windows/Apple/Android), a +# version-independent link stub is downloaded automatically unless DUSK_GAME_EXE is set. + +cmake_minimum_required(VERSION 3.25) + +if (TARGET dusklight_mod_api) + message(FATAL_ERROR "Mod SDK already configured") +endif () + +include("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/WindowsTargetProcessor.cmake") + +if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING + "Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE) +endif () + +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +# Version detection & version.h +include("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/DetectVersion.cmake") +detect_version() +configure_version_header() + +# Mod API and optional feature header surfaces +include("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GameABIConfig.cmake") + +if (WIN32 OR APPLE OR ANDROID) + set(DUSK_GAME_EXE "" CACHE FILEPATH "Game binary or link stub mods link against") + if (DUSK_GAME_EXE AND NOT EXISTS "${DUSK_GAME_EXE}") + message(FATAL_ERROR "Mod SDK: DUSK_GAME_EXE does not exist: ${DUSK_GAME_EXE}") + endif () +endif () + +include("${CMAKE_CURRENT_SOURCE_DIR}/../cmake/ModSDK.cmake") diff --git a/sdk/include/mods/api.h b/sdk/include/mods/api.h new file mode 100644 index 0000000000..c63d08cfe2 --- /dev/null +++ b/sdk/include/mods/api.h @@ -0,0 +1,246 @@ +#pragma once + +#ifdef __cplusplus +#include +#include +extern "C" { +#else +#include +#include +#include +#include +#endif + +#if defined(_WIN32) +#define MOD_EXPORT __declspec(dllexport) +#else +#define MOD_EXPORT __attribute__((visibility("default"))) +#endif + +#ifdef __cplusplus +#define MOD_EXTERN_C extern "C" +#else +#define MOD_EXTERN_C +#endif + +#define MOD_ABI_VERSION 1u +#define MOD_ERROR_MESSAGE_SIZE 512u + +typedef struct ModContext ModContext; + +typedef enum ModResult { + MOD_OK = 0, + MOD_ERROR = 1, + MOD_UNAVAILABLE = 2, + MOD_UNSUPPORTED = 3, + MOD_CONFLICT = 4, + MOD_INVALID_ARGUMENT = 5, +} ModResult; + +static_assert(sizeof(ModResult) == 4, + "mod SDK enums must be int-sized; do not build mods with -fshort-enums"); + +typedef struct ModError { + uint32_t struct_size; + ModResult code; + char message[MOD_ERROR_MESSAGE_SIZE]; +} ModError; + +#define MOD_ERROR_INIT {sizeof(ModError), MOD_OK, {0}} + +/* + * Opaque per-mod context, populated by the host before mod_initialize is called. + * Pass it as the first argument to every service call; it identifies the calling + * mod for attribution (logging, resource lookup, hook ownership, etc.). + */ +MOD_EXPORT extern ModContext* mod_ctx; + +/* + * Service versioning contract: + * + * A service is a struct of function pointers, beginning with a ServiceHeader. + * Compatibility is tracked with a major/minor version pair: + * + * - A major version bump is a breaking change. Different majors are distinct + * services; the registry never matches an import against a different major. + * - A minor version bump may only append fields to the end of the struct. + * Existing fields must keep their offsets and semantics. + * + * Providers: exporting minor N means every function pointer introduced at or + * below N is populated (non-NULL). struct_size reflects the compiled struct. + * + * Importers: importing with min_minor_version N guarantees (enforced at load + * time) that the resolved service is at least minor N, so any field introduced + * at or below N may be used unconditionally, with no availability checks. + * Fields newer than the declared min_minor_version must be gated behind + * SERVICE_HAS plus a NULL check on the pointer itself. + * + * Load ordering: a manifest import of another mod's service (required or + * optional) guarantees that the provider's mod_initialize completed before the + * importer's runs, and deferred services published during the provider's + * initialization resolve into import slots just like static exports. If a + * provider fails to load, mods that required its services fail in turn. Mods + * whose required imports form a cycle all fail to load; a cycle involving an + * optional import is broken by dropping the ordering guarantee (not the + * resolution) of that optional import. Dynamic lookups via + * HostService::get_service carry no ordering guarantee: they see whatever has + * been published at call time. + */ +typedef struct ServiceHeader { + uint32_t struct_size; + uint16_t major_version; + uint16_t minor_version; +} ServiceHeader; + +#define SERVICE_HEADER(service_type, major, minor) {sizeof(service_type), (major), (minor)} + +#define SERVICE_HAS(service, service_type, field) \ + ((service) != NULL && \ + (service)->header.struct_size >= \ + (uint32_t)(offsetof(service_type, field) + sizeof(((service_type*)0)->field))) + +typedef enum ServiceImportFlags { + SERVICE_IMPORT_REQUIRED = 0u, + SERVICE_IMPORT_OPTIONAL = 1u << 0u, +} ServiceImportFlags; + +typedef enum ServiceExportFlags { + SERVICE_EXPORT_STATIC = 0u, + SERVICE_EXPORT_DEFERRED = 1u << 0u, +} ServiceExportFlags; + +/* + * Mod metadata records. + * + * A mod's manifest is a sequence of records in a dedicated section of the native library ("modmeta" + * on ELF, "__DATA,__modmeta" on Mach-O, "modmeta$a/$d/$z" on PE). + * + * The records are pure data. Every string is inline and NUL-terminated. Fields documented as + * runtime-only hold relocated pointers that are meaningless on disk; static parsers recover their + * targets from the file's relocation/bind entries instead. + * + * Layout rules: + * - Little-endian, 8-byte aligned; every record size is a multiple of 8. + * - Parsers must skip all-zero 8-byte units (linker padding) and records of unknown kind. + * - Exactly one MOD_META_HEADER record per library. + * + * The IMPORT_SERVICE/EXPORT_SERVICE/DEFINE_HOOK macros emit these records; mods do not construct + * them by hand. + */ + +#define MOD_META_SERVICE_ID_SIZE 64u + +/* Records are 8-byte aligned so the linker packs them without padding; most are naturally + * aligned by their pointer fields, the alignment below covers the rest. */ +#if defined(__cplusplus) +#define MOD_META_ALIGN alignas(8) +#elif defined(_MSC_VER) +#define MOD_META_ALIGN __declspec(align(8)) +#else +#define MOD_META_ALIGN __attribute__((aligned(8))) +#endif + +typedef enum ModMetaKind { + MOD_META_PAD = 0, + MOD_META_HEADER = 1, + MOD_META_IMPORT = 2, + MOD_META_EXPORT = 3, + MOD_META_HOOK_FN = 4, + MOD_META_HOOK_MEM = 5, + MOD_META_HOOK_NAME = 6, +} ModMetaKind; + +typedef struct ModMetaRecord { + uint16_t size; /* total record size in bytes, a multiple of 8 */ + uint8_t kind; /* ModMetaKind */ + uint8_t flags; /* ServiceImportFlags / ServiceExportFlags for imports/exports */ +} ModMetaRecord; + +typedef struct ModMetaServiceId { + char chars[MOD_META_SERVICE_ID_SIZE]; /* NUL-terminated */ +} ModMetaServiceId; + +typedef struct MOD_META_ALIGN ModMetaHeader { + ModMetaRecord rec; + uint32_t abi_version; +} ModMetaHeader; + +static_assert(sizeof(ModMetaHeader) == 8); + +typedef struct MOD_META_ALIGN ModMetaImport { + ModMetaRecord rec; + uint16_t major_version; + uint16_t min_minor_version; + void* slot; /* runtime only */ + ModMetaServiceId service_id; +} ModMetaImport; + +static_assert(sizeof(ModMetaImport) == 16 + MOD_META_SERVICE_ID_SIZE); + +typedef struct MOD_META_ALIGN ModMetaExport { + ModMetaRecord rec; + uint16_t major_version; + uint16_t minor_version; + const void* service; /* runtime only */ + ModMetaServiceId service_id; +} ModMetaExport; + +static_assert(sizeof(ModMetaExport) == 16 + MOD_META_SERVICE_ID_SIZE); + +/* Hook on a function named at link time: `target` carries the &fn relocation. */ +typedef struct MOD_META_ALIGN ModMetaHookFn { + ModMetaRecord rec; + uint32_t reserved; + void* target; /* runtime only */ + void* resolved; /* runtime only */ +} ModMetaHookFn; + +static_assert(sizeof(ModMetaHookFn) == 24); + +/* + * Hook on a member function: `pmf` holds the compiler's pointer-to-member representation + * (non-virtual: a function address relocation; virtual Itanium/AAPCS: literal slot words). Two + * NUL-terminated strings follow `resolved`: the class vtable symbol (empty if the class name is not + * representable), then the stringified target for tooling display. + */ +typedef struct MOD_META_ALIGN ModMetaHookMem { + ModMetaRecord rec; + uint32_t reserved; + unsigned char pmf[16]; + void* resolved; /* runtime only */ +} ModMetaHookMem; + +static_assert(sizeof(ModMetaHookMem) == 32); + +/* + * Hook on a function by symbol name, for targets that cannot be named in C++ (file-local statics, + * private members). One NUL-terminated string follows `resolved`; it may be either the platform + * mangled name or the demangled qualified display name. + */ +typedef struct MOD_META_ALIGN ModMetaHookName { + ModMetaRecord rec; + uint32_t reserved; + void* resolved; /* runtime only */ +} ModMetaHookName; + +static_assert(sizeof(ModMetaHookName) == 16); + +typedef struct ModMeta { + uint32_t struct_size; + const void* records_begin; + const void* records_end; +} ModMeta; + +MOD_EXPORT extern const ModMeta mod_meta; + +typedef ModResult (*ModInitializeFn)(ModError* out_error); +typedef ModResult (*ModUpdateFn)(ModError* out_error); +typedef ModResult (*ModShutdownFn)(ModError* out_error); + +MOD_EXPORT ModResult mod_initialize(ModError* out_error); +MOD_EXPORT ModResult mod_update(ModError* out_error); +MOD_EXPORT ModResult mod_shutdown(ModError* out_error); + +#ifdef __cplusplus +} +#endif diff --git a/sdk/include/mods/hook.hpp b/sdk/include/mods/hook.hpp new file mode 100644 index 0000000000..07999da84c --- /dev/null +++ b/sdk/include/mods/hook.hpp @@ -0,0 +1,210 @@ +#pragma once + +#if !defined(DUSK_BUILDING_GAME) && !defined(DUSK_MOD_FEATURE_GAME) +#error "DEFINE_HOOK requires add_mod(... FEATURES game)" +#endif + +#include + +#include +#include + +namespace mods { + +template +T arg(void* argsRaw, int n) noexcept { + void** args = static_cast(argsRaw); + return *static_cast>>(args[n]); +} + +template +std::remove_reference_t& arg_ref(void* argsRaw, int n) noexcept { + void** args = static_cast(argsRaw); + return *static_cast>>(args[n]); +} + +/* + * Trampoline generator + per-target state. Tag makes each hooked target's statics distinct; the + * target address comes from the declaration's metadata record, resolved by the host at mod + * initialization. + */ +template +struct HookImpl { + static inline R (*g_orig)(A...) = nullptr; + static inline const HookService* hooks = nullptr; + static inline void* target = nullptr; + + static bool dispatch_pre(void* args, void* retval) { + if (hooks == nullptr) { + return false; + } + + int skipOriginal = 0; + const ModResult result = hooks->dispatch_pre(mod_ctx, target, args, retval, &skipOriginal); + return result == MOD_OK && skipOriginal != 0; + } + + static void dispatch_post(void* args, void* retval) { + if (hooks != nullptr) { + hooks->dispatch_post(mod_ctx, target, args, retval); + } + } + + static R trampoline(A... args) { + if constexpr (sizeof...(A) == 0) { + if constexpr (std::is_void_v) { + const bool skipOriginal = dispatch_pre(nullptr, nullptr); + if (!skipOriginal) { + g_orig(args...); + } + dispatch_post(nullptr, nullptr); + } else { + R result{}; + const bool skipOriginal = + dispatch_pre(nullptr, static_cast(std::addressof(result))); + if (!skipOriginal) { + result = g_orig(args...); + } + dispatch_post(nullptr, static_cast(std::addressof(result))); + return result; + } + } else { + void* ptrs[] = {static_cast(std::addressof(args))...}; + if constexpr (std::is_void_v) { + const bool skipOriginal = dispatch_pre(static_cast(ptrs), nullptr); + if (!skipOriginal) { + g_orig(args...); + } + dispatch_post(static_cast(ptrs), nullptr); + } else { + R result{}; + const bool skipOriginal = dispatch_pre( + static_cast(ptrs), static_cast(std::addressof(result))); + if (!skipOriginal) { + result = g_orig(args...); + } + dispatch_post(static_cast(ptrs), static_cast(std::addressof(result))); + return result; + } + } + } +}; + +namespace detail { +template +using TargetTag = std::integral_constant; +template +struct NameTag {}; +} // namespace detail + +/* + * Typed base for a hook on a function named at compile time (&daAlink_c::execute, &free_fn). + * Instantiate through DEFINE_HOOK, which pairs it with the metadata record the host resolves. + */ +template +struct Hook; + +template +struct Hook : HookImpl, R, C*, A...> {}; + +template +struct Hook : HookImpl, R, const C*, A...> {}; + +template +struct Hook : HookImpl, R, A...> {}; + +/* + * Typed base for a hook on a function by its symbol name, for targets you can't name in C++: + * file-local statics, private members, or symbols without a header. The signature is written + * free-style with the receiver first and is *not* compiler-checked. Instantiate through + * DEFINE_HOOK_SYMBOL. + */ +template +struct NamedHook; + +template +struct NamedHook : HookImpl, R, A...> {}; + +/* + * Declare a hook target. The declaration emits a metadata record that the host resolves at mod + * initialization. Every hook target must be declared. + * + * DEFINE_HOOK(&daAlink_c::execute, LinkExecute); + * DEFINE_HOOK_SYMBOL("daAlink_hookshotAtHitCallBack", + * void(fopAc_ac_c*, dCcD_GObjInf*, fopAc_ac_c*, dCcD_GObjInf*), HookshotHit); + * + * mods::hook_add_pre(svc_hook, on_link_execute); + * + * DEFINE_HOOK_SYMBOL names may be the platform mangled name (dlopen convention, no Mach-O + * leading underscore) or the demangled qualified display name; overloaded display names are + * ambiguous and need the mangled form. + */ +#define DEFINE_HOOK(target, alias) \ + [[maybe_unused]] static const void* const mod_meta_hook_##alias = \ + &::mods::detail::HookRecordFor<(target), ::mods::FixedString{#target}>::Holder::record; \ + struct alias : ::mods::Hook<(target)> { \ + static void* resolved_target() { \ + return ::mods::detail::HookRecordFor<(target), \ + ::mods::FixedString{#target}>::Holder::record.resolved; \ + } \ + } + +#define DEFINE_HOOK_SYMBOL(name, sig, alias) \ + MOD_META_RECORD static constinit auto mod_meta_hook_##alias = \ + ::mods::detail::make_hook_name_record<::mods::FixedString{name}>(); \ + struct alias : ::mods::NamedHook<::mods::FixedString{name}, sig> { \ + static void* resolved_target() { return mod_meta_hook_##alias.resolved; } \ + } + +template +ModResult hook_install(const HookService* hooks) { + if (hooks == nullptr) { + return MOD_UNAVAILABLE; + } + + Entry::hooks = hooks; + if (Entry::target == nullptr) { + void* resolved = Entry::resolved_target(); + if (resolved == nullptr) { + return MOD_UNAVAILABLE; + } + Entry::target = resolved; + } + return hooks->install(mod_ctx, Entry::target, reinterpret_cast(Entry::trampoline), + reinterpret_cast(&Entry::g_orig)); +} + +template +ModResult hook_add_pre( + const HookService* hooks, HookPreFn callback, const HookOptions* options = nullptr) { + const ModResult installed = hook_install(hooks); + if (installed != MOD_OK) { + return installed; + } + + return hooks->add_pre(mod_ctx, Entry::target, callback, options); +} + +template +ModResult hook_add_post( + const HookService* hooks, HookPostFn callback, const HookOptions* options = nullptr) { + const ModResult installed = hook_install(hooks); + if (installed != MOD_OK) { + return installed; + } + + return hooks->add_post(mod_ctx, Entry::target, callback, options); +} + +template +ModResult hook_replace( + const HookService* hooks, HookReplaceFn callback, const HookOptions* options = nullptr) { + const ModResult installed = hook_install(hooks); + if (installed != MOD_OK) { + return installed; + } + + return hooks->replace(mod_ctx, Entry::target, callback, options); +} + +} // namespace mods diff --git a/sdk/include/mods/meta.hpp b/sdk/include/mods/meta.hpp new file mode 100644 index 0000000000..023783cea1 --- /dev/null +++ b/sdk/include/mods/meta.hpp @@ -0,0 +1,285 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include + +/* + * modmeta records. Each IMPORT_SERVICE/EXPORT_SERVICE/DEFINE_HOOK use places one + * constant-initialized record object in the metadata section. + */ +#if defined(_WIN32) +#pragma section("modmeta$a", read, write) +#pragma section("modmeta$d", read, write) +#pragma section("modmeta$z", read, write) +#if defined(__clang__) +#define MOD_META_RECORD __declspec(allocate("modmeta$d")) __attribute__((used)) +#else +#define MOD_META_RECORD __declspec(allocate("modmeta$d")) +#endif +#elif defined(__APPLE__) +#define MOD_META_RECORD __attribute__((section("__DATA,__modmeta"), used)) +#elif defined(__has_attribute) && __has_attribute(retain) +#define MOD_META_RECORD __attribute__((section("modmeta"), used, retain)) +#else +#define MOD_META_RECORD __attribute__((section("modmeta"), used)) +#endif + +/* Section bounds for the mod_meta descriptor */ +#if defined(_WIN32) +#define MOD_META_BOUNDS_DEFN \ + extern "C" { \ + __declspec(allocate("modmeta$a")) constinit unsigned long long mod_meta_bounds_begin = 0; \ + __declspec(allocate("modmeta$z")) constinit unsigned long long mod_meta_bounds_end = 0; \ + } +#define MOD_META_BOUNDS_BEGIN (&mod_meta_bounds_begin) +#define MOD_META_BOUNDS_END (&mod_meta_bounds_end) +#elif defined(__APPLE__) +extern "C" const unsigned char mod_meta_bounds_begin[] __asm("section$start$__DATA$__modmeta"); +extern "C" const unsigned char mod_meta_bounds_end[] __asm("section$end$__DATA$__modmeta"); +#define MOD_META_BOUNDS_DEFN +#define MOD_META_BOUNDS_BEGIN (mod_meta_bounds_begin) +#define MOD_META_BOUNDS_END (mod_meta_bounds_end) +#else +extern "C" const unsigned char __start_modmeta[]; +extern "C" const unsigned char __stop_modmeta[]; +#define MOD_META_BOUNDS_DEFN +#define MOD_META_BOUNDS_BEGIN (__start_modmeta) +#define MOD_META_BOUNDS_END (__stop_modmeta) +#endif + +namespace mods { + +/* A string usable as a template argument: carries a symbol/target name into record builders + * and makes each hook declaration's static state unique. */ +template +struct FixedString { + char chars[N]{}; + constexpr FixedString(const char (&s)[N]) noexcept { + for (size_t i = 0; i < N; ++i) { + chars[i] = s[i]; + } + } +}; + +namespace detail { + +template +constexpr std::string_view class_name() { +#if defined(__clang__) || defined(__GNUC__) + // "... class_name() [T = daAlink_c]" / "... [with T = daAlink_c; ...]" + constexpr std::string_view fn = __PRETTY_FUNCTION__; + constexpr size_t start = fn.find("T = ") + 4; + return fn.substr(start, fn.find_first_of(";]", start) - start); +#elif defined(_MSC_VER) + // "... class_name(void)" + constexpr std::string_view fn = __FUNCSIG__; + constexpr size_t start = fn.find("class_name<") + 11; + constexpr std::string_view name = fn.substr(start, fn.rfind(">(") - start); + if constexpr (name.starts_with("class ")) { + return name.substr(6); + } else if constexpr (name.starts_with("struct ")) { + return name.substr(7); + } else { + return name; + } +#else +#error "unsupported compiler" +#endif +} + +/* The symbol name of C's vtable. Only unscoped, non-template class names are supported (an + * empty result makes hooks on virtual members of C fail resolution, which is reported). */ +template +constexpr auto vtable_symbol() { + constexpr std::string_view name = class_name(); + constexpr bool simple = name.find_first_of(":<> ") == std::string_view::npos; + // "_ZTV" + decimal length + name / "??_7" + name + "@@6B@", NUL-terminated + std::array out{}; + if constexpr (!simple) { + return out; + } + size_t n = 0; +#if defined(_WIN32) + for (char c : {'?', '?', '_', '7'}) { + out[n++] = c; + } + for (char c : name) { + out[n++] = c; + } + for (char c : {'@', '@', '6', 'B', '@'}) { + out[n++] = c; + } +#else + for (char c : {'_', 'Z', 'T', 'V'}) { + out[n++] = c; + } + size_t len = name.size(); + char digits[8]{}; + size_t d = 0; + while (len != 0) { + digits[d++] = static_cast('0' + len % 10); + len /= 10; + } + while (d != 0) { + out[n++] = digits[--d]; + } + for (char c : name) { + out[n++] = c; + } +#endif + return out; +} + +template +struct member_traits; +template +struct member_traits { + using Class = C; +}; +template +struct member_traits { + using Class = C; +}; + +consteval ModMetaServiceId make_service_id(const char* id) { + ModMetaServiceId out{}; + size_t n = 0; + for (; id[n] != '\0'; ++n) { + if (n + 1 >= MOD_META_SERVICE_ID_SIZE) { + throw "service id exceeds MOD_META_SERVICE_ID_SIZE"; + } + out.chars[n] = id[n]; + } + return out; +} + +consteval ModMetaHeader make_header() { + ModMetaHeader r{}; + r.rec = {sizeof(ModMetaHeader), MOD_META_HEADER, 0}; + r.abi_version = MOD_ABI_VERSION; + return r; +} + +/* + * Typed record variants: embedding the target as its native type makes the compiler emit the + * on-disk representation (relocations, PMF slot words) that static parsers read; the layouts + * match the byte-view structs in api.h. + */ + +template +struct HookFnRecord { + ModMetaRecord rec; + uint32_t reserved; + F target; + void* resolved; +}; + +template +struct HookMemRecord { + ModMetaRecord rec; + uint32_t reserved; + union { + F fn; + unsigned char raw[16]; + } pmf; + void* resolved; + char names[N]; +}; + +template +struct HookNameRecord { + ModMetaRecord rec; + uint32_t reserved; + void* resolved; + char name[N]; +}; + +template +constexpr size_t align_up(size_t n) { + return (n + (N - 1)) & ~(N - 1); +} + +template +struct HookMemNames { + char chars[N]{}; + size_t len{}; +}; + +template +consteval auto make_hook_mem_names() { + using C = member_traits::Class; + // Strip the leading '&' of the stringified target expression for display. + constexpr size_t dispFrom = Disp.chars[0] == '&' ? 1 : 0; + constexpr size_t dispLen = sizeof(Disp.chars) - 1 - dispFrom; + constexpr auto vtbl = vtable_symbol(); + constexpr size_t vtblLen = std::string_view{vtbl.data()}.size(); + HookMemNames(vtblLen + 1 + dispLen + 1)> r{}; + size_t at = 0; + for (size_t i = 0; i < vtblLen; ++i) { + r.chars[at++] = vtbl[i]; + } + r.chars[at++] = '\0'; + for (size_t i = 0; i < dispLen; ++i) { + r.chars[at++] = Disp.chars[dispFrom + i]; + } + r.len = sizeof(r.chars); + return r; +} + +/* + * MSVC constant-evaluates a pointer-to-member only when every other operand in the + * initializer is a literal: no consteval calls, constexpr-object copies, or default + * member initializers. + */ +template +struct HookMemHolder { + using F = decltype(Target); + static_assert(sizeof(F) <= 16, "unsupported pointer-to-member representation"); + MOD_META_RECORD static constinit inline HookMemRecord record = { + {sizeof(HookMemRecord), MOD_META_HOOK_MEM, 0}, 0, {Target}, nullptr, + {Cs...}}; +}; + +template +struct HookFnHolder { + using F = decltype(Target); + static_assert(std::is_pointer_v && std::is_function_v>, + "hook target must be a function or member function"); + MOD_META_RECORD static constinit inline HookFnRecord record = { + {sizeof(HookFnRecord), MOD_META_HOOK_FN, 0}, 0, Target, nullptr}; +}; + +template > +struct HookRecordFor { + using Holder = HookFnHolder; +}; + +template +struct HookRecordFor { + template + struct Bind; + template + struct Bind> { + using Type = HookMemHolder().chars[Is]...>; + }; + using Holder = Bind().len>>::Type; +}; + +template +consteval auto make_hook_name_record() { + constexpr size_t len = sizeof(Name.chars) - 1; + HookNameRecord(len + 1)> r{}; + r.rec = {sizeof(r), MOD_META_HOOK_NAME, 0}; + for (size_t i = 0; i < len; ++i) { + r.name[i] = Name.chars[i]; + } + return r; +} + +} // namespace detail +} // namespace mods diff --git a/sdk/include/mods/service.hpp b/sdk/include/mods/service.hpp new file mode 100644 index 0000000000..a6010a375c --- /dev/null +++ b/sdk/include/mods/service.hpp @@ -0,0 +1,95 @@ +#pragma once + +#include +#include + +#include +#include +#include + +namespace mods { + +template +struct ServiceTraits; + +inline ModResult set_error(ModError* outError, ModResult code, const char* message) { + if (outError != nullptr && outError->struct_size >= sizeof(ModError)) { + outError->code = code; + outError->message[0] = '\0'; + if (message != nullptr) { + std::snprintf(outError->message, sizeof(outError->message), "%s", message); + } + } + return code; +} + +} // namespace mods + +#define DEFINE_MOD() \ + extern "C" { \ + MOD_EXPORT ModContext* mod_ctx = nullptr; \ + } \ + MOD_META_RECORD static constinit ModMetaHeader mod_meta_header_record = \ + ::mods::detail::make_header(); \ + MOD_META_BOUNDS_DEFN \ + extern "C" { \ + MOD_EXPORT constinit const ModMeta mod_meta = { \ + sizeof(ModMeta), \ + MOD_META_BOUNDS_BEGIN, \ + MOD_META_BOUNDS_END, \ + }; \ + } + +// Declares `static const service_type* variable`, filled in by the host before mod_initialize. +// Required imports are guaranteed non-null (the mod fails to load otherwise); optional imports +// must be checked against nullptr before use. The unversioned macros use the latest minor version; +// set an explicit version to target an older minor version for backwards compatibility. +#define IMPORT_SERVICE_EX( \ + service_type, variable, service_id_value, major_value, min_minor_value, flags_value) \ + static const service_type* variable = nullptr; \ + MOD_META_RECORD static constinit ModMetaImport mod_meta_import_##variable = { \ + {sizeof(ModMetaImport), MOD_META_IMPORT, static_cast(flags_value)}, \ + static_cast(major_value), \ + static_cast(min_minor_value), \ + &(variable), \ + ::mods::detail::make_service_id(service_id_value), \ + } + +#define IMPORT_SERVICE_VERSION(service_type, variable, min_minor_value) \ + IMPORT_SERVICE_EX(service_type, variable, ::mods::ServiceTraits::id, \ + ::mods::ServiceTraits::major_version, min_minor_value, \ + SERVICE_IMPORT_REQUIRED) + +#define IMPORT_SERVICE(service_type, variable) \ + IMPORT_SERVICE_VERSION( \ + service_type, variable, ::mods::ServiceTraits::minor_version) + +#define IMPORT_OPTIONAL_SERVICE_VERSION(service_type, variable, min_minor_value) \ + IMPORT_SERVICE_EX(service_type, variable, ::mods::ServiceTraits::id, \ + ::mods::ServiceTraits::major_version, min_minor_value, \ + SERVICE_IMPORT_OPTIONAL) + +#define IMPORT_OPTIONAL_SERVICE(service_type, variable) \ + IMPORT_OPTIONAL_SERVICE_VERSION( \ + service_type, variable, ::mods::ServiceTraits::minor_version) + +#define EXPORT_SERVICE_AS(instance, service_id_value) \ + MOD_META_RECORD static constinit ModMetaExport mod_meta_export_##instance = { \ + {sizeof(ModMetaExport), MOD_META_EXPORT, SERVICE_EXPORT_STATIC}, \ + (instance).header.major_version, \ + (instance).header.minor_version, \ + &(instance), \ + ::mods::detail::make_service_id(service_id_value), \ + } + +#define EXPORT_SERVICE(instance) \ + EXPORT_SERVICE_AS(instance, ::mods::ServiceTraits>::id) + +#define EXPORT_DEFERRED_SERVICE(token, service_id_value, major_value, minor_value) \ + MOD_META_RECORD static constinit ModMetaExport mod_meta_export_##token = { \ + {sizeof(ModMetaExport), MOD_META_EXPORT, SERVICE_EXPORT_DEFERRED}, \ + static_cast(major_value), \ + static_cast(minor_value), \ + nullptr, \ + ::mods::detail::make_service_id(service_id_value), \ + } diff --git a/sdk/include/mods/svc/camera.h b/sdk/include/mods/svc/camera.h new file mode 100644 index 0000000000..f6de5b8146 --- /dev/null +++ b/sdk/include/mods/svc/camera.h @@ -0,0 +1,65 @@ +#pragma once + +#include + +#define CAMERA_SERVICE_ID "dev.twilitrealm.dusklight.camera" +#define CAMERA_SERVICE_MAJOR 1u +#define CAMERA_SERVICE_MINOR 0u + +/* + * Snapshot of a game camera for the frame currently being recorded. + * + * Matrix conventions: every matrix is a column-major float[16] using the matrix * column-vector + * convention, ready to memcpy into a WGSL mat4x4f uniform. NOTE: this is the TRANSPOSE of the + * game's row-major Mtx/Mtx44 layout; mods that want the raw game matrices should read the + * view_class directly instead. + * + * View space is right-handed with -Z forward. Projection matrices are in WebGPU clip convention + * and follow the renderer's depth mode: reversed-Z by default (depth 1.0 at the near plane, + * 0.0 at far). + * + * Unprojecting a depth-buffer texel at uv with sampled depth d: + * let ndc = vec3f(uv.x * 2.0 - 1.0, 1.0 - uv.y * 2.0, d); // WebGPU framebuffer y is down + * let world4 = world_from_proj * vec4f(ndc, 1.0); + * let world = world4.xyz / world4.w; + */ +typedef struct CameraInfo { + uint32_t struct_size; + + float view_from_world[16]; /* the view matrix */ + float world_from_view[16]; /* its inverse; column 3 is the camera position */ + float proj_from_view[16]; /* WebGPU-convention projection (+ Aurora reversed-Z) */ + float view_from_proj[16]; /* its inverse */ + float proj_from_world[16]; /* proj_from_view * view_from_world */ + float world_from_proj[16]; /* one-step depth-buffer -> world unproject */ + + float eye[3]; /* camera position in world space */ + float fovy; /* vertical field of view, degrees */ + float aspect; + float near_plane; + float far_plane; +} CameraInfo; + +#define CAMERA_INFO_INIT {sizeof(CameraInfo)} + +typedef struct CameraService { + ServiceHeader header; + + /* + * Snapshots a camera. game_view must be a view_class pointer, such as from a render stage + * callback's game view. Game thread only. Returns MOD_UNAVAILABLE when the view is not a valid + * perspective camera. + */ + ModResult (*get_camera)(ModContext* ctx, const void* game_view, CameraInfo* out_info); +} CameraService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = CAMERA_SERVICE_ID; + static constexpr uint16_t major_version = CAMERA_SERVICE_MAJOR; + static constexpr uint16_t minor_version = CAMERA_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/config.h b/sdk/include/mods/svc/config.h new file mode 100644 index 0000000000..cd4afdbbdf --- /dev/null +++ b/sdk/include/mods/svc/config.h @@ -0,0 +1,108 @@ +#pragma once + +#include + +#define CONFIG_SERVICE_ID "dev.twilitrealm.dusklight.config" +#define CONFIG_SERVICE_MAJOR 1u +#define CONFIG_SERVICE_MINOR 0u + +/* Handle for a config var registered by the calling mod. 0 is never a valid handle. */ +typedef uint64_t ConfigVarHandle; +/* Handle for a change subscription. 0 is never a valid handle. */ +typedef uint64_t ConfigSubscriptionHandle; + +typedef enum ConfigVarType { + CONFIG_VAR_BOOL = 0, /* bool */ + CONFIG_VAR_INT = 1, /* int64_t */ + CONFIG_VAR_FLOAT = 2, /* double */ + CONFIG_VAR_STRING = 3, /* UTF-8 */ +} ConfigVarType; + +typedef struct ConfigVarDesc { + uint32_t struct_size; + /* Name fragment: 1-64 characters from [A-Za-z0-9_-]. The full config key is + * "mod..", persisted in config.json alongside host settings. + * "enabled" is reserved by the loader. */ + const char* name; + ConfigVarType type; + /* Default value; only the field matching `type` is read. */ + bool default_bool; + int64_t default_int; + double default_float; + const char* default_string; /* NULL means "" */ +} ConfigVarDesc; + +#define CONFIG_VAR_DESC_INIT {sizeof(ConfigVarDesc), NULL, CONFIG_VAR_BOOL, false, 0, 0.0, NULL} + +/* Snapshot of a var's value; only the field matching `type` is meaningful. */ +typedef struct ConfigVarValue { + uint32_t struct_size; + ConfigVarType type; + bool bool_value; + int64_t int_value; + double float_value; + const char* string_value; /* NUL-terminated; NULL for non-string vars */ + size_t string_length; /* excludes the NUL */ +} ConfigVarValue; + +/* + * Fired on the game thread whenever the var's effective value changes at runtime: the calling mod's + * own set_* calls and any other runtime writer. Writes that leave the value unchanged do not fire, + * and neither do values applied from config.json or --cvar during registration. `value` holds the + * new (current) value and `previous` the one it replaced; both snapshots are valid only for the + * duration of the call (copy string_value if you need to keep it). Setting the same var from inside + * its own callback applies the write but is not re-notified. + */ +typedef void (*ConfigChangedFn)(ModContext* ctx, ConfigVarHandle var, const ConfigVarValue* value, + const ConfigVarValue* previous, void* user_data); + +/* + * Scoped configuration variables. + * + * Registrations are owned by the calling mod and removed automatically (subscriptions included) + * when it is disabled, reloaded, or fails. Values are saved to config.json. Writes are debounced, + * not flushed per set. + */ +typedef struct ConfigService { + ServiceHeader header; + + /* Register a config var. If a value for the full key was saved earlier (or set via --cvar), + * it takes effect immediately; otherwise the var starts at the default. Registering a name + * that is already live is MOD_CONFLICT. */ + ModResult (*register_var)( + ModContext* ctx, const ConfigVarDesc* desc, ConfigVarHandle* out_handle); + /* Unregister a var previously registered by the calling mod. Its persisted value is kept. */ + ModResult (*unregister_var)(ModContext* ctx, ConfigVarHandle var); + + /* Typed accessors; the type must match the registration (MOD_INVALID_ARGUMENT otherwise). */ + ModResult (*get_bool)(ModContext* ctx, ConfigVarHandle var, bool* out_value); + ModResult (*set_bool)(ModContext* ctx, ConfigVarHandle var, bool value); + ModResult (*get_int)(ModContext* ctx, ConfigVarHandle var, int64_t* out_value); + ModResult (*set_int)(ModContext* ctx, ConfigVarHandle var, int64_t value); + ModResult (*get_float)(ModContext* ctx, ConfigVarHandle var, double* out_value); + ModResult (*set_float)(ModContext* ctx, ConfigVarHandle var, double value); + /* Copies the NUL-terminated value into buffer. out_length (optional) receives the full + * length excluding the NUL regardless of buffer size; call with buffer == NULL and + * buffer_size == 0 to query the length. A non-NULL buffer that is too small fails with + * MOD_INVALID_ARGUMENT and writes nothing. */ + ModResult (*get_string)( + ModContext* ctx, ConfigVarHandle var, char* buffer, size_t buffer_size, size_t* out_length); + ModResult (*set_string)(ModContext* ctx, ConfigVarHandle var, const char* value); + + /* Subscribe to changes of a var registered by the calling mod. out_handle may be NULL if + * the subscription is never removed manually (cleanup on mod teardown is automatic). */ + ModResult (*subscribe)(ModContext* ctx, ConfigVarHandle var, ConfigChangedFn callback, + void* user_data, ConfigSubscriptionHandle* out_handle); + ModResult (*unsubscribe)(ModContext* ctx, ConfigSubscriptionHandle handle); +} ConfigService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = CONFIG_SERVICE_ID; + static constexpr uint16_t major_version = CONFIG_SERVICE_MAJOR; + static constexpr uint16_t minor_version = CONFIG_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/game.h b/sdk/include/mods/svc/game.h new file mode 100644 index 0000000000..0a3585b912 --- /dev/null +++ b/sdk/include/mods/svc/game.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +/* + * The mod SDK imports this service automatically for mods built with FEATURES game; service-only + * and asset-only mods do not require it. + * + * Major version is the game-code ABI epoch: it is bumped when game-visible struct or vtable layouts + * change incompatibly (e.g. a TARGET_PC field added to an existing game struct). The loader's + * ordinary version check then fails mods built against the old epoch with a clear message instead + * of letting them corrupt memory. + */ +#define GAME_SERVICE_ID "dev.twilitrealm.dusklight.game" +#define GAME_SERVICE_MAJOR 1u +#define GAME_SERVICE_MINOR 0u + +typedef struct GameService { + ServiceHeader header; +} GameService; + +#ifdef __cplusplus +#include + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = GAME_SERVICE_ID; + static constexpr uint16_t major_version = GAME_SERVICE_MAJOR; + static constexpr uint16_t minor_version = GAME_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/gfx.h b/sdk/include/mods/svc/gfx.h new file mode 100644 index 0000000000..03b24ed986 --- /dev/null +++ b/sdk/include/mods/svc/gfx.h @@ -0,0 +1,214 @@ +#pragma once + +#include + +#if !defined(DUSK_BUILDING_GAME) && !defined(DUSK_MOD_FEATURE_WEBGPU) +#error "mods/svc/gfx.h requires add_mod(... FEATURES webgpu)" +#endif + +#include + +/* + * Direct WebGPU access at various stages of the rendering pipeline. Mods use the wgpu* C API + * (via webgpu/webgpu.h) for custom draws and compute dispatches. + * + * Every service function must be called on the game thread. GfxStageFn callbacks run on the game + * thread during frame recording. push_draw, push_* and pass functions are valid from a stage + * callback and anywhere else GX commands are being recorded. + * + * GfxDrawFn and GfxComputeFn callbacks run on the render worker thread while the frame is encoded. + * They may use only the handles in their context struct and raw wgpu* calls; no other service may + * be called from them. + * + * All WGPU handles provided by this service are borrowed. Handles in callback contexts are valid + * only for the duration of the callback; views in GfxResolvedTargets are valid for the current + * frame only. GPU objects a mod creates through raw wgpu calls are its own responsibility and + * should be released in mod_shutdown. The device outlives all mods. + */ + +#define GFX_SERVICE_ID "dev.twilitrealm.dusklight.gfx" +#define GFX_SERVICE_MAJOR 1u +#define GFX_SERVICE_MINOR 0u + +/* Maximum size for push_draw payload */ +#define GFX_INLINE_DRAW_PAYLOAD_SIZE 128u + +/* 0 is never a valid handle. */ +typedef uint64_t GfxDrawTypeHandle; +typedef uint64_t GfxStageHookHandle; +typedef uint64_t GfxComputeTypeHandle; + +/* A suballocation in one of the shared per-frame streaming buffers. */ +typedef struct GfxRange { + uint32_t offset; + uint32_t size; +} GfxRange; + +/* + * Device and scene pass configuration. Valid from mod_initialize onward and stable for the + * session. Offscreen passes from create_pass are always single-sample. + */ +typedef struct GfxDeviceInfo { + uint32_t struct_size; + WGPUDevice device; /* borrowed */ + WGPUQueue queue; /* borrowed */ + WGPUTextureFormat color_format; /* scene color target format */ + WGPUTextureFormat depth_format; /* scene depth target format */ + uint32_t sample_count; /* scene pass MSAA sample count */ + bool uses_reversed_z; /* true means depth 1.0 is near */ +} GfxDeviceInfo; + +#define GFX_DEVICE_INFO_INIT \ + {sizeof(GfxDeviceInfo), NULL, NULL, WGPUTextureFormat_Undefined, WGPUTextureFormat_Undefined, \ + 1u, false} + +/* + * Passed to GfxDrawFn on the render worker thread; valid only during the call. The pass pipeline, + * bind group, viewport, and scissor state is restored by the host after the callback returns. + */ +typedef struct GfxDrawContext { + uint32_t struct_size; + WGPUDevice device; + WGPUQueue queue; + WGPURenderPassEncoder pass; + WGPUBuffer vertex_buffer; + WGPUBuffer index_buffer; + WGPUBuffer uniform_buffer; + WGPUBuffer storage_buffer; + WGPUTextureFormat color_format; + WGPUTextureFormat depth_format; + uint32_t sample_count; + uint32_t target_width; + uint32_t target_height; + bool uses_reversed_z; +} GfxDrawContext; + +typedef void (*GfxDrawFn)(ModContext* ctx, const GfxDrawContext* draw_ctx, const void* payload, + size_t payload_size, void* user_data); + +typedef struct GfxDrawTypeDesc { + uint32_t struct_size; + const char* label; /* optional debug label */ + GfxDrawFn draw; /* required; called from the render worker thread */ + void* user_data; +} GfxDrawTypeDesc; + +#define GFX_DRAW_TYPE_DESC_INIT {sizeof(GfxDrawTypeDesc), NULL, NULL, NULL} + +typedef enum GfxStage { + GFX_STAGE_SCENE_AFTER_TERRAIN = 0, + GFX_STAGE_FRAME_BEFORE_HUD = 1, + GFX_STAGE_FRAME_AFTER_HUD = 2, + GFX_STAGE_SCENE_BEGIN = 3, + GFX_STAGE_SCENE_AFTER_OPAQUE = 4, +} GfxStage; + +typedef struct GfxStageContext { + uint32_t struct_size; + GfxStage stage; + const void* game_view; /* view_class* for world-camera stages; NULL otherwise */ + const void* game_viewport; /* view_port_class* for world-camera stages; NULL otherwise */ +} GfxStageContext; + +typedef void (*GfxStageFn)(ModContext* ctx, const GfxStageContext* stage_ctx, void* user_data); + +typedef struct GfxStageHookDesc { + uint32_t struct_size; + GfxStageFn callback; /* required */ + void* user_data; +} GfxStageHookDesc; + +#define GFX_STAGE_HOOK_DESC_INIT {sizeof(GfxStageHookDesc), NULL, NULL} + +typedef struct GfxResolveDesc { + uint32_t struct_size; + bool color; + bool depth; +} GfxResolveDesc; + +#define GFX_RESOLVE_DESC_INIT {sizeof(GfxResolveDesc), true, false} + +typedef struct GfxResolvedTargets { + uint32_t struct_size; + WGPUTextureView color; /* single-sample snapshot in color_format */ + WGPUTextureView depth; /* single-sample raw depth snapshot, R32Float when available */ + WGPUTextureFormat color_format; + uint32_t width; + uint32_t height; +} GfxResolvedTargets; + +#define GFX_RESOLVED_TARGETS_INIT \ + {sizeof(GfxResolvedTargets), NULL, NULL, WGPUTextureFormat_Undefined, 0u, 0u} + +/* + * Passed to GfxComputeFn on the render worker thread; valid only during the call. The encoder is + * the frame command encoder between scene render passes. Leave no pass open and never finish or + * release the encoder. + */ +typedef struct GfxComputeContext { + uint32_t struct_size; + WGPUDevice device; + WGPUQueue queue; + WGPUCommandEncoder encoder; + WGPUBuffer vertex_buffer; + WGPUBuffer index_buffer; + WGPUBuffer uniform_buffer; + WGPUBuffer storage_buffer; +} GfxComputeContext; + +typedef void (*GfxComputeFn)(ModContext* ctx, const GfxComputeContext* compute_ctx, + const void* payload, size_t payload_size, void* user_data); + +typedef struct GfxComputeTypeDesc { + uint32_t struct_size; + const char* label; /* optional debug label */ + GfxComputeFn callback; /* required; called from the render worker thread */ + void* user_data; +} GfxComputeTypeDesc; + +#define GFX_COMPUTE_TYPE_DESC_INIT {sizeof(GfxComputeTypeDesc), NULL, NULL, NULL} + +typedef struct GfxService { + ServiceHeader header; + + ModResult (*get_device_info)(ModContext* ctx, GfxDeviceInfo* out_info); + void* (*get_proc_address)(ModContext* ctx, const char* name); + + ModResult (*register_draw_type)( + ModContext* ctx, const GfxDrawTypeDesc* desc, GfxDrawTypeHandle* out_handle); + ModResult (*unregister_draw_type)(ModContext* ctx, GfxDrawTypeHandle handle); + ModResult (*push_draw)( + ModContext* ctx, GfxDrawTypeHandle handle, const void* payload, size_t payload_size); + + ModResult (*register_compute_type)( + ModContext* ctx, const GfxComputeTypeDesc* desc, GfxComputeTypeHandle* out_handle); + ModResult (*unregister_compute_type)(ModContext* ctx, GfxComputeTypeHandle handle); + ModResult (*push_compute)( + ModContext* ctx, GfxComputeTypeHandle handle, const void* payload, size_t payload_size); + + ModResult (*push_verts)( + ModContext* ctx, const void* data, size_t size, size_t alignment, GfxRange* out_range); + ModResult (*push_indices)( + ModContext* ctx, const void* data, size_t size, size_t alignment, GfxRange* out_range); + ModResult (*push_uniform)(ModContext* ctx, const void* data, size_t size, GfxRange* out_range); + ModResult (*push_storage)(ModContext* ctx, const void* data, size_t size, GfxRange* out_range); + + ModResult (*register_stage_hook)(ModContext* ctx, GfxStage stage, const GfxStageHookDesc* desc, + GfxStageHookHandle* out_handle); + ModResult (*unregister_stage_hook)(ModContext* ctx, GfxStageHookHandle handle); + + ModResult (*resolve_pass)( + ModContext* ctx, const GfxResolveDesc* desc, GfxResolvedTargets* out_targets); + ModResult (*create_pass)(ModContext* ctx, uint32_t width, uint32_t height); +} GfxService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = GFX_SERVICE_ID; + static constexpr uint16_t major_version = GFX_SERVICE_MAJOR; + static constexpr uint16_t minor_version = GFX_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/hook.h b/sdk/include/mods/svc/hook.h new file mode 100644 index 0000000000..3d4e9c0472 --- /dev/null +++ b/sdk/include/mods/svc/hook.h @@ -0,0 +1,126 @@ +#pragma once + +#include + +/* + * Intercept game functions by address. Prefer the typed helpers in mods/hook.hpp + * (hook_add_pre/hook_add_post/hook_replace over a &Class::method): they generate the + * trampoline and hide install/dispatch, which are the low-level primitives those helpers + * build. resolve() maps a symbol name to an address for targets you can't name at compile time + * (file-local statics included). + * + * Every call is game-thread-only. Install and removal must run with no hooked function on the + * stack; the loader guarantees this by applying mod lifecycle changes between frames, which is + * why hooking a function that never returns (the outermost loop) makes a mod un-unloadable. + */ + +#define HOOK_SERVICE_ID "dev.twilitrealm.dusklight.hook" +#define HOOK_SERVICE_MAJOR 1u +#define HOOK_SERVICE_MINOR 0u + +/* Symbol flags reported by resolve() */ +typedef enum HookSymbolFlags { + HOOK_SYMBOL_CODE = 1u << 0u, + HOOK_SYMBOL_DATA = 1u << 1u, + /* Not exported/dynamically visible: hookable, but never linkable. */ + HOOK_SYMBOL_LOCAL = 1u << 2u, + /* Other names share this address (ICF fold/alias): a hook intercepts them all. */ + HOOK_SYMBOL_MULTI_NAME = 1u << 3u, + /* Resolved through a demangled display-name alias rather than the real symbol. */ + HOOK_SYMBOL_DISPLAY = 1u << 6u, +} HookSymbolFlags; + +/* A pre-hook's return value: whether to run the original function. */ +typedef enum HookAction { + HOOK_CONTINUE = 0, /* run the original (and any lower-priority pre-hooks) */ + HOOK_SKIP_ORIGINAL = 1, /* cancel the original and remaining pre-hooks; post-hooks still run */ +} HookAction; + +/* How replace resolves a second replace-hook on a target that already has one. */ +typedef enum HookReplacePolicy { + HOOK_REPLACE_CONFLICT = 0, /* refuse with MOD_CONFLICT (the default) */ + HOOK_REPLACE_PRIORITY = 1, /* take over only if this options.priority is strictly higher */ + HOOK_REPLACE_OVERRIDE = 2, /* take over unconditionally */ +} HookReplacePolicy; + +/* + * Hook callbacks. `args` is an array of pointers to the call's arguments (index 0 is `this` + * for member functions); `retval` points at the return slot (NULL for void). Read and write + * them through mods::arg / arg_ref from mods/hook.hpp. `userdata` is the pointer + * from HookOptions. All run on the game thread, in the hooked call's own stack frame. + */ +typedef HookAction (*HookPreFn)(ModContext* ctx, void* args, void* retval, void* userdata); +typedef void (*HookPostFn)(ModContext* ctx, void* args, void* retval, void* userdata); +typedef void (*HookReplaceFn)(ModContext* ctx, void* args, void* retval, void* userdata); + +typedef struct HookOptions { + uint32_t struct_size; + /* Higher runs first; ties break by registration order. Applies to pre/post ordering and, + * with HOOK_REPLACE_PRIORITY, to replace-hook takeover. */ + int32_t priority; + HookReplacePolicy replace_policy; + void* userdata; /* passed back to the callback */ +} HookOptions; + +#define HOOK_OPTIONS_INIT {sizeof(HookOptions), 0, HOOK_REPLACE_CONFLICT, NULL} + +typedef struct HookService { + ServiceHeader header; + + /* + * Install a trampoline detour on fn_addr and return the address to call the original through in + * *out_original_fn. The typed helpers generate the trampoline and call this; mods normally + * don't. The first mod to install a given target owns the live detour; later mods register as + * candidates so a hook survives the owner unloading (the detour is handed off and every + * original pointer is rewritten). Idempotent per (mod, out slot). + */ + ModResult (*install)( + ModContext* ctx, void* fn_addr, void* trampoline_fn, void** out_original_fn); + + /* + * Register a callback on an already-installed target. Pre runs before the original (and can + * cancel it), post runs after (even if cancelled). Any number of mods may add pre/post to the + * same target; they run in priority then registration order. replace installs a single + * substitute for the original, managed by options.replace_policy, MOD_CONFLICT if refused. + */ + ModResult (*add_pre)( + ModContext* ctx, void* fn_addr, HookPreFn callback, const HookOptions* options); + ModResult (*add_post)( + ModContext* ctx, void* fn_addr, HookPostFn callback, const HookOptions* options); + ModResult (*replace)( + ModContext* ctx, void* fn_addr, HookReplaceFn callback, const HookOptions* options); + + /* + * Run the registered callbacks for a target. The generated trampoline calls these; they + * are not a mod-facing entry point. dispatch_pre reports through *out_skip_original + * whether the original should be skipped (a pre-hook returned HOOK_SKIP_ORIGINAL, or a + * replace-hook ran). + */ + ModResult (*dispatch_pre)( + ModContext* ctx, void* fn_addr, void* args, void* retval, int* out_skip_original); + ModResult (*dispatch_post)(ModContext* ctx, void* fn_addr, void* args, void* retval); + + /* + * Resolve a game symbol by name from the symbol manifest, including non-exported (static) + * functions. Names can be either the platform's mangled name (i.e. the name passed to dlopen; + * no Mach-O leading underscore) or the qualified function name without parameters (e.g. + * "daAlink_c::execute"). out_flags (optional) receives HookSymbolFlags. + * + * Results: MOD_OK; MOD_UNSUPPORTED (no manifest for this build, missing or stale); + * MOD_UNAVAILABLE (symbol not found); MOD_CONFLICT (name maps to more than one address: C++ + * overloads or per-TU statics; use the mangled name). + */ + ModResult (*resolve)( + ModContext* ctx, const char* symbol, void** out_addr, HookSymbolFlags* out_flags); +} HookService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = HOOK_SERVICE_ID; + static constexpr uint16_t major_version = HOOK_SERVICE_MAJOR; + static constexpr uint16_t minor_version = HOOK_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/host.h b/sdk/include/mods/svc/host.h new file mode 100644 index 0000000000..9e278d5790 --- /dev/null +++ b/sdk/include/mods/svc/host.h @@ -0,0 +1,115 @@ +#pragma once + +#include + +/* + * The host service: the calling mod's identity and its runtime interface to the loader. + * Always available; every other service can be reached from it. + */ + +#define HOST_SERVICE_ID "dev.twilitrealm.dusklight.host" +#define HOST_SERVICE_MAJOR 2u +#define HOST_SERVICE_MINOR 1u + +/* + * Ignore unknown values: later service minors may add events. + */ +typedef enum ModLifecycleEvent { + /* + * The subject mod is gone: its mod_shutdown has run (when it initialized at all) and + * every service has already dropped the state it held for it. The subject's library is + * still mapped, so pointers into it are valid to compare against, but they must not be + * called or dereferenced after the callback returns. Drop everything keyed to the + * mod: callbacks it registered, its ModContext*, state indexed by it. + */ + MOD_LIFECYCLE_DETACHED = 0, +} ModLifecycleEvent; + +/* + * ctx is the watching mod's own context; subject identifies the mod the event is about. + * subject_id is valid only for the duration of the call. + */ +typedef void (*ModLifecycleFn)(ModContext* ctx, ModContext* subject, const char* subject_id, + ModLifecycleEvent event, void* user_data); + +typedef struct HostService { + ServiceHeader header; + + /* Version string of the current Dusklight build. (e.g. "1.4.2") */ + const char* version; + + /* Build id of the running game binary: PDB GUID+age on Windows, LC_UUID on macOS, GNU build-id + * on Linux. May be empty (len 0) if the identity could not be determined. */ + const uint8_t* build_id; + uint32_t build_id_len; + + /* + * Look up a service by id at call time. Unlike a manifest import, this sees whatever is + * currently published and carries no initialization-order guarantee (see mods/api.h). + * MOD_UNAVAILABLE if no matching service is published; *out_service is null on failure. + */ + ModResult (*get_service)(ModContext* ctx, const char* service_id, uint16_t major_version, + uint16_t min_minor_version, const void** out_service); + + /* + * Publish a service the calling mod declared as a deferred export in its manifest. + * Must happen during mod_initialize so importers can resolve it; `service` must stay + * valid until the mod shuts down. + */ + ModResult (*publish_service)( + ModContext* ctx, const char* service_id, uint16_t major_version, const void* service); + + /* + * Report an unrecoverable failure. The calling mod's services stop resolving immediately + * and the loader fully disables it at the next safe point; `message` is shown to the user. + * Safe to call from any mod callback. + */ + void (*fail)(ModContext* ctx, ModResult code, const char* message); + + /* + * The calling mod's manifest metadata. Returned strings remain valid while the mod is + * loaded. + */ + const char* (*mod_id)(ModContext* ctx); + const char* (*mod_name)(ModContext* ctx); + const char* (*mod_version)(ModContext* ctx); + + /* + * A writable scratch directory reserved for the calling mod. Contents survive disable + * and reload within a session, but the directory is wiped at game startup. + */ + const char* (*mod_dir)(ModContext* ctx); + + /* + * Observe other mods' lifecycle events. Any mod whose service hands out per-caller state + * (registrations, callbacks, handles) should watch for MOD_LIFECYCLE_DETACHED and drop what it + * holds for the subject. + * + * Callbacks fire on the game thread at a lifecycle safe point (never mid-frame), for + * every mod but the watcher itself (use mod_shutdown for self-cleanup). + */ + ModResult (*watch_mod_lifecycle)( + ModContext* ctx, ModLifecycleFn fn, void* user_data, uint64_t* out_handle); + ModResult (*unwatch_mod_lifecycle)(ModContext* ctx, uint64_t handle); + + /* + * Read-only directory containing this platform's packaged native runtime: the mod module + * and any RUNTIME_LIBRARIES. The path is absolute and remains valid until mod_shutdown + * returns. Libraries loaded dynamically from here are owned by the mod and must be unloaded + * during mod_shutdown. + * + * Added in minor version 1. + */ + const char* (*native_dir)(ModContext* ctx); +} HostService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = HOST_SERVICE_ID; + static constexpr uint16_t major_version = HOST_SERVICE_MAJOR; + static constexpr uint16_t minor_version = HOST_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/log.h b/sdk/include/mods/svc/log.h new file mode 100644 index 0000000000..0bb9ca74ed --- /dev/null +++ b/sdk/include/mods/svc/log.h @@ -0,0 +1,48 @@ +#pragma once + +#include + +/* + * Logging into the game's console and log files. Messages are attributed to the calling mod + * (prefixed with its ID). + */ + +#define LOG_SERVICE_ID "dev.twilitrealm.dusklight.log" +#define LOG_SERVICE_MAJOR 1u +#define LOG_SERVICE_MINOR 0u + +typedef enum LogLevel { + LOG_LEVEL_TRACE = 0, + LOG_LEVEL_DEBUG = 1, + LOG_LEVEL_INFO = 2, + LOG_LEVEL_WARN = 3, + LOG_LEVEL_ERROR = 4, +} LogLevel; + +typedef struct LogService { + ServiceHeader header; + + /* + * Write a log message at the given level. + * `message` is a plain UTF-8 string and is copied before returning. + */ + void (*write)(ModContext* ctx, LogLevel level, const char* message); + + /* Per-level shorthands for write. */ + void (*trace)(ModContext* ctx, const char* message); + void (*debug)(ModContext* ctx, const char* message); + void (*info)(ModContext* ctx, const char* message); + void (*warn)(ModContext* ctx, const char* message); + void (*error)(ModContext* ctx, const char* message); +} LogService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = LOG_SERVICE_ID; + static constexpr uint16_t major_version = LOG_SERVICE_MAJOR; + static constexpr uint16_t minor_version = LOG_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/overlay.h b/sdk/include/mods/svc/overlay.h new file mode 100644 index 0000000000..76e24c878b --- /dev/null +++ b/sdk/include/mods/svc/overlay.h @@ -0,0 +1,58 @@ +#pragma once + +#include + +#define OVERLAY_SERVICE_ID "dev.twilitrealm.dusklight.overlay" +#define OVERLAY_SERVICE_MAJOR 1u +#define OVERLAY_SERVICE_MINOR 0u + +/* Handle for a runtime overlay registration. 0 is never a valid handle. */ +typedef uint64_t OverlayHandle; + +/* + * Runtime DVD file overlays. + * + * Registrations are owned by the calling mod and removed automatically when it is disabled, + * reloaded, or fails. Changes are applied at the next frame boundary; data the game has already + * read stays in memory until it re-reads the file (sometimes on scene reload, sometimes on + * restart). + * + * disc_path names the file to overlay: absolute with a leading '/', matched against the disc + * case-insensitively (e.g. "/res/Stage/R04_00.arc"). Paths that do not exist on the disc are added + * as new files. + * + * If multiple sources overlay the same path, the last one wins: a mod's runtime registrations beat + * its static overlay/ files, and later-loaded mods beat earlier ones. + */ +typedef struct OverlayService { + ServiceHeader header; + + /* + * Overlay disc_path with a file from the calling mod's bundle (bundle-relative path, e.g. + * "res/replacement.arc"). The file's contents are read lazily on each open, so the bundle + * file must not change size while registered. + */ + ModResult (*add_file)( + ModContext* ctx, const char* disc_path, const char* bundle_path, OverlayHandle* out_handle); + + /* + * Overlay disc_path with a caller-owned buffer. The data is copied; the caller may free it + * as soon as this returns. + */ + ModResult (*add_buffer)(ModContext* ctx, const char* disc_path, const void* data, size_t size, + OverlayHandle* out_handle); + + /* Remove a runtime overlay previously added by the calling mod. */ + ModResult (*remove)(ModContext* ctx, OverlayHandle handle); +} OverlayService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = OVERLAY_SERVICE_ID; + static constexpr uint16_t major_version = OVERLAY_SERVICE_MAJOR; + static constexpr uint16_t minor_version = OVERLAY_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/resource.h b/sdk/include/mods/svc/resource.h new file mode 100644 index 0000000000..05a22754a3 --- /dev/null +++ b/sdk/include/mods/svc/resource.h @@ -0,0 +1,53 @@ +#pragma once + +#include + +/* + * Read-only access to the res/ tree of the calling mod's own bundle. Reload serves the new + * bundle's contents. For writable storage, use HostService::mod_dir. + */ + +#define RESOURCE_SERVICE_ID "dev.twilitrealm.dusklight.resource" +#define RESOURCE_SERVICE_MAJOR 1u +#define RESOURCE_SERVICE_MINOR 0u + +/* + * A loaded resource, allocated by the service. Return every successful load with free; + * buffers still live when the mod is disabled or reloaded are reclaimed with a warning. + */ +typedef struct ResourceBuffer { + uint32_t struct_size; + void* data; + size_t size; +} ResourceBuffer; + +#define RESOURCE_BUFFER_INIT {sizeof(ResourceBuffer), NULL, 0u} + +typedef struct ResourceService { + ServiceHeader header; + + /* + * Load a file into a fresh allocation. `relative_path` is resolved against the bundle's + * res/ directory. Absolute paths and ".." are rejected. MOD_UNAVAILABLE if the file does not + * exist. An empty file loads as data == NULL with size 0. Previous contents of `out_buffer` are + * overwritten, not freed. + */ + ModResult (*load)(ModContext* ctx, const char* relative_path, ResourceBuffer* out_buffer); + + /* + * Release a loaded buffer and reset it to the empty state. Safe to call on an empty or + * already-freed buffer. + */ + void (*free)(ModContext* ctx, ResourceBuffer* buffer); +} ResourceService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = RESOURCE_SERVICE_ID; + static constexpr uint16_t major_version = RESOURCE_SERVICE_MAJOR; + static constexpr uint16_t minor_version = RESOURCE_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/texture.h b/sdk/include/mods/svc/texture.h new file mode 100644 index 0000000000..cdcfbe7e2a --- /dev/null +++ b/sdk/include/mods/svc/texture.h @@ -0,0 +1,89 @@ +#pragma once + +#include + +#define TEXTURE_SERVICE_ID "dev.twilitrealm.dusklight.texture" +#define TEXTURE_SERVICE_MAJOR 1u +#define TEXTURE_SERVICE_MINOR 0u + +/* Handle for a runtime texture replacement registration. 0 is never a valid handle. */ +typedef uint64_t TextureReplacementHandle; + +typedef enum TextureKeyKind { + /* Match a texture by the address of its in-memory GX texel data. */ + TEXTURE_KEY_POINTER = 0, + /* Match by content: XXH64 of the base mip level (and of the referenced TLUT range for + * palette formats), as encoded in replacement filenames / texture dumps. */ + TEXTURE_KEY_SOURCE = 1, +} TextureKeyKind; + +/* Wildcard values for TEXTURE_KEY_SOURCE hashes ("$" in the filename convention). */ +#define TEXTURE_HASH_WILDCARD UINT64_C(0xFFFFFFFFFFFFFFFF) +#define TEXTURE_TLUT_WILDCARD UINT64_C(0xFFFFFFFFFFFFFFFE) + +typedef struct TextureKey { + uint32_t struct_size; + TextureKeyKind kind; + const void* pointer; /* TEXTURE_KEY_POINTER only */ + uint64_t texture_hash; /* TEXTURE_KEY_SOURCE */ + uint64_t tlut_hash; /* TEXTURE_KEY_SOURCE, palette formats only */ + uint32_t width; + uint32_t height; + uint32_t gx_format; + bool has_tlut; +} TextureKey; + +#define TEXTURE_KEY_INIT {sizeof(TextureKey), TEXTURE_KEY_POINTER, NULL, 0u, 0u, 0u, 0u, 0u, false} + +typedef struct TextureData { + uint32_t struct_size; + const void* data; /* texel data laid out in gx_format; copied by the service */ + size_t size; + uint32_t width; + uint32_t height; + uint32_t mip_count; + uint32_t gx_format; /* any GX texture format supported by Aurora's converter */ +} TextureData; + +#define TEXTURE_DATA_INIT {sizeof(TextureData), NULL, 0u, 0u, 0u, 1u, 0u} + +/* + * Runtime texture replacements. + * + * Registrations are owned by the calling mod and removed automatically when it is disabled, + * reloaded, or fails. When multiple sources replace the same texture, the highest priority wins: + * later-loaded mods beat earlier ones, and any mod beats the user's texture_replacements config + * directory. Files shipped in a mod's textures/ directory register automatically with the same + * ownership and priority; this service is for replacements decided at runtime. + */ +typedef struct TextureService { + ServiceHeader header; + + /* Register a replacement from raw texel data. The data is copied; the caller may free it as + * soon as this returns. */ + ModResult (*register_data)(ModContext* ctx, const TextureKey* key, const TextureData* data, + TextureReplacementHandle* out_handle); + + /* + * Register a replacement from an encoded .dds/.png inside the calling mod's bundle. The + * filename encodes the key (same convention as the texture_replacements directory, e.g. + * "tex1_{w}x{h}_{hash}_{fmt}.dds"); "_mipN" sidecars next to it are picked up automatically. + * The file is decoded lazily on first use by the renderer. + */ + ModResult (*register_file)(ModContext* ctx, const char* bundle_path, + TextureReplacementHandle* out_handle); + + /* Remove a replacement previously registered by the calling mod. */ + ModResult (*unregister)(ModContext* ctx, TextureReplacementHandle handle); +} TextureService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = TEXTURE_SERVICE_ID; + static constexpr uint16_t major_version = TEXTURE_SERVICE_MAJOR; + static constexpr uint16_t minor_version = TEXTURE_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/ui.h b/sdk/include/mods/svc/ui.h new file mode 100644 index 0000000000..e19ec65f6c --- /dev/null +++ b/sdk/include/mods/svc/ui.h @@ -0,0 +1,285 @@ +#pragma once + +#include +#include + +#define UI_SERVICE_ID "dev.twilitrealm.dusklight.ui" +#define UI_SERVICE_MAJOR 1u +#define UI_SERVICE_MINOR 0u + +/* + * UI primitives: a panel inside the host Mods window, mod-owned windows, dialogs, scoped + * RCSS stylesheets and menu bar tabs. + * + * All calls must be made on the game thread from mod callbacks (initialize, update, hooks, or UI + * callbacks). Handles are opaque, generation-checked ids; a stale or unknown handle fails with + * MOD_INVALID_ARGUMENT. Element handles die with the content that owns them: a panel or tab rebuild + * destroys the previous build's elements, so re-acquire handles inside the build callback rather + * than caching them. Strings are UTF-8 and, in both directions, only valid for the duration of the + * call. + */ + +/* 0 is never a valid handle. */ +typedef uint64_t UiWindowHandle; +typedef uint64_t UiDialogHandle; +typedef uint64_t UiElementHandle; +typedef uint64_t UiStyleHandle; +typedef uint64_t UiMenuTabHandle; + +typedef enum UiStyleScope { + UI_SCOPE_PRELAUNCH = 0, /* the pre-launch menu */ + UI_SCOPE_WINDOW = 1, /* every tabbed/small window, host and mod alike */ + UI_SCOPE_MENU_BAR = 2, /* the in-game menu bar */ + UI_SCOPE_OVERLAY = 3, /* the passive overlay (toasts, FPS counter, timers) */ + UI_SCOPE_TOUCH_CONTROLS = 4, /* touch controls and their editor */ + UI_SCOPE_GRAPHICS_TUNER = 5, /* the graphics tuner overlay window */ +} UiStyleScope; + +typedef enum UiDialogVariant { + UI_DIALOG_NORMAL = 0, + UI_DIALOG_WARNING = 1, /* warning icon by default */ + UI_DIALOG_DANGER = 2, /* red styling, error icon by default */ +} UiDialogVariant; + +typedef enum UiControlKind { + UI_CONTROL_BUTTON = 0, /* action button (on_pressed) */ + UI_CONTROL_TOGGLE = 1, /* boolean on/off */ + UI_CONTROL_NUMBER = 2, /* integer stepper with min/max/step */ + UI_CONTROL_STRING = 3, /* text input */ + UI_CONTROL_SELECT = 4, /* one of `options`; the value is the option index */ +} UiControlKind; + +typedef enum UiControlBinding { + /* Values flow through the `get`/`set` callbacks. Getters are polled every frame while the + control is visible and must be cheap. */ + UI_BINDING_CALLBACKS = 0, + /* The control reads and writes `config_var` (a ConfigService handle owned by the calling mod) + * directly: persistence, change notifications and the modified indicator (value != default) are + * wired automatically. The var type must match the control kind: TOGGLE = bool, NUMBER and + * SELECT = int, STRING = string. Float vars are not bindable; use callbacks. */ + UI_BINDING_CONFIG_VAR = 1, +} UiControlBinding; + +/* Tagged by the control's kind: TOGGLE reads bool_value, NUMBER and SELECT read int_value, STRING + * reads string_value. string_value passed to a setter is only valid during the call; a getter + * should point it at storage owned by the mod (e.g. a static buffer) that stays valid until the + * next call into the mod — the host copies it right after the getter returns. */ +typedef struct UiControlValue { + uint32_t struct_size; + bool bool_value; + int64_t int_value; + const char* string_value; +} UiControlValue; + +#define UI_CONTROL_VALUE_INIT {sizeof(UiControlValue), false, 0, NULL} + +typedef void (*UiControlGetFn)(ModContext* ctx, void* user_data, UiControlValue* out_value); +typedef void (*UiControlSetFn)(ModContext* ctx, void* user_data, const UiControlValue* value); +/* Polled every frame while the control is visible. */ +typedef bool (*UiPredicateFn)(ModContext* ctx, void* user_data); +typedef void (*UiPressedFn)(ModContext* ctx, void* user_data); + +typedef struct UiControlDesc { + uint32_t struct_size; + UiControlKind kind; + /* Row label (plain text). Required. */ + const char* label; + /* Optional RML shown as contextual help when the control is focused or hovered. Only rendered + * where a help pane exists (mod window tabs). */ + const char* help_rml; + UiControlBinding binding; /* ignored for BUTTON */ + ConfigVarHandle config_var; /* UI_BINDING_CONFIG_VAR */ + UiControlGetFn get; /* UI_BINDING_CALLBACKS (all kinds but BUTTON) */ + UiControlSetFn set; /* UI_BINDING_CALLBACKS (all kinds but BUTTON) */ + UiPressedFn on_pressed; /* BUTTON only. Required for BUTTON. */ + UiPredicateFn is_disabled; /* optional */ + /* Optional override for the modified indicator. CONFIG_VAR controls derive it from value != + * default when this is NULL. */ + UiPredicateFn is_modified; + /* Passed to every callback above. */ + void* user_data; + /* NUMBER: inclusive clamp range and step. min == max means the defaults (0 .. INT32_MAX); step + * < 1 means 1. */ + int64_t min; + int64_t max; + int64_t step; + const char* prefix; /* NUMBER: optional text before the value */ + const char* suffix; /* NUMBER: optional text after the value */ + /* SELECT: option labels (plain text). Required for SELECT. SELECT controls + * present their options in the help pane, so they are only available where + * one exists (mod window tabs); MOD_UNSUPPORTED elsewhere. */ + const char* const* options; + size_t option_count; + int32_t max_length; /* STRING: maximum input length; < 1 means unlimited */ +} UiControlDesc; + +#define UI_CONTROL_DESC_INIT \ + {sizeof(UiControlDesc), UI_CONTROL_BUTTON, NULL, NULL, UI_BINDING_CALLBACKS, 0u, NULL, NULL, \ + NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL, 0u, 0} + +/* Build the panel contents. `panel` accepts the pane_add_* functions; it and + * every element created in it are destroyed (handles invalidated) whenever the + * panel is rebuilt, e.g. on tab switches. A non-MOD_OK result fails the mod. */ +typedef ModResult (*UiPanelBuildFn)( + ModContext* ctx, UiElementHandle panel, void* user_data, ModError* out_error); +/* Called every frame while the panel is the visible tab. */ +typedef ModResult (*UiPanelUpdateFn)(ModContext* ctx, void* user_data, ModError* out_error); + +/* A panel rendered inside the calling mod's tab of the host Mods window. */ +typedef struct UiModsPanelDesc { + uint32_t struct_size; + UiPanelBuildFn build; /* required */ + UiPanelUpdateFn update; + void* user_data; +} UiModsPanelDesc; + +#define UI_MODS_PANEL_DESC_INIT {sizeof(UiModsPanelDesc), NULL, NULL, NULL} + +/* Build one tab of a mod window. `left_pane` is the interactive column, + * `right_pane` shows contextual help (controls' help_rml and SELECT options + * render there). Rebuilt on every tab activation. */ +typedef ModResult (*UiTabBuildFn)(ModContext* ctx, UiWindowHandle window, UiElementHandle left_pane, + UiElementHandle right_pane, void* user_data, ModError* out_error); + +typedef struct UiTabDesc { + uint32_t struct_size; + const char* title; /* required */ + UiTabBuildFn build; /* required */ + UiPanelUpdateFn update; + void* user_data; +} UiTabDesc; + +#define UI_TAB_DESC_INIT {sizeof(UiTabDesc), NULL, NULL, NULL, NULL} + +typedef void (*UiWindowClosedFn)(ModContext* ctx, UiWindowHandle window, void* user_data); + +typedef struct UiWindowDesc { + uint32_t struct_size; + const UiTabDesc* tabs; /* at least one */ + size_t tab_count; + /* Optional RCSS applied to this window's document only (on top of any + * UI_SCOPE_WINDOW sheets, which apply automatically). */ + const char* rcss; + /* Fired when the window is destroyed by user close or window_close. Not + * fired during owning-mod teardown/shutdown. The handle is already invalid. */ + UiWindowClosedFn on_closed; + void* user_data; +} UiWindowDesc; + +#define UI_WINDOW_DESC_INIT {sizeof(UiWindowDesc), NULL, 0u, NULL, NULL, NULL} + +typedef void (*UiDialogActionFn)(ModContext* ctx, UiDialogHandle dialog, void* user_data); + +/* Note: array element without struct_size; a future change requires appending + * a v2 desc struct rather than growing this one. */ +typedef struct UiDialogAction { + const char* label; /* required */ + UiDialogActionFn on_pressed; + void* user_data; + bool keep_open; /* false = the dialog closes after on_pressed returns */ +} UiDialogAction; + +typedef struct UiDialogDesc { + uint32_t struct_size; + const char* title; /* plain text; required */ + const char* body_rml; /* RML body; required */ + UiDialogVariant variant; + /* Optional icon name overriding the variant default: "warning", "error", + * "question-mark", "verifying", "celebration". */ + const char* icon; + const UiDialogAction* actions; /* at least one */ + size_t action_count; + /* Fired on cancel (B/Escape) before the dialog closes; the dialog always + * closes on dismiss. */ + UiDialogActionFn on_dismiss; + void* user_data; /* passed to on_dismiss */ +} UiDialogDesc; + +#define UI_DIALOG_DESC_INIT \ + {sizeof(UiDialogDesc), NULL, NULL, UI_DIALOG_NORMAL, NULL, NULL, 0u, NULL, NULL} + +/* A tab added to the in-game menu bar. */ +typedef struct UiMenuTabDesc { + uint32_t struct_size; + const char* label; /* plain text; required */ + UiPressedFn on_selected; /* fired when the user activates the tab; required */ + void* user_data; +} UiMenuTabDesc; + +#define UI_MENU_TAB_DESC_INIT {sizeof(UiMenuTabDesc), NULL, NULL, NULL} + +typedef struct UiService { + ServiceHeader header; + + /* Register or replace the panel shown in the calling mod's Mods-window tab. */ + ModResult (*register_mods_panel)(ModContext* ctx, const UiModsPanelDesc* desc); + + /* Content builders. `pane` is a panel or tab pane handle; out_elem (where + * present, optional) receives a handle for later elem_set_* updates. */ + ModResult (*pane_add_section)(ModContext* ctx, UiElementHandle pane, const char* title); + ModResult (*pane_add_text)( + ModContext* ctx, UiElementHandle pane, const char* text, UiElementHandle* out_elem); + ModResult (*pane_add_rml)( + ModContext* ctx, UiElementHandle pane, const char* rml, UiElementHandle* out_elem); + ModResult (*pane_add_progress)( + ModContext* ctx, UiElementHandle pane, float value, UiElementHandle* out_elem); + ModResult (*pane_add_control)(ModContext* ctx, UiElementHandle pane, const UiControlDesc* desc, + UiElementHandle* out_elem); + + /* Element updates. The handle kind must match the setter (text/rml on text + * rows, progress on progress bars). */ + ModResult (*elem_set_text)(ModContext* ctx, UiElementHandle elem, const char* text); + ModResult (*elem_set_rml)(ModContext* ctx, UiElementHandle elem, const char* rml); + ModResult (*elem_set_progress)(ModContext* ctx, UiElementHandle elem, float value); + /* Set or clear an RCSS class on any element handle (rows, progress bars, + * controls, panes), for styling via scoped or window RCSS. */ + ModResult (*elem_set_class)( + ModContext* ctx, UiElementHandle elem, const char* name, bool active); + + /* Push a tabbed two-pane window onto the document stack and show it. */ + ModResult (*window_push)(ModContext* ctx, const UiWindowDesc* desc, UiWindowHandle* out_window); + ModResult (*window_close)(ModContext* ctx, UiWindowHandle window); + + /* Push a modal dialog onto the document stack and show it. */ + ModResult (*dialog_push)(ModContext* ctx, const UiDialogDesc* desc, UiDialogHandle* out_dialog); + ModResult (*dialog_close)(ModContext* ctx, UiDialogHandle dialog); + ModResult (*dialog_set_body)(ModContext* ctx, UiDialogHandle dialog, const char* body_rml); + /* Replace the dialog icon ("" removes it; names as in UiDialogDesc.icon). */ + ModResult (*dialog_set_icon)(ModContext* ctx, UiDialogHandle dialog, const char* icon); + /* Append one action button (same callback rules as at push). */ + ModResult (*dialog_add_action)( + ModContext* ctx, UiDialogHandle dialog, const UiDialogAction* action); + + /* Whether any focus-stack document is currently visible (visible documents block gamepad + * input). */ + ModResult (*is_any_document_visible)(ModContext* ctx, bool* out_visible); + + /* Register an RCSS sheet applied to every document of `scope`, now and in the future, until + * unregistered or the calling mod is torn down. Sheets apply in registration order after the + * host styles. Fails with MOD_INVALID_ARGUMENT if the RCSS does not parse. */ + ModResult (*register_styles)( + ModContext* ctx, UiStyleScope scope, const char* rcss, UiStyleHandle* out_style); + /* Like register_styles, but reads the RCSS from the mod bundle's res/ directory (same path + * rules as ResourceService::load). MOD_UNAVAILABLE if the file does not exist. */ + ModResult (*register_styles_file)( + ModContext* ctx, UiStyleScope scope, const char* path, UiStyleHandle* out_style); + ModResult (*unregister_styles)(ModContext* ctx, UiStyleHandle style); + + /* Add a tab to the in-game menu bar, on_selected runs with the menu open; pushing a window from + * it stacks the window over the menu like the host tabs do. The tab is removed when + * unregistered or the mod is torn down. */ + ModResult (*register_menu_tab)( + ModContext* ctx, const UiMenuTabDesc* desc, UiMenuTabHandle* out_tab); + ModResult (*unregister_menu_tab)(ModContext* ctx, UiMenuTabHandle tab); +} UiService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = UI_SERVICE_ID; + static constexpr uint16_t major_version = UI_SERVICE_MAJOR; + static constexpr uint16_t minor_version = UI_SERVICE_MINOR; +}; +#endif diff --git a/sdk/src/game_feature.cpp b/sdk/src/game_feature.cpp new file mode 100644 index 0000000000..15fa16c443 --- /dev/null +++ b/sdk/src/game_feature.cpp @@ -0,0 +1,5 @@ +#include +#include + +// Linking the game feature makes the loader enforce the game ABI epoch. +IMPORT_SERVICE(GameService, svc_game); diff --git a/src/DynamicLink.cpp b/src/DynamicLink.cpp index dae7da52de..c1ca5b1775 100644 --- a/src/DynamicLink.cpp +++ b/src/DynamicLink.cpp @@ -142,11 +142,11 @@ DynamicModuleControl::DynamicModuleControl(char const* name) { } #endif -u32 DynamicModuleControl::sAllocBytes; +DUSK_GAME_DATA u32 DynamicModuleControl::sAllocBytes; -JKRArchive* DynamicModuleControl::sArchive; +DUSK_GAME_DATA JKRArchive* DynamicModuleControl::sArchive; -JKRFileCache* DynamicModuleControl::sFileCache; +DUSK_GAME_DATA JKRFileCache* DynamicModuleControl::sFileCache; static const char* baseString = "Base"; diff --git a/src/SSystem/SComponent/c_API.cpp b/src/SSystem/SComponent/c_API.cpp index a6ecf42d75..0db032bb8a 100644 --- a/src/SSystem/SComponent/c_API.cpp +++ b/src/SSystem/SComponent/c_API.cpp @@ -12,7 +12,7 @@ extern int mDoGph_AfterOfDraw(); extern int mDoGph_Painter(); extern int mDoGph_Create(); -cAPI_Interface g_cAPI_Interface = { +DUSK_GAME_DATA cAPI_Interface g_cAPI_Interface = { (cAPIGph_Mthd)mDoGph_Create, (cAPIGph_Mthd)mDoGph_BeforeOfDraw, (cAPIGph_Mthd)mDoGph_AfterOfDraw, diff --git a/src/SSystem/SComponent/c_angle.cpp b/src/SSystem/SComponent/c_angle.cpp index 4d04f980b2..90179b9050 100644 --- a/src/SSystem/SComponent/c_angle.cpp +++ b/src/SSystem/SComponent/c_angle.cpp @@ -7,11 +7,11 @@ extern f32 cM_atan2f(f32, f32); -const cSAngle cSAngle::_0(static_cast(0)); -const cSAngle cSAngle::_1(static_cast(0xb6)); -const cSAngle cSAngle::_90(static_cast(0x4000)); -const cSAngle cSAngle::_180(static_cast(-0x8000)); -const cSAngle cSAngle::_270(static_cast(-0x4000)); +DUSK_GAME_DATA const cSAngle cSAngle::_0(static_cast(0)); +DUSK_GAME_DATA const cSAngle cSAngle::_1(static_cast(0xb6)); +DUSK_GAME_DATA const cSAngle cSAngle::_90(static_cast(0x4000)); +DUSK_GAME_DATA const cSAngle cSAngle::_180(static_cast(-0x8000)); +DUSK_GAME_DATA const cSAngle cSAngle::_270(static_cast(-0x4000)); #ifdef __MWERKS__ cSAngle::cSAngle(const cSAngle& angle) { diff --git a/src/SSystem/SComponent/c_cc_d.cpp b/src/SSystem/SComponent/c_cc_d.cpp index 76c4920b8f..df6fa5b39c 100644 --- a/src/SSystem/SComponent/c_cc_d.cpp +++ b/src/SSystem/SComponent/c_cc_d.cpp @@ -10,7 +10,7 @@ #define CHECK_FLOAT_RANGE(line, x) JUT_ASSERT(line, -1.0e32f < x && x < 1.0e32f); -cXyz cCcD_ShapeAttr::m_virtual_center = cXyz::Zero; +DUSK_GAME_DATA cXyz cCcD_ShapeAttr::m_virtual_center = cXyz::Zero; void cCcD_DivideInfo::Set(u32 xDivInfo, u32 yDivInfo, u32 zDivInfo) { mXDivInfo = xDivInfo; diff --git a/src/SSystem/SComponent/c_counter.cpp b/src/SSystem/SComponent/c_counter.cpp index 7da967f25f..e8ec9b2aeb 100644 --- a/src/SSystem/SComponent/c_counter.cpp +++ b/src/SSystem/SComponent/c_counter.cpp @@ -5,7 +5,7 @@ #include "SSystem/SComponent/c_counter.h" -counter_class g_Counter; +DUSK_GAME_DATA counter_class g_Counter; void cCt_Counter(int resetCounter1) { if (resetCounter1 == 1) { diff --git a/src/SSystem/SComponent/c_lib.cpp b/src/SSystem/SComponent/c_lib.cpp index d73dfb8627..2b5bb6e0d8 100644 --- a/src/SSystem/SComponent/c_lib.cpp +++ b/src/SSystem/SComponent/c_lib.cpp @@ -496,7 +496,7 @@ s32 cLib_distanceAngleS(s16 x, s16 y) { static Mtx mtx[10]; -Mtx* calc_mtx = mtx; +DUSK_GAME_DATA Mtx* calc_mtx = mtx; /** * Initializes calc_mtx to mtx stack @@ -530,7 +530,7 @@ void MtxScale(f32 x_trans, f32 y_trans, f32 z_trans, u8 param_3) { * @param src The src position to be multiplied * @param dest The resulting multiplied position */ -void MtxPosition(cXyz* src, cXyz* dest) { +void MtxPosition(cXyz DUSK_CONST* src, cXyz* dest) { MTXMultVec(*calc_mtx, src, dest); } diff --git a/src/SSystem/SComponent/c_m3d.cpp b/src/SSystem/SComponent/c_m3d.cpp index c44ea66bf8..ae11a5268b 100644 --- a/src/SSystem/SComponent/c_m3d.cpp +++ b/src/SSystem/SComponent/c_m3d.cpp @@ -17,7 +17,7 @@ #define FLT_EPSILON std::numeric_limits::epsilon() #endif -const f32 G_CM3D_F_ABS_MIN = 32 * FLT_EPSILON; +DUSK_GAME_DATA const f32 G_CM3D_F_ABS_MIN = 32 * FLT_EPSILON; void cM3d_InDivPos1(const Vec* pVecA, const Vec* pVecB, f32 pF, Vec* pOut) { Vec tmp; diff --git a/src/SSystem/SComponent/c_malloc.cpp b/src/SSystem/SComponent/c_malloc.cpp index 3de7fcbf62..83956c3a79 100644 --- a/src/SSystem/SComponent/c_malloc.cpp +++ b/src/SSystem/SComponent/c_malloc.cpp @@ -6,7 +6,7 @@ #include "SSystem/SComponent/c_malloc.h" #include "JSystem/JKernel/JKRHeap.h" -JKRHeap* cMl::Heap; +DUSK_GAME_DATA JKRHeap* cMl::Heap; void cMl::init(JKRHeap* heap) { Heap = heap; diff --git a/src/SSystem/SComponent/c_sxyz.cpp b/src/SSystem/SComponent/c_sxyz.cpp index 1679155a20..6204f5f272 100644 --- a/src/SSystem/SComponent/c_sxyz.cpp +++ b/src/SSystem/SComponent/c_sxyz.cpp @@ -5,7 +5,7 @@ #include "SSystem/SComponent/c_sxyz.h" -const csXyz csXyz::Zero = csXyz(0, 0, 0); +DUSK_GAME_DATA const csXyz csXyz::Zero = csXyz(0, 0, 0); csXyz::csXyz(s16 x, s16 y, s16 z) { this->x = x; diff --git a/src/SSystem/SComponent/c_xyz.cpp b/src/SSystem/SComponent/c_xyz.cpp index be4214a874..f5b6480e62 100644 --- a/src/SSystem/SComponent/c_xyz.cpp +++ b/src/SSystem/SComponent/c_xyz.cpp @@ -137,11 +137,11 @@ s16 cXyz::atan2sY_XZ() const { return cM_atan2s(-this->y, absXZ()); } -const cXyz cXyz::Zero(0, 0, 0); -const cXyz cXyz::BaseX(1, 0, 0); -const cXyz cXyz::BaseY(0, 1, 0); -const cXyz cXyz::BaseZ(0, 0, 1); -const cXyz cXyz::BaseXY(1, 1, 0); -const cXyz cXyz::BaseXZ(1, 0, 1); -const cXyz cXyz::BaseYZ(0, 1, 1); -const cXyz cXyz::BaseXYZ(1, 1, 1); +DUSK_GAME_DATA const cXyz cXyz::Zero(0, 0, 0); +DUSK_GAME_DATA const cXyz cXyz::BaseX(1, 0, 0); +DUSK_GAME_DATA const cXyz cXyz::BaseY(0, 1, 0); +DUSK_GAME_DATA const cXyz cXyz::BaseZ(0, 0, 1); +DUSK_GAME_DATA const cXyz cXyz::BaseXY(1, 1, 0); +DUSK_GAME_DATA const cXyz cXyz::BaseXZ(1, 0, 1); +DUSK_GAME_DATA const cXyz cXyz::BaseYZ(0, 1, 1); +DUSK_GAME_DATA const cXyz cXyz::BaseXYZ(1, 1, 1); diff --git a/src/Z2AudioCS/SpkSystem.cpp b/src/Z2AudioCS/SpkSystem.cpp index ebe8c0a88c..0e91ca599c 100644 --- a/src/Z2AudioCS/SpkSystem.cpp +++ b/src/Z2AudioCS/SpkSystem.cpp @@ -1,6 +1,5 @@ #include "Z2AudioCS/SpkSystem.h" -#include "../../libs/JSystem/include/JSystem/JKernel/JKRHeap.h" #include "JSystem/JAudio2/JASGadget.h" #include "JSystem/JAudio2/JASHeapCtrl.h" #include "JSystem/JKernel/JKRHeap.h" diff --git a/src/Z2AudioLib/Z2AudioMgr.cpp b/src/Z2AudioLib/Z2AudioMgr.cpp index d6d78fb4b7..96d49af096 100644 --- a/src/Z2AudioLib/Z2AudioMgr.cpp +++ b/src/Z2AudioLib/Z2AudioMgr.cpp @@ -19,8 +19,8 @@ #include "Z2AudioCS/Z2AudioCS.h" #endif -Z2AudioMgr* Z2AudioMgr::mAudioMgrPtr; -u8 gMuffleOutOfRangeMic = false; +DUSK_GAME_DATA Z2AudioMgr* Z2AudioMgr::mAudioMgrPtr; +DUSK_GAME_DATA u8 gMuffleOutOfRangeMic = false; Z2AudioMgr::Z2AudioMgr() : mSoundStarter(true) { mAudioMgrPtr = this; diff --git a/src/Z2AudioLib/Z2Calc.cpp b/src/Z2AudioLib/Z2Calc.cpp index 0082ca0e9b..529bd7afd0 100644 --- a/src/Z2AudioLib/Z2Calc.cpp +++ b/src/Z2AudioLib/Z2Calc.cpp @@ -19,9 +19,9 @@ f32 Z2Calc::linearTransform(f32 inValue, f32 inMin, f32 inMax, f32 outMin, f32 o } } -const f32 Z2Calc::cEqualCSlope = 1.0f; +DUSK_GAME_DATA const f32 Z2Calc::cEqualCSlope = 1.0f; -const f32 Z2Calc::cEqualPSlope = 0.5f; +DUSK_GAME_DATA const f32 Z2Calc::cEqualPSlope = 0.5f; f32 Z2Calc::getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32 outMax, Z2Calc::CurveSign curveSign) { if (curveSign == Z2Calc::CURVE_POSITIVE) { diff --git a/src/Z2AudioLib/Z2Creature.cpp b/src/Z2AudioLib/Z2Creature.cpp index 7a27e9e9c4..f7d7a2924a 100644 --- a/src/Z2AudioLib/Z2Creature.cpp +++ b/src/Z2AudioLib/Z2Creature.cpp @@ -10,8 +10,8 @@ static void Z2_E_ms_modVol(Z2SoundHandlePool*, u32); static void Z2_E_mm_modPitch(Z2SoundHandlePool*, u32); static void Z2_B_zan_modPitch(Z2SoundHandlePool*, u32); -s8 data_80451358; -s8 data_80451359; +DUSK_GAME_DATA s8 data_80451358; +DUSK_GAME_DATA s8 data_80451359; static Z2EnemyArea const sAreaDefault = {true, 700, 1100, 1500}; diff --git a/src/Z2AudioLib/Z2DebugSys.cpp b/src/Z2AudioLib/Z2DebugSys.cpp index 2764365bc4..5082ff1b3a 100644 --- a/src/Z2AudioLib/Z2DebugSys.cpp +++ b/src/Z2AudioLib/Z2DebugSys.cpp @@ -121,7 +121,7 @@ JAISeqDataMgr* Z2DebugSys::initSeSeqDataMgr(const void* param_1) { u8 gMicOn = true; u8 gMicOffWhenOutOfSight = true; -extern u8 gMuffleOutOfRangeMic; +DUSK_GAME_EXTERN u8 gMuffleOutOfRangeMic; void Z2ParamNode::message(JAHControl& ctrl) { ctrl.makeComment("**** 各種パラメータ編集用ノード ****", 0, 5, 0); diff --git a/src/Z2AudioLib/Z2LinkMgr.cpp b/src/Z2AudioLib/Z2LinkMgr.cpp index 818dfe099e..c759950f0d 100644 --- a/src/Z2AudioLib/Z2LinkMgr.cpp +++ b/src/Z2AudioLib/Z2LinkMgr.cpp @@ -47,7 +47,7 @@ void Z2CreatureLink::setLinkBootsType(s32 bootsType) { } } -Z2CreatureLink* Z2CreatureLink::mLinkPtr; +DUSK_GAME_DATA Z2CreatureLink* Z2CreatureLink::mLinkPtr; Z2CreatureLink::Z2CreatureLink() { mLinkState = 0; diff --git a/src/Z2AudioLib/Z2Param.cpp b/src/Z2AudioLib/Z2Param.cpp index d081c73b07..e1915eb426 100644 --- a/src/Z2AudioLib/Z2Param.cpp +++ b/src/Z2AudioLib/Z2Param.cpp @@ -5,81 +5,81 @@ #include "Z2AudioLib/Z2Param.h" -f32 Z2Param::DISTANCE_MAX = 2000.0f; +DUSK_GAME_DATA f32 Z2Param::DISTANCE_MAX = 2000.0f; -f32 Z2Param::MAX_VOLUME_DISTANCE = 300.0f; +DUSK_GAME_DATA f32 Z2Param::MAX_VOLUME_DISTANCE = 300.0f; -f32 Z2Param::DOLBY_CENTER_VALUE = 0.3f; +DUSK_GAME_DATA f32 Z2Param::DOLBY_CENTER_VALUE = 0.3f; -f32 Z2Param::DOLBY_FLONT_DISTANCE_MAX = -300.0f; +DUSK_GAME_DATA f32 Z2Param::DOLBY_FLONT_DISTANCE_MAX = -300.0f; -f32 Z2Param::DOLBY_BEHIND_DISTANCE_MAX = 600.0f; +DUSK_GAME_DATA f32 Z2Param::DOLBY_BEHIND_DISTANCE_MAX = 600.0f; -f32 Z2Param::DISTANCE_FX_PARAM = 10.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::DISTANCE_FX_PARAM = 10.0f / 127.0f; -f32 Z2Param::SONIC_SPEED = 360.0f; +DUSK_GAME_DATA f32 Z2Param::SONIC_SPEED = 360.0f; -f32 Z2Param::VOL_BGM_DEFAULT = 1.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_BGM_DEFAULT = 1.0f; -f32 Z2Param::VOL_SE_SYSTEM_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_SYSTEM_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_VOICE_DEFAULT = 1.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_VOICE_DEFAULT = 1.0f; -f32 Z2Param::VOL_SE_LINK_MOTION_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_MOTION_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_FOOTNOTE_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_FOOTNOTE_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_CHAR_VOICE_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_CHAR_VOICE_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_CHAR_MOVE_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_CHAR_MOVE_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_OBJECT_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_OBJECT_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_ATMOSPHERE_DEFAULT = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_ATMOSPHERE_DEFAULT = 120.0f / 127.0f; -f32 Z2Param::VOL_BGM_TALKING = 0.5f; +DUSK_GAME_DATA f32 Z2Param::VOL_BGM_TALKING = 0.5f; -f32 Z2Param::VOL_SE_SYSTEM_TALKING = 112.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_SYSTEM_TALKING = 112.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_VOICE_TALKING = 104.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_VOICE_TALKING = 104.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_MOTION_TALKING = 96.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_MOTION_TALKING = 96.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_FOOTNOTE_TALKING = 96.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_FOOTNOTE_TALKING = 96.0f / 127.0f; -f32 Z2Param::VOL_SE_CHAR_VOICE_TALKING = 120.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_CHAR_VOICE_TALKING = 120.0f / 127.0f; -f32 Z2Param::VOL_SE_CHAR_MOVE_TALKING = 119.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_CHAR_MOVE_TALKING = 119.0f / 127.0f; -f32 Z2Param::VOL_SE_OBJECT_TALKING = 96.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_OBJECT_TALKING = 96.0f / 127.0f; -f32 Z2Param::VOL_SE_ATMOSPHERE_TALKING = 96.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_ATMOSPHERE_TALKING = 96.0f / 127.0f; -f32 Z2Param::VOL_BGM_PAUSING = 0.3f; +DUSK_GAME_DATA f32 Z2Param::VOL_BGM_PAUSING = 0.3f; -f32 Z2Param::VOL_SE_SYSTEM_PAUSING = 112.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_SYSTEM_PAUSING = 112.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_VOICE_PAUSING = 80.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_VOICE_PAUSING = 80.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_MOTION_PAUSING = 72.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_MOTION_PAUSING = 72.0f / 127.0f; -f32 Z2Param::VOL_SE_LINK_FOOTNOTE_PAUSING = 72.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_LINK_FOOTNOTE_PAUSING = 72.0f / 127.0f; -f32 Z2Param::VOL_SE_CHAR_VOICE_PAUSING = 72.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_CHAR_VOICE_PAUSING = 72.0f / 127.0f; -f32 Z2Param::VOL_SE_CHAR_MOVE_PAUSING = 72.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_CHAR_MOVE_PAUSING = 72.0f / 127.0f; -f32 Z2Param::VOL_SE_OBJECT_PAUSING = 72.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_OBJECT_PAUSING = 72.0f / 127.0f; -f32 Z2Param::VOL_SE_ATMOSPHERE_PAUSING = 72.0f / 127.0f; +DUSK_GAME_DATA f32 Z2Param::VOL_SE_ATMOSPHERE_PAUSING = 72.0f / 127.0f; -u8 Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME = 33; +DUSK_GAME_DATA u8 Z2Param::SCENE_CHANGE_BGM_FADEOUT_TIME = 33; -u8 Z2Param::BGM_CROSS_FADEIN_TIME = 60; +DUSK_GAME_DATA u8 Z2Param::BGM_CROSS_FADEIN_TIME = 60; -u8 Z2Param::BGM_CROSS_FADEOUT_TIME = 60; +DUSK_GAME_DATA u8 Z2Param::BGM_CROSS_FADEOUT_TIME = 60; -u8 Z2Param::BATTLE_BGM_WAIT_TIME = 30; +DUSK_GAME_DATA u8 Z2Param::BATTLE_BGM_WAIT_TIME = 30; #if DEBUG f32 Z2Param::ENEMY_NEARBY_DIST = 700.0f; @@ -87,23 +87,23 @@ f32 Z2Param::BATTLE_FADEIN_DIST = 1100.0f; f32 Z2Param::BATTLE_FADEOUT_DIST = 1500.0f; #endif -u8 Z2Param::FOUND_TRACK_FI_TIME = 20; +DUSK_GAME_DATA u8 Z2Param::FOUND_TRACK_FI_TIME = 20; -u8 Z2Param::FOUND_TRACK_FO_TIME = 30; +DUSK_GAME_DATA u8 Z2Param::FOUND_TRACK_FO_TIME = 30; -u8 Z2Param::CLOSE_BATTLE_TRACK_FI_TIME = 10; +DUSK_GAME_DATA u8 Z2Param::CLOSE_BATTLE_TRACK_FI_TIME = 10; -u8 Z2Param::CLOSE_BATTLE_TRACK_FO_TIME = 30; +DUSK_GAME_DATA u8 Z2Param::CLOSE_BATTLE_TRACK_FO_TIME = 30; -u8 Z2Param::ENDING_BLOW_VOL_DOWN_TIME = 1; +DUSK_GAME_DATA u8 Z2Param::ENDING_BLOW_VOL_DOWN_TIME = 1; -u8 Z2Param::ENDING_BLOW_VOL_LOWER_TIME = 10; +DUSK_GAME_DATA u8 Z2Param::ENDING_BLOW_VOL_LOWER_TIME = 10; -u8 Z2Param::ENDING_BLOW_VOL_LOWER_RECOVER_TIME = 30; +DUSK_GAME_DATA u8 Z2Param::ENDING_BLOW_VOL_LOWER_RECOVER_TIME = 30; -u8 Z2Param::ENDING_BLOW_MIN_FINISH_TIME = 20; +DUSK_GAME_DATA u8 Z2Param::ENDING_BLOW_MIN_FINISH_TIME = 20; -u8 data_8045086C = 1; +DUSK_GAME_DATA u8 data_8045086C = 1; #if DEBUG f32 Z2Param::AUDIBLE_DELTA_RANGE_VOLUME = 0.25f; @@ -111,12 +111,12 @@ f32 Z2Param::AUDIBLE_DELTA_RANGE_PAN = 0.15f; f32 Z2Param::AUDIBLE_DELTA_RANGE_DOLBY = 0.15f; #endif -f32 Z2Param::MIN_DISTANCE_VOLUME; +DUSK_GAME_DATA f32 Z2Param::MIN_DISTANCE_VOLUME; -f32 Z2Param::ENEMY_LASTHIT_MUTE_VOLUME; +DUSK_GAME_DATA f32 Z2Param::ENEMY_LASTHIT_MUTE_VOLUME; -u8 Z2Param::DARK_SE_FILTER_ON; +DUSK_GAME_DATA u8 Z2Param::DARK_SE_FILTER_ON; -u8 Z2Param::DARK_SE_LOW_PASS_FILTER_SETTING; +DUSK_GAME_DATA u8 Z2Param::DARK_SE_LOW_PASS_FILTER_SETTING; -u8 Z2Param::SYSTEM_SE_USE_DARK_SE_SETTING; +DUSK_GAME_DATA u8 Z2Param::SYSTEM_SE_USE_DARK_SE_SETTING; diff --git a/src/Z2AudioLib/Z2SoundInfo.cpp b/src/Z2AudioLib/Z2SoundInfo.cpp index a298213dca..cb67b4c805 100644 --- a/src/Z2AudioLib/Z2SoundInfo.cpp +++ b/src/Z2AudioLib/Z2SoundInfo.cpp @@ -8,7 +8,7 @@ #include "Z2AudioLib/Z2Calc.h" struct JAUStdSoundTableType { - static const u32 STRM_CH_SHIFT; + static DUSK_GAME_DATA const u32 STRM_CH_SHIFT; struct StringOffset { static inline const char* getString(const void* addr, u32 offset) { return (const char*)addr + offset; @@ -230,7 +230,7 @@ void Z2SoundInfo::getSeqInfo(JAISoundID soundID, JAISeq* seqPtr) const { getSoundInfo_(soundID, seqPtr); } -const u32 JAUStdSoundTableType::STRM_CH_SHIFT = 2; +DUSK_GAME_DATA const u32 JAUStdSoundTableType::STRM_CH_SHIFT = 2; void Z2SoundInfo::getStreamInfo(JAISoundID soundID, JAIStream* streamPtr) const { int numChild; diff --git a/src/Z2AudioLib/Z2SoundMgr.cpp b/src/Z2AudioLib/Z2SoundMgr.cpp index b861475118..6978a61585 100644 --- a/src/Z2AudioLib/Z2SoundMgr.cpp +++ b/src/Z2AudioLib/Z2SoundMgr.cpp @@ -183,7 +183,7 @@ bool Z2SoundMgr::startSound(JAISoundID soundID, JAISoundHandle* handle, const JG return streamMgr_.startSound(soundID, handle, posPtr); default: char error[64]; - sprintf(error, "Unknown Sound-Type id :%08x\n", (u32)soundID); + SAFE_SPRINTF(error, "Unknown Sound-Type id :%08x\n", (u32)soundID); JUT_WARN(277, "%s", error); } diff --git a/src/Z2AudioLib/Z2SoundObject.cpp b/src/Z2AudioLib/Z2SoundObject.cpp index 1c81be0f17..23e8171736 100644 --- a/src/Z2AudioLib/Z2SoundObject.cpp +++ b/src/Z2AudioLib/Z2SoundObject.cpp @@ -22,7 +22,7 @@ #include "os_report.h" Z2SoundObjBase::Z2SoundObjBase() -#if DEBUG +#if PARTIAL_DEBUG || DEBUG : JSULink(this) #endif { diff --git a/src/Z2AudioLib/Z2SpeechMgr2.cpp b/src/Z2AudioLib/Z2SpeechMgr2.cpp index 8b1402ff5b..914098fa36 100644 --- a/src/Z2AudioLib/Z2SpeechMgr2.cpp +++ b/src/Z2AudioLib/Z2SpeechMgr2.cpp @@ -19,61 +19,61 @@ struct Z2MdnPrm { u8 tailNum2; }; - static Unit const sReply[50]; - static u8 const sReplyTail[10]; + static DUSK_GAME_DATA Unit const sReply[50]; + static DUSK_GAME_DATA u8 const sReplyTail[10]; - static Unit const sJoke[50]; - static u8 const sJokeTail[10]; + static DUSK_GAME_DATA Unit const sJoke[50]; + static DUSK_GAME_DATA u8 const sJokeTail[10]; - static Unit const sSexy[50]; - static u8 const sSexyTail[10]; + static DUSK_GAME_DATA Unit const sSexy[50]; + static DUSK_GAME_DATA u8 const sSexyTail[10]; - static Unit const sRidicule[50]; - static u8 const sRidiculeTail[10]; + static DUSK_GAME_DATA Unit const sRidicule[50]; + static DUSK_GAME_DATA u8 const sRidiculeTail[10]; - static Unit const sBoring[54]; - static u8 const sBoringTail[6]; + static DUSK_GAME_DATA Unit const sBoring[54]; + static DUSK_GAME_DATA u8 const sBoringTail[6]; - static Unit const sIrritated[47]; - static u8 const sIrritatedTail[10]; + static DUSK_GAME_DATA Unit const sIrritated[47]; + static DUSK_GAME_DATA u8 const sIrritatedTail[10]; - static Unit const sOrder[57]; - static u8 const sOrderTail[6]; + static DUSK_GAME_DATA Unit const sOrder[57]; + static DUSK_GAME_DATA u8 const sOrderTail[6]; - static Unit const sResent[53]; - static u8 const sResentTail[5]; + static DUSK_GAME_DATA Unit const sResent[53]; + static DUSK_GAME_DATA u8 const sResentTail[5]; - static Unit const sCheerful[53]; - static u8 const sCheerfulTail[8]; + static DUSK_GAME_DATA Unit const sCheerful[53]; + static DUSK_GAME_DATA u8 const sCheerfulTail[8]; - static Unit const sConfused[53]; - static u8 const sConfusedTail[5]; + static DUSK_GAME_DATA Unit const sConfused[53]; + static DUSK_GAME_DATA u8 const sConfusedTail[5]; - static Unit const sHostility[52]; - static u8 const sHostilityTail[7]; + static DUSK_GAME_DATA Unit const sHostility[52]; + static DUSK_GAME_DATA u8 const sHostilityTail[7]; - static Unit const sTired[53]; - static u8 const sTiredTail[8]; + static DUSK_GAME_DATA Unit const sTired[53]; + static DUSK_GAME_DATA u8 const sTiredTail[8]; - static Unit const sSerious[53]; - static u8 const sSeriousTail[7]; + static DUSK_GAME_DATA Unit const sSerious[53]; + static DUSK_GAME_DATA u8 const sSeriousTail[7]; - static Unit const sReplyb[42]; - static u8 const sReplybTail[7]; + static DUSK_GAME_DATA Unit const sReplyb[42]; + static DUSK_GAME_DATA u8 const sReplybTail[7]; - static Unit const sApologize[50]; - static u8 const sApologizeTail[9]; + static DUSK_GAME_DATA Unit const sApologize[50]; + static DUSK_GAME_DATA u8 const sApologizeTail[9]; - static Unit const sDeside[50]; - static u8 const sDesideTail[8]; + static DUSK_GAME_DATA Unit const sDeside[50]; + static DUSK_GAME_DATA u8 const sDesideTail[8]; - static Unit const sAfford[52]; - static u8 const sAffordTail[12]; + static DUSK_GAME_DATA Unit const sAfford[52]; + static DUSK_GAME_DATA u8 const sAffordTail[12]; - static Prm const sPrm[17]; + static DUSK_GAME_DATA Prm const sPrm[17]; }; -Z2MdnPrm::Unit const Z2MdnPrm::sReply[50] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sReply[50] = { 0x6A, 0x8A, 0x50, 0x5F, 0x53, 0x37, 0x37, 0x4F, 0x4F, 0x5E, 0xAA, 0x46, 0x52, 0x5A, 0x5A, 0x4F, 0x4F, 0x45, 0x45, 0x56, 0x64, 0x79, 0x79, 0x79, 0x87, 0x95, 0x95, 0x89, 0x89, 0x4C, 0x4C, 0x4B, 0x52, 0x41, 0x41, 0x5B, 0x5F, 0x71, 0x53, 0x47, 0x89, 0x7D, 0x77, 0x88, 0x88, @@ -83,11 +83,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sReply[50] = { 0x71, 0x85, 0x85, 0xA2, 0xA2, 0x52, 0x52, 0x5C, 0x5C, 0x75, }; -u8 const Z2MdnPrm::sReplyTail[10] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sReplyTail[10] = { 0x5E, 0x7F, 0x68, 0x39, 0x56, 0x75, 0x47, 0x71, 0x7D, 0x33, }; -Z2MdnPrm::Unit const Z2MdnPrm::sJoke[50] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sJoke[50] = { 0x68, 0x57, 0x57, 0x55, 0x55, 0x51, 0x5B, 0x64, 0x6B, 0x7B, 0x7B, 0x5C, 0x77, 0x97, 0x8D, 0x97, 0x97, 0x8D, 0x66, 0x69, 0xA2, 0x5C, 0x87, 0x4F, 0x69, 0x5F, 0x5F, 0x83, 0x83, 0x82, 0x7F, 0x96, 0x96, 0xB0, 0x70, 0xA1, 0x6D, 0x6D, 0x6D, 0x59, 0x4C, 0x4B, 0x5A, 0x40, 0x4A, @@ -97,11 +97,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sJoke[50] = { 0x45, 0x45, 0x29, 0x4C, 0x4B, 0x64, 0x64, 0x60, 0x5C, 0xB1, }; -u8 const Z2MdnPrm::sJokeTail[10] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sJokeTail[10] = { 0x51, 0x97, 0x60, 0xB0, 0x6F, 0x5E, 0x5A, 0xA6, 0x4F, 0x4F, }; -Z2MdnPrm::Unit const Z2MdnPrm::sSexy[50] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sSexy[50] = { 0x5E, 0x60, 0x5F, 0x63, 0x63, 0x72, 0x72, 0x78, 0x4D, 0x7A, 0x6E, 0x6E, 0x6E, 0x6E, 0x6E, 0x59, 0x59, 0x7A, 0x7A, 0xA5, 0x90, 0x8D, 0x86, 0x62, 0x72, 0x79, 0x79, 0x86, 0x7F, 0x8B, 0x85, 0x7B, 0x7B, 0x5E, 0x5E, 0x6D, 0x6D, 0x88, 0x5F, 0xA3, 0xA3, 0x95, 0x95, 0x7F, 0x79, @@ -111,11 +111,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sSexy[50] = { 0x79, 0x65, 0x65, 0x4A, 0x5C, 0x78, 0x78, 0x8B, 0x8D, 0x7C, }; -u8 const Z2MdnPrm::sSexyTail[10] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sSexyTail[10] = { 0x52, 0x79, 0x82, 0xA5, 0x62, 0x86, 0x3F, 0x7D, 0x57, 0x7C, }; -Z2MdnPrm::Unit const Z2MdnPrm::sRidicule[50] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sRidicule[50] = { 0xA7, 0x5A, 0x5A, 0x52, 0x52, 0x85, 0x85, 0x8C, 0x63, 0x73, 0x73, 0x90, 0x50, 0x46, 0x74, 0x74, 0xA3, 0xA7, 0x41, 0x51, 0x58, 0x34, 0x34, 0x2A, 0x5A, 0x81, 0x5D, 0x42, 0x4B, 0x70, 0x70, 0xB1, 0xB1, 0xB1, 0xB1, 0x65, 0x6A, 0xB1, 0x54, 0xA8, 0xA8, 0x6B, 0x6C, 0x55, 0x55, @@ -125,11 +125,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sRidicule[50] = { 0x2D, 0x2D, 0x2D, 0x8C, 0x8C, 0x8B, 0x8B, 0x93, 0x93, 0x6E, }; -u8 const Z2MdnPrm::sRidiculeTail[10] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sRidiculeTail[10] = { 0x81, 0x67, 0x6D, 0x8C, 0x90, 0x85, 0xB1, 0x4D, 0x4F, 0x6E, }; -Z2MdnPrm::Unit const Z2MdnPrm::sBoring[54] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sBoring[54] = { 0x8E, 0x9C, 0x9C, 0x5A, 0x5A, 0x52, 0x52, 0x5B, 0x5C, 0x56, 0x5C, 0x52, 0x52, 0x2D, 0x2D, 0x5B, 0x59, 0x56, 0x56, 0x56, 0x56, 0x6B, 0x6B, 0x58, 0x4C, 0x8E, 0x8E, 0x59, 0x61, 0x54, 0xA0, 0x4D, 0x5D, 0x59, 0x48, 0x30, 0x30, 0x5B, 0x5B, 0x5B, 0x4A, 0x64, 0x64, 0x7A, 0x7A, 0x92, 0x62, 0x62, @@ -139,11 +139,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sBoring[54] = { 0x5B, 0x5E, 0x70, 0x56, 0x56, 0x4C, 0x4C, 0x59, 0x59, 0x5B, 0x5B, 0x71, }; -u8 const Z2MdnPrm::sBoringTail[6] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sBoringTail[6] = { 0x92, 0x58, 0x59, 0x5B, 0x70, 0x71, }; -Z2MdnPrm::Unit const Z2MdnPrm::sIrritated[47] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sIrritated[47] = { 0x6C, 0x91, 0x67, 0x8B, 0x8B, 0xA2, 0xA2, 0xAB, 0x48, 0x64, 0x73, 0x61, 0x61, 0x64, 0x64, 0x6D, 0x60, 0x7E, 0x4A, 0x55, 0x6A, 0x63, 0x66, 0x78, 0x5C, 0x5A, 0x6E, 0x79, 0x75, 0x62, 0x62, 0x57, 0x85, 0x3F, 0x3C, 0x83, 0x83, 0x9B, 0x78, 0x65, 0x65, 0x67, 0x65, 0x65, 0x87, 0x88, 0x88, 0x3D, @@ -152,11 +152,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sIrritated[47] = { 0xAD, 0x6E, 0x72, 0x82, 0x83, 0x87, 0x85, 0x85, 0x85, 0x8E, 0x60, 0x6D, 0x80, 0x80, }; -u8 const Z2MdnPrm::sIrritatedTail[10] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sIrritatedTail[10] = { 0x64, 0x61, 0x4E, 0x91, 0xA0, 0x85, 0x9B, 0x67, 0x6F, 0x64, }; -Z2MdnPrm::Unit const Z2MdnPrm::sOrder[57] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sOrder[57] = { 0x77, 0x5F, 0x5F, 0x73, 0x73, 0x66, 0x66, 0x6B, 0x6B, 0x7A, 0x7A, 0x60, 0x54, 0x5F, 0x5F, 0x69, 0x69, 0x5A, 0x86, 0x84, 0x84, 0x96, 0x96, 0x94, 0x94, 0x8A, 0x87, 0x84, 0x5A, 0x2C, 0x4E, 0x52, 0x52, 0x52, 0x52, 0x51, 0x51, 0x6E, 0x62, 0x5E, 0x6C, 0xA3, 0xA3, 0x5B, 0x62, @@ -167,11 +167,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sOrder[57] = { 0x48, 0x48, 0x69, 0x69, 0x6D, 0x6D, 0x94, 0x94, 0x97, }; -u8 const Z2MdnPrm::sOrderTail[6] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sOrderTail[6] = { 0x60, 0xA8, 0x5B, 0x4E, 0x5D, 0x87, }; -Z2MdnPrm::Unit const Z2MdnPrm::sResent[53] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sResent[53] = { 0x6F, 0x5F, 0x5F, 0x66, 0x66, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x4B, 0x4B, 0x6B, 0x6B, 0x86, 0x86, 0x4A, 0x4A, 0x6D, 0x6D, 0x6D, 0x6D, 0x8C, 0x8C, 0x84, 0x84, 0x64, 0x64, 0x6C, 0x6C, 0x92, 0x92, 0x6A, 0x5F, 0x6F, 0x6F, 0x62, 0x62, 0x62, 0x75, 0x5A, 0x5A, 0x5A, 0x5A, 0x60, 0x60, 0x6A, @@ -181,11 +181,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sResent[53] = { 0x5E, 0xAA, 0xAA, 0x9E, 0x9E, 0x5A, 0x5A, 0x57, 0x57, 0x57, }; -u8 const Z2MdnPrm::sResentTail[5] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sResentTail[5] = { 0x4A, 0x98, 0x8A, 0x7E, 0x57, }; -Z2MdnPrm::Unit const Z2MdnPrm::sCheerful[53] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sCheerful[53] = { 0x64, 0x6D, 0x6D, 0x6D, 0x99, 0x6D, 0x40, 0x51, 0x51, 0x6F, 0x6F, 0x66, 0x66, 0x60, 0xA7, 0xAF, 0xB3, 0x61, 0x61, 0xA7, 0xA7, 0x5E, 0x8B, 0x75, 0x77, 0x72, 0x72, 0x93, 0x93, 0x8B, 0x8B, 0x88, 0x88, 0x77, 0x77, 0x80, 0x80, 0x80, 0x80, 0x67, 0x67, 0x4D, 0x4A, 0x69, 0x44, 0xA1, 0x64, 0xA8, @@ -195,11 +195,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sCheerful[53] = { 0x65, 0x70, 0x6B, 0x6B, 0x6B, 0x6D, 0x6D, 0x57, 0x57, 0x7B, }; -u8 const Z2MdnPrm::sCheerfulTail[8] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sCheerfulTail[8] = { 0x60, 0x6D, 0x4D, 0x44, 0x9C, 0x54, 0x70, 0x7B, }; -Z2MdnPrm::Unit const Z2MdnPrm::sConfused[53] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sConfused[53] = { 0x83, 0x80, 0x80, 0x82, 0x82, 0x82, 0x82, 0x5B, 0x75, 0x84, 0x84, 0x84, 0x84, 0x75, 0x75, 0x62, 0x62, 0x62, 0x4D, 0x56, 0x56, 0x59, 0x59, 0x59, 0x59, 0x74, 0x74, 0x85, 0x7D, 0x8D, 0x8D, 0x70, 0x70, 0x5A, 0x5A, 0x6B, 0x6B, 0x6B, 0x6B, 0x70, 0x79, 0x73, 0x73, 0x71, 0x71, 0x75, 0x75, 0x7B, @@ -209,11 +209,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sConfused[53] = { 0x38, 0x38, 0x38, 0x83, 0x83, 0x8E, 0x8E, 0x4C, 0x56, 0x56, }; -u8 const Z2MdnPrm::sConfusedTail[5] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sConfusedTail[5] = { 0x2C, 0x42, 0x4C, 0x7C, 0x49, }; -Z2MdnPrm::Unit const Z2MdnPrm::sHostility[52] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sHostility[52] = { 0x85, 0x71, 0x71, 0x73, 0x73, 0x3B, 0x62, 0x84, 0x94, 0x94, 0x94, 0xAF, 0x98, 0xAD, 0xAD, 0x5A, 0x5A, 0x63, 0x63, 0x97, 0x90, 0x90, 0x7B, 0x73, 0x73, 0x63, 0x63, 0x55, 0x55, 0x65, 0x66, 0x7F, 0x7F, 0x87, 0x87, 0x8A, 0x8A, 0x94, 0x5D, 0x5C, 0x5A, 0x67, 0x67, 0x68, 0x68, @@ -223,11 +223,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sHostility[52] = { 0x62, 0x6A, 0x5F, 0x72, 0x72, 0x62, 0x62, 0x65, 0x5E, 0x69, 0x69, 0x63, 0x63, 0x7F, }; -u8 const Z2MdnPrm::sHostilityTail[7] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sHostilityTail[7] = { 0x97, 0x67, 0x94, 0x6A, 0x66, 0x4F, 0x6A, }; -Z2MdnPrm::Unit const Z2MdnPrm::sTired[53] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sTired[53] = { 0x70, 0x70, 0x70, 0x5C, 0x5C, 0x5C, 0x6F, 0x6F, 0x6F, 0x93, 0x8C, 0x9A, 0x9D, 0x89, 0x99, 0x7A, 0x91, 0x8D, 0x8D, 0x8D, 0x8D, 0x69, 0x69, 0x72, 0x72, 0x65, 0x65, 0x65, 0x9E, 0x98, 0x98, 0x2A, 0x50, 0x54, 0x54, 0x49, 0x64, 0x59, 0x59, 0x62, 0x62, 0x62, 0x44, 0x5E, 0x9F, 0x91, 0x63, 0x63, @@ -237,11 +237,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sTired[53] = { 0x84, 0x6D, 0x6D, 0x6A, 0x6A, 0x8D, 0x8D, 0x8D, 0x8D, 0x3B, }; -u8 const Z2MdnPrm::sTiredTail[8] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sTiredTail[8] = { 0x66, 0x6F, 0x3B, 0x7A, 0x49, 0x91, 0x5C, 0x6A, }; -Z2MdnPrm::Unit const Z2MdnPrm::sSerious[53] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sSerious[53] = { 0x52, 0x65, 0x65, 0x72, 0x5A, 0x61, 0x61, 0x7B, 0x80, 0x92, 0x93, 0x9D, 0x9D, 0x70, 0x79, 0x76, 0x62, 0x57, 0x5A, 0x53, 0x53, 0x59, 0x59, 0x65, 0x63, 0x60, 0x60, 0x6A, 0x83, 0x80, 0x7F, 0x5D, 0x5C, 0x45, 0x5D, 0x71, 0x72, 0x65, 0x65, 0x65, 0x66, 0x4B, 0xB2, 0x60, 0x5C, 0x5C, 0x5C, 0x5B, @@ -251,11 +251,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sSerious[53] = { 0x70, 0x60, 0x3C, 0x81, 0x81, 0x92, 0x92, 0x8E, 0x98, 0x87, }; -u8 const Z2MdnPrm::sSeriousTail[7] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sSeriousTail[7] = { 0x7B, 0x69, 0x4B, 0x61, 0x52, 0x59, 0x87, }; -Z2MdnPrm::Unit const Z2MdnPrm::sReplyb[42] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sReplyb[42] = { 0x5C, 0x45, 0x45, 0x71, 0x9F, 0x57, 0xB4, 0xB4, 0x56, 0x62, 0x8E, 0x61, 0x61, 0xB0, 0xB0, 0x3C, 0x59, 0x4A, 0x64, 0xA4, 0xA4, 0x5A, 0x5A, 0x5A, 0x5A, 0x72, 0x72, 0x4B, 0x6B, 0x97, 0x97, 0x59, 0x60, 0x60, 0x60, 0x69, 0x3E, 0x3E, 0x57, 0x42, 0x5E, 0x76, @@ -264,11 +264,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sReplyb[42] = { 0x44, 0x4F, 0x52, 0x58, 0x5A, 0x6F, 0x6E, 0x8A, 0x8E, 0x8E, 0x8E, 0x8C, 0x8C, 0x9B, }; -u8 const Z2MdnPrm::sReplybTail[7] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sReplybTail[7] = { 0x4F, 0x4A, 0xA2, 0x4F, 0x65, 0x98, 0x5C, }; -Z2MdnPrm::Unit const Z2MdnPrm::sApologize[50] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sApologize[50] = { 0x6A, 0x6A, 0x6A, 0x51, 0x51, 0x51, 0x51, 0x51, 0x51, 0x51, 0x57, 0x57, 0x57, 0x63, 0x61, 0x54, 0x54, 0x54, 0x54, 0x58, 0x58, 0x58, 0x58, 0x45, 0x45, 0x56, 0x56, 0x5B, 0x5B, 0x37, 0x53, 0x53, 0x53, 0x59, 0x59, 0x59, 0x49, 0x58, 0x58, 0x55, 0x56, 0x56, 0x83, 0x7F, 0x7F, @@ -278,11 +278,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sApologize[50] = { 0x64, 0x60, 0x61, 0x63, 0x6A, 0x62, 0x62, 0x64, 0x65, 0x71, }; -u8 const Z2MdnPrm::sApologizeTail[9] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sApologizeTail[9] = { 0x7C, 0x6E, 0x63, 0x71, 0x51, 0x37, 0x75, 0x58, 0x5C, }; -Z2MdnPrm::Unit const Z2MdnPrm::sDeside[50] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sDeside[50] = { 0x77, 0x77, 0x77, 0x58, 0x58, 0x6F, 0x78, 0x5F, 0x66, 0x5E, 0x6E, 0x62, 0x62, 0x2E, 0x5A, 0x58, 0x54, 0x52, 0x52, 0x5C, 0x59, 0x56, 0x56, 0x4B, 0x4B, 0x63, 0x63, 0x4D, 0x4E, 0x4A, 0x69, 0x71, 0x71, 0x76, 0x80, 0x80, 0x80, 0x73, 0x73, 0x5C, 0x7C, 0x64, 0x83, 0x89, 0x89, @@ -292,11 +292,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sDeside[50] = { 0x75, 0x6A, 0x66, 0x76, 0x69, 0x69, 0x69, 0x60, 0x60, 0x5F, }; -u8 const Z2MdnPrm::sDesideTail[8] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sDesideTail[8] = { 0x64, 0x2E, 0x4A, 0x57, 0x80, 0x48, 0x7C, 0x5F, }; -Z2MdnPrm::Unit const Z2MdnPrm::sAfford[52] = { +DUSK_GAME_DATA Z2MdnPrm::Unit const Z2MdnPrm::sAfford[52] = { 0x4E, 0x45, 0x52, 0x5B, 0x56, 0x5B, 0x59, 0x52, 0x52, 0x57, 0x5C, 0x50, 0x50, 0x49, 0x80, 0x6E, 0x6E, 0x5A, 0x5C, 0x60, 0x6A, 0x62, 0x62, 0x6A, 0x71, 0x48, 0x4C, 0x5B, 0x5A, 0x40, 0x40, 0x49, 0x49, 0x50, 0x51, 0x51, 0x51, 0x3A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x57, 0x57, @@ -306,11 +306,11 @@ Z2MdnPrm::Unit const Z2MdnPrm::sAfford[52] = { 0x63, 0x5D, 0x69, 0x70, 0x56, 0x50, 0x4B, 0x92, 0x86, 0x8F, 0x4B, 0x4F, 0x57, 0x56, }; -u8 const Z2MdnPrm::sAffordTail[12] = { +DUSK_GAME_DATA u8 const Z2MdnPrm::sAffordTail[12] = { 0x63, 0x8E, 0x5B, 0x59, 0x4C, 0x3A, 0x69, 0x47, 0x41, 0x59, 0x50, 0x55, }; -const Z2MdnPrm::Prm Z2MdnPrm::sPrm[17] = { +DUSK_GAME_DATA const Z2MdnPrm::Prm Z2MdnPrm::sPrm[17] = { {Z2MdnPrm::sReply, Z2MdnPrm::sReplyTail, ARRAY_SIZE(Z2MdnPrm::sReply), 6, 4}, {Z2MdnPrm::sJoke, Z2MdnPrm::sJokeTail, ARRAY_SIZE(Z2MdnPrm::sJoke), 3, 7}, {Z2MdnPrm::sSexy, Z2MdnPrm::sSexyTail, ARRAY_SIZE(Z2MdnPrm::sSexy), 3, 7}, diff --git a/src/Z2AudioLib/Z2StatusMgr.cpp b/src/Z2AudioLib/Z2StatusMgr.cpp index a044b552b6..1cd5e9cdc9 100644 --- a/src/Z2AudioLib/Z2StatusMgr.cpp +++ b/src/Z2AudioLib/Z2StatusMgr.cpp @@ -91,7 +91,7 @@ bool Z2StatusMgr::isMovieDemo() { return mDemoStatus == 2 || mDemoStatus == 8 || mDemoStatus == 9; } -void Z2StatusMgr::setDemoName(char* demoName) { +void Z2StatusMgr::setDemoName(DUSK_CONST char* demoName) { if (mDemoStatus == 11) { mDemoStatus = 0; if (Z2GetSceneMgr()->isInGame()) { diff --git a/src/c/c_damagereaction.cpp b/src/c/c_damagereaction.cpp index b8da6e4535..7b6921ca3a 100644 --- a/src/c/c_damagereaction.cpp +++ b/src/c/c_damagereaction.cpp @@ -4,15 +4,15 @@ #include "f_op/f_op_actor_mng.h" #include "d/d_s_play.h" -u8 cDmr_SkipInfo; -u8 data_80450C99; -u8 data_80450C9A; -u8 data_80450C9B; +DUSK_GAME_DATA u8 cDmr_SkipInfo; +DUSK_GAME_DATA u8 data_80450C99; +DUSK_GAME_DATA u8 data_80450C9A; +DUSK_GAME_DATA u8 data_80450C9B; -u8 data_80450C9C; -u8 data_80450C9D; -u8 data_80450C9E; -u8 cDmr_FishingWether; +DUSK_GAME_DATA u8 data_80450C9C; +DUSK_GAME_DATA u8 data_80450C9D; +DUSK_GAME_DATA u8 data_80450C9E; +DUSK_GAME_DATA u8 cDmr_FishingWether; #if DEBUG void debug_actor_create() { @@ -60,8 +60,8 @@ BOOL cDmrNowMidnaTalk() { return 0; } -u8 data_80450CA0; +DUSK_GAME_DATA u8 data_80450CA0; extern "C" { - JPTraceParticleCallBack4 JPTracePCB4; + DUSK_GAME_DATA JPTraceParticleCallBack4 JPTracePCB4; } diff --git a/src/d/actor/d_a_L7demo_dr.cpp b/src/d/actor/d_a_L7demo_dr.cpp index 468675cd09..47b46284eb 100644 --- a/src/d/actor/d_a_L7demo_dr.cpp +++ b/src/d/actor/d_a_L7demo_dr.cpp @@ -399,7 +399,7 @@ static int daDr_Create(daDr_c* i_this) { return i_this->create(); } -static actor_method_class l_daDr_Method = { +static DUSK_CONST actor_method_class l_daDr_Method = { (process_method_func)daDr_Create, (process_method_func)daDr_Delete, (process_method_func)daDr_Execute, @@ -407,7 +407,7 @@ static actor_method_class l_daDr_Method = { (process_method_func)daDr_Draw, }; -actor_process_profile_definition g_profile_DR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_L7low_dr.cpp b/src/d/actor/d_a_L7low_dr.cpp index 6afb2e63e9..863c030bd8 100644 --- a/src/d/actor/d_a_L7low_dr.cpp +++ b/src/d/actor/d_a_L7low_dr.cpp @@ -189,7 +189,7 @@ static int daL7lowDr_IsDelete(daL7lowDr_c* i_this) { return 1; } -static actor_method_class l_daL7lowDr_Method = { +static DUSK_CONST actor_method_class l_daL7lowDr_Method = { (process_method_func)daL7lowDr_Create, (process_method_func)daL7lowDr_Delete, (process_method_func)daL7lowDr_Execute, @@ -197,7 +197,7 @@ static actor_method_class l_daL7lowDr_Method = { (process_method_func)daL7lowDr_Draw, }; -actor_process_profile_definition g_profile_L7lowDr = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_L7lowDr = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_L7op_demo_dr.cpp b/src/d/actor/d_a_L7op_demo_dr.cpp index 7881507271..3b3cb0a2db 100644 --- a/src/d/actor/d_a_L7op_demo_dr.cpp +++ b/src/d/actor/d_a_L7op_demo_dr.cpp @@ -835,7 +835,7 @@ static int daL7ODR_Create(daL7ODR_c* i_this) { return i_this->create(); } -static actor_method_class l_daL7ODR_Method = { +static DUSK_CONST actor_method_class l_daL7ODR_Method = { (process_method_func)daL7ODR_Create, (process_method_func)daL7ODR_Delete, (process_method_func)daL7ODR_Execute, @@ -843,7 +843,7 @@ static actor_method_class l_daL7ODR_Method = { (process_method_func)daL7ODR_Draw, }; -actor_process_profile_definition g_profile_L7ODR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_L7ODR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 8c82b5dc6c..45829188db 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -57,6 +57,7 @@ #include "dusk/settings.h" #include "res/Object/Alink.h" #include +#include #endif static int daAlink_Create(fopAc_ac_c* i_this); @@ -112,31 +113,31 @@ static void daAlink_coHitCallback(fopAc_ac_c* i_coActorA, dCcD_GObjInf* i_coObjI static_cast(i_coActorA)->coHitCallback(i_coActorB, i_coObjInfA); } -static cXyz l_waitBaseAnime(1.24279f, 102.00054f, 5.0f); +static DUSK_CONSTEXPR cXyz l_waitBaseAnime(1.24279f, 102.00054f, 5.0f); -static cXyz l_ironBallBaseAnime(-4.248938f, 89.0f, -5.267045f); +static DUSK_CONSTEXPR cXyz l_ironBallBaseAnime(-4.248938f, 89.0f, -5.267045f); -static cXyz l_halfAtnWaitBaseAnime(3.5f, 97.0f, -7.0f); +static DUSK_CONSTEXPR cXyz l_halfAtnWaitBaseAnime(3.5f, 97.0f, -7.0f); -static cXyz l_rWaitBaseAnime(4.313951f, 93.94436f, -5.207283f); +static DUSK_CONSTEXPR cXyz l_rWaitBaseAnime(4.313951f, 93.94436f, -5.207283f); -static cXyz l_lWaitBaseAnime(-4.300988f, 93.95595f, -5.218504f); +static DUSK_CONSTEXPR cXyz l_lWaitBaseAnime(-4.300988f, 93.95595f, -5.218504f); -static cXyz l_horseBaseAnime(-l_waitBaseAnime.x, 225.7f, 1.81f - l_waitBaseAnime.z); +static DUSK_CONSTEXPR cXyz l_horseBaseAnime(-l_waitBaseAnime.x, 225.7f, 1.81f - l_waitBaseAnime.z); -static cXyz l_boarBaseAnime(-l_waitBaseAnime.x, 186.17f, -20.29f - l_waitBaseAnime.z); +static DUSK_CONSTEXPR cXyz l_boarBaseAnime(-l_waitBaseAnime.x, 186.17f, -20.29f - l_waitBaseAnime.z); -static cXyz l_localHorseRidePos(-68.208984f, 41.609924f, 0.883789f); +static DUSK_CONSTEXPR cXyz l_localHorseRidePos(-68.208984f, 41.609924f, 0.883789f); -static cXyz l_localBoarRidePos(0.0f, 15.0f, 0.0f); +static DUSK_CONSTEXPR cXyz l_localBoarRidePos(0.0f, 15.0f, 0.0f); -static cXyz l_canoeBaseAnime(1.24279f - l_waitBaseAnime.x, 56.0f, -72.0f - l_waitBaseAnime.z); +static DUSK_CONSTEXPR cXyz l_canoeBaseAnime(1.24279f - l_waitBaseAnime.x, 56.0f, -72.0f - l_waitBaseAnime.z); -static cXyz l_sumouBaseAnimeSp(0.0f, 0.0f, 32.0f - l_waitBaseAnime.z); +static DUSK_CONSTEXPR cXyz l_sumouBaseAnimeSp(0.0f, 0.0f, 32.0f - l_waitBaseAnime.z); -static cXyz l_wolfBaseAnime(1.0f, 88.63934f, -28.497932f); +static cXyz DUSK_CONST l_wolfBaseAnime(1.0f, 88.63934f, -28.497932f); -static cXyz l_wolfRopeBaseAnime(0.115164f, 68.336296f, -7.667817f); +static cXyz DUSK_CONST l_wolfRopeBaseAnime(0.115164f, 68.336296f, -7.667817f); static void dummy_lit_3757() { Vec temp = { 0.0f, 0.0f, 0.0f }; @@ -216,7 +217,7 @@ static s16 const l_insectNameList[12] = { f32 l_jumpTop; #endif -daAlink_BckData const daAlink_c::m_mainBckShield[20] = { +DUSK_GAME_DATA daAlink_BckData const daAlink_c::m_mainBckShield[20] = { {dRes_ID_ALANM_BCK_ATRFWS_e, dRes_ID_ALANM_BCK_ATRFWS_e}, {dRes_ID_ALANM_BCK_ATRFDS_e, dRes_ID_ALANM_BCK_ATRFDS_e}, {dRes_ID_ALANM_BCK_ATBW_e, dRes_ID_ALANM_BCK_ATLS_e}, @@ -239,7 +240,7 @@ daAlink_BckData const daAlink_c::m_mainBckShield[20] = { {dRes_ID_ALANM_BCK_DASHS_e, dRes_ID_ALANM_BCK_ATLS_e}, }; -daAlink_BckData const daAlink_c::m_mainBckSword[5] = { +DUSK_GAME_DATA daAlink_BckData const daAlink_c::m_mainBckSword[5] = { {dRes_ID_ALANM_BCK_ATL_e, dRes_ID_ALANM_BCK_ATL_e}, {dRes_ID_ALANM_BCK_ATR_e, dRes_ID_ALANM_BCK_ATR_e}, {dRes_ID_ALANM_BCK_WALKS_e, dRes_ID_ALANM_BCK_WALKS_e}, @@ -247,7 +248,7 @@ daAlink_BckData const daAlink_c::m_mainBckSword[5] = { {dRes_ID_ALANM_BCK_SWIMWAIT_e, dRes_ID_ALANM_BCK_SWIMWAITS_e}, }; -daAlink_BckData const daAlink_c::m_mainBckFishing[28] = { +DUSK_GAME_DATA daAlink_BckData const daAlink_c::m_mainBckFishing[28] = { {dRes_ID_ALANM_BCK_ATRFWS_e, dRes_ID_ALANM_BCK_WALKFISHR_e}, {dRes_ID_ALANM_BCK_ATRFDS_e, dRes_ID_ALANM_BCK_DASHFISHR_e}, {dRes_ID_ALANM_BCK_ATBW_e, dRes_ID_ALANM_BCK_WALKFISHR_e}, @@ -278,7 +279,7 @@ daAlink_BckData const daAlink_c::m_mainBckFishing[28] = { {dRes_ID_ALANM_BCK_WAITBTOA_e, dRes_ID_ALANM_BCK_WALKFISHR_e}, }; -daAlink_AnmData const daAlink_c::m_anmDataTable[daAlink_c::ANM_MAX] = { +DUSK_GAME_DATA daAlink_AnmData const daAlink_c::m_anmDataTable[daAlink_c::ANM_MAX] = { {dRes_ID_ALANM_BCK_ATRFWS_e, dRes_ID_ALANM_BCK_ATRFW_e, 0xFE, 0xFE, FTANM_0, dRes_ID_ALANM_BCK_FAT_e, 0x0}, {dRes_ID_ALANM_BCK_ATRFDS_e, dRes_ID_ALANM_BCK_ATRFD_e, 0xFE, 0xFE, FTANM_0, dRes_ID_ALANM_BCK_FAT_e, 0x0}, {dRes_ID_ALANM_BCK_ATBW_e, dRes_ID_ALANM_BCK_ATBW_e, 0xFE, 0xFE, FTANM_0, dRes_ID_ALANM_BCK_FAT_e, 0x0}, @@ -695,7 +696,7 @@ daAlink_AnmData const daAlink_c::m_anmDataTable[daAlink_c::ANM_MAX] = { {dRes_ID_ALANM_BCK_ASHIMOTO_e, dRes_ID_ALANM_BCK_ASHIMOTO_e, 0xFE, 0xFE, FTANM_ASHIMOTO, dRes_ID_ALANM_BCK_FASHIMOTO_e, 0x0}, }; -daAlink_WlAnmData const daAlink_c::m_wlAnmDataTable[daAlink_c::WANM_MAX] = { +DUSK_GAME_DATA daAlink_WlAnmData const daAlink_c::m_wlAnmDataTable[daAlink_c::WANM_MAX] = { {dRes_ID_ALANM_BCK_WL_WAITA_e, 0x0, 0x1, 10, 40, -1, -1}, {dRes_ID_ALANM_BCK_WL_WALKA_e, 0x0, 0x2, 1, 14, -1, -1}, {dRes_ID_ALANM_BCK_WL_WALKB_e, 0x0, 0x2, 1, 14, -1, -1}, @@ -845,7 +846,7 @@ daAlink_WlAnmData const daAlink_c::m_wlAnmDataTable[daAlink_c::WANM_MAX] = { {0x802B, 0xC, 0xC, -1, -1, -1, -1}, }; -daAlink_FaceTexData const daAlink_c::m_faceTexDataTable[] = { +DUSK_GAME_DATA daAlink_FaceTexData const daAlink_c::m_faceTexDataTable[] = { {dRes_ID_ALANM_BTP_FMABA01_e, dRes_ID_ALANM_BTK_FMABA01_e}, {dRes_ID_ALANM_BTP_FMABA02_e, dRes_ID_ALANM_BTK_FMABA02_e}, {dRes_ID_ALANM_BTP_FMABA03_e, dRes_ID_ALANM_BTK_FMABA03_e}, @@ -1011,7 +1012,7 @@ daAlink_FaceTexData const daAlink_c::m_faceTexDataTable[] = { {dRes_ID_ALANM_BTP_WL_FC_e, dRes_ID_ALANM_BTK_WL_FA_e}, }; -const daAlink_procInitTable daAlink_c::m_procInitTable[] = { +DUSK_GAME_DATA const daAlink_procInitTable daAlink_c::m_procInitTable[] = { { &daAlink_c::procPreActionUnequip, 0x21 }, { &daAlink_c::procServiceWait, 0x10000085 }, { &daAlink_c::procTiredWait, 0x10001185 }, @@ -1366,7 +1367,7 @@ const daAlink_procInitTable daAlink_c::m_procInitTable[] = { { &daAlink_c::procDemoCommon, 0x1 }, }; -daAlink_procFunc daAlink_c::m_demoInitTable[] = { +DUSK_GAME_DATA daAlink_procFunc daAlink_c::m_demoInitTable[] = { NULL, NULL, NULL, @@ -2002,9 +2003,9 @@ daAlinkHIO_cut_c::~daAlinkHIO_cut_c() {} daAlinkHIO_c::~daAlinkHIO_c() {} -bool daAlink_matAnm_c::m_eye_move_flg; +DUSK_GAME_DATA bool daAlink_matAnm_c::m_eye_move_flg; -u8 daAlink_matAnm_c::m_morf_frame; +DUSK_GAME_DATA u8 daAlink_matAnm_c::m_morf_frame; void daAlink_matAnm_c::init() { field_0xf4 = 0.0f; @@ -5990,7 +5991,7 @@ void daAlink_c::setItemMatrix(int param_0) { mDoMtx_stack_c::XrotS(-0x8000); #ifdef TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { Mtx boot_mtx; mDoMtx_concat(mpLinkModel->getAnmMtx(0x18), mDoMtx_stack_c::get(), boot_mtx); mpLinkBootModels[1]->setAnmMtx(1, boot_mtx); @@ -12733,7 +12734,19 @@ void daAlink_c::setMagicArmorBrk(int i_status) { BOOL daAlink_c::checkMagicArmorHeavy() const { #if TARGET_PC - return checkMagicArmorWearAbility() && (dComIfGs_getRupee() == 0 && !dusk::getSettings().game.freeMagicArmor); + if(!checkMagicArmorWearAbility()) { + return false; + } + + switch(dusk::getSettings().game.armorRupeeDrain) { + case dusk::MagicArmorMode::NORMAL: + return dComIfGs_getRupee() == 0; + case dusk::MagicArmorMode::ON_DAMAGE: + case dusk::MagicArmorMode::DOUBLE_DEFENSE: + case dusk::MagicArmorMode::INVINCIBLE: + case dusk::MagicArmorMode::COSMETIC: + return false; + } #else return checkMagicArmorWearAbility() && dComIfGs_getRupee() == 0; #endif @@ -14795,6 +14808,8 @@ void daAlink_c::deleteEquipItem(BOOL i_isPlaySound, BOOL i_isDeleteKantera) { #if TARGET_PC mIBChainInterpPrevValid = false; mIBChainInterpCurrValid = false; + mHsChainInterpPrevValid = false; + mHsChainInterpCurrValid = false; #endif field_0x0774 = NULL; field_0x0778 = NULL; @@ -18706,7 +18721,7 @@ int daAlink_c::execute() { #if TARGET_PC // This handles rupee drain and transitions between rupees/no rupees // We can skip all of that if the magic armor doesn't use rupees - if (!dusk::getSettings().game.freeMagicArmor && checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) { + if (dusk::getSettings().game.armorRupeeDrain.getValue() == dusk::MagicArmorMode::NORMAL && checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) { #else if (checkMagicArmorWearAbility() && mClothesChangeWaitTimer == 0) { #endif @@ -19767,23 +19782,37 @@ int daAlink_c::draw() { dComIfGd_getOpaListDark()->entryImm(mpHookChain, 0); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation && - mEquipItem == dItemNo_IRONBALL_e && - mIronBallChainPos != NULL && mIronBallChainAngle != NULL) - { - if (mIBChainInterpCurrValid) { - memcpy(mIBChainInterpPrevPos, mIBChainInterpCurrPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz)); - memcpy(mIBChainInterpPrevAngle, mIBChainInterpCurrAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz)); - mIBChainInterpPrevHandRoot = mIBChainInterpCurrHandRoot; - mIBChainInterpPrevValid = true; + if (dusk::frame_interp::is_enabled()) { + if (mEquipItem == dItemNo_IRONBALL_e && + mIronBallChainPos != NULL && mIronBallChainAngle != NULL) + { + if (mIBChainInterpCurrValid) { + memcpy(mIBChainInterpPrevPos, mIBChainInterpCurrPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz)); + memcpy(mIBChainInterpPrevAngle, mIBChainInterpCurrAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz)); + mIBChainInterpPrevHandRoot = mIBChainInterpCurrHandRoot; + mIBChainInterpPrevValid = true; + } + + memcpy(mIBChainInterpCurrPos, mIronBallChainPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz)); + memcpy(mIBChainInterpCurrAngle, mIronBallChainAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz)); + mIBChainInterpCurrHandRoot = mHookshotTopPos; + mIBChainInterpCurrValid = true; + + dusk::frame_interp::add_interpolation_callback(&ironBallChainInterpCallback, this); + } else { + if (mHsChainInterpCurrValid) { + mHsChainInterpPrevTop = mHsChainInterpCurrTop; + mHsChainInterpPrevRoot = mHsChainInterpCurrRoot; + mHsChainInterpPrevSubRoot = mHsChainInterpCurrSubRoot; + mHsChainInterpPrevSubTop = mHsChainInterpCurrSubTop; + mHsChainInterpPrevValid = true; + } + mHsChainInterpCurrTop = mHookshotTopPos; + mHsChainInterpCurrRoot = mHeldItemRootPos; + mHsChainInterpCurrSubRoot = field_0x3810; + mHsChainInterpCurrSubTop = mIronBallBgChkPos; + mHsChainInterpCurrValid = true; } - - memcpy(mIBChainInterpCurrPos, mIronBallChainPos, IRON_BALL_CHAIN_COUNT * sizeof(cXyz)); - memcpy(mIBChainInterpCurrAngle, mIronBallChainAngle, IRON_BALL_CHAIN_COUNT * sizeof(csXyz)); - mIBChainInterpCurrHandRoot = mHookshotTopPos; - mIBChainInterpCurrValid = true; - - dusk::frame_interp::add_interpolation_callback(&ironBallChainInterpCallback, this); } #endif } @@ -19889,13 +19918,13 @@ static int daAlink_Delete(daAlink_c* i_this) { } } -static actor_method_class l_daAlink_Method = { +static DUSK_CONST actor_method_class l_daAlink_Method = { (process_method_func)daAlink_Create, (process_method_func)daAlink_Delete, (process_method_func)daAlink_Execute, (process_method_func)NULL, (process_method_func)daAlink_Draw, }; -actor_process_profile_definition g_profile_ALINK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ALINK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 5, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_alink_HIO_data.inc b/src/d/actor/d_a_alink_HIO_data.inc index feb49c6d3d..86b9519657 100644 --- a/src/d/actor/d_a_alink_HIO_data.inc +++ b/src/d/actor/d_a_alink_HIO_data.inc @@ -1,7 +1,7 @@ #include "d/actor/d_a_alink.h" // clang-format off -const daAlinkHIO_basic_c1 daAlinkHIO_basic_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_basic_c1 daAlinkHIO_basic_c0::m = { false, 20000, -10000, @@ -30,7 +30,7 @@ const daAlinkHIO_basic_c1 daAlinkHIO_basic_c0::m = { 5000.0f, }; -const daAlinkHIO_move_c1 daAlinkHIO_move_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_move_c1 daAlinkHIO_move_c0::m = { { 11, 0.7f, @@ -58,7 +58,7 @@ const daAlinkHIO_move_c1 daAlinkHIO_move_c0::m = { 0.4f, }; -const daAlinkHIO_atnMove_c1 daAlinkHIO_atnMove_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_atnMove_c1 daAlinkHIO_atnMove_c0::m = { 3000, 2000, 6, @@ -83,7 +83,7 @@ const daAlinkHIO_atnMove_c1 daAlinkHIO_atnMove_c0::m = { 1.3f, }; -const daAlinkHIO_noActAtnMove_c1 daAlinkHIO_noActAtnMove_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_noActAtnMove_c1 daAlinkHIO_noActAtnMove_c0::m = { 3000, 2000, 6, @@ -108,7 +108,7 @@ const daAlinkHIO_noActAtnMove_c1 daAlinkHIO_noActAtnMove_c0::m = { 2.3f, }; -const daAlinkHIO_frontRoll_c1 daAlinkHIO_frontRoll_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_frontRoll_c1 daAlinkHIO_frontRoll_c0::m = { { 29, 1.1f, @@ -147,7 +147,7 @@ const daAlinkHIO_frontRoll_c1 daAlinkHIO_frontRoll_c0::m = { 60.0f, }; -const daAlinkHIO_backJump_c1 daAlinkHIO_backJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_backJump_c1 daAlinkHIO_backJump_c0::m = { { 9, 0.7f, @@ -168,7 +168,7 @@ const daAlinkHIO_backJump_c1 daAlinkHIO_backJump_c0::m = { 10.0f, }; -const daAlinkHIO_sideStep_c1 daAlinkHIO_sideStep_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_sideStep_c1 daAlinkHIO_sideStep_c0::m = { { 5, 1.1f, @@ -205,7 +205,7 @@ const daAlinkHIO_sideStep_c1 daAlinkHIO_sideStep_c0::m = { 10.0f, }; -const daAlinkHIO_slide_c1 daAlinkHIO_slide_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_slide_c1 daAlinkHIO_slide_c0::m = { { 14, 0.75f, @@ -248,7 +248,7 @@ const daAlinkHIO_slide_c1 daAlinkHIO_slide_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmV_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmV_c0::m = { { 27, 1.2f, @@ -264,7 +264,7 @@ const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmV_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmL_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmL_c0::m = { { 27, 1.2f, @@ -280,7 +280,7 @@ const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmL_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmR_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmR_c0::m = { { 27, 1.2f, @@ -296,7 +296,7 @@ const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmR_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmSL_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmSL_c0::m = { { 31, 1.1f, @@ -312,7 +312,7 @@ const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmSL_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmSR_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmSR_c0::m = { { 27, 1.1f, @@ -328,7 +328,7 @@ const daAlinkHIO_cutNormal_c1 daAlinkHIO_cutNmSR_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnL_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnL_c0::m = { { 29, 1.0f, @@ -348,7 +348,7 @@ const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnL_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnV_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnV_c0::m = { { 33, 1.0f, @@ -368,7 +368,7 @@ const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnV_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnS_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnS_c0::m = { { 31, 1.1f, @@ -388,7 +388,7 @@ const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnS_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnSl_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnSl_c0::m = { { 33, 0.9f, @@ -408,7 +408,7 @@ const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnSl_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnSm_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnSm_c0::m = { { 31, 0.9f, @@ -427,7 +427,7 @@ const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnSm_c0::m = { #pragma pop #pragma push -const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnR_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnR_c0::m = { { 34, 1.1f, @@ -445,7 +445,7 @@ const daAlinkHIO_cutFinish_c1 daAlinkHIO_cutFnR_c0::m = { }; #pragma pop -const daAlinkHIO_cutFnJU_c1 daAlinkHIO_cutFnJU_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutFnJU_c1 daAlinkHIO_cutFnJU_c0::m = { { 19, 1.0f, @@ -474,7 +474,7 @@ const daAlinkHIO_cutFnJU_c1 daAlinkHIO_cutFnJU_c0::m = { 80.0f, }; -const daAlinkHIO_cutJump_c1 daAlinkHIO_cutJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutJump_c1 daAlinkHIO_cutJump_c0::m = { { 17, 1.1f, @@ -498,7 +498,7 @@ const daAlinkHIO_cutJump_c1 daAlinkHIO_cutJump_c0::m = { 3.0f, }; -const daAlinkHIO_cutTurn_c1 daAlinkHIO_cutTurn_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutTurn_c1 daAlinkHIO_cutTurn_c0::m = { { 47, 1.0f, @@ -548,7 +548,7 @@ const daAlinkHIO_cutTurn_c1 daAlinkHIO_cutTurn_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutLA_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutLA_c0::m = { { 21, 0.9f, @@ -564,7 +564,7 @@ const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutLA_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutLB_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutLB_c0::m = { { 24, 0.9f, @@ -580,7 +580,7 @@ const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutLB_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutRA_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutRA_c0::m = { { 24, 0.95f, @@ -596,7 +596,7 @@ const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutRA_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutRB_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutRB_c0::m = { { 11, 0.9f, @@ -610,7 +610,7 @@ const daAlinkHIO_hoCut_c1 daAlinkHIO_hoCutRB_c0::m = { }; #pragma pop -const daAlinkHIO_hoCutCharge_c1 daAlinkHIO_hoCutCharge_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_hoCutCharge_c1 daAlinkHIO_hoCutCharge_c0::m = { { 6, 0.45f, @@ -643,7 +643,7 @@ const daAlinkHIO_hoCutCharge_c1 daAlinkHIO_hoCutCharge_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaL_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaL_c0::m = { { 12, 0.8f, @@ -658,7 +658,7 @@ const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaL_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaR_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaR_c0::m = { { 14, 1.0f, @@ -673,7 +673,7 @@ const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaR_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaCharge_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaCharge_c0::m = { { 14, 1.0f, @@ -686,7 +686,7 @@ const daAlinkHIO_cutDash_c1 daAlinkHIO_cutDaCharge_c0::m = { }; #pragma pop -const daAlinkHIO_cutDown_c1 daAlinkHIO_cutDown_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutDown_c1 daAlinkHIO_cutDown_c0::m = { { 8, 1.0f, @@ -729,7 +729,7 @@ const daAlinkHIO_cutDown_c1 daAlinkHIO_cutDown_c0::m = { 10.0f, }; -const daAlinkHIO_cutHead_c1 daAlinkHIO_cutHead_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutHead_c1 daAlinkHIO_cutHead_c0::m = { { 8, 0.9f, @@ -762,7 +762,7 @@ const daAlinkHIO_cutHead_c1 daAlinkHIO_cutHead_c0::m = { 1.6f, }; -const daAlinkHIO_cutLargeJump_c1 daAlinkHIO_cutLargeJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cutLargeJump_c1 daAlinkHIO_cutLargeJump_c0::m = { { 29, 1.3f, @@ -802,7 +802,7 @@ const daAlinkHIO_cutLargeJump_c1 daAlinkHIO_cutLargeJump_c0::m = { 5.0f, }; -const daAlinkHIO_cut_c1 daAlinkHIO_cut_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_cut_c1 daAlinkHIO_cut_c0::m = { { 18, -1.100f, @@ -857,7 +857,7 @@ const daAlinkHIO_cut_c1 daAlinkHIO_cut_c0::m = { 0.0f, }; -const daAlinkHIO_guardAttack_c1 daAlinkHIO_gAtPush_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_guardAttack_c1 daAlinkHIO_gAtPush_c0::m = { { 14, 1.0f, @@ -873,7 +873,7 @@ const daAlinkHIO_guardAttack_c1 daAlinkHIO_gAtPush_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_guardAttack_c1 daAlinkHIO_gAtKick_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_guardAttack_c1 daAlinkHIO_gAtKick_c0::m = { { 21, 1.2f, @@ -888,7 +888,7 @@ const daAlinkHIO_guardAttack_c1 daAlinkHIO_gAtKick_c0::m = { }; #pragma pop -const daAlinkHIO_turnMove_c1 daAlinkHIO_turnMove_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_turnMove_c1 daAlinkHIO_turnMove_c0::m = { { 27, 1.0f, @@ -906,7 +906,7 @@ const daAlinkHIO_turnMove_c1 daAlinkHIO_turnMove_c0::m = { 25.0f, }; -const daAlinkHIO_guard_c1 daAlinkHIO_guard_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_guard_c1 daAlinkHIO_guard_c0::m = { { 11, 1.0f, @@ -951,7 +951,7 @@ const daAlinkHIO_guard_c1 daAlinkHIO_guard_c0::m = { 18.0f, }; -const daAlinkHIO_crouch_c1 daAlinkHIO_crouch_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_crouch_c1 daAlinkHIO_crouch_c0::m = { { 9, 1.0f, @@ -978,7 +978,7 @@ const daAlinkHIO_crouch_c1 daAlinkHIO_crouch_c0::m = { 5.0f, }; -const daAlinkHIO_autoJump_c1 daAlinkHIO_autoJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_autoJump_c1 daAlinkHIO_autoJump_c0::m = { { 6, 1.2f, @@ -1036,7 +1036,7 @@ const daAlinkHIO_autoJump_c1 daAlinkHIO_autoJump_c0::m = { 23.0f, }; -const daAlinkHIO_smallJump_c1 daAlinkHIO_smallJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_smallJump_c1 daAlinkHIO_smallJump_c0::m = { { 8, 0.6f, @@ -1063,7 +1063,7 @@ const daAlinkHIO_smallJump_c1 daAlinkHIO_smallJump_c0::m = { 7.0f, }; -const daAlinkHIO_wallCatch_c1 daAlinkHIO_wallCatch_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wallCatch_c1 daAlinkHIO_wallCatch_c0::m = { { 19, 1.0f, @@ -1095,7 +1095,7 @@ const daAlinkHIO_wallCatch_c1 daAlinkHIO_wallCatch_c0::m = { 4.0f, }; -const daAlinkHIO_wallFall_c1 daAlinkHIO_wallFall_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wallFall_c1 daAlinkHIO_wallFall_c0::m = { { 22, 0.8f, @@ -1112,7 +1112,7 @@ const daAlinkHIO_wallFall_c1 daAlinkHIO_wallFall_c0::m = { }, }; -const daAlinkHIO_wallMove_c1 daAlinkHIO_wallMove_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wallMove_c1 daAlinkHIO_wallMove_c0::m = { 0.8f, 1.1f, 3.0f, @@ -1120,7 +1120,7 @@ const daAlinkHIO_wallMove_c1 daAlinkHIO_wallMove_c0::m = { 3.0f, }; -const daAlinkHIO_wallHang_c1 daAlinkHIO_wallHang_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wallHang_c1 daAlinkHIO_wallHang_c0::m = { 2, 3, 50.0f, @@ -1131,7 +1131,7 @@ const daAlinkHIO_wallHang_c1 daAlinkHIO_wallHang_c0::m = { 200.0f, }; -const daAlinkHIO_pushpull_c1 daAlinkHIO_pushpull_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_pushpull_c1 daAlinkHIO_pushpull_c0::m = { 0, 120, 7, @@ -1153,7 +1153,7 @@ const daAlinkHIO_pushpull_c1 daAlinkHIO_pushpull_c0::m = { 0.75f, }; -const daAlinkHIO_damNormal_c1 daAlinkHIO_damNormal_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damNormal_c1 daAlinkHIO_damNormal_c0::m = { { 22, 2.3f, @@ -1190,7 +1190,7 @@ const daAlinkHIO_damNormal_c1 daAlinkHIO_damNormal_c0::m = { 0.5f, }; -const daAlinkHIO_damLaHu_c1 daAlinkHIO_damLarge_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damLaHu_c1 daAlinkHIO_damLarge_c0::m = { { 49, 0.8f, @@ -1256,7 +1256,7 @@ const daAlinkHIO_damLaHu_c1 daAlinkHIO_damLarge_c0::m = { 0.5f, }; -const daAlinkHIO_damLaHu_c1 daAlinkHIO_damHuge_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damLaHu_c1 daAlinkHIO_damHuge_c0::m = { { 49, 0.8f, @@ -1322,7 +1322,7 @@ const daAlinkHIO_damLaHu_c1 daAlinkHIO_damHuge_c0::m = { 0.5f, }; -const daAlinkHIO_damHorse_c1 daAlinkHIO_damHorse_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damHorse_c1 daAlinkHIO_damHorse_c0::m = { { 9, 2.0f, @@ -1341,7 +1341,7 @@ const daAlinkHIO_damHorse_c1 daAlinkHIO_damHorse_c0::m = { 5000, }; -const daAlinkHIO_damFall_c1 daAlinkHIO_damFall_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damFall_c1 daAlinkHIO_damFall_c0::m = { { 11, 1.2f, @@ -1367,7 +1367,7 @@ const daAlinkHIO_damFall_c1 daAlinkHIO_damFall_c0::m = { 15.0f, }; -const daAlinkHIO_damCaught_c1 daAlinkHIO_damCaught_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damCaught_c1 daAlinkHIO_damCaught_c0::m = { { 59, 1.5f, @@ -1382,7 +1382,7 @@ const daAlinkHIO_damCaught_c1 daAlinkHIO_damCaught_c0::m = { 1.3f, }; -const daAlinkHIO_damSwim_c1 daAlinkHIO_damSwim_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damSwim_c1 daAlinkHIO_damSwim_c0::m = { { 22, 1.2f, @@ -1433,7 +1433,7 @@ const daAlinkHIO_damSwim_c1 daAlinkHIO_damSwim_c0::m = { 15.0f, }; -const daAlinkHIO_damage_c1 daAlinkHIO_damage_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_damage_c1 daAlinkHIO_damage_c0::m = { { 14, 1.0f, @@ -1471,7 +1471,7 @@ const daAlinkHIO_damage_c1 daAlinkHIO_damage_c0::m = { 35.0f, }; -const daAlinkHIO_horse_c1 daAlinkHIO_horse_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_horse_c1 daAlinkHIO_horse_c0::m = { { 18, 1.2f, @@ -1512,7 +1512,7 @@ const daAlinkHIO_horse_c1 daAlinkHIO_horse_c0::m = { 5.0f, }; -const daAlinkHIO_canoe_c1 daAlinkHIO_canoe_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_canoe_c1 daAlinkHIO_canoe_c0::m = { { 23, 1.3f, @@ -1536,7 +1536,7 @@ const daAlinkHIO_canoe_c1 daAlinkHIO_canoe_c0::m = { 0.2f, }; -const daAlinkHIO_bow_c1 daAlinkHIO_bow_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_bow_c1 daAlinkHIO_bow_c0::m = { { 9, 1.0f, @@ -1572,7 +1572,7 @@ const daAlinkHIO_bow_c1 daAlinkHIO_bow_c0::m = { 800.0f, }; -const daAlinkHIO_boom_c1 daAlinkHIO_boom_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_boom_c1 daAlinkHIO_boom_c0::m = { { 21, 0.9f, @@ -1599,7 +1599,7 @@ const daAlinkHIO_boom_c1 daAlinkHIO_boom_c0::m = { 40.0f, }; -const daAlinkHIO_bomb_c1 daAlinkHIO_bomb_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_bomb_c1 daAlinkHIO_bomb_c0::m = { 160, 50, 50, @@ -1624,7 +1624,7 @@ const daAlinkHIO_bomb_c1 daAlinkHIO_bomb_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_huLight_c1 daAlinkHIO_huLight_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_huLight_c1 daAlinkHIO_huLight_c0::m = { 0, 3, 0, @@ -1639,7 +1639,7 @@ const daAlinkHIO_huLight_c1 daAlinkHIO_huLight_c0::m = { }; #pragma pop -const daAlinkHIO_kandelaar_c1 daAlinkHIO_kandelaar_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_kandelaar_c1 daAlinkHIO_kandelaar_c0::m = { { 30, 1.1f, @@ -1672,7 +1672,7 @@ const daAlinkHIO_kandelaar_c1 daAlinkHIO_kandelaar_c0::m = { 0.5f, }; -const daAlinkHIO_fmChain_c1 daAlinkHIO_fmChain_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_fmChain_c1 daAlinkHIO_fmChain_c0::m = { { 20, 1.2f, @@ -1689,7 +1689,7 @@ const daAlinkHIO_fmChain_c1 daAlinkHIO_fmChain_c0::m = { }, }; -const daAlinkHIO_magneBoots_c1 daAlinkHIO_magneBoots_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_magneBoots_c1 daAlinkHIO_magneBoots_c0::m = { { 29, 1.1f, @@ -1713,7 +1713,7 @@ const daAlinkHIO_magneBoots_c1 daAlinkHIO_magneBoots_c0::m = { 0.7f, }; -const daAlinkHIO_pickUp_c1 daAlinkHIO_pickUp_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_pickUp_c1 daAlinkHIO_pickUp_c0::m = { { 18, 0.9f, @@ -1732,7 +1732,7 @@ const daAlinkHIO_pickUp_c1 daAlinkHIO_pickUp_c0::m = { 30.0f, }; -const daAlinkHIO_board_c1 daAlinkHIO_board_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_board_c1 daAlinkHIO_board_c0::m = { { 9, 2.5f, @@ -1782,7 +1782,7 @@ const daAlinkHIO_board_c1 daAlinkHIO_board_c0::m = { 50.0f, }; -const daAlinkHIO_bottle_c1 daAlinkHIO_bottle_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_bottle_c1 daAlinkHIO_bottle_c0::m = { { 56, 1.15f, @@ -1848,7 +1848,7 @@ const daAlinkHIO_bottle_c1 daAlinkHIO_bottle_c0::m = { }, }; -const daAlinkHIO_hookshot_c1 daAlinkHIO_hookshot_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_hookshot_c1 daAlinkHIO_hookshot_c0::m = { { 12, 1.0f, @@ -1885,7 +1885,7 @@ const daAlinkHIO_hookshot_c1 daAlinkHIO_hookshot_c0::m = { 90.0f, }; -const daAlinkHIO_spinner_c1 daAlinkHIO_spinner_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_spinner_c1 daAlinkHIO_spinner_c0::m = { { 21, 0.8f, @@ -1908,7 +1908,7 @@ const daAlinkHIO_spinner_c1 daAlinkHIO_spinner_c0::m = { 60.0f, }; -const daAlinkHIO_ironBall_c1 daAlinkHIO_ironBall_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_ironBall_c1 daAlinkHIO_ironBall_c0::m = { { 19, 1.1f, @@ -1949,7 +1949,7 @@ const daAlinkHIO_ironBall_c1 daAlinkHIO_ironBall_c0::m = { 0.5f, }; -const daAlinkHIO_copyRod_c1 daAlinkHIO_copyRod_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_copyRod_c1 daAlinkHIO_copyRod_c0::m = { 19, 1.0f, 0.0f, @@ -1966,7 +1966,7 @@ const daAlinkHIO_copyRod_c1 daAlinkHIO_copyRod_c0::m = { 2000.0f, }; -const daAlinkHIO_zwLight_c1 daAlinkHIO_zwLight_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_zwLight_c1 daAlinkHIO_zwLight_c0::m = { 771, 0, 182, @@ -1979,7 +1979,7 @@ const daAlinkHIO_zwLight_c1 daAlinkHIO_zwLight_c0::m = { 0.0f, }; -const daAlinkHIO_item_c1 daAlinkHIO_item_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_item_c1 daAlinkHIO_item_c0::m = { { 12, 1.0f, @@ -2003,7 +2003,7 @@ const daAlinkHIO_item_c1 daAlinkHIO_item_c0::m = { 1.3f, }; -const daAlinkHIO_ladder_c1 daAlinkHIO_ladder_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_ladder_c1 daAlinkHIO_ladder_c0::m = { { 13, 0.8f, @@ -2038,7 +2038,7 @@ const daAlinkHIO_ladder_c1 daAlinkHIO_ladder_c0::m = { 80.0f, }; -const daAlinkHIO_roofHang_c1 daAlinkHIO_roofHang_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_roofHang_c1 daAlinkHIO_roofHang_c0::m = { { 34, 1.0f, @@ -2063,7 +2063,7 @@ const daAlinkHIO_roofHang_c1 daAlinkHIO_roofHang_c0::m = { 3.0f, }; -const daAlinkHIO_grab_c1 daAlinkHIO_grab_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_grab_c1 daAlinkHIO_grab_c0::m = { { 4, 0.9f, @@ -2146,7 +2146,7 @@ const daAlinkHIO_grab_c1 daAlinkHIO_grab_c0::m = { 0.55f, }; -const daAlinkHIO_swim_c1 daAlinkHIO_swim_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_swim_c1 daAlinkHIO_swim_c0::m = { { 25, 1.0f, @@ -2224,7 +2224,7 @@ const daAlinkHIO_swim_c1 daAlinkHIO_swim_c0::m = { 1.3f, }; -const daAlinkHIO_wlMove_c1 daAlinkHIO_wlMove_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlMove_c1 daAlinkHIO_wlMove_c0::m = { { 14, 1.0f, @@ -2303,7 +2303,7 @@ const daAlinkHIO_wlMove_c1 daAlinkHIO_wlMove_c0::m = { 0.5f, }; -const daAlinkHIO_wlMoveNoP_c1 daAlinkHIO_wlMoveNoP_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlMoveNoP_c1 daAlinkHIO_wlMoveNoP_c0::m = { 9000, 100, 5, @@ -2325,7 +2325,7 @@ const daAlinkHIO_wlMoveNoP_c1 daAlinkHIO_wlMoveNoP_c0::m = { 30.0f, }; -const daAlinkHIO_wlAtnMove_c1 daAlinkHIO_wlAtnMove_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtnMove_c1 daAlinkHIO_wlAtnMove_c0::m = { 9000, 100, 3, @@ -2343,7 +2343,7 @@ const daAlinkHIO_wlAtnMove_c1 daAlinkHIO_wlAtnMove_c0::m = { 2.0f, }; -const daAlinkHIO_wlSideStep_c1 daAlinkHIO_wlSideStep_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlSideStep_c1 daAlinkHIO_wlSideStep_c0::m = { { 5, 1.0f, @@ -2380,7 +2380,7 @@ const daAlinkHIO_wlSideStep_c1 daAlinkHIO_wlSideStep_c0::m = { 10.0f, }; -const daAlinkHIO_wlBackJump_c1 daAlinkHIO_wlBackJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlBackJump_c1 daAlinkHIO_wlBackJump_c0::m = { { 11, 0.8f, @@ -2401,7 +2401,7 @@ const daAlinkHIO_wlBackJump_c1 daAlinkHIO_wlBackJump_c0::m = { 10.0f, }; -const daAlinkHIO_wlHowl_c1 daAlinkHIO_wlHowl_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlHowl_c1 daAlinkHIO_wlHowl_c0::m = { { 49, 1.0f, @@ -2436,7 +2436,7 @@ const daAlinkHIO_wlHowl_c1 daAlinkHIO_wlHowl_c0::m = { 0.7f, }; -const daAlinkHIO_wlAutoJump_c1 daAlinkHIO_wlAutoJump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAutoJump_c1 daAlinkHIO_wlAutoJump_c0::m = { { 3, 1.2f, @@ -2478,7 +2478,7 @@ const daAlinkHIO_wlAutoJump_c1 daAlinkHIO_wlAutoJump_c0::m = { 100.0f, }; -const daAlinkHIO_wlPush_c1 daAlinkHIO_wlPush_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlPush_c1 daAlinkHIO_wlPush_c0::m = { 1.0f, 3.0f, 1.0f, @@ -2486,7 +2486,7 @@ const daAlinkHIO_wlPush_c1 daAlinkHIO_wlPush_c0::m = { 0.75f, }; -const daAlinkHIO_wlLie_c1 daAlinkHIO_wlLie_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlLie_c1 daAlinkHIO_wlLie_c0::m = { { 14, 1.5f, @@ -2515,7 +2515,7 @@ const daAlinkHIO_wlLie_c1 daAlinkHIO_wlLie_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_wlLight_c1 daAlinkHIO_wlLight_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlLight_c1 daAlinkHIO_wlLight_c0::m = { 515, 0, 120, @@ -2529,7 +2529,7 @@ const daAlinkHIO_wlLight_c1 daAlinkHIO_wlLight_c0::m = { }; #pragma pop -const daAlinkHIO_wlWallHang_c1 daAlinkHIO_wlWallHang_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlWallHang_c1 daAlinkHIO_wlWallHang_c0::m = { { 13, 1.2f, @@ -2583,7 +2583,7 @@ const daAlinkHIO_wlWallHang_c1 daAlinkHIO_wlWallHang_c0::m = { 10.0f, }; -const daAlinkHIO_wlDamNormal_c1 daAlinkHIO_wlDamNormal_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlDamNormal_c1 daAlinkHIO_wlDamNormal_c0::m = { { 9, 1.0f, @@ -2618,7 +2618,7 @@ const daAlinkHIO_wlDamNormal_c1 daAlinkHIO_wlDamNormal_c0::m = { 0.25f, }; -const daAlinkHIO_wlDamLaHu_c1 daAlinkHIO_wlDamLarge_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlDamLaHu_c1 daAlinkHIO_wlDamLarge_c0::m = { { 49, 1.0f, @@ -2658,7 +2658,7 @@ const daAlinkHIO_wlDamLaHu_c1 daAlinkHIO_wlDamLarge_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_wlDamLaHu_c1 daAlinkHIO_wlDamHuge_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlDamLaHu_c1 daAlinkHIO_wlDamHuge_c0::m = { { 49, 1.1f, @@ -2697,7 +2697,7 @@ const daAlinkHIO_wlDamLaHu_c1 daAlinkHIO_wlDamHuge_c0::m = { }; #pragma pop -const daAlinkHIO_wlDamFall_c1 daAlinkHIO_wlDamFall_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlDamFall_c1 daAlinkHIO_wlDamFall_c0::m = { { 11, 1.0f, @@ -2721,7 +2721,7 @@ const daAlinkHIO_wlDamFall_c1 daAlinkHIO_wlDamFall_c0::m = { 15.0f, }; -const daAlinkHIO_wlDamCaught_c1 daAlinkHIO_wlDamCaught_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlDamCaught_c1 daAlinkHIO_wlDamCaught_c0::m = { 300, 5, 1.2f, @@ -2729,7 +2729,7 @@ const daAlinkHIO_wlDamCaught_c1 daAlinkHIO_wlDamCaught_c0::m = { 1.5f, }; -const daAlinkHIO_wlDamage_c1 daAlinkHIO_wlDamage_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlDamage_c1 daAlinkHIO_wlDamage_c0::m = { { 9, 1.1f, @@ -2747,7 +2747,7 @@ const daAlinkHIO_wlDamage_c1 daAlinkHIO_wlDamage_c0::m = { 0.7f, }; -const daAlinkHIO_wlSlide_c1 daAlinkHIO_wlSlide_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlSlide_c1 daAlinkHIO_wlSlide_c0::m = { { 20, 1.25f, @@ -2790,7 +2790,7 @@ const daAlinkHIO_wlSlide_c1 daAlinkHIO_wlSlide_c0::m = { 30.0f, }; -const daAlinkHIO_wlRope_c1 daAlinkHIO_wlRope_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlRope_c1 daAlinkHIO_wlRope_c0::m = { { 16, 1.0f, @@ -2812,7 +2812,7 @@ const daAlinkHIO_wlRope_c1 daAlinkHIO_wlRope_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaLr_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaLr_c0::m = { { 41, 0.9f, @@ -2836,7 +2836,7 @@ const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaLr_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaSc_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaSc_c0::m = { { 15, 0.9f, @@ -2860,7 +2860,7 @@ const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaSc_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaTl_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaTl_c0::m = { { 42, 1.05f, @@ -2882,7 +2882,7 @@ const daAlinkHIO_wlAtWait_c1 daAlinkHIO_wlAtWaTl_c0::m = { }; #pragma pop -const daAlinkHIO_wlAtRoll_c1 daAlinkHIO_wlAtRoll_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtRoll_c1 daAlinkHIO_wlAtRoll_c0::m = { { 40, 1.0f, @@ -2895,7 +2895,7 @@ const daAlinkHIO_wlAtRoll_c1 daAlinkHIO_wlAtRoll_c0::m = { 0.0f, }; -const daAlinkHIO_wlAtNjump_c1 daAlinkHIO_wlAtNjump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtNjump_c1 daAlinkHIO_wlAtNjump_c0::m = { { 6, 1.0f, @@ -2915,7 +2915,7 @@ const daAlinkHIO_wlAtNjump_c1 daAlinkHIO_wlAtNjump_c0::m = { 10.0f, }; -const daAlinkHIO_wlAtCjump_c1 daAlinkHIO_wlAtCjump_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtCjump_c1 daAlinkHIO_wlAtCjump_c0::m = { { 3, 2.0f, @@ -2947,7 +2947,7 @@ const daAlinkHIO_wlAtCjump_c1 daAlinkHIO_wlAtCjump_c0::m = { 0.1f, }; -const daAlinkHIO_wlAtLand_c1 daAlinkHIO_wlAtLand_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtLand_c1 daAlinkHIO_wlAtLand_c0::m = { { 19, 0.9f, @@ -2972,7 +2972,7 @@ const daAlinkHIO_wlAtLand_c1 daAlinkHIO_wlAtLand_c0::m = { 2.0f, }; -const daAlinkHIO_wlAtDown_c1 daAlinkHIO_wlAtDown_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtDown_c1 daAlinkHIO_wlAtDown_c0::m = { { 3, 1.0f, @@ -3029,7 +3029,7 @@ const daAlinkHIO_wlAtDown_c1 daAlinkHIO_wlAtDown_c0::m = { 13.0f, }; -const daAlinkHIO_wlAtLock_c1 daAlinkHIO_wlAtLock_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtLock_c1 daAlinkHIO_wlAtLock_c0::m = { { 6, 3.0f, @@ -3057,7 +3057,7 @@ const daAlinkHIO_wlAtLock_c1 daAlinkHIO_wlAtLock_c0::m = { 1000.0f, }; -const daAlinkHIO_wlAtBite_c1 daAlinkHIO_wlAtBite_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAtBite_c1 daAlinkHIO_wlAtBite_c0::m = { { 5, 1.0f, @@ -3088,7 +3088,7 @@ const daAlinkHIO_wlAtBite_c1 daAlinkHIO_wlAtBite_c0::m = { 0.02f, }; -const daAlinkHIO_wlAttack_c1 daAlinkHIO_wlAttack_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlAttack_c1 daAlinkHIO_wlAttack_c0::m = { { 59, 1.2f, @@ -3108,7 +3108,7 @@ const daAlinkHIO_wlAttack_c1 daAlinkHIO_wlAttack_c0::m = { 30.0f, }; -const daAlinkHIO_wlPoint_c1 daAlinkHIO_wlPoint_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlPoint_c1 daAlinkHIO_wlPoint_c0::m = { { 6, 0.9f, @@ -3150,7 +3150,7 @@ const daAlinkHIO_wlPoint_c1 daAlinkHIO_wlPoint_c0::m = { 0.2f, }; -const daAlinkHIO_wlChain_c1 daAlinkHIO_wlChain_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlChain_c1 daAlinkHIO_wlChain_c0::m = { { 39, 1.0f, @@ -3183,7 +3183,7 @@ const daAlinkHIO_wlChain_c1 daAlinkHIO_wlChain_c0::m = { 5.0f, }; -const daAlinkHIO_wlSwim_c1 daAlinkHIO_wlSwim_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlSwim_c1 daAlinkHIO_wlSwim_c0::m = { { 25, 0.9f, @@ -3237,7 +3237,7 @@ const daAlinkHIO_wlSwim_c1 daAlinkHIO_wlSwim_c0::m = { 7.0f, }; -const daAlinkHIO_wlGrab_c1 daAlinkHIO_wlGrab_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlGrab_c1 daAlinkHIO_wlGrab_c0::m = { { 20, 1.5f, @@ -3277,7 +3277,7 @@ const daAlinkHIO_wlGrab_c1 daAlinkHIO_wlGrab_c0::m = { #pragma push #pragma force_active on -const daAlinkHIO_wlBall_c1 daAlinkHIO_wlBall_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wlBall_c1 daAlinkHIO_wlBall_c0::m = { { 64, 1.0f, @@ -3299,7 +3299,7 @@ const daAlinkHIO_wlBall_c1 daAlinkHIO_wlBall_c0::m = { }; #pragma pop -const daAlinkHIO_wolf_c1 daAlinkHIO_wolf_c0::m = { +DUSK_GAME_DATA const daAlinkHIO_wolf_c1 daAlinkHIO_wolf_c0::m = { 13000, -10000, 8000, diff --git a/src/d/actor/d_a_alink_cut.inc b/src/d/actor/d_a_alink_cut.inc index f33d2935c5..ba3c0ba89e 100644 --- a/src/d/actor/d_a_alink_cut.inc +++ b/src/d/actor/d_a_alink_cut.inc @@ -1165,6 +1165,10 @@ int daAlink_c::procCutFinishInit(int i_type) { const daAlink_cutParamTbl* cutParams = &cutParamTable[i_type]; BOOL is_proc_frontRoll = mProcID == PROC_FRONT_ROLL; +#if TARGET_PC + mIsRollstab = (is_proc_frontRoll != FALSE) && (i_type == CUT_FINISH_PARAM_STAB); +#endif + commonProcInit(PROC_CUT_FINISH); setCutType(cutParams->m_cutType); field_0x3198 = cutParams->m_recoilAnmID; diff --git a/src/d/actor/d_a_alink_damage.inc b/src/d/actor/d_a_alink_damage.inc index bccdbf7381..a57e71bcee 100644 --- a/src/d/actor/d_a_alink_damage.inc +++ b/src/d/actor/d_a_alink_damage.inc @@ -192,7 +192,7 @@ int daAlink_c::setDamagePoint(int i_dmgAmount, BOOL i_checkZoraMag, BOOL i_setDm if (checkMagicArmorNoDamage()) { #if TARGET_PC - if(dusk::getSettings().game.freeMagicArmor) { + if(dusk::getSettings().game.armorRupeeDrain.getValue() == dusk::MagicArmorMode::INVINCIBLE) { i_dmgAmount = 0; } #endif @@ -202,6 +202,11 @@ int daAlink_c::setDamagePoint(int i_dmgAmount, BOOL i_checkZoraMag, BOOL i_setDm if (!mpHIO->mDamage.m.mInvincible && g_debugHpMode == 0) #endif { +#if TARGET_PC + if(checkMagicArmorWearAbility() && dusk::getSettings().game.armorRupeeDrain.getValue() == dusk::MagicArmorMode::DOUBLE_DEFENSE) { + i_dmgAmount /= 2; + } +#endif dComIfGp_setItemLifeCount(-i_dmgAmount, 0); } @@ -281,7 +286,26 @@ BOOL daAlink_c::checkIcePolygonDamage(cBgS_PolyInfo* i_poly) { } BOOL daAlink_c::checkMagicArmorNoDamage() { +#ifdef TARGET_PC + if (!checkMagicArmorWearAbility()) { + return false; + } + + switch(dusk::getSettings().game.armorRupeeDrain) { + case dusk::MagicArmorMode::NORMAL: + return !checkMagicArmorHeavy(); + case dusk::MagicArmorMode::ON_DAMAGE: + return dComIfGs_getRupee() != 0; + case dusk::MagicArmorMode::DOUBLE_DEFENSE: + return false; + case dusk::MagicArmorMode::INVINCIBLE: + return true; + case dusk::MagicArmorMode::COSMETIC: + return false; + } +#else return checkMagicArmorWearAbility() && !checkMagicArmorHeavy(); +#endif } int daAlink_c::checkPolyDamage() { diff --git a/src/d/actor/d_a_alink_demo.inc b/src/d/actor/d_a_alink_demo.inc index 55e261cc13..b1eb71a85d 100644 --- a/src/d/actor/d_a_alink_demo.inc +++ b/src/d/actor/d_a_alink_demo.inc @@ -4359,7 +4359,7 @@ void daAlink_c::dungeonReturnWarp() { s16 angle = dComIfGs_getWarpPlayerAngleY(); s8 room = dComIfGs_getWarpRoomNo(); char name[8]; - strcpy(name, dComIfGs_getWarpStageName()); + SAFE_STRCPY(name, dComIfGs_getWarpStageName()); dComIfGs_setRestartRoom(pos, angle, room); dComIfGp_setNextStage(name, -1, dComIfGs_getRestartRoomNo(), -1, 0.0f, 12, 0, @@ -4535,7 +4535,7 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) { if (checkBossRoom() && fopAcM_GetRoomNo(this) == 50) { char stageName[32]; - strcpy(stageName, dComIfGp_getStartStageName()); + SAFE_STRCPY(stageName, dComIfGp_getStartStageName()); for (int i = 0; i < 32; i++) { if ((s64)stageName[i] == 0) { diff --git a/src/d/actor/d_a_alink_dusk.cpp b/src/d/actor/d_a_alink_dusk.cpp index 8c1d415ae0..8a2bc0025b 100644 --- a/src/d/actor/d_a_alink_dusk.cpp +++ b/src/d/actor/d_a_alink_dusk.cpp @@ -144,7 +144,7 @@ void daAlink_c::handleQuickTransform() { procCoMetamorphoseInit(); } -bool daAlink_c::checkGyroAimContext() { +bool daAlink_c::checkAimContext() { switch (mProcID) { case PROC_SUBJECTIVITY: case PROC_SWIM_SUBJECTIVITY: @@ -175,3 +175,13 @@ bool daAlink_c::checkGyroAimContext() { return false; } } + +bool daAlink_c::checkAimInputContext() { + switch (mProcID) { + case PROC_HOOKSHOT_ROOF_WAIT: + case PROC_HOOKSHOT_WALL_WAIT: + return false; + default: + return checkAimContext(); + } +} diff --git a/src/d/actor/d_a_alink_effect.inc b/src/d/actor/d_a_alink_effect.inc index d595cd4293..db64d25b81 100644 --- a/src/d/actor/d_a_alink_effect.inc +++ b/src/d/actor/d_a_alink_effect.inc @@ -8,9 +8,9 @@ #include "d/actor/d_a_alink.h" #include "d/d_com_inf_game.h" #include "d/d_k_wmark.h" -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" -const EffParamProc daAlink_c::m_fEffParamProc[] = { +DUSK_GAME_DATA const EffParamProc daAlink_c::m_fEffParamProc[] = { &daAlink_c::setEffectFrontRollParam, &daAlink_c::setEffectSlipParam, &daAlink_c::setEffectSmallLandParam, @@ -2028,11 +2028,10 @@ void daAlink_blur_c::traceBlur(cXyz const* param_0, cXyz const* param_1, s16 par } void daAlink_blur_c::draw() { + ZoneScoped; j3dSys.reinitGX(); -#ifdef TARGET_PC - TGXTexObj texObj; -#else +#if !TARGET_PC static TGXTexObj texObj; #endif static GXColor nColor0 = {0xFF, 0xFF, 0xFF, 0x14}; @@ -2040,11 +2039,25 @@ void daAlink_blur_c::draw() { GXSetNumIndStages(0); nColor0.a = field_0x20; +#if TARGET_PC + if (mpCachedBlurTex != m_blurTex) { + mBlurTexObj.reset(); + GXInitTexObj(&mBlurTexObj, + reinterpret_cast( + reinterpret_cast(m_blurTex) + m_blurTex->imageOffset), + 16, 4, GX_TF_I4, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObjLOD( + &mBlurTexObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1); + mpCachedBlurTex = m_blurTex; + } + GXLoadTexObj(&mBlurTexObj, GX_TEXMAP0); +#else GXInitTexObj(&texObj, (void*)((uintptr_t)m_blurTex + m_blurTex->imageOffset), 16, 4, GX_TF_I4, GX_CLAMP, GX_CLAMP, GX_FALSE); GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, GX_FALSE, GX_FALSE, GX_ANISO_1); GXLoadTexObj(&texObj, GX_TEXMAP0); +#endif GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8); GXClearVtxDesc(); diff --git a/src/d/actor/d_a_alink_hook.inc b/src/d/actor/d_a_alink_hook.inc index 36fba0c6d8..660cf3b2ce 100644 --- a/src/d/actor/d_a_alink_hook.inc +++ b/src/d/actor/d_a_alink_hook.inc @@ -136,8 +136,26 @@ void daAlink_c::hsChainShape_c::draw() { } } } else { +#if TARGET_PC + cXyz hsInterpTop, hsInterpRoot, hsInterpSubRoot, hsInterpSubTop; + if (dusk::frame_interp::is_enabled() && alink->mHsChainInterpPrevValid && alink->mHsChainInterpCurrValid) { + const f32 alpha = dusk::frame_interp::get_interpolation_step(); + hsInterpTop = alink->mHsChainInterpPrevTop + (alink->mHsChainInterpCurrTop - alink->mHsChainInterpPrevTop) * alpha; + hsInterpRoot = alink->mHsChainInterpPrevRoot + (alink->mHsChainInterpCurrRoot - alink->mHsChainInterpPrevRoot) * alpha; + hsInterpSubRoot = alink->mHsChainInterpPrevSubRoot + (alink->mHsChainInterpCurrSubRoot - alink->mHsChainInterpPrevSubRoot) * alpha; + hsInterpSubTop = alink->mHsChainInterpPrevSubTop + (alink->mHsChainInterpCurrSubTop - alink->mHsChainInterpPrevSubTop) * alpha; + } else { + hsInterpTop = alink->getHsChainTopPos(); + hsInterpRoot = alink->getHsChainRootPos(); + hsInterpSubRoot = alink->getHsSubChainRootPos(); + hsInterpSubTop = alink->getHsSubChainTopPos(); + } + const cXyz& chainRootPos = hsInterpRoot; + const cXyz& chainTopPos = hsInterpTop; +#else const cXyz& chainRootPos = alink->getHsChainRootPos(); const cXyz& chainTopPos = alink->getHsChainTopPos(); +#endif cXyz maxDistance = chainRootPos - chainTopPos; f32 maxDistanceF = maxDistance.abs(); @@ -200,8 +218,13 @@ void daAlink_c::hsChainShape_c::draw() { } } +#if TARGET_PC + const cXyz& subChainRootPos = hsInterpSubRoot; + const cXyz& subChainTopPos = hsInterpSubTop; +#else const cXyz& subChainRootPos = alink->getHsSubChainRootPos(); const cXyz& subChainTopPos = alink->getHsSubChainTopPos(); +#endif maxDistance = subChainRootPos - subChainTopPos; maxDistanceF = maxDistance.abs(); diff --git a/src/d/actor/d_a_alink_horse.inc b/src/d/actor/d_a_alink_horse.inc index f0c585f1b8..7389decb73 100644 --- a/src/d/actor/d_a_alink_horse.inc +++ b/src/d/actor/d_a_alink_horse.inc @@ -73,19 +73,19 @@ int daAlink_c::getReinRideDirection() { return DIR_RIGHT; } -Vec const daAlink_c::m_handLeftOutSidePos = { +DUSK_GAME_DATA Vec const daAlink_c::m_handLeftOutSidePos = { 9.0f, -5.0f, 3.0f }; -Vec const daAlink_c::m_handRightOutSidePos = { +DUSK_GAME_DATA Vec const daAlink_c::m_handRightOutSidePos = { 9.0f, -5.0f, -3.0f }; -Vec const daAlink_c::m_handLeftInSidePos = { +DUSK_GAME_DATA Vec const daAlink_c::m_handLeftInSidePos = { 9.0f, 5.0f, 3.0f }; -Vec const daAlink_c::m_handRightInSidePos = { +DUSK_GAME_DATA Vec const daAlink_c::m_handRightInSidePos = { 9.0f, 5.0f, -3.0f }; @@ -1270,7 +1270,7 @@ int daAlink_c::procHorseRideInit() { daAlink_ANM anm; MtxP rideMtx; - Vec* localRidePos_p; + Vec DUSK_CONST* localRidePos_p; u32 mode; if (fopAcM_GetName(field_0x27f4) == fpcNm_HORSE_e) { daHorse_c* horse = (daHorse_c*)field_0x27f4; diff --git a/src/d/actor/d_a_alink_link.inc b/src/d/actor/d_a_alink_link.inc index 636aabdffe..6150fe09d2 100644 --- a/src/d/actor/d_a_alink_link.inc +++ b/src/d/actor/d_a_alink_link.inc @@ -11,8 +11,10 @@ #include "d/actor/d_a_tag_mhint.h" #if TARGET_PC -#include "dusk/gyro.h" #include "dusk/action_bindings.h" +#include "dusk/gyro.h" +#include "dusk/mouse.h" +#include "dusk/touch_camera.h" #endif bool daAlink_c::checkNoSubjectModeCamera() { @@ -131,7 +133,10 @@ BOOL daAlink_c::setBodyAngleToCamera() { } #if TARGET_PC - if (dusk::getSettings().game.enableGyroAim && checkGyroAimContext()) { + if ((dusk::getSettings().game.enableGyroAim || + dusk::getSettings().game.enableMouseAim) && + checkAimInputContext()) + { f32 gyro_scale = 1.0f; if (checkWolfEyeUp()) { gyro_scale *= 0.6f; @@ -141,17 +146,52 @@ BOOL daAlink_c::setBodyAngleToCamera() { gyro_scale /= dComIfGp_getCameraZoomScale(field_0x317c); } - f32 gy_yaw = 0.f; - f32 gy_pitch = 0.f; - dusk::gyro::getAimDeltas(gy_yaw, gy_pitch); + f32 final_yaw = 0.f; + f32 final_pitch = 0.f; + if (dusk::getSettings().game.enableMouseAim) { + dusk::mouse::get_aim_deltas(final_yaw, final_pitch); + } + if (dusk::getSettings().game.enableGyroAim) { + f32 gyro_yaw = 0.f; + f32 gyro_pitch = 0.f; + dusk::gyro::getAimDeltas(gyro_yaw, gyro_pitch); + final_yaw += gyro_yaw; + final_pitch += gyro_pitch; + } - shape_angle.y = shape_angle.y + cM_rad2s(gy_yaw * gyro_scale); - sp8 = sp8 + cM_rad2s(gy_pitch * gyro_scale); + shape_angle.y = shape_angle.y + cM_rad2s(final_yaw * gyro_scale); + sp8 = sp8 + cM_rad2s(final_pitch * gyro_scale); if (checkNotItemSinkLimit() && sp8 > 0 && sp8 > mBodyAngle.x) { sp8 = mBodyAngle.x; } } + + if (dusk::getSettings().game.enableTouchControls && checkAimInputContext()) { + f32 touchYawDp = 0.0f; + f32 touchPitchDp = 0.0f; + if (dusk::touch_camera::consume_delta(touchYawDp, touchPitchDp)) { + f32 scale = 1.0f; + if (checkWolfEyeUp()) { + scale *= 0.6f; + } + if (dComIfGp_checkPlayerStatus0(0, 0x200000)) { + scale /= dComIfGp_getCameraZoomScale(field_0x317c); + } + + const f32 yawDeg = -touchYawDp * dusk::touch_camera::YAW_DEGREES_PER_DP * scale * + dusk::getSettings().game.touchCameraXSensitivity; + const f32 pitchDeg = touchPitchDp * dusk::touch_camera::PITCH_DEGREES_PER_DP * + scale * dusk::getSettings().game.touchCameraYSensitivity; + + shape_angle.y = shape_angle.y + cM_deg2s(yawDeg); + sp8 = sp8 + cM_deg2s(pitchDeg); + + if (checkNotItemSinkLimit() && sp8 > 0 && sp8 > mBodyAngle.x) { + sp8 = mBodyAngle.x; + } + } + } #endif if (checkNotItemSinkLimit() && sp8 > 0) { diff --git a/src/d/actor/d_a_alink_swim.inc b/src/d/actor/d_a_alink_swim.inc index 038d710e80..19131e404a 100644 --- a/src/d/actor/d_a_alink_swim.inc +++ b/src/d/actor/d_a_alink_swim.inc @@ -216,7 +216,7 @@ void daAlink_c::setSpeedAndAngleSwim() { if (checkEventRun()) { var_r28 = mMoveAngle; } else { - var_r28 = shape_angle.y + (16384.0f * cM_ssin(mStickAngle)); + var_r28 = shape_angle.y + (16384.0f * cM_ssin(mStickAngle) IF_DUSK(* (dusk::getSettings().game.invertAirSwimX ? -1.0f : 1.0f))); } cLib_addCalcAngleS(&shape_angle.y, var_r28, mpHIO->mSwim.m.mUnderwaterTurnRate, mpHIO->mSwim.m.mUnderwaterMaxTurn, mpHIO->mSwim.m.mUnderwaterMinTurn); @@ -835,7 +835,7 @@ void daAlink_c::setSwimMoveAnime() { } else { s16 var_r24; if (checkInputOnR() && !checkEventRun()) { - var_r24 = 13653.0f * cM_scos(mStickAngle); + var_r24 = 13653.0f * cM_scos(mStickAngle) IF_DUSK(* (dusk::getSettings().game.invertAirSwimY ? -1.0f : 1.0f)); } else { var_r24 = 0; } diff --git a/src/d/actor/d_a_alink_wolf.inc b/src/d/actor/d_a_alink_wolf.inc index 67fde3a7a7..51b67c47d0 100644 --- a/src/d/actor/d_a_alink_wolf.inc +++ b/src/d/actor/d_a_alink_wolf.inc @@ -65,8 +65,8 @@ extern Vec const l_crawlSideOffset; extern Vec const l_wolfLieSideOffset; extern Vec const l_crawlMinSideOffset; extern f32 const l_wolfFootOnFrame[][4]; -extern cXyz l_wolfBaseAnime; -extern cXyz l_wolfRopeBaseAnime; +extern cXyz DUSK_CONST l_wolfBaseAnime; +extern cXyz DUSK_CONST l_wolfRopeBaseAnime; void daAlink_c::changeCommon() { @@ -348,7 +348,7 @@ void daAlink_c::changeLink(int param_0) { initModel(static_cast(dComIfG_getObjectRes(l_mArcName, "al_hands.bmd")), 0); #if TARGET_PC - if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor) + if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.armorRupeeDrain.getValue() != dusk::MagicArmorMode::NORMAL) #else if (dComIfGs_getRupee() != 0) #endif @@ -458,7 +458,7 @@ void daAlink_c::changeLink(int param_0) { field_0x06f0 = field_0x064C->getMaterialNodePointer(2)->getShape(); #if TARGET_PC - if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.freeMagicArmor) { + if (dComIfGs_getRupee() != 0 || dusk::getSettings().game.armorRupeeDrain.getValue() != dusk::MagicArmorMode::NORMAL) { #else if (dComIfGs_getRupee() != 0) { #endif @@ -4005,7 +4005,13 @@ int daAlink_c::procWolfHowlDemoInit() { } else if (name == fpcNm_Tag_WaraHowl_e) { mZ2WolfHowlMgr.setCorrectCurve(static_cast(field_0x27f4)->getTuneId()); } else { + #if TARGET_PC + if (mZ2WolfHowlMgr.getCorrectCurveID() != 9) { + mZ2WolfHowlMgr.setCorrectCurve(-1); + } + #else mZ2WolfHowlMgr.setCorrectCurve(-1); + #endif } } else { #if TARGET_PC diff --git a/src/d/actor/d_a_alldie.cpp b/src/d/actor/d_a_alldie.cpp index 092e86143b..68eeaaeb1c 100644 --- a/src/d/actor/d_a_alldie.cpp +++ b/src/d/actor/d_a_alldie.cpp @@ -179,7 +179,7 @@ static int daAlldie_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daAlldie_Method = { +static DUSK_CONST actor_method_class l_daAlldie_Method = { (process_method_func)daAlldie_Create, (process_method_func)daAlldie_Delete, (process_method_func)daAlldie_Execute, @@ -187,7 +187,7 @@ static actor_method_class l_daAlldie_Method = { (process_method_func)daAlldie_Draw, }; -actor_process_profile_definition g_profile_ALLDIE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ALLDIE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_andsw.cpp b/src/d/actor/d_a_andsw.cpp index 097d7096c5..6f4fb37df4 100644 --- a/src/d/actor/d_a_andsw.cpp +++ b/src/d/actor/d_a_andsw.cpp @@ -104,7 +104,7 @@ static int daAndsw_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daAndsw_Method = { +static DUSK_CONST actor_method_class l_daAndsw_Method = { (process_method_func)daAndsw_Create, (process_method_func)daAndsw_Delete, (process_method_func)daAndsw_Execute, @@ -112,7 +112,7 @@ static actor_method_class l_daAndsw_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_ANDSW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ANDSW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_andsw2.cpp b/src/d/actor/d_a_andsw2.cpp index 146dcb5929..f6e770b80c 100644 --- a/src/d/actor/d_a_andsw2.cpp +++ b/src/d/actor/d_a_andsw2.cpp @@ -336,13 +336,13 @@ static int daAndsw2_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daAndsw2_Method = { +static DUSK_CONST actor_method_class l_daAndsw2_Method = { (process_method_func)daAndsw2_Create, (process_method_func)daAndsw2_Delete, (process_method_func)daAndsw2_Execute, }; -actor_process_profile_definition g_profile_ANDSW2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ANDSW2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp index c18d19e149..7e9d052302 100644 --- a/src/d/actor/d_a_arrow.cpp +++ b/src/d/actor/d_a_arrow.cpp @@ -1220,7 +1220,7 @@ AUDIO_INSTANCES; template<> JAUSectionHeap* JASGlobalInstance::sInstance; -static actor_method_class l_daArrowMethodTable = { +static DUSK_CONST actor_method_class l_daArrowMethodTable = { (process_method_func)daArrow_create, (process_method_func)daArrow_delete, (process_method_func)daArrow_execute, @@ -1228,7 +1228,7 @@ static actor_method_class l_daArrowMethodTable = { (process_method_func)daArrow_draw, }; -actor_process_profile_definition g_profile_ARROW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ARROW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_bh.cpp b/src/d/actor/d_a_b_bh.cpp index e2c35acca0..3c82cb27c8 100644 --- a/src/d/actor/d_a_b_bh.cpp +++ b/src/d/actor/d_a_b_bh.cpp @@ -1568,7 +1568,7 @@ static int daB_BH_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daB_BH_Method = { +static DUSK_CONST actor_method_class l_daB_BH_Method = { (process_method_func)daB_BH_Create, (process_method_func)daB_BH_Delete, (process_method_func)daB_BH_Execute, @@ -1576,7 +1576,7 @@ static actor_method_class l_daB_BH_Method = { (process_method_func)daB_BH_Draw, }; -actor_process_profile_definition g_profile_B_BH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_BH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_bq.cpp b/src/d/actor/d_a_b_bq.cpp index 637e82360e..2c9f4bd893 100644 --- a/src/d/actor/d_a_b_bq.cpp +++ b/src/d/actor/d_a_b_bq.cpp @@ -2674,13 +2674,13 @@ static int daB_BQ_Create(fopAc_ac_c* i_this) { b_bq_class::b_bq_class() {} -static actor_method_class l_daB_BQ_Method = { +static DUSK_CONST actor_method_class l_daB_BQ_Method = { (process_method_func)daB_BQ_Create, (process_method_func)daB_BQ_Delete, (process_method_func)daB_BQ_Execute, (process_method_func)daB_BQ_IsDelete, (process_method_func)daB_BQ_Draw, }; -actor_process_profile_definition g_profile_B_BQ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_BQ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_dr.cpp b/src/d/actor/d_a_b_dr.cpp index 1d172cf8d1..7e1cc8c0d5 100644 --- a/src/d/actor/d_a_b_dr.cpp +++ b/src/d/actor/d_a_b_dr.cpp @@ -4285,7 +4285,7 @@ static int daB_DR_Create(daB_DR_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_DR_Method = { +static DUSK_CONST actor_method_class l_daB_DR_Method = { (process_method_func)daB_DR_Create, (process_method_func)daB_DR_Delete, (process_method_func)daB_DR_Execute, @@ -4293,7 +4293,7 @@ static actor_method_class l_daB_DR_Method = { (process_method_func)daB_DR_Draw, }; -actor_process_profile_definition g_profile_B_DR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_DR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_dre.cpp b/src/d/actor/d_a_b_dre.cpp index c25b187b76..b26e815ddd 100644 --- a/src/d/actor/d_a_b_dre.cpp +++ b/src/d/actor/d_a_b_dre.cpp @@ -937,13 +937,13 @@ static int daB_DRE_IsDelete(daB_DRE_c* i_this) { return 1; } -static actor_method_class l_daB_DRE_Method = { +static DUSK_CONST actor_method_class l_daB_DRE_Method = { (process_method_func)daB_DRE_Create, (process_method_func)daB_DRE_Delete, (process_method_func)daB_DRE_Execute, (process_method_func)daB_DRE_IsDelete, (process_method_func)daB_DRE_Draw, }; -actor_process_profile_definition g_profile_B_DRE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_DRE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_ds.cpp b/src/d/actor/d_a_b_ds.cpp index 487addd826..17bdd9564b 100644 --- a/src/d/actor/d_a_b_ds.cpp +++ b/src/d/actor/d_a_b_ds.cpp @@ -5680,13 +5680,13 @@ static cPhs_Step daB_DS_Create(daB_DS_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_DS_Method = { +static DUSK_CONST actor_method_class l_daB_DS_Method = { (process_method_func)daB_DS_Create, (process_method_func)daB_DS_Delete, (process_method_func)daB_DS_Execute, (process_method_func)daB_DS_IsDelete, (process_method_func)daB_DS_Draw, }; -actor_process_profile_definition g_profile_B_DS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_DS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_gg.cpp b/src/d/actor/d_a_b_gg.cpp index dac161d266..f6259b1f7b 100644 --- a/src/d/actor/d_a_b_gg.cpp +++ b/src/d/actor/d_a_b_gg.cpp @@ -4456,7 +4456,7 @@ static int daB_GG_Create(fopAc_ac_c* i_this) { return ((daB_GG_c*)i_this)->Create(); } -static actor_method_class l_daB_GG_Method = { +static DUSK_CONST actor_method_class l_daB_GG_Method = { (process_method_func)daB_GG_Create, (process_method_func)daB_GG_Delete, (process_method_func)daB_GG_Execute, @@ -4464,7 +4464,7 @@ static actor_method_class l_daB_GG_Method = { (process_method_func)daB_GG_Draw, }; -actor_process_profile_definition g_profile_B_GG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_GG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_gm.cpp b/src/d/actor/d_a_b_gm.cpp index 0f9304e22a..2b65b8095b 100644 --- a/src/d/actor/d_a_b_gm.cpp +++ b/src/d/actor/d_a_b_gm.cpp @@ -2223,7 +2223,7 @@ static int daB_GM_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daB_GM_Method = { +static DUSK_CONST actor_method_class l_daB_GM_Method = { (process_method_func)daB_GM_Create, (process_method_func)daB_GM_Delete, (process_method_func)daB_GM_Execute, @@ -2231,7 +2231,7 @@ static actor_method_class l_daB_GM_Method = { (process_method_func)daB_GM_Draw, }; -actor_process_profile_definition g_profile_B_GM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_GM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_gnd.cpp b/src/d/actor/d_a_b_gnd.cpp index f5b03be1b1..80cca37f6e 100644 --- a/src/d/actor/d_a_b_gnd.cpp +++ b/src/d/actor/d_a_b_gnd.cpp @@ -397,7 +397,7 @@ static int daB_GND_Draw(b_gnd_class* i_this) { i_this->field_0x21e8.update(2, l_color, &a_this->tevStr); dComIfGd_set3DlineMat(&i_this->field_0x21e8); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mReinsInterpCurrValid) { memcpy(i_this->mReinsInterpPrev, i_this->mReinsInterpCurr, sizeof(i_this->mReinsInterpCurr)); memcpy(i_this->mReinsTexInterpPrev, i_this->mReinsTexInterpCurr, sizeof(i_this->mReinsTexInterpCurr)); @@ -2192,6 +2192,9 @@ static void damage_check(b_gnd_class* i_this) { i_this->mDamageInvulnerabilityTimer = 100; } } + #if TARGET_PC + dusk::AchievementSystem::get().signal("ganondorf_hit"); + #endif } cXyz hitmark_size(1.0f, 1.0f, 1.0f); @@ -2218,6 +2221,7 @@ static void damage_check(b_gnd_class* i_this) { i_this->field_0xc7c = 0; dScnPly_c::setPauseTimer(7); a_this->health = 100; + dusk::AchievementSystem::get().signal("ganondorf_knocked_down"); } break; } @@ -4933,7 +4937,7 @@ static int daB_GND_Create(fopAc_ac_c* a_this) { } // mSphAttr }; - static dCcD_SrcCyl co_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl co_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -5014,7 +5018,7 @@ static int daB_GND_Create(fopAc_ac_c* a_this) { b_gnd_class::b_gnd_class() {} -static actor_method_class l_daB_GND_Method = { +static DUSK_CONST actor_method_class l_daB_GND_Method = { (process_method_func)daB_GND_Create, (process_method_func)daB_GND_Delete, (process_method_func)daB_GND_Execute, @@ -5022,7 +5026,7 @@ static actor_method_class l_daB_GND_Method = { (process_method_func)daB_GND_Draw, }; -actor_process_profile_definition g_profile_B_GND = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_GND = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_go.cpp b/src/d/actor/d_a_b_go.cpp index 04d16d2c09..cb8e9e2d9f 100644 --- a/src/d/actor/d_a_b_go.cpp +++ b/src/d/actor/d_a_b_go.cpp @@ -284,13 +284,13 @@ static int daB_GO_Create(fopAc_ac_c* i_this) { b_go_class::b_go_class() {} -static actor_method_class l_daB_GO_Method = { +static DUSK_CONST actor_method_class l_daB_GO_Method = { (process_method_func)daB_GO_Create, (process_method_func)daB_GO_Delete, (process_method_func)daB_GO_Execute, (process_method_func)daB_GO_IsDelete, (process_method_func)daB_GO_Draw, }; -actor_process_profile_definition g_profile_B_GO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_GO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_gos.cpp b/src/d/actor/d_a_b_gos.cpp index 65a1bd85b7..9496a70e2b 100644 --- a/src/d/actor/d_a_b_gos.cpp +++ b/src/d/actor/d_a_b_gos.cpp @@ -383,7 +383,7 @@ static int daB_GOS_Create(fopAc_ac_c* i_this) { a_this->gravity = -7.0f; a_this->mAction = ACTION_WAIT; - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -411,13 +411,13 @@ static int daB_GOS_Create(fopAc_ac_c* i_this) { b_gos_class::b_gos_class() {} -static actor_method_class l_daB_GOS_Method = { +static DUSK_CONST actor_method_class l_daB_GOS_Method = { (process_method_func)daB_GOS_Create, (process_method_func)daB_GOS_Delete, (process_method_func)daB_GOS_Execute, (process_method_func)daB_GOS_IsDelete, (process_method_func)daB_GOS_Draw, }; -actor_process_profile_definition g_profile_B_GOS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_GOS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_mgn.cpp b/src/d/actor/d_a_b_mgn.cpp index 169db10cd3..a293fc63ad 100644 --- a/src/d/actor/d_a_b_mgn.cpp +++ b/src/d/actor/d_a_b_mgn.cpp @@ -3576,13 +3576,13 @@ static int daB_MGN_Create(daB_MGN_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_MGN_Method = { +static DUSK_CONST actor_method_class l_daB_MGN_Method = { (process_method_func)daB_MGN_Create, (process_method_func)daB_MGN_Delete, (process_method_func)daB_MGN_Execute, (process_method_func)daB_MGN_IsDelete, (process_method_func)daB_MGN_Draw, }; -actor_process_profile_definition g_profile_B_MGN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_MGN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_ob.cpp b/src/d/actor/d_a_b_ob.cpp index f7aa9b1f0b..2725c4b754 100644 --- a/src/d/actor/d_a_b_ob.cpp +++ b/src/d/actor/d_a_b_ob.cpp @@ -3649,7 +3649,7 @@ static int daB_OB_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daB_OB_Method = { +static DUSK_CONST actor_method_class l_daB_OB_Method = { (process_method_func)daB_OB_Create, (process_method_func)daB_OB_Delete, (process_method_func)daB_OB_Execute, @@ -3657,7 +3657,7 @@ static actor_method_class l_daB_OB_Method = { (process_method_func)daB_OB_Draw, }; -actor_process_profile_definition g_profile_B_OB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_OB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_oh.cpp b/src/d/actor/d_a_b_oh.cpp index e52b965b65..e6e9db3dfe 100644 --- a/src/d/actor/d_a_b_oh.cpp +++ b/src/d/actor/d_a_b_oh.cpp @@ -822,7 +822,7 @@ static int daB_OH_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daB_OH_Method = { +static DUSK_CONST actor_method_class l_daB_OH_Method = { (process_method_func)daB_OH_Create, (process_method_func)daB_OH_Delete, (process_method_func)daB_OH_Execute, @@ -830,7 +830,7 @@ static actor_method_class l_daB_OH_Method = { (process_method_func)daB_OH_Draw, }; -actor_process_profile_definition g_profile_B_OH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_OH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_oh2.cpp b/src/d/actor/d_a_b_oh2.cpp index 2e2619d155..8bf8773d51 100644 --- a/src/d/actor/d_a_b_oh2.cpp +++ b/src/d/actor/d_a_b_oh2.cpp @@ -293,13 +293,13 @@ static int daB_OH2_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daB_OH2_Method = { +static DUSK_CONST actor_method_class l_daB_OH2_Method = { (process_method_func)daB_OH2_Create, (process_method_func)daB_OH2_Delete, (process_method_func)daB_OH2_Execute, (process_method_func)daB_OH2_IsDelete, (process_method_func)daB_OH2_Draw, }; -actor_process_profile_definition g_profile_B_OH2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_OH2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_tn.cpp b/src/d/actor/d_a_b_tn.cpp index 17f6616314..8ad5edece5 100644 --- a/src/d/actor/d_a_b_tn.cpp +++ b/src/d/actor/d_a_b_tn.cpp @@ -5168,13 +5168,13 @@ static int daB_TN_Create(daB_TN_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_TN_Method = { +static DUSK_CONST actor_method_class l_daB_TN_Method = { (process_method_func)daB_TN_Create, (process_method_func)daB_TN_Delete, (process_method_func)daB_TN_Execute, (process_method_func)daB_TN_IsDelete, (process_method_func)daB_TN_Draw, }; -actor_process_profile_definition g_profile_B_TN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_TN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_yo.cpp b/src/d/actor/d_a_b_yo.cpp index 58f77ca5c2..2bc83b9473 100644 --- a/src/d/actor/d_a_b_yo.cpp +++ b/src/d/actor/d_a_b_yo.cpp @@ -3426,7 +3426,7 @@ static u32 m_common_count; } // namespace -static actor_method_class l_daB_YO_Method = { +static DUSK_CONST actor_method_class l_daB_YO_Method = { (process_method_func)daB_YO_Create, (process_method_func)daB_YO_Delete, (process_method_func)daB_YO_Execute, @@ -3434,7 +3434,7 @@ static actor_method_class l_daB_YO_Method = { (process_method_func)daB_YO_Draw, }; -actor_process_profile_definition g_profile_B_YO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_YO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_yo_ice.cpp b/src/d/actor/d_a_b_yo_ice.cpp index ee55b8c9f2..50a6e49ba6 100644 --- a/src/d/actor/d_a_b_yo_ice.cpp +++ b/src/d/actor/d_a_b_yo_ice.cpp @@ -1091,7 +1091,7 @@ static cPhs_Step daB_YOI_Create(daB_YOI_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_YOI_Method = { +static DUSK_CONST actor_method_class l_daB_YOI_Method = { (process_method_func)daB_YOI_Create, (process_method_func)daB_YOI_Delete, (process_method_func)daB_YOI_Execute, @@ -1099,7 +1099,7 @@ static actor_method_class l_daB_YOI_Method = { (process_method_func)daB_YOI_Draw, }; -actor_process_profile_definition g_profile_B_YOI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_YOI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_zant.cpp b/src/d/actor/d_a_b_zant.cpp index 3c590fe101..bc6aa0dcdc 100644 --- a/src/d/actor/d_a_b_zant.cpp +++ b/src/d/actor/d_a_b_zant.cpp @@ -5472,6 +5472,15 @@ int daB_ZANT_c::create() { fopAcM_ct(this, daB_ZANT_c); OS_REPORT("B_ZANT PARAM %x\n", fopAcM_GetParam(this)); +#if TARGET_PC + // Due to our loads being so much faster, Zant can initialize *before* the player + // This breaks respawning in the final phase of the fight when it tries + // to load the player's position + if (daPy_getPlayerActorClass() == NULL) { + return cPhs_INIT_e; + } +#endif + mSwbit = fopAcM_GetParam(this); if (mSwbit != 0xFF) { if (dComIfGs_isSwitch(mSwbit, fopAcM_GetRoomNo(this))) { @@ -5591,7 +5600,7 @@ static int daB_ZANT_Create(daB_ZANT_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_ZANT_Method = { +static DUSK_CONST actor_method_class l_daB_ZANT_Method = { (process_method_func)daB_ZANT_Create, (process_method_func)daB_ZANT_Delete, (process_method_func)daB_ZANT_Execute, @@ -5599,7 +5608,7 @@ static actor_method_class l_daB_ZANT_Method = { (process_method_func)daB_ZANT_Draw, }; -actor_process_profile_definition g_profile_B_ZANT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_ZANT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_zant_magic.cpp b/src/d/actor/d_a_b_zant_magic.cpp index 97eeec2c4c..133ec3d4da 100644 --- a/src/d/actor/d_a_b_zant_magic.cpp +++ b/src/d/actor/d_a_b_zant_magic.cpp @@ -268,7 +268,7 @@ static int daB_ZANTM_Create(daB_ZANTM_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_ZANTM_Method = { +static DUSK_CONST actor_method_class l_daB_ZANTM_Method = { (process_method_func)daB_ZANTM_Create, (process_method_func)daB_ZANTM_Delete, (process_method_func)daB_ZANTM_Execute, @@ -276,7 +276,7 @@ static actor_method_class l_daB_ZANTM_Method = { (process_method_func)daB_ZANTM_Draw, }; -actor_process_profile_definition g_profile_B_ZANTM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_ZANTM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_zant_mobile.cpp b/src/d/actor/d_a_b_zant_mobile.cpp index 5ac969969b..556fe7288b 100644 --- a/src/d/actor/d_a_b_zant_mobile.cpp +++ b/src/d/actor/d_a_b_zant_mobile.cpp @@ -500,7 +500,7 @@ static int daB_ZANTZ_Create(daB_ZANTZ_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_ZANTZ_Method = { +static DUSK_CONST actor_method_class l_daB_ZANTZ_Method = { (process_method_func)daB_ZANTZ_Create, (process_method_func)daB_ZANTZ_Delete, (process_method_func)daB_ZANTZ_Execute, @@ -508,7 +508,7 @@ static actor_method_class l_daB_ZANTZ_Method = { (process_method_func)daB_ZANTZ_Draw, }; -actor_process_profile_definition g_profile_B_ZANTZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_ZANTZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_b_zant_sima.cpp b/src/d/actor/d_a_b_zant_sima.cpp index 83429a84a0..a1d284e001 100644 --- a/src/d/actor/d_a_b_zant_sima.cpp +++ b/src/d/actor/d_a_b_zant_sima.cpp @@ -221,13 +221,13 @@ static int daB_ZANTS_Create(daB_ZANTS_c* i_this) { return i_this->create(); } -static actor_method_class l_daB_ZANTS_Method = { +static DUSK_CONST actor_method_class l_daB_ZANTS_Method = { (process_method_func)daB_ZANTS_Create, (process_method_func)daB_ZANTS_Delete, (process_method_func)daB_ZANTS_Execute, (process_method_func)daB_ZANTS_IsDelete, (process_method_func)daB_ZANTS_Draw, }; -actor_process_profile_definition g_profile_B_ZANTS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_B_ZANTS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_balloon_2D.cpp b/src/d/actor/d_a_balloon_2D.cpp index 8627505371..a9d6d0db4f 100644 --- a/src/d/actor/d_a_balloon_2D.cpp +++ b/src/d/actor/d_a_balloon_2D.cpp @@ -154,7 +154,7 @@ static int daBalloon2D_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_arcName = "Balloon2D"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Balloon2D"; int daBalloon2D_c::createHeap() { mScreen = JKR_NEW J2DScreen(); @@ -229,9 +229,9 @@ int daBalloon2D_c::createHeap() { return 1; } -daBalloon2D_HIO_c l_HOSTIO; +DUSK_GAME_DATA daBalloon2D_HIO_c l_HOSTIO; -daBalloon2D_c* daBalloon2D_c::myclass; +DUSK_GAME_DATA daBalloon2D_c* daBalloon2D_c::myclass; int daBalloon2D_c::create() { int rv = dComIfG_resLoad(this, l_arcName); @@ -687,7 +687,7 @@ void daBalloon2D_HIO_c::genMessage(JORMContext* ctx) { } #endif -static actor_method_class daBalloon2D_METHODS = { +static DUSK_CONST actor_method_class daBalloon2D_METHODS = { (process_method_func)daBalloon2D_create, (process_method_func)daBalloon2D_destroy, (process_method_func)daBalloon2D_execute, @@ -695,7 +695,7 @@ static actor_method_class daBalloon2D_METHODS = { (process_method_func)daBalloon2D_draw, }; -actor_process_profile_definition g_profile_BALLOON2D = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BALLOON2D = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_bd.cpp b/src/d/actor/d_a_bd.cpp index ea786a60a1..e2cdc30329 100644 --- a/src/d/actor/d_a_bd.cpp +++ b/src/d/actor/d_a_bd.cpp @@ -1048,13 +1048,13 @@ static int daBd_Create(fopAc_ac_c* i_act_this) { return phase_state; } -static actor_method_class l_daBd_Method = { +static DUSK_CONST actor_method_class l_daBd_Method = { (process_method_func)daBd_Create, (process_method_func)daBd_Delete, (process_method_func)daBd_Execute, (process_method_func)daBd_IsDelete, (process_method_func)daBd_Draw, }; -actor_process_profile_definition g_profile_BD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_bg.cpp b/src/d/actor/d_a_bg.cpp index 9c453b6553..110e2aef15 100644 --- a/src/d/actor/d_a_bg.cpp +++ b/src/d/actor/d_a_bg.cpp @@ -631,7 +631,7 @@ int daBg_c::create() { return cPhs_COMPLEATE_e; } -static actor_method_class l_daBg_Method = { +static DUSK_CONST actor_method_class l_daBg_Method = { (process_method_func)daBg_Create, (process_method_func)daBg_Delete, (process_method_func)daBg_Execute, @@ -639,7 +639,7 @@ static actor_method_class l_daBg_Method = { (process_method_func)daBg_Draw, }; -actor_process_profile_definition2 g_profile_BG = { +DUSK_PROFILE actor_process_profile_definition2 DUSK_CONST g_profile_BG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_bg_obj.cpp b/src/d/actor/d_a_bg_obj.cpp index 7d4adb9e47..da18ce4501 100644 --- a/src/d/actor/d_a_bg_obj.cpp +++ b/src/d/actor/d_a_bg_obj.cpp @@ -5,24 +5,25 @@ #include "d/dolzel_rel.h" // IWYU pragma: keep -#include "d/actor/d_a_bg_obj.h" -#include "JSystem/J3DGraphBase/J3DMaterial.h" #include -#include #include +#include +#include "JSystem/J3DGraphBase/J3DMaterial.h" +#include "SSystem/SComponent/c_math.h" +#include "d/actor/d_a_bg_obj.h" #include "d/actor/d_a_set_bgobj.h" #include "d/d_s_play.h" -#include "SSystem/SComponent/c_math.h" +#include "helpers/string.hpp" static const char* getBmdName(int param_0, int param_1) { static char l_bmdName[16]; switch (param_1) { case 0: - sprintf(l_bmdName, "model%d.bmd", param_0); + SAFE_SPRINTF(l_bmdName, "model%d.bmd", param_0); break; default: - sprintf(l_bmdName, "model%d_%d.bmd", param_0, param_1); + SAFE_SPRINTF(l_bmdName, "model%d_%d.bmd", param_0, param_1); break; } @@ -34,10 +35,10 @@ static const char* getBtkName(int param_0, int param_1) { switch (param_1) { case 0: - sprintf(l_btkName, "model%d.btk", param_0); + SAFE_SPRINTF(l_btkName, "model%d.btk", param_0); break; default: - sprintf(l_btkName, "model%d_%d.btk", param_0, param_1); + SAFE_SPRINTF(l_btkName, "model%d_%d.btk", param_0, param_1); break; } @@ -49,10 +50,10 @@ static const char* getBrkName(int param_0, int param_1) { switch (param_1) { case 0: - sprintf(l_brkName, "model%d.brk", param_0); + SAFE_SPRINTF(l_brkName, "model%d.brk", param_0); break; default: - sprintf(l_brkName, "model%d_%d.brk", param_0, param_1); + SAFE_SPRINTF(l_brkName, "model%d_%d.brk", param_0, param_1); break; } @@ -62,7 +63,7 @@ static const char* getBrkName(int param_0, int param_1) { static const char* getDzbName(int param_0) { static char l_dzbName[16]; - sprintf(l_dzbName, "model%d.dzb", param_0); + SAFE_SPRINTF(l_dzbName, "model%d.dzb", param_0); return l_dzbName; } @@ -95,12 +96,12 @@ u8* daBgObj_c::spec_data_c::initTexShareBlock(u8* i_dataPtr) { u8* dataPos = i_dataPtr + 8; for (; i < mTexShareNum; i++) { - strcpy(sp48, (char*)dataPos); + SAFE_STRCPY(sp48, (char*)dataPos); int len = strlen((char*)dataPos); dataPos += len + 1; if (*dataPos != 0) { - strcpy(sp8, (char*)dataPos); + SAFE_STRCPY(sp8, (char*)dataPos); dataPos += strlen((char*)dataPos) + 1; } else if (*dataPos == 0 && dataPos[1] == 1) { dataPos += 2; @@ -498,16 +499,16 @@ static dCcD_SrcTri l_tri_src = { }, }; -static char* l_specName = "spec.dat"; +static DUSK_CONST char* l_specName = "spec.dat"; -createHeapFunc daBgObj_c::mCreateHeapFunc[] = { +DUSK_GAME_DATA createHeapFunc daBgObj_c::mCreateHeapFunc[] = { &daBgObj_c::CreateHeapType0, &daBgObj_c::CreateHeapType1, &daBgObj_c::CreateHeapType1, &daBgObj_c::CreateHeapType1, }; -createInitFunc daBgObj_c::mCreateInitFunc[] = { +DUSK_GAME_DATA createInitFunc daBgObj_c::mCreateInitFunc[] = { &daBgObj_c::CreateInitType0, &daBgObj_c::CreateInitType1, &daBgObj_c::CreateInitType1, @@ -518,14 +519,14 @@ int daBgObj_c::Create() { return (this->*mCreateInitFunc[mSpecData.mSpecType])(); } -executeFunc daBgObj_c::mExecuteFunc[] = { +DUSK_GAME_DATA executeFunc daBgObj_c::mExecuteFunc[] = { &daBgObj_c::ExecuteType0, &daBgObj_c::ExecuteType1, &daBgObj_c::ExecuteType1, &daBgObj_c::ExecuteType1, }; -tgSetFunc daBgObj_c::mTgSetFunc[] = { +DUSK_GAME_DATA tgSetFunc daBgObj_c::mTgSetFunc[] = { &daBgObj_c::set_tri_0, &daBgObj_c::set_tri_1, &daBgObj_c::set_cyl_0, &daBgObj_c::set_tri_2, &daBgObj_c::set_tri_3, }; @@ -646,14 +647,14 @@ void daBgObj_c::doShareTexture() { u8* spec_res_name = mSpecData.mpTexShareBlock + 8; for (int i = 0; i < mSpecData.mTexShareNum; i++) { - strcpy(res_name, (char*)spec_res_name); + SAFE_STRCPY(res_name, (char*)spec_res_name); spec_res_name += strlen((char*)spec_res_name) + 1; J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(daSetBgObj_c::getArcName(this), res_name); if (*spec_res_name != 0) { - strcpy(share_res_name, (char*)spec_res_name); + SAFE_STRCPY(share_res_name, (char*)spec_res_name); spec_res_name += strlen((char*)spec_res_name) + 1; J3DModelData* shareModelData = @@ -1354,7 +1355,7 @@ static int daBgObj_MoveBGDraw(daBgObj_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daBgObj_METHODS = { +static DUSK_CONST actor_method_class daBgObj_METHODS = { (process_method_func)daBgObj_create1st, (process_method_func)daBgObj_MoveBGDelete, (process_method_func)daBgObj_MoveBGExecute, @@ -1362,7 +1363,7 @@ static actor_method_class daBgObj_METHODS = { (process_method_func)daBgObj_MoveBGDraw, }; -actor_process_profile_definition g_profile_BG_OBJ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BG_OBJ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_boomerang.cpp b/src/d/actor/d_a_boomerang.cpp index 590897640e..9deb7b46b8 100644 --- a/src/d/actor/d_a_boomerang.cpp +++ b/src/d/actor/d_a_boomerang.cpp @@ -137,17 +137,17 @@ static const u8 lbl_46_rodata_24[6] = { 0x1E, }; -const u16 daBoomerang_HIO_c0::m_lockWaitTime = 10; +DUSK_GAME_DATA const u16 daBoomerang_HIO_c0::m_lockWaitTime = 10; -const f32 daBoomerang_HIO_c0::m_minCircleR = 28.0f; +DUSK_GAME_DATA const f32 daBoomerang_HIO_c0::m_minCircleR = 28.0f; -const f32 daBoomerang_HIO_c0::m_middleCircleR = 35.0f; +DUSK_GAME_DATA const f32 daBoomerang_HIO_c0::m_middleCircleR = 35.0f; -const f32 daBoomerang_HIO_c0::m_maxCircleR = 80.0f; +DUSK_GAME_DATA const f32 daBoomerang_HIO_c0::m_maxCircleR = 80.0f; -const f32 daBoomerang_HIO_c0::m_scale = 3.0f / 5.0f; +DUSK_GAME_DATA const f32 daBoomerang_HIO_c0::m_scale = 3.0f / 5.0f; -const f32 daBoomerang_HIO_c0::m_lockWindScale = 2.0f; +DUSK_GAME_DATA const f32 daBoomerang_HIO_c0::m_lockWindScale = 2.0f; static const u32 l_lockSeFlg[BOOMERANG_LOCK_MAX] = { Z2SE_SY_BOOM_LOCK_ON_1, @@ -1489,7 +1489,7 @@ static int daBoomerang_Create(fopAc_ac_c* i_this) { return ((daBoomerang_c*)i_this)->create(); } -static actor_method_class l_daBoomerang_Method = { +static DUSK_CONST actor_method_class l_daBoomerang_Method = { (process_method_func)daBoomerang_Create, (process_method_func)daBoomerang_Delete, (process_method_func)daBoomerang_Execute, @@ -1497,7 +1497,7 @@ static actor_method_class l_daBoomerang_Method = { (process_method_func)daBoomerang_Draw, }; -actor_process_profile_definition g_profile_BOOMERANG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BOOMERANG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 6, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_bullet.cpp b/src/d/actor/d_a_bullet.cpp index cac505a0bb..f6b873a67f 100644 --- a/src/d/actor/d_a_bullet.cpp +++ b/src/d/actor/d_a_bullet.cpp @@ -8,20 +8,20 @@ #include "d/actor/d_a_bullet.h" #include "d/d_com_inf_game.h" -static char* l_resFileNameList[] = {"Hanjo1"}; +static DUSK_CONST char* l_resFileNameList[] = {"Hanjo1"}; -static char* l_bmdFileNameList[] = {"hanjo_stone.bmd"}; +static DUSK_CONST char* l_bmdFileNameList[] = {"hanjo_stone.bmd"}; static BULLET_HIO_CLASS l_HIO; -const dCcD_SrcGObjInf daBullet_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daBullet_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0x0, 0x0}, {0x79}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 0}, {0}, }; -dCcD_SrcSph daBullet_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daBullet_c::mCcDSph = { daBullet_c::mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph @@ -81,7 +81,7 @@ int daBullet_c::Delete() { return 1; } -daBullet_HIOParam const daBullet_Param_c::m = { +DUSK_GAME_DATA daBullet_HIOParam const daBullet_Param_c::m = { -3.0f, 255.0f, 3.0f, @@ -267,7 +267,7 @@ static int daBullet_IsDelete(void* i_this) { return 1; } -static actor_method_class daBullet_MethodTable = { +static DUSK_CONST actor_method_class daBullet_MethodTable = { (process_method_func)daBullet_Create, (process_method_func)daBullet_Delete, (process_method_func)daBullet_Execute, @@ -275,7 +275,7 @@ static actor_method_class daBullet_MethodTable = { (process_method_func)daBullet_Draw, }; -actor_process_profile_definition g_profile_BULLET = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BULLET = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_canoe.cpp b/src/d/actor/d_a_canoe.cpp index 7f393263f7..d0c1a86130 100644 --- a/src/d/actor/d_a_canoe.cpp +++ b/src/d/actor/d_a_canoe.cpp @@ -909,7 +909,7 @@ static int daCanoe_Draw(daCanoe_c* i_this) { return i_this->draw(); } -static actor_method_class l_daCanoe_Method = { +static DUSK_CONST actor_method_class l_daCanoe_Method = { (process_method_func)daCanoe_Create, (process_method_func)daCanoe_Delete, (process_method_func)daCanoe_Execute, @@ -917,7 +917,7 @@ static actor_method_class l_daCanoe_Method = { (process_method_func)daCanoe_Draw, }; -actor_process_profile_definition g_profile_CANOE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_CANOE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_coach_2D.cpp b/src/d/actor/d_a_coach_2D.cpp index eab333cb8b..4592be183d 100644 --- a/src/d/actor/d_a_coach_2D.cpp +++ b/src/d/actor/d_a_coach_2D.cpp @@ -105,7 +105,7 @@ static int daCoach2D_createHeap(fopAc_ac_c* i_this) { return ((daCoach2D_c*)i_this)->createHeap(); } -static char* l_arcName = "Coach2D"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Coach2D"; static daCoach2D_HIO_c l_HOSTIO; @@ -349,7 +349,7 @@ static int daCoach2D_draw(daCoach2D_c* i_this) { return i_this->draw(); } -static actor_method_class daCoach2D_METHODS = { +static DUSK_CONST actor_method_class daCoach2D_METHODS = { (process_method_func)daCoach2D_create, (process_method_func)daCoach2D_destroy, (process_method_func)daCoach2D_execute, @@ -357,7 +357,7 @@ static actor_method_class daCoach2D_METHODS = { (process_method_func)daCoach2D_draw, }; -actor_process_profile_definition g_profile_COACH2D = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_COACH2D = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_coach_fire.cpp b/src/d/actor/d_a_coach_fire.cpp index 8ffc1b1105..53e2e4de0f 100644 --- a/src/d/actor/d_a_coach_fire.cpp +++ b/src/d/actor/d_a_coach_fire.cpp @@ -7,7 +7,7 @@ #include "d/actor/d_a_coach_fire.h" -CoachFireAttr const daCoachFire_c::M_attr = { +DUSK_GAME_DATA CoachFireAttr const daCoachFire_c::M_attr = { 50.0f, // radius 4.0f, // field_0x04 36, // field_0x08 @@ -155,15 +155,15 @@ static int daCoachFire_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static char* stringBase_80658454 = "Coach"; +static DUSK_CONST char* stringBase_80658454 = "Coach"; -static actor_method_class l_daCoachFire_Method = { +static DUSK_CONST actor_method_class l_daCoachFire_Method = { (process_method_func)daCoachFire_Create, (process_method_func)daCoachFire_Delete, (process_method_func)daCoachFire_Execute, (process_method_func)daCoachFire_IsDelete, (process_method_func)daCoachFire_Draw, }; -actor_process_profile_definition g_profile_COACH_FIRE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_COACH_FIRE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_cow.cpp b/src/d/actor/d_a_cow.cpp index bdb3ab08da..4132b151b0 100644 --- a/src/d/actor/d_a_cow.cpp +++ b/src/d/actor/d_a_cow.cpp @@ -3283,11 +3283,11 @@ static int daCow_IsDelete(void* actor) { return true; } -static actor_method_class daCow_MethodTable = { +static DUSK_CONST actor_method_class daCow_MethodTable = { daCow_Create, daCow_Delete, daCow_Execute, daCow_IsDelete, daCow_Draw, }; -actor_process_profile_definition g_profile_COW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_COW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_crod.cpp b/src/d/actor/d_a_crod.cpp index 0aecb4ab0e..2851c651db 100644 --- a/src/d/actor/d_a_crod.cpp +++ b/src/d/actor/d_a_crod.cpp @@ -376,13 +376,13 @@ static int daCrod_Draw(daCrod_c* i_this) { return i_this->draw(); } -static actor_method_class l_daCrod_Method = { +static DUSK_CONST actor_method_class l_daCrod_Method = { (process_method_func)daCrod_Create, (process_method_func)daCrod_Delete, (process_method_func)daCrod_Execute, (process_method_func)NULL, (process_method_func)daCrod_Draw, }; -actor_process_profile_definition g_profile_CROD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_CROD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_cstaF.cpp b/src/d/actor/d_a_cstaF.cpp index 76b83c8243..e764d4c153 100644 --- a/src/d/actor/d_a_cstaF.cpp +++ b/src/d/actor/d_a_cstaF.cpp @@ -34,7 +34,7 @@ static const char l_arcNameFB[] = "CstaFB"; static const char l_spStageName[8] = "R_SP209"; -const daCstaF_c::BckTbl daCstaF_c::m_bckIdxTable[] = { +DUSK_GAME_DATA const daCstaF_c::BckTbl daCstaF_c::m_bckIdxTable[] = { {9, 9, 8, 7}, {9, 9, 8, 7} }; @@ -571,7 +571,7 @@ static int daCstaF_Draw(daCstaF_c* a_this) { return a_this->MoveBGDraw(); } -static actor_method_class l_daCstaF_Method = { +static DUSK_CONST actor_method_class l_daCstaF_Method = { (process_method_func)daCstaF_Create, (process_method_func)daCstaF_Delete, (process_method_func)daCstaF_Execute, @@ -579,7 +579,7 @@ static actor_method_class l_daCstaF_Method = { (process_method_func)daCstaF_Draw, }; -actor_process_profile_definition g_profile_CSTAF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_CSTAF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_cstatue.cpp b/src/d/actor/d_a_cstatue.cpp index 7dd3ea8a32..906b1f7559 100644 --- a/src/d/actor/d_a_cstatue.cpp +++ b/src/d/actor/d_a_cstatue.cpp @@ -53,7 +53,7 @@ enum CStatueAnimIndex { CStatueAnimIndex_N, }; -u16 const daCstatue_c::m_bckIdxTable[daCstatueType_N][CStatueAnimIndex_N] = { +DUSK_GAME_DATA u16 const daCstatue_c::m_bckIdxTable[daCstatueType_N][CStatueAnimIndex_N] = { // daCstatueType_NORMAL {CStatueAnimSwing, CStatueAnimWalk, CStatueAnimSwing, CStatueAnimFall, CStatueAnimStop, CStatueAnimStart, CStatueAnimSwingre}, @@ -1206,7 +1206,7 @@ static int daCstatue_Draw(daCstatue_c* actor) { return static_cast(actor)->draw(); } -static actor_method_class l_daCstatue_Method = { +static DUSK_CONST actor_method_class l_daCstatue_Method = { (process_method_func)daCstatue_Create, (process_method_func)daCstatue_Delete, (process_method_func)daCstatue_Execute, @@ -1214,7 +1214,7 @@ static actor_method_class l_daCstatue_Method = { (process_method_func)daCstatue_Draw, }; -actor_process_profile_definition g_profile_CSTATUE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_CSTATUE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_demo00.cpp b/src/d/actor/d_a_demo00.cpp index 99ad6c1587..b737083598 100644 --- a/src/d/actor/d_a_demo00.cpp +++ b/src/d/actor/d_a_demo00.cpp @@ -1893,7 +1893,7 @@ class JAUSectionHeap; template<> JAUSectionHeap* JASGlobalInstance::sInstance; -static actor_method_class l_daDemo00_Method = { +static DUSK_CONST actor_method_class l_daDemo00_Method = { (process_method_func)daDemo00_Create, (process_method_func)daDemo00_Delete, (process_method_func)daDemo00_Execute, @@ -1901,7 +1901,7 @@ static actor_method_class l_daDemo00_Method = { (process_method_func)daDemo00_Draw, }; -actor_process_profile_definition g_profile_DEMO00 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DEMO00 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_demo_item.cpp b/src/d/actor/d_a_demo_item.cpp index 6168a6b7e8..209bd483c4 100644 --- a/src/d/actor/d_a_demo_item.cpp +++ b/src/d/actor/d_a_demo_item.cpp @@ -552,7 +552,7 @@ static int daDitem_Draw(daDitem_c* i_this) { return i_this->draw(); } -static actor_method_class l_daDitem_Method = { +static DUSK_CONST actor_method_class l_daDitem_Method = { (process_method_func)daDitem_Create, (process_method_func)daDitem_Delete, (process_method_func)daDitem_Execute, @@ -560,7 +560,7 @@ static actor_method_class l_daDitem_Method = { (process_method_func)daDitem_Draw, }; -actor_process_profile_definition g_profile_Demo_Item = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Demo_Item = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_disappear.cpp b/src/d/actor/d_a_disappear.cpp index 2aec26258f..755de634bd 100644 --- a/src/d/actor/d_a_disappear.cpp +++ b/src/d/actor/d_a_disappear.cpp @@ -116,13 +116,13 @@ static int daDisappear_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daDisappear_Method = { +static DUSK_CONST actor_method_class l_daDisappear_Method = { (process_method_func)daDisappear_Create, (process_method_func)daDisappear_Delete, (process_method_func)daDisappear_Execute, (process_method_func)daDisappear_IsDelete, (process_method_func)daDisappear_Draw, }; -actor_process_profile_definition g_profile_DISAPPEAR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DISAPPEAR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_dmidna.cpp b/src/d/actor/d_a_dmidna.cpp index 09d6187d21..42228f3593 100644 --- a/src/d/actor/d_a_dmidna.cpp +++ b/src/d/actor/d_a_dmidna.cpp @@ -82,13 +82,13 @@ static int daDmidna_Draw(daDmidna_c* i_this) { return i_this->draw(); } -static actor_method_class l_daDmidna_Method = { +static DUSK_CONST actor_method_class l_daDmidna_Method = { (process_method_func)daDmidna_Create, (process_method_func)daDmidna_Delete, (process_method_func)daDmidna_Execute, (process_method_func)NULL, (process_method_func)daDmidna_Draw, }; -actor_process_profile_definition g_profile_DMIDNA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DMIDNA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_do.cpp b/src/d/actor/d_a_do.cpp index ffe31165fa..00fbfa5af9 100644 --- a/src/d/actor/d_a_do.cpp +++ b/src/d/actor/d_a_do.cpp @@ -2492,7 +2492,7 @@ static cPhs_Step daDo_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daDo_Method = { +static DUSK_CONST actor_method_class l_daDo_Method = { (process_method_func)daDo_Create, (process_method_func)daDo_Delete, (process_method_func)daDo_Execute, @@ -2500,7 +2500,7 @@ static actor_method_class l_daDo_Method = { (process_method_func)daDo_Draw, }; -actor_process_profile_definition g_profile_DO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_boss.cpp b/src/d/actor/d_a_door_boss.cpp index bf042b3323..37034cdcc9 100644 --- a/src/d/actor/d_a_door_boss.cpp +++ b/src/d/actor/d_a_door_boss.cpp @@ -12,19 +12,19 @@ #include "d/d_door_param2.h" #include "SSystem/SComponent/c_math.h" -char* daBdoor_c::getArcName() { +DUSK_CONST char* daBdoor_c::getArcName() { return "Z_bdor00"; } -char* daBdoor_c::getBmd() { +DUSK_CONST char* daBdoor_c::getBmd() { return "Z_bdor00.bmd"; } -char* daBdoor_c::getDzb() { +DUSK_CONST char* daBdoor_c::getDzb() { return "door30.dzb"; } -char* daBdoor_c::getBmd2() { +DUSK_CONST char* daBdoor_c::getBmd2() { return "door_shutterBoss.bmd"; } @@ -119,7 +119,7 @@ cPhs_Step daBdoor_c::create() { } int daBdoor_c::getDemoAction() { - static char* action_table[11] = { + static DUSK_CONST char* action_table[11] = { "WAIT", "UNLOCK", "OPEN", @@ -412,7 +412,7 @@ static cPhs_Step daBdoor_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBdoor_Method = { +static DUSK_CONST actor_method_class l_daBdoor_Method = { (process_method_func)daBdoor_Create, (process_method_func)daBdoor_Delete, (process_method_func)daBdoor_Execute, @@ -420,7 +420,7 @@ static actor_method_class l_daBdoor_Method = { (process_method_func)daBdoor_Draw, }; -actor_process_profile_definition g_profile_BOSS_DOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BOSS_DOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_bossL1.cpp b/src/d/actor/d_a_door_bossL1.cpp index 649ebbd5f3..5dc5dc5631 100644 --- a/src/d/actor/d_a_door_bossL1.cpp +++ b/src/d/actor/d_a_door_bossL1.cpp @@ -15,7 +15,7 @@ #include "f_op/f_op_actor_mng.h" #include -static char* l_stageName[20] = { +static DUSK_CONST char* l_stageName[20] = { "D_MN05", "D_MN05A", "D_MN04", @@ -50,7 +50,7 @@ static int getNowLevel() { return -1; } -char* daBdoorL1_c::getDoorEventName() { +DUSK_CONST char* daBdoorL1_c::getDoorEventName() { switch (getNowLevel()) { case 1: return "DEFAULT_BS_SHUTTER_L1_F"; @@ -71,7 +71,7 @@ char* daBdoorL1_c::getDoorEventName() { } } -char* daBdoorL1_c::getDoorEventName2() { +DUSK_CONST char* daBdoorL1_c::getDoorEventName2() { switch (getNowLevel()) { case 1: return "DEFAULT_BS_SHUTTER_L1_F_2"; @@ -230,7 +230,7 @@ int daBdoorL1_c::CreateHeap() { return 1; } -static char* action_table[18] = { +static DUSK_CONST char* action_table[18] = { "WAIT", "SETANGLE", "UNLOCK", @@ -972,7 +972,7 @@ static int daBdoorL1_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBdoorL1_Method = { +static DUSK_CONST actor_method_class l_daBdoorL1_Method = { (process_method_func)daBdoorL1_Create, (process_method_func)daBdoorL1_Delete, (process_method_func)daBdoorL1_Execute, @@ -980,7 +980,7 @@ static actor_method_class l_daBdoorL1_Method = { (process_method_func)daBdoorL1_Draw, }; -actor_process_profile_definition g_profile_L1BOSS_DOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_L1BOSS_DOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_bossL5.cpp b/src/d/actor/d_a_door_bossL5.cpp index 34dac15fa9..d4c05b4685 100644 --- a/src/d/actor/d_a_door_bossL5.cpp +++ b/src/d/actor/d_a_door_bossL5.cpp @@ -54,7 +54,7 @@ static char const l_door_open_demo_1st[26] = "DEFAULT_BS_SHUTTER_L5_1ST"; static char const l_staff_name[13] = "SHUTTER_DOOR"; -static char* action_table[14] = { +static DUSK_CONSTEXPR char DUSK_CONST* action_table[14] = { "WAIT", "UNLOCK", "OPEN", @@ -498,7 +498,7 @@ static int daBdoorL5_Create(fopAc_ac_c* i_this) { } -static actor_method_class l_daBdoorL5_Method = { +static DUSK_CONST actor_method_class l_daBdoorL5_Method = { (process_method_func)daBdoorL5_Create, (process_method_func)daBdoorL5_Delete, (process_method_func)daBdoorL5_Execute, @@ -506,7 +506,7 @@ static actor_method_class l_daBdoorL5_Method = { (process_method_func)daBdoorL5_Draw, }; -actor_process_profile_definition g_profile_L5BOSS_DOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_L5BOSS_DOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_dbdoor00.cpp b/src/d/actor/d_a_door_dbdoor00.cpp index c659a47cb2..2aa1f4e23f 100644 --- a/src/d/actor/d_a_door_dbdoor00.cpp +++ b/src/d/actor/d_a_door_dbdoor00.cpp @@ -27,31 +27,31 @@ static int nodeCallBack(J3DJoint* i_joint, int param_1) { return 1; } -static char* dummyStringFunc() { +static DUSK_CONST char* dummyStringFunc() { return "door-pushDouble_"; } -char* daDbDoor00_c::getAlwaysArcName() { +DUSK_CONST char* daDbDoor00_c::getAlwaysArcName() { return "static"; } -char* daDbDoor00_c::getDzb() { +DUSK_CONST char* daDbDoor00_c::getDzb() { return "door-pushDouble.dzb"; } -char* daDbDoor00_c::getDummyBmdName() { +DUSK_CONST char* daDbDoor00_c::getDummyBmdName() { return "door-pushDoubleDummy.bmd"; } -char* daDbDoor00_c::getBmdArcName() { +DUSK_CONST char* daDbDoor00_c::getBmdArcName() { return "DbDoor0"; } -static char* l_bmd_base_name = "door-pushDouble_"; +static DUSK_CONST char* l_bmd_base_name = "door-pushDouble_"; -char* daDbDoor00_c::getBmdName() { +DUSK_CONST char* daDbDoor00_c::getBmdName() { static char l_bmdName[32]; - sprintf(l_bmdName, "%s%02d.bmd", l_bmd_base_name, door_param2_c::getDoorModel(this)); + SAFE_SPRINTF(l_bmdName, "%s%02d.bmd", l_bmd_base_name, door_param2_c::getDoorModel(this)); return l_bmdName; } @@ -167,7 +167,7 @@ int daDbDoor00_c::create() { } int daDbDoor00_c::getDemoAction() { - static char* action_table[9] = { + static DUSK_CONST char* action_table[9] = { "WAIT", "SET_START", "SET_ANGLE", "END", "OPEN", "STOP_OPEN", "SET_GOAL", "SET_GOAL2", "ADJUSTMENT", }; @@ -408,13 +408,13 @@ static int daDbdoor00_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daDbdoor00_Method = { +static DUSK_CONST actor_method_class l_daDbdoor00_Method = { (process_method_func)daDbdoor00_Create, (process_method_func)daDbdoor00_Delete, (process_method_func)daDbdoor00_Execute, (process_method_func)daDbdoor00_IsDelete, (process_method_func)daDbdoor00_Draw, }; -actor_process_profile_definition g_profile_DBDOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DBDOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_knob00.cpp b/src/d/actor/d_a_door_knob00.cpp index 50d5723261..918ac2fb71 100644 --- a/src/d/actor/d_a_door_knob00.cpp +++ b/src/d/actor/d_a_door_knob00.cpp @@ -30,32 +30,32 @@ u8 knob_param_c::getExitNo(fopAc_ac_c* i_this) { return fopAcM_GetParamBit(i_this, 25, 6); } -static char* dummyStringFunc() { +static DUSK_CONST char* dummyStringFunc() { return "door-knob_"; } -char* daKnob20_c::getAlwaysArcName() { +DUSK_CONST char* daKnob20_c::getAlwaysArcName() { return "static"; } -char* daKnob20_c::getEvArcName() { +DUSK_CONST char* daKnob20_c::getEvArcName() { return "DoorK10"; } -char* daKnob20_c::getDzb() { +DUSK_CONST char* daKnob20_c::getDzb() { return "door-knob.dzb"; } -char* daKnob20_c::getDummyBmd() { +DUSK_CONST char* daKnob20_c::getDummyBmd() { return "door-knobDummy.bmd"; } -static char* l_bmd_base_name = "door-knob_"; +static DUSK_CONST char* l_bmd_base_name = "door-knob_"; -char* daKnob20_c::getBmd() { +DUSK_CONST char* daKnob20_c::getBmd() { static char l_bmdName[32]; - sprintf(l_bmdName, "%s%02d.bmd", l_bmd_base_name, knob_param_c::getDoorModel(this)); + SAFE_SPRINTF(l_bmdName, "%s%02d.bmd", l_bmd_base_name, knob_param_c::getDoorModel(this)); return l_bmdName; } @@ -194,7 +194,7 @@ void daKnob20_c::setActionFromFlow() { } void daKnob20_c::setEventId() { - static char* ev_name_table[7] = { + static DUSK_CONSTEXPR char DUSK_CONST* ev_name_table[7] = { "DEFAULT_KNOB_DOOR_F_OPEN", "DEFAULT_KNOB_DOOR_B_OPEN", "DEFAULT_KNOB_TALK", @@ -296,7 +296,7 @@ int daKnob20_c::frontCheck() { } int daKnob20_c::getDemoAction() { - static char* action_table[16] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[16] = { "WAIT", "SETSTART", "SETANGLE", @@ -463,7 +463,7 @@ int daKnob20_c::adjustmentProc() { } int daKnob20_c::openInit(int param_1) { - static char* bck_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* bck_table[4] = { "FDoorA.bck", "FDoorB.bck", "FDoorA.bck", @@ -694,13 +694,13 @@ static int daKnob20_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daKnob20_Method = { +static DUSK_CONST actor_method_class l_daKnob20_Method = { (process_method_func)daKnob20_Create, (process_method_func)daKnob20_Delete, (process_method_func)daKnob20_Execute, (process_method_func)NULL, (process_method_func)daKnob20_Draw, }; -actor_process_profile_definition g_profile_KNOB20 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KNOB20 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_mbossL1.cpp b/src/d/actor/d_a_door_mbossL1.cpp index 5dfd3bb96c..a982d0af20 100644 --- a/src/d/actor/d_a_door_mbossL1.cpp +++ b/src/d/actor/d_a_door_mbossL1.cpp @@ -57,7 +57,7 @@ static u16 const l_stop_heap_size[12] = { 0x0EA0, 0x0800, 0x0EB0, 0x0800, 0x0800, 0x1BD0, }; -static char* l_door_open_demo[11] = { +static DUSK_CONST char* l_door_open_demo[11] = { NULL, "DEFAULT_MBS_SHUTTER_L1_F", "DEFAULT_MBS_SHUTTER_L1_F", @@ -71,7 +71,7 @@ static char* l_door_open_demo[11] = { "DEFAULT_MBS_SHUTTER_L7_F", }; -static char* l_door_open_demoB[11] = { +static DUSK_CONST char* l_door_open_demoB[11] = { NULL, "DEFAULT_MBS_SHUTTER_L1_B", "DEFAULT_MBS_SHUTTER_L1_B", @@ -85,7 +85,7 @@ static char* l_door_open_demoB[11] = { "DEFAULT_MBS_SHUTTER_L7_B", }; -static char* l_door_open_demoLv5[4] = { +static DUSK_CONST char* l_door_open_demoLv5[4] = { "DEFAULT_MBS_KNOB_OPEN_B", "DEFAULT_MBS_KNOB_OPEN_F", "DEFAULT_MBS_KNOB_NOTOPEN_B", @@ -193,7 +193,7 @@ f32 dDoor_stop2_c::getHeight() { } -char* daMBdoorL1_c::getAnmArcName() { +DUSK_CONST char* daMBdoorL1_c::getAnmArcName() { switch(getDoorType()) { case 0: return "DoorY00"; @@ -205,7 +205,7 @@ char* daMBdoorL1_c::getAnmArcName() { return "DoorT00"; } -char* daMBdoorL1_c::getArcName() { +DUSK_CONST char* daMBdoorL1_c::getArcName() { switch (getNowLevel(this)) { case 0: case 1: @@ -228,7 +228,7 @@ char* daMBdoorL1_c::getArcName() { } } -char* daMBdoorL1_c::getAlwaysArcName() { +DUSK_CONST char* daMBdoorL1_c::getAlwaysArcName() { return "static"; } @@ -245,7 +245,7 @@ int daMBdoorL1_c::getDoorType() { } } -char* daMBdoorL1_c::getOpenAnm() { +DUSK_CONST char* daMBdoorL1_c::getOpenAnm() { if (getDoorType() == DOOR_TYPE_1) { return "oj_DoorOpD.bck"; } @@ -255,7 +255,7 @@ char* daMBdoorL1_c::getOpenAnm() { return NULL; } -char* daMBdoorL1_c::getCloseAnm() { +DUSK_CONST char* daMBdoorL1_c::getCloseAnm() { if (getDoorType() == DOOR_TYPE_1) { return "oj_DoorCloseD.bck"; } @@ -265,7 +265,7 @@ char* daMBdoorL1_c::getCloseAnm() { return NULL; } -char* daMBdoorL1_c::getBmd() { +DUSK_CONST char* daMBdoorL1_c::getBmd() { switch(getNowLevel(this)) { case 5: case 11: @@ -275,11 +275,11 @@ char* daMBdoorL1_c::getBmd() { } } -char* daMBdoorL1_c::getBtk() { +DUSK_CONST char* daMBdoorL1_c::getBtk() { return "door-shutter_00.btk"; } -char* daMBdoorL1_c::getDzb() { +DUSK_CONST char* daMBdoorL1_c::getDzb() { if (getNowLevel(this) == 5) { return "door-shutter.dzb"; } @@ -529,7 +529,7 @@ int daMBdoorL1_c::create() { } int daMBdoorL1_c::getDemoAction() { - static char* action_table[26] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[26] = { "WAIT", "SETANGLE", "UNLOCK", @@ -1066,7 +1066,7 @@ int daMBdoorL1_c::unlock() { } int daMBdoorL1_c::openInitKnob(int param_1) { - static char* bck_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* bck_table[4] = { "FDoorA.bck", "FDoorB.bck", "FDoorA.bck", @@ -1723,7 +1723,7 @@ static int daMBdoorL1_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daMBdoorL1_Method = { +static DUSK_CONST actor_method_class l_daMBdoorL1_Method = { (process_method_func)daMBdoorL1_Create, (process_method_func)daMBdoorL1_Delete, (process_method_func)daMBdoorL1_Execute, @@ -1731,7 +1731,7 @@ static actor_method_class l_daMBdoorL1_Method = { (process_method_func)daMBdoorL1_Draw, }; -actor_process_profile_definition g_profile_L1MBOSS_DOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_L1MBOSS_DOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_push.cpp b/src/d/actor/d_a_door_push.cpp index 78e9156294..531f5be5f6 100644 --- a/src/d/actor/d_a_door_push.cpp +++ b/src/d/actor/d_a_door_push.cpp @@ -74,9 +74,9 @@ void daDoorPush_c::setBaseMtx() { } } -static char* l_arcName = "V_OsuDoor"; +static DUSK_CONST char* l_arcName = "V_OsuDoor"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-600.0f, 0.0f, -600.0f}, {600.0f, 1000.0f, 600.0f}, }; @@ -233,7 +233,7 @@ void daDoorPush_c::actionEvent() { } int daDoorPush_c::demoProc() { - static char* action_table[3] = {"WAIT", "OPEN", "SCENE_CHG"}; + static DUSK_CONST char* action_table[3] = {"WAIT", "OPEN", "SCENE_CHG"}; daPy_py_c* player = daPy_getPlayerActorClass(); @@ -364,13 +364,13 @@ static int daDoorPush_MoveBGDraw(daDoorPush_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daDoorPush_METHODS = { +static DUSK_CONST actor_method_class daDoorPush_METHODS = { (process_method_func)daDoorPush_create1st, (process_method_func)daDoorPush_MoveBGDelete, (process_method_func)daDoorPush_MoveBGExecute, (process_method_func)NULL, (process_method_func)daDoorPush_MoveBGDraw, }; -actor_process_profile_definition g_profile_PushDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_PushDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_shutter.cpp b/src/d/actor/d_a_door_shutter.cpp index ebd1c9a185..3b7cdcc5f2 100644 --- a/src/d/actor/d_a_door_shutter.cpp +++ b/src/d/actor/d_a_door_shutter.cpp @@ -22,7 +22,7 @@ #include #endif -char* daDoor20_c::getStopBmdName() { +char DUSK_CONST* daDoor20_c::getStopBmdName() { switch (door_param2_c::getKind(this)) { case 3: case 11: @@ -35,11 +35,11 @@ J3DModelData* daDoor20_c::getStopModelData() { return (J3DModelData*)dComIfG_getStageRes(getStopBmdName()); } -char* daDoor20_c::getAlwaysArcName() { +char DUSK_CONST* daDoor20_c::getAlwaysArcName() { return "static"; } -char* daDoor20_c::getArcName() { +char DUSK_CONST* daDoor20_c::getArcName() { switch (door_param2_c::getKind(this)) { default: return "DoorT00"; @@ -56,7 +56,7 @@ char* daDoor20_c::getArcName() { } } -char* daDoor20_c::getBmdName() { +char DUSK_CONST* daDoor20_c::getBmdName() { static char bmdName[32]; switch(door_param2_c::getKind(this)) { case 0: @@ -65,20 +65,20 @@ char* daDoor20_c::getBmdName() { case 10: case 12: default: - sprintf(bmdName, "door-shutter_%02d.bmd", door_param2_c::getDoorModel(this)); + SAFE_SPRINTF(bmdName, "door-shutter_%02d.bmd", door_param2_c::getDoorModel(this)); break; case 9: - sprintf(bmdName, "door-knob_%02d.bmd", door_param2_c::getDoorModel(this)); + SAFE_SPRINTF(bmdName, "door-knob_%02d.bmd", door_param2_c::getDoorModel(this)); break; } return bmdName; } -char* daDoor20_c::getBtk() { +char DUSK_CONST* daDoor20_c::getBtk() { return "door-shutter_00.btk"; } -char* daDoor20_c::getDzbName() { +char DUSK_CONST* daDoor20_c::getDzbName() { switch(door_param2_c::getKind(this)) { case 0: case 1: @@ -1536,7 +1536,7 @@ void daDoor20_c::startDemoProc() { } void daDoor20_c::makeEventId() { - static char* table[19] = { + static DUSK_CONSTEXPR char DUSK_CONST* table[19] = { "DEFAULT_STOP_OPEN", "DEFAULT_STOP_OPEN", NULL, @@ -1558,49 +1558,49 @@ void daDoor20_c::makeEventId() { NULL, }; - static char* tate_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* tate_table[4] = { "DEFAULT_SHUTTER_DOOR_10", "DEFAULT_SHUTTER_DOOR_10", "DEFAULT_SHUTTER_DOOR_F_STOP", "DEFAULT_SHUTTER_DOOR_F_STOP", }; - static char* tate_w_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* tate_w_table[4] = { "WOLF_SHUTTER_DOOR_10", "WOLF_SHUTTER_DOOR_10", "WOLF_SHUTTER_DOOR_F_STOP", "WOLF_SHUTTER_DOOR_F_STOP", }; - static char* yoko_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* yoko_table[4] = { "DEFAULT_SHUTTER_DOOR_14", "DEFAULT_SHUTTER_DOOR_14", "DEFAULT_SHUTTER_DOOR_F_STOP_14", "DEFAULT_SHUTTER_DOOR_F_STOP_14", }; - static char* yoko_w_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* yoko_w_table[4] = { "WOLF_SHUTTER_DOOR_14", "WOLF_SHUTTER_DOOR_14", "WOLF_SHUTTER_DOOR_F_STOP_14", "WOLF_SHUTTER_DOOR_F_STOP_14", }; - static char* lv8_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* lv8_table[4] = { "DEFAULT_SHUTTER_DOOR_18", "DEFAULT_SHUTTER_DOOR_18", "DEFAULT_SHUTTER_DOOR_F_STOP_18", "DEFAULT_SHUTTER_DOOR_F_STOP_18", }; - static char* lv8_w_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* lv8_w_table[4] = { "WOLF_SHUTTER_DOOR_18", "WOLF_SHUTTER_DOOR_18", "WOLF_SHUTTER_DOOR_F_STOP_18", "WOLF_SHUTTER_DOOR_F_STOP_18", }; - static char* knob_table[7] = { + static DUSK_CONSTEXPR char DUSK_CONST* knob_table[7] = { "DEFAULT_KNOB_DOOR_F", "DEFAULT_KNOB_DOOR_B", "DEFAULT_KNOB_DOOR_F_STOP", @@ -1610,28 +1610,28 @@ void daDoor20_c::makeEventId() { "DEFAULT_KNOB_DOOR_TALK_NOTOPEN_F", }; - static char* lv7_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* lv7_table[4] = { "DEFAULT_SHUTTER_DOOR_20", "DEFAULT_SHUTTER_DOOR_20", "DEFAULT_SHUTTER_DOOR_F_STOP_20", "DEFAULT_SHUTTER_DOOR_F_STOP_20", }; - static char* lv7_w_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* lv7_w_table[4] = { "WOLF_SHUTTER_DOOR_20", "WOLF_SHUTTER_DOOR_20", "WOLF_SHUTTER_DOOR_F_STOP_20", "WOLF_SHUTTER_DOOR_F_STOP_20", }; - static char* lv9_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* lv9_table[4] = { "DEFAULT_SHUTTER_DOOR_22", "DEFAULT_SHUTTER_DOOR_22", "DEFAULT_SHUTTER_DOOR_F_STOP_22", "DEFAULT_SHUTTER_DOOR_F_STOP_22", }; - static char* lv9_w_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* lv9_w_table[4] = { "WOLF_SHUTTER_DOOR_22", "WOLF_SHUTTER_DOOR_22", "WOLF_SHUTTER_DOOR_F_STOP_22", @@ -1842,7 +1842,7 @@ void daDoor20_c::getRestartPos(cXyz* param_1) { } int daDoor20_c::getDemoAction() { - static char* action_table[29] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[29] = { "WAIT", "STOP_OPEN", "STOP_CLOSE", @@ -2151,13 +2151,13 @@ static int daDoor20_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daDoor20_Method = { +static DUSK_CONST actor_method_class l_daDoor20_Method = { (process_method_func)daDoor20_Create, (process_method_func)daDoor20_Delete, (process_method_func)daDoor20_Execute, (process_method_func)NULL, (process_method_func)daDoor20_Draw, }; -actor_process_profile_definition g_profile_DOOR20 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_DOOR20 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_door_spiral.cpp b/src/d/actor/d_a_door_spiral.cpp index b7c7567787..6d103cca70 100644 --- a/src/d/actor/d_a_door_spiral.cpp +++ b/src/d/actor/d_a_door_spiral.cpp @@ -94,9 +94,9 @@ const char* daSpiral_c::getBmd(int i_type) { const char* daSpiral_c::getBmd2(int i_type) { static char bmdName[32]; if (i_type == daSpiral_TYPE_DOWN_e) { - sprintf(bmdName, "door-stairSpiralU.bmd"); + SAFE_SPRINTF(bmdName, "door-stairSpiralU.bmd"); } else { - sprintf(bmdName, "door-stairSpiralD.bmd"); + SAFE_SPRINTF(bmdName, "door-stairSpiralD.bmd"); } return bmdName; @@ -432,7 +432,7 @@ void daSpiral_c::initOpenDemo(int param_0) { } int daSpiral_c::getDemoAction() { - static char* action_table[] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[] = { "WAIT", "START", "SETGOAL", @@ -1178,7 +1178,7 @@ int daSpiral_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daSpiral_Method = { +static DUSK_CONST actor_method_class l_daSpiral_Method = { (process_method_func)daSpiral_Create, (process_method_func)daSpiral_Delete, (process_method_func)daSpiral_Execute, (process_method_func)NULL, (process_method_func)daSpiral_Draw, @@ -1191,7 +1191,7 @@ static actor_method_class l_daSpiral_Method = { #define DASPIRAL_METHODS NULL #endif -actor_process_profile_definition g_profile_SPIRAL_DOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SPIRAL_DOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_dshutter.cpp b/src/d/actor/d_a_dshutter.cpp index 264f559e07..4d7bdc14dd 100644 --- a/src/d/actor/d_a_dshutter.cpp +++ b/src/d/actor/d_a_dshutter.cpp @@ -9,7 +9,7 @@ #include "SSystem/SComponent/c_math.h" #include "Z2AudioLib/Z2Instances.h" -static char* l_arcName[] = { +static DUSK_CONST char* l_arcName[] = { "K_tetd", "S_bsaku00", "S_lv7saku", @@ -247,13 +247,13 @@ static int daDsh_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daDsh_Method = { +static DUSK_CONST actor_method_class l_daDsh_Method = { (process_method_func)daDsh_Create, (process_method_func)daDsh_Delete, (process_method_func)daDsh_Execute, (process_method_func)daDsh_IsDelete, (process_method_func)daDsh_Draw, }; -actor_process_profile_definition2 g_profile_DSHUTTER = { +DUSK_PROFILE actor_process_profile_definition2 DUSK_CONST g_profile_DSHUTTER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ai.cpp b/src/d/actor/d_a_e_ai.cpp index d9f0c5fadd..251a026b88 100644 --- a/src/d/actor/d_a_e_ai.cpp +++ b/src/d/actor/d_a_e_ai.cpp @@ -71,7 +71,7 @@ void e_ai_class::initCcCylinder() { m_ccShieldSph.SetStts(&m_ccShieldStts); m_ccShieldSph.OnCoSetBit(); - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xdafbf9ff, 0x43}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -942,7 +942,7 @@ static int daE_AI_Create(fopAc_ac_c* i_this) { return ((e_ai_class*)i_this)->Create(); } -static actor_method_class l_daE_AI_Method = { +static DUSK_CONST actor_method_class l_daE_AI_Method = { (process_method_func)daE_AI_Create, (process_method_func)daE_AI_Delete, (process_method_func)daE_AI_Execute, @@ -950,7 +950,7 @@ static actor_method_class l_daE_AI_Method = { (process_method_func)daE_AI_Draw, }; -actor_process_profile_definition g_profile_E_AI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_AI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_arrow.cpp b/src/d/actor/d_a_e_arrow.cpp index 11746e3a76..f4acdd918e 100644 --- a/src/d/actor/d_a_e_arrow.cpp +++ b/src/d/actor/d_a_e_arrow.cpp @@ -674,7 +674,29 @@ static int daE_ARROW_Create(fopAc_ac_c* i_this) { } int phase_state = dComIfG_resLoad(&a_this->mPhase, a_this->mResName); +#if TARGET_PC + static int s_create_frames = 0; + static bool s_first_arrow = true; + static fpc_ProcID s_last_scene_id = 0; + + s_create_frames++; + fpc_ProcID cur_scene_id = dStage_roomControl_c::getProcID(); + + if (cur_scene_id != s_last_scene_id) { + s_first_arrow = true; + s_last_scene_id = cur_scene_id; + } + + if (phase_state == cPhs_COMPLEATE_e && s_first_arrow && s_create_frames < 4) { + return cPhs_INIT_e; + } +#endif if (phase_state == cPhs_COMPLEATE_e) { +#if TARGET_PC + s_create_frames = 0; + s_first_arrow = false; +#endif + a_this->mArrowType = fopAcM_GetParam(a_this) & 0xF; a_this->mFlags = fopAcM_GetParam(a_this) & 0xF0; @@ -747,13 +769,13 @@ static int daE_ARROW_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_ARROW_Method = { +static DUSK_CONST actor_method_class l_daE_ARROW_Method = { (process_method_func)daE_ARROW_Create, (process_method_func)daE_ARROW_Delete, (process_method_func)daE_ARROW_Execute, (process_method_func)daE_ARROW_IsDelete, (process_method_func)daE_ARROW_Draw, }; -actor_process_profile_definition g_profile_E_ARROW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_ARROW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ba.cpp b/src/d/actor/d_a_e_ba.cpp index 65aeb2e442..83afd65004 100644 --- a/src/d/actor/d_a_e_ba.cpp +++ b/src/d/actor/d_a_e_ba.cpp @@ -990,9 +990,9 @@ static int useHeapInit(fopAc_ac_c* i_this) { } static cPhs_Step daE_BA_Create(fopAc_ac_c* i_this) { - static char* arc_name[3] = {"E_ba", "E_fb", "E_ib"}; + static DUSK_CONST char* arc_name[3] = {"E_ba", "E_fb", "E_ib"}; - static dCcD_SrcSph cc_sph_src = { + static DUSK_CONSTEXPR dCcD_SrcSph cc_sph_src = { { {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_HARD_BODY, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1096,7 +1096,7 @@ static cPhs_Step daE_BA_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daE_BA_Method = { +static DUSK_CONST actor_method_class l_daE_BA_Method = { (process_method_func)daE_BA_Create, (process_method_func)daE_BA_Delete, (process_method_func)daE_BA_Execute, @@ -1104,7 +1104,7 @@ static actor_method_class l_daE_BA_Method = { (process_method_func)daE_BA_Draw, }; -actor_process_profile_definition g_profile_E_BA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bee.cpp b/src/d/actor/d_a_e_bee.cpp index d3d308c418..09909f9e0a 100644 --- a/src/d/actor/d_a_e_bee.cpp +++ b/src/d/actor/d_a_e_bee.cpp @@ -762,7 +762,7 @@ static cPhs_Step daE_Bee_Create(fopAc_ac_c* i_this) { _this->mCounter = fopAcM_GetID(i_this); _this->mCcStts.Init(0, 0, i_this); - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x410022, 0x23}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -807,7 +807,7 @@ static cPhs_Step daE_Bee_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daE_Bee_Method = { +static DUSK_CONST actor_method_class l_daE_Bee_Method = { (process_method_func)daE_Bee_Create, (process_method_func)daE_Bee_Delete, (process_method_func)daE_Bee_Execute, @@ -815,7 +815,7 @@ static actor_method_class l_daE_Bee_Method = { (process_method_func)daE_Bee_Draw, }; -actor_process_profile_definition g_profile_E_BEE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BEE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bg.cpp b/src/d/actor/d_a_e_bg.cpp index 1b1ec722ca..bdaca15723 100644 --- a/src/d/actor/d_a_e_bg.cpp +++ b/src/d/actor/d_a_e_bg.cpp @@ -1429,7 +1429,7 @@ static int daE_BG_Create(daE_BG_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_BG_Method = { +static DUSK_CONST actor_method_class l_daE_BG_Method = { (process_method_func)daE_BG_Create, (process_method_func)daE_BG_Delete, (process_method_func)daE_BG_Execute, @@ -1437,7 +1437,7 @@ static actor_method_class l_daE_BG_Method = { (process_method_func)daE_BG_Draw, }; -actor_process_profile_definition g_profile_E_BG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bi.cpp b/src/d/actor/d_a_e_bi.cpp index c9284aa356..b6027badd3 100644 --- a/src/d/actor/d_a_e_bi.cpp +++ b/src/d/actor/d_a_e_bi.cpp @@ -908,7 +908,7 @@ static cPhs_Step daE_BI_Create(fopAc_ac_c* actor) { actor->health = 30; actor->field_0x560 = 30; - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -987,7 +987,7 @@ static cPhs_Step daE_BI_Create(fopAc_ac_c* actor) { AUDIO_INSTANCES; -static actor_method_class l_daE_BI_Method = { +static DUSK_CONST actor_method_class l_daE_BI_Method = { (process_method_func)daE_BI_Create, (process_method_func)daE_BI_Delete, (process_method_func)daE_BI_Execute, @@ -995,7 +995,7 @@ static actor_method_class l_daE_BI_Method = { (process_method_func)daE_BI_Draw, }; -actor_process_profile_definition g_profile_E_BI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bi_leaf.cpp b/src/d/actor/d_a_e_bi_leaf.cpp index ed2000b3c5..ef17113b43 100644 --- a/src/d/actor/d_a_e_bi_leaf.cpp +++ b/src/d/actor/d_a_e_bi_leaf.cpp @@ -116,13 +116,13 @@ static int daE_BI_LEAF_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daE_BI_LEAF_Method = { +static DUSK_CONST actor_method_class l_daE_BI_LEAF_Method = { (process_method_func)daE_BI_LEAF_Create, (process_method_func)daE_BI_LEAF_Delete, (process_method_func)daE_BI_LEAF_Execute, (process_method_func)daE_BI_LEAF_IsDelete, (process_method_func)daE_BI_LEAF_Draw, }; -actor_process_profile_definition g_profile_E_BI_LEAF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BI_LEAF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bs.cpp b/src/d/actor/d_a_e_bs.cpp index 64350e0264..30ab4a7658 100644 --- a/src/d/actor/d_a_e_bs.cpp +++ b/src/d/actor/d_a_e_bs.cpp @@ -920,7 +920,7 @@ static int daE_BS_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_BS_Method = { +static DUSK_CONST actor_method_class l_daE_BS_Method = { (process_method_func)daE_BS_Create, (process_method_func)daE_BS_Delete, (process_method_func)daE_BS_Execute, @@ -928,7 +928,7 @@ static actor_method_class l_daE_BS_Method = { (process_method_func)daE_BS_Draw, }; -actor_process_profile_definition g_profile_E_BS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bu.cpp b/src/d/actor/d_a_e_bu.cpp index cd8a3cf766..b3ed379a76 100644 --- a/src/d/actor/d_a_e_bu.cpp +++ b/src/d/actor/d_a_e_bu.cpp @@ -1128,7 +1128,7 @@ static int daE_BU_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_BU_Method = { +static DUSK_CONST actor_method_class l_daE_BU_Method = { (process_method_func)daE_BU_Create, (process_method_func)daE_BU_Delete, (process_method_func)daE_BU_Execute, @@ -1136,7 +1136,7 @@ static actor_method_class l_daE_BU_Method = { (process_method_func)daE_BU_Draw, }; -actor_process_profile_definition g_profile_E_BU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_bug.cpp b/src/d/actor/d_a_e_bug.cpp index e9ad4ab32c..0fb63e4a3b 100644 --- a/src/d/actor/d_a_e_bug.cpp +++ b/src/d/actor/d_a_e_bug.cpp @@ -893,7 +893,7 @@ static cPhs_Step daE_Bug_Create(fopAc_ac_c* a_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_Bug_Method = { +static DUSK_CONST actor_method_class l_daE_Bug_Method = { (process_method_func)daE_Bug_Create, (process_method_func)daE_Bug_Delete, (process_method_func)daE_Bug_Execute, @@ -901,7 +901,7 @@ static actor_method_class l_daE_Bug_Method = { (process_method_func)daE_Bug_Draw, }; -actor_process_profile_definition g_profile_E_BUG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_BUG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_cr.cpp b/src/d/actor/d_a_e_cr.cpp index ac245c6985..f9367cc242 100644 --- a/src/d/actor/d_a_e_cr.cpp +++ b/src/d/actor/d_a_e_cr.cpp @@ -537,7 +537,7 @@ static int daE_CR_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_CR_Method = { +static DUSK_CONST actor_method_class l_daE_CR_Method = { (process_method_func)daE_CR_Create, (process_method_func)daE_CR_Delete, (process_method_func)daE_CR_Execute, @@ -545,7 +545,7 @@ static actor_method_class l_daE_CR_Method = { (process_method_func)daE_CR_Draw, }; -actor_process_profile_definition g_profile_E_CR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_CR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_cr_egg.cpp b/src/d/actor/d_a_e_cr_egg.cpp index fa3c60f270..8ccfbcd519 100644 --- a/src/d/actor/d_a_e_cr_egg.cpp +++ b/src/d/actor/d_a_e_cr_egg.cpp @@ -215,7 +215,7 @@ static int daE_CR_EGG_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_CR_EGG_Method = { +static DUSK_CONST actor_method_class l_daE_CR_EGG_Method = { (process_method_func)daE_CR_EGG_Create, (process_method_func)daE_CR_EGG_Delete, (process_method_func)daE_CR_EGG_Execute, @@ -223,7 +223,7 @@ static actor_method_class l_daE_CR_EGG_Method = { (process_method_func)daE_CR_EGG_Draw, }; -actor_process_profile_definition g_profile_E_CR_EGG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_CR_EGG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_db.cpp b/src/d/actor/d_a_e_db.cpp index 4d60fbd6f6..dcc3849756 100644 --- a/src/d/actor/d_a_e_db.cpp +++ b/src/d/actor/d_a_e_db.cpp @@ -116,7 +116,7 @@ static int daE_DB_Draw(e_db_class* i_this) { i_this->stalkLine.update(12, l_color, &actor->tevStr); dComIfGd_set3DlineMat(&i_this->stalkLine); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mStalkLineInterpCurrValid) { memcpy(i_this->mStalkLineInterpPrev, i_this->mStalkLineInterpCurr, sizeof(i_this->mStalkLineInterpCurr)); i_this->mStalkLineInterpPrevValid = true; @@ -2228,7 +2228,7 @@ static int daE_DB_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_DB_Method = { +static DUSK_CONST actor_method_class l_daE_DB_Method = { (process_method_func)daE_DB_Create, (process_method_func)daE_DB_Delete, (process_method_func)daE_DB_Execute, @@ -2236,7 +2236,7 @@ static actor_method_class l_daE_DB_Method = { (process_method_func)daE_DB_Draw, }; -actor_process_profile_definition g_profile_E_DB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_db_leaf.cpp b/src/d/actor/d_a_e_db_leaf.cpp index c712a437fa..cb8e54093c 100644 --- a/src/d/actor/d_a_e_db_leaf.cpp +++ b/src/d/actor/d_a_e_db_leaf.cpp @@ -59,7 +59,7 @@ static int daE_DB_LEAF_Create(fopAc_ac_c* i_this) { return ret; } -static actor_method_class l_daE_DB_LEAF_Method = { +static DUSK_CONST actor_method_class l_daE_DB_LEAF_Method = { (process_method_func)daE_DB_LEAF_Create, (process_method_func)daE_DB_LEAF_Delete, (process_method_func)daE_DB_LEAF_Execute, @@ -67,7 +67,7 @@ static actor_method_class l_daE_DB_LEAF_Method = { (process_method_func)daE_DB_LEAF_Draw, }; -actor_process_profile_definition g_profile_E_DB_LEAF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DB_LEAF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_dd.cpp b/src/d/actor/d_a_e_dd.cpp index 360fa65442..76af1183b3 100644 --- a/src/d/actor/d_a_e_dd.cpp +++ b/src/d/actor/d_a_e_dd.cpp @@ -1775,7 +1775,7 @@ static cPhs_Step daE_DD_Create(fopAc_ac_c* a_this) { return phase; } -actor_method_class l_daE_DD_Method = { +DUSK_GAME_DATA actor_method_class l_daE_DD_Method = { (process_method_func)daE_DD_Create, (process_method_func)daE_DD_Delete, (process_method_func)daE_DD_Execute, @@ -1783,7 +1783,7 @@ actor_method_class l_daE_DD_Method = { (process_method_func)daE_DD_Draw, }; -actor_process_profile_definition g_profile_E_DD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_df.cpp b/src/d/actor/d_a_e_df.cpp index 1039e2ddf7..fb7d472dfc 100644 --- a/src/d/actor/d_a_e_df.cpp +++ b/src/d/actor/d_a_e_df.cpp @@ -711,13 +711,13 @@ static int daE_DF_Create(fopAc_ac_c* i_this) { return a_this->Create(); } -static actor_method_class l_daE_DF_Method = { +static DUSK_CONST actor_method_class l_daE_DF_Method = { (process_method_func)daE_DF_Create, (process_method_func)daE_DF_Delete, (process_method_func)daE_DF_Execute, (process_method_func)daE_DF_IsDelete, (process_method_func)daE_DF_Draw, }; -actor_process_profile_definition g_profile_E_DF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_dk.cpp b/src/d/actor/d_a_e_dk.cpp index 82fa722157..f61f3f474e 100644 --- a/src/d/actor/d_a_e_dk.cpp +++ b/src/d/actor/d_a_e_dk.cpp @@ -1073,7 +1073,7 @@ static int daE_DK_Create(daE_DK_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_DK_Method = { +static DUSK_CONST actor_method_class l_daE_DK_Method = { (process_method_func)daE_DK_Create, (process_method_func)daE_DK_Delete, (process_method_func)daE_DK_Execute, @@ -1081,7 +1081,7 @@ static actor_method_class l_daE_DK_Method = { (process_method_func)daE_DK_Draw, }; -actor_process_profile_definition g_profile_E_DK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_dn.cpp b/src/d/actor/d_a_e_dn.cpp index d7d0e056ef..1386275ca0 100644 --- a/src/d/actor/d_a_e_dn.cpp +++ b/src/d/actor/d_a_e_dn.cpp @@ -1031,7 +1031,7 @@ static int way_check(e_dn_class* i_this) { return 2; } -int learn_check; +DUSK_GAME_DATA int learn_check; static void* shot_s_sub(void* i_actor, void* i_data) { UNUSED(i_data); @@ -3506,7 +3506,7 @@ e_dn_class::e_dn_class() {} AUDIO_INSTANCES; -static actor_method_class l_daE_DN_Method = { +static DUSK_CONST actor_method_class l_daE_DN_Method = { (process_method_func)daE_DN_Create, (process_method_func)daE_DN_Delete, (process_method_func)daE_DN_Execute, @@ -3514,7 +3514,7 @@ static actor_method_class l_daE_DN_Method = { (process_method_func)daE_DN_Draw, }; -actor_process_profile_definition g_profile_E_DN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_dt.cpp b/src/d/actor/d_a_e_dt.cpp index c88635d111..1078b89eb5 100644 --- a/src/d/actor/d_a_e_dt.cpp +++ b/src/d/actor/d_a_e_dt.cpp @@ -124,15 +124,15 @@ enum Joint { /* 0x2A */ JNT_TAIL_2, }; -f32 E_DT_n::eDt_ShakeFrame[10] = { +DUSK_GAME_DATA f32 E_DT_n::eDt_ShakeFrame[10] = { 20.0f, 22.0f, 24.0f, 26.0f, 28.0f, 30.0f, 32.0f, 34.0f, 36.0f, 38.0f, }; -f32 E_DT_n::eDt_ShakeFrameDemo[10] = { +DUSK_GAME_DATA f32 E_DT_n::eDt_ShakeFrameDemo[10] = { 310.0f, 312.0f, 314.0f, 316.0f, 318.0f, 320.0f, 322.0f, 324.0f, 326.0f, 328.0f, }; -dCcD_SrcSph E_DT_n::cc_dt_body_src = { +DUSK_GAME_DATA dCcD_SrcSph E_DT_n::cc_dt_body_src = { { {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0x0}, {0xd8fbfdff, 0x43}, 0x75}}, // mObj {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -144,7 +144,7 @@ dCcD_SrcSph E_DT_n::cc_dt_body_src = { } // mSphAttr }; -dCcD_SrcSph E_DT_n::cc_dt_tongue_src = { +DUSK_GAME_DATA dCcD_SrcSph E_DT_n::cc_dt_tongue_src = { { {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0x0}, {0xd8fbfdff, 0x43}, 0x75}}, // mObj {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -700,9 +700,9 @@ void daE_DT_c::setBoxTubaLandEffect() { } } -int E_DT_n::mDt_OtamaNum; +DUSK_GAME_DATA int E_DT_n::mDt_OtamaNum; -int E_DT_n::mDt_OtamaNo[20]; +DUSK_GAME_DATA int E_DT_n::mDt_OtamaNo[20]; static void* s_otama_todo(void* i_proc, void* i_this) { if (fopAcM_IsActor(i_proc) && !fpcM_IsCreating(fopAcM_GetID(i_proc)) @@ -726,7 +726,7 @@ int daE_DT_c::getNumberOfOtama() { return E_DT_n::mDt_OtamaNum; } -int E_DT_n::m_fall_no; +DUSK_GAME_DATA int E_DT_n::m_fall_no; static void* s_fall_otama(void* i_proc, void* i_this) { if (fopAcM_IsActor(i_proc) && !fpcM_IsCreating(fopAcM_GetID(i_proc)) @@ -772,7 +772,7 @@ static void* s_demo_otama(void* i_proc, void* i_this) { return NULL; } -cXyz E_DT_n::m_tongue_pos; +DUSK_GAME_DATA cXyz E_DT_n::m_tongue_pos; static void* s_bomb_search(void* i_proc, void* i_this) { if (fopAcM_IsActor(i_proc) && !fpcM_IsCreating(fopAcM_GetID(i_proc))) { @@ -2558,7 +2558,7 @@ static cPhs_Step daE_DT_Create(daE_DT_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_DT_Method = { +static DUSK_CONST actor_method_class l_daE_DT_Method = { (process_method_func)daE_DT_Create, (process_method_func)daE_DT_Delete, (process_method_func)daE_DT_Execute, @@ -2566,7 +2566,7 @@ static actor_method_class l_daE_DT_Method = { (process_method_func)daE_DT_Draw, }; -actor_process_profile_definition g_profile_E_DT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_DT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_fb.cpp b/src/d/actor/d_a_e_fb.cpp index 937eb801fb..3bc8de04c0 100644 --- a/src/d/actor/d_a_e_fb.cpp +++ b/src/d/actor/d_a_e_fb.cpp @@ -993,7 +993,7 @@ static int daE_FB_Create(daE_FB_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_FB_Method = { +static DUSK_CONST actor_method_class l_daE_FB_Method = { (process_method_func)daE_FB_Create, (process_method_func)daE_FB_Delete, (process_method_func)daE_FB_Execute, @@ -1001,7 +1001,7 @@ static actor_method_class l_daE_FB_Method = { (process_method_func)daE_FB_Draw, }; -actor_process_profile_definition g_profile_E_FB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_FB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_fk.cpp b/src/d/actor/d_a_e_fk.cpp index 5840df0495..aa75087d66 100644 --- a/src/d/actor/d_a_e_fk.cpp +++ b/src/d/actor/d_a_e_fk.cpp @@ -803,7 +803,7 @@ static int daE_FK_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES -static actor_method_class l_daE_FK_Method = { +static DUSK_CONST actor_method_class l_daE_FK_Method = { (process_method_func)daE_FK_Create, (process_method_func)daE_FK_Delete, (process_method_func)daE_FK_Execute, @@ -811,7 +811,7 @@ static actor_method_class l_daE_FK_Method = { (process_method_func)daE_FK_Draw, }; -actor_process_profile_definition g_profile_E_FK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_FK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_fm.cpp b/src/d/actor/d_a_e_fm.cpp index 81a1b404f0..101b8dd06e 100644 --- a/src/d/actor/d_a_e_fm.cpp +++ b/src/d/actor/d_a_e_fm.cpp @@ -3880,7 +3880,7 @@ static int daE_FM_Create(fopAc_ac_c* i_this) { e_fm_class::e_fm_class() {} -static actor_method_class l_daE_FM_Method = { +static DUSK_CONST actor_method_class l_daE_FM_Method = { (process_method_func)daE_FM_Create, (process_method_func)daE_FM_Delete, (process_method_func)daE_FM_Execute, @@ -3888,7 +3888,7 @@ static actor_method_class l_daE_FM_Method = { (process_method_func)daE_FM_Draw, }; -actor_process_profile_definition g_profile_E_FM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_FM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_fs.cpp b/src/d/actor/d_a_e_fs.cpp index 3ed859c686..7d6ca7b2d4 100644 --- a/src/d/actor/d_a_e_fs.cpp +++ b/src/d/actor/d_a_e_fs.cpp @@ -787,7 +787,7 @@ static cPhs_Step daE_Fs_Create(fopAc_ac_c* i_this) { _this->mAtInfo.mpSound = &_this->mCreatureSound; _this->mAtInfo.field_0x18 = 0x25; - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x43}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -844,7 +844,7 @@ static cPhs_Step daE_Fs_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_Fs_Method = { +static DUSK_CONST actor_method_class l_daE_Fs_Method = { (process_method_func)daE_Fs_Create, (process_method_func)daE_Fs_Delete, (process_method_func)daE_Fs_Execute, @@ -852,7 +852,7 @@ static actor_method_class l_daE_Fs_Method = { (process_method_func)daE_Fs_Draw, }; -actor_process_profile_definition g_profile_E_FS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_FS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_fz.cpp b/src/d/actor/d_a_e_fz.cpp index a48c4df8f0..4d8ad1feaf 100644 --- a/src/d/actor/d_a_e_fz.cpp +++ b/src/d/actor/d_a_e_fz.cpp @@ -1039,13 +1039,13 @@ static int daE_FZ_Create(daE_FZ_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_FZ_Method = { +static DUSK_CONST actor_method_class l_daE_FZ_Method = { (process_method_func)daE_FZ_Create, (process_method_func)daE_FZ_Delete, (process_method_func)daE_FZ_Execute, (process_method_func)daE_FZ_IsDelete, (process_method_func)daE_FZ_Draw, }; -actor_process_profile_definition g_profile_E_FZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_FZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ga.cpp b/src/d/actor/d_a_e_ga.cpp index f5405f6a6b..1db46aeec7 100644 --- a/src/d/actor/d_a_e_ga.cpp +++ b/src/d/actor/d_a_e_ga.cpp @@ -256,7 +256,7 @@ static int daE_Ga_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_Ga_Method = { +static DUSK_CONST actor_method_class l_daE_Ga_Method = { (process_method_func)daE_Ga_Create, (process_method_func)daE_Ga_Delete, (process_method_func)daE_Ga_Execute, @@ -264,7 +264,7 @@ static actor_method_class l_daE_Ga_Method = { (process_method_func)daE_Ga_Draw, }; -actor_process_profile_definition g_profile_E_GA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_gb.cpp b/src/d/actor/d_a_e_gb.cpp index 4ef42d2d9b..09b6556548 100644 --- a/src/d/actor/d_a_e_gb.cpp +++ b/src/d/actor/d_a_e_gb.cpp @@ -1632,7 +1632,7 @@ static cPhs_Step daE_GB_Create(fopAc_ac_c* actor) { } // mSphAttr }; - static dCcD_SrcCyl body_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl body_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1721,7 +1721,7 @@ static cPhs_Step daE_GB_Create(fopAc_ac_c* actor) { e_gb_class::e_gb_class() {} -static actor_method_class l_daE_GB_Method = { +static DUSK_CONST actor_method_class l_daE_GB_Method = { (process_method_func)daE_GB_Create, (process_method_func)daE_GB_Delete, (process_method_func)daE_GB_Execute, @@ -1729,7 +1729,7 @@ static actor_method_class l_daE_GB_Method = { (process_method_func)daE_GB_Draw, }; -actor_process_profile_definition g_profile_E_GB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ge.cpp b/src/d/actor/d_a_e_ge.cpp index 5159649d54..cdf83bbed5 100644 --- a/src/d/actor/d_a_e_ge.cpp +++ b/src/d/actor/d_a_e_ge.cpp @@ -1081,7 +1081,7 @@ void daE_GE_c::executeShield() { } } -daE_GE_c::actionFunc daE_GE_c::l_actionmenu[9] = { +DUSK_GAME_DATA daE_GE_c::actionFunc daE_GE_c::l_actionmenu[9] = { (&daE_GE_c::executeWait), (&daE_GE_c::executeFly), (&daE_GE_c::executeAttack), (&daE_GE_c::executeBack), (&daE_GE_c::executeDown), (&daE_GE_c::executeSurprise), (&daE_GE_c::executeCaw), (&daE_GE_c::executeWind), (&daE_GE_c::executeShield), @@ -1370,13 +1370,13 @@ static int daE_GE_Create(daE_GE_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_GE_Method = { +static DUSK_CONST actor_method_class l_daE_GE_Method = { (process_method_func)daE_GE_Create, (process_method_func)daE_GE_Delete, (process_method_func)daE_GE_Execute, (process_method_func)daE_GE_IsDelete, (process_method_func)daE_GE_Draw, }; -actor_process_profile_definition g_profile_E_GE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_gi.cpp b/src/d/actor/d_a_e_gi.cpp index 9f2033cdbb..7bcf0269ff 100644 --- a/src/d/actor/d_a_e_gi.cpp +++ b/src/d/actor/d_a_e_gi.cpp @@ -1103,7 +1103,7 @@ static int daE_GI_Create(daE_GI_c* a_this) { return a_this->create(); } -static actor_method_class l_daE_GI_Method = { +static DUSK_CONST actor_method_class l_daE_GI_Method = { (process_method_func)daE_GI_Create, (process_method_func)daE_GI_Delete, (process_method_func)daE_GI_Execute, @@ -1111,7 +1111,7 @@ static actor_method_class l_daE_GI_Method = { (process_method_func)daE_GI_Draw, }; -actor_process_profile_definition g_profile_E_GI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_gm.cpp b/src/d/actor/d_a_e_gm.cpp index c9a326804c..007f5e3cd5 100644 --- a/src/d/actor/d_a_e_gm.cpp +++ b/src/d/actor/d_a_e_gm.cpp @@ -1815,7 +1815,7 @@ static int daE_GM_Create(daE_GM_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_GM_Method = { +static DUSK_CONST actor_method_class l_daE_GM_Method = { (process_method_func)daE_GM_Create, (process_method_func)daE_GM_Delete, (process_method_func)daE_GM_Execute, @@ -1823,7 +1823,7 @@ static actor_method_class l_daE_GM_Method = { (process_method_func)daE_GM_Draw, }; -actor_process_profile_definition g_profile_E_GM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_gob.cpp b/src/d/actor/d_a_e_gob.cpp index 6824263328..65c084eaf8 100644 --- a/src/d/actor/d_a_e_gob.cpp +++ b/src/d/actor/d_a_e_gob.cpp @@ -2394,7 +2394,7 @@ static int daE_GOB_Create(fopAc_ac_c* i_this) { e_gob_class::e_gob_class() {} -static actor_method_class l_daE_GOB_Method = { +static DUSK_CONST actor_method_class l_daE_GOB_Method = { (process_method_func)daE_GOB_Create, (process_method_func)daE_GOB_Delete, (process_method_func)daE_GOB_Execute, @@ -2402,7 +2402,7 @@ static actor_method_class l_daE_GOB_Method = { (process_method_func)daE_GOB_Draw, }; -actor_process_profile_definition g_profile_E_GOB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GOB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_gs.cpp b/src/d/actor/d_a_e_gs.cpp index 16000f554b..9d19db469d 100644 --- a/src/d/actor/d_a_e_gs.cpp +++ b/src/d/actor/d_a_e_gs.cpp @@ -224,7 +224,7 @@ static int daE_GS_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_GS_Method = { +static DUSK_CONST actor_method_class l_daE_GS_Method = { (process_method_func)daE_GS_Create, (process_method_func)daE_GS_Delete, (process_method_func)daE_GS_Execute, @@ -232,7 +232,7 @@ static actor_method_class l_daE_GS_Method = { (process_method_func)daE_GS_Draw, }; -actor_process_profile_definition g_profile_E_GS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_GS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_hb.cpp b/src/d/actor/d_a_e_hb.cpp index 8ed9058c6f..f0dfbda3a6 100644 --- a/src/d/actor/d_a_e_hb.cpp +++ b/src/d/actor/d_a_e_hb.cpp @@ -103,7 +103,7 @@ static int daE_HB_Draw(e_hb_class* i_this) { i_this->stalkLine.update(12, l_color, &actor->tevStr); dComIfGd_set3DlineMat(&i_this->stalkLine); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mStalkLineInterpCurrValid) { memcpy(i_this->mStalkLineInterpPrev, i_this->mStalkLineInterpCurr, sizeof(i_this->mStalkLineInterpCurr)); i_this->mStalkLineInterpPrevValid = true; @@ -1533,7 +1533,7 @@ static int daE_HB_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_HB_Method = { +static DUSK_CONST actor_method_class l_daE_HB_Method = { (process_method_func)daE_HB_Create, (process_method_func)daE_HB_Delete, (process_method_func)daE_HB_Execute, @@ -1541,7 +1541,7 @@ static actor_method_class l_daE_HB_Method = { (process_method_func)daE_HB_Draw, }; -actor_process_profile_definition g_profile_E_HB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_HB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_hb_leaf.cpp b/src/d/actor/d_a_e_hb_leaf.cpp index 99d45d6ea3..f4ebb64c6c 100644 --- a/src/d/actor/d_a_e_hb_leaf.cpp +++ b/src/d/actor/d_a_e_hb_leaf.cpp @@ -80,13 +80,13 @@ static int daE_HB_LEAF_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_HB_LEAF_Method = { +static DUSK_CONST actor_method_class l_daE_HB_LEAF_Method = { (process_method_func)daE_HB_LEAF_Create, (process_method_func)daE_HB_LEAF_Delete, (process_method_func)daE_HB_LEAF_Execute, (process_method_func)daE_HB_LEAF_IsDelete, (process_method_func)daE_HB_LEAF_Draw, }; -actor_process_profile_definition g_profile_E_HB_LEAF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_HB_LEAF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_hm.cpp b/src/d/actor/d_a_e_hm.cpp index 77641117ab..161966fc18 100644 --- a/src/d/actor/d_a_e_hm.cpp +++ b/src/d/actor/d_a_e_hm.cpp @@ -1594,7 +1594,7 @@ static int daE_HM_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES -static actor_method_class l_daE_HM_Method = { +static DUSK_CONST actor_method_class l_daE_HM_Method = { (process_method_func)daE_HM_Create, (process_method_func)daE_HM_Delete, (process_method_func)daE_HM_Execute, @@ -1602,7 +1602,7 @@ static actor_method_class l_daE_HM_Method = { (process_method_func)daE_HM_Draw, }; -actor_process_profile_definition g_profile_E_HM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_HM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_hp.cpp b/src/d/actor/d_a_e_hp.cpp index 633795ab39..51ac16fcf3 100644 --- a/src/d/actor/d_a_e_hp.cpp +++ b/src/d/actor/d_a_e_hp.cpp @@ -1313,13 +1313,13 @@ static int daE_HP_Create(daE_HP_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_HP_Method = { +static DUSK_CONST actor_method_class l_daE_HP_Method = { (process_method_func)daE_HP_Create, (process_method_func)daE_HP_Delete, (process_method_func)daE_HP_Execute, (process_method_func)daE_HP_IsDelete, (process_method_func)daE_HP_Draw, }; -actor_process_profile_definition g_profile_E_HP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_HP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_hz.cpp b/src/d/actor/d_a_e_hz.cpp index f2fb7d12b8..b3db29b1c2 100644 --- a/src/d/actor/d_a_e_hz.cpp +++ b/src/d/actor/d_a_e_hz.cpp @@ -2104,13 +2104,13 @@ static int daE_HZ_Create(daE_HZ_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_HZ_Method = { +static DUSK_CONST actor_method_class l_daE_HZ_Method = { (process_method_func)daE_HZ_Create, (process_method_func)daE_HZ_Delete, (process_method_func)daE_HZ_Execute, (process_method_func)daE_HZ_IsDelete, (process_method_func)daE_HZ_Draw, }; -actor_process_profile_definition g_profile_E_HZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_HZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_hzelda.cpp b/src/d/actor/d_a_e_hzelda.cpp index 4217e26781..7f8a4b3d23 100644 --- a/src/d/actor/d_a_e_hzelda.cpp +++ b/src/d/actor/d_a_e_hzelda.cpp @@ -1526,7 +1526,7 @@ static int daE_HZELDA_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_HZELDA_Method = { +static DUSK_CONST actor_method_class l_daE_HZELDA_Method = { (process_method_func)daE_HZELDA_Create, (process_method_func)daE_HZELDA_Delete, (process_method_func)daE_HZELDA_Execute, @@ -1534,7 +1534,7 @@ static actor_method_class l_daE_HZELDA_Method = { (process_method_func)daE_HZELDA_Draw, }; -actor_process_profile_definition g_profile_E_HZELDA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_HZELDA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_is.cpp b/src/d/actor/d_a_e_is.cpp index 2e7764a352..27f8aee1aa 100644 --- a/src/d/actor/d_a_e_is.cpp +++ b/src/d/actor/d_a_e_is.cpp @@ -683,7 +683,7 @@ static int daE_IS_Create(fopAc_ac_c* i_this) { } // mSphAttr }; - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -746,7 +746,7 @@ static int daE_IS_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_IS_Method = { +static DUSK_CONST actor_method_class l_daE_IS_Method = { (process_method_func)daE_IS_Create, (process_method_func)daE_IS_Delete, (process_method_func)daE_IS_Execute, @@ -754,7 +754,7 @@ static actor_method_class l_daE_IS_Method = { (process_method_func)daE_IS_Draw, }; -actor_process_profile_definition g_profile_E_IS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_IS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_kg.cpp b/src/d/actor/d_a_e_kg.cpp index 013e330090..c5cbc354b5 100644 --- a/src/d/actor/d_a_e_kg.cpp +++ b/src/d/actor/d_a_e_kg.cpp @@ -735,7 +735,7 @@ static int daE_KG_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daE_KG_Method = { +static DUSK_CONST actor_method_class l_daE_KG_Method = { (process_method_func)daE_KG_Create, (process_method_func)daE_KG_Delete, (process_method_func)daE_KG_Execute, @@ -743,7 +743,7 @@ static actor_method_class l_daE_KG_Method = { (process_method_func)daE_KG_Draw, }; -actor_process_profile_definition g_profile_E_KG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_KG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_kk.cpp b/src/d/actor/d_a_e_kk.cpp index 6cc792428e..f2cd8f5cf2 100644 --- a/src/d/actor/d_a_e_kk.cpp +++ b/src/d/actor/d_a_e_kk.cpp @@ -1486,13 +1486,13 @@ static int daE_KK_Create(daE_KK_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_KK_Method = { +static DUSK_CONST actor_method_class l_daE_KK_Method = { (process_method_func)daE_KK_Create, (process_method_func)daE_KK_Delete, (process_method_func)daE_KK_Execute, (process_method_func)daE_KK_IsDelete, (process_method_func)daE_KK_Draw, }; -actor_process_profile_definition g_profile_E_KK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_KK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_kr.cpp b/src/d/actor/d_a_e_kr.cpp index f21c83b50a..13c343571f 100644 --- a/src/d/actor/d_a_e_kr.cpp +++ b/src/d/actor/d_a_e_kr.cpp @@ -2385,13 +2385,13 @@ static int daE_Kr_Create(fopAc_ac_c* i_this) { e_kr_class::e_kr_class() { } -static actor_method_class l_daE_Kr_Method = { +static DUSK_CONST actor_method_class l_daE_Kr_Method = { (process_method_func)daE_Kr_Create, (process_method_func)daE_Kr_Delete, (process_method_func)daE_Kr_Execute, (process_method_func)daE_Kr_IsDelete, (process_method_func)daE_Kr_Draw, }; -actor_process_profile_definition g_profile_E_KR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_KR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_mb.cpp b/src/d/actor/d_a_e_mb.cpp index aa77a99612..1fff337b33 100644 --- a/src/d/actor/d_a_e_mb.cpp +++ b/src/d/actor/d_a_e_mb.cpp @@ -105,7 +105,7 @@ static int daE_MB_Draw(e_mb_class* i_this) { i_this->mRopeMat.update(16, l_color, &a_this->tevStr); dComIfGd_set3DlineMat(&i_this->mRopeMat); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mRopeInterpCurrValid) { memcpy(i_this->mRopeInterpPrev, i_this->mRopeInterpCurr, sizeof(i_this->mRopeInterpCurr)); i_this->mRopeInterpPrevValid = true; @@ -763,7 +763,7 @@ static int daE_MB_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_MB_Method = { +static DUSK_CONST actor_method_class l_daE_MB_Method = { (process_method_func)daE_MB_Create, (process_method_func)daE_MB_Delete, (process_method_func)daE_MB_Execute, @@ -771,7 +771,7 @@ static actor_method_class l_daE_MB_Method = { (process_method_func)daE_MB_Draw, }; -actor_process_profile_definition g_profile_E_MB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_md.cpp b/src/d/actor/d_a_e_md.cpp index 19baf66f5f..21fdf6fcf6 100644 --- a/src/d/actor/d_a_e_md.cpp +++ b/src/d/actor/d_a_e_md.cpp @@ -455,7 +455,7 @@ static int daE_MD_IsDelete(daE_MD_c* i_this) { return 1; } -static actor_method_class l_daE_MD_Method = { +static DUSK_CONST actor_method_class l_daE_MD_Method = { (process_method_func)daE_MD_Create, (process_method_func)daE_MD_Delete, (process_method_func)daE_MD_Execute, @@ -463,7 +463,7 @@ static actor_method_class l_daE_MD_Method = { (process_method_func)daE_MD_Draw, }; -actor_process_profile_definition g_profile_E_MD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_mf.cpp b/src/d/actor/d_a_e_mf.cpp index 594b9aa2d8..369c73b21e 100644 --- a/src/d/actor/d_a_e_mf.cpp +++ b/src/d/actor/d_a_e_mf.cpp @@ -3264,7 +3264,7 @@ e_mf_class::e_mf_class() {} AUDIO_INSTANCES; -actor_method_class l_daE_MF_Method = { +DUSK_GAME_DATA actor_method_class l_daE_MF_Method = { (process_method_func)daE_MF_Create, (process_method_func)daE_MF_Delete, (process_method_func)daE_MF_Execute, @@ -3272,7 +3272,7 @@ actor_method_class l_daE_MF_Method = { (process_method_func)daE_MF_Draw, }; -actor_process_profile_definition g_profile_E_MF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_mk.cpp b/src/d/actor/d_a_e_mk.cpp index 8099419410..f507177f1d 100644 --- a/src/d/actor/d_a_e_mk.cpp +++ b/src/d/actor/d_a_e_mk.cpp @@ -2958,7 +2958,7 @@ static int daE_MK_Create(fopAc_ac_c* i_actor) { AUDIO_INSTANCES -static actor_method_class l_daE_MK_Method = { +static DUSK_CONST actor_method_class l_daE_MK_Method = { (process_method_func)daE_MK_Create, (process_method_func)daE_MK_Delete, (process_method_func)daE_MK_Execute, @@ -2966,7 +2966,7 @@ static actor_method_class l_daE_MK_Method = { (process_method_func)daE_MK_Draw, }; -actor_process_profile_definition g_profile_E_MK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_mk_bo.cpp b/src/d/actor/d_a_e_mk_bo.cpp index e2a075134c..950d6cdc56 100644 --- a/src/d/actor/d_a_e_mk_bo.cpp +++ b/src/d/actor/d_a_e_mk_bo.cpp @@ -804,7 +804,7 @@ static int daE_MK_BO_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_MK_BO_Method = { +static DUSK_CONST actor_method_class l_daE_MK_BO_Method = { (process_method_func)daE_MK_BO_Create, (process_method_func)daE_MK_BO_Delete, (process_method_func)daE_MK_BO_Execute, @@ -812,7 +812,7 @@ static actor_method_class l_daE_MK_BO_Method = { (process_method_func)daE_MK_BO_Draw, }; -actor_process_profile_definition g_profile_E_MK_BO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MK_BO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_mm.cpp b/src/d/actor/d_a_e_mm.cpp index cfb7cf5491..ab6fc4a310 100644 --- a/src/d/actor/d_a_e_mm.cpp +++ b/src/d/actor/d_a_e_mm.cpp @@ -1131,7 +1131,7 @@ static int daE_MM_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daE_MM_Method = { +static DUSK_CONST actor_method_class l_daE_MM_Method = { (process_method_func)daE_MM_Create, (process_method_func)daE_MM_Delete, (process_method_func)daE_MM_Execute, @@ -1139,7 +1139,7 @@ static actor_method_class l_daE_MM_Method = { (process_method_func)daE_MM_Draw, }; -actor_process_profile_definition g_profile_E_MM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_mm_mt.cpp b/src/d/actor/d_a_e_mm_mt.cpp index 205cebab78..a3f57ddcf1 100644 --- a/src/d/actor/d_a_e_mm_mt.cpp +++ b/src/d/actor/d_a_e_mm_mt.cpp @@ -840,7 +840,7 @@ static int daE_MM_MT_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daE_MM_MT_Method = { +static DUSK_CONST actor_method_class l_daE_MM_MT_Method = { (process_method_func)daE_MM_MT_Create, (process_method_func)daE_MM_MT_Delete, (process_method_func)daE_MM_MT_Execute, @@ -848,7 +848,7 @@ static actor_method_class l_daE_MM_MT_Method = { (process_method_func)daE_MM_MT_Draw, }; -actor_process_profile_definition g_profile_E_MM_MT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MM_MT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ms.cpp b/src/d/actor/d_a_e_ms.cpp index 5b43781d66..fbeca0cd6b 100644 --- a/src/d/actor/d_a_e_ms.cpp +++ b/src/d/actor/d_a_e_ms.cpp @@ -1056,13 +1056,13 @@ static int daE_MS_Create(fopAc_ac_c* actor) { return phase; } -static actor_method_class l_daE_MS_Method = { +static DUSK_CONST actor_method_class l_daE_MS_Method = { (process_method_func)daE_MS_Create, (process_method_func)daE_MS_Delete, (process_method_func)daE_MS_Execute, (process_method_func)daE_MS_IsDelete, (process_method_func)daE_MS_Draw, }; -actor_process_profile_definition g_profile_E_MS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_MS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_nest.cpp b/src/d/actor/d_a_e_nest.cpp index 25055c4bd6..c86cd1bb5e 100644 --- a/src/d/actor/d_a_e_nest.cpp +++ b/src/d/actor/d_a_e_nest.cpp @@ -1028,7 +1028,7 @@ static cPhs_Step daE_Nest_Create(fopAc_ac_c* i_this) { }; _this->mCcSph.Set(cc_sph_src); _this->mCcSph.SetStts(&_this->mCcStts); - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x2020, 0x3}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1066,7 +1066,7 @@ static cPhs_Step daE_Nest_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daE_Nest_Method = { +static DUSK_CONST actor_method_class l_daE_Nest_Method = { (process_method_func)daE_Nest_Create, (process_method_func)daE_Nest_Delete, (process_method_func)daE_Nest_Execute, @@ -1074,7 +1074,7 @@ static actor_method_class l_daE_Nest_Method = { (process_method_func)daE_Nest_Draw, }; -actor_process_profile_definition g_profile_E_NEST = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_NEST = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_nz.cpp b/src/d/actor/d_a_e_nz.cpp index e9960c393d..c4044d5075 100644 --- a/src/d/actor/d_a_e_nz.cpp +++ b/src/d/actor/d_a_e_nz.cpp @@ -735,7 +735,7 @@ static int daE_NZ_Create(fopAc_ac_c* a_this) { AUDIO_INSTANCES -static actor_method_class l_daE_NZ_Method = { +static DUSK_CONST actor_method_class l_daE_NZ_Method = { (process_method_func)daE_NZ_Create, (process_method_func)daE_NZ_Delete, (process_method_func)daE_NZ_Execute, @@ -743,7 +743,7 @@ static actor_method_class l_daE_NZ_Method = { (process_method_func)daE_NZ_Draw, }; -actor_process_profile_definition g_profile_E_NZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_NZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_oc.cpp b/src/d/actor/d_a_e_oc.cpp index 6f0a55f12a..57828ccb7c 100644 --- a/src/d/actor/d_a_e_oc.cpp +++ b/src/d/actor/d_a_e_oc.cpp @@ -58,17 +58,17 @@ public: #endif }; -f32 const E_OC_n::oc_attackb_trans[10] = { +DUSK_GAME_DATA f32 const E_OC_n::oc_attackb_trans[10] = { 0.0f, 0.0f, 0.0f, 0.0f, 15.3f, 38.4f, 63.3f, 86.2f, 103.3f, 112.0f }; -f32 const E_OC_n::oc_attackc_trans[10] = { +DUSK_GAME_DATA f32 const E_OC_n::oc_attackc_trans[10] = { 0.0f, 31.3f, 72.7f, 91.5f, 91.5f, 91.5f, 91.5f, 91.5f, 91.5f, 91.5f }; -dCcD_SrcSph E_OC_n::cc_sph_src = { +DUSK_GAME_DATA dCcD_SrcSph E_OC_n::cc_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xD8FBFDFF, 0x3}, 0x75}}, // mObj {0x9, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -80,7 +80,7 @@ dCcD_SrcSph E_OC_n::cc_sph_src = { } // mSphAttr }; -dCcD_SrcSph E_OC_n::at_sph_src = { +DUSK_GAME_DATA dCcD_SrcSph E_OC_n::at_sph_src = { { {0x0, {{0x1000, 0x1, 0xD}, {0x0, 0x0}, 0x0}}, // mObj {0x9, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -193,13 +193,13 @@ static int daE_OC_Draw(daE_OC_c* i_this) { return i_this->draw(); } -daE_OC_c* E_OC_n::m_battle_oc; +DUSK_GAME_DATA daE_OC_c* E_OC_n::m_battle_oc; -daE_OC_c* E_OC_n::m_damage_oc; +DUSK_GAME_DATA daE_OC_c* E_OC_n::m_damage_oc; -daE_OC_c* E_OC_n::m_death_oc; +DUSK_GAME_DATA daE_OC_c* E_OC_n::m_death_oc; -daE_OC_c* E_OC_n::m_talk_oc; +DUSK_GAME_DATA daE_OC_c* E_OC_n::m_talk_oc; static u8 lbl_216_bss_58; @@ -2837,7 +2837,7 @@ static int daE_OC_Create(daE_OC_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_OC_Method = { +static DUSK_CONST actor_method_class l_daE_OC_Method = { (process_method_func)daE_OC_Create, (process_method_func)daE_OC_Delete, (process_method_func)daE_OC_Execute, @@ -2845,7 +2845,7 @@ static actor_method_class l_daE_OC_Method = { (process_method_func)daE_OC_Draw, }; -actor_process_profile_definition g_profile_E_OC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_OC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_oct_bg.cpp b/src/d/actor/d_a_e_oct_bg.cpp index 94fa69596b..df181dd23b 100644 --- a/src/d/actor/d_a_e_oct_bg.cpp +++ b/src/d/actor/d_a_e_oct_bg.cpp @@ -173,10 +173,10 @@ static int daE_OctBg_Delete(daE_OctBg_c* i_this) { static daE_OctBg_HIO_c l_HIO; -u8 unk_bss_78; -u8 unk_bss_79; -u8 unk_bss_7A; -u8 unk_bss_7B; +DUSK_GAME_DATA u8 unk_bss_78; +DUSK_GAME_DATA u8 unk_bss_79; +DUSK_GAME_DATA u8 unk_bss_7A; +DUSK_GAME_DATA u8 unk_bss_7B; void daE_OctBg_c::cc_set() { cXyz cStack_1c; @@ -884,7 +884,7 @@ static int daE_OctBg_IsDelete(daE_OctBg_c* i_this) { return 1; } -static actor_method_class l_daE_OctBg_Method = { +static DUSK_CONST actor_method_class l_daE_OctBg_Method = { (process_method_func)daE_OctBg_Create, (process_method_func)daE_OctBg_Delete, (process_method_func)daE_OctBg_Execute, @@ -892,7 +892,7 @@ static actor_method_class l_daE_OctBg_Method = { (process_method_func)daE_OctBg_Draw, }; -actor_process_profile_definition g_profile_E_OctBg = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_OctBg = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ot.cpp b/src/d/actor/d_a_e_ot.cpp index 3debc44c44..7e1a26e199 100644 --- a/src/d/actor/d_a_e_ot.cpp +++ b/src/d/actor/d_a_e_ot.cpp @@ -829,7 +829,7 @@ static cPhs_Step daE_OT_Create(daE_OT_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_OT_Method = { +static DUSK_CONST actor_method_class l_daE_OT_Method = { (process_method_func)daE_OT_Create, (process_method_func)daE_OT_Delete, (process_method_func)daE_OT_Execute, @@ -837,7 +837,7 @@ static actor_method_class l_daE_OT_Method = { (process_method_func)daE_OT_Draw, }; -actor_process_profile_definition g_profile_E_OT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_OT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ph.cpp b/src/d/actor/d_a_e_ph.cpp index 3213c2716e..faf3ff1d6f 100644 --- a/src/d/actor/d_a_e_ph.cpp +++ b/src/d/actor/d_a_e_ph.cpp @@ -1303,13 +1303,13 @@ static int daE_PH_IsDelete(daE_PH_c* i_this) { return 1; } -static actor_method_class l_daE_PH_Method = { +static DUSK_CONST actor_method_class l_daE_PH_Method = { (process_method_func)daE_PH_Create, (process_method_func)daE_PH_Delete, (process_method_func)daE_PH_Execute, (process_method_func)daE_PH_IsDelete, (process_method_func)daE_PH_Draw, }; -actor_process_profile_definition g_profile_E_PH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_PH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_pm.cpp b/src/d/actor/d_a_e_pm.cpp index 5820985ec1..8c68907f15 100644 --- a/src/d/actor/d_a_e_pm.cpp +++ b/src/d/actor/d_a_e_pm.cpp @@ -2870,7 +2870,7 @@ static cPhs_Step daE_PM_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_PM_Method = { +static DUSK_CONST actor_method_class l_daE_PM_Method = { (process_method_func)daE_PM_Create, (process_method_func)daE_PM_Delete, (process_method_func)daE_PM_Execute, @@ -2878,7 +2878,7 @@ static actor_method_class l_daE_PM_Method = { (process_method_func)daE_PM_Draw, }; -actor_process_profile_definition g_profile_E_PM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_PM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_po.cpp b/src/d/actor/d_a_e_po.cpp index 4899fc0376..1c4e95fa61 100644 --- a/src/d/actor/d_a_e_po.cpp +++ b/src/d/actor/d_a_e_po.cpp @@ -2947,7 +2947,7 @@ static int daE_PO_Create(fopAc_ac_c* i_act_this) { i_this->mAcchCir.SetWall(80.0f, 100.0f); i_this->mColliderStts.Init(150, 0, i_act_this); - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8000000, 0x3}, 0x0}}, // mObj {dCcD_SE_13, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -3157,13 +3157,13 @@ e_po_class::e_po_class() { // empty method } -static actor_method_class l_daE_PO_Method = { +static DUSK_CONST actor_method_class l_daE_PO_Method = { (process_method_func)daE_PO_Create, (process_method_func)daE_PO_Delete, (process_method_func)daE_PO_Execute, (process_method_func)daE_PO_IsDelete, (process_method_func)daE_PO_Draw, }; -actor_process_profile_definition g_profile_E_PO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_PO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_pz.cpp b/src/d/actor/d_a_e_pz.cpp index 6bc42128f5..7d95e7f64e 100644 --- a/src/d/actor/d_a_e_pz.cpp +++ b/src/d/actor/d_a_e_pz.cpp @@ -2648,7 +2648,7 @@ static int daE_PZ_Create(daE_PZ_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_PZ_Method = { +static DUSK_CONST actor_method_class l_daE_PZ_Method = { (process_method_func)daE_PZ_Create, (process_method_func)daE_PZ_Delete, (process_method_func)daE_PZ_Execute, @@ -2656,7 +2656,7 @@ static actor_method_class l_daE_PZ_Method = { (process_method_func)daE_PZ_Draw, }; -actor_process_profile_definition g_profile_E_PZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_PZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_rb.cpp b/src/d/actor/d_a_e_rb.cpp index 11d0b52863..5f3fe8c13b 100644 --- a/src/d/actor/d_a_e_rb.cpp +++ b/src/d/actor/d_a_e_rb.cpp @@ -861,7 +861,7 @@ static int daE_RB_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_RB_Method = { +static DUSK_CONST actor_method_class l_daE_RB_Method = { (process_method_func)daE_RB_Create, (process_method_func)daE_RB_Delete, (process_method_func)daE_RB_Execute, @@ -869,7 +869,7 @@ static actor_method_class l_daE_RB_Method = { (process_method_func)daE_RB_Draw, }; -actor_process_profile_definition g_profile_E_RB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_RB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_rd.cpp b/src/d/actor/d_a_e_rd.cpp index 460bc9dd26..495dadc66c 100644 --- a/src/d/actor/d_a_e_rd.cpp +++ b/src/d/actor/d_a_e_rd.cpp @@ -7625,7 +7625,7 @@ e_rd_class::e_rd_class() {} AUDIO_INSTANCES -static actor_method_class l_daE_RD_Method = { +static DUSK_CONST actor_method_class l_daE_RD_Method = { (process_method_func)daE_RD_Create, (process_method_func)daE_RD_Delete, (process_method_func)daE_RD_Execute, @@ -7633,7 +7633,7 @@ static actor_method_class l_daE_RD_Method = { (process_method_func)daE_RD_Draw, }; -actor_process_profile_definition g_profile_E_RD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_RD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_rdb.cpp b/src/d/actor/d_a_e_rdb.cpp index d5348475cd..7eccf34ef5 100644 --- a/src/d/actor/d_a_e_rdb.cpp +++ b/src/d/actor/d_a_e_rdb.cpp @@ -1801,7 +1801,7 @@ static int daE_RDB_Create(fopAc_ac_c* actor) { } // mSphAttr }; - static dCcD_SrcCyl co_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl co_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x0, 0x0}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1914,13 +1914,13 @@ static s32 unused_bss_29c = 0; AUDIO_INSTANCES -static actor_method_class l_daE_RDB_Method = { +static DUSK_CONST actor_method_class l_daE_RDB_Method = { (process_method_func)daE_RDB_Create, (process_method_func)daE_RDB_Delete, (process_method_func)daE_RDB_Execute, (process_method_func)daE_RDB_IsDelete, (process_method_func)daE_RDB_Draw, }; -actor_process_profile_definition g_profile_E_RDB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_RDB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_rdy.cpp b/src/d/actor/d_a_e_rdy.cpp index 305fc55efe..646f694f55 100644 --- a/src/d/actor/d_a_e_rdy.cpp +++ b/src/d/actor/d_a_e_rdy.cpp @@ -5070,7 +5070,7 @@ e_rdy_class::e_rdy_class() { AUDIO_INSTANCES -static actor_method_class l_daE_RDY_Method = { +static DUSK_CONST actor_method_class l_daE_RDY_Method = { (process_method_func)daE_RDY_Create, (process_method_func)daE_RDY_Delete, (process_method_func)daE_RDY_Execute, @@ -5078,7 +5078,7 @@ static actor_method_class l_daE_RDY_Method = { (process_method_func)daE_RDY_Draw, }; -actor_process_profile_definition g_profile_E_RDY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_RDY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_s1.cpp b/src/d/actor/d_a_e_s1.cpp index a5a05fce20..cd48a103e1 100644 --- a/src/d/actor/d_a_e_s1.cpp +++ b/src/d/actor/d_a_e_s1.cpp @@ -117,6 +117,13 @@ static void daE_S1_interp_callback(bool isSimFrame, void* pUserWork) { dst[i] = p0 + (p1 - p0) * alpha; } } + GXColor line_color; + line_color.r = JREG_S(0) + 5; + line_color.g = JREG_S(1) + 10; + line_color.b = JREG_S(2) + 10; + line_color.a = 0xFF; + + i_this->mLineMat.update(16, line_color, &i_this->tevStr); } #endif @@ -154,7 +161,7 @@ static int daE_S1_Draw(e_s1_class* i_this) { dComIfGd_set3DlineMatDark(&i_this->mLineMat); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mHairInterpCurrValid) { memcpy(i_this->mHairInterpPrev, i_this->mHairInterpCurr, sizeof(i_this->mHairInterpCurr)); i_this->mHairInterpPrevValid = true; @@ -2285,13 +2292,13 @@ static int daE_S1_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_S1_Method = { +static DUSK_CONST actor_method_class l_daE_S1_Method = { (process_method_func)daE_S1_Create, (process_method_func)daE_S1_Delete, (process_method_func)daE_S1_Execute, (process_method_func)daE_S1_IsDelete, (process_method_func)daE_S1_Draw, }; -actor_process_profile_definition g_profile_E_S1 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_S1 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sb.cpp b/src/d/actor/d_a_e_sb.cpp index 59d5b87bfd..098b901133 100644 --- a/src/d/actor/d_a_e_sb.cpp +++ b/src/d/actor/d_a_e_sb.cpp @@ -1160,7 +1160,7 @@ static int daE_SB_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->Create(); } -static actor_method_class l_daE_SB_Method = { +static DUSK_CONST actor_method_class l_daE_SB_Method = { (process_method_func)daE_SB_Create, (process_method_func)daE_SB_Delete, (process_method_func)daE_SB_Execute, @@ -1168,7 +1168,7 @@ static actor_method_class l_daE_SB_Method = { (process_method_func)daE_SB_Draw, }; -actor_process_profile_definition g_profile_E_SB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sf.cpp b/src/d/actor/d_a_e_sf.cpp index 0dcc405b49..c75b74a471 100644 --- a/src/d/actor/d_a_e_sf.cpp +++ b/src/d/actor/d_a_e_sf.cpp @@ -1876,7 +1876,7 @@ static cPhs_Step daE_SF_Create(fopAc_ac_c* a_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_SF_Method = { +static DUSK_CONST actor_method_class l_daE_SF_Method = { (process_method_func)daE_SF_Create, (process_method_func)daE_SF_Delete, (process_method_func)daE_SF_Execute, @@ -1884,7 +1884,7 @@ static actor_method_class l_daE_SF_Method = { (process_method_func)daE_SF_Draw, }; -actor_process_profile_definition g_profile_E_SF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sg.cpp b/src/d/actor/d_a_e_sg.cpp index efec965a3e..e06b9fa9e9 100644 --- a/src/d/actor/d_a_e_sg.cpp +++ b/src/d/actor/d_a_e_sg.cpp @@ -1246,13 +1246,13 @@ static int daE_SG_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_SG_Method = { +static DUSK_CONST actor_method_class l_daE_SG_Method = { (process_method_func)daE_SG_Create, (process_method_func)daE_SG_Delete, (process_method_func)daE_SG_Execute, (process_method_func)daE_SG_IsDelete, (process_method_func)daE_SG_Draw, }; -actor_process_profile_definition g_profile_E_SG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sh.cpp b/src/d/actor/d_a_e_sh.cpp index 8bd95fcf5d..73fb15c1fb 100644 --- a/src/d/actor/d_a_e_sh.cpp +++ b/src/d/actor/d_a_e_sh.cpp @@ -1264,7 +1264,7 @@ static int daE_SH_Create(fopAc_ac_c* i_this) { return resLoadResult; } -static actor_method_class l_daE_SH_Method = { +static DUSK_CONST actor_method_class l_daE_SH_Method = { (process_method_func)daE_SH_Create, (process_method_func)daE_SH_Delete, (process_method_func)daE_SH_Execute, @@ -1272,7 +1272,7 @@ static actor_method_class l_daE_SH_Method = { (process_method_func)daE_SH_Draw, }; -actor_process_profile_definition g_profile_E_SH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sm.cpp b/src/d/actor/d_a_e_sm.cpp index b85e22e640..a94225cf9b 100644 --- a/src/d/actor/d_a_e_sm.cpp +++ b/src/d/actor/d_a_e_sm.cpp @@ -2009,7 +2009,7 @@ daE_SM_c::daE_SM_c() {} AUDIO_INSTANCES; -static actor_method_class l_daE_SM_Method = { +static DUSK_CONST actor_method_class l_daE_SM_Method = { (process_method_func)daE_SM_Create, (process_method_func)daE_SM_Delete, (process_method_func)daE_SM_Execute, @@ -2017,7 +2017,7 @@ static actor_method_class l_daE_SM_Method = { (process_method_func)daE_SM_Draw, }; -actor_process_profile_definition g_profile_E_SM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sm2.cpp b/src/d/actor/d_a_e_sm2.cpp index f55c4411cb..808301527e 100644 --- a/src/d/actor/d_a_e_sm2.cpp +++ b/src/d/actor/d_a_e_sm2.cpp @@ -923,6 +923,14 @@ static void damage_check(e_sm2_class* i_this) { sm_hit_actor->mode = 10; u8 new_color_type = new_col_d[(sm_hit_actor->type * 7) + i_this->type]; + #if TARGET_PC + if (dusk::getSettings().game.restoreWiiGlitches && + ((sm_hit_actor->type == TYPE_BLUE && i_this->type == TYPE_YELLOW) || + (sm_hit_actor->type == TYPE_YELLOW && i_this->type == TYPE_BLUE))) + { + new_color_type = TYPE_GREEN; + } + #endif i_this->type = new_color_type; sm_hit_actor->type = new_color_type; @@ -1695,7 +1703,7 @@ static int daE_SM2_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_SM2_Method = { +static DUSK_CONST actor_method_class l_daE_SM2_Method = { (process_method_func)daE_SM2_Create, (process_method_func)daE_SM2_Delete, (process_method_func)daE_SM2_Execute, @@ -1703,7 +1711,7 @@ static actor_method_class l_daE_SM2_Method = { (process_method_func)daE_SM2_Draw, }; -actor_process_profile_definition g_profile_E_SM2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SM2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_st.cpp b/src/d/actor/d_a_e_st.cpp index fe12756de1..9a65bc98a3 100644 --- a/src/d/actor/d_a_e_st.cpp +++ b/src/d/actor/d_a_e_st.cpp @@ -3127,7 +3127,7 @@ static cPhs_Step daE_ST_Create(fopAc_ac_c* a_this) { } // mSphAttr }; - static dCcD_SrcCyl line_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl line_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -3198,7 +3198,7 @@ static cPhs_Step daE_ST_Create(fopAc_ac_c* a_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_ST_Method = { +static DUSK_CONST actor_method_class l_daE_ST_Method = { (process_method_func)daE_ST_Create, (process_method_func)daE_ST_Delete, (process_method_func)daE_ST_Execute, @@ -3206,7 +3206,7 @@ static actor_method_class l_daE_ST_Method = { (process_method_func)daE_ST_Draw, }; -actor_process_profile_definition g_profile_E_ST = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_ST = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_st_line.cpp b/src/d/actor/d_a_e_st_line.cpp index eaed9eb259..d3339726f0 100644 --- a/src/d/actor/d_a_e_st_line.cpp +++ b/src/d/actor/d_a_e_st_line.cpp @@ -116,13 +116,13 @@ static int daE_ST_LINE_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_ST_LINE_Method = { +static DUSK_CONST actor_method_class l_daE_ST_LINE_Method = { (process_method_func)daE_ST_LINE_Create, (process_method_func)daE_ST_LINE_Delete, (process_method_func)daE_ST_LINE_Execute, (process_method_func)daE_ST_LINE_IsDelete, (process_method_func)daE_ST_LINE_Draw, }; -actor_process_profile_definition g_profile_E_ST_LINE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_ST_LINE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_sw.cpp b/src/d/actor/d_a_e_sw.cpp index cab3337753..4e19ce617f 100644 --- a/src/d/actor/d_a_e_sw.cpp +++ b/src/d/actor/d_a_e_sw.cpp @@ -1794,7 +1794,7 @@ void daE_SW_c::d_setAction(void (daE_SW_c::*action)()) { (this->*field_0xafc)(); } -static actor_method_class l_daE_SW_Method = { +static DUSK_CONST actor_method_class l_daE_SW_Method = { (process_method_func)daE_SW_Create, (process_method_func)daE_SW_Delete, (process_method_func)daE_SW_Execute, @@ -1802,7 +1802,7 @@ static actor_method_class l_daE_SW_Method = { (process_method_func)daE_SW_Draw, }; -actor_process_profile_definition g_profile_E_SW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_SW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_th.cpp b/src/d/actor/d_a_e_th.cpp index 056e9f565e..58af2b4cfd 100644 --- a/src/d/actor/d_a_e_th.cpp +++ b/src/d/actor/d_a_e_th.cpp @@ -1313,7 +1313,7 @@ static int daE_TH_Create(fopAc_ac_c* a_this) { return phase_state; } -static actor_method_class l_daE_TH_Method = { +static DUSK_CONST actor_method_class l_daE_TH_Method = { (process_method_func)daE_TH_Create, (process_method_func)daE_TH_Delete, (process_method_func)daE_TH_Execute, @@ -1321,7 +1321,7 @@ static actor_method_class l_daE_TH_Method = { (process_method_func)daE_TH_Draw, }; -actor_process_profile_definition g_profile_E_TH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_TH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_th_ball.cpp b/src/d/actor/d_a_e_th_ball.cpp index 8e6c24f09c..e9be033af2 100644 --- a/src/d/actor/d_a_e_th_ball.cpp +++ b/src/d/actor/d_a_e_th_ball.cpp @@ -1115,7 +1115,7 @@ static int daE_TH_BALL_Create(fopAc_ac_c* a_this) { return phase_state; } -static actor_method_class l_daE_TH_BALL_Method = { +static DUSK_CONST actor_method_class l_daE_TH_BALL_Method = { (process_method_func)daE_TH_BALL_Create, (process_method_func)daE_TH_BALL_Delete, (process_method_func)daE_TH_BALL_Execute, @@ -1123,7 +1123,7 @@ static actor_method_class l_daE_TH_BALL_Method = { (process_method_func)daE_TH_BALL_Draw, }; -actor_process_profile_definition g_profile_E_TH_BALL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_TH_BALL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_tk.cpp b/src/d/actor/d_a_e_tk.cpp index 040394acb5..6b6c51773f 100644 --- a/src/d/actor/d_a_e_tk.cpp +++ b/src/d/actor/d_a_e_tk.cpp @@ -806,13 +806,13 @@ static int daE_TK_Create(fopAc_ac_c* actor) { return phase; } -static actor_method_class l_daE_TK_Method = { +static DUSK_CONST actor_method_class l_daE_TK_Method = { (process_method_func)daE_TK_Create, (process_method_func)daE_TK_Delete, (process_method_func)daE_TK_Execute, (process_method_func)daE_TK_IsDelete, (process_method_func)daE_TK_Draw, }; -actor_process_profile_definition g_profile_E_TK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_TK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_tk2.cpp b/src/d/actor/d_a_e_tk2.cpp index 30c0cce9df..c2a382a06b 100644 --- a/src/d/actor/d_a_e_tk2.cpp +++ b/src/d/actor/d_a_e_tk2.cpp @@ -608,13 +608,13 @@ static int daE_TK2_Create(fopAc_ac_c* actor) { return phase; } -static actor_method_class l_daE_TK2_Method = { +static DUSK_CONST actor_method_class l_daE_TK2_Method = { (process_method_func)daE_TK2_Create, (process_method_func)daE_TK2_Delete, (process_method_func)daE_TK2_Execute, (process_method_func)daE_TK2_IsDelete, (process_method_func)daE_TK2_Draw, }; -actor_process_profile_definition g_profile_E_TK2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_TK2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_tk_ball.cpp b/src/d/actor/d_a_e_tk_ball.cpp index 1ed6a0db0c..4714c492a2 100644 --- a/src/d/actor/d_a_e_tk_ball.cpp +++ b/src/d/actor/d_a_e_tk_ball.cpp @@ -470,13 +470,13 @@ static int daE_TK_BALL_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daE_TK_BALL_Method = { +static DUSK_CONST actor_method_class l_daE_TK_BALL_Method = { (process_method_func)daE_TK_BALL_Create, (process_method_func)daE_TK_BALL_Delete, (process_method_func)daE_TK_BALL_Execute, (process_method_func)daE_TK_BALL_IsDelete, (process_method_func)daE_TK_BALL_Draw, }; -actor_process_profile_definition g_profile_E_TK_BALL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_TK_BALL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_tt.cpp b/src/d/actor/d_a_e_tt.cpp index fb2a8bf8a5..aa618bba2f 100644 --- a/src/d/actor/d_a_e_tt.cpp +++ b/src/d/actor/d_a_e_tt.cpp @@ -1313,13 +1313,13 @@ static int daE_TT_Create(daE_TT_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_TT_Method = { +static DUSK_CONST actor_method_class l_daE_TT_Method = { (process_method_func)daE_TT_Create, (process_method_func)daE_TT_Delete, (process_method_func)daE_TT_Execute, (process_method_func)daE_TT_IsDelete, (process_method_func)daE_TT_Draw, }; -actor_process_profile_definition g_profile_E_TT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_TT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_vt.cpp b/src/d/actor/d_a_e_vt.cpp index 305e212401..f1afe17398 100644 --- a/src/d/actor/d_a_e_vt.cpp +++ b/src/d/actor/d_a_e_vt.cpp @@ -3919,7 +3919,7 @@ static int daE_VA_Create(daE_VA_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_VA_Method = { +static DUSK_CONST actor_method_class l_daE_VA_Method = { (process_method_func)daE_VA_Create, (process_method_func)daE_VA_Delete, (process_method_func)daE_VA_Execute, @@ -3927,7 +3927,7 @@ static actor_method_class l_daE_VA_Method = { (process_method_func)daE_VA_Draw, }; -actor_process_profile_definition g_profile_E_VT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_VT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_warpappear.cpp b/src/d/actor/d_a_e_warpappear.cpp index d752b727a6..96e2c4e0ff 100644 --- a/src/d/actor/d_a_e_warpappear.cpp +++ b/src/d/actor/d_a_e_warpappear.cpp @@ -907,13 +907,13 @@ static int daE_Warpappear_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daE_Warpappear_Method = { +static DUSK_CONST actor_method_class l_daE_Warpappear_Method = { (process_method_func)daE_Warpappear_Create, (process_method_func)daE_Warpappear_Delete, (process_method_func)daE_Warpappear_Execute, (process_method_func)daE_Warpappear_IsDelete, (process_method_func)daE_Warpappear_Draw, }; -actor_process_profile_definition g_profile_E_WAP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_WAP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_wb.cpp b/src/d/actor/d_a_e_wb.cpp index 47004737cb..b5a38eff65 100644 --- a/src/d/actor/d_a_e_wb.cpp +++ b/src/d/actor/d_a_e_wb.cpp @@ -535,7 +535,7 @@ static int daE_WB_Draw(e_wb_class* i_this) { i_this->himo_tex.update(2, l_color, &actor->tevStr); dComIfGd_set3DlineMat(&i_this->himo_tex); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->himo_interp_curr_valid) { memcpy(i_this->himo_mat_interp_prev, i_this->himo_mat_interp_curr, sizeof(i_this->himo_mat_interp_curr)); memcpy(i_this->himo_tex_interp_prev, i_this->himo_tex_interp_curr, sizeof(i_this->himo_tex_interp_curr)); @@ -603,8 +603,8 @@ static s8 gake_check(e_wb_class* i_this) { cXyz mae; cXyz ato; - static f32 chk_x[4] = {14257.0f, 34775.0f, -22864.0f, -11627.0f}; - static f32 chk_z[4] = {20075.0f, -16467.0f, 9823.0f, 22601.0f}; + static DUSK_CONSTEXPR f32 chk_x[4] = {14257.0f, 34775.0f, -22864.0f, -11627.0f}; + static DUSK_CONSTEXPR f32 chk_z[4] = {20075.0f, -16467.0f, 9823.0f, 22601.0f}; if (lbl_244_bss_46 != 0) { if (!daAlink_getAlinkActorClass()->checkBoarRideOwn(actor) && @@ -743,8 +743,8 @@ static int e_wb_saku_check_sub(e_wb_class* i_this, s16 yaa) { static int e_wb_saku_check(e_wb_class* i_this) { e_wb_class* unused = i_this; int saku = false; - static s16 yaa[3] = {0, -4096, 4096}; - static u32 saku_bit[3] = {1, 2, 4}; + static DUSK_CONSTEXPR s16 yaa[3] = {0, -4096, 4096}; + static DUSK_CONSTEXPR u32 saku_bit[3] = {1, 2, 4}; for (int i = 0; i < 3; i++) { if (e_wb_saku_check_sub(i_this, yaa[i])) { @@ -1813,18 +1813,18 @@ static void e_wb_b_run(e_wb_class* i_this) { static void arrow_rd_set(e_wb_class* i_this) { fopAc_ac_c* actor = (fopAc_ac_c*)i_this; - static cXyz arrow_rd_pos[1] = {cXyz(36460.0f, 1040.0f, -17020.0f)}; + static DUSK_CONSTEXPR cXyz arrow_rd_pos[1] = {cXyz(36460.0f, 1040.0f, -17020.0f)}; for (int i = 0; i < 1; i++) { fopAcM_create(fpcNm_E_RD_e, 0xff00a3ff, &arrow_rd_pos[i], fopAcM_GetRoomNo(actor), 0, 0, -1); } } -static cXyz saku_p(34800.0f, 0.0f, -14900.0f); +static DUSK_CONSTEXPR cXyz saku_p(34800.0f, 0.0f, -14900.0f); -static cXyz saku_p2(34800.0f, 0.0f, -37200.0f); +static DUSK_CONSTEXPR cXyz saku_p2(34800.0f, 0.0f, -37200.0f); static void e_wb_b_ikki(e_wb_class* i_this) { - static cXyz ikki_pos[2] = {cXyz(34789.0f, -290.0f, -36200.0f), + static DUSK_CONSTEXPR cXyz ikki_pos[2] = {cXyz(34789.0f, -290.0f, -36200.0f), cXyz(34789.0f, -290.0f, -16600.0f)}; fopAc_ac_c* actor = (fopAc_ac_c*)i_this; @@ -2036,18 +2036,18 @@ static void e_wb_b_ikki(e_wb_class* i_this) { if (i_this->saku_burn != 0) { if (i_this->saku_burn == 1) { - static cXyz f_pos[2] = {cXyz(34800.0f, -300.0f, -15150.0f), + static DUSK_CONSTEXPR cXyz f_pos[2] = {cXyz(34800.0f, -300.0f, -15150.0f), cXyz(34800.0f, -300.0f, -37200.0f)}; csXyz angl; for (int i = 0; i < 2; i++) { - static s16 f_ya[2] = { + static DUSK_CONSTEXPR s16 f_ya[2] = { -0x8000, 0x0000, }; angl.set(0, f_ya[i], 0); for (int j = 0; j < 2; j++) { - static u16 f_id[2] = { + static DUSK_CONSTEXPR u16 f_id[2] = { dPa_RM(ID_ZI_S_UMASAKU_BURN_A), dPa_RM(ID_ZI_S_UMASAKU_BURN_B), }; @@ -2089,7 +2089,7 @@ static void e_wb_b_ikki_end(e_wb_class* i_this) { } static void e_wb_b_ikki2(e_wb_class* i_this) { - static cXyz ikki2_pos[2] = {cXyz(-93620.0f, -5750.0f, 48944.0f), + static DUSK_CONSTEXPR cXyz ikki2_pos[2] = {cXyz(-93620.0f, -5750.0f, 48944.0f), cXyz(-93620.0f, -5750.0f, 28423.0f)}; fopAc_ac_c* actor = (fopAc_ac_c*)i_this; @@ -2960,12 +2960,12 @@ static void effect_set(e_wb_class* i_this) { J3DModel* model = i_this->anm_p->getModel(); int foot_idx = (i_this->counter & 2) >> 1; - static int footd[2] = { + static DUSK_CONSTEXPR int footd[2] = { 6, 10, }; - static int footd_B[2] = { + static DUSK_CONSTEXPR int footd_B[2] = { 6, 10, }; @@ -3076,13 +3076,13 @@ static void effect_set(e_wb_class* i_this) { cXyz scale(v, v, v); csXyz angle(0, 0, 0); - static u16 w_eff_name[3] = { + static DUSK_CONSTEXPR u16 w_eff_name[3] = { dPa_RM(ID_ZI_S_ENEMY_RUNWTRA_A), dPa_RM(ID_ZI_S_ENEMY_RUNWTRA_B), dPa_RM(ID_ZI_S_ENEMY_RUNWTRA_C), }; - static u16 w_eff_name2[3] = { + static DUSK_CONSTEXPR u16 w_eff_name2[3] = { dPa_RM(ID_ZI_S_ENEMY_DOWNWTRA_A), dPa_RM(ID_ZI_S_ENEMY_DOWNWTRA_B), dPa_RM(ID_ZI_S_ENEMY_DOWNWTRA_C), @@ -3100,10 +3100,10 @@ static void effect_set(e_wb_class* i_this) { } if (is_water && i_this->field_0x1721 != 0) { - static cXyz sc(4.0f, 4.0f, 4.0f); + static DUSK_CONSTEXPR cXyz sc(4.0f, 4.0f, 4.0f); for (int i = 0; i < 4; i++) { - static u16 w_eff_id[4] = { + static DUSK_CONSTEXPR u16 w_eff_id[4] = { ID_ZI_J_DOWNWTRA_A, ID_ZI_J_DOWNWTRA_B, ID_ZI_J_DOWNWTRA_C, @@ -3339,13 +3339,13 @@ static s8 e_wb_c_run(e_wb_class* i_this) { if (!behind_obstacle) { - static cXyz sh_pos[3] = { + static DUSK_CONSTEXPR cXyz sh_pos[3] = { cXyz(400.0f, 200.0f, 200.0f), cXyz(-400.0f, 200.0f, 300.0f), cXyz(0.0f, 200.0f, -700.0f), }; - static cXyz sh_posH[3] = { + static DUSK_CONSTEXPR cXyz sh_posH[3] = { cXyz(150.0f, 200.0f, 200.0f), cXyz(-150.0f, 200.0f, 300.0f), cXyz(0.0f, 200.0f, -700.0f) @@ -4893,7 +4893,7 @@ static void demo_camera(e_wb_class* i_this) { } for (int i = 0; i < 2; i++) { - static u16 key_eno[2] = { + static DUSK_CONSTEXPR u16 key_eno[2] = { dPa_RM(ID_ZM_S_KEYLIGHT00), dPa_RM(ID_ZM_S_KEYLIGHT01), }; @@ -4924,7 +4924,7 @@ static void demo_camera(e_wb_class* i_this) { } break; case 94: { for (int i = 0; i < 2; i++) { - static u16 key_eno[2] = { + static DUSK_CONSTEXPR u16 key_eno[2] = { dPa_RM(ID_ZM_S_KEYLIGHT00), dPa_RM(ID_ZM_S_KEYLIGHT01), }; @@ -5482,8 +5482,8 @@ static int daE_WB_Execute(e_wb_class* i_this) { mae.set(0.0f, 0.0f, 0.0f); for (int i = 0; i < 4; i++) { - static int foot_no[4] = {5, 24, 9, 20}; - static int foot_no_B[4] = {5, 28, 9, 23}; + static DUSK_CONSTEXPR int foot_no[4] = {5, 24, 9, 20}; + static DUSK_CONSTEXPR int foot_no_B[4] = {5, 28, 9, 23}; if (i_this->leader != 0) { MTXCopy(model->getAnmMtx(foot_no_B[i]), *calc_mtx); @@ -5713,11 +5713,11 @@ static int daE_WB_Create(fopAc_ac_c* actor) { fopAcM_GetRoomNo(actor), 0, 0, -1, 0); } - static f32 pass_r[6] = { + static DUSK_CONSTEXPR f32 pass_r[6] = { 0.0f, 800.0f, 800.0f, -100.0f, -150.0f, -100.0f, }; - static f32 x_check_off[6] = { + static DUSK_CONSTEXPR f32 x_check_off[6] = { 600.0f, -800.0f, 800.0f, -300.0f, 0.0f, 300.0f, }; @@ -5768,7 +5768,7 @@ static int daE_WB_Create(fopAc_ac_c* actor) { } for (int i = 0; i <= 6; i++) { - static dCcD_SrcSph cc_sph_src = { + static DUSK_CONSTEXPR dCcD_SrcSph cc_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x486022, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -5789,7 +5789,7 @@ static int daE_WB_Create(fopAc_ac_c* actor) { } } - static dCcD_SrcSph at_sph_src = { + static DUSK_CONSTEXPR dCcD_SrcSph at_sph_src = { { {0x0, {{AT_TYPE_1000, 0x2, 0x1f}, {0x0, 0x0}, 0x0}}, // mObj {dCcD_SE_HARD_BODY, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -5863,13 +5863,13 @@ static int daE_WB_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daE_WB_Method = { +static DUSK_CONST actor_method_class l_daE_WB_Method = { (process_method_func)daE_WB_Create, (process_method_func)daE_WB_Delete, (process_method_func)daE_WB_Execute, (process_method_func)daE_WB_IsDelete, (process_method_func)daE_WB_Draw, }; -actor_process_profile_definition g_profile_E_WB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_WB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ws.cpp b/src/d/actor/d_a_e_ws.cpp index bb5835776f..1bc16d4614 100644 --- a/src/d/actor/d_a_e_ws.cpp +++ b/src/d/actor/d_a_e_ws.cpp @@ -996,7 +996,7 @@ static int daE_WS_Create(daE_WS_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_WS_Method = { +static DUSK_CONST actor_method_class l_daE_WS_Method = { (process_method_func)daE_WS_Create, (process_method_func)daE_WS_Delete, (process_method_func)daE_WS_Execute, @@ -1004,7 +1004,7 @@ static actor_method_class l_daE_WS_Method = { (process_method_func)daE_WS_Draw, }; -actor_process_profile_definition g_profile_E_WS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_WS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ww.cpp b/src/d/actor/d_a_e_ww.cpp index 5f378b60f9..cc82b1e652 100644 --- a/src/d/actor/d_a_e_ww.cpp +++ b/src/d/actor/d_a_e_ww.cpp @@ -2297,7 +2297,7 @@ static int daE_WW_Create(daE_WW_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daE_WW_Method = { +static DUSK_CONST actor_method_class l_daE_WW_Method = { (process_method_func)daE_WW_Create, (process_method_func)daE_WW_Delete, (process_method_func)daE_WW_Execute, @@ -2305,7 +2305,7 @@ static actor_method_class l_daE_WW_Method = { (process_method_func)daE_WW_Draw, }; -actor_process_profile_definition g_profile_E_WW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_WW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yc.cpp b/src/d/actor/d_a_e_yc.cpp index c14e710e47..dabd605919 100644 --- a/src/d/actor/d_a_e_yc.cpp +++ b/src/d/actor/d_a_e_yc.cpp @@ -826,7 +826,7 @@ static cPhs_Step daE_YC_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daE_YC_Method = { +static DUSK_CONST actor_method_class l_daE_YC_Method = { (process_method_func)daE_YC_Create, (process_method_func)daE_YC_Delete, (process_method_func)daE_YC_Execute, @@ -834,7 +834,7 @@ static actor_method_class l_daE_YC_Method = { (process_method_func)daE_YC_Draw, }; -actor_process_profile_definition g_profile_E_YC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yd.cpp b/src/d/actor/d_a_e_yd.cpp index 18809e05ea..52a5be7fdc 100644 --- a/src/d/actor/d_a_e_yd.cpp +++ b/src/d/actor/d_a_e_yd.cpp @@ -107,7 +107,7 @@ static s32 daE_YD_Draw(e_yd_class* i_this) { i_this->mLineMat.update(12, l_color, &i_this->actor.tevStr); dComIfGd_set3DlineMat(&i_this->mLineMat); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mLineMatInterpCurrValid) { memcpy(i_this->mLineMatInterpPrev, i_this->mLineMatInterpCurr, sizeof(i_this->mLineMatInterpCurr)); i_this->mLineMatInterpPrevValid = true; @@ -1515,7 +1515,7 @@ static int daE_YD_Create(fopAc_ac_c* i_this) { return loadRv; } -static actor_method_class l_daE_YD_Method = { +static DUSK_CONST actor_method_class l_daE_YD_Method = { (process_method_func)daE_YD_Create, (process_method_func)daE_YD_Delete, (process_method_func)daE_YD_Execute, @@ -1523,7 +1523,7 @@ static actor_method_class l_daE_YD_Method = { (process_method_func)daE_YD_Draw, }; -actor_process_profile_definition g_profile_E_YD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yd_leaf.cpp b/src/d/actor/d_a_e_yd_leaf.cpp index 750842e144..cf13e26a7c 100644 --- a/src/d/actor/d_a_e_yd_leaf.cpp +++ b/src/d/actor/d_a_e_yd_leaf.cpp @@ -88,13 +88,13 @@ static int daE_YD_LEAF_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daE_YD_LEAF_Method = { +static DUSK_CONST actor_method_class l_daE_YD_LEAF_Method = { (process_method_func)daE_YD_LEAF_Create, (process_method_func)daE_YD_LEAF_Delete, (process_method_func)daE_YD_LEAF_Execute, (process_method_func)daE_YD_LEAF_IsDelete, (process_method_func)daE_YD_LEAF_Draw, }; -actor_process_profile_definition g_profile_E_YD_LEAF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YD_LEAF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yg.cpp b/src/d/actor/d_a_e_yg.cpp index 44a8aee249..71756d6f57 100644 --- a/src/d/actor/d_a_e_yg.cpp +++ b/src/d/actor/d_a_e_yg.cpp @@ -139,6 +139,7 @@ static BOOL pl_check(e_yg_class* i_this, f32 i_dist) { #if TARGET_PC static void daE_YG_interp_callback(bool isSimFrame, void* pUserWork) { e_yg_class* i_this = (e_yg_class*)pUserWork; + fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->actor; if (!i_this->mTentacleInterpPrevValid || !i_this->mTentacleInterpCurrValid) { return; } @@ -152,6 +153,13 @@ static void daE_YG_interp_callback(bool isSimFrame, void* pUserWork) { dst[i] = p0 + (p1 - p0) * alpha; } } + GXColor color; + color.r = JREG_S(0) + 20; + color.g = JREG_S(1) + 20; + color.b = JREG_S(2) + 20; + color.a = 0xFF; + + i_this->mLineMat.update(10, color, &actor->tevStr); } #endif @@ -183,7 +191,7 @@ static int daE_YG_Draw(e_yg_class* i_this) { dComIfGd_set3DlineMatDark(&i_this->mLineMat); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mTentacleInterpCurrValid) { memcpy(i_this->mTentacleInterpPrev, i_this->mTentacleInterpCurr, sizeof(i_this->mTentacleInterpCurr)); i_this->mTentacleInterpPrevValid = true; @@ -1500,7 +1508,7 @@ static cPhs_Step daE_YG_Create(fopAc_ac_c* actor) { AUDIO_INSTANCES; -static actor_method_class l_daE_YG_Method = { +static DUSK_CONST actor_method_class l_daE_YG_Method = { (process_method_func)daE_YG_Create, (process_method_func)daE_YG_Delete, (process_method_func)daE_YG_Execute, @@ -1508,7 +1516,7 @@ static actor_method_class l_daE_YG_Method = { (process_method_func)daE_YG_Draw, }; -actor_process_profile_definition g_profile_E_YG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yh.cpp b/src/d/actor/d_a_e_yh.cpp index cf9955a7db..fb00a4bab1 100644 --- a/src/d/actor/d_a_e_yh.cpp +++ b/src/d/actor/d_a_e_yh.cpp @@ -135,7 +135,7 @@ static int daE_YH_Draw(e_yh_class* i_this) { i_this->mLine.update(12, l_color, &a_this->tevStr); dComIfGd_set3DlineMat(&i_this->mLine); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (i_this->mLineInterpCurrValid) { memcpy(i_this->mLineInterpPrev, i_this->mLineInterpCurr, sizeof(i_this->mLineInterpCurr)); i_this->mLineInterpPrevValid = true; @@ -2275,7 +2275,7 @@ static int daE_YH_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daE_YH_Method = { +static DUSK_CONST actor_method_class l_daE_YH_Method = { (process_method_func)daE_YH_Create, (process_method_func)daE_YH_Delete, (process_method_func)daE_YH_Execute, @@ -2283,7 +2283,7 @@ static actor_method_class l_daE_YH_Method = { (process_method_func)daE_YH_Draw, }; -actor_process_profile_definition g_profile_E_YH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yk.cpp b/src/d/actor/d_a_e_yk.cpp index e42af49348..602e5a23d5 100644 --- a/src/d/actor/d_a_e_yk.cpp +++ b/src/d/actor/d_a_e_yk.cpp @@ -1549,7 +1549,7 @@ static int daE_YK_Create(fopAc_ac_c* i_this) { return phase_step; } -static actor_method_class l_daE_YK_Method = { +static DUSK_CONST actor_method_class l_daE_YK_Method = { (process_method_func)daE_YK_Create, (process_method_func)daE_YK_Delete, (process_method_func)daE_YK_Execute, @@ -1557,7 +1557,7 @@ static actor_method_class l_daE_YK_Method = { (process_method_func)daE_YK_Draw, }; -actor_process_profile_definition g_profile_E_YK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ym.cpp b/src/d/actor/d_a_e_ym.cpp index 3f6bef6788..7c96e289ee 100644 --- a/src/d/actor/d_a_e_ym.cpp +++ b/src/d/actor/d_a_e_ym.cpp @@ -35,7 +35,7 @@ public: /* 0x20 */ f32 mMoveRange; }; -dCcD_SrcSph E_YM_n::cc_sph_src = { +DUSK_GAME_DATA dCcD_SrcSph E_YM_n::cc_sph_src = { { {0, {{0x400, 1, 13}, {0xD8FBFDFF, 3}, 0x75}}, {dCcD_SE_METAL, 0, 0, 0, {0}}, @@ -3727,7 +3727,7 @@ static int daE_YM_Create(daE_YM_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_YM_Method = { +static DUSK_CONST actor_method_class l_daE_YM_Method = { (process_method_func)daE_YM_Create, (process_method_func)daE_YM_Delete, (process_method_func)daE_YM_Execute, @@ -3735,7 +3735,7 @@ static actor_method_class l_daE_YM_Method = { (process_method_func)daE_YM_Draw, }; -actor_process_profile_definition g_profile_E_YM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ym_tag.cpp b/src/d/actor/d_a_e_ym_tag.cpp index 501c80bd3b..9c40adc47e 100644 --- a/src/d/actor/d_a_e_ym_tag.cpp +++ b/src/d/actor/d_a_e_ym_tag.cpp @@ -60,7 +60,7 @@ static int daE_YM_TAG_Create(daE_YM_TAG_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_YM_TAG_Method = { +static DUSK_CONST actor_method_class l_daE_YM_TAG_Method = { (process_method_func)daE_YM_TAG_Create, (process_method_func)daE_YM_TAG_Delete, (process_method_func)daE_YM_TAG_Execute, @@ -68,7 +68,7 @@ static actor_method_class l_daE_YM_TAG_Method = { (process_method_func)daE_YM_TAG_Draw }; -actor_process_profile_definition g_profile_E_YM_TAG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YM_TAG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_ymb.cpp b/src/d/actor/d_a_e_ymb.cpp index 2604b06480..8f395bc741 100644 --- a/src/d/actor/d_a_e_ymb.cpp +++ b/src/d/actor/d_a_e_ymb.cpp @@ -3239,7 +3239,7 @@ static int daE_YMB_Create(daE_YMB_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_YMB_Method = { +static DUSK_CONST actor_method_class l_daE_YMB_Method = { (process_method_func)daE_YMB_Create, (process_method_func)daE_YMB_Delete, (process_method_func)daE_YMB_Execute, @@ -3247,7 +3247,7 @@ static actor_method_class l_daE_YMB_Method = { (process_method_func)daE_YMB_Draw, }; -actor_process_profile_definition g_profile_E_YMB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YMB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_yr.cpp b/src/d/actor/d_a_e_yr.cpp index dfd07b6797..6a2aba9ee5 100644 --- a/src/d/actor/d_a_e_yr.cpp +++ b/src/d/actor/d_a_e_yr.cpp @@ -2560,7 +2560,7 @@ static int daE_Yr_Create(fopAc_ac_c* i_this) { return loadResult; } -static actor_method_class l_daE_Yr_Method = { +static DUSK_CONST actor_method_class l_daE_Yr_Method = { (process_method_func)daE_Yr_Create, (process_method_func)daE_Yr_Delete, (process_method_func)daE_Yr_Execute, @@ -2568,7 +2568,7 @@ static actor_method_class l_daE_Yr_Method = { (process_method_func)daE_Yr_Draw, }; -actor_process_profile_definition g_profile_E_YR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_YR = { /* Layer ID */ (u32)fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_zh.cpp b/src/d/actor/d_a_e_zh.cpp index 827a8fd36a..9ddc8a1b22 100644 --- a/src/d/actor/d_a_e_zh.cpp +++ b/src/d/actor/d_a_e_zh.cpp @@ -85,7 +85,7 @@ namespace { } }; - static dCcD_SrcCyl cc_zhCyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_zhCyl_src = { { {0, {{AT_TYPE_0, 0, 0}, {0xD84860BA, 3}, 0x15}}, {dCcD_SE_METAL, 0, 0, 0, 0}, @@ -99,7 +99,7 @@ namespace { } }; - static dCcD_SrcCyl cc_zhCyl_at_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_zhCyl_at_src = { { {0, {{AT_TYPE_CSTATUE_SWING, 4, 0xD}, {0, 0}, 0}}, {dCcD_SE_METAL, 0, 2, 0, 0}, @@ -2327,7 +2327,7 @@ static int daE_ZH_Create(daE_ZH_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daE_ZH_Method = { +static DUSK_CONST actor_method_class l_daE_ZH_Method = { (process_method_func)daE_ZH_Create, (process_method_func)daE_ZH_Delete, (process_method_func)daE_ZH_Execute, @@ -2335,7 +2335,7 @@ static actor_method_class l_daE_ZH_Method = { (process_method_func)daE_ZH_Draw, }; -actor_process_profile_definition g_profile_E_ZH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_ZH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_zm.cpp b/src/d/actor/d_a_e_zm.cpp index dd7e0db5ba..72037a5254 100644 --- a/src/d/actor/d_a_e_zm.cpp +++ b/src/d/actor/d_a_e_zm.cpp @@ -70,7 +70,7 @@ static u8 hio_set; static daE_ZM_HIO_c l_HIO; namespace { - static dCcD_SrcCyl cc_zm_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_zm_src = { { {0, {{AT_TYPE_0, 0, 0}, {0xD8FBFDFF, 0x43}, 0x45}}, {dCcD_SE_13, 0, 0, 0, 0}, @@ -1025,7 +1025,7 @@ static int daE_ZM_Create(daE_ZM_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_ZM_Method = { +static DUSK_CONST actor_method_class l_daE_ZM_Method = { (process_method_func)daE_ZM_Create, (process_method_func)daE_ZM_Delete, (process_method_func)daE_ZM_Execute, @@ -1033,7 +1033,7 @@ static actor_method_class l_daE_ZM_Method = { (process_method_func)daE_ZM_Draw, }; -actor_process_profile_definition g_profile_E_ZM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_ZM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_e_zs.cpp b/src/d/actor/d_a_e_zs.cpp index cd57ffdd51..cd85e35f4e 100644 --- a/src/d/actor/d_a_e_zs.cpp +++ b/src/d/actor/d_a_e_zs.cpp @@ -561,7 +561,7 @@ static int daE_ZS_Create(daE_ZS_c* i_this) { return i_this->create(); } -static actor_method_class l_daE_ZS_Method = { +static DUSK_CONST actor_method_class l_daE_ZS_Method = { (process_method_func)daE_ZS_Create, (process_method_func)daE_ZS_Delete, (process_method_func)daE_ZS_Execute, @@ -569,7 +569,7 @@ static actor_method_class l_daE_ZS_Method = { (process_method_func)daE_ZS_Draw, }; -actor_process_profile_definition g_profile_E_ZS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_E_ZS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_econt.cpp b/src/d/actor/d_a_econt.cpp index ea976d6ee9..7a242add0f 100644 --- a/src/d/actor/d_a_econt.cpp +++ b/src/d/actor/d_a_econt.cpp @@ -10,7 +10,7 @@ #include "d/d_meter2_info.h" #include "f_pc/f_pc_executor.h" -u8 data_805197E0[4]; +DUSK_GAME_DATA u8 data_805197E0[4]; static int daEcont_Draw(econt_class* i_this) { return 1; @@ -71,7 +71,7 @@ static int daEcont_Create(fopAc_ac_c* i_this) { } -static actor_method_class l_daEcont_Method = { +static DUSK_CONST actor_method_class l_daEcont_Method = { (process_method_func)daEcont_Create, (process_method_func)daEcont_Delete, (process_method_func)daEcont_Execute, @@ -79,7 +79,7 @@ static actor_method_class l_daEcont_Method = { (process_method_func)daEcont_Draw }; -actor_process_profile_definition g_profile_ECONT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ECONT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_ep.cpp b/src/d/actor/d_a_ep.cpp index 312bd08ea4..51ef2e7675 100644 --- a/src/d/actor/d_a_ep.cpp +++ b/src/d/actor/d_a_ep.cpp @@ -390,7 +390,7 @@ static BOOL ep_switch_event_begin(ep_class* i_this) { } static int ep_switch_event_move(ep_class* i_this) { - static char* actions[2] = { + static DUSK_CONST char* actions[2] = { "WAIT", "FIRE", }; @@ -851,7 +851,7 @@ static int daEp_Create(fopAc_ac_c* a_this) { } // mSphAttr }; - static dCcD_SrcCyl co_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl co_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdbf, 0x1f}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -948,7 +948,7 @@ static int daEp_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daEp_Method = { +static DUSK_CONST actor_method_class l_daEp_Method = { (process_method_func)daEp_Create, (process_method_func)daEp_Delete, (process_method_func)daEp_Execute, @@ -956,7 +956,7 @@ static actor_method_class l_daEp_Method = { (process_method_func)daEp_Draw, }; -actor_process_profile_definition g_profile_EP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_EP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_formation_mng.cpp b/src/d/actor/d_a_formation_mng.cpp index c4a9127627..4512826412 100644 --- a/src/d/actor/d_a_formation_mng.cpp +++ b/src/d/actor/d_a_formation_mng.cpp @@ -9,7 +9,7 @@ #include "d/d_save.h" #include "f_op/f_op_actor_mng.h" -FmtMngAttributes const daFmtMng_c::M_attr = { +DUSK_GAME_DATA FmtMngAttributes const daFmtMng_c::M_attr = { 0x14, 6.0f, 0.5f, 120.0f, 150.0f, 10, 0x4000, }; @@ -62,7 +62,7 @@ void daFmtMng_c::initMemberPos() { } } -daFmtMng_c::ActionFunc daFmtMng_c::ActionTable[10] = { +DUSK_GAME_DATA daFmtMng_c::ActionFunc daFmtMng_c::ActionTable[10] = { &daFmtMng_c::initWait, &daFmtMng_c::executeWait, &daFmtMng_c::initWalk, &daFmtMng_c::executeWalk, &daFmtMng_c::initReverse, &daFmtMng_c::executeReverse, @@ -386,7 +386,7 @@ void daFmtMng_c::create_init() { } } -static actor_method_class l_daFmtMng_Method = { +static DUSK_CONST actor_method_class l_daFmtMng_Method = { (process_method_func)daFmtMng_Create, (process_method_func)daFmtMng_Delete, (process_method_func)daFmtMng_Execute, @@ -394,7 +394,7 @@ static actor_method_class l_daFmtMng_Method = { (process_method_func)daFmtMng_Draw, }; -actor_process_profile_definition g_profile_FORMATION_MNG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_FORMATION_MNG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_fr.cpp b/src/d/actor/d_a_fr.cpp index 9280a93013..4f0c161268 100644 --- a/src/d/actor/d_a_fr.cpp +++ b/src/d/actor/d_a_fr.cpp @@ -732,7 +732,7 @@ static int daFr_Create(fopAc_ac_c* a_this) { return phase_state; } -static actor_method_class l_daFr_Method = { +static DUSK_CONST actor_method_class l_daFr_Method = { (process_method_func)daFr_Create, (process_method_func)daFr_Delete, (process_method_func)daFr_Execute, @@ -740,7 +740,7 @@ static actor_method_class l_daFr_Method = { (process_method_func)daFr_Draw, }; -actor_process_profile_definition g_profile_FR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_FR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_grass.cpp b/src/d/actor/d_a_grass.cpp index f04d5cfcd2..e3f12f3300 100644 --- a/src/d/actor/d_a_grass.cpp +++ b/src/d/actor/d_a_grass.cpp @@ -391,7 +391,7 @@ static int daGrass_draw(daGrass_c* i_this) { return i_this->draw(); } -static actor_method_class daGrass_METHODS = { +static DUSK_CONST actor_method_class daGrass_METHODS = { (process_method_func)daGrass_create, (process_method_func)daGrass_Delete, (process_method_func)daGrass_execute, @@ -399,7 +399,7 @@ static actor_method_class daGrass_METHODS = { (process_method_func)daGrass_draw, }; -actor_process_profile_definition g_profile_GRASS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_GRASS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 11, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_guard_mng.cpp b/src/d/actor/d_a_guard_mng.cpp index 141b390c38..c982692975 100644 --- a/src/d/actor/d_a_guard_mng.cpp +++ b/src/d/actor/d_a_guard_mng.cpp @@ -59,14 +59,14 @@ static int daGuardMng_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daGuardMng_Method = { +static DUSK_CONST actor_method_class l_daGuardMng_Method = { (process_method_func)daGuardMng_Create, (process_method_func)daGuardMng_Delete, (process_method_func)daGuardMng_Execute, (process_method_func)daGuardMng_IsDelete }; -actor_process_profile_definition g_profile_GUARD_MNG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_GUARD_MNG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_hitobj.cpp b/src/d/actor/d_a_hitobj.cpp index d8f3aae581..fe54032d21 100644 --- a/src/d/actor/d_a_hitobj.cpp +++ b/src/d/actor/d_a_hitobj.cpp @@ -65,7 +65,7 @@ static int daHitobj_Create(fopAc_ac_c* i_this) { return ret; } -static actor_method_class l_daHitobj_Method = { +static DUSK_CONST actor_method_class l_daHitobj_Method = { (process_method_func)daHitobj_Create, (process_method_func)daHitobj_Delete, (process_method_func)daHitobj_Execute, @@ -73,7 +73,7 @@ static actor_method_class l_daHitobj_Method = { (process_method_func)daHitobj_Draw }; -actor_process_profile_definition g_profile_HITOBJ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_HITOBJ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_horse.cpp b/src/d/actor/d_a_horse.cpp index 16790d42ff..72b1fb1e7b 100644 --- a/src/d/actor/d_a_horse.cpp +++ b/src/d/actor/d_a_horse.cpp @@ -76,11 +76,11 @@ static void strippedFunc() { static char const l_arcName[] = "Horse"; -const u16 daHorse_c::m_footJointTable[] = { +DUSK_GAME_DATA const u16 daHorse_c::m_footJointTable[] = { 3, 7, 27, 31, }; -const f32 daHorse_c::m_callLimitDistance2 = 640000.0f; +DUSK_GAME_DATA const f32 daHorse_c::m_callLimitDistance2 = 640000.0f; static f32 l_autoUpHeight = 50.0f; @@ -170,7 +170,7 @@ void daHorse_hio_c::genMessage(JORMContext* ctx) { } #endif -const daHorse_hio_c1 daHorse_hio_c0::m = { +DUSK_GAME_DATA const daHorse_hio_c1 daHorse_hio_c0::m = { 600, 50, 45, @@ -2264,12 +2264,12 @@ void daHorse_c::setRoomInfo(int param_0) { } } -static cXyz l_frontFootOffset(23.5f, -20.0f, 0.0f); +static DUSK_CONSTEXPR cXyz l_frontFootOffset(23.5f, -20.0f, 0.0f); -static cXyz l_backFootOffset(25.5f, 12.0f, 0.0f); +static DUSK_CONSTEXPR cXyz l_backFootOffset(25.5f, 12.0f, 0.0f); void daHorse_c::setBodyPart() { - static cXyz localEyePos(25.0f, -15.0f, 0.0f); + static DUSK_CONSTEXPR cXyz localEyePos(25.0f, -15.0f, 0.0f); mDoMtx_multVec(m_model->getAnmMtx(15), &localEyePos, &eyePos); mDoMtx_multVecZero(m_model->getAnmMtx(0), &m_bodyEyePos); @@ -2427,10 +2427,10 @@ void daHorse_c::setEffect() { speedF); } - static cXyz runScale(2.0f, 2.0f, 2.0f); - static cXyz landScale(1.5f, 1.5f, 1.5f); - static cXyz grassRunScale(1.8f, 1.8f, 1.8f); - static cXyz waterDirection(0.0f, 1.0f, -0.75f); + static DUSK_CONSTEXPR cXyz runScale(2.0f, 2.0f, 2.0f); + static DUSK_CONSTEXPR cXyz landScale(1.5f, 1.5f, 1.5f); + static DUSK_CONSTEXPR cXyz grassRunScale(1.8f, 1.8f, 1.8f); + static DUSK_CONSTEXPR cXyz waterDirection(0.0f, 1.0f, -0.75f); int j; int i; @@ -2942,10 +2942,10 @@ void daHorse_c::footBgCheck() { } void daHorse_c::setReinPosMoveInit(int param_0) { - static cXyz reinLeftStart(63.0f, 17.0f, 11.0f); - static cXyz reinRightStart(63.0f, 17.0f, -11.0f); - static cXyz localNeckLeft(10.0f, 10.0f, 35.0f); - static cXyz localNeckRight(10.0f, 10.0f, -35.0f); + static DUSK_CONSTEXPR cXyz reinLeftStart(63.0f, 17.0f, 11.0f); + static DUSK_CONSTEXPR cXyz reinRightStart(63.0f, 17.0f, -11.0f); + static DUSK_CONSTEXPR cXyz localNeckLeft(10.0f, 10.0f, 35.0f); + static DUSK_CONSTEXPR cXyz localNeckRight(10.0f, 10.0f, -35.0f); static const f32 sideOffset = 10.0f; static const f32 onHandSideOffset = 1.0f; @@ -3128,8 +3128,8 @@ void daHorse_c::setReinPosHandSubstance(int param_0) { } void daHorse_c::setReinPosNormalSubstance() { - static cXyz saddleLeft(29.0f, -2.0f, 30.0f); - static cXyz saddleRight(29.0f, 2.0f, 30.0f); + static DUSK_CONSTEXPR cXyz saddleLeft(29.0f, -2.0f, 30.0f); + static DUSK_CONSTEXPR cXyz saddleRight(29.0f, 2.0f, 30.0f); static const int sideCount = 24; if (!checkStateFlg0(FLG0_UNK_1) && getZeldaActor() != NULL) { @@ -3165,7 +3165,7 @@ void daHorse_c::setReinPosNormalSubstance() { #if TARGET_PC void daHorse_c::lerpControlPoints(f32 alpha) { // FRAME INTERP NOTE: Currently only lerping points for Epona's reins. Need a more global solution. - if (!dusk::getSettings().game.enableFrameInterpolation || !s_horseReinSimPrevValid || !s_horseReinSimCurrValid) { + if (!dusk::frame_interp::is_enabled() || !s_horseReinSimPrevValid || !s_horseReinSimCurrValid) { return; } const int nCurr = s_horseReinSimNumCurr; @@ -3188,9 +3188,9 @@ void daHorse_c::lerpControlPoints(f32 alpha) { void daHorse_c::bgCheck() { if (m_procID != PROC_LARGE_DAMAGE_e) { - static cXyz localCenterPos(0.0f, 100.0f, 0.0f); - static cXyz localFrontPos(0.0f, 100.0f, 220.0f); - static cXyz localBackPos(0.0f, 100.0f, -170.0f); + static DUSK_CONSTEXPR cXyz localCenterPos(0.0f, 100.0f, 0.0f); + static DUSK_CONSTEXPR cXyz localFrontPos(0.0f, 100.0f, 220.0f); + static DUSK_CONSTEXPR cXyz localBackPos(0.0f, 100.0f, -170.0f); cXyz line_start; cXyz line_end; @@ -4750,7 +4750,7 @@ static int daHorse_Delete(daHorse_c* i_this) { return 1; } -static actor_method_class l_daHorse_Method = { +static DUSK_CONST actor_method_class l_daHorse_Method = { (process_method_func)daHorse_Create, (process_method_func)daHorse_Delete, (process_method_func)daHorse_Execute, @@ -4758,7 +4758,7 @@ static actor_method_class l_daHorse_Method = { (process_method_func)daHorse_Draw, }; -actor_process_profile_definition g_profile_HORSE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_HORSE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_hozelda.cpp b/src/d/actor/d_a_hozelda.cpp index 364654c1c1..dfc9ba038c 100644 --- a/src/d/actor/d_a_hozelda.cpp +++ b/src/d/actor/d_a_hozelda.cpp @@ -31,7 +31,7 @@ static void* daHoZelda_searchGanon(fopAc_ac_c* i_actor, void* i_data) { return NULL; } -const daHoZelda_hio_c1 daHoZelda_hio_c0::m = { +DUSK_GAME_DATA const daHoZelda_hio_c1 daHoZelda_hio_c0::m = { 0x38E, 0x2AAA, 0x4000, @@ -40,8 +40,8 @@ const daHoZelda_hio_c1 daHoZelda_hio_c0::m = { 4000.0f, }; -u8 daHoZelda_matAnm_c::mEyeMoveFlg; -u8 daHoZelda_matAnm_c::mMorfFrame; +DUSK_GAME_DATA u8 daHoZelda_matAnm_c::mEyeMoveFlg; +DUSK_GAME_DATA u8 daHoZelda_matAnm_c::mMorfFrame; void daHoZelda_matAnm_c::init() { field_0xf4 = 0.0f; @@ -930,7 +930,7 @@ static int daHoZelda_Draw(daHoZelda_c* i_this) { return i_this->draw(); } -static actor_method_class l_daHoZelda_Method = { +static DUSK_CONST actor_method_class l_daHoZelda_Method = { (process_method_func)daHoZelda_Create, (process_method_func)daHoZelda_Delete, (process_method_func)daHoZelda_Execute, @@ -938,7 +938,7 @@ static actor_method_class l_daHoZelda_Method = { (process_method_func)daHoZelda_Draw, }; -actor_process_profile_definition g_profile_HOZELDA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_HOZELDA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_izumi_gate.cpp b/src/d/actor/d_a_izumi_gate.cpp index d9e8b2a0dc..77ecab0ef6 100644 --- a/src/d/actor/d_a_izumi_gate.cpp +++ b/src/d/actor/d_a_izumi_gate.cpp @@ -35,7 +35,7 @@ static int daIzumiGate_Delete(daIzumiGate_c* i_this) { return 1; } -static char* l_arcName = "M_IzmGate"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_IzmGate"; int daIzumiGate_c::create() { fopAcM_ct(this, daIzumiGate_c); @@ -86,13 +86,13 @@ int daIzumiGate_c::Delete() { return 1; } -static actor_method_class l_daIzumiGate_Method = { +static DUSK_CONST actor_method_class l_daIzumiGate_Method = { (process_method_func)daIzumiGate_Create, (process_method_func)daIzumiGate_Delete, (process_method_func)daIzumiGate_Execute, (process_method_func)daIzumiGate_IsDelete, (process_method_func)daIzumiGate_Draw, }; -actor_process_profile_definition g_profile_Izumi_Gate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Izumi_Gate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kago.cpp b/src/d/actor/d_a_kago.cpp index 9444237f12..0b1954a4ed 100644 --- a/src/d/actor/d_a_kago.cpp +++ b/src/d/actor/d_a_kago.cpp @@ -3530,6 +3530,15 @@ void daKago_c::action() { #endif mStickY = mDoCPd_c::getStickY(PAD_1); +#ifdef TARGET_PC + if(dusk::getSettings().game.invertAirSwimX) { + mStickX = -mStickX; + } + if(dusk::getSettings().game.invertAirSwimY) { + mStickY = -mStickY; + } +#endif + u8 prevIsWaterfall = mIsWaterfall; mIsWaterfall = FALSE; fpcM_Search(s_waterfall, this); @@ -3894,7 +3903,7 @@ static int daKago_Create(daKago_c* i_this) { return i_this->create(); } -static actor_method_class l_daKago_Method = { +static DUSK_CONST actor_method_class l_daKago_Method = { (process_method_func)daKago_Create, (process_method_func)daKago_Delete, (process_method_func)daKago_Execute, @@ -3902,7 +3911,7 @@ static actor_method_class l_daKago_Method = { (process_method_func)daKago_Draw, }; -actor_process_profile_definition g_profile_KAGO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KAGO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag00.cpp b/src/d/actor/d_a_kytag00.cpp index 31c21d28b2..0b04a7fecc 100644 --- a/src/d/actor/d_a_kytag00.cpp +++ b/src/d/actor/d_a_kytag00.cpp @@ -459,13 +459,13 @@ static int daKytag00_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag00_Method = { +static DUSK_CONST actor_method_class l_daKytag00_Method = { (process_method_func)daKytag00_Create, (process_method_func)daKytag00_Delete, (process_method_func)daKytag00_Execute, (process_method_func)daKytag00_IsDelete, (process_method_func)daKytag00_Draw, }; -actor_process_profile_definition g_profile_KYTAG00 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG00 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag01.cpp b/src/d/actor/d_a_kytag01.cpp index 33c14c373f..ccbdb19725 100644 --- a/src/d/actor/d_a_kytag01.cpp +++ b/src/d/actor/d_a_kytag01.cpp @@ -215,13 +215,13 @@ static int daKytag01_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag01_Method = { +static DUSK_CONST actor_method_class l_daKytag01_Method = { (process_method_func)daKytag01_Create, (process_method_func)daKytag01_Delete, (process_method_func)daKytag01_Execute, (process_method_func)daKytag01_IsDelete, (process_method_func)daKytag01_Draw, }; -actor_process_profile_definition g_profile_KYTAG01 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG01 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag02.cpp b/src/d/actor/d_a_kytag02.cpp index cb2b05cf01..cdecaabdb1 100644 --- a/src/d/actor/d_a_kytag02.cpp +++ b/src/d/actor/d_a_kytag02.cpp @@ -130,13 +130,13 @@ static int daKytag02_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag02_Method = { +static DUSK_CONST actor_method_class l_daKytag02_Method = { (process_method_func)daKytag02_Create, (process_method_func)daKytag02_Delete, (process_method_func)daKytag02_Execute, (process_method_func)daKytag02_IsDelete, (process_method_func)daKytag02_Draw, }; -actor_process_profile_definition g_profile_KYTAG02 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG02 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag03.cpp b/src/d/actor/d_a_kytag03.cpp index 73a83b40cb..1437b1ca4c 100644 --- a/src/d/actor/d_a_kytag03.cpp +++ b/src/d/actor/d_a_kytag03.cpp @@ -455,13 +455,13 @@ static int daKytag03_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag03_Method = { +static DUSK_CONST actor_method_class l_daKytag03_Method = { (process_method_func)daKytag03_Create, (process_method_func)daKytag03_Delete, (process_method_func)daKytag03_Execute, (process_method_func)daKytag03_IsDelete, (process_method_func)daKytag03_Draw, }; -actor_process_profile_definition g_profile_KYTAG03 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG03 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag04.cpp b/src/d/actor/d_a_kytag04.cpp index 21f6d85b93..7efac7c2d5 100644 --- a/src/d/actor/d_a_kytag04.cpp +++ b/src/d/actor/d_a_kytag04.cpp @@ -354,13 +354,13 @@ static int daKytag04_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daKytag04_Method = { +static DUSK_CONST actor_method_class l_daKytag04_Method = { (process_method_func)daKytag04_Create, (process_method_func)daKytag04_Delete, (process_method_func)daKytag04_Execute, (process_method_func)daKytag04_IsDelete, (process_method_func)daKytag04_Draw, }; -actor_process_profile_definition g_profile_KYTAG04 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG04 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag05.cpp b/src/d/actor/d_a_kytag05.cpp index 1322057075..ec8cea1091 100644 --- a/src/d/actor/d_a_kytag05.cpp +++ b/src/d/actor/d_a_kytag05.cpp @@ -40,13 +40,13 @@ static int daKytag05_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag05_Method = { +static DUSK_CONST actor_method_class l_daKytag05_Method = { (process_method_func)daKytag05_Create, (process_method_func)daKytag05_Delete, (process_method_func)daKytag05_Execute, (process_method_func)daKytag05_IsDelete, (process_method_func)daKytag05_Draw, }; -actor_process_profile_definition g_profile_KYTAG05 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG05 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag06.cpp b/src/d/actor/d_a_kytag06.cpp index bc7510c9d4..6441507642 100644 --- a/src/d/actor/d_a_kytag06.cpp +++ b/src/d/actor/d_a_kytag06.cpp @@ -1188,13 +1188,13 @@ static int daKytag06_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag06_Method = { +static DUSK_CONST actor_method_class l_daKytag06_Method = { (process_method_func)daKytag06_Create, (process_method_func)daKytag06_Delete, (process_method_func)daKytag06_Execute, (process_method_func)daKytag06_IsDelete, (process_method_func)daKytag06_Draw, }; -actor_process_profile_definition g_profile_KYTAG06 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG06 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag07.cpp b/src/d/actor/d_a_kytag07.cpp index 2895963994..60870b508c 100644 --- a/src/d/actor/d_a_kytag07.cpp +++ b/src/d/actor/d_a_kytag07.cpp @@ -62,12 +62,12 @@ static int daKytag07_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag07_Method = { +static DUSK_CONST actor_method_class l_daKytag07_Method = { (process_method_func)daKytag07_Create, (process_method_func)daKytag07_Delete, (process_method_func)daKytag07_Execute, (process_method_func)daKytag07_IsDelete, (process_method_func)daKytag07_Draw}; -actor_process_profile_definition g_profile_KYTAG07 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG07 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag08.cpp b/src/d/actor/d_a_kytag08.cpp index 44f4bf5f9a..7ac2605c8d 100644 --- a/src/d/actor/d_a_kytag08.cpp +++ b/src/d/actor/d_a_kytag08.cpp @@ -267,13 +267,13 @@ static int daKytag08_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daKytag08_Method = { +static DUSK_CONST actor_method_class l_daKytag08_Method = { (process_method_func)daKytag08_Create, (process_method_func)daKytag08_Delete, (process_method_func)daKytag08_Execute, (process_method_func)daKytag08_IsDelete, (process_method_func)daKytag08_Draw, }; -actor_process_profile_definition g_profile_KYTAG08 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG08 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag09.cpp b/src/d/actor/d_a_kytag09.cpp index 2b2218e8ee..1c55b8d565 100644 --- a/src/d/actor/d_a_kytag09.cpp +++ b/src/d/actor/d_a_kytag09.cpp @@ -138,13 +138,13 @@ static int daKytag09_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daKytag09_Method = { +static DUSK_CONST actor_method_class l_daKytag09_Method = { (process_method_func)daKytag09_Create, (process_method_func)daKytag09_Delete, (process_method_func)daKytag09_Execute, (process_method_func)daKytag09_IsDelete, (process_method_func)daKytag09_Draw, }; -actor_process_profile_definition g_profile_KYTAG09 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG09 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag10.cpp b/src/d/actor/d_a_kytag10.cpp index a63ff88c52..27c02c2df0 100644 --- a/src/d/actor/d_a_kytag10.cpp +++ b/src/d/actor/d_a_kytag10.cpp @@ -200,13 +200,13 @@ static int daKytag10_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag10_Method = { +static DUSK_CONST actor_method_class l_daKytag10_Method = { (process_method_func)daKytag10_Create, (process_method_func)daKytag10_Delete, (process_method_func)daKytag10_Execute, (process_method_func)daKytag10_IsDelete, (process_method_func)daKytag10_Draw, }; -actor_process_profile_definition g_profile_KYTAG10 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG10 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag11.cpp b/src/d/actor/d_a_kytag11.cpp index b6b1d3fc63..7815bfc5e3 100644 --- a/src/d/actor/d_a_kytag11.cpp +++ b/src/d/actor/d_a_kytag11.cpp @@ -107,13 +107,13 @@ static int daKytag11_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag11_Method = { +static DUSK_CONST actor_method_class l_daKytag11_Method = { (process_method_func)daKytag11_Create, (process_method_func)daKytag11_Delete, (process_method_func)daKytag11_Execute, (process_method_func)daKytag11_IsDelete, (process_method_func)daKytag11_Draw, }; -actor_process_profile_definition g_profile_KYTAG11 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG11 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag12.cpp b/src/d/actor/d_a_kytag12.cpp index 58bd2963d9..dfc274cb85 100644 --- a/src/d/actor/d_a_kytag12.cpp +++ b/src/d/actor/d_a_kytag12.cpp @@ -1028,7 +1028,7 @@ static int daKytag12_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag12_Method = { +static DUSK_CONST actor_method_class l_daKytag12_Method = { (process_method_func)daKytag12_Create, (process_method_func)daKytag12_Delete, (process_method_func)daKytag12_Execute, @@ -1036,7 +1036,7 @@ static actor_method_class l_daKytag12_Method = { (process_method_func)daKytag12_Draw, }; -actor_process_profile_definition g_profile_KYTAG12 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG12 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag13.cpp b/src/d/actor/d_a_kytag13.cpp index d54932c0fb..fcb206353d 100644 --- a/src/d/actor/d_a_kytag13.cpp +++ b/src/d/actor/d_a_kytag13.cpp @@ -380,7 +380,7 @@ static int daKytag13_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag13_Method = { +static DUSK_CONST actor_method_class l_daKytag13_Method = { (process_method_func)daKytag13_Create, (process_method_func)daKytag13_Delete, (process_method_func)daKytag13_Execute, @@ -388,7 +388,7 @@ static actor_method_class l_daKytag13_Method = { (process_method_func)daKytag13_Draw, }; -actor_process_profile_definition g_profile_KYTAG13 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG13 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag14.cpp b/src/d/actor/d_a_kytag14.cpp index e179da4523..2aba9cf9fa 100644 --- a/src/d/actor/d_a_kytag14.cpp +++ b/src/d/actor/d_a_kytag14.cpp @@ -102,13 +102,13 @@ static int daKytag14_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag14_Method = { +static DUSK_CONST actor_method_class l_daKytag14_Method = { (process_method_func)daKytag14_Create, (process_method_func)daKytag14_Delete, (process_method_func)daKytag14_Execute, (process_method_func)daKytag14_IsDelete, (process_method_func)daKytag14_Draw, }; -actor_process_profile_definition g_profile_KYTAG14 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG14 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag15.cpp b/src/d/actor/d_a_kytag15.cpp index 3287f45a6a..5c8f8dd5a8 100644 --- a/src/d/actor/d_a_kytag15.cpp +++ b/src/d/actor/d_a_kytag15.cpp @@ -123,13 +123,13 @@ static int daKytag15_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daKytag15_Method = { +static DUSK_CONST actor_method_class l_daKytag15_Method = { (process_method_func)daKytag15_Create, (process_method_func)daKytag15_Delete, (process_method_func)daKytag15_Execute, (process_method_func)daKytag15_IsDelete, (process_method_func)daKytag15_Draw, }; -actor_process_profile_definition g_profile_KYTAG15 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG15 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag16.cpp b/src/d/actor/d_a_kytag16.cpp index addbc046fa..38f752649c 100644 --- a/src/d/actor/d_a_kytag16.cpp +++ b/src/d/actor/d_a_kytag16.cpp @@ -160,13 +160,13 @@ static int daKytag16_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag16_Method = { +static DUSK_CONST actor_method_class l_daKytag16_Method = { (process_method_func)daKytag16_Create, (process_method_func)daKytag16_Delete, (process_method_func)daKytag16_Execute, (process_method_func)daKytag16_IsDelete, (process_method_func)daKytag16_Draw, }; -actor_process_profile_definition g_profile_KYTAG16 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG16 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_kytag17.cpp b/src/d/actor/d_a_kytag17.cpp index 6f8eaabccc..f4fceee0f0 100644 --- a/src/d/actor/d_a_kytag17.cpp +++ b/src/d/actor/d_a_kytag17.cpp @@ -34,12 +34,12 @@ static int daKytag17_Create(fopAc_ac_c* i_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daKytag17_Method = { +static DUSK_CONST actor_method_class l_daKytag17_Method = { (process_method_func)daKytag17_Create, (process_method_func)daKytag17_Delete, (process_method_func)daKytag17_Execute, (process_method_func)daKytag17_IsDelete, (process_method_func)daKytag17_Draw}; -actor_process_profile_definition g_profile_KYTAG17 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KYTAG17 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_mant.cpp b/src/d/actor/d_a_mant.cpp index 6a559c0e1c..956bd6cc72 100644 --- a/src/d/actor/d_a_mant.cpp +++ b/src/d/actor/d_a_mant.cpp @@ -11,17 +11,38 @@ #include "d/d_com_inf_game.h" #if TARGET_PC +#include #include "dusk/dvd_asset.hpp" #include "dusk/frame_interpolation.h" using GameVersion = dusk::version::GameVersion; -static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; } +// keep the original version of the cape texture const so we don't need to reload the file +static u8 const * l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; } static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x5C00}, {GameVersion::GcnPal, 0x5C00}}, 0x4000), true); return buf; } static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C00}, {GameVersion::GcnPal, 0x9C00}}, 0x60), true); return buf; } #define l_Egnd_mantTEX (l_Egnd_mantTEX_get()) #define l_Egnd_mantTEX_U (l_Egnd_mantTEX_U_get()) #define l_Egnd_mantPAL (l_Egnd_mantPAL_get()) + +// make a copy of the cape texture that can be overwritten with the tears +static u8 l_Egnd_mantTEX_copy[0x4000]; + +// keep our cached texture objects out here so that we can update them from multiple places +static bool textureObjsInitialized = false; +static TGXTlutObj tlutObj; +static TGXTexObj mainTexObj; +static TGXTexObj undersideTexObj; + +// l_pos is unused +//static f32* l_pos_get() { alignas(32) static f32 buf[507]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA44C}, {GameVersion::GcnPal, 0xA44C}}, sizeof(buf)), true); return buf; } +static f32* l_normal_get() { alignas(32) static f32 buf[3]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C60}, {GameVersion::GcnPal, 0x9C60}}, sizeof(buf)), true); return buf; } +static f32* l_texCoord_get() { alignas(32) static f32 buf[338]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA458}, {GameVersion::GcnPal, 0xA458}}, sizeof(buf)), true); return buf; } +//#define l_pos (l_pos_get()) +#define l_normal (l_normal_get()) +#define l_texCoord (l_texCoord_get()) + +static bool l_Egnd_mantTEX_hasReplacement = false; #else #include "assets/l_Egnd_mantTEX.h" @@ -31,228 +52,6 @@ static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bo #endif #include "d/d_s_play.h" -static u32 l_pos[507] = { - 0x42480000, 0x3F5CFC93, 0xC365BD9C, 0x4226AAAA, - 0x3F5CFC93, 0xC365BD9C, 0x42055556, 0x3F5CFC93, - 0xC365BD9C, 0x41C80000, 0x3F5CFC93, 0xC365BD9C, - 0x41855556, 0x3F5CFC93, 0xC365BD9C, 0x41055556, - 0x3F5CFC93, 0xC365BD9C, 0x358637BD, 0x3F5CFC93, - 0xC365BD9C, 0xC1055554, 0x3F5CFC93, 0xC365BD9C, - 0xC1855554, 0x3F5CFC93, 0xC365BD9C, 0xC1C7FFFF, - 0x3F5CFC93, 0xC365BD9C, 0xC2055554, 0x3F5CFC93, - 0xC365BD9C, 0xC226AAAA, 0x3F5CFC93, 0xC365BD9C, - 0xC2480000, 0x3F5CFC93, 0xC365BD9C, 0x42480000, - 0x3F5CFC93, 0xC35292F0, 0x4226AAAA, 0x3F5CFC93, - 0xC35292F0, 0x42055556, 0x3F5CFC93, 0xC35292F0, - 0x41C80000, 0x3F5CFC93, 0xC35292F0, 0x41855556, - 0x3F5CFC93, 0xC35292F0, 0x41055556, 0x3F5CFC93, - 0xC35292F0, 0x358637BD, 0x3F5CFC93, 0xC35292F0, - 0xC1055554, 0x3F5CFC93, 0xC35292F0, 0xC1855554, - 0x3F5CFC93, 0xC35292F0, 0xC1C7FFFF, 0x3F5CFC93, - 0xC35292F0, 0xC2055554, 0x3F5CFC93, 0xC35292F0, - 0xC226AAAA, 0x3F5CFC93, 0xC35292F0, 0xC2480000, - 0x3F5CFC93, 0xC35292F0, 0x42480000, 0x3F5CFC93, - 0xC33F6846, 0x4226AAAA, 0x3F5CFC93, 0xC33F6846, - 0x42055556, 0x3F5CFC93, 0xC33F6846, 0x41C80000, - 0x3F5CFC93, 0xC33F6846, 0x41855556, 0x3F5CFC93, - 0xC33F6846, 0x41055556, 0x3F5CFC93, 0xC33F6846, - 0x358637BD, 0x3F5CFC93, 0xC33F6846, 0xC1055554, - 0x3F5CFC93, 0xC33F6846, 0xC1855554, 0x3F5CFC93, - 0xC33F6846, 0xC1C7FFFF, 0x3F5CFC93, 0xC33F6846, - 0xC2055554, 0x3F5CFC93, 0xC33F6846, 0xC226AAAA, - 0x3F5CFC93, 0xC33F6846, 0xC2480000, 0x3F5CFC93, - 0xC33F6846, 0x42480000, 0x3F5CFC93, 0xC32C3D9C, - 0x4226AAAA, 0x3F5CFC93, 0xC32C3D9C, 0x42055556, - 0x3F5CFC93, 0xC32C3D9C, 0x41C80000, 0x3F5CFC93, - 0xC32C3D9C, 0x41855556, 0x3F5CFC93, 0xC32C3D9C, - 0x41055556, 0x3F5CFC93, 0xC32C3D9C, 0x358637BD, - 0x3F5CFC93, 0xC32C3D9C, 0xC1055554, 0x3F5CFC93, - 0xC32C3D9C, 0xC1855554, 0x3F5CFC93, 0xC32C3D9C, - 0xC1C7FFFF, 0x3F5CFC93, 0xC32C3D9C, 0xC2055554, - 0x3F5CFC93, 0xC32C3D9C, 0xC226AAAA, 0x3F5CFC93, - 0xC32C3D9C, 0xC2480000, 0x3F5CFC93, 0xC32C3D9C, - 0x42480000, 0x3F5CFC93, 0xC31912F1, 0x4226AAAA, - 0x3F5CFC93, 0xC31912F1, 0x42055556, 0x3F5CFC93, - 0xC31912F1, 0x41C80000, 0x3F5CFC93, 0xC31912F1, - 0x41855556, 0x3F5CFC93, 0xC31912F1, 0x41055556, - 0x3F5CFC93, 0xC31912F1, 0x358637BD, 0x3F5CFC93, - 0xC31912F1, 0xC1055554, 0x3F5CFC93, 0xC31912F1, - 0xC1855554, 0x3F5CFC93, 0xC31912F1, 0xC1C7FFFF, - 0x3F5CFC93, 0xC31912F1, 0xC2055554, 0x3F5CFC93, - 0xC31912F1, 0xC226AAAA, 0x3F5CFC93, 0xC31912F1, - 0xC2480000, 0x3F5CFC93, 0xC31912F1, 0x42480000, - 0x3F5CFC93, 0xC305E846, 0x4226AAAA, 0x3F5CFC93, - 0xC305E846, 0x42055556, 0x3F5CFC93, 0xC305E846, - 0x41C80000, 0x3F5CFC93, 0xC305E846, 0x41855556, - 0x3F5CFC93, 0xC305E846, 0x41055556, 0x3F5CFC93, - 0xC305E846, 0x358637BD, 0x3F5CFC93, 0xC305E846, - 0xC1055554, 0x3F5CFC93, 0xC305E846, 0xC1855554, - 0x3F5CFC93, 0xC305E846, 0xC1C7FFFF, 0x3F5CFC93, - 0xC305E846, 0xC2055554, 0x3F5CFC93, 0xC305E846, - 0xC226AAAA, 0x3F5CFC93, 0xC305E846, 0xC2480000, - 0x3F5CFC93, 0xC305E846, 0x42480000, 0x3F5CFC93, - 0xC2E57B38, 0x4226AAAA, 0x3F5CFC93, 0xC2E57B38, - 0x42055556, 0x3F5CFC93, 0xC2E57B38, 0x41C80000, - 0x3F5CFC93, 0xC2E57B38, 0x41855556, 0x3F5CFC93, - 0xC2E57B38, 0x41055556, 0x3F5CFC93, 0xC2E57B38, - 0x358637BD, 0x3F5CFC93, 0xC2E57B38, 0xC1055554, - 0x3F5CFC93, 0xC2E57B38, 0xC1855554, 0x3F5CFC93, - 0xC2E57B38, 0xC1C7FFFF, 0x3F5CFC93, 0xC2E57B38, - 0xC2055554, 0x3F5CFC93, 0xC2E57B38, 0xC226AAAA, - 0x3F5CFC93, 0xC2E57B38, 0xC2480000, 0x3F5CFC93, - 0xC2E57B38, 0x42480000, 0x3F5CFC93, 0xC2BF25E2, - 0x4226AAAA, 0x3F5CFC93, 0xC2BF25E2, 0x42055556, - 0x3F5CFC93, 0xC2BF25E2, 0x41C80000, 0x3F5CFC93, - 0xC2BF25E2, 0x41855556, 0x3F5CFC93, 0xC2BF25E2, - 0x41055556, 0x3F5CFC93, 0xC2BF25E2, 0x358637BD, - 0x3F5CFC93, 0xC2BF25E2, 0xC1055554, 0x3F5CFC93, - 0xC2BF25E2, 0xC1855554, 0x3F5CFC93, 0xC2BF25E2, - 0xC1C7FFFF, 0x3F5CFC93, 0xC2BF25E2, 0xC2055554, - 0x3F5CFC93, 0xC2BF25E2, 0xC226AAAA, 0x3F5CFC93, - 0xC2BF25E2, 0xC2480000, 0x3F5CFC93, 0xC2BF25E2, - 0x42480000, 0x3F5CFC93, 0xC298D08D, 0x4226AAAA, - 0x3F5CFC93, 0xC298D08D, 0x42055556, 0x3F5CFC93, - 0xC298D08D, 0x41C80000, 0x3F5CFC93, 0xC298D08D, - 0x41855556, 0x3F5CFC93, 0xC298D08D, 0x41055556, - 0x3F5CFC93, 0xC298D08D, 0x358637BD, 0x3F5CFC93, - 0xC298D08D, 0xC1055554, 0x3F5CFC93, 0xC298D08D, - 0xC1855554, 0x3F5CFC93, 0xC298D08D, 0xC1C7FFFF, - 0x3F5CFC93, 0xC298D08D, 0xC2055554, 0x3F5CFC93, - 0xC298D08D, 0xC226AAAA, 0x3F5CFC93, 0xC298D08D, - 0xC2480000, 0x3F5CFC93, 0xC298D08D, 0x42480000, - 0x3F5CFC93, 0xC264F66F, 0x4226AAAA, 0x3F5CFC93, - 0xC264F66F, 0x42055556, 0x3F5CFC93, 0xC264F66F, - 0x41C80000, 0x3F5CFC93, 0xC264F66F, 0x41855556, - 0x3F5CFC93, 0xC264F66F, 0x41055556, 0x3F5CFC93, - 0xC264F66F, 0x358637BD, 0x3F5CFC93, 0xC264F66F, - 0xC1055554, 0x3F5CFC93, 0xC264F66F, 0xC1855554, - 0x3F5CFC93, 0xC264F66F, 0xC1C7FFFF, 0x3F5CFC93, - 0xC264F66F, 0xC2055554, 0x3F5CFC93, 0xC264F66F, - 0xC226AAAA, 0x3F5CFC93, 0xC264F66F, 0xC2480000, - 0x3F5CFC93, 0xC264F66F, 0x42480000, 0x3F5CFC93, - 0xC2184BC4, 0x4226AAAA, 0x3F5CFC93, 0xC2184BC4, - 0x42055556, 0x3F5CFC93, 0xC2184BC4, 0x41C80000, - 0x3F5CFC93, 0xC2184BC4, 0x41855556, 0x3F5CFC93, - 0xC2184BC4, 0x41055556, 0x3F5CFC93, 0xC2184BC4, - 0x358637BD, 0x3F5CFC93, 0xC2184BC4, 0xC1055554, - 0x3F5CFC93, 0xC2184BC4, 0xC1855554, 0x3F5CFC93, - 0xC2184BC4, 0xC1C7FFFF, 0x3F5CFC93, 0xC2184BC4, - 0xC2055554, 0x3F5CFC93, 0xC2184BC4, 0xC226AAAA, - 0x3F5CFC93, 0xC2184BC4, 0xC2480000, 0x3F5CFC93, - 0xC2184BC4, 0x42480000, 0x3F5CFC93, 0xC1974231, - 0x4226AAAA, 0x3F5CFC93, 0xC1974231, 0x42055556, - 0x3F5CFC93, 0xC1974231, 0x41C80000, 0x3F5CFC93, - 0xC1974231, 0x41855556, 0x3F5CFC93, 0xC1974231, - 0x41055556, 0x3F5CFC93, 0xC1974231, 0x358637BD, - 0x3F5CFC93, 0xC1974231, 0xC1055554, 0x3F5CFC93, - 0xC1974231, 0xC1855554, 0x3F5CFC93, 0xC1974231, - 0xC1C7FFFF, 0x3F5CFC93, 0xC1974231, 0xC2055554, - 0x3F5CFC93, 0xC1974231, 0xC226AAAA, 0x3F5CFC93, - 0xC1974231, 0xC2480000, 0x3F5CFC93, 0xC1974231, - 0x42480000, 0x3F5CFC93, 0x3E84C964, 0x4226AAAA, - 0x3F5CFC93, 0x3E84C964, 0x42055556, 0x3F5CFC93, - 0x3E84C964, 0x41C80000, 0x3F5CFC93, 0x3E84C964, - 0x41855556, 0x3F5CFC93, 0x3E84C964, 0x41055556, - 0x3F5CFC93, 0x3E84C964, 0x358637BD, 0x3F5CFC93, - 0x3E84C964, 0xC1055554, 0x3F5CFC93, 0x3E84C964, - 0xC1855554, 0x3F5CFC93, 0x3E84C964, 0xC1C7FFFF, - 0x3F5CFC93, 0x3E84C964, 0xC2055554, 0x3F5CFC93, - 0x3E84C964, 0xC226AAAA, 0x3F5CFC93, 0x3E84C964, - 0xC2480000, 0x3F5CFC93, 0x3E84C964, -}; - -static u32 l_normal[3] = { - 0x00000000, 0x3F800000, 0x00000000, -}; - -static u32 l_texCoord[338] = { - 0x00000000, 0x3F6AAAB0, 0x3DAAAA7E, 0x3F6AAAB0, - 0x3DAAAA7E, 0x3F800000, 0x00000000, 0x3F800000, - 0x3E2AAAC1, 0x3F6AAAB0, 0x3E2AAAC1, 0x3F800000, - 0x3E800000, 0x3F6AAAB0, 0x3E800000, 0x3F800000, - 0x3EAAAA9F, 0x3F6AAAB0, 0x3EAAAA9F, 0x3F800000, - 0x3ED55561, 0x3F6AAAB0, 0x3ED55561, 0x3F800000, - 0x3F000000, 0x3F6AAAB0, 0x3F000000, 0x3F800000, - 0x3F155550, 0x3F6AAAB0, 0x3F155550, 0x3F800000, - 0x3F2AAAB0, 0x3F6AAAB0, 0x3F2AAAB0, 0x3F800000, - 0x3F400000, 0x3F6AAAB0, 0x3F400000, 0x3F800000, - 0x3F555550, 0x3F6AAAB0, 0x3F555550, 0x3F800000, - 0x3F6AAAB0, 0x3F6AAAB0, 0x3F6AAAB0, 0x3F800000, - 0x3F800000, 0x3F6AAAB0, 0x3F800000, 0x3F800000, - 0x00000000, 0x3F555550, 0x3DAAAA7E, 0x3F555550, - 0x3E2AAAC1, 0x3F555550, 0x3E800000, 0x3F555550, - 0x3EAAAA9F, 0x3F555550, 0x3ED55561, 0x3F555550, - 0x3F000000, 0x3F555550, 0x3F155550, 0x3F555550, - 0x3F2AAAB0, 0x3F555550, 0x3F400000, 0x3F555550, - 0x3F555550, 0x3F555550, 0x3F6AAAB0, 0x3F555550, - 0x3F800000, 0x3F555550, 0x00000000, 0x3F400000, - 0x3DAAAA7E, 0x3F400000, 0x3E2AAAC1, 0x3F400000, - 0x3E800000, 0x3F400000, 0x3EAAAA9F, 0x3F400000, - 0x3ED55561, 0x3F400000, 0x3F000000, 0x3F400000, - 0x3F155550, 0x3F400000, 0x3F2AAAB0, 0x3F400000, - 0x3F400000, 0x3F400000, 0x3F555550, 0x3F400000, - 0x3F6AAAB0, 0x3F400000, 0x3F800000, 0x3F400000, - 0x00000000, 0x3F2AAAB0, 0x3DAAAA7E, 0x3F2AAAB0, - 0x3E2AAAC1, 0x3F2AAAB0, 0x3E800000, 0x3F2AAAB0, - 0x3EAAAA9F, 0x3F2AAAB0, 0x3ED55561, 0x3F2AAAB0, - 0x3F000000, 0x3F2AAAB0, 0x3F155550, 0x3F2AAAB0, - 0x3F2AAAB0, 0x3F2AAAB0, 0x3F400000, 0x3F2AAAB0, - 0x3F555550, 0x3F2AAAB0, 0x3F6AAAB0, 0x3F2AAAB0, - 0x3F800000, 0x3F2AAAB0, 0x00000000, 0x3F155550, - 0x3DAAAA7E, 0x3F155550, 0x3E2AAAC1, 0x3F155550, - 0x3E800000, 0x3F155550, 0x3EAAAA9F, 0x3F155550, - 0x3ED55561, 0x3F155550, 0x3F000000, 0x3F155550, - 0x3F155550, 0x3F155550, 0x3F2AAAB0, 0x3F155550, - 0x3F400000, 0x3F155550, 0x3F555550, 0x3F155550, - 0x3F6AAAB0, 0x3F155550, 0x3F800000, 0x3F155550, - 0x00000000, 0x3F000000, 0x3DAAAA7E, 0x3F000000, - 0x3E2AAAC1, 0x3F000000, 0x3E800000, 0x3F000000, - 0x3EAAAA9F, 0x3F000000, 0x3ED55561, 0x3F000000, - 0x3F000000, 0x3F000000, 0x3F155550, 0x3F000000, - 0x3F2AAAB0, 0x3F000000, 0x3F400000, 0x3F000000, - 0x3F555550, 0x3F000000, 0x3F6AAAB0, 0x3F000000, - 0x3F800000, 0x3F000000, 0x00000000, 0x3ED55561, - 0x3DAAAA7E, 0x3ED55561, 0x3E2AAAC1, 0x3ED55561, - 0x3E800000, 0x3ED55561, 0x3EAAAA9F, 0x3ED55561, - 0x3ED55561, 0x3ED55561, 0x3F000000, 0x3ED55561, - 0x3F155550, 0x3ED55561, 0x3F2AAAB0, 0x3ED55561, - 0x3F400000, 0x3ED55561, 0x3F555550, 0x3ED55561, - 0x3F6AAAB0, 0x3ED55561, 0x3F800000, 0x3ED55561, - 0x00000000, 0x3EAAAA9F, 0x3DAAAA7E, 0x3EAAAA9F, - 0x3E2AAAC1, 0x3EAAAA9F, 0x3E800000, 0x3EAAAA9F, - 0x3EAAAA9F, 0x3EAAAA9F, 0x3ED55561, 0x3EAAAA9F, - 0x3F000000, 0x3EAAAA9F, 0x3F155550, 0x3EAAAA9F, - 0x3F2AAAB0, 0x3EAAAA9F, 0x3F400000, 0x3EAAAA9F, - 0x3F555550, 0x3EAAAA9F, 0x3F6AAAB0, 0x3EAAAA9F, - 0x3F800000, 0x3EAAAA9F, 0x00000000, 0x3E800000, - 0x3DAAAA7E, 0x3E800000, 0x3E2AAAC1, 0x3E800000, - 0x3E800000, 0x3E800000, 0x3EAAAA9F, 0x3E800000, - 0x3ED55561, 0x3E800000, 0x3F000000, 0x3E800000, - 0x3F155550, 0x3E800000, 0x3F2AAAB0, 0x3E800000, - 0x3F400000, 0x3E800000, 0x3F555550, 0x3E800000, - 0x3F6AAAB0, 0x3E800000, 0x3F800000, 0x3E800000, - 0x00000000, 0x3E2AAAC1, 0x3DAAAA7E, 0x3E2AAAC1, - 0x3E2AAAC1, 0x3E2AAAC1, 0x3E800000, 0x3E2AAAC1, - 0x3EAAAA9F, 0x3E2AAAC1, 0x3ED55561, 0x3E2AAAC1, - 0x3F000000, 0x3E2AAAC1, 0x3F155550, 0x3E2AAAC1, - 0x3F2AAAB0, 0x3E2AAAC1, 0x3F400000, 0x3E2AAAC1, - 0x3F555550, 0x3E2AAAC1, 0x3F6AAAB0, 0x3E2AAAC1, - 0x3F800000, 0x3E2AAAC1, 0x00000000, 0x3DAAAA7E, - 0x3DAAAA7E, 0x3DAAAA7E, 0x3E2AAAC1, 0x3DAAAA7E, - 0x3E800000, 0x3DAAAA7E, 0x3EAAAA9F, 0x3DAAAA7E, - 0x3ED55561, 0x3DAAAA7E, 0x3F000000, 0x3DAAAA7E, - 0x3F155550, 0x3DAAAA7E, 0x3F2AAAB0, 0x3DAAAA7E, - 0x3F400000, 0x3DAAAA7E, 0x3F555550, 0x3DAAAA7E, - 0x3F6AAAB0, 0x3DAAAA7E, 0x3F800000, 0x3DAAAA7E, - 0x00000000, 0x00000000, 0x3DAAAA7E, 0x00000000, - 0x3E2AAAC1, 0x00000000, 0x3E800000, 0x00000000, - 0x3EAAAA9F, 0x00000000, 0x3ED55561, 0x00000000, - 0x3F000000, 0x00000000, 0x3F155550, 0x00000000, - 0x3F2AAAB0, 0x00000000, 0x3F400000, 0x00000000, - 0x3F555550, 0x00000000, 0x3F6AAAB0, 0x00000000, - 0x3F800000, 0x00000000, -}; - #if TARGET_PC using GameVersion = dusk::version::GameVersion; @@ -305,8 +104,9 @@ static void mant_build_anchor_frame(const cXyz& anchor_a, const cXyz& anchor_b, #endif void daMant_packet_c::draw() { + ZoneScoped; #if TARGET_PC - void* image = l_Egnd_mantTEX; + void* image = l_Egnd_mantTEX_copy; void* lut = l_Egnd_mantPAL; #else void* image = tex_d[0]; @@ -388,12 +188,12 @@ void daMant_packet_c::draw() { } } GXSETARRAY(GX_VA_POS, draw_pos, sizeof(mNrm[0]), 12, true); - GXSETARRAY(GX_VA_NRM, &l_normal, sizeof(l_normal), 12, false); + GXSETARRAY(GX_VA_NRM, l_normal, sizeof(f32) * 3, 12, false); #else GXSETARRAY(GX_VA_POS, this->getPos(), sizeof(mPos[0]), 12, true); GXSETARRAY(GX_VA_NRM, this->getNrm(), sizeof(mNrm[0]), 12, true); #endif - GXSETARRAY(GX_VA_TEX0, &l_texCoord, sizeof(l_texCoord), 8, false); // TODO: set to true when converted to float literals + GXSETARRAY(GX_VA_TEX0, l_texCoord, sizeof(f32) * 338, 8, false); GXSetZCompLoc(0); GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_ENABLE); @@ -418,15 +218,33 @@ void daMant_packet_c::draw() { GXSetTevKAlphaSel(GX_TEVSTAGE0, GX_TEV_KASEL_K3_A); GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); +#if TARGET_PC + if (!textureObjsInitialized) { + GXInitTlutObj(&tlutObj, lut, GX_TL_RGB5A3, 0x100); + GXInitTexObjCI(&mainTexObj, image, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0); + GXInitTexObjLOD(&mainTexObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1); + GXInitTexObjCI( + &undersideTexObj, l_Egnd_mantTEX_U, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0); + GXInitTexObjLOD(&undersideTexObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1); + l_Egnd_mantTEX_hasReplacement = aurora::texture::has_replacement(&mainTexObj, &tlutObj); + textureObjsInitialized = true; + } +#else GXTlutObj GStack_80; GXInitTlutObj(&GStack_80, lut, GX_TL_RGB5A3, 0x100); TGXTexObj GStack_74; GXInitTexObjCI(&GStack_74, image, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0); GXInitTexObjLOD(&GStack_74, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1); +#endif - GXLoadTlut(&GStack_80, 0); +#if TARGET_PC + GXLoadTlut(&tlutObj, GX_TLUT0); + GXLoadTexObj(&mainTexObj, GX_TEXMAP0); +#else + GXLoadTlut(&GStack_80, GX_TLUT0); GXLoadTexObj(&GStack_74, GX_TEXMAP0); +#endif GXSetCullMode(GX_CULL_BACK); @@ -442,12 +260,13 @@ void daMant_packet_c::draw() { GXLoadNrmMtxImm(MStack_54, GX_PNMTX0); GXCallDisplayList(l_Egnd_mantDL, 0x3e0); -#ifdef TARGET_PC - GStack_74.reset(); -#endif +#if TARGET_PC + GXLoadTexObj(&undersideTexObj, GX_TEXMAP0); +#else GXInitTexObjCI(&GStack_74, l_Egnd_mantTEX_U, 0x80, 0x80, GX_TF_C8, GX_CLAMP, GX_CLAMP, 0, 0); GXInitTexObjLOD(&GStack_74, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, 0, 0, GX_ANISO_1); GXLoadTexObj(&GStack_74, GX_TEXMAP0); +#endif GXSetTevColor(GX_TEVREG0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0}); GXSetTevKColor(GX_KCOLOR0, COMPOUND_LITERAL(GXColor){0, 0, 0, 0}); @@ -821,7 +640,11 @@ static int daMant_Execute(mant_class* i_this) { iVar8 = 0; if (i_this->field_0x3967 != 0) { +#if TARGET_PC + mant_cut_type = l_Egnd_mantTEX_hasReplacement ? 1 : i_this->field_0x3967; +#else mant_cut_type = i_this->field_0x3967; +#endif if (i_this->field_0x3968 < 15) { i_this->field_0x3968++; @@ -833,9 +656,18 @@ static int daMant_Execute(mant_class* i_this) { iVar8 = 20; } - unaff_r29 = cM_rndF(65536.0f); - var_f31 = cM_rndFX(32.0f); - var_f30 = cM_rndFX(32.0f); +#if TARGET_PC + if (l_Egnd_mantTEX_hasReplacement) { + unaff_r29 = i_this->mMantRng.getF(65536.0f); + var_f31 = i_this->mMantRng.getFX(32.0f); + var_f30 = i_this->mMantRng.getFX(32.0f); + } else +#endif + { + unaff_r29 = cM_rndF(65536.0f); + var_f31 = cM_rndFX(32.0f); + var_f30 = cM_rndFX(32.0f); + } } i_this->field_0x3967 = 0; @@ -894,8 +726,14 @@ static int daMant_Execute(mant_class* i_this) { if (0 <= uVar1 && uVar1 < 0x4000) { int iVar5 = (uVar1 & 7) + (uVar1 & 0x78) * 4 + (uVar1 >> 4 & 0x18) + (uVar1 & 0x3e00); - l_Egnd_mantTEX[iVar5] = l_Egnd_mantTEX_U[iVar5] = 0; + DUSK_IF_ELSE(l_Egnd_mantTEX_copy[iVar5], l_Egnd_mantTEX[iVar5]) = l_Egnd_mantTEX_U[iVar5] = 0; } + +#if TARGET_PC + if(textureObjsInitialized) { + GXInitTlutObjData(&tlutObj, l_Egnd_mantPAL); // make sure the cached textures are updated + } +#endif } } @@ -933,6 +771,16 @@ static int daMant_Create(fopAc_ac_c* i_this) { l_Egnd_mantTEX_U[i] = 6; } +#if TARGET_PC + memcpy(l_Egnd_mantTEX_copy, l_Egnd_mantTEX, sizeof(l_Egnd_mantTEX_copy)); + + if(textureObjsInitialized) { + GXInitTlutObjData(&tlutObj, l_Egnd_mantPAL); // make sure the cached textures are updated + } + + m_this->mMantRng.init(66, 16983, 855); +#endif + lbl_277_bss_0 = 0; daMant_Execute(m_this); return 4; @@ -949,7 +797,7 @@ extern "C" void __ct__4cXyzFv() { /* empty function */ } -static actor_method_class l_daMant_Method = { +static DUSK_CONST actor_method_class l_daMant_Method = { (process_method_func)daMant_Create, (process_method_func)daMant_Delete, (process_method_func)daMant_Execute, @@ -957,7 +805,7 @@ static actor_method_class l_daMant_Method = { (process_method_func)daMant_Draw, }; -actor_process_profile_definition g_profile_MANT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MANT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_mg_fish.cpp b/src/d/actor/d_a_mg_fish.cpp index 6791bcb61c..86d2552970 100644 --- a/src/d/actor/d_a_mg_fish.cpp +++ b/src/d/actor/d_a_mg_fish.cpp @@ -3771,7 +3771,7 @@ static int useHeapImg_fisht(fopAc_ac_c* i_actor) { } static int daMg_Fish_Create(fopAc_ac_c* i_this) { - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { { 0x0, { { 0x0, 0x0, 0x0 }, { 0x0, 0x0 }, 0x75 } }, // mObj { dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0 }, // mGObjAt @@ -4075,7 +4075,7 @@ static int daMg_Fish_Create(fopAc_ac_c* i_this) { return retval; } -static actor_method_class l_daMg_Fish_Method = { +static DUSK_CONST actor_method_class l_daMg_Fish_Method = { (process_method_func)daMg_Fish_Create, (process_method_func)daMg_Fish_Delete, (process_method_func)daMg_Fish_Execute, @@ -4083,7 +4083,7 @@ static actor_method_class l_daMg_Fish_Method = { (process_method_func)daMg_Fish_Draw, }; -actor_process_profile_definition g_profile_MG_FISH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MG_FISH = { /* Layer ID */ (u32)fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_mg_fshop.cpp b/src/d/actor/d_a_mg_fshop.cpp index 0d5b6dd2c9..9e8eb3f357 100644 --- a/src/d/actor/d_a_mg_fshop.cpp +++ b/src/d/actor/d_a_mg_fshop.cpp @@ -1818,7 +1818,7 @@ static int daFshop_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daFshop_Method = { +static DUSK_CONST actor_method_class l_daFshop_Method = { (process_method_func)daFshop_Create, (process_method_func)daFshop_Delete, (process_method_func)daFshop_Execute, @@ -1826,7 +1826,7 @@ static actor_method_class l_daFshop_Method = { (process_method_func)daFshop_Draw, }; -actor_process_profile_definition g_profile_FSHOP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_FSHOP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_mg_rod.cpp b/src/d/actor/d_a_mg_rod.cpp index 956a9e3cff..f6f3b8d6c6 100644 --- a/src/d/actor/d_a_mg_rod.cpp +++ b/src/d/actor/d_a_mg_rod.cpp @@ -25,7 +25,11 @@ #include #include +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#include "dusk/settings.h" #include "dusk/version.hpp" +#endif class dmg_rod_HIO_c : public JORReflexible { public: @@ -177,6 +181,25 @@ static int Worm_nodeCallBack(J3DJoint* i_joint, int param_1) { return 1; } +#if TARGET_PC +static void dmg_rod_interp_callback(bool isSimFrame, void* pUserWork) { + dmg_rod_class* i_this = (dmg_rod_class*)pUserWork; + if (!i_this->mLineInterpPrevValid || !i_this->mLineInterpCurrValid) { + return; + } + const f32 alpha = dusk::frame_interp::get_interpolation_step(); + const int count = i_this->kind == MG_ROD_KIND_LURE ? MG_ROD_LURE_LINE_LEN : MG_ROD_UKI_LINE_LEN; + cXyz* dst = i_this->linemat.getPos(0); + for (int i = 0; i < count; i++) { + const cXyz& p0 = i_this->mLineInterpPrev[i]; + const cXyz& p1 = i_this->mLineInterpCurr[i]; + dst[i] = p0 + (p1 - p0) * alpha; + } + static GXColor l_color = {0xFF, 0xFF, 0x96, 0xFF}; + i_this->linemat.update(count, l_color, &i_this->actor.tevStr); +} +#endif + static int dmg_rod_Draw(dmg_rod_class* i_this) { int unused; fopAc_ac_c* actor = &i_this->actor; @@ -217,6 +240,18 @@ static int dmg_rod_Draw(dmg_rod_class* i_this) { i_this->linemat.update(MG_ROD_LURE_LINE_LEN, l_color, &i_this->actor.tevStr); dComIfGd_set3DlineMat(&i_this->linemat); +#if TARGET_PC + if (dusk::frame_interp::is_enabled()) { + if (i_this->mLineInterpCurrValid) { + memcpy(i_this->mLineInterpPrev, i_this->mLineInterpCurr, MG_ROD_LURE_LINE_LEN * sizeof(cXyz)); + i_this->mLineInterpPrevValid = true; + } + memcpy(i_this->mLineInterpCurr, i_this->linemat.getPos(0), MG_ROD_LURE_LINE_LEN * sizeof(cXyz)); + i_this->mLineInterpCurrValid = true; + dusk::frame_interp::add_interpolation_callback(&dmg_rod_interp_callback, i_this); + } +#endif + model = i_this->rod_modelMorf->getModel(); g_env_light.setLightTevColorType_MAJI(model, &i_this->actor.tevStr); i_this->rod_modelMorf->entryDL(); @@ -241,6 +276,18 @@ static int dmg_rod_Draw(dmg_rod_class* i_this) { i_this->linemat.update(MG_ROD_UKI_LINE_LEN, l_color, &i_this->actor.tevStr); dComIfGd_set3DlineMat(&i_this->linemat); +#if TARGET_PC + if (dusk::frame_interp::is_enabled()) { + if (i_this->mLineInterpCurrValid) { + memcpy(i_this->mLineInterpPrev, i_this->mLineInterpCurr, MG_ROD_UKI_LINE_LEN * sizeof(cXyz)); + i_this->mLineInterpPrevValid = true; + } + memcpy(i_this->mLineInterpCurr, i_this->linemat.getPos(0), MG_ROD_UKI_LINE_LEN * sizeof(cXyz)); + i_this->mLineInterpCurrValid = true; + dusk::frame_interp::add_interpolation_callback(&dmg_rod_interp_callback, i_this); + } +#endif + for (int i = 0; i < 15; i++) { g_env_light.setLightTevColorType_MAJI(i_this->rod_uki_model[i], &actor->tevStr); mDoExt_modelUpdateDL(i_this->rod_uki_model[i]); @@ -1137,8 +1184,14 @@ static int lure_standby(dmg_rod_class* i_this) { dComIfGp_setDoStatusForce(42, 0); } - i_this->rod_stick_x = mDoCPd_c::getStickX3D(PAD_1) * mDoCPd_c::getStickX3D(PAD_1); - if (mDoCPd_c::getStickX3D(PAD_1) < 0.0f) { + f32 stick_x = mDoCPd_c::getStickX3D(PAD_1); +#if TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + stick_x = -stick_x; + } +#endif + i_this->rod_stick_x = stick_x * stick_x; + if (stick_x < 0.0f) { i_this->rod_stick_x *= -1.0f; } @@ -3671,7 +3724,13 @@ static void uki_standby(dmg_rod_class* i_this) { cLib_addCalc2(&i_this->field_0x150c, substickX, 0.5f, 0.2f); if (i_this->field_0x1508 > 0.3f && i_this->play_cam_mode < 5) { - ANGLE_ADD(i_this->field_0x1418, (-500.0f + VREG_F(3)) * mDoCPd_c::getStickX3D(PAD_1)); + f32 stick_x = mDoCPd_c::getStickX3D(PAD_1); +#if TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + stick_x = -stick_x; + } +#endif + ANGLE_ADD(i_this->field_0x1418, (-500.0f + VREG_F(3)) * stick_x); } cMtx_YrotS(*calc_mtx, i_this->field_0x1418); @@ -5043,8 +5102,15 @@ static void play_camera(dmg_rod_class* i_this) { static f32 old_stick_x = 0.0f; static f32 old_stick_sx = 0.0f; + f32 stick_x = mDoCPd_c::getStickX3D(PAD_1); +#if TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + stick_x = -stick_x; + } +#endif + if ( - (mDoCPd_c::getStickX3D(PAD_1) >= 0.8f && old_stick_x < 0.8f) || (mDoCPd_c::getStickX3D(PAD_1) <= -0.8f && old_stick_x > -0.8f) + (stick_x >= 0.8f && old_stick_x < 0.8f) || (stick_x <= -0.8f && old_stick_x > -0.8f) #if VERSION != VERSION_SHIELD_DEBUG || (mDoCPd_c::getSubStickX3D(PAD_1) >= 0.8f && old_stick_sx < 0.8f) || (mDoCPd_c::getSubStickX3D(PAD_1) <= -0.8f && old_stick_sx > -0.8f) #endif @@ -5060,7 +5126,7 @@ static void play_camera(dmg_rod_class* i_this) { } if (i_this->play_cam_timer >= 15) { - if (mDoCPd_c::getStickX3D(PAD_1) >= 0.5f + if (stick_x >= 0.5f #if VERSION != VERSION_SHIELD_DEBUG || mDoCPd_c::getSubStickX3D(PAD_1) >= 0.5f #endif @@ -5082,8 +5148,8 @@ static void play_camera(dmg_rod_class* i_this) { } } - old_stick_x = mDoCPd_c::getStickX3D(PAD_1); - old_stick_sx = mDoCPd_c::getSubStickX(PAD_1); + old_stick_x = stick_x; + old_stick_sx = mDoCPd_c::getSubStickX3D(PAD_1); if (i_this->play_cam_timer == 1) { if (i_this->field_0xf81 == 0) { @@ -5733,6 +5799,12 @@ static void play_camera_u(dmg_rod_class* i_this) { } } +#if TARGET_PC +BOOL item_any_fishing_rod(int itemId) { + return itemId == dItemNo_FISHING_ROD_1_e || (itemId >= dItemNo_BEE_ROD_e && itemId <= dItemNo_JEWEL_WORM_ROD_e); +} +#endif + static int dmg_rod_Execute(dmg_rod_class* i_this) { fopAc_ac_c* actor = &i_this->actor; @@ -5788,10 +5860,28 @@ static int dmg_rod_Execute(dmg_rod_class* i_this) { i_this->rod_stick_x = mDoCPd_c::getStickX3D(PAD_1); i_this->rod_stick_y = mDoCPd_c::getStickY(PAD_1); +#if TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + i_this->rod_stick_x = -i_this->rod_stick_x; + } + i_this->rod_substick_x = mDoCPd_c::getSubStickX3D(PAD_1); +#else i_this->rod_substick_x = mDoCPd_c::getSubStickX(PAD_1); +#endif i_this->prev_rod_substick_y = i_this->rod_substick_y; i_this->rod_substick_y = mDoCPd_c::getSubStickY(PAD_1); + #if TARGET_PC + if (dusk::getSettings().game.buttonFishing) { + if ((item_any_fishing_rod(dComIfGp_getSelectItem(0)) && mDoCPd_c::getHoldX(PAD_1)) || + (item_any_fishing_rod(dComIfGp_getSelectItem(1)) && mDoCPd_c::getHoldY(PAD_1))) + { + i_this->rod_stick_y = -1.0f; + i_this->rod_substick_y = -1.0f; + } + } + #endif + i_this->reel_speed = 5.0f; i_this->reel_btn_flags = mDoCPd_c::getHoldB(PAD_1) | mDoCPd_c::getHoldDown(PAD_1); if (mDoCPd_c::getHoldDown(PAD_1)) { @@ -6359,6 +6449,11 @@ static int dmg_rod_Create(fopAc_ac_c* i_this) { return cPhs_ERROR_e; } +#if TARGET_PC + rod->mLineInterpPrevValid = false; + rod->mLineInterpCurrValid = false; +#endif + OS_REPORT("//////////////MG_ROD SET 2 !!\n"); if (!hio_set) { rod->HIOInit = TRUE; @@ -6435,7 +6530,7 @@ static int dmg_rod_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_dmg_rod_Method = { +static DUSK_CONST actor_method_class l_dmg_rod_Method = { (process_method_func)dmg_rod_Create, (process_method_func)dmg_rod_Delete, (process_method_func)dmg_rod_Execute, @@ -6443,7 +6538,7 @@ static actor_method_class l_dmg_rod_Method = { (process_method_func)dmg_rod_Draw, }; -actor_process_profile_definition g_profile_MG_ROD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MG_ROD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_midna.cpp b/src/d/actor/d_a_midna.cpp index 3bc500991d..1b96147957 100644 --- a/src/d/actor/d_a_midna.cpp +++ b/src/d/actor/d_a_midna.cpp @@ -109,7 +109,7 @@ void daMidna_hio_c::genMessage(JORMContext* ctx) { } #endif -daMidna_hio_c1 const daMidna_hio_c0::m = { +DUSK_GAME_DATA daMidna_hio_c1 const daMidna_hio_c0::m = { 0, 0, 0, @@ -126,8 +126,8 @@ daMidna_hio_c1 const daMidna_hio_c0::m = { 25.0f, }; -bool daMidna_matAnm_c::sEyeMoveFlg; -u8 daMidna_matAnm_c::sMorfFrame; +DUSK_GAME_DATA bool daMidna_matAnm_c::sEyeMoveFlg; +DUSK_GAME_DATA u8 daMidna_matAnm_c::sMorfFrame; void daMidna_matAnm_c::init() { mOldTransX = 0.0f; @@ -173,7 +173,7 @@ int daMidna_McaMorfCB1_c::execute(u16 i_jointNo, J3DTransformInfo* transform) { return 1; } -daMidna_texData_s const daMidna_c::m_texDataTable[21] = { +DUSK_GAME_DATA daMidna_texData_s const daMidna_c::m_texDataTable[21] = { 0x0405, 0x03A4, 0x03F5, 0x0399, 0x03F6, 0x0399, @@ -197,7 +197,7 @@ daMidna_texData_s const daMidna_c::m_texDataTable[21] = { 0x03FD, 0x0399, }; -daMidna_anmData_s const daMidna_c::m_anmDataTable[53] = { +DUSK_GAME_DATA daMidna_anmData_s const daMidna_c::m_anmDataTable[53] = { 0x01DC, 0x00, -1.0f, 0, 0x01B7, 0x01, -1.0f, 0, 0x01B8, 0x02, -1.0f, 0, @@ -3654,7 +3654,7 @@ static void dummy() { } template unsigned char cLib_calcTimer(unsigned char*); -static actor_method_class l_daMidna_Method = { +static DUSK_CONST actor_method_class l_daMidna_Method = { (process_method_func)daMidna_Create, (process_method_func)daMidna_Delete, (process_method_func)daMidna_Execute, @@ -3662,7 +3662,7 @@ static actor_method_class l_daMidna_Method = { (process_method_func)daMidna_Draw, }; -actor_process_profile_definition g_profile_MIDNA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MIDNA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 6, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_mirror.cpp b/src/d/actor/d_a_mirror.cpp index 5c5218328e..486a035590 100644 --- a/src/d/actor/d_a_mirror.cpp +++ b/src/d/actor/d_a_mirror.cpp @@ -18,16 +18,16 @@ #endif #ifndef __MWERKS__ -#include "dusk/math.h" +#include "helpers/math.h" #endif static BOOL daMirror_c_createHeap(fopAc_ac_c* i_this) { return ((daMirror_c*)i_this)->createHeap(); } -static char* l_arcName = "Mirror"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Mirror"; -static char* l_arcName2 = "MR-Table"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName2 = "MR-Table"; dMirror_packet_c::dMirror_packet_c() { #ifdef TARGET_PC @@ -105,6 +105,7 @@ int dMirror_packet_c::entryModel(J3DModel* i_model) { void dMirror_packet_c::mirrorZdraw(f32* param_0, f32* param_1, f32 param_2, f32 param_3, f32 param_4, f32 param_5, f32 param_6, f32 param_7) { + ZoneScoped; GXSetNumChans(1); GXSetChanCtrl(GX_COLOR0, GX_FALSE, GX_SRC_REG, GX_SRC_REG, 0, GX_DF_NONE, GX_AF_NONE); GXSetNumTexGens(0); @@ -265,6 +266,7 @@ void dMirror_packet_c::modelDraw(J3DModel* i_model, Mtx param_1) { } void dMirror_packet_c::mainDraw() { + ZoneScoped; j3dSys.reinitGX(); cXyz sp19C[5]; @@ -646,13 +648,13 @@ int daMirror_c::entryModel(J3DModel* i_model) { return mPacket.entryModel(i_model); } -static actor_method_class daMirror_METHODS = { +static DUSK_CONST actor_method_class daMirror_METHODS = { (process_method_func)daMirror_create, (process_method_func)daMirror_Delete, (process_method_func)daMirror_execute, (process_method_func)NULL, (process_method_func)daMirror_draw, }; -actor_process_profile_definition g_profile_MIRROR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MIRROR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_movie_player.cpp b/src/d/actor/d_a_movie_player.cpp index 1f8bdeecd7..a830f1440f 100644 --- a/src/d/actor/d_a_movie_player.cpp +++ b/src/d/actor/d_a_movie_player.cpp @@ -26,15 +26,16 @@ #include "f_op/f_op_overlap_mng.h" -#include "dusk/gx_helper.h" -#include "dusk/os.h" -#include "dusk/layout.hpp" - #include "JSystem/JAudio2/JASCriticalSection.h" +#if TARGET_PC +#include "helpers/gx_helper.h" +#include "dusk/os.h" +#include "dusk/layout.hpp" #if MOVIE_SUPPORT #include "turbojpeg.h" #endif +#endif inline s32 daMP_NEXT_READ_SIZE(daMP_THPReadBuffer* readBuf) { return *(BE(s32)*)readBuf->ptr; @@ -3912,13 +3913,20 @@ static BOOL daMP_ProperTimingForGettingNextFrame() { return TRUE; } } else { - s32 frameRate = daMP_ActivePlayer.header.frameRate * 100.0f; #if TARGET_PC - // DUSK HACK: We only fire retrace callbacks *half* as often as the game expects, - // because we only run them once per frame, and normally there should be two scans - // per game frame. - frameRate *= 2; -#endif + const f32 fps = daMP_ActivePlayer.header.frameRate; + if (fps > 0.0f) { + const f32 elapsed = std::chrono::duration( + std::chrono::steady_clock::now() - daMP_ActivePlayer.thpPlaybackClock).count(); + const s32 desired = static_cast(elapsed * fps); + if (desired != daMP_ActivePlayer.prevCount) { + daMP_ActivePlayer.prevCount = desired; + daMP_ActivePlayer.curCount = desired; + return TRUE; + } + } +#else + s32 frameRate = daMP_ActivePlayer.header.frameRate * 100.0f; if (VIGetTvFormat() == VI_PAL) { daMP_ActivePlayer.curCount = daMP_ActivePlayer.retaceCount * frameRate / 5000; } else { @@ -3929,6 +3937,7 @@ static BOOL daMP_ProperTimingForGettingNextFrame() { daMP_ActivePlayer.prevCount = daMP_ActivePlayer.curCount; return TRUE; } +#endif } return FALSE; @@ -4133,6 +4142,9 @@ static BOOL daMP_THPPlayerPlay() { daMP_ActivePlayer.prevCount = 0; daMP_ActivePlayer.curCount = 0; daMP_ActivePlayer.retaceCount = -1; +#if TARGET_PC + daMP_ActivePlayer.thpPlaybackClock = std::chrono::steady_clock::now(); +#endif return TRUE; } @@ -4482,7 +4494,7 @@ int daMP_c::daMP_c_Init() { JUT_ASSERT(9507, 0 <= movieNo && movieNo <= 99); char path[32]; - sprintf(path, "/Movie/demo_movie%02d_%02d.thp", demoNo, movieNo); + SAFE_SPRINTF(path, "/Movie/demo_movie%02d_%02d.thp", demoNo, movieNo); if (!daMP_ActivePlayer_Init(path)) { daMP_Fail_alloc = TRUE; @@ -4554,7 +4566,7 @@ static int daMP_Callback_Dummy(daMP_c* i_this) { return 1; } -static actor_method_class daMP_METHODS = { +static DUSK_CONST actor_method_class daMP_METHODS = { (process_method_func)daMP_c::daMP_c_Callback_Init, (process_method_func)daMP_c::daMP_c_Callback_Finish, (process_method_func)daMP_c::daMP_c_Callback_Main, @@ -4562,7 +4574,7 @@ static actor_method_class daMP_METHODS = { (process_method_func)daMP_c::daMP_c_Callback_Draw, }; -actor_process_profile_definition g_profile_MOVIE_PLAYER = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MOVIE_PLAYER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, @@ -4580,12 +4592,3 @@ actor_process_profile_definition g_profile_MOVIE_PLAYER = { }; AUDIO_INSTANCES; - -#if TARGET_PC -void dusk::MoviePlayerShutdown() { - // We need to cleanly shut down the threads to avoid crashes on shutdown. - if (daMP_c::m_myObj) { - daMP_c::m_myObj->daMP_c_Finish(); - } -} -#endif \ No newline at end of file diff --git a/src/d/actor/d_a_myna.cpp b/src/d/actor/d_a_myna.cpp index 776f219f93..93409fdb65 100644 --- a/src/d/actor/d_a_myna.cpp +++ b/src/d/actor/d_a_myna.cpp @@ -15,7 +15,7 @@ #include "d/d_s_play.h" #include -static daMyna_c::ProcFunc init_proc[] = { +static DUSK_CONSTEXPR daMyna_c::ProcFunc init_proc[] = { &daMyna_c::attack_wait_init, &daMyna_c::attack_before_talk_init, &daMyna_c::attack_fly_init, @@ -40,7 +40,7 @@ static daMyna_c::ProcFunc init_proc[] = { &daMyna_c::attack2_talk_init, }; -static daMyna_c::ProcFunc move_proc[] = { +static DUSK_CONSTEXPR daMyna_c::ProcFunc move_proc[] = { &daMyna_c::attack_wait_move, &daMyna_c::attack_before_talk_move, &daMyna_c::attack_fly_move, @@ -65,14 +65,14 @@ static daMyna_c::ProcFunc move_proc[] = { &daMyna_c::attack2_talk_move, }; -static char* l_bckFileNameTBL[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_bckFileNameTBL[] = { "MYNA_hovering.bck", "MYNA_wait_a.bck", "MYNA_pick_a.bck", "MYNA_pick_b.bck", "MYNA_jump.bck", "MYNA_sidestepL.bck", "MYNA_sidestepR.bck", "MYNA_lightup.bck", "MYNA_attack.bck", "MYNA_talk_a.bck", "MYNA_talk_b.bck", "MYNA_wait_b.bck", "MYNA_wait_c.bck", "MYNA_talk_c.bck", "MYNA_wait_d.bck", }; -static char* l_btpFileNameTBL[] = {"MYNA.btp"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_btpFileNameTBL[] = {"MYNA.btp"}; static int createHeapCallBack(fopAc_ac_c* i_this) { daMyna_c* a_this = static_cast(i_this); @@ -254,7 +254,7 @@ static void* daMyna_searchEvtTag(void* i_evtTagActor, void* param_1) { return 0; } -dCcD_SrcSph const daMyna_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph const daMyna_c::mCcDSph = { 0, 0x400, 1, 0x1F, 0, 0, 0x79, 0xA, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 15.0f, }; @@ -326,7 +326,7 @@ int daMyna_c::baseMotion06(int param_0) { return 1; } -daMyna_c::BaseMotionFunc daMyna_c::mBaseMotionTBL[] = { +DUSK_GAME_DATA daMyna_c::BaseMotionFunc daMyna_c::mBaseMotionTBL[] = { &daMyna_c::baseMotion00, &daMyna_c::baseMotion01, &daMyna_c::baseMotion02, &daMyna_c::baseMotion03, &daMyna_c::baseMotion04, &daMyna_c::baseMotion05, &daMyna_c::baseMotion06, @@ -1475,7 +1475,7 @@ void daMyna_c::setBtpAnm(J3DAnmTexPattern* i_btk, J3DModelData* param_1, f32 i_r mBtpAnm.init(param_1, i_btk, 1, i_attribute, i_rate, 0, -1); } -J3DAnmTransformKey* daMyna_c::getTrnsfrmKeyAnm(char* i_resName) { +J3DAnmTransformKey* daMyna_c::getTrnsfrmKeyAnm(DUSK_CONST char* i_resName) { if (i_resName != NULL) { return static_cast(dComIfG_getObjectRes("Npc_myna", i_resName)); } else { @@ -1483,7 +1483,7 @@ J3DAnmTransformKey* daMyna_c::getTrnsfrmKeyAnm(char* i_resName) { } } -J3DAnmTexPattern* daMyna_c::getTexPtrnAnm(char* i_resName) { +J3DAnmTexPattern* daMyna_c::getTexPtrnAnm(DUSK_CONST char* i_resName) { if (i_resName != NULL) { return static_cast(dComIfG_getObjectRes("Npc_myna", i_resName)); } else { @@ -1820,13 +1820,13 @@ static int daMyna_IsDelete(void* i_this) { return 1; } -static actor_method_class daMyna_MethodTable = { +static DUSK_CONST actor_method_class daMyna_MethodTable = { (process_method_func)daMyna_Create, (process_method_func)daMyna_Delete, (process_method_func)daMyna_Execute, (process_method_func)daMyna_IsDelete, (process_method_func)daMyna_Draw, }; -actor_process_profile_definition g_profile_MYNA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MYNA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_nbomb.cpp b/src/d/actor/d_a_nbomb.cpp index 4a185c9561..0626290433 100644 --- a/src/d/actor/d_a_nbomb.cpp +++ b/src/d/actor/d_a_nbomb.cpp @@ -117,7 +117,7 @@ static dCcD_SrcSph l_sphSrc = { } // mSphAttr }; -const char* daNbomb_c::m_arcNameList[6] = { +DUSK_GAME_DATA const char* daNbomb_c::m_arcNameList[6] = { daAlink_c::getAlinkArcName(), daAlink_c::getAlinkArcName(), daAlink_c::getAlinkArcName(), l_arcNameBombF, l_arcNameBombE, l_arcNameBombEW, }; @@ -1676,7 +1676,7 @@ AUDIO_INSTANCES; template<> JAUSectionHeap* JASGlobalInstance::sInstance; -static actor_method_class l_daNbombMethod = { +static DUSK_CONST actor_method_class l_daNbombMethod = { (process_method_func)daNbomb_Create, (process_method_func)daNbomb_Delete, (process_method_func)daNbomb_Execute, @@ -1684,7 +1684,7 @@ static actor_method_class l_daNbombMethod = { (process_method_func)daNbomb_Draw, }; -actor_process_profile_definition g_profile_NBOMB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NBOMB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_ni.cpp b/src/d/actor/d_a_ni.cpp index 8d97925078..cb53ae6030 100644 --- a/src/d/actor/d_a_ni.cpp +++ b/src/d/actor/d_a_ni.cpp @@ -943,6 +943,11 @@ static int ni_play(ni_class* i_this) { s16 var_r28 = 0x4000; i_this->mPadMainStickX = mDoCPd_c::getStickX3D(PAD_1); +#if TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + i_this->mPadMainStickX = -i_this->mPadMainStickX; + } +#endif i_this->mPadMainStickY = mDoCPd_c::getStickY(PAD_1); i_this->mPadSubStickY = mDoCPd_c::getSubStickY(PAD_1); i_this->mPadSubStickX = mDoCPd_c::getSubStickX(PAD_1); @@ -1989,7 +1994,7 @@ static int daNi_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daNi_Method = { +static DUSK_CONST actor_method_class l_daNi_Method = { (process_method_func)daNi_Create, (process_method_func)daNi_Delete, (process_method_func)daNi_Execute, @@ -1997,7 +2002,7 @@ static actor_method_class l_daNi_Method = { (process_method_func)daNi_Draw, }; -actor_process_profile_definition g_profile_NI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_no_chg_room.cpp b/src/d/actor/d_a_no_chg_room.cpp index 3a2e788a96..c393db8d85 100644 --- a/src/d/actor/d_a_no_chg_room.cpp +++ b/src/d/actor/d_a_no_chg_room.cpp @@ -150,13 +150,13 @@ static int daNocrm_draw(daNocrm_c* i_this) { return 1; } -static actor_method_class daNocrm_METHODS = { +static DUSK_CONST actor_method_class daNocrm_METHODS = { (process_method_func)daNocrm_create, (process_method_func)daNocrm_Delete, (process_method_func)daNocrm_execute, (process_method_func)NULL, (process_method_func)daNocrm_draw, }; -actor_process_profile_definition g_profile_NO_CHG_ROOM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NO_CHG_ROOM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc.cpp b/src/d/actor/d_a_npc.cpp index 123bf66800..d093c51d70 100644 --- a/src/d/actor/d_a_npc.cpp +++ b/src/d/actor/d_a_npc.cpp @@ -1219,7 +1219,7 @@ void daNpcT_DmgStagger_c::calc(BOOL param_0) { } } -dCcD_SrcCyl daNpcT_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daNpcT_c::mCcDCyl = { daNpcT_c::mCcDObjData, { { @@ -1230,7 +1230,7 @@ dCcD_SrcCyl daNpcT_c::mCcDCyl = { } }; -dCcD_SrcSph daNpcT_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daNpcT_c::mCcDSph = { daNpcT_c::mCcDObjData, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph @@ -1252,13 +1252,13 @@ void daNpcT_c::tgHitCallBack(fopAc_ac_c* i_actor1, dCcD_GObjInf* i_obj1, fopAc_a static_cast(actor1)->setCutType(cut_type); } -fopAc_ac_c* daNpcT_c::mFindActorPtrs[50]; +DUSK_GAME_DATA fopAc_ac_c* daNpcT_c::mFindActorPtrs[50]; -char l_fileNameBuf[0x15]; +DUSK_GAME_DATA char l_fileNameBuf[0x15]; -s16 daNpcT_c::mSrchName; +DUSK_GAME_DATA s16 daNpcT_c::mSrchName; -int daNpcT_c::mFindCount; +DUSK_GAME_DATA int daNpcT_c::mFindCount; void* daNpcT_c::srchActor(void* i_actor1, void* i_actor2) { fopAc_ac_c* actor2 = (fopAc_ac_c*)i_actor2; @@ -1335,7 +1335,7 @@ int daNpcT_c::setBpkAnm(J3DAnmColor* i_bpk, J3DModelData* i_modelData, f32 i_spe return mBpkAnm.init(i_modelData, i_bpk, TRUE, i_mode, i_speed, 0, -1); } -int daNpcT_c::loadRes(s8 const* i_resNoList, char const** i_resNameList) { +int daNpcT_c::loadRes(s8 const* i_resNoList, char const* DUSK_CONST* i_resNameList) { int phase_state; int resLoad_cnt = 0; for (int i = 0; i < 10; i++) { @@ -1359,7 +1359,7 @@ int daNpcT_c::loadRes(s8 const* i_resNoList, char const** i_resNameList) { return cPhs_INIT_e; } -void daNpcT_c::deleteRes(s8 const* i_resNoList, char const** i_resNameList) { +void daNpcT_c::deleteRes(s8 const* i_resNoList, char const* DUSK_CONST* i_resNameList) { for (int i = 0; i < 10 && i_resNoList[i] != -1; i++) { dComIfG_resDelete(&mPhase[i], i_resNameList[i_resNoList[i]]); } @@ -2901,7 +2901,7 @@ BOOL daNpcT_chkTmpBit(u32 i_no) { return dComIfGs_isTmpBit((u16)dSv_event_tmp_flag_c::tempBitLabels[i_no]); } -const dCcD_SrcGObjInf daNpcT_c::mCcDObjData = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daNpcT_c::mCcDObjData = { {0, {{0, 0, 0}, {0, 0x00}, {0x79}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 0}, diff --git a/src/d/actor/d_a_npc2.cpp b/src/d/actor/d_a_npc2.cpp index f629c0b562..6bf14418ae 100644 --- a/src/d/actor/d_a_npc2.cpp +++ b/src/d/actor/d_a_npc2.cpp @@ -7,7 +7,7 @@ static s32 daBaseNpc_chkPnt(cXyz param_0, dPnt* param_1, u16 param_2, u16 param_ static u16 daBaseNpc_putNurbs(dPnt* i_CPnts, int i_CPntNum, int i_maxPntNum, dPnt* o_curve_p, BOOL i_isClosed); static s16 daBaseNpc_getGroundAngle(cBgS_PolyInfo* param_0, s16 param_1); -dCcD_SrcCyl daBaseNpc_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daBaseNpc_c::mCcDCyl = { daBaseNpc_c::mCcDObj, { { @@ -18,7 +18,7 @@ dCcD_SrcCyl daBaseNpc_c::mCcDCyl = { } }; -dCcD_SrcSph daBaseNpc_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daBaseNpc_c::mCcDSph = { daBaseNpc_c::mCcDObj, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph @@ -490,7 +490,7 @@ const char* daBaseNpc_c::getResName() { return NULL; } -J3DAnmTransform* daBaseNpc_c::getTrnsfrmKeyAnmP(char* i_arcName, int i_resIdx) { +J3DAnmTransform* daBaseNpc_c::getTrnsfrmKeyAnmP(char DUSK_CONST* i_arcName, int i_resIdx) { void* objectRes = dComIfG_getObjectRes(i_arcName, i_resIdx); return (J3DAnmTransform*)objectRes; } @@ -510,7 +510,7 @@ int daBaseNpc_c::setBckAnm(J3DAnmTransform* i_anm, f32 i_speed, int i_mode, int return mBck.init(i_anm, TRUE, i_mode, i_speed, start, end, i_modify); } -J3DAnmTransform* daBaseNpc_c::getTexPtrnAnmP(char* i_arcName, int i_resIdx) { +J3DAnmTransform* daBaseNpc_c::getTexPtrnAnmP(char DUSK_CONST* i_arcName, int i_resIdx) { void* objectRes = dComIfG_getObjectRes(i_arcName, i_resIdx); return (J3DAnmTransform*)objectRes; } @@ -540,7 +540,7 @@ void daBaseNpc_c::attnSttsOn(int param_0, int param_1) { void daBaseNpc_c::setParam() {} -void daBaseNpc_c::orderEvent(int param_0, char* i_evtName) { +void daBaseNpc_c::orderEvent(int param_0, char DUSK_CONST* i_evtName) { if (i_evtName != NULL) { mEvtIdx = dComIfGp_getEventManager().getEventIdx(this, i_evtName, -1); fopAcM_orderOtherEventId(this, mEvtIdx, 0xFF, 0xFFFF, 0, 1); @@ -701,11 +701,11 @@ static int CheckCreateHeap(fopAc_ac_c* i_this) { return moveBgActor->MoveBGCreateHeap(); } -const char* daBaseNpc_moveBgActor_c::m_name; +DUSK_GAME_DATA const char* daBaseNpc_moveBgActor_c::m_name; -int daBaseNpc_moveBgActor_c::m_dzb_id; +DUSK_GAME_DATA int daBaseNpc_moveBgActor_c::m_dzb_id; -MoveBGActor_SetFunc daBaseNpc_moveBgActor_c::m_set_func; +DUSK_GAME_DATA MoveBGActor_SetFunc daBaseNpc_moveBgActor_c::m_set_func; int daBaseNpc_moveBgActor_c::MoveBGCreateHeap() { if (!CreateHeap()) { diff --git a/src/d/actor/d_a_npc4.cpp b/src/d/actor/d_a_npc4.cpp index 858cf579d9..b6e3092051 100644 --- a/src/d/actor/d_a_npc4.cpp +++ b/src/d/actor/d_a_npc4.cpp @@ -707,7 +707,7 @@ void daNpcF_c::tgHitCallBack(fopAc_ac_c* i_this, dCcD_GObjInf* param_1, fopAc_ac } } -dCcD_SrcCyl daNpcF_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daNpcF_c::mCcDCyl = { daNpcF_c::mCcDObjInfo, { { @@ -718,18 +718,18 @@ dCcD_SrcCyl daNpcF_c::mCcDCyl = { } }; -dCcD_SrcSph daNpcF_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daNpcF_c::mCcDSph = { daNpcF_c::mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph } // mSphAttr }; -char daNpcF_c::mFileNameBuf[0x15]; +DUSK_GAME_DATA char daNpcF_c::mFileNameBuf[0x15]; -fopAc_ac_c* daNpcF_c::mFindActorPList[100]; +DUSK_GAME_DATA fopAc_ac_c* daNpcF_c::mFindActorPList[100]; -s32 daNpcF_c::mFindCount; +DUSK_GAME_DATA s32 daNpcF_c::mFindCount; void* daNpcF_c::srchAttnActor1(void* i_proc, void* param_1) { void* param_1_copy = param_1; @@ -746,7 +746,7 @@ void* daNpcF_c::srchAttnActor1(void* i_proc, void* param_1) { return NULL; } -s16 daNpcF_c::mSrchActorName; +DUSK_GAME_DATA s16 daNpcF_c::mSrchActorName; void* daNpcF_c::srchActor(void* i_proc, void* i_this) { void* i_this_copy = i_this; @@ -891,22 +891,22 @@ void daNpcF_c::initialize() { field_0x9d2 = cM_rndF(0x10000); } -J3DAnmTransformKey* daNpcF_c::getTrnsfrmKeyAnmP(char* i_arcName, int i_resIdx) { +J3DAnmTransformKey* daNpcF_c::getTrnsfrmKeyAnmP(char DUSK_CONST* i_arcName, int i_resIdx) { J3DAnmTransformKey* key = (J3DAnmTransformKey*)dComIfG_getObjectRes(i_arcName, i_resIdx); return key; } -J3DAnmTexPattern* daNpcF_c::getTexPtrnAnmP(char* i_arcName, int i_resIdx) { +J3DAnmTexPattern* daNpcF_c::getTexPtrnAnmP(char DUSK_CONST* i_arcName, int i_resIdx) { J3DAnmTexPattern* pattern = (J3DAnmTexPattern*)dComIfG_getObjectRes(i_arcName, i_resIdx); return pattern; } -J3DAnmTextureSRTKey* daNpcF_c::getTexSRTKeyAnmP(char* i_arcName, int i_resIdx) { +J3DAnmTextureSRTKey* daNpcF_c::getTexSRTKeyAnmP(char DUSK_CONST* i_arcName, int i_resIdx) { J3DAnmTextureSRTKey* key = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(i_arcName, i_resIdx); return key; } -J3DAnmTevRegKey* daNpcF_c::getTevRegKeyAnmP(char* i_arcName, int i_resIdx) { +J3DAnmTevRegKey* daNpcF_c::getTevRegKeyAnmP(char DUSK_CONST* i_arcName, int i_resIdx) { J3DAnmTevRegKey* key = (J3DAnmTevRegKey*)dComIfG_getObjectRes(i_arcName, i_resIdx); return key; } @@ -1280,7 +1280,7 @@ int daNpcF_c::ctrlMsgAnm(int& o_expression, int& o_motion, fopAc_ac_c* param_2, return mMsgTimer; } -void daNpcF_c::orderEvent(int i_speak, char* i_evtName, u16 param_2, u16 i_priority, +void daNpcF_c::orderEvent(int i_speak, DUSK_CONST char* i_evtName, u16 param_2, u16 i_priority, u8 i_mapToolID, u16 i_flag) { if (i_evtName != NULL) { @@ -1302,7 +1302,7 @@ void daNpcF_c::orderEvent(int i_speak, char* i_evtName, u16 param_2, u16 i_prior } } -void daNpcF_c::changeEvent(char* i_arcName, char* i_evtName, u16 param_2, u16 param_3) { +void daNpcF_c::changeEvent(DUSK_CONST char* i_arcName, DUSK_CONST char* i_evtName, u16 param_2, u16 param_3) { if (i_arcName != NULL) { eventInfo.setArchiveName(i_arcName); dComIfGp_getEventManager().setObjectArchive(eventInfo.getArchiveName()); @@ -2159,14 +2159,14 @@ int daNpcF_MoveBgActor_c::MoveBGDraw() { return Draw(); } -dCcD_SrcGObjInf const daBaseNpc_c::mCcDObj = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daBaseNpc_c::mCcDObj = { {0, {{0, 0, 0}, {0x0, 0x0}, {0x79}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 0}, {0} }; -dCcD_SrcGObjInf const daNpcF_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daNpcF_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0x0, 0x0}, {0x79}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 0}, diff --git a/src/d/actor/d_a_npc_aru.cpp b/src/d/actor/d_a_npc_aru.cpp index a730afa9cd..7e6558b877 100644 --- a/src/d/actor/d_a_npc_aru.cpp +++ b/src/d/actor/d_a_npc_aru.cpp @@ -141,7 +141,7 @@ enum Type { /* 0x4 */ TYPE_4, }; -const daNpc_Aru_HIOParam daNpc_Aru_Param_c::m = { +DUSK_GAME_DATA const daNpc_Aru_HIOParam daNpc_Aru_Param_c::m = { 220.0f, -3.0f, 1.0f, @@ -244,11 +244,11 @@ void daNpc_Aru_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_ARU, ARU}, }; -static daNpcT_evtData_c l_evtList[12] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[12] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -263,26 +263,26 @@ static daNpcT_evtData_c l_evtList[12] = { {"NO_ENTRANCE", 2}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Aru", "Aru1", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { ARU, -1 }; -static s8 l_loadResPtrn9[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[3] = { ARU, ARU1, -1, }; -static s8* l_loadResPtrnList[6] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[6] = { l_loadResPtrn9, l_loadResPtrn9, l_loadResPtrn9, l_loadResPtrn9, l_loadResPtrn9, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[13] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[13] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_ARU, J3DFrameCtrl::EMode_LOOP, ARU, 1}, {BCK_ARU_F_NORMAL, J3DFrameCtrl::EMode_NONE, ARU, BTP_ARU, J3DFrameCtrl::EMode_LOOP, ARU, 1}, {BCK_ARU_F_GRUMPY, J3DFrameCtrl::EMode_NONE, ARU1, BTP_ARU_F_GRUMPY, J3DFrameCtrl::EMode_NONE, ARU1, 0}, @@ -298,7 +298,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[13] = { {BCK_ARU_FH_NORMAL, J3DFrameCtrl::EMode_LOOP, ARU, BTP_ARU_FH_NORMAL, J3DFrameCtrl::EMode_LOOP, ARU, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[13] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[13] = { {BCK_ARU_WAIT_A, J3DFrameCtrl::EMode_LOOP, ARU, BTK_ARU,J3DFrameCtrl::EMode_NONE, ARU, 1, 0}, {BCK_ARU_WAIT_C, J3DFrameCtrl::EMode_LOOP, ARU1, BTK_ARU, J3DFrameCtrl::EMode_NONE, ARU, 1, 0}, {BCK_ARU_WAIT_D, J3DFrameCtrl::EMode_LOOP, ARU1, BTK_ARU, J3DFrameCtrl::EMode_NONE, ARU, 1, 0}, @@ -314,7 +314,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[13] = { {BCK_ARU_RUN, J3DFrameCtrl::EMode_LOOP, ARU1, BTK_ARU, J3DFrameCtrl::EMode_NONE, ARU, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[52] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[52] = { {1, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {8, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -330,7 +330,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[52] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[48] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[48] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -345,7 +345,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[48] = { {11, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Aru_c::mCutNameList[7] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Aru_c::mCutNameList[7] = { "", "RIDEON_HORSE", "GOTO_BULLRUNNING_STAGE", @@ -355,7 +355,7 @@ char* daNpc_Aru_c::mCutNameList[7] = { "NO_ENTRANCE", }; -daNpc_Aru_c::cutFunc daNpc_Aru_c::mCutList[7] = { +DUSK_GAME_DATA daNpc_Aru_c::cutFunc DUSK_CONST daNpc_Aru_c::mCutList[7] = { NULL, &daNpc_Aru_c::cutRideOnHorse, &daNpc_Aru_c::cutGotoBullRunningStage, @@ -2206,7 +2206,7 @@ static int daNpc_Aru_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_Aru_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Aru_MethodTable = { (process_method_func)daNpc_Aru_Create, (process_method_func)daNpc_Aru_Delete, (process_method_func)daNpc_Aru_Execute, @@ -2214,7 +2214,7 @@ static actor_method_class daNpc_Aru_MethodTable = { (process_method_func)daNpc_Aru_Draw, }; -actor_process_profile_definition g_profile_NPC_ARU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ARU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ash.cpp b/src/d/actor/d_a_npc_ash.cpp index 4bb33c5352..7bfde34700 100644 --- a/src/d/actor/d_a_npc_ash.cpp +++ b/src/d/actor/d_a_npc_ash.cpp @@ -12,7 +12,7 @@ #include "SSystem/SComponent/c_math.h" #include -const daNpcAsh_HIOParam daNpcAsh_Param_c::m = { +DUSK_GAME_DATA const daNpcAsh_HIOParam daNpcAsh_Param_c::m = { 35.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -135,7 +135,7 @@ bool daNpcAsh_c::step(s16 i_angY, bool i_animate) { return mTurnMode > 1; } -static daNpc_GetParam2 l_bckGetParamList[18] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[18] = { {-1, 2, 0}, // {7, 0, 0}, // ash_f_talk_a {12, 0, 1}, // ash_f_talk_b @@ -156,38 +156,38 @@ static daNpc_GetParam2 l_bckGetParamList[18] = { {4, 2, 2}, // ash_bowrun }; -static daNpc_GetParam2 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[1] = { {17, 2, 0}, // ash }; -static daNpc_GetParam2 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[1] = { {14, 2, 0}, // ash }; -static int l_loadRes_ASH0[3] = { +static DUSK_CONSTEXPR int l_loadRes_ASH0[3] = { 0, 1, -1, }; -static int l_loadRes_ASH1[3] = { +static DUSK_CONSTEXPR int l_loadRes_ASH1[3] = { 0, 2, -1, }; -static int* l_loadRes_list[2] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[2] = { l_loadRes_ASH0, l_loadRes_ASH1, }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "Ash", "Ash1", "Ash2", }; -static char* l_evtNames[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[6] = { "", "THE_INTRODUCTION", "RESIST_MEETING", @@ -196,9 +196,9 @@ static char* l_evtNames[6] = { "RESIST_WIRETAP_RAFREL", }; -static char* l_myName = "Ash"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Ash"; -daNpcAsh_c::EventFn daNpcAsh_c::mEvtSeqList[6] = { +DUSK_GAME_DATA daNpcAsh_c::EventFn daNpcAsh_c::mEvtSeqList[6] = { NULL, &daNpcAsh_c::EvCut_Introduction, &daNpcAsh_c::EvCut_Meeting, @@ -1329,13 +1329,13 @@ BOOL daNpcAsh_c::drawDbgInfo() { return false; } -static actor_method_class daNpcAsh_MethodTable = { +static DUSK_CONST actor_method_class daNpcAsh_MethodTable = { (process_method_func)daNpcAsh_Create, (process_method_func)daNpcAsh_Delete, (process_method_func)daNpcAsh_Execute, (process_method_func)daNpcAsh_IsDelete, (process_method_func)daNpcAsh_Draw, }; -actor_process_profile_definition g_profile_NPC_ASH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ASH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ashB.cpp b/src/d/actor/d_a_npc_ashB.cpp index 25194fb71e..a4dd015906 100644 --- a/src/d/actor/d_a_npc_ashB.cpp +++ b/src/d/actor/d_a_npc_ashB.cpp @@ -10,7 +10,7 @@ #include "JSystem/J3DGraphBase/J3DMaterial.h" #include -const daNpcAshB_HIOParam daNpcAshB_Param_c::m = { +DUSK_GAME_DATA const daNpcAshB_HIOParam daNpcAshB_Param_c::m = { 205.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -49,20 +49,20 @@ const daNpcAshB_HIOParam daNpcAshB_Param_c::m = { static NPC_ASHB_HIO_CLASS l_HIO; -static daNpc_GetParam2 l_bckGetParamList[21] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[21] = { {-1, 2, 0}, {13, 0, 0}, {14, 0, 0}, {11, 0, 0}, {10, 0, 0}, {9, 0, 0}, {12, 0, 0}, {24, 2, 0}, {25, 2, 0}, {24, 2, 0}, {21, 0, 0}, {22, 0, 0}, {20, 0, 0}, {23, 0, 0}, {7, 0, 0}, {8, 0, 0}, {18, 0, 0}, {15, 0, 0}, {16, 0, 0}, {17, 2, 0}, {19, 0, 0}, }; -static daNpc_GetParam2 l_btpGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[4] = { {38, 2, 0}, {41, 0, 0}, {40, 0, 0}, {39, 0, 0}, }; -static daNpc_GetParam2 l_btkGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[4] = { {32, 2, 0}, {34, 0, 0}, {33, 0, 0}, @@ -70,16 +70,16 @@ static daNpc_GetParam2 l_btkGetParamList[4] = { }; -static char* l_arcNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[1] = { "AshB", }; -static char* l_evtNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[2] = { NULL, "ASHB_APPEAR", }; -static char* l_myName = "AshB"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "AshB"; #if DEBUG daNpcAshB_HIO_c::daNpcAshB_HIO_c() { @@ -93,7 +93,7 @@ void daNpcAshB_HIO_c::genMessage(JORMContext* ctext) { } #endif -daNpcAshB_c::EventFn daNpcAshB_c::mEvtSeqList[2] = { +DUSK_GAME_DATA daNpcAshB_c::EventFn DUSK_CONST daNpcAshB_c::mEvtSeqList[2] = { NULL, &daNpcAshB_c::EvCut_Appear, }; @@ -1187,13 +1187,13 @@ BOOL daNpcAshB_c::drawDbgInfo() { return false; } -static actor_method_class daNpcAshB_MethodTable = { +static DUSK_CONST actor_method_class daNpcAshB_MethodTable = { (process_method_func)daNpcAshB_Create, (process_method_func)daNpcAshB_Delete, (process_method_func)daNpcAshB_Execute, (process_method_func)daNpcAshB_IsDelete, (process_method_func)daNpcAshB_Draw, }; -actor_process_profile_definition g_profile_NPC_ASHB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ASHB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_bans.cpp b/src/d/actor/d_a_npc_bans.cpp index e2d3eedad7..db08a19bde 100644 --- a/src/d/actor/d_a_npc_bans.cpp +++ b/src/d/actor/d_a_npc_bans.cpp @@ -138,7 +138,7 @@ enum Type { /* 0x5 */ TYPE_DEFAULT, }; -daNpc_Bans_HIOParam const daNpc_Bans_Param_c::m = { +DUSK_GAME_DATA daNpc_Bans_HIOParam const daNpc_Bans_Param_c::m = { 200.0f, -3.0f, 1.0f, @@ -219,14 +219,14 @@ void daNpc_Bans_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[4][2] = { +static DUSK_CONSTEXPR int l_bmdData[4][2] = { {BMDE_BANS, BANS}, {BMDR_BANS_TW, BANS_TW}, {BMDR_BANS_SCOOP, BANS2}, {BMDR_BANS_TUB, BANS2}, }; -static daNpcT_evtData_c l_evtList[9] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[9] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -238,7 +238,7 @@ static daNpcT_evtData_c l_evtList[9] = { {"GOBACK", 3}, }; -static char* l_resNameList[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[6] = { "", "Bans", "Bans_TW", @@ -247,32 +247,32 @@ static char* l_resNameList[6] = { "Len1", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { BANS, BANS1, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { BANS, BANS2, -1, }; -static s8 l_loadResPtrn2[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[2] = { BANS_TW, -1, }; -static s8 l_loadResPtrn3[4] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[4] = { BANS, BANS1, BANS2, -1, }; -static s8 l_loadResPtrn4[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn4[5] = { BANS, BANS_TW, BANS1, BANS2, -1, }; -static s8* l_loadResPtrnList[6] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[6] = { l_loadResPtrn3, l_loadResPtrn2, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn4, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, BTP_BANS, J3DFrameCtrl::EMode_LOOP, BANS, TRUE}, {-1, J3DFrameCtrl::EMode_NONE, NONE, -1, J3DFrameCtrl::EMode_NONE, NONE, FALSE}, {BCK_BANS_F_TALK_A, J3DFrameCtrl::EMode_NONE, BANS, BTP_BANS, J3DFrameCtrl::EMode_LOOP, BANS, TRUE}, @@ -280,7 +280,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {BCK_BANS_FH_TALK_B, J3DFrameCtrl::EMode_LOOP, BANS, BTP_BANS, J3DFrameCtrl::EMode_LOOP, BANS, TRUE}, }; -static daNpcT_motionAnmData_c l_motionAnmData[20] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[20] = { {BCK_BANS_WAIT_A, J3DFrameCtrl::EMode_LOOP, BANS, BTK_BANS, J3DFrameCtrl::EMode_NONE, BANS, 1, 0}, {BCK_BANS_WAIT_B, J3DFrameCtrl::EMode_LOOP, BANS1, BTK_BANS, J3DFrameCtrl::EMode_NONE, BANS, 1, 0}, {BCK_BANS_WAIT_C, J3DFrameCtrl::EMode_LOOP, BANS1, BTK_BANS, J3DFrameCtrl::EMode_NONE, BANS, 1, 0}, @@ -303,7 +303,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[20] = { {BCK_BANS_FAINT, J3DFrameCtrl::EMode_LOOP, BANS2, BTK_BANS, J3DFrameCtrl::EMode_NONE, BANS, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {4, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -311,7 +311,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[84] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[84] = { {0, -9, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -9, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, 0, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -335,14 +335,14 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[84] = { {9, 0, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Bans_c::mCutNameList[4] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Bans_c::mCutNameList[4] = { "", "ANGER", "PURCHASE", "GO_BACK", }; -daNpc_Bans_c::cutFunc daNpc_Bans_c::mCutList[4] = { +DUSK_GAME_DATA daNpc_Bans_c::cutFunc DUSK_CONST daNpc_Bans_c::mCutList[4] = { NULL, &daNpc_Bans_c::cutAnger, &daNpc_Bans_c::cutPurchase, @@ -1852,7 +1852,7 @@ static int daNpc_Bans_IsDelete(void*) { return 1; } -static actor_method_class daNpc_Bans_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Bans_MethodTable = { (process_method_func)daNpc_Bans_Create, (process_method_func)daNpc_Bans_Delete, (process_method_func)daNpc_Bans_Execute, @@ -1860,7 +1860,7 @@ static actor_method_class daNpc_Bans_MethodTable = { (process_method_func)daNpc_Bans_Draw, }; -actor_process_profile_definition g_profile_NPC_BANS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_BANS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_besu.cpp b/src/d/actor/d_a_npc_besu.cpp index ea52cd896a..197f97dfb0 100644 --- a/src/d/actor/d_a_npc_besu.cpp +++ b/src/d/actor/d_a_npc_besu.cpp @@ -284,7 +284,7 @@ enum Event { /* 0xC */ EVENT_CONVERSATION_ABOUT_ZORA, }; -const daNpc_Besu_HIOParam daNpc_Besu_Param_c::m = { +DUSK_GAME_DATA const daNpc_Besu_HIOParam daNpc_Besu_Param_c::m = { 160.0f, -3.0f, 1.0f, @@ -369,7 +369,7 @@ void daNpc_Besu_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[6][2] = { +static DUSK_CONSTEXPR int l_bmdData[6][2] = { {3, 1}, {11, 2}, {37, 5}, @@ -378,7 +378,7 @@ static int l_bmdData[6][2] = { {38, 5}, }; -static daNpcT_evtData_c l_evtList[13] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[13] = { {"", 0}, {"NO_RESPONSE", 0}, {"CONVERSATION_ABOUT_SARU01", 11}, @@ -394,7 +394,7 @@ static daNpcT_evtData_c l_evtList[13] = { {"CONVERSATION_ABOUT_ZORA", 5}, }; -static char* l_resNameList[12] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[12] = { "", "Besu", "Besu_TW", @@ -409,33 +409,33 @@ static char* l_resNameList[12] = { "Sera", }; -static s8 l_loadResPtrn0[4] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = { 1, 3, 4, -1 }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { 3, 2, -1, }; -static s8 l_loadResPtrn2[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = { 3, 5, -1, }; -static s8 l_loadResPtrn3[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[3] = { 3, 6, -1, }; -static s8 l_loadResPtrn4[4] = {3, 4, 6, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn4[4] = {3, 4, 6, -1}; -static s8 l_loadResPtrn5[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn5[3] = { 1, 7, -1, }; -static s8 l_loadResPtrn9[7] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[7] = { 1, 2, 3, 4, 5, 6, -1, }; -static s8* l_loadResPtrnList[19] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[19] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn4, l_loadResPtrn0, l_loadResPtrn3, l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, @@ -443,7 +443,7 @@ static s8* l_loadResPtrnList[19] = { l_loadResPtrn0, l_loadResPtrn5, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_BESU, J3DFrameCtrl::EMode_LOOP, BESU0, 1}, {BCK_BESU_F_TALK_A, J3DFrameCtrl::EMode_NONE, BESU1, BTP_BESU_F_TALK_A, J3DFrameCtrl::EMode_NONE, BESU1, 0}, {BCK_BESU_F_TALK_B, J3DFrameCtrl::EMode_NONE, BESU1, BTP_BESU_F_TALK_B, J3DFrameCtrl::EMode_NONE, BESU1, 0}, @@ -476,7 +476,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {BCK_BESU_FH_BIKKURI, J3DFrameCtrl::EMode_LOOP, BESU0, BTP_BESU_FH_BIKKURI, J3DFrameCtrl::EMode_LOOP, BESU0, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[33] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[33] = { {BCK_BESU_WAIT_A, J3DFrameCtrl::EMode_LOOP, BESU0, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, {BCK_BESU_WAIT_B, J3DFrameCtrl::EMode_LOOP, BESU1, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, {BCK_BESU_WAIT_C, J3DFrameCtrl::EMode_LOOP, BESU0, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, @@ -512,7 +512,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[33] = { {BCK_BESU_BODY_WAIT, J3DFrameCtrl::EMode_LOOP, BESU0, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[116] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[116] = { {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -544,7 +544,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[116] {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -577,7 +577,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { {9, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Besu_c::mCutNameList[15] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Besu_c::mCutNameList[15] = { "", "CONVERSATION_ABOUT_SARU", "CONVERSATION_ABOUT_PACHINKO", @@ -595,7 +595,7 @@ char* daNpc_Besu_c::mCutNameList[15] = { "THANK_YOU", }; -daNpc_Besu_c::cutFunc daNpc_Besu_c::mCutList[15] = { +DUSK_GAME_DATA daNpc_Besu_c::cutFunc DUSK_CONST daNpc_Besu_c::mCutList[15] = { NULL, &daNpc_Besu_c::cutConversationAboutSaru, &daNpc_Besu_c::cutConversationAboutPachinko, @@ -3060,7 +3060,7 @@ static int daNpc_Besu_IsDelete(void*) { return true; } -static actor_method_class daNpc_Besu_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Besu_MethodTable = { (process_method_func)daNpc_Besu_Create, (process_method_func)daNpc_Besu_Delete, (process_method_func)daNpc_Besu_Execute, @@ -3068,7 +3068,7 @@ static actor_method_class daNpc_Besu_MethodTable = { (process_method_func)daNpc_Besu_Draw, }; -actor_process_profile_definition g_profile_NPC_BESU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_BESU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_blue_ns.cpp b/src/d/actor/d_a_npc_blue_ns.cpp index 1a90f4542d..9b8ccf41dd 100644 --- a/src/d/actor/d_a_npc_blue_ns.cpp +++ b/src/d/actor/d_a_npc_blue_ns.cpp @@ -11,7 +11,7 @@ #include "d/actor/d_a_npc_yamid.h" #include "d/actor/d_a_npc_yamit.h" -static daNpc_GetParam2 l_bckGetParamList[9] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[9] = { {11, 2, 0}, {12, 2, 0}, {13, 2, 0}, @@ -23,9 +23,9 @@ static daNpc_GetParam2 l_bckGetParamList[9] = { {7, 0, 0}, }; -static char* l_arcNames[1] = {"Blue_NS"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[1] = {"Blue_NS"}; -static char* l_evtNames[7] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[7] = { NULL, "CHG_YAMI_CHIBI", "CHG_YAMI_DEBU", @@ -35,11 +35,11 @@ static char* l_evtNames[7] = { "CHG_YAMI_NOPPO_STOPPER", }; -static char* l_myName = "Blue_NS"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Blue_NS"; static NPC_BLUE_NS_HIO_CLASS l_HIO; -daNpcBlueNS_c::EventFn daNpcBlueNS_c::mEvtSeqList[] = { +DUSK_GAME_DATA daNpcBlueNS_c::EventFn DUSK_CONST daNpcBlueNS_c::mEvtSeqList[] = { NULL, &daNpcBlueNS_c::_Evt_ChgYami_Chibi, &daNpcBlueNS_c::_Evt_ChgYami_Debu, @@ -93,7 +93,7 @@ const static dCcD_SrcCyl l_cyl_src = { } }; -const daNpcBlueNS_HIOParam daNpcBlueNS_Param_c::m = { +DUSK_GAME_DATA const daNpcBlueNS_HIOParam daNpcBlueNS_Param_c::m = { 55.0f, -3.0f, 1.0f, @@ -1419,7 +1419,7 @@ static int daNpcBlueNS_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcBlueNS_MethodTable = { +static DUSK_CONST actor_method_class daNpcBlueNS_MethodTable = { (process_method_func)daNpcBlueNS_Create, (process_method_func)daNpcBlueNS_Delete, (process_method_func)daNpcBlueNS_Execute, @@ -1427,7 +1427,7 @@ static actor_method_class daNpcBlueNS_MethodTable = { (process_method_func)daNpcBlueNS_Draw, }; -actor_process_profile_definition g_profile_NPC_BLUENS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_BLUENS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_bou.cpp b/src/d/actor/d_a_npc_bou.cpp index 775bfd7c4c..a8915773a7 100644 --- a/src/d/actor/d_a_npc_bou.cpp +++ b/src/d/actor/d_a_npc_bou.cpp @@ -13,11 +13,11 @@ #include "d/d_meter2_info.h" #include -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {11, 1}, }; -static daNpcT_evtData_c l_evtList[11] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[11] = { {"", 0}, {"NO_RESPONSE", 0}, {"WILDGOAT", 2}, @@ -31,7 +31,7 @@ static daNpcT_evtData_c l_evtList[11] = { {"MEETING_AGAIN_NEAR", 4}, }; -static char* l_resNameList[7] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[7] = { "", "Bou", "Bou1", @@ -41,22 +41,22 @@ static char* l_resNameList[7] = { "Jagar2" }; -static s8 l_loadResPtrn0[4] = {1, 2, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = {1, 2, 4, -1}; -static s8 l_loadResPtrn1[3] = {1, 3, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = {1, 3, -1}; -static s8 l_loadResPtrn2[3] = {1, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = {1, 4, -1}; -static s8 l_loadResPtrn3[3] = {1, 5, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn3[3] = {1, 5, -1}; -static s8 l_loadResPtrn9[5] = {1, 2, 3, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = {1, 2, 3, 4, -1}; -static s8* l_loadResPtrnList[6] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[6] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn2, l_loadResPtrn3, l_loadResPtrn0, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[11] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[11] = { {-1, 0, 0, 17, 2, 1, 1}, {6, 0, 1, 17, 2, 1, 1}, {4, 0, 2, 17, 2, 1, 1}, @@ -70,7 +70,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[11] = { {10, 0, 4, 27, 0, 4, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[23] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[23] = { {8, 2, 1, 14, 0, 1, 1, 0}, {5, 0, 2, 14, 0, 1, 1, 0}, {7, 2, 3, 14, 0, 1, 1, 0}, @@ -96,7 +96,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[23] = { {18, 2, 4, 14, 0, 1, 1, 0} }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[44] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[44] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, 0, 1}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 1}, {8, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -105,7 +105,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[44] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[88] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[88] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, 0, 1}, {10, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 1}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -119,7 +119,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[88] = { {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Bou_c::mCutNameList[9] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Bou_c::mCutNameList[9] = { "", "WILDGOAT", "WILDGOAT_SUCCESS", @@ -131,7 +131,7 @@ char* daNpc_Bou_c::mCutNameList[9] = { "MEETING_AGAIN" }; -daNpc_Bou_c::cutFunc daNpc_Bou_c::mCutList[9] = { +DUSK_GAME_DATA daNpc_Bou_c::cutFunc DUSK_CONST daNpc_Bou_c::mCutList[9] = { NULL, &daNpc_Bou_c::cutWildGoat, &daNpc_Bou_c::cutWildGoatSuccess, @@ -157,7 +157,7 @@ daNpc_Bou_c::~daNpc_Bou_c() { deleteRes(l_loadResPtrnList[mType], (char const**)l_resNameList); } -daNpc_Bou_HIOParam const daNpc_Bou_Param_c::m = { +DUSK_GAME_DATA daNpc_Bou_HIOParam const daNpc_Bou_Param_c::m = { { 210.0f, -3.0f, 1.0f, 600.0f, 255.0f, 200.0f, 35.0f, 40.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, @@ -185,7 +185,7 @@ void daNpc_Bou_HIO_c::genMessage(JORMContext* ctx) { #endif int daNpc_Bou_c::create() { - static int const heapSize[6] = {15696, 15696, 15696, 15696, 15696, 0}; + static DUSK_CONSTEXPR int const heapSize[6] = {15696, 15696, 15696, 15696, 15696, 0}; daNpcT_ct(this, daNpc_Bou_c, l_faceMotionAnmData, l_motionAnmData, l_faceMotionSequenceData, 4, l_motionSequenceData, 4, l_evtList, l_resNameList @@ -1665,7 +1665,7 @@ static int daNpc_Bou_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Bou_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Bou_MethodTable = { (process_method_func)daNpc_Bou_Create, (process_method_func)daNpc_Bou_Delete, (process_method_func)daNpc_Bou_Execute, @@ -1673,7 +1673,7 @@ static actor_method_class daNpc_Bou_MethodTable = { (process_method_func)daNpc_Bou_Draw, }; -actor_process_profile_definition g_profile_NPC_BOU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_BOU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_bouS.cpp b/src/d/actor/d_a_npc_bouS.cpp index 66a1cf02bc..ffd0156f9b 100644 --- a/src/d/actor/d_a_npc_bouS.cpp +++ b/src/d/actor/d_a_npc_bouS.cpp @@ -165,7 +165,7 @@ enum Event { /* 0x3 */ EVENT_INTRO_SUMO3, }; -static daNpc_GetParam2 l_bckGetParamList[23] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[23] = { {-1, J3DFrameCtrl::EMode_LOOP, BOU}, {BCK_BOU_F_TALK_A, J3DFrameCtrl::EMode_NONE, BOU}, {BCK_BOU4_F_TALK_A, J3DFrameCtrl::EMode_NONE, BOU4}, @@ -191,7 +191,7 @@ static daNpc_GetParam2 l_bckGetParamList[23] = { {BCK_BOU4_THINKING_B, J3DFrameCtrl::EMode_LOOP, BOU4}, }; -static daNpc_GetParam2 l_btpGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[5] = { {BTP_BOU, J3DFrameCtrl::EMode_LOOP, BOU}, {BTP_BOU4_F_CONSIDER, J3DFrameCtrl::EMode_NONE, BOU4}, {BTP_BOU4_F_CONSIDERING, J3DFrameCtrl::EMode_LOOP, BOU4}, @@ -199,25 +199,25 @@ static daNpc_GetParam2 l_btpGetParamList[5] = { {BTP_BOU4_FH_TALK_B, J3DFrameCtrl::EMode_LOOP, BOU4}, }; -static daNpc_GetParam2 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[1] = { {BTK_BOU, J3DFrameCtrl::EMode_LOOP, BOU}, }; -static char* l_arcNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[2] = { "Bou", "Bou4", }; -static char* l_evtNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[4] = { NULL, "BOUS_INTRO_SUMO1", "BOUS_INTRO_SUMO2", "BOUS_INTRO_SUMO3", }; -static char* l_myName = "BouS"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "BouS"; -static cXyz l_createPos(1000000000.0f, 1000000000.0f, 1000000000.0f); +static DUSK_CONSTEXPR cXyz l_createPos(1000000000.0f, 1000000000.0f, 1000000000.0f); static NPC_BOUS_HIO_CLASS l_HIO; @@ -261,7 +261,7 @@ void daNpcBouS_HIO_c::genMessage(JORMContext* ctx) { } #endif -daNpcBouS_c::eventFunc daNpcBouS_c::mEvtSeqList[4] = { +DUSK_GAME_DATA daNpcBouS_c::eventFunc daNpcBouS_c::mEvtSeqList[4] = { NULL, &daNpcBouS_c::EvCut_BousIntroSumo1, &daNpcBouS_c::EvCut_BousIntroSumo2, @@ -286,7 +286,7 @@ daNpcBouS_c::~daNpcBouS_c() { #endif } -daNpcBouS_HIOParam const daNpcBouS_Param_c::m = { +DUSK_GAME_DATA daNpcBouS_HIOParam const daNpcBouS_Param_c::m = { 220.0f, -3.0f, 1.0f, @@ -1616,7 +1616,7 @@ inline void daNpcBouS_c::drawOtherMdls() {} AUDIO_INSTANCES; -static actor_method_class daNpcBouS_MethodTable = { +static DUSK_CONST actor_method_class daNpcBouS_MethodTable = { (process_method_func)daNpcBouS_Create, (process_method_func)daNpcBouS_Delete, (process_method_func)daNpcBouS_Execute, @@ -1624,7 +1624,7 @@ static actor_method_class daNpcBouS_MethodTable = { (process_method_func)daNpcBouS_Draw, }; -actor_process_profile_definition g_profile_NPC_BOU_S = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_BOU_S = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_cd.cpp b/src/d/actor/d_a_npc_cd.cpp index 3b008b73e7..cc4ab6f967 100644 --- a/src/d/actor/d_a_npc_cd.cpp +++ b/src/d/actor/d_a_npc_cd.cpp @@ -15,128 +15,128 @@ static int jntNodeCallBack(J3DJoint* i_jnt, int param_1) { return 1; } -static char* const l_resMANa[6] = { +static DUSK_CONST char* const l_resMANa[6] = { "MAN_a_L", "MAN_a_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMADa[6] = { +static DUSK_CONST char* const l_resMADa[6] = { "MAD_a_L", "MAD_a_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMCNa[6] = { +static DUSK_CONST char* const l_resMCNa[6] = { "MCN_a_L", "MCN_a_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMONa[6] = { +static DUSK_CONST char* const l_resMONa[6] = { "MON_a_L", "MON_a_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMANb[6] = { +static DUSK_CONST char* const l_resMANb[6] = { "MAN_b_L", "MAN_b_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMANc[6] = { +static DUSK_CONST char* const l_resMANc[6] = { "MAN_c_L", "MAN_c_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMASa[6] = { +static DUSK_CONST char* const l_resMASa[6] = { "MAS_a_L", "MAS_a_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMBNa[6] = { +static DUSK_CONST char* const l_resMBNa[6] = { "MBN_a_L", "MBN_a_LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMANa2[6] = { +static DUSK_CONST char* const l_resMANa2[6] = { "MAN_a2_L", "MAN_a2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMADa2[6] = { +static DUSK_CONST char* const l_resMADa2[6] = { "MAD_a2_L", "MAD_a2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMCNa2[6] = { +static DUSK_CONST char* const l_resMCNa2[6] = { "MCN_a2_L", "MCN_a2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMONa2[6] = { +static DUSK_CONST char* const l_resMONa2[6] = { "MON_a2_L", "MON_a2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMANb2[6] = { +static DUSK_CONST char* const l_resMANb2[6] = { "MAN_b2_L", "MAN_b2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMANc2[6] = { +static DUSK_CONST char* const l_resMANc2[6] = { "MAN_c2_L", "MAN_c2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMASa2[6] = { +static DUSK_CONST char* const l_resMASa2[6] = { "MAS_a2_L", "MAS_a2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resMBNa2[6] = { +static DUSK_CONST char* const l_resMBNa2[6] = { "MBN_a2_L", "MBN_a2LTW", "Mgenral_l", "Mspcial_l", "object_l", "objectLTW", }; -static char* const l_resWANa[6] = { +static DUSK_CONST char* const l_resWANa[6] = { "WAN_a_L", "WAN_a_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWADa[6] = { +static DUSK_CONST char* const l_resWADa[6] = { "WAD_a_L", "WAD_a_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resMATa[6] = { +static DUSK_CONST char* const l_resMATa[6] = { "MAT_a_L", "MAT_a_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWCNa[6] = { +static DUSK_CONST char* const l_resWCNa[6] = { "WCN_a_L", "WCN_a_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWONa[6] = { +static DUSK_CONST char* const l_resWONa[6] = { "WON_a_L", "WON_a_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWGNa[6] = { +static DUSK_CONST char* const l_resWGNa[6] = { "WGN_a_L", "WGN_a_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWANb[6] = { +static DUSK_CONST char* const l_resWANb[6] = { "WAN_b_L", "WAN_b_LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWANa2[6] = { +static DUSK_CONST char* const l_resWANa2[6] = { "WAN_a2_L", "WAN_a2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWADa2[6] = { +static DUSK_CONST char* const l_resWADa2[6] = { "WAD_a2_L", "WAD_a2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resMATa2[6] = { +static DUSK_CONST char* const l_resMATa2[6] = { "MAT_a2_L", "MAT_a2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWCNa2[6] = { +static DUSK_CONST char* const l_resWCNa2[6] = { "WCN_a2_L", "WCN_a2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWONa2[6] = { +static DUSK_CONST char* const l_resWONa2[6] = { "WON_a2_L", "WON_a2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWGNa2[6] = { +static DUSK_CONST char* const l_resWGNa2[6] = { "WGN_a2_L", "WGN_a2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; -static char* const l_resWANb2[6] = { +static DUSK_CONST char* const l_resWANb2[6] = { "WAN_b2_L", "WAN_b2LTW", "Wgenral_l", "Wspcial_l", "object_l", "objectLTW", }; struct anmTblPrm { - char* arc_name; + DUSK_CONST char* arc_name; int resource_index; }; @@ -160,7 +160,7 @@ static anmTblPrm const l_bckTbl_W[10] = { {"Wspcial_l", 7}, {"Wspcial_l", 8}, {"Wspcial_l", 3}, {"Wspcial_l", 4}, {"Wspcial_l", 5}, }; -dCcD_SrcCyl const daNpcCd_c::m_cylDat = { +DUSK_GAME_DATA dCcD_SrcCyl const daNpcCd_c::m_cylDat = { { {0x0, {{0x0, 0x0, 0x0}, {0, 0}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -317,7 +317,7 @@ J3DAnmTransform* daNpcCd_c::getAnmP(int param_1, int param_2) { return (J3DAnmTransform*)dComIfG_getObjectRes(anmTbl.arc_name, anmTbl.resource_index); } -static char* const* l_resNameTbl[30] = { +static DUSK_CONST char* const* l_resNameTbl[30] = { l_resMANa, l_resMADa, l_resMCNa, l_resMONa, l_resMANb, l_resMANc, l_resMASa, l_resMBNa, l_resMANa2, l_resMADa2, l_resMCNa2, l_resMONa2, l_resMANb2, l_resMANc2, l_resMASa2, l_resMBNa2, l_resWANa, l_resWADa, l_resMATa, l_resWCNa, l_resWONa, l_resWGNa, l_resWANb, l_resWANa2, @@ -346,7 +346,7 @@ static anmTblPrm const l_bmdTWTbl[30] = { {l_resWGNa2[1], 3}, {l_resWANb2[1], 3}, }; -daNpcCd_HIO_c l_Cd_HIO; +DUSK_GAME_DATA daNpcCd_HIO_c l_Cd_HIO; int daNpcCd_c::setAttention(int i_idx) { static cXyz const a_eyeOfsTbl[30] = { diff --git a/src/d/actor/d_a_npc_cd2.cpp b/src/d/actor/d_a_npc_cd2.cpp index cf3f07ef10..c42f5f947c 100644 --- a/src/d/actor/d_a_npc_cd2.cpp +++ b/src/d/actor/d_a_npc_cd2.cpp @@ -14,128 +14,128 @@ static int jntNodeCallBack(J3DJoint* i_jnt, int param_1) { return 1; } -static char* const l_resMANa[6] = { +static DUSK_CONST char* const l_resMANa[6] = { "MAN_a", "MAN_a_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMADa[6] = { +static DUSK_CONST char* const l_resMADa[6] = { "MAD_a", "MAD_a_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMCNa[6] = { +static DUSK_CONST char* const l_resMCNa[6] = { "MCN_a", "MCN_a_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMONa[6] = { +static DUSK_CONST char* const l_resMONa[6] = { "MON_a", "MON_a_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMANb[6] = { +static DUSK_CONST char* const l_resMANb[6] = { "MAN_b", "MAN_b_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMANc[6] = { +static DUSK_CONST char* const l_resMANc[6] = { "MAN_c", "MAN_c_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMASa[6] = { +static DUSK_CONST char* const l_resMASa[6] = { "MAS_a", "MAS_a_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMBNa[6] = { +static DUSK_CONST char* const l_resMBNa[6] = { "MBN_a", "MBN_a_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMANa2[6] = { +static DUSK_CONST char* const l_resMANa2[6] = { "MAN_a2", "MAN_a2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMADa2[6] = { +static DUSK_CONST char* const l_resMADa2[6] = { "MAD_a2", "MAD_a2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMCNa2[6] = { +static DUSK_CONST char* const l_resMCNa2[6] = { "MCN_a2", "MCN_a2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMONa2[6] = { +static DUSK_CONST char* const l_resMONa2[6] = { "MON_a2", "MON_a2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMANb2[6] = { +static DUSK_CONST char* const l_resMANb2[6] = { "MAN_b2", "MAN_b2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMANc2[6] = { +static DUSK_CONST char* const l_resMANc2[6] = { "MAN_c2", "MAN_c2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMASa2[6] = { +static DUSK_CONST char* const l_resMASa2[6] = { "MAS_a2", "MAS_a2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resMBNa2[6] = { +static DUSK_CONST char* const l_resMBNa2[6] = { "MBN_a2", "MBN_a2_TW", "Mgeneral", "Mspecial", "object", "objectTW", }; -static char* const l_resWANa[6] = { +static DUSK_CONST char* const l_resWANa[6] = { "WAN_a", "WAN_a_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWADa[6] = { +static DUSK_CONST char* const l_resWADa[6] = { "WAD_a", "WAD_a_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resMATa[6] = { +static DUSK_CONST char* const l_resMATa[6] = { "MAT_a", "MAT_a_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWCNa[6] = { +static DUSK_CONST char* const l_resWCNa[6] = { "WCN_a", "WCN_a_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWONa[6] = { +static DUSK_CONST char* const l_resWONa[6] = { "WON_a", "WON_a_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWGNa[6] = { +static DUSK_CONST char* const l_resWGNa[6] = { "WGN_a", "WGN_a_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWANb[6] = { +static DUSK_CONST char* const l_resWANb[6] = { "WAN_b", "WAN_b_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWANa2[6] = { +static DUSK_CONST char* const l_resWANa2[6] = { "WAN_a2", "WAN_a2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWADa2[6] = { +static DUSK_CONST char* const l_resWADa2[6] = { "WAD_a2", "WAD_a2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resMATa2[6] = { +static DUSK_CONST char* const l_resMATa2[6] = { "MAT_a2", "MAT_a2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWCNa2[6] = { +static DUSK_CONST char* const l_resWCNa2[6] = { "WCN_a2", "WCN_a2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWONa2[6] = { +static DUSK_CONST char* const l_resWONa2[6] = { "WON_a2", "WON_a2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWGNa2[6] = { +static DUSK_CONST char* const l_resWGNa2[6] = { "WGN_a2", "WGN_a2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; -static char* const l_resWANb2[6] = { +static DUSK_CONST char* const l_resWANb2[6] = { "WAN_b2", "WAN_b2_TW", "Wgeneral", "Wspecial", "object", "objectTW", }; struct anmTblPrm { - char* name; + DUSK_CONST char* name; int index; }; @@ -179,7 +179,7 @@ static anmTblPrm const l_bckTbl_W[54] = { {"Wgeneral", 5}, {"Wgeneral", 6}, {"Wgeneral", 9}, {"Wgeneral", 15}, }; -dCcD_SrcCyl const daNpcCd2_c::m_cylDat = { +DUSK_GAME_DATA dCcD_SrcCyl const daNpcCd2_c::m_cylDat = { { {0x0, {{0x0, 0x0, 0x0}, {0, 0}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -195,7 +195,7 @@ dCcD_SrcCyl const daNpcCd2_c::m_cylDat = { } }; -static char* const* l_resNameTbl[30] = { +static DUSK_CONST char* const* l_resNameTbl[30] = { l_resMANa, l_resMADa, l_resMCNa, l_resMONa, l_resMANb, l_resMANc, l_resMASa, l_resMBNa, l_resMANa2, l_resMADa2, l_resMCNa2, l_resMONa2, l_resMANb2, l_resMANc2, l_resMASa2, l_resMBNa2, l_resWANa, l_resWADa, l_resMATa, l_resWCNa, l_resWONa, l_resWGNa, l_resWANb, l_resWANa2, @@ -240,7 +240,7 @@ static anmTblPrm const l_btpTWTbl[30] = { #include "d/actor/d_a_npc_cd2_HIO.inc" -daNpcCd2_HIO_c l_Cd2_HIO; +DUSK_GAME_DATA daNpcCd2_HIO_c l_Cd2_HIO; int daNpcCd2_c::NpcCreate(int param_1) { J3DModelData* a_mdlData_p = getNpcMdlDataP(param_1); diff --git a/src/d/actor/d_a_npc_cdn3.cpp b/src/d/actor/d_a_npc_cdn3.cpp index 8d63fa1347..1b9ee8c6f3 100644 --- a/src/d/actor/d_a_npc_cdn3.cpp +++ b/src/d/actor/d_a_npc_cdn3.cpp @@ -10,7 +10,7 @@ #include "d/d_s_play.h" #include -const daNpcCdn3_c::ActionPair daNpcCdn3_c::ActionTable[8] = { +DUSK_GAME_DATA const daNpcCdn3_c::ActionPair daNpcCdn3_c::ActionTable[8] = { {&daNpcCdn3_c::initWait, &daNpcCdn3_c::executeWait}, {&daNpcCdn3_c::initPath, &daNpcCdn3_c::executePath}, {&daNpcCdn3_c::initTalk, &daNpcCdn3_c::executeTalk}, @@ -1500,7 +1500,7 @@ inline int daNpcCdn3_c::draw() { return 1; } -daNpcCdn3_c::seqFunc* daNpcCdn3_c::m_funcTbl[44] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc* daNpcCdn3_c::m_funcTbl[44] = { m_seq00_funcTbl, m_seq01_funcTbl, m_seq02_funcTbl, m_seq03_funcTbl, m_seq04_funcTbl, m_seq05_funcTbl, @@ -1525,25 +1525,25 @@ daNpcCdn3_c::seqFunc* daNpcCdn3_c::m_funcTbl[44] = { m_seq42_funcTbl, m_seq43_funcTbl, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq00_funcTbl[2] = {&daNpcCdn3_c::walka, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq00_funcTbl[2] = {&daNpcCdn3_c::walka, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq01_funcTbl[2] = {&daNpcCdn3_c::runa, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq01_funcTbl[2] = {&daNpcCdn3_c::runa, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq02_funcTbl[2] = {&daNpcCdn3_c::waita, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq02_funcTbl[2] = {&daNpcCdn3_c::waita, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq03_funcTbl[2] = {&daNpcCdn3_c::talka, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq03_funcTbl[2] = {&daNpcCdn3_c::talka, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq04_funcTbl[2] = {&daNpcCdn3_c::runb, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq04_funcTbl[2] = {&daNpcCdn3_c::runb, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq05_funcTbl[4] = {&daNpcCdn3_c::turnr, &daNpcCdn3_c::waita, +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq05_funcTbl[4] = {&daNpcCdn3_c::turnr, &daNpcCdn3_c::waita, &daNpcCdn3_c::talka, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq06_funcTbl[4] = {&daNpcCdn3_c::turnl, &daNpcCdn3_c::waita, +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq06_funcTbl[4] = {&daNpcCdn3_c::turnl, &daNpcCdn3_c::waita, &daNpcCdn3_c::talka, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq07_funcTbl[2] = {&daNpcCdn3_c::waitwall, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq07_funcTbl[2] = {&daNpcCdn3_c::waitwall, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq08_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq08_funcTbl[7] = { &daNpcCdn3_c::talkwall, &daNpcCdn3_c::waitwall, &daNpcCdn3_c::talkbwall, @@ -1553,25 +1553,25 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq08_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq09_funcTbl[2] = {&daNpcCdn3_c::talkb, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq09_funcTbl[2] = {&daNpcCdn3_c::talkb, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq10_funcTbl[2] = {&daNpcCdn3_c::talkc, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq10_funcTbl[2] = {&daNpcCdn3_c::talkc, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq11_funcTbl[6] = {&daNpcCdn3_c::talka, &daNpcCdn3_c::waita, +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq11_funcTbl[6] = {&daNpcCdn3_c::talka, &daNpcCdn3_c::waita, &daNpcCdn3_c::talkb, &daNpcCdn3_c::waitb, &daNpcCdn3_c::talkc, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq12_funcTbl[2] = {&daNpcCdn3_c::waitb, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq12_funcTbl[2] = {&daNpcCdn3_c::waitb, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq13_funcTbl[6] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq13_funcTbl[6] = { &daNpcCdn3_c::browsea, &daNpcCdn3_c::browseb, &daNpcCdn3_c::talka, &daNpcCdn3_c::talkb, &daNpcCdn3_c::waita, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq14_funcTbl[2] = {&daNpcCdn3_c::walkb, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq14_funcTbl[2] = {&daNpcCdn3_c::walkb, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq15_funcTbl[2] = {&daNpcCdn3_c::sitwaita, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq15_funcTbl[2] = {&daNpcCdn3_c::sitwaita, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq16_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq16_funcTbl[7] = { &daNpcCdn3_c::sittalka, &daNpcCdn3_c::sitwaita, &daNpcCdn3_c::sittalkab, @@ -1581,14 +1581,14 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq16_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq17_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq17_funcTbl[2] = { &daNpcCdn3_c::playm, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq18_funcTbl[2] = {&daNpcCdn3_c::sitwaitb, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq18_funcTbl[2] = {&daNpcCdn3_c::sitwaitb, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq19_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq19_funcTbl[7] = { &daNpcCdn3_c::sittalkb, &daNpcCdn3_c::sitwaitb, &daNpcCdn3_c::sittalkbb, @@ -1598,14 +1598,14 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq19_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq20_funcTbl[2] = {&daNpcCdn3_c::looka, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq20_funcTbl[2] = {&daNpcCdn3_c::looka, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq21_funcTbl[2] = {&daNpcCdn3_c::lookb, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq21_funcTbl[2] = {&daNpcCdn3_c::lookb, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq22_funcTbl[4] = {&daNpcCdn3_c::looka, &daNpcCdn3_c::lookb, +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq22_funcTbl[4] = {&daNpcCdn3_c::looka, &daNpcCdn3_c::lookb, &daNpcCdn3_c::waita, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq23_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq23_funcTbl[7] = { &daNpcCdn3_c::talka, &daNpcCdn3_c::waita, &daNpcCdn3_c::talkb, @@ -1615,11 +1615,11 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq23_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq24_funcTbl[5] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq24_funcTbl[5] = { &daNpcCdn3_c::talkb, &daNpcCdn3_c::talka, &daNpcCdn3_c::talkc, &daNpcCdn3_c::waita, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq25_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq25_funcTbl[7] = { &daNpcCdn3_c::browsea, &daNpcCdn3_c::browseb, &daNpcCdn3_c::talka, @@ -1629,37 +1629,37 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq25_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq26_funcTbl[3] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq26_funcTbl[3] = { &daNpcCdn3_c::browsea, &daNpcCdn3_c::browseb, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq27_funcTbl[2] = {&daNpcCdn3_c::dance, NULL}; +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq27_funcTbl[2] = {&daNpcCdn3_c::dance, NULL}; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq28_funcTbl[3] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq28_funcTbl[3] = { &daNpcCdn3_c::ladytalka, &daNpcCdn3_c::normtalka, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq29_funcTbl[3] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq29_funcTbl[3] = { &daNpcCdn3_c::ladytalkb, &daNpcCdn3_c::normtalkb, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq30_funcTbl[6] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq30_funcTbl[6] = { &daNpcCdn3_c::talka, &daNpcCdn3_c::ladytalka, &daNpcCdn3_c::waita, &daNpcCdn3_c::talkb, &daNpcCdn3_c::waita, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq31_funcTbl[6] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq31_funcTbl[6] = { &daNpcCdn3_c::waita, &daNpcCdn3_c::ladytalkb, &daNpcCdn3_c::talka, &daNpcCdn3_c::waita, &daNpcCdn3_c::talkb, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq32_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq32_funcTbl[7] = { &daNpcCdn3_c::talka, &daNpcCdn3_c::ladytalka, &daNpcCdn3_c::waita, @@ -1669,7 +1669,7 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq32_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq33_funcTbl[7] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq33_funcTbl[7] = { &daNpcCdn3_c::waita, &daNpcCdn3_c::ladytalkb, &daNpcCdn3_c::talka, @@ -1679,50 +1679,50 @@ daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq33_funcTbl[7] = { NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq34_funcTbl[9] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq34_funcTbl[9] = { &daNpcCdn3_c::talka, &daNpcCdn3_c::ladytalka, &daNpcCdn3_c::ladytalkb, &daNpcCdn3_c::waita, &daNpcCdn3_c::talkb, &daNpcCdn3_c::waita, &daNpcCdn3_c::normtalka, &daNpcCdn3_c::normtalkb, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq35_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq35_funcTbl[2] = { &daNpcCdn3_c::sellme, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq36_funcTbl[4] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq36_funcTbl[4] = { &daNpcCdn3_c::ladytalkb, &daNpcCdn3_c::talka, &daNpcCdn3_c::waita, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq37_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq37_funcTbl[2] = { &daNpcCdn3_c::sing, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq38_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq38_funcTbl[2] = { &daNpcCdn3_c::sittalka, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq39_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq39_funcTbl[2] = { &daNpcCdn3_c::sittalkab, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq40_funcTbl[3] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq40_funcTbl[3] = { &daNpcCdn3_c::sittalka, &daNpcCdn3_c::sittalkab, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq41_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq41_funcTbl[2] = { &daNpcCdn3_c::sittalkb, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq42_funcTbl[2] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq42_funcTbl[2] = { &daNpcCdn3_c::sittalkbb, NULL, }; -daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq43_funcTbl[3] = { +DUSK_GAME_DATA daNpcCdn3_c::seqFunc daNpcCdn3_c::m_seq43_funcTbl[3] = { &daNpcCdn3_c::sittalkb, &daNpcCdn3_c::sittalkbb, NULL, }; @@ -1747,7 +1747,7 @@ static int daNpcCdn3_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcCdn3_METHODS = { +static DUSK_CONST actor_method_class daNpcCdn3_METHODS = { (process_method_func)daNpcCdn3_Create, (process_method_func)daNpcCdn3_Delete, (process_method_func)daNpcCdn3_Execute, @@ -1755,7 +1755,7 @@ static actor_method_class daNpcCdn3_METHODS = { (process_method_func)daNpcCdn3_Draw, }; -actor_process_profile_definition g_profile_NPC_CD3 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_CD3 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_chat.cpp b/src/d/actor/d_a_npc_chat.cpp index 39ebb0313c..e9f4412b8c 100644 --- a/src/d/actor/d_a_npc_chat.cpp +++ b/src/d/actor/d_a_npc_chat.cpp @@ -795,7 +795,7 @@ enum Type { /* 0x1D */ MdlWANb2_e, }; -static char* const l_resMANa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMANa[6] = { "MAN_a", "MAN_a_TW", "Mgeneral", @@ -804,7 +804,7 @@ static char* const l_resMANa[6] = { "objectTW", }; -static char* const l_resMADa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMADa[6] = { "MAD_a", "MAD_a_TW", "Mgeneral", @@ -813,7 +813,7 @@ static char* const l_resMADa[6] = { "objectTW", }; -static char* const l_resMCNa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMCNa[6] = { "MCN_a", "MCN_a_TW", "Mgeneral", @@ -822,7 +822,7 @@ static char* const l_resMCNa[6] = { "objectTW", }; -static char* const l_resMONa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMONa[6] = { "MON_a", "MON_a_TW", "Mgeneral", @@ -831,7 +831,7 @@ static char* const l_resMONa[6] = { "objectTW", }; -static char* const l_resMANb[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMANb[6] = { "MAN_b", "MAN_b_TW", "Mgeneral", @@ -840,7 +840,7 @@ static char* const l_resMANb[6] = { "objectTW", }; -static char* const l_resMANc[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMANc[6] = { "MAN_c", "MAN_c_TW", "Mgeneral", @@ -849,7 +849,7 @@ static char* const l_resMANc[6] = { "objectTW", }; -static char* const l_resMASa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMASa[6] = { "MAS_a", "MAS_a_TW", "Mgeneral", @@ -858,7 +858,7 @@ static char* const l_resMASa[6] = { "objectTW", }; -static char* const l_resMBNa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMBNa[6] = { "MBN_a", "MBN_a_TW", "Mgeneral", @@ -867,7 +867,7 @@ static char* const l_resMBNa[6] = { "objectTW", }; -static char* const l_resMANa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMANa2[6] = { "MAN_a2", "MAN_a2_TW", "Mgeneral", @@ -876,7 +876,7 @@ static char* const l_resMANa2[6] = { "objectTW", }; -static char* const l_resMADa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMADa2[6] = { "MAD_a2", "MAD_a2_TW", "Mgeneral", @@ -885,7 +885,7 @@ static char* const l_resMADa2[6] = { "objectTW", }; -static char* const l_resMCNa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMCNa2[6] = { "MCN_a2", "MCN_a2_TW", "Mgeneral", @@ -894,7 +894,7 @@ static char* const l_resMCNa2[6] = { "objectTW", }; -static char* const l_resMONa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMONa2[6] = { "MON_a2", "MON_a2_TW", "Mgeneral", @@ -903,7 +903,7 @@ static char* const l_resMONa2[6] = { "objectTW", }; -static char* const l_resMANb2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMANb2[6] = { "MAN_b2", "MAN_b2_TW", "Mgeneral", @@ -912,7 +912,7 @@ static char* const l_resMANb2[6] = { "objectTW", }; -static char* const l_resMANc2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMANc2[6] = { "MAN_c2", "MAN_c2_TW", "Mgeneral", @@ -921,7 +921,7 @@ static char* const l_resMANc2[6] = { "objectTW", }; -static char* const l_resMASa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMASa2[6] = { "MAS_a2", "MAS_a2_TW", "Mgeneral", @@ -930,7 +930,7 @@ static char* const l_resMASa2[6] = { "objectTW", }; -static char* const l_resMBNa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMBNa2[6] = { "MBN_a2", "MBN_a2_TW", "Mgeneral", @@ -939,7 +939,7 @@ static char* const l_resMBNa2[6] = { "objectTW", }; -static char* const l_resWANa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWANa[6] = { "WAN_a", "WAN_a_TW", "Wgeneral", @@ -948,7 +948,7 @@ static char* const l_resWANa[6] = { "objectTW", }; -static char* const l_resWADa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWADa[6] = { "WAD_a", "WAD_a_TW", "Wgeneral", @@ -957,7 +957,7 @@ static char* const l_resWADa[6] = { "objectTW", }; -static char* const l_resMATa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMATa[6] = { "MAT_a", "MAT_a_TW", "Wgeneral", @@ -966,7 +966,7 @@ static char* const l_resMATa[6] = { "objectTW", }; -static char* const l_resWCNa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWCNa[6] = { "WCN_a", "WCN_a_TW", "Wgeneral", @@ -975,7 +975,7 @@ static char* const l_resWCNa[6] = { "objectTW", }; -static char* const l_resWONa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWONa[6] = { "WON_a", "WON_a_TW", "Wgeneral", @@ -984,7 +984,7 @@ static char* const l_resWONa[6] = { "objectTW", }; -static char* const l_resWGNa[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWGNa[6] = { "WGN_a", "WGN_a_TW", "Wgeneral", @@ -993,7 +993,7 @@ static char* const l_resWGNa[6] = { "objectTW", }; -static char* const l_resWANb[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWANb[6] = { "WAN_b", "WAN_b_TW", "Wgeneral", @@ -1002,7 +1002,7 @@ static char* const l_resWANb[6] = { "objectTW", }; -static char* const l_resWANa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWANa2[6] = { "WAN_a2", "WAN_a2_TW", "Wgeneral", @@ -1011,7 +1011,7 @@ static char* const l_resWANa2[6] = { "objectTW", }; -static char* const l_resWADa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWADa2[6] = { "WAD_a2", "WAD_a2_TW", "Wgeneral", @@ -1020,7 +1020,7 @@ static char* const l_resWADa2[6] = { "objectTW", }; -static char* const l_resMATa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resMATa2[6] = { "MAT_a2", "MAT_a2_TW", "Wgeneral", @@ -1029,7 +1029,7 @@ static char* const l_resMATa2[6] = { "objectTW", }; -static char* const l_resWCNa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWCNa2[6] = { "WCN_a2", "WCN_a2_TW", "Wgeneral", @@ -1038,7 +1038,7 @@ static char* const l_resWCNa2[6] = { "objectTW", }; -static char* const l_resWONa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWONa2[6] = { "WON_a2", "WON_a2_TW", "Wgeneral", @@ -1047,7 +1047,7 @@ static char* const l_resWONa2[6] = { "objectTW", }; -static char* const l_resWGNa2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWGNa2[6] = { "WGN_a2", "WGN_a2_TW", "Wgeneral", @@ -1056,7 +1056,7 @@ static char* const l_resWGNa2[6] = { "objectTW", }; -static char* const l_resWANb2[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* const l_resWANb2[6] = { "WAN_b2", "WAN_b2_TW", "Wgeneral", @@ -1065,7 +1065,7 @@ static char* const l_resWANb2[6] = { "objectTW", }; -static char* const* l_resNameTbl[30] = { +static DUSK_CONSTEXPR char DUSK_CONST* const* l_resNameTbl[30] = { l_resMANa, l_resMADa, l_resMCNa, l_resMONa, l_resMANb, l_resMANc, l_resMASa, l_resMBNa, l_resMANa2, l_resMADa2, l_resMCNa2, l_resMONa2, @@ -1077,11 +1077,11 @@ static char* const* l_resNameTbl[30] = { }; struct anmTblPrm { - char* arc_name; + DUSK_CONST char* arc_name; int resource_index; }; - static anmTblPrm l_bmdTbl[30] = { + static DUSK_CONSTEXPR anmTblPrm l_bmdTbl[30] = { l_resMANa[0], BMDR_MAN_A, l_resMADa[0], BMDR_MAD_A, l_resMCNa[0], BMDR_MCN_A, @@ -1114,7 +1114,7 @@ struct anmTblPrm { l_resWANb2[0], BMDR_WAN_B2, }; -static anmTblPrm l_bmdTWTbl[30] = { +static DUSK_CONSTEXPR anmTblPrm l_bmdTWTbl[30] = { l_resMANa[1], BMDR_MAN_A_TW, l_resMADa[1], BMDR_MAD_A_TW, l_resMCNa[1], BMDR_MCN_A_TW, @@ -1147,7 +1147,7 @@ static anmTblPrm l_bmdTWTbl[30] = { l_resWANb2[1], BMDR_WAN_B2_TW, }; -static anmTblPrm l_btpTbl[30] = { +static DUSK_CONSTEXPR anmTblPrm l_btpTbl[30] = { l_resMANa[0], -1, l_resMADa[0], -1, l_resMCNa[0], BTP_MCN_A, @@ -1180,7 +1180,7 @@ static anmTblPrm l_btpTbl[30] = { l_resWANb2[0], BTP_WAN_B2, }; -static anmTblPrm l_btpTWTbl[30] = { +static DUSK_CONSTEXPR anmTblPrm l_btpTWTbl[30] = { l_resMANa[1], -1, l_resMADa[1], -1, l_resMCNa[1], BTP_MCN_A_TW, @@ -1213,7 +1213,7 @@ static anmTblPrm l_btpTWTbl[30] = { l_resWANb2[1], BTP_WAN_B2_TW, }; -static anmTblPrm l_bckTbl_M[54] = { +static DUSK_CONSTEXPR anmTblPrm l_bckTbl_M[54] = { {"Mgeneral", BCK_M_WAIT_A}, {"Mgeneral", BCK_M_WAIT_B}, {"Mgeneral", BCK_M_WALK_A}, @@ -1270,7 +1270,7 @@ static anmTblPrm l_bckTbl_M[54] = { {"Mgeneral", BCK_M_SING}, }; -static anmTblPrm l_bckTbl_W[54] = { +static DUSK_CONSTEXPR anmTblPrm l_bckTbl_W[54] = { {"Wgeneral", BCK_W_WAIT_A}, {"Wgeneral", BCK_W_WAIT_B}, {"Wgeneral", BCK_W_WALK_A}, @@ -1342,7 +1342,7 @@ struct jntTblWPrm { /* 0x0 */ jnt jntPrm[21]; }; -static jntTblMPrm a_jntTbl_M[16] = { +static DUSK_CONSTEXPR jntTblMPrm a_jntTbl_M[16] = { { 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, @@ -1712,7 +1712,7 @@ struct prmTbl { /* 0x3C */ f32 field_0x3c; }; -static prmTbl a_prmTbl_M[16] = { +static DUSK_CONSTEXPR prmTbl a_prmTbl_M[16] = { -852593.0f, 0xB9, 0xB0, 0xD8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xA0, 0x3A, 0x98, 0xE0, 0xC0, 0xC5, 0x68, 1.0f, 0xC8, 0x00, 0x00, 1.5f, 1.8f, 16.0f, 6.0f, 180.0f, 30.0f, 50.1f, 35.0f, @@ -1778,7 +1778,7 @@ static prmTbl a_prmTbl_M[16] = { 1.5f, 1.8f, 16.0f, 6.0f, 180.0f, 30.0f, 50.1f, 35.0f, }; -static jntTblWPrm a_jntTbl_W[14] = { +static DUSK_CONSTEXPR jntTblWPrm a_jntTbl_W[14] = { { 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, @@ -2116,7 +2116,7 @@ static jntTblWPrm a_jntTbl_W[14] = { }, }; -static prmTbl a_prmTbl_W[14] = { +static DUSK_CONSTEXPR prmTbl a_prmTbl_W[14] = { -852593.0f, 0xB9, 0xB0, 0xD8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xA0, 0x3A, 0x98, 0xE0, 0xC0, 0xC5, 0x68, 1.0f, 0xC8, 0x00, 0x00, 1.4f, 1.5f, 10.0f, 4.0f, 180.0f, 30.0f, 50.1f, 35.0f, @@ -2174,19 +2174,19 @@ static prmTbl a_prmTbl_W[14] = { 1.5f, 1.6f, 10.0f, 4.4f, 180.0f, 30.0f, 50.1f, 35.0f, }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL, }; -static char* l_myName = "Chat"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Chat"; static NPC_CHAT_HIO_CLASS l_HIO; -daNpcChat_c::eventFunc daNpcChat_c::mEvtSeqList[1] = { +DUSK_GAME_DATA daNpcChat_c::eventFunc DUSK_CONST daNpcChat_c::mEvtSeqList[1] = { NULL, }; -static anmTblPrm const l_objTbl[13] = { +static DUSK_CONSTEXPR anmTblPrm const l_objTbl[13] = { {"object", BMDR_B_TUBO}, {"object", BMDR_B_TUBO}, {"object", BMDR_B_SPEAR}, @@ -2202,7 +2202,7 @@ static anmTblPrm const l_objTbl[13] = { {"object", BMDR_MARO_BAG_W}, }; -static anmTblPrm const l_objTWTbl[13] = { +static DUSK_CONSTEXPR anmTblPrm const l_objTWTbl[13] = { {"objectTW", BMDR_B_TUBO_TW}, {"objectTW", BMDR_B_TUBO_TW}, {"objectTW", BMDR_B_SPEAR_TW}, @@ -2218,7 +2218,7 @@ static anmTblPrm const l_objTWTbl[13] = { {"objectTW", -1}, }; -daNpcChat_HIOParam const daNpcChat_Param_c::m = { +DUSK_GAME_DATA daNpcChat_HIOParam const daNpcChat_Param_c::m = { 55.0f, -3.0f, 1.0f, @@ -3448,7 +3448,7 @@ void daNpcChat_c::setMotionAnm(int i_index, f32 i_morf) { } int resIdx; - char* arcName; + DUSK_CONST char* arcName; if (isM_()) { arcName = l_bckTbl_M[index].arc_name; resIdx = l_bckTbl_M[index].resource_index; @@ -4135,7 +4135,7 @@ static int daNpcChat_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpcChat_MethodTable = { +static DUSK_CONST actor_method_class daNpcChat_MethodTable = { (process_method_func)daNpcChat_Create, (process_method_func)daNpcChat_Delete, (process_method_func)daNpcChat_Execute, @@ -4143,7 +4143,7 @@ static actor_method_class daNpcChat_MethodTable = { (process_method_func)daNpcChat_Draw, }; -actor_process_profile_definition g_profile_NPC_CHAT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_CHAT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_chin.cpp b/src/d/actor/d_a_npc_chin.cpp index bd1a4731d4..f31cac9822 100644 --- a/src/d/actor/d_a_npc_chin.cpp +++ b/src/d/actor/d_a_npc_chin.cpp @@ -26,7 +26,7 @@ static s16 const sLoadResPat_Normal[6] = {0, 1, 2, 4, 5, -1}; static s16 const sLoadResPat_Tw[3] = {0, 3, -1}; -daNpcChin_HIOParam const daNpcChin_Param_c::m = { +DUSK_GAME_DATA daNpcChin_HIOParam const daNpcChin_Param_c::m = { 40.0f, -3.0f, 1.0f, 400.0f, 255.0f, 130.0f, 35.0f, 30.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f, @@ -37,7 +37,7 @@ daNpcChin_HIOParam const daNpcChin_Param_c::m = { FALSE, FALSE, }; -static daNpc_GetParam2 l_bckGetParamList[33] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[33] = { {-1, 2, 0}, {8, 0, 0}, {7, 0, 0}, @@ -73,7 +73,7 @@ static daNpc_GetParam2 l_bckGetParamList[33] = { {29, 2, 1}, }; -static daNpc_GetParam2 l_btpGetParamList[15] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[15] = { {18, 2, 0}, {20, 0, 0}, {19, 0, 0}, @@ -91,7 +91,7 @@ static daNpc_GetParam2 l_btpGetParamList[15] = { {50, 2, 1}, }; -static daNpc_GetParam2 l_btkGetParamList[9] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[9] = { {13, 2, 0}, {14, 0, 0}, {15, 2, 0}, @@ -103,7 +103,7 @@ static daNpc_GetParam2 l_btkGetParamList[9] = { {7, 2, 5}, }; -static char* l_arcNames[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[6] = { "Chin", "chin1", "chin_mdl", @@ -117,7 +117,7 @@ static s16* sLoadResInfo[2] = { (s16*)sLoadResPat_Tw, }; -static char* l_evtNames[8] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[8] = { NULL, "GAME_START", "GAME_FAILED", @@ -130,7 +130,7 @@ static char* l_evtNames[8] = { static u8 lit_3861[12]; -daNpcChin_c::eventFunc daNpcChin_c::mEvtSeqList[8] = { +DUSK_GAME_DATA daNpcChin_c::eventFunc daNpcChin_c::mEvtSeqList[8] = { NULL, &daNpcChin_c::_Evt_GameStart, &daNpcChin_c::_Evt_GameFailed, @@ -143,7 +143,7 @@ daNpcChin_c::eventFunc daNpcChin_c::mEvtSeqList[8] = { static NPC_CHIN_HIO_CLASS l_HIO; -static char* l_myName = "chin"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "chin"; #if DEBUG daNpcChin_HIO_c::daNpcChin_HIO_c() { @@ -2114,7 +2114,7 @@ static int daNpcChin_IsDelete(void* param_0) { return TRUE; } -static actor_method_class daNpcChin_MethodTable = { +static DUSK_CONST actor_method_class daNpcChin_MethodTable = { (process_method_func)daNpcChin_Create, (process_method_func)daNpcChin_Delete, (process_method_func)daNpcChin_Execute, @@ -2122,7 +2122,7 @@ static actor_method_class daNpcChin_MethodTable = { (process_method_func)daNpcChin_Draw, }; -actor_process_profile_definition g_profile_NPC_CHIN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_CHIN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_clerka.cpp b/src/d/actor/d_a_npc_clerka.cpp index b127f591c4..16fb887636 100644 --- a/src/d/actor/d_a_npc_clerka.cpp +++ b/src/d/actor/d_a_npc_clerka.cpp @@ -9,7 +9,7 @@ #include "d/d_msg_object.h" #include -const daNpc_clerkA_HIOParam daNpc_clerkA_Param_c::m = { +DUSK_GAME_DATA const daNpc_clerkA_HIOParam daNpc_clerkA_Param_c::m = { 220.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -69,55 +69,55 @@ void daNpc_clerkA_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {19, 1}, }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "clerkA", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {-1, 0, 0, 25, 2, 1, 1}, {6, 0, 1, 26, 0, 1, 0}, {7, 0, 1, 27, 0, 1, 0}, {8, 0, 1, 28, 0, 1, 0}, {9, 2, 1, 29, 2, 1, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[7] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[7] = { {15, 2, 1, 22, 0, 1, 1, 0}, {16, 2, 1, 22, 0, 1, 1, 0}, {10, 0, 1, 22, 0, 1, 1, 0}, {11, 0, 1, 22, 0, 1, 1, 0}, {12, 0, 1, 22, 0, 1, 1, 0}, {13, 0, 1, 22, 0, 1, 1, 0}, {14, 0, 1, 22, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {4, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[28] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[28] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -9, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_clerkA_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_clerkA_c::mCutNameList[1] = {""}; -daNpc_clerkA_c::cutFunc daNpc_clerkA_c::mCutList[1] = {NULL}; +DUSK_GAME_DATA daNpc_clerkA_c::cutFunc DUSK_CONST daNpc_clerkA_c::mCutList[1] = {NULL}; daNpc_clerkA_c::~daNpc_clerkA_c() { deleteObject(); @@ -783,13 +783,13 @@ static int daNpc_clerkA_IsDelete(void* i_this) { static NPC_CLERKA_HIO_CLASS l_HIO; -static actor_method_class daNpc_clerkA_MethodTable = { +static DUSK_CONST actor_method_class daNpc_clerkA_MethodTable = { (process_method_func)daNpc_clerkA_Create, (process_method_func)daNpc_clerkA_Delete, (process_method_func)daNpc_clerkA_Execute, (process_method_func)daNpc_clerkA_IsDelete, (process_method_func)daNpc_clerkA_Draw, }; -actor_process_profile_definition g_profile_NPC_CLERKA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_CLERKA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_clerkb.cpp b/src/d/actor/d_a_npc_clerkb.cpp index 8b3f89aba6..38c75135f6 100644 --- a/src/d/actor/d_a_npc_clerkb.cpp +++ b/src/d/actor/d_a_npc_clerkb.cpp @@ -9,7 +9,7 @@ #include "d/d_msg_object.h" #include -const daNpc_clerkB_HIOParam daNpc_clerkB_Param_c::m = { +DUSK_GAME_DATA const daNpc_clerkB_HIOParam daNpc_clerkB_Param_c::m = { 220.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -70,41 +70,41 @@ void daNpc_clerkB_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {26, 1}, }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "clerkB", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[9] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[9] = { {-1, 0, 0, 35, 2, 1, 1}, {12, 0, 1, 40, 0, 1, 0}, {8, 0, 1, 36, 0, 1, 0}, {10, 0, 1, 38, 0, 1, 0}, {11, 0, 1, 39, 0, 1, 0}, {9, 0, 1, 37, 0, 1, 0}, {14, 2, 1, 42, 2, 1, 0}, {15, 2, 1, 43, 2, 1, 0}, {13, 2, 1, 35, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[9] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[9] = { {23, 2, 1, 32, 0, 1, 1, 0}, {22, 2, 1, 32, 0, 1, 1, 0}, {20, 2, 1, 32, 0, 1, 1, 0}, {7, 0, 1, 32, 0, 1, 1, 0}, {21, 0, 1, 32, 0, 1, 1, 0}, {17, 2, 1, 32, 0, 1, 1, 0}, {16, 2, 1, 32, 0, 1, 1, 0}, {19, 0, 1, 32, 0, 1, 1, 0}, {18, 0, 1, 32, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {6, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {8, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -112,7 +112,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {0, -9, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -9, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, 0, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, 0, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -120,9 +120,9 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {8, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_clerkB_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_clerkB_c::mCutNameList[1] = {""}; -daNpc_clerkB_c::cutFunc daNpc_clerkB_c::mCutList[1] = {NULL}; +DUSK_GAME_DATA daNpc_clerkB_c::cutFunc DUSK_CONST daNpc_clerkB_c::mCutList[1] = {NULL}; daNpc_clerkB_c::~daNpc_clerkB_c() { deleteObject(); @@ -935,13 +935,13 @@ static int daNpc_clerkB_IsDelete(void* i_this) { static NPC_CLERKB_HIO_CLASS l_HIO; -static actor_method_class daNpc_clerkB_MethodTable = { +static DUSK_CONST actor_method_class daNpc_clerkB_MethodTable = { (process_method_func)daNpc_clerkB_Create, (process_method_func)daNpc_clerkB_Delete, (process_method_func)daNpc_clerkB_Execute, (process_method_func)daNpc_clerkB_IsDelete, (process_method_func)daNpc_clerkB_Draw, }; -actor_process_profile_definition g_profile_NPC_CLERKB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_CLERKB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_clerkt.cpp b/src/d/actor/d_a_npc_clerkt.cpp index b15322a6e2..f305a5f8a3 100644 --- a/src/d/actor/d_a_npc_clerkt.cpp +++ b/src/d/actor/d_a_npc_clerkt.cpp @@ -9,7 +9,7 @@ #include "d/d_msg_object.h" #include -const daNpcClerkt_HIOParam daNpcClerkt_Param_c::m = { +DUSK_GAME_DATA const daNpcClerkt_HIOParam daNpcClerkt_Param_c::m = { 120.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -67,50 +67,50 @@ void daNpcClerkt_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {12, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"DEFAULT_GETITEM", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Tkj", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, 0, 0, 18, 2, 1, 1}, {6, 0, 1, 18, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {9, 2, 1, 15, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpcClerkT_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpcClerkT_c::mCutNameList[1] = {""}; -daNpcClerkT_c::cutFunc daNpcClerkT_c::mCutList[1] = {NULL}; +DUSK_GAME_DATA daNpcClerkT_c::cutFunc DUSK_CONST daNpcClerkT_c::mCutList[1] = {NULL}; daNpcClerkT_c::~daNpcClerkT_c() { deleteObject(); @@ -696,13 +696,13 @@ void daNpcClerkT_c::setCollision() { static NPC_CLERKT_HIO_CLASS l_HIO; -static actor_method_class daNpcClerkt_MethodTable = { +static DUSK_CONST actor_method_class daNpcClerkt_MethodTable = { (process_method_func)daNpcClerkt_Create, (process_method_func)daNpcClerkt_Delete, (process_method_func)daNpcClerkt_Execute, (process_method_func)daNpcClerkt_IsDelete, (process_method_func)daNpcClerkt_Draw, }; -actor_process_profile_definition g_profile_NPC_CLERKT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_CLERKT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_coach.cpp b/src/d/actor/d_a_npc_coach.cpp index 51a5019088..5b395f38c8 100644 --- a/src/d/actor/d_a_npc_coach.cpp +++ b/src/d/actor/d_a_npc_coach.cpp @@ -200,7 +200,7 @@ static int jointRearWheelCallBack(J3DJoint* i_joint, int param_2) { return 1; } -daNpcCoach_Attr_c const daNpcCoach_c::M_attr = { +DUSK_GAME_DATA daNpcCoach_Attr_c const daNpcCoach_c::M_attr = { -3.0f, -200.0f, -0.25f, @@ -423,7 +423,7 @@ static void* s_sub(void* i_actor, void* i_data) { } void daNpcCoach_c::initCollision() { - static dCcD_SrcCyl const ccCylSrc = { + static DUSK_CONSTEXPR dCcD_SrcCyl const ccCylSrc = { { {0, {{0, 0, 0}, {0x2420, 0x11}, 0x79}}, {dCcD_SE_NONE, 0, 0, 0, 0}, @@ -437,7 +437,7 @@ void daNpcCoach_c::initCollision() { } }; - static dCcD_SrcSph const ccSphSrc = { + static DUSK_CONSTEXPR dCcD_SrcSph const ccSphSrc = { { {0, {{0, 0, 0}, {0x10000, 0x11}, 0}}, {dCcD_SE_NONE, 0, 0, 0, 0}, @@ -570,9 +570,9 @@ static int createSolidHeap(fopAc_ac_c* a_this) { return i_this->createHeap(); } -static char* l_arcName = "Coach"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Coach"; -static struct { +static DUSK_CONSTEXPR struct { int field_0x0; f32 field_0x4; f32 field_0x8; @@ -2166,7 +2166,7 @@ void daNpcCoach_c::initCoachBlazing() { daNpcCoach_c::daNpcCoach_c() {} -static actor_method_class l_daNpcCoach_Method = { +static DUSK_CONST actor_method_class l_daNpcCoach_Method = { (process_method_func)daNpcCoach_Create, (process_method_func)daNpcCoach_Delete, (process_method_func)daNpcCoach_Execute, @@ -2174,7 +2174,7 @@ static actor_method_class l_daNpcCoach_Method = { (process_method_func)daNpcCoach_Draw, }; -actor_process_profile_definition g_profile_NPC_COACH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_COACH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_df.cpp b/src/d/actor/d_a_npc_df.cpp index 545cb04ff1..dc3d44eaef 100644 --- a/src/d/actor/d_a_npc_df.cpp +++ b/src/d/actor/d_a_npc_df.cpp @@ -413,7 +413,7 @@ static cPhs_Step daNpc_Df_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daNpc_Df_Method = { +static DUSK_CONST actor_method_class l_daNpc_Df_Method = { (process_method_func)daNpc_Df_Create, (process_method_func)daNpc_Df_Delete, (process_method_func)daNpc_Df_Execute, @@ -421,7 +421,7 @@ static actor_method_class l_daNpc_Df_Method = { (process_method_func)daNpc_Df_Draw, }; -actor_process_profile_definition g_profile_NPC_DF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_DF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_doc.cpp b/src/d/actor/d_a_npc_doc.cpp index c752b5f4c5..f75b4d4189 100644 --- a/src/d/actor/d_a_npc_doc.cpp +++ b/src/d/actor/d_a_npc_doc.cpp @@ -9,34 +9,34 @@ #include "Z2AudioLib/Z2Instances.h" #include -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {14, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Doc", "Doc1", }; -static s8 l_loadResPtrn0[] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[] = { 1, 2, -1, }; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, 0, 0, 20, 2, 1, 1}, {6, 0, 1, 20, 2, 1, 1}, {9, 0, 2, 34, 0, 2, 0}, @@ -49,7 +49,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {8, 2, 2, 20, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[14] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[14] = { {11, 2, 1, 17, 0, 1, 1, 0}, {8, 0, 1, 17, 0, 1, 1, 0}, {7, 0, 1, 17, 0, 1, 1, 0}, @@ -66,7 +66,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[14] = { {6, 2, 2, 25, 2, 2, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {3, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {3, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {6, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -74,7 +74,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[52] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[52] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {4, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 1}, {10, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -84,13 +84,13 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[52] = { {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Doc_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Doc_c::mCutNameList[1] = {""}; -daNpc_Doc_c::cutFunc daNpc_Doc_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_Doc_c::cutFunc DUSK_CONST daNpc_Doc_c::mCutList[1] = { NULL, }; -const daNpc_Doc_HIOParam daNpc_Doc_Param_c::m = { +DUSK_GAME_DATA const daNpc_Doc_HIOParam daNpc_Doc_Param_c::m = { 140.0f, -3.0f, 1.0f, @@ -865,7 +865,7 @@ static int daNpc_Doc_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Doc_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Doc_MethodTable = { (process_method_func)daNpc_Doc_Create, (process_method_func)daNpc_Doc_Delete, (process_method_func)daNpc_Doc_Execute, @@ -873,7 +873,7 @@ static actor_method_class daNpc_Doc_MethodTable = { (process_method_func)daNpc_Doc_Draw, }; -actor_process_profile_definition g_profile_NPC_DOC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_DOC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_doorboy.cpp b/src/d/actor/d_a_npc_doorboy.cpp index 17ba417cd5..ca2983aa0c 100644 --- a/src/d/actor/d_a_npc_doorboy.cpp +++ b/src/d/actor/d_a_npc_doorboy.cpp @@ -93,7 +93,7 @@ enum Motion { /* 0xB */ MOT_SIT_TO_WOLF_A, }; -static daNpc_GetParam2 l_bckGetParamList[6] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[6] = { {BCK_M_WAIT_A, J3DFrameCtrl::EMode_LOOP, MGENERAL}, {BCK_M_TALK_A, J3DFrameCtrl::EMode_LOOP, MGENERAL}, {BCK_M_TALK_B, J3DFrameCtrl::EMode_LOOP, MGENERAL}, @@ -102,26 +102,26 @@ static daNpc_GetParam2 l_bckGetParamList[6] = { {BCK_M_SIT_TO_WOLF_A, J3DFrameCtrl::EMode_LOOP, MGENERAL}, }; -static daNpc_GetParam2 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[1] = { {BTP_DOORBOY, J3DFrameCtrl::EMode_LOOP, DOORBOY}, }; -static char* l_arcNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[2] = { "DoorBoy", "Mgeneral", }; -static char* l_evtNames[1] = {NULL}; +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = {NULL}; -static char* l_myName = "DoorBoy"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "DoorBoy"; static NPC_DOORBOY_HIO_CLASS l_HIO; -daNpcDoorBoy_c::EventFn daNpcDoorBoy_c::mEvtSeqList[1] = { +DUSK_GAME_DATA daNpcDoorBoy_c::EventFn DUSK_CONST daNpcDoorBoy_c::mEvtSeqList[1] = { NULL }; -daNpcDoorBoy_HIOParam const daNpcDoorBoy_Param_c::m = { +DUSK_GAME_DATA daNpcDoorBoy_HIOParam const daNpcDoorBoy_Param_c::m = { 55.0f, 0.0f, 1.0f, @@ -877,7 +877,7 @@ BOOL daNpcDoorBoy_c::drawDbgInfo() { return FALSE; } -static actor_method_class daNpcDoorBoy_MethodTable = { +static DUSK_CONST actor_method_class daNpcDoorBoy_MethodTable = { (process_method_func)daNpcDoorBoy_Create, (process_method_func)daNpcDoorBoy_Delete, (process_method_func)daNpcDoorBoy_Execute, @@ -885,7 +885,7 @@ static actor_method_class daNpcDoorBoy_MethodTable = { (process_method_func)daNpcDoorBoy_Draw, }; -actor_process_profile_definition g_profile_NPC_DOORBOY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_DOORBOY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_drainSol.cpp b/src/d/actor/d_a_npc_drainSol.cpp index 84fe3c9ca1..e8b3ca24b6 100644 --- a/src/d/actor/d_a_npc_drainSol.cpp +++ b/src/d/actor/d_a_npc_drainSol.cpp @@ -8,22 +8,22 @@ #include "d/actor/d_a_npc_drainSol.h" #include "d/actor/d_a_npc.h" -static int l_bmdGetParamList[] = { +static DUSK_CONSTEXPR int l_bmdGetParamList[] = { 9, 7 }; -static daNpc_GetParam3 l_bckGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_bckGetParamList[] = { {5, 2}, {4, 2}, {4, 0}, }; -static char* l_arcNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[2] = { "DrainSol1", "DrainSol2", }; -const daNpcDrSol_HIOParam daNpcDrSol_Param_c::m = { +DUSK_GAME_DATA const daNpcDrSol_HIOParam daNpcDrSol_Param_c::m = { 40.0f, 0.0f, 1.0f, @@ -453,11 +453,11 @@ BOOL daNpcDrSol_c::drawDbgInfo() { return false; } -static char* dummyString() { +static DUSK_CONSTEXPR char DUSK_CONST* dummyString() { return "Shoe"; }; -static actor_method_class daNpcDrSol_MethodTable = { +static DUSK_CONST actor_method_class daNpcDrSol_MethodTable = { (process_method_func)daNpcDrSol_Create, (process_method_func)daNpcDrSol_Delete, (process_method_func)daNpcDrSol_Execute, @@ -465,7 +465,7 @@ static actor_method_class daNpcDrSol_MethodTable = { (process_method_func)daNpcDrSol_Draw, }; -actor_process_profile_definition g_profile_NPC_DRSOL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_DRSOL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_du.cpp b/src/d/actor/d_a_npc_du.cpp index 3d2574604a..7b077b7b39 100644 --- a/src/d/actor/d_a_npc_du.cpp +++ b/src/d/actor/d_a_npc_du.cpp @@ -696,7 +696,7 @@ static cPhs_Step daNpc_Du_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daNpc_Du_Method = { +static DUSK_CONST actor_method_class l_daNpc_Du_Method = { (process_method_func)daNpc_Du_Create, (process_method_func)daNpc_Du_Delete, (process_method_func)daNpc_Du_Execute, @@ -704,7 +704,7 @@ static actor_method_class l_daNpc_Du_Method = { (process_method_func)daNpc_Du_Draw, }; -actor_process_profile_definition g_profile_NPC_DU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_DU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_fairy.cpp b/src/d/actor/d_a_npc_fairy.cpp index c228d969d5..5de667f237 100644 --- a/src/d/actor/d_a_npc_fairy.cpp +++ b/src/d/actor/d_a_npc_fairy.cpp @@ -145,7 +145,7 @@ enum Type { /* 0x4 */ TYPE_50F, }; -const daNpc_Fairy_HIOParam daNpc_Fairy_Param_c::m = { +DUSK_GAME_DATA const daNpc_Fairy_HIOParam daNpc_Fairy_Param_c::m = { 190.0f, -3.0f, 1.0f, @@ -251,25 +251,25 @@ BOOL _Fairy_Feather_c::create() { return TRUE; } -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "fairy", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[5] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[5] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDV_FAIRY, FAIRY}, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {-1, J3DFrameCtrl::EMode_NONE, NONE,BTP_FAIRY, J3DFrameCtrl::EMode_LOOP, FAIRY, 1}, {BCK_FAIRY_F_SAD, J3DFrameCtrl::EMode_LOOP, FAIRY, BTP_FAIRY_F_SAD, J3DFrameCtrl::EMode_LOOP, FAIRY, 1}, {BCK_FAIRY_F_SMILE, J3DFrameCtrl::EMode_NONE, FAIRY, BTP_FAIRY_F_SMILE, J3DFrameCtrl::EMode_NONE, FAIRY, 1}, @@ -277,7 +277,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {BCK_FAIRY_FH_SMILE, J3DFrameCtrl::EMode_LOOP, FAIRY, BTP_FAIRY, J3DFrameCtrl::EMode_LOOP, FAIRY, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[12] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[12] = { {BCK_FAIRY_WAIT, J3DFrameCtrl::EMode_LOOP, FAIRY, BTK_FAIRY, J3DFrameCtrl::EMode_LOOP, FAIRY, 1, 0}, {BCK_FAIRY_GO, J3DFrameCtrl::EMode_NONE, FAIRY, BTK_FAIRY, J3DFrameCtrl::EMode_LOOP, FAIRY, 1, 0}, {BCK_FAIRY_GOWAIT, J3DFrameCtrl::EMode_LOOP, FAIRY, BTK_FAIRY, J3DFrameCtrl::EMode_LOOP, FAIRY, 1, 0}, @@ -292,7 +292,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[12] = { {BCK_FAIRY_HOPPE_WAIT, J3DFrameCtrl::EMode_LOOP, FAIRY, BTK_FAIRY, J3DFrameCtrl::EMode_LOOP, FAIRY, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -300,7 +300,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -351,7 +351,7 @@ BOOL _Fairy_Feather_c::setAnm(int i_idx) { return TRUE; } - static daNpc_GetParam2 const sBckPrm[6] = { + static DUSK_CONSTEXPR daNpc_GetParam2 const sBckPrm[6] = { {BCK_FAIRY_HANE_NON, J3DFrameCtrl::EMode_LOOP, FAIRY}, {BCK_FAIRY_HANE_SYUTU, J3DFrameCtrl::EMode_NONE, FAIRY}, {BCK_FAIRY_HANE_SITWAIT, J3DFrameCtrl::EMode_LOOP, FAIRY}, @@ -383,7 +383,7 @@ BOOL _Fairy_Feather_c::setAnm(int i_idx) { } BOOL _Fairy_Feather_c::setBrk(int i_idx) { - static daNpc_GetParam2 const sBrkPrm[1] = { + static DUSK_CONSTEXPR daNpc_GetParam2 const sBrkPrm[1] = { {BRK_FAIRY_FEATHER_GT, J3DFrameCtrl::EMode_LOOP, FAIRY}, }; @@ -397,7 +397,7 @@ BOOL _Fairy_Feather_c::setBrk(int i_idx) { } BOOL _Fairy_Feather_c::setBtk(int i_idx) { - static daNpc_GetParam2 const sBtkPrm[1] = { + static DUSK_CONSTEXPR daNpc_GetParam2 const sBtkPrm[1] = { {BTK_FAIRY_FEATHER_GT, J3DFrameCtrl::EMode_LOOP, FAIRY}, }; @@ -438,7 +438,7 @@ void _Fairy_Feather_c::draw(daNpc_Fairy_c* i_this) { mBtkAnm.remove(mdlData_p); } -static daNpcT_evtData_c l_evtList[18] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[18] = { {"", 0}, {"APPEAR_10F_01", 1}, {"APPEAR_10F_02", 1}, @@ -459,7 +459,7 @@ static daNpcT_evtData_c l_evtList[18] = { {"RETURN_CANCEL", 1}, }; -char* daNpc_Fairy_c::mCutNameList[18] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Fairy_c::mCutNameList[18] = { "", "APPEAR_10F_01", "APPEAR_10F_02", @@ -480,7 +480,7 @@ char* daNpc_Fairy_c::mCutNameList[18] = { "RETURN_CANCEL", }; -daNpc_Fairy_c::cutFunc daNpc_Fairy_c::mCutList[18] = { +DUSK_GAME_DATA daNpc_Fairy_c::cutFunc DUSK_CONST daNpc_Fairy_c::mCutList[18] = { NULL, &daNpc_Fairy_c::cutAppear_10F_01, &daNpc_Fairy_c::cutAppear_10F_02, @@ -3051,7 +3051,7 @@ static int daNpc_Fairy_IsDelete(void* i_this) { return true; } -static actor_method_class daNpc_Fairy_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Fairy_MethodTable = { (process_method_func)daNpc_Fairy_Create, (process_method_func)daNpc_Fairy_Delete, (process_method_func)daNpc_Fairy_Execute, @@ -3059,7 +3059,7 @@ static actor_method_class daNpc_Fairy_MethodTable = { (process_method_func)daNpc_Fairy_Draw, }; -actor_process_profile_definition g_profile_NPC_FAIRY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_FAIRY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_fairy_seirei.cpp b/src/d/actor/d_a_npc_fairy_seirei.cpp index f6c91551dd..f1a40fae6d 100644 --- a/src/d/actor/d_a_npc_fairy_seirei.cpp +++ b/src/d/actor/d_a_npc_fairy_seirei.cpp @@ -10,59 +10,59 @@ #include -static daNpcT_evtData_c l_evtList[1] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[1] = { {"", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONST char* l_resNameList[2] = { "", NULL, }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[4] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { -1, 0, 0, -1, 0, 0, 0, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {-1, 0, 0, -1, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_FairySeirei_c::mCutNameList[1] = { +DUSK_GAME_DATA DUSK_CONST char* daNpc_FairySeirei_c::mCutNameList[1] = { "", }; -daNpc_FairySeirei_c::cutFunc daNpc_FairySeirei_c::mCutList[1] = { +DUSK_GAME_DATA DUSK_CONST daNpc_FairySeirei_c::cutFunc daNpc_FairySeirei_c::mCutList[1] = { NULL, }; -const daNpc_FairySeirei_HIOParam daNpc_FairySeirei_Param_c::m = { +DUSK_GAME_DATA const daNpc_FairySeirei_HIOParam daNpc_FairySeirei_Param_c::m = { 600.0f, 0.0f, 1.0f, 4000.0f, 255.0f, 200.0f, 0.0f, 60.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0, 0, 0, 0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, @@ -412,12 +412,12 @@ static int daNpc_FairySeirei_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_FairySeirei_MethodTable = { +static DUSK_CONST actor_method_class daNpc_FairySeirei_MethodTable = { daNpc_FairySeirei_Create, daNpc_FairySeirei_Delete, daNpc_FairySeirei_Execute, daNpc_FairySeirei_IsDelete, daNpc_FairySeirei_Draw, }; -actor_process_profile_definition g_profile_NPC_FAIRY_SEIREI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_FAIRY_SEIREI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_fguard.cpp b/src/d/actor/d_a_npc_fguard.cpp index 5b75b2a91c..8fab9e7b22 100644 --- a/src/d/actor/d_a_npc_fguard.cpp +++ b/src/d/actor/d_a_npc_fguard.cpp @@ -200,7 +200,7 @@ static int daNpcFgd_IsDelete(void* pa_this) { return 1; } -static actor_method_class daNpcFgd_METHODS = { +static DUSK_CONST actor_method_class daNpcFgd_METHODS = { (process_method_func)daNpcFgd_Create, (process_method_func)daNpcFgd_Delete, (process_method_func)daNpcFgd_Execute, @@ -208,7 +208,7 @@ static actor_method_class daNpcFgd_METHODS = { (process_method_func)daNpcFgd_Draw, }; -actor_process_profile_definition g_profile_NPC_FGUARD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_FGUARD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_fish.cpp b/src/d/actor/d_a_npc_fish.cpp index 4113fd3289..316fa65481 100644 --- a/src/d/actor/d_a_npc_fish.cpp +++ b/src/d/actor/d_a_npc_fish.cpp @@ -146,13 +146,13 @@ static int daNpc_Fish_Create(fopAc_ac_c* i_this) { return 5; } -static actor_method_class l_daNpc_Fish_Method = { +static DUSK_CONST actor_method_class l_daNpc_Fish_Method = { (process_method_func)daNpc_Fish_Create, (process_method_func)daNpc_Fish_Delete, (process_method_func)daNpc_Fish_Execute, (process_method_func)daNpc_Fish_IsDelete, (process_method_func)daNpc_Fish_Draw, }; -actor_process_profile_definition g_profile_NPC_FISH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_FISH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_gnd.cpp b/src/d/actor/d_a_npc_gnd.cpp index 10a20a179e..b88eb94fe9 100644 --- a/src/d/actor/d_a_npc_gnd.cpp +++ b/src/d/actor/d_a_npc_gnd.cpp @@ -8,52 +8,52 @@ #include "d/actor/d_a_npc_gnd.h" #include -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {11, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Gnd", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0 }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, 0, 0, 23, 2, 1, 1} }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {8, 2, 1, 20, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -char* daNpc_Gnd_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Gnd_c::mCutNameList[1] = {""}; -daNpc_Gnd_c::cutFunc daNpc_Gnd_c::mCutList[1] = {NULL}; +DUSK_GAME_DATA daNpc_Gnd_c::cutFunc DUSK_CONST daNpc_Gnd_c::mCutList[1] = {NULL}; -const daNpc_Gnd_HIOParam daNpc_Gnd_Param_c::m = { +DUSK_GAME_DATA const daNpc_Gnd_HIOParam daNpc_Gnd_Param_c::m = { 280.0f, -3.0f, 1.0f, @@ -676,7 +676,7 @@ static int daNpc_Gnd_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Gnd_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Gnd_MethodTable = { (process_method_func)daNpc_Gnd_Create, (process_method_func)daNpc_Gnd_Delete, (process_method_func)daNpc_Gnd_Execute, @@ -684,7 +684,7 @@ static actor_method_class daNpc_Gnd_MethodTable = { (process_method_func)daNpc_Gnd_Draw, }; -actor_process_profile_definition g_profile_NPC_GND = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GND = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_gra.cpp b/src/d/actor/d_a_npc_gra.cpp index e1db3b4568..a43491a57a 100644 --- a/src/d/actor/d_a_npc_gra.cpp +++ b/src/d/actor/d_a_npc_gra.cpp @@ -14,7 +14,7 @@ #include "Z2AudioLib/Z2Instances.h" #include -const daNpc_grA_HIOParam daNpc_grA_Param_c::m = { +DUSK_GAME_DATA const daNpc_grA_HIOParam daNpc_grA_Param_c::m = { {90.0f, -4.0f, 1.0f, 850.0f, 255.0f, 280.0f, 40.0f, 100.0f, 0.0f, 0.0f, 20.0f, -20.0f, 40.0f, -30.0f, 40.0f, -40.0f, 0.4f, 12.0f, 4, 6, 6, 6, 60.0f, 500.0f, 300.0f, -300.0f, 0x3c, 8, 0, 0, 0, 0, 0}, @@ -27,7 +27,7 @@ const daNpc_grA_HIOParam daNpc_grA_Param_c::m = { 1.35f, }; -static int l_bmdGetParamList[][2] = { +static DUSK_CONSTEXPR int l_bmdGetParamList[][2] = { 3, 1, 3, 2, 3, 12, @@ -35,7 +35,7 @@ static int l_bmdGetParamList[][2] = { 11, 15, }; -static int l_bckGetParamList[][2] = { +static DUSK_CONSTEXPR int l_bckGetParamList[][2] = { 0x0E, 0x00, 0x0C, 0x00, 0x0D, 0x00, @@ -89,7 +89,7 @@ static int l_bckGetParamList[][2] = { 0x07, 0x0F, }; -static int l_btpGetParamList[][2] = { +static DUSK_CONSTEXPR int l_btpGetParamList[][2] = { 0x1C, 0x00, 0x1F, 0x00, 0x20, 0x00, @@ -108,9 +108,9 @@ static int l_btpGetParamList[][2] = { 0x1D, 0x00, }; -static int l_btkGetParamList[][2] = {-1, 0}; +static DUSK_CONSTEXPR int l_btkGetParamList[][2] = {-1, 0}; -static int l_evtGetParamList[][2] = { +static DUSK_CONSTEXPR int l_evtGetParamList[][2] = { 0x00, 0x00, 0x01, 0x03, 0x02, 0x05, @@ -132,7 +132,7 @@ daNpc_grA_HIO_c::daNpc_grA_HIO_c() { static NPC_GRA_HIO_CLASS l_HIO; -static char* l_evtNames[11] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[11] = { NULL, "TALK_SPA", "TEACH_ELV", @@ -146,59 +146,59 @@ static char* l_evtNames[11] = { "ROLL_ROCK_CRASH", }; -static int l_loadRes_GRAa[] = { +static DUSK_CONSTEXPR int l_loadRes_GRAa[] = { 0, 1, -1, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA_Tw[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_Tw[] = { 0, 2, -1, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA_Spa[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_Spa[] = { 0, 1, 3, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA_SDEMO[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_SDEMO[] = { 0, 1, 4, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA_GATE[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_GATE[] = { 0, 1, 4, 5, -1, -1, -1, -1, }; -static int l_loadRes_GRA_KICKOUT[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_KICKOUT[] = { 0, 1, 6, 10, -1, -1, -1, -1, }; -static int l_loadRes_GRA_ROCK[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_ROCK[] = { 0, 1, 7, 8, -1, -1, -1, -1, }; -static int l_loadRes_GRA_SPAWATER[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_SPAWATER[] = { 0, 1, 3, 9, 10, 11, 12, -1, }; -static int l_loadRes_GRA_SPABUYER[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_SPABUYER[] = { 0, 1, 15, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA_SPABUYER_TW[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_SPABUYER_TW[] = { 0, 2, 15, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA_ROCKCRASHER[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_ROCKCRASHER[] = { 0, 1, 13, 11, 14, -1, -1, -1, }; -static int l_loadRes_GRA_BUYER[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA_BUYER[] = { 0, 1, 4, -1, -1, -1, -1, -1, }; -static int l_loadRes_GRA0[] = { +static DUSK_CONSTEXPR int l_loadRes_GRA0[] = { 0, 1, -1, -1, -1, -1, -1, -1, }; -static int* l_loadRes_list[13] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[13] = { l_loadRes_GRAa, l_loadRes_GRA_Tw, l_loadRes_GRA_Spa, @@ -214,7 +214,7 @@ static int* l_loadRes_list[13] = { l_loadRes_GRA0, }; -static char* l_resNames[16] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[16] = { "grA_base", "grA_mdl", "grA_TW", @@ -233,7 +233,7 @@ static char* l_resNames[16] = { "grA_town", }; -static char* l_myName[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_myName[3] = { "grA", "grA_spa", "grA_Elv", @@ -288,7 +288,7 @@ void daNpc_grA_HIO_c::genMessage(JORMContext* context) { } #endif -char* daNpc_grA_c::mEvtCutNameList[12] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grA_c::mEvtCutNameList[12] = { "", "TALK_SPA", "GRDS_ROLL", @@ -303,7 +303,7 @@ char* daNpc_grA_c::mEvtCutNameList[12] = { "ROLL_ROCK_CRASH", }; -daNpc_grA_c::cut_type daNpc_grA_c::mEvtCutList[] = { +DUSK_GAME_DATA daNpc_grA_c::cut_type DUSK_CONST daNpc_grA_c::mEvtCutList[] = { NULL, &daNpc_grA_c::ECut_talkSpa, &daNpc_grA_c::ECut_grDSRoll, @@ -4101,7 +4101,7 @@ static BOOL daNpc_grA_IsDelete(void* i_this) { return true; } -static actor_method_class daNpc_grA_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grA_MethodTable = { (process_method_func)daNpc_grA_Create, (process_method_func)daNpc_grA_Delete, (process_method_func)daNpc_grA_Execute, @@ -4109,7 +4109,7 @@ static actor_method_class daNpc_grA_MethodTable = { (process_method_func)daNpc_grA_Draw, }; -actor_process_profile_definition g_profile_NPC_GRA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grc.cpp b/src/d/actor/d_a_npc_grc.cpp index f41578bcaa..2435f13c77 100644 --- a/src/d/actor/d_a_npc_grc.cpp +++ b/src/d/actor/d_a_npc_grc.cpp @@ -156,12 +156,12 @@ enum Event_Cut_Nums { static NPC_GRC_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[2] = { {BMDR_GRC_A, GRC_MDL}, {BMDR_GRC_TW, GRC_TW}, }; -static daNpc_GetParam1 l_bckGetParamList[19] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[19] = { {-1, GRC}, {BCK_GRC_F_WAIT_A, 0}, {BCK_GRC_GRUMPY, GRC}, @@ -183,7 +183,7 @@ static daNpc_GetParam1 l_bckGetParamList[19] = { {BCK_GRC_STEP, GRC}, }; -static daNpc_GetParam1 l_btpGetParamList[6] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[6] = { {BTP_GRC_A, GRC}, {BTP_GRC_F_CHEERFUL_T, GRC}, {BTP_GRC_F_GRUMPY_T, GRC}, @@ -192,49 +192,49 @@ static daNpc_GetParam1 l_btpGetParamList[6] = { {BTP_GRC_FH_CLOSEEYE, GRC}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {-1, GRC}, }; -static daNpc_GetParam1 l_evtGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[1] = { {0, GRC}, }; -static int l_loadRes_GRCa[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRCa[3] = { GRC, GRC_MDL, -1, }; -static int l_loadRes_GRCa_TW[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRCa_TW[3] = { GRC, GRC_TW, -1, }; -static int l_loadRes_GRC0[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRC0[3] = { GRC, GRC_MDL, -1, }; -static int* l_loadRes_list[7] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[7] = { l_loadRes_GRCa, l_loadRes_GRCa_TW, l_loadRes_GRCa, l_loadRes_GRCa, l_loadRes_GRCa, l_loadRes_GRCa, l_loadRes_GRC0, }; -static char* l_resNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[3] = { "grC", "grC_Mdl", "grC_TW", }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL }; -static char* l_myName = "grC"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "grC"; -char* daNpc_grC_c::mEvtCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grC_c::mEvtCutNameList = ""; -daNpc_grC_c::EventFn daNpc_grC_c::mEvtCutList[1] = {NULL}; +DUSK_GAME_DATA daNpc_grC_c::EventFn DUSK_CONST daNpc_grC_c::mEvtCutList[1] = {NULL}; -daNpc_grC_HIOParam const daNpc_grC_Param_c::m = { +DUSK_GAME_DATA daNpc_grC_HIOParam const daNpc_grC_Param_c::m = { 40.0f, -3.0f, 1.0f, @@ -1568,7 +1568,7 @@ static int daNpc_grC_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_grC_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grC_MethodTable = { (process_method_func)daNpc_grC_Create, (process_method_func)daNpc_grC_Delete, (process_method_func)daNpc_grC_Execute, @@ -1576,7 +1576,7 @@ static actor_method_class daNpc_grC_MethodTable = { (process_method_func)daNpc_grC_Draw, }; -actor_process_profile_definition g_profile_NPC_GRC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grd.cpp b/src/d/actor/d_a_npc_grd.cpp index 8f006bf4cf..59be9c4e00 100644 --- a/src/d/actor/d_a_npc_grd.cpp +++ b/src/d/actor/d_a_npc_grd.cpp @@ -50,71 +50,71 @@ enum Type { static NPC_GRD_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[1] = { {11, 0}, }; -static daNpc_GetParam1 l_bckGetParamList[12] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[12] = { {-1, 0}, {6, 0}, {5, 1}, {6, 1}, {4, 1}, {8, 0}, {7, 0}, {10, 1}, {11, 1}, {8, 1}, {7, 1}, {9, 1}, }; -static daNpc_GetParam1 l_btpGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[4] = { {17, 0}, {15, 1}, {16, 1}, {14, 1}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {14, 0}, }; -static daNpc_GetParam1 l_evtGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[1] = { {0, 0}, }; -static int l_loadRes_GRD_YELIA[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRD_YELIA[3] = { 0, 1, -1, }; -static int l_loadRes_GRDa[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRDa[3] = { 0, 1, -1, }; -static int l_loadRes_GRD0[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRD0[3] = { 0, -1, -1, }; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_GRD_YELIA, l_loadRes_GRDa, l_loadRes_GRD0, }; -static char* l_resNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[2] = { "grD", "grD1", }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL, }; -static char* l_myName = "grD"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "grD"; -char* daNpc_Grd_c::mEvtCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Grd_c::mEvtCutNameList[2] = { "", "NOD_TO_GRZ", }; -daNpc_Grd_c::cutFunc daNpc_Grd_c::mEvtCutList[2] = { +DUSK_GAME_DATA daNpc_Grd_c::cutFunc DUSK_CONST daNpc_Grd_c::mEvtCutList[2] = { NULL, &daNpc_Grd_c::ECut_nodToGrz, }; @@ -131,7 +131,7 @@ daNpc_Grd_c::~daNpc_Grd_c() { } } -const daNpc_Grd_HIOParam daNpc_Grd_Param_c::m = { +DUSK_GAME_DATA const daNpc_Grd_HIOParam daNpc_Grd_Param_c::m = { 230.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -1245,13 +1245,13 @@ static int daNpc_Grd_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Grd_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Grd_MethodTable = { (process_method_func)daNpc_Grd_Create, (process_method_func)daNpc_Grd_Delete, (process_method_func)daNpc_Grd_Execute, (process_method_func)daNpc_Grd_IsDelete, (process_method_func)daNpc_Grd_Draw, }; -actor_process_profile_definition g_profile_NPC_GRD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grm.cpp b/src/d/actor/d_a_npc_grm.cpp index 4869ef254b..8e124b035d 100644 --- a/src/d/actor/d_a_npc_grm.cpp +++ b/src/d/actor/d_a_npc_grm.cpp @@ -51,27 +51,27 @@ enum RES_Name { /* 0x2 */ GRA_MDL, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_GRA_A, GRA_MDL}, }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {NULL, 0}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "grA_base", "grA_mdl", }; -static s8 l_loadResPtrn0[3] = {2, 1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = {2, 1, -1}; -static s8* l_loadResPtrnList[1] = {l_loadResPtrn0}; +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[1] = {l_loadResPtrn0}; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[8] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[8] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, BTP_GRA_A, J3DFrameCtrl::EMode_LOOP, GRA_BASE, TRUE}, {BCK_GRA_F_WAIT_A, J3DFrameCtrl::EMode_LOOP, GRA_BASE, BTP_GRA_A, J3DFrameCtrl::EMode_LOOP, GRA_BASE, TRUE}, @@ -101,7 +101,7 @@ enum Motion { /* 0x4 */ MOT_TALK_B, }; -static daNpcT_motionAnmData_c l_motionAnmData[3] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[3] = { {BCK_GRA_WAIT_A, J3DFrameCtrl::EMode_LOOP, GRA_BASE, BTK_GRA_A, J3DFrameCtrl::EMode_NONE, GRA_BASE, 0, 0}, {BCK_GRA_TALK_A, J3DFrameCtrl::EMode_NONE, GRA_BASE, BTK_GRA_A, J3DFrameCtrl::EMode_NONE, @@ -110,31 +110,31 @@ static daNpcT_motionAnmData_c l_motionAnmData[3] = { GRA_BASE, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { {2, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[20] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[20] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_grM_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grM_c::mCutNameList[2] = { "", "TALK_SPA", }; -daNpc_grM_c::cutFunc daNpc_grM_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_grM_c::cutFunc DUSK_CONST daNpc_grM_c::mCutList[2] = { NULL, &daNpc_grM_c::cutTalkSpa, }; static NPC_GRM_HIO_CLASS l_HIO; -daNpc_grM_HIOParam const daNpc_grM_Param_c::m = { +DUSK_GAME_DATA daNpc_grM_HIOParam const daNpc_grM_Param_c::m = { 300.0f, -3.0f, 1.0f, 600.0f, 255.0f, 260.0f, 35.0f, 70.0f, 0.0f, 0.0f, 30.0f, -30.0f, 30.0f, -10.0f, 20.0f, -20.0f, 0.6f, 12.0f, 8, 6, 8, 6, 0.0f, 0.0f, 0.0f, 0.0f, 60, 8, 0, 0, 0, false, false, @@ -812,13 +812,13 @@ static BOOL daNpc_grM_IsDelete(void* param_0) { return TRUE; } -static actor_method_class daNpc_grM_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grM_MethodTable = { (process_method_func)daNpc_grM_Create, (process_method_func)daNpc_grM_Delete, (process_method_func)daNpc_grM_Execute, (process_method_func)daNpc_grM_IsDelete, (process_method_func)daNpc_grM_Draw, }; -actor_process_profile_definition g_profile_NPC_GRM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grmc.cpp b/src/d/actor/d_a_npc_grmc.cpp index 71a1f62ebd..4ac574b021 100644 --- a/src/d/actor/d_a_npc_grmc.cpp +++ b/src/d/actor/d_a_npc_grmc.cpp @@ -75,28 +75,28 @@ enum Motion { /* 0x8 */ MOT_SAD_WAIT = 0x8, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_GRC_A, GRC_MDL}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"DEFAULT_GETITEM", 0}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "grC", "grC_Mdl", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { 1, 2, -1, }; -static s8* l_loadResPtrnList[1] = {l_loadResPtrn0}; +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[1] = {l_loadResPtrn0}; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[9] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[9] = { {-1, 0, J3DFrameCtrl::EMode_NONE, BTP_GRC_A, J3DFrameCtrl::EMode_LOOP, GRC, 1}, {BCK_GRC_F_WAIT_A, J3DFrameCtrl::EMode_LOOP, GRC, BTP_GRC_A, J3DFrameCtrl::EMode_LOOP, GRC, 1}, {BCK_GRC_GRUMPY, J3DFrameCtrl::EMode_LOOP, GRC, BTP_GRC_A, J3DFrameCtrl::EMode_LOOP, GRC, 1}, @@ -108,7 +108,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[9] = { {BCK_GRC_F_SAD_TALK, J3DFrameCtrl::EMode_NONE, GRC, BTP_GRC_F_SAD_TALK, J3DFrameCtrl::EMode_NONE, GRC, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[9] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[9] = { {BCK_GRC_WAIT_A, J3DFrameCtrl::EMode_LOOP, GRC, BTK_GRC_A, J3DFrameCtrl::EMode_NONE, GRC, 0, 0}, {BCK_GRC_TALK_A, J3DFrameCtrl::EMode_LOOP, GRC, BTK_GRC_A, J3DFrameCtrl::EMode_NONE, GRC, 0, 0}, {BCK_GRC_TALK_B, J3DFrameCtrl::EMode_LOOP, GRC, BTK_GRC_A, J3DFrameCtrl::EMode_NONE, GRC, 0, 0}, @@ -120,7 +120,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[9] = { {BCK_GRC_STEP, J3DFrameCtrl::EMode_NONE, GRC, BTK_GRC_A, J3DFrameCtrl::EMode_NONE, GRC, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { {5, -1, 1}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -137,7 +137,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -149,9 +149,9 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_grMC_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grMC_c::mCutNameList = ""; -daNpc_grMC_c::cutFunc daNpc_grMC_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_grMC_c::cutFunc DUSK_CONST daNpc_grMC_c::mCutList[1] = { NULL, }; @@ -171,7 +171,7 @@ daNpc_grMC_c::~daNpc_grMC_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_grMC_HIOParam const daNpc_grMC_Param_c::m = { +DUSK_GAME_DATA daNpc_grMC_HIOParam const daNpc_grMC_Param_c::m = { 140.0f, -3.0f, 1.0f, @@ -802,7 +802,7 @@ static int daNpc_grMC_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpc_grMC_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grMC_MethodTable = { (process_method_func)daNpc_grMC_Create, (process_method_func)daNpc_grMC_Delete, (process_method_func)daNpc_grMC_Execute, @@ -810,7 +810,7 @@ static actor_method_class daNpc_grMC_MethodTable = { (process_method_func)daNpc_grMC_Draw, }; -actor_process_profile_definition g_profile_NPC_GRMC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRMC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_gro.cpp b/src/d/actor/d_a_npc_gro.cpp index 785136559f..bdf984f35f 100644 --- a/src/d/actor/d_a_npc_gro.cpp +++ b/src/d/actor/d_a_npc_gro.cpp @@ -193,17 +193,17 @@ enum Mode { static NPC_GRO_HIO_CLASS l_HIO; -static daNpc_Maro_c::actionFunc dummy_lit_3931() { +static DUSK_CONSTEXPR daNpc_Maro_c::actionFunc dummy_lit_3931() { return &daNpc_Maro_c::choccai; } -static daNpc_GetParam1 l_bmdGetParamList[3] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[3] = { {BMDR_GRO_A, GRO}, {BMDR_GRO_PIPE, GRO}, {BMDR_MARO_BOKIN, GRO1}, }; -static daNpc_GetParam1 l_bckGetParamList[23] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[23] = { {-1, GRO}, {BCK_GRO_F_WAIT_A, GRO}, {BCK_GRO_F_WALK_A, GRO}, @@ -229,7 +229,7 @@ static daNpc_GetParam1 l_bckGetParamList[23] = { {BCK_GRO_SWING, GRO1}, }; -static daNpc_GetParam1 l_btpGetParamList[6] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[6] = { {BTP_GRO_A, GRO}, {BTP_GRO_F_TALK_B, GRO}, {BTP_GRO_F_CALL, GRO1}, @@ -238,57 +238,57 @@ static daNpc_GetParam1 l_btpGetParamList[6] = { {BTP_GRO_F_BOW, GRO1}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {BTK_GRO_A, GRO}, }; -static daNpc_GetParam1 l_evtGetParamList[3] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[3] = { {0, GRO}, {1, GRO1D}, {2, GRO}, }; -static int l_loadRes_GROa[4] = { +static DUSK_CONSTEXPR int l_loadRes_GROa[4] = { GRO, -1, -1, -1, }; -static int l_loadRes_GRO_BOKIN[4] = { +static DUSK_CONSTEXPR int l_loadRes_GRO_BOKIN[4] = { GRO, GRO1, GRO1D, -1, }; -static int l_loadRes_GRO_MARO[4] = { +static DUSK_CONSTEXPR int l_loadRes_GRO_MARO[4] = { GRO, GRO1, -1, -1, }; -static int l_loadRes_GRO0[4] = { +static DUSK_CONSTEXPR int l_loadRes_GRO0[4] = { GRO, -1, -1, -1, }; -static int* l_loadRes_list[4] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[4] = { l_loadRes_GROa, l_loadRes_GRO_BOKIN, l_loadRes_GRO_MARO, l_loadRes_GRO0, }; -static int l_loadObj_list[2][2] = { +static DUSK_CONSTEXPR int l_loadObj_list[2][2] = { {1, 2}, {-1, 1}, }; -static char* l_resNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[3] = { "grO", "grO1", "grO1D", }; -static char* l_evtNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[3] = { NULL, "BOKIN_FINISH", "PUSHOUT", }; -static char* l_myName = "grO"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "grO"; #if DEBUG daNpc_grO_HIO_c::daNpc_grO_HIO_c() { @@ -325,13 +325,13 @@ void daNpc_grO_HIO_c::genMessage(JORMContext* ctx) { } #endif -char* daNpc_grO_c::mEvtCutNameList[3] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grO_c::mEvtCutNameList[3] = { "", "BOKIN_FINISH", "PUSHOUT", }; -daNpc_grO_c::cutFunc daNpc_grO_c::mEvtCutList[3] = { +DUSK_GAME_DATA daNpc_grO_c::cutFunc DUSK_CONST daNpc_grO_c::mEvtCutList[3] = { NULL, &daNpc_grO_c::ECut_bokinFinish, &daNpc_grO_c::cutPushOut, @@ -355,7 +355,7 @@ daNpc_grO_c::~daNpc_grO_c() { #endif } -daNpc_grO_HIOParam const daNpc_grO_Param_c::m = { +DUSK_GAME_DATA daNpc_grO_HIOParam const daNpc_grO_Param_c::m = { 160.0f, -3.0f, 1.0f, @@ -1907,7 +1907,7 @@ static int daNpc_grO_IsDelete(void* i_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_grO_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grO_MethodTable = { (process_method_func)daNpc_grO_Create, (process_method_func)daNpc_grO_Delete, (process_method_func)daNpc_grO_Execute, @@ -1915,7 +1915,7 @@ static actor_method_class daNpc_grO_MethodTable = { (process_method_func)daNpc_grO_Draw, }; -actor_process_profile_definition g_profile_NPC_GRO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grr.cpp b/src/d/actor/d_a_npc_grr.cpp index 39689144f4..ee0d50d858 100644 --- a/src/d/actor/d_a_npc_grr.cpp +++ b/src/d/actor/d_a_npc_grr.cpp @@ -124,11 +124,11 @@ enum Event_Cut_Nums { static NPC_GRR_HIO_CLASS l_HIO; -static int l_bmdGetParamList[1][2] = { +static DUSK_CONSTEXPR int l_bmdGetParamList[1][2] = { {BMDR_GRR, GRR}, }; -static daNpc_GetParam1 l_bckGetParamList[19] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[19] = { {-1, GRR}, {BCK_GRR_F_TALK_A, GRR}, {BCK_GRR_F_LAUGH, GRR}, @@ -150,7 +150,7 @@ static daNpc_GetParam1 l_bckGetParamList[19] = { {BCK_GRR_SWING, GRR1}, }; -static daNpc_GetParam1 l_btpGetParamList[6] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[6] = { {BTP_GRR, GRR}, {BTP_GRR_F_LAUGH, GRR}, {BTP_GRR_F_KEEE, GRR}, @@ -159,53 +159,53 @@ static daNpc_GetParam1 l_btpGetParamList[6] = { {BTP_GRR_FH_LAUGH, GRR}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {BTK_GRR, GRR}, }; -static daNpc_GetParam1 l_evtGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[1] = { {0, GRR}, }; -static int l_loadRes_GRRa[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRRa[3] = { GRR, -1, -1, }; -static int l_loadRes_GRR_SPAWATER[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRR_SPAWATER[3] = { GRR, GRR1, -1, }; -static int l_loadRes_GRR_MARO[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRR_MARO[3] = { GRR, GRR1, -1, }; -static int l_loadRes_GRR0[3] = { +static DUSK_CONSTEXPR int l_loadRes_GRR0[3] = { GRR, -1, -1, }; -static int* l_loadRes_list[4] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[4] = { l_loadRes_GRRa, l_loadRes_GRR_SPAWATER, l_loadRes_GRR_MARO, l_loadRes_GRR0, }; -static char* l_resNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[2] = { "grR", "grR1", }; -static char* l_evtNames[1] = {NULL}; +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = {NULL}; -static char* l_myName = "grR"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "grR"; -char* daNpc_grR_c::mEvtCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grR_c::mEvtCutNameList = ""; -daNpc_grR_c::cutFunc daNpc_grR_c::mEvtCutList[1] = { +DUSK_GAME_DATA daNpc_grR_c::cutFunc DUSK_CONST daNpc_grR_c::mEvtCutList[1] = { NULL, }; -daNpc_grR_HIOParam const daNpc_grR_Param_c::m = { +DUSK_GAME_DATA daNpc_grR_HIOParam const daNpc_grR_Param_c::m = { 60.0f, -3.0f, 1.0f, @@ -1434,7 +1434,7 @@ static int daNpc_grR_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_grR_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grR_MethodTable = { (process_method_func)daNpc_grR_Create, (process_method_func)daNpc_grR_Delete, (process_method_func)daNpc_grR_Execute, @@ -1442,7 +1442,7 @@ static actor_method_class daNpc_grR_MethodTable = { (process_method_func)daNpc_grR_Draw, }; -actor_process_profile_definition g_profile_NPC_GRR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grs.cpp b/src/d/actor/d_a_npc_grs.cpp index 401634d2ab..abab07d22b 100644 --- a/src/d/actor/d_a_npc_grs.cpp +++ b/src/d/actor/d_a_npc_grs.cpp @@ -35,12 +35,12 @@ enum LookMode { /* 0x04 */ LOOK_MODE_UNK_4, }; -static daNpc_GetParam1 l_bmdGetParamList[2] = { +DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[2] = { {16, 0}, {17, 0}, }; -static daNpc_GetParam1 l_bckGetParamList[8] = { +DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[8] = { {-1, 0}, {8, 0}, {7, 0}, @@ -51,49 +51,54 @@ static daNpc_GetParam1 l_bckGetParamList[8] = { {10, 0}, }; -static daNpc_GetParam1 l_btpGetParamList[3] = { +DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[3] = { {23, 0}, {24, 0}, {25, 0}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {20, 0}, }; -static daNpc_GetParam1 l_evtGetParamList[2] = { +DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[2] = { {0, 0}, {1, 0}, }; -static int l_loadRes_GRSa[3] = {0, -1, -1}; +DUSK_CONSTEXPR int l_loadRes_GRSa[3] = {0, -1, -1}; -static int l_loadRes_GRS0[3] = {0, -1, -1}; +DUSK_CONSTEXPR int l_loadRes_GRS0[3] = {0, -1, -1}; -static int* l_loadRes_list[2] = { - (int*)&l_loadRes_GRSa, - (int*)&l_loadRes_GRS0, +DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[2] = { +#if TARGET_PC + l_loadRes_GRSa, + l_loadRes_GRS0, +#else + (int DUSK_CONST*)&l_loadRes_GRSa, + (int DUSK_CONST*)&l_loadRes_GRS0, +#endif }; -static char* l_resNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[1] = { "grS", }; -static char* l_evtNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[2] = { NULL, "PUSHOUT", }; -static char* l_myName = "grS"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "grS"; static NPC_GRS_HIO_CLASS l_HIO; -char* daNpc_grS_c::mEvtCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_grS_c::mEvtCutNameList[2] = { "", "PUSHOUT", }; -daNpc_grS_c::cutFunc daNpc_grS_c::mEvtCutList[2] = { +DUSK_GAME_DATA daNpc_grS_c::cutFunc DUSK_CONST daNpc_grS_c::mEvtCutList[2] = { NULL, &daNpc_grS_c::cutPushOut, }; @@ -117,7 +122,7 @@ daNpc_grS_c::~daNpc_grS_c() { #endif } -const daNpc_grS_HIOParam daNpc_grS_Param_c::m = { +DUSK_GAME_DATA const daNpc_grS_HIOParam daNpc_grS_Param_c::m = { 120.0f, -3.0f, 1.0f, 600.0f, 255.0f, 120.0f, 35.0f, 60.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -30.0f, 45.0f, -45.0f, 0.6f, 12.0f, @@ -1294,7 +1299,7 @@ static int daNpc_grS_IsDelete(void* i_this) { return TRUE; } -static actor_method_class daNpc_grS_MethodTable = { +static DUSK_CONST actor_method_class daNpc_grS_MethodTable = { (process_method_func)daNpc_grS_Create, (process_method_func)daNpc_grS_Delete, (process_method_func)daNpc_grS_Execute, @@ -1302,7 +1307,7 @@ static actor_method_class daNpc_grS_MethodTable = { (process_method_func)daNpc_grS_Draw, }; -actor_process_profile_definition g_profile_NPC_GRS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_grz.cpp b/src/d/actor/d_a_npc_grz.cpp index 104c0c4756..bd376a84ce 100644 --- a/src/d/actor/d_a_npc_grz.cpp +++ b/src/d/actor/d_a_npc_grz.cpp @@ -244,11 +244,11 @@ enum Event_Cut_Nums { static NPC_GRZ_HIO_CLASS l_HIO; -static int l_bmdGetParamList[1][2] = { +static DUSK_CONSTEXPR int l_bmdGetParamList[1][2] = { {BMDR_GRZ, GRZ}, }; -static daNpc_GetParam1 l_bckGetParamList[34] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[34] = { {-1, GRZ}, {BCK_GRZ_F_MUKIDASHI, GRZ}, {BCK_GRZ_F_RECOVER, GRZ3}, @@ -285,7 +285,7 @@ static daNpc_GetParam1 l_bckGetParamList[34] = { {BCK_GRZ_PUNCH, GRZ3}, }; -static daNpc_GetParam1 l_btpGetParamList[10] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[10] = { {BTP_GRZ, GRZ}, {BTP_GRZ_F_LIEDOWN, GRZ1}, {BTP_GRZ_F_GETUP, GRZ1}, @@ -298,52 +298,52 @@ static daNpc_GetParam1 l_btpGetParamList[10] = { {BTP_GRZ_F_RECOVER, GRZ3}, }; -static daNpc_GetParam1 l_btkGetParamList[3] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[3] = { {BTK_GRZ, GRZ}, {BTK_GRZ_GETUP, GRZ1}, {BTK_GRZ_SNIFF, GRZ2}, }; -static daNpc_GetParam1 l_evtGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[4] = { {0, GRZ}, {1, GRZD1}, {2, GRZD3}, {3, GRZD3}, }; -static char* l_evtNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[4] = { NULL, "TALK_STAND", "STONE_SMASH", "STONE_SMASH_SKIP", }; -static int l_loadRes_YELIA[5] = { +static DUSK_CONSTEXPR int l_loadRes_YELIA[5] = { GRZ, GRZ2, -1, -1, -1, }; -static int l_loadRes_LieDown[5] = { +static DUSK_CONSTEXPR int l_loadRes_LieDown[5] = { GRZ, GRZ1, GRZD1, -1, -1, }; -static int l_loadRes_Smash[5] = { +static DUSK_CONSTEXPR int l_loadRes_Smash[5] = { GRZ, GRZ2, GRZ3, GRZD3, -1, }; -static int l_loadRes_GRZa[5] = { +static DUSK_CONSTEXPR int l_loadRes_GRZa[5] = { GRZ, GRZ2, -1, -1, -1, }; -static int l_loadRes_GRZ0[5] = { +static DUSK_CONSTEXPR int l_loadRes_GRZ0[5] = { GRZ, -1, -1, -1, -1, }; -static int* l_loadRes_list[5] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[5] = { l_loadRes_YELIA, l_loadRes_LieDown, l_loadRes_Smash, l_loadRes_GRZa, l_loadRes_GRZ0, }; -static char* l_resNames[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[6] = { "grZ", "grZ1", "grZ2", @@ -352,9 +352,9 @@ static char* l_resNames[6] = { "grZD3", }; -static char* l_myName = "grZ"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "grZ"; -char* daNpc_Grz_c::mEvtCutNameList[7] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Grz_c::mEvtCutNameList[7] = { "", "WAIT", "REBIRTH", @@ -364,7 +364,7 @@ char* daNpc_Grz_c::mEvtCutNameList[7] = { "STONE_SMASH_SKIP", }; -daNpc_Grz_c::cutFunc daNpc_Grz_c::mEvtCutList[7] = { +DUSK_GAME_DATA daNpc_Grz_c::cutFunc DUSK_CONST daNpc_Grz_c::mEvtCutList[7] = { NULL, &daNpc_Grz_c::doWaitCut, &daNpc_Grz_c::doRebirthCut, @@ -406,7 +406,7 @@ daNpc_Grz_c::~daNpc_Grz_c() { #endif } -daNpc_Grz_HIOParam const daNpc_Grz_Param_c::m = { +DUSK_GAME_DATA daNpc_Grz_HIOParam const daNpc_Grz_Param_c::m = { 130.0f, -3.0f, 1.0f, @@ -2539,7 +2539,7 @@ static int daNpc_Grz_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_Grz_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Grz_MethodTable = { (process_method_func)daNpc_Grz_Create, (process_method_func)daNpc_Grz_Delete, (process_method_func)daNpc_Grz_Execute, @@ -2547,7 +2547,7 @@ static actor_method_class daNpc_Grz_MethodTable = { (process_method_func)daNpc_Grz_Draw, }; -actor_process_profile_definition g_profile_NPC_GRZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GRZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_guard.cpp b/src/d/actor/d_a_npc_guard.cpp index 60c6597cd9..8ad17ea9c8 100644 --- a/src/d/actor/d_a_npc_guard.cpp +++ b/src/d/actor/d_a_npc_guard.cpp @@ -35,7 +35,7 @@ static int createHeapCallBack(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -daNpcGuard_c::actionFunc daNpcGuard_c::ActionTable[7][2] = { +DUSK_GAME_DATA daNpcGuard_c::actionFunc daNpcGuard_c::ActionTable[7][2] = { {&daNpcGuard_c::initPath, &daNpcGuard_c::executePath}, {&daNpcGuard_c::initRun, &daNpcGuard_c::executeRun}, {&daNpcGuard_c::initFightWait, &daNpcGuard_c::executeFightWait}, @@ -603,13 +603,13 @@ static int daNpcGuard_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcGuard_METHODS = { +static DUSK_CONST actor_method_class daNpcGuard_METHODS = { (process_method_func)daNpcGuard_Create, (process_method_func)daNpcGuard_Delete, (process_method_func)daNpcGuard_Execute, (process_method_func)daNpcGuard_IsDelete, (process_method_func)daNpcGuard_Draw, }; -actor_process_profile_definition g_profile_NPC_GUARD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GUARD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_gwolf.cpp b/src/d/actor/d_a_npc_gwolf.cpp index 9956468e41..fb4d1d8d17 100644 --- a/src/d/actor/d_a_npc_gwolf.cpp +++ b/src/d/actor/d_a_npc_gwolf.cpp @@ -89,11 +89,11 @@ enum Motion { static NPC_GWOLF_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[1] = { {BMDR_GW, GWOLF}, }; -static daNpc_GetParam1 l_bckGetParamList[12] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[12] = { {-1, GWOLF}, {-1, GWOLF}, {BCK_WL_WAITSIT, GWOLF}, @@ -108,15 +108,15 @@ static daNpc_GetParam1 l_bckGetParamList[12] = { {BCK_WL_DASHA, GWOLF}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {BTK_GW, GWOLF}, }; -static daNpc_GetParam1 l_brkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_brkGetParamList[1] = { {BRK_GW, GWOLF}, }; -static daNpc_GetParam1 l_evtGetParamList[15] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[15] = { {EVT_NONE, GWOLF}, {EVT_ATTACK_WARP, GWOLF}, {EVT_ATTACK_WARP_HORSE, GWOLF}, @@ -134,7 +134,7 @@ static daNpc_GetParam1 l_evtGetParamList[15] = { {EVT_MEET_GWOLFF, GWOLF}, }; -static char* l_evtNames[15] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[15] = { NULL, "ATTACK_WARP", "ATTACK_WARP_HORSE", @@ -152,26 +152,26 @@ static char* l_evtNames[15] = { "MEET_GWOLFF", }; -static int l_loadRes_GWOLFa[3] = { +static DUSK_CONSTEXPR int l_loadRes_GWOLFa[3] = { GWOLF, -1, -1, }; -static int l_loadRes_GWOLF0[3] = { +static DUSK_CONSTEXPR int l_loadRes_GWOLF0[3] = { GWOLF, -1, -1, }; -static int* l_loadRes_list[4] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[4] = { l_loadRes_GWOLFa, l_loadRes_GWOLFa, l_loadRes_GWOLFa, l_loadRes_GWOLF0, }; -static char* l_resNames[1] = {"GWolf"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[1] = {"GWolf"}; -static char* l_myName = "GWolf"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "GWolf"; -static s16 l_appearTmpFlag[7] = { +static DUSK_CONSTEXPR s16 l_appearTmpFlag[7] = { -1, 0x005C, // dSv_event_tmp_flag_c::T_0092 - Hero's spirit - Gold wolf identification 2 0x005D, // dSv_event_tmp_flag_c::T_0093 - Hero's spirit - Gold wolf identification 3 @@ -181,7 +181,7 @@ static s16 l_appearTmpFlag[7] = { 0x0061, // dSv_event_tmp_flag_c::T_0097 - Hero's spirit - Gold wolf identification 7 }; -static s16 l_warpAppearFlag[7] = { +static DUSK_CONSTEXPR s16 l_warpAppearFlag[7] = { -1, 0x01D8, // dSv_event_flag_c::F_0472 - Secret techniques - Distant howling complete (for secret technique 2) 0x01D9, // dSv_event_flag_c::F_0473 - Secret techniques - Distant howling complete (for secret technique 3) @@ -191,7 +191,7 @@ static s16 l_warpAppearFlag[7] = { 0x01DD, // dSv_event_flag_c::F_0477 - Secret techniques - Distant howling complete (for secret technique 7) }; -char* daNpc_GWolf_c::mEvtCutNameList[5] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_GWolf_c::mEvtCutNameList[5] = { "", "ATTACK_WARP", "ATTACK_WARP_HORSE", @@ -199,7 +199,7 @@ char* daNpc_GWolf_c::mEvtCutNameList[5] = { "MEET_GWOLFA", }; -daNpc_GWolf_c::cutFunc daNpc_GWolf_c::mEvtCutList[5] = { +DUSK_GAME_DATA daNpc_GWolf_c::cutFunc DUSK_CONST daNpc_GWolf_c::mEvtCutList[5] = { NULL, &daNpc_GWolf_c::ECut_attackWarp, &daNpc_GWolf_c::ECut_attackWarpHorse, @@ -207,7 +207,7 @@ daNpc_GWolf_c::cutFunc daNpc_GWolf_c::mEvtCutList[5] = { &daNpc_GWolf_c::ECut_meetGWolf, }; -daNpc_GWolf_HIOParam const daNpc_GWolf_Param_c::m = { +DUSK_GAME_DATA daNpc_GWolf_HIOParam const daNpc_GWolf_Param_c::m = { 30.0f, -4.0f, 1.0f, @@ -1916,7 +1916,7 @@ static int daNpc_GWolf_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_GWolf_MethodTable = { +static DUSK_CONST actor_method_class daNpc_GWolf_MethodTable = { (process_method_func)daNpc_GWolf_Create, (process_method_func)daNpc_GWolf_Delete, (process_method_func)daNpc_GWolf_Execute, @@ -1924,7 +1924,7 @@ static actor_method_class daNpc_GWolf_MethodTable = { (process_method_func)daNpc_GWolf_Draw, }; -actor_process_profile_definition g_profile_NPC_GWOLF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_GWOLF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_hanjo.cpp b/src/d/actor/d_a_npc_hanjo.cpp index ef5d1671d0..cbd3d9dcf9 100644 --- a/src/d/actor/d_a_npc_hanjo.cpp +++ b/src/d/actor/d_a_npc_hanjo.cpp @@ -15,12 +15,14 @@ #include "Z2AudioLib/Z2Instances.h" #include -static int l_bmdData[4][2] = { +#include "helpers/string.hpp" + +static DUSK_CONSTEXPR int l_bmdData[4][2] = { {14, 1}, {26, 2}, {25, 2}, {3, 4}, }; -static daNpcT_evtData_c l_evtList[11] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[11] = { {"", 0}, {"NO_RESPONSE", 0}, {"CONVERSATION_ABOUT_SARU01", 5}, @@ -36,7 +38,7 @@ static daNpcT_evtData_c l_evtList[11] = { -static char* l_resNameList[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[6] = { "", "Hanjo", "Hanjo1", @@ -45,13 +47,13 @@ static char* l_resNameList[6] = { "Sera", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { 1, 2, -1, }; -static s8 l_loadResPtrn1[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[5] = { 1, 2, 3, @@ -59,11 +61,11 @@ static s8 l_loadResPtrn1[5] = { -1, }; -static s8 l_loadResPtrn2[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[2] = { 1, -1 }; -static s8 l_loadResPtrn9[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = { 1, 2, 3, @@ -71,12 +73,12 @@ static s8 l_loadResPtrn9[5] = { -1, }; -static s8* l_loadResPtrnList[5] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[5] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn2, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, 0, 0, 20, 2, 1, 1}, {7, 0, 1, 20, 2, 1, 1}, {7, 0, 2, 34, 0, 2, 0}, @@ -89,7 +91,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { { 11, 2, 2, 38, 2, 2, 0}, }; -static int l_motionAnmData[161] = { +static DUSK_CONSTEXPR int l_motionAnmData[161] = { 11, 2, 1, 17, 0, 1, 65536, 22, 2, 2, 17, 0, 1, 65536, 16, 2, 2, 17, 0, 1, 65536, 13, 2, 2, 17, 0, 1, 65536, 21, 2, 2, 31, 2, 2, 0, 20, 0, 2, 30, 0, 2, 0, 14, 0, 2, 29, 0, 2, 0, 8, 2, 1, 17, 0, 1, 65536, 6, 0, 1, 17, 0, 1, 65536, @@ -99,13 +101,13 @@ static int l_motionAnmData[161] = { 10, 0, 3, 17, 0, 1, 65536, 9, 0, 1, 17, 0, 1, 65536, 11, 0, 3, 17, 0, 1, 65536, 10, 0, 1, 17, 0, 1, 65536, -1, 0, 0, 17, 0, 1, 65536}; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[32] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[32] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {4, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}}; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {21, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {11, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {12, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, @@ -119,7 +121,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { {-1, 0, 0}, {-1, 0, 0}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}}; -char* daNpc_Hanjo_c::mCutNameList[6] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Hanjo_c::mCutNameList[6] = { "", "CONVERSATION_ABOUT_SARU", "CONVERSATION", @@ -128,7 +130,7 @@ char* daNpc_Hanjo_c::mCutNameList[6] = { "DIVE", }; -daNpc_Hanjo_c::cutFunc daNpc_Hanjo_c::mCutList[6] = { +DUSK_GAME_DATA daNpc_Hanjo_c::cutFunc DUSK_CONST daNpc_Hanjo_c::mCutList[6] = { NULL, &daNpc_Hanjo_c::cutConversationAboutSaru, &daNpc_Hanjo_c::cutConversation, @@ -137,11 +139,11 @@ daNpc_Hanjo_c::cutFunc daNpc_Hanjo_c::mCutList[6] = { &daNpc_Hanjo_c::cutDive, }; -dCcD_SrcSph daNpc_Hanjo_c::mStoneCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph DUSK_CONST daNpc_Hanjo_c::mStoneCcDSph = { daNpc_Hanjo_c::mStoneCcDObjInfo, {} }; -daNpc_Hanjo_HIOParam const daNpc_Hanjo_Param_c::m = { +DUSK_GAME_DATA daNpc_Hanjo_HIOParam const daNpc_Hanjo_Param_c::m = { 160.0f, -3.0f, 1.0f, 400.0f, 255.0f, 160.0f, 35.0f, 30.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f, 3, 6, 5, 6, 110.0f, 500.0f, 300.0f, -300.0f, 60, 8, 0, 0, 0, 0, 0, @@ -150,7 +152,7 @@ daNpc_Hanjo_HIOParam const daNpc_Hanjo_Param_c::m = { 80.0f, 65.0f, 4.0f, 600.0f, 136.0f, 0x500, 90, 90, 2, }; -dCcD_SrcGObjInf const daNpc_Hanjo_c::mStoneCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daNpc_Hanjo_c::mStoneCcDObjInfo = { {0, {{0, 0, 0}, {0, 0}, {0x79}}}, {0, 0, 0, 0, {0}}, {0, 0, 0, 0, {0}}, @@ -1336,8 +1338,8 @@ int daNpc_Hanjo_c::cutAppearHawker(int param_1) { home.angle.y += 0x8000; setAngle(home.angle.y); initTalk(0xcf, NULL); - strcpy(acStack_98, l_evtList[9].eventName); - strcat(acStack_98, "@"); + SAFE_STRCPY(acStack_98, l_evtList[9].eventName); + SAFE_STRCAT(acStack_98, "@"); dComIfGp_getEvent()->setSkipZev(this, acStack_98); dComIfGp_getEvent()->onSkipFade(); dComIfGp_getVibration().StartShock( 9, 15, cXyz(0.0f, 1.0f, 0.0f)); @@ -1951,7 +1953,7 @@ static int daNpc_Hanjo_IsDelete(void* i_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_Hanjo_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Hanjo_MethodTable = { (process_method_func)daNpc_Hanjo_Create, (process_method_func)daNpc_Hanjo_Delete, (process_method_func)daNpc_Hanjo_Execute, @@ -1959,7 +1961,7 @@ static actor_method_class daNpc_Hanjo_MethodTable = { (process_method_func)daNpc_Hanjo_Draw, }; -actor_process_profile_definition g_profile_NPC_HANJO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_HANJO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_henna.cpp b/src/d/actor/d_a_npc_henna.cpp index 40dd9b3091..dc02aeb08d 100644 --- a/src/d/actor/d_a_npc_henna.cpp +++ b/src/d/actor/d_a_npc_henna.cpp @@ -2850,13 +2850,13 @@ static int daNpc_Henna_Create(fopAc_ac_c* i_this) { return loadResult; } -static actor_method_class l_daNpc_Henna_Method = { +static DUSK_CONST actor_method_class l_daNpc_Henna_Method = { (process_method_func)daNpc_Henna_Create, (process_method_func)daNpc_Henna_Delete, (process_method_func)daNpc_Henna_Execute, (process_method_func)daNpc_Henna_IsDelete, (process_method_func)daNpc_Henna_Draw, }; -actor_process_profile_definition g_profile_NPC_HENNA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_HENNA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_henna0.cpp b/src/d/actor/d_a_npc_henna0.cpp index 2c9b53fe3f..199e0b2ca5 100644 --- a/src/d/actor/d_a_npc_henna0.cpp +++ b/src/d/actor/d_a_npc_henna0.cpp @@ -6,7 +6,7 @@ #include "d/dolzel_rel.h" // IWYU pragma: keep #include "d/actor/d_a_npc_henna0.h" -actor_process_profile_definition g_profile_NPC_HENNA0 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_HENNA0 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_hoz.cpp b/src/d/actor/d_a_npc_hoz.cpp index e8d537c9fe..48e3fe4f5e 100644 --- a/src/d/actor/d_a_npc_hoz.cpp +++ b/src/d/actor/d_a_npc_hoz.cpp @@ -11,12 +11,12 @@ #include "d/d_meter2_info.h" #include -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {13, 1}, {3, 2}, }; -static daNpcT_evtData_c l_evtList[9] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[9] = { {"", 0}, {"BOAT_RACE", 1}, {"BOAT_RACE_RETURN", 1}, @@ -28,7 +28,7 @@ static daNpcT_evtData_c l_evtList[9] = { {"TALK_BREAK", 1}, }; -static char* l_resNameList[7] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[7] = { "", "Hoz", "Hoz_TW", @@ -38,7 +38,7 @@ static char* l_resNameList[7] = { "Hoz2_3", }; -static s8 l_loadResPtrn0[] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[] = { 1, 2, -1, @@ -46,7 +46,7 @@ static s8 l_loadResPtrn0[] = { static s8 l_loadResPtrnTW[] = {1, 2, 3, -1}; -static s8 l_loadResPtrn1[] = {1, 4, 6, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[] = {1, 4, 6, -1}; static s8 l_loadResPtrnBattle[] = { 1, @@ -56,13 +56,13 @@ static s8 l_loadResPtrnBattle[] = { -1, }; -static s8* l_loadResPtrnList[7] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[7] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrnBattle, l_loadResPtrnTW, l_loadResPtrn1, l_loadResPtrnTW, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[39] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[39] = { {-1, 0, 0, 19, 2, 1, 1}, {8, 0, 1, 19, 2, 1, 1}, {7, 2, 1, 19, 2, 1, 1}, @@ -104,7 +104,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[39] = { {22, 2, 4, 19, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[39] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[39] = { {10, 2, 1, 16, 0, 1, 1, 0}, {9, 0, 1, 16, 0, 1, 1, 0}, {19, 2, 3, 16, 0, 1, 1, 0}, @@ -146,7 +146,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[39] = { {7, 2, 4, 16, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[140] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[140] = { {1, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {10, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -167,7 +167,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[140] {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[144] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[144] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -188,7 +188,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[144] = { {29, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Hoz_c::mCutNameList[8] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Hoz_c::mCutNameList[8] = { "", "BOAT_RACE", "BEFORE_BATTLE", @@ -199,7 +199,7 @@ char* daNpc_Hoz_c::mCutNameList[8] = { "TALK_BREAK", }; -daNpc_Hoz_c::cutFunc daNpc_Hoz_c::mCutList[] = { +DUSK_GAME_DATA daNpc_Hoz_c::cutFunc DUSK_CONST daNpc_Hoz_c::mCutList[] = { NULL, &daNpc_Hoz_c::ECut_boatRace, &daNpc_Hoz_c::ECut_beforeBattle, @@ -210,7 +210,7 @@ daNpc_Hoz_c::cutFunc daNpc_Hoz_c::mCutList[] = { &daNpc_Hoz_c::ECut_talkBreak, }; -const daNpc_Hoz_HIOParam daNpc_Hoz_Param_c::m = { +DUSK_GAME_DATA const daNpc_Hoz_HIOParam daNpc_Hoz_Param_c::m = { 60.0f, -3.0f, 1.0f, @@ -1686,7 +1686,7 @@ static int daNpc_Hoz_IsDelete(void* i_this) { return true; } -static actor_method_class daNpc_Hoz_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Hoz_MethodTable = { (process_method_func)daNpc_Hoz_Create, (process_method_func)daNpc_Hoz_Delete, (process_method_func)daNpc_Hoz_Execute, @@ -1694,7 +1694,7 @@ static actor_method_class daNpc_Hoz_MethodTable = { (process_method_func)daNpc_Hoz_Draw, }; -actor_process_profile_definition g_profile_NPC_HOZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_HOZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_impal.cpp b/src/d/actor/d_a_npc_impal.cpp index 3b9a14f524..5ac057ce06 100644 --- a/src/d/actor/d_a_npc_impal.cpp +++ b/src/d/actor/d_a_npc_impal.cpp @@ -9,7 +9,7 @@ #include "d/actor/d_a_npc.h" #include -daNpcImpal_HIOParam const daNpcImpal_Param_c::m = { +DUSK_GAME_DATA daNpcImpal_HIOParam const daNpcImpal_Param_c::m = { 135.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -48,36 +48,36 @@ daNpcImpal_HIOParam const daNpcImpal_Param_c::m = { static NPC_IMPAL_HIO_CLASS l_HIO; -static daNpc_GetParam2 l_bckGetParamList[18] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[18] = { {-1, 2, 0}, {14, 0, 0}, {8, 0, 0}, {7, 2, 0}, {11, 0, 0}, {13, 0, 0}, {12, 0, 0}, {15, 2, 0}, {17, 2, 0}, {16, 2, 0}, {22, 2, 0}, {19, 2, 0}, {23, 2, 0}, {18, 0, 0}, {21, 0, 0}, {20, 0, 0}, {10, 0, 0}, {9, 2, 0}, }; -static daNpc_GetParam2 l_btpGetParamList[10] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[10] = { {35, 2, 0}, {41, 2, 0}, {37, 0, 0}, {36, 2, 0}, {38, 2, 0}, {40, 2, 0}, {39, 0, 0}, {42, 2, 0}, {44, 2, 0}, {43, 2, 0}, }; -static daNpc_GetParam2 l_btkGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[4] = { {29, 2, 0}, {32, 2, 0}, {31, 0, 0}, {30, 2, 0}, }; -static char* l_arcNames[1] = {"impal"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[1] = {"impal"}; -static char* l_evtNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[4] = { NULL, "IMPAL_APPEAR1", "IMPAL_APPEAR2", "IMPAL_COPYROD", }; -static Vec l_resetPos = {2536.763671875f, 99.99166107177734f, -1154.2318115234375f}; +static DUSK_CONSTEXPR Vec l_resetPos = {2536.763671875f, 99.99166107177734f, -1154.2318115234375f}; -static char* l_myName = "impal"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "impal"; #if DEBUG daNpcImpal_HIO_c::daNpcImpal_HIO_c() { @@ -91,7 +91,7 @@ void daNpcImpal_HIO_c::genMessage(JORMContext* ctext) { } #endif -daNpcImpal_c::EventFn daNpcImpal_c::mEvtSeqList[4] = { +DUSK_GAME_DATA daNpcImpal_c::EventFn daNpcImpal_c::mEvtSeqList[4] = { NULL, &daNpcImpal_c::EvCut_ImpalAppear1, &daNpcImpal_c::EvCut_ImpalAppear2, @@ -328,13 +328,13 @@ int daNpcImpal_c::step(s16 i_angle, int i_animate) { } void daNpcImpal_c::playExpression() { - daNpcF_anmPlayData dat0 = {ANM_1, mpHIO->m.common.morf_frame, 1}; + daNpcF_anmPlayData dat0 = {ANM_1, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)}; daNpcF_anmPlayData* pDat0[1] = {&dat0}; - daNpcF_anmPlayData dat1 = {ANM_5, mpHIO->m.common.morf_frame, 1}; + daNpcF_anmPlayData dat1 = {ANM_5, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)}; daNpcF_anmPlayData* pDat1[1] = {&dat1}; - daNpcF_anmPlayData dat2 = {ANM_4, mpHIO->m.common.morf_frame, 1}; + daNpcF_anmPlayData dat2 = {ANM_4, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)}; daNpcF_anmPlayData* pDat2[1] = {&dat2}; - daNpcF_anmPlayData dat3 = {ANM_6, mpHIO->m.common.morf_frame, 1}; + daNpcF_anmPlayData dat3 = {ANM_6, mpHIO->m.common.morf_frame, DUSK_IF_ELSE(0, 1)}; daNpcF_anmPlayData* pDat3[1] = {&dat3}; daNpcF_anmPlayData dat4 = {ANM_8, mpHIO->m.common.morf_frame, 0}; daNpcF_anmPlayData* pDat4[1] = {&dat4}; @@ -1231,13 +1231,13 @@ BOOL daNpcImpal_c::drawDbgInfo() { return FALSE; } -static actor_method_class daNpcImpal_MethodTable = { +static DUSK_CONST actor_method_class daNpcImpal_MethodTable = { (process_method_func)daNpcImpal_Create, (process_method_func)daNpcImpal_Delete, (process_method_func)daNpcImpal_Execute, (process_method_func)daNpcImpal_IsDelete, (process_method_func)daNpcImpal_Draw, }; -actor_process_profile_definition g_profile_NPC_IMPAL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_IMPAL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_inko.cpp b/src/d/actor/d_a_npc_inko.cpp index 4d55a31f8e..0dd4645156 100644 --- a/src/d/actor/d_a_npc_inko.cpp +++ b/src/d/actor/d_a_npc_inko.cpp @@ -484,7 +484,7 @@ static int daNpc_Inko_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daNpc_Inko_Method = { +static DUSK_CONST actor_method_class l_daNpc_Inko_Method = { (process_method_func)daNpc_Inko_Create, (process_method_func)daNpc_Inko_Delete, (process_method_func)daNpc_Inko_Execute, @@ -492,7 +492,7 @@ static actor_method_class l_daNpc_Inko_Method = { (process_method_func)daNpc_Inko_Draw, }; -actor_process_profile_definition g_profile_NPC_INKO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_INKO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ins.cpp b/src/d/actor/d_a_npc_ins.cpp index f3636747b6..0ce91ca914 100644 --- a/src/d/actor/d_a_npc_ins.cpp +++ b/src/d/actor/d_a_npc_ins.cpp @@ -215,7 +215,7 @@ enum Type { static NPC_INS_HIO_CLASS l_HIO; -static daNpc_GetParam2 l_bckGetParamList[24] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[24] = { {-1, J3DFrameCtrl::EMode_LOOP, INS}, {BCK_INS_F_TALK_A, J3DFrameCtrl::EMode_NONE, INS}, {BCK_INS_F_SNIFF, J3DFrameCtrl::EMode_NONE, INS}, @@ -242,7 +242,7 @@ static daNpc_GetParam2 l_bckGetParamList[24] = { {BCK_INS_K_STEP, J3DFrameCtrl::EMode_NONE, INS2}, }; -static daNpc_GetParam2 l_btpGetParamList[8] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[8] = { {BTP_INS, J3DFrameCtrl::EMode_LOOP, INS}, {BTP_INS_F_SNIFF, J3DFrameCtrl::EMode_NONE, INS}, {BTP_INS_F_SURPRISED, J3DFrameCtrl::EMode_NONE, INS}, @@ -253,7 +253,7 @@ static daNpc_GetParam2 l_btpGetParamList[8] = { {BTP_INS_FH_MAD, J3DFrameCtrl::EMode_LOOP, INS}, }; -static daNpc_GetParam2 l_btkGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[2] = { {BTK_INS, J3DFrameCtrl::EMode_LOOP, INS}, {BTK_INS_SNIFF, J3DFrameCtrl::EMode_NONE, INS1}, }; @@ -270,25 +270,25 @@ static int l_loadRes_INS2[3] = { INS, INS2, -1, }; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_INS0, l_loadRes_INS1, l_loadRes_INS2, }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "Ins", "Ins1", "Ins2", }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL, }; -static char* l_myName = "ins"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "ins"; -daNpcIns_c::eventFunc daNpcIns_c::mEvtSeqList[1] = { +DUSK_GAME_DATA daNpcIns_c::eventFunc daNpcIns_c::mEvtSeqList[1] = { NULL, }; @@ -319,7 +319,7 @@ static insect_param_data const l_insectParams[24] = { {0x01A8, 0x714, 0, 0}, }; -daNpcIns_HIOParam const daNpcIns_Param_c::m = { +DUSK_GAME_DATA daNpcIns_HIOParam const daNpcIns_Param_c::m = { 35.0f, -3.0f, 1.0f, @@ -1803,7 +1803,7 @@ static int daNpcIns_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpcIns_MethodTable = { +static DUSK_CONST actor_method_class daNpcIns_MethodTable = { (process_method_func)daNpcIns_Create, (process_method_func)daNpcIns_Delete, (process_method_func)daNpcIns_Execute, @@ -1811,7 +1811,7 @@ static actor_method_class daNpcIns_MethodTable = { (process_method_func)daNpcIns_Draw, }; -actor_process_profile_definition g_profile_NPC_INS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_INS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_jagar.cpp b/src/d/actor/d_a_npc_jagar.cpp index 29902a3e3e..fce6435a04 100644 --- a/src/d/actor/d_a_npc_jagar.cpp +++ b/src/d/actor/d_a_npc_jagar.cpp @@ -138,7 +138,7 @@ enum Event { /* 0x8 */ EVENT_FIND_WOLF_VER2, }; -daNpc_Jagar_HIOParam const daNpc_Jagar_Param_c::m = { +DUSK_GAME_DATA daNpc_Jagar_HIOParam const daNpc_Jagar_Param_c::m = { 170.0f, -3.0f, 1.0f, 400.0f, 255.0f, 160.0f, 35.0f, 30.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f, @@ -176,11 +176,11 @@ void daNpc_Jagar_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_JAGAR, 1}, }; -static daNpcT_evtData_c l_evtList[9] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[9] = { {"", 0}, {"NO_RESPONSE", 0}, {"CLIMBUP", 2}, @@ -192,7 +192,7 @@ static daNpcT_evtData_c l_evtList[9] = { {"FIND_WOLF_VER2", 3}, }; -static char* l_resNameList[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[5] = { "", "Jagar", "Jagar1", @@ -200,26 +200,26 @@ static char* l_resNameList[5] = { "Jagar3", }; -static s8 l_loadResPtrn0[4] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = { 1, 2, 4, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { 1, 3, -1 }; -static s8 l_loadResPtrn9[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = { 1, 2, 3, 4, -1 }; -static s8* l_loadResPtrnList[4] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn9, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_JAGA, J3DFrameCtrl::EMode_LOOP, Jagar, 1}, {BCK_JAGA_F_TALK_A, J3DFrameCtrl::EMode_NONE, Jagar, @@ -242,7 +242,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { BTP_JAGA_F_SURPRISE_WAIT, J3DFrameCtrl::EMode_LOOP, Jagar2, 0}, }; -daNpcT_motionAnmData_c l_motionAnmData[18] = { +DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[18] = { {BCK_JAGAR_WAIT_A, J3DFrameCtrl::EMode_LOOP, Jagar, BTK_JAGA, J3DFrameCtrl::EMode_NONE, Jagar, 1, 0}, {BCK_JAGA_CHU, J3DFrameCtrl::EMode_LOOP, Jagar1, @@ -281,7 +281,7 @@ daNpcT_motionAnmData_c l_motionAnmData[18] = { BTK_JAGA, J3DFrameCtrl::EMode_NONE, Jagar, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = { {1, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {6, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -293,7 +293,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -315,7 +315,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { {13, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Jagar_c::mCutNameList[7] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Jagar_c::mCutNameList[7] = { "", "CLIMBUP", "NEED_YOUR_HELP", @@ -325,7 +325,7 @@ char* daNpc_Jagar_c::mCutNameList[7] = { "FIND_WOLF", }; -daNpc_Jagar_c::cutFunc daNpc_Jagar_c::mCutList[7] = { +DUSK_GAME_DATA daNpc_Jagar_c::cutFunc DUSK_CONST daNpc_Jagar_c::mCutList[7] = { NULL, &daNpc_Jagar_c::cutClimbUp, &daNpc_Jagar_c::cutNeedYourHelp, @@ -1783,7 +1783,7 @@ static int daNpc_Jagar_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Jagar_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Jagar_MethodTable = { (process_method_func)daNpc_Jagar_Create, (process_method_func)daNpc_Jagar_Delete, (process_method_func)daNpc_Jagar_Execute, @@ -1791,7 +1791,7 @@ static actor_method_class daNpc_Jagar_MethodTable = { (process_method_func)daNpc_Jagar_Draw, }; -actor_process_profile_definition g_profile_NPC_JAGAR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_JAGAR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kakashi.cpp b/src/d/actor/d_a_npc_kakashi.cpp index a285c41b98..6a3f72241f 100644 --- a/src/d/actor/d_a_npc_kakashi.cpp +++ b/src/d/actor/d_a_npc_kakashi.cpp @@ -11,13 +11,13 @@ #include "Z2AudioLib/Z2Instances.h" #include -static int l_bmdData[3][2] = { +static DUSK_CONSTEXPR int l_bmdData[3][2] = { {10, 1}, {8, 1}, {9, 1}, }; -static daNpcT_evtData_c l_evtList[21] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[21] = { {"", 0}, {"NO_RESPONSE", 0}, {"MAROS_WHISPER", 1}, @@ -41,55 +41,55 @@ static daNpcT_evtData_c l_evtList[21] = { {"SWDTUTORIAL_JUMPGIRI_CLEAR2", 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Kakashi", }; -static s8 l_loadResPtrn0[] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[] = {1, -1}; -static s8* l_loadResPtrnList[6] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[6] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, NULL, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, 0, 0, -1, 0, 0, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {-1, 0, 0, -1, 0, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Kakashi_c::mCutNameList[4] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Kakashi_c::mCutNameList[4] = { "", "SWDTUTORIAL", "GET_WOODSWD", "MAROS_WHISPER", }; -int (daNpc_Kakashi_c::*daNpc_Kakashi_c::mCutList[])(int) = { +DUSK_GAME_DATA int (daNpc_Kakashi_c::* DUSK_CONST daNpc_Kakashi_c::mCutList[])(int) = { NULL, &daNpc_Kakashi_c::cutSwdTutorial, &daNpc_Kakashi_c::cutGetWoodSwd, &daNpc_Kakashi_c::cutMarosWhisper, }; -const daNpc_Kakashi_HIOParam daNpc_Kakashi_Param_c::m = { +DUSK_GAME_DATA const daNpc_Kakashi_HIOParam daNpc_Kakashi_Param_c::m = { 190.0f, -6.0f, 1.0f, @@ -1163,7 +1163,7 @@ static int daNpc_Kakashi_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Kakashi_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Kakashi_MethodTable = { (process_method_func)daNpc_Kakashi_Create, (process_method_func)daNpc_Kakashi_Delete, (process_method_func)daNpc_Kakashi_Execute, @@ -1171,7 +1171,7 @@ static actor_method_class daNpc_Kakashi_MethodTable = { (process_method_func)daNpc_Kakashi_Draw, }; -actor_process_profile_definition g_profile_NPC_KAKASHI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KAKASHI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kasi_hana.cpp b/src/d/actor/d_a_npc_kasi_hana.cpp index 9d2ff8b8b5..e7191118a6 100644 --- a/src/d/actor/d_a_npc_kasi_hana.cpp +++ b/src/d/actor/d_a_npc_kasi_hana.cpp @@ -518,7 +518,7 @@ void daNpcKasi_Mng_c::chgWeightLight() { } } -static daNpc_GetParam2 l_bckGetParamList[15] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[15] = { {BCK_MICH_IYAN_WAIT, J3DFrameCtrl::EMode_LOOP, GIRLS}, {BCK_MICH_KYA_TALK, J3DFrameCtrl::EMode_LOOP, GIRLS}, {BCK_MICH_OUEN_WAIT_A, J3DFrameCtrl::EMode_LOOP, GIRLS}, @@ -536,17 +536,17 @@ static daNpc_GetParam2 l_bckGetParamList[15] = { {BCK_W_2NORMALTALK_B, J3DFrameCtrl::EMode_NONE, WGENERAL}, }; -static daNpc_GetParam2 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[1] = { {BTP_HANA, J3DFrameCtrl::EMode_LOOP, KASI_HANA}, }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "kasi_hana", "girls", "Wgeneral", }; -static char* l_evtNames[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[6] = { NULL, "KASIMASI_APPEAR", "KASIMASI_TALK", @@ -555,9 +555,9 @@ static char* l_evtNames[6] = { "KASIMASI_CHEER2", }; -static char* l_myName = "kasi_hana"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "kasi_hana"; -daNpcKasiHana_HIOParam const daNpcKasiHana_Param_c::m = { +DUSK_GAME_DATA daNpcKasiHana_HIOParam const daNpcKasiHana_Param_c::m = { 55.0f, -3.0f, 1.0f, @@ -611,7 +611,7 @@ void daNpcKasiHana_HIO_c::genMessage(JORMContext* ctext) { } #endif -daNpcKasiHana_c::EventFn daNpcKasiHana_c::mEvtSeqList[6] = { +DUSK_GAME_DATA daNpcKasiHana_c::EventFn daNpcKasiHana_c::mEvtSeqList[6] = { NULL, &daNpcKasiHana_c::_Evt_Kasi_Appear, &daNpcKasiHana_c::_Evt_Kasi_Talk, @@ -1469,11 +1469,11 @@ int daNpcKasiHana_c::fear(int param_1) { return 1; } -daTagEscape_c* daNpcKasiHana_c::mTargetTag; +DUSK_GAME_DATA daTagEscape_c* daNpcKasiHana_c::mTargetTag; -f32 daNpcKasiHana_c::mTargetTagDist; +DUSK_GAME_DATA f32 daNpcKasiHana_c::mTargetTagDist; -s16 daNpcKasiHana_c::mWolfAngle; +DUSK_GAME_DATA s16 daNpcKasiHana_c::mWolfAngle; daTagEscape_c* daNpcKasiHana_c::srchWolfTag() { mTargetTag = NULL; @@ -2301,7 +2301,7 @@ static int daNpcKasiHana_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpcKasiHana_MethodTable = { +static DUSK_CONST actor_method_class daNpcKasiHana_MethodTable = { (process_method_func)daNpcKasiHana_Create, (process_method_func)daNpcKasiHana_Delete, (process_method_func)daNpcKasiHana_Execute, @@ -2309,7 +2309,7 @@ static actor_method_class daNpcKasiHana_MethodTable = { (process_method_func)daNpcKasiHana_Draw, }; -actor_process_profile_definition g_profile_NPC_KASIHANA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KASIHANA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kasi_kyu.cpp b/src/d/actor/d_a_npc_kasi_kyu.cpp index d3d3782a3f..86ef71380e 100644 --- a/src/d/actor/d_a_npc_kasi_kyu.cpp +++ b/src/d/actor/d_a_npc_kasi_kyu.cpp @@ -105,7 +105,7 @@ enum Motion { static NPC_KASI_KYU_HIO_CLASS l_HIO; -static daNpc_GetParam2 l_bckGetParamList[16] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[16] = { {BCK_MICH_IYAN_WAIT, J3DFrameCtrl::EMode_LOOP, GIRLS}, {BCK_MICH_KYA_TALK, J3DFrameCtrl::EMode_LOOP, GIRLS}, {BCK_MICH_OUEN_WAIT_A, J3DFrameCtrl::EMode_LOOP, GIRLS}, @@ -124,27 +124,27 @@ static daNpc_GetParam2 l_bckGetParamList[16] = { {BCK_W_2NORMALTALK_A, J3DFrameCtrl::EMode_NONE, WGENERAL}, }; -static daNpc_GetParam2 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[1] = { {BTP_KYU, J3DFrameCtrl::EMode_LOOP, KASI_KYU}, }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "kasi_kyu", "girls", "Wgeneral", }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL, }; -static char* l_myName = "kasi_kyu"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "kasi_kyu"; -daNpcKasiKyu_c::EventFn daNpcKasiKyu_c::mEvtSeqList[1] = { +DUSK_GAME_DATA daNpcKasiKyu_c::EventFn DUSK_CONST daNpcKasiKyu_c::mEvtSeqList[1] = { NULL }; -daNpcKasiKyu_HIOParam const daNpcKasiKyu_Param_c::m = { +DUSK_GAME_DATA daNpcKasiKyu_HIOParam const daNpcKasiKyu_Param_c::m = { 55.0f, -3.0f, 1.0f, @@ -366,11 +366,11 @@ void daNpcKasiKyu_c::setParam() { attention_info.flags = fopAc_AttnFlag_SPEAK_e | fopAc_AttnFlag_TALK_e; } -daTagEscape_c* daNpcKasiKyu_c::mTargetTag; +DUSK_GAME_DATA daTagEscape_c* daNpcKasiKyu_c::mTargetTag; -f32 daNpcKasiKyu_c::mTargetTagDist; +DUSK_GAME_DATA f32 daNpcKasiKyu_c::mTargetTagDist; -s16 daNpcKasiKyu_c::mWolfAngle; +DUSK_GAME_DATA s16 daNpcKasiKyu_c::mWolfAngle; BOOL daNpcKasiKyu_c::main() { if (mSygnal >= 0) { @@ -1416,7 +1416,7 @@ static int daNpcKasiKyu_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpcKasiKyu_MethodTable = { +static DUSK_CONST actor_method_class daNpcKasiKyu_MethodTable = { (process_method_func)daNpcKasiKyu_Create, (process_method_func)daNpcKasiKyu_Delete, (process_method_func)daNpcKasiKyu_Execute, @@ -1424,7 +1424,7 @@ static actor_method_class daNpcKasiKyu_MethodTable = { (process_method_func)daNpcKasiKyu_Draw, }; -actor_process_profile_definition g_profile_NPC_KASIKYU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KASIKYU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kasi_mich.cpp b/src/d/actor/d_a_npc_kasi_mich.cpp index a050bffc01..b5ffa90f47 100644 --- a/src/d/actor/d_a_npc_kasi_mich.cpp +++ b/src/d/actor/d_a_npc_kasi_mich.cpp @@ -105,7 +105,7 @@ enum Motion { static NPC_KASI_MICH_HIO_CLASS l_HIO; -static daNpc_GetParam2 l_bckGetParamList[16] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[16] = { {BCK_MICH_IYAN_WAIT, J3DFrameCtrl::EMode_LOOP, GIRLS}, {BCK_MICH_KYA_TALK, J3DFrameCtrl::EMode_LOOP, GIRLS}, {BCK_MICH_OUEN_WAIT_A, J3DFrameCtrl::EMode_LOOP, GIRLS}, @@ -124,27 +124,27 @@ static daNpc_GetParam2 l_bckGetParamList[16] = { {BCK_W_2NORMALTALK_B, J3DFrameCtrl::EMode_NONE, WGENERAL}, }; -static daNpc_GetParam2 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[1] = { {BTP_MICH, J3DFrameCtrl::EMode_LOOP, KASI_MICH}, }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "kasi_mich", "girls", "Wgeneral", }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL }; -static char* l_myName = "kasi_mich"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "kasi_mich"; -daNpcKasiMich_c::EventFn daNpcKasiMich_c::mEvtSeqList[1] = { +DUSK_GAME_DATA daNpcKasiMich_c::EventFn DUSK_CONST daNpcKasiMich_c::mEvtSeqList[1] = { NULL }; -daNpcKasiMich_HIOParam const daNpcKasiMich_Param_c::m = { +DUSK_GAME_DATA daNpcKasiMich_HIOParam const daNpcKasiMich_Param_c::m = { 55.0f, -3.0f, 1.0f, @@ -366,11 +366,11 @@ void daNpcKasiMich_c::setParam() { attention_info.flags = fopAc_AttnFlag_SPEAK_e | fopAc_AttnFlag_TALK_e; } -daTagEscape_c* daNpcKasiMich_c::mTargetTag; +DUSK_GAME_DATA daTagEscape_c* daNpcKasiMich_c::mTargetTag; -f32 daNpcKasiMich_c::mTargetTagDist; +DUSK_GAME_DATA f32 daNpcKasiMich_c::mTargetTagDist; -s16 daNpcKasiMich_c::mWolfAngle; +DUSK_GAME_DATA s16 daNpcKasiMich_c::mWolfAngle; BOOL daNpcKasiMich_c::main() { if (mSygnal >= 0) { @@ -1403,7 +1403,7 @@ static int daNpcKasiMich_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpcKasiMich_MethodTable = { +static DUSK_CONST actor_method_class daNpcKasiMich_MethodTable = { (process_method_func)daNpcKasiMich_Create, (process_method_func)daNpcKasiMich_Delete, (process_method_func)daNpcKasiMich_Execute, @@ -1411,7 +1411,7 @@ static actor_method_class daNpcKasiMich_MethodTable = { (process_method_func)daNpcKasiMich_Draw, }; -actor_process_profile_definition g_profile_NPC_KASIMICH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KASIMICH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kdk.cpp b/src/d/actor/d_a_npc_kdk.cpp index 0cbae54ae3..51736d173c 100644 --- a/src/d/actor/d_a_npc_kdk.cpp +++ b/src/d/actor/d_a_npc_kdk.cpp @@ -7,7 +7,7 @@ #include "d/actor/d_a_npc_kdk.h" -actor_process_profile_definition g_profile_NPC_KDK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KDK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kkri.cpp b/src/d/actor/d_a_npc_kkri.cpp index e4687ac2c2..9b6b17d2e9 100644 --- a/src/d/actor/d_a_npc_kkri.cpp +++ b/src/d/actor/d_a_npc_kkri.cpp @@ -9,12 +9,12 @@ #include "d/actor/d_a_e_ym.h" #include -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {35, 1}, {18, 2}, }; -static daNpcT_evtData_c l_evtList[5] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[5] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -22,23 +22,23 @@ static daNpcT_evtData_c l_evtList[5] = { {"YM_LOOK", 2}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Kkri", "Kkri_TW", }; -static s8 l_loadResPtrn0[] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[] = {1, -1}; -static s8 l_loadResPtrn1[] = {1, 2, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[] = {1, 2, -1}; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[15] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[15] = { {-1, 0, 0, 44, 2, 1, 1}, {13, 0, 1, 44, 2, 1, 1}, {11, 0, 1, 50, 0, 1, 0}, @@ -56,7 +56,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[15] = { {8, 0, 2, 26, 0, 2, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[21] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[21] = { {30, 2, 1, 38, 0, 1, 1, 0}, {31, 2, 1, 38, 0, 1, 1, 0}, {28, 2, 1, 38, 0, 1, 1, 0}, @@ -80,7 +80,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[21] = { {13, 0, 2, 38, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[60] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[60] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, @@ -143,7 +143,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[60] = {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -222,13 +222,13 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { {-1, 0, 0}, }; -char* daNpc_Kkri_c::mCutNameList[3] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Kkri_c::mCutNameList[3] = { "", "CONVERSATION_ABOUT_SOUP", "YM_LOOK", }; -int (daNpc_Kkri_c::*daNpc_Kkri_c::mCutList[])(int) = { +DUSK_GAME_DATA int (daNpc_Kkri_c::* DUSK_CONST daNpc_Kkri_c::mCutList[])(int) = { NULL, &daNpc_Kkri_c::cutConversationAboutSoup, &daNpc_Kkri_c::cutYmLook, @@ -236,7 +236,7 @@ int (daNpc_Kkri_c::*daNpc_Kkri_c::mCutList[])(int) = { static NPC_KKRI_HIO_CLASS l_HIO; -const daNpc_Kkri_HIOParam daNpc_Kkri_Param_c::m = { +DUSK_GAME_DATA const daNpc_Kkri_HIOParam daNpc_Kkri_Param_c::m = { 180.0f, -3.0f, 1.0f, @@ -1237,7 +1237,7 @@ static int daNpc_Kkri_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Kkri_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Kkri_MethodTable = { (process_method_func)daNpc_Kkri_Create, (process_method_func)daNpc_Kkri_Delete, (process_method_func)daNpc_Kkri_Execute, @@ -1245,7 +1245,7 @@ static actor_method_class daNpc_Kkri_MethodTable = { (process_method_func)daNpc_Kkri_Draw, }; -actor_process_profile_definition g_profile_NPC_KKRI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KKRI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kn.cpp b/src/d/actor/d_a_npc_kn.cpp index 63db584cda..1edecfe650 100644 --- a/src/d/actor/d_a_npc_kn.cpp +++ b/src/d/actor/d_a_npc_kn.cpp @@ -17,25 +17,25 @@ #include #endif -dCcD_SrcCyl daNpc_Kn_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daNpc_Kn_c::mCcDCyl = { mCcDObjData, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f}, } }; -dCcD_SrcSph daNpc_Kn_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daNpc_Kn_c::mCcDSph = { mCcDObjData, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSphCc }, }; -s16 daNpc_Kn_c::mSrchName; +DUSK_GAME_DATA s16 daNpc_Kn_c::mSrchName; -fopAc_ac_c* daNpc_Kn_c::mFindActorPtrs[50]; +DUSK_GAME_DATA fopAc_ac_c* daNpc_Kn_c::mFindActorPtrs[50]; -int daNpc_Kn_c::mFindCount; +DUSK_GAME_DATA int daNpc_Kn_c::mFindCount; void* dummy_srchActor(void* i_actor1, void* i_actor2) { // Fake function (though a similar one likely existed and got stripped out). @@ -59,7 +59,7 @@ void* dummy_srchActor(void* i_actor1, void* i_actor2) { return NULL; } -const dCcD_SrcGObjInf daNpc_Kn_c::mCcDObjData = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daNpc_Kn_c::mCcDObjData = { {0, {{0, 0, 0}, {0, 0}, {0x79}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 0}, @@ -68,7 +68,7 @@ const dCcD_SrcGObjInf daNpc_Kn_c::mCcDObjData = { #include "d/actor/d_a_npc_kn_base.inc" -const daNpc_Kn_HIOParam daNpc_Kn_Param_c::m = { +DUSK_GAME_DATA const daNpc_Kn_HIOParam daNpc_Kn_Param_c::m = { 50.0f, -5.0f, 1.0f, @@ -200,13 +200,13 @@ void daNpc_Kn_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[3][2] = { +static DUSK_CONSTEXPR int l_bmdData[3][2] = { {47, 1}, {48, 1}, {49, 1}, }; -static daNpcT_evtData_c l_evtList[26] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[26] = { {"", 0}, {"NONE_EQUIP_CHANGE_TALK", 1}, {"NONE_EQUIP_CHANGE_TALK_WAIT", 1}, @@ -235,7 +235,7 @@ static daNpcT_evtData_c l_evtList[26] = { {"SEVENTH_SKILL_GET_STAND", 8}, }; -static char* l_resNameList[9] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[9] = { "", "KN_a", "KN_tch01D", "KN_tch02D", "KN_tch03D", "KN_tch04D", "KN_tch05D", "KN_tch06D", "KN_tch07D", }; @@ -287,17 +287,17 @@ static s8 l_loadResPtrnTeach07[3] = { -1, }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[8] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[8] = { l_loadResPtrnTeach01, l_loadResPtrnTeach02, l_loadResPtrnTeach03, l_loadResPtrnTeach04, l_loadResPtrnTeach05, l_loadResPtrnTeach06, l_loadResPtrnTeach07, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, 0, 0, -1, 0, 0, 0}, {21, 0, 1, -1, 0, 0, 0}, }; @@ -322,7 +322,7 @@ static int l_podBckData[5][2] = { {32, 1}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -333,7 +333,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[132] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[132] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -468,7 +468,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[132] = { {-1, 0, 0}, }; -char* daNpc_Kn_c::mCutNameList[21] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Kn_c::mCutNameList[21] = { "", "NONE_EQUIP_CHANGE_TALK", "NO_EQ_CHNGE_TLK_STD", @@ -492,7 +492,7 @@ char* daNpc_Kn_c::mCutNameList[21] = { "SEVENTH_SKILL_GET", }; -daNpc_Kn_c::cutFunc daNpc_Kn_c::mCutList[21] = { +DUSK_GAME_DATA daNpc_Kn_c::cutFunc DUSK_CONST daNpc_Kn_c::mCutList[21] = { NULL, &daNpc_Kn_c::ECut_noneEquipChangeTalk, &daNpc_Kn_c::ECut_noneEquipChangeTalkStand, @@ -783,10 +783,10 @@ u8 daNpc_Kn_c::getPath() { } BOOL daNpc_Kn_c::isDelete() { - static s16 l_appearFlag[7] = { + static DUSK_CONSTEXPR s16 l_appearFlag[7] = { -1, 0x0153, 0x0152, 0x0154, 0x0155, 0x0156, 0x0157, }; - static s16 l_delFlag[7] = { + static DUSK_CONSTEXPR s16 l_delFlag[7] = { 0x0153, 0x0152, 0x0154, 0x0155, 0x0156, 0x0157, 0x0158, }; @@ -1224,7 +1224,7 @@ void daNpc_Kn_c::setCollision() { } void daNpc_Kn_c::setCollisionSword() { - static f32 l_swordOffset[2] = {60.0f, 120.0f}; + static DUSK_CONSTEXPR f32 l_swordOffset[2] = {60.0f, 120.0f}; if (mMotionSeqMngr.getNo() == 0x19 && mMotionSeqMngr.getStepNo() == 0 && mMotionSeqMngr.checkEntryNewMotion() == 0) @@ -5035,8 +5035,8 @@ void daNpc_Kn_c::setSwordChargePtcl() { { f32 frame = mpModelMorf[0]->getFrame(); if (frame >= 17.0f && frame < 37.0f) { - static cXyz lightAParticleScale(1.5223f, 1.3f, 1.3f); - static cXyz lightALocalTrans(88.399994f, 0.0f, 0.0f); + static DUSK_CONSTEXPR cXyz lightAParticleScale(1.5223f, 1.3f, 1.3f); + static DUSK_CONSTEXPR cXyz lightALocalTrans(88.399994f, 0.0f, 0.0f); f32 temp_f29 = 156.0f; f32 var_f30 = frame; @@ -5258,13 +5258,13 @@ static int daNpc_Kn_IsDelete(void* i_this) { #include "d/actor/d_a_npc_kn_teach02.inc" -static actor_method_class daNpc_Kn_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Kn_MethodTable = { (process_method_func)daNpc_Kn_Create, (process_method_func)daNpc_Kn_Delete, (process_method_func)daNpc_Kn_Execute, (process_method_func)daNpc_Kn_IsDelete, (process_method_func)daNpc_Kn_Draw, }; -actor_process_profile_definition g_profile_NPC_KN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kn_base.inc b/src/d/actor/d_a_npc_kn_base.inc index 79e8349c3b..28f4b8fba7 100644 --- a/src/d/actor/d_a_npc_kn_base.inc +++ b/src/d/actor/d_a_npc_kn_base.inc @@ -65,7 +65,7 @@ BOOL daNpc_Kn_c::setBtkAnm(J3DAnmTextureSRTKey* i_btk, J3DModelData* i_modelData return mBtkAnm.init(i_modelData, i_btk, TRUE, i_mode, i_speed, 0, -1); } -int daNpc_Kn_c::loadRes(const s8* i_ptrn_list, const char** i_arcname_list) { +int daNpc_Kn_c::loadRes(const s8* i_ptrn_list, const char* DUSK_CONST* i_arcname_list) { int phase; int resLoad_cnt = 0; @@ -91,7 +91,7 @@ int daNpc_Kn_c::loadRes(const s8* i_ptrn_list, const char** i_arcname_list) { return cPhs_INIT_e; } -void daNpc_Kn_c::deleteRes(const s8* i_ptrn_list, const char** i_arcname_list) { +void daNpc_Kn_c::deleteRes(const s8* i_ptrn_list, const char* DUSK_CONST* i_arcname_list) { for (int i = 0; i < 8 && i_ptrn_list[i] != -1; i++) { dComIfG_resDelete(&mPhase[i], i_arcname_list[i_ptrn_list[i]]); } diff --git a/src/d/actor/d_a_npc_knj.cpp b/src/d/actor/d_a_npc_knj.cpp index d92f09b170..cf40a06221 100644 --- a/src/d/actor/d_a_npc_knj.cpp +++ b/src/d/actor/d_a_npc_knj.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_npc_knj.h" #include -const daNpc_Knj_HIOParam daNpc_Knj_Param_c::m = { +DUSK_GAME_DATA const daNpc_Knj_HIOParam daNpc_Knj_Param_c::m = { 0.0f, // attention_offset 0.0f, // gravity 1.0f, // scale @@ -83,51 +83,51 @@ enum Motion { /* 0x00 */ MOT_UNK_0 = 0, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {9, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Knj", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[6] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[6] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, 0, 0, -1, 0, 0, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {6, 2, 1, -1, 0, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Knj_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Knj_c::mCutNameList[1] = {""}; -daNpc_Knj_c::cutFunc daNpc_Knj_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_Knj_c::cutFunc DUSK_CONST daNpc_Knj_c::mCutList[1] = { NULL, }; @@ -527,13 +527,13 @@ static int daNpc_Knj_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Knj_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Knj_MethodTable = { (process_method_func)daNpc_Knj_Create, (process_method_func)daNpc_Knj_Delete, (process_method_func)daNpc_Knj_Execute, (process_method_func)daNpc_Knj_IsDelete, (process_method_func)daNpc_Knj_Draw, }; -actor_process_profile_definition g_profile_NPC_KNJ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KNJ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kolin.cpp b/src/d/actor/d_a_npc_kolin.cpp index a7dd470d2b..3440f551e4 100644 --- a/src/d/actor/d_a_npc_kolin.cpp +++ b/src/d/actor/d_a_npc_kolin.cpp @@ -167,13 +167,13 @@ enum Event { /* 0x8 */ EVENT_CLOTH_TRY, }; -static int l_bmdData[3][2] = { +static DUSK_CONSTEXPR int l_bmdData[3][2] = { {BMDR_KOLIN, KOLIN}, {BMDR_KOLIN_TW, KOLIN_TW}, {BMDR_KOLIN_CLOTH, KOLIN2}, }; -static daNpcT_evtData_c l_evtList[9] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[9] = { {"", 0}, {"NO_RESPONSE", 0}, {"NO_RIDE_L", 3}, @@ -185,7 +185,7 @@ static daNpcT_evtData_c l_evtList[9] = { {"CLOTH_TRY", 3}, }; -static char* l_resNameList[8] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[8] = { "", "Kolin", "Kolin_TW", @@ -196,38 +196,38 @@ static char* l_resNameList[8] = { "Taro1", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { KOLIN, KOLIN1, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { KOLIN, KOLIN_TW, -1, }; -static s8 l_loadResPtrn2[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = { KOLIN, KOLIN2, -1, }; -static s8 l_loadResPtrn3[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[5] = { KOLIN, KOLIN1, KOLIN2, KOLIN_TW, -1, }; -static s8 l_loadResPtrn4[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn4[3] = { KOLIN, KOLIN_P1, -1, }; -static s8 l_loadResPtrn9[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = { KOLIN, KOLIN1, KOLIN2, KOLIN_TW, -1, }; -static s8* l_loadResPtrnList[15] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[15] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn3, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn4, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_KOLIN, J3DFrameCtrl::EMode_LOOP, KOLIN, 1}, {BCK_KOLIN_F_WALK_A, J3DFrameCtrl::EMode_LOOP, KOLIN1, BTP_KOLIN_F_WALK_A, J3DFrameCtrl::EMode_LOOP, KOLIN1, 0}, {BCK_KOLIN_F_STONE, J3DFrameCtrl::EMode_NONE, KOLIN1, BTP_KOLIN_F_STONE, J3DFrameCtrl::EMode_NONE, KOLIN1, 0}, @@ -244,7 +244,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {BCK_KOLIN_F_CLUP, J3DFrameCtrl::EMode_NONE, KOLIN1, BTP_KOLIN_F_CLUP, J3DFrameCtrl::EMode_NONE, KOLIN1, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[21] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[21] = { {BCK_KOLIN_WAIT_A, J3DFrameCtrl::EMode_LOOP, KOLIN, BTK_KOLIN, J3DFrameCtrl::EMode_NONE, KOLIN, 1, 0}, {BCK_KOLIN_WAIT_B, J3DFrameCtrl::EMode_LOOP, KOLIN1, BTK_KOLIN, J3DFrameCtrl::EMode_NONE, KOLIN, 1, 0}, {BCK_KOLIN_WAIT_C, J3DFrameCtrl::EMode_LOOP, KOLIN1, BTK_KOLIN, J3DFrameCtrl::EMode_NONE, KOLIN, 1, 0}, @@ -268,7 +268,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[21] = { {BCK_KOLIN_CLOTH_TRY, J3DFrameCtrl::EMode_NONE, KOLIN2, BTK_KOLIN_CLOTH_TRY, J3DFrameCtrl::EMode_NONE, KOLIN2, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { {10, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -285,7 +285,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -308,7 +308,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { {20, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Kolin_c::mCutNameList[11] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Kolin_c::mCutNameList[11] = { "", "NO_RIDE", "HAIL", @@ -322,7 +322,7 @@ char* daNpc_Kolin_c::mCutNameList[11] = { "THANK_YOU", }; -daNpc_Kolin_c::cutFunc daNpc_Kolin_c::mCutList[11] = { +DUSK_GAME_DATA daNpc_Kolin_c::cutFunc DUSK_CONST daNpc_Kolin_c::mCutList[11] = { NULL, &daNpc_Kolin_c::cutNoRide, &daNpc_Kolin_c::cutHail, @@ -336,7 +336,7 @@ daNpc_Kolin_c::cutFunc daNpc_Kolin_c::mCutList[11] = { &daNpc_Kolin_c::cutThankYou }; -daNpc_Kolin_HIOParam const daNpc_Kolin_Param_c::m = { +DUSK_GAME_DATA daNpc_Kolin_HIOParam const daNpc_Kolin_Param_c::m = { 140.0f, -3.0f, 1.0f, @@ -2243,7 +2243,7 @@ static int daNpc_Kolin_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_Kolin_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Kolin_MethodTable = { (process_method_func)daNpc_Kolin_Create, (process_method_func)daNpc_Kolin_Delete, (process_method_func)daNpc_Kolin_Execute, @@ -2251,7 +2251,7 @@ static actor_method_class daNpc_Kolin_MethodTable = { (process_method_func)daNpc_Kolin_Draw, }; -actor_process_profile_definition g_profile_NPC_KOLIN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KOLIN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kolinb.cpp b/src/d/actor/d_a_npc_kolinb.cpp index fa76592483..caff7135a1 100644 --- a/src/d/actor/d_a_npc_kolinb.cpp +++ b/src/d/actor/d_a_npc_kolinb.cpp @@ -98,38 +98,38 @@ enum TYPE { /* 0x3 */ TYPE_3, }; -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {BMDR_KOLINB, KOLINB}, {BMDR_SRCB, ZRCB}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"", 0}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Kolinb", "zrCb", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { KOLINB, -1 }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { KOLINB, ZRCB, -1, }; -static s8* l_loadResPtrnList[4] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, NULL, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_KOLINB, J3DFrameCtrl::EMode_LOOP, KOLINB, 1}, {BCK_KOLINB_F_WAIT_A, J3DFrameCtrl::EMode_LOOP, KOLINB, BTP_KOLINB_F_WAIT_A, J3DFrameCtrl::EMode_LOOP, KOLINB, 0}, {BCK_KOLINB_F_SUFFER_A, J3DFrameCtrl::EMode_LOOP, KOLINB, BTP_KOLINB_F_SUFFER_A, J3DFrameCtrl::EMode_LOOP, KOLINB, 0}, @@ -142,7 +142,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {BCK_ZRCB_F_SUFFER_B, J3DFrameCtrl::EMode_LOOP, ZRCB, BTP_ZRCB_F_SUFFER_B, J3DFrameCtrl::EMode_LOOP, ZRCB, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[9] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[9] = { {BCK_KOLINB_WAIT_A, J3DFrameCtrl::EMode_LOOP, KOLINB, BTK_KOLINB, J3DFrameCtrl::EMode_NONE, KOLINB, 0, 0}, {BCK_KOLINB_SUFFER_A, J3DFrameCtrl::EMode_LOOP, KOLINB, BTK_KOLINB, J3DFrameCtrl::EMode_NONE, KOLINB, 0, 0}, {BCK_KOLINB_SUFFER_B, J3DFrameCtrl::EMode_LOOP, KOLINB, BTK_KOLINB, J3DFrameCtrl::EMode_NONE, KOLINB, 0, 0}, @@ -154,7 +154,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[9] = { {BCK_ZRCB_SUFFER_B, J3DFrameCtrl::EMode_LOOP, ZRCB, -1, J3DFrameCtrl::EMode_NONE, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {6, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -166,7 +166,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[36] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[32] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[32] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {5, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -177,7 +177,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[32] = { {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Kolinb_c::mCutNameList[7] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Kolinb_c::mCutNameList[7] = { "", "CONVERSATION_IN_HOTEL", "CONVERSATION_ABOUT_DEATHMT", @@ -187,7 +187,7 @@ char* daNpc_Kolinb_c::mCutNameList[7] = { "THANK_YOU", }; -daNpc_Kolinb_c::cutFunc daNpc_Kolinb_c::mCutList[7] = { +DUSK_GAME_DATA daNpc_Kolinb_c::cutFunc DUSK_CONST daNpc_Kolinb_c::mCutList[7] = { NULL, &daNpc_Kolinb_c::cutConversationInHotel, &daNpc_Kolinb_c::cutConversationAboutDeathMt, @@ -199,7 +199,7 @@ daNpc_Kolinb_c::cutFunc daNpc_Kolinb_c::mCutList[7] = { static NPC_KOLINB_HIO_CLASS l_HIO; -daNpc_Kolinb_HIOParam const daNpc_Kolinb_Param_c::m = { +DUSK_GAME_DATA daNpc_Kolinb_HIOParam const daNpc_Kolinb_Param_c::m = { 100.0f, -3.0f, 1.0f, @@ -935,7 +935,7 @@ static int daNpc_Kolinb_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpc_Kolinb_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Kolinb_MethodTable = { (process_method_func)daNpc_Kolinb_Create, (process_method_func)daNpc_Kolinb_Delete, (process_method_func)daNpc_Kolinb_Execute, @@ -943,7 +943,7 @@ static actor_method_class daNpc_Kolinb_MethodTable = { (process_method_func)daNpc_Kolinb_Draw, }; -actor_process_profile_definition g_profile_NPC_KOLINB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KOLINB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ks.cpp b/src/d/actor/d_a_npc_ks.cpp index 1d60f5a10a..222827df63 100644 --- a/src/d/actor/d_a_npc_ks.cpp +++ b/src/d/actor/d_a_npc_ks.cpp @@ -178,7 +178,7 @@ static void anm_init(npc_ks_class* i_this, int param_2, f32 i_morf, u8 i_attr, f param_2 = 42; } else { // bug: developers meant to set equal to 44? - param_2 == 44; + IF_NOT_DUSK(param_2 == 44); dComIfGs_shake_kandelaar(); } } @@ -6882,6 +6882,16 @@ static int daNpc_Ks_Delete(npc_ks_class* i_this) { i_this->model->stopZelAnime(); } +#if TARGET_PC + if (leader == i_this) { + leader = NULL; + } + + if (saru_p[i_this->set_id] == i_this) { + saru_p[i_this->set_id] = NULL; + } +#endif + return 1; } @@ -7315,7 +7325,7 @@ static void* s_check_sub(void* i_actor, void* i_data) { } static int daNpc_Ks_Create(fopAc_ac_c* actor) { - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fafd3f, 0x3}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -7455,7 +7465,7 @@ static int daNpc_Ks_Create(fopAc_ac_c* actor) { AUDIO_INSTANCES; -static actor_method_class l_daNpc_Ks_Method = { +static DUSK_CONST actor_method_class l_daNpc_Ks_Method = { (process_method_func)daNpc_Ks_Create, (process_method_func)daNpc_Ks_Delete, (process_method_func)daNpc_Ks_Execute, @@ -7463,7 +7473,7 @@ static actor_method_class l_daNpc_Ks_Method = { (process_method_func)daNpc_Ks_Draw, }; -actor_process_profile_definition g_profile_NPC_KS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_kyury.cpp b/src/d/actor/d_a_npc_kyury.cpp index 2ca6652468..15913aaf49 100644 --- a/src/d/actor/d_a_npc_kyury.cpp +++ b/src/d/actor/d_a_npc_kyury.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_npc_kyury.h" #include -const daNpc_Kyury_HIOParam daNpc_Kyury_Param_c::m = { +DUSK_GAME_DATA const daNpc_Kyury_HIOParam daNpc_Kyury_Param_c::m = { 200.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -52,40 +52,40 @@ const daNpc_Kyury_HIOParam daNpc_Kyury_Param_c::m = { 0.0f, // box_offset }; -static int l_bmdData[3][2] = { +static DUSK_CONSTEXPR int l_bmdData[3][2] = { {41, 1}, {42, 1}, {43, 1}, }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"NO_RESPONSE", 0}, {"FIRST_CONVERSATION", 2}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Kyury", "Kyury1", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8 l_loadResPtrn9[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[3] = { 1, 2, -1, }; -static s8* l_loadResPtrnList[4] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn9, l_loadResPtrn9, l_loadResPtrn9, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[17] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[17] = { {-1, 0, 0, 50, 2, 1, 1}, {22, 0, 1, 50, 2, 1, 1}, {23, 0, 1, 56, 0, 1, 0}, {24, 0, 1, 57, 0, 1, 0}, {19, 0, 1, 53, 0, 1, 0}, {21, 0, 1, 55, 0, 1, 0}, {25, 2, 1, 50, 2, 1, 1}, {27, 2, 1, 59, 2, 1, 0}, {11, 2, 1, 50, 2, 1, 1}, @@ -94,7 +94,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[17] = { {20, 0, 1, 54, 0, 1, 0}, {26, 2, 1, 58, 2, 1, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[16] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[16] = { {36, 2, 1, 46, 0, 1, 1, 0}, {37, 2, 1, 46, 0, 1, 1, 0}, {33, 0, 1, 46, 0, 1, 1, 0}, {34, 0, 1, 46, 0, 1, 1, 0}, {35, 0, 1, 46, 0, 1, 1, 0}, {38, 2, 1, 46, 0, 1, 1, 0}, {28, 0, 1, 46, 0, 1, 1, 0}, {29, 0, 1, 46, 0, 1, 1, 0}, {18, 2, 1, 46, 0, 1, 1, 0}, @@ -103,7 +103,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[16] = { {31, 0, 1, 46, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[64] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[64] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {15, -1, 1}, @@ -116,7 +116,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[64] = {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[52] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[52] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, @@ -127,12 +127,12 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[52] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Kyury_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Kyury_c::mCutNameList[2] = { "", "CONVERSATION", }; -daNpc_Kyury_c::cutFunc daNpc_Kyury_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_Kyury_c::cutFunc DUSK_CONST daNpc_Kyury_c::mCutList[2] = { NULL, &daNpc_Kyury_c::cutConversation, }; @@ -884,13 +884,13 @@ static int daNpc_Kyury_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Kyury_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Kyury_MethodTable = { (process_method_func)daNpc_Kyury_Create, (process_method_func)daNpc_Kyury_Delete, (process_method_func)daNpc_Kyury_Execute, (process_method_func)daNpc_Kyury_IsDelete, (process_method_func)daNpc_Kyury_Draw, }; -actor_process_profile_definition g_profile_NPC_KYURY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_KYURY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_len.cpp b/src/d/actor/d_a_npc_len.cpp index f61784592a..7b7acab6fd 100644 --- a/src/d/actor/d_a_npc_len.cpp +++ b/src/d/actor/d_a_npc_len.cpp @@ -44,7 +44,7 @@ enum Motion { /* 0x11 */ MOT_UNK_17 = 17, }; -const daNpc_Len_HIOParam daNpc_Len_Param_c::m = { +DUSK_GAME_DATA const daNpc_Len_HIOParam daNpc_Len_Param_c::m = { 230.0f, -3.0f, 1.0f, 450.0f, 255.0f, 210.0f, 35.0f, 40.0f, 0.0f, 0.0f, 15.0f, -15.0f, 30.0f, -10.0f, 30.0f, -30.0f, 0.6f, 12.0f, 3, 6, 5, 6, 110.0f, 0.0f, 0.0f, 0.0f, 60, 8, 0, 0, 0, 0, 0, @@ -65,12 +65,12 @@ void daNpc_Len_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {11, 1}, {13, 2}, }; -static daNpcT_evtData_c l_evtList[7] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[7] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -80,27 +80,27 @@ static daNpcT_evtData_c l_evtList[7] = { {"CONVERSATION_IN_HOTEL2", 3}, }; -static char* l_resNameList[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[4] = { "", "Len", "Len_TW", "Len1", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { 1, 3, -1, }; -static s8 l_loadResPtrn1[4] = {1, 2, 3, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[4] = {1, 2, 3, -1}; -static s8* l_loadResPtrnList[10] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[10] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[21] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[21] = { {-1, 0, 0, 17, 2, 1, 1}, {6, 0, 1, 17, 2, 1, 1}, {16, 0, 3, 46, 0, 3, 0}, {24, 2, 3, 49, 2, 3, 0}, {18, 0, 3, 47, 0, 3, 0}, {25, 2, 3, 50, 2, 3, 0}, {17, 2, 3, 17, 2, 1, 1}, {19, 2, 3, 17, 2, 1, 1}, {14, 2, 3, 17, 2, 1, 1}, @@ -110,7 +110,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[21] = { {9, 2, 2, 21, 2, 2, 0}, {8, 0, 2, 20, 0, 2, 0}, {10, 2, 2, 22, 2, 2, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[18] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[18] = { {8, 2, 1, 14, 0, 1, 1, 0}, {27, 0, 3, 14, 0, 1, 1, 0}, {34, 2, 3, 14, 0, 1, 1, 0}, {29, 2, 3, 14, 0, 1, 1, 0}, {31, 2, 3, 14, 0, 1, 1, 0}, {30, 0, 3, 14, 0, 1, 1, 0}, {32, 2, 3, 14, 0, 1, 1, 0}, {33, 0, 3, 14, 0, 1, 1, 0}, {28, 0, 3, 14, 0, 1, 1, 0}, @@ -119,7 +119,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[18] = { {7, 2, 2, 17, 2, 2, 0, 0}, {6, 2, 2, 16, 2, 2, 0, 0}, {7, 0, 1, 14, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {5, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {11, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {13, -1, 1}, {14, 0, 1}, {15, 0, 0}, {-1, 0, 0}, {16, -1, 1}, @@ -133,7 +133,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[56] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[56] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 1}, {10, 0, 1}, {11, 0, 0}, {-1, 0, 0}, {12, -1, 1}, @@ -144,14 +144,14 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[56] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {17, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Len_c::mCutNameList[4] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Len_c::mCutNameList[4] = { "", "HURRY", "CONVERSATION_IN_HOTEL", "TAKE_WOODSTATUE", }; -daNpc_Len_c::cutFunc daNpc_Len_c::mCutList[4] = { +DUSK_GAME_DATA daNpc_Len_c::cutFunc DUSK_CONST daNpc_Len_c::mCutList[4] = { NULL, &daNpc_Len_c::cutHurry, &daNpc_Len_c::cutConversationInHotel, @@ -1290,13 +1290,13 @@ static int daNpc_Len_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Len_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Len_MethodTable = { (process_method_func)daNpc_Len_Create, (process_method_func)daNpc_Len_Delete, (process_method_func)daNpc_Len_Execute, (process_method_func)daNpc_Len_IsDelete, (process_method_func)daNpc_Len_Draw, }; -actor_process_profile_definition g_profile_NPC_LEN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_LEN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_lf.cpp b/src/d/actor/d_a_npc_lf.cpp index 30b83fda7a..cca956e2e6 100644 --- a/src/d/actor/d_a_npc_lf.cpp +++ b/src/d/actor/d_a_npc_lf.cpp @@ -324,7 +324,7 @@ lf_s::lf_s() {} daNPC_LF_HIO_c::~daNPC_LF_HIO_c() {} -static actor_method_class l_daNPC_LF_Method = { +static DUSK_CONST actor_method_class l_daNPC_LF_Method = { (process_method_func)daNPC_LF_Create, (process_method_func)daNPC_LF_Delete, (process_method_func)daNPC_LF_Execute, @@ -332,7 +332,7 @@ static actor_method_class l_daNPC_LF_Method = { (process_method_func)daNPC_LF_Draw, }; -actor_process_profile_definition g_profile_NPC_LF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_LF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_lud.cpp b/src/d/actor/d_a_npc_lud.cpp index cd15d60d22..3551b68db9 100644 --- a/src/d/actor/d_a_npc_lud.cpp +++ b/src/d/actor/d_a_npc_lud.cpp @@ -9,7 +9,7 @@ #include "d/actor/d_a_npc_lud.h" #include -const daNpc_Lud_HIOParam daNpc_Lud_Param_c::m = { +DUSK_GAME_DATA const daNpc_Lud_HIOParam daNpc_Lud_Param_c::m = { 160.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -123,47 +123,47 @@ enum Motion { /* 0x13 */ MOT_UNK_19 = 19, }; -static int l_bmdData[5][2] = { +static DUSK_CONSTEXPR int l_bmdData[5][2] = { {11, 1}, {11, 2}, {39, 4}, {40, 4}, {38, 4}, }; -static daNpcT_evtData_c l_evtList[6] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[6] = { {"", 0}, {"NO_RESPONSE", 0}, {"DEMO13_STB", 0}, {"CONVERSATION_ABOUT_GORON", 4}, {"NURSE", 4}, {"GO_AHEAD", 4}, }; -static char* l_resNameList[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[6] = { "", "Lud", "Lud_TW", "Lud1", "Lud2", "Len1", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { 1, 3, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { 1, 2, -1, }; -static s8 l_loadResPtrn2[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = { 1, 4, -1, }; -s8 l_loadResPtrn9[5] = { +DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = { 1, 2, 3, 4, -1, }; -static s8* l_loadResPtrnList[9] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[9] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[20] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[20] = { {-1, 0, 0, 17, 2, 1, 1}, {6, 0, 1, 17, 2, 1, 1}, {18, 2, 4, 51, 2, 4, 0}, {15, 0, 4, 48, 0, 4, 0}, {16, 2, 4, 49, 2, 4, 0}, {17, 0, 4, 50, 0, 4, 0}, {21, 0, 4, 54, 0, 4, 0}, {22, 0, 4, 55, 0, 4, 0}, {24, 2, 4, 57, 2, 4, 0}, @@ -173,7 +173,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[20] = { {8, 2, 2, 15, 2, 2, 0}, {7, 2, 2, 14, 2, 2, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[21] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[21] = { {8, 2, 1, 14, 0, 1, 1, 0}, {6, 0, 3, 14, 0, 1, 1, 0}, {7, 0, 3, 14, 0, 1, 1, 0}, {7, 0, 1, 14, 0, 1, 1, 0}, {30, 2, 4, 14, 0, 1, 1, 0}, {33, 0, 4, 14, 0, 1, 1, 0}, {34, 2, 4, 14, 0, 1, 1, 0}, {35, 0, 4, 14, 0, 1, 1, 0}, {25, 0, 4, 14, 0, 1, 0, 0}, @@ -183,7 +183,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[21] = { {5, 2, 3, 14, 0, 1, 0, 0}, {6, 2, 2, -1, 0, 0, 0, 0}, {5, 2, 2, -1, 0, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[76] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[76] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {15, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, 0, 1}, {5, 0, 1}, {-1, 0, 0}, {-1, 0, 0}, {3, 0, 1}, @@ -197,7 +197,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[76] = {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {16, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, @@ -212,7 +212,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[80] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Lud_c::mCutNameList[8] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Lud_c::mCutNameList[8] = { "", "HURRY", "CONVERSATION_IN_HOTEL", @@ -223,7 +223,7 @@ char* daNpc_Lud_c::mCutNameList[8] = { "THANK_YOU", }; -daNpc_Lud_c::cutFunc daNpc_Lud_c::mCutList[8] = { +DUSK_GAME_DATA daNpc_Lud_c::cutFunc DUSK_CONST daNpc_Lud_c::mCutList[8] = { NULL, &daNpc_Lud_c::cutHurry, &daNpc_Lud_c::cutConversationInHotel, @@ -1506,13 +1506,13 @@ static int daNpc_Lud_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Lud_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Lud_MethodTable = { (process_method_func)daNpc_Lud_Create, (process_method_func)daNpc_Lud_Delete, (process_method_func)daNpc_Lud_Execute, (process_method_func)daNpc_Lud_IsDelete, (process_method_func)daNpc_Lud_Draw, }; -actor_process_profile_definition g_profile_NPC_LUD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_LUD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_maro.cpp b/src/d/actor/d_a_npc_maro.cpp index 7b2166a1a1..4e2c3ad870 100644 --- a/src/d/actor/d_a_npc_maro.cpp +++ b/src/d/actor/d_a_npc_maro.cpp @@ -22,7 +22,7 @@ #include #endif -const daNpc_Maro_HIOParam daNpc_Maro_Param_c::m = { +DUSK_GAME_DATA const daNpc_Maro_HIOParam daNpc_Maro_Param_c::m = { 100.0f, -3.0f, 1.0f, @@ -113,11 +113,11 @@ void daNpc_Maro_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {11, 1}, {5, 2}, }; -static daNpcT_evtData_c l_evtList[15] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[15] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -135,7 +135,7 @@ static daNpcT_evtData_c l_evtList[15] = { {"TALK_TO_KAKASHI", 3}, }; -static char* l_resNameList[10] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[10] = { "", "Maro", "Maro_TW", @@ -148,15 +148,15 @@ static char* l_resNameList[10] = { "Besu1", }; -static s8 l_loadResPtrn0[3] = {1, 3, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = {1, 3, -1}; -static s8 l_loadResPtrn1[3] = {1, 2, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = {1, 2, -1}; -static s8 l_loadResPtrn2[4] = {1, 3, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn2[4] = {1, 3, 4, -1}; -static s8 l_loadResPtrn3[5] = {1, 2, 3, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn3[5] = {1, 2, 3, 4, -1}; -static s8* l_loadResPtrnList[17] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[17] = { l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn2, l_loadResPtrn2, @@ -164,7 +164,7 @@ static s8* l_loadResPtrnList[17] = { l_loadResPtrn3, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, 0, 0, 17, 2, 1, 1}, {6, 0, 1, 18, 0, 1, 0}, {7, 0, 3, 22, 0, 3, 0}, @@ -177,7 +177,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {7, 2, 5, 11, 2, 5, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[10] = { {8, 2, 1, 14, 0, 1, 1, 0}, {5, 2, 4, 14, 0, 1, 1, 0}, {5, 2, 5, 14, 0, 1, 1, 0}, @@ -190,7 +190,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[10] = { {10, 2, 3, 14, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -198,7 +198,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -206,7 +206,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Maro_c::mCutNameList[17] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Maro_c::mCutNameList[17] = { "", "CONVERSATION_ABOUT_PACHINKO", "CONVERSATION_ABOUT_WOODSWD", @@ -226,7 +226,7 @@ char* daNpc_Maro_c::mCutNameList[17] = { "TALK_TO_KAKASHI", }; -daNpc_Maro_c::cutFunc daNpc_Maro_c::mCutList[17] = { +DUSK_GAME_DATA daNpc_Maro_c::cutFunc DUSK_CONST daNpc_Maro_c::mCutList[17] = { NULL, &daNpc_Maro_c::cutConversationAboutPachinko, &daNpc_Maro_c::cutConversationAboutWoodSwd, @@ -3507,7 +3507,7 @@ static int daNpc_Maro_IsDelete(void*) { return 1; } -static actor_method_class daNpc_Maro_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Maro_MethodTable = { (process_method_func)daNpc_Maro_Create, (process_method_func)daNpc_Maro_Delete, (process_method_func)daNpc_Maro_Execute, @@ -3515,7 +3515,7 @@ static actor_method_class daNpc_Maro_MethodTable = { (process_method_func)daNpc_Maro_Draw, }; -actor_process_profile_definition g_profile_NPC_MARO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_MARO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_midp.cpp b/src/d/actor/d_a_npc_midp.cpp index 4c11c71b75..4edfc74d27 100644 --- a/src/d/actor/d_a_npc_midp.cpp +++ b/src/d/actor/d_a_npc_midp.cpp @@ -22,51 +22,51 @@ enum midP_RES_File_ID { /* 0xF */ BTP_MIDP = 0xF, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_MIDP, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "midP" }; -static s8 l_loadResPtrn0[1 + 1 /* padding */] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[1 + 1 /* padding */] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { -1, 0, 0, 15, 2, 1, 1 }; -static daNpcT_motionAnmData_c l_motionAnmData = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData = { 6, 2, 1, 12, 0, 1, 1, 0 }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -char* daNpc_midP_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_midP_c::mCutNameList = ""; -daNpc_midP_c::cutFunc daNpc_midP_c::mCutList[1] = { 0 }; +DUSK_GAME_DATA daNpc_midP_c::cutFunc DUSK_CONST daNpc_midP_c::mCutList[1] = { 0 }; -daNpc_midP_HIOParam const daNpc_midP_Param_c::m = { +DUSK_GAME_DATA daNpc_midP_HIOParam const daNpc_midP_Param_c::m = { 210.0f, -3.0f, 1.0f, @@ -638,7 +638,7 @@ static int daNpc_midP_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_midP_MethodTable = { +static DUSK_CONST actor_method_class daNpc_midP_MethodTable = { (process_method_func)daNpc_midP_Create, (process_method_func)daNpc_midP_Delete, (process_method_func)daNpc_midP_Execute, @@ -646,7 +646,7 @@ static actor_method_class daNpc_midP_MethodTable = { (process_method_func)daNpc_midP_Draw, }; -actor_process_profile_definition g_profile_NPC_MIDP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_MIDP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_mk.cpp b/src/d/actor/d_a_npc_mk.cpp index 9782fa54f9..282a9a2f41 100644 --- a/src/d/actor/d_a_npc_mk.cpp +++ b/src/d/actor/d_a_npc_mk.cpp @@ -27,7 +27,7 @@ static BOOL daNpc_Mk_IsDelete(void* param_0) { return TRUE; } -static actor_method_class daNpc_Mk_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Mk_MethodTable = { (process_method_func)daNpc_Mk_Create, (process_method_func)daNpc_Mk_Delete, (process_method_func)daNpc_Mk_Execute, @@ -35,7 +35,7 @@ static actor_method_class daNpc_Mk_MethodTable = { (process_method_func)daNpc_Mk_Draw, }; -actor_process_profile_definition g_profile_NPC_MK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_MK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_moi.cpp b/src/d/actor/d_a_npc_moi.cpp index c0101e4114..58060909df 100644 --- a/src/d/actor/d_a_npc_moi.cpp +++ b/src/d/actor/d_a_npc_moi.cpp @@ -13,7 +13,7 @@ #include "d/actor/d_a_npc_uri.h" #include -const daNpc_Moi_HIOParam daNpc_Moi_Param_c::m = { +DUSK_GAME_DATA const daNpc_Moi_HIOParam daNpc_Moi_Param_c::m = { 200.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -86,56 +86,56 @@ void daNpc_Moi_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[8][2] = { +static DUSK_CONSTEXPR int l_bmdData[8][2] = { {11, 1}, {29, 3}, {30, 3}, {31, 3}, {13, 1}, {33, 3}, {12, 1}, {32, 3}, }; -static daNpcT_evtData_c l_evtList[4] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[4] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, {"DELIVERED_SW", 2}, }; -static char* l_resNameList[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[6] = { "", "Moi", "Moi1", "Moi2", "Moi3", "Moi_p1", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { 1, 2, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { 1, 3, -1, }; -static s8 l_loadResPtrn3[4] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[4] = { 1, 3, 4, -1, }; -static s8 l_loadResPtrn4[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn4[3] = { 1, 5, -1, }; -static s8 l_loadResPtrn9[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = { 1, 2, 3, 4, -1, }; -static s8* l_loadResPtrnList[7] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[7] = { l_loadResPtrn0, l_loadResPtrn4, l_loadResPtrn1, l_loadResPtrn3, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[20] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[20] = { {-1, 0, 0, 19, 2, 1, TRUE}, {6, 0, 1, 19, 2, 1, TRUE}, {9, 0, 2, 41, 0, 2, FALSE}, {10, 0, 2, 42, 0, 2, FALSE}, {8, 0, 2, 40, 0, 2, FALSE}, {7, 0, 2, 39, 0, 2, FALSE}, {11, 0, 2, 43, 0, 2, FALSE}, {7, 0, 3, 40, 0, 3, FALSE}, {8, 0, 3, 41, 0, 3, FALSE}, @@ -145,7 +145,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[20] = { {6, 2, 3, 39, 2, 3, FALSE}, {18, 0, 2, 49, 0, 2, FALSE}, }; -static daNpcT_motionAnmData_c l_motionAnmData[35] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[35] = { {8, 2, 1, 16, 0, 1, 1, 0}, {29, 2, 2, 16, 0, 1, 1, 0}, {30, 2, 2, 16, 0, 1, 1, 0}, {6, 0, 2, 16, 0, 1, 1, 0}, {17, 2, 2, 35, 2, 2, 0, 0}, {31, 2, 2, 16, 0, 1, 1, 0}, {23, 0, 2, 16, 0, 1, 1, 0}, {28, 0, 2, 16, 0, 1, 1, 0}, {24, 0, 2, 16, 0, 1, 1, 0}, @@ -160,7 +160,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[35] = { {3, 2, 4, 16, 0, 1, 1, 0}, {21, 2, 3, 16, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[88] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[88] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {13, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {14, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, @@ -176,7 +176,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[88] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[196] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[196] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 1}, @@ -207,11 +207,11 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[196] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {18, 4, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Moi_c::mCutNameList[5] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Moi_c::mCutNameList[5] = { "", "DELIVERED_SW", "APPEARANCE_MOI", "CONVERSATION_WITH_URI", "FIND_WOLF", }; -daNpc_Moi_c::cutFunc daNpc_Moi_c::mCutList[5] = { +DUSK_GAME_DATA daNpc_Moi_c::cutFunc DUSK_CONST daNpc_Moi_c::mCutList[5] = { NULL, &daNpc_Moi_c::cutDeliveredSw, &daNpc_Moi_c::cutAppearanceMoi, @@ -1984,13 +1984,13 @@ static int daNpc_Moi_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Moi_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Moi_MethodTable = { (process_method_func)daNpc_Moi_Create, (process_method_func)daNpc_Moi_Delete, (process_method_func)daNpc_Moi_Execute, (process_method_func)daNpc_Moi_IsDelete, (process_method_func)daNpc_Moi_Draw, }; -actor_process_profile_definition g_profile_NPC_MOI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_MOI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_moir.cpp b/src/d/actor/d_a_npc_moir.cpp index dde4a7c3bf..48f58cc621 100644 --- a/src/d/actor/d_a_npc_moir.cpp +++ b/src/d/actor/d_a_npc_moir.cpp @@ -122,7 +122,7 @@ enum Joint { /* 0x19 */ JNT_FOOTR }; -static daNpc_GetParam2 l_bckGetParamList[39] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[39] = { {-1, J3DFrameCtrl::EMode_NONE, MoiR}, {BCK_MOIR_F_TALK_A, J3DFrameCtrl::EMode_NONE, MoiR}, {BCK_MOIR_F_HOLD_S, J3DFrameCtrl::EMode_NONE, MoiR}, @@ -164,50 +164,50 @@ static daNpc_GetParam2 l_bckGetParamList[39] = { {BCK_MOIR_RUN, J3DFrameCtrl::EMode_LOOP, MoiR3}, }; -static daNpc_GetParam2 l_btpGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[2] = { {BTP_MOIR, J3DFrameCtrl::EMode_LOOP, MoiR}, {BTP_MOIR_FH_SERIOUS, J3DFrameCtrl::EMode_LOOP, MoiR}, }; -static daNpc_GetParam2 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[1] = { {BTK_MOIR, J3DFrameCtrl::EMode_LOOP, MoiR}, }; -static int l_loadRes_MOIR0[3] = { +static DUSK_CONSTEXPR int l_loadRes_MOIR0[3] = { 0, 1, -1, }; -static int l_loadRes_MOIR1[3] = { +static DUSK_CONSTEXPR int l_loadRes_MOIR1[3] = { 0, 2, -1, }; -static int l_loadRes_MOIR2[3] = { +static DUSK_CONSTEXPR int l_loadRes_MOIR2[3] = { 0, 3, -1, }; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_MOIR0, l_loadRes_MOIR1, l_loadRes_MOIR2, }; -static char* l_arcNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[4] = { "MoiR", "MoiR1", "MoiR2", "MoiR3", }; -static char* l_evtNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[4] = { "", "THE_INTRODUCTION", "MOIR_APPEAR", "MOIR_APPEAR2", }; -static char* l_myName = "MoiR"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "MoiR"; -daNpcMoiR_HIOParam const daNpcMoiR_Param_c::m = { +DUSK_GAME_DATA daNpcMoiR_HIOParam const daNpcMoiR_Param_c::m = { 35.0f, -3.0f, 1.0f, @@ -261,7 +261,7 @@ void daNpcMoiR_HIO_c::genMessage(JORMContext* ctext) { static NPC_MOIR_HIO_CLASS l_HIO; -daNpcMoiR_c::EventFn daNpcMoiR_c::mEvtSeqList[4] = { +DUSK_GAME_DATA daNpcMoiR_c::EventFn daNpcMoiR_c::mEvtSeqList[4] = { NULL, &daNpcMoiR_c::EvCut_Introduction, &daNpcMoiR_c::EvCut_Appear, @@ -2011,7 +2011,7 @@ BOOL daNpcMoiR_c::drawDbgInfo() { return FALSE; } -static actor_method_class daNpcMoiR_MethodTable = { +static DUSK_CONST actor_method_class daNpcMoiR_MethodTable = { (process_method_func)daNpcMoiR_Create, (process_method_func)daNpcMoiR_Delete, (process_method_func)daNpcMoiR_Execute, @@ -2019,7 +2019,7 @@ static actor_method_class daNpcMoiR_MethodTable = { (process_method_func)daNpcMoiR_Draw, }; -actor_process_profile_definition g_profile_NPC_MOIR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_MOIR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_myna2.cpp b/src/d/actor/d_a_npc_myna2.cpp index d78b94fc5f..ede18be556 100644 --- a/src/d/actor/d_a_npc_myna2.cpp +++ b/src/d/actor/d_a_npc_myna2.cpp @@ -17,11 +17,11 @@ enum { static NPC_MYNA2_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[] = { {0x17, 0}, }; -static daNpc_GetParam1 l_bckGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[] = { {17, 0}, {10, 0}, {11, 0}, @@ -39,11 +39,11 @@ static daNpc_GetParam1 l_bckGetParamList[] = { {20, 0}, }; -static daNpc_GetParam1 l_btpGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[] = { {26, 0}, }; -static daNpc_GetParam1 l_evtGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[] = { {0, 0}, {1, 0}, {2, 1}, @@ -51,7 +51,7 @@ static daNpc_GetParam1 l_evtGetParamList[] = { {4, 2}, }; -static char* l_evtNames[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[5] = { NULL, "FIRST_TALK", "GAME_FAILURE", @@ -59,23 +59,23 @@ static char* l_evtNames[5] = { "GAME_GOAL_SUCCESS", }; -static int l_loadRes_MYNA2a[] = { +static DUSK_CONSTEXPR int l_loadRes_MYNA2a[] = { 0, -1, -1, }; -static int l_loadRes_MYNA2_GAME_FAILURE[] = { +static DUSK_CONSTEXPR int l_loadRes_MYNA2_GAME_FAILURE[] = { 0, 1, -1, }; -static int l_loadRes_MYNA2_GAME_GOAL[] = { +static DUSK_CONSTEXPR int l_loadRes_MYNA2_GAME_GOAL[] = { 0, 2, -1, }; -static int l_loadRes_MYNA20[] = { +static DUSK_CONSTEXPR int l_loadRes_MYNA20[] = { 0, -1, -1, }; -static int* l_loadRes_list[5] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[5] = { l_loadRes_MYNA2a, l_loadRes_MYNA2a, l_loadRes_MYNA2_GAME_FAILURE, @@ -83,15 +83,15 @@ static int* l_loadRes_list[5] = { l_loadRes_MYNA20, }; -static char* l_resNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[3] = { "MYNA_b", "MYNA_b_f", "MYNA_b_g", }; -static char* l_myName = "myna2"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "myna2"; -char* daNpc_myna2_c::mEvtCutNameList[5] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_myna2_c::mEvtCutNameList[5] = { "", "FIRST_TALK", "GAME_FAILURE", @@ -99,7 +99,7 @@ char* daNpc_myna2_c::mEvtCutNameList[5] = { "GAME_GOAL_SUCCESS", }; -daNpc_myna2_c::EventFn daNpc_myna2_c::mEvtCutList[] = { +DUSK_GAME_DATA daNpc_myna2_c::EventFn DUSK_CONST daNpc_myna2_c::mEvtCutList[] = { NULL, &daNpc_myna2_c::ECut_firstTalk, &daNpc_myna2_c::ECut_gameFailure, @@ -107,7 +107,7 @@ daNpc_myna2_c::EventFn daNpc_myna2_c::mEvtCutList[] = { &daNpc_myna2_c::ECut_gameGoalSuccess, }; -const daNpc_myna2_HIOParam daNpc_myna2_Param_c::m = { +DUSK_GAME_DATA const daNpc_myna2_HIOParam daNpc_myna2_Param_c::m = { 60.0f, 0.0f, 1.0f, @@ -1356,7 +1356,7 @@ static int daNpc_myna2_IsDelete(void* i_this) { return TRUE; } -static actor_method_class daNpc_myna2_MethodTable = { +static DUSK_CONST actor_method_class daNpc_myna2_MethodTable = { (process_method_func)daNpc_myna2_Create, (process_method_func)daNpc_myna2_Delete, (process_method_func)daNpc_myna2_Execute, @@ -1364,7 +1364,7 @@ static actor_method_class daNpc_myna2_MethodTable = { (process_method_func)daNpc_myna2_Draw, }; -actor_process_profile_definition g_profile_MYNA2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_MYNA2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ne.cpp b/src/d/actor/d_a_npc_ne.cpp index 90e33adea5..edce270a2c 100644 --- a/src/d/actor/d_a_npc_ne.cpp +++ b/src/d/actor/d_a_npc_ne.cpp @@ -3311,7 +3311,7 @@ npc_ne_class::npc_ne_class() { /* empty function */ } -static actor_method_class l_daNpc_Ne_Method = { +static DUSK_CONST actor_method_class l_daNpc_Ne_Method = { (process_method_func)daNpc_Ne_Create, (process_method_func)daNpc_Ne_Delete, (process_method_func)daNpc_Ne_Execute, @@ -3319,7 +3319,7 @@ static actor_method_class l_daNpc_Ne_Method = { (process_method_func)daNpc_Ne_Draw, }; -actor_process_profile_definition g_profile_NPC_NE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_NE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_p2.cpp b/src/d/actor/d_a_npc_p2.cpp index c2dfdf711f..11c1d21fce 100644 --- a/src/d/actor/d_a_npc_p2.cpp +++ b/src/d/actor/d_a_npc_p2.cpp @@ -27,7 +27,7 @@ static BOOL daNpc_P2IsDelete(void* param_0) { return TRUE; } -static actor_method_class daNpc_P2MethodTable = { +static DUSK_CONST actor_method_class daNpc_P2MethodTable = { (process_method_func)daNpc_P2Create, (process_method_func)daNpc_P2Delete, (process_method_func)daNpc_P2Execute, @@ -35,7 +35,7 @@ static actor_method_class daNpc_P2MethodTable = { (process_method_func)daNpc_P2Draw, }; -actor_process_profile_definition g_profile_NPC_P2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_P2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_pachi_besu.cpp b/src/d/actor/d_a_npc_pachi_besu.cpp index 73a7c91027..089d9b4acc 100644 --- a/src/d/actor/d_a_npc_pachi_besu.cpp +++ b/src/d/actor/d_a_npc_pachi_besu.cpp @@ -257,7 +257,7 @@ enum Event { /* 0x1 */ EVT_TUTRIAL_TALK2, }; -static int l_bmdData[6][2] = { +static DUSK_CONSTEXPR int l_bmdData[6][2] = { {BMDR_BESU, BESU}, {BMDR_BESU_TW, BESU_TW}, {BMDR_BESU_CLOTH, BESU2}, @@ -266,12 +266,12 @@ static int l_bmdData[6][2] = { {BMDR_BESU_CUP, BESU2}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"TUTRIAL_TALK2", 7}, }; -static char* l_resNameList[8] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[8] = { "", "Besu", "Besu_TW", @@ -282,32 +282,32 @@ static char* l_resNameList[8] = { "evt_pachi", }; -static s8 l_loadResPtrn0[6] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[6] = { BESU, BESU0, BESU2, BESU1, EVT_PACHI, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { BESU0, BESU_TW, -1, }; -static s8 l_loadResPtrn2[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = { BESU2, BESU0, -1, }; -static s8 l_loadResPtrn3[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[3] = { BESU0, BESU3, -1, }; -static s8 l_loadResPtrn4[7] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn4[7] = { BESU, BESU_TW, BESU0, BESU1, BESU2, BESU3, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn4, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, 25, J3DFrameCtrl::EMode_LOOP, BESU0, 1}, {BCK_BESU_F_TALK_A, J3DFrameCtrl::EMode_NONE, BESU1, BTP_BESU_F_TALK_A, J3DFrameCtrl::EMode_NONE, BESU1, 0}, {BCK_BESU_F_TALK_B, J3DFrameCtrl::EMode_NONE, BESU1, BTP_BESU_F_TALK_B, J3DFrameCtrl::EMode_NONE, BESU1, 0}, @@ -340,7 +340,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {BCK_BESU_FH_BIKKURI, J3DFrameCtrl::EMode_LOOP, BESU0, BTP_BESU_FH_BIKKURI, J3DFrameCtrl::EMode_LOOP, BESU0, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[33] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[33] = { {BCK_BESU_WAIT_A, J3DFrameCtrl::EMode_LOOP, BESU0, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, {BCK_BESU_WAIT_B, J3DFrameCtrl::EMode_LOOP, BESU1, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, {BCK_BESU_WAIT_C, J3DFrameCtrl::EMode_LOOP, BESU0, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, @@ -376,7 +376,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[33] = { {BCK_BESU_BODY_WAIT, J3DFrameCtrl::EMode_LOOP, BESU0, BTK_BESU, J3DFrameCtrl::EMode_NONE, BESU0, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[116] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[116] = { {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -408,7 +408,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[116] {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -441,7 +441,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { {9, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Pachi_Besu_c::mCutNameList[11] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Pachi_Besu_c::mCutNameList[11] = { "", "TUTRIAL_BEGIN", "TUTRIAL_BEGIN_SKIP", @@ -455,7 +455,7 @@ char* daNpc_Pachi_Besu_c::mCutNameList[11] = { "TUTRIAL_CAUTION", }; -daNpc_Pachi_Besu_c::cutFunc daNpc_Pachi_Besu_c::mCutList[11] = { +DUSK_GAME_DATA daNpc_Pachi_Besu_c::cutFunc DUSK_CONST daNpc_Pachi_Besu_c::mCutList[11] = { NULL, &daNpc_Pachi_Besu_c::cutTutrialBegin, &daNpc_Pachi_Besu_c::cutTutrialBegin_Skip, @@ -469,7 +469,7 @@ daNpc_Pachi_Besu_c::cutFunc daNpc_Pachi_Besu_c::mCutList[11] = { &daNpc_Pachi_Besu_c::cutTutrialCaution, }; -daNpc_Pachi_Besu_HIOParam const daNpc_Pachi_Besu_Param_c::m = { +DUSK_GAME_DATA daNpc_Pachi_Besu_HIOParam const daNpc_Pachi_Besu_Param_c::m = { 160.0f, -3.0f, 1.0f, @@ -1554,7 +1554,7 @@ static int daNpc_Pachi_Besu_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_Pachi_Besu_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Pachi_Besu_MethodTable = { (process_method_func)daNpc_Pachi_Besu_Create, (process_method_func)daNpc_Pachi_Besu_Delete, (process_method_func)daNpc_Pachi_Besu_Execute, @@ -1562,7 +1562,7 @@ static actor_method_class daNpc_Pachi_Besu_MethodTable = { (process_method_func)daNpc_Pachi_Besu_Draw, }; -actor_process_profile_definition g_profile_NPC_PACHI_BESU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_PACHI_BESU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_pachi_maro.cpp b/src/d/actor/d_a_npc_pachi_maro.cpp index 9631bd42ba..61cc4eabe1 100644 --- a/src/d/actor/d_a_npc_pachi_maro.cpp +++ b/src/d/actor/d_a_npc_pachi_maro.cpp @@ -364,17 +364,17 @@ void daNpc_Pachi_Maro_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {11, 1}, {5, 2}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"TUTRIAL_TALK", 10}, }; -static char* l_resNameList[11] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[11] = { "", "Maro", "Maro_TW", @@ -388,28 +388,28 @@ static char* l_resNameList[11] = { "evt_pachi", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { MARO, MARO1, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { MARO, MARO_TW, -1, }; -static s8 l_loadResPtrn2[6] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[6] = { MARO, MARO1, MARO2, MARO3, EVT_PACHI, -1, }; -static s8 l_loadResPtrn3[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[5] = { MARO, MARO_TW, MARO1, MARO2, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn2, l_loadResPtrn3, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, BTP_MARO, J3DFrameCtrl::EMode_LOOP, MARO, 1}, {BCK_MARO_F_TALK_A, J3DFrameCtrl::EMode_NONE, MARO, BTP_MARO_F_TALK_A, J3DFrameCtrl::EMode_NONE, MARO, 0}, {BCK_MARO_F_TALK_B, J3DFrameCtrl::EMode_NONE, MARO1, BTP_MARO_F_TALK_B, J3DFrameCtrl::EMode_NONE, MARO1, 0}, @@ -422,7 +422,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {BCK_MARO_FH_BESUTALK, J3DFrameCtrl::EMode_LOOP, MARO3, BTP_MARO_FH_BESUTALK, J3DFrameCtrl::EMode_LOOP, MARO3, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[10] = { {BCK_MARO_WAIT_A, J3DFrameCtrl::EMode_LOOP, MARO, BTK_MARO, J3DFrameCtrl::EMode_NONE, MARO, 1, 0}, {BCK_MARO_CROUCH, J3DFrameCtrl::EMode_LOOP, MARO2, BTK_MARO, J3DFrameCtrl::EMode_NONE, MARO, 1, 0}, {BCK_MARO_ASKING, J3DFrameCtrl::EMode_LOOP, MARO3, BTK_MARO, J3DFrameCtrl::EMode_NONE, MARO, 1, 0}, @@ -435,7 +435,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[10] = { {BCK_MARO_RUN, J3DFrameCtrl::EMode_LOOP, MARO1, BTK_MARO, J3DFrameCtrl::EMode_NONE, MARO, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { {FACE_MOT_ANM_TALK_A, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {FACE_MOT_ANM_SURPRISE, -1, 1}, {FACE_MOT_ANM_H_SURPRISE, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {FACE_MOT_ANM_TALK_B, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -448,7 +448,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = {FACE_MOT_ANM_NONE, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {MOT_ANM_WAIT_A, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {MOT_ANM_TALK_A, -1, 1}, {MOT_ANM_WAIT_A, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {MOT_ANM_CROUCH, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -460,7 +460,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {MOT_ANM_RUN, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Pachi_Maro_c::mCutNameList[11] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Pachi_Maro_c::mCutNameList[11] = { "", "TUTRIAL_BEGIN", "TUTRIAL_BEGIN_SKIP", @@ -474,7 +474,7 @@ char* daNpc_Pachi_Maro_c::mCutNameList[11] = { "TUTRIAL_CAUTION", }; -daNpc_Pachi_Maro_c::cutFunc daNpc_Pachi_Maro_c::mCutList[11] = { +DUSK_GAME_DATA daNpc_Pachi_Maro_c::cutFunc DUSK_CONST daNpc_Pachi_Maro_c::mCutList[11] = { NULL, &daNpc_Pachi_Maro_c::cutTutrialBegin, &daNpc_Pachi_Maro_c::cutTutrialBegin_Skip, @@ -506,7 +506,7 @@ daNpc_Pachi_Maro_c::~daNpc_Pachi_Maro_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_Pachi_Maro_HIOParam const daNpc_Pachi_Maro_Param_c::m = { +DUSK_GAME_DATA daNpc_Pachi_Maro_HIOParam const daNpc_Pachi_Maro_Param_c::m = { 100.0f, -3.0f, 1.0f, @@ -1668,7 +1668,7 @@ static int daNpc_Pachi_Maro_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Pachi_Maro_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Pachi_Maro_MethodTable = { (process_method_func)daNpc_Pachi_Maro_Create, (process_method_func)daNpc_Pachi_Maro_Delete, (process_method_func)daNpc_Pachi_Maro_Execute, @@ -1676,7 +1676,7 @@ static actor_method_class daNpc_Pachi_Maro_MethodTable = { (process_method_func)daNpc_Pachi_Maro_Draw, }; -actor_process_profile_definition g_profile_NPC_PACHI_MARO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_PACHI_MARO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_pachi_taro.cpp b/src/d/actor/d_a_npc_pachi_taro.cpp index 1da06ded50..d0e905f900 100644 --- a/src/d/actor/d_a_npc_pachi_taro.cpp +++ b/src/d/actor/d_a_npc_pachi_taro.cpp @@ -482,7 +482,7 @@ void daNpc_Pachi_Taro_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[5][2] = { +static DUSK_CONSTEXPR int l_bmdData[5][2] = { {BMDR_TARO, TARO}, {BMDR_TARO_STICK_A, TARO1}, {BMDR_TARO_SWB, TARO1}, @@ -490,7 +490,7 @@ static int l_bmdData[5][2] = { {BMDR_GM_TARO, TAROB}, }; -static daNpcT_evtData_c l_evtList[11] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[11] = { {"", NONE}, {"TUTRIAL_BEGIN", EVT_PACHI}, {"TUTRIAL_BEGIN_SKIP", EVT_PACHI}, @@ -504,7 +504,7 @@ static daNpcT_evtData_c l_evtList[11] = { {"TUTRIAL_CAUTION", EVT_PACHI}, }; -static char* l_resNameList[12] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[12] = { "", "Taro", "Taro_TW", @@ -519,20 +519,20 @@ static char* l_resNameList[12] = { "evt_pachi", }; -static s8 l_loadResPtrn0[7] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[7] = { TARO, TARO0, TARO1, TARO2, TARO3, EVT_PACHI, -1, }; -static s8 l_loadResPtrn4[8] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn4[8] = { TARO, TARO_TW, TARO0, TARO1, TARO2, TARO3, TARO4, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn4, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, BTP_TARO_F_NORMAL, J3DFrameCtrl::EMode_LOOP, TARO, 1}, {BCK_TARO_F_NORMAL, J3DFrameCtrl::EMode_NONE, TARO0,BTP_TARO_F_NORMAL, J3DFrameCtrl::EMode_LOOP, TARO, 1}, {BCK_TARO_F_SAD, J3DFrameCtrl::EMode_NONE, TARO1, BTP_TARO_F_SAD, J3DFrameCtrl::EMode_NONE, TARO1, 0}, @@ -565,7 +565,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {BCK_TARO_F_CRY, J3DFrameCtrl::EMode_LOOP, TARO5, BTP_TARO_F_CRY, J3DFrameCtrl::EMode_LOOP, TARO5, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[41] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[41] = { {BCK_TARO_WAIT_A, J3DFrameCtrl::EMode_LOOP, TARO0,BTK_TARO, J3DFrameCtrl::EMode_NONE, TARO0, 1, 0}, {BCK_TARO_WAIT_B, J3DFrameCtrl::EMode_LOOP, TARO1, BTK_TARO, J3DFrameCtrl::EMode_NONE, TARO0, 1, 0}, {BCK_TARO_WAIT_C, J3DFrameCtrl::EMode_LOOP, TARO3, BTK_TARO, J3DFrameCtrl::EMode_NONE, TARO0, 1, 0}, @@ -609,7 +609,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[41] = { {BCK_TAROB_SAVED, J3DFrameCtrl::EMode_NONE, TARO5, BTK_TARO, J3DFrameCtrl::EMode_NONE, TARO0, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[128] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[128] = { {FACE_MOT_ANM_NORMAL, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {FACE_MOT_ANM_SAD, -1, 1}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {FACE_MOT_ANM_SMILE, -1, 1}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -644,7 +644,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[128] {FACE_MOT_ANM_NONE, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[164] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[164] = { {MOT_ANM_WAIT_A, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {MOT_ANM_CALL, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {MOT_ANM_WAVE, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -688,7 +688,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[164] = { {MOT_ANM_SAVED, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Pachi_Taro_c::mCutNameList[11] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Pachi_Taro_c::mCutNameList[11] = { "", "TUTRIAL_BEGIN", "TUTRIAL_BEGIN_SKIP", @@ -702,7 +702,7 @@ char* daNpc_Pachi_Taro_c::mCutNameList[11] = { "TUTRIAL_CAUTION", }; -daNpc_Pachi_Taro_c::cutFunc daNpc_Pachi_Taro_c::mCutList[11] = { +DUSK_GAME_DATA daNpc_Pachi_Taro_c::cutFunc DUSK_CONST daNpc_Pachi_Taro_c::mCutList[11] = { NULL, &daNpc_Pachi_Taro_c::cutTutrialBegin, &daNpc_Pachi_Taro_c::cutTutrialBegin_Skip, @@ -734,7 +734,7 @@ daNpc_Pachi_Taro_c::~daNpc_Pachi_Taro_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_Pachi_Taro_HIOParam const daNpc_Pachi_Taro_Param_c::m = { +DUSK_GAME_DATA daNpc_Pachi_Taro_HIOParam const daNpc_Pachi_Taro_Param_c::m = { 140.0f, -3.0f, 1.0f, @@ -1970,7 +1970,7 @@ BOOL daNpc_Pachi_Taro_c::cutTalk(int i_staffId) { return TRUE; } - char* mesNos[5] = { + DUSK_CONSTEXPR char DUSK_CONST* mesNos[5] = { "MesNo0", "MesNo1", "MesNo2", @@ -2085,7 +2085,7 @@ BOOL daNpc_Pachi_Taro_c::cutTalk2(int i_staffId) { return TRUE; } - char* mesNos[5] = { + DUSK_CONSTEXPR char DUSK_CONST* mesNos[5] = { "MesNo0", "MesNo1", "MesNo2", @@ -2550,7 +2550,7 @@ static int daNpc_Pachi_Taro_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Pachi_Taro_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Pachi_Taro_MethodTable = { (process_method_func)daNpc_Pachi_Taro_Create, (process_method_func)daNpc_Pachi_Taro_Delete, (process_method_func)daNpc_Pachi_Taro_Execute, @@ -2558,7 +2558,7 @@ static actor_method_class daNpc_Pachi_Taro_MethodTable = { (process_method_func)daNpc_Pachi_Taro_Draw, }; -actor_process_profile_definition g_profile_NPC_PACHI_TARO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_PACHI_TARO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_passer.cpp b/src/d/actor/d_a_npc_passer.cpp index b7df633f4f..11bd69e88c 100644 --- a/src/d/actor/d_a_npc_passer.cpp +++ b/src/d/actor/d_a_npc_passer.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_npc_passer.h" #include "d/d_s_play.h" -daNpcPasser_c::actionFunc daNpcPasser_c::ActionTable[5][2] = { +DUSK_GAME_DATA daNpcPasser_c::actionFunc daNpcPasser_c::ActionTable[5][2] = { {&daNpcPasser_c::initPath, &daNpcPasser_c::executePath}, {&daNpcPasser_c::initEscape, &daNpcPasser_c::executeEscape}, {&daNpcPasser_c::initFear, &daNpcPasser_c::executeFear}, @@ -481,7 +481,7 @@ void daNpcPasser_c::create_init() { setBaseMtx(); } -daNpcPasser_c::seqFunc* daNpcPasser_c::m_funcTbl[28] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc* daNpcPasser_c::m_funcTbl[28] = { daNpcPasser_c::m_seq00_funcTbl, daNpcPasser_c::m_seq01_funcTbl, daNpcPasser_c::m_seq02_funcTbl, daNpcPasser_c::m_seq03_funcTbl, daNpcPasser_c::m_seq04_funcTbl, daNpcPasser_c::m_seq05_funcTbl, @@ -498,51 +498,51 @@ daNpcPasser_c::seqFunc* daNpcPasser_c::m_funcTbl[28] = { daNpcPasser_c::m_seq26_funcTbl, daNpcPasser_c::m_seq27_funcTbl, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq00_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq00_funcTbl[2] = { &daNpcPasser_c::walka, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq01_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq01_funcTbl[2] = { &daNpcPasser_c::runa, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq02_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq02_funcTbl[2] = { &daNpcPasser_c::waita, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq03_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq03_funcTbl[2] = { &daNpcPasser_c::talka, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq04_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq04_funcTbl[2] = { &daNpcPasser_c::runb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq05_funcTbl[4] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq05_funcTbl[4] = { &daNpcPasser_c::turnr, &daNpcPasser_c::waita, &daNpcPasser_c::talka, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq06_funcTbl[4] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq06_funcTbl[4] = { &daNpcPasser_c::turnl, &daNpcPasser_c::waita, &daNpcPasser_c::talka, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq07_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq07_funcTbl[2] = { &daNpcPasser_c::waitwall, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq08_funcTbl[7] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq08_funcTbl[7] = { &daNpcPasser_c::talkwall, &daNpcPasser_c::waitwall, &daNpcPasser_c::talkbwall, @@ -552,17 +552,17 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq08_funcTbl[7] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq09_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq09_funcTbl[2] = { &daNpcPasser_c::talkb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq10_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq10_funcTbl[2] = { &daNpcPasser_c::talkc, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq11_funcTbl[6] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq11_funcTbl[6] = { &daNpcPasser_c::talka, &daNpcPasser_c::waita, &daNpcPasser_c::talkb, @@ -571,12 +571,12 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq11_funcTbl[6] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq12_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq12_funcTbl[2] = { &daNpcPasser_c::waitb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq13_funcTbl[6] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq13_funcTbl[6] = { &daNpcPasser_c::browsea, &daNpcPasser_c::browseb, &daNpcPasser_c::talka, @@ -585,17 +585,17 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq13_funcTbl[6] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq14_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq14_funcTbl[2] = { &daNpcPasser_c::walkb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq15_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq15_funcTbl[2] = { &daNpcPasser_c::sitwaita, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq16_funcTbl[7] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq16_funcTbl[7] = { &daNpcPasser_c::sittalka, &daNpcPasser_c::sitwaita, &daNpcPasser_c::sittalkab, @@ -605,17 +605,17 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq16_funcTbl[7] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq17_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq17_funcTbl[2] = { &daNpcPasser_c::playm, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq18_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq18_funcTbl[2] = { &daNpcPasser_c::sitwaitb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq19_funcTbl[7] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq19_funcTbl[7] = { &daNpcPasser_c::sittalkb, &daNpcPasser_c::sitwaitb, &daNpcPasser_c::sittalkbb, @@ -625,24 +625,24 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq19_funcTbl[7] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq20_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq20_funcTbl[2] = { &daNpcPasser_c::looka, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq21_funcTbl[2] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq21_funcTbl[2] = { &daNpcPasser_c::lookb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq22_funcTbl[4] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq22_funcTbl[4] = { &daNpcPasser_c::looka, &daNpcPasser_c::lookb, &daNpcPasser_c::waita, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq23_funcTbl[7] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq23_funcTbl[7] = { &daNpcPasser_c::talka, &daNpcPasser_c::waita, &daNpcPasser_c::talkb, @@ -652,7 +652,7 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq23_funcTbl[7] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq24_funcTbl[5] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq24_funcTbl[5] = { &daNpcPasser_c::talkb, &daNpcPasser_c::talka, &daNpcPasser_c::talkc, @@ -660,7 +660,7 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq24_funcTbl[5] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq25_funcTbl[7] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq25_funcTbl[7] = { &daNpcPasser_c::browsea, &daNpcPasser_c::browseb, &daNpcPasser_c::talka, @@ -670,13 +670,13 @@ daNpcPasser_c::seqFunc daNpcPasser_c::m_seq25_funcTbl[7] = { NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq26_funcTbl[3] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq26_funcTbl[3] = { &daNpcPasser_c::browsea, &daNpcPasser_c::browseb, NULL, }; -daNpcPasser_c::seqFunc daNpcPasser_c::m_seq27_funcTbl[1] = { +DUSK_GAME_DATA daNpcPasser_c::seqFunc daNpcPasser_c::m_seq27_funcTbl[1] = { &daNpcPasser_c::waitTime, }; @@ -1151,7 +1151,7 @@ static int daNpcPasser_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcPasser_METHODS = { +static DUSK_CONST actor_method_class daNpcPasser_METHODS = { (process_method_func)daNpcPasser_Create, (process_method_func)daNpcPasser_Delete, (process_method_func)daNpcPasser_Execute, @@ -1159,7 +1159,7 @@ static actor_method_class daNpcPasser_METHODS = { (process_method_func)daNpcPasser_Draw, }; -actor_process_profile_definition g_profile_NPC_PASSER = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_PASSER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_passer2.cpp b/src/d/actor/d_a_npc_passer2.cpp index ea4aae6db5..00656fb835 100644 --- a/src/d/actor/d_a_npc_passer2.cpp +++ b/src/d/actor/d_a_npc_passer2.cpp @@ -31,7 +31,7 @@ static int createHeapCallBack(fopAc_ac_c* i_this) { return actor->createHeap(); } -daNpcPasser2_c::actionFunc daNpcPasser2_c::ActionTable[1][2] = { +DUSK_GAME_DATA daNpcPasser2_c::actionFunc daNpcPasser2_c::ActionTable[1][2] = { {&daNpcPasser2_c::initPath, &daNpcPasser2_c::executePath}, }; @@ -370,7 +370,7 @@ static int daNpcPasser2_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcPasser2_METHODS = { +static DUSK_CONST actor_method_class daNpcPasser2_METHODS = { (process_method_func)daNpcPasser2_Create, (process_method_func)daNpcPasser2_Delete, (process_method_func)daNpcPasser2_Execute, @@ -378,7 +378,7 @@ static actor_method_class daNpcPasser2_METHODS = { (process_method_func)daNpcPasser2_Draw, }; -actor_process_profile_definition g_profile_NPC_PASSER2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_PASSER2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_post.cpp b/src/d/actor/d_a_npc_post.cpp index e47d4c3e13..b26e4da1c7 100644 --- a/src/d/actor/d_a_npc_post.cpp +++ b/src/d/actor/d_a_npc_post.cpp @@ -159,7 +159,7 @@ enum Type { /* 0x3 */ TYPE_DEFAULT, }; -daNpc_Post_HIOParam const daNpc_Post_Param_c::m = { +DUSK_GAME_DATA daNpc_Post_HIOParam const daNpc_Post_Param_c::m = { 190.0f, -3.0f, 1.0f, @@ -247,14 +247,14 @@ void daNpc_Post_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[4][2] = { +static DUSK_CONSTEXPR int l_bmdData[4][2] = { {BMDR_POST, POST}, {BMDR_POST_FLAG, POST}, {BMDR_POST_LETTER, POST}, {BMDR_POST_LETTER_B, POST2}, }; -static daNpcT_evtData_c l_evtList[5] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[5] = { {"", 0}, {"NO_RESPONSE", 0}, {"DELIVER", 2}, @@ -262,33 +262,33 @@ static daNpcT_evtData_c l_evtList[5] = { {"DELIVERTO_WOLF", 2}, }; -static char* l_resNameList[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[4] = { "", "post", "post1", "post2", }; -static s8 l_loadResPtrn0[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = { POST, POST1, -1 }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { POST, POST2, -1, }; -static s8 l_loadResPtrn9[4] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[4] = { POST, POST1, POST2, -1, }; -static s8* l_loadResPtrnList[4] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[15] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[15] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, BTP_POST, J3DFrameCtrl::EMode_LOOP, POST, 1}, {-1, J3DFrameCtrl::EMode_NONE, NONE, BTP_POST_RUN, J3DFrameCtrl::EMode_LOOP, POST1, 0}, {BCK_POST_F_TALK_A, J3DFrameCtrl::EMode_NONE, POST, BTP_POST_F_TALK_A, J3DFrameCtrl::EMode_NONE, POST, 0}, @@ -306,7 +306,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[15] = { {BCK_POST_FH_ANGRY, J3DFrameCtrl::EMode_LOOP, POST2, BTP_POST_FH_ANGRY, J3DFrameCtrl::EMode_LOOP, POST2, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[13] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[13] = { {BCK_POST_WAIT_A, J3DFrameCtrl::EMode_LOOP, POST, BTK_POST, J3DFrameCtrl::EMode_NONE, POST, 1, 0}, {BCK_POST_RUN, J3DFrameCtrl::EMode_LOOP, POST1, BTK_POST_RUN, J3DFrameCtrl::EMode_LOOP, POST1, 0, 0}, {BCK_POST_STEP, J3DFrameCtrl::EMode_NONE, POST, BTK_POST, J3DFrameCtrl::EMode_NONE, POST, 1, 0}, @@ -322,7 +322,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[13] = { {BCK_POST_SIT_NOD, J3DFrameCtrl::EMode_NONE, POST2, BTK_POST_SIT_NOD, J3DFrameCtrl::EMode_NONE, POST2, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[60] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[60] = { {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -340,7 +340,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[60] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {4, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -354,12 +354,12 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { {2, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Post_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Post_c::mCutNameList[2] = { "", "DELIVER", }; -daNpc_Post_c::cutFunc daNpc_Post_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_Post_c::cutFunc DUSK_CONST daNpc_Post_c::mCutList[2] = { NULL, &daNpc_Post_c::cutDeliver, }; @@ -988,7 +988,7 @@ void daNpc_Post_c::drawOtherMdl() { } bool daNpc_Post_c::setFlagAnm(int i_idx, int i_attr, f32 i_morf) { - static daNpc_GetParam1 flagAnmData[13] = { + static DUSK_CONSTEXPR daNpc_GetParam1 flagAnmData[13] = { {BCK_POST_FLAG_WAIT_A, POST}, {BCK_POST_FLAG_RUN, POST1}, {BCK_POST_FLAG_STEP, POST}, @@ -1558,7 +1558,7 @@ static int daNpc_Post_IsDelete(void* i_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_Post_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Post_MethodTable = { (process_method_func)daNpc_Post_Create, (process_method_func)daNpc_Post_Delete, (process_method_func)daNpc_Post_Execute, @@ -1566,7 +1566,7 @@ static actor_method_class daNpc_Post_MethodTable = { (process_method_func)daNpc_Post_Draw, }; -actor_process_profile_definition g_profile_NPC_POST = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_POST = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_pouya.cpp b/src/d/actor/d_a_npc_pouya.cpp index 23f9cb490b..72bad48e4b 100644 --- a/src/d/actor/d_a_npc_pouya.cpp +++ b/src/d/actor/d_a_npc_pouya.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_npc_pouya.h" #include -const daNpc_Pouya_HIOParam daNpc_Pouya_Param_c::m = { +DUSK_GAME_DATA const daNpc_Pouya_HIOParam daNpc_Pouya_Param_c::m = { 120.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -66,13 +66,13 @@ void daNpc_Pouya_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[3][2] = { +static DUSK_CONSTEXPR int l_bmdData[3][2] = { {26, 1}, {23, 1}, {34, 2}, }; -static daNpcT_evtData_c l_evtList[9] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[9] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -84,21 +84,21 @@ static daNpcT_evtData_c l_evtList[9] = { {"RETURN_FAVOR_2_02", 2}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "pouyaA", "pouyaB", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8 l_loadResPtrn1[2] = {2, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[2] = {2, -1}; -static s8* l_loadResPtrnList[6] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[6] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { {-1, 0, 0, -1, 0, 0, 0}, {11, 0, 1, -1, 0, 0, 0}, {8, 2, 1, -1, 0, 0, 0}, {9, 0, 1, -1, 0, 0, 0}, {10, 0, 1, -1, 0, 0, 0}, {12, 2, 1, -1, 0, 0, 0}, {14, 2, 2, 47, 2, 2, 0}, {10, 0, 2, 43, 0, 2, 0}, {16, 2, 2, 49, 2, 2, 0}, @@ -107,7 +107,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { {18, 2, 2, 51, 2, 2, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[26] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[26] = { {18, 2, 1, 36, 2, 1, 0, 0}, {19, 2, 1, 36, 2, 1, 0, 0}, {20, 2, 1, 36, 2, 1, 0, 0}, {13, 0, 1, 36, 2, 1, 0, 0}, {16, 0, 1, 36, 2, 1, 0, 0}, {17, 2, 1, 36, 2, 1, 0, 0}, {14, 0, 1, 36, 2, 1, 0, 0}, {15, 2, 1, 36, 2, 1, 0, 0}, {16, 0, 1, 36, 2, 1, 0, 0}, @@ -119,7 +119,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[26] = { {26, 0, 2, 37, 0, 2, 1, 0}, {23, 0, 2, 37, 0, 2, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, @@ -133,7 +133,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {5, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, @@ -147,13 +147,13 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[76] = { {-1, 0, 0}, {-1, 0, 0}, {25, -1, 1}, {10, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Pouya_c::mCutNameList[3] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Pouya_c::mCutNameList[3] = { "", "HAVE_FAVORTO_ASK", "RETURN_FAVOR", }; -daNpc_Pouya_c::cutFunc daNpc_Pouya_c::mCutList[3] = { +DUSK_GAME_DATA daNpc_Pouya_c::cutFunc DUSK_CONST daNpc_Pouya_c::mCutList[3] = { NULL, &daNpc_Pouya_c::cutHaveFavorToAsk, &daNpc_Pouya_c::cutHaveFavorToAsk, @@ -1192,13 +1192,13 @@ static BOOL daNpc_Pouya_IsDelete(void* i_this) { static NPC_POUYA_HIO_CLASS l_HIO; -static actor_method_class daNpc_Pouya_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Pouya_MethodTable = { (process_method_func)daNpc_Pouya_Create, (process_method_func)daNpc_Pouya_Delete, (process_method_func)daNpc_Pouya_Execute, (process_method_func)daNpc_Pouya_IsDelete, (process_method_func)daNpc_Pouya_Draw, }; -actor_process_profile_definition g_profile_NPC_POUYA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_POUYA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_prayer.cpp b/src/d/actor/d_a_npc_prayer.cpp index 7233ccc683..9191bc0315 100644 --- a/src/d/actor/d_a_npc_prayer.cpp +++ b/src/d/actor/d_a_npc_prayer.cpp @@ -10,7 +10,7 @@ static NPC_PRAY_HIO_CLASS l_HIO; -static struct { +static DUSK_CONSTEXPR struct { int resIdx; int anmMode; int arcnameIdx; @@ -30,24 +30,24 @@ enum daNpcPray_MOTION_e { MOTION_WOLF_e, }; -static char* l_arcNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[2] = { "Prayer", "Wgeneral", }; -static char* l_evtNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[2] = { NULL, "GET_HEART", }; -static char* l_myName = "Prayer"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Prayer"; -daNpcPray_c::EvtSeq daNpcPray_c::mEvtSeqList[] = { +DUSK_GAME_DATA daNpcPray_c::EvtSeq DUSK_CONST daNpcPray_c::mEvtSeqList[] = { NULL, &daNpcPray_c::_Evt_GetHeart, }; -const daNpcPray_HIOParam daNpcPray_Param_c::m = { +DUSK_GAME_DATA const daNpcPray_HIOParam daNpcPray_Param_c::m = { 55.0f, -3.0f, 1.0f, @@ -837,7 +837,7 @@ static int daNpcPray_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcPray_MethodTable = { +static DUSK_CONST actor_method_class daNpcPray_MethodTable = { (process_method_func)daNpcPray_Create, (process_method_func)daNpcPray_Delete, (process_method_func)daNpcPray_Execute, @@ -845,7 +845,7 @@ static actor_method_class daNpcPray_MethodTable = { (process_method_func)daNpcPray_Draw, }; -actor_process_profile_definition g_profile_NPC_PRAYER = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_PRAYER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_raca.cpp b/src/d/actor/d_a_npc_raca.cpp index 1db4dff86c..42b01aeaff 100644 --- a/src/d/actor/d_a_npc_raca.cpp +++ b/src/d/actor/d_a_npc_raca.cpp @@ -80,30 +80,30 @@ enum Type { /* 0x1 */ TYPE_1, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_RACA, RACA}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Raca", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[8] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[8] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, 32, J3DFrameCtrl::EMode_LOOP, RACA, 1}, {BCK_RACA_F_TALK_A, J3DFrameCtrl::EMode_NONE, RACA, BTP_RACA, J3DFrameCtrl::EMode_LOOP, RACA, 1}, {BCK_RACA_F_TALK_B, J3DFrameCtrl::EMode_NONE, RACA, BTP_RACA_F_TALK_B, J3DFrameCtrl::EMode_NONE, RACA, 0}, @@ -114,7 +114,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[8] = { {BCK_RACA_FH_BITTERSMILE, J3DFrameCtrl::EMode_LOOP, RACA, BTP_RACA_FH_BITTERSMILE, J3DFrameCtrl::EMode_LOOP, RACA, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[10] = { {BCK_RACA_WAIT_A, J3DFrameCtrl::EMode_LOOP, RACA, BTK_RACA, J3DFrameCtrl::EMode_NONE, RACA, 1, 0}, {BCK_RACA_GIVEME, J3DFrameCtrl::EMode_LOOP, RACA, BTK_RACA, J3DFrameCtrl::EMode_NONE, RACA, 1, 0}, {BCK_RACA_TALK_A, J3DFrameCtrl::EMode_NONE, RACA, BTK_RACA, J3DFrameCtrl::EMode_NONE, RACA, 1, 0}, @@ -127,7 +127,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[10] = { {BCK_RACA_STEP, J3DFrameCtrl::EMode_NONE, RACA,BTK_RACA, J3DFrameCtrl::EMode_NONE, RACA, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[32] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[32] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {5, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {6, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -138,7 +138,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[32] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -150,13 +150,13 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[36] = { {9, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Raca_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Raca_c::mCutNameList = ""; -daNpc_Raca_c::cutFunc daNpc_Raca_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_Raca_c::cutFunc DUSK_CONST daNpc_Raca_c::mCutList[1] = { NULL, }; -daNpc_Raca_HIOParam const daNpc_Raca_Param_c::m = { +DUSK_GAME_DATA daNpc_Raca_HIOParam const daNpc_Raca_Param_c::m = { 230.0f, -3.0f, 1.0f, @@ -843,7 +843,7 @@ static int daNpc_Raca_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpc_Raca_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Raca_MethodTable = { (process_method_func)daNpc_Raca_Create, (process_method_func)daNpc_Raca_Delete, (process_method_func)daNpc_Raca_Execute, @@ -851,7 +851,7 @@ static actor_method_class daNpc_Raca_MethodTable = { (process_method_func)daNpc_Raca_Draw, }; -actor_process_profile_definition g_profile_NPC_RACA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_RACA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_rafrel.cpp b/src/d/actor/d_a_npc_rafrel.cpp index dfc6e912fe..8a4e5d03ef 100644 --- a/src/d/actor/d_a_npc_rafrel.cpp +++ b/src/d/actor/d_a_npc_rafrel.cpp @@ -10,7 +10,7 @@ #include "d/d_debug_viewer.h" #include -static daNpc_GetParam2 l_bckGetParamList[29] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[29] = { {-1, 2, 0}, {9, 0, 0}, {7, 0, 0}, @@ -42,13 +42,13 @@ static daNpc_GetParam2 l_bckGetParamList[29] = { {5, 2, 3}, }; -static daNpc_GetParam2 l_btpGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[4] = { {23, 2, 0}, {24, 0, 0}, {25, 2, 0}, {30, 2, 0}, }; -static daNpc_GetParam2 l_btkGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[5] = { {20, 2, 0}, {24, 0, 1}, {25, 2, 1}, @@ -56,38 +56,38 @@ static daNpc_GetParam2 l_btkGetParamList[5] = { {27, 2, 1}, }; -static int l_loadRes_RAFREL0[] = { +static DUSK_CONSTEXPR int l_loadRes_RAFREL0[] = { 0, 2, -1, }; -static int l_loadRes_RAFREL1[] = { +static DUSK_CONSTEXPR int l_loadRes_RAFREL1[] = { 0, 1, -1, }; -static int l_loadRes_RAFREL2[] = { +static DUSK_CONSTEXPR int l_loadRes_RAFREL2[] = { 0, 3, -1, }; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_RAFREL0, l_loadRes_RAFREL1, l_loadRes_RAFREL2, }; -static char* l_arcNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[4] = { "Rafrel", "Rafrel1", "Rafrel2", "Rafrel3", }; -static char* l_evtNames[7] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[7] = { "", "THE_INTRODUCTION", "RESIST_MEETING", @@ -97,7 +97,7 @@ static char* l_evtNames[7] = { "RESIST_WIRETAP_RAFREL", }; -const daNpcRafrel_HIOParam daNpcRafrel_Param_c::m = { +DUSK_GAME_DATA const daNpcRafrel_HIOParam daNpcRafrel_Param_c::m = { 35.0f, -3.0f, 1.0f, @@ -135,7 +135,7 @@ const daNpcRafrel_HIOParam daNpcRafrel_Param_c::m = { 0, }; -static char* l_myName = "Rafrel"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Rafrel"; #if DEBUG daNpcRafrel_HIO_c::daNpcRafrel_HIO_c() { @@ -152,7 +152,7 @@ void daNpcRafrel_HIO_c::genMessage(JORMContext* ctx) { static NPC_RAFREL_HIO_CLASS l_HIO; typedef BOOL (daNpcRafrel_c::*EventFn)(int); -EventFn daNpcRafrel_c::mEvtSeqList[] = { +DUSK_GAME_DATA EventFn daNpcRafrel_c::mEvtSeqList[] = { NULL, &daNpcRafrel_c::EvCut_Introduction, &daNpcRafrel_c::EvCut_Meeting, @@ -1749,7 +1749,7 @@ static int daNpcRafrel_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcRafrel_MethodTable = { +static DUSK_CONST actor_method_class daNpcRafrel_MethodTable = { (process_method_func)daNpcRafrel_Create, (process_method_func)daNpcRafrel_Delete, (process_method_func)daNpcRafrel_Execute, @@ -1757,7 +1757,7 @@ static actor_method_class daNpcRafrel_MethodTable = { (process_method_func)daNpcRafrel_Draw, }; -actor_process_profile_definition g_profile_NPC_RAFREL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_RAFREL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_saru.cpp b/src/d/actor/d_a_npc_saru.cpp index 500daea704..7f3f9e1126 100644 --- a/src/d/actor/d_a_npc_saru.cpp +++ b/src/d/actor/d_a_npc_saru.cpp @@ -11,6 +11,8 @@ #include "d/actor/d_a_e_ym.h" #include +#include "helpers/string.hpp" + enum saru_TW_RES_File_ID { /* BMDR */ /* 0x4 */ BMDR_SARU_BARA_TW = 0x4, @@ -61,37 +63,37 @@ enum Material { /* 0x2 */ MAT_SARU_FACE_M, }; -static int l_bmdData[4][2] = { +static DUSK_CONSTEXPR int l_bmdData[4][2] = { { npc_ks_class::BMDR_SARU, 1 }, { BMDR_SARU_TW, 2 }, { npc_ks_class::BMDR_SARU_BARA, 1 }, { BMDR_SARU_BARA_TW, 2 }, }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"NO_RESPONSE", 0}, {"YM_LOOK", 2}, }; -static char* l_resNameList[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[4] = { "", "Npc_ks", "saru_TW", "saru" }; -static s8 l_loadResPtrn0[4] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = { NPC_KS, SARU_TW, SARU, -1, }; -static s8* l_loadResPtrnList[4] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0 }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, J3DFrameCtrl::EMode_NONE, 0, npc_ks_class::BTP_SARU, J3DFrameCtrl::EMode_LOOP, NPC_KS, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[51] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[51] = { {npc_ks_class::BCK_SARU_WAIT_A, J3DFrameCtrl::EMode_LOOP, NPC_KS, -1, J3DFrameCtrl::EMode_NONE, 0, 0, 0}, {npc_ks_class::BCK_SARU_WAIT_B, J3DFrameCtrl::EMode_LOOP, NPC_KS, @@ -196,11 +198,11 @@ static daNpcT_motionAnmData_c l_motionAnmData[51] = { -1, J3DFrameCtrl::EMode_NONE, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -214,21 +216,21 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[44] = { {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Saru_c::mCutNameList[4] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Saru_c::mCutNameList[4] = { "", "FIND_MONKEY", "HELP_ME", "YM_LOOK", }; -daNpc_Saru_c::cutFunc daNpc_Saru_c::mCutList[4] = { +DUSK_GAME_DATA daNpc_Saru_c::cutFunc DUSK_CONST daNpc_Saru_c::mCutList[4] = { NULL, &daNpc_Saru_c::cutFindMonkey, &daNpc_Saru_c::cutHelpMe, &daNpc_Saru_c::cutYmLook, }; -daNpc_Saru_HIOParam const daNpc_Saru_Param_c::m = { +DUSK_GAME_DATA daNpc_Saru_HIOParam const daNpc_Saru_Param_c::m = { 140.0f, -3.0f, 1.0f, @@ -956,8 +958,8 @@ int daNpc_Saru_c::cutYmLook(int param_1) { if (dComIfGp_getEventManager().getIsAddvance(param_1) != 0) { switch (iVar1) { case 0: - strcpy(acStack_88, l_evtList[2].eventName); - strcat(acStack_88, "@"); + SAFE_STRCPY(acStack_88, l_evtList[2].eventName); + SAFE_STRCAT(acStack_88, "@"); dComIfGp_getEvent()->setSkipZev(this, acStack_88); dComIfGp_getEvent()->onSkipFade(); field_0xfd9 = 1; @@ -1223,7 +1225,7 @@ static int daNpc_Saru_IsDelete(void* param_1) { return 1; } -static actor_method_class daNpc_Saru_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Saru_MethodTable = { (process_method_func)daNpc_Saru_Create, (process_method_func)daNpc_Saru_Delete, (process_method_func)daNpc_Saru_Execute, @@ -1231,7 +1233,7 @@ static actor_method_class daNpc_Saru_MethodTable = { (process_method_func)daNpc_Saru_Draw, }; -actor_process_profile_definition g_profile_NPC_SARU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SARU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_seib.cpp b/src/d/actor/d_a_npc_seib.cpp index b87793ea82..e5ab22228b 100644 --- a/src/d/actor/d_a_npc_seib.cpp +++ b/src/d/actor/d_a_npc_seib.cpp @@ -8,51 +8,51 @@ #include "d/actor/d_a_npc_seib.h" #include -static int l_bmdData[2][1] = {12, 1}; +static DUSK_CONSTEXPR int l_bmdData[2][1] = {12, 1}; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = {"", "seiB"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = {"", "seiB"}; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData = {-1, 0, 0, -1, 0, 0, 0}; +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData = {-1, 0, 0, -1, 0, 0, 0}; -static daNpcT_motionAnmData_c l_motionAnmData[4] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[4] = { {9, 2, 1, -1, 0, 0, 0, 0}, {7, 0, 1, -1, 0, 0, 0, 0}, {6, 2, 1, -1, 0, 0, 0, 0}, {8, 0, 1, -1, 0, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[16] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[16] = { {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, 0, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, 0, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_seiB_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_seiB_c::mCutNameList = ""; -daNpc_seiB_c::cutFunc daNpc_seiB_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_seiB_c::cutFunc DUSK_CONST daNpc_seiB_c::mCutList[1] = { 0, }; -daNpc_seiB_HIOParam const daNpc_seiB_Param_c::m = { +DUSK_GAME_DATA daNpc_seiB_HIOParam const daNpc_seiB_Param_c::m = { 0.0f, 0.0f, 1.0f, @@ -558,13 +558,13 @@ static int daNpc_seiB_IsDelete(void* param_1) { return 1; } -static actor_method_class daNpc_seiB_MethodTable = { +static DUSK_CONST actor_method_class daNpc_seiB_MethodTable = { (process_method_func)daNpc_seiB_Create, (process_method_func)daNpc_seiB_Delete, (process_method_func)daNpc_seiB_Execute, (process_method_func)daNpc_seiB_IsDelete, (process_method_func)daNpc_seiB_Draw, }; -actor_process_profile_definition g_profile_NPC_SEIB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_seic.cpp b/src/d/actor/d_a_npc_seic.cpp index a31eb09d73..bb94a59c39 100644 --- a/src/d/actor/d_a_npc_seic.cpp +++ b/src/d/actor/d_a_npc_seic.cpp @@ -9,53 +9,53 @@ #include "SSystem/SComponent/c_counter.h" #include -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {9, 1} }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE",0 } }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "seiC" }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { -1, 0, 0, -1, 0, 0, 0 }; -static daNpcT_motionAnmData_c l_motionAnmData = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData = { 6, 2, 1, -1, 0, 0, 0, 0 }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_seiC_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_seiC_c::mCutNameList = ""; -daNpc_seiC_c::cutFunc daNpc_seiC_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_seiC_c::cutFunc DUSK_CONST daNpc_seiC_c::mCutList[1] = { 0 }; -daNpc_seiC_HIOParam const daNpc_seiC_Param_c::m = { +DUSK_GAME_DATA daNpc_seiC_HIOParam const daNpc_seiC_Param_c::m = { 0.0f, 0.0f, 1.0f, @@ -499,7 +499,7 @@ static int daNpc_seiC_IsDelete(void* param_1) { return 1; } -static actor_method_class daNpc_seiC_MethodTable = { +static DUSK_CONST actor_method_class daNpc_seiC_MethodTable = { (process_method_func)daNpc_seiC_Create, (process_method_func)daNpc_seiC_Delete, (process_method_func)daNpc_seiC_Execute, @@ -507,7 +507,7 @@ static actor_method_class daNpc_seiC_MethodTable = { (process_method_func)daNpc_seiC_Draw, }; -actor_process_profile_definition g_profile_NPC_SEIC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_seid.cpp b/src/d/actor/d_a_npc_seid.cpp index 74ee8801cf..ed96e2ebe5 100644 --- a/src/d/actor/d_a_npc_seid.cpp +++ b/src/d/actor/d_a_npc_seid.cpp @@ -9,53 +9,53 @@ #include "SSystem/SComponent/c_counter.h" #include -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {5, 1} }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE",0 } }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "seiD", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, 0, 0, -1, 0, 0, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {-1, 2, 0, -1, 0, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_seiD_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_seiD_c::mCutNameList = ""; -daNpc_seiD_c::cutFunc daNpc_seiD_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_seiD_c::cutFunc DUSK_CONST daNpc_seiD_c::mCutList[1] = { 0 }; -daNpc_seiD_HIOParam const daNpc_seiD_Param_c::m = { +DUSK_GAME_DATA daNpc_seiD_HIOParam const daNpc_seiD_Param_c::m = { 0.0f, 0.0f, 1.0f, @@ -497,7 +497,7 @@ static int daNpc_seiD_IsDelete(void* param_1) { return 1; } -static actor_method_class daNpc_seiD_MethodTable = { +static DUSK_CONST actor_method_class daNpc_seiD_MethodTable = { (process_method_func)daNpc_seiD_Create, (process_method_func)daNpc_seiD_Delete, (process_method_func)daNpc_seiD_Execute, @@ -505,7 +505,7 @@ static actor_method_class daNpc_seiD_MethodTable = { (process_method_func)daNpc_seiD_Draw, }; -actor_process_profile_definition g_profile_NPC_SEID = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SEID = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_seira.cpp b/src/d/actor/d_a_npc_seira.cpp index 12cbd6464f..c8d0b52503 100644 --- a/src/d/actor/d_a_npc_seira.cpp +++ b/src/d/actor/d_a_npc_seira.cpp @@ -10,19 +10,19 @@ #include -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {4, 3}, {17, 2}, }; -static daNpcT_evtData_c l_evtList[4] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[4] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"CONVERSATION_ABOUT_SARU01", 3}, {"CONVERSATION_ABOUT_SARU02", 3}, }; -static char* l_resNameList[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[5] = { "", "Seira", "SeraBtl", @@ -30,16 +30,16 @@ static char* l_resNameList[5] = { "Seira_p1", }; -static s8 l_loadResPtrn0[4] = {3, 1, 2, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = {3, 1, 2, -1}; -static s8 l_loadResPtrn1[3] = {3, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = {3, 4, -1}; -static s8* l_loadResPtrnList[7] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[7] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {-1, 0, 0, 67, 2, 1, 1}, {14, 0, 1, 67, 2, 1, 1}, {11, 0, 1, 75, 0, 1, 0}, @@ -56,7 +56,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {18, 2, 1, 81, 2, 1, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[26] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[26] = { {42, 2, 1, 45, 0, 1, 1, 12}, {37, 2, 1, 55, 0, 1, 0, 12}, {41, 2, 1, 45, 0, 1, 1, 12}, @@ -85,7 +85,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[26] = { {38, 0, 1, 45, 0, 1, 1, 12}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -95,7 +95,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = {13, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[104] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[104] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -111,19 +111,19 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[104] = { {25, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Seira_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Seira_c::mCutNameList[2] = { "", "CONVERSATION_ABOUT_SARU", }; -daNpc_Seira_c::cutFunc daNpc_Seira_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_Seira_c::cutFunc DUSK_CONST daNpc_Seira_c::mCutList[2] = { NULL, &daNpc_Seira_c::cutConversationAboutSaru, }; static NPC_SEIRA_HIO_CLASS l_HIO; -const daNpc_Seira_HIOParam daNpc_Seira_Param_c::m = { +DUSK_GAME_DATA const daNpc_Seira_HIOParam daNpc_Seira_Param_c::m = { 210.0f, -3.0f, 1.0f, @@ -1401,7 +1401,7 @@ static int daNpc_Seira_IsDelete(void* param_0) { return 1; } -static actor_method_class daNpc_Seira_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Seira_MethodTable = { (process_method_func)daNpc_Seira_Create, (process_method_func)daNpc_Seira_Delete, (process_method_func)daNpc_Seira_Execute, @@ -1409,7 +1409,7 @@ static actor_method_class daNpc_Seira_MethodTable = { (process_method_func)daNpc_Seira_Draw, }; -actor_process_profile_definition g_profile_NPC_SEIRA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIRA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_seira2.cpp b/src/d/actor/d_a_npc_seira2.cpp index 73e7ff44d3..fc5afa55bb 100644 --- a/src/d/actor/d_a_npc_seira2.cpp +++ b/src/d/actor/d_a_npc_seira2.cpp @@ -8,31 +8,31 @@ #include "d/actor/d_a_npc_seira2.h" #include -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { {4, 3}, {17, 2}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"DEFAULT_GETITEM", 0}, }; -static char* l_resNameList[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[4] = { "", "Seira", "SeraBtl", "Sera", }; -static s8 l_loadResPtrn0[4] = {3, 1, 2, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = {3, 1, 2, -1}; -static s8* l_loadResPtrnList[7] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[7] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {-1, 0, 0, 67, 2, 1, 1}, {14, 0, 1, 67, 2, 1, 1}, {11, 0, 1, 75, 0, 1, 0}, @@ -49,7 +49,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {18, 2, 1, 81, 2, 1, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[25] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[25] = { {42, 2, 1, 45, 0, 1, 1, 12}, {37, 2, 1, 55, 0, 1, 0, 12}, {41, 2, 1, 45, 0, 1, 1, 12}, @@ -77,7 +77,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[25] = { {38, 0, 1, 45, 0, 1, 1, 12}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -87,7 +87,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = {13, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[100] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[100] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -103,13 +103,13 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[100] = { {24, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Seira2_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Seira2_c::mCutNameList[1] = {""}; -daNpc_Seira2_c::cutFunc daNpc_Seira2_c::mCutList[1] = { NULL }; +DUSK_GAME_DATA daNpc_Seira2_c::cutFunc DUSK_CONST daNpc_Seira2_c::mCutList[1] = { NULL }; static NPC_SEIRA2_HIO_CLASS l_HIO; -const daNpc_Seira2_HIOParam daNpc_Seira2_Param_c::m = { +DUSK_GAME_DATA const daNpc_Seira2_HIOParam daNpc_Seira2_Param_c::m = { 210.0f, -3.0f, 1.0f, @@ -1116,7 +1116,7 @@ static int daNpc_Seira2_IsDelete(void*) { return 1; } -static actor_method_class daNpc_Seira2_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Seira2_MethodTable = { (process_method_func)daNpc_Seira2_Create, (process_method_func)daNpc_Seira2_Delete, (process_method_func)daNpc_Seira2_Execute, @@ -1124,7 +1124,7 @@ static actor_method_class daNpc_Seira2_MethodTable = { (process_method_func)daNpc_Seira2_Draw, }; -actor_process_profile_definition g_profile_NPC_SERA2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SERA2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_seirei.cpp b/src/d/actor/d_a_npc_seirei.cpp index 806118cf9f..85d9e83476 100644 --- a/src/d/actor/d_a_npc_seirei.cpp +++ b/src/d/actor/d_a_npc_seirei.cpp @@ -90,68 +90,68 @@ enum Type { /* 0x3 */ TYPE_3, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDE_SEIA, SEIREI}, }; -static daNpcT_evtData_c l_evtList[4] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[4] = { {"", 0}, {"CONVERSATION_ABOUT_YM", 2}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Seirei", "Seirei1", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { SEIREI, -1, }; -static s8 l_loadResPtrn1[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[2] = { SEIREI1, -1, }; - static s8* l_loadResPtrnList[4] = { + static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[4] = { l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, -1, J3DFrameCtrl::EMode_NONE, NONE, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[2] = { {BCK_SEIA_WAIT_A, J3DFrameCtrl::EMode_LOOP, SEIREI, -1, J3DFrameCtrl::EMode_NONE, NONE, 0, 0}, {BCK_SEIA_WAIT_B, J3DFrameCtrl::EMode_NONE, SEIREI, -1, J3DFrameCtrl::EMode_NONE, NONE, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[12] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[12] = { {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, 0, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Seirei_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Seirei_c::mCutNameList[2] = { "", "CONVERSATION", }; -daNpc_Seirei_c::cutFunc daNpc_Seirei_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_Seirei_c::cutFunc DUSK_CONST daNpc_Seirei_c::mCutList[2] = { NULL, &daNpc_Seirei_c::cutConversation, }; -daNpc_Seirei_HIOParam const daNpc_Seirei_Param_c::m = { +DUSK_GAME_DATA daNpc_Seirei_HIOParam const daNpc_Seirei_Param_c::m = { 600.0f, 0.0f, 1.0f, @@ -815,7 +815,7 @@ static int daNpc_Seirei_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpc_Seirei_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Seirei_MethodTable = { (process_method_func)daNpc_Seirei_Create, (process_method_func)daNpc_Seirei_Delete, (process_method_func)daNpc_Seirei_Execute, @@ -823,7 +823,7 @@ static actor_method_class daNpc_Seirei_MethodTable = { (process_method_func)daNpc_Seirei_Draw, }; -actor_process_profile_definition g_profile_NPC_SEIREI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SEIREI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_shad.cpp b/src/d/actor/d_a_npc_shad.cpp index 3b58c47650..a93e02a94e 100644 --- a/src/d/actor/d_a_npc_shad.cpp +++ b/src/d/actor/d_a_npc_shad.cpp @@ -12,7 +12,7 @@ #include "d/d_msg_object.h" #include -const daNpcShad_HIOParam daNpcShad_Param_c::m = { +DUSK_GAME_DATA const daNpcShad_HIOParam daNpcShad_Param_c::m = { 35.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -186,7 +186,7 @@ enum Joint { /* 0x1E */ JNT_FOOTR, }; -static daNpc_GetParam2 l_bckGetParamList[36] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[36] = { {-1, J3DFrameCtrl::EMode_LOOP, SHAD}, {BCK_SHAD_F_TALK_A, J3DFrameCtrl::EMode_NONE, SHAD}, {BCK_SHAD_F_HAPPY, J3DFrameCtrl::EMode_NONE, SHAD}, @@ -225,7 +225,7 @@ static daNpc_GetParam2 l_bckGetParamList[36] = { {BCK_SHAD_SURPRISE_WAIT, J3DFrameCtrl::EMode_LOOP, SHAD1}, }; -static daNpc_GetParam2 l_btpGetParamList[11] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[11] = { {BTP_SHAD, J3DFrameCtrl::EMode_LOOP, SHAD}, {BTP_SHAD_F_ANGER, J3DFrameCtrl::EMode_NONE, SHAD1}, {BTP_SHAD_F_DISCOURAGED, J3DFrameCtrl::EMode_NONE, SHAD}, @@ -239,7 +239,7 @@ static daNpc_GetParam2 l_btpGetParamList[11] = { {BTP_SHAD_FH_HAPPY, J3DFrameCtrl::EMode_LOOP, SHAD}, }; -static daNpc_GetParam2 l_btkGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btkGetParamList[5] = { {BTK_SHAD, J3DFrameCtrl::EMode_LOOP, SHAD}, {BTK_SHAD_DISCOURAGED, J3DFrameCtrl::EMode_NONE, SHAD1}, {BTK_SHAD_DISCOURAGED_WAIT, J3DFrameCtrl::EMode_LOOP, SHAD1}, @@ -259,20 +259,20 @@ static int l_loadRes_SHAD2[3] = { 0, 3, -1, }; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_SHAD0, l_loadRes_SHAD1, l_loadRes_SHAD2, }; -static char* l_arcNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[4] = { "Shad", "Shad1", "Shad2", "Shad3", }; -static char* l_evtNames[14] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[14] = { "", "THE_INTRODUCTION", "RESIST_MEETING", @@ -289,7 +289,7 @@ static char* l_evtNames[14] = { "RESIST_WIRETAP_RAFREL" }; -static char* l_evtArcs[14] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtArcs[14] = { NULL, NULL, NULL, @@ -306,11 +306,11 @@ static char* l_evtArcs[14] = { NULL, }; -static char* l_myName = "Shad"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Shad"; static NPC_SHAD_HIO_CLASS l_HIO; -daNpcShad_c::EventFn daNpcShad_c::mEvtSeqList[14] = { +DUSK_GAME_DATA daNpcShad_c::EventFn DUSK_CONST daNpcShad_c::mEvtSeqList[14] = { NULL, &daNpcShad_c::EvCut_Introduction, &daNpcShad_c::EvCut_Meeting, @@ -1204,7 +1204,7 @@ bool daNpcShad_c::wait_type0(void* param_1) { eventInfo.setArchiveName(l_evtArcs[mOrderEvtNo]); } - char* event; + char DUSK_CONST* event; if (mOrderEvtNo != 0) { event = l_evtNames[mOrderEvtNo]; } else { @@ -1376,7 +1376,7 @@ bool daNpcShad_c::wait_type1(void* param_1) { eventInfo.setArchiveName(l_evtArcs[mOrderEvtNo]); } - char* event; + char DUSK_CONST* event; if (mOrderEvtNo != 0) { event = l_evtNames[mOrderEvtNo]; } else { @@ -2638,7 +2638,7 @@ inline BOOL daNpcShad_c::drawDbgInfo() { return FALSE; } -static actor_method_class daNpcShad_MethodTable = { +static DUSK_CONST actor_method_class daNpcShad_MethodTable = { (process_method_func)daNpcShad_Create, (process_method_func)daNpcShad_Delete, (process_method_func)daNpcShad_Execute, @@ -2646,7 +2646,7 @@ static actor_method_class daNpcShad_MethodTable = { (process_method_func)daNpcShad_Draw, }; -actor_process_profile_definition g_profile_NPC_SHAD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SHAD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_shaman.cpp b/src/d/actor/d_a_npc_shaman.cpp index 76b6acb69f..bb1e070c92 100644 --- a/src/d/actor/d_a_npc_shaman.cpp +++ b/src/d/actor/d_a_npc_shaman.cpp @@ -89,11 +89,11 @@ enum RES_Name { /* 0x1 */ SHA, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_SHA, SHA}, }; -static daNpcT_evtData_c l_evtList[6] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[6] = { {"", 0}, {"NO_RESPONSE", 0}, {"PERFORM_AUGURY", 1}, @@ -102,22 +102,22 @@ static daNpcT_evtData_c l_evtList[6] = { {"RETURN", 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Sha", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { SHA, -1, }; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, 32, J3DFrameCtrl::EMode_LOOP, SHA, 1}, {10, J3DFrameCtrl::EMode_NONE, SHA, 32, J3DFrameCtrl::EMode_LOOP, SHA, 1}, {9, J3DFrameCtrl::EMode_NONE, SHA, 35, J3DFrameCtrl::EMode_NONE, SHA, 0}, @@ -130,7 +130,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[10] = { {13, J3DFrameCtrl::EMode_LOOP, SHA, 38, J3DFrameCtrl::EMode_LOOP, SHA, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[8] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[8] = { {23, J3DFrameCtrl::EMode_LOOP, SHA, 29, J3DFrameCtrl::EMode_NONE, SHA, 1, 0}, {19, J3DFrameCtrl::EMode_NONE, SHA, 29, J3DFrameCtrl::EMode_NONE, SHA, 1, 0}, {21, J3DFrameCtrl::EMode_NONE, SHA, 29, J3DFrameCtrl::EMode_NONE, SHA, 1, 0}, @@ -141,7 +141,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[8] = { {20, J3DFrameCtrl::EMode_NONE, SHA, 29, J3DFrameCtrl::EMode_NONE, SHA, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, 0, 1}, {8, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -154,7 +154,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[40] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[32] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[32] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {3, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -165,12 +165,12 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[32] = { {7, 0, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Sha_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Sha_c::mCutNameList[2] = { "", "PERFORM_AUGURY", }; -daNpc_Sha_c::cutFunc daNpc_Sha_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_Sha_c::cutFunc DUSK_CONST daNpc_Sha_c::mCutList[2] = { NULL, &daNpc_Sha_c::cutPerformAugury, }; @@ -193,7 +193,7 @@ daNpc_Sha_c::~daNpc_Sha_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_Sha_HIOParam const daNpc_Sha_Param_c::m = { +DUSK_GAME_DATA daNpc_Sha_HIOParam const daNpc_Sha_Param_c::m = { 210.0f, -3.0f, 1.0f, @@ -1131,15 +1131,15 @@ int daNpc_Sha_c::test(void* param_1) { return 1; } -const u16 daNpc_Sha_c::mEvtBitLabels[6] = { +DUSK_GAME_DATA const u16 daNpc_Sha_c::mEvtBitLabels[6] = { 0xF0FF, 0xEFFF, 0xEEFF, 0xEDFF, 0xECFF, 0xEBFF, }; -const u16 daNpc_Sha_c::mTmpBitLabels[6] = { +DUSK_GAME_DATA const u16 daNpc_Sha_c::mTmpBitLabels[6] = { 0xFAFF, 0xF9FF, 0xF8FF, 0xF7FF, 0xF6FF, 0xF5FF, }; -const int daNpc_Sha_c::mSceneChangeNoTable[48] = { +DUSK_GAME_DATA const int daNpc_Sha_c::mSceneChangeNoTable[48] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC, @@ -1154,7 +1154,7 @@ const int daNpc_Sha_c::mSceneChangeNoTable[48] = { 0x2D, -1, -1, -1, }; -daNpc_Sha_c::queryFunc daNpc_Sha_c::mQueries[48] = { +DUSK_GAME_DATA daNpc_Sha_c::queryFunc daNpc_Sha_c::mQueries[48] = { &daNpc_Sha_c::query000, &daNpc_Sha_c::query265, &daNpc_Sha_c::query000, &daNpc_Sha_c::query267, &daNpc_Sha_c::query000, &daNpc_Sha_c::query000, &daNpc_Sha_c::query078, &daNpc_Sha_c::query268, &daNpc_Sha_c::query265, &daNpc_Sha_c::query265, &daNpc_Sha_c::query078, &daNpc_Sha_c::query000, @@ -1242,7 +1242,7 @@ static int daNpc_Sha_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Sha_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Sha_MethodTable = { (process_method_func)daNpc_Sha_Create, (process_method_func)daNpc_Sha_Delete, (process_method_func)daNpc_Sha_Execute, @@ -1250,7 +1250,7 @@ static actor_method_class daNpc_Sha_MethodTable = { (process_method_func)daNpc_Sha_Draw, }; -actor_process_profile_definition g_profile_NPC_SHAMAN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SHAMAN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_shoe.cpp b/src/d/actor/d_a_npc_shoe.cpp index bf3a2b383c..b7fcc2e14c 100644 --- a/src/d/actor/d_a_npc_shoe.cpp +++ b/src/d/actor/d_a_npc_shoe.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_npc_shoe.h" #include "d/actor/d_a_npc.h" -const daNpcShoe_HIOParam daNpcShoe_Param_c::m = { +DUSK_GAME_DATA const daNpcShoe_HIOParam daNpcShoe_Param_c::m = { 55.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -82,7 +82,7 @@ bool daNpcShoe_c::chkFindPlayer() { return ret; } -static daNpc_GetParam2 l_bckGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_bckGetParamList[5] = { {17, 2, 1}, // m_sitwait_a {13, 0, 1}, // m_sittalk_a {14, 0, 1}, // m_sittalk_a_b @@ -90,21 +90,21 @@ static daNpc_GetParam2 l_bckGetParamList[5] = { {11, 2, 1} // m_sit_to_wolf_a }; -static daNpc_GetParam2 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_btpGetParamList[1] = { {12, 2, 0}, // shoe }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "shoe", "Mgeneral", "object", }; -static char* l_evtNames[1] = {NULL}; +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = {NULL}; -static char* l_myName = "Shoe"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Shoe"; -daNpcShoe_c::EventFn daNpcShoe_c::mEvtSeqList[1] = {NULL}; +DUSK_GAME_DATA daNpcShoe_c::EventFn DUSK_CONST daNpcShoe_c::mEvtSeqList[1] = {NULL}; daNpcShoe_c::daNpcShoe_c() {} @@ -736,13 +736,13 @@ BOOL daNpcShoe_c::drawDbgInfo() { return FALSE; } -static actor_method_class daNpcShoe_MethodTable = { +static DUSK_CONST actor_method_class daNpcShoe_MethodTable = { (process_method_func)daNpcShoe_Create, (process_method_func)daNpcShoe_Delete, (process_method_func)daNpcShoe_Execute, (process_method_func)daNpcShoe_IsDelete, (process_method_func)daNpcShoe_Draw, }; -actor_process_profile_definition g_profile_NPC_SHOE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SHOE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_shop0.cpp b/src/d/actor/d_a_npc_shop0.cpp index 1dd4b3e31f..e61ea44f4e 100644 --- a/src/d/actor/d_a_npc_shop0.cpp +++ b/src/d/actor/d_a_npc_shop0.cpp @@ -8,15 +8,17 @@ #include "d/actor/d_a_npc_shop0.h" #include +#include "helpers/string.hpp" + static int createHeapCallBack(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_resName = "Shop0"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resName = "Shop0"; -static char* l_bmdFileName = "grA_a.bmd"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bmdFileName = "grA_a.bmd"; -static char* l_bckFileNameTBL = "grA_wait_a"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bckFileNameTBL = "grA_wait_a"; daNpc_Shop0_c::~daNpc_Shop0_c() { dComIfG_resLoad(&mPhaseReq, getResName()); @@ -37,7 +39,7 @@ int daNpc_Shop0_c::create() { return phase_step; } -dCcD_SrcCyl const daNpc_Shop0_c::mCylDat = { +DUSK_GAME_DATA dCcD_SrcCyl const daNpc_Shop0_c::mCylDat = { { { 0x0, // mFlags @@ -60,7 +62,7 @@ dCcD_SrcCyl const daNpc_Shop0_c::mCylDat = { } }; -daNpc_Shop0_Param_c::param const daNpc_Shop0_Param_c::mParam = { +DUSK_GAME_DATA daNpc_Shop0_Param_c::param const daNpc_Shop0_Param_c::mParam = { 0x44480000, 0x44480000, 0x41F00000, @@ -133,7 +135,7 @@ int daNpc_Shop0_c::draw() { return 1; } -char* daNpc_Shop0_c::getResName() { +char DUSK_CONST* daNpc_Shop0_c::getResName() { return l_resName; } @@ -183,9 +185,9 @@ int daNpc_Shop0_c::init() { static char l_fileName[21]; -J3DAnmTransform* daNpc_Shop0_c::getTrnsfrmAnmP(int i_fileIndex, char** i_fileName) { - strcpy(l_fileName, i_fileName[i_fileIndex]); - strcat(l_fileName, ".bck"); +J3DAnmTransform* daNpc_Shop0_c::getTrnsfrmAnmP(int i_fileIndex, char DUSK_CONST* DUSK_CONST* i_fileName) { + SAFE_STRCPY(l_fileName, i_fileName[i_fileIndex]); + SAFE_STRCAT(l_fileName, ".bck"); return (J3DAnmTransform*) dComIfG_getObjectRes(getResName(), l_fileName); } @@ -346,11 +348,11 @@ static int daNpc_Shop0_IsDelete(void*) { return true; } -static actor_method_class daNpc_Shop0_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Shop0_MethodTable = { daNpc_Shop0_Create, daNpc_Shop0_Delete, daNpc_Shop0_Execute, daNpc_Shop0_IsDelete, daNpc_Shop0_Draw, }; -actor_process_profile_definition g_profile_NPC_SHOP0 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SHOP0 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_shop_maro.cpp b/src/d/actor/d_a_npc_shop_maro.cpp index d113c06855..334d46b839 100644 --- a/src/d/actor/d_a_npc_shop_maro.cpp +++ b/src/d/actor/d_a_npc_shop_maro.cpp @@ -33,7 +33,7 @@ int daNpc_shopMaro_c::create() { return cPhs_ERROR_e; } -static actor_method_class daNpc_shopMaro_MethodTable = { +static DUSK_CONST actor_method_class daNpc_shopMaro_MethodTable = { (process_method_func)daNpc_shopMaro_Create, (process_method_func)daNpc_shopMaro_Delete, (process_method_func)daNpc_shopMaro_Execute, @@ -41,7 +41,7 @@ static actor_method_class daNpc_shopMaro_MethodTable = { (process_method_func)daNpc_shopMaro_Draw, }; -actor_process_profile_definition g_profile_NPC_SMARO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SMARO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_sola.cpp b/src/d/actor/d_a_npc_sola.cpp index a8fb79593c..cf0b21dd32 100644 --- a/src/d/actor/d_a_npc_sola.cpp +++ b/src/d/actor/d_a_npc_sola.cpp @@ -20,53 +20,53 @@ enum RES_Name { /* 0x1 */ SOLA, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_SOLA, SOLA}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "solA", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[1] = {l_loadResPtrn0}; +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[1] = {l_loadResPtrn0}; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, -1, J3DFrameCtrl::EMode_NONE, NONE, FALSE}, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {BCK_SOLA_WAIT_A, J3DFrameCtrl::EMode_LOOP, SOLA, -1, J3DFrameCtrl::EMode_NONE, NONE, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_solA_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_solA_c::mCutNameList[1] = {""}; -daNpc_solA_c::cutFunc daNpc_solA_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_solA_c::cutFunc DUSK_CONST daNpc_solA_c::mCutList[1] = { NULL, }; -daNpc_solA_HIOParam const daNpc_solA_Param_c::m = { +DUSK_GAME_DATA daNpc_solA_HIOParam const daNpc_solA_Param_c::m = { 220.0f, -3.0f, 1.0f, 400.0f, 255.0f, 200.0f, 35.0f, 30.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f, 3, 6, 5, 6, 0.0f, 0.0f, 0.0f, 0.0f, 60, 8, 0, 0, 0, false, false, @@ -488,13 +488,13 @@ static int daNpc_solA_IsDelete(void* param_0) { return 1; } -static actor_method_class daNpc_solA_MethodTable = { +static DUSK_CONST actor_method_class daNpc_solA_MethodTable = { (process_method_func)daNpc_solA_Create, (process_method_func)daNpc_solA_Delete, (process_method_func)daNpc_solA_Execute, (process_method_func)daNpc_solA_IsDelete, (process_method_func)daNpc_solA_Draw, }; -actor_process_profile_definition g_profile_NPC_SOLA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SOLA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_soldierA.cpp b/src/d/actor/d_a_npc_soldierA.cpp index 14e188e4a8..a6fd6e6abb 100644 --- a/src/d/actor/d_a_npc_soldierA.cpp +++ b/src/d/actor/d_a_npc_soldierA.cpp @@ -89,12 +89,12 @@ enum Event_Cut_Nums { static NPC_SOLDIERA_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[2] = { {BMDR_SOLA_TW, CHTSOLA}, {BMDR_SOLA_SPEAR, CHTSOLA}, }; -static daNpc_GetParam1 l_bckGetParamList[7] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[7] = { {-1, CHTSOLA}, {BCK_SOLA_WAIT_A, CHTSOLA}, {BCK_SOLA_FEAR_WAIT, CHTSOLA}, @@ -104,42 +104,42 @@ static daNpc_GetParam1 l_bckGetParamList[7] = { {BCK_SOLA_TALK_B, CHTSOLA}, }; -static daNpc_GetParam1 l_evtGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[2] = { {0, CHTSOLA}, {1, CHTSOLA}, }; -static char* l_evtNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[2] = { NULL, "TALK_LAKE", }; -static int l_loadRes_SOLDIERaa[3] = { +static DUSK_CONSTEXPR int l_loadRes_SOLDIERaa[3] = { CHTSOLA, -1, -1, }; -static int l_loadRes_SOLDIERa0[3] = { +static DUSK_CONSTEXPR int l_loadRes_SOLDIERa0[3] = { CHTSOLA, -1, -1, }; -static int* l_loadRes_list[4] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[4] = { l_loadRes_SOLDIERaa, l_loadRes_SOLDIERaa, l_loadRes_SOLDIERaa, l_loadRes_SOLDIERa0, }; -static char* l_resNames[1] = {"chtSolA"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[1] = {"chtSolA"}; -static char* l_myName = "chtSolA"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "chtSolA"; -char* daNpc_SoldierA_c::mEvtCutNameList[3] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_SoldierA_c::mEvtCutNameList[3] = { "", "TALK_LAKE", "LISTEN_LAKE", }; -daNpc_SoldierA_c::cutFunc daNpc_SoldierA_c::mEvtCutList[3] = { +DUSK_GAME_DATA daNpc_SoldierA_c::cutFunc DUSK_CONST daNpc_SoldierA_c::mEvtCutList[3] = { NULL, &daNpc_SoldierA_c::ECut_talkLake, &daNpc_SoldierA_c::ECut_listenLake, @@ -163,7 +163,7 @@ daNpc_SoldierA_c::~daNpc_SoldierA_c() { #endif } -daNpc_SoldierA_HIOParam const daNpc_SoldierA_Param_c::m = { +DUSK_GAME_DATA daNpc_SoldierA_HIOParam const daNpc_SoldierA_Param_c::m = { 30.0f, -4.0f, 1.0f, @@ -1144,7 +1144,7 @@ static int daNpc_SoldierA_IsDelete(void* i_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_SoldierA_MethodTable = { +static DUSK_CONST actor_method_class daNpc_SoldierA_MethodTable = { (process_method_func)daNpc_SoldierA_Create, (process_method_func)daNpc_SoldierA_Delete, (process_method_func)daNpc_SoldierA_Execute, @@ -1152,7 +1152,7 @@ static actor_method_class daNpc_SoldierA_MethodTable = { (process_method_func)daNpc_SoldierA_Draw, }; -actor_process_profile_definition g_profile_NPC_SOLDIERa = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SOLDIERa = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_soldierB.cpp b/src/d/actor/d_a_npc_soldierB.cpp index 8ee1762ca4..b8289f479f 100644 --- a/src/d/actor/d_a_npc_soldierB.cpp +++ b/src/d/actor/d_a_npc_soldierB.cpp @@ -68,50 +68,50 @@ enum Event_Cut_Nums { static NPC_SOLDIERB_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[2] = {{10, 0}, {9, 0}}; +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[2] = {{10, 0}, {9, 0}}; -static daNpc_GetParam1 l_bckGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[4] = { {-1, 0}, {4, 0}, {6, 0}, {5, 0}, }; -static daNpc_GetParam1 l_evtGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[1] = { {0, 0}, }; -static char* l_evtNames[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[1] = { NULL, }; -static int l_loadRes_SOLDIERba[3] = { +static DUSK_CONSTEXPR int l_loadRes_SOLDIERba[3] = { 0, -1, -1, }; -static int l_loadRes_SOLDIERb0[3] = { +static DUSK_CONSTEXPR int l_loadRes_SOLDIERb0[3] = { 0, -1, -1, }; -static int* l_loadRes_list[2] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[2] = { l_loadRes_SOLDIERba, l_loadRes_SOLDIERb0, }; -static char* l_resNames[1] = {"chtSolB"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[1] = {"chtSolB"}; -static char* l_myName = "chtSolB"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "chtSolB"; -char* daNpc_SoldierB_c::mEvtCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_SoldierB_c::mEvtCutNameList[2] = { "", "LISTEN_LAKE", }; -daNpc_SoldierB_c::cutFunc daNpc_SoldierB_c::mEvtCutList[2] = { +DUSK_GAME_DATA daNpc_SoldierB_c::cutFunc DUSK_CONST daNpc_SoldierB_c::mEvtCutList[2] = { NULL, &daNpc_SoldierB_c::ECut_listenLake, }; @@ -128,7 +128,7 @@ daNpc_SoldierB_c::~daNpc_SoldierB_c() { } } -daNpc_SoldierB_HIOParam const daNpc_SoldierB_Param_c::m = { +DUSK_GAME_DATA daNpc_SoldierB_HIOParam const daNpc_SoldierB_Param_c::m = { 30.0f, // attention_offset -4.0f, // gravity 1.0f, // scale @@ -974,13 +974,13 @@ static int daNpc_SoldierB_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_SoldierB_MethodTable = { +static DUSK_CONST actor_method_class daNpc_SoldierB_MethodTable = { (process_method_func)daNpc_SoldierB_Create, (process_method_func)daNpc_SoldierB_Delete, (process_method_func)daNpc_SoldierB_Execute, (process_method_func)daNpc_SoldierB_IsDelete, (process_method_func)daNpc_SoldierB_Draw, }; -actor_process_profile_definition g_profile_NPC_SOLDIERb = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SOLDIERb = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_sq.cpp b/src/d/actor/d_a_npc_sq.cpp index 796e682ca1..9dbf078c53 100644 --- a/src/d/actor/d_a_npc_sq.cpp +++ b/src/d/actor/d_a_npc_sq.cpp @@ -381,7 +381,7 @@ static cPhs_Step daNpc_Sq_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daNpc_Sq_Method = { +static DUSK_CONST actor_method_class l_daNpc_Sq_Method = { (process_method_func)daNpc_Sq_Create, (process_method_func)daNpc_Sq_Delete, (process_method_func)daNpc_Sq_Execute, @@ -389,7 +389,7 @@ static actor_method_class l_daNpc_Sq_Method = { (process_method_func)daNpc_Sq_Draw, }; -actor_process_profile_definition g_profile_NPC_SQ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_SQ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_taro.cpp b/src/d/actor/d_a_npc_taro.cpp index 1461dc6dba..1a6a3473e3 100644 --- a/src/d/actor/d_a_npc_taro.cpp +++ b/src/d/actor/d_a_npc_taro.cpp @@ -31,11 +31,11 @@ enum TaroEvent { /* 0x18 */ EVENT_18 = 0x18, }; -static int l_bmdData[5][2] = { +static DUSK_CONSTEXPR int l_bmdData[5][2] = { 4, 1, 31, 4, 32, 4, 10, 2, 4, 9, }; -static daNpcT_evtData_c l_evtList[27] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[27] = { {"", 0}, {"NO_RESPONSE", 0}, {"HAIL", 4}, @@ -65,39 +65,39 @@ static daNpcT_evtData_c l_evtList[27] = { {"TAG_PUSH4", 4}, }; -static char* l_resNameList[11] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[11] = { "", "Taro", "Taro_TW", "Taro0", "Taro1", "Taro2", "Taro3", "Taro4", "Taro5", "TaroB", "Len1", }; -static s8 l_loadResPtrn0[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[5] = { 0x01, 0x03, 0x04, 0x06, -1, }; -static s8 l_loadResPtrn1[4] = {0x01, 0x03, 0x02, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[4] = {0x01, 0x03, 0x02, -1}; -static s8 l_loadResPtrn2[6] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[6] = { 0x01, 0x03, 0x05, 0x06, 0x07, -1, }; -static s8 l_loadResPtrn3[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[5] = { 0x01, 0x03, 0x04, 0x07, -1, }; -static s8 l_loadResPtrn4[4] = {0x01, 0x03, 0x08, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn4[4] = {0x01, 0x03, 0x08, -1}; -static s8 l_loadResPtrn5[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn5[5] = { 0x09, 0x03, 0x04, 0x08, -1, }; -static s8 l_loadResPtrn6[6] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn6[6] = { 0x01, 0x03, 0x04, 0x05, 0x06, -1, }; -static s8 l_loadResPtrn9[9] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[9] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, -1, }; -static s8* l_loadResPtrnList[17] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[17] = { l_loadResPtrn6, l_loadResPtrn6, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn3, l_loadResPtrn6, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn6, l_loadResPtrn6, @@ -105,7 +105,7 @@ static s8* l_loadResPtrnList[17] = { l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {-1, 0, 0, 7, 2, 1, 1}, {7, 0, 3, 7, 2, 1, 1}, {11, 0, 4, 43, 0, 4, 0}, @@ -138,7 +138,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[30] = { {7, 2, 8, 25, 2, 8, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[42] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[42] = { 9, 2, 3, 12, 0, 3, 1, 0, 25, 2, 4, 12, 0, 3, 1, 0, 10, 2, 6, 12, 0, 3, 1, 0, 26, 2, 4, 12, 0, 3, 1, 0, 27, 2, 4, 12, 0, 3, 1, 0, 28, 2, 4, 12, 0, 3, 1, 0, 8, 0, 6, 12, 0, 3, 1, 0, -1, 0, 0, -1, 0, 0, 0, 0, 17, 2, 4, 12, 0, 3, 1, 0, @@ -155,7 +155,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[42] = { 6, 2, 8, 22, 2, 8, 0, 0, 17, 0, 8, 12, 0, 3, 1, 0, 18, 2, 8, 12, 0, 3, 1, 0, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[128] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[128] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {9, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {10, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {11, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {12, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -174,7 +174,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[128] {29, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[168] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[168] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {21, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {22, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {17, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {24, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -198,7 +198,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[168] = { {40, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {40, -1, 1}, {41, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Taro_c::mCutNameList[17] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Taro_c::mCutNameList[17] = { "", "CONVERSATION_ABOUT_PACHINKO", "CONVERSATION_ABOUT_WOODSWD", @@ -218,7 +218,7 @@ char* daNpc_Taro_c::mCutNameList[17] = { "TAG_PUSH4", }; -daNpc_Taro_c::cutFunc daNpc_Taro_c::mCutList[17] = { +DUSK_GAME_DATA daNpc_Taro_c::cutFunc DUSK_CONST daNpc_Taro_c::mCutList[17] = { NULL, &daNpc_Taro_c::cutConversationAboutPachinko, &daNpc_Taro_c::cutConversationAboutWoodSwd, @@ -240,7 +240,7 @@ daNpc_Taro_c::cutFunc daNpc_Taro_c::mCutList[17] = { static NPC_TARO_HIO_CLASS l_HIO; -daNpc_Taro_HIOParam const daNpc_Taro_Param_c::m = { +DUSK_GAME_DATA daNpc_Taro_HIOParam const daNpc_Taro_Param_c::m = { 140.0f, -3.0f, 1.0f, 400.0f, 255.0f, 120.0f, 35.0f, 30.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f, 3, 6, 5, 6, 110.0f, 0.0f, 0.0f, 0.0f, 60, 8, 0, 0, 0, 0, 0, @@ -3389,7 +3389,7 @@ static int daNpc_Taro_IsDelete(void* i_this) { AUDIO_INSTANCES -static actor_method_class daNpc_Taro_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Taro_MethodTable = { (process_method_func)daNpc_Taro_Create, (process_method_func)daNpc_Taro_Delete, (process_method_func)daNpc_Taro_Execute, @@ -3397,7 +3397,7 @@ static actor_method_class daNpc_Taro_MethodTable = { (process_method_func)daNpc_Taro_Draw, }; -actor_process_profile_definition g_profile_NPC_TARO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TARO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_the.cpp b/src/d/actor/d_a_npc_the.cpp index 4e3fd39366..01b7fbb66c 100644 --- a/src/d/actor/d_a_npc_the.cpp +++ b/src/d/actor/d_a_npc_the.cpp @@ -12,7 +12,7 @@ #include "SSystem/SComponent/c_math.h" #include -const daNpcThe_HIOParam daNpcThe_Param_c::m = { +DUSK_GAME_DATA const daNpcThe_HIOParam daNpcThe_Param_c::m = { 220.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -64,12 +64,12 @@ void daNpcThe_HIO_c::genMessage(JORMContext* ctext) { static NPC_THE_HIO_CLASS l_HIO; -static daNpc_GetParam1 l_bmdGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[2] = { {23, 0}, // the {24, 0}, // the_tw }; -static daNpc_GetParam1 l_bckGetParamList[27] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[27] = { {-1, 0}, // {10, 0}, // the_f_talk_a {9, 0}, // the_f_smile @@ -99,7 +99,7 @@ static daNpc_GetParam1 l_bckGetParamList[27] = { {3, 2}, // the_kune_shishi }; -static daNpc_GetParam1 l_btpGetParamList[14] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[14] = { {30, 0}, // the {34, 0}, // the_f_talk_a {33, 0}, // the_f_smile @@ -116,53 +116,53 @@ static daNpc_GetParam1 l_btpGetParamList[14] = { {43, 0}, // the_fh_talk_r }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {27, 0}, // the }; -static int l_loadRes_THE0[3] = {0, 1, -1}; +static DUSK_CONSTEXPR int l_loadRes_THE0[3] = {0, 1, -1}; -static int l_loadRes_THE1[3] = {0, 1, -1}; +static DUSK_CONSTEXPR int l_loadRes_THE1[3] = {0, 1, -1}; -static int l_loadRes_THE2[3] = {0, 2, -1}; +static DUSK_CONSTEXPR int l_loadRes_THE2[3] = {0, 2, -1}; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_THE0, l_loadRes_THE1, l_loadRes_THE2, }; -static char* l_resNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[4] = { "The", "The1", "The2", "yelB_TW", }; -static int l_evtGetParamList[4] = { +static DUSK_CONSTEXPR int l_evtGetParamList[4] = { 0, 3, 3, 0, }; -static char* l_evtNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[4] = { NULL, "TW_RESISTANCE1", "TW_RESISTANCE2", "THE_INTRODUCTION", }; -static char* l_myName = "The"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "The"; -char* daNpcThe_c::mEvtCutNameList[4] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpcThe_c::mEvtCutNameList[4] = { "", "TW_RESISTANCE", "TW_RESISTANCE", "THE_INTRODUCTION", }; -daNpcThe_c::EventFn daNpcThe_c::mEvtCutList[4] = { +DUSK_GAME_DATA daNpcThe_c::EventFn DUSK_CONST daNpcThe_c::mEvtCutList[4] = { NULL, &daNpcThe_c::EvCut_TwResistance, &daNpcThe_c::EvCut_TwResistance, @@ -1336,13 +1336,13 @@ BOOL daNpcThe_c::drawDbgInfo() { return false; } -static actor_method_class daNpcThe_MethodTable = { +static DUSK_CONST actor_method_class daNpcThe_MethodTable = { (process_method_func)daNpcThe_Create, (process_method_func)daNpcThe_Delete, (process_method_func)daNpcThe_Execute, (process_method_func)daNpcThe_IsDelete, (process_method_func)daNpcThe_Draw, }; -actor_process_profile_definition g_profile_NPC_THE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_THE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_theB.cpp b/src/d/actor/d_a_npc_theB.cpp index 901c495543..01e371277b 100644 --- a/src/d/actor/d_a_npc_theB.cpp +++ b/src/d/actor/d_a_npc_theB.cpp @@ -101,7 +101,7 @@ static u16 l_bmdGetParamList[1][2] = { {0, BMDR_THEB}, }; -static daNpc_GetParam1 l_bckGetParamList[14] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[14] = { {-1, J3DFrameCtrl::EMode_LOOP}, {BCK_THEB_F_TALK_A, J3DFrameCtrl::EMode_NONE}, {BCK_THEB_F_TALK_B, J3DFrameCtrl::EMode_NONE}, @@ -118,15 +118,15 @@ static daNpc_GetParam1 l_bckGetParamList[14] = { {BCK_THEB_BEND_TURN, J3DFrameCtrl::EMode_NONE}, }; -static daNpc_GetParam1 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[1] = { {BTP_THEB, J3DFrameCtrl::EMode_LOOP}, }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {BTK_THEB, J3DFrameCtrl::EMode_LOOP}, }; -static char* l_evtNames[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[6] = { NULL, "PERSONAL_COMBAT_INTRO", "PERSONAL_COMBAT_REVENGE", @@ -135,9 +135,9 @@ static char* l_evtNames[6] = { "COACH_GUARD_GAMEOVER", }; -static char* l_arcName = "Coach"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Coach"; -static char* l_myName = "TheB"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "TheB"; #if DEBUG daNpcTheB_HIO_c::daNpcTheB_HIO_c() { @@ -174,7 +174,7 @@ void daNpcTheB_HIO_c::genMessage(JORMContext* ctx) { } #endif -daNpcTheB_c::cutFunc daNpcTheB_c::mEvtSeqList[6] = { +DUSK_GAME_DATA daNpcTheB_c::cutFunc daNpcTheB_c::mEvtSeqList[6] = { NULL, &daNpcTheB_c::EvCut_PersonalCombatIntro, &daNpcTheB_c::EvCut_PersonalCombatRevenge, @@ -199,7 +199,7 @@ daNpcTheB_c::~daNpcTheB_c() { #endif } -daNpcTheB_HIOParam const daNpcTheB_Param_c::m = { +DUSK_GAME_DATA daNpcTheB_HIOParam const daNpcTheB_Param_c::m = { 115.0f, -3.0f, 1.0f, @@ -1581,7 +1581,7 @@ static int daNpcTheB_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcTheB_MethodTable = { +static DUSK_CONST actor_method_class daNpcTheB_MethodTable = { (process_method_func)daNpcTheB_Create, (process_method_func)daNpcTheB_Delete, (process_method_func)daNpcTheB_Execute, @@ -1589,7 +1589,7 @@ static actor_method_class daNpcTheB_MethodTable = { (process_method_func)daNpcTheB_Draw, }; -actor_process_profile_definition g_profile_NPC_THEB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_THEB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_tk.cpp b/src/d/actor/d_a_npc_tk.cpp index 0349f8ebc0..046386e6d6 100644 --- a/src/d/actor/d_a_npc_tk.cpp +++ b/src/d/actor/d_a_npc_tk.cpp @@ -679,14 +679,14 @@ bool daNPC_TK_c::executePerchDemo(int param_0) { } void daNPC_TK_c::executePerch() { - static char* action_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[4] = { "Wait", "Circle", "Nearly", "Land", }; - static char* action_table_w[2] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table_w[2] = { "Wait", "Circle", }; @@ -3302,13 +3302,13 @@ static int daNPC_TK_Create(daNPC_TK_c* i_this) { return i_this->create(); } -static actor_method_class l_daNPC_TK_Method = { +static DUSK_CONST actor_method_class l_daNPC_TK_Method = { (process_method_func)daNPC_TK_Create, (process_method_func)daNPC_TK_Delete, (process_method_func)daNPC_TK_Execute, (process_method_func)daNPC_TK_IsDelete, (process_method_func)daNPC_TK_Draw, }; -actor_process_profile_definition g_profile_NPC_TK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 6, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_tkc.cpp b/src/d/actor/d_a_npc_tkc.cpp index bcd5afedb8..94fa1538b3 100644 --- a/src/d/actor/d_a_npc_tkc.cpp +++ b/src/d/actor/d_a_npc_tkc.cpp @@ -99,34 +99,34 @@ void daNpcTkc_HIO_c::genMessage(JORMContext* ctx) { } #endif -static daNpc_GetParam3 l_bckGetParamList[3] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_bckGetParamList[3] = { {-1, J3DFrameCtrl::EMode_LOOP}, {BCK_TKC_F_TALK_A, J3DFrameCtrl::EMode_NONE}, {BCK_TKC_FLY, J3DFrameCtrl::EMode_LOOP}, }; -static daNpc_GetParam3 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_btpGetParamList[1] = { {BTP_TKC, J3DFrameCtrl::EMode_LOOP}, }; -static daNpc_GetParam3 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_btkGetParamList[1] = { {BTK_TKC, J3DFrameCtrl::EMode_LOOP}, }; -static char* l_evtNames[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[4] = { "", "TKS_SECRET", "TKS_WARP", "TKC_WARP", }; -static char* l_arcName = "Tkc"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Tkc"; -static char* l_myName = "Tkc"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Tkc"; static NPC_TKC_HIO_CLASS l_HIO; -daNpcTkc_c::evtFunc daNpcTkc_c::mEvtSeqList[4] = { +DUSK_GAME_DATA daNpcTkc_c::evtFunc daNpcTkc_c::mEvtSeqList[4] = { NULL, &daNpcTkc_c::EvCut_TksSecretChild, &daNpcTkc_c::EvCut_TksWarpExit, @@ -149,7 +149,7 @@ daNpcTkc_c::~daNpcTkc_c() { #endif } -daNpcTkc_HIOParam const daNpcTkc_Param_c::m = { +DUSK_GAME_DATA daNpcTkc_HIOParam const daNpcTkc_Param_c::m = { 10.0f, 0.0f, 1.0f, @@ -1380,7 +1380,7 @@ static int daNpcTkc_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpcTkc_MethodTable = { +static DUSK_CONST actor_method_class daNpcTkc_MethodTable = { (process_method_func)daNpcTkc_Create, (process_method_func)daNpcTkc_Delete, (process_method_func)daNpcTkc_Execute, @@ -1388,7 +1388,7 @@ static actor_method_class daNpcTkc_MethodTable = { (process_method_func)daNpcTkc_Draw, }; -actor_process_profile_definition g_profile_NPC_TKC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TKC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_tkj.cpp b/src/d/actor/d_a_npc_tkj.cpp index af8eaf3d6c..909b72b4b4 100644 --- a/src/d/actor/d_a_npc_tkj.cpp +++ b/src/d/actor/d_a_npc_tkj.cpp @@ -9,40 +9,40 @@ #include "d/actor/d_a_npc4.h" #include -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {12, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"DEFAULT_GETITEM", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Tkj", }; -static s8 l_loadResPtrn0[] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[] = { 1, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, 0, 0, 18, 2, 1, 1}, {6, 0, 1, 18, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[2] = { {9, 2, 1, 15, 0, 1, 0, 0}, {8, 2, 1, 15, 0, 1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -53,7 +53,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -64,17 +64,17 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { {-1, 0, 0}, }; -char* daNpcTkj_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpcTkj_c::mCutNameList[2] = { "", "LV7_FIRST_START", }; -int (daNpcTkj_c::*daNpcTkj_c::mCutList[])(int) = { +DUSK_GAME_DATA int (daNpcTkj_c::* DUSK_CONST daNpcTkj_c::mCutList[])(int) = { NULL, &daNpcTkj_c::cutLv7Start, }; -const daNpc_Tkj_HIOParam daNpc_Tkj_Param_c::m = { +DUSK_GAME_DATA const daNpc_Tkj_HIOParam daNpc_Tkj_Param_c::m = { 120.0f, -3.0f, 1.0f, @@ -682,7 +682,7 @@ void daNpcTkj_c::beforeMove() { } } -static actor_method_class daNpc_Tkj_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Tkj_MethodTable = { (process_method_func)daNpc_Tkj_Create, (process_method_func)daNpc_Tkj_Delete, (process_method_func)daNpc_Tkj_Execute, @@ -690,7 +690,7 @@ static actor_method_class daNpc_Tkj_MethodTable = { (process_method_func)daNpc_Tkj_Draw, }; -actor_process_profile_definition g_profile_NPC_TKJ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TKJ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_tkj2.cpp b/src/d/actor/d_a_npc_tkj2.cpp index 38e510d6c0..6d96e44a43 100644 --- a/src/d/actor/d_a_npc_tkj2.cpp +++ b/src/d/actor/d_a_npc_tkj2.cpp @@ -1198,7 +1198,7 @@ static cPhs_Step daNpc_Tkj2_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daNpc_Tkj2_Method = { +static DUSK_CONST actor_method_class l_daNpc_Tkj2_Method = { (process_method_func)daNpc_Tkj2_Create, (process_method_func)daNpc_Tkj2_Delete, (process_method_func)daNpc_Tkj2_Execute, @@ -1206,7 +1206,7 @@ static actor_method_class l_daNpc_Tkj2_Method = { (process_method_func)daNpc_Tkj2_Draw, }; -actor_process_profile_definition g_profile_NPC_TKJ2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TKJ2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_tks.cpp b/src/d/actor/d_a_npc_tks.cpp index 9b0ee4af70..9990e4834b 100644 --- a/src/d/actor/d_a_npc_tks.cpp +++ b/src/d/actor/d_a_npc_tks.cpp @@ -136,7 +136,7 @@ enum RES_Name { static NPC_TKS_HIO_CLASS l_HIO; -static daNpc_GetParam3 l_bckGetParamList[22] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_bckGetParamList[22] = { {-1, J3DFrameCtrl::EMode_LOOP}, {BCK_TKS_F_TALK_A, J3DFrameCtrl::EMode_NONE}, {BCK_TKS_WAIT_A, J3DFrameCtrl::EMode_LOOP}, @@ -161,48 +161,48 @@ static daNpc_GetParam3 l_bckGetParamList[22] = { {BCK_TKS_SWIM, J3DFrameCtrl::EMode_LOOP}, }; -static daNpc_GetParam3 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_btpGetParamList[1] = { {BTP_TKS, J3DFrameCtrl::EMode_LOOP}, }; -static daNpc_GetParam3 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam3 l_btkGetParamList[1] = { {BTK_TKS, J3DFrameCtrl::EMode_LOOP}, }; -static int l_loadRes_TKS0[3] = { +static DUSK_CONSTEXPR int l_loadRes_TKS0[3] = { TKS, J_TUBO_00, -1, }; -static int l_loadRes_TKS1[3] = { +static DUSK_CONSTEXPR int l_loadRes_TKS1[3] = { TKS, K_TUBO02, -1, }; -static int l_loadRes_TKS2[3] = { +static DUSK_CONSTEXPR int l_loadRes_TKS2[3] = { TKS, -1, -1, }; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_TKS0, l_loadRes_TKS1, l_loadRes_TKS2, }; -static char* l_arcNames[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcNames[3] = { "TKS", "J_tubo_00", "K_tubo02", }; -static char* l_evtNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[2] = { NULL, "TKS_ENCOUNTER", }; -static char* l_arcName = "TKS"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "TKS"; -static char* l_myName = "Tks"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Tks"; -daNpcTks_HIOParam const daNpcTks_Param_c::m = { +DUSK_GAME_DATA daNpcTks_HIOParam const daNpcTks_Param_c::m = { 90.0f, -3.0f, 1.0f, @@ -3047,7 +3047,7 @@ void daNpcTks_c::drawOtherMdls() { } } -static actor_method_class daNpcTks_MethodTable = { +static DUSK_CONST actor_method_class daNpcTks_MethodTable = { (process_method_func)daNpcTks_Create, (process_method_func)daNpcTks_Delete, (process_method_func)daNpcTks_Execute, @@ -3055,7 +3055,7 @@ static actor_method_class daNpcTks_MethodTable = { (process_method_func)daNpcTks_Draw, }; -actor_process_profile_definition g_profile_NPC_TKS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TKS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_toby.cpp b/src/d/actor/d_a_npc_toby.cpp index d175d199b7..53a39a3e91 100644 --- a/src/d/actor/d_a_npc_toby.cpp +++ b/src/d/actor/d_a_npc_toby.cpp @@ -17,7 +17,7 @@ #include "dusk/frame_interpolation.h" #include -const daNpc_Toby_HIOParam daNpc_Toby_Param_c::m = { +DUSK_GAME_DATA const daNpc_Toby_HIOParam daNpc_Toby_Param_c::m = { 160.0f, -3.0f, 1.0f, @@ -121,13 +121,13 @@ void daNpc_Toby_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[3][2] = { +static DUSK_CONSTEXPR int l_bmdData[3][2] = { {3, 1}, {3, 2}, {9, 6}, }; -static daNpcT_evtData_c l_evtList[7] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[7] = { {"", 0}, {"NO_RESPONSE", 0}, {"TALKTO_ONESELF", 5}, @@ -137,7 +137,7 @@ static daNpcT_evtData_c l_evtList[7] = { {"CONVERSATION_ABOUT_ZRA", 4}, }; -static char* l_resNameList[9] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[9] = { "", "Toby", "Toby_TW", @@ -149,20 +149,20 @@ static char* l_resNameList[9] = { "Toby5", }; -static s8 l_loadResPtrn0[6] = {1, 3, 4, 7, 8, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[6] = {1, 3, 4, 7, 8, -1}; -static s8 l_loadResPtrn1[6] = {2, 3, 5, 7, 8, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[6] = {2, 3, 5, 7, 8, -1}; -static s8 l_loadResPtrn2[5] = {1, 3, 6, 7, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn2[5] = {1, 3, 6, 7, -1}; -static s8 l_loadResPtrn3[8] = {1, 2, 3, 4, 5, 7, 8, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn3[8] = {1, 2, 3, 4, 5, 7, 8, -1}; -static s8* l_loadResPtrnList[7] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[7] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn2, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn3, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { {-1, 0, 0, 13, 2, 3, 1}, {5, 0, 3, 14, 0, 3, 0}, {12, 0, 4, 29, 0, 4, 0}, @@ -181,7 +181,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { {8, 2, 5, 22, 2, 5, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[25] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[25] = { {7, 2, 3, 10, 0, 3, 1, 0}, {15, 2, 4, 10, 0, 3, 1, 0}, {20, 2, 4, 10, 0, 3, 1, 0}, @@ -209,7 +209,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[25] = { {10, 0, 8, 10, 0, 3, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[68] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[68] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {8, -1, 1}, {15, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 1}, {13, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 1}, {12, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {11, -1, 1}, {14, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {3, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -221,7 +221,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[68] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[100] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[100] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {10, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {11, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {12, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {13, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -247,7 +247,7 @@ enum NPC_TOBY_CUTS { CUT_CONVERSATION_ABOUT_ZRA = 6, }; -char* daNpc_Toby_c::mCutNameList[7] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Toby_c::mCutNameList[7] = { "", "TOBY_HOUSE_FIRE", "TALKTO_ONESELF", @@ -257,7 +257,7 @@ char* daNpc_Toby_c::mCutNameList[7] = { "CONVERSATION_ABOUT_ZRA", }; -daNpc_Toby_c::cutFunc daNpc_Toby_c::mCutList[7] = { +DUSK_GAME_DATA daNpc_Toby_c::cutFunc DUSK_CONST daNpc_Toby_c::mCutList[7] = { NULL, &daNpc_Toby_c::cutTobyHouseFire, &daNpc_Toby_c::cutTalkToOneself, @@ -2199,7 +2199,7 @@ static int daNpc_Toby_IsDelete(void*) { return true; } -static actor_method_class daNpc_Toby_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Toby_MethodTable = { (process_method_func)daNpc_Toby_Create, (process_method_func)daNpc_Toby_Delete, (process_method_func)daNpc_Toby_Execute, @@ -2207,7 +2207,7 @@ static actor_method_class daNpc_Toby_MethodTable = { (process_method_func)daNpc_Toby_Draw, }; -actor_process_profile_definition g_profile_NPC_TOBY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TOBY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_tr.cpp b/src/d/actor/d_a_npc_tr.cpp index 3331b7cd2b..300b079e1c 100644 --- a/src/d/actor/d_a_npc_tr.cpp +++ b/src/d/actor/d_a_npc_tr.cpp @@ -247,13 +247,13 @@ static int daNPC_TR_Create(fopAc_ac_c* i_this) { daNPC_TR_HIO_c::~daNPC_TR_HIO_c() {} -static actor_method_class l_daNPC_TR_Method = { +static DUSK_CONST actor_method_class l_daNPC_TR_Method = { (process_method_func)daNPC_TR_Create, (process_method_func)daNPC_TR_Delete, (process_method_func)daNPC_TR_Execute, (process_method_func)daNPC_TR_IsDelete, (process_method_func)daNPC_TR_Draw, }; -actor_process_profile_definition g_profile_NPC_TR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_TR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_uri.cpp b/src/d/actor/d_a_npc_uri.cpp index bb0a561d26..44df1060d2 100644 --- a/src/d/actor/d_a_npc_uri.cpp +++ b/src/d/actor/d_a_npc_uri.cpp @@ -10,7 +10,7 @@ #include "m_Do/m_Do_graphic.h" #include -const daNpc_Uri_HIOParam daNpc_Uri_Param_c::m = { +DUSK_GAME_DATA const daNpc_Uri_HIOParam daNpc_Uri_Param_c::m = { 200.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -79,9 +79,9 @@ void daNpc_Uri_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[2][2] = {{12, 1}, {33, 2}}; +static DUSK_CONSTEXPR int l_bmdData[2][2] = {{12, 1}, {33, 2}}; -static daNpcT_evtData_c l_evtList[11] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[11] = { {"", 0}, {"DEFAULT_GETITEM", 2}, {"NO_RESPONSE", 0}, @@ -95,42 +95,42 @@ static daNpcT_evtData_c l_evtList[11] = { {"MEETING_AGAIN", 4}, }; -static char* l_resNameList[6] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[6] = { "", "Uri", "Uri1", "Uri2", "Uri3", "Uri_P1", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { 1, 2, -1, }; -static s8 l_loadResPtrn2[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = { 1, 3, -1, }; -static s8 l_loadResPtrn3[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn3[5] = { 1, 2, 3, 4, -1, }; -static s8 l_loadResPtrn4[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn4[3] = { 1, 5, -1, }; -static s8 l_loadResPtrn9[5] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = { 1, 2, 3, 4, -1, }; -static s8* l_loadResPtrnList[7] = {l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn2, +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[7] = {l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn2, l_loadResPtrn3, l_loadResPtrn4, l_loadResPtrn9}; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[19] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[19] = { {-1, 0, 0, 18, 2, 1, TRUE}, {-1, 0, 0, -1, 0, 0, FALSE}, {6, 0, 1, 18, 2, 1, TRUE}, {10, 0, 2, 43, 0, 2, FALSE}, {11, 0, 2, 44, 0, 2, FALSE}, {9, 0, 2, 42, 0, 2, FALSE}, {12, 0, 2, 45, 0, 2, FALSE}, {6, 0, 3, 21, 0, 3, FALSE}, {8, 0, 3, 23, 0, 3, FALSE}, @@ -140,7 +140,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[19] = { {8, 2, 1, 21, 2, 1, FALSE}, }; -static daNpcT_motionAnmData_c l_motionAnmData[34] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[34] = { {9, 2, 1, 15, 0, 1, 1, 0}, {-1, 0, 0, -1, 0, 0, 0, 0}, {9, 2, 3, 18, 2, 3, 0, 0}, {-1, 0, 0, -1, 0, 0, 0, 0}, {-1, 0, 0, -1, 0, 0, 0, 0}, {-1, 0, 0, -1, 0, 0, 0, 0}, {-1, 0, 0, -1, 0, 0, 0, 0}, {-1, 0, 0, -1, 0, 0, 0, 0}, {30, 0, 2, 15, 0, 1, 1, 0}, @@ -155,7 +155,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[34] = { {19, 0, 2, 15, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = { {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {14, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {11, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {12, -1, 0}, @@ -169,7 +169,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[72] = {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {28, -1, 1}, {29, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {30, -1, 1}, {26, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {31, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {32, -1, 1}, {31, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {9, -1, 0}, @@ -190,7 +190,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[120] = { {-1, 0, 0}, }; -const char* daNpc_Uri_c::mCutNameList[7] = { +DUSK_GAME_DATA const char* daNpc_Uri_c::mCutNameList[7] = { "", "CONVERSATION", "START_CARRY_TUTORIAL", @@ -200,7 +200,7 @@ const char* daNpc_Uri_c::mCutNameList[7] = { "MEETING_AGAIN", }; -daNpc_Uri_c::cutFunc daNpc_Uri_c::mCutList[7] = { +DUSK_GAME_DATA daNpc_Uri_c::cutFunc DUSK_CONST daNpc_Uri_c::mCutList[7] = { NULL, &daNpc_Uri_c::cutConversation, &daNpc_Uri_c::cutStartCarryTutorial, @@ -1913,13 +1913,13 @@ static int daNpc_Uri_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Uri_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Uri_MethodTable = { (process_method_func)daNpc_Uri_Create, (process_method_func)daNpc_Uri_Delete, (process_method_func)daNpc_Uri_Execute, (process_method_func)daNpc_Uri_IsDelete, (process_method_func)daNpc_Uri_Draw, }; -actor_process_profile_definition g_profile_NPC_URI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_URI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_worm.cpp b/src/d/actor/d_a_npc_worm.cpp index 4c8e31d56c..66a1a38d40 100644 --- a/src/d/actor/d_a_npc_worm.cpp +++ b/src/d/actor/d_a_npc_worm.cpp @@ -392,7 +392,7 @@ static int daNPC_WORM_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daNPC_WORM_Method = { +static DUSK_CONST actor_method_class l_daNPC_WORM_Method = { (process_method_func)daNPC_WORM_Create, (process_method_func)daNPC_WORM_Delete, (process_method_func)daNPC_WORM_Execute, @@ -400,7 +400,7 @@ static actor_method_class l_daNPC_WORM_Method = { (process_method_func)daNPC_WORM_Draw, }; -actor_process_profile_definition g_profile_NPC_WORM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_WORM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_wrestler.cpp b/src/d/actor/d_a_npc_wrestler.cpp index 81b50c8338..a7e71f5902 100644 --- a/src/d/actor/d_a_npc_wrestler.cpp +++ b/src/d/actor/d_a_npc_wrestler.cpp @@ -244,9 +244,9 @@ enum Bou3_Joint { /* 0x24 */ JNT_OBIR, }; -static char* l_resALink = "alSumou"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resALink = "alSumou"; -static char* l_resName[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resName[5] = { "Bou3", "grDS", NULL, @@ -254,11 +254,11 @@ static char* l_resName[5] = { NULL, }; -static int l_bmdGetParamList[5] = { +static DUSK_CONSTEXPR int l_bmdGetParamList[5] = { BMDR_BOUS, BMDR_GRD, 0, 0, 0, }; -static daNpc_GetParam1 l_BouBckParamList[63] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_BouBckParamList[63] = { {-1, 2}, {BCK_BOUS_F_DOWN, 2}, {BCK_BOUS_F_HEAD_UP, 0}, {BCK_BOUS_F_LOSE, 0}, {BCK_BOUS_F_LOSE2, 0}, {BCK_BOUS_F_PULLBACK, 0}, {BCK_BOUS_F_PUNCH, 0}, {BCK_BOUS_F_PUNCH_SHOCK, 0}, {BCK_BOUS_F_PUNCHMISS_TACKLESHOCK, 0}, @@ -282,7 +282,7 @@ static daNpc_GetParam1 l_BouBckParamList[63] = { {-1, 2}, {-1, 2}, {-1, 2}, }; -static daNpc_GetParam2 l_BouFaceParamList[23] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_BouFaceParamList[23] = { {-1, 0x44, 2}, {7, 0x45, 2}, {8, 0x46, 0}, {9, 0x47, 0}, {10, 0x48, 0}, {11, 0x49, 0}, {12, 0x4A, 0}, {13, 0x4B, 0}, {14, 0x4C, 0}, @@ -293,7 +293,7 @@ static daNpc_GetParam2 l_BouFaceParamList[23] = { {27, 0x58, 0}, {28, 0x59, 0}, }; -static daNpc_GetParam1 l_BouBtpParamList[23] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_BouBtpParamList[23] = { {BTP_BOUS, 2}, {BTP_BOUS_F_DOWN, 0}, {BTP_BOUS_F_HEAD_UP, 0}, {BTP_BOUS_F_LOSE, 0}, {BTP_BOUS_F_LOSE2, 0}, {BTP_BOUS_F_PULLBACK, 0}, @@ -308,18 +308,18 @@ static daNpc_GetParam1 l_BouBtpParamList[23] = { {BTP_BOUS_F_WIN_POSE, 0}, }; -static daNpc_GetParam1 l_BouBtkParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_BouBtkParamList[1] = { {BTK_BOUS, 2}, }; -static WrestlerParamList l_BouAnmParamList = { +static DUSK_CONSTEXPR WrestlerParamList l_BouAnmParamList = { l_BouBckParamList, l_BouFaceParamList, l_BouBtpParamList, l_BouBtkParamList, }; -static daNpc_GetParam1 l_GrdBckParamList[63] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_GrdBckParamList[63] = { {-1, 2}, {8, 2}, {9, 0}, {10, 0}, {0x0B, 0}, {0x0D, 0}, {0x0E, 0}, {0x0F, 0}, {0x10, 0}, {0x11, 0}, {0x12, 0}, {0x14, 2}, @@ -338,7 +338,7 @@ static daNpc_GetParam1 l_GrdBckParamList[63] = { {0x3C, 0}, {0x3D, 0}, {0x42, 2}, }; -static daNpc_GetParam2 l_GrdFaceParamList[23] = { +static DUSK_CONSTEXPR daNpc_GetParam2 l_GrdFaceParamList[23] = { {-1, 0x4D, 2}, {8, 0x4E, 2}, {9, 0x4F, 0}, {0x0A, 0x50, 0}, {0x0B, 0x51, 0}, {0x0D, 0x52, 0}, {0x0E, -1, 0}, {0x0F, 0x53, 0}, {0x10, 0x54, 0}, @@ -349,7 +349,7 @@ static daNpc_GetParam2 l_GrdFaceParamList[23] = { {0x1E, 0x5F, 0}, {0x1F, -1, 0}, }; -static daNpc_GetParam1 l_GrdBtpParamList[23] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_GrdBtpParamList[23] = { {0x4D, 2}, {0x4E, 2}, {0x4F, 0}, {0x50, 0}, {0x51, 0}, {0x52, 0}, {-1, 0}, {0x53, 0}, {0x54, 0}, {0x55, 0}, {0x56, 0}, {0x57, 2}, @@ -358,23 +358,23 @@ static daNpc_GetParam1 l_GrdBtpParamList[23] = { {0x5E, 2}, {0x5F, 0}, {-1, 0}, }; -static daNpc_GetParam1 l_GrdBtkParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_GrdBtkParamList[1] = { {0x4A, 2}, }; -static WrestlerParamList l_GrdAnmParamList = { +static DUSK_CONSTEXPR WrestlerParamList l_GrdAnmParamList = { l_GrdBckParamList, l_GrdFaceParamList, l_GrdBtpParamList, l_GrdBtkParamList, }; -static WrestlerParamList* l_anmList[2] = { +static DUSK_CONSTEXPR WrestlerParamList DUSK_CONST* l_anmList[2] = { &l_BouAnmParamList, &l_GrdAnmParamList, }; -static char* l_evtNames[7] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[7] = { NULL, "GRDS_ENTRY", "GRDS_ENTRY2", @@ -384,11 +384,11 @@ static char* l_evtNames[7] = { "GRDS_LOSE", }; -static char* l_myName = "Wrestler"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "Wrestler"; static NPC_WRESTLER_HIO_CLASS l_HIO; -const daNpcWrestler_HIOParam daNpcWrestler_Param_c::m = { +DUSK_GAME_DATA const daNpcWrestler_HIOParam daNpcWrestler_Param_c::m = { 220.0f, -3.0f, 1.0f, @@ -646,7 +646,7 @@ void daNpcWrestler_HIO_c::genMessage(JORMContext* ctext) { } #endif -daNpcWrestler_c::EventFn daNpcWrestler_c::mEvtSeqList[7] = { +DUSK_GAME_DATA daNpcWrestler_c::EventFn DUSK_CONST daNpcWrestler_c::mEvtSeqList[7] = { NULL, &daNpcWrestler_c::EvCut_grDSEntry, &daNpcWrestler_c::EvCut_grDSEntry2, @@ -5212,7 +5212,7 @@ void daNpcWrestler_c::drawOtherMdls() { /* empty function */ } -static actor_method_class daNpcWrestler_MethodTable = { +static DUSK_CONST actor_method_class daNpcWrestler_MethodTable = { (process_method_func)daNpcWrestler_Create, (process_method_func)daNpcWrestler_Delete, (process_method_func)daNpcWrestler_Execute, @@ -5220,7 +5220,7 @@ static actor_method_class daNpcWrestler_MethodTable = { (process_method_func)daNpcWrestler_Draw, }; -actor_process_profile_definition g_profile_NPC_WRESTLER = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_WRESTLER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_yamid.cpp b/src/d/actor/d_a_npc_yamid.cpp index 42668a8342..d43458bd32 100644 --- a/src/d/actor/d_a_npc_yamid.cpp +++ b/src/d/actor/d_a_npc_yamid.cpp @@ -77,56 +77,56 @@ void daNpc_yamiD_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_YAMID, YAMID}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"STOPPER", 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "yamiD", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_YAMID, J3DFrameCtrl::EMode_LOOP, YAMID, 1}, {BCK_YAMID_F_TALK_A, J3DFrameCtrl::EMode_NONE, YAMID, BTP_YAMID, J3DFrameCtrl::EMode_LOOP, YAMID, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[2] = { {BCK_YAMID_WAIT_A, J3DFrameCtrl::EMode_LOOP, YAMID, BTK_YAMID, J3DFrameCtrl::EMode_NONE, YAMID, 1, 0}, {BCK_YAMID_STEP, J3DFrameCtrl::EMode_NONE, YAMID, BTK_YAMID, J3DFrameCtrl::EMode_NONE, YAMID, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_yamiD_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_yamiD_c::mCutNameList[2] = { "", "STOPPER", }; -daNpc_yamiD_c::cutFunc daNpc_yamiD_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_yamiD_c::cutFunc DUSK_CONST daNpc_yamiD_c::mCutList[2] = { NULL, &daNpc_yamiD_c::cutStopper, }; @@ -145,7 +145,7 @@ daNpc_yamiD_c::~daNpc_yamiD_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_yamiD_HIOParam const daNpc_yamiD_Param_c::m = { +DUSK_GAME_DATA daNpc_yamiD_HIOParam const daNpc_yamiD_Param_c::m = { 180.0f, -3.0f, 1.0f, @@ -787,7 +787,7 @@ static int daNpc_yamiD_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_yamiD_MethodTable = { +static DUSK_CONST actor_method_class daNpc_yamiD_MethodTable = { (process_method_func)daNpc_yamiD_Create, (process_method_func)daNpc_yamiD_Delete, (process_method_func)daNpc_yamiD_Execute, @@ -795,7 +795,7 @@ static actor_method_class daNpc_yamiD_MethodTable = { (process_method_func)daNpc_yamiD_Draw, }; -actor_process_profile_definition g_profile_NPC_YAMID = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_YAMID = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_yamis.cpp b/src/d/actor/d_a_npc_yamis.cpp index 51ef99e7f4..ca7e52f130 100644 --- a/src/d/actor/d_a_npc_yamis.cpp +++ b/src/d/actor/d_a_npc_yamis.cpp @@ -37,52 +37,52 @@ void daNpc_yamiS_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {12, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"STOPPER", 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "yamiS", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, 0, 0, 18, 2, 1, 1}, {7, 0, 1, 18, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[2] = { {9, 2, 1, 15, 0, 1, 1, 0}, {8, 0, 1, 15, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_yamiS_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_yamiS_c::mCutNameList[2] = { "", "STOPPER", }; -daNpc_yamiS_c::cutFunc daNpc_yamiS_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_yamiS_c::cutFunc DUSK_CONST daNpc_yamiS_c::mCutList[2] = { NULL, &daNpc_yamiS_c::cutStopper, }; @@ -94,7 +94,7 @@ daNpc_yamiS_c::~daNpc_yamiS_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -const daNpc_yamiS_HIOParam daNpc_yamiS_Param_c::m = { +DUSK_GAME_DATA const daNpc_yamiS_HIOParam daNpc_yamiS_Param_c::m = { 140.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -720,13 +720,13 @@ static int daNpc_yamiS_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_yamiS_MethodTable = { +static DUSK_CONST actor_method_class daNpc_yamiS_MethodTable = { (process_method_func)daNpc_yamiS_Create, (process_method_func)daNpc_yamiS_Delete, (process_method_func)daNpc_yamiS_Execute, (process_method_func)daNpc_yamiS_IsDelete, (process_method_func)daNpc_yamiS_Draw, }; -actor_process_profile_definition g_profile_NPC_YAMIS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_YAMIS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_yamit.cpp b/src/d/actor/d_a_npc_yamit.cpp index ffedc646f4..ac67845d70 100644 --- a/src/d/actor/d_a_npc_yamit.cpp +++ b/src/d/actor/d_a_npc_yamit.cpp @@ -38,54 +38,54 @@ void daNpc_yamiT_HIO_c::genMessage(JORMContext* ctext) { } #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {12, 1}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"STOPPER", 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "yamiT", }; -static s8 l_loadResPtrn0[2] = {1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {1, -1}; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, 0, 0, 15, 2, 1, 1}, {6, 0, 1, 15, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[3] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[3] = { {9, 2, 1, -1, 0, 0, 0, 0}, {8, 0, 1, -1, 0, 0, 0, 0}, {7, 0, 1, -1, 0, 0, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[12] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[12] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_yamiT_c::mCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_yamiT_c::mCutNameList[2] = { "", "STOPPER", }; -daNpc_yamiT_c::cutFunc daNpc_yamiT_c::mCutList[2] = { +DUSK_GAME_DATA daNpc_yamiT_c::cutFunc DUSK_CONST daNpc_yamiT_c::mCutList[2] = { NULL, &daNpc_yamiT_c::cutStopper, }; @@ -97,7 +97,7 @@ daNpc_yamiT_c::~daNpc_yamiT_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -const daNpc_yamiT_HIOParam daNpc_yamiT_Param_c::m = { +DUSK_GAME_DATA const daNpc_yamiT_HIOParam daNpc_yamiT_Param_c::m = { 230.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -749,13 +749,13 @@ static int daNpc_yamiT_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_yamiT_MethodTable = { +static DUSK_CONST actor_method_class daNpc_yamiT_MethodTable = { (process_method_func)daNpc_yamiT_Create, (process_method_func)daNpc_yamiT_Delete, (process_method_func)daNpc_yamiT_Execute, (process_method_func)daNpc_yamiT_IsDelete, (process_method_func)daNpc_yamiT_Draw, }; -actor_process_profile_definition g_profile_NPC_YAMIT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_YAMIT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_yelia.cpp b/src/d/actor/d_a_npc_yelia.cpp index 67b1cbcffc..44b408b35c 100644 --- a/src/d/actor/d_a_npc_yelia.cpp +++ b/src/d/actor/d_a_npc_yelia.cpp @@ -9,13 +9,15 @@ #include "d/actor/d_a_demo_item.h" #include -static daNpc_GetParam1 l_bmdData[3] = { +#include "helpers/string.hpp" + +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdData[3] = { {3, 1}, {3, 4}, {8, 7}, }; -static daNpcT_evtData_c l_evtList[6] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[6] = { {"", 0}, {"NO_RESPONSE", 0}, {"TW_RESISTANCE1", 7}, @@ -24,7 +26,7 @@ static daNpcT_evtData_c l_evtList[6] = { {"THANK_YOU", 6}, }; -static char* l_resNameList[8] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[8] = { "", "Yelia", "Yelia0", @@ -35,26 +37,26 @@ static char* l_resNameList[8] = { "yelB_TW", }; -static s8 l_loadResPtrn0[4] = {1, 2, 3, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[4] = {1, 2, 3, -1}; -static s8 l_loadResPtrn1[3] = {2, 4, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = {2, 4, -1}; -static s8 l_loadResPtrn2[4] = {1, 2, 5, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn2[4] = {1, 2, 5, -1}; -static s8 l_loadResPtrn3[4] = {2, 4, 6, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn3[4] = {2, 4, 6, -1}; -static s8 l_loadResPtrn4[4] = {2, 7, 6, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn4[4] = {2, 7, 6, -1}; -static s8 l_loadResPtrn5[5] = {2, 4, 7, 6, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn5[5] = {2, 4, 7, 6, -1}; -static s8 l_loadResPtrn9[8] = {1, 2, 3, 4, 5, 6, 7, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn9[8] = {1, 2, 3, 4, 5, 6, 7, -1}; -static s8* l_loadResPtrnList[10] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[10] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn2, l_loadResPtrn3, l_loadResPtrn4, l_loadResPtrn5, l_loadResPtrn3, l_loadResPtrn3, l_loadResPtrn9, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[] = { {-1, J3DFrameCtrl::EMode_NONE, 0, 19, J3DFrameCtrl::EMode_LOOP, 2, TRUE}, {7, J3DFrameCtrl::EMode_NONE, 2, 19, J3DFrameCtrl::EMode_LOOP, 2, TRUE}, {-1, J3DFrameCtrl::EMode_NONE, 0, -1, J3DFrameCtrl::EMode_NONE, 0, FALSE}, @@ -85,7 +87,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[] = { {9, J3DFrameCtrl::EMode_LOOP, 2, 23, J3DFrameCtrl::EMode_LOOP, 2, FALSE}, }; -static daNpcT_motionAnmData_c l_motionAnmData[] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[] = { {13, J3DFrameCtrl::EMode_LOOP, 2, 16, J3DFrameCtrl::EMode_NONE, 2, TRUE}, {-1, J3DFrameCtrl::EMode_NONE, 0, -1, J3DFrameCtrl::EMode_NONE, 0, FALSE}, {-1, J3DFrameCtrl::EMode_NONE, 0, -1, J3DFrameCtrl::EMode_NONE, 0, FALSE}, @@ -123,7 +125,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[] = { {11, J3DFrameCtrl::EMode_NONE, 2, 16, J3DFrameCtrl::EMode_NONE, 2, TRUE}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {9, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -153,7 +155,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -190,7 +192,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[] = { {32, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_Yelia_c::mCutNameList[6] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Yelia_c::mCutNameList[6] = { "", "CONVERSATION_ABOUT_LOOPHOLE", "TW_RESISTANCE", @@ -199,7 +201,7 @@ char* daNpc_Yelia_c::mCutNameList[6] = { "THANK_YOU", }; -BOOL (daNpc_Yelia_c::*daNpc_Yelia_c::mCutList[6])(int) = { +DUSK_GAME_DATA BOOL (daNpc_Yelia_c::*daNpc_Yelia_c::mCutList[6])(int) = { NULL, &daNpc_Yelia_c::cutConversationAboutLoopHole, &daNpc_Yelia_c::cutTWResistance, @@ -296,7 +298,7 @@ enum Motion { /* 0x21 */ MOTION_KIZUKU_WAIT, }; -daNpc_Yelia_HIOParam const daNpc_Yelia_Param_c::m = { +DUSK_GAME_DATA daNpc_Yelia_HIOParam const daNpc_Yelia_Param_c::m = { 170.0f, // mAttnOffsetY -3.0f, // mGravity 1.0f, // mScale @@ -1137,8 +1139,8 @@ BOOL daNpc_Yelia_c::cutTakeWoodStatue(int i_staffId) { mItemId = fpcM_ERROR_PROCESS_ID_e; mEventTimer = timer; Z2GetAudioMgr()->muteSceneBgm(90, 0.0f); - strcpy(name, l_evtList[EVENT_TAKE_WOODSTATUE].eventName); - strcat(name, "@"); + SAFE_STRCPY(name, l_evtList[EVENT_TAKE_WOODSTATUE].eventName); + SAFE_STRCAT(name, "@"); dComIfGp_getEvent()->setSkipZev(this, name); dComIfGp_getEvent()->onSkipFade(); break; @@ -1580,7 +1582,7 @@ static int daNpc_Yelia_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Yelia_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Yelia_MethodTable = { (process_method_func)daNpc_Yelia_Create, (process_method_func)daNpc_Yelia_Delete, (process_method_func)daNpc_Yelia_Execute, @@ -1588,7 +1590,7 @@ static actor_method_class daNpc_Yelia_MethodTable = { (process_method_func)daNpc_Yelia_Draw, }; -actor_process_profile_definition g_profile_NPC_YELIA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_YELIA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ykm.cpp b/src/d/actor/d_a_npc_ykm.cpp index 1cdba0d9a5..d4ac67b04c 100644 --- a/src/d/actor/d_a_npc_ykm.cpp +++ b/src/d/actor/d_a_npc_ykm.cpp @@ -175,7 +175,7 @@ enum RES_Name { /* 0x4 */ YKM3, }; -daNpc_ykM_HIOParam const daNpc_ykM_Param_c::m = { +DUSK_GAME_DATA daNpc_ykM_HIOParam const daNpc_ykM_Param_c::m = { 500.0f, -4.0f, 1.0f, @@ -317,7 +317,7 @@ void daNpc_ykM_HIO_c::genMessage(JORMContext* ctx) { } #endif -static int l_bmdData[6][2] = { +static DUSK_CONSTEXPR int l_bmdData[6][2] = { {BMDR_YKM, YKM}, {BMDR_YKM_TOMATO, YKM1}, {BMDR_YKM_LEAF, YKM2}, @@ -335,7 +335,7 @@ enum BmdIndex { BMD_INDEX_LEAF, }; -static daNpcT_evtData_c l_evtList[10] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[10] = { {"", 0}, {"NO_RESPONSE", 0}, {"SLIDEDOWN", 4}, @@ -348,7 +348,7 @@ static daNpcT_evtData_c l_evtList[10] = { {"HUG", 2}, }; -static char* l_resNameList[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[5] = { "", "ykM", "ykM1", @@ -356,20 +356,20 @@ static char* l_resNameList[5] = { "ykM3", }; -static s8 l_loadResPtrn0[3] = {YKM, YKM1, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn0[3] = {YKM, YKM1, -1}; -static s8 l_loadResPtrn1[3] = {YKM, YKM2, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = {YKM, YKM2, -1}; -static s8 l_loadResPtrn2[5] = {YKM, YKM1, YKM2, YKM3, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn2[5] = {YKM, YKM1, YKM2, YKM3, -1}; -static s8 l_loadResPtrn9[5] = {YKM, YKM1, YKM2, YKM3, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn9[5] = {YKM, YKM1, YKM2, YKM3, -1}; -static s8* l_loadResPtrnList[8] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[8] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn2, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { {-1, J3DFrameCtrl::EMode_NONE, 0, BTP_YKM, J3DFrameCtrl::EMode_LOOP, YKM, TRUE}, {BCK_YKM_F_TALK_A, J3DFrameCtrl::EMode_NONE, YKM, BTP_YKM, J3DFrameCtrl::EMode_LOOP, YKM, TRUE}, {BCK_YKM_F_TALK_B, J3DFrameCtrl::EMode_NONE, YKM, BTP_YKM, J3DFrameCtrl::EMode_LOOP, YKM, TRUE}, @@ -388,7 +388,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[16] = { {BCK_YKM_FH_HAPPY, J3DFrameCtrl::EMode_LOOP, YKM1, BTP_YKM_FH_HAPPY, J3DFrameCtrl::EMode_LOOP, YKM1, FALSE}, }; -static daNpcT_motionAnmData_c l_motionAnmData[51] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[51] = { {BCK_YKM_WAIT_A, J3DFrameCtrl::EMode_LOOP, YKM, BTK_YKM, J3DFrameCtrl::EMode_NONE, YKM, 1, 0}, {BCK_YKM_WAIT_B, J3DFrameCtrl::EMode_LOOP, YKM1, BTK_YKM_WAIT_B, J3DFrameCtrl::EMode_NONE, YKM1, 0, 0}, {BCK_YKM_WAIT_C, J3DFrameCtrl::EMode_LOOP, YKM1, BTK_YKM, J3DFrameCtrl::EMode_NONE, YKM, 1, 0}, @@ -442,7 +442,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[51] = { {BCK_YKM_WAITHOLD_B_B, J3DFrameCtrl::EMode_LOOP, YKM1, BTK_YKM, J3DFrameCtrl::EMode_NONE, YKM, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[64] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[64] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -461,7 +461,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[64] = {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[188] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[188] = { {0, -9, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 1}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -511,7 +511,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[188] = { {0x27, -1, 1}, {0x28, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_ykM_c::mCutNameList[10] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_ykM_c::mCutNameList[10] = { "", "SLIDEDOWN", "MEETING_AGAIN", @@ -524,7 +524,7 @@ char* daNpc_ykM_c::mCutNameList[10] = { "HUG" }; -daNpc_ykM_c::cutFunc daNpc_ykM_c::mCutList[10] = { +DUSK_GAME_DATA daNpc_ykM_c::cutFunc DUSK_CONST daNpc_ykM_c::mCutList[10] = { NULL, &daNpc_ykM_c::cutSlideDown, &daNpc_ykM_c::cutMeetingAgain, @@ -3727,7 +3727,7 @@ static int daNpc_ykM_IsDelete(void* a_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_ykM_MethodTable = { +static DUSK_CONST actor_method_class daNpc_ykM_MethodTable = { (process_method_func)daNpc_ykM_Create, (process_method_func)daNpc_ykM_Delete, (process_method_func)daNpc_ykM_Execute, @@ -3735,7 +3735,7 @@ static actor_method_class daNpc_ykM_MethodTable = { (process_method_func)daNpc_ykM_Draw, }; -actor_process_profile_definition g_profile_NPC_YKM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_YKM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_ykw.cpp b/src/d/actor/d_a_npc_ykw.cpp index e2c97df58a..7ca9c4f36f 100644 --- a/src/d/actor/d_a_npc_ykw.cpp +++ b/src/d/actor/d_a_npc_ykw.cpp @@ -20,6 +20,8 @@ #include "m_Do/m_Do_ext.h" #include +#include "helpers/string.hpp" + #if DEBUG class daNpc_ykW_HIO_c : public mDoHIO_entry_c { public: @@ -36,11 +38,11 @@ public: }; #endif -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {11, 1}, }; -static daNpcT_evtData_c l_evtList[10] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[10] = { {"", 0}, {"DEFAULT_GETITEM", 0}, {"NO_RESPONSE", 0}, @@ -61,16 +63,16 @@ static const char* l_resNameList[5] = { "ykM2", }; -static s8 l_loadResPtrn0[2] = {0x01, -1}; -static s8 l_loadResPtrn1[3] = {0x01, 0x02, -1}; -static s8 l_loadResPtrn2[3] = {0x01, 0x03, -1}; -static s8 l_loadResPtrn9[4] = {0x01, 0x02, 0x03, -1}; -static s8* l_loadResPtrnList[8] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = {0x01, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = {0x01, 0x02, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn2[3] = {0x01, 0x03, -1}; +static DUSK_CONSTEXPR s8 l_loadResPtrn9[4] = {0x01, 0x02, 0x03, -1}; +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[8] = { l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn2, l_loadResPtrn1, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn9, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {-1, 0, 0, 17, 2, 1, 1}, {6, 0, 1, 17, 2, 1, 1}, {9, 0, 2, 37, 0, 2, 0}, @@ -87,7 +89,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[14] = { {-1, 0, 0, 41, 2, 2, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[35] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[35] = { {8, 2, 1, 14, 0, 1, 1, 0}, {22, 2, 2, 14, 0, 1, 1, 0}, {14, 2, 3, 14, 0, 1, 1, 0}, @@ -125,7 +127,7 @@ static daNpcT_motionAnmData_c l_motionAnmData[35] = { {26, 0, 3, 29, 0, 3, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 1}, {7, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -135,7 +137,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[56] = {13, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[132] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[132] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {25, -1, 1}, {1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {29, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {30, -1, 1}, {0, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -155,7 +157,7 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[132] = { {23, 0, 1}, {24, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -const char* daNpc_ykW_c::mCutNameList[8] = { +DUSK_GAME_DATA const char* daNpc_ykW_c::mCutNameList[8] = { "", "SHOW_DOOR", "GO_INTO_BOSSROOM", @@ -166,7 +168,7 @@ const char* daNpc_ykW_c::mCutNameList[8] = { "HUG", }; -daNpc_ykW_c::cutFunc daNpc_ykW_c::mCutList[8] = { +DUSK_GAME_DATA daNpc_ykW_c::cutFunc DUSK_CONST daNpc_ykW_c::mCutList[8] = { NULL, &daNpc_ykW_c::cutShowDoor, &daNpc_ykW_c::cutGoIntoBossRoom, @@ -270,7 +272,7 @@ daNpc_ykW_c::~daNpc_ykW_c() { daNpcT_offTmpBit(0x55); } -const daNpc_ykW_HIOParam daNpc_ykW_Param_c::m = { +DUSK_GAME_DATA const daNpc_ykW_HIOParam daNpc_ykW_Param_c::m = { { 250.0f, -3.0f, 1.0f, 500.0f, 255.0f, 230.0f, 35.0f, 60.0f, 0.0f, 0.0f, 20.0f, -20.0f, 15.0f, -15.0f, 20.0f, -20.0f, @@ -1411,11 +1413,11 @@ int daNpc_ykW_c::cutGoIntoBossRoom(int param_0) { if (skip != 0 && (prm == 0 || prm == 4)) { if (prm == 0) { - strcpy(unkStrBuf1, l_evtList[4].eventName); + SAFE_STRCPY(unkStrBuf1, l_evtList[4].eventName); } else { - strcpy(unkStrBuf1, l_evtList[5].eventName); + SAFE_STRCPY(unkStrBuf1, l_evtList[5].eventName); } - strcat(unkStrBuf1, "@"); + SAFE_STRCAT(unkStrBuf1, "@"); dComIfGp_getEvent()->setSkipZev(this, unkStrBuf1); } } @@ -3019,7 +3021,7 @@ static int daNpc_ykW_IsDelete(void* i_this) { AUDIO_INSTANCES -static actor_method_class daNpc_ykW_MethodTable = { +static DUSK_CONST actor_method_class daNpc_ykW_MethodTable = { (process_method_func)daNpc_ykW_Create, (process_method_func)daNpc_ykW_Delete, (process_method_func)daNpc_ykW_Execute, @@ -3027,7 +3029,7 @@ static actor_method_class daNpc_ykW_MethodTable = { (process_method_func)daNpc_ykW_Draw, }; -actor_process_profile_definition g_profile_NPC_YKW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_YKW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zanb.cpp b/src/d/actor/d_a_npc_zanb.cpp index 9e4213695e..69775de42e 100644 --- a/src/d/actor/d_a_npc_zanb.cpp +++ b/src/d/actor/d_a_npc_zanb.cpp @@ -34,48 +34,48 @@ enum Motion { /* 0x1 */ MOT_SIT, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {9, ZANB}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "zanB", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[1] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, -1, J3DFrameCtrl::EMode_NONE, 0, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[2] = { {BCK_ZANB_WAIT_A, J3DFrameCtrl::EMode_LOOP, ZANB, BTK_ZANB, J3DFrameCtrl::EMode_NONE, ZANB, 1, 0}, {BCK_ZANB_SIT, J3DFrameCtrl::EMode_LOOP, ZANB, BTK_ZANB, J3DFrameCtrl::EMode_NONE, ZANB, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_zanB_c::mCutNameList[1] = {""}; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_zanB_c::mCutNameList[1] = {""}; -daNpc_zanB_c::cutFunc daNpc_zanB_c::mCutList[1] = {NULL}; +DUSK_GAME_DATA daNpc_zanB_c::cutFunc DUSK_CONST daNpc_zanB_c::mCutList[1] = {NULL}; daNpc_zanB_c::~daNpc_zanB_c() { OS_REPORT("|%06d:%x|daNpc_zanB_c -> デストラクト\n", g_Counter.mCounter0, this); @@ -93,7 +93,7 @@ daNpc_zanB_c::~daNpc_zanB_c() { deleteRes(l_loadResPtrnList[mType], (const char**)l_resNameList); } -daNpc_zanB_HIOParam const daNpc_zanB_Param_c::m = { +DUSK_GAME_DATA daNpc_zanB_HIOParam const daNpc_zanB_Param_c::m = { 270.0f, -3.0f, 1.0f, @@ -697,7 +697,7 @@ static int daNpc_zanB_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_zanB_MethodTable = { +static DUSK_CONST actor_method_class daNpc_zanB_MethodTable = { (process_method_func)daNpc_zanB_Create, (process_method_func)daNpc_zanB_Delete, (process_method_func)daNpc_zanB_Execute, @@ -705,7 +705,7 @@ static actor_method_class daNpc_zanB_MethodTable = { (process_method_func)daNpc_zanB_Draw, }; -actor_process_profile_definition g_profile_NPC_ZANB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZANB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zant.cpp b/src/d/actor/d_a_npc_zant.cpp index 9dd8839367..ba13a93954 100644 --- a/src/d/actor/d_a_npc_zant.cpp +++ b/src/d/actor/d_a_npc_zant.cpp @@ -11,55 +11,55 @@ #include "SSystem/SComponent/c_counter.h" #include -static int l_bmdData[2] = { +static DUSK_CONSTEXPR int l_bmdData[2] = { 7, 1 }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0} }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Zant", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { -1, 0, 0, -1, 0, 0, 0 }; -static daNpcT_motionAnmData_c l_motionAnmData = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData = { 4, 2, 1, -1, 0, 0, 0 }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -char* daNpc_Zant_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_Zant_c::mCutNameList = ""; -daNpc_Zant_c::cutFunc daNpc_Zant_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_Zant_c::cutFunc DUSK_CONST daNpc_Zant_c::mCutList[1] = { NULL }; static NPC_ZANT_HIO_CLASS l_HIO; -daNpc_Zant_HIOParam const daNpc_Zant_Param_c::m = { +DUSK_GAME_DATA daNpc_Zant_HIOParam const daNpc_Zant_Param_c::m = { 270.0f, -3.0f, 1.0f, 500.0f, 255.0f, 250.0f, 35.0f, 50.0f, 0.0f, 0.0f, 10.0f, -10.0f, 30.0f, -10.0f, 45.0f, -45.0f, 0.6f, 12.0f, 3, 6, 5, 6, 110.0f, 0.0f, 0.0f, 0.0f, 60, 8, @@ -551,7 +551,7 @@ static int daNpc_Zant_IsDelete(void* i_this) { return 1; } -static actor_method_class daNpc_Zant_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Zant_MethodTable = { (process_method_func)daNpc_Zant_Create, (process_method_func)daNpc_Zant_Delete, (process_method_func)daNpc_Zant_Execute, @@ -559,7 +559,7 @@ static actor_method_class daNpc_Zant_MethodTable = { (process_method_func)daNpc_Zant_Draw, }; -actor_process_profile_definition g_profile_NPC_ZANT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZANT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zelR.cpp b/src/d/actor/d_a_npc_zelR.cpp index 9e8bc00ee9..3e1b8cb2cb 100644 --- a/src/d/actor/d_a_npc_zelR.cpp +++ b/src/d/actor/d_a_npc_zelR.cpp @@ -13,59 +13,59 @@ enum RES_Name { /* 0x1 */ ZELRF, }; -static daNpc_GetParam1 l_bmdData[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdData[1] = { {10, 1} }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0} }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "zelRf" }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, 0, 0, 16, 2, 1, 1}, {6, 0, 1, 16, 2, 1, 1} }; -static daNpcT_motionAnmData_c l_motionAnmData = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData = { 7, 2, 1, 13, 0, 1, 1, 0 }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0} }; -char* daNpc_ZelR_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_ZelR_c::mCutNameList = ""; -daNpc_ZelR_c::EventFn daNpc_ZelR_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_ZelR_c::EventFn daNpc_ZelR_c::mCutList[1] = { NULL }; static NPC_ZELR_HIO_CLASS l_HIO; -daNpc_ZelR_HIOParam const daNpc_ZelR_Param_c::m = { +DUSK_GAME_DATA daNpc_ZelR_HIOParam const daNpc_ZelR_Param_c::m = { 190.0f, -3.0f, 1.0f, @@ -623,7 +623,7 @@ static int daNpc_ZelR_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpc_ZelR_MethodTable = { +static DUSK_CONST actor_method_class daNpc_ZelR_MethodTable = { (process_method_func)daNpc_ZelR_Create, (process_method_func)daNpc_ZelR_Delete, (process_method_func)daNpc_ZelR_Execute, @@ -631,7 +631,7 @@ static actor_method_class daNpc_ZelR_MethodTable = { (process_method_func)daNpc_ZelR_Draw, }; -actor_process_profile_definition g_profile_NPC_ZELR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZELR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zelRo.cpp b/src/d/actor/d_a_npc_zelRo.cpp index 2732eea27b..213de4d018 100644 --- a/src/d/actor/d_a_npc_zelRo.cpp +++ b/src/d/actor/d_a_npc_zelRo.cpp @@ -42,54 +42,54 @@ enum Type { /* 0x1 */ TYPE_1, }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {BMDR_ZELRO, ZELRO}, }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "zelRo", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1 }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[2] = { {-1, J3DFrameCtrl::EMode_NONE, NONE, 16, J3DFrameCtrl::EMode_LOOP, ZELRO, 1}, {BCK_ZELRO_F_TALK_A, J3DFrameCtrl::EMode_NONE, ZELRO, 16, J3DFrameCtrl::EMode_LOOP, ZELRO, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[1] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[1] = { {BCK_ZELRO_WAIT_A, J3DFrameCtrl::EMode_LOOP, ZELRO, BTK_ZELRO, J3DFrameCtrl::EMode_NONE, ZELRO, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[8] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -char* daNpc_ZelRo_c::mCutNameList = ""; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_ZelRo_c::mCutNameList = ""; -daNpc_ZelRo_c::cutFunc daNpc_ZelRo_c::mCutList[1] = { +DUSK_GAME_DATA daNpc_ZelRo_c::cutFunc DUSK_CONST daNpc_ZelRo_c::mCutList[1] = { NULL }; -const daNpc_ZelRo_HIOParam daNpc_ZelRo_Param_c::m = { +DUSK_GAME_DATA const daNpc_ZelRo_HIOParam daNpc_ZelRo_Param_c::m = { 190.0f, -3.0f, 1.0f, @@ -673,7 +673,7 @@ static int daNpc_ZelRo_IsDelete(void* a_this) { return 1; } -static actor_method_class daNpc_ZelRo_MethodTable = { +static DUSK_CONST actor_method_class daNpc_ZelRo_MethodTable = { (process_method_func)daNpc_ZelRo_Create, (process_method_func)daNpc_ZelRo_Delete, (process_method_func)daNpc_ZelRo_Execute, @@ -681,7 +681,7 @@ static actor_method_class daNpc_ZelRo_MethodTable = { (process_method_func)daNpc_ZelRo_Draw, }; -actor_process_profile_definition g_profile_NPC_ZELRO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZELRO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zelda.cpp b/src/d/actor/d_a_npc_zelda.cpp index 121d97bb39..065ac236f9 100644 --- a/src/d/actor/d_a_npc_zelda.cpp +++ b/src/d/actor/d_a_npc_zelda.cpp @@ -14,47 +14,47 @@ static u32 l_bmdData[2] = { 11, 1 }; -static daNpcT_evtData_c l_evtList[2] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[2] = { {"", 0}, {"NO_RESPONSE", 0}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Zelda" }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[2] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[2] = { &l_loadResPtrn0[0], &l_loadResPtrn0[0], }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[3] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[3] = { {-1, 0, 0, 17, 2, 1, 1}, {-1, 0, 0, 18, 2, 1, 0}, {6, 0, 1, 17, 2, 1, 1}, }; -static daNpcT_motionAnmData_c l_motionAnmData[2] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[2] = { {8, 2, 1, 14, 0, 1, 1, 0}, {7, 2, 1, 14, 0, 1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[12] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[12] = { {2, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[8] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -const char* daNpc_Zelda_c::mCutNameList = ""; -daNpc_Zelda_c::cutFunc daNpc_Zelda_c::mCutList[1] = { 0 }; +DUSK_GAME_DATA const char* daNpc_Zelda_c::mCutNameList = ""; +DUSK_GAME_DATA daNpc_Zelda_c::cutFunc DUSK_CONST daNpc_Zelda_c::mCutList[1] = { 0 }; static NPC_ZELDA_HIO_CLASS l_HIO; @@ -108,7 +108,7 @@ daNpc_Zelda_c::~daNpc_Zelda_c() { deleteRes(l_loadResPtrnList[field_0xf80], (const char**)l_resNameList); } -const daNpc_Zelda_HIOParam daNpc_Zelda_Param_c::m = {{ +DUSK_GAME_DATA const daNpc_Zelda_HIOParam daNpc_Zelda_Param_c::m = {{ 190.0f, // attention_offset -3.0f, // gravity 1.0f, // scale @@ -778,7 +778,7 @@ static int daNpc_Zelda_IsDelete(void* param_0) { return 1; } -static actor_method_class daNpc_Zelda_MethodTable = { +static DUSK_CONST actor_method_class daNpc_Zelda_MethodTable = { (process_method_func)daNpc_Zelda_Create, (process_method_func)daNpc_Zelda_Delete, (process_method_func)daNpc_Zelda_Execute, @@ -786,7 +786,7 @@ static actor_method_class daNpc_Zelda_MethodTable = { (process_method_func)daNpc_Zelda_Draw, }; -actor_process_profile_definition g_profile_NPC_ZELDA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZELDA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zra.cpp b/src/d/actor/d_a_npc_zra.cpp index 15ed62157e..9d97a3ac2c 100644 --- a/src/d/actor/d_a_npc_zra.cpp +++ b/src/d/actor/d_a_npc_zra.cpp @@ -22,7 +22,7 @@ static NPC_ZRA_HIO_CLASS l_HIO; -daNpc_zrA_HIOParam const daNpc_zrA_Param_c::m = { +DUSK_GAME_DATA daNpc_zrA_HIOParam const daNpc_zrA_Param_c::m = { 230.0f, // mAttnOffsetY -3.0f, // mGravity 1.0f, // mScale @@ -227,7 +227,7 @@ f32 daNpc_zrA_Path_c::chkPassDst(u16 i_idx, cXyz i_pos) { } } -static daNpc_GetParam1 l_bmdGetParamList[6] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[6] = { {3, 4}, // zra {13, 5}, // zra_tw {3, 7}, // zra_met @@ -236,7 +236,7 @@ static daNpc_GetParam1 l_bmdGetParamList[6] = { {4, 10}, // zra_sp_tw }; -static daNpc_GetParam1 l_bckGetParamList[63] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[63] = { {-1, 0}, {8, 0}, // zra_f_talk_a {9, 0}, // zra_f_talk_a_sp @@ -302,7 +302,7 @@ static daNpc_GetParam1 l_bckGetParamList[63] = { {12, 3}, // zra_step_sp }; -static daNpc_GetParam1 l_btpGetParamList[8] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[8] = { {34, 0}, // zra {16, 5}, // zra_fh_sadsit_a {10, 6}, // zra_fh_sadsit_b @@ -313,24 +313,24 @@ static daNpc_GetParam1 l_btpGetParamList[8] = { {18, 9}, // zra_fh_spa_wait_b }; -static daNpc_GetParam1 l_btkGetParamList[4] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[4] = { {28, 0}, // zra {31, 0}, // zra_water02 {29, 0}, // zra_reset {30, 0}, // zra_w_eyeball }; -static daNpc_GetParam1 l_brkGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_brkGetParamList[2] = { {24, 0}, // zra {25, 0}, // zra_water02 }; -static daNpc_GetParam1 l_bpkGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bpkGetParamList[2] = { {20, 0}, // zra {21, 0}, // zra_water02 }; -static daNpc_GetParam1 l_evtGetParamList[13] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[13] = { {0, 0}, {1, 0}, {2, 0}, @@ -346,7 +346,7 @@ static daNpc_GetParam1 l_evtGetParamList[13] = { {12, 0}, }; -static char* l_evtNames[13] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[13] = { NULL, "TALK_SWIM", "BEFORE_BLAST_ZRR", @@ -362,34 +362,34 @@ static char* l_evtNames[13] = { "TALK_MULTI2", }; -static int l_loadObj_list[3][3] = { +static DUSK_CONSTEXPR int l_loadObj_list[3][3] = { {2, 3, -1}, {2, -1, -1}, {-1, -1, -1}, }; -static int l_loadObj_listTW[3][3] = { +static DUSK_CONSTEXPR int l_loadObj_listTW[3][3] = { {4, 5, -1}, {4, -1, -1}, {-1, -1, -1}, }; -static int l_loadRes_ZRAa[8] = {0, 1, 2, 4, 6, -1, -1, -1}; +static DUSK_CONSTEXPR int l_loadRes_ZRAa[8] = {0, 1, 2, 4, 6, -1, -1, -1}; -static int l_loadRes_Swim[8] = {0, 1, 2, 4, -1, -1, -1, -1}; +static DUSK_CONSTEXPR int l_loadRes_Swim[8] = {0, 1, 2, 4, -1, -1, -1, -1}; -static int l_loadRes_Tobi[8] = {0, 1, 2, 4, 8, -1, -1, -1}; +static DUSK_CONSTEXPR int l_loadRes_Tobi[8] = {0, 1, 2, 4, 8, -1, -1, -1}; -static int l_loadRes_Spa[8] = {0, 2, 4, 9, -1, -1, -1, -1}; +static DUSK_CONSTEXPR int l_loadRes_Spa[8] = {0, 2, 4, 9, -1, -1, -1, -1}; -static int l_loadRes_ZRA0[8] = {0, 1, 2, 4, -1, -1, -1, -1}; +static DUSK_CONSTEXPR int l_loadRes_ZRA0[8] = {0, 1, 2, 4, -1, -1, -1, -1}; -static int* l_loadRes_list[8] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[8] = { l_loadRes_ZRAa, l_loadRes_Swim, l_loadRes_Swim, l_loadRes_Swim, l_loadRes_Tobi, l_loadRes_Tobi, l_loadRes_Spa, l_loadRes_ZRA0, }; -static char* l_resNames[11] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[11] = { "zrA", "zrA_nml", "zrA_nml2", @@ -403,14 +403,14 @@ static char* l_resNames[11] = { "zrA_objTW", }; -static char* l_myName[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_myName[4] = { "zrA", "zrA_talk", "zrR", "zrWF", }; -char* daNpc_zrA_c::mEvtCutNameList[11] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_zrA_c::mEvtCutNameList[11] = { "", "TALK_SWIM", "BEFORE_BLAST_ZRR", @@ -424,7 +424,7 @@ char* daNpc_zrA_c::mEvtCutNameList[11] = { "TALK_MULTI", }; -daNpc_zrA_c::EventFn daNpc_zrA_c::mEvtCutList[11] = { +DUSK_GAME_DATA daNpc_zrA_c::EventFn DUSK_CONST daNpc_zrA_c::mEvtCutList[11] = { NULL, &daNpc_zrA_c::ECut_talkSwim, &daNpc_zrA_c::ECut_beforeBlastzrR, @@ -2331,7 +2331,7 @@ static int daNpc_zrA_IsDelete(void* i_this) { AUDIO_INSTANCES -static actor_method_class daNpc_zrA_MethodTable = { +static DUSK_CONST actor_method_class daNpc_zrA_MethodTable = { (process_method_func)daNpc_zrA_Create, (process_method_func)daNpc_zrA_Delete, (process_method_func)daNpc_zrA_Execute, @@ -2339,7 +2339,7 @@ static actor_method_class daNpc_zrA_MethodTable = { (process_method_func)daNpc_zrA_Draw, }; -actor_process_profile_definition g_profile_NPC_ZRA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZRA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zrc.cpp b/src/d/actor/d_a_npc_zrc.cpp index d7f2ebc372..60ae6713e5 100644 --- a/src/d/actor/d_a_npc_zrc.cpp +++ b/src/d/actor/d_a_npc_zrc.cpp @@ -17,7 +17,7 @@ enum Event_Cut_Nums { static NPC_ZRC_HIO_CLASS l_HIO; -daNpc_zrC_HIOParam const daNpc_zrC_Param_c::m = { +DUSK_GAME_DATA daNpc_zrC_HIOParam const daNpc_zrC_Param_c::m = { 50.0f, // mAttnOffsetY -3.0f, // mGravity 1.0f, // mScale @@ -55,12 +55,12 @@ daNpc_zrC_HIOParam const daNpc_zrC_Param_c::m = { 2300.0f, }; -static daNpc_GetParam1 l_bmdGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[2] = { {3, 3}, // zrc {3, 4}, // zrc_sick_tw }; -static daNpc_GetParam1 l_bckGetParamList[32] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[32] = { {9, 0}, // zrc_f_wait_a {5, 2}, // zrc_f_sit_talk {8, 0}, // zrc_f_talk_a @@ -95,7 +95,7 @@ static daNpc_GetParam1 l_bckGetParamList[32] = { {5, 5}, // zrc_sick_demo_wait }; -static daNpc_GetParam1 l_btpGetParamList[15] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[15] = { {19, 0}, // zrc {10, 2}, // zrc_f_sit_talk {23, 0}, // zrc_f_talk_a @@ -113,7 +113,7 @@ static daNpc_GetParam1 l_btpGetParamList[15] = { {8, 5}, // zrc_f_sick_demo_wait }; -static daNpc_GetParam1 l_btkGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[5] = { {16, 0}, // zrc {26, 1}, // zrc_sad_talk {27, 1}, // zrc_sad_wait @@ -121,37 +121,37 @@ static daNpc_GetParam1 l_btkGetParamList[5] = { {25, 1}, // zrc_kizuku_wait }; -static daNpc_GetParam1 l_evtGetParamList[2] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[2] = { {0, 0}, {1, 6}, }; -static char* l_evtNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[2] = { NULL, "EARRING_GET", }; -static int l_loadRes_ZRCa[5] = { +static DUSK_CONSTEXPR int l_loadRes_ZRCa[5] = { 0, 3, -1, -1, 0, }; -static int l_loadRes_ZRC_SICK[5] = { +static DUSK_CONSTEXPR int l_loadRes_ZRC_SICK[5] = { 3, 5, 0, -1, 0, }; -static int l_loadRes_ZRC0[5] = { +static DUSK_CONSTEXPR int l_loadRes_ZRC0[5] = { 0, 3, -1, -1, 0, }; -static int l_loadRes_ZRC_PRAY[5] = { +static DUSK_CONSTEXPR int l_loadRes_ZRC_PRAY[5] = { 0, 3, 1, 6, -1, }; -static int l_loadRes_ZRC_SIT[5] = { +static DUSK_CONSTEXPR int l_loadRes_ZRC_SIT[5] = { 0, 2, 3, -1, 0, }; -static int* l_loadRes_list[5] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[5] = { l_loadRes_ZRCa, l_loadRes_ZRC_SICK, l_loadRes_ZRC_PRAY, @@ -159,7 +159,7 @@ static int* l_loadRes_list[5] = { l_loadRes_ZRC0, }; -static char* l_resNames[7] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[7] = { "zrC", "zrC1", "zrC2", @@ -169,14 +169,14 @@ static char* l_resNames[7] = { "zrC_EGD", }; -static char* l_myName = "zrC"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "zrC"; -char* daNpc_zrC_c::mEvtCutNameList[2] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_zrC_c::mEvtCutNameList[2] = { "", "EARRING_GET", }; -daNpc_zrC_c::EventFn daNpc_zrC_c::mEvtCutList[2] = { +DUSK_GAME_DATA daNpc_zrC_c::EventFn DUSK_CONST daNpc_zrC_c::mEvtCutList[2] = { NULL, &daNpc_zrC_c::ECut_earringGet, }; @@ -1791,7 +1791,7 @@ static int daNpc_zrC_IsDelete(void* i_this) { AUDIO_INSTANCES -static actor_method_class daNpc_zrC_MethodTable = { +static DUSK_CONST actor_method_class daNpc_zrC_MethodTable = { (process_method_func)daNpc_zrC_Create, (process_method_func)daNpc_zrC_Delete, (process_method_func)daNpc_zrC_Execute, @@ -1799,7 +1799,7 @@ static actor_method_class daNpc_zrC_MethodTable = { (process_method_func)daNpc_zrC_Draw, }; -actor_process_profile_definition g_profile_NPC_ZRC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZRC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_npc_zrz.cpp b/src/d/actor/d_a_npc_zrz.cpp index 7e71ef130e..9e45b34f86 100644 --- a/src/d/actor/d_a_npc_zrz.cpp +++ b/src/d/actor/d_a_npc_zrz.cpp @@ -16,7 +16,7 @@ static NPC_ZRZ_HIO_CLASS l_HIO; -daNpc_zrZ_HIOParam const daNpc_zrZ_Param_c::m = { +DUSK_GAME_DATA daNpc_zrZ_HIOParam const daNpc_zrZ_Param_c::m = { 700.0f, // mAttnOffsetY 0.0f, // mGravity 1.0f, // mScale @@ -58,15 +58,15 @@ daNpc_zrZ_HIOParam const daNpc_zrZ_Param_c::m = { 200.0f, }; -static daNpc_GetParam1 l_bmdGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGetParamList[1] = { {9, 0}, }; -static daNpc_GetParam1 l_bmdGTGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdGTGetParamList[1] = { {13, 1}, // gt }; -static daNpc_GetParam1 l_bckGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[5] = { {-1, 0}, {-1, 0}, {6, 0}, @@ -74,7 +74,7 @@ static daNpc_GetParam1 l_bckGetParamList[5] = { {0, 0}, }; -static daNpc_GetParam1 l_bckGTGetParamList[5] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGTGetParamList[5] = { {-1, 1}, {8, 1}, // f_talk_a {10, 1}, // wait_gt_a @@ -82,23 +82,23 @@ static daNpc_GetParam1 l_bckGTGetParamList[5] = { {7, 1}, // comeon }; -static daNpc_GetParam1 l_btpGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[1] = { {15, 0}, }; -static daNpc_GetParam1 l_btpGTGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGTGetParamList[1] = { {19, 1}, // gt }; -static daNpc_GetParam1 l_btkGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[1] = { {12, 0}, }; -static daNpc_GetParam1 l_btkGTGetParamList[1] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGTGetParamList[1] = { {16, 1}, // gt }; -static daNpc_GetParam1 l_evtGetParamList[8] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_evtGetParamList[8] = { {0, 0}, {1, 1}, {2, 1}, @@ -115,18 +115,18 @@ static int l_loadRes_ZRZ_GT[3] = {1, -1, -1}; static int l_loadRes_ZRZ0[3] = {0, -1, -1}; -static int* l_loadRes_list[3] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[3] = { l_loadRes_ZRZa, l_loadRes_ZRZ_GT, l_loadRes_ZRZ0, }; -static char* l_resNames[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[2] = { "zrZ", "zrZ_GT", }; -static char* l_evtNames[8] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNames[8] = { NULL, "HELP_PRINCE", "COME_HERE", @@ -137,9 +137,9 @@ static char* l_evtNames[8] = { "SR_SKIP", }; -static char* l_myName = "zrZ"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "zrZ"; -char* daNpc_zrZ_c::mEvtCutNameList[8] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daNpc_zrZ_c::mEvtCutNameList[8] = { "", "HELP_PRINCE", "COME_HERE", @@ -150,7 +150,7 @@ char* daNpc_zrZ_c::mEvtCutNameList[8] = { "SR_SKIP", }; -daNpc_zrZ_c::EventFn daNpc_zrZ_c::mEvtCutList[8] = { +DUSK_GAME_DATA daNpc_zrZ_c::EventFn DUSK_CONST daNpc_zrZ_c::mEvtCutList[8] = { NULL, &daNpc_zrZ_c::ECut_helpPrince, &daNpc_zrZ_c::ECut_comeHere, @@ -2446,7 +2446,7 @@ static int daNpc_zrZ_IsDelete(void* i_this) { AUDIO_INSTANCES; -static actor_method_class daNpc_zrZ_MethodTable = { +static DUSK_CONST actor_method_class daNpc_zrZ_MethodTable = { (process_method_func)daNpc_zrZ_Create, (process_method_func)daNpc_zrZ_Delete, (process_method_func)daNpc_zrZ_Execute, @@ -2454,7 +2454,7 @@ static actor_method_class daNpc_zrZ_MethodTable = { (process_method_func)daNpc_zrZ_Draw, }; -actor_process_profile_definition g_profile_NPC_ZRZ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_NPC_ZRZ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_Lv5Key.cpp b/src/d/actor/d_a_obj_Lv5Key.cpp index a71ad25e33..227077c5c4 100644 --- a/src/d/actor/d_a_obj_Lv5Key.cpp +++ b/src/d/actor/d_a_obj_Lv5Key.cpp @@ -10,7 +10,7 @@ static int useHeapInit(fopAc_ac_c*); -static char* l_arcName = "Lv5_KEY"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Lv5_KEY"; int daObjLv5Key_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 7); @@ -333,13 +333,13 @@ static int daObjLv5Key_IsDelete(daObjLv5Key_c* i_this) { return 1; } -static actor_method_class l_daObjLv5Key_Method = { +static DUSK_CONST actor_method_class l_daObjLv5Key_Method = { (process_method_func)daObjLv5Key_Create, (process_method_func)daObjLv5Key_Delete, (process_method_func)daObjLv5Key_Execute, (process_method_func)daObjLv5Key_IsDelete, (process_method_func)daObjLv5Key_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv5Key = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv5Key = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_Turara.cpp b/src/d/actor/d_a_obj_Turara.cpp index 5e350e0974..767129993c 100644 --- a/src/d/actor/d_a_obj_Turara.cpp +++ b/src/d/actor/d_a_obj_Turara.cpp @@ -50,7 +50,7 @@ void daTurara_c::setBaseMtx() { static daTurara_HIO_c l_HIO; -const dCcD_SrcGObjInf daTurara_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daTurara_c::mCcDObjInfo = { {0, // mFlags { {0x20, 0x1, 0x1f}, // mObjAt @@ -63,7 +63,7 @@ const dCcD_SrcGObjInf daTurara_c::mCcDObjInfo = { {0} // mGObjCo }; -dCcD_SrcCyl daTurara_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daTurara_c::mCcDCyl = { daTurara_c::mCcDObjInfo, // mObjInf { { @@ -410,7 +410,7 @@ static int daTurara_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daTurara_Method = { +static DUSK_CONST actor_method_class l_daTurara_Method = { (process_method_func)daTurara_Create, (process_method_func)daTurara_Delete, (process_method_func)daTurara_Execute, @@ -418,7 +418,7 @@ static actor_method_class l_daTurara_Method = { (process_method_func)daTurara_Draw, }; -actor_process_profile_definition g_profile_Obj_Turara = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Turara = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_TvCdlst.cpp b/src/d/actor/d_a_obj_TvCdlst.cpp index 9df06beddf..1b7cbb44db 100644 --- a/src/d/actor/d_a_obj_TvCdlst.cpp +++ b/src/d/actor/d_a_obj_TvCdlst.cpp @@ -10,7 +10,7 @@ static daTvCdlst_HIO_c l_HIO; -dCcD_SrcCyl daTvCdlst_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daTvCdlst_c::mCcDCyl = { daTvCdlst_c::mCcDObjInfo, // mObjInf { { @@ -42,7 +42,7 @@ int daTvCdlst_c::CreateHeap() { return 1; } -const dCcD_SrcGObjInf daTvCdlst_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daTvCdlst_c::mCcDObjInfo = { {0, // mFlags { {0x0, 0x0, 0x0}, // mObjAt @@ -214,7 +214,7 @@ static int daTvCdlst_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daTvCdlst_Method = { +static DUSK_CONST actor_method_class l_daTvCdlst_Method = { (process_method_func)daTvCdlst_Create, (process_method_func)daTvCdlst_Delete, (process_method_func)daTvCdlst_Execute, @@ -222,7 +222,7 @@ static actor_method_class l_daTvCdlst_Method = { (process_method_func)daTvCdlst_Draw, }; -actor_process_profile_definition g_profile_Obj_TvCdlst = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TvCdlst = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_Y_taihou.cpp b/src/d/actor/d_a_obj_Y_taihou.cpp index 61f96a12ab..9050f9bb17 100644 --- a/src/d/actor/d_a_obj_Y_taihou.cpp +++ b/src/d/actor/d_a_obj_Y_taihou.cpp @@ -373,7 +373,7 @@ static int daObjYtaihou_MoveBGDraw(daObjYtaihou_c* i_this) { return i_this->Draw(); } -static actor_method_class daObjYtaihou_METHODS = { +static DUSK_CONST actor_method_class daObjYtaihou_METHODS = { (process_method_func)daObjYtaihou_create1st, (process_method_func)daObjYtaihou_MoveBGDelete, (process_method_func)daObjYtaihou_MoveBGExecute, @@ -381,7 +381,7 @@ static actor_method_class daObjYtaihou_METHODS = { (process_method_func)daObjYtaihou_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Ytaihou = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ytaihou = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_amiShutter.cpp b/src/d/actor/d_a_obj_amiShutter.cpp index 2150ea48ac..8d193c8811 100644 --- a/src/d/actor/d_a_obj_amiShutter.cpp +++ b/src/d/actor/d_a_obj_amiShutter.cpp @@ -284,7 +284,7 @@ int daAmiShutter_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -actor_method_class l_daAmiShutter_Method = { +DUSK_GAME_DATA actor_method_class l_daAmiShutter_Method = { (process_method_func)daAmiShutter_Create, (process_method_func)daAmiShutter_Delete, (process_method_func)daAmiShutter_Execute, @@ -293,7 +293,7 @@ actor_method_class l_daAmiShutter_Method = { }; -actor_process_profile_definition g_profile_Obj_AmiShutter = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_AmiShutter = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ari.cpp b/src/d/actor/d_a_obj_ari.cpp index 267b0003af..bde4ba7c46 100644 --- a/src/d/actor/d_a_obj_ari.cpp +++ b/src/d/actor/d_a_obj_ari.cpp @@ -731,7 +731,7 @@ static int daObjARI_IsDelete(daObjARI_c* i_this) { return 1; } -static actor_method_class l_daObjARI_Method = { +static DUSK_CONST actor_method_class l_daObjARI_Method = { (process_method_func)daObjARI_Create, (process_method_func)daObjARI_Delete, (process_method_func)daObjARI_Execute, @@ -739,7 +739,7 @@ static actor_method_class l_daObjARI_Method = { (process_method_func)daObjARI_Draw, }; -actor_process_profile_definition g_profile_Obj_Ari = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ari = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_automata.cpp b/src/d/actor/d_a_obj_automata.cpp index bb277e015f..3d6b5d804e 100644 --- a/src/d/actor/d_a_obj_automata.cpp +++ b/src/d/actor/d_a_obj_automata.cpp @@ -10,16 +10,16 @@ #include "d/d_cc_d.h" #include "d/d_com_inf_game.h" -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { 9, 1, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "AutoMata", }; -daObj_AutoMata_HIOParam const daObj_AutoMata_Param_c::m = { +DUSK_GAME_DATA daObj_AutoMata_HIOParam const daObj_AutoMata_Param_c::m = { 220.0f, 80.0f, 40.0f, }; @@ -330,7 +330,7 @@ static int daObj_AutoMata_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_AutoMata_MethodTable = { +static DUSK_CONST actor_method_class daObj_AutoMata_MethodTable = { (process_method_func)daObj_AutoMata_Create, (process_method_func)daObj_AutoMata_Delete, (process_method_func)daObj_AutoMata_Execute, @@ -338,7 +338,7 @@ static actor_method_class daObj_AutoMata_MethodTable = { (process_method_func)daObj_AutoMata_Draw, }; -actor_process_profile_definition g_profile_OBJ_AUTOMATA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_AUTOMATA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_avalanche.cpp b/src/d/actor/d_a_obj_avalanche.cpp index 4742cf1683..48bf874c63 100644 --- a/src/d/actor/d_a_obj_avalanche.cpp +++ b/src/d/actor/d_a_obj_avalanche.cpp @@ -35,13 +35,13 @@ void daObjAvalanche_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mMtx2); } -static char* l_arcName = "V_Yuki"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_Yuki"; -static char* l_evName = "SNOW_COLLAPSE"; +static DUSK_CONSTEXPR char DUSK_CONST* l_evName = "SNOW_COLLAPSE"; -static char* l_staffName = "Obj_ava"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "Obj_ava"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-500.0f, -500.0f, -700.0f}, {500.0f, 1000.0f, 700.0f}, }; @@ -134,7 +134,7 @@ int daObjAvalanche_c::checkCollapse() { local_28 = l_check_pos[0]; local_1c = l_check_pos[1]; cXyz playerDist = player->current.pos - current.pos; - mDoMtx_stack_c::YrotM(-shape_angle.y); + DUSK_IF_ELSE(mDoMtx_stack_c::YrotS(-shape_angle.y), mDoMtx_stack_c::YrotM(-shape_angle.y)); mDoMtx_stack_c::multVec(&playerDist, &playerDist); if (player->current.pos.y > current.pos.y && player->current.pos.y < current.pos.y + 300.0f && playerDist.x > local_28.x && playerDist.x < local_1c.x && playerDist.z > local_28.z && @@ -204,7 +204,7 @@ void daObjAvalanche_c::actionEvent() { void daObjAvalanche_c::actionDead() { } -static char* action_table[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* action_table[2] = { "WAIT", "COLLAPSE", }; @@ -292,13 +292,13 @@ static int daObjAvalanche_MoveBGDraw(daObjAvalanche_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjAvalanche_METHODS = { +static DUSK_CONST actor_method_class daObjAvalanche_METHODS = { (process_method_func)daObjAvalanche_create1st, (process_method_func)daObjAvalanche_MoveBGDelete, (process_method_func)daObjAvalanche_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjAvalanche_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Avalanche = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Avalanche = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_balloon.cpp b/src/d/actor/d_a_obj_balloon.cpp index d857a569ba..a8d3b944ed 100644 --- a/src/d/actor/d_a_obj_balloon.cpp +++ b/src/d/actor/d_a_obj_balloon.cpp @@ -300,13 +300,13 @@ static int daObj_Balloon_Create(daObj_Balloon_c* i_this) { return i_this->create(); } -static actor_method_class l_daObj_Balloon_Method = { +static DUSK_CONST actor_method_class l_daObj_Balloon_Method = { (process_method_func)daObj_Balloon_Create, (process_method_func)daObj_Balloon_Delete, (process_method_func)daObj_Balloon_Execute, (process_method_func)daObj_Balloon_IsDelete, (process_method_func)daObj_Balloon_Draw, }; -actor_process_profile_definition g_profile_OBJ_BALLOON = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_BALLOON = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_barDesk.cpp b/src/d/actor/d_a_obj_barDesk.cpp index 8de65413ba..a333cb1a3d 100644 --- a/src/d/actor/d_a_obj_barDesk.cpp +++ b/src/d/actor/d_a_obj_barDesk.cpp @@ -12,14 +12,14 @@ static daBarDesk_HIO_c l_HIO; -dCcD_SrcGObjInf const daBarDesk_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daBarDesk_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0xD8FAFDBF, 0x11}, {0}}}, {1, 0, 0, 0, 0}, {0xA, 0, 0, 0, 6}, {0} }; -dCcD_SrcCyl daBarDesk_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daBarDesk_c::mCcDCyl = { mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f} @@ -152,7 +152,7 @@ static cPhs_Step daBarDesk_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBarDesk_Method = { +static DUSK_CONST actor_method_class l_daBarDesk_Method = { (process_method_func)daBarDesk_Create, (process_method_func)daBarDesk_Delete, (process_method_func)daBarDesk_Execute, @@ -160,7 +160,7 @@ static actor_method_class l_daBarDesk_Method = { (process_method_func)daBarDesk_Draw, }; -actor_process_profile_definition g_profile_Obj_BarDesk = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BarDesk = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_batta.cpp b/src/d/actor/d_a_obj_batta.cpp index 87c4114ce4..07feb23251 100644 --- a/src/d/actor/d_a_obj_batta.cpp +++ b/src/d/actor/d_a_obj_batta.cpp @@ -686,7 +686,7 @@ static int daObjBATTA_IsDelete(daObjBATTA_c* i_this) { return 1; } -static actor_method_class l_daObjBATTA_Method = { +static DUSK_CONST actor_method_class l_daObjBATTA_Method = { (process_method_func)daObjBATTA_Create, (process_method_func)daObjBATTA_Delete, (process_method_func)daObjBATTA_Execute, @@ -694,7 +694,7 @@ static actor_method_class l_daObjBATTA_Method = { (process_method_func)daObjBATTA_Draw, }; -actor_process_profile_definition g_profile_Obj_Batta = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Batta = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bbox.cpp b/src/d/actor/d_a_obj_bbox.cpp index 210932589a..38f20ab3db 100644 --- a/src/d/actor/d_a_obj_bbox.cpp +++ b/src/d/actor/d_a_obj_bbox.cpp @@ -25,7 +25,7 @@ const static dCcD_SrcCyl l_cyl_src = { } }; -static char* l_arcName = "M_BBox"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_BBox"; void daObjBBox_c::initBaseMtx() { mpModel->setBaseScale(scale); @@ -127,7 +127,7 @@ static int daObjBBox_MoveBGDraw(daObjBBox_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjBBox_METHODS = { +static DUSK_CONST actor_method_class daObjBBox_METHODS = { (process_method_func)daObjBBox_create1st, (process_method_func)daObjBBox_MoveBGDelete, (process_method_func)daObjBBox_MoveBGExecute, @@ -135,7 +135,7 @@ static actor_method_class daObjBBox_METHODS = { (process_method_func)daObjBBox_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_BBox = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BBox = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bed.cpp b/src/d/actor/d_a_obj_bed.cpp index 63c09e78c0..e4d11f5b29 100644 --- a/src/d/actor/d_a_obj_bed.cpp +++ b/src/d/actor/d_a_obj_bed.cpp @@ -12,7 +12,7 @@ #include "d/actor/d_a_npc.h" #include "f_pc/f_pc_name.h" -static char* l_resName = "KH_Bed"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resName = "KH_Bed"; static OBJ_BED_HIO_CLASS l_HIO; @@ -30,7 +30,7 @@ void daObj_Bed_HIO_c::genMessage(JORMContext* ctx) { } #endif -daObj_Bed_HIOParam const daObj_Bed_Param_c::m = {0, -3.0f, 1.0f, 600.0f}; +DUSK_GAME_DATA daObj_Bed_HIOParam const daObj_Bed_Param_c::m = {0, -3.0f, 1.0f, 600.0f}; daObj_Bed_c::~daObj_Bed_c() { if (mpCollider != NULL) { @@ -149,7 +149,7 @@ u8 daObj_Bed_c::getType() { return 0; } -char* daObj_Bed_c::getResName() { +char DUSK_CONST* daObj_Bed_c::getResName() { return l_resName; } @@ -199,7 +199,7 @@ static int daObj_Bed_IsDelete(void* param_0) { return 1; } -static actor_method_class daObj_Bed_MethodTable = { +static DUSK_CONST actor_method_class daObj_Bed_MethodTable = { (process_method_func)daObj_Bed_Create, (process_method_func)daObj_Bed_Delete, (process_method_func)daObj_Bed_Execute, @@ -207,7 +207,7 @@ static actor_method_class daObj_Bed_MethodTable = { (process_method_func)daObj_Bed_Draw, }; -actor_process_profile_definition g_profile_OBJ_BED = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_BED = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bemos.cpp b/src/d/actor/d_a_obj_bemos.cpp index 98b4d9e597..2603294ed0 100644 --- a/src/d/actor/d_a_obj_bemos.cpp +++ b/src/d/actor/d_a_obj_bemos.cpp @@ -52,7 +52,7 @@ static Vec const l_craw_offset[4] = { {0.0f, 0.0f, 95.0f}, }; -s16 const daObjBm_c::M_dir_base[4] = { +DUSK_GAME_DATA s16 const daObjBm_c::M_dir_base[4] = { 0x0000, 0x4000, -0x8000, @@ -63,26 +63,26 @@ static const char* l_arcName = "Obj_bm"; static const char* l_eye_matName = "bmEye"; -static char* l_head_joint = "head"; +static DUSK_CONSTEXPR char DUSK_CONST* l_head_joint = "head"; -static char* l_bigGear_joint = "cogRed"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bigGear_joint = "cogRed"; -static char* l_smallGear0_joint = "cogBlue"; +static DUSK_CONSTEXPR char DUSK_CONST* l_smallGear0_joint = "cogBlue"; -static char* l_smallGear1_joint = "cogGreen"; +static DUSK_CONSTEXPR char DUSK_CONST* l_smallGear1_joint = "cogGreen"; -static char* l_smallGear2_joint = "cogYellow"; +static DUSK_CONSTEXPR char DUSK_CONST* l_smallGear2_joint = "cogYellow"; -static char* l_joint_table[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_joint_table[5] = { l_head_joint, l_bigGear_joint, l_smallGear0_joint, l_smallGear1_joint, l_smallGear2_joint, }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-1200.0f, -100.0f, -1200.0f}, {1200.0f, 400.0f, 1200.0f}, }; -static dCcD_SrcSph l_sph_src = { +static DUSK_CONSTEXPR dCcD_SrcSph l_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x402020, 0x11}, 0x58}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -94,7 +94,7 @@ static dCcD_SrcSph l_sph_src = { } // mSphAttr }; -static dCcD_SrcCps l_cps_src = { +static DUSK_CONSTEXPR dCcD_SrcCps l_cps_src = { { {0x0, {{0x100, 0x1, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj {dCcD_SE_SWORD, 0x0, 0x0, 0x1, 0x0}, // mGObjAt @@ -106,7 +106,7 @@ static dCcD_SrcCps l_cps_src = { } // mCpsAttr }; -static dCcD_SrcCyl l_cyl_src = { +static DUSK_CONSTEXPR dCcD_SrcCyl l_cyl_src = { { {0x0, {{0x0, 0x0, 0x1f}, {0x0, 0x0}, 0x79}}, // mObj {dCcD_SE_NONE, 0x1, 0x0, 0x0, 0x0}, // mGObjAt @@ -1037,12 +1037,12 @@ void daObjBm_c::mode_wait() { } } -const daObjBm_c::BgcSrc_c daObjBm_c::Bgc_c::M_lin5[] = { +DUSK_GAME_DATA const daObjBm_c::BgcSrc_c daObjBm_c::Bgc_c::M_lin5[] = { {0.0f, 0.0f, 0.0f, 0.0f}, {-0.5f, -0.5f, -1.0f, -1.0f}, {0.5f, -0.5f, 1.0f, -1.0f}, {0.5f, 0.5f, 1.0f, 1.0f}, {-0.5f, 0.5f, -1.0f, 1.0f}, }; -const daObjBm_c::BgcSrc_c daObjBm_c::Bgc_c::M_lin20[] = { +DUSK_GAME_DATA const daObjBm_c::BgcSrc_c daObjBm_c::Bgc_c::M_lin20[] = { {0.0f, 0.0f, 0.0f, 0.0f}, {-0.25f, -0.25f, 0.0f, 0.0f}, {-0.5f, -0.5f, -1.0f, -1.0f}, {0.0f, -0.5f, 1.0f, -1.0f}, {0.0f, 0.0f, 1.0f, 1.0f}, {-0.5f, 0.0f, -1.0f, 1.0f}, {0.25f, -0.25f, 0.0f, 0.0f}, {0.0f, -0.5f, -1.0f, -1.0f}, {0.5f, -0.5f, 1.0f, -1.0f}, @@ -1148,11 +1148,11 @@ static f32 dummy_rodata_5157() { return -G_CM3D_F_INF; } -dBgS_ObjGndChk daObjBm_c::Bgc_c::M_gnd_work[23]; +DUSK_GAME_DATA dBgS_ObjGndChk daObjBm_c::Bgc_c::M_gnd_work[23]; -dBgS_WtrChk daObjBm_c::Bgc_c::M_wrt_work; +DUSK_GAME_DATA dBgS_WtrChk daObjBm_c::Bgc_c::M_wrt_work; -dBgS_ObjLinChk daObjBm_c::Bgc_c::M_wall_work[23]; +DUSK_GAME_DATA dBgS_ObjLinChk daObjBm_c::Bgc_c::M_wall_work[23]; void daObjBm_c::Bgc_c::chk_wall_touch(const fopAc_ac_c*, const daObjBm_c::BgcSrc_c*, short) { static dBgS_ObjLinChk touch_work; @@ -1943,13 +1943,13 @@ static int daObjBm_MoveBGDraw(daObjBm_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjBm_METHODS = { +static DUSK_CONST actor_method_class daObjBm_METHODS = { (process_method_func)daObjBm_create1st, (process_method_func)daObjBm_MoveBGDelete, (process_method_func)daObjBm_MoveBGExecute, 0, (process_method_func)daObjBm_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Bemos = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Bemos = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bhashi.cpp b/src/d/actor/d_a_obj_bhashi.cpp index 00a35bc158..a64d177433 100644 --- a/src/d/actor/d_a_obj_bhashi.cpp +++ b/src/d/actor/d_a_obj_bhashi.cpp @@ -346,7 +346,7 @@ static int daObjBHASHI_Execute(daObjBHASHI_c* i_this) { return i_this->MoveBGExecute(); } -static char* l_arcName = "B_Hashi"; +static DUSK_CONST char* l_arcName = "B_Hashi"; int daObjBHASHI_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "Lv9_R07_pillar.bmd"); @@ -494,7 +494,7 @@ int daObjBHASHI_c::Delete() { return 1; } -static actor_method_class l_daObjBHASHI_Method = { +static DUSK_CONST actor_method_class l_daObjBHASHI_Method = { (process_method_func)daObjBHASHI_Create, (process_method_func)daObjBHASHI_Delete, (process_method_func)daObjBHASHI_Execute, @@ -502,7 +502,7 @@ static actor_method_class l_daObjBHASHI_Method = { (process_method_func)daObjBHASHI_Draw, }; -actor_process_profile_definition g_profile_Obj_BHASHI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BHASHI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bhbridge.cpp b/src/d/actor/d_a_obj_bhbridge.cpp index f690ff1087..e2b8237475 100644 --- a/src/d/actor/d_a_obj_bhbridge.cpp +++ b/src/d/actor/d_a_obj_bhbridge.cpp @@ -80,7 +80,7 @@ static int daObjBhbridge_Delete(daObjBhbridge_c* i_this) { return 1; } -static char* l_arcName = "BHBridge"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "BHBridge"; inline int daObjBhbridge_c::create() { fopAcM_ct(this, daObjBhbridge_c); @@ -190,7 +190,7 @@ inline int daObjBhbridge_c::Delete() { return 1; } -static actor_method_class l_daObjBhbridge_Method = { +static DUSK_CONST actor_method_class l_daObjBhbridge_Method = { (process_method_func)daObjBhbridge_Create, (process_method_func)daObjBhbridge_Delete, (process_method_func)daObjBhbridge_Execute, @@ -198,7 +198,7 @@ static actor_method_class l_daObjBhbridge_Method = { (process_method_func)daObjBhbridge_Draw, }; -actor_process_profile_definition g_profile_Obj_Bhbridge = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Bhbridge = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bk_leaf.cpp b/src/d/actor/d_a_obj_bk_leaf.cpp index 7e45e0801f..19b4f638a0 100644 --- a/src/d/actor/d_a_obj_bk_leaf.cpp +++ b/src/d/actor/d_a_obj_bk_leaf.cpp @@ -153,13 +153,13 @@ static int daBkLeaf_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBkLeaf_Method = { +static DUSK_CONST actor_method_class l_daBkLeaf_Method = { (process_method_func)daBkLeaf_Create, (process_method_func)daBkLeaf_Delete, (process_method_func)daBkLeaf_Execute, NULL, (process_method_func)daBkLeaf_Draw, }; -actor_process_profile_definition g_profile_Obj_BkLeaf = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BkLeaf = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bkdoor.cpp b/src/d/actor/d_a_obj_bkdoor.cpp index 3a4501d971..894dfc56f5 100644 --- a/src/d/actor/d_a_obj_bkdoor.cpp +++ b/src/d/actor/d_a_obj_bkdoor.cpp @@ -36,7 +36,7 @@ void daObjBkDoor_c::setBaseMtx() { mDoMtx_copy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName = "A_BkDoor"; +static DUSK_CONST char* l_arcName = "A_BkDoor"; static int const l_bmd[] = {0x04, 0x05}; static int const l_dzb[] = {0x08, 0x09}; @@ -198,13 +198,13 @@ static int daObjBkDoor_MoveBGDraw(daObjBkDoor_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjBkDoor_METHODS = { +static DUSK_CONST actor_method_class daObjBkDoor_METHODS = { (process_method_func)daObjBkDoor_create1st, (process_method_func)daObjBkDoor_MoveBGDelete, (process_method_func)daObjBkDoor_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjBkDoor_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_BkDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BkDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bky_rock.cpp b/src/d/actor/d_a_obj_bky_rock.cpp index 25869bb0b5..d88e99c24c 100644 --- a/src/d/actor/d_a_obj_bky_rock.cpp +++ b/src/d/actor/d_a_obj_bky_rock.cpp @@ -16,9 +16,9 @@ static int daBkyRock_c_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_arcName = "BYRock"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "BYRock"; -daBkyRock_c::exeProc daBkyRock_c::s_exeProc[3] = { +DUSK_GAME_DATA daBkyRock_c::exeProc daBkyRock_c::s_exeProc[3] = { &daBkyRock_c::exeModeNoDamage, &daBkyRock_c::exeModeDamage, &daBkyRock_c::exeModePiece, @@ -124,7 +124,7 @@ static u16 const SECOND_PARTICLE_NAME[6] = { 0x89C2, 0x89C3, 0x89C4, 0x89C5, 0x89C6, 0x89C7, }; -dCcD_SrcCyl const daBkyRock_c::s_CcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl const daBkyRock_c::s_CcDCyl = { { {0x0, {{0x0, 0x0, 0x0}, {0x20a0, 0x11}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -416,7 +416,7 @@ static int daBkyRock_draw(daBkyRock_c* i_this) { return i_this->draw(); } -static actor_method_class daBkyRock_METHODS = { +static DUSK_CONST actor_method_class daBkyRock_METHODS = { (process_method_func)daBkyRock_create, (process_method_func)daBkyRock_Delete, (process_method_func)daBkyRock_execute, @@ -424,7 +424,7 @@ static actor_method_class daBkyRock_METHODS = { (process_method_func)daBkyRock_draw, }; -actor_process_profile_definition g_profile_BkyRock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_BkyRock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bmWindow.cpp b/src/d/actor/d_a_obj_bmWindow.cpp index 80130e8ccb..6148004948 100644 --- a/src/d/actor/d_a_obj_bmWindow.cpp +++ b/src/d/actor/d_a_obj_bmWindow.cpp @@ -45,7 +45,7 @@ int daBmWindow_c::CreateHeap() { return mModel != NULL ? 1 : 0; } -dCcD_SrcGObjInf const daBmWindow_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daBmWindow_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0xd8fafdbf, 0x11}, {0}}}, {1, 0, 0, 0, 0}, {0xa, 0, 0, 0, 0xa6}, @@ -122,7 +122,7 @@ int daBmWindow_c::Execute(Mtx** param_1) { static daBmWindow_HIO_c l_HIO; -dCcD_SrcCyl daBmWindow_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daBmWindow_c::mCcDCyl = { daBmWindow_c::mCcDObjInfo, { { @@ -326,13 +326,13 @@ static int daBmWindow_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBmWindow_Method = { +static DUSK_CONST actor_method_class l_daBmWindow_Method = { (process_method_func)daBmWindow_Create, (process_method_func)daBmWindow_Delete, (process_method_func)daBmWindow_Execute, (process_method_func)NULL, (process_method_func)daBmWindow_Draw, }; -actor_process_profile_definition g_profile_Obj_BmWindow = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BmWindow = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bmshutter.cpp b/src/d/actor/d_a_obj_bmshutter.cpp index 3ab56169fe..e11c2e8da8 100644 --- a/src/d/actor/d_a_obj_bmshutter.cpp +++ b/src/d/actor/d_a_obj_bmshutter.cpp @@ -288,7 +288,7 @@ int daObjBmSh_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjBmSh_Method = { +static DUSK_CONST actor_method_class l_daObjBmSh_Method = { (process_method_func)daObjBmSh_Create, (process_method_func)daObjBmSh_Delete, (process_method_func)daObjBmSh_Execute, @@ -296,7 +296,7 @@ static actor_method_class l_daObjBmSh_Method = { (process_method_func)daObjBmSh_Draw, }; -actor_process_profile_definition g_profile_Obj_BoomShutter = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BoomShutter = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bombf.cpp b/src/d/actor/d_a_obj_bombf.cpp index bba146781f..cc10ae7840 100644 --- a/src/d/actor/d_a_obj_bombf.cpp +++ b/src/d/actor/d_a_obj_bombf.cpp @@ -107,13 +107,13 @@ static int daObjBombf_Draw(daObjBombf_c* i_this) { return i_this->draw(); } -static actor_method_class l_daObjBombf_Method = { +static DUSK_CONST actor_method_class l_daObjBombf_Method = { (process_method_func)daObjBombf_Create, (process_method_func)daObjBombf_Delete, (process_method_func)daObjBombf_Execute, (process_method_func)NULL, (process_method_func)daObjBombf_Draw, }; -actor_process_profile_definition g_profile_Obj_Bombf = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Bombf = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bosswarp.cpp b/src/d/actor/d_a_obj_bosswarp.cpp index b107971f8f..e286ce1640 100644 --- a/src/d/actor/d_a_obj_bosswarp.cpp +++ b/src/d/actor/d_a_obj_bosswarp.cpp @@ -14,7 +14,7 @@ #include "d/actor/d_a_obj_ystone.h" #include -static char* l_arcName = "ef_Portal"; +static DUSK_CONST char* l_arcName = "ef_Portal"; static char const* l_clearEvName[9] = { "BOSSCLEAR01", @@ -415,7 +415,7 @@ void daObjBossWarp_c::actionCancelEvent() { } int daObjBossWarp_c::demoProc() { - static char* action_table[15] = { + static DUSK_CONST char* action_table[15] = { "WAIT", "APPEAR", "DISAPPEAR", @@ -662,7 +662,7 @@ static cPhs_Step daObjBossWarp_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjBossWarp_Method = { +static DUSK_CONST actor_method_class l_daObjBossWarp_Method = { (process_method_func)daObjBossWarp_Create, (process_method_func)daObjBossWarp_Delete, (process_method_func)daObjBossWarp_Execute, @@ -670,7 +670,7 @@ static actor_method_class l_daObjBossWarp_Method = { (process_method_func)daObjBossWarp_Draw, }; -actor_process_profile_definition g_profile_Obj_BossWarp = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BossWarp = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_boumato.cpp b/src/d/actor/d_a_obj_boumato.cpp index 34677f4112..173b23fea6 100644 --- a/src/d/actor/d_a_obj_boumato.cpp +++ b/src/d/actor/d_a_obj_boumato.cpp @@ -14,7 +14,7 @@ static const char* dummyString() { return ""; } -daObj_BouMato_HIOParam const daObj_BouMato_Param_c::m = { +DUSK_GAME_DATA daObj_BouMato_HIOParam const daObj_BouMato_Param_c::m = { 0.0f, -3.0f, 1.0f, 400.0f, 300.0f, 4.0f, 20.0f, }; @@ -37,7 +37,7 @@ static dCcD_SrcCyl l_ccDCyl = { } }; -static char* l_resName = "H_BouMato"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resName = "H_BouMato"; static daArrow_c* l_findActorPtrs[100]; @@ -278,7 +278,7 @@ void daObj_BouMato_c::deleteStuckArrow() { } } -char* daObj_BouMato_c::getResName() { +char DUSK_CONST* daObj_BouMato_c::getResName() { return l_resName; } @@ -359,7 +359,7 @@ static int daObj_BouMato_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_BouMato_MethodTable = { +static DUSK_CONST actor_method_class daObj_BouMato_MethodTable = { (process_method_func)daObj_BouMato_Create, (process_method_func)daObj_BouMato_Delete, (process_method_func)daObj_BouMato_Execute, @@ -367,7 +367,7 @@ static actor_method_class daObj_BouMato_MethodTable = { (process_method_func)daObj_BouMato_Draw, }; -actor_process_profile_definition g_profile_OBJ_BOUMATO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_BOUMATO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_brakeeff.cpp b/src/d/actor/d_a_obj_brakeeff.cpp index 1b84e2a3ca..ae3032119c 100644 --- a/src/d/actor/d_a_obj_brakeeff.cpp +++ b/src/d/actor/d_a_obj_brakeeff.cpp @@ -28,7 +28,7 @@ int daObj_Brakeeff_Draw(obj_brakeeff_class* i_this) { } // Particle IDS -u16 e_name[5] = {0x00, 0x00, 0x00, 0x00, 0x00}; +DUSK_GAME_DATA u16 e_name[5] = {0x00, 0x00, 0x00, 0x00, 0x00}; void obj_brakeeff_1(obj_brakeeff_class* i_this) { fopAc_ac_c* a_this = static_cast(i_this); @@ -130,13 +130,13 @@ int daObj_Brakeeff_Delete(obj_brakeeff_class* i_this) { } // model data per effect type -u32 bef_bmd[2] = { +DUSK_GAME_DATA u32 bef_bmd[2] = { 5, 6, }; // J3DAnmTevRegKey per effect type -u32 bef_brk[2] = { +DUSK_GAME_DATA u32 bef_brk[2] = { 9, 10, }; @@ -229,13 +229,13 @@ int daObj_Brakeeff_Create(fopAc_ac_c* a_this) { return res_load_result; } -actor_method_class l_daObj_Brakeeff_Method = { +DUSK_GAME_DATA actor_method_class l_daObj_Brakeeff_Method = { (process_method_func)daObj_Brakeeff_Create, (process_method_func)daObj_Brakeeff_Delete, (process_method_func)daObj_Brakeeff_Execute, (process_method_func)daObj_Brakeeff_IsDelete, (process_method_func)daObj_Brakeeff_Draw, }; -actor_process_profile_definition g_profile_OBJ_BEF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_BEF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_brg.cpp b/src/d/actor/d_a_obj_brg.cpp index 5615a79622..74ae23aeb9 100644 --- a/src/d/actor/d_a_obj_brg.cpp +++ b/src/d/actor/d_a_obj_brg.cpp @@ -1426,7 +1426,7 @@ static void CreateInit(fopAc_ac_c* i_this) { a_this->mCcStts.Init(0xFF, 0xFF, i_this); - static dCcD_SrcCyl himo_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl himo_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1442,7 +1442,7 @@ static void CreateInit(fopAc_ac_c* i_this) { } // mCylAttr }; - static dCcD_SrcCyl wire_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl wire_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1829,7 +1829,7 @@ static int daObj_Brg_Create(fopAc_ac_c* i_this) { AUDIO_INSTANCES; -static actor_method_class l_daObj_Brg_Method = { +static DUSK_CONST actor_method_class l_daObj_Brg_Method = { (process_method_func)daObj_Brg_Create, (process_method_func)daObj_Brg_Delete, (process_method_func)daObj_Brg_Execute, @@ -1837,7 +1837,7 @@ static actor_method_class l_daObj_Brg_Method = { (process_method_func)daObj_Brg_Draw, }; -actor_process_profile_definition g_profile_OBJ_BRG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_BRG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bsGate.cpp b/src/d/actor/d_a_obj_bsGate.cpp index 694ea3c2ce..0b1a53ad33 100644 --- a/src/d/actor/d_a_obj_bsGate.cpp +++ b/src/d/actor/d_a_obj_bsGate.cpp @@ -227,7 +227,7 @@ static cPhs_Step daBsGate_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBsGate_Method = { +static DUSK_CONST actor_method_class l_daBsGate_Method = { (process_method_func)daBsGate_Create, (process_method_func)daBsGate_Delete, (process_method_func)daBsGate_Execute, @@ -235,7 +235,7 @@ static actor_method_class l_daBsGate_Method = { (process_method_func)daBsGate_Draw, }; -actor_process_profile_definition g_profile_Obj_BsGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BsGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_bubblePilar.cpp b/src/d/actor/d_a_obj_bubblePilar.cpp index a496f253c3..c1393b919e 100644 --- a/src/d/actor/d_a_obj_bubblePilar.cpp +++ b/src/d/actor/d_a_obj_bubblePilar.cpp @@ -11,14 +11,14 @@ static daBubbPilar_HIO_c l_HIO; -const dCcD_SrcGObjInf daBubbPilar_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daBubbPilar_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0x20, 0x11}, {0}}}, {dCcD_SE_NONE, 0, 1, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 2}, {0}, }; -dCcD_SrcCyl daBubbPilar_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daBubbPilar_c::mCcDCyl = { daBubbPilar_c::mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f} @@ -218,7 +218,7 @@ static int daBubbPilar_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daBubbPilar_Method = { +static DUSK_CONST actor_method_class l_daBubbPilar_Method = { (process_method_func)daBubbPilar_Create, (process_method_func)daBubbPilar_Delete, (process_method_func)daBubbPilar_Execute, @@ -226,7 +226,7 @@ static actor_method_class l_daBubbPilar_Method = { (process_method_func)daBubbPilar_Draw, }; -actor_process_profile_definition g_profile_Obj_awaPlar = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_awaPlar = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_burnbox.cpp b/src/d/actor/d_a_obj_burnbox.cpp index ebd76121f4..36fa21275e 100644 --- a/src/d/actor/d_a_obj_burnbox.cpp +++ b/src/d/actor/d_a_obj_burnbox.cpp @@ -186,13 +186,13 @@ int daObjBurnBox_MoveBGDraw(daObjBurnBox_c* i_this) { return i_this->MoveBGDraw(); } -actor_method_class daObjBurnBox_METHODS = { +DUSK_GAME_DATA actor_method_class daObjBurnBox_METHODS = { (process_method_func) daObjBurnBox_create1st, (process_method_func)daObjBurnBox_MoveBGDelete, (process_method_func) daObjBurnBox_MoveBGExecute, NULL, (process_method_func) daObjBurnBox_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_BurnBox = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_BurnBox = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_carry.cpp b/src/d/actor/d_a_obj_carry.cpp index a8265f69f6..d00b06b10a 100644 --- a/src/d/actor/d_a_obj_carry.cpp +++ b/src/d/actor/d_a_obj_carry.cpp @@ -39,7 +39,7 @@ static const cM3dGCylS l_cyl_info[] = { { 0.0f, 0.0f, 0.0f, 50.0f, 100.0f }, }; -const daObjCarry_dt_t daObjCarry_c::mData[] = { +DUSK_GAME_DATA const daObjCarry_dt_t daObjCarry_c::mData[] = { // TYPE_TSUBO { 27.0f, @@ -716,32 +716,32 @@ const static dCcD_SrcCyl l_tg_cyl = { static const GXColor l_light_color = {0xFF, 0xFF, 0xFF, 0xFF}; -static char* l_arcName[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[] = { "J_tubo_00", "J_tubo_01", "Kkiba_00", "Y_ironbal", "J_taru00", "J_doku00", "Obj_bkl", "K_tubo02", "Obj_ballS", "Obj_ballS", "D_aotubo0", "Obj_tama", "O_tuboS", "O_tuboB", }; -static char* l_bmdName[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_bmdName[] = { "J_tubo_00.bmd", "J_tubo_01.bmd", "J_hako_00.bmd", "Yironball.bmd", "J_taru_00.bmd", "J_doku_00.bmd", "K_hb00.bmd", "K_tubo02.bmd", "LV8_OBJ_HikariS.bmd", "LV8_OBJ_HikariS.bmd", "D_aotubo00.bmd", "LV8_tama.bmd", "O_tuboS_LV8.bmd", "O_tuboB_LV8.bmd", }; -static Vec kibako_jv_offset[] = { +static DUSK_CONSTEXPR Vec kibako_jv_offset[] = { {0.0f, 0.0f, 0.0f}, {0.0f, 150.0f, 0.0f}, }; -static Vec taru_jv_offset[] = { +static DUSK_CONSTEXPR Vec taru_jv_offset[] = { {0.0f, 0.0f, 0.0f}, {0.0f, 100.0f, 0.0f}, }; // box joint col data -static dJntColData_c kibako_jc_data = {1, 1, 0, 45.0f, kibako_jv_offset}; +static DUSK_CONSTEXPR dJntColData_c kibako_jc_data = {1, 1, 0, 45.0f, kibako_jv_offset}; -static dJntColData_c taru_jc_data = {1, 1, 0, 45.0f, taru_jv_offset}; +static DUSK_CONSTEXPR dJntColData_c taru_jc_data = {1, 1, 0, 45.0f, taru_jv_offset}; static f32 bound(cXyz* param_0, const cBgS_PolyInfo& param_1, f32 param_2) { cM3dGPla plane; @@ -858,11 +858,11 @@ const daObjCarry_dt_t& daObjCarry_c::data() { return mData[mType]; } -char* daObjCarry_c::getArcName() { +DUSK_CONST char* daObjCarry_c::getArcName() { return l_arcName[mType]; } -char* daObjCarry_c::getBmdName() { +DUSK_CONST char* daObjCarry_c::getBmdName() { return l_bmdName[mType]; } @@ -4300,12 +4300,12 @@ static int daObjCarry_Create(fopAc_ac_c* i_this) { return ((daObjCarry_c*)i_this)->create(); } -static actor_method_class l_daObjCarry_Method = { +static DUSK_CONST actor_method_class l_daObjCarry_Method = { (process_method_func)daObjCarry_Create, (process_method_func)daObjCarry_Delete, (process_method_func)daObjCarry_Execute, (process_method_func)NULL, (process_method_func)daObjCarry_Draw}; -actor_process_profile_definition g_profile_Obj_Carry = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Carry = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_catdoor.cpp b/src/d/actor/d_a_obj_catdoor.cpp index 1be955b6c9..21f4ed2bc9 100644 --- a/src/d/actor/d_a_obj_catdoor.cpp +++ b/src/d/actor/d_a_obj_catdoor.cpp @@ -10,7 +10,7 @@ static const char* l_arcName = "CatDoor"; -const daObjCatDoor_Attr_c daObjCatDoor_c::M_attr = { +DUSK_GAME_DATA const daObjCatDoor_Attr_c daObjCatDoor_c::M_attr = { 30, 1400, }; @@ -182,13 +182,13 @@ static int daObjCatDoor_Create(fopAc_ac_c* actor) { return i_this->create(); } -static actor_method_class l_daObjCatDoor_Method = { +static DUSK_CONST actor_method_class l_daObjCatDoor_Method = { (process_method_func)daObjCatDoor_Create, (process_method_func)daObjCatDoor_Delete, (process_method_func)daObjCatDoor_Execute, (process_method_func)daObjCatDoor_IsDelete, (process_method_func)daObjCatDoor_Draw, }; -actor_process_profile_definition g_profile_Obj_CatDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CatDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cb.cpp b/src/d/actor/d_a_obj_cb.cpp index 6dc552a3eb..8262cd7af0 100644 --- a/src/d/actor/d_a_obj_cb.cpp +++ b/src/d/actor/d_a_obj_cb.cpp @@ -225,7 +225,7 @@ static int daObj_Cb_Create(fopAc_ac_c* actor) { return rv; } -static actor_method_class l_daObj_Cb_Method = { +static DUSK_CONST actor_method_class l_daObj_Cb_Method = { (process_method_func)daObj_Cb_Create, (process_method_func)daObj_Cb_Delete, (process_method_func)daObj_Cb_Execute, @@ -233,7 +233,7 @@ static actor_method_class l_daObj_Cb_Method = { (process_method_func)daObj_Cb_Draw, }; -actor_process_profile_definition g_profile_OBJ_CB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_CB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cblock.cpp b/src/d/actor/d_a_obj_cblock.cpp index 1335e84948..42c1df44a2 100644 --- a/src/d/actor/d_a_obj_cblock.cpp +++ b/src/d/actor/d_a_obj_cblock.cpp @@ -44,12 +44,12 @@ static cXyz l_chainOffset(0.0f, 105.0f, 30.0f); static cXyz l_smokeSetOffset(0.0f, 0.0f, -200.0f); -static cull_box const l_cull_box = { +static DUSK_CONSTEXPR cull_box const l_cull_box = { {-250.0f, 0.0f, -450.0f}, {250.0f, 250.0f, 400.0f}, }; -static char* l_arcName = "P_Cblock"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Cblock"; static f32 l_side_co_offset[12] = { -255.0f, 0.0f, -30.0f, -135.0f, @@ -394,7 +394,7 @@ static const u32 dummy3[3] = { AUDIO_INSTANCES; -static actor_method_class l_daObjCBlk_Method = { +static DUSK_CONST actor_method_class l_daObjCBlk_Method = { (process_method_func)daObjCBlk_Create, (process_method_func)daObjCBlk_Delete, (process_method_func)daObjCBlk_Execute, @@ -402,7 +402,7 @@ static actor_method_class l_daObjCBlk_Method = { (process_method_func)daObjCBlk_Draw, }; -actor_process_profile_definition g_profile_Obj_ChainBlock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ChainBlock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cboard.cpp b/src/d/actor/d_a_obj_cboard.cpp index 2fb01212bc..d181b3cf04 100644 --- a/src/d/actor/d_a_obj_cboard.cpp +++ b/src/d/actor/d_a_obj_cboard.cpp @@ -20,13 +20,13 @@ void daObjBoard_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName = "Obj_Board"; +static DUSK_CONST char* l_arcName = "Obj_Board"; -static char* l_dzbName[5] = { +static DUSK_CONST char* l_dzbName[5] = { "ClearB00.dzb", "ClearB01.dzb", "ClearB02.dzb", "ClearB03.dzb", "ClearB04.dzb", }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-100.0f, -10.0f, -100.0f}, {100.0f, 10.0f, 100.0f}, }; @@ -150,13 +150,13 @@ static int daObjBoard_MoveBGDraw(daObjBoard_c* i_this) { return i_this->Draw(); } -static actor_method_class daObjBoard_METHODS = { +static DUSK_CONST actor_method_class daObjBoard_METHODS = { (process_method_func)daObjBoard_create1st, (process_method_func)daObjBoard_MoveBGDelete, (process_method_func)daObjBoard_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjBoard_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Cboard = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Cboard = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cdoor.cpp b/src/d/actor/d_a_obj_cdoor.cpp index d1f539a339..d41830c2e0 100644 --- a/src/d/actor/d_a_obj_cdoor.cpp +++ b/src/d/actor/d_a_obj_cdoor.cpp @@ -11,7 +11,7 @@ #include "d/d_com_inf_game.h" #include "f_pc/f_pc_name.h" -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "Cdoor", "J_Suimon", }; @@ -288,7 +288,7 @@ static int daObjCdoor_Draw(daObjCdoor_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class l_daObjCdoor_Method = { +static DUSK_CONST actor_method_class l_daObjCdoor_Method = { (process_method_func)daObjCdoor_Create, (process_method_func)daObjCdoor_Delete, (process_method_func)daObjCdoor_Execute, @@ -296,7 +296,7 @@ static actor_method_class l_daObjCdoor_Method = { (process_method_func)daObjCdoor_Draw, }; -actor_process_profile_definition g_profile_Obj_Cdoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Cdoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_chandelier.cpp b/src/d/actor/d_a_obj_chandelier.cpp index 46b1d5b748..27d1f7f7eb 100644 --- a/src/d/actor/d_a_obj_chandelier.cpp +++ b/src/d/actor/d_a_obj_chandelier.cpp @@ -10,9 +10,9 @@ #include "d/d_com_inf_game.h" #include "f_pc/f_pc_name.h" -static char* l_arcName = "L9Chand"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "L9Chand"; -daObjChandelier_proc daObjChandelier_c::s_exeProc[5] = { +DUSK_GAME_DATA daObjChandelier_proc daObjChandelier_c::s_exeProc[5] = { &daObjChandelier_c::exeModeWait, &daObjChandelier_c::exeModeStartSwg, &daObjChandelier_c::exeModeDown, @@ -248,7 +248,7 @@ static int daObjChandelier_MoveBGDraw(daObjChandelier_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjChandelier_METHODS = { +static DUSK_CONST actor_method_class daObjChandelier_METHODS = { (process_method_func)daObjChandelier_create1st, (process_method_func)daObjChandelier_MoveBGDelete, (process_method_func)daObjChandelier_MoveBGExecute, @@ -256,7 +256,7 @@ static actor_method_class daObjChandelier_METHODS = { (process_method_func)daObjChandelier_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Chandelier = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Chandelier = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_chest.cpp b/src/d/actor/d_a_obj_chest.cpp index 9d5d222d73..c8676c28c7 100644 --- a/src/d/actor/d_a_obj_chest.cpp +++ b/src/d/actor/d_a_obj_chest.cpp @@ -93,7 +93,7 @@ int daObjChest_c::Create() { return 1; } -static char* l_arcName = "H_Tansu"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_Tansu"; int daObjChest_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -242,13 +242,13 @@ static int daObjChest_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjChest_Method = { +static DUSK_CONST actor_method_class l_daObjChest_Method = { (process_method_func)daObjChest_Create, (process_method_func)daObjChest_Delete, (process_method_func)daObjChest_Execute, (process_method_func)NULL, (process_method_func)daObjChest_Draw, }; -actor_process_profile_definition g_profile_Obj_Chest = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Chest = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cho.cpp b/src/d/actor/d_a_obj_cho.cpp index 8fbc2dbde8..74cc2ac0a2 100644 --- a/src/d/actor/d_a_obj_cho.cpp +++ b/src/d/actor/d_a_obj_cho.cpp @@ -598,7 +598,7 @@ static int daObjCHO_IsDelete(daObjCHO_c* i_this) { return 1; } -static actor_method_class l_daObjCHO_Method = { +static DUSK_CONST actor_method_class l_daObjCHO_Method = { (process_method_func)daObjCHO_Create, (process_method_func)daObjCHO_Delete, (process_method_func)daObjCHO_Execute, @@ -606,7 +606,7 @@ static actor_method_class l_daObjCHO_Method = { (process_method_func)daObjCHO_Draw, }; -actor_process_profile_definition g_profile_Obj_Cho = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Cho = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cowdoor.cpp b/src/d/actor/d_a_obj_cowdoor.cpp index 56c644b247..5841a97fb0 100644 --- a/src/d/actor/d_a_obj_cowdoor.cpp +++ b/src/d/actor/d_a_obj_cowdoor.cpp @@ -93,13 +93,13 @@ static int daCowdoor_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daCowdoor_Method = { +static DUSK_CONST actor_method_class l_daCowdoor_Method = { (process_method_func)daCowdoor_Create, (process_method_func)daCowdoor_Delete, (process_method_func)daCowdoor_Execute, (process_method_func)NULL, (process_method_func)daCowdoor_Draw, }; -actor_process_profile_definition g_profile_Obj_Cowdoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Cowdoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crope.cpp b/src/d/actor/d_a_obj_crope.cpp index c28ee05ca3..c1143dca6c 100644 --- a/src/d/actor/d_a_obj_crope.cpp +++ b/src/d/actor/d_a_obj_crope.cpp @@ -371,7 +371,7 @@ static int daObjCrope_Draw(daObjCrope_c* i_this) { return i_this->draw(); } -static actor_method_class l_daObjCrope_Method = { +static DUSK_CONST actor_method_class l_daObjCrope_Method = { (process_method_func)daObjCrope_Create, (process_method_func)daObjCrope_Delete, (process_method_func)daObjCrope_Execute, @@ -379,7 +379,7 @@ static actor_method_class l_daObjCrope_Method = { (process_method_func)daObjCrope_Draw, }; -actor_process_profile_definition g_profile_Obj_Crope = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Crope = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crvfence.cpp b/src/d/actor/d_a_obj_crvfence.cpp index 9712205ea3..cf43df1c23 100644 --- a/src/d/actor/d_a_obj_crvfence.cpp +++ b/src/d/actor/d_a_obj_crvfence.cpp @@ -28,7 +28,7 @@ enum Action { /* 0x1 */ ACTION_BROKEN, }; -static char* l_arcName = "CrvFence"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "CrvFence"; BOOL daObjCRVFENCE_c::CheckVec() { cXyz vec(fopAcM_GetPosition((fopAc_ac_c*)daPy_getPlayerActorClass())); @@ -415,7 +415,7 @@ int daObjCRVFENCE_c::Delete() { return 1; } -static actor_method_class l_daObjCRVFENCE_Method = { +static DUSK_CONST actor_method_class l_daObjCRVFENCE_Method = { (process_method_func)daObjCRVFENCE_Create, (process_method_func)daObjCRVFENCE_Delete, (process_method_func)daObjCRVFENCE_Execute, @@ -423,7 +423,7 @@ static actor_method_class l_daObjCRVFENCE_Method = { (process_method_func)daObjCRVFENCE_Draw, }; -actor_process_profile_definition g_profile_Obj_CRVFENCE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVFENCE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crvgate.cpp b/src/d/actor/d_a_obj_crvgate.cpp index f0c24eb22b..bc78bc82c6 100644 --- a/src/d/actor/d_a_obj_crvgate.cpp +++ b/src/d/actor/d_a_obj_crvgate.cpp @@ -20,7 +20,7 @@ const static dCcD_SrcSph ccSphSrc = { } // mSphAttr }; -static char* l_arcName = "CrvGate"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "CrvGate"; namespace { static u16 s_CoCount = 0; @@ -827,13 +827,13 @@ int daObjCRVGATE_c::Delete() { return 1; } -static actor_method_class l_daObjCRVGATE_Method = { +static DUSK_CONST actor_method_class l_daObjCRVGATE_Method = { (process_method_func)daObjCRVGATE_Create, (process_method_func)daObjCRVGATE_Delete, (process_method_func)daObjCRVGATE_Execute, (process_method_func)daObjCRVGATE_IsDelete, (process_method_func)daObjCRVGATE_Draw, }; -actor_process_profile_definition g_profile_Obj_CRVGATE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVGATE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crvhahen.cpp b/src/d/actor/d_a_obj_crvhahen.cpp index 2dc91c6e6b..446dde3809 100644 --- a/src/d/actor/d_a_obj_crvhahen.cpp +++ b/src/d/actor/d_a_obj_crvhahen.cpp @@ -234,13 +234,13 @@ static int daObjCRVHAHEN_IsDelete(daObjCRVHAHEN_c* i_this) { return true; } -static actor_method_class l_daObjCRVHAHEN_Method = { +static DUSK_CONST actor_method_class l_daObjCRVHAHEN_Method = { (process_method_func)daObjCRVHAHEN_Create, (process_method_func)daObjCRVHAHEN_Delete, (process_method_func)daObjCRVHAHEN_Execute, (process_method_func)daObjCRVHAHEN_IsDelete, (process_method_func)daObjCRVHAHEN_Draw, }; -actor_process_profile_definition g_profile_Obj_CRVHAHEN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVHAHEN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crvlh_down.cpp b/src/d/actor/d_a_obj_crvlh_down.cpp index 94e9f4a0c1..4943a29091 100644 --- a/src/d/actor/d_a_obj_crvlh_down.cpp +++ b/src/d/actor/d_a_obj_crvlh_down.cpp @@ -13,7 +13,7 @@ #include "d/d_cc_uty.h" #include "d/d_s_play.h" -static char* l_arcName = "CrvLH_Dw"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "CrvLH_Dw"; void daObjCRVLH_DW_c::initCcCylinder() { const static dCcD_SrcCyl ccCylSrc = { @@ -233,13 +233,13 @@ int daObjCRVLH_DW_c::Delete() { return 1; } -static actor_method_class l_daObjCRVLH_DW_Method = { +static DUSK_CONST actor_method_class l_daObjCRVLH_DW_Method = { (process_method_func)daObjCRVLH_DW_Create, (process_method_func)daObjCRVLH_DW_Delete, (process_method_func)daObjCRVLH_DW_Execute, (process_method_func)daObjCRVLH_DW_IsDelete, (process_method_func)daObjCRVLH_DW_Draw, }; -actor_process_profile_definition g_profile_Obj_CRVLH_DW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVLH_DW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crvlh_up.cpp b/src/d/actor/d_a_obj_crvlh_up.cpp index ce796b4150..d0b5ae17eb 100644 --- a/src/d/actor/d_a_obj_crvlh_up.cpp +++ b/src/d/actor/d_a_obj_crvlh_up.cpp @@ -19,7 +19,7 @@ static int daObjCRVLH_UP_Delete(daObjCRVLH_UP_c* i_this) { return 1; } -static char* l_arcName = "CrvLH_Up"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "CrvLH_Up"; void daObjCRVLH_UP_c::HakaiSet() { fopAcM_GetPosition(daPy_getPlayerActorClass()); @@ -192,13 +192,13 @@ int daObjCRVLH_UP_c::Delete() { return 1; } -static actor_method_class l_daObjCRVLH_UP_Method = { +static DUSK_CONST actor_method_class l_daObjCRVLH_UP_Method = { (process_method_func)daObjCRVLH_UP_Create, (process_method_func)daObjCRVLH_UP_Delete, (process_method_func)daObjCRVLH_UP_Execute, (process_method_func)daObjCRVLH_UP_IsDelete, (process_method_func)daObjCRVLH_UP_Draw, }; -actor_process_profile_definition g_profile_Obj_CRVLH_UP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVLH_UP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crvsteel.cpp b/src/d/actor/d_a_obj_crvsteel.cpp index 0dc774ef12..fbe983eac0 100644 --- a/src/d/actor/d_a_obj_crvsteel.cpp +++ b/src/d/actor/d_a_obj_crvsteel.cpp @@ -72,7 +72,7 @@ static int daObjCRVSTEEL_Execute(daObjCRVSTEEL_c* i_this) { return i_this->MoveBGExecute(); } -static char* l_arcName = "CrvSteel"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "CrvSteel"; int daObjCRVSTEEL_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "U_CrvSteelGate.bmd"); @@ -140,7 +140,7 @@ int daObjCRVSTEEL_c::Delete() { return 1; } -static actor_method_class l_daObjCRVSTEEL_Method = { +static DUSK_CONST actor_method_class l_daObjCRVSTEEL_Method = { (process_method_func)daObjCRVSTEEL_Create, (process_method_func)daObjCRVSTEEL_Delete, (process_method_func)daObjCRVSTEEL_Execute, @@ -148,7 +148,7 @@ static actor_method_class l_daObjCRVSTEEL_Method = { (process_method_func)daObjCRVSTEEL_Draw, }; -actor_process_profile_definition g_profile_Obj_CRVSTEEL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_CRVSTEEL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_crystal.cpp b/src/d/actor/d_a_obj_crystal.cpp index f3d43478d1..0ca202676a 100644 --- a/src/d/actor/d_a_obj_crystal.cpp +++ b/src/d/actor/d_a_obj_crystal.cpp @@ -28,7 +28,7 @@ void daObjCrystal_c::setBaseMtx() { mpModel[1]->setBaseTRMtx(mDoMtx_stack_c::get()); } -static char* l_arcName = "H_Suisho"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_Suisho"; int daObjCrystal_c::Create() { initBaseMtx(); @@ -131,13 +131,13 @@ static int daObjCrystal_Create(daObjCrystal_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjCrystal_Method = { +static DUSK_CONST actor_method_class l_daObjCrystal_Method = { (process_method_func)daObjCrystal_Create, (process_method_func)daObjCrystal_Delete, (process_method_func)daObjCrystal_Execute, (process_method_func)NULL, (process_method_func)daObjCrystal_Draw, }; -actor_process_profile_definition g_profile_Obj_Crystal = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Crystal = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_cwall.cpp b/src/d/actor/d_a_obj_cwall.cpp index 6bf0b480a5..b02615cd7e 100644 --- a/src/d/actor/d_a_obj_cwall.cpp +++ b/src/d/actor/d_a_obj_cwall.cpp @@ -66,12 +66,12 @@ static Vec const l_check_max_wolf = { 120.0f, 0.0f, 160.0f, }; -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "P_Cwall", "P_L4Cwall", }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-300.0f, -100.0f, -650.0f}, {300.0f, 500.0f, 300.0f}, }; @@ -830,7 +830,7 @@ static int daObjCwall_MoveBGDraw(daObjCwall_c* i_this) { return i_this->Draw(); } -static actor_method_class daObjCwall_METHODS = { +static DUSK_CONST actor_method_class daObjCwall_METHODS = { (process_method_func)daObjCwall_create1st, (process_method_func)daObjCwall_MoveBGDelete, (process_method_func)daObjCwall_MoveBGExecute, @@ -838,7 +838,7 @@ static actor_method_class daObjCwall_METHODS = { (process_method_func)daObjCwall_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_ChainWall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ChainWall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_damCps.cpp b/src/d/actor/d_a_obj_damCps.cpp index 5e234a7342..7fc9599a96 100644 --- a/src/d/actor/d_a_obj_damCps.cpp +++ b/src/d/actor/d_a_obj_damCps.cpp @@ -12,7 +12,7 @@ static daObjDamCps_HIO_c l_HIO; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-20.0f, 0.0f, -20.0f}, {20.0f, 100.0f, 20.0f}, }; @@ -193,14 +193,14 @@ static int daObjDamCps_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjDamCps_Method = { +static DUSK_CONST actor_method_class l_daObjDamCps_Method = { (process_method_func)daObjDamCps_Create, (process_method_func)daObjDamCps_Delete, (process_method_func)daObjDamCps_Execute, (process_method_func)NULL, (process_method_func)daObjDamCps_Draw, }; #endif -actor_process_profile_definition g_profile_Obj_DamCps = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_DamCps = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_dan.cpp b/src/d/actor/d_a_obj_dan.cpp index cc176b9a20..fd3c3a2dae 100644 --- a/src/d/actor/d_a_obj_dan.cpp +++ b/src/d/actor/d_a_obj_dan.cpp @@ -594,7 +594,7 @@ static int daObjDAN_IsDelete(daObjDAN_c* i_this) { return 1; } -static actor_method_class l_daObjDAN_Method = { +static DUSK_CONST actor_method_class l_daObjDAN_Method = { (process_method_func)daObjDAN_Create, (process_method_func)daObjDAN_Delete, (process_method_func)daObjDAN_Execute, @@ -602,7 +602,7 @@ static actor_method_class l_daObjDAN_Method = { (process_method_func)daObjDAN_Draw, }; -actor_process_profile_definition g_profile_Obj_Dan = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Dan = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_digholl.cpp b/src/d/actor/d_a_obj_digholl.cpp index b9bfcdca8a..518d745ba3 100644 --- a/src/d/actor/d_a_obj_digholl.cpp +++ b/src/d/actor/d_a_obj_digholl.cpp @@ -95,13 +95,13 @@ static int daObjDigholl_Draw(daObjDigholl_c* i_this) { return i_this->draw(); } -static actor_method_class l_daObjDigholl_Method = { +static DUSK_CONST actor_method_class l_daObjDigholl_Method = { (process_method_func)daObjDigholl_Create, (process_method_func)daObjDigholl_Delete, (process_method_func)daObjDigholl_Execute, (process_method_func)NULL, (process_method_func)daObjDigholl_Draw, }; -actor_process_profile_definition g_profile_Obj_Digholl = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Digholl = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_digplace.cpp b/src/d/actor/d_a_obj_digplace.cpp index 16fa438012..157df4f8a2 100644 --- a/src/d/actor/d_a_obj_digplace.cpp +++ b/src/d/actor/d_a_obj_digplace.cpp @@ -169,13 +169,13 @@ static int daObjDigpl_Draw(daObjDigpl_c* i_this) { return 1; } -static actor_method_class l_daObjDigpl_Method = { +static DUSK_CONST actor_method_class l_daObjDigpl_Method = { (process_method_func)daObjDigpl_Create, (process_method_func)daObjDigpl_Delete, (process_method_func)daObjDigpl_Execute, (process_method_func)NULL, (process_method_func)daObjDigpl_Draw, }; -actor_process_profile_definition g_profile_Obj_Digpl = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Digpl = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_digsnow.cpp b/src/d/actor/d_a_obj_digsnow.cpp index 6da13dd5c9..70092131db 100644 --- a/src/d/actor/d_a_obj_digsnow.cpp +++ b/src/d/actor/d_a_obj_digsnow.cpp @@ -34,7 +34,7 @@ int daObjDigSnow_c::Create() { return TRUE; } -static char* l_arcName = "Y_horiyuk"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Y_horiyuk"; int daObjDigSnow_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -173,13 +173,13 @@ static int daObjDigSnow_MoveBGDraw(daObjDigSnow_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjDigSnow_METHODS = { +static DUSK_CONST actor_method_class daObjDigSnow_METHODS = { (process_method_func)daObjDigSnow_create1st, (process_method_func)daObjDigSnow_MoveBGDelete, (process_method_func)daObjDigSnow_MoveBGExecute, NULL, (process_method_func)daObjDigSnow_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_DigSnow = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_DigSnow = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_dmelevator.cpp b/src/d/actor/d_a_obj_dmelevator.cpp index 58f863203c..836631530a 100644 --- a/src/d/actor/d_a_obj_dmelevator.cpp +++ b/src/d/actor/d_a_obj_dmelevator.cpp @@ -529,7 +529,7 @@ void daObjDmElevator_c::actionDead() { } int daObjDmElevator_c::demoProc() { - static char* action_table[2] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[2] = { "WAIT", "MOVE", }; @@ -673,7 +673,7 @@ static int daObjDmElevator_MoveBGDraw(daObjDmElevator_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjDmElevator_METHODS = { +static DUSK_CONST actor_method_class daObjDmElevator_METHODS = { (process_method_func)daObjDmElevator_create1st, (process_method_func)daObjDmElevator_MoveBGDelete, (process_method_func)daObjDmElevator_MoveBGExecute, @@ -681,7 +681,7 @@ static actor_method_class daObjDmElevator_METHODS = { (process_method_func)daObjDmElevator_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Elevator = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Elevator = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_drop.cpp b/src/d/actor/d_a_obj_drop.cpp index 62f3bf9f17..453ecf32f7 100644 --- a/src/d/actor/d_a_obj_drop.cpp +++ b/src/d/actor/d_a_obj_drop.cpp @@ -630,7 +630,7 @@ static int daObjDrop_Create(fopAc_ac_c* i_this) { return ((daObjDrop_c*)i_this)->create(); } -static actor_method_class l_daObjDrop_Method = { +static DUSK_CONST actor_method_class l_daObjDrop_Method = { (process_method_func)daObjDrop_Create, (process_method_func)daObjDrop_Delete, (process_method_func)daObjDrop_Execute, @@ -638,7 +638,7 @@ static actor_method_class l_daObjDrop_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Obj_Drop = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Drop = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_dust.cpp b/src/d/actor/d_a_obj_dust.cpp index bd851109fd..a2eb45f29e 100644 --- a/src/d/actor/d_a_obj_dust.cpp +++ b/src/d/actor/d_a_obj_dust.cpp @@ -243,7 +243,7 @@ int daObjDust_c::Delete() { return 1; } -static actor_method_class l_daObjDust_Method = { +static DUSK_CONST actor_method_class l_daObjDust_Method = { (process_method_func)daObjDust_Create, (process_method_func)daObjDust_Delete, (process_method_func)daObjDust_Execute, @@ -252,7 +252,7 @@ static actor_method_class l_daObjDust_Method = { }; -actor_process_profile_definition g_profile_Obj_DUST = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_DUST = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_eff.cpp b/src/d/actor/d_a_obj_eff.cpp index 21c34b7eb2..343fa0ec75 100644 --- a/src/d/actor/d_a_obj_eff.cpp +++ b/src/d/actor/d_a_obj_eff.cpp @@ -47,7 +47,7 @@ int Mthd_IsDelete(void* i_this) { namespace daObjEff { namespace { -static actor_method_class Mthd_Table = { +static DUSK_CONST actor_method_class Mthd_Table = { (process_method_func)Mthd_Create, (process_method_func)Mthd_Delete, (process_method_func)Mthd_Execute, (process_method_func)Mthd_IsDelete, (process_method_func)Mthd_Draw, @@ -55,7 +55,7 @@ static actor_method_class Mthd_Table = { }; }; // namespace daObjEff -actor_process_profile_definition g_profile_Obj_Eff = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Eff = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_enemy_create.cpp b/src/d/actor/d_a_obj_enemy_create.cpp index c5ff0c52e7..13fcfd26c2 100644 --- a/src/d/actor/d_a_obj_enemy_create.cpp +++ b/src/d/actor/d_a_obj_enemy_create.cpp @@ -247,13 +247,13 @@ static int daObjE_CREATE_IsDelete(daObjE_CREATE_c* i_this) { return 1; } -static actor_method_class l_daObjE_CREATE_Method = { +static DUSK_CONST actor_method_class l_daObjE_CREATE_Method = { (process_method_func)daObjE_CREATE_Create, (process_method_func)daObjE_CREATE_Delete, (process_method_func)daObjE_CREATE_Execute, (process_method_func)daObjE_CREATE_IsDelete, (process_method_func)daObjE_CREATE_Draw, }; -actor_process_profile_definition g_profile_Obj_E_CREATE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_E_CREATE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fallobj.cpp b/src/d/actor/d_a_obj_fallobj.cpp index e310a7925f..d95581d52f 100644 --- a/src/d/actor/d_a_obj_fallobj.cpp +++ b/src/d/actor/d_a_obj_fallobj.cpp @@ -13,9 +13,9 @@ #include "d/d_s_play.h" -static char* l_arcName = "K_drock00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "K_drock00"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-200.0f, -10000.0f, -200.0f}, {200.0f, 600.0f, 200.0f}, }; @@ -440,7 +440,7 @@ static int daObjFallObj_MoveBGDraw(daObjFallObj_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjFallObj_METHODS = { +static DUSK_CONST actor_method_class daObjFallObj_METHODS = { (process_method_func)daObjFallObj_create1st, (process_method_func)daObjFallObj_MoveBGDelete, (process_method_func)daObjFallObj_MoveBGExecute, @@ -448,7 +448,7 @@ static actor_method_class daObjFallObj_METHODS = { (process_method_func)daObjFallObj_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_FallObj = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_FallObj = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fan.cpp b/src/d/actor/d_a_obj_fan.cpp index dfe413c5b9..ae2f9f746c 100644 --- a/src/d/actor/d_a_obj_fan.cpp +++ b/src/d/actor/d_a_obj_fan.cpp @@ -111,7 +111,7 @@ int daObjFan_c::Create() { return 1; } -static char* l_arcName[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[3] = { "Obj_prop1", "Obj_prop0", "Obj_prop2", @@ -327,7 +327,7 @@ static int daObjFan_MoveBGDraw(daObjFan_c* param_0) { return param_0->MoveBGDraw(); } -static actor_method_class daObjFan_METHODS = { +static DUSK_CONST actor_method_class daObjFan_METHODS = { (process_method_func)daObjFan_create1st, (process_method_func)daObjFan_MoveBGDelete, (process_method_func)daObjFan_MoveBGExecute, @@ -335,7 +335,7 @@ static actor_method_class daObjFan_METHODS = { (process_method_func)daObjFan_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Fan = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Fan = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fchain.cpp b/src/d/actor/d_a_obj_fchain.cpp index 024b4ecf8b..b4d473c424 100644 --- a/src/d/actor/d_a_obj_fchain.cpp +++ b/src/d/actor/d_a_obj_fchain.cpp @@ -325,7 +325,7 @@ int daObjFchain_c::draw() { dComIfGd_getOpaListDark()->entryImm(&mShape, 0); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (mChainInterpCurrValid) { memcpy(mChainInterpPrev, mChainInterpCurr, sizeof(mChainInterpCurr)); mChainInterpPrevValid = true; @@ -344,7 +344,7 @@ static int daObjFchain_Draw(daObjFchain_c* i_this) { return static_cast(i_this)->draw(); } -static actor_method_class l_daObjFchain_Method = { +static DUSK_CONST actor_method_class l_daObjFchain_Method = { (process_method_func)daObjFchain_Create, (process_method_func)daObjFchain_Delete, (process_method_func)daObjFchain_Execute, @@ -352,7 +352,7 @@ static actor_method_class l_daObjFchain_Method = { (process_method_func)daObjFchain_Draw, }; -actor_process_profile_definition g_profile_Obj_Fchain = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Fchain = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fireWood.cpp b/src/d/actor/d_a_obj_fireWood.cpp index dd314ed908..b73a526b40 100644 --- a/src/d/actor/d_a_obj_fireWood.cpp +++ b/src/d/actor/d_a_obj_fireWood.cpp @@ -21,7 +21,7 @@ void daFireWood_c::setBaseMtx() { static daFireWood_HIO_c l_HIO; -dCcD_SrcCyl daFireWood_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daFireWood_c::mCcDCyl = { daFireWood_c::mCcDObjInfo, { { @@ -32,14 +32,14 @@ dCcD_SrcCyl daFireWood_c::mCcDCyl = { } }; -const dCcD_SrcGObjInf daFireWood_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daFireWood_c::mCcDObjInfo = { {0, {{AT_TYPE_LANTERN_SWING, 0, 0x13}, {0xD8FBFFFF, 0x1F}, {0x0}}}, {dCcD_SE_SWORD, 0, 0, dCcD_MTRL_NONE, 0}, {dCcD_SE_STONE, 0, 0, dCcD_MTRL_NONE, 0}, {0}, }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-50.0f, 0.0f, -50.0f}, {50.0f, 100.0f, 50.0f}, }; @@ -184,13 +184,13 @@ static int daFireWood_Create(fopAc_ac_c* i_this) { } -static actor_method_class l_daFireWood_Method = { +static DUSK_CONST actor_method_class l_daFireWood_Method = { (process_method_func)daFireWood_Create, (process_method_func)daFireWood_Delete, (process_method_func)daFireWood_Execute, (process_method_func)NULL, (process_method_func)daFireWood_Draw, }; -actor_process_profile_definition g_profile_Obj_FireWood = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_FireWood = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fireWood2.cpp b/src/d/actor/d_a_obj_fireWood2.cpp index 1bcc04777b..69ee25f6d1 100644 --- a/src/d/actor/d_a_obj_fireWood2.cpp +++ b/src/d/actor/d_a_obj_fireWood2.cpp @@ -21,14 +21,14 @@ void daFireWood2_c::setBaseMtx() { static daFireWood2_HIO_c l_HIO; -const dCcD_SrcGObjInf daFireWood2_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daFireWood2_c::mCcDObjInfo = { {0, {{AT_TYPE_LANTERN_SWING, 0, 0x13}, {0xD8FBFFFF, 0x1F}, {0x79}}}, {dCcD_SE_SWORD, 0, 0, dCcD_MTRL_NONE, 0}, {dCcD_SE_STONE, 0, 0, dCcD_MTRL_NONE, 0}, {0}, }; -dCcD_SrcCyl daFireWood2_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daFireWood2_c::mCcDCyl = { daFireWood2_c::mCcDObjInfo, { { @@ -39,7 +39,7 @@ dCcD_SrcCyl daFireWood2_c::mCcDCyl = { } }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-50.0f, 0.0f, -50.0f}, {50.0f, 100.0f, 50.0f}, }; @@ -268,13 +268,13 @@ static int daFireWood2_Create(fopAc_ac_c* i_this) { return ((daFireWood2_c*)i_this)->create(); } -static actor_method_class l_daFireWood2_Method = { +static DUSK_CONST actor_method_class l_daFireWood2_Method = { (process_method_func)daFireWood2_Create, (process_method_func)daFireWood2_Delete, (process_method_func)daFireWood2_Execute, (process_method_func)NULL, (process_method_func)daFireWood2_Draw, }; -actor_process_profile_definition g_profile_Obj_FireWood2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_FireWood2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_firepillar.cpp b/src/d/actor/d_a_obj_firepillar.cpp index 986762a1fe..a63b6a23ed 100644 --- a/src/d/actor/d_a_obj_firepillar.cpp +++ b/src/d/actor/d_a_obj_firepillar.cpp @@ -20,7 +20,7 @@ void daObjFPillar_c::setBaseMtx() { mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z); } -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-30.0f, -10.0f, -30.0f}, {30.0f, 60.0f, 30.0f}, }; @@ -213,7 +213,7 @@ static int daObjFPillar_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjFPillar_Method = { +static DUSK_CONST actor_method_class l_daObjFPillar_Method = { (process_method_func)daObjFPillar_Create, (process_method_func)daObjFPillar_Delete, (process_method_func)daObjFPillar_Execute, @@ -221,7 +221,7 @@ static actor_method_class l_daObjFPillar_Method = { (process_method_func)daObjFPillar_Draw, }; -actor_process_profile_definition g_profile_Obj_FirePillar = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_FirePillar = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_firepillar2.cpp b/src/d/actor/d_a_obj_firepillar2.cpp index 150f3fc4eb..149f701e3b 100644 --- a/src/d/actor/d_a_obj_firepillar2.cpp +++ b/src/d/actor/d_a_obj_firepillar2.cpp @@ -38,9 +38,9 @@ void daObjFPillar2_c::setBaseMtx() { } } -static char* l_arcName = "Obj_yogan"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_yogan"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-150.0f, -10.0f, -150.0f}, {150.0f, 1200.0f, 150.0f}, }; @@ -495,7 +495,7 @@ static int daObjFPillar2_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjFPillar2_Method = { +static DUSK_CONST actor_method_class l_daObjFPillar2_Method = { (process_method_func)daObjFPillar2_Create, (process_method_func)daObjFPillar2_Delete, (process_method_func)daObjFPillar2_Execute, @@ -503,7 +503,7 @@ static actor_method_class l_daObjFPillar2_Method = { (process_method_func)daObjFPillar2_Draw, }; -actor_process_profile_definition g_profile_Obj_FirePillar2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_FirePillar2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_flag.cpp b/src/d/actor/d_a_obj_flag.cpp index b3f55ff1d2..5edd11ff88 100644 --- a/src/d/actor/d_a_obj_flag.cpp +++ b/src/d/actor/d_a_obj_flag.cpp @@ -7,7 +7,7 @@ #include "d/actor/d_a_obj_flag.h" -daObjFlag_c::M_attrs const daObjFlag_c::M_attr = { +DUSK_GAME_DATA daObjFlag_c::M_attrs const daObjFlag_c::M_attr = { 4000.0f, 1.0f, 0.3f, 15, 2000, 1500, 4000, 1800, 0, 0, 1000, 400, @@ -192,7 +192,7 @@ inline int daObjFlag_c::createHeap() { tmp = true; char resName[12]; - sprintf(resName, "flag%02d.bmd", angle); + SAFE_SPRINTF(resName, "flag%02d.bmd", angle); shape_angle.setall(0); current.angle.setall(0); @@ -297,7 +297,7 @@ static int daObjFlag_Create(fopAc_ac_c* param_0) { FlagJoint_c::FlagJoint_c() {} -static actor_method_class l_daObjFlag_Method = { +static DUSK_CONST actor_method_class l_daObjFlag_Method = { (process_method_func)daObjFlag_Create, (process_method_func)daObjFlag_Delete, (process_method_func)daObjFlag_Execute, @@ -305,7 +305,7 @@ static actor_method_class l_daObjFlag_Method = { (process_method_func)daObjFlag_Draw, }; -actor_process_profile_definition g_profile_Obj_Flag = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Flag = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_flag2.cpp b/src/d/actor/d_a_obj_flag2.cpp index 4741f4d5a3..a22e1216d8 100644 --- a/src/d/actor/d_a_obj_flag2.cpp +++ b/src/d/actor/d_a_obj_flag2.cpp @@ -51,7 +51,7 @@ public: daObjFlag2_Hio_c M_hio; #endif -daObjFlag2_Attr_c const daObjFlag2_c::M_attr = { +DUSK_GAME_DATA daObjFlag2_Attr_c const daObjFlag2_c::M_attr = { -2.0f, 0.74f, 0.68f, 40.0f, 100.0f, }; @@ -261,6 +261,7 @@ void FlagCloth_c::execute() { } void FlagCloth_c::draw() { + ZoneScoped; j3dSys.reinitGX(); GXSetNumIndStages(0); dKy_setLight_again(); @@ -370,7 +371,7 @@ int daObjFlag2_c::createHeap() { s8 flagNum = (u8)shape_angle.x; if (mFlagValid) { char acStack_40[16]; - sprintf(acStack_40, "flag%02d.bti", flagNum); + SAFE_SPRINTF(acStack_40, "flag%02d.bti", flagNum); shape_angle.setall(0); current.angle.setall(0); ResTIMG* image = (ResTIMG*)dComIfG_getObjectRes(mFlagName, "flag.bti"); @@ -409,7 +410,7 @@ int daObjFlag2_c::create() { mFlagValid = false; } else { mFlagValid = true; - sprintf(mFlagName, "FlagObj%02d", flagNum); + SAFE_SPRINTF(mFlagName, "FlagObj%02d", flagNum); int rv = dComIfG_resLoad(&mFlagPhase, mFlagName); if (rv != cPhs_COMPLEATE_e) { return rv; @@ -498,7 +499,7 @@ static int daObjFlag2_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjFlag2_Method = { +static DUSK_CONST actor_method_class l_daObjFlag2_Method = { (process_method_func)daObjFlag2_Create, (process_method_func)daObjFlag2_Delete, (process_method_func)daObjFlag2_Execute, @@ -506,7 +507,7 @@ static actor_method_class l_daObjFlag2_Method = { (process_method_func)daObjFlag2_Draw, }; -actor_process_profile_definition g_profile_Obj_Flag2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Flag2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_flag3.cpp b/src/d/actor/d_a_obj_flag3.cpp index fc696db1ab..d053c045b9 100644 --- a/src/d/actor/d_a_obj_flag3.cpp +++ b/src/d/actor/d_a_obj_flag3.cpp @@ -49,7 +49,7 @@ public: daObjFlag3_Hio_c M_hio; #endif -daObjFlag3_Attr_c const daObjFlag3_c::M_attr = { +DUSK_GAME_DATA daObjFlag3_Attr_c const daObjFlag3_c::M_attr = { -2.0f, 0.6f, 0.68f, 40.0f, 100.0f, }; @@ -220,6 +220,7 @@ void FlagCloth2_c::initCcSphere(fopAc_ac_c*) { } inline void FlagCloth2_c::draw() { + ZoneScoped; j3dSys.reinitGX(); GXSetNumIndStages(0); dKy_setLight_again(); @@ -299,7 +300,7 @@ int daObjFlag3_c::createHeap() { s8 flagNum = (u8)shape_angle.x; if (mFlagValid) { char acStack_40[16]; - sprintf(acStack_40, "flag%02d.bti", flagNum); + SAFE_SPRINTF(acStack_40, "flag%02d.bti", flagNum); shape_angle.setall(0); current.angle.setall(0); ResTIMG* image = (ResTIMG*)dComIfG_getObjectRes(mFlagName, "flag.bti"); @@ -486,7 +487,7 @@ int daObjFlag3_c::create() { mFlagValid = false; } else { mFlagValid = true; - sprintf(mFlagName, "FlagObj%02d", flagNum); + SAFE_SPRINTF(mFlagName, "FlagObj%02d", flagNum); int rv = dComIfG_resLoad(&mFlagPhase, mFlagName); if (rv != cPhs_COMPLEATE_e) { return rv; @@ -503,7 +504,7 @@ int daObjFlag3_c::create() { return rv; } -static actor_method_class l_daObjFlag3_Method = { +static DUSK_CONST actor_method_class l_daObjFlag3_Method = { (process_method_func)daObjFlag3_Create, (process_method_func)daObjFlag3_Delete, (process_method_func)daObjFlag3_Execute, @@ -511,7 +512,7 @@ static actor_method_class l_daObjFlag3_Method = { (process_method_func)daObjFlag3_Draw, }; -actor_process_profile_definition g_profile_Obj_Flag3 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Flag3 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fmobj.cpp b/src/d/actor/d_a_obj_fmobj.cpp index 3b0f3b9ecc..2bd9551164 100644 --- a/src/d/actor/d_a_obj_fmobj.cpp +++ b/src/d/actor/d_a_obj_fmobj.cpp @@ -112,13 +112,13 @@ static int daObj_Fmobj_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daObj_Fmobj_Method = { +static DUSK_CONST actor_method_class l_daObj_Fmobj_Method = { (process_method_func)daObj_Fmobj_Create, (process_method_func)daObj_Fmobj_Delete, (process_method_func)daObj_Fmobj_Execute, (process_method_func)daObj_Fmobj_IsDelete, (process_method_func)daObj_Fmobj_Draw, }; -actor_process_profile_definition g_profile_OBJ_FMOBJ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_FMOBJ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_food.cpp b/src/d/actor/d_a_obj_food.cpp index bbc9ac14b6..777198868f 100644 --- a/src/d/actor/d_a_obj_food.cpp +++ b/src/d/actor/d_a_obj_food.cpp @@ -493,7 +493,7 @@ static cPhs_Step daObj_Food_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daObj_Food_Method = { +static DUSK_CONST actor_method_class l_daObj_Food_Method = { (process_method_func)daObj_Food_Create, (process_method_func)daObj_Food_Delete, (process_method_func)daObj_Food_Execute, @@ -501,7 +501,7 @@ static actor_method_class l_daObj_Food_Method = { (process_method_func)daObj_Food_Draw, }; -actor_process_profile_definition g_profile_OBJ_FOOD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_FOOD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_fw.cpp b/src/d/actor/d_a_obj_fw.cpp index 9ea82fe945..046a4b4144 100644 --- a/src/d/actor/d_a_obj_fw.cpp +++ b/src/d/actor/d_a_obj_fw.cpp @@ -297,7 +297,7 @@ static cPhs_Step daObj_Fw_Create(fopAc_ac_c* a_this) { return phase; } -static actor_method_class l_daObj_Fw_Method = { +static DUSK_CONST actor_method_class l_daObj_Fw_Method = { (process_method_func)daObj_Fw_Create, (process_method_func)daObj_Fw_Delete, (process_method_func)daObj_Fw_Execute, @@ -305,7 +305,7 @@ static actor_method_class l_daObj_Fw_Method = { (process_method_func)daObj_Fw_Draw, }; -actor_process_profile_definition g_profile_OBJ_FW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_FW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gadget.cpp b/src/d/actor/d_a_obj_gadget.cpp index 1a7c4fed05..cd401c9654 100644 --- a/src/d/actor/d_a_obj_gadget.cpp +++ b/src/d/actor/d_a_obj_gadget.cpp @@ -35,7 +35,7 @@ public: #endif -daObj_Gadget_HIOParam const daObj_Gadget_Param_c::m = { +DUSK_GAME_DATA daObj_Gadget_HIOParam const daObj_Gadget_Param_c::m = { 0.0f, -4.0f, 1.0f, 100.0f, 37.0f, 26.0f, 13.0f, 14.0f, 37.0f, 50.0f, 18.0f, }; @@ -52,7 +52,7 @@ static u32 l_bmdData[2][2] = { 35, 1, 34, 1, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "ykM1", }; @@ -601,7 +601,7 @@ static int daObj_Gadget_IsDelete(void* i_this) { AUDIO_INSTANCES -static actor_method_class daObj_Gadget_MethodTable = { +static DUSK_CONST actor_method_class daObj_Gadget_MethodTable = { (process_method_func)daObj_Gadget_Create, (process_method_func)daObj_Gadget_Delete, (process_method_func)daObj_Gadget_Execute, @@ -609,7 +609,7 @@ static actor_method_class daObj_Gadget_MethodTable = { (process_method_func)daObj_Gadget_Draw, }; -actor_process_profile_definition g_profile_OBJ_GADGET = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_GADGET = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ganonwall.cpp b/src/d/actor/d_a_obj_ganonwall.cpp index f395713d33..a1ed94b2c2 100644 --- a/src/d/actor/d_a_obj_ganonwall.cpp +++ b/src/d/actor/d_a_obj_ganonwall.cpp @@ -32,9 +32,9 @@ static const GXColor l_color[24] = { {0xFF, 0xFF, 0xFF, 0xFF}, {0xFF, 0xFF, 0xFF, 0xFF}, {0xB4, 0xB4, 0xB4, 0xFF}, }; -static char* l_arcName = "Y_gwall"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Y_gwall"; -static char* l_matName = "mat00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_matName = "mat00"; static int CheckCreateHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->CreateHeap(); @@ -180,7 +180,7 @@ static int daObjGWall_Create(daObjGWall_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjGWall_Method = { +static DUSK_CONST actor_method_class l_daObjGWall_Method = { (process_method_func)daObjGWall_Create, (process_method_func)daObjGWall_Delete, (process_method_func)daObjGWall_Execute, @@ -188,7 +188,7 @@ static actor_method_class l_daObjGWall_Method = { (process_method_func)daObjGWall_Draw, }; -actor_process_profile_definition g_profile_Obj_GanonWall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GanonWall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ganonwall2.cpp b/src/d/actor/d_a_obj_ganonwall2.cpp index 187210687f..6f461dc11f 100644 --- a/src/d/actor/d_a_obj_ganonwall2.cpp +++ b/src/d/actor/d_a_obj_ganonwall2.cpp @@ -27,9 +27,9 @@ static const GXColor l_color[24] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, 0xB4, 0xB4, 0xFF, }; -static char* l_arcName = "V_CTGWall"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_CTGWall"; -static char* l_matName = "mat00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_matName = "mat00"; void daObjGWall2_c::initBaseMtx() { mpModel->setBaseScale(scale); @@ -166,7 +166,7 @@ static int daObjGWall2_MoveBGDraw(daObjGWall2_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjGWall2_METHODS = { +static DUSK_CONST actor_method_class daObjGWall2_METHODS = { (process_method_func)daObjGWall2_create1st, (process_method_func)daObjGWall2_MoveBGDelete, (process_method_func)daObjGWall2_MoveBGExecute, @@ -174,7 +174,7 @@ static actor_method_class daObjGWall2_METHODS = { (process_method_func)daObjGWall2_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_GanonWall2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GanonWall2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gb.cpp b/src/d/actor/d_a_obj_gb.cpp index 2cf002cd65..a610dfd5fb 100644 --- a/src/d/actor/d_a_obj_gb.cpp +++ b/src/d/actor/d_a_obj_gb.cpp @@ -229,7 +229,7 @@ static int daObj_Gb_Create(fopAc_ac_c* actor) { return rv; } -static actor_method_class l_daObj_Gb_Method = { +static DUSK_CONST actor_method_class l_daObj_Gb_Method = { (process_method_func)daObj_Gb_Create, (process_method_func)daObj_Gb_Delete, (process_method_func)daObj_Gb_Execute, @@ -237,7 +237,7 @@ static actor_method_class l_daObj_Gb_Method = { (process_method_func)daObj_Gb_Draw, }; -actor_process_profile_definition g_profile_OBJ_GB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_GB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_geyser.cpp b/src/d/actor/d_a_obj_geyser.cpp index 0f34360a33..819f20d29b 100644 --- a/src/d/actor/d_a_obj_geyser.cpp +++ b/src/d/actor/d_a_obj_geyser.cpp @@ -19,9 +19,9 @@ void daObjGeyser_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mMtx); } -static char* l_arcName = "H_knktsn"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_knktsn"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-100.0f, -10.0f, -100.0f}, {100.0f, 550.0f, 100.0f}, }; @@ -681,7 +681,7 @@ static int daObjGeyser_MoveBGDraw(daObjGeyser_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjGeyser_METHODS = { +static DUSK_CONST actor_method_class daObjGeyser_METHODS = { (process_method_func)daObjGeyser_create1st, (process_method_func)daObjGeyser_MoveBGDelete, (process_method_func)daObjGeyser_MoveBGExecute, @@ -689,7 +689,7 @@ static actor_method_class daObjGeyser_METHODS = { (process_method_func)daObjGeyser_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Geyser = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Geyser = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_glowSphere.cpp b/src/d/actor/d_a_obj_glowSphere.cpp index b60a1c9aa0..4f668fd53d 100644 --- a/src/d/actor/d_a_obj_glowSphere.cpp +++ b/src/d/actor/d_a_obj_glowSphere.cpp @@ -17,19 +17,19 @@ daGlwSph_HIO_c::daGlwSph_HIO_c() { static daGlwSph_HIO_c l_HIO; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-30.0f, -10.0f, -30.0f}, {30.0f, 60.0f, 30.0f} }; -const dCcD_SrcGObjInf daGlwSph_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daGlwSph_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0x10000, 0x11}, {0x19}}}, {dCcD_SE_SWORD, 0, 0, 0, 0x0}, {dCcD_SE_STONE, 0, 0, 0, 0x2}, {0}, }; -dCcD_SrcSph daGlwSph_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daGlwSph_c::mCcDSph = { daGlwSph_c::mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph @@ -45,7 +45,7 @@ static GXColor l_envColor[] = { /* Blue */ {0x00, 0x32, 0xFF, 0xFF}, }; -_GlSph_Mng_c daGlwSph_c::mSphMng; +DUSK_GAME_DATA _GlSph_Mng_c daGlwSph_c::mSphMng; _GlSph_Mng_c& daGlwSph_c::getSphMng() { return mSphMng; @@ -415,9 +415,9 @@ BOOL _GlSph_Mng_c::_chkAllGet_main() { return TRUE; } -u16 _GlSph_Mng_c::mSphSe; +DUSK_GAME_DATA u16 _GlSph_Mng_c::mSphSe; -s16 _GlSph_Mng_c::mSeClrTmr; +DUSK_GAME_DATA s16 _GlSph_Mng_c::mSeClrTmr; void _GlSph_Mng_c::SphSeProc() { if (mSeClrTmr > 0) { @@ -456,13 +456,13 @@ void _GlSph_Mng_c::incSphSe() { } } -static actor_method_class l_daGlwSph_Method = { +static DUSK_CONST actor_method_class l_daGlwSph_Method = { (process_method_func)daGlwSph_Create, (process_method_func)daGlwSph_Delete, (process_method_func)daGlwSph_Execute, (process_method_func)NULL, (process_method_func)daGlwSph_Draw, }; -actor_process_profile_definition g_profile_Obj_glowSphere = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_glowSphere = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gm.cpp b/src/d/actor/d_a_obj_gm.cpp index 89419b1e49..a86b0045c5 100644 --- a/src/d/actor/d_a_obj_gm.cpp +++ b/src/d/actor/d_a_obj_gm.cpp @@ -719,7 +719,7 @@ static cPhs_Step daObj_Gm_Create(fopAc_ac_c* a_this) { return phase; } -static actor_method_class l_daObj_Gm_Method = { +static DUSK_CONST actor_method_class l_daObj_Gm_Method = { (process_method_func)daObj_Gm_Create, (process_method_func)daObj_Gm_Delete, (process_method_func)daObj_Gm_Execute, @@ -727,7 +727,7 @@ static actor_method_class l_daObj_Gm_Method = { (process_method_func)daObj_Gm_Draw, }; -actor_process_profile_definition g_profile_OBJ_GM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_GM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_goGate.cpp b/src/d/actor/d_a_obj_goGate.cpp index fc0fef5ba5..a83b5b8584 100644 --- a/src/d/actor/d_a_obj_goGate.cpp +++ b/src/d/actor/d_a_obj_goGate.cpp @@ -170,13 +170,13 @@ static int daGoGate_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daGoGate_Method = { +static DUSK_CONST actor_method_class l_daGoGate_Method = { (process_method_func)daGoGate_Create, (process_method_func)daGoGate_Delete, (process_method_func)daGoGate_Execute, (process_method_func)NULL, (process_method_func)daGoGate_Draw, }; -actor_process_profile_definition g_profile_Obj_GoGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GoGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gomikabe.cpp b/src/d/actor/d_a_obj_gomikabe.cpp index 66963f0efd..b5e05fe386 100644 --- a/src/d/actor/d_a_obj_gomikabe.cpp +++ b/src/d/actor/d_a_obj_gomikabe.cpp @@ -12,7 +12,7 @@ #include "d/d_com_inf_game.h" #include "m_Do/m_Do_lib.h" -static char* l_arcName = "GomiKabe"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "GomiKabe"; daObjGOMIKABE_HIO_c::daObjGOMIKABE_HIO_c() { mId = -1; @@ -385,7 +385,7 @@ int daObjGOMIKABE_c::Delete() { return 1; } -static actor_method_class l_daObjGOMIKABE_Method = { +static DUSK_CONST actor_method_class l_daObjGOMIKABE_Method = { (process_method_func)daObjGOMIKABE_Create, (process_method_func)daObjGOMIKABE_Delete, (process_method_func)daObjGOMIKABE_Execute, @@ -393,7 +393,7 @@ static actor_method_class l_daObjGOMIKABE_Method = { (process_method_func)daObjGOMIKABE_Draw, }; -actor_process_profile_definition g_profile_Obj_GOMIKABE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GOMIKABE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gpTaru.cpp b/src/d/actor/d_a_obj_gpTaru.cpp index 74b0f8cfdf..08185aebbe 100644 --- a/src/d/actor/d_a_obj_gpTaru.cpp +++ b/src/d/actor/d_a_obj_gpTaru.cpp @@ -59,7 +59,7 @@ int daGpTaru_c::CreateHeap() { return 1; } -dCcD_SrcCyl daGpTaru_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daGpTaru_c::mCcDCyl = { daGpTaru_c::mCcDObjInfo, { { @@ -70,7 +70,7 @@ dCcD_SrcCyl daGpTaru_c::mCcDCyl = { } // mCylAttr }; -const dCcD_SrcGObjInf daGpTaru_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daGpTaru_c::mCcDObjInfo = { {0, {{0, 0, 0x1F}, {0xD8FAFDBF, 0x11}, {0x79}}}, {dCcD_SE_NONE, 0, 1, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 2}, @@ -581,7 +581,7 @@ static int daGpTaru_Create(fopAc_ac_c* i_this) { return ((daGpTaru_c*)i_this)->create(); } -static actor_method_class l_daGpTaru_Method = { +static DUSK_CONST actor_method_class l_daGpTaru_Method = { (process_method_func)daGpTaru_Create, (process_method_func)daGpTaru_Delete, (process_method_func)daGpTaru_Execute, @@ -589,7 +589,7 @@ static actor_method_class l_daGpTaru_Method = { (process_method_func)daGpTaru_Draw, }; -actor_process_profile_definition g_profile_Obj_GpTaru = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GpTaru = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gra2.cpp b/src/d/actor/d_a_obj_gra2.cpp index 550b680e06..a5fa226ee7 100644 --- a/src/d/actor/d_a_obj_gra2.cpp +++ b/src/d/actor/d_a_obj_gra2.cpp @@ -5,13 +5,14 @@ #include "d/dolzel_rel.h" // IWYU pragma: keep -#include "d/actor/d_a_obj_gra2.h" #include "d/actor/d_a_npc4.h" +#include "d/actor/d_a_obj_gra2.h" #include "d/actor/d_a_tag_gra.h" #include "d/d_bg_w.h" #include "d/d_cc_uty.h" -#include "d/d_com_inf_game.h" #include "d/d_com_inf_actor.h" +#include "d/d_com_inf_game.h" +#include "helpers/string.hpp" #if DEBUG #include "d/d_debug_viewer.h" #endif @@ -24,7 +25,7 @@ class daObj_GrA_Param_c { public: virtual ~daObj_GrA_Param_c() {} - static const daObj_GrA_HIO_Param_c m; + static DUSK_GAME_DATA const daObj_GrA_HIO_Param_c m; }; #if DEBUG @@ -124,33 +125,33 @@ public: }; #endif -static char* l_resFileNameList[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resFileNameList[4] = { "grA", "grA", "grA", "grA", }; -static int l_exLoadRes_GRAa[4] = { +static DUSK_CONSTEXPR int l_exLoadRes_GRAa[4] = { 1, 2, -1, -1, }; -static int l_exLoadRes_GRA_jump[4] = { +static DUSK_CONSTEXPR int l_exLoadRes_GRA_jump[4] = { 1, 2, 4, -1, }; -static int l_exLoadRes_GRA_demo[4] = { +static DUSK_CONSTEXPR int l_exLoadRes_GRA_demo[4] = { 1, 2, 3, -1, }; -static int* l_exloadRes_list[4] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_exloadRes_list[4] = { l_exLoadRes_GRAa, l_exLoadRes_GRA_jump, l_exLoadRes_GRAa, l_exLoadRes_GRA_demo, }; -static char* l_resNames[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[5] = { "grA", "grA_base", "grA_mdl", @@ -158,11 +159,11 @@ static char* l_resNames[5] = { "grA_Look", }; -static int l_bmdGetParamList[2] = { +static DUSK_CONSTEXPR int l_bmdGetParamList[2] = { 3, 2, }; -static int l_bckGetParamList[35][2] = { +static DUSK_CONSTEXPR int l_bckGetParamList[35][2] = { {21, 1}, {18, 0}, {22, 1}, {11, 0}, {18, 1}, {19, 1}, @@ -183,27 +184,27 @@ static int l_bckGetParamList[35][2] = { {9, 0}, }; -static int l_btpGetParamList[4][2] = { +static DUSK_CONSTEXPR int l_btpGetParamList[4][2] = { {28, 1}, {32, 1}, {31, 1}, {21, 0}, }; -static u16 l_eventMotionChangeTable[11] = { +static DUSK_CONSTEXPR u16 l_eventMotionChangeTable[11] = { 0, 1, 0, 2, 3, 0, 0, 0, 0, 0, 0, }; -static u16 l_eventFaceChangeTable[4] = { +static DUSK_CONSTEXPR u16 l_eventFaceChangeTable[4] = { 1, 2, 6, 7, }; -static char* l_evtNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evtNameList[2] = { NULL, "GRA_THROWN", }; -static u16 l_entryJntNoList[4] = { +static DUSK_CONSTEXPR u16 l_entryJntNoList[4] = { 5, 6, 7, 0xFFFF, }; @@ -307,7 +308,7 @@ cPhs_Step daObj_GrA_c::create() { return phase; } -daObj_GrA_HIO_Param_c const daObj_GrA_Param_c::m = { +DUSK_GAME_DATA daObj_GrA_HIO_Param_c const daObj_GrA_Param_c::m = { 85.0f, -4.0f, 1.0f, @@ -364,7 +365,7 @@ daObj_GrA_HIO_Param_c const daObj_GrA_Param_c::m = { 30.0f, }; -static const f32 l_bgcParam[20] = { +static DUSK_CONSTEXPR const f32 l_bgcParam[20] = { 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 1.0f, -0.5f, 1.0f, 0.5f, -1.0f, -0.5f, 1.0f, @@ -539,7 +540,7 @@ const char* daObj_GrA_c::getResName() { u8 daObj_GrA_c::getMode() { u32 uVar1 = fopAcM_GetParam(this) >> 28 & 3; - strcpy(field_0x744, "Obj_grA"); + SAFE_STRCPY(field_0x744, "Obj_grA"); switch (uVar1) { case 1: @@ -654,7 +655,7 @@ void daObj_GrA_c::restart() { field_0x209c = 0; } -static cXyz l_centerOfst(0.0f, 67.0f, 26.0f); +static DUSK_CONSTEXPR cXyz l_centerOfst(0.0f, 67.0f, 26.0f); static OBJ_GRA_HIO_CLASS l_HIO; @@ -1047,7 +1048,7 @@ void daObj_GrA_c::adjustShapeAngle() { } void daObj_GrA_c::setMtx(int param_1) { - static cXyz aTrembleTrans[15] = { + static DUSK_CONSTEXPR cXyz aTrembleTrans[15] = { cXyz(0.0f, 0.0f, 0.0f), cXyz(1.154554f, -0.052719f, 1.018953f), cXyz(0.722208f, -0.14003f, 1.333208f), @@ -1148,7 +1149,7 @@ void daObj_GrA_c::setCollisions() { field_0xf50.OnTgNoConHit(); } - static cXyz aOfst(0.0f, 0.0f, 20.0f); + static DUSK_CONSTEXPR cXyz aOfst(0.0f, 0.0f, 20.0f); mDoMtx_stack_c::transS(current.pos); mDoMtx_stack_c::YrotM(field_0x91a.y); @@ -1197,7 +1198,7 @@ void daObj_GrA_c::setCollisions() { void daObj_GrA_c::setAttnPos() { lookat(); - static cXyz aEyeOfst(15.0f, 25.0f, 0.0f); + static DUSK_CONSTEXPR cXyz aEyeOfst(15.0f, 25.0f, 0.0f); cXyz sp18; mDoMtx_stack_c::copy(mpModelMorf->getModel()->getAnmMtx(4)); @@ -2082,7 +2083,7 @@ static int daObj_GrA_IsDelete(void* i_this) { AUDIO_INSTANCES; -daObj_GrA_c::MotionFunc daObj_GrA_c::mBaseMotionList[22] = { +DUSK_GAME_DATA daObj_GrA_c::MotionFunc daObj_GrA_c::mBaseMotionList[22] = { &daObj_GrA_c::base000, &daObj_GrA_c::base001, &daObj_GrA_c::base003, @@ -2107,7 +2108,7 @@ daObj_GrA_c::MotionFunc daObj_GrA_c::mBaseMotionList[22] = { &daObj_GrA_c::base026, }; -daObj_GrA_c::MotionFunc daObj_GrA_c::mFaceMotionList[14] = { +DUSK_GAME_DATA daObj_GrA_c::MotionFunc daObj_GrA_c::mFaceMotionList[14] = { &daObj_GrA_c::face000, &daObj_GrA_c::face003, &daObj_GrA_c::face004, @@ -2124,7 +2125,7 @@ daObj_GrA_c::MotionFunc daObj_GrA_c::mFaceMotionList[14] = { &daObj_GrA_c::face999, }; -static actor_method_class daObj_GrA_MethodTable = { +static DUSK_CONST actor_method_class daObj_GrA_MethodTable = { (process_method_func)daObj_GrA_Create, (process_method_func)daObj_GrA_Delete, (process_method_func)daObj_GrA_Execute, @@ -2132,7 +2133,7 @@ static actor_method_class daObj_GrA_MethodTable = { (process_method_func)daObj_GrA_Draw, }; -actor_process_profile_definition g_profile_OBJ_GRA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_GRA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_graWall.cpp b/src/d/actor/d_a_obj_graWall.cpp index 3bff2a8ae2..bf4d749b97 100644 --- a/src/d/actor/d_a_obj_graWall.cpp +++ b/src/d/actor/d_a_obj_graWall.cpp @@ -95,7 +95,7 @@ static int daObjGraWall_create(fopAc_ac_c* i_this) { return static_cast(i_this)->Create(); } -static actor_method_class l_daObjGraWall_Method = { +static DUSK_CONST actor_method_class l_daObjGraWall_Method = { (process_method_func)daObjGraWall_create, (process_method_func)daObjGraWall_Delete, (process_method_func)daObjGraWall_Execute, @@ -103,7 +103,7 @@ static actor_method_class l_daObjGraWall_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_GRA_WALL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_GRA_WALL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_gra_rock.cpp b/src/d/actor/d_a_obj_gra_rock.cpp index e2b1a06f06..045d2fcc0e 100644 --- a/src/d/actor/d_a_obj_gra_rock.cpp +++ b/src/d/actor/d_a_obj_gra_rock.cpp @@ -16,7 +16,7 @@ static void dummy() { cLib_calcTimer(0); } -dCcD_SrcCyl const daObjGraRock_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl const daObjGraRock_c::mCcDCyl = { { {0x0, {{0x0, 0x0, 0x0}, {0x2020, 0x11}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -171,7 +171,7 @@ int daObjGraRock_c::Create() { return 1; } -static char* l_arcName[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[5] = { "M_VBom", "grA_base", "grA_mdl", @@ -298,7 +298,7 @@ static int daObjGraRock_create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjGraRock_Method = { +static DUSK_CONST actor_method_class l_daObjGraRock_Method = { (process_method_func)daObjGraRock_create, (process_method_func)daObjGraRock_Delete, (process_method_func)daObjGraRock_Execute, @@ -306,7 +306,7 @@ static actor_method_class l_daObjGraRock_Method = { (process_method_func)daObjGraRock_Draw, }; -actor_process_profile_definition g_profile_Obj_GraRock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GraRock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_grave_stone.cpp b/src/d/actor/d_a_obj_grave_stone.cpp index 771635d589..7902e5361b 100644 --- a/src/d/actor/d_a_obj_grave_stone.cpp +++ b/src/d/actor/d_a_obj_grave_stone.cpp @@ -12,14 +12,14 @@ static char const* l_arcName = "H_Haka"; -dCcD_SrcGObjInf const daGraveStone_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daGraveStone_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0, 0}, {0x79}}}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0}, }; -dCcD_SrcCyl const daGraveStone_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl const daGraveStone_c::mCcDCyl = { { {0, {{0, 0, 0}, {0, 0}, {0x79}}}, {0, 0, 0, 0, 0}, @@ -215,7 +215,7 @@ static cPhs_Step daGraveStone_create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daGraveStone_Method = { +static DUSK_CONST actor_method_class l_daGraveStone_Method = { (process_method_func)daGraveStone_create, (process_method_func)daGraveStone_Delete, (process_method_func)daGraveStone_Execute, @@ -223,7 +223,7 @@ static actor_method_class l_daGraveStone_Method = { (process_method_func)daGraveStone_Draw, }; -actor_process_profile_definition g_profile_Obj_GraveStone = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GraveStone = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_groundwater.cpp b/src/d/actor/d_a_obj_groundwater.cpp index 2d3d05a36c..59f310678d 100644 --- a/src/d/actor/d_a_obj_groundwater.cpp +++ b/src/d/actor/d_a_obj_groundwater.cpp @@ -335,7 +335,7 @@ static int daGrdWater_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daGrdWater_Method = { +static DUSK_CONST actor_method_class l_daGrdWater_Method = { (process_method_func)daGrdWater_Create, (process_method_func)daGrdWater_Delete, (process_method_func)daGrdWater_Execute, @@ -343,7 +343,7 @@ static actor_method_class l_daGrdWater_Method = { (process_method_func)daGrdWater_Draw, }; -actor_process_profile_definition g_profile_GRDWATER = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_GRDWATER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_grz_rock.cpp b/src/d/actor/d_a_obj_grz_rock.cpp index 772f7a8cff..ac4441d585 100644 --- a/src/d/actor/d_a_obj_grz_rock.cpp +++ b/src/d/actor/d_a_obj_grz_rock.cpp @@ -49,7 +49,7 @@ int daObjGrzRock_c::Create() { return 1; } -static char* l_arcName = "grZRock"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "grZRock"; int daObjGrzRock_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -153,7 +153,7 @@ static int daObjGrzRock_create(fopAc_ac_c* a_this) { return static_cast(a_this)->create(); } -static actor_method_class l_daObjGrzRock_Method = { +static DUSK_CONST actor_method_class l_daObjGrzRock_Method = { (process_method_func)daObjGrzRock_create, (process_method_func)daObjGrzRock_Delete, (process_method_func)daObjGrzRock_Execute, @@ -161,7 +161,7 @@ static actor_method_class l_daObjGrzRock_Method = { (process_method_func)daObjGrzRock_Draw, }; -actor_process_profile_definition g_profile_Obj_GrzRock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_GrzRock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_h_saku.cpp b/src/d/actor/d_a_obj_h_saku.cpp index 1349e377ea..737a212bbc 100644 --- a/src/d/actor/d_a_obj_h_saku.cpp +++ b/src/d/actor/d_a_obj_h_saku.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_obj_h_saku.h" #include "Z2AudioLib/Z2Instances.h" -static char* l_arcName = "H_Saku"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_Saku"; void daObjH_Saku_c::BreakSet() { cXyz pos(240.0f, 0.0f, -30.0f); @@ -294,7 +294,7 @@ static cXyz s_pos_r; AUDIO_INSTANCES; -static actor_method_class l_daObjH_Saku_Method = { +static DUSK_CONST actor_method_class l_daObjH_Saku_Method = { (process_method_func)daObjH_Saku_Create, (process_method_func)daObjH_Saku_Delete, (process_method_func)daObjH_Saku_Execute, @@ -302,7 +302,7 @@ static actor_method_class l_daObjH_Saku_Method = { (process_method_func)daObjH_Saku_Draw, }; -actor_process_profile_definition g_profile_Obj_H_Saku = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_H_Saku = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hakai_brl.cpp b/src/d/actor/d_a_obj_hakai_brl.cpp index ea157e4822..c4ac094354 100644 --- a/src/d/actor/d_a_obj_hakai_brl.cpp +++ b/src/d/actor/d_a_obj_hakai_brl.cpp @@ -12,7 +12,7 @@ static int daObjHBarrel_c_createHeap(fopAc_ac_c* i_this) { return ((daObjHBarrel_c*)i_this)->createHeap(); } -static char* l_arcName = "HBarrel"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "HBarrel"; daObjHBarrel_c::daObjHBarrel_c() {} @@ -82,7 +82,7 @@ int daObjHBarrel_c::execute() { return 1; } -dCcD_SrcCyl const daObjHBarrel_c::s_CcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl const daObjHBarrel_c::s_CcDCyl = { { {0x0, {{0x0, 0x0, 0xd}, {0xd8fafdff, 0x11}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -189,7 +189,7 @@ static int daObjHBarrel_draw(daObjHBarrel_c* param_0) { return param_0->draw(); } -static actor_method_class daObjHBarrel_METHODS = { +static DUSK_CONST actor_method_class daObjHBarrel_METHODS = { (process_method_func)daObjHBarrel_create, (process_method_func)daObjHBarrel_Delete, (process_method_func)daObjHBarrel_execute, @@ -197,7 +197,7 @@ static actor_method_class daObjHBarrel_METHODS = { (process_method_func)daObjHBarrel_draw, }; -actor_process_profile_definition g_profile_Obj_HBarrel = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_HBarrel = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hakai_ftr.cpp b/src/d/actor/d_a_obj_hakai_ftr.cpp index c2696234e5..0f03a00934 100644 --- a/src/d/actor/d_a_obj_hakai_ftr.cpp +++ b/src/d/actor/d_a_obj_hakai_ftr.cpp @@ -99,7 +99,7 @@ int daObjHFtr_c::draw() { return 1; } -dCcD_SrcCyl const daObjHFtr_c::s_CcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl const daObjHFtr_c::s_CcDCyl = { { {0x0, {{0x0, 0x0, 0x0}, {0x400020, 0x11}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -201,13 +201,13 @@ static int daObjHFtr_draw(daObjHFtr_c* param_0) { return param_0->draw(); } -static actor_method_class daObjHFtr_METHODS = { +static DUSK_CONST actor_method_class daObjHFtr_METHODS = { (process_method_func)daObjHFtr_create, (process_method_func)daObjHFtr_Delete, (process_method_func)daObjHFtr_execute, 0, (process_method_func)daObjHFtr_draw, }; -actor_process_profile_definition g_profile_Obj_HFtr = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_HFtr = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hasu2.cpp b/src/d/actor/d_a_obj_hasu2.cpp index 139dfc9bf6..f10f5a7dab 100644 --- a/src/d/actor/d_a_obj_hasu2.cpp +++ b/src/d/actor/d_a_obj_hasu2.cpp @@ -24,7 +24,7 @@ static const cull_box l_cull_box = { {133.0f, 29.0f, 127.0f} }; -static char* l_arcName = "M_Hasu"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_Hasu"; nObjMHasu::daObjMHasu_c::daObjMHasu_c() : mConst1(25.5f), @@ -176,7 +176,7 @@ static int daObjMHasu_MoveBGDraw(nObjMHasu::daObjMHasu_c* i_this) { return i_this->MoveBGDraw(); } -actor_method_class daObjMHasu_METHODS = { +DUSK_GAME_DATA actor_method_class daObjMHasu_METHODS = { (process_method_func)&daObjMHasu_create1st, (process_method_func)&daObjMHasu_MoveBGDelete, (process_method_func)&daObjMHasu_MoveBGExecute, @@ -184,7 +184,7 @@ actor_method_class daObjMHasu_METHODS = { (process_method_func)&daObjMHasu_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_MHasu = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MHasu = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hata.cpp b/src/d/actor/d_a_obj_hata.cpp index fd4d30cbca..f4a675b156 100644 --- a/src/d/actor/d_a_obj_hata.cpp +++ b/src/d/actor/d_a_obj_hata.cpp @@ -33,7 +33,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) { return 1; } -static char* l_arcName = "Hata"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Hata"; daObjHata_c::daObjHata_c() {} @@ -172,7 +172,7 @@ static int daObjHata_draw(daObjHata_c* i_this) { return i_this->draw(); } -static actor_method_class daObjHata_METHODS = { +static DUSK_CONST actor_method_class daObjHata_METHODS = { (process_method_func)daObjHata_create, (process_method_func)daObjHata_Delete, (process_method_func)daObjHata_execute, @@ -180,7 +180,7 @@ static actor_method_class daObjHata_METHODS = { (process_method_func)daObjHata_draw, }; -actor_process_profile_definition g_profile_Obj_Hata = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Hata = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hb.cpp b/src/d/actor/d_a_obj_hb.cpp index 76fee9ab7b..1162804e09 100644 --- a/src/d/actor/d_a_obj_hb.cpp +++ b/src/d/actor/d_a_obj_hb.cpp @@ -710,7 +710,7 @@ static cPhs_Step daOBJ_HB_Create(fopAc_ac_c* a_this) { return phase; } -static actor_method_class l_daOBJ_HB_Method = { +static DUSK_CONST actor_method_class l_daOBJ_HB_Method = { (process_method_func)daOBJ_HB_Create, (process_method_func)daOBJ_HB_Delete, (process_method_func)daOBJ_HB_Execute, @@ -718,7 +718,7 @@ static actor_method_class l_daOBJ_HB_Method = { (process_method_func)daOBJ_HB_Draw, }; -actor_process_profile_definition g_profile_OBJ_HB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_HB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hbombkoya.cpp b/src/d/actor/d_a_obj_hbombkoya.cpp index 22868d08cf..eaf67ff995 100644 --- a/src/d/actor/d_a_obj_hbombkoya.cpp +++ b/src/d/actor/d_a_obj_hbombkoya.cpp @@ -9,7 +9,7 @@ #include "d/d_com_inf_game.h" #include "d/d_bg_w.h" -static char* l_arcName = "H_Bombkoy"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_Bombkoy"; int daObjHBombkoya_c::create1st() { if (fopAcM_isSwitch(this, getSw2No())) { @@ -264,7 +264,7 @@ static int daObjHBombkoya_MoveBGDraw(daObjHBombkoya_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjHBombkoya_METHODS = { +static DUSK_CONST actor_method_class daObjHBombkoya_METHODS = { (process_method_func)daObjHBombkoya_create1st, (process_method_func)daObjHBombkoya_MoveBGDelete, (process_method_func)daObjHBombkoya_MoveBGExecute, @@ -272,7 +272,7 @@ static actor_method_class daObjHBombkoya_METHODS = { (process_method_func)daObjHBombkoya_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_HBombkoya = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_HBombkoya = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_heavySw.cpp b/src/d/actor/d_a_obj_heavySw.cpp index bcfe282ed5..e8a8a60cfe 100644 --- a/src/d/actor/d_a_obj_heavySw.cpp +++ b/src/d/actor/d_a_obj_heavySw.cpp @@ -283,13 +283,13 @@ static int daHeavySw_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daHeavySw_Method = { +static DUSK_CONST actor_method_class l_daHeavySw_Method = { (process_method_func)daHeavySw_Create, (process_method_func)daHeavySw_Delete, (process_method_func)daHeavySw_Execute, (process_method_func)NULL, (process_method_func)daHeavySw_Draw, }; -actor_process_profile_definition g_profile_Obj_HeavySw = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_HeavySw = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hfuta.cpp b/src/d/actor/d_a_obj_hfuta.cpp index d79a74459a..6701112c3d 100644 --- a/src/d/actor/d_a_obj_hfuta.cpp +++ b/src/d/actor/d_a_obj_hfuta.cpp @@ -40,7 +40,7 @@ int daObjFuta_c::Create() { return 1; } -static char* l_arcName = "Obj_hfuta"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_hfuta"; int daObjFuta_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -188,7 +188,7 @@ static int daObjFuta_MoveBGDraw(daObjFuta_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjFuta_METHODS = { +static DUSK_CONST actor_method_class daObjFuta_METHODS = { (process_method_func)daObjFuta_create1st, (process_method_func)daObjFuta_MoveBGDelete, (process_method_func)daObjFuta_MoveBGExecute, @@ -196,7 +196,7 @@ static actor_method_class daObjFuta_METHODS = { (process_method_func)daObjFuta_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Hfuta = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Hfuta = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hhashi.cpp b/src/d/actor/d_a_obj_hhashi.cpp index d5ab5558b0..59e87383c5 100644 --- a/src/d/actor/d_a_obj_hhashi.cpp +++ b/src/d/actor/d_a_obj_hhashi.cpp @@ -272,7 +272,7 @@ static int daObjHHASHI_Execute(daObjHHASHI_c* i_this) { return i_this->MoveBGExecute(); } -static char* l_arcName = "L_hhashi"; +static DUSK_CONST char* l_arcName = "L_hhashi"; int daObjHHASHI_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "L_hhashi00.bmd"); @@ -373,7 +373,7 @@ int daObjHHASHI_c::Delete() { return 1; } -static actor_method_class l_daObjHHASHI_Method = { +static DUSK_CONST actor_method_class l_daObjHHASHI_Method = { (process_method_func)daObjHHASHI_Create, (process_method_func)daObjHHASHI_Delete, (process_method_func)daObjHHASHI_Execute, @@ -381,7 +381,7 @@ static actor_method_class l_daObjHHASHI_Method = { (process_method_func)daObjHHASHI_Draw, }; -actor_process_profile_definition g_profile_Obj_HHASHI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_HHASHI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_hsTarget.cpp b/src/d/actor/d_a_obj_hsTarget.cpp index ba686bbc34..9c622f3c11 100644 --- a/src/d/actor/d_a_obj_hsTarget.cpp +++ b/src/d/actor/d_a_obj_hsTarget.cpp @@ -88,13 +88,13 @@ static int daHsTarget_Create(fopAc_ac_c* i_this) { static daHsTarget_HIO_c l_HIO; -static actor_method_class l_daHsTarget_Method = { +static DUSK_CONST actor_method_class l_daHsTarget_Method = { (process_method_func)daHsTarget_Create, (process_method_func)daHsTarget_Delete, (process_method_func)daHsTarget_Execute, (process_method_func)NULL, (process_method_func)daHsTarget_Draw, }; -actor_process_profile_definition g_profile_Obj_HsTarget = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_HsTarget = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ice_l.cpp b/src/d/actor/d_a_obj_ice_l.cpp index 1c7dbc917e..f4eec3bc36 100644 --- a/src/d/actor/d_a_obj_ice_l.cpp +++ b/src/d/actor/d_a_obj_ice_l.cpp @@ -127,7 +127,7 @@ static int daObjIce_l_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static char* l_arcName = "V_Ice_l"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_Ice_l"; int daObjIce_l_c::create() { fopAcM_ct(this, daObjIce_l_c); @@ -247,7 +247,7 @@ int daObjIce_l_c::Delete() { return 1; } -static actor_method_class l_daObjIce_l_Method = { +static DUSK_CONST actor_method_class l_daObjIce_l_Method = { (process_method_func)daObjIce_l_Create, (process_method_func)daObjIce_l_Delete, (process_method_func)daObjIce_l_Execute, @@ -255,7 +255,7 @@ static actor_method_class l_daObjIce_l_Method = { (process_method_func)daObjIce_l_Draw, }; -actor_process_profile_definition g_profile_Obj_Ice_l = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ice_l = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ice_s.cpp b/src/d/actor/d_a_obj_ice_s.cpp index 7387bea34f..77802532ff 100644 --- a/src/d/actor/d_a_obj_ice_s.cpp +++ b/src/d/actor/d_a_obj_ice_s.cpp @@ -26,7 +26,7 @@ public: /* 0xC */ f32 mSinkingAmount; }; -static char* l_arcName = "V_Ice_s"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_Ice_s"; daOBJ_ICE_S_HIO_c::daOBJ_ICE_S_HIO_c() { mId = -1; @@ -292,7 +292,7 @@ int daObjIce_s_c::Delete() { } -static actor_method_class l_daObjIce_s_Method = { +static DUSK_CONST actor_method_class l_daObjIce_s_Method = { (process_method_func)daObjIce_s_Create, (process_method_func)daObjIce_s_Delete, (process_method_func)daObjIce_s_Execute, @@ -300,7 +300,7 @@ static actor_method_class l_daObjIce_s_Method = { (process_method_func)daObjIce_s_Draw, }; -actor_process_profile_definition g_profile_Obj_Ice_s = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ice_s = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_iceblock.cpp b/src/d/actor/d_a_obj_iceblock.cpp index 81a72b85e7..e796d19559 100644 --- a/src/d/actor/d_a_obj_iceblock.cpp +++ b/src/d/actor/d_a_obj_iceblock.cpp @@ -199,7 +199,7 @@ void daObjIceBlk_c::disablePushPull() { } } -static char* l_arcName = "Y_icecube"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Y_icecube"; int daObjIceBlk_c::Create() { mpPath = dPath_GetRoomPath(getPathId(), fopAcM_GetRoomNo(this)); @@ -830,13 +830,13 @@ static int daObjIceBlk_MoveBGDraw(daObjIceBlk_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjIceBlk_METHODS = { +static DUSK_CONST actor_method_class daObjIceBlk_METHODS = { (process_method_func)daObjIceBlk_create1st, (process_method_func)daObjIceBlk_MoveBGDelete, (process_method_func)daObjIceBlk_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjIceBlk_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_IceBlock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_IceBlock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_iceleaf.cpp b/src/d/actor/d_a_obj_iceleaf.cpp index f4dbfac98a..afccb22e84 100644 --- a/src/d/actor/d_a_obj_iceleaf.cpp +++ b/src/d/actor/d_a_obj_iceleaf.cpp @@ -20,7 +20,7 @@ void daObjIceLeaf_c::initBaseMtx() { setBaseMtx(); } -static char* l_arcName = "V_IceLeaf"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_IceLeaf"; void daObjIceLeaf_c::setBaseMtx() { if (mRide) { @@ -405,13 +405,13 @@ static int daObjIceLeaf_Create(daObjIceLeaf_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjIceLeaf_Method = { +static DUSK_CONST actor_method_class l_daObjIceLeaf_Method = { (process_method_func)daObjIceLeaf_Create, (process_method_func)daObjIceLeaf_Delete, (process_method_func)daObjIceLeaf_Execute, (process_method_func)NULL, (process_method_func)daObjIceLeaf_Draw, }; -actor_process_profile_definition g_profile_Obj_IceLeaf = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_IceLeaf = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ihasi.cpp b/src/d/actor/d_a_obj_ihasi.cpp index 0a647bbb12..1ad0c570a4 100644 --- a/src/d/actor/d_a_obj_ihasi.cpp +++ b/src/d/actor/d_a_obj_ihasi.cpp @@ -216,13 +216,13 @@ static int daObj_Ihasi_Create(fopAc_ac_c* i_actor) { return step; } -static actor_method_class l_daObj_Ihasi_Method = { +static DUSK_CONST actor_method_class l_daObj_Ihasi_Method = { (process_method_func)daObj_Ihasi_Create, (process_method_func)daObj_Ihasi_Delete, (process_method_func)daObj_Ihasi_Execute, (process_method_func)daObj_Ihasi_IsDelete, (process_method_func)daObj_Ihasi_Draw, }; -actor_process_profile_definition g_profile_OBJ_IHASI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_IHASI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ikada.cpp b/src/d/actor/d_a_obj_ikada.cpp index eb94d61272..dae2d8a1d6 100644 --- a/src/d/actor/d_a_obj_ikada.cpp +++ b/src/d/actor/d_a_obj_ikada.cpp @@ -85,7 +85,7 @@ static int daObjIkada_Delete(daObjIkada_c* i_this) { return 1; } -static char* l_arcName = "M_Ikada"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_Ikada"; int daObjIkada_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "M_Ikada.bmd"); @@ -196,7 +196,7 @@ int daObjIkada_c::Delete() { return 1; } -static actor_method_class l_daObjIkada_Method = { +static DUSK_CONST actor_method_class l_daObjIkada_Method = { (process_method_func)daObjIkada_Create, (process_method_func)daObjIkada_Delete, (process_method_func)daObjIkada_Execute, @@ -204,7 +204,7 @@ static actor_method_class l_daObjIkada_Method = { (process_method_func)daObjIkada_Draw, }; -actor_process_profile_definition g_profile_Obj_Ikada = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ikada = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_inobone.cpp b/src/d/actor/d_a_obj_inobone.cpp index 2076405828..6425f65a4c 100644 --- a/src/d/actor/d_a_obj_inobone.cpp +++ b/src/d/actor/d_a_obj_inobone.cpp @@ -277,7 +277,7 @@ static int daObjIBone_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjIBone_Method = { +static DUSK_CONST actor_method_class l_daObjIBone_Method = { (process_method_func)daObjIBone_Create, (process_method_func)daObjIBone_Delete, (process_method_func)daObjIBone_Execute, @@ -285,7 +285,7 @@ static actor_method_class l_daObjIBone_Method = { (process_method_func)daObjIBone_Draw, }; -actor_process_profile_definition g_profile_Obj_InoBone = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_InoBone = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ita.cpp b/src/d/actor/d_a_obj_ita.cpp index 31e696eee4..e2f83334de 100644 --- a/src/d/actor/d_a_obj_ita.cpp +++ b/src/d/actor/d_a_obj_ita.cpp @@ -43,7 +43,7 @@ void daObj_ITA_HIO_c::genMessage(JORMContext* ctx) { } #endif -static char* l_arcName = "M_Ita"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_Ita"; static f32 dummy() { return 0.0f; @@ -288,7 +288,7 @@ int daObjIta_c::Delete() { return 1; } -static actor_method_class l_daObjIta_Method = { +static DUSK_CONST actor_method_class l_daObjIta_Method = { (process_method_func)daObjIta_Create, (process_method_func)daObjIta_Delete, (process_method_func)daObjIta_Execute, @@ -296,7 +296,7 @@ static actor_method_class l_daObjIta_Method = { (process_method_func)daObjIta_Draw, }; -actor_process_profile_definition g_profile_Obj_ITA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ITA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_itamato.cpp b/src/d/actor/d_a_obj_itamato.cpp index 0538d7c783..dd795e362b 100644 --- a/src/d/actor/d_a_obj_itamato.cpp +++ b/src/d/actor/d_a_obj_itamato.cpp @@ -11,7 +11,7 @@ #include "JSystem/JHostIO/JORFile.h" #include -daObj_ItaMato_HIOParam const daObj_ItaMato_Param_c::m = { +DUSK_GAME_DATA daObj_ItaMato_HIOParam const daObj_ItaMato_Param_c::m = { 110.0f, -3.0f, 1.0f, @@ -81,7 +81,7 @@ static dCcD_SrcSph l_ccDSph = { static OBJ_ITAMATO_HIO_CLASS l_HIO; -static char* l_resName = "H_ItaMato"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resName = "H_ItaMato"; daObj_ItaMato_c::~daObj_ItaMato_c() { OS_REPORT("|%06d:%x|daObj_ItaMato_c -> デストラクト\n", g_Counter.mCounter0, this); @@ -465,7 +465,7 @@ static int daObj_ItaMato_IsDelete(void* a_this) { return 1; } -static actor_method_class daObj_ItaMato_MethodTable = { +static DUSK_CONST actor_method_class daObj_ItaMato_MethodTable = { (process_method_func)daObj_ItaMato_Create, (process_method_func)daObj_ItaMato_Delete, (process_method_func)daObj_ItaMato_Execute, @@ -473,7 +473,7 @@ static actor_method_class daObj_ItaMato_MethodTable = { (process_method_func)daObj_ItaMato_Draw, }; -actor_process_profile_definition g_profile_OBJ_ITAMATO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_ITAMATO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_item.cpp b/src/d/actor/d_a_obj_item.cpp index e45de1933d..0dc9ff833b 100644 --- a/src/d/actor/d_a_obj_item.cpp +++ b/src/d/actor/d_a_obj_item.cpp @@ -268,6 +268,11 @@ int daItem_c::_daItem_create() { } m_itemNo = daItem_prm::getItemNo(this); +#if TARGET_PC + if (dusk::getSettings().game.noHeartDrops && isHeart(m_itemNo)) { + return cPhs_ERROR_e; + } +#endif BOOL flag = dItem_data::chkFlag(m_itemNo, 2); #if DEBUG @@ -1081,7 +1086,7 @@ void daItem_c::set_bound_se() { } } -s32 daItem_c::m_timer_max = 10000; +DUSK_GAME_DATA s32 daItem_c::m_timer_max = 10000; int daItem_c::CountTimer() { m_timer++; @@ -1193,7 +1198,7 @@ void daItem_c::initScale() { } } -procFunc daItem_c::mFuncPtr[] = { +DUSK_GAME_DATA procFunc daItem_c::mFuncPtr[] = { &daItem_c::procMainNormal, &daItem_c::procMainEnemyCarry, &daItem_c::procMainSimpleGetDemo, &daItem_c::procWaitGetDemoEvent, &daItem_c::procMainGetDemoEvent, &daItem_c::procMainBoomerangCarry, @@ -1201,7 +1206,7 @@ procFunc daItem_c::mFuncPtr[] = { &daItem_c::procMainForceGet, NULL, }; -const dCcD_SrcCyl daItem_c::m_cyl_src = { +DUSK_GAME_DATA const dCcD_SrcCyl daItem_c::m_cyl_src = { { {0, {{0, 0, 0}, {0xFFFFFFFF, 17}, 0x59}}, {dCcD_SE_NONE, 0, 0, 0, {0}}, @@ -1275,13 +1280,13 @@ static int daItem_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->_daItem_create(); } -static actor_method_class l_daItem_Method = { +static DUSK_CONST actor_method_class l_daItem_Method = { (process_method_func)daItem_Create, (process_method_func)daItem_Delete, (process_method_func)daItem_Execute, (process_method_func)NULL, (process_method_func)daItem_Draw, }; -actor_process_profile_definition g_profile_ITEM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ITEM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ito.cpp b/src/d/actor/d_a_obj_ito.cpp index 02601f7e31..b224c2a943 100644 --- a/src/d/actor/d_a_obj_ito.cpp +++ b/src/d/actor/d_a_obj_ito.cpp @@ -681,7 +681,7 @@ static cPhs_Step daObj_Ito_Create(fopAc_ac_c* a_this) { return phase; } -static actor_method_class l_daObj_Ito_Method = { +static DUSK_CONST actor_method_class l_daObj_Ito_Method = { (process_method_func)daObj_Ito_Create, (process_method_func)daObj_Ito_Delete, (process_method_func)daObj_Ito_Execute, @@ -689,7 +689,7 @@ static actor_method_class l_daObj_Ito_Method = { (process_method_func)daObj_Ito_Draw, }; -actor_process_profile_definition g_profile_OBJ_ITO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_ITO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kabuto.cpp b/src/d/actor/d_a_obj_kabuto.cpp index 1e923eff24..3c564df0e2 100644 --- a/src/d/actor/d_a_obj_kabuto.cpp +++ b/src/d/actor/d_a_obj_kabuto.cpp @@ -855,7 +855,7 @@ static int daObjKABUTO_IsDelete(daObjKABUTO_c* i_this) { return 1; } -static actor_method_class l_daObjKABUTO_Method = { +static DUSK_CONST actor_method_class l_daObjKABUTO_Method = { (process_method_func)daObjKABUTO_Create, (process_method_func)daObjKABUTO_Delete, (process_method_func)daObjKABUTO_Execute, @@ -863,7 +863,7 @@ static actor_method_class l_daObjKABUTO_Method = { (process_method_func)daObjKABUTO_Draw, }; -actor_process_profile_definition g_profile_Obj_Kabuto = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kabuto = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kag.cpp b/src/d/actor/d_a_obj_kag.cpp index acfeb88fd2..d7b1a7523d 100644 --- a/src/d/actor/d_a_obj_kag.cpp +++ b/src/d/actor/d_a_obj_kag.cpp @@ -760,7 +760,7 @@ void daObjKAG_c::kag_setParticle() { } } -static actor_method_class l_daObjKAG_Method = { +static DUSK_CONST actor_method_class l_daObjKAG_Method = { (process_method_func)daObjKAG_Create, (process_method_func)daObjKAG_Delete, (process_method_func)daObjKAG_Execute, @@ -768,7 +768,7 @@ static actor_method_class l_daObjKAG_Method = { (process_method_func)daObjKAG_Draw, }; -actor_process_profile_definition g_profile_Obj_Kag = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kag = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kage.cpp b/src/d/actor/d_a_obj_kage.cpp index 768ea5f61d..2f0d1b182f 100644 --- a/src/d/actor/d_a_obj_kage.cpp +++ b/src/d/actor/d_a_obj_kage.cpp @@ -121,7 +121,7 @@ static int daObj_Kage_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daObj_Kage_Method = { +static DUSK_CONST actor_method_class l_daObj_Kage_Method = { (process_method_func)daObj_Kage_Create, (process_method_func)daObj_Kage_Delete, (process_method_func)daObj_Kage_Execute, @@ -129,7 +129,7 @@ static actor_method_class l_daObj_Kage_Method = { (process_method_func)daObj_Kage_Draw, }; -actor_process_profile_definition g_profile_OBJ_KAGE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KAGE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kago.cpp b/src/d/actor/d_a_obj_kago.cpp index dc15a05907..7335c4ac35 100644 --- a/src/d/actor/d_a_obj_kago.cpp +++ b/src/d/actor/d_a_obj_kago.cpp @@ -15,7 +15,7 @@ #include "f_op/f_op_actor_mng.h" #include -daObj_Kago_HIOParam const daObj_Kago_Param_c::m = { +DUSK_GAME_DATA daObj_Kago_HIOParam const daObj_Kago_Param_c::m = { 0.0f, -5.0f, 1.0f, @@ -42,11 +42,11 @@ const dCcD_SrcGObjInf l_ccDObjData = { {0} // mGObjCo }; -static int l_bmdData[2][2] = { +static DUSK_CONSTEXPR int l_bmdData[2][2] = { { 3, 1 }, { 4, 1 }, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "uri_kago" }; @@ -676,7 +676,7 @@ static int daObj_Kago_IsDelete(void* param_1) { AUDIO_INSTANCES; -static actor_method_class daObj_Kago_MethodTable = { +static DUSK_CONST actor_method_class daObj_Kago_MethodTable = { (process_method_func)daObj_Kago_Create, (process_method_func)daObj_Kago_Delete, (process_method_func)daObj_Kago_Execute, @@ -684,7 +684,7 @@ static actor_method_class daObj_Kago_MethodTable = { (process_method_func)daObj_Kago_Draw, }; -actor_process_profile_definition g_profile_OBJ_KAGO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KAGO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kaisou.cpp b/src/d/actor/d_a_obj_kaisou.cpp index fe2204d8ca..a0e5281e5c 100644 --- a/src/d/actor/d_a_obj_kaisou.cpp +++ b/src/d/actor/d_a_obj_kaisou.cpp @@ -66,7 +66,7 @@ static int JointCallBack(J3DJoint* i_joint, int param_2) { return 1; } -static char* l_arcName = "M_kaisou"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_kaisou"; int daObjKaisou_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "M_kaisou.bmd"); @@ -295,7 +295,7 @@ static int daObjKaisou_IsDelete(daObjKaisou_c* i_this) { return 1; } -static actor_method_class l_daObjKaisou_Method = { +static DUSK_CONST actor_method_class l_daObjKaisou_Method = { (process_method_func)daObjKaisou_Create, (process_method_func)daObjKaisou_Delete, (process_method_func)daObjKaisou_Execute, @@ -303,7 +303,7 @@ static actor_method_class l_daObjKaisou_Method = { (process_method_func)daObjKaisou_Draw, }; -actor_process_profile_definition g_profile_Obj_Kaisou = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kaisou = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kamakiri.cpp b/src/d/actor/d_a_obj_kamakiri.cpp index 2b641d7769..21e6030a7f 100644 --- a/src/d/actor/d_a_obj_kamakiri.cpp +++ b/src/d/actor/d_a_obj_kamakiri.cpp @@ -898,13 +898,13 @@ static BOOL daObjKAM_IsDelete(daObjKAM_c* param_0) { return TRUE; } -static actor_method_class l_daObjKAM_Method = { +static DUSK_CONST actor_method_class l_daObjKAM_Method = { (process_method_func)daObjKAM_Create, (process_method_func)daObjKAM_Delete, (process_method_func)daObjKAM_Execute, (process_method_func)daObjKAM_IsDelete, (process_method_func)daObjKAM_Draw, }; -actor_process_profile_definition g_profile_Obj_Kam = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kam = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kanban2.cpp b/src/d/actor/d_a_obj_kanban2.cpp index 8c1f501755..8998952202 100644 --- a/src/d/actor/d_a_obj_kanban2.cpp +++ b/src/d/actor/d_a_obj_kanban2.cpp @@ -89,7 +89,7 @@ enum daObj_Kanban2_DamageType { }; namespace { -static char* l_kn2_bmdidx[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_kn2_bmdidx[] = { "J_kanban00.bmd", "J_kanban00_01.bmd", "J_kanban00_02.bmd", @@ -111,7 +111,7 @@ static char* l_kn2_bmdidx[] = { "J_kanban00_18.bmd", }; -static s16 dKn2_CarryOffset[] = { +static DUSK_CONSTEXPR s16 dKn2_CarryOffset[] = { -0x2f83, -0x45df, -0x45df, @@ -122,7 +122,7 @@ static s16 dKn2_CarryOffset[] = { -0x3993, }; -static struct { +static DUSK_CONSTEXPR struct { f32 speed_y; f32 speed_f; } dKb2_BAN_SPEED[] = { @@ -146,7 +146,7 @@ static struct { { 0.0f, 30.0f }, }; -static u16 dKb2_BAN_ANGLE[] = { +static DUSK_CONSTEXPR u16 dKb2_BAN_ANGLE[] = { 0x6800, 0x7800, 0x8800, @@ -167,7 +167,7 @@ static u16 dKb2_BAN_ANGLE[] = { 0x9000, }; -static u32 dKb2_BAN_PARTS[] = { +static DUSK_CONSTEXPR u32 dKb2_BAN_PARTS[] = { PART_TOP_LEFT_UNDER, PART_SPINE_LEFT_UPPER | PART_TOP_LEFT_UPPER, PART_SPINE_RIGHT_UPPER | PART_TOP_RIGHT_UPPER, @@ -188,7 +188,7 @@ static u32 dKb2_BAN_PARTS[] = { 0, }; -static dCcD_SrcSph cc_kn2_src = { +static DUSK_CONSTEXPR dCcD_SrcSph cc_kn2_src = { { {0x0, {{AT_TYPE_1000, 0x2, 0x13}, {0xD8FBFDFF, 0x11}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -200,7 +200,7 @@ static dCcD_SrcSph cc_kn2_src = { } // mSphAttr }; -static struct { +static DUSK_CONSTEXPR struct { f32 x; f32 y; } d_KANBAN_OFFSET[] = { @@ -1770,7 +1770,7 @@ static int daObj_Kanban2_Create(daObj_Kanban2_c* i_this) { return i_this->create(); } -static actor_method_class l_daObj_Kanban2_Method = { +static DUSK_CONST actor_method_class l_daObj_Kanban2_Method = { (process_method_func)daObj_Kanban2_Create, (process_method_func)daObj_Kanban2_Delete, (process_method_func)daObj_Kanban2_Execute, @@ -1778,7 +1778,7 @@ static actor_method_class l_daObj_Kanban2_Method = { (process_method_func)daObj_Kanban2_Draw, }; -actor_process_profile_definition g_profile_OBJ_KANBAN2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KANBAN2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kantera.cpp b/src/d/actor/d_a_obj_kantera.cpp index 3d38a949af..a521a119a1 100644 --- a/src/d/actor/d_a_obj_kantera.cpp +++ b/src/d/actor/d_a_obj_kantera.cpp @@ -254,7 +254,7 @@ static int daItemKantera_Create(fopAc_ac_c* i_this) { } -static actor_method_class l_daItemKantera_Method = { +static DUSK_CONST actor_method_class l_daItemKantera_Method = { (process_method_func)daItemKantera_Create, (process_method_func)daItemKantera_Delete, (process_method_func)daItemKantera_Execute, @@ -262,7 +262,7 @@ static actor_method_class l_daItemKantera_Method = { (process_method_func)daItemKantera_Draw, }; -actor_process_profile_definition g_profile_Obj_Kantera = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kantera = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_katatsumuri.cpp b/src/d/actor/d_a_obj_katatsumuri.cpp index 805aa37b44..e9a540e726 100644 --- a/src/d/actor/d_a_obj_katatsumuri.cpp +++ b/src/d/actor/d_a_obj_katatsumuri.cpp @@ -870,7 +870,7 @@ static int daObjKAT_IsDelete(daObjKAT_c* param_0) { return 1; } -static actor_method_class l_daObjKAT_Method = { +static DUSK_CONST actor_method_class l_daObjKAT_Method = { (process_method_func)daObjKAT_Create, (process_method_func)daObjKAT_Delete, (process_method_func)daObjKAT_Execute, @@ -878,7 +878,7 @@ static actor_method_class l_daObjKAT_Method = { (process_method_func)daObjKAT_Draw, }; -actor_process_profile_definition g_profile_Obj_Kat = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kat = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kazeneko.cpp b/src/d/actor/d_a_obj_kazeneko.cpp index e686683f27..cee30e6d4f 100644 --- a/src/d/actor/d_a_obj_kazeneko.cpp +++ b/src/d/actor/d_a_obj_kazeneko.cpp @@ -12,7 +12,7 @@ #include "d/d_com_inf_game.h" #include "f_op/f_op_actor_mng.h" -KazoNekoAttr const daObjKazeNeko_c::M_attr = { +DUSK_GAME_DATA KazoNekoAttr const daObjKazeNeko_c::M_attr = { 30.0f, 120.0f, 3000.0f, 7000.0f, 90.0f, 1800.0f, 180.0f, 27.0f, 15.0f, 1, 0x70, 0x6400, 0x190000, @@ -103,7 +103,7 @@ void daObjKazeNeko_c::getFirstVec(cXyz* param_1, int param_2) { param_1->set((attr().field_0x20 * cM_ssin(sVar4)), 30.0f, attr().field_0x20 * cM_scos(sVar4)); } -static char* l_arcName = "J_Kazami"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "J_Kazami"; inline int daObjKazeNeko_c::createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "pole.bmd"); @@ -219,7 +219,7 @@ static int daObjKazeNeko_Create(fopAc_ac_c* i_this) { } -static actor_method_class l_daObjKazeNeko_Method = { +static DUSK_CONST actor_method_class l_daObjKazeNeko_Method = { (process_method_func)daObjKazeNeko_Create, (process_method_func)daObjKazeNeko_Delete, (process_method_func)daObjKazeNeko_Execute, @@ -227,7 +227,7 @@ static actor_method_class l_daObjKazeNeko_Method = { (process_method_func)daObjKazeNeko_Draw, }; -actor_process_profile_definition g_profile_Obj_KazeNeko = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KazeNeko = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kbacket.cpp b/src/d/actor/d_a_obj_kbacket.cpp index 72f74b9496..371f03fbd4 100644 --- a/src/d/actor/d_a_obj_kbacket.cpp +++ b/src/d/actor/d_a_obj_kbacket.cpp @@ -15,9 +15,9 @@ static s32 l_bmdData[4] = { 8, 0, 9, 0 }; -static char* l_resNameList[1] = {"Kakashi"}; +static DUSK_CONST char* l_resNameList[1] = {"Kakashi"}; -const daObj_KBacket_HIOParam daObj_KBacket_Param_c::m = { +DUSK_GAME_DATA const daObj_KBacket_HIOParam daObj_KBacket_Param_c::m = { 0.0f, -5.0f, 1.0f, 400.0f, 73.0f, 30.0f, 30.0f, 30.0f, 37.0f, 45.0f, 0.0f }; @@ -685,7 +685,7 @@ static int daObj_KBacket_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_KBacket_MethodTable = { +static DUSK_CONST actor_method_class daObj_KBacket_MethodTable = { (process_method_func)daObj_KBacket_Create, (process_method_func)daObj_KBacket_Delete, (process_method_func)daObj_KBacket_Execute, @@ -693,7 +693,7 @@ static actor_method_class daObj_KBacket_MethodTable = { (process_method_func)daObj_KBacket_Draw, }; -actor_process_profile_definition g_profile_OBJ_KBACKET = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KBACKET = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kbox.cpp b/src/d/actor/d_a_obj_kbox.cpp index 61eb2a6418..b916fac0a1 100644 --- a/src/d/actor/d_a_obj_kbox.cpp +++ b/src/d/actor/d_a_obj_kbox.cpp @@ -520,7 +520,7 @@ static int daObj_Kbox_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daObj_Kbox_Method = { +static DUSK_CONST actor_method_class l_daObj_Kbox_Method = { (process_method_func)daObj_Kbox_Create, (process_method_func)daObj_Kbox_Delete, (process_method_func)daObj_Kbox_Execute, @@ -528,7 +528,7 @@ static actor_method_class l_daObj_Kbox_Method = { (process_method_func)daObj_Kbox_Draw, }; -actor_process_profile_definition g_profile_OBJ_KBOX = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KBOX = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_key.cpp b/src/d/actor/d_a_obj_key.cpp index b7814189ed..94adc504ac 100644 --- a/src/d/actor/d_a_obj_key.cpp +++ b/src/d/actor/d_a_obj_key.cpp @@ -641,7 +641,7 @@ static int daObj_Key_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daObj_Key_Method = { +static DUSK_CONST actor_method_class l_daObj_Key_Method = { (process_method_func)daObj_Key_Create, (process_method_func)daObj_Key_Delete, (process_method_func)daObj_Key_Execute, @@ -649,7 +649,7 @@ static actor_method_class l_daObj_Key_Method = { (process_method_func)daObj_Key_Draw, }; -actor_process_profile_definition g_profile_OBJ_KEY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KEY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_keyhole.cpp b/src/d/actor/d_a_obj_keyhole.cpp index 4e58733163..d56f39f40b 100644 --- a/src/d/actor/d_a_obj_keyhole.cpp +++ b/src/d/actor/d_a_obj_keyhole.cpp @@ -10,6 +10,9 @@ #include "d/d_s_play.h" #include "d/actor/d_a_player.h" #include "Z2AudioLib/Z2Instances.h" +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#endif daObj_Keyhole_HIO_c::daObj_Keyhole_HIO_c() { id = -1; @@ -53,6 +56,21 @@ static int daObj_Keyhole_Draw(obj_keyhole_class* i_this) { for (int i = 0; i < 6; i++) { kh_chain_s* chain_s = &i_this->chain_s[i]; for (int j = 0; j < i_this->chain_num; j++) { +#if TARGET_PC + if (dusk::frame_interp::is_enabled() && i_this->mChainInterpPrevValid && i_this->mChainInterpCurrValid) { + const f32 alpha = dusk::frame_interp::get_interpolation_step(); + Mtx mtx; + const f32* p0 = (const f32*)i_this->mChainInterpPrev[i][j]; + const f32* p1 = (const f32*)i_this->mChainInterpCurr[i][j]; + f32* dst = (f32*)mtx; + for (int k = 0; k < 12; k++) { + dst[k] = p0[k] + (p1[k] - p0[k]) * alpha; + } + chain_s->model[j]->setBaseTRMtx(mtx); + g_env_light.setLightTevColorType_MAJI(chain_s->model[j], &actor->tevStr); + mDoExt_modelUpdateDL(chain_s->model[j]); + } else +#endif dComIfGp_entrySimpleModel(chain_s->model[j], fopAcM_GetRoomNo(actor)); } } @@ -261,7 +279,7 @@ static void chain_move(obj_keyhole_class* i_this) { fopAc_ac_c* actor = &i_this->actor; fopAc_ac_c* player = dComIfGp_getPlayer(0); - static cXyz lock_pos[] = { + static DUSK_CONSTEXPR cXyz lock_pos[] = { cXyz(140.0f, 130.0f, 0.0f), cXyz(-140.0f, 130.0f, 0.0f), cXyz(170.0f, 30.0f, 0.0f), @@ -370,6 +388,21 @@ static void chain_move(obj_keyhole_class* i_this) { ANGLE_ADD(sp8, TREG_S(0) + 0x3D00); } } + +#if TARGET_PC + if (dusk::frame_interp::is_enabled()) { + if (i_this->mChainInterpCurrValid) { + memcpy(i_this->mChainInterpPrev, i_this->mChainInterpCurr, sizeof(i_this->mChainInterpCurr)); + i_this->mChainInterpPrevValid = true; + } + for (int i = 0; i < 6; i++) { + for (int j = 0; j < i_this->chain_num; j++) { + MTXCopy(i_this->chain_s[i].model[j]->getBaseTRMtx(), i_this->mChainInterpCurr[i][j]); + } + } + i_this->mChainInterpCurrValid = true; + } +#endif } static void open(obj_keyhole_class* i_this) { @@ -648,19 +681,19 @@ static int useHeapInit(fopAc_ac_c* i_this) { obj_keyhole_class* a_this = (obj_keyhole_class*)i_this; void* modelData; - static int bmd_d[] = { + static DUSK_CONSTEXPR int bmd_d[] = { 7, 11, 11, 7, 11, 11, 11, 11, 11, 11, }; - static u32 mdl_f[] = { + static DUSK_CONSTEXPR u32 mdl_f[] = { 0x80000, 0, 0x80000, 0, 0, 0, 0, 0, 0, 0, }; - static int bck_d[] = { + static DUSK_CONSTEXPR int bck_d[] = { 0, 5, 5, 0, 5, 5, 5, 5, 5, 5, }; - static int cbmd_d[] = { + static DUSK_CONSTEXPR int cbmd_d[] = { 4, 8, 8, 4, 8, 8, 8, 8, 8, 8, }; @@ -709,7 +742,7 @@ static int daObj_Keyhole_Create(fopAc_ac_c* a_this) { obj_keyhole_class* i_this = (obj_keyhole_class*)a_this; fopAcM_ct(a_this, obj_keyhole_class); - static char* arc_name[] = { + static DUSK_CONSTEXPR char DUSK_CONST* arc_name[] = { "Obj_keyh", "Obj_bkey", "Obj_bkey2", "Obj_bkey3", "Obj_bkey", "Obj_bkey5", "Obj_bkey", "Obj_bkey", "Obj_bkey", "Obj_bkey", }; @@ -750,6 +783,11 @@ static int daObj_Keyhole_Create(fopAc_ac_c* a_this) { return cPhs_ERROR_e; } +#if TARGET_PC + i_this->mChainInterpPrevValid = false; + i_this->mChainInterpCurrValid = false; +#endif + OS_REPORT("//////////////OBJ_KEYHOLE SET 2 !!\n"); if (i_this->arg0 == 3) { @@ -771,7 +809,7 @@ static int daObj_Keyhole_Create(fopAc_ac_c* a_this) { fopAcM_SetMin(a_this, -400.0f, -400.0f, -400.0f); fopAcM_SetMax(a_this, 400.0f, 400.0f, 400.0f); - static dCcD_SrcSph cc_sph_src = { + static DUSK_CONSTEXPR dCcD_SrcSph cc_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdbf, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -833,7 +871,7 @@ static int daObj_Keyhole_Create(fopAc_ac_c* a_this) { return phase_state; } -static actor_method_class l_daObj_Keyhole_Method = { +static DUSK_CONST actor_method_class l_daObj_Keyhole_Method = { (process_method_func)daObj_Keyhole_Create, (process_method_func)daObj_Keyhole_Delete, (process_method_func)daObj_Keyhole_Execute, @@ -841,7 +879,7 @@ static actor_method_class l_daObj_Keyhole_Method = { (process_method_func)daObj_Keyhole_Draw, }; -actor_process_profile_definition g_profile_OBJ_KEYHOLE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KEYHOLE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kgate.cpp b/src/d/actor/d_a_obj_kgate.cpp index ceb677a846..6fc8dd28d4 100644 --- a/src/d/actor/d_a_obj_kgate.cpp +++ b/src/d/actor/d_a_obj_kgate.cpp @@ -52,7 +52,7 @@ static u32 const l_gate_heap[] = {0x1940, 0x1940, 0x1940}; static u32 const l_key_heap[] = {0x1000, 0x1000, 0x1000}; -static cull_box const l_cull_box = { +static DUSK_CONSTEXPR cull_box const l_cull_box = { {-300.0f, 0.0f, -350.0f}, {300.0f, 450.0f, 350.0f}, }; @@ -205,14 +205,14 @@ void daObjKGate_c::setBaseMtx() { } } -static char* l_arcName[] = { +static DUSK_CONST char* l_arcName[] = { "D_Kgate00", "D_Kgate01", "M_RGate00", }; int daObjKGate_c::Create() { - static char* l_evName[] = {"KOKI_GATE_OPEN00", NULL, "RIDER_GATE_OPEN00"}; + static DUSK_CONST char* l_evName[] = {"KOKI_GATE_OPEN00", NULL, "RIDER_GATE_OPEN00"}; u8 sw_no = getSwNo(); @@ -910,7 +910,7 @@ void daObjKGate_c::demoProc() { } int daObjKGate_c::getDemoAction() { - static char* action_table[] = {"WAIT", "ADJUSTMENT", "UNLOCK", "OPEN"}; + static DUSK_CONST char* action_table[] = {"WAIT", "ADJUSTMENT", "UNLOCK", "OPEN"}; return dComIfGp_evmng_getMyActIdx(mStaffID, action_table, ARRAY_SIZEU(action_table), 0, 0); } @@ -981,13 +981,13 @@ static int daObjKGate_MoveBGDraw(daObjKGate_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjKGate_METHODS = { +static DUSK_CONST actor_method_class daObjKGate_METHODS = { (process_method_func)daObjKGate_create1st, (process_method_func)daObjKGate_MoveBGDelete, (process_method_func)daObjKGate_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjKGate_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KkrGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KkrGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ki.cpp b/src/d/actor/d_a_obj_ki.cpp index 569368a4a6..b108092ca7 100644 --- a/src/d/actor/d_a_obj_ki.cpp +++ b/src/d/actor/d_a_obj_ki.cpp @@ -216,7 +216,7 @@ static cPhs_Step daObj_Ki_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daObj_Ki_Method = { +static DUSK_CONST actor_method_class l_daObj_Ki_Method = { (process_method_func)daObj_Ki_Create, (process_method_func)daObj_Ki_Delete, (process_method_func)daObj_Ki_Execute, @@ -224,7 +224,7 @@ static actor_method_class l_daObj_Ki_Method = { (process_method_func)daObj_Ki_Draw, }; -actor_process_profile_definition g_profile_OBJ_KI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kiPot.cpp b/src/d/actor/d_a_obj_kiPot.cpp index 54e01c5a12..53e91646a3 100644 --- a/src/d/actor/d_a_obj_kiPot.cpp +++ b/src/d/actor/d_a_obj_kiPot.cpp @@ -10,7 +10,7 @@ static daKiPot_HIO_c l_HIO; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-50.0f, 0.0f, -50.0f}, {50.0f, 100.0f, 50.0f}, }; @@ -108,13 +108,13 @@ static int daKiPot_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daKiPot_Method = { +static DUSK_CONST actor_method_class l_daKiPot_Method = { (process_method_func)daKiPot_Create, (process_method_func)daKiPot_Delete, (process_method_func)daKiPot_Execute, 0, (process_method_func)daKiPot_Draw, }; -actor_process_profile_definition g_profile_Obj_KiPot = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KiPot = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kita.cpp b/src/d/actor/d_a_obj_kita.cpp index 7c531310bf..ceba9bdb81 100644 --- a/src/d/actor/d_a_obj_kita.cpp +++ b/src/d/actor/d_a_obj_kita.cpp @@ -254,7 +254,7 @@ static int daObj_Kita_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daObj_Kita_Method = { +static DUSK_CONST actor_method_class l_daObj_Kita_Method = { (process_method_func)daObj_Kita_Create, (process_method_func)daObj_Kita_Delete, (process_method_func)daObj_Kita_Execute, @@ -262,7 +262,7 @@ static actor_method_class l_daObj_Kita_Method = { (process_method_func)daObj_Kita_Draw, }; -actor_process_profile_definition g_profile_OBJ_KITA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_KITA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kjgjs.cpp b/src/d/actor/d_a_obj_kjgjs.cpp index 2a174669d5..cd4fe03757 100644 --- a/src/d/actor/d_a_obj_kjgjs.cpp +++ b/src/d/actor/d_a_obj_kjgjs.cpp @@ -106,13 +106,13 @@ static int daObjKJgjs_MoveBGDraw(daObjKJgjs_c* i_this) { daObjKJgjs_c::~daObjKJgjs_c() {} -static actor_method_class daObjKJgjs_METHODS = { +static DUSK_CONST actor_method_class daObjKJgjs_METHODS = { (process_method_func)daObjKJgjs_create1st, (process_method_func)daObjKJgjs_MoveBGDelete, (process_method_func)daObjKJgjs_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjKJgjs_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KJgjs = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KJgjs = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kkanban.cpp b/src/d/actor/d_a_obj_kkanban.cpp index 661b26d1be..f81440fe6f 100644 --- a/src/d/actor/d_a_obj_kkanban.cpp +++ b/src/d/actor/d_a_obj_kkanban.cpp @@ -38,7 +38,7 @@ void daObjKKanban_c::setBaseMtx() { mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); } -static char* l_arcName = "H_KKanban"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_KKanban"; static dCcD_SrcTri l_tri_src = { { @@ -149,13 +149,13 @@ static int daObjKKanban_MoveBGDraw(daObjKKanban_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjKKanban_METHODS = { +static DUSK_CONST actor_method_class daObjKKanban_METHODS = { (process_method_func)daObjKKanban_create1st, (process_method_func)daObjKKanban_MoveBGDelete, (process_method_func)daObjKKanban_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjKKanban_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KKanban = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KKanban = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_klift00.cpp b/src/d/actor/d_a_obj_klift00.cpp index e44cce7467..fbccb64edb 100644 --- a/src/d/actor/d_a_obj_klift00.cpp +++ b/src/d/actor/d_a_obj_klift00.cpp @@ -493,7 +493,7 @@ int daObjKLift00_c::Draw() { dComIfGd_setList(); #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { if (mChainInterpCurrValid) { memcpy(mChainInterpPrev, mChainInterpCurr, mNumChains * sizeof(cXyz)); mChainInterpPrevValid = true; @@ -538,7 +538,7 @@ static int daObjKLift00_MoveBGDraw(daObjKLift00_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjKLift00_METHODS = { +static DUSK_CONST actor_method_class daObjKLift00_METHODS = { (process_method_func)daObjKLift00_create1st, (process_method_func)daObjKLift00_MoveBGDelete, (process_method_func)daObjKLift00_MoveBGExecute, @@ -546,7 +546,7 @@ static actor_method_class daObjKLift00_METHODS = { (process_method_func)daObjKLift00_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KLift00 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KLift00 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_knBullet.cpp b/src/d/actor/d_a_obj_knBullet.cpp index c4eabe796a..b8c7a922ff 100644 --- a/src/d/actor/d_a_obj_knBullet.cpp +++ b/src/d/actor/d_a_obj_knBullet.cpp @@ -194,7 +194,7 @@ static int daObjKnBullet_create(fopAc_ac_c* i_this) { return ((daObjKnBullet_c*)i_this)->Create(); } -static actor_method_class l_daObjKnBullet_Method = { +static DUSK_CONST actor_method_class l_daObjKnBullet_Method = { (process_method_func)daObjKnBullet_create, (process_method_func)daObjKnBullet_Delete, (process_method_func)daObjKnBullet_Execute, @@ -202,7 +202,7 @@ static actor_method_class l_daObjKnBullet_Method = { (process_method_func)daObjKnBullet_Draw, }; -actor_process_profile_definition g_profile_KN_BULLET = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_KN_BULLET = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kshutter.cpp b/src/d/actor/d_a_obj_kshutter.cpp index 5cfa8c719b..8470a9d327 100644 --- a/src/d/actor/d_a_obj_kshutter.cpp +++ b/src/d/actor/d_a_obj_kshutter.cpp @@ -129,11 +129,11 @@ static u32 const l_heap_size[5] = { 0x1300, 0x1300, 0x1300, 0x1300, 0x20D0, }; -static cull_box const l_cull_box = { +static DUSK_CONSTEXPR cull_box const l_cull_box = { {-450.0f, 0.0f, -50.0f}, {450.0f, 700.0f, 150.0f}, }; -static char* l_arcName[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[5] = { "S_shut00", "S_shut00", "Lv3shut00", @@ -141,7 +141,7 @@ static char* l_arcName[5] = { "V_Shutter", }; -static char* l_anmName[10] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_anmName[10] = { "oj_DoorOpC.bck", "md_oj_DoorOpC.bck", "oj_DoorOpC.bck", @@ -154,7 +154,7 @@ static char* l_anmName[10] = { "V_Shutter.bck", }; -static char* l_eventName[10] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_eventName[10] = { "KEY_JAIL_00", "KEY_JAIL_WOLF_00", "KEY_JAIL_00", @@ -234,7 +234,7 @@ void daObjKshtr_c::offDzb() { } } -static char* l_anmArcName[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_anmArcName[5] = { "DoorY00", "DoorY00", "DoorT00", @@ -381,7 +381,7 @@ cPhs_Step daObjKshtr_c::phase_2() { } cPhs_Step daObjKshtr_c::create1st() { - static daObjKshtr_c::PhaseFunc l_ct_func[3] = { + static DUSK_CONSTEXPR daObjKshtr_c::PhaseFunc l_ct_func[3] = { &daObjKshtr_c::phase_0, &daObjKshtr_c::phase_1, &daObjKshtr_c::phase_2, @@ -391,7 +391,7 @@ cPhs_Step daObjKshtr_c::create1st() { } void daObjKshtr_c::event_proc_call() { - static daObjKshtr_c::ActionFunc l_func[3] = { + static DUSK_CONSTEXPR daObjKshtr_c::ActionFunc l_func[3] = { &daObjKshtr_c::actionWaitEvent, &daObjKshtr_c::actionEvent, &daObjKshtr_c::actionDead, @@ -401,7 +401,7 @@ void daObjKshtr_c::event_proc_call() { } void daObjKshtr_c::event_proc_call2() { - static daObjKshtr_c::ActionFunc l_func[4] = { + static DUSK_CONSTEXPR daObjKshtr_c::ActionFunc l_func[4] = { &daObjKshtr_c::actionWaitEvent2, &daObjKshtr_c::actionEvent2, &daObjKshtr_c::actionDead2, @@ -474,7 +474,7 @@ BOOL daObjKshtr_c::checkOpen() { } int daObjKshtr_c::getDemoAction() { - static char* action_table[6] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[6] = { "WAIT", "ADJUSTMENT", "UNLOCK", @@ -667,7 +667,7 @@ BOOL daObjKshtr_c::openProc_type1() { } BOOL daObjKshtr_c::openProc_type2() { - static u16 const l_eff_id[5] = { + static DUSK_CONSTEXPR u16 const l_eff_id[5] = { 0x8762, 0x8763, 0x8764, @@ -698,12 +698,12 @@ BOOL daObjKshtr_c::openProc_typeL3Boss() { } void daObjKshtr_c::demoProc() { - static daObjKshtr_c::DemoFunc l_demoProc[2] = { + static DUSK_CONSTEXPR daObjKshtr_c::DemoFunc l_demoProc[2] = { &daObjKshtr_c::demoJail1, &daObjKshtr_c::demoJail2, }; - static daObjKshtr_c::DemoFunc l_demoProc2[2] = { + static DUSK_CONSTEXPR daObjKshtr_c::DemoFunc l_demoProc2[2] = { &daObjKshtr_c::demoJail11, &daObjKshtr_c::demoJail21, }; @@ -963,7 +963,7 @@ static int daObjKshtr_MoveBGDraw(daObjKshtr_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjKshtr_METHODS = { +static DUSK_CONST actor_method_class daObjKshtr_METHODS = { (process_method_func)daObjKshtr_create1st, (process_method_func)daObjKshtr_MoveBGDelete, (process_method_func)daObjKshtr_MoveBGExecute, @@ -971,7 +971,7 @@ static actor_method_class daObjKshtr_METHODS = { (process_method_func)daObjKshtr_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Kshutter = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kshutter = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ktOnFire.cpp b/src/d/actor/d_a_obj_ktOnFire.cpp index b11a22c7cf..000a185e64 100644 --- a/src/d/actor/d_a_obj_ktOnFire.cpp +++ b/src/d/actor/d_a_obj_ktOnFire.cpp @@ -20,19 +20,19 @@ public: static daKtOnFire_HIO_c l_HIO; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-50.0f, 0.0f, -50.0f}, {50.0f, 100.0f, 50.0f}, }; -const dCcD_SrcGObjInf daKtOnFire_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daKtOnFire_c::mCcDObjInfo = { {0x0, {{0x200, 0x0, 0x13}, {0xD8FBFFFF, 0x11}, 0x0}}, // mObj {dCcD_SE_SWORD, 0x0, 0x0, 0x0, 0x0}, // mGObjAt {dCcD_SE_STONE, 0x0, 0x0, 0x0, 0x0}, // mGObjTg {0x0}, // mGObjCo }; -dCcD_SrcCyl daKtOnFire_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daKtOnFire_c::mCcDCyl = { mCcDObjInfo, { { @@ -194,7 +194,7 @@ static int daKtOnFire_Create(fopAc_ac_c* i_this) { return ((daKtOnFire_c*)i_this)->create(); } -static actor_method_class l_daKtOnFire_Method = { +static DUSK_CONST actor_method_class l_daKtOnFire_Method = { (process_method_func)daKtOnFire_Create, (process_method_func)daKtOnFire_Delete, (process_method_func)daKtOnFire_Execute, @@ -202,7 +202,7 @@ static actor_method_class l_daKtOnFire_Method = { (process_method_func)daKtOnFire_Draw, }; -actor_process_profile_definition g_profile_Tag_KtOnFire = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_KtOnFire = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kuwagata.cpp b/src/d/actor/d_a_obj_kuwagata.cpp index 80020208d3..ccdbd7c4f4 100644 --- a/src/d/actor/d_a_obj_kuwagata.cpp +++ b/src/d/actor/d_a_obj_kuwagata.cpp @@ -891,7 +891,7 @@ static int daObjKUW_IsDelete(daObjKUW_c* param_0) { return 1; } -static actor_method_class l_daObjKUW_Method = { +static DUSK_CONST actor_method_class l_daObjKUW_Method = { (process_method_func)daObjKUW_Create, (process_method_func)daObjKUW_Delete, (process_method_func)daObjKUW_Execute, @@ -899,7 +899,7 @@ static actor_method_class l_daObjKUW_Method = { (process_method_func)daObjKUW_Draw, }; -actor_process_profile_definition g_profile_Obj_Kuw = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Kuw = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kwheel00.cpp b/src/d/actor/d_a_obj_kwheel00.cpp index 5ec012478d..bc39975ebc 100644 --- a/src/d/actor/d_a_obj_kwheel00.cpp +++ b/src/d/actor/d_a_obj_kwheel00.cpp @@ -127,7 +127,7 @@ static dCcD_SrcSph l_sphSrc = { } // mSphAttr }; -u16 l_se_angle[4] = {0, 0x3FFF, 0x7FFF, 0xBFFF}; // {0°, 90°, 180°, 270°} +DUSK_GAME_DATA u16 l_se_angle[4] = {0, 0x3FFF, 0x7FFF, 0xBFFF}; // {0°, 90°, 180°, 270°} int daObjKWheel00_c::Create() { mpModel->setBaseTRMtx(mTransformMtx); @@ -347,7 +347,7 @@ bool daObjKWheel00_c::eventStart() { return true; } -static actor_method_class daObjKWheel00_METHODS = { +static DUSK_CONST actor_method_class daObjKWheel00_METHODS = { (process_method_func)daObjKWheel00_create1st, (process_method_func)daObjKWheel00_MoveBGDelete, (process_method_func)daObjKWheel00_MoveBGExecute, @@ -355,7 +355,7 @@ static actor_method_class daObjKWheel00_METHODS = { (process_method_func)daObjKWheel00_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KWheel00 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KWheel00 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kwheel01.cpp b/src/d/actor/d_a_obj_kwheel01.cpp index b91a01ce23..5566c2b5cd 100644 --- a/src/d/actor/d_a_obj_kwheel01.cpp +++ b/src/d/actor/d_a_obj_kwheel01.cpp @@ -339,7 +339,7 @@ bool daObjKWheel01_c::eventStart() { return true; } -static actor_method_class daObjKWheel01_METHODS = { +static DUSK_CONST actor_method_class daObjKWheel01_METHODS = { (process_method_func)daObjKWheel01_create1st, (process_method_func)daObjKWheel01_MoveBGDelete, (process_method_func)daObjKWheel01_MoveBGExecute, @@ -347,7 +347,7 @@ static actor_method_class daObjKWheel01_METHODS = { (process_method_func)daObjKWheel01_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KWheel01 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KWheel01 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_kznkarm.cpp b/src/d/actor/d_a_obj_kznkarm.cpp index 2b8828ce03..fd026b14d1 100644 --- a/src/d/actor/d_a_obj_kznkarm.cpp +++ b/src/d/actor/d_a_obj_kznkarm.cpp @@ -73,16 +73,16 @@ void daObjKznkarm_Hio_c::genMessage(JORMContext* ctx) { #endif - daObjKznkarm_Attr_c const daObjKznkarm_c::M_attr = { + DUSK_GAME_DATA daObjKznkarm_Attr_c const daObjKznkarm_c::M_attr = { -5.0f, -30.0f, 0.6f, 0.94f, 40.0f, 40.0f, -60.0f, -6.0f, -6.0f, -60.0f, 0.0f, 12.0f, 0, 0x1000, 0, -0x2000, }; -static char* l_arcName = "J_Kazami"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "J_Kazami"; -daObjKznkarm_c::actionFunc daObjKznkarm_c::ActionTable[4][2] = { +DUSK_GAME_DATA daObjKznkarm_c::actionFunc daObjKznkarm_c::ActionTable[4][2] = { &daObjKznkarm_c::initBroken, &daObjKznkarm_c::executeBroken, &daObjKznkarm_c::initCarry, @@ -437,7 +437,7 @@ static int daObjKznkarm_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjKznkarm_Method = { +static DUSK_CONST actor_method_class l_daObjKznkarm_Method = { (process_method_func)daObjKznkarm_Create, (process_method_func)daObjKznkarm_Delete, (process_method_func)daObjKznkarm_Execute, @@ -445,7 +445,7 @@ static actor_method_class l_daObjKznkarm_Method = { (process_method_func)daObjKznkarm_Draw, }; -actor_process_profile_definition g_profile_Obj_KznkArm = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KznkArm = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ladder.cpp b/src/d/actor/d_a_obj_ladder.cpp index bb2b145fc6..1bd7e54786 100644 --- a/src/d/actor/d_a_obj_ladder.cpp +++ b/src/d/actor/d_a_obj_ladder.cpp @@ -171,7 +171,7 @@ Hio_c L_hio; } -char const Act_c::M_arcname[5] = "Mhsg"; +DUSK_GAME_DATA char const Act_c::M_arcname[5] = "Mhsg"; int Act_c::CreateHeap() { J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes(M_arcname, attr_type(mType).field_0x0); @@ -344,7 +344,7 @@ void Act_c::mode_fell_init() { void Act_c::mode_fell() { } -Mtx Act_c::M_tmp_mtx; +DUSK_GAME_DATA Mtx Act_c::M_tmp_mtx; void Act_c::set_mtx() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); @@ -408,7 +408,7 @@ namespace { return ((Act_c*)i_this)->MoveBGIsDelete(); } - static actor_method_class Mthd_Table = { + static DUSK_CONST actor_method_class Mthd_Table = { (process_method_func)Mthd_Create, (process_method_func)Mthd_Delete, (process_method_func)Mthd_Execute, @@ -419,7 +419,7 @@ namespace { } -actor_process_profile_definition g_profile_Obj_Ladder = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ladder = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_laundry.cpp b/src/d/actor/d_a_obj_laundry.cpp index 289ed5f1c4..355ca08ddd 100644 --- a/src/d/actor/d_a_obj_laundry.cpp +++ b/src/d/actor/d_a_obj_laundry.cpp @@ -11,7 +11,7 @@ #include "d/d_com_inf_game.h" #include "d/d_kankyo_wether.h" -daObjLdy_Attr_c const daObjLdy_c::mAttr = {5.0f, 30.0f, 130.0f, -50.0f, 0.15f, 0.45f, 0.3f, 1000.0f, +DUSK_GAME_DATA daObjLdy_Attr_c const daObjLdy_c::mAttr = {5.0f, 30.0f, 130.0f, -50.0f, 0.15f, 0.45f, 0.3f, 1000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, 10, 0}; void daObjLdy_c::create_init() { @@ -182,7 +182,7 @@ static int nodeCallBack(J3DJoint* i_joint, int i_callbackCondition) { return 1; } -static char* l_arcName = "J_Sentaku"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "J_Sentaku"; int daObjLdy_c::getObjType() { return fopAcM_GetParam(this) & 0xff; @@ -277,13 +277,13 @@ static int daObjLdy_Create(fopAc_ac_c* i_this) { return ((daObjLdy_c*)i_this)->create(); } -static actor_method_class l_daObjLdy_Method = { +static DUSK_CONST actor_method_class l_daObjLdy_Method = { (process_method_func)daObjLdy_Create, (process_method_func)daObjLdy_Delete, (process_method_func)daObjLdy_Execute, (process_method_func)daObjLdy_IsDelete, (process_method_func)daObjLdy_Draw, }; -actor_process_profile_definition g_profile_Obj_Laundry = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Laundry = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_laundry_rope.cpp b/src/d/actor/d_a_obj_laundry_rope.cpp index 5dc3ff8f92..5da01533e4 100644 --- a/src/d/actor/d_a_obj_laundry_rope.cpp +++ b/src/d/actor/d_a_obj_laundry_rope.cpp @@ -13,7 +13,7 @@ #include "d/d_kankyo_wether.h" #include "d/d_path.h" -daObjLndRope_Attr_c const daObjLndRope_c::mAttr = {-5.0f, 0.2f, 0.5f, 0.8f, 0.0f}; +DUSK_GAME_DATA daObjLndRope_Attr_c const daObjLndRope_c::mAttr = {-5.0f, 0.2f, 0.5f, 0.8f, 0.0f}; static const s8 l_laundryList[13] = {-1, -1, 3, 0, -1, 1, 1, -1, 2, 2, -1, 2, -1}; @@ -207,7 +207,7 @@ void daObjLndRope_c::setNormalRopePos() { } } -static char* l_arcName = "Obj_SRope"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_SRope"; int daObjLndRope_c::createHeap() { ResTIMG* resTimg = (ResTIMG*)dComIfG_getObjectRes(l_arcName, "Obj_ItaRope.bti"); @@ -282,13 +282,13 @@ static int daObjLndRope_Create(fopAc_ac_c* i_this) { return ((daObjLndRope_c*)i_this)->create(); } -static actor_method_class l_daObjLndRope_Method = { +static DUSK_CONST actor_method_class l_daObjLndRope_Method = { (process_method_func)daObjLndRope_Create, (process_method_func)daObjLndRope_Delete, (process_method_func)daObjLndRope_Execute, (process_method_func)daObjLndRope_IsDelete, (process_method_func)daObjLndRope_Draw, }; -actor_process_profile_definition g_profile_Obj_LndRope = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_LndRope = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lbox.cpp b/src/d/actor/d_a_obj_lbox.cpp index 96f2f29bd2..dd8dc81ccc 100644 --- a/src/d/actor/d_a_obj_lbox.cpp +++ b/src/d/actor/d_a_obj_lbox.cpp @@ -190,12 +190,12 @@ static cPhs_Step daObj_Lbox_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daObj_Lbox_Method = { +static DUSK_CONST actor_method_class l_daObj_Lbox_Method = { (process_method_func)daObj_Lbox_Create, (process_method_func)daObj_Lbox_Delete, (process_method_func)daObj_Lbox_Execute, (process_method_func)daObj_Lbox_IsDelete, (process_method_func)daObj_Lbox_Draw}; -actor_process_profile_definition g_profile_OBJ_LBOX = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_LBOX = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_life_container.cpp b/src/d/actor/d_a_obj_life_container.cpp index 221f106d67..22706ba447 100644 --- a/src/d/actor/d_a_obj_life_container.cpp +++ b/src/d/actor/d_a_obj_life_container.cpp @@ -502,7 +502,7 @@ static int daObjLife_Create(fopAc_ac_c* i_this) { return ((daObjLife_c*)i_this)->create(); } -static actor_method_class l_daObjLife_Method = { +static DUSK_CONST actor_method_class l_daObjLife_Method = { (process_method_func)daObjLife_Create, (process_method_func)daObjLife_Delete, (process_method_func)daObjLife_Execute, @@ -510,7 +510,7 @@ static actor_method_class l_daObjLife_Method = { (process_method_func)daObjLife_Draw, }; -actor_process_profile_definition g_profile_Obj_LifeContainer = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_LifeContainer = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lp.cpp b/src/d/actor/d_a_obj_lp.cpp index 2d688ac3de..828909e307 100644 --- a/src/d/actor/d_a_obj_lp.cpp +++ b/src/d/actor/d_a_obj_lp.cpp @@ -486,7 +486,7 @@ static int daObj_Lp_Create(fopAc_ac_c* a_this) { return phase_state; } -static actor_method_class l_daObj_Lp_Method = { +static DUSK_CONST actor_method_class l_daObj_Lp_Method = { (process_method_func)daObj_Lp_Create, (process_method_func)daObj_Lp_Delete, (process_method_func)daObj_Lp_Execute, @@ -494,7 +494,7 @@ static actor_method_class l_daObj_Lp_Method = { (process_method_func)daObj_Lp_Draw, }; -actor_process_profile_definition g_profile_OBJ_LP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_LP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv1Candle00.cpp b/src/d/actor/d_a_obj_lv1Candle00.cpp index 12582c32af..64a8f7c904 100644 --- a/src/d/actor/d_a_obj_lv1Candle00.cpp +++ b/src/d/actor/d_a_obj_lv1Candle00.cpp @@ -10,7 +10,7 @@ static daLv1Cdl00_HIO_c l_HIO; -dCcD_SrcGObjInf const daLv1Cdl00_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daLv1Cdl00_c::mCcDObjInfo = { { 0, { {0x200, 0, 0x13}, @@ -23,7 +23,7 @@ dCcD_SrcGObjInf const daLv1Cdl00_c::mCcDObjInfo = { {0}, }; -dCcD_SrcCyl daLv1Cdl00_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv1Cdl00_c::mCcDCyl = { daLv1Cdl00_c::mCcDObjInfo, { { {0.0f, 0.0f, 0.0f}, 0, 0} @@ -267,7 +267,7 @@ static cPhs_Step daLv1Cdl00_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daLv1Cdl00_Method = { +static DUSK_CONST actor_method_class l_daLv1Cdl00_Method = { (process_method_func)daLv1Cdl00_Create, (process_method_func)daLv1Cdl00_Delete, (process_method_func)daLv1Cdl00_Execute, @@ -275,7 +275,7 @@ static actor_method_class l_daLv1Cdl00_Method = { (process_method_func)daLv1Cdl00_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv1Cdl00 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv1Cdl00 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv1Candle01.cpp b/src/d/actor/d_a_obj_lv1Candle01.cpp index 9e1cabfebb..a910141bb1 100644 --- a/src/d/actor/d_a_obj_lv1Candle01.cpp +++ b/src/d/actor/d_a_obj_lv1Candle01.cpp @@ -10,7 +10,7 @@ static daLv1Cdl01_HIO_c l_HIO; -dCcD_SrcGObjInf const daLv1Cdl01_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daLv1Cdl01_c::mCcDObjInfo = { { 0, { {0, 0, 0}, @@ -23,7 +23,7 @@ dCcD_SrcGObjInf const daLv1Cdl01_c::mCcDObjInfo = { {0}, }; -dCcD_SrcCyl daLv1Cdl01_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv1Cdl01_c::mCcDCyl = { daLv1Cdl01_c::mCcDObjInfo, { { {0.0f, 0.0f, 0.0f}, 0, 0} @@ -221,7 +221,7 @@ static cPhs_Step daLv1Cdl01_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daLv1Cdl01_Method = { +static DUSK_CONST actor_method_class l_daLv1Cdl01_Method = { (process_method_func)daLv1Cdl01_Create, (process_method_func)daLv1Cdl01_Delete, (process_method_func)daLv1Cdl01_Execute, @@ -229,7 +229,7 @@ static actor_method_class l_daLv1Cdl01_Method = { (process_method_func)daLv1Cdl01_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv1Cdl01 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv1Cdl01 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv2Candle.cpp b/src/d/actor/d_a_obj_lv2Candle.cpp index e93a4d05ed..7b3a511d3b 100644 --- a/src/d/actor/d_a_obj_lv2Candle.cpp +++ b/src/d/actor/d_a_obj_lv2Candle.cpp @@ -35,7 +35,7 @@ daLv2Candle_HIO_c::daLv2Candle_HIO_c() { mColor2B = 0x42; } -dCcD_SrcGObjInf const daLv2Candle_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daLv2Candle_c::mCcDObjInfo = { { 0, { {0x200, 0, 0x13}, @@ -48,14 +48,14 @@ dCcD_SrcGObjInf const daLv2Candle_c::mCcDObjInfo = { {0}, }; -dCcD_SrcCyl daLv2Candle_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv2Candle_c::mCcDCyl = { daLv2Candle_c::mCcDObjInfo, { { {0.0f, 0.0f, 0.0f}, 0, 0} } }; -static char* l_resNameIdx[3] = { +static DUSK_CONST char* l_resNameIdx[3] = { "L2candl", "L4candl", "L9Candle", @@ -386,7 +386,7 @@ static cPhs_Step daLv2Candle_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daLv2Candle_Method = { +static DUSK_CONST actor_method_class l_daLv2Candle_Method = { (process_method_func)daLv2Candle_Create, (process_method_func)daLv2Candle_Delete, (process_method_func)daLv2Candle_Execute, @@ -394,7 +394,7 @@ static actor_method_class l_daLv2Candle_Method = { (process_method_func)daLv2Candle_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv2Candle = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv2Candle = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv3Candle.cpp b/src/d/actor/d_a_obj_lv3Candle.cpp index 784af3210b..6f12a81bd3 100644 --- a/src/d/actor/d_a_obj_lv3Candle.cpp +++ b/src/d/actor/d_a_obj_lv3Candle.cpp @@ -34,16 +34,16 @@ void daLv3Candle_HIO_c::genMessage(JORMContext* mctx) { } #endif -dCcD_SrcGObjInf const daLv3Candle_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daLv3Candle_c::mCcDObjInfo = { {0, {{0x200, 0, 0x13}, {0xd8fbfdff, 0x1f}, {0x79}}}, {1, 0, 0, 0, 0}, {0xa, 0, 0, 0, 6}, {0}, }; -dCcD_SrcSph daLv3Candle_c::mCcDSph = {daLv3Candle_c::mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 0.0f}}}; +DUSK_GAME_DATA dCcD_SrcSph daLv3Candle_c::mCcDSph = {daLv3Candle_c::mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 0.0f}}}; -static char* l_resNameIdx[] = {"L3candl", "L3candl2"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[] = {"L3candl", "L3candl2"}; void daLv3Candle_c::setBaseMtx() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); @@ -238,13 +238,13 @@ static int daLv3Candle_Create(fopAc_ac_c* i_this) { return actor->create(); } -static actor_method_class l_daLv3Candle_Method = { +static DUSK_CONST actor_method_class l_daLv3Candle_Method = { (process_method_func)daLv3Candle_Create, (process_method_func)daLv3Candle_Delete, (process_method_func)daLv3Candle_Execute, NULL, (process_method_func)daLv3Candle_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv3Candle = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3Candle = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv3Water.cpp b/src/d/actor/d_a_obj_lv3Water.cpp index d0b5490c8d..22226f64b2 100644 --- a/src/d/actor/d_a_obj_lv3Water.cpp +++ b/src/d/actor/d_a_obj_lv3Water.cpp @@ -78,7 +78,7 @@ static const int l_btkIdrIdx[] = { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, -1, -1, }; -static char* l_resNameIdx[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[] = { "Kr10water", "Kr10wat01", "Kr02wat00", "Kr03wat00", "Kr03wat01", "Kr03wat02", "Kr03wat03", "Kr03wat04", "Kr07wat00", "Kr08wat00", "Kr08wat01", "Kr02wat01", "Kr02wat02", "Kr02wat03", "Kr11wat00", "Kr12wat00", "Kr13wat00", "Kr13wat01", "Kr13wat02", "Kr03wat05", "Kr03wat06", @@ -452,13 +452,13 @@ static int daLv3Water_Create(fopAc_ac_c* i_this) { return actor->create(); } -static actor_method_class l_daLv3Water_Method = { +static DUSK_CONST actor_method_class l_daLv3Water_Method = { (process_method_func)daLv3Water_Create, (process_method_func)daLv3Water_Delete, (process_method_func)daLv3Water_Execute, 0, (process_method_func)daLv3Water_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv3Water = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3Water = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv3Water2.cpp b/src/d/actor/d_a_obj_lv3Water2.cpp index 32995e646b..97290e43a4 100644 --- a/src/d/actor/d_a_obj_lv3Water2.cpp +++ b/src/d/actor/d_a_obj_lv3Water2.cpp @@ -39,7 +39,7 @@ void daLv3Water2_HIO_c::genMessage(JORMContext* ctx) { } #endif -static char* l_resNameIdx[] = {"Kr03wat04"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[] = {"Kr03wat04"}; void daLv3Water2_c::setBaseMtx() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); @@ -283,7 +283,7 @@ static int daLv3Water2_Create(fopAc_ac_c* i_this) { return actor->create(); } -static actor_method_class l_daLv3Water2_Method = { +static DUSK_CONST actor_method_class l_daLv3Water2_Method = { (process_method_func)daLv3Water2_Create, (process_method_func)daLv3Water2_Delete, (process_method_func)daLv3Water2_Execute, @@ -291,7 +291,7 @@ static actor_method_class l_daLv3Water2_Method = { (process_method_func)daLv3Water2_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv3Water2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3Water2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv3WaterB.cpp b/src/d/actor/d_a_obj_lv3WaterB.cpp index f4ad49685d..b1c84808c3 100644 --- a/src/d/actor/d_a_obj_lv3WaterB.cpp +++ b/src/d/actor/d_a_obj_lv3WaterB.cpp @@ -213,13 +213,13 @@ static int daObj_Lv3waterB_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daObj_Lv3waterB_Method = { +static DUSK_CONST actor_method_class l_daObj_Lv3waterB_Method = { (process_method_func)daObj_Lv3waterB_Create, (process_method_func)daObj_Lv3waterB_Delete, (process_method_func)daObj_Lv3waterB_Execute, (process_method_func)daObj_Lv3waterB_IsDelete, (process_method_func)daObj_Lv3waterB_Draw, }; -actor_process_profile_definition g_profile_OBJ_LV3WATERB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_LV3WATERB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv3saka00.cpp b/src/d/actor/d_a_obj_lv3saka00.cpp index 792747c664..06b9f63186 100644 --- a/src/d/actor/d_a_obj_lv3saka00.cpp +++ b/src/d/actor/d_a_obj_lv3saka00.cpp @@ -11,7 +11,7 @@ #include "f_pc/f_pc_name.h" #include "m_Do/m_Do_mtx.h" -static char* l_arcName[] = {"Obj_saka", "Obj_saka2"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[] = {"Obj_saka", "Obj_saka2"}; #if DEBUG class daObjLv3saka_HIO_c : public mDoHIO_entry_c { @@ -178,12 +178,12 @@ static int daObjLv3saka_MoveBGDraw(daObjLv3saka_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv3saka_METHODS = { +static DUSK_CONST actor_method_class daObjLv3saka_METHODS = { (process_method_func)daObjLv3saka_create1st, (process_method_func)daObjLv3saka_MoveBGDelete, (process_method_func)daObjLv3saka_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjLv3saka_MoveBGDraw}; -actor_process_profile_definition g_profile_Obj_Lv3R10Saka = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv3R10Saka = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv3waterEff.cpp b/src/d/actor/d_a_obj_lv3waterEff.cpp index 07b3dfb7bc..af29a4b71c 100644 --- a/src/d/actor/d_a_obj_lv3waterEff.cpp +++ b/src/d/actor/d_a_obj_lv3waterEff.cpp @@ -92,7 +92,7 @@ static int daObjWaterEff_Create(fopAc_ac_c* i_this) { return actor->create(); } -static actor_method_class l_daObjWaterEff_Method = { +static DUSK_CONST actor_method_class l_daObjWaterEff_Method = { (process_method_func)daObjWaterEff_Create, (process_method_func)daObjWaterEff_Delete, (process_method_func)daObjWaterEff_Execute, @@ -100,7 +100,7 @@ static actor_method_class l_daObjWaterEff_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Obj_WaterEff = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WaterEff = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp index 7212b0f492..3a35c879f3 100644 --- a/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp +++ b/src/d/actor/d_a_obj_lv4CandleDemoTag.cpp @@ -186,7 +186,7 @@ static int dalv4CandleDemoTag_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_dalv4CandleDemoTag_Method = { +static DUSK_CONST actor_method_class l_dalv4CandleDemoTag_Method = { (process_method_func)dalv4CandleDemoTag_Create, (process_method_func)dalv4CandleDemoTag_Delete, (process_method_func)dalv4CandleDemoTag_Execute, @@ -194,7 +194,7 @@ static actor_method_class l_dalv4CandleDemoTag_Method = { (process_method_func)dalv4CandleDemoTag_Draw, }; -actor_process_profile_definition g_profile_Tag_Lv4CandleDm = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv4CandleDm = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4CandleTag.cpp b/src/d/actor/d_a_obj_lv4CandleTag.cpp index e25c5f1cd1..70c047c03d 100644 --- a/src/d/actor/d_a_obj_lv4CandleTag.cpp +++ b/src/d/actor/d_a_obj_lv4CandleTag.cpp @@ -140,7 +140,7 @@ static int dalv4CandleTag_Create(fopAc_ac_c* i_this) { return ((dalv4CandleTag_c*)i_this)->create(); } -static actor_method_class l_dalv4CandleTag_Method = { +static DUSK_CONST actor_method_class l_dalv4CandleTag_Method = { (process_method_func)dalv4CandleTag_Create, (process_method_func)dalv4CandleTag_Delete, (process_method_func)dalv4CandleTag_Execute, @@ -148,7 +148,7 @@ static actor_method_class l_dalv4CandleTag_Method = { (process_method_func)dalv4CandleTag_Draw, }; -actor_process_profile_definition g_profile_Tag_Lv4Candle = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv4Candle = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4EdShutter.cpp b/src/d/actor/d_a_obj_lv4EdShutter.cpp index 64868f15b2..46a238bbd3 100644 --- a/src/d/actor/d_a_obj_lv4EdShutter.cpp +++ b/src/d/actor/d_a_obj_lv4EdShutter.cpp @@ -214,7 +214,7 @@ static int daLv4EdShutter_Create(fopAc_ac_c* i_this) { return ((daLv4EdShutter_c*)i_this)->create(); } -static actor_method_class l_daLv4EdShutter_Method = { +static DUSK_CONST actor_method_class l_daLv4EdShutter_Method = { (process_method_func)daLv4EdShutter_Create, (process_method_func)daLv4EdShutter_Delete, (process_method_func)daLv4EdShutter_Execute, @@ -222,7 +222,7 @@ static actor_method_class l_daLv4EdShutter_Method = { (process_method_func)daLv4EdShutter_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv4EdShutter = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4EdShutter = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4Gate.cpp b/src/d/actor/d_a_obj_lv4Gate.cpp index 3d1ff0a730..68f8799723 100644 --- a/src/d/actor/d_a_obj_lv4Gate.cpp +++ b/src/d/actor/d_a_obj_lv4Gate.cpp @@ -173,13 +173,13 @@ static int daLv4Gate_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daLv4Gate_Method = { +static DUSK_CONST actor_method_class l_daLv4Gate_Method = { (process_method_func)daLv4Gate_Create, (process_method_func)daLv4Gate_Delete, (process_method_func)daLv4Gate_Execute, (process_method_func)NULL, (process_method_func)daLv4Gate_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv4Gate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Gate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4HsTarget.cpp b/src/d/actor/d_a_obj_lv4HsTarget.cpp index ed66cdddb4..face5c51ce 100644 --- a/src/d/actor/d_a_obj_lv4HsTarget.cpp +++ b/src/d/actor/d_a_obj_lv4HsTarget.cpp @@ -84,13 +84,13 @@ static int daLv4HsTarget_Create(fopAc_ac_c* i_this) { static daLv4HsTarget_HIO_c l_HIO; -static actor_method_class l_daLv4HsTarget_Method = { +static DUSK_CONST actor_method_class l_daLv4HsTarget_Method = { (process_method_func)daLv4HsTarget_Create, (process_method_func)daLv4HsTarget_Delete, (process_method_func)daLv4HsTarget_Execute, (process_method_func)NULL, (process_method_func)daLv4HsTarget_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv4HsTarget = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4HsTarget = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4PoGate.cpp b/src/d/actor/d_a_obj_lv4PoGate.cpp index eb0b5442ec..cc9e9068e5 100644 --- a/src/d/actor/d_a_obj_lv4PoGate.cpp +++ b/src/d/actor/d_a_obj_lv4PoGate.cpp @@ -253,13 +253,13 @@ static int daLv4PoGate_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daLv4PoGate_Method = { +static DUSK_CONST actor_method_class l_daLv4PoGate_Method = { (process_method_func)daLv4PoGate_Create, (process_method_func)daLv4PoGate_Delete, (process_method_func)daLv4PoGate_Execute, (process_method_func)NULL, (process_method_func)daLv4PoGate_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv4PoGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4PoGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4RailWall.cpp b/src/d/actor/d_a_obj_lv4RailWall.cpp index 9128376496..98ad348663 100644 --- a/src/d/actor/d_a_obj_lv4RailWall.cpp +++ b/src/d/actor/d_a_obj_lv4RailWall.cpp @@ -10,7 +10,7 @@ #include "d/actor/d_a_b_ds.h" #include "d/d_s_play.h" -static char* l_arcName = "P_L4Rwall"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_L4Rwall"; static void* s_BossSearch(void* i_actor, void* i_data) { if (fopAcM_IsActor(i_actor) && fopAcM_GetName(i_actor) == fpcNm_B_DS_e) { @@ -241,7 +241,7 @@ static int daObjLv4Wall_MoveBGDraw(daObjLv4Wall_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv4Wall_METHODS = { +static DUSK_CONST actor_method_class daObjLv4Wall_METHODS = { (process_method_func)daObjLv4Wall_create1st, (process_method_func)daObjLv4Wall_MoveBGDelete, (process_method_func)daObjLv4Wall_MoveBGExecute, @@ -249,7 +249,7 @@ static actor_method_class daObjLv4Wall_METHODS = { (process_method_func)daObjLv4Wall_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4RailWall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4RailWall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4SlideWall.cpp b/src/d/actor/d_a_obj_lv4SlideWall.cpp index 2742339487..cce1c80f26 100644 --- a/src/d/actor/d_a_obj_lv4SlideWall.cpp +++ b/src/d/actor/d_a_obj_lv4SlideWall.cpp @@ -167,7 +167,7 @@ static int daSldWall_Create(fopAc_ac_c* i_this) { return ((daSldWall_c*)i_this)->create(); } -static actor_method_class l_daSldWall_Method = { +static DUSK_CONST actor_method_class l_daSldWall_Method = { (process_method_func)daSldWall_Create, (process_method_func)daSldWall_Delete, (process_method_func)daSldWall_Execute, @@ -175,7 +175,7 @@ static actor_method_class l_daSldWall_Method = { (process_method_func)daSldWall_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv4SlideWall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4SlideWall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4bridge.cpp b/src/d/actor/d_a_obj_lv4bridge.cpp index b11fa22d55..9b260823cc 100644 --- a/src/d/actor/d_a_obj_lv4bridge.cpp +++ b/src/d/actor/d_a_obj_lv4bridge.cpp @@ -41,7 +41,7 @@ int daObjLv4Brg_c::Create() { return 1; } -static char* l_arcName = "Obj_l4brg"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_l4brg"; int daObjLv4Brg_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -162,7 +162,7 @@ static int daObjLv4Brg_MoveBGDraw(daObjLv4Brg_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv4Brg_METHODS = { +static DUSK_CONST actor_method_class daObjLv4Brg_METHODS = { (process_method_func)daObjLv4Brg_create1st, (process_method_func)daObjLv4Brg_MoveBGDelete, (process_method_func)daObjLv4Brg_MoveBGExecute, @@ -170,7 +170,7 @@ static actor_method_class daObjLv4Brg_METHODS = { (process_method_func)daObjLv4Brg_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4Bridge = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Bridge = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4chandelier.cpp b/src/d/actor/d_a_obj_lv4chandelier.cpp index fbd0cf2fe0..7847b37358 100644 --- a/src/d/actor/d_a_obj_lv4chandelier.cpp +++ b/src/d/actor/d_a_obj_lv4chandelier.cpp @@ -13,7 +13,7 @@ #include "d/d_cc_uty.h" #ifndef __MWERKS__ -#include "dusk/math.h" +#include "helpers/math.h" #endif #if DEBUG @@ -36,7 +36,7 @@ static void rideCallBack(dBgW* i_bgw, fopAc_ac_c* param_2, fopAc_ac_c* param_3) ((daObjLv4Chan_c*)param_2)->rideActor(param_3); } -static char* l_arcName = "P_Lv4Chan"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Lv4Chan"; int daObjLv4Chan_c::create1st() { int rv = dComIfG_resLoad(this, l_arcName); @@ -869,7 +869,7 @@ static int daObjLv4Chan_MoveBGDraw(daObjLv4Chan_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv4Chan_METHODS = { +static DUSK_CONST actor_method_class daObjLv4Chan_METHODS = { (process_method_func)daObjLv4Chan_create1st, (process_method_func)daObjLv4Chan_MoveBGDelete, (process_method_func)daObjLv4Chan_MoveBGExecute, @@ -877,7 +877,7 @@ static actor_method_class daObjLv4Chan_METHODS = { (process_method_func)daObjLv4Chan_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4Chan = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Chan = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4digsand.cpp b/src/d/actor/d_a_obj_lv4digsand.cpp index 53a1e05511..f25f0907a6 100644 --- a/src/d/actor/d_a_obj_lv4digsand.cpp +++ b/src/d/actor/d_a_obj_lv4digsand.cpp @@ -33,7 +33,7 @@ int daObjL4DigSand_c::Create() { return 1; } -static char* l_arcName = "P_DSand"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_DSand"; int daObjL4DigSand_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -171,7 +171,7 @@ static int daObjL4DigSand_MoveBGDraw(daObjL4DigSand_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjL4DigSand_METHODS = { +static DUSK_CONST actor_method_class daObjL4DigSand_METHODS = { (process_method_func)daObjL4DigSand_create1st, (process_method_func)daObjL4DigSand_MoveBGDelete, (process_method_func)daObjL4DigSand_MoveBGExecute, @@ -179,7 +179,7 @@ static actor_method_class daObjL4DigSand_METHODS = { (process_method_func)daObjL4DigSand_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4DigSand = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4DigSand = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4floor.cpp b/src/d/actor/d_a_obj_lv4floor.cpp index ab04768a0a..d7f76e3304 100644 --- a/src/d/actor/d_a_obj_lv4floor.cpp +++ b/src/d/actor/d_a_obj_lv4floor.cpp @@ -27,7 +27,7 @@ int daObjLv4Floor_c::Create() { return 1; } -static char* l_arcName = "P_L4Floor"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_L4Floor"; int daObjLv4Floor_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -132,7 +132,7 @@ static int daObjLv4Floor_MoveBGDraw(daObjLv4Floor_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv4Floor_METHODS = { +static DUSK_CONST actor_method_class daObjLv4Floor_METHODS = { (process_method_func)daObjLv4Floor_create1st, (process_method_func)daObjLv4Floor_MoveBGDelete, (process_method_func)daObjLv4Floor_MoveBGExecute, @@ -140,7 +140,7 @@ static actor_method_class daObjLv4Floor_METHODS = { (process_method_func)daObjLv4Floor_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4Floor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Floor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4gear.cpp b/src/d/actor/d_a_obj_lv4gear.cpp index 02ea392cb9..25b61dc52b 100644 --- a/src/d/actor/d_a_obj_lv4gear.cpp +++ b/src/d/actor/d_a_obj_lv4gear.cpp @@ -47,7 +47,7 @@ int daObjLv4Gear_c::Create() { static int const l_bmd[] = {4, 3}; -static char* l_arcName = "P_Gear"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Gear"; int daObjLv4Gear_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, l_bmd[mType]); @@ -154,13 +154,13 @@ static int daObjLv4Gear_Create(daObjLv4Gear_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjLv4Gear_Method = { +static DUSK_CONST actor_method_class l_daObjLv4Gear_Method = { (process_method_func)daObjLv4Gear_Create, (process_method_func)daObjLv4Gear_Delete, (process_method_func)daObjLv4Gear_Execute, (process_method_func)NULL, (process_method_func)daObjLv4Gear_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv4Gear = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Gear = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4prelvtr.cpp b/src/d/actor/d_a_obj_lv4prelvtr.cpp index a8f9a9061a..488496f4e9 100644 --- a/src/d/actor/d_a_obj_lv4prelvtr.cpp +++ b/src/d/actor/d_a_obj_lv4prelvtr.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_obj_lv4prelvtr.h" #include "d/d_com_inf_game.h" -static char* l_arcName = "PRElvtr"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "PRElvtr"; int daObjPRElvtr_c::create1st() { int phase = dComIfG_resLoad(this, l_arcName); @@ -109,13 +109,13 @@ static int daObjPRElvtr_MoveBGDraw(daObjPRElvtr_c* i_this) { return i_this->Draw(); } -static actor_method_class daObjPRElvtr_METHODS = { +static DUSK_CONST actor_method_class daObjPRElvtr_METHODS = { (process_method_func)daObjPRElvtr_create1st, (process_method_func)daObjPRElvtr_MoveBGDelete, (process_method_func)daObjPRElvtr_MoveBGExecute, 0, (process_method_func)daObjPRElvtr_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_PRElvtr = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_PRElvtr = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4prwall.cpp b/src/d/actor/d_a_obj_lv4prwall.cpp index 76e24dd16f..de2e112fb3 100644 --- a/src/d/actor/d_a_obj_lv4prwall.cpp +++ b/src/d/actor/d_a_obj_lv4prwall.cpp @@ -20,7 +20,7 @@ static const int l_bmdidx[] = { 4, }; -static char* l_arcName[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[3] = { "PRWallR09", "P_Rwall", "PRWallR04", @@ -294,7 +294,7 @@ static int daObjLv4PRwall_MoveBGDraw(daObjLv4PRwall_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv4PRwall_METHODS = { +static DUSK_CONST actor_method_class daObjLv4PRwall_METHODS = { (process_method_func)daObjLv4PRwall_create1st, (process_method_func)daObjLv4PRwall_MoveBGDelete, (process_method_func)daObjLv4PRwall_MoveBGExecute, @@ -302,7 +302,7 @@ static actor_method_class daObjLv4PRwall_METHODS = { (process_method_func)daObjLv4PRwall_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4PRwall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4PRwall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv4sand.cpp b/src/d/actor/d_a_obj_lv4sand.cpp index 13f08b6534..89513ee80e 100644 --- a/src/d/actor/d_a_obj_lv4sand.cpp +++ b/src/d/actor/d_a_obj_lv4sand.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_obj_lv4sand.h" #include "d/d_s_play.h" -static char* l_arcName = "P_L4Sand"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_L4Sand"; void daObjLv4Sand_c::initBaseMtx() { mpModel->setBaseScale(scale); @@ -162,7 +162,7 @@ static int daObjLv4Sand_MoveBGDraw(daObjLv4Sand_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv4Sand_METHODS = { +static DUSK_CONST actor_method_class daObjLv4Sand_METHODS = { (process_method_func)daObjLv4Sand_create1st, (process_method_func)daObjLv4Sand_MoveBGDelete, (process_method_func)daObjLv4Sand_MoveBGExecute, @@ -170,7 +170,7 @@ static actor_method_class daObjLv4Sand_METHODS = { (process_method_func)daObjLv4Sand_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv4Sand = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv4Sand = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv5FloorBoard.cpp b/src/d/actor/d_a_obj_lv5FloorBoard.cpp index fc3819cf08..4dbd3cfe5c 100644 --- a/src/d/actor/d_a_obj_lv5FloorBoard.cpp +++ b/src/d/actor/d_a_obj_lv5FloorBoard.cpp @@ -76,14 +76,14 @@ int daFlorBoad_c::Execute(Mtx** param_0) { static daFlorBoad_HIO_c l_HIO; -const dCcD_SrcGObjInf daFlorBoad_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daFlorBoad_c::mCcDObjInfo = { {0, {{0, 1, 0}, {0x400020, 0x11}, {0}}}, {dCcD_SE_SWORD, 0, 0, 2, 1}, {dCcD_SE_STONE, 0, 0, 0, 6}, {0}, }; -dCcD_SrcCyl daFlorBoad_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daFlorBoad_c::mCcDCyl = { daFlorBoad_c::mCcDObjInfo, { { @@ -183,13 +183,13 @@ static int daFlorBoad_Create(fopAc_ac_c* i_this) { return ((daFlorBoad_c*)i_this)->create(); } -static actor_method_class l_daFlorBoad_Method = { +static DUSK_CONST actor_method_class l_daFlorBoad_Method = { (process_method_func)daFlorBoad_Create, (process_method_func)daFlorBoad_Delete, (process_method_func)daFlorBoad_Execute, (process_method_func)NULL, (process_method_func)daFlorBoad_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv5FBoard = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv5FBoard = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv5IceWall.cpp b/src/d/actor/d_a_obj_lv5IceWall.cpp index dc17845331..f514f80a98 100644 --- a/src/d/actor/d_a_obj_lv5IceWall.cpp +++ b/src/d/actor/d_a_obj_lv5IceWall.cpp @@ -50,14 +50,14 @@ int daIceWall_c::CreateHeap() { static daIceWall_HIO_c l_HIO; -const dCcD_SrcGObjInf daIceWall_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daIceWall_c::mCcDObjInfo = { {0, {{0x100, 1, 0}, {0x400000, 0x11}, {0}}}, {dCcD_SE_SWORD, 0, 0, 2, 1}, {dCcD_SE_STONE, 0, 0, 0, 0x2006}, {0}, }; -dCcD_SrcCyl daIceWall_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daIceWall_c::mCcDCyl = { daIceWall_c::mCcDObjInfo, { { @@ -289,13 +289,13 @@ static int daIceWall_Create(fopAc_ac_c* i_this) { return ((daIceWall_c*)i_this)->create(); } -static actor_method_class l_daIceWall_Method = { +static DUSK_CONST actor_method_class l_daIceWall_Method = { (process_method_func)daIceWall_Create, (process_method_func)daIceWall_Delete, (process_method_func)daIceWall_Execute, (process_method_func)NULL, (process_method_func)daIceWall_Draw, }; -actor_process_profile_definition g_profile_Obj_IceWall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_IceWall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv5SwIce.cpp b/src/d/actor/d_a_obj_lv5SwIce.cpp index 2ff52396c0..8c474aa125 100644 --- a/src/d/actor/d_a_obj_lv5SwIce.cpp +++ b/src/d/actor/d_a_obj_lv5SwIce.cpp @@ -70,14 +70,14 @@ int daLv5SwIce_c::Execute(Mtx** param_0) { static daLv5SwIce_HIO_c l_HIO; -const dCcD_SrcGObjInf daLv5SwIce_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daLv5SwIce_c::mCcDObjInfo = { {0, {{0x100, 1, 0}, {0x400000, 0x11}, {0}}}, {dCcD_SE_SWORD, 0, 0, 2, 1}, {dCcD_SE_STONE, 0, 0, 0, 0x6}, {0}, }; -dCcD_SrcCyl daLv5SwIce_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv5SwIce_c::mCcDCyl = { daLv5SwIce_c::mCcDObjInfo, { { @@ -193,13 +193,13 @@ static int daLv5SwIce_Create(fopAc_ac_c* i_this) { return ((daLv5SwIce_c*)i_this)->create(); } -static actor_method_class l_daLv5SwIce_Method = { +static DUSK_CONST actor_method_class l_daLv5SwIce_Method = { (process_method_func)daLv5SwIce_Create, (process_method_func)daLv5SwIce_Delete, (process_method_func)daLv5SwIce_Execute, (process_method_func)NULL, (process_method_func)daLv5SwIce_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv5SwIce = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv5SwIce = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv5ychndlr.cpp b/src/d/actor/d_a_obj_lv5ychndlr.cpp index 22eaac0e15..cf39d80a4f 100644 --- a/src/d/actor/d_a_obj_lv5ychndlr.cpp +++ b/src/d/actor/d_a_obj_lv5ychndlr.cpp @@ -11,7 +11,7 @@ #include "d/d_bg_w.h" #include "d/d_com_inf_game.h" -static char* l_arcName = "Ychandelr"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Ychandelr"; int daObjYchndlr_c::create1st() { int phase = dComIfG_resLoad(this, l_arcName); @@ -354,13 +354,13 @@ static int daObjYchndlr_MoveBGDraw(daObjYchndlr_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjYchndlr_METHODS = { +static DUSK_CONST actor_method_class daObjYchndlr_METHODS = { (process_method_func)daObjYchndlr_create1st, (process_method_func)daObjYchndlr_MoveBGDelete, (process_method_func)daObjYchndlr_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjYchndlr_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Ychndlr = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ychndlr = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv5yiblltray.cpp b/src/d/actor/d_a_obj_lv5yiblltray.cpp index 7a9aa47e22..5bc8fea278 100644 --- a/src/d/actor/d_a_obj_lv5yiblltray.cpp +++ b/src/d/actor/d_a_obj_lv5yiblltray.cpp @@ -12,7 +12,7 @@ #include "d/d_com_inf_game.h" #include "d/actor/d_a_obj_carry.h" -static char* l_arcName = "YIblltray"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "YIblltray"; int daObjYIblltray_c::create1st() { int phase = dComIfG_resLoad(this, l_arcName); @@ -572,7 +572,7 @@ static int daObjYIblltray_MoveBGDraw(daObjYIblltray_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjYIblltray_METHODS = { +static DUSK_CONST actor_method_class daObjYIblltray_METHODS = { (process_method_func)daObjYIblltray_create1st, (process_method_func)daObjYIblltray_MoveBGDelete, (process_method_func)daObjYIblltray_MoveBGExecute, @@ -580,7 +580,7 @@ static actor_method_class daObjYIblltray_METHODS = { (process_method_func)daObjYIblltray_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_YIblltray = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_YIblltray = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6ChangeGate.cpp b/src/d/actor/d_a_obj_lv6ChangeGate.cpp index a725b4bdf8..3a3ae79af5 100644 --- a/src/d/actor/d_a_obj_lv6ChangeGate.cpp +++ b/src/d/actor/d_a_obj_lv6ChangeGate.cpp @@ -28,14 +28,14 @@ daLv6ChangeGate_HIO_c::daLv6ChangeGate_HIO_c() { static daLv6ChangeGate_HIO_c l_HIO; -const dCcD_SrcGObjInf daLv6ChangeGate_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daLv6ChangeGate_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0x400, 0x11}, {0x79}}}, {dCcD_SE_SWORD, 0, 0, 0, 0}, {dCcD_SE_STONE, 0, 0, 0, 0}, {0}, }; -dCcD_SrcCyl daLv6ChangeGate_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv6ChangeGate_c::mCcDCyl = { mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f} @@ -302,7 +302,7 @@ static int daLv6ChangeGate_Create(fopAc_ac_c* i_this) { return ((daLv6ChangeGate_c*)i_this)->create(); } -static actor_method_class l_daLv6ChangeGate_Method = { +static DUSK_CONST actor_method_class l_daLv6ChangeGate_Method = { (process_method_func)daLv6ChangeGate_Create, (process_method_func)daLv6ChangeGate_Delete, (process_method_func)daLv6ChangeGate_Execute, @@ -310,7 +310,7 @@ static actor_method_class l_daLv6ChangeGate_Method = { (process_method_func)daLv6ChangeGate_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6ChgGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6ChgGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6FurikoTrap.cpp b/src/d/actor/d_a_obj_lv6FurikoTrap.cpp index ae0828e248..bd31d398c6 100644 --- a/src/d/actor/d_a_obj_lv6FurikoTrap.cpp +++ b/src/d/actor/d_a_obj_lv6FurikoTrap.cpp @@ -24,13 +24,13 @@ void daLv6FurikoTrap_HIO_c::genMessage(JORMContext* context) { static daLv6FurikoTrap_HIO_c l_HIO; -const dCcD_SrcGObjInf daLv6FurikoTrap_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daLv6FurikoTrap_c::mCcDObjInfo = { {0, {{0x800, 1, 0x1f}, {0, 0}, {0x79}}}, {1, 0, 1, 0, 1}, {0xa, 5, 0, 0, 0}, {0}, }; -dCcD_SrcSph daLv6FurikoTrap_c::mCcDSph = {mCcDObjInfo}; +DUSK_GAME_DATA dCcD_SrcSph daLv6FurikoTrap_c::mCcDSph = {mCcDObjInfo}; void daLv6FurikoTrap_c::setBaseMtx() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); @@ -185,7 +185,7 @@ static int daLv6FurikoTrap_Create(fopAc_ac_c* i_this) { return this_trap->create(); } -static actor_method_class l_daLv6FurikoTrap_Method = { +static DUSK_CONST actor_method_class l_daLv6FurikoTrap_Method = { (process_method_func)daLv6FurikoTrap_Create, (process_method_func)daLv6FurikoTrap_Delete, (process_method_func)daLv6FurikoTrap_Execute, @@ -193,7 +193,7 @@ static actor_method_class l_daLv6FurikoTrap_Method = { (process_method_func)daLv6FurikoTrap_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6FuriTrap = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6FuriTrap = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6Lblock.cpp b/src/d/actor/d_a_obj_lv6Lblock.cpp index dbb701b0b1..f9e0badc72 100644 --- a/src/d/actor/d_a_obj_lv6Lblock.cpp +++ b/src/d/actor/d_a_obj_lv6Lblock.cpp @@ -171,7 +171,7 @@ static int daLv6Lblock_Create(fopAc_ac_c* i_this) { return ((daLv6Lblock_c*)i_this)->create(); } -static actor_method_class l_daLv6Lblock_Method = { +static DUSK_CONST actor_method_class l_daLv6Lblock_Method = { (process_method_func)daLv6Lblock_Create, (process_method_func)daLv6Lblock_Delete, (process_method_func)daLv6Lblock_Execute, @@ -179,7 +179,7 @@ static actor_method_class l_daLv6Lblock_Method = { (process_method_func)daLv6Lblock_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6Lblock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6Lblock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6SwGate.cpp b/src/d/actor/d_a_obj_lv6SwGate.cpp index c8b4b62b61..cdcc97efde 100644 --- a/src/d/actor/d_a_obj_lv6SwGate.cpp +++ b/src/d/actor/d_a_obj_lv6SwGate.cpp @@ -31,11 +31,11 @@ void daLv6SwGate_HIO_c::genMessage(JORMContext* context) static daLv6SwGate_HIO_c l_HIO; -const dCcD_SrcGObjInf daLv6SwGate_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daLv6SwGate_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0x400, 0x11}, {0x79}}}, {1, 0, 0, 0, 0}, {0xA, 0, 0, 0, 0}, {0} }; -dCcD_SrcCyl daLv6SwGate_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv6SwGate_c::mCcDCyl = { mCcDObjInfo, { { @@ -46,7 +46,7 @@ dCcD_SrcCyl daLv6SwGate_c::mCcDCyl = { } // mCylAttr }; -static cull_box l_cull_box = {-1200.0f, -300.0f, -100.0f, 1200.0f, 300.0f, 100.0f}; +static DUSK_CONSTEXPR cull_box l_cull_box = {-1200.0f, -300.0f, -100.0f, 1200.0f, 300.0f, 100.0f}; void daLv6SwGate_c::setBaseMtx() { mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); @@ -314,7 +314,7 @@ static int daLv6SwGate_Create(fopAc_ac_c* i_this) { return gate->create(); } -static actor_method_class l_daLv6SwGate_Method = { +static DUSK_CONST actor_method_class l_daLv6SwGate_Method = { (process_method_func)daLv6SwGate_Create, (process_method_func)daLv6SwGate_Delete, (process_method_func)daLv6SwGate_Execute, @@ -322,7 +322,7 @@ static actor_method_class l_daLv6SwGate_Method = { (process_method_func)daLv6SwGate_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6SwGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6SwGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6SzGate.cpp b/src/d/actor/d_a_obj_lv6SzGate.cpp index b5c02b197d..7d21557671 100644 --- a/src/d/actor/d_a_obj_lv6SzGate.cpp +++ b/src/d/actor/d_a_obj_lv6SzGate.cpp @@ -9,7 +9,7 @@ #include "d/d_bg_w.h" #include "d/d_com_inf_game.h" -static cull_box l_cull_box = {{-1200.0f, -300.0f, -100.0f}, {1200.0f, 300.0f, 100.0f}}; +static DUSK_CONSTEXPR cull_box l_cull_box = {{-1200.0f, -300.0f, -100.0f}, {1200.0f, 300.0f, 100.0f}}; static daLv6SzGate_HIO_c l_HIO; @@ -250,13 +250,13 @@ static int daLv6SzGate_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daLv6SzGate_Method = { +static DUSK_CONST actor_method_class l_daLv6SzGate_Method = { (process_method_func)daLv6SzGate_Create, (process_method_func)daLv6SzGate_Delete, (process_method_func)daLv6SzGate_Execute, (process_method_func)NULL, (process_method_func)daLv6SzGate_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6SzGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6SzGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6Tenbin.cpp b/src/d/actor/d_a_obj_lv6Tenbin.cpp index 4f36a4ffbf..4c6fd2936d 100644 --- a/src/d/actor/d_a_obj_lv6Tenbin.cpp +++ b/src/d/actor/d_a_obj_lv6Tenbin.cpp @@ -50,7 +50,7 @@ void daTenbin_HIO_c::genMessage(JORMContext* context) { } #endif -static cull_box l_cull_box = {-300.0f, -500.0f, -400.0f, 1200.0f, 300.0f, 1300.0f}; +static DUSK_CONSTEXPR cull_box l_cull_box = {-300.0f, -500.0f, -400.0f, 1200.0f, 300.0f, 1300.0f}; static daTenbin_HIO_c l_HIO; @@ -346,7 +346,7 @@ static int daTenbin_Create(fopAc_ac_c* i_this) { return this_tenbin->create(); } -static actor_method_class l_daTenbin_Method = { +static DUSK_CONST actor_method_class l_daTenbin_Method = { (process_method_func)daTenbin_Create, (process_method_func)daTenbin_Delete, (process_method_func)daTenbin_Execute, @@ -354,7 +354,7 @@ static actor_method_class l_daTenbin_Method = { (process_method_func)daTenbin_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6Tenbin = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6Tenbin = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6TogeRoll.cpp b/src/d/actor/d_a_obj_lv6TogeRoll.cpp index 386a9e5ea0..694b3242cd 100644 --- a/src/d/actor/d_a_obj_lv6TogeRoll.cpp +++ b/src/d/actor/d_a_obj_lv6TogeRoll.cpp @@ -10,14 +10,14 @@ static daTogeRoll_HIO_c l_HIO; -dCcD_SrcSph daTogeRoll_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daTogeRoll_c::mCcDSph = { daTogeRoll_c::mCcDObjInfo, // mObjInf { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph } // mSphAttr }; -dCcD_SrcCps daTogeRoll_c::mCcDCps = { +DUSK_GAME_DATA dCcD_SrcCps daTogeRoll_c::mCcDCps = { daTogeRoll_c::mCcDObjInfo2, // mObjInf { {{0.0f, 0.0f, 0.0f}, {0.0f, 1100.0f, 0.0f}, 150.0f}, // mCps @@ -50,21 +50,21 @@ int daTogeRoll_c::CreateHeap() { return 1; } -dCcD_SrcGObjInf const daTogeRoll_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daTogeRoll_c::mCcDObjInfo = { {0, {{0x800, 0x1, 0x1f}, {0xdafbfdff, 0x1f}, {0x79}}}, {1, 0, 1, 0, 1}, {0xa, 5, 0, 0, 0}, {0}, }; -dCcD_SrcGObjInf const daTogeRoll_c::mCcDObjInfo2 = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daTogeRoll_c::mCcDObjInfo2 = { {0, {{0, 0, 0}, {0xdafbfdff, 0x1f}, {0}}}, {1, 0, 0, 0, 0}, {0xa, 1, 0, 0, 2}, {0}, }; -f32 const daTogeRoll_c::mSpeed[] = { +DUSK_GAME_DATA f32 const daTogeRoll_c::mSpeed[] = { 10.0f, 16.6666666f, 23.3333333f, 25.0f, 26.6666666f, 28.3333333f, 30.0f, 31.6666666f, 33.3333333f, 40.0f, 46.6666666f, 53.3333333f, 60.0f, 66.6666666f, 83.3333333f, 3.3333333f, @@ -432,13 +432,13 @@ static int daTogeRoll_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daTogeRoll_Method = { +static DUSK_CONST actor_method_class l_daTogeRoll_Method = { (process_method_func)daTogeRoll_Create, (process_method_func)daTogeRoll_Delete, (process_method_func)daTogeRoll_Execute, 0, (process_method_func)daTogeRoll_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6TogeRoll = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6TogeRoll = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6TogeTrap.cpp b/src/d/actor/d_a_obj_lv6TogeTrap.cpp index 24e41124bf..16399a899b 100644 --- a/src/d/actor/d_a_obj_lv6TogeTrap.cpp +++ b/src/d/actor/d_a_obj_lv6TogeTrap.cpp @@ -51,28 +51,28 @@ daLv6TogeTrap_HIO_c::daLv6TogeTrap_HIO_c() { static daLv6TogeTrap_HIO_c l_HIO; -const dCcD_SrcGObjInf daLv6TogeTrap_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daLv6TogeTrap_c::mCcDObjInfo = { {0, {{0x800, 0x1, 0x1F}, {0xD8FBFDFF, 0x11}, {0x79}}}, {dCcD_SE_SWORD, 0, 1, 0, 1}, {dCcD_SE_STONE, 5, 0, 0, 0}, {0}, }; -const dCcD_SrcGObjInf daLv6TogeTrap_c::mCcDObjInfo2 = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daLv6TogeTrap_c::mCcDObjInfo2 = { {0, {{0x0, 0x0, 0}, {0xDAFBFDFF, 0x11}, {0x0}}}, {dCcD_SE_SWORD, 0, 0, 0, 0}, {dCcD_SE_STONE, 1, 0, 0, 2}, {0}, }; -dCcD_SrcSph daLv6TogeTrap_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daLv6TogeTrap_c::mCcDSph = { daLv6TogeTrap_c::mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph } // mSphAttr }; -dCcD_SrcCyl daLv6TogeTrap_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daLv6TogeTrap_c::mCcDCyl = { daLv6TogeTrap_c::mCcDObjInfo2, { { @@ -83,13 +83,13 @@ dCcD_SrcCyl daLv6TogeTrap_c::mCcDCyl = { } }; -static char* l_resNameIdx[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[3] = { "L6TogeTp", "L4TogeTp", "L9Toge", }; -const f32 daLv6TogeTrap_c::mSpeed[16] = { +DUSK_GAME_DATA const f32 daLv6TogeTrap_c::mSpeed[16] = { 10.0f, 16.666666f, 23.333334f, @@ -764,7 +764,7 @@ static int daLv6TogeTrap_Create(fopAc_ac_c* i_this) { return ((daLv6TogeTrap_c*)i_this)->create(); } -static actor_method_class l_daLv6TogeTrap_Method = { +static DUSK_CONST actor_method_class l_daLv6TogeTrap_Method = { (process_method_func)daLv6TogeTrap_Create, (process_method_func)daLv6TogeTrap_Delete, (process_method_func)daLv6TogeTrap_Execute, @@ -772,7 +772,7 @@ static actor_method_class l_daLv6TogeTrap_Method = { (process_method_func)daLv6TogeTrap_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv6TogeTrap = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6TogeTrap = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6bemos.cpp b/src/d/actor/d_a_obj_lv6bemos.cpp index 760f09efb3..8703d1c376 100644 --- a/src/d/actor/d_a_obj_lv6bemos.cpp +++ b/src/d/actor/d_a_obj_lv6bemos.cpp @@ -108,9 +108,9 @@ void daObjL6Bm_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName = "Obj_lv6bm"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_lv6bm"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-200.0f, -100.0f, -200.0f}, {200.0f, 100.0f, 200.0f}, }; @@ -407,7 +407,7 @@ static int daObjL6Bm_MoveBGDraw(daObjL6Bm_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjL6Bm_METHODS = { +static DUSK_CONST actor_method_class daObjL6Bm_METHODS = { (process_method_func)daObjL6Bm_create1st, (process_method_func)daObjL6Bm_MoveBGDelete, (process_method_func)daObjL6Bm_MoveBGExecute, @@ -415,7 +415,7 @@ static actor_method_class daObjL6Bm_METHODS = { (process_method_func)daObjL6Bm_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv6bemos = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6bemos = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6bemos2.cpp b/src/d/actor/d_a_obj_lv6bemos2.cpp index be86aa46e6..247c3764db 100644 --- a/src/d/actor/d_a_obj_lv6bemos2.cpp +++ b/src/d/actor/d_a_obj_lv6bemos2.cpp @@ -107,21 +107,21 @@ void daObjLv6Bm_c::setBaseMtx() { mBeamEffectModel->setBaseTRMtx(mDoMtx_stack_c::get()); } -static char* l_arcName = "E_bm6"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "E_bm6"; -static char* l_eye_matName = "bm6_eye"; +static DUSK_CONSTEXPR char DUSK_CONST* l_eye_matName = "bm6_eye"; -static char* l_head_joint = "head"; +static DUSK_CONSTEXPR char DUSK_CONST* l_head_joint = "head"; -static char* l_bigGear_joint = "cogRed"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bigGear_joint = "cogRed"; -static char* l_smallGear0_joint = "cogBlue"; +static DUSK_CONSTEXPR char DUSK_CONST* l_smallGear0_joint = "cogBlue"; -static char* l_smallGear1_joint = "cogGreen"; +static DUSK_CONSTEXPR char DUSK_CONST* l_smallGear1_joint = "cogGreen"; -static char* l_smallGear2_joint = "cogYellow"; +static DUSK_CONSTEXPR char DUSK_CONST* l_smallGear2_joint = "cogYellow"; -static char* l_joint_table[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_joint_table[5] = { l_head_joint, l_bigGear_joint, l_smallGear0_joint, @@ -129,12 +129,12 @@ static char* l_joint_table[5] = { l_smallGear2_joint, }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-1200.0f, -100.0f, -1200.0f}, {1200.0f, 400.0f, 1200.0f}, }; -static dCcD_SrcSph l_sph_src = { +static DUSK_CONSTEXPR dCcD_SrcSph l_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x402420, 0x11}, 0x58}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -146,7 +146,7 @@ static dCcD_SrcSph l_sph_src = { } // mSphAttr }; -static dCcD_SrcCps l_cps_src = { +static DUSK_CONSTEXPR dCcD_SrcCps l_cps_src = { { {0x0, {{0x100, 0x1, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj {dCcD_SE_SWORD, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -158,7 +158,7 @@ static dCcD_SrcCps l_cps_src = { } // mCpsAttr }; -static dCcD_SrcCyl l_cyl_src = { +static DUSK_CONSTEXPR dCcD_SrcCyl l_cyl_src = { { {0x0, {{0x0, 0x0, 0x1e}, {0x400, 0x11}, 0x18}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -368,7 +368,7 @@ int daObjLv6Bm_c::Execute(f32 (**param_1)[3][4]) { } void daObjLv6Bm_c::action() { - static daObjLv6Bm_c::actionFunc l_func[6] = { + static DUSK_CONSTEXPR daObjLv6Bm_c::actionFunc l_func[6] = { &daObjLv6Bm_c::actionSwWait, &daObjLv6Bm_c::actionWarning, &daObjLv6Bm_c::actionFindPlayer, @@ -587,7 +587,7 @@ f32 daObjLv6Bm_c::getBeamSearchDistance() { } void daObjLv6Bm_c::effect_proc() { - static daObjLv6Bm_c::effectFunc l_eff_func[2] = { + static DUSK_CONSTEXPR daObjLv6Bm_c::effectFunc l_eff_func[2] = { &daObjLv6Bm_c::effectWait, &daObjLv6Bm_c::effectSet0, }; @@ -1167,7 +1167,7 @@ static int daObjLv6Bm_MoveBGDraw(daObjLv6Bm_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv6Bm_METHODS = { +static DUSK_CONST actor_method_class daObjLv6Bm_METHODS = { (process_method_func)daObjLv6Bm_create1st, (process_method_func)daObjLv6Bm_MoveBGDelete, (process_method_func)daObjLv6Bm_MoveBGExecute, @@ -1175,7 +1175,7 @@ static actor_method_class daObjLv6Bm_METHODS = { (process_method_func)daObjLv6Bm_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv6bemos2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6bemos2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6egate.cpp b/src/d/actor/d_a_obj_lv6egate.cpp index 1d81549d6a..58453509b7 100644 --- a/src/d/actor/d_a_obj_lv6egate.cpp +++ b/src/d/actor/d_a_obj_lv6egate.cpp @@ -7,7 +7,7 @@ #include "d/actor/d_a_obj_lv6egate.h" -static char* l_arcName = "LV6EGATE"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "LV6EGATE"; const int l_dzbidx = 3; @@ -226,7 +226,7 @@ static int daObjLv6EGate_MoveBGDraw(daObjLv6EGate_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv6EGate_METHODS = { +static DUSK_CONST actor_method_class daObjLv6EGate_METHODS = { (process_method_func)daObjLv6EGate_create1st, (process_method_func)daObjLv6EGate_MoveBGDelete, (process_method_func)daObjLv6EGate_MoveBGExecute, @@ -234,7 +234,7 @@ static actor_method_class daObjLv6EGate_METHODS = { (process_method_func)daObjLv6EGate_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv6EGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6EGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6elevta.cpp b/src/d/actor/d_a_obj_lv6elevta.cpp index a4126f0213..233e6cff9a 100644 --- a/src/d/actor/d_a_obj_lv6elevta.cpp +++ b/src/d/actor/d_a_obj_lv6elevta.cpp @@ -12,7 +12,7 @@ // // Declarations: // -static char* l_arcName = "Lv6ElevtA"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Lv6ElevtA"; static const int l_dzbidx = {7}; static const int l_bmdidx = {4}; @@ -263,7 +263,7 @@ static int daObjLv6ElevtA_MoveBGDraw(daObjLv6ElevtA_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv6ElevtA_METHODS = { +static DUSK_CONST actor_method_class daObjLv6ElevtA_METHODS = { (process_method_func)daObjLv6ElevtA_create1st, (process_method_func)daObjLv6ElevtA_MoveBGDelete, (process_method_func)daObjLv6ElevtA_MoveBGExecute, @@ -271,7 +271,7 @@ static actor_method_class daObjLv6ElevtA_METHODS = { (process_method_func)daObjLv6ElevtA_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv6ElevtA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6ElevtA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv6swturn.cpp b/src/d/actor/d_a_obj_lv6swturn.cpp index d512118bb5..ccb57a1036 100644 --- a/src/d/actor/d_a_obj_lv6swturn.cpp +++ b/src/d/actor/d_a_obj_lv6swturn.cpp @@ -10,7 +10,7 @@ #include "d/actor/d_a_obj_lv6swturn.h" #include "d/actor/d_a_player.h" -static char* l_arcName = "Obj_l6tsw"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_l6tsw"; #if DEBUG daObjLv6SwTurn_HIO_c::daObjLv6SwTurn_HIO_c() { @@ -335,7 +335,7 @@ static int daObjLv6SwTurn_MoveBGDraw(daObjLv6SwTurn_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv6SwTurn_METHODS = { +static DUSK_CONST actor_method_class daObjLv6SwTurn_METHODS = { (process_method_func)daObjLv6SwTurn_create1st, (process_method_func)daObjLv6SwTurn_MoveBGDelete, (process_method_func)daObjLv6SwTurn_MoveBGExecute, @@ -343,7 +343,7 @@ static actor_method_class daObjLv6SwTurn_METHODS = { (process_method_func)daObjLv6SwTurn_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv6SwTurn = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv6SwTurn = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv7BsGate.cpp b/src/d/actor/d_a_obj_lv7BsGate.cpp index 811b301f81..62be603399 100644 --- a/src/d/actor/d_a_obj_lv7BsGate.cpp +++ b/src/d/actor/d_a_obj_lv7BsGate.cpp @@ -21,14 +21,14 @@ public: static daLv7BsGate_HIO_c l_HIO; -static char* l_type[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_type[2] = { "L7Gate", "L7GateL", }; -static int l_bmdIdx[] = {4, 4}; +static DUSK_CONSTEXPR int l_bmdIdx[] = {4, 4}; -static int l_dzbIdx[] = {7, 7}; +static DUSK_CONSTEXPR int l_dzbIdx[] = {7, 7}; daLv7BsGate_HIO_c::daLv7BsGate_HIO_c() { open_speed = 2.0f; @@ -103,7 +103,7 @@ int daLv7BsGate_c::Execute(Mtx** param_0) { } void daLv7BsGate_c::moveGate() { - static void (daLv7BsGate_c::*mode_proc[])() = { + static DUSK_CONSTEXPR void (daLv7BsGate_c::*mode_proc[])() = { &daLv7BsGate_c::modeWait, &daLv7BsGate_c::modeOpen, &daLv7BsGate_c::modeClose, @@ -199,7 +199,7 @@ static int daLv7BsGate_Create(fopAc_ac_c* i_this) { return ((daLv7BsGate_c*)i_this)->create(); } -static actor_method_class l_daLv7BsGate_Method = { +static DUSK_CONST actor_method_class l_daLv7BsGate_Method = { (process_method_func)daLv7BsGate_Create, (process_method_func)daLv7BsGate_Delete, (process_method_func)daLv7BsGate_Execute, @@ -207,7 +207,7 @@ static actor_method_class l_daLv7BsGate_Method = { (process_method_func)daLv7BsGate_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv7BsGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv7BsGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv7PropellerY.cpp b/src/d/actor/d_a_obj_lv7PropellerY.cpp index f7933b263b..0f32987c2c 100644 --- a/src/d/actor/d_a_obj_lv7PropellerY.cpp +++ b/src/d/actor/d_a_obj_lv7PropellerY.cpp @@ -23,14 +23,14 @@ public: /* 0x1C */ f32 y_offset; }; -static char* l_type[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_type[2] = { "stickwl00", "stickwl01", }; -static int l_bmdIdx[] = {4, 4}; +static DUSK_CONSTEXPR int l_bmdIdx[] = {4, 4}; -static int l_dzbIdx[] = {7, 7}; +static DUSK_CONSTEXPR int l_dzbIdx[] = {7, 7}; daPropY_HIO_c::daPropY_HIO_c() { rot_speed = 0.0f; @@ -128,7 +128,7 @@ int daPropY_c::Execute(Mtx** param_0) { } void daPropY_c::procMain() { - static void (daPropY_c::*mode_proc[])() = { + static DUSK_CONSTEXPR void (daPropY_c::*mode_proc[])() = { &daPropY_c::modeMoveWait, &daPropY_c::modeMove, &daPropY_c::modeWait, @@ -289,7 +289,7 @@ static int daPropY_Create(fopAc_ac_c* i_this) { return ((daPropY_c*)i_this)->create(); } -static actor_method_class l_daPropY_Method = { +static DUSK_CONST actor_method_class l_daPropY_Method = { (process_method_func)daPropY_Create, (process_method_func)daPropY_Delete, (process_method_func)daPropY_Execute, @@ -297,7 +297,7 @@ static actor_method_class l_daPropY_Method = { (process_method_func)daPropY_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv7PropY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv7PropY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv7bridge.cpp b/src/d/actor/d_a_obj_lv7bridge.cpp index 193796ebab..dc4f85590c 100644 --- a/src/d/actor/d_a_obj_lv7bridge.cpp +++ b/src/d/actor/d_a_obj_lv7bridge.cpp @@ -107,7 +107,7 @@ void daObjLv7Brg_c::setBaseMtx() { } } -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "Obj_l7brg", "K_bridge", }; @@ -465,7 +465,7 @@ static int daObjLv7Brg_MoveBGDraw(daObjLv7Brg_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjLv7Brg_METHODS = { +static DUSK_CONST actor_method_class daObjLv7Brg_METHODS = { (process_method_func)daObjLv7Brg_create1st, (process_method_func)daObjLv7Brg_MoveBGDelete, (process_method_func)daObjLv7Brg_MoveBGExecute, @@ -473,7 +473,7 @@ static actor_method_class daObjLv7Brg_METHODS = { (process_method_func)daObjLv7Brg_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Lv7Bridge = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv7Bridge = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv8KekkaiTrap.cpp b/src/d/actor/d_a_obj_lv8KekkaiTrap.cpp index 557a39aa32..cb7dedd214 100644 --- a/src/d/actor/d_a_obj_lv8KekkaiTrap.cpp +++ b/src/d/actor/d_a_obj_lv8KekkaiTrap.cpp @@ -24,11 +24,11 @@ public: static daKekaiTrap_HIO_c l_HIO; -static char* l_type[] = {"Lv8Kekkai"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_type[] = {"Lv8Kekkai"}; -static int l_bmdIdx[] = {4}; +static DUSK_CONSTEXPR int l_bmdIdx[] = {4}; -static int l_dzbIdx[] = {7}; +static DUSK_CONSTEXPR int l_dzbIdx[] = {7}; daKekaiTrap_HIO_c::daKekaiTrap_HIO_c() { appear_init_speed = 0.0f; @@ -100,7 +100,7 @@ int daKekaiTrap_c::Execute(Mtx** param_0) { } void daKekaiTrap_c::moveMain() { - static void (daKekaiTrap_c::*mode_proc[])() = { + static DUSK_CONSTEXPR void (daKekaiTrap_c::*mode_proc[])() = { &daKekaiTrap_c::modeWait, &daKekaiTrap_c::modeMoveUp, &daKekaiTrap_c::modeMoveDown, @@ -203,7 +203,7 @@ static int daKekaiTrap_Create(fopAc_ac_c* i_this) { return ((daKekaiTrap_c*)i_this)->create(); } -static actor_method_class l_daKekaiTrap_Method = { +static DUSK_CONST actor_method_class l_daKekaiTrap_Method = { (process_method_func)daKekaiTrap_Create, (process_method_func)daKekaiTrap_Delete, (process_method_func)daKekaiTrap_Execute, @@ -211,7 +211,7 @@ static actor_method_class l_daKekaiTrap_Method = { (process_method_func)daKekaiTrap_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv8KekkaiTrap = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8KekkaiTrap = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv8Lift.cpp b/src/d/actor/d_a_obj_lv8Lift.cpp index 8fa9422325..9ac8206f6b 100644 --- a/src/d/actor/d_a_obj_lv8Lift.cpp +++ b/src/d/actor/d_a_obj_lv8Lift.cpp @@ -37,7 +37,7 @@ void daL8Lift_c::setBaseMtx() { mpModel->setBaseTRMtx(mDoMtx_stack_c::now); } -f32 const daL8Lift_c::mSpeed[16] = { +DUSK_GAME_DATA f32 const daL8Lift_c::mSpeed[16] = { 5.0f, 6.6666665f, 8.333333f, 10.0f, 11.666667f, 13.333333f, 15.0f, 16.666666f, 18.333334f, 20.0f, 21.666666, 23.333334, 25.0f, 26.666666f, 28.333334f, 3.3333333f @@ -477,7 +477,7 @@ static int daL8Lift_Create(fopAc_ac_c* a_this) { return i_this->create(); } -static actor_method_class l_daL8Lift_Method = { +static DUSK_CONST actor_method_class l_daL8Lift_Method = { (process_method_func)daL8Lift_Create, (process_method_func)daL8Lift_Delete, (process_method_func)daL8Lift_Execute, @@ -485,7 +485,7 @@ static actor_method_class l_daL8Lift_Method = { (process_method_func)daL8Lift_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv8Lift = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8Lift = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv8OptiLift.cpp b/src/d/actor/d_a_obj_lv8OptiLift.cpp index 6b6c806d64..e367b89b36 100644 --- a/src/d/actor/d_a_obj_lv8OptiLift.cpp +++ b/src/d/actor/d_a_obj_lv8OptiLift.cpp @@ -38,7 +38,7 @@ void daOptiLift_c::setBaseMtx() { mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); } -const f32 daOptiLift_c::mSpeed[] = { +DUSK_GAME_DATA const f32 daOptiLift_c::mSpeed[] = { 5.0f, 6.6666665f, 8.333333f, 10.0f, 11.666667f, 13.333333f, 15.0f, 16.666666f, 18.333334f, 20.0f, 21.666666f, 23.333334f, 25.0f, 26.666666f, 28.333334f, 3.3333333f, }; @@ -511,13 +511,13 @@ static int daOptiLift_Create(fopAc_ac_c* i_this) { return ((daOptiLift_c*)i_this)->create(); } -static actor_method_class l_daOptiLift_Method = { +static DUSK_CONST actor_method_class l_daOptiLift_Method = { (process_method_func)daOptiLift_Create, (process_method_func)daOptiLift_Delete, (process_method_func)daOptiLift_Execute, (process_method_func)NULL, (process_method_func)daOptiLift_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv8OptiLift = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8OptiLift = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv8UdFloor.cpp b/src/d/actor/d_a_obj_lv8UdFloor.cpp index 920ff92fa4..1c7e9a21ee 100644 --- a/src/d/actor/d_a_obj_lv8UdFloor.cpp +++ b/src/d/actor/d_a_obj_lv8UdFloor.cpp @@ -27,7 +27,7 @@ public: /* 0x14 */ u8 up_framecount; }; -static char* l_resNameIdx[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[2] = { "L8Step", "L8StepX", }; @@ -279,7 +279,7 @@ static int daUdFloor_Create(fopAc_ac_c* i_this) { return ((daUdFloor_c*)i_this)->create(); } -static actor_method_class l_daUdFloor_Method = { +static DUSK_CONST actor_method_class l_daUdFloor_Method = { (process_method_func)daUdFloor_Create, (process_method_func)daUdFloor_Delete, (process_method_func)daUdFloor_Execute, @@ -287,7 +287,7 @@ static actor_method_class l_daUdFloor_Method = { (process_method_func)daUdFloor_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv8UdFloor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv8UdFloor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_lv9SwShutter.cpp b/src/d/actor/d_a_obj_lv9SwShutter.cpp index 0a034ea6bd..6b7755ff15 100644 --- a/src/d/actor/d_a_obj_lv9SwShutter.cpp +++ b/src/d/actor/d_a_obj_lv9SwShutter.cpp @@ -185,7 +185,7 @@ static int daLv9SwShutter_Create(fopAc_ac_c* i_this) { return ((daLv9SwShutter_c*)i_this)->create(); } -static actor_method_class l_daLv9SwShutter_Method = { +static DUSK_CONST actor_method_class l_daLv9SwShutter_Method = { (process_method_func)daLv9SwShutter_Create, (process_method_func)daLv9SwShutter_Delete, (process_method_func)daLv9SwShutter_Execute, @@ -193,7 +193,7 @@ static actor_method_class l_daLv9SwShutter_Method = { (process_method_func)daLv9SwShutter_Draw, }; -actor_process_profile_definition g_profile_Obj_Lv9SwShutter = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Lv9SwShutter = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_magLift.cpp b/src/d/actor/d_a_obj_magLift.cpp index 6e677b5f34..0ff6961815 100644 --- a/src/d/actor/d_a_obj_magLift.cpp +++ b/src/d/actor/d_a_obj_magLift.cpp @@ -37,7 +37,7 @@ int daMagLift_c::CreateHeap() { return 1; } -const f32 daMagLift_c::mSpeed[16] = { +DUSK_GAME_DATA const f32 daMagLift_c::mSpeed[16] = { 5.0f, 6.6666665f, 8.333333f, 10.0f, 11.666667f, 13.333333f, 15.0f, 16.666666f, 18.333334f, 20.0f, 21.666666f, 23.333334f, 25.0f, 26.666666f, 28.333334f, 3.3333333f, }; @@ -234,7 +234,7 @@ static int daMagLift_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daMagLift_Method = { +static DUSK_CONST actor_method_class l_daMagLift_Method = { (process_method_func) daMagLift_Create, (process_method_func) daMagLift_Delete, (process_method_func) daMagLift_Execute, @@ -242,7 +242,7 @@ static actor_method_class l_daMagLift_Method = { (process_method_func) daMagLift_Draw, }; -actor_process_profile_definition g_profile_Obj_MagLift = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MagLift = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_magLiftRot.cpp b/src/d/actor/d_a_obj_magLiftRot.cpp index f55368de37..100469b25b 100644 --- a/src/d/actor/d_a_obj_magLiftRot.cpp +++ b/src/d/actor/d_a_obj_magLiftRot.cpp @@ -14,7 +14,7 @@ #include "d/d_bg_w.h" #include "SSystem/SComponent/c_math.h" -static char* l_arcName[3] = {"MagLiftS", "MagLiftM", "MagLiftL"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[3] = {"MagLiftS", "MagLiftM", "MagLiftL"}; daMagLiftRot_HIO_c::daMagLiftRot_HIO_c() { mWaitTime = 60; @@ -354,7 +354,7 @@ static int daMagLiftRot_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daMagLiftRot_Method = { +static DUSK_CONST actor_method_class l_daMagLiftRot_Method = { (process_method_func)daMagLiftRot_Create, (process_method_func)daMagLiftRot_Delete, (process_method_func)daMagLiftRot_Execute, @@ -362,7 +362,7 @@ static actor_method_class l_daMagLiftRot_Method = { (process_method_func)daMagLiftRot_Draw, }; -actor_process_profile_definition g_profile_Obj_MagLiftRot = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MagLiftRot = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_magne_arm.cpp b/src/d/actor/d_a_obj_magne_arm.cpp index 54a734c35d..f092de8b8b 100644 --- a/src/d/actor/d_a_obj_magne_arm.cpp +++ b/src/d/actor/d_a_obj_magne_arm.cpp @@ -141,15 +141,15 @@ void rideCallBack(dBgW* param_0, fopAc_ac_c* i_this, fopAc_ac_c* i_rideActor) { } } -static char* l_arcName = "D_Marm"; +static DUSK_CONST char* l_arcName = "D_Marm"; static void dummyStrings() { DEAD_STRING("D_MN54"); } -static cull_box l_cull_box = {{-500.0f, -3000.0f, -500.0f}, {500.0f, 3000.0f, 2500.0f}}; +static DUSK_CONSTEXPR cull_box l_cull_box = {{-500.0f, -3000.0f, -500.0f}, {500.0f, 3000.0f, 2500.0f}}; -static cull_box l_cull_box2 = {{-500.0f, -4000.0f, -500.0f}, {500.0f, 3000.0f, 2500.0f}}; +static DUSK_CONSTEXPR cull_box l_cull_box2 = {{-500.0f, -4000.0f, -500.0f}, {500.0f, 3000.0f, 2500.0f}}; static Vec const l_offsetB = {-150.0f, 1200.0f, 0.0f}; // unused @@ -1090,7 +1090,7 @@ static int daObjMarm_MoveBGDraw(daObjMarm_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjMarm_METHODS = { +static DUSK_CONST actor_method_class daObjMarm_METHODS = { (process_method_func)daObjMarm_create1st, (process_method_func)daObjMarm_MoveBGDelete, (process_method_func)daObjMarm_MoveBGExecute, @@ -1098,7 +1098,7 @@ static actor_method_class daObjMarm_METHODS = { (process_method_func)daObjMarm_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_MagneArm = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MagneArm = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_maki.cpp b/src/d/actor/d_a_obj_maki.cpp index f207b2f7f0..c5a8530405 100644 --- a/src/d/actor/d_a_obj_maki.cpp +++ b/src/d/actor/d_a_obj_maki.cpp @@ -132,7 +132,7 @@ int daObj_Maki_IsDelete(obj_maki_class* i_this) { return true; } -u8 lbl_567_bss_8; +DUSK_GAME_DATA u8 lbl_567_bss_8; int daObj_Maki_Delete(obj_maki_class* i_this) { dComIfG_resDelete(&i_this->mPhase, "Obj_maki"); @@ -237,13 +237,13 @@ cPhs_Step daObj_Maki_Create(fopAc_ac_c* i_this) { return phase; } -actor_method_class l_daObj_Maki_Method = { +DUSK_GAME_DATA actor_method_class l_daObj_Maki_Method = { (process_method_func)daObj_Maki_Create, (process_method_func)daObj_Maki_Delete, (process_method_func)daObj_Maki_Execute, (process_method_func)daObj_Maki_IsDelete, (process_method_func)daObj_Maki_Draw, }; -actor_process_profile_definition g_profile_OBJ_MAKI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_MAKI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_master_sword.cpp b/src/d/actor/d_a_obj_master_sword.cpp index cc00bc91f4..820f603363 100644 --- a/src/d/actor/d_a_obj_master_sword.cpp +++ b/src/d/actor/d_a_obj_master_sword.cpp @@ -10,7 +10,7 @@ #include "d/d_com_inf_game.h" #include "d/d_meter2_info.h" -daObjMasterSword_Attr_c const daObjMasterSword_c::mAttr = {1.0f}; +DUSK_GAME_DATA daObjMasterSword_Attr_c const daObjMasterSword_c::mAttr = {1.0f}; void daObjMasterSword_c::initBaseMtx() { fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); @@ -54,7 +54,7 @@ int daObjMasterSword_c::createHeapCallBack(fopAc_ac_c* i_this) { return static_cast(i_this)->CreateHeap(); } -static char* l_arcName = "MstrSword"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "MstrSword"; int daObjMasterSword_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 5); @@ -80,7 +80,7 @@ static int daObjMasterSword_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -actionFunc daObjMasterSword_c::ActionTable[] = { +DUSK_GAME_DATA actionFunc daObjMasterSword_c::ActionTable[] = { &daObjMasterSword_c::initWait, &daObjMasterSword_c::executeWait, }; @@ -236,7 +236,7 @@ static int daObjMasterSword_IsDelete(daObjMasterSword_c* param_0) { return 1; } -static actor_method_class l_daObjMasterSword_Method = { +static DUSK_CONST actor_method_class l_daObjMasterSword_Method = { (process_method_func)daObjMasterSword_Create, (process_method_func)daObjMasterSword_Delete, (process_method_func)daObjMasterSword_Execute, @@ -244,7 +244,7 @@ static actor_method_class l_daObjMasterSword_Method = { (process_method_func)daObjMasterSword_Draw, }; -actor_process_profile_definition g_profile_Obj_MasterSword = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MasterSword = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mato.cpp b/src/d/actor/d_a_obj_mato.cpp index f45df05570..d173d364ea 100644 --- a/src/d/actor/d_a_obj_mato.cpp +++ b/src/d/actor/d_a_obj_mato.cpp @@ -365,7 +365,7 @@ static int daObjMATO_IsDelete(daObjMATO_c* i_this) { return 1; } -static actor_method_class l_daObjMATO_Method = { +static DUSK_CONST actor_method_class l_daObjMATO_Method = { (process_method_func)daObjMATO_Create, (process_method_func)daObjMATO_Delete, (process_method_func)daObjMATO_Execute, @@ -373,7 +373,7 @@ static actor_method_class l_daObjMATO_Method = { (process_method_func)daObjMATO_Draw, }; -actor_process_profile_definition g_profile_Obj_Mato = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Mato = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_metalbox.cpp b/src/d/actor/d_a_obj_metalbox.cpp index 41ca666474..523c0e5804 100644 --- a/src/d/actor/d_a_obj_metalbox.cpp +++ b/src/d/actor/d_a_obj_metalbox.cpp @@ -98,7 +98,7 @@ static int daObjMBox_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjMBox_Method = { +static DUSK_CONST actor_method_class l_daObjMBox_Method = { (process_method_func)daObjMBox_Create, (process_method_func)daObjMBox_Delete, (process_method_func)daObjMBox_Execute, @@ -106,7 +106,7 @@ static actor_method_class l_daObjMBox_Method = { (process_method_func)daObjMBox_Draw, }; -actor_process_profile_definition g_profile_Obj_MetalBox = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MetalBox = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mgate.cpp b/src/d/actor/d_a_obj_mgate.cpp index 8a09785678..10f4de85db 100644 --- a/src/d/actor/d_a_obj_mgate.cpp +++ b/src/d/actor/d_a_obj_mgate.cpp @@ -74,24 +74,24 @@ int daObjMGate_c::Create() { return 1; } -static char* l_arcName[] = { +static DUSK_CONST char* l_arcName[] = { "M_IGate", "M_HGate", }; -static char* l_bmdName[] = { +static DUSK_CONST char* l_bmdName[] = { "M_IzumiGate.bmd", "M_HashiGate.bmd", }; -static char* l_dzbName[] = { +static DUSK_CONST char* l_dzbName[] = { "M_IzumiGate.dzb", "M_HashiGate.dzb", }; -static char* l_keyArcName = "M_GateKey"; +static DUSK_CONST char* l_keyArcName = "M_GateKey"; -static char* l_keyBmdName = "M_IGateKey.bmd"; +static DUSK_CONST char* l_keyBmdName = "M_IGateKey.bmd"; int daObjMGate_c::CreateHeap() { J3DModelData* modelData = @@ -235,13 +235,13 @@ static int daObjMGate_MoveBGDraw(daObjMGate_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjMGate_METHODS = { +static DUSK_CONST actor_method_class daObjMGate_METHODS = { (process_method_func)daObjMGate_create1st, (process_method_func)daObjMGate_MoveBGDelete, (process_method_func)daObjMGate_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjMGate_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_MGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mhole.cpp b/src/d/actor/d_a_obj_mhole.cpp index 0b3093d388..239e935301 100644 --- a/src/d/actor/d_a_obj_mhole.cpp +++ b/src/d/actor/d_a_obj_mhole.cpp @@ -25,7 +25,7 @@ static f32 const l_size[2] = {150.0f, 370.0f}; static char const* l_arcName[2] = {"ef_MgnF_L", "ef_MgnF_S"}; -dCcD_SrcCps l_cps_src = { +DUSK_GAME_DATA dCcD_SrcCps l_cps_src = { { {0x0, {{AT_TYPE_40000, 0x0, 0x1d}, {0x0, 0x0}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x6}, // mGObjAt @@ -375,7 +375,7 @@ static int daObjMHole_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjMHole_Method = { +static DUSK_CONST actor_method_class l_daObjMHole_Method = { (process_method_func)daObjMHole_Create, (process_method_func)daObjMHole_Delete, (process_method_func)daObjMHole_Execute, @@ -383,7 +383,7 @@ static actor_method_class l_daObjMHole_Method = { (process_method_func)daObjMHole_Draw, }; -actor_process_profile_definition g_profile_Obj_MHole = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MHole = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mie.cpp b/src/d/actor/d_a_obj_mie.cpp index dc55c589e8..ab96679de6 100644 --- a/src/d/actor/d_a_obj_mie.cpp +++ b/src/d/actor/d_a_obj_mie.cpp @@ -18,12 +18,12 @@ static u32 l_bmdData[1][2] = { 23, 1, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "pouyaA", }; -daObj_Mie_HIOParam const daObj_Mie_Param_c::m = { +DUSK_GAME_DATA daObj_Mie_HIOParam const daObj_Mie_Param_c::m = { 0.0f, -4.0f, 1.0f, 100.0f, 255.0f, 20.0f, 10.0f, 14.0f, 37.0f, 50.0f, 18.0f, }; @@ -512,7 +512,7 @@ static int daObj_Mie_IsDelete(void* a_this) { AUDIO_INSTANCES -static actor_method_class daObj_Mie_MethodTable = { +static DUSK_CONST actor_method_class daObj_Mie_MethodTable = { (process_method_func)daObj_Mie_Create, (process_method_func)daObj_Mie_Delete, (process_method_func)daObj_Mie_Execute, @@ -520,7 +520,7 @@ static actor_method_class daObj_Mie_MethodTable = { (process_method_func)daObj_Mie_Draw, }; -actor_process_profile_definition g_profile_OBJ_MIE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_MIE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mirror_6pole.cpp b/src/d/actor/d_a_obj_mirror_6pole.cpp index bec22c08f2..41b755850f 100644 --- a/src/d/actor/d_a_obj_mirror_6pole.cpp +++ b/src/d/actor/d_a_obj_mirror_6pole.cpp @@ -9,9 +9,9 @@ #include "f_pc/f_pc_name.h" #include "f_op/f_op_actor_mng.h" -static char* l_arcName = "MR-6Pole"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "MR-6Pole"; -const actionFunc daObjMirror6Pole_c::ActionTable[][2] = { +DUSK_GAME_DATA const actionFunc daObjMirror6Pole_c::ActionTable[][2] = { {&daObjMirror6Pole_c::initWait, &daObjMirror6Pole_c::executeWait}, {&daObjMirror6Pole_c::initDemo, &daObjMirror6Pole_c::executeDemo}, }; @@ -167,13 +167,13 @@ static int daObjMirror6Pole_IsDelete(daObjMirror6Pole_c* i_this) { return 1; } -static actor_method_class l_daObjMirror6Pole_Method = { +static DUSK_CONST actor_method_class l_daObjMirror6Pole_Method = { (process_method_func)daObjMirror6Pole_Create, (process_method_func)daObjMirror6Pole_Delete, (process_method_func)daObjMirror6Pole_Execute, (process_method_func)daObjMirror6Pole_IsDelete, (process_method_func)daObjMirror6Pole_Draw, }; -actor_process_profile_definition g_profile_Obj_Mirror6Pole = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Mirror6Pole = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mirror_chain.cpp b/src/d/actor/d_a_obj_mirror_chain.cpp index 92c062f7c8..8301e14e4a 100644 --- a/src/d/actor/d_a_obj_mirror_chain.cpp +++ b/src/d/actor/d_a_obj_mirror_chain.cpp @@ -496,7 +496,7 @@ static cPhs_Step daObjMirrorChain_Create(fopAc_ac_c* i_this) { return ((daObjMirrorChain_c*)i_this)->create(); } -static actor_method_class l_daObjMirrorChain_Method = { +static DUSK_CONST actor_method_class l_daObjMirrorChain_Method = { (process_method_func)daObjMirrorChain_Create, (process_method_func)daObjMirrorChain_Delete, (process_method_func)daObjMirrorChain_Execute, @@ -504,7 +504,7 @@ static actor_method_class l_daObjMirrorChain_Method = { (process_method_func)daObjMirrorChain_Draw, }; -actor_process_profile_definition g_profile_Obj_MirrorChain = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorChain = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mirror_sand.cpp b/src/d/actor/d_a_obj_mirror_sand.cpp index 38d9ce0cf5..5039148ed2 100644 --- a/src/d/actor/d_a_obj_mirror_sand.cpp +++ b/src/d/actor/d_a_obj_mirror_sand.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_obj_mirror_sand.h" #include "f_pc/f_pc_name.h" -static char* l_arcName = "MR-Sand"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "MR-Sand"; int daObjMirrorSand_c::createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 8); @@ -163,13 +163,13 @@ static int daObjMirrorSand_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjMirrorSand_Method = { +static DUSK_CONST actor_method_class l_daObjMirrorSand_Method = { (process_method_func)daObjMirrorSand_Create, (process_method_func)daObjMirrorSand_Delete, (process_method_func)daObjMirrorSand_Execute, (process_method_func)daObjMirrorSand_IsDelete, (process_method_func)daObjMirrorSand_Draw, }; -actor_process_profile_definition g_profile_Obj_MirrorSand = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorSand = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mirror_screw.cpp b/src/d/actor/d_a_obj_mirror_screw.cpp index 4d8432f1c4..ec5b698bd5 100644 --- a/src/d/actor/d_a_obj_mirror_screw.cpp +++ b/src/d/actor/d_a_obj_mirror_screw.cpp @@ -11,7 +11,7 @@ static char const* l_arcName = "MR-Screw"; -daObjMirrorScrew_c::attr const daObjMirrorScrew_c::M_attr = { +DUSK_GAME_DATA daObjMirrorScrew_c::attr const daObjMirrorScrew_c::M_attr = { -2710.0f, // mDownDist 0.6f, // mRotSpeedThreshold 45, // mSpinCount @@ -20,7 +20,7 @@ daObjMirrorScrew_c::attr const daObjMirrorScrew_c::M_attr = { -3.375f, // mDownSpeed }; -daObjMirrorScrew_actionFunc daObjMirrorScrew_c::ActionTable[2][2] = { +DUSK_GAME_DATA daObjMirrorScrew_actionFunc daObjMirrorScrew_c::ActionTable[2][2] = { { &daObjMirrorScrew_c::initWait, &daObjMirrorScrew_c::executeWait, @@ -252,13 +252,13 @@ int daObjMirrorScrew_c::Delete() { return 1; } -static actor_method_class l_daObjMirrorScrew_Method = { +static DUSK_CONST actor_method_class l_daObjMirrorScrew_Method = { (process_method_func)daObjMirrorScrew_Create, (process_method_func)daObjMirrorScrew_Delete, (process_method_func)daObjMirrorScrew_Execute, (process_method_func)daObjMirrorScrew_IsDelete, (process_method_func)daObjMirrorScrew_Draw, }; -actor_process_profile_definition g_profile_Obj_MirrorScrew = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorScrew = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mirror_table.cpp b/src/d/actor/d_a_obj_mirror_table.cpp index ec77a7ac91..6be9fdc295 100644 --- a/src/d/actor/d_a_obj_mirror_table.cpp +++ b/src/d/actor/d_a_obj_mirror_table.cpp @@ -454,7 +454,7 @@ void daObjMirrorTable_c::initBaseMtx() { setBaseMtx(); } -static actor_method_class l_daObjMirrorTable_Method = { +static DUSK_CONST actor_method_class l_daObjMirrorTable_Method = { (process_method_func)daObjMirrorTable_Create, (process_method_func)daObjMirrorTable_Delete, (process_method_func)daObjMirrorTable_Execute, @@ -462,7 +462,7 @@ static actor_method_class l_daObjMirrorTable_Method = { (process_method_func)daObjMirrorTable_Draw, }; -actor_process_profile_definition g_profile_Obj_MirrorTable = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MirrorTable = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_movebox.cpp b/src/d/actor/d_a_obj_movebox.cpp index 0392c33d79..729ac8c702 100644 --- a/src/d/actor/d_a_obj_movebox.cpp +++ b/src/d/actor/d_a_obj_movebox.cpp @@ -99,12 +99,12 @@ void daObjMovebox::Hio_c::genMessage(JORMContext* context) { #endif -const daObjMovebox::BgcSrc_c daObjMovebox::Bgc_c::M_lin5[] = { +DUSK_GAME_DATA const daObjMovebox::BgcSrc_c daObjMovebox::Bgc_c::M_lin5[] = { {0.0f, 0.0f, 0.0f, 0.0f}, {-0.5f, -0.5f, 1.0f, 1.0f}, {0.5f, -0.5f, -1.0f, 1.0f}, {0.5f, 0.5f, -1.0f, -1.0f}, {-0.5f, 0.5f, 1.0f, -1.0f}, }; -const daObjMovebox::BgcSrc_c daObjMovebox::Bgc_c::M_lin20[] = { +DUSK_GAME_DATA const daObjMovebox::BgcSrc_c daObjMovebox::Bgc_c::M_lin20[] = { {0.0f, 0.0f, 0.0f, 0.0f}, {-0.25f, -0.25f, 0.0f, 0.0f}, {-0.5f, -0.5f, 1.0f, 1.0f}, {0.0f, -0.5f, -1.0f, 1.0f}, {0.0f, 0.0f, -1.0f, -1.0f}, {-0.5f, 0.0f, 1.0f, -1.0f}, {0.25f, -0.25f, 0.0f, 0.0f}, {0.0f, -0.5f, 1.0f, 1.0f}, {0.5f, -0.5f, -1.0f, 1.0f}, @@ -128,7 +128,7 @@ daObjMovebox::Bgc_c::Bgc_c() { mState = STATE_0_e; } -dBgS_ObjGndChk daObjMovebox::Bgc_c::M_gnd_work[23]; +DUSK_GAME_DATA dBgS_ObjGndChk daObjMovebox::Bgc_c::M_gnd_work[23]; void daObjMovebox::Bgc_c::gnd_pos(const daObjMovebox::Act_c* i_actor, const daObjMovebox::BgcSrc_c* i_bgcSrc, int i_checkNum, @@ -165,7 +165,7 @@ void daObjMovebox::Bgc_c::gnd_pos(const daObjMovebox::Act_c* i_actor, } } -dBgS_WtrChk daObjMovebox::Bgc_c::M_wrt_work; +DUSK_GAME_DATA dBgS_WtrChk daObjMovebox::Bgc_c::M_wrt_work; void daObjMovebox::Bgc_c::wrt_pos(cXyz const& param_0) { @@ -186,7 +186,7 @@ void daObjMovebox::Bgc_c::wrt_pos(cXyz const& param_0) { } } -dBgS_ObjLinChk daObjMovebox::Bgc_c::M_wall_work[23]; +DUSK_GAME_DATA dBgS_ObjLinChk daObjMovebox::Bgc_c::M_wall_work[23]; void daObjMovebox::Bgc_c::wall_pos(daObjMovebox::Act_c const* i_actor, @@ -409,11 +409,11 @@ void daObjMovebox::Act_c::prmX_init() { shape_angle.x = 0; } -const char* const daObjMovebox::Act_c::M_arcname[8] = { +DUSK_GAME_DATA const char* const daObjMovebox::Act_c::M_arcname[8] = { "Kkiba_00", "Osiblk", "H_Box20", "A_SMBlock", "P_Lv4blk", "P_Lv4blk2", "H_OsiHaka", "dummy4", }; -const dCcD_SrcCyl daObjMovebox::Act_c::M_cyl_src = { +DUSK_GAME_DATA const dCcD_SrcCyl daObjMovebox::Act_c::M_cyl_src = { { 0, {{0, 0, 0}, {0xD8FAFDBF, 0x11}, {0x78}}, // mObj @@ -430,7 +430,7 @@ const dCcD_SrcCyl daObjMovebox::Act_c::M_cyl_src = { } }; -const daObjMovebox::Attr_c daObjMovebox::Act_c::M_attr[8] = { +DUSK_GAME_DATA const daObjMovebox::Attr_c daObjMovebox::Act_c::M_attr[8] = { { // Timing 6, 14, 10, 6, 14, 10, @@ -1498,7 +1498,7 @@ int Mthd_IsDelete(void* i_this) { return ((daObjMovebox::Act_c*)i_this)->MoveBGIsDelete(); } -static actor_method_class Mthd_Table = { +static DUSK_CONST actor_method_class Mthd_Table = { (process_method_func)Mthd_Create, (process_method_func)Mthd_Delete, (process_method_func)Mthd_Execute, (process_method_func)Mthd_IsDelete, (process_method_func)Mthd_Draw, @@ -1506,7 +1506,7 @@ static actor_method_class Mthd_Table = { }; // namespace }; // namespace daObjMovebox -actor_process_profile_definition g_profile_Obj_Movebox = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Movebox = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_msima.cpp b/src/d/actor/d_a_obj_msima.cpp index fadc177a4c..7b94ca0acc 100644 --- a/src/d/actor/d_a_obj_msima.cpp +++ b/src/d/actor/d_a_obj_msima.cpp @@ -500,7 +500,7 @@ static int daObj_Msima_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daObj_Msima_Method = { +static DUSK_CONST actor_method_class l_daObj_Msima_Method = { (process_method_func)daObj_Msima_Create, (process_method_func)daObj_Msima_Delete, (process_method_func)daObj_Msima_Execute, @@ -508,7 +508,7 @@ static actor_method_class l_daObj_Msima_Method = { (process_method_func)daObj_Msima_Draw, }; -actor_process_profile_definition g_profile_OBJ_MSIMA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_MSIMA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_mvstair.cpp b/src/d/actor/d_a_obj_mvstair.cpp index 330695d16f..73ee2c2c86 100644 --- a/src/d/actor/d_a_obj_mvstair.cpp +++ b/src/d/actor/d_a_obj_mvstair.cpp @@ -72,7 +72,7 @@ int daObjStair_c::Create() { return 1; } -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "K_mvkai00", "Lv9_mvkai", }; @@ -454,7 +454,7 @@ static int daObjStair_MoveBGDraw(daObjStair_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjStair_METHODS = { +static DUSK_CONST actor_method_class daObjStair_METHODS = { (process_method_func)daObjStair_create1st, (process_method_func)daObjStair_MoveBGDelete, (process_method_func)daObjStair_MoveBGExecute, @@ -462,7 +462,7 @@ static actor_method_class daObjStair_METHODS = { (process_method_func)daObjStair_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_MvStair = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_MvStair = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_myogan.cpp b/src/d/actor/d_a_obj_myogan.cpp index 745b4e21b5..af488ef92a 100644 --- a/src/d/actor/d_a_obj_myogan.cpp +++ b/src/d/actor/d_a_obj_myogan.cpp @@ -161,13 +161,13 @@ static int daObj_Myogan_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daObj_Myogan_Method = { +static DUSK_CONST actor_method_class l_daObj_Myogan_Method = { (process_method_func)daObj_Myogan_Create, (process_method_func)daObj_Myogan_Delete, (process_method_func)daObj_Myogan_Execute, (process_method_func)daObj_Myogan_IsDelete, (process_method_func)daObj_Myogan_Draw, }; -actor_process_profile_definition g_profile_OBJ_MYOGAN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_MYOGAN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_nagaisu.cpp b/src/d/actor/d_a_obj_nagaisu.cpp index bc1b3c1b53..7465f7c928 100644 --- a/src/d/actor/d_a_obj_nagaisu.cpp +++ b/src/d/actor/d_a_obj_nagaisu.cpp @@ -11,7 +11,7 @@ static int daObjNagaisu_c_createHeap(fopAc_ac_c* i_this) { return ((daObjNagaisu_c*)i_this)->createHeap(); } -static char* l_arcName = "Nagaisu"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Nagaisu"; daObjNagaisu_c::daObjNagaisu_c() {} @@ -40,7 +40,7 @@ int daObjNagaisu_c::createHeap() { return 1; } -const int daObjNagaisu_c::REMOVE_ISU_IDX[] = { +DUSK_GAME_DATA const int daObjNagaisu_c::REMOVE_ISU_IDX[] = { 6, 7, 11, @@ -50,7 +50,7 @@ const int daObjNagaisu_c::REMOVE_ISU_IDX[] = { 29, }; -const dCcD_SrcCyl daObjIsuChild_c::s_CcDCyl = { +DUSK_GAME_DATA const dCcD_SrcCyl daObjIsuChild_c::s_CcDCyl = { { {0, {{0, 0, 0}, {0x400020, 0x11}, 0}}, {dCcD_SE_NONE, 0, 0, 0, 0}, @@ -312,7 +312,7 @@ static int daObjNagaisu_draw(daObjNagaisu_c* i_this) { return i_this->draw(); } -static actor_method_class daObjNagaisu_METHODS = { +static DUSK_CONST actor_method_class daObjNagaisu_METHODS = { (process_method_func)daObjNagaisu_create, (process_method_func)daObjNagaisu_Delete, (process_method_func)daObjNagaisu_execute, @@ -320,7 +320,7 @@ static actor_method_class daObjNagaisu_METHODS = { (process_method_func)daObjNagaisu_draw, }; -actor_process_profile_definition g_profile_Obj_Nagaisu = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Nagaisu = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_nameplate.cpp b/src/d/actor/d_a_obj_nameplate.cpp index e72cc6553c..50ee106c38 100644 --- a/src/d/actor/d_a_obj_nameplate.cpp +++ b/src/d/actor/d_a_obj_nameplate.cpp @@ -13,7 +13,7 @@ #include "SSystem/SComponent/c_math.h" // clang-format off -daObjNameplate_c::M_attrs const daObjNameplate_c::M_attr = { +DUSK_GAME_DATA daObjNameplate_c::M_attrs const daObjNameplate_c::M_attr = { 50.0f, 2500.0f, 400.0f, @@ -228,7 +228,7 @@ void daObjNameplate_c::messageProc() { } } -char* daObjNameplate_c::l_arcName = "J_Hyosatu"; +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daObjNameplate_c::l_arcName = "J_Hyosatu"; int daObjNameplate_c::createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "J_Hyousatu.bmd"); @@ -300,13 +300,13 @@ static int daObjNameplate_Create(fopAc_ac_c* i_this) { /* ############################################################################################## */ -static actor_method_class l_daObjNameplate_Method = { +static DUSK_CONST actor_method_class l_daObjNameplate_Method = { (process_method_func)daObjNameplate_Create, (process_method_func)daObjNameplate_Delete, (process_method_func)daObjNameplate_Execute, (process_method_func)daObjNameplate_IsDelete, (process_method_func)daObjNameplate_Draw, }; -actor_process_profile_definition g_profile_Obj_NamePlate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_NamePlate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_nan.cpp b/src/d/actor/d_a_obj_nan.cpp index c830433453..691d2525ca 100644 --- a/src/d/actor/d_a_obj_nan.cpp +++ b/src/d/actor/d_a_obj_nan.cpp @@ -720,7 +720,7 @@ static int daObjNAN_IsDelete(daObjNAN_c* i_this) { return 1; } -static actor_method_class l_daObjNAN_Method = { +static DUSK_CONST actor_method_class l_daObjNAN_Method = { (process_method_func)daObjNAN_Create, (process_method_func)daObjNAN_Delete, (process_method_func)daObjNAN_Execute, @@ -728,7 +728,7 @@ static actor_method_class l_daObjNAN_Method = { (process_method_func)daObjNAN_Draw, }; -actor_process_profile_definition g_profile_Obj_Nan = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Nan = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ndoor.cpp b/src/d/actor/d_a_obj_ndoor.cpp index c57cb162a7..67c8ef9e2b 100644 --- a/src/d/actor/d_a_obj_ndoor.cpp +++ b/src/d/actor/d_a_obj_ndoor.cpp @@ -125,13 +125,13 @@ static int daObj_Ndoor_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daObj_Ndoor_Method = { +static DUSK_CONST actor_method_class l_daObj_Ndoor_Method = { (process_method_func)daObj_Ndoor_Create, (process_method_func)daObj_Ndoor_Delete, (process_method_func)daObj_Ndoor_Execute, (process_method_func)daObj_Ndoor_IsDelete, (process_method_func)daObj_Ndoor_Draw, }; -actor_process_profile_definition g_profile_OBJ_NDOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_NDOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_nougu.cpp b/src/d/actor/d_a_obj_nougu.cpp index ae3ee5bba9..e7aeaeb17f 100644 --- a/src/d/actor/d_a_obj_nougu.cpp +++ b/src/d/actor/d_a_obj_nougu.cpp @@ -9,16 +9,16 @@ #include "d/actor/d_a_npc.h" #include "SSystem/SComponent/c_counter.h" -dCcD_SrcSph daObj_Nougu_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daObj_Nougu_c::mCcDSph = { daNpcT_c::mCcDObjData, { {{0.0f, 0.0f, 0.0f}, 0.0f} }, }; -static char* l_resName = "Jagar4"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resName = "Jagar4"; -const daObj_Nougu_HIOParam daObj_Nougu_Param_c::m = { +DUSK_GAME_DATA const daObj_Nougu_HIOParam daObj_Nougu_Param_c::m = { 0.0f, -3.0f, 1.0f, @@ -227,7 +227,7 @@ static int daObj_Nougu_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_Nougu_MethodTable = { +static DUSK_CONST actor_method_class daObj_Nougu_MethodTable = { (process_method_func)daObj_Nougu_Create, (process_method_func)daObj_Nougu_Delete, (process_method_func)daObj_Nougu_Execute, @@ -235,7 +235,7 @@ static actor_method_class daObj_Nougu_MethodTable = { (process_method_func)daObj_Nougu_Draw, }; -actor_process_profile_definition g_profile_OBJ_NOUGU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_NOUGU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_octhashi.cpp b/src/d/actor/d_a_obj_octhashi.cpp index 6f38f99b2d..0dfa795942 100644 --- a/src/d/actor/d_a_obj_octhashi.cpp +++ b/src/d/actor/d_a_obj_octhashi.cpp @@ -25,7 +25,7 @@ const static dCcD_SrcSph ccSphSrc = { } // mSphAttr }; -static char* l_arcName[1] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[1] = { "Octhashi" }; @@ -376,7 +376,7 @@ int daObjOCTHASHI_c::Delete() { return 1; } -static actor_method_class l_daObjOCTHASHI_Method = { +static DUSK_CONST actor_method_class l_daObjOCTHASHI_Method = { (process_method_func)daObjOCTHASHI_Create, (process_method_func)daObjOCTHASHI_Delete, (process_method_func)daObjOCTHASHI_Execute, @@ -384,7 +384,7 @@ static actor_method_class l_daObjOCTHASHI_Method = { (process_method_func)daObjOCTHASHI_Draw, }; -actor_process_profile_definition g_profile_OCTHASHI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OCTHASHI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_oiltubo.cpp b/src/d/actor/d_a_obj_oiltubo.cpp index a2110168f4..31573e59b1 100644 --- a/src/d/actor/d_a_obj_oiltubo.cpp +++ b/src/d/actor/d_a_obj_oiltubo.cpp @@ -7,15 +7,15 @@ #include "d/actor/d_a_obj_oiltubo.h" -static char* l_resFileName = "Obj_otubo"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resFileName = "Obj_otubo"; -static char* l_bmdFileName = "x_oiltubo_00.bmd"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bmdFileName = "x_oiltubo_00.bmd"; -static char* l_bbmdFileName = "x_oiltubo_00b.bmd"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bbmdFileName = "x_oiltubo_00b.bmd"; -static char* l_bbtkFileName = "x_oiltubo_00b.btk"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bbtkFileName = "x_oiltubo_00b.btk"; -dCcD_SrcCyl daObj_Oiltubo_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST daObj_Oiltubo_c::mCcDCyl = { daObj_Oiltubo_c::mCcDObjInfo, { { @@ -41,7 +41,7 @@ int daObj_Oiltubo_c::create() { return phase_state; } -const dCcD_SrcGObjInf daObj_Oiltubo_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daObj_Oiltubo_c::mCcDObjInfo = { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x1F}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt {dCcD_SE_NONE, 0x2, 0x0, 0x0, 0x1}, // mGObjTg @@ -284,13 +284,13 @@ static int daObj_Oiltubo_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_Oiltubo_MethodTable = { +static DUSK_CONST actor_method_class daObj_Oiltubo_MethodTable = { (process_method_func)daObj_Oiltubo_Create, (process_method_func)daObj_Oiltubo_Delete, (process_method_func)daObj_Oiltubo_Execute, (process_method_func)daObj_Oiltubo_IsDelete, (process_method_func)daObj_Oiltubo_Draw, }; -actor_process_profile_definition g_profile_OBJ_OILTUBO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_OILTUBO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_onsen.cpp b/src/d/actor/d_a_obj_onsen.cpp index de484230c7..d1e2bd1df9 100644 --- a/src/d/actor/d_a_obj_onsen.cpp +++ b/src/d/actor/d_a_obj_onsen.cpp @@ -39,7 +39,7 @@ static const u32 l_dzb[2] = {12, 12}; static const u32 l_heap_size[2] = {10240, 6880}; -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "H_Onsen", "H_KaOnsen", }; @@ -121,13 +121,13 @@ static int daObjOnsen_MoveBGDraw(daObjOnsen_c* i_this) { return static_cast(i_this)->MoveBGDraw(); } -static actor_method_class daObjOnsen_METHODS = { +static DUSK_CONST actor_method_class daObjOnsen_METHODS = { (process_method_func)daObjOnsen_create1st, (process_method_func)daObjOnsen_MoveBGDelete, (process_method_func)daObjOnsen_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjOnsen_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Onsen = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Onsen = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_onsenFire.cpp b/src/d/actor/d_a_obj_onsenFire.cpp index 9adfca491d..1d45d79e25 100644 --- a/src/d/actor/d_a_obj_onsenFire.cpp +++ b/src/d/actor/d_a_obj_onsenFire.cpp @@ -38,13 +38,13 @@ static int daObjOnsenFire_Delete(daObjOnsenFire_c* i_this) { return 1; } -static actor_method_class l_daObjOnsenFire_Method = { +static DUSK_CONST actor_method_class l_daObjOnsenFire_Method = { (process_method_func)daObjOnsenFire_Create, (process_method_func)daObjOnsenFire_Delete, (process_method_func)daObjOnsenFire_Execute }; -actor_process_profile_definition g_profile_OBJ_ONSEN_FIRE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_ONSEN_FIRE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_onsenTaru.cpp b/src/d/actor/d_a_obj_onsenTaru.cpp index ea2b107ecf..28175f54a0 100644 --- a/src/d/actor/d_a_obj_onsenTaru.cpp +++ b/src/d/actor/d_a_obj_onsenTaru.cpp @@ -20,14 +20,14 @@ daOnsTaru_HIO_c::daOnsTaru_HIO_c() { static daOnsTaru_HIO_c l_HIO; -const dCcD_SrcGObjInf daOnsTaru_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daOnsTaru_c::mCcDObjInfo = { {0, {{8, 0, 0x1F}, {0xD8FADDAF, 0x1F}, {0x79}}}, {dCcD_SE_NONE, 0, 1, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 2}, {0}, }; -dCcD_SrcCyl daOnsTaru_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daOnsTaru_c::mCcDCyl = { daOnsTaru_c::mCcDObjInfo, { { @@ -384,13 +384,13 @@ static int daOnsTaru_Create(fopAc_ac_c* i_this) { return ((daOnsTaru_c*)i_this)->create(); } -static actor_method_class l_daOnsTaru_Method = { +static DUSK_CONST actor_method_class l_daOnsTaru_Method = { (process_method_func)daOnsTaru_Create, (process_method_func)daOnsTaru_Delete, (process_method_func)daOnsTaru_Execute, (process_method_func)NULL, (process_method_func)daOnsTaru_Draw, }; -actor_process_profile_definition g_profile_Obj_OnsenTaru = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_OnsenTaru = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ornament_cloth.cpp b/src/d/actor/d_a_obj_ornament_cloth.cpp index 32569f300d..f1181b2d0a 100644 --- a/src/d/actor/d_a_obj_ornament_cloth.cpp +++ b/src/d/actor/d_a_obj_ornament_cloth.cpp @@ -58,7 +58,7 @@ public: }; #endif -daObjOnCloth_Attr_c const daObjOnCloth_c::M_attr = { +DUSK_GAME_DATA daObjOnCloth_Attr_c const daObjOnCloth_c::M_attr = { 8.0f, -40.0f, 0.3f, @@ -205,7 +205,7 @@ static int nodeCallBack(J3DJoint* i_joint, int param_2) { return 1; } -static char* l_arcName = "J_Necktie"; +static DUSK_CONST char* l_arcName = "J_Necktie"; int daObjOnCloth_c::createHeap() { J3DModelData* modelData = static_cast(dComIfG_getObjectRes(l_arcName, "J_Necktie.bmd")); @@ -311,7 +311,7 @@ ClothJoint_c::ClothJoint_c() { /* empty function */ } -static actor_method_class l_daObjOnCloth_Method = { +static DUSK_CONST actor_method_class l_daObjOnCloth_Method = { (process_method_func)daObjOnCloth_Create, (process_method_func)daObjOnCloth_Delete, (process_method_func)daObjOnCloth_Execute, @@ -319,7 +319,7 @@ static actor_method_class l_daObjOnCloth_Method = { (process_method_func)daObjOnCloth_Draw, }; -actor_process_profile_definition g_profile_Obj_OnCloth = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_OnCloth = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_pdoor.cpp b/src/d/actor/d_a_obj_pdoor.cpp index cffabcd90e..eb67b6c00f 100644 --- a/src/d/actor/d_a_obj_pdoor.cpp +++ b/src/d/actor/d_a_obj_pdoor.cpp @@ -51,9 +51,9 @@ void daObjPDoor_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName = "V_OsuDoor"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_OsuDoor"; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {0.0f, 0.0f, -600.0f}, {600.0f, 1000.0f, 600.0f}, }; @@ -270,7 +270,7 @@ static int daObjPDoor_MoveBGDraw(daObjPDoor_c* i_this) { return i_this->Draw(); } -static actor_method_class daObjPDoor_METHODS = { +static DUSK_CONST actor_method_class daObjPDoor_METHODS = { (process_method_func)daObjPDoor_create1st, (process_method_func)daObjPDoor_MoveBGDelete, (process_method_func)daObjPDoor_MoveBGExecute, @@ -278,7 +278,7 @@ static actor_method_class daObjPDoor_METHODS = { (process_method_func)daObjPDoor_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_PushDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_PushDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_pdtile.cpp b/src/d/actor/d_a_obj_pdtile.cpp index 79bbb7d80e..63bece04e8 100644 --- a/src/d/actor/d_a_obj_pdtile.cpp +++ b/src/d/actor/d_a_obj_pdtile.cpp @@ -16,39 +16,39 @@ static void rideCallBack(dBgW* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3 static_cast(param_2)->rideActor(param_3); } -static char* l_arcName4 = "P_Dtile"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName4 = "P_Dtile"; -static u32 l_dzbidx4[2] = { +static DUSK_CONSTEXPR u32 l_dzbidx4[2] = { 9, 8, }; -static u32 l_bmdidx4[2] = { +static DUSK_CONSTEXPR u32 l_bmdidx4[2] = { 5, 4, }; -static cull_box l_cull_box4[2] = { +static DUSK_CONSTEXPR cull_box l_cull_box4[2] = { {{-50.0f, -100.0f, -50.0f}, {50.0f, 20.49f, 50.0f}}, {{-160.0f, -460.0f, -160.0f}, {160.0f, 20.0f, 160.0f}}, }; -static char* l_arcName7 = "P_Dtile00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName7 = "P_Dtile00"; -static u32 l_dzbidx7 = 7; +static DUSK_CONSTEXPR u32 l_dzbidx7 = 7; -static u32 l_bmdidx7 = 4; +static DUSK_CONSTEXPR u32 l_bmdidx7 = 4; -static cull_box l_cull_box7 = { +static DUSK_CONSTEXPR cull_box l_cull_box7 = { {-200.0f, -700.0f, -200.0f}, {200.0f, 50.0f, 200.0f}, }; -static char* l_arcName9 = "Lv9_Dtile"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName9 = "Lv9_Dtile"; -static u32 l_dzbidx9 = 7; +static DUSK_CONSTEXPR u32 l_dzbidx9 = 7; -static u32 l_bmdidx9 = 4; +static DUSK_CONSTEXPR u32 l_bmdidx9 = 4; -static cull_box l_cull_box9 = { +static DUSK_CONSTEXPR cull_box l_cull_box9 = { {-200.0f, -650.0f, -200.0f}, {200.0f, 50.0f, 200.0f}, }; @@ -185,7 +185,7 @@ int daObjPDtile_c::CreateHeap() { return mModel != 0 ? TRUE : FALSE; } -static dCcD_SrcCyl cc_cyl_src = { +static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x8020, 0x11}, 0x0}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -514,7 +514,7 @@ static int daObjPDtile_MoveBGDraw(daObjPDtile_c* i_this) { } -static actor_method_class daObjPDtile_METHODS = { +static DUSK_CONST actor_method_class daObjPDtile_METHODS = { (process_method_func)daObjPDtile_create1st, (process_method_func)daObjPDtile_MoveBGDelete, (process_method_func)daObjPDtile_MoveBGExecute, @@ -522,7 +522,7 @@ static actor_method_class daObjPDtile_METHODS = { (process_method_func)daObjPDtile_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_PDtile = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_PDtile = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_pdwall.cpp b/src/d/actor/d_a_obj_pdwall.cpp index cfdf2dfc32..dc6a1913fd 100644 --- a/src/d/actor/d_a_obj_pdwall.cpp +++ b/src/d/actor/d_a_obj_pdwall.cpp @@ -16,7 +16,7 @@ static const cull_box l_cull_box = { {750.0f, 500.0f, 300.0f}, }; -static char* l_arcName = "P_Dwall"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Dwall"; int daObjPDwall_c::create1st() { int phase_state = dComIfG_resLoad(this, l_arcName); @@ -192,7 +192,7 @@ static int daObjPDwall_MoveBGDraw(daObjPDwall_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjPDwall_METHODS = { +static DUSK_CONST actor_method_class daObjPDwall_METHODS = { (process_method_func)daObjPDwall_create1st, (process_method_func)daObjPDwall_MoveBGDelete, (process_method_func)daObjPDwall_MoveBGExecute, @@ -200,7 +200,7 @@ static actor_method_class daObjPDwall_METHODS = { (process_method_func)daObjPDwall_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_PDwall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_PDwall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_picture.cpp b/src/d/actor/d_a_obj_picture.cpp index 800650d4f0..67b89627d2 100644 --- a/src/d/actor/d_a_obj_picture.cpp +++ b/src/d/actor/d_a_obj_picture.cpp @@ -12,7 +12,7 @@ static int daObjPicture_c_createHeap(fopAc_ac_c* i_this) { return ((daObjPicture_c*)i_this)->createHeap(); } -static char* l_arcName = "L9Picture"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "L9Picture"; static Vec l_LINE_OFFSET_POS[] = { {-100.0f, 200.0f, -2.0f}, @@ -517,7 +517,7 @@ static int daObjPicture_draw(daObjPicture_c* i_this) { #if DEBUG const #endif -dCcD_SrcCps daObjPicture_c::s_CcDCps = { +DUSK_GAME_DATA dCcD_SrcCps daObjPicture_c::s_CcDCps = { { {0x0, {{0x0, 0x0, 0x0}, {0x20A0, 0x11}, 0x0}}, // mObj {dCcD_SE_SWORD, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -532,7 +532,7 @@ dCcD_SrcCps daObjPicture_c::s_CcDCps = { #if DEBUG const #endif -dCcD_SrcCyl daObjPicture_c::s_CcDCyl_pic_at = { +DUSK_GAME_DATA dCcD_SrcCyl daObjPicture_c::s_CcDCyl_pic_at = { { {0x0, {{0x400, 0x1, 0x11}, {0x0, 0x11}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -548,7 +548,7 @@ dCcD_SrcCyl daObjPicture_c::s_CcDCyl_pic_at = { } }; -static actor_method_class daObjPicture_METHODS = { +static DUSK_CONST actor_method_class daObjPicture_METHODS = { (process_method_func)daObjPicture_create, (process_method_func)daObjPicture_Delete, (process_method_func)daObjPicture_execute, @@ -556,7 +556,7 @@ static actor_method_class daObjPicture_METHODS = { (process_method_func)daObjPicture_draw, }; -actor_process_profile_definition g_profile_Obj_Picture = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Picture = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_pillar.cpp b/src/d/actor/d_a_obj_pillar.cpp index 965b93fc4d..47ecccf575 100644 --- a/src/d/actor/d_a_obj_pillar.cpp +++ b/src/d/actor/d_a_obj_pillar.cpp @@ -59,7 +59,7 @@ static const daPillar_c::sdata_t l_shake_data[] = { /* CRASH */ {5, 0, 800, 120, 7000, 30, 15}, }; -static char* l_arcName[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[] = { "K_mbhasi0", "K_mbhasi1", }; @@ -479,7 +479,7 @@ static int daPillar_MoveBGDraw(daPillar_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daPillar_METHODS = { +static DUSK_CONST actor_method_class daPillar_METHODS = { (process_method_func)daPillar_create1st, (process_method_func)daPillar_MoveBGDelete, (process_method_func)daPillar_MoveBGExecute, @@ -487,7 +487,7 @@ static actor_method_class daPillar_METHODS = { (process_method_func)daPillar_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Pillar = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Pillar = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_pleaf.cpp b/src/d/actor/d_a_obj_pleaf.cpp index b714bbd870..afc230dade 100644 --- a/src/d/actor/d_a_obj_pleaf.cpp +++ b/src/d/actor/d_a_obj_pleaf.cpp @@ -7,9 +7,9 @@ #include "d/actor/d_a_obj_pleaf.h" -static char* l_resName = "J_Hatake"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resName = "J_Hatake"; -daObj_Pleaf_HIOParam const daObj_Pleaf_Param_c::m = {0, -3.0f, 1.0f, 900.0f}; +DUSK_GAME_DATA daObj_Pleaf_HIOParam const daObj_Pleaf_Param_c::m = {0, -3.0f, 1.0f, 900.0f}; static OBJ_PLEAF_HIO_CLASS l_HIO; @@ -123,7 +123,7 @@ int daObj_Pleaf_c::createHeapCallBack(fopAc_ac_c* i_this) { return static_cast(i_this)->CreateHeap(); } -char* daObj_Pleaf_c::getResName() { +char DUSK_CONST* daObj_Pleaf_c::getResName() { return l_resName; } @@ -172,13 +172,13 @@ static int daObj_Pleaf_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_Pleaf_MethodTable = { +static DUSK_CONST actor_method_class daObj_Pleaf_MethodTable = { (process_method_func)daObj_Pleaf_Create, (process_method_func)daObj_Pleaf_Delete, (process_method_func)daObj_Pleaf_Execute, (process_method_func)daObj_Pleaf_IsDelete, (process_method_func)daObj_Pleaf_Draw, }; -actor_process_profile_definition g_profile_OBJ_PLEAF = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_PLEAF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_poCandle.cpp b/src/d/actor/d_a_obj_poCandle.cpp index 70f914bb25..e7bc470f2f 100644 --- a/src/d/actor/d_a_obj_poCandle.cpp +++ b/src/d/actor/d_a_obj_poCandle.cpp @@ -241,7 +241,7 @@ static int daPoCandle_Create(fopAc_ac_c* i_this) { return ((daPoCandle_c*)i_this)->create(); } -static actor_method_class l_daPoCandle_Method = { +static DUSK_CONST actor_method_class l_daPoCandle_Method = { (process_method_func)daPoCandle_Create, (process_method_func)daPoCandle_Delete, (process_method_func)daPoCandle_Execute, @@ -249,7 +249,7 @@ static actor_method_class l_daPoCandle_Method = { (process_method_func)daPoCandle_Draw, }; -actor_process_profile_definition g_profile_Obj_poCandle = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_poCandle = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_poFire.cpp b/src/d/actor/d_a_obj_poFire.cpp index 4c2f9d9ac0..ed01ba3013 100644 --- a/src/d/actor/d_a_obj_poFire.cpp +++ b/src/d/actor/d_a_obj_poFire.cpp @@ -380,7 +380,7 @@ bool daPoFire_c::eventStart() { } bool daPoFire_c::eventRun() { - static char* action_table[1] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[1] = { "MOVE_END", }; @@ -431,13 +431,13 @@ static int daPoFire_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daPoFire_Method = { +static DUSK_CONST actor_method_class l_daPoFire_Method = { (process_method_func)daPoFire_Create, (process_method_func)daPoFire_Delete, (process_method_func)daPoFire_Execute, NULL, (process_method_func)daPoFire_Draw, }; -actor_process_profile_definition g_profile_Obj_poFire = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_poFire = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_poTbox.cpp b/src/d/actor/d_a_obj_poTbox.cpp index 9ef2bfde09..e850c0e67b 100644 --- a/src/d/actor/d_a_obj_poTbox.cpp +++ b/src/d/actor/d_a_obj_poTbox.cpp @@ -18,16 +18,16 @@ public: /* 0x8 */ f32 close_speed; }; -static char* l_type[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_type[2] = { "pouBox0", "pouBox1", }; -static int l_bmdIdx[] = { +static DUSK_CONSTEXPR int l_bmdIdx[] = { 10, 8, }; -static int l_dzbIdx[] = { +static DUSK_CONSTEXPR int l_dzbIdx[] = { 21, 11, }; @@ -157,7 +157,7 @@ int daPoTbox_c::create() { static daPoTbox_HIO_c l_HIO; int daPoTbox_c::Execute(Mtx** param_0) { - static void (daPoTbox_c::*mode_proc[])() = { + static DUSK_CONSTEXPR void (daPoTbox_c::*mode_proc[])() = { &daPoTbox_c::modeWait, &daPoTbox_c::modeOpen, &daPoTbox_c::modeOpenEnd, @@ -295,7 +295,7 @@ static int daPoTbox_Create(fopAc_ac_c* i_this) { return ((daPoTbox_c*)i_this)->create(); } -static actor_method_class l_daPoTbox_Method = { +static DUSK_CONST actor_method_class l_daPoTbox_Method = { (process_method_func)daPoTbox_Create, (process_method_func)daPoTbox_Delete, (process_method_func)daPoTbox_Execute, @@ -303,7 +303,7 @@ static actor_method_class l_daPoTbox_Method = { (process_method_func)daPoTbox_Draw, }; -actor_process_profile_definition g_profile_Obj_poTbox = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_poTbox = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_prop.cpp b/src/d/actor/d_a_obj_prop.cpp index 393bd02c7e..c49cc10cd8 100644 --- a/src/d/actor/d_a_obj_prop.cpp +++ b/src/d/actor/d_a_obj_prop.cpp @@ -93,13 +93,13 @@ static int daObjProp_draw(daObjProp_c* i_this) { return i_this->draw(); } -static actor_method_class daObjProp_METHODS = { +static DUSK_CONST actor_method_class daObjProp_METHODS = { (process_method_func)daObjProp_create, (process_method_func)daObjProp_Delete, (process_method_func)daObjProp_execute, (process_method_func)NULL, (process_method_func)daObjProp_draw, }; -actor_process_profile_definition g_profile_Obj_Prop = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Prop = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_pumpkin.cpp b/src/d/actor/d_a_obj_pumpkin.cpp index 6dcd0988f7..c5c3d01504 100644 --- a/src/d/actor/d_a_obj_pumpkin.cpp +++ b/src/d/actor/d_a_obj_pumpkin.cpp @@ -17,7 +17,7 @@ #include #endif -const daObj_Pumpkin_HIOParam daObj_Pumpkin_Param_c::m = { +DUSK_GAME_DATA const daObj_Pumpkin_HIOParam daObj_Pumpkin_Param_c::m = { 0.0f, -5.0f, 1.4f, @@ -143,11 +143,11 @@ const dCcD_SrcGObjInf l_ccDObjData = { }; -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { {3, 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "pumpkin", }; @@ -883,7 +883,7 @@ static int daObj_Pumpkin_IsDelete(void*) { return 1; } -static actor_method_class daObj_Pumpkin_MethodTable = { +static DUSK_CONST actor_method_class daObj_Pumpkin_MethodTable = { (process_method_func)daObj_Pumpkin_Create, (process_method_func)daObj_Pumpkin_Delete, (process_method_func)daObj_Pumpkin_Execute, @@ -891,7 +891,7 @@ static actor_method_class daObj_Pumpkin_MethodTable = { (process_method_func)daObj_Pumpkin_Draw, }; -actor_process_profile_definition g_profile_OBJ_PUMPKIN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_PUMPKIN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rcircle.cpp b/src/d/actor/d_a_obj_rcircle.cpp index 6beb12110c..35b91e8129 100644 --- a/src/d/actor/d_a_obj_rcircle.cpp +++ b/src/d/actor/d_a_obj_rcircle.cpp @@ -12,7 +12,7 @@ static int daObjRCircle_c_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_arcName = "RCircle"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "RCircle"; daObjRCircle_c::daObjRCircle_c() {} @@ -116,13 +116,13 @@ static int daObjRCircle_draw(daObjRCircle_c* i_this) { return i_this->draw(); } -static actor_method_class daObjRCircle_METHODS = { +static DUSK_CONST actor_method_class daObjRCircle_METHODS = { (process_method_func)daObjRCircle_create, (process_method_func)daObjRCircle_Delete, (process_method_func)daObjRCircle_execute, (process_method_func)NULL, (process_method_func)daObjRCircle_draw, }; -actor_process_profile_definition g_profile_Obj_RCircle = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RCircle = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rfHole.cpp b/src/d/actor/d_a_obj_rfHole.cpp index 7cec9644c1..28e18466ed 100644 --- a/src/d/actor/d_a_obj_rfHole.cpp +++ b/src/d/actor/d_a_obj_rfHole.cpp @@ -193,7 +193,7 @@ static int daRfHole_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daRfHole_Method = { +static DUSK_CONST actor_method_class l_daRfHole_Method = { (process_method_func)daRfHole_Create, (process_method_func)daRfHole_Delete, (process_method_func)daRfHole_Execute, @@ -201,7 +201,7 @@ static actor_method_class l_daRfHole_Method = { (process_method_func)daRfHole_Draw, }; -actor_process_profile_definition g_profile_Obj_RfHole = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RfHole = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rgate.cpp b/src/d/actor/d_a_obj_rgate.cpp index a652eb6a03..66616d3d34 100644 --- a/src/d/actor/d_a_obj_rgate.cpp +++ b/src/d/actor/d_a_obj_rgate.cpp @@ -210,10 +210,10 @@ void daObjRgate_c::setBaseMtx() { } } -static char* l_arcName = "M_RGate00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_RGate00"; int daObjRgate_c::Create() { - static char* l_evName = "RIDER_GATE_OPEN00"; + static DUSK_CONSTEXPR char DUSK_CONST* l_evName = "RIDER_GATE_OPEN00"; u8 sw_no = getSwNo(); if (sw_no != 0xFF && !fopAcM_isSwitch(this, sw_no) && @@ -803,7 +803,7 @@ void daObjRgate_c::demoProc() { } int daObjRgate_c::getDemoAction() { - static char* action_table[] = {"WAIT", "ADJUSTMENT", "UNLOCK", "OPEN"}; + static DUSK_CONSTEXPR char DUSK_CONST* action_table[] = {"WAIT", "ADJUSTMENT", "UNLOCK", "OPEN"}; return dComIfGp_evmng_getMyActIdx(mStaffID, action_table, ARRAY_SIZEU(action_table), 0, 0); } @@ -872,13 +872,13 @@ static int daObjRgate_MoveBGDraw(daObjRgate_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjRgate_METHODS = { +static DUSK_CONST actor_method_class daObjRgate_METHODS = { (process_method_func)daObjRgate_create1st, (process_method_func)daObjRgate_MoveBGDelete, (process_method_func)daObjRgate_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjRgate_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_RiderGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RiderGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_riverrock.cpp b/src/d/actor/d_a_obj_riverrock.cpp index 4b530882a1..7c61b15de4 100644 --- a/src/d/actor/d_a_obj_riverrock.cpp +++ b/src/d/actor/d_a_obj_riverrock.cpp @@ -10,7 +10,7 @@ #include "d/d_cc_d.h" #include "d/d_com_inf_game.h" -static char* l_arcName = "RiverRock"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "RiverRock"; daObjRIVERROCK_HIO_c::daObjRIVERROCK_HIO_c() { field_0x4 = -1; @@ -312,7 +312,7 @@ int daObjRIVERROCK_c::Delete() { return 1; } -static actor_method_class l_daObjRIVERROCK_Method = { +static DUSK_CONST actor_method_class l_daObjRIVERROCK_Method = { (process_method_func)daObjRIVERROCK_Create, (process_method_func)daObjRIVERROCK_Delete, (process_method_func)daObjRIVERROCK_Execute, @@ -320,7 +320,7 @@ static actor_method_class l_daObjRIVERROCK_Method = { (process_method_func)daObjRIVERROCK_Draw, }; -actor_process_profile_definition g_profile_Obj_RIVERROCK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RIVERROCK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rock.cpp b/src/d/actor/d_a_obj_rock.cpp index 6bf1bf84e1..453eff92f0 100644 --- a/src/d/actor/d_a_obj_rock.cpp +++ b/src/d/actor/d_a_obj_rock.cpp @@ -195,12 +195,12 @@ rock_ss::~rock_ss() {} rock_ss::rock_ss() {} -static actor_method_class l_daObj_Rock_Method = { +static DUSK_CONST actor_method_class l_daObj_Rock_Method = { (process_method_func)daObj_Rock_Create, (process_method_func)daObj_Rock_Delete, (process_method_func)daObj_Rock_Execute, (process_method_func)daObj_Rock_IsDelete, (process_method_func)daObj_Rock_Draw}; -actor_process_profile_definition g_profile_OBJ_ROCK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_ROCK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rope_bridge.cpp b/src/d/actor/d_a_obj_rope_bridge.cpp index 7d5ff20af5..3fcd949d1a 100644 --- a/src/d/actor/d_a_obj_rope_bridge.cpp +++ b/src/d/actor/d_a_obj_rope_bridge.cpp @@ -10,9 +10,9 @@ #include "d/d_s_play.h" #include -static char* l_arcName[2] = {"L_RopeB_S", "L_RopeB_L"}; +static DUSK_CONST char* l_arcName[2] = {"L_RopeB_S", "L_RopeB_L"}; -static char* l_ropeArcName = "L_Ropest"; +static DUSK_CONST char* l_ropeArcName = "L_Ropest"; void daObjRBridge_c::initBaseMtx() { mDoMtx_stack_c::transS(current.pos); @@ -244,12 +244,12 @@ BOOL daObjRBridge_c::checkTight() { return FALSE; } -static cull_box l_cull_sizeS = { +static DUSK_CONSTEXPR cull_box l_cull_sizeS = { {-250.0f, 0.0f, -100.0f}, {250.0f, 1100.0f, 1000.0f}, }; -static cull_box l_cull_sizeL = { +static DUSK_CONSTEXPR cull_box l_cull_sizeL = { {-400.0f, 0.0f, -100.0f}, {400.0f, 1500.0f, 1500.0f}, }; @@ -321,8 +321,8 @@ int daObjRBridge_c::Create() { mCcCps[i].SetStts(&mCcStts); } - Vec* cull_min; - Vec* cull_max; + Vec DUSK_CONST* cull_min; + Vec DUSK_CONST* cull_max; if (mType == 0) { cull_min = &l_cull_sizeS.min; cull_max = &l_cull_sizeS.max; @@ -629,7 +629,7 @@ static int daObjRBridge_MoveBGDraw(daObjRBridge_c* a_this) { return a_this->MoveBGDraw(); } -static actor_method_class daObjRBridge_METHODS = { +static DUSK_CONST actor_method_class daObjRBridge_METHODS = { (process_method_func)daObjRBridge_create1st, (process_method_func)daObjRBridge_MoveBGDelete, (process_method_func)daObjRBridge_MoveBGExecute, @@ -637,7 +637,7 @@ static actor_method_class daObjRBridge_METHODS = { (process_method_func)daObjRBridge_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_RopeBridge = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RopeBridge = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rotBridge.cpp b/src/d/actor/d_a_obj_rotBridge.cpp index e024eedb9a..7f2577f563 100644 --- a/src/d/actor/d_a_obj_rotBridge.cpp +++ b/src/d/actor/d_a_obj_rotBridge.cpp @@ -7,7 +7,7 @@ #include "d/actor/d_a_obj_rotBridge.h" -static char* l_resNameIdx[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[3] = { "P_Mbridge", "P_Mbridge", "P_Mbrid9", @@ -252,7 +252,7 @@ static int daRotBridge_Create(fopAc_ac_c* i_this) { return ((daRotBridge_c*)i_this)->create(); } -static actor_method_class l_daRotBridge_Method = { +static DUSK_CONST actor_method_class l_daRotBridge_Method = { (process_method_func)daRotBridge_Create, (process_method_func)daRotBridge_Delete, (process_method_func)daRotBridge_Execute, @@ -260,7 +260,7 @@ static actor_method_class l_daRotBridge_Method = { (process_method_func)daRotBridge_Draw, }; -actor_process_profile_definition g_profile_Obj_RotBridge = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RotBridge = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rotTrap.cpp b/src/d/actor/d_a_obj_rotTrap.cpp index 095b2e457d..d298db61be 100644 --- a/src/d/actor/d_a_obj_rotTrap.cpp +++ b/src/d/actor/d_a_obj_rotTrap.cpp @@ -19,14 +19,14 @@ daRotTrap_HIO_c::daRotTrap_HIO_c() { static daRotTrap_HIO_c l_HIO; -dCcD_SrcGObjInf const daRotTrap_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daRotTrap_c::mCcDObjInfo = { {0, {{AT_TYPE_800, 0x1, 0x1F}, {0x0, 0x0}, {0}}}, {dCcD_SE_SWORD, 0, 1, 0, 0}, {dCcD_SE_STONE, 0, 0, 0, 0}, {0} }; -dCcD_SrcCyl daRotTrap_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daRotTrap_c::mCcDCyl = { mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f} @@ -311,7 +311,7 @@ static int daRotTrap_Create(fopAc_ac_c* i_this) { return ((daRotTrap_c*)i_this)->create(); } -static actor_method_class l_daRotTrap_Method = { +static DUSK_CONST actor_method_class l_daRotTrap_Method = { (process_method_func)daRotTrap_Create, (process_method_func)daRotTrap_Delete, (process_method_func)daRotTrap_Execute, @@ -319,7 +319,7 @@ static actor_method_class l_daRotTrap_Method = { (process_method_func)daRotTrap_Draw, }; -actor_process_profile_definition g_profile_Obj_RotTrap = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RotTrap = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_roten.cpp b/src/d/actor/d_a_obj_roten.cpp index dbbe609654..7fa091e59e 100644 --- a/src/d/actor/d_a_obj_roten.cpp +++ b/src/d/actor/d_a_obj_roten.cpp @@ -68,9 +68,9 @@ int daObj_Roten_c::Create() { return 1; } -static char* l_resFileName = "Obj_roten"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resFileName = "Obj_roten"; -static u32 l_bmdFileIdx = 4; +static DUSK_CONSTEXPR u32 l_bmdFileIdx = 4; int daObj_Roten_c::CreateHeap() { J3DModelData* mdlData_p = (J3DModelData*)dComIfG_getObjectRes(getResName(), l_bmdFileIdx); @@ -79,7 +79,7 @@ int daObj_Roten_c::CreateHeap() { return mModel != NULL; } -static u32 l_dzbFileIdx = 7; +static DUSK_CONSTEXPR u32 l_dzbFileIdx = 7; int daObj_Roten_c::create() { fopAcM_ct(this, daObj_Roten_c); @@ -142,7 +142,7 @@ int daObj_Roten_c::Delete() { return 1; } -char* daObj_Roten_c::getResName() { +char DUSK_CONST* daObj_Roten_c::getResName() { return l_resFileName; } @@ -169,7 +169,7 @@ static int daObj_Roten_IsDelete(void* i_this) { daObj_Roten_c::~daObj_Roten_c() { } -static actor_method_class daObj_Roten_MethodTable = { +static DUSK_CONST actor_method_class daObj_Roten_MethodTable = { (process_method_func)daObj_Roten_Create, (process_method_func)daObj_Roten_Delete, (process_method_func)daObj_Roten_Execute, @@ -177,7 +177,7 @@ static actor_method_class daObj_Roten_MethodTable = { (process_method_func)daObj_Roten_Draw, }; -actor_process_profile_definition g_profile_OBJ_ROTEN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_ROTEN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rstair.cpp b/src/d/actor/d_a_obj_rstair.cpp index 609a0cf7b8..33068cdae7 100644 --- a/src/d/actor/d_a_obj_rstair.cpp +++ b/src/d/actor/d_a_obj_rstair.cpp @@ -70,7 +70,7 @@ int daObjRotStair_c::Create() { return 1; } -static char* l_arcName = "K_spkai00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "K_spkai00"; static Vec l_water_check_offset = { 0.0f, 2000.0f, -2000.0f, @@ -354,7 +354,7 @@ static int daObjRotStair_MoveBGDraw(daObjRotStair_c* i_this) { } -static actor_method_class daObjRotStair_METHODS = { +static DUSK_CONST actor_method_class daObjRotStair_METHODS = { (process_method_func)daObjRotStair_create1st, (process_method_func)daObjRotStair_MoveBGDelete, (process_method_func)daObjRotStair_MoveBGExecute, @@ -362,7 +362,7 @@ static actor_method_class daObjRotStair_METHODS = { (process_method_func)daObjRotStair_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_RotStair = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_RotStair = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_rw.cpp b/src/d/actor/d_a_obj_rw.cpp index 94ea6350c4..1958c4d583 100644 --- a/src/d/actor/d_a_obj_rw.cpp +++ b/src/d/actor/d_a_obj_rw.cpp @@ -335,7 +335,7 @@ static int daOBJ_RW_Create(fopAc_ac_c* actor) { } // mSphAttr }; - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -386,7 +386,7 @@ static int daOBJ_RW_Create(fopAc_ac_c* actor) { return phase_state; } -static actor_method_class l_daOBJ_RW_Method = { +static DUSK_CONST actor_method_class l_daOBJ_RW_Method = { (process_method_func)daOBJ_RW_Create, (process_method_func)daOBJ_RW_Delete, (process_method_func)daOBJ_RW_Execute, @@ -394,7 +394,7 @@ static actor_method_class l_daOBJ_RW_Method = { (process_method_func)daOBJ_RW_Draw, }; -actor_process_profile_definition g_profile_OBJ_RW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_RW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sWallShutter.cpp b/src/d/actor/d_a_obj_sWallShutter.cpp index 7c7f2b0c63..c90ce1ec1a 100644 --- a/src/d/actor/d_a_obj_sWallShutter.cpp +++ b/src/d/actor/d_a_obj_sWallShutter.cpp @@ -9,7 +9,7 @@ #include "SSystem/SComponent/c_math.h" #include "d/d_com_inf_game.h" -static char* l_resNameIdx[2] = { +static DUSK_CONST char* l_resNameIdx[2] = { "P_Rgate", "SDGate", }; @@ -231,13 +231,13 @@ static int daSwShutter_Create(fopAc_ac_c* i_this) { return ((daSwShutter_c*)i_this)->create(); } -static actor_method_class l_daSwShutter_Method = { +static DUSK_CONST actor_method_class l_daSwShutter_Method = { (process_method_func)daSwShutter_Create, (process_method_func)daSwShutter_Delete, (process_method_func)daSwShutter_Execute, (process_method_func)NULL, (process_method_func)daSwShutter_Draw, }; -actor_process_profile_definition g_profile_Obj_SwallShutter = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwallShutter = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_saidan.cpp b/src/d/actor/d_a_obj_saidan.cpp index ed4818e0f5..ab0d6bf923 100644 --- a/src/d/actor/d_a_obj_saidan.cpp +++ b/src/d/actor/d_a_obj_saidan.cpp @@ -148,13 +148,13 @@ static int daSaidan_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daSaidan_Method = { +static DUSK_CONST actor_method_class l_daSaidan_Method = { (process_method_func)daSaidan_Create, (process_method_func)daSaidan_Delete, (process_method_func)daSaidan_Execute, NULL, (process_method_func)daSaidan_Draw, }; -actor_process_profile_definition g_profile_Obj_Saidan = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Saidan = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sakuita.cpp b/src/d/actor/d_a_obj_sakuita.cpp index d81e2a6825..8092f2d853 100644 --- a/src/d/actor/d_a_obj_sakuita.cpp +++ b/src/d/actor/d_a_obj_sakuita.cpp @@ -51,11 +51,11 @@ void daObjSakuita_Hio_c::dt() { static daObjSakuita_Hio_c M_hio; #endif -daObjSakuita_Attr_c const daObjSakuita_c::M_attr = { +DUSK_GAME_DATA daObjSakuita_Attr_c const daObjSakuita_c::M_attr = { 20.0f, 12.0f, 70.0f, -50.0f, 0.8f, 0.5f, -6.0f, 900.0f, 20000.0f, 100.0f, 0x1400, 0x14, }; -static char* l_arcName = "A_Sakuita"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "A_Sakuita"; void daObjSakuita_c::create_init() { fopAcM_setCullSizeBox(this, -30.0f, -90.0f, -10.0f, 30.0f, 20.0f, 10.0f); @@ -205,7 +205,7 @@ static int daObjSakuita_Create(fopAc_ac_c* i_actor) { return static_cast(i_actor)->create(); } -static actor_method_class l_daObjSakuita_Method = { +static DUSK_CONST actor_method_class l_daObjSakuita_Method = { (process_method_func)daObjSakuita_Create, (process_method_func)daObjSakuita_Delete, (process_method_func)daObjSakuita_Execute, @@ -213,7 +213,7 @@ static actor_method_class l_daObjSakuita_Method = { (process_method_func)daObjSakuita_Draw, }; -actor_process_profile_definition g_profile_Obj_Sakuita = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Sakuita = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sakuita_rope.cpp b/src/d/actor/d_a_obj_sakuita_rope.cpp index 87beb7066f..40bfd7cfcf 100644 --- a/src/d/actor/d_a_obj_sakuita_rope.cpp +++ b/src/d/actor/d_a_obj_sakuita_rope.cpp @@ -61,7 +61,7 @@ int Sakuita_c::setModelData(J3DModelData* i_modelData) { return 1; } -daObjItaRope_Attr_c const daObjItaRope_c::M_attr = { +DUSK_GAME_DATA daObjItaRope_Attr_c const daObjItaRope_c::M_attr = { -5.0f, 0.2f, 0.5f, 0.8f, 0, }; @@ -134,7 +134,7 @@ void Sakuita_c::calcAngle() { mRotation.z = -cM_atan2s(local_28.x, local_28.y); } -static char* l_arcName = "A_Sakuita"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "A_Sakuita"; #if DEBUG daObjItaRope_Hio_c M_hio; @@ -376,7 +376,7 @@ static int daObjItaRope_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjItaRope_Method = { +static DUSK_CONST actor_method_class l_daObjItaRope_Method = { (process_method_func)daObjItaRope_Create, (process_method_func)daObjItaRope_Delete, (process_method_func)daObjItaRope_Execute, @@ -384,7 +384,7 @@ static actor_method_class l_daObjItaRope_Method = { (process_method_func)daObjItaRope_Draw, }; -actor_process_profile_definition g_profile_Obj_ItaRope = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ItaRope = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_scannon.cpp b/src/d/actor/d_a_obj_scannon.cpp index 29c36b85fc..ceb4399463 100644 --- a/src/d/actor/d_a_obj_scannon.cpp +++ b/src/d/actor/d_a_obj_scannon.cpp @@ -11,17 +11,17 @@ #include "d/d_s_play.h" #include -char* l_arcName_Comp = "SkyCannon"; +DUSK_CONSTEXPR char DUSK_CONST* l_arcName_Comp = "SkyCannon"; -char* l_arcName_Crash = "SCanHai"; +DUSK_CONSTEXPR char DUSK_CONST* l_arcName_Crash = "SCanHai"; -char* l_arcName_Zev = "SCanZev"; +DUSK_CONSTEXPR char DUSK_CONST* l_arcName_Zev = "SCanZev"; -char* l_arcName_Ptl = "SCanPtl"; +DUSK_CONSTEXPR char DUSK_CONST* l_arcName_Ptl = "SCanPtl"; -char* l_staffName = "SCannon"; +DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "SCannon"; -char* l_eventName[4] = { +DUSK_CONSTEXPR char DUSK_CONST* l_eventName[4] = { "SKY_CANNON_WARP_END", "SKY_CANNON_FIRE_FIRST", "SKY_CANNON_FIRE_TKS", @@ -53,7 +53,7 @@ daSCannon_c::daSCannon_c() { } daSCannon_c::~daSCannon_c() { - char* arcname; + char DUSK_CONST* arcname; if (mLayerNo == 3 || mLayerNo == 10) { arcname = l_arcName_Comp; } else if (mLayerNo == 1) { @@ -93,7 +93,7 @@ int daSCannon_c::create() { return cPhs_ERROR_e; } - char* arcname = l_arcName_Comp; + char DUSK_CONST* arcname = l_arcName_Comp; int ptl_phase_state = cPhs_COMPLEATE_e; if (layerNo == 1) { arcname = l_arcName_Crash; @@ -264,7 +264,7 @@ void daSCannon_c::setPtlModelMtx() { } int daSCannon_c::createHeap() { - char* arcname; + char DUSK_CONST* arcname; int bmd_index; int dzb_index; @@ -436,51 +436,51 @@ void daSCannon_c::exeModeOrderEvt() { eventInfo.onCondition(dEvtCnd_CANDEMO_e); } -void (daSCannon_c::*daSCannon_c::s_exeProc[])() = { +DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST daSCannon_c::s_exeProc[])() = { &daSCannon_c::exeModeWait, &daSCannon_c::exeModeOrderEvt, &daSCannon_c::exeModeActionEvt, &daSCannon_c::exeModeEnd, }; -char* CUT_TYPE_TABLE_WARP_END[2] = { +DUSK_CONSTEXPR char DUSK_CONST* CUT_TYPE_TABLE_WARP_END[2] = { "WAIT", "MOVE", }; -char* CUT_TYPE_TABLE_FIRE_TKS[3] = { +DUSK_CONSTEXPR char DUSK_CONST* CUT_TYPE_TABLE_FIRE_TKS[3] = { "0001_WAIT", "0002_RUN", "0003_JUMP", }; -char* CUT_TYPE_TABLE_FIRE_FIRST[1] = { +DUSK_CONSTEXPR char DUSK_CONST* CUT_TYPE_TABLE_FIRE_FIRST[1] = { "LINK_IN", }; -char* CUT_TYPE_TABLE_FIRE_SECOND[4] = { +DUSK_CONSTEXPR char DUSK_CONST* CUT_TYPE_TABLE_FIRE_SECOND[4] = { "SET", "MOVE", "FIRE", "FINISH", }; -void (daSCannon_c::*daSCannon_c::s_demoExeProc_WarpEnd[][2])() = { +DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST daSCannon_c::s_demoExeProc_WarpEnd[][2])() = { {&daSCannon_c::demoInitWarpEndWait, &daSCannon_c::demoExeWarpEndWait}, {&daSCannon_c::demoInitWarpEndMove, &daSCannon_c::demoExeWarpEndMove}, }; -void (daSCannon_c::*daSCannon_c::s_demoExeProc_FireTks[][2])() = { +DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST daSCannon_c::s_demoExeProc_FireTks[][2])() = { {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, }; -void (daSCannon_c::*daSCannon_c::s_demoExeProc_FireFirst[][2])() = { +DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST daSCannon_c::s_demoExeProc_FireFirst[][2])() = { {&daSCannon_c::demoInitLinkIn, &daSCannon_c::demoExeLinkIn}, }; -void (daSCannon_c::*daSCannon_c::s_demoExeProc_FireSecond[][2])() = { +DUSK_GAME_DATA void (daSCannon_c::*DUSK_CONST daSCannon_c::s_demoExeProc_FireSecond[][2])() = { {&daSCannon_c::demoInitSet, &daSCannon_c::demoExeSet}, {&daSCannon_c::demoInitMove, &daSCannon_c::demoExeMove}, {&daSCannon_c::demoInitFire, &daSCannon_c::demoExeFire}, @@ -525,7 +525,7 @@ void daSCannon_c::exeModeActionEvt() { void daSCannon_c::exeModeEnd() {} -const daSCannon_c::demoTable_s daSCannon_c::s_demoTable[] = { +DUSK_GAME_DATA const daSCannon_c::demoTable_s daSCannon_c::s_demoTable[] = { {s_demoExeProc_WarpEnd, CUT_TYPE_TABLE_WARP_END, 2}, {s_demoExeProc_FireFirst, CUT_TYPE_TABLE_FIRE_FIRST, 1}, {s_demoExeProc_FireTks, CUT_TYPE_TABLE_FIRE_TKS, 3}, @@ -533,7 +533,7 @@ const daSCannon_c::demoTable_s daSCannon_c::s_demoTable[] = { }; void daSCannon_c::demoExe() { - char** cut_table = s_demoTable[mDemoType].cut_table; + char DUSK_CONST* DUSK_CONST* cut_table = s_demoTable[mDemoType].cut_table; int cut_num = s_demoTable[mDemoType].cut_num; int act_idx = dComIfGp_evmng_getMyActIdx(mStaffId, cut_table, cut_num, 0, 0); if (act_idx != -1) { @@ -566,7 +566,7 @@ void daSCannon_c::demoExeLinkIn() { player_p->onPlayerNoDraw(); player_p->onPlayerShadowNoDraw(); - cXyz pos(-102065.44f, -17973.893f, 53981.64f); + DUSK_CONSTEXPR cXyz pos(-102065.44f, -17973.893f, 53981.64f); player_p->setPlayerPosAndAngle(&pos, player_p->shape_angle.y, 0); mpBgW->OffRoofRegist(); } @@ -842,7 +842,7 @@ static int daSCannon_draw(daSCannon_c* i_this) { return i_this->draw(); } -static actor_method_class daSCannon_METHODS = { +static DUSK_CONST actor_method_class daSCannon_METHODS = { (process_method_func)daSCannon_create, (process_method_func)daSCannon_Delete, (process_method_func)daSCannon_execute, @@ -850,7 +850,7 @@ static actor_method_class daSCannon_METHODS = { (process_method_func)daSCannon_draw, }; -actor_process_profile_definition g_profile_Obj_SCannon = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SCannon = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_scannon_crs.cpp b/src/d/actor/d_a_obj_scannon_crs.cpp index 28d91740b1..033cf92dd4 100644 --- a/src/d/actor/d_a_obj_scannon_crs.cpp +++ b/src/d/actor/d_a_obj_scannon_crs.cpp @@ -33,11 +33,11 @@ static int eventCallBack(void* i_proc, int param_1) { return 1; } -static char* l_arcName = "SCanCrs"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "SCanCrs"; -static char* l_eventName = "SKY_CANNON_WARP_START"; +static DUSK_CONSTEXPR char DUSK_CONST* l_eventName = "SKY_CANNON_WARP_START"; -static char* l_staffName = "SCanCrs"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "SCanCrs"; daSCannonCrs_c::daSCannonCrs_c() { mpBgW = NULL; @@ -267,7 +267,7 @@ void daSCannonCrs_c::exeModeWarpEvt(daMidna_c* i_midna_p) { void daSCannonCrs_c::exeModeEnd(daMidna_c* i_midna_p) {} -void (daSCannonCrs_c::*daSCannonCrs_c::s_exeProc[])(daMidna_c*) = { +DUSK_GAME_DATA void (daSCannonCrs_c::*daSCannonCrs_c::s_exeProc[])(daMidna_c*) = { &daSCannonCrs_c::exeModeWait, &daSCannonCrs_c::exeModePreWait, &daSCannonCrs_c::exeModeOrderEvt, @@ -277,7 +277,7 @@ void (daSCannonCrs_c::*daSCannonCrs_c::s_exeProc[])(daMidna_c*) = { }; void daSCannonCrs_c::demoExe() { - static char* CUT_TYPE_TABLE[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* CUT_TYPE_TABLE[4] = { "WAIT", "BEAM_HIT", "READY", @@ -509,7 +509,7 @@ static int daSCannonCrs_draw(daSCannonCrs_c* i_this) { return i_this->draw(); } -static actor_method_class daSCannonCrs_METHODS = { +static DUSK_CONST actor_method_class daSCannonCrs_METHODS = { (process_method_func)daSCannonCrs_create, (process_method_func)daSCannonCrs_Delete, (process_method_func)daSCannonCrs_execute, @@ -517,7 +517,7 @@ static actor_method_class daSCannonCrs_METHODS = { (process_method_func)daSCannonCrs_draw, }; -actor_process_profile_definition g_profile_Obj_SCannonCrs = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SCannonCrs = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_scannon_ten.cpp b/src/d/actor/d_a_obj_scannon_ten.cpp index 17a3f5e61f..4794b783e2 100644 --- a/src/d/actor/d_a_obj_scannon_ten.cpp +++ b/src/d/actor/d_a_obj_scannon_ten.cpp @@ -11,11 +11,11 @@ #include "f_op/f_op_camera_mng.h" #include -static char* l_arcName = "SCanTen"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "SCanTen"; -static char* l_staffName = "SCanTen"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "SCanTen"; -static char* l_eventName = "SKY_CANNON_TEN_FIRE"; +static DUSK_CONSTEXPR char DUSK_CONST* l_eventName = "SKY_CANNON_TEN_FIRE"; static int eventCallBack(void* i_proc, int param_1) { daObjSCannonTen_c* proc = (daObjSCannonTen_c*)i_proc; @@ -148,14 +148,14 @@ int daObjSCannonTen_c::execute() { return 1; } -const daObjSCannonTen_c::ExeProc daObjSCannonTen_c::s_exeProc[] = { +DUSK_GAME_DATA const daObjSCannonTen_c::ExeProc daObjSCannonTen_c::s_exeProc[] = { &daObjSCannonTen_c::exeModeWait, &daObjSCannonTen_c::exeModeOrderEvt, &daObjSCannonTen_c::exeModeActionEvt, &daObjSCannonTen_c::exeModeEnd, }; -const daObjSCannonTen_c::ExeProc daObjSCannonTen_c::s_demoExeProc[][2] = { +DUSK_GAME_DATA const daObjSCannonTen_c::ExeProc daObjSCannonTen_c::s_demoExeProc[][2] = { {&daObjSCannonTen_c::demoInitLinkIn, &daObjSCannonTen_c::demoExeLinkIn}, {&daObjSCannonTen_c::demoInitSet, &daObjSCannonTen_c::demoExeSet}, {&daObjSCannonTen_c::demoInitMove, &daObjSCannonTen_c::demoExeMove}, @@ -217,7 +217,7 @@ void daObjSCannonTen_c::exeModeActionEvt() { void daObjSCannonTen_c::exeModeEnd() {} void daObjSCannonTen_c::demoExe() { - static char* CUT_TYPE_TABLE_FIRE_SECOND[6] = { + static DUSK_CONSTEXPR char DUSK_CONST* CUT_TYPE_TABLE_FIRE_SECOND[6] = { "LINK_IN", "SET", "MOVE", @@ -460,7 +460,7 @@ static int daObjSCannonTen_draw(daObjSCannonTen_c* i_this) { return i_this->draw(); } -static actor_method_class daObjSCannonTen_METHODS = { +static DUSK_CONST actor_method_class daObjSCannonTen_METHODS = { (process_method_func)daObjSCannonTen_create, (process_method_func)daObjSCannonTen_Delete, (process_method_func)daObjSCannonTen_execute, @@ -468,7 +468,7 @@ static actor_method_class daObjSCannonTen_METHODS = { (process_method_func)daObjSCannonTen_draw, }; -actor_process_profile_definition g_profile_Obj_SCannonTen = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SCannonTen = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sekidoor.cpp b/src/d/actor/d_a_obj_sekidoor.cpp index 498282f4b4..52784fbc4e 100644 --- a/src/d/actor/d_a_obj_sekidoor.cpp +++ b/src/d/actor/d_a_obj_sekidoor.cpp @@ -18,11 +18,11 @@ static struct { u32 resIdx; } l_dzbData[1] = {7, 1}; -static char* l_resNameList[2] = {"", "SekiDoor"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = {"", "SekiDoor"}; static OBJ_SEKIDOOR_HIO_CLASS l_HIO; -const daObj_SekiDoor_HIOParam daObj_SekiDoor_Param_c::m = {0}; +DUSK_GAME_DATA const daObj_SekiDoor_HIOParam daObj_SekiDoor_Param_c::m = {0}; static const f32 reference_posy = 460.0f; @@ -269,7 +269,7 @@ static int daObj_SekiDoor_IsDelete(void* param_0) { return 1; } -static actor_method_class daObj_SekiDoor_MethodTable = { +static DUSK_CONST actor_method_class daObj_SekiDoor_MethodTable = { (process_method_func)daObj_SekiDoor_Create, (process_method_func)daObj_SekiDoor_Delete, (process_method_func)daObj_SekiDoor_Execute, @@ -277,7 +277,7 @@ static actor_method_class daObj_SekiDoor_MethodTable = { (process_method_func)daObj_SekiDoor_Draw, }; -actor_process_profile_definition g_profile_OBJ_SEKIDOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SEKIDOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sekizo.cpp b/src/d/actor/d_a_obj_sekizo.cpp index 6c73025257..9c1fe8abb2 100644 --- a/src/d/actor/d_a_obj_sekizo.cpp +++ b/src/d/actor/d_a_obj_sekizo.cpp @@ -19,11 +19,11 @@ static struct { u32 resIdx; } l_dzbData[1] = {7, 1}; -static char* l_resNameList[2] = {"", "Sekizo"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = {"", "Sekizo"}; static u8 lit_3800[12]; -daObj_Sekizo_HIOParam const daObj_Sekizo_Param_c::m = {}; +DUSK_GAME_DATA daObj_Sekizo_HIOParam const daObj_Sekizo_Param_c::m = {}; static OBJ_SEKIZO_HIO_CLASS l_HIO; @@ -149,12 +149,12 @@ static int daObj_Sekizo_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_Sekizo_MethodTable = { +static DUSK_CONST actor_method_class daObj_Sekizo_MethodTable = { (process_method_func)daObj_Sekizo_Create, (process_method_func)daObj_Sekizo_Delete, (process_method_func)daObj_Sekizo_Execute, (process_method_func)daObj_Sekizo_IsDelete, (process_method_func)daObj_Sekizo_Draw}; -actor_process_profile_definition g_profile_OBJ_SEKIZO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SEKIZO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sekizoa.cpp b/src/d/actor/d_a_obj_sekizoa.cpp index 19f4446b87..f8493ec385 100644 --- a/src/d/actor/d_a_obj_sekizoa.cpp +++ b/src/d/actor/d_a_obj_sekizoa.cpp @@ -8,46 +8,48 @@ #include "d/actor/d_a_tag_kmsg.h" #include #include + +#include "helpers/string.hpp" #include "f_op/f_op_actor_mng.h" #include "f_op/f_op_msg.h" -static daNpc_GetParam1 l_bmdData[9] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bmdData[9] = { {36, 1}, {36, 1}, {35, 1}, {37, 1}, {38, 1}, {3, 2}, {3, 2}, {4, 2}, {5, 2}, }; -static daNpcT_evtData_c l_evtList[10] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[10] = { {"", 1}, {"NO_RESPONSE", 1}, {"START", 1}, {"RESTART", 1}, {"TURN", 1}, {"JUMP", 1}, {"GOAL", 1}, {"EXIT", 1}, {"FREE", 1}, {"EXTINCTION", 1}, }; -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "sekizoA", "seki_1k", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8 l_loadResPtrn1[3] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn1[3] = { 1, 2, -1, }; -static s8* l_loadResPtrnList[8] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[8] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn1, l_loadResPtrn1, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData = { -1, 0, 0, -1, 0, 0, 0, }; -static daNpcT_motionAnmData_c l_motionAnmData[24] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[24] = { {daObj_Sekizoa_c::ANM_SEKI_WAIT_A, 2, 1, -1, 0, 0, 0}, {daObj_Sekizoa_c::ANM_SEKI_WAIT_R, 2, 1, -1, 0, 0, 0}, {daObj_Sekizoa_c::ANM_SEKI_STILL_R, 2, 1, -1, 0, 0, 0}, @@ -73,14 +75,14 @@ static daNpcT_motionAnmData_c l_motionAnmData[24] = { {daObj_Sekizoa_c::ANM_SEKI_STEP_L, 0, 1, -1, 0, 0, 0}, {daObj_Sekizoa_c::ANM_SEKI_WAIT_A, 2, 1, -1, 0, 0, 0}}; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[4] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[96] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[96] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 1}, {2, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, @@ -96,11 +98,11 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[96] = { {21, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {22, 4, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {23, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}}; -char* daObj_Sekizoa_c::mCutNameList[9] = { +DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST daObj_Sekizoa_c::mCutNameList[9] = { "", "START", "START", "TURN", "JUMP", "GOAL", "EXIT", "FREE", "EXTINCTION", }; -daObj_Sekizoa_c::cutFunc daObj_Sekizoa_c::mCutList[9] = { +DUSK_GAME_DATA daObj_Sekizoa_c::cutFunc DUSK_CONST daObj_Sekizoa_c::mCutList[9] = { NULL, &daObj_Sekizoa_c::cutStart, &daObj_Sekizoa_c::cutStart, @@ -112,11 +114,11 @@ daObj_Sekizoa_c::cutFunc daObj_Sekizoa_c::mCutList[9] = { &daObj_Sekizoa_c::cutExtinction, }; -static cXyz l_srcPosR(-600.0f, 1000.0f, 1800.0f); +static DUSK_CONSTEXPR cXyz l_srcPosR(-600.0f, 1000.0f, 1800.0f); -static cXyz l_srcPosL(600.0f, 1000.0f, 1800.0f); +static DUSK_CONSTEXPR cXyz l_srcPosL(600.0f, 1000.0f, 1800.0f); -daObj_Sekizoa_HIOParam const daObj_Sekizoa_Param_c::m = { +DUSK_GAME_DATA daObj_Sekizoa_HIOParam const daObj_Sekizoa_Param_c::m = { 600.0f, -10.0f, 1.0f, 1100.0f, 255.0f, 550.0f, 100.0f, 70.0f, 0.0f, 0.0f, 30.0f, 0.0f, 30.0f, -30.0f, 45.0f, -45.0f, 0.6f, 8.0f, 0x3, 0x6, 0x5, 0x6, 0.0f, 0.0f, 0.0f, 0.0f, 0x3C0008, 0.0f, 0.0f, 4.0f, 0.0f, 0.0f, 0.0f, @@ -863,7 +865,7 @@ void daObj_Sekizoa_c::drawOtherMdl() { int daObj_Sekizoa_c::setYariAnm(int i_frame, int i_mode, f32 i_morf) { - static struct { + static DUSK_CONSTEXPR struct { u32 param_0; u32 param_1; } yariAnmData[24] = { @@ -927,7 +929,7 @@ void daObj_Sekizoa_c::drawGhost() { bool daObj_Sekizoa_c::afterSetMotionAnm(int i_frame, int i_mode, f32 i_morf, int param_3) { f32 var1; - static struct { + static DUSK_CONSTEXPR struct { int field_0x0; u32 field_0x4; u32 field_0x8; @@ -935,7 +937,7 @@ bool daObj_Sekizoa_c::afterSetMotionAnm(int i_frame, int i_mode, f32 i_morf, int {0x2A, 0, 1}, {0x2B, 0, 1}, {0x2C, 0, 1}, {0x2D, 0, 1}, {0x2E, 0, 1}, {0x29, 0, 1}, }; - static struct { + static DUSK_CONSTEXPR struct { int field_0x0; u32 field_0x4; u32 field_0x8; @@ -1364,8 +1366,8 @@ int daObj_Sekizoa_c::cutStart(int i_staffIdx) { daObj_SMTile_c* actor_4 = (daObj_SMTile_c*)mActorMngrs[4].getActorP(); actor_4->reset(); dComIfGp_getEvent()->setPt2(actor_4); - strcpy(acStack_90, l_evtList[2].eventName); - strcat(acStack_90, "@"); + SAFE_STRCPY(acStack_90, l_evtList[2].eventName); + SAFE_STRCAT(acStack_90, "@"); dComIfGp_getEvent()->setSkipZev(this, acStack_90); dComIfGp_getEvent()->onSkipFade(); if (daNpcT_getPlayerInfoFromPlayerList(1, fopAcM_GetRoomNo(this), &c_stack_9c, @@ -1856,8 +1858,8 @@ int daObj_Sekizoa_c::cutGoal(int i_staffIdx) { switch (prm) { case 0: if (mType == TYPE_0) { - strcpy(acStack_9c, l_evtList[6].eventName); - strcat(acStack_9c, "@"); + SAFE_STRCPY(acStack_9c, l_evtList[6].eventName); + SAFE_STRCAT(acStack_9c, "@"); dComIfGp_getEvent()->setSkipZev(this, acStack_9c); dComIfGp_getEvent()->onSkipFade(); } @@ -2222,8 +2224,8 @@ int daObj_Sekizoa_c::cutExtinction(int i_staffIdx) { cStack_b0 += actor_0->current.pos; daPy_getPlayerActorClass()->setPlayerPosAndAngle(&cStack_b0, actor_0->shape_angle.y - -0x8000, 0); - strcpy(acStack_a4, l_evtList[9].eventName); - strcat(acStack_a4, "@"); + SAFE_STRCPY(acStack_a4, l_evtList[9].eventName); + SAFE_STRCAT(acStack_a4, "@"); dComIfGp_getEvent()->setSkipZev(actor_0, acStack_a4); dComIfGp_getEvent()->onSkipFade(); actor_0->pullMasterSword(); @@ -2453,12 +2455,12 @@ static int daObj_Sekizoa_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_Sekizoa_MethodTable = { +static DUSK_CONST actor_method_class daObj_Sekizoa_MethodTable = { daObj_Sekizoa_Create, daObj_Sekizoa_Delete, daObj_Sekizoa_Execute, daObj_Sekizoa_IsDelete, daObj_Sekizoa_Draw, }; -actor_process_profile_definition g_profile_OBJ_SEKIZOA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SEKIZOA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_shield.cpp b/src/d/actor/d_a_obj_shield.cpp index 953c578888..3941011043 100644 --- a/src/d/actor/d_a_obj_shield.cpp +++ b/src/d/actor/d_a_obj_shield.cpp @@ -361,7 +361,7 @@ static int daItemShield_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daItemShield_Method = { +static DUSK_CONST actor_method_class l_daItemShield_Method = { (process_method_func)daItemShield_Create, (process_method_func)daItemShield_Delete, (process_method_func)daItemShield_Execute, @@ -369,7 +369,7 @@ static actor_method_class l_daItemShield_Method = { (process_method_func)daItemShield_Draw, }; -actor_process_profile_definition g_profile_Obj_Shield = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Shield = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sm_door.cpp b/src/d/actor/d_a_obj_sm_door.cpp index e1d490d10c..01ddb831fa 100644 --- a/src/d/actor/d_a_obj_sm_door.cpp +++ b/src/d/actor/d_a_obj_sm_door.cpp @@ -12,7 +12,7 @@ #include "d/d_com_inf_game.h" #include "d/actor/d_a_e_pm.h" -static char* l_arcName = "sm_door"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "sm_door"; static cPhs_Step daObjSM_DOOR_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); @@ -284,7 +284,7 @@ inline int daObjSM_DOOR_c::Delete() { return 1; } -static actor_method_class l_daObjSM_DOOR_Method = { +static DUSK_CONST actor_method_class l_daObjSM_DOOR_Method = { (process_method_func)daObjSM_DOOR_Create, (process_method_func)daObjSM_DOOR_Delete, (process_method_func)daObjSM_DOOR_Execute, @@ -292,7 +292,7 @@ static actor_method_class l_daObjSM_DOOR_Method = { (process_method_func)daObjSM_DOOR_Draw, }; -actor_process_profile_definition g_profile_Obj_SM_DOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SM_DOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_smallkey.cpp b/src/d/actor/d_a_obj_smallkey.cpp index e5d31c214c..9bf8face57 100644 --- a/src/d/actor/d_a_obj_smallkey.cpp +++ b/src/d/actor/d_a_obj_smallkey.cpp @@ -550,7 +550,7 @@ static int daKey_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daKey_Method = { +static DUSK_CONST actor_method_class l_daKey_Method = { (process_method_func)daKey_Create, (process_method_func)daKey_Delete, (process_method_func)daKey_Execute, @@ -558,7 +558,7 @@ static actor_method_class l_daKey_Method = { (process_method_func)daKey_Draw, }; -actor_process_profile_definition g_profile_Obj_SmallKey = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SmallKey = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_smgdoor.cpp b/src/d/actor/d_a_obj_smgdoor.cpp index 42777605fb..343513e15a 100644 --- a/src/d/actor/d_a_obj_smgdoor.cpp +++ b/src/d/actor/d_a_obj_smgdoor.cpp @@ -70,24 +70,24 @@ void daObjSmgDoor_c::setBaseMtx() { cMtx_copy(field_0x5b8, mBgMtx); } -static char* l_arcName[2] = {"A_SMGDoor", "A_SMKDoor"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = {"A_SMGDoor", "A_SMKDoor"}; -static char* l_bmd[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_bmd[2] = { "A_SMGDoor.bmd", "A_SMKDoor.bmd", }; -static char* l_dzb[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_dzb[2] = { "A_SMGDoor.dzb", "A_SMKDoor.dzb", }; -static char* l_eventName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_eventName[2] = { "NOW_DOOR_IN", "OLD_DOOR_IN", }; -static cull_box l_cull_box = {{-200.0f, 0.0f, -50.0f}, {200.0f, 400.0f, 50.0f}}; +static DUSK_CONSTEXPR cull_box l_cull_box = {{-200.0f, 0.0f, -50.0f}, {200.0f, 400.0f, 50.0f}}; int daObjSmgDoor_c::Create() { initBaseMtx(); @@ -148,7 +148,7 @@ int daObjSmgDoor_c::Execute(Mtx** param_0) { } int daObjSmgDoor_c::getDemoAction() { - static char* action_table[6] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[6] = { "WAIT", "OPEN", "SETGOAL", "SETPOS", "SCENE_CHG", "COLOR_CHG", }; @@ -419,13 +419,13 @@ static int daObjSmgDoor_MoveBGDraw(daObjSmgDoor_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjSmgDoor_METHODS = { +static DUSK_CONST actor_method_class daObjSmgDoor_METHODS = { (process_method_func)daObjSmgDoor_create1st, (process_method_func)daObjSmgDoor_MoveBGDelete, (process_method_func)daObjSmgDoor_MoveBGExecute, 0, (process_method_func)daObjSmgDoor_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_SmgDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SmgDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_smoke.cpp b/src/d/actor/d_a_obj_smoke.cpp index 18631fd32a..63b491c9d9 100644 --- a/src/d/actor/d_a_obj_smoke.cpp +++ b/src/d/actor/d_a_obj_smoke.cpp @@ -66,13 +66,13 @@ static int daObjSmoke_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjSmoke_Method = { +static DUSK_CONST actor_method_class l_daObjSmoke_Method = { (process_method_func)daObjSmoke_Create, (process_method_func)daObjSmoke_Delete, (process_method_func)daObjSmoke_Execute, }; -actor_process_profile_definition g_profile_Obj_Smoke = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Smoke = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_smtile.cpp b/src/d/actor/d_a_obj_smtile.cpp index 0cdd9f0077..3a2346fde9 100644 --- a/src/d/actor/d_a_obj_smtile.cpp +++ b/src/d/actor/d_a_obj_smtile.cpp @@ -13,7 +13,7 @@ static u32 l_bmdData[1][2] = { 4, 1, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "A_SMTile", }; @@ -29,7 +29,7 @@ static s8 l_tileMoveData[21][4] = { static OBJ_SMTILE_HIO_CLASS l_HIO; -daObj_SMTile_HIOParam const daObj_SMTile_Param_c::m = {600.0f, 20.0f}; +DUSK_GAME_DATA daObj_SMTile_HIOParam const daObj_SMTile_Param_c::m = {600.0f, 20.0f}; #if DEBUG daObj_SMTile_HIO_c::daObj_SMTile_HIO_c() { @@ -340,7 +340,7 @@ static int daObj_SMTile_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_SMTile_MethodTable = { +static DUSK_CONST actor_method_class daObj_SMTile_MethodTable = { (process_method_func)daObj_SMTile_Create, (process_method_func)daObj_SMTile_Delete, (process_method_func)daObj_SMTile_Execute, @@ -348,7 +348,7 @@ static actor_method_class daObj_SMTile_MethodTable = { (process_method_func)daObj_SMTile_Draw, }; -actor_process_profile_definition g_profile_OBJ_SMTILE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SMTILE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_smw_stone.cpp b/src/d/actor/d_a_obj_smw_stone.cpp index f214bd7a67..4d8968c491 100644 --- a/src/d/actor/d_a_obj_smw_stone.cpp +++ b/src/d/actor/d_a_obj_smw_stone.cpp @@ -10,7 +10,7 @@ #include "d/d_bg_w.h" #include "d/d_com_inf_game.h" -static char* l_arcName = "WStoneF"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "WStoneF"; static int daSmWStone_c_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); @@ -187,7 +187,7 @@ static int daSmWStone_draw(daSmWStone_c* i_this) { return i_this->draw(); } -static actor_method_class daSmWStone_METHODS = { +static DUSK_CONST actor_method_class daSmWStone_METHODS = { (process_method_func)daSmWStone_create, (process_method_func)daSmWStone_Delete, (process_method_func)daSmWStone_execute, @@ -195,7 +195,7 @@ static actor_method_class daSmWStone_METHODS = { (process_method_func)daSmWStone_draw, }; -actor_process_profile_definition g_profile_Obj_SmWStone = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SmWStone = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_snowEffTag.cpp b/src/d/actor/d_a_obj_snowEffTag.cpp index 09287aeddb..9f84f8d96b 100644 --- a/src/d/actor/d_a_obj_snowEffTag.cpp +++ b/src/d/actor/d_a_obj_snowEffTag.cpp @@ -124,13 +124,13 @@ daSnowEffTag_HIO_c::~daSnowEffTag_HIO_c() {} static daSnowEffTag_HIO_c l_HIO; -static actor_method_class l_daSnowEffTag_Method = { +static DUSK_CONST actor_method_class l_daSnowEffTag_Method = { (process_method_func)daSnowEffTag_Create, (process_method_func)daSnowEffTag_Delete, (process_method_func)daSnowEffTag_Execute, (process_method_func)NULL, (process_method_func)daSnowEffTag_Draw, }; -actor_process_profile_definition g_profile_Tag_SnowEff = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_SnowEff = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_snow_soup.cpp b/src/d/actor/d_a_obj_snow_soup.cpp index 027d0bd8c8..eebcf323c4 100644 --- a/src/d/actor/d_a_obj_snow_soup.cpp +++ b/src/d/actor/d_a_obj_snow_soup.cpp @@ -15,7 +15,7 @@ static int daObjSnowSoup_c_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_arcName = "SnowSoup"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "SnowSoup"; static Vec const SOUP_MODEL_OFFSET = {3317.86f, 214.73f, 323.3f}; @@ -185,7 +185,7 @@ static int daObjSnowSoup_draw(daObjSnowSoup_c* i_this) { return i_this->draw(); } -static actor_method_class daObjSnowSoup_METHODS = { +static DUSK_CONST actor_method_class daObjSnowSoup_METHODS = { (process_method_func)daObjSnowSoup_create, (process_method_func)daObjSnowSoup_Delete, (process_method_func)daObjSnowSoup_execute, @@ -193,7 +193,7 @@ static actor_method_class daObjSnowSoup_METHODS = { (process_method_func)daObjSnowSoup_draw, }; -actor_process_profile_definition g_profile_Obj_SnowSoup = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SnowSoup = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_so.cpp b/src/d/actor/d_a_obj_so.cpp index 537db9d0ad..a377946d82 100644 --- a/src/d/actor/d_a_obj_so.cpp +++ b/src/d/actor/d_a_obj_so.cpp @@ -980,7 +980,7 @@ static int useHeapInit(fopAc_ac_c* a_this) { } static int daObj_So_Create(fopAc_ac_c* a_this) { - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fafd3f, 0x1f}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -1080,7 +1080,7 @@ static int daObj_So_Create(fopAc_ac_c* a_this) { return phase; } -static actor_method_class l_daObj_So_Method = { +static DUSK_CONST actor_method_class l_daObj_So_Method = { (process_method_func)daObj_So_Create, (process_method_func)daObj_So_Delete, (process_method_func)daObj_So_Execute, @@ -1088,7 +1088,7 @@ static actor_method_class l_daObj_So_Method = { (process_method_func)daObj_So_Draw, }; -actor_process_profile_definition g_profile_OBJ_SO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_spinLift.cpp b/src/d/actor/d_a_obj_spinLift.cpp index 9c59768e26..ae51ab08eb 100644 --- a/src/d/actor/d_a_obj_spinLift.cpp +++ b/src/d/actor/d_a_obj_spinLift.cpp @@ -50,7 +50,7 @@ void daSpinLift_HIO_c::genMessage(JORMContext* ctx) { } #endif -static char* l_resNameIdx[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[] = { "L4_N_Entr", "L4_N_SlpH", "L4_N_SlpL", "L4_Center", "L4_Switch", "L4_S_Slp", "L4_Wal_ZE", "L4_Wal_ZW", "L4_Wal_X", }; @@ -272,13 +272,13 @@ static int daSpinLift_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daSpinLift_Method = { +static DUSK_CONST actor_method_class l_daSpinLift_Method = { (process_method_func)daSpinLift_Create, (process_method_func)daSpinLift_Delete, (process_method_func)daSpinLift_Execute, 0, (process_method_func)daSpinLift_Draw, }; -actor_process_profile_definition g_profile_Obj_SpinLift = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SpinLift = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ss_drink.cpp b/src/d/actor/d_a_obj_ss_drink.cpp index a2b68af17e..6a44f3d786 100644 --- a/src/d/actor/d_a_obj_ss_drink.cpp +++ b/src/d/actor/d_a_obj_ss_drink.cpp @@ -11,18 +11,18 @@ #include "d/d_msg_object.h" #include "d/d_s_play.h" -static char* l_resFileName = "Obj_btl"; +static DUSK_CONSTEXPR char DUSK_CONST* l_resFileName = "Obj_btl"; -static char* l_bmdName = "al_bottle.bmd"; +static DUSK_CONSTEXPR char DUSK_CONST* l_bmdName = "al_bottle.bmd"; -dCcD_SrcGObjInf const daObj_SSDrink_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daObj_SSDrink_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0, 0}, {0x79}}}, {0, 0, 0, 0, {0}}, {0, 0, 0, 0, {0}}, {{0}}, }; -dCcD_SrcCyl daObj_SSDrink_c::mCcDCyl = {mCcDObjInfo, {}}; +DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST daObj_SSDrink_c::mCcDCyl = {mCcDObjInfo, {}}; daObj_SSDrink_c::~daObj_SSDrink_c() { dComIfG_resDelete(&mPhase, getResName()); @@ -170,7 +170,7 @@ void daObj_SSDrink_c::setSoldOut() { } } -char* daObj_SSDrink_c::getResName() { +char DUSK_CONST* daObj_SSDrink_c::getResName() { return l_resFileName; } @@ -479,13 +479,13 @@ static int daObj_SSDrink_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_SSDrink_MethodTable = { +static DUSK_CONST actor_method_class daObj_SSDrink_MethodTable = { (process_method_func)daObj_SSDrink_Create, (process_method_func)daObj_SSDrink_Delete, (process_method_func)daObj_SSDrink_Execute, (process_method_func)daObj_SSDrink_IsDelete, (process_method_func)daObj_SSDrink_Draw, }; -actor_process_profile_definition g_profile_OBJ_SSDRINK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SSDRINK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ss_item.cpp b/src/d/actor/d_a_obj_ss_item.cpp index 4c354878ae..102223c21b 100644 --- a/src/d/actor/d_a_obj_ss_item.cpp +++ b/src/d/actor/d_a_obj_ss_item.cpp @@ -11,28 +11,28 @@ #include "m_Do/m_Do_ext.h" #include "d/actor/d_a_myna.h" -static char* l_resFileName[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resFileName[] = { "Always", "Always", "Pumpkin", }; -static int l_bmdIdxName[] = {0x23, 0x23, 0x00}; +static DUSK_CONSTEXPR int l_bmdIdxName[] = {0x23, 0x23, 0x00}; -static char* l_bmdFileName[] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_bmdFileName[] = { "", "", "pumpkin.bmd", }; -dCcD_SrcGObjInf const daObj_SSItem_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daObj_SSItem_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0, 0}, {0x79}}}, {0, 0, 0, 0, {0}}, {0, 0, 0, 0, {0}}, {{0}}, }; -dCcD_SrcCyl daObj_SSItem_c::mCcDCyl = {mCcDObjInfo, {}}; +DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST daObj_SSItem_c::mCcDCyl = {mCcDObjInfo, {}}; daObj_SSItem_c::~daObj_SSItem_c() { dComIfG_resDelete(&mPhase, getResName()); @@ -180,7 +180,7 @@ daObj_SSItem_c* daObj_SSItem_c::getExchangeItemPtr() { return this; } -char* daObj_SSItem_c::getResName() { +char DUSK_CONST* daObj_SSItem_c::getResName() { return l_resFileName[field_0xB0E]; } @@ -365,13 +365,13 @@ static int daObj_SSItem_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_SSItem_MethodTable = { +static DUSK_CONST actor_method_class daObj_SSItem_MethodTable = { (process_method_func)daObj_SSItem_Create, (process_method_func)daObj_SSItem_Delete, (process_method_func)daObj_SSItem_Execute, (process_method_func)daObj_SSItem_IsDelete, (process_method_func)daObj_SSItem_Draw, }; -actor_process_profile_definition g_profile_OBJ_SSITEM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SSITEM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_stairBlock.cpp b/src/d/actor/d_a_obj_stairBlock.cpp index 9ca15c8477..1ea8fb75dd 100644 --- a/src/d/actor/d_a_obj_stairBlock.cpp +++ b/src/d/actor/d_a_obj_stairBlock.cpp @@ -22,7 +22,7 @@ void daStairBlock_c::setBaseMtx() { } } -const dCcD_SrcGObjInf daStairBlock_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daStairBlock_c::mCcDObjInfo = { {0, {0, 0, 0, {0x0, 0x0}, {0x19}}}, {dCcD_SE_NONE, 0, 0, 0, 0x0}, {dCcD_SE_NONE, 0, 0, 0, 0x0}, @@ -166,15 +166,15 @@ static int daStairBlock_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -dCcD_SrcSph daStairBlock_c::mCcDSph = {daStairBlock_c::mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 4.0f}}}; +DUSK_GAME_DATA dCcD_SrcSph daStairBlock_c::mCcDSph = {daStairBlock_c::mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 4.0f}}}; -static actor_method_class l_daStairBlock_Method = { +static DUSK_CONST actor_method_class l_daStairBlock_Method = { (process_method_func)daStairBlock_Create, (process_method_func)daStairBlock_Delete, (process_method_func)daStairBlock_Execute, 0, (process_method_func)daStairBlock_Draw, }; -actor_process_profile_definition g_profile_Obj_StairBlock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_StairBlock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_stick.cpp b/src/d/actor/d_a_obj_stick.cpp index d6aa8d1e22..95bb4d95c5 100644 --- a/src/d/actor/d_a_obj_stick.cpp +++ b/src/d/actor/d_a_obj_stick.cpp @@ -11,18 +11,18 @@ #include "m_Do/m_Do_ext.h" #include "d/actor/d_a_npc.h" -const daObj_Stick_HIOParam daObj_Stick_Param_c::m = { +DUSK_GAME_DATA const daObj_Stick_HIOParam daObj_Stick_Param_c::m = { 0.0f, -3.0f, 1.0f, 100.0f }; -dCcD_SrcSph daObj_Stick_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daObj_Stick_c::mCcDSph = { daNpcT_c::mCcDObjData, // mObjInf { {{0.0f, 0.0f, 0.0f}, 0.0f} // mSph } // mSphAttr }; -static char* l_resName = "Taro6"; +static DUSK_CONST char* l_resName = "Taro6"; static OBJ_STICK_HIO_CLASS l_HIO; @@ -218,7 +218,7 @@ static int daObj_Stick_IsDelete(void* param_0) { return 1; } -static actor_method_class daObj_Stick_MethodTable = { +static DUSK_CONST actor_method_class daObj_Stick_MethodTable = { (process_method_func)daObj_Stick_Create, (process_method_func)daObj_Stick_Delete, (process_method_func)daObj_Stick_Execute, @@ -226,7 +226,7 @@ static actor_method_class daObj_Stick_MethodTable = { (process_method_func)daObj_Stick_Draw, }; -actor_process_profile_definition g_profile_OBJ_STICK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_STICK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_stone.cpp b/src/d/actor/d_a_obj_stone.cpp index 080069e4f0..c6adef08d8 100644 --- a/src/d/actor/d_a_obj_stone.cpp +++ b/src/d/actor/d_a_obj_stone.cpp @@ -114,7 +114,7 @@ const static s16 l_rot_angle[2] = {35, 18}; const static s16 l_walk_rot_angle[2] = {40, 40}; -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "D_Srock", // small rock "D_Brock", // big rock }; @@ -1011,7 +1011,7 @@ static int daObjStone_Create(fopAc_ac_c* param_0) { return static_cast(param_0)->create(); } -static actor_method_class l_daObjStone_Method = { +static DUSK_CONST actor_method_class l_daObjStone_Method = { (process_method_func)daObjStone_Create, (process_method_func)daObjStone_Delete, (process_method_func)daObjStone_Execute, @@ -1019,7 +1019,7 @@ static actor_method_class l_daObjStone_Method = { (process_method_func)daObjStone_Draw, }; -actor_process_profile_definition g_profile_Obj_Stone = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Stone = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_stoneMark.cpp b/src/d/actor/d_a_obj_stoneMark.cpp index 9c4e3a063e..bb4dcf7456 100644 --- a/src/d/actor/d_a_obj_stoneMark.cpp +++ b/src/d/actor/d_a_obj_stoneMark.cpp @@ -13,7 +13,7 @@ #include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_lib.h" -static char* l_arcName = "A_IwaAto"; +static DUSK_CONST char* l_arcName = "A_IwaAto"; void daObjSMark_c::initBaseMtx() { setBaseMtx(); @@ -75,7 +75,7 @@ static int daObjSMark_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjSMark_Method = { +static DUSK_CONST actor_method_class l_daObjSMark_Method = { (process_method_func)daObjSMark_Create, (process_method_func)daObjSMark_Delete, (process_method_func)NULL, @@ -83,7 +83,7 @@ static actor_method_class l_daObjSMark_Method = { (process_method_func)daObjSMark_Draw, }; -actor_process_profile_definition g_profile_Obj_StoneMark = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_StoneMark = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_stopper.cpp b/src/d/actor/d_a_obj_stopper.cpp index 75ef504d63..dc14eab469 100644 --- a/src/d/actor/d_a_obj_stopper.cpp +++ b/src/d/actor/d_a_obj_stopper.cpp @@ -508,13 +508,13 @@ static int daObjStopper_Create(fopAc_ac_c* param_0) { return static_cast(param_0)->create(); } -static actor_method_class l_daObjStopper_Method = { +static DUSK_CONST actor_method_class l_daObjStopper_Method = { (process_method_func)daObjStopper_Create, (process_method_func)daObjStopper_Delete, (process_method_func)daObjStopper_Execute, 0, (process_method_func)daObjStopper_Draw, }; -actor_process_profile_definition g_profile_Obj_Stopper = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Stopper = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_stopper2.cpp b/src/d/actor/d_a_obj_stopper2.cpp index a65969bc22..138d415e54 100644 --- a/src/d/actor/d_a_obj_stopper2.cpp +++ b/src/d/actor/d_a_obj_stopper2.cpp @@ -8,16 +8,16 @@ #include "d/actor/d_a_obj_stopper2.h" #include "d/actor/d_a_player.h" -static char* l_arcName = "Stop00"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Stop00"; -static char* l_evName[4] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_evName[4] = { "STOP_OPEN", "STOP_CLOSE", "STOP_OPEN2", "STOP_CLOSE2", }; -static char* l_staffName = "dstop"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "dstop"; static int CheckCreateHeap(fopAc_ac_c* i_this) { return ((daObjStopper2_c*)i_this)->CreateHeap(); @@ -205,7 +205,7 @@ void daObjStopper2_c::actionEvent() { void daObjStopper2_c::actionDead() {} int daObjStopper2_c::demoProc() { - static char* action_table[3] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[3] = { "WAIT", "STOP_OPEN", "STOP_CLOSE", @@ -299,7 +299,7 @@ static int daObjStopper2_Create(daObjStopper2_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjStopper2_Method = { +static DUSK_CONST actor_method_class l_daObjStopper2_Method = { (process_method_func)daObjStopper2_Create, (process_method_func)daObjStopper2_Delete, (process_method_func)daObjStopper2_Execute, @@ -307,7 +307,7 @@ static actor_method_class l_daObjStopper2_Method = { (process_method_func)daObjStopper2_Draw, }; -actor_process_profile_definition g_profile_Obj_Stopper2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Stopper2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_suisya.cpp b/src/d/actor/d_a_obj_suisya.cpp index f14ff36706..a1da37f0c6 100644 --- a/src/d/actor/d_a_obj_suisya.cpp +++ b/src/d/actor/d_a_obj_suisya.cpp @@ -98,13 +98,13 @@ static int daObj_Suisya_Create(daObj_Suisya_c* i_this) { return i_this->create(); } -static actor_method_class l_daObj_Suisya_Method = { +static DUSK_CONST actor_method_class l_daObj_Suisya_Method = { (process_method_func)daObj_Suisya_Create, (process_method_func)daObj_Suisya_Delete, (process_method_func)daObj_Suisya_Execute, (process_method_func)daObj_Suisya_IsDelete, (process_method_func)daObj_Suisya_Draw, }; -actor_process_profile_definition g_profile_OBJ_SUISYA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SUISYA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sw.cpp b/src/d/actor/d_a_obj_sw.cpp index cc850f79c3..85b9a24daa 100644 --- a/src/d/actor/d_a_obj_sw.cpp +++ b/src/d/actor/d_a_obj_sw.cpp @@ -820,13 +820,13 @@ static int daObj_Sw_Create(fopAc_ac_c* a_this) { return phase; } -static actor_method_class l_daObj_Sw_Method = { +static DUSK_CONST actor_method_class l_daObj_Sw_Method = { (process_method_func)daObj_Sw_Create, (process_method_func)daObj_Sw_Delete, (process_method_func)daObj_Sw_Execute, (process_method_func)daObj_Sw_IsDelete, (process_method_func)daObj_Sw_Draw, }; -actor_process_profile_definition g_profile_OBJ_SW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_SW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swBallA.cpp b/src/d/actor/d_a_obj_swBallA.cpp index 19c1a81995..813b36a6c3 100644 --- a/src/d/actor/d_a_obj_swBallA.cpp +++ b/src/d/actor/d_a_obj_swBallA.cpp @@ -128,7 +128,7 @@ int daObjSwBallA_c::Create() { return 1; } -static char* l_arcName = "P_LBswA"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_LBswA"; int daObjSwBallA_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -339,7 +339,7 @@ static int daObjSwBallA_Create(fopAc_ac_c* param_0) { return ((daObjSwBallA_c*)param_0)->create(); } -static actor_method_class l_daObjSwBallA_Method = { +static DUSK_CONST actor_method_class l_daObjSwBallA_Method = { (process_method_func)daObjSwBallA_Create, (process_method_func)daObjSwBallA_Delete, (process_method_func)daObjSwBallA_Execute, @@ -347,7 +347,7 @@ static actor_method_class l_daObjSwBallA_Method = { (process_method_func)daObjSwBallA_Draw, }; -actor_process_profile_definition g_profile_Obj_SwBallA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwBallA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swBallB.cpp b/src/d/actor/d_a_obj_swBallB.cpp index 0b516eecc1..d5337095bc 100644 --- a/src/d/actor/d_a_obj_swBallB.cpp +++ b/src/d/actor/d_a_obj_swBallB.cpp @@ -156,7 +156,7 @@ int daObjSwBallB_c::Create() { return 1; } -static char* l_arcName = "P_LBswBC"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_LBswBC"; int daObjSwBallB_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 5); @@ -402,7 +402,7 @@ static int daObjSwBallB_Create(fopAc_ac_c* param_0) { return ((daObjSwBallB_c*)param_0)->create(); } -static actor_method_class l_daObjSwBallB_Method = { +static DUSK_CONST actor_method_class l_daObjSwBallB_Method = { (process_method_func)daObjSwBallB_Create, (process_method_func)daObjSwBallB_Delete, (process_method_func)daObjSwBallB_Execute, @@ -410,7 +410,7 @@ static actor_method_class l_daObjSwBallB_Method = { (process_method_func)daObjSwBallB_Draw, }; -actor_process_profile_definition g_profile_Obj_SwBallB = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwBallB = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swBallC.cpp b/src/d/actor/d_a_obj_swBallC.cpp index 560edd9ec4..99e750469b 100644 --- a/src/d/actor/d_a_obj_swBallC.cpp +++ b/src/d/actor/d_a_obj_swBallC.cpp @@ -58,9 +58,9 @@ void daObjSwBallC_c::setBaseMtx() { static GXColor const l_color = {0x03, 0x96, 0xFF, 0xFF}; -static char* l_arcName = "P_LBswBC"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_LBswBC"; -static char* l_evName = "REVIVE_MASTER_SWORD"; +static DUSK_CONSTEXPR char DUSK_CONST* l_evName = "REVIVE_MASTER_SWORD"; static f32 dummyFloat() { return -1.0f; @@ -93,7 +93,7 @@ int daObjSwBallC_c::Create() { return 1; } -static char* l_staffName = "lbsw"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "lbsw"; int daObjSwBallC_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 6); @@ -136,7 +136,7 @@ void daObjSwBallC_c::event_proc_call() { (this->*l_func[field_0x57f])(); } -static char* action_table[13] = { +static DUSK_CONSTEXPR char DUSK_CONST* action_table[13] = { "WAIT", "ON", "OFF", "ON_ALL_B", "OFF_ALL_B", "DEL_BALL", "SOUND", "SCALING", "INIT", "MESSAGE", "ST_CUT2", "LINK_INIT", "EQUIP_SWD", }; @@ -402,7 +402,7 @@ static int daObjSwBallC_Create(daObjSwBallC_c* param_0) { return param_0->create(); } -static actor_method_class l_daObjSwBallC_Method = { +static DUSK_CONST actor_method_class l_daObjSwBallC_Method = { (process_method_func)daObjSwBallC_Create, (process_method_func)daObjSwBallC_Delete, (process_method_func)daObjSwBallC_Execute, @@ -410,7 +410,7 @@ static actor_method_class l_daObjSwBallC_Method = { (process_method_func)daObjSwBallC_Draw, }; -actor_process_profile_definition g_profile_Obj_SwBallC = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwBallC = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swLight.cpp b/src/d/actor/d_a_obj_swLight.cpp index 6883fe8ba8..64a09c81ad 100644 --- a/src/d/actor/d_a_obj_swLight.cpp +++ b/src/d/actor/d_a_obj_swLight.cpp @@ -78,9 +78,9 @@ const static dCcD_SrcSph l_sph_src_tg = { } // mSphAttr }; -static char* l_arcName = "Obj_l8sw0"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_l8sw0"; -static cull_box l_cull_box = {{ +static DUSK_CONSTEXPR cull_box l_cull_box = {{ -500.0f, 0.0f, -500.0f, @@ -470,13 +470,13 @@ static int daObjSwLight_MoveBGDraw(daObjSwLight_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjSwLight_METHODS = { +static DUSK_CONST actor_method_class daObjSwLight_METHODS = { (process_method_func)daObjSwLight_create1st, (process_method_func)daObjSwLight_MoveBGDelete, (process_method_func)daObjSwLight_MoveBGExecute, 0, (process_method_func)daObjSwLight_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_SwLight = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwLight = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swchain.cpp b/src/d/actor/d_a_obj_swchain.cpp index a9c3ff42ac..8a30d9b7aa 100644 --- a/src/d/actor/d_a_obj_swchain.cpp +++ b/src/d/actor/d_a_obj_swchain.cpp @@ -122,7 +122,7 @@ static s16 GetActorName(cBgS_PolyInfo& param_0) { return fpcNm_Obj_SwChain_e; } -static char* l_arcName = "P_Chain"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Chain"; static dCcD_SrcSph l_sph_src = { { @@ -1184,13 +1184,13 @@ static int daObjSwChain_Create(fopAc_ac_c* i_this) { return a_this->create1st(); } -static actor_method_class l_daObjSwChain_Method = { +static DUSK_CONST actor_method_class l_daObjSwChain_Method = { (process_method_func)daObjSwChain_Create, (process_method_func)daObjSwChain_Delete, (process_method_func)daObjSwChain_Execute, 0, (process_method_func)daObjSwChain_Draw, }; -actor_process_profile_definition g_profile_Obj_SwChain = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwChain = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swhang.cpp b/src/d/actor/d_a_obj_swhang.cpp index 7fd34fc3ee..5f5218a866 100644 --- a/src/d/actor/d_a_obj_swhang.cpp +++ b/src/d/actor/d_a_obj_swhang.cpp @@ -66,7 +66,7 @@ void daObjSwHang_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[5] = { "S_bura_A", "S_bura_B", "S_bura_7a", @@ -74,7 +74,7 @@ static char* l_arcName[5] = { "S_bura_7c", }; -static char* l_pull_jnt[5] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_pull_jnt[5] = { "totte", "hook", "hook", @@ -82,12 +82,12 @@ static char* l_pull_jnt[5] = { "tottel", }; -static Vec l_hang_offset[5] = { +static DUSK_CONSTEXPR Vec l_hang_offset[5] = { {0.0f, -470.0f, 10.0f}, {0.0f, -183.0f, 10.0f}, {0.0f, -200.0f, 10.0f}, {0.0f, -520.0f, 10.0f}, {0.0f, -1010.0f, 10.0f}, }; -static dCcD_SrcSph l_sph_src = { +static DUSK_CONSTEXPR dCcD_SrcSph l_sph_src = { { {0x0, {{0x0, 0x0, 0x0}, {0x0, 0x10}, 0x19}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -493,7 +493,7 @@ static void dummy() { JKR_DELETE((cCcD_GStts*)NULL); } -static actor_method_class daObjSwHang_METHODS = { +static DUSK_CONST actor_method_class daObjSwHang_METHODS = { (process_method_func)daObjSwHang_create1st, (process_method_func)daObjSwHang_MoveBGDelete, (process_method_func)daObjSwHang_MoveBGExecute, @@ -501,7 +501,7 @@ static actor_method_class daObjSwHang_METHODS = { (process_method_func)daObjSwHang_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_SwHang = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwHang = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_sword.cpp b/src/d/actor/d_a_obj_sword.cpp index bb34eb6d8d..b346c4232e 100644 --- a/src/d/actor/d_a_obj_sword.cpp +++ b/src/d/actor/d_a_obj_sword.cpp @@ -10,7 +10,7 @@ #include "d/d_com_inf_game.h" #include "d/d_item_data.h" -static cull_box l_cull_box = {{-200.0f, 0.0f, -200.0f}, {200.0f, 100.0f, 200.0f}}; +static DUSK_CONSTEXPR cull_box l_cull_box = {{-200.0f, 0.0f, -200.0f}, {200.0f, 100.0f, 200.0f}}; void daObjSword_c::initBaseMtx() { mpModel->setBaseScale(scale); @@ -140,13 +140,13 @@ static int daObjSword_Create(daObjSword_c* param_0) { return param_0->create(); } -static actor_method_class l_daObjSword_Method = { +static DUSK_CONST actor_method_class l_daObjSword_Method = { (process_method_func)daObjSword_Create, (process_method_func)daObjSword_Delete, (process_method_func)daObjSword_Execute, 0, (process_method_func)daObjSword_Draw, }; -actor_process_profile_definition g_profile_Obj_Sword = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Sword = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swpropeller.cpp b/src/d/actor/d_a_obj_swpropeller.cpp index 957798805e..635d223b51 100644 --- a/src/d/actor/d_a_obj_swpropeller.cpp +++ b/src/d/actor/d_a_obj_swpropeller.cpp @@ -73,9 +73,9 @@ static f32 const l_cull_size[] = {-150.0f, 0.0f, -150.0f, 150.0f, 150.0f, 150.0f // This was used for this object's HIO, which was removed in retail static s16 const l_r00_rot_time[] = {190, 148, 100}; -static char* l_arcName[] = {"K_prop00", "Lv9_puro"}; +static DUSK_CONST char* l_arcName[] = {"K_prop00", "Lv9_puro"}; -static char* l_joint_name = "kaiten"; +static DUSK_CONST char* l_joint_name = "kaiten"; int daObjSwPr_c::Create() { #if AVOID_UB @@ -329,13 +329,13 @@ static int daObjSwPr_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjSwPr_Method = { +static DUSK_CONST actor_method_class l_daObjSwPr_Method = { (process_method_func)daObjSwPr_Create, (process_method_func)daObjSwPr_Delete, (process_method_func)daObjSwPr_Execute, (process_method_func)NULL, (process_method_func)daObjSwPr_Draw, }; -actor_process_profile_definition g_profile_Obj_Swpropeller = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpropeller = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swpush.cpp b/src/d/actor/d_a_obj_swpush.cpp index b6d465744e..c901a4ef98 100644 --- a/src/d/actor/d_a_obj_swpush.cpp +++ b/src/d/actor/d_a_obj_swpush.cpp @@ -54,11 +54,11 @@ BOOL daObjSwpush::Act_c::solidHeapCB(fopAc_ac_c* a_this) { return static_cast(a_this)->create_heap(); } -s16 const daObjSwpush::Act_c::M_bmd[3] = {BMDR_KBOTA_00, BMDR_S_LV3BOTA, BMDR_S_LV6BOTA}; +DUSK_GAME_DATA s16 const daObjSwpush::Act_c::M_bmd[3] = {BMDR_KBOTA_00, BMDR_S_LV3BOTA, BMDR_S_LV6BOTA}; -s16 const daObjSwpush::Act_c::M_dzb[3] = {DZB_KBOTA_00, DZB_KBOTA2_00, DZB_KBOTA3_00}; +DUSK_GAME_DATA s16 const daObjSwpush::Act_c::M_dzb[3] = {DZB_KBOTA_00, DZB_KBOTA2_00, DZB_KBOTA3_00}; -char* daObjSwpush::Act_c::M_arcname[3] = { +DUSK_GAME_DATA DUSK_CONST char* daObjSwpush::Act_c::M_arcname[3] = { "Kbota_00", "S_lv3bota", "S_lv6bota", @@ -117,9 +117,9 @@ cPhs_Step daObjSwpush::Act_c::create_res_load() { return cPhs_COMPLEATE_e; } -u32 const daObjSwpush::Act_c::M_heap_size[3] = {0x1000, 0x1000, 0x1000}; +DUSK_GAME_DATA u32 const daObjSwpush::Act_c::M_heap_size[3] = {0x1000, 0x1000, 0x1000}; -daObjSwpush::Hio_c::Attr_c const daObjSwpush::Act_c::M_attr[5] = { +DUSK_GAME_DATA daObjSwpush::Hio_c::Attr_c const daObjSwpush::Act_c::M_attr[5] = { { (AttrFlag_e)(FLAG_STAY_PRESSED | FLAG_OBEY_SAVE), 1.0f, @@ -198,7 +198,7 @@ daObjSwpush::Hio_c::Attr_c const daObjSwpush::Act_c::M_attr[5] = { }; -u8 const daObjSwpush::Act_c::M_op_vtx[4] = {0x0D, 0x0B, 0x0A, 0x0C}; +DUSK_GAME_DATA u8 const daObjSwpush::Act_c::M_op_vtx[4] = {0x0D, 0x0B, 0x0A, 0x0C}; cPhs_Step daObjSwpush::Act_c::Mthd_Create() { fopAcM_ct(this, daObjSwpush::Act_c); @@ -853,7 +853,7 @@ namespace { return 1; } - static actor_method_class Mthd_Table = { + static DUSK_CONST actor_method_class Mthd_Table = { (process_method_func)Mthd_Create, (process_method_func)Mthd_Delete, (process_method_func)Mthd_Execute, @@ -865,7 +865,7 @@ namespace { AUDIO_INSTANCES; -actor_process_profile_definition g_profile_Obj_Swpush = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpush = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swpush2.cpp b/src/d/actor/d_a_obj_swpush2.cpp index cb59f80d1f..10dce4e85b 100644 --- a/src/d/actor/d_a_obj_swpush2.cpp +++ b/src/d/actor/d_a_obj_swpush2.cpp @@ -71,9 +71,9 @@ int daObjSwpush2::Act_c::solidHeapCB(fopAc_ac_c* i_this) { return ((daObjSwpush2::Act_c*)i_this)->create_heap(); } -const char daObjSwpush2::Act_c::M_arcname[9] = "K_swmn00"; +DUSK_GAME_DATA const char daObjSwpush2::Act_c::M_arcname[9] = "K_swmn00"; -const daObjSwpush2::Attr_c daObjSwpush2::Act_c::M_attr[4] = { +DUSK_GAME_DATA const daObjSwpush2::Attr_c daObjSwpush2::Act_c::M_attr[4] = { { 0x2000, daObjSwpush2::AttrFlag_e(AttrFlag_UNK_0x1_e | AttrFlag_UNK_0x2_e), @@ -714,7 +714,7 @@ actor_method_class Mthd_Table = { } } -actor_process_profile_definition g_profile_Obj_Swpush2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpush2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swpush5.cpp b/src/d/actor/d_a_obj_swpush5.cpp index ab0844c9dd..7082e317fa 100644 --- a/src/d/actor/d_a_obj_swpush5.cpp +++ b/src/d/actor/d_a_obj_swpush5.cpp @@ -112,7 +112,7 @@ int daObjSw5_c::Create() { return 1; } -static char* l_arcName = "D_Hfsw00"; +static DUSK_CONST char* l_arcName = "D_Hfsw00"; int daObjSw5_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -409,7 +409,7 @@ static int daObjSw5_Create(fopAc_ac_c* i_this) { return ((daObjSw5_c*)i_this)->create(); } -static actor_method_class l_daObjSw5_Method = { +static DUSK_CONST actor_method_class l_daObjSw5_Method = { (process_method_func)daObjSw5_Create, (process_method_func)daObjSw5_Delete, (process_method_func)daObjSw5_Execute, @@ -417,7 +417,7 @@ static actor_method_class l_daObjSw5_Method = { (process_method_func)daObjSw5_Draw, }; -actor_process_profile_definition g_profile_Obj_Swpush5 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Swpush5 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swspinner.cpp b/src/d/actor/d_a_obj_swspinner.cpp index e7966e7735..9cd51d2024 100644 --- a/src/d/actor/d_a_obj_swspinner.cpp +++ b/src/d/actor/d_a_obj_swspinner.cpp @@ -70,7 +70,7 @@ int daObjSwSpinner_c::Create() { return 1; } -static char* l_arcName = "P_Sswitch"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "P_Sswitch"; int daObjSwSpinner_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -216,7 +216,7 @@ static int daObjSwSpinner_MoveBGDraw(daObjSwSpinner_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjSwSpinner_METHODS = { +static DUSK_CONST actor_method_class daObjSwSpinner_METHODS = { (process_method_func)daObjSwSpinner_create1st, (process_method_func)daObjSwSpinner_MoveBGDelete, (process_method_func)daObjSwSpinner_MoveBGExecute, @@ -224,7 +224,7 @@ static actor_method_class daObjSwSpinner_METHODS = { (process_method_func)daObjSwSpinner_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_SwSpinner = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwSpinner = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_swturn.cpp b/src/d/actor/d_a_obj_swturn.cpp index 6db58daf07..e850179e31 100644 --- a/src/d/actor/d_a_obj_swturn.cpp +++ b/src/d/actor/d_a_obj_swturn.cpp @@ -113,7 +113,7 @@ int daObjSwTurn_c::Create() { return 1; } -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "P_Lv4tsw", "P_Lv4tswD", }; @@ -428,7 +428,7 @@ static int daObjSwTurn_MoveBGDraw(daObjSwTurn_c* i_this) { return i_this->Draw(); } -static actor_method_class daObjSwTurn_METHODS = { +static DUSK_CONST actor_method_class daObjSwTurn_METHODS = { (process_method_func)daObjSwTurn_create1st, (process_method_func)daObjSwTurn_MoveBGDelete, (process_method_func)daObjSwTurn_MoveBGExecute, @@ -436,7 +436,7 @@ static actor_method_class daObjSwTurn_METHODS = { (process_method_func)daObjSwTurn_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_SwTurn = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SwTurn = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_syRock.cpp b/src/d/actor/d_a_obj_syRock.cpp index e419725eb3..44d8c42741 100644 --- a/src/d/actor/d_a_obj_syRock.cpp +++ b/src/d/actor/d_a_obj_syRock.cpp @@ -36,7 +36,7 @@ public: static daSyRock_HIO_c l_HIO; -dCcD_SrcCyl daSyRock_c::mCcDCyl = {mCcDObjInfo}; +DUSK_GAME_DATA dCcD_SrcCyl daSyRock_c::mCcDCyl = {mCcDObjInfo}; daSyRock_HIO_c::daSyRock_HIO_c() { mShakeAmplitude = 450.0f; @@ -151,7 +151,7 @@ int daSyRock_c::CreateHeap() { return 1; } -dCcD_SrcGObjInf const daSyRock_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daSyRock_c::mCcDObjInfo = { {0x0, {{AT_TYPE_BOMB, 0x1, 0x1F}, {AT_TYPE_IRON_BALL | AT_TYPE_BOMB, 0x11}, 0x79}}, // mObj {dCcD_SE_SWORD, 0x0, 0x1, dCcD_MTRL_NONE, 0x0}, // mGObjAt {dCcD_SE_STONE, 0x0, 0x0, dCcD_MTRL_NONE, 0x2}, // mGObjTg @@ -607,7 +607,7 @@ static int daSyRock_Create(fopAc_ac_c* i_this) { return actor->create(); } -static actor_method_class l_daSyRock_Method = { +static DUSK_CONST actor_method_class l_daSyRock_Method = { (process_method_func)daSyRock_Create, (process_method_func)daSyRock_Delete, (process_method_func)daSyRock_Execute, @@ -615,7 +615,7 @@ static actor_method_class l_daSyRock_Method = { (process_method_func)daSyRock_Draw, }; -actor_process_profile_definition g_profile_Obj_SyRock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SyRock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_szbridge.cpp b/src/d/actor/d_a_obj_szbridge.cpp index c362e5720a..78ef961276 100644 --- a/src/d/actor/d_a_obj_szbridge.cpp +++ b/src/d/actor/d_a_obj_szbridge.cpp @@ -164,7 +164,7 @@ static int daObjSZbridge_MoveBGDraw(daObjSZbridge_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjSZbridge_METHODS = { +static DUSK_CONST actor_method_class daObjSZbridge_METHODS = { (process_method_func)daObjSZbridge_create1st, (process_method_func)daObjSZbridge_MoveBGDelete, (process_method_func)daObjSZbridge_MoveBGExecute, @@ -172,7 +172,7 @@ static actor_method_class daObjSZbridge_METHODS = { (process_method_func)daObjSZbridge_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_SZbridge = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_SZbridge = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_taFence.cpp b/src/d/actor/d_a_obj_taFence.cpp index 42d436bddd..d298641a4f 100644 --- a/src/d/actor/d_a_obj_taFence.cpp +++ b/src/d/actor/d_a_obj_taFence.cpp @@ -106,14 +106,14 @@ int daTaFence_c::CreateHeap() { return 1; } -const dCcD_SrcGObjInf daTaFence_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daTaFence_c::mCcDObjInfo = { {0, {{0x0, 0x0, 0x0}, {0x400032, 0x11}, {0x0}}}, {dCcD_SE_SWORD, 0, 0, 0, 0}, {dCcD_SE_STONE, 0, 0, 0, 0}, {0}, }; -dCcD_SrcCyl daTaFence_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daTaFence_c::mCcDCyl = { daTaFence_c::mCcDObjInfo, { { @@ -407,7 +407,7 @@ static int daTaFence_Create(fopAc_ac_c* i_this) { return ((daTaFence_c*)i_this)->create(); } -static actor_method_class l_daTaFence_Method = { +static DUSK_CONST actor_method_class l_daTaFence_Method = { (process_method_func)daTaFence_Create, (process_method_func)daTaFence_Delete, (process_method_func)daTaFence_Execute, @@ -415,7 +415,7 @@ static actor_method_class l_daTaFence_Method = { (process_method_func)daTaFence_Draw, }; -actor_process_profile_definition g_profile_Obj_TaFence = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TaFence = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_table.cpp b/src/d/actor/d_a_obj_table.cpp index eb6b0e5896..d9d7c133a3 100644 --- a/src/d/actor/d_a_obj_table.cpp +++ b/src/d/actor/d_a_obj_table.cpp @@ -13,7 +13,7 @@ #include "d/d_meter2_info.h" #include "d/d_msg_object.h" -static char* l_arcName = "Table"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Table"; void daObjTable_c::initBaseMtx() { fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); @@ -191,13 +191,13 @@ int daObjTable_c::Delete() { return 1; } -static actor_method_class l_daObjTable_Method = { +static DUSK_CONST actor_method_class l_daObjTable_Method = { (process_method_func)daObjTable_Create, (process_method_func)daObjTable_Delete, (process_method_func)daObjTable_Execute, (process_method_func)daObjTable_IsDelete, (process_method_func)daObjTable_Draw, }; -actor_process_profile_definition g_profile_Obj_Table = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Table = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_takaraDai.cpp b/src/d/actor/d_a_obj_takaraDai.cpp index b33111f137..5e1f95ddce 100644 --- a/src/d/actor/d_a_obj_takaraDai.cpp +++ b/src/d/actor/d_a_obj_takaraDai.cpp @@ -196,13 +196,13 @@ static int daTkraDai_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daTkraDai_Method = { +static DUSK_CONST actor_method_class l_daTkraDai_Method = { (process_method_func)daTkraDai_Create, (process_method_func)daTkraDai_Delete, (process_method_func)daTkraDai_Execute, 0, (process_method_func)daTkraDai_Draw, }; -actor_process_profile_definition g_profile_Obj_TakaraDai = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TakaraDai = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tatigi.cpp b/src/d/actor/d_a_obj_tatigi.cpp index 93c07f409a..092a6e6d8f 100644 --- a/src/d/actor/d_a_obj_tatigi.cpp +++ b/src/d/actor/d_a_obj_tatigi.cpp @@ -110,7 +110,7 @@ static BOOL set_pos_check(obj_tatigi_class* i_this, int param_2) { } static int daObj_Tatigi_Create(fopAc_ac_c* a_this) { - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x11}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -206,7 +206,7 @@ static int daObj_Tatigi_Create(fopAc_ac_c* a_this) { return rv; } -static actor_method_class l_daObj_Tatigi_Method = { +static DUSK_CONST actor_method_class l_daObj_Tatigi_Method = { (process_method_func)daObj_Tatigi_Create, (process_method_func)daObj_Tatigi_Delete, (process_method_func)daObj_Tatigi_Execute, @@ -214,7 +214,7 @@ static actor_method_class l_daObj_Tatigi_Method = { (process_method_func)daObj_Tatigi_Draw, }; -actor_process_profile_definition g_profile_OBJ_TATIGI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_TATIGI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ten.cpp b/src/d/actor/d_a_obj_ten.cpp index fbedd6a8c9..596d05cf90 100644 --- a/src/d/actor/d_a_obj_ten.cpp +++ b/src/d/actor/d_a_obj_ten.cpp @@ -801,7 +801,7 @@ static int daObjTEN_IsDelete(daObjTEN_c* param_0) { return 1; } -static actor_method_class l_daObjTEN_Method = { +static DUSK_CONST actor_method_class l_daObjTEN_Method = { (process_method_func)daObjTEN_Create, (process_method_func)daObjTEN_Delete, (process_method_func)daObjTEN_Execute, @@ -809,7 +809,7 @@ static actor_method_class l_daObjTEN_Method = { (process_method_func)daObjTEN_Draw, }; -actor_process_profile_definition g_profile_Obj_Ten = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Ten = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_testcube.cpp b/src/d/actor/d_a_obj_testcube.cpp index a9469551b4..c2beadc71b 100644 --- a/src/d/actor/d_a_obj_testcube.cpp +++ b/src/d/actor/d_a_obj_testcube.cpp @@ -351,7 +351,7 @@ static int daObjCube_Create(fopAc_ac_c* actor) { return i_this->create(); } -static actor_method_class l_daObjCube_Method = { +static DUSK_CONST actor_method_class l_daObjCube_Method = { (process_method_func)daObjCube_Create, (process_method_func)daObjCube_Delete, (process_method_func)daObjCube_Execute, @@ -366,7 +366,7 @@ static actor_method_class l_daObjCube_Method = { #define OBJCUBE_METHODS NULL #endif -actor_process_profile_definition g_profile_Obj_TestCube = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TestCube = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tgake.cpp b/src/d/actor/d_a_obj_tgake.cpp index 18ca94f97b..7284e246be 100644 --- a/src/d/actor/d_a_obj_tgake.cpp +++ b/src/d/actor/d_a_obj_tgake.cpp @@ -36,7 +36,7 @@ int daObjGake_c::Create() { return 1; } -static char* l_arcName = "A_TGake"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "A_TGake"; int daObjGake_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 4); @@ -125,13 +125,13 @@ static int daObjGake_MoveBGDraw(daObjGake_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjGake_METHODS = { +static DUSK_CONST actor_method_class daObjGake_METHODS = { (process_method_func)daObjGake_create1st, (process_method_func)daObjGake_MoveBGDelete, (process_method_func)daObjGake_MoveBGExecute, (process_method_func)NULL, (process_method_func)daObjGake_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Gake = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Gake = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_thashi.cpp b/src/d/actor/d_a_obj_thashi.cpp index 48aa05a435..2feafd46d4 100644 --- a/src/d/actor/d_a_obj_thashi.cpp +++ b/src/d/actor/d_a_obj_thashi.cpp @@ -27,7 +27,7 @@ void daObjTHASHI_c::initCcCylinder() { #if !DEBUG const #endif - static dCcD_SrcCyl ccCylSrc = { + static DUSK_CONSTEXPR dCcD_SrcCyl ccCylSrc = { { {0x0, {{AT_TYPE_0, 0x0, 0x0}, {0x00100000, 0x1f}, 0x75}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -239,7 +239,7 @@ static int daObjTHASHI_IsDelete(daObjTHASHI_c* param_0) { return TRUE; } -static actor_method_class l_daObjTHASHI_Method = { +static DUSK_CONST actor_method_class l_daObjTHASHI_Method = { (process_method_func)daObjTHASHI_Create, (process_method_func)daObjTHASHI_Delete, (process_method_func)daObjTHASHI_Execute, @@ -247,7 +247,7 @@ static actor_method_class l_daObjTHASHI_Method = { (process_method_func)daObjTHASHI_Draw, }; -actor_process_profile_definition g_profile_Obj_THASHI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_THASHI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_thdoor.cpp b/src/d/actor/d_a_obj_thdoor.cpp index 3a84a59cb8..81a847789a 100644 --- a/src/d/actor/d_a_obj_thdoor.cpp +++ b/src/d/actor/d_a_obj_thdoor.cpp @@ -62,11 +62,11 @@ void daObjThDoor_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName = "V_CTDoor"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "V_CTDoor"; -static char* l_evName = "CHASE_AWAY_WOLF"; +static DUSK_CONSTEXPR char DUSK_CONST* l_evName = "CHASE_AWAY_WOLF"; -static char* l_staffName = "thdoor"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "thdoor"; static dCcD_SrcCyl l_cyl_src = { { @@ -243,7 +243,7 @@ void daObjThDoor_c::actionDead() {} int daObjThDoor_c::demoProc() { - static char* action_table[3] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[3] = { "WAIT", "MSG", "CLOSE", @@ -355,7 +355,7 @@ static int daObjThDoor_MoveBGDraw(daObjThDoor_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjThDoor_METHODS = { +static DUSK_CONST actor_method_class daObjThDoor_METHODS = { (process_method_func)daObjThDoor_create1st, (process_method_func)daObjThDoor_MoveBGDelete, (process_method_func)daObjThDoor_MoveBGExecute, @@ -363,7 +363,7 @@ static actor_method_class daObjThDoor_METHODS = { (process_method_func)daObjThDoor_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_TDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_timeFire.cpp b/src/d/actor/d_a_obj_timeFire.cpp index 8b7b2ba730..8ab9dfaa96 100644 --- a/src/d/actor/d_a_obj_timeFire.cpp +++ b/src/d/actor/d_a_obj_timeFire.cpp @@ -146,7 +146,7 @@ static int daTimeFire_Create(fopAc_ac_c* i_this) { static daTimeFire_HIO_c l_HIO; -static actor_method_class l_daTimeFire_Method = { +static DUSK_CONST actor_method_class l_daTimeFire_Method = { (process_method_func)daTimeFire_Create, (process_method_func)daTimeFire_Delete, (process_method_func)daTimeFire_Execute, @@ -154,7 +154,7 @@ static actor_method_class l_daTimeFire_Method = { (process_method_func)daTimeFire_Draw, }; -actor_process_profile_definition g_profile_Obj_TimeFire = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TimeFire = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_timer.cpp b/src/d/actor/d_a_obj_timer.cpp index 0bdb9f769b..4923185555 100644 --- a/src/d/actor/d_a_obj_timer.cpp +++ b/src/d/actor/d_a_obj_timer.cpp @@ -131,7 +131,7 @@ namespace { }; // namespace daObjTimer -actor_process_profile_definition g_profile_Obj_Timer = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Timer = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 10, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tks.cpp b/src/d/actor/d_a_obj_tks.cpp index 7c87356c85..df6a596804 100644 --- a/src/d/actor/d_a_obj_tks.cpp +++ b/src/d/actor/d_a_obj_tks.cpp @@ -10,7 +10,7 @@ #include "d/d_camera.h" #include "d/d_com_inf_game.h" -static daNpc_GetParam1 l_bckGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_bckGetParamList[] = { {-1, 2}, {7, 0}, {11, 2}, @@ -19,11 +19,11 @@ static daNpc_GetParam1 l_bckGetParamList[] = { {9, 0}, }; -static daNpc_GetParam1 l_btpGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btpGetParamList[] = { {20, 2}, }; -static daNpc_GetParam1 l_btkGetParamList[] = { +static DUSK_CONSTEXPR daNpc_GetParam1 l_btkGetParamList[] = { {17, 2}, }; @@ -35,9 +35,9 @@ static u8 l_evtNames[4] = { 0x00, }; -static char* l_arcName = "TKS2"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "TKS2"; -static char* l_myName = "ObjTks"; +static DUSK_CONSTEXPR char DUSK_CONST* l_myName = "ObjTks"; daObjTks_c::daObjTks_c() {} @@ -59,7 +59,7 @@ daObjTks_c::~daObjTks_c() { #endif } -const daObjTks_HIOParam daObjTks_Param_c::m = { +DUSK_GAME_DATA const daObjTks_HIOParam daObjTks_Param_c::m = { 90.0f, -3.0f, 1.0f, @@ -896,7 +896,7 @@ BOOL daObjTks_c::drawDbgInfo() { void daObjTks_c::drawOtherMdls() {} -static actor_method_class daObjTks_MethodTable = { +static DUSK_CONST actor_method_class daObjTks_MethodTable = { (process_method_func)daObjTks_Create, (process_method_func)daObjTks_Delete, (process_method_func)daObjTks_Execute, @@ -904,7 +904,7 @@ static actor_method_class daObjTks_MethodTable = { (process_method_func)daObjTks_Draw, }; -actor_process_profile_definition g_profile_OBJ_TKS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_TKS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tmoon.cpp b/src/d/actor/d_a_obj_tmoon.cpp index 58b9a5b4c7..8c83b16838 100644 --- a/src/d/actor/d_a_obj_tmoon.cpp +++ b/src/d/actor/d_a_obj_tmoon.cpp @@ -95,13 +95,13 @@ static int daObjTMoon_Create(daObjTMoon_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjTMoon_Method = { +static DUSK_CONST actor_method_class l_daObjTMoon_Method = { (process_method_func)daObjTMoon_Create, (process_method_func)daObjTMoon_Delete, (process_method_func)daObjTMoon_Execute, (process_method_func)NULL, (process_method_func)daObjTMoon_Draw, }; -actor_process_profile_definition g_profile_Obj_TMoon = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TMoon = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_toaru_maki.cpp b/src/d/actor/d_a_obj_toaru_maki.cpp index 8bacb9ba53..9b3d366a81 100644 --- a/src/d/actor/d_a_obj_toaru_maki.cpp +++ b/src/d/actor/d_a_obj_toaru_maki.cpp @@ -12,7 +12,7 @@ static int daObjToaruMaki_c_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_arcName[2] = {"T_Maki1", "T_Maki2"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = {"T_Maki1", "T_Maki2"}; daObjToaruMaki_c::daObjToaruMaki_c() { mpBgW = NULL; @@ -120,7 +120,7 @@ static int daObjToaruMaki_draw(daObjToaruMaki_c* i_this) { return i_this->draw(); } -static actor_method_class daObjToaruMaki_METHODS = { +static DUSK_CONST actor_method_class daObjToaruMaki_METHODS = { (process_method_func)daObjToaruMaki_create, (process_method_func)daObjToaruMaki_Delete, (process_method_func)daObjToaruMaki_execute, @@ -128,7 +128,7 @@ static actor_method_class daObjToaruMaki_METHODS = { (process_method_func)daObjToaruMaki_draw, }; -actor_process_profile_definition g_profile_Obj_ToaruMaki = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ToaruMaki = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_toby.cpp b/src/d/actor/d_a_obj_toby.cpp index ade90bcdf7..2e235796dc 100644 --- a/src/d/actor/d_a_obj_toby.cpp +++ b/src/d/actor/d_a_obj_toby.cpp @@ -19,7 +19,7 @@ #include #endif -static s8 r05yuka_image[192] = { +static DUSK_CONSTEXPR s8 r05yuka_image[192] = { 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -34,7 +34,7 @@ static s8 r05yuka_image[192] = { 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; -static s8 r11yuka_image[192] = { +static DUSK_CONSTEXPR s8 r11yuka_image[192] = { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -519,7 +519,7 @@ static int daObj_Toby_Create(fopAc_ac_c* a_this) { cXyz cStack_38(a_this->home.pos); if (i_this->field_0x577 == 3) { i_this->mYukaNum = 0; - s8* local_64; + s8 DUSK_CONST* local_64; if (fopAcM_GetRoomNo(a_this) == 5) { local_64 = r05yuka_image; } else { @@ -696,7 +696,7 @@ static int daObj_Toby_Create(fopAc_ac_c* a_this) { AUDIO_INSTANCES; -static actor_method_class l_daObj_Toby_Method = { +static DUSK_CONST actor_method_class l_daObj_Toby_Method = { (process_method_func)daObj_Toby_Create, (process_method_func)daObj_Toby_Delete, (process_method_func)daObj_Toby_Execute, @@ -704,7 +704,7 @@ static actor_method_class l_daObj_Toby_Method = { (process_method_func)daObj_Toby_Draw, }; -actor_process_profile_definition g_profile_OBJ_TOBY = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_TOBY = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tobyhouse.cpp b/src/d/actor/d_a_obj_tobyhouse.cpp index 2e83318c9d..ee6fe73dd3 100644 --- a/src/d/actor/d_a_obj_tobyhouse.cpp +++ b/src/d/actor/d_a_obj_tobyhouse.cpp @@ -125,13 +125,13 @@ void daObjTobyHouse_c::setBaseMtx() { MTXCopy(mDoMtx_stack_c::get(), mBgMtx); } -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "M_THouse", "U_THouse", }; -static char* l_staff_name = "thouse"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staff_name = "thouse"; -static char* l_event_name[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_event_name[2] = { "TOBY_HOUSE_FIRE_TO_RAKKA", "TOBY_HOUSE_FIRE_TO_DESERT", }; @@ -254,7 +254,7 @@ int daObjTobyHouse_c::Execute(Mtx** i_mtx) { } void daObjTobyHouse_c::action() { - static daObjTobyHouse_c::actionFunc l_func[4] = { + static DUSK_CONSTEXPR daObjTobyHouse_c::actionFunc l_func[4] = { &daObjTobyHouse_c::actionWait, &daObjTobyHouse_c::actionOrderEvent, &daObjTobyHouse_c::actionEvent, @@ -322,8 +322,8 @@ void daObjTobyHouse_c::demoProc() { }; daPy_py_c* player = daPy_getPlayerActorClass(); - static cXyz l_shotSmokeScale(8.0f, 8.0f, 8.0f); - static Vec l_shotSmokeOffset = {0.0f, 2500.0f, -600.0f}; + static DUSK_CONSTEXPR cXyz l_shotSmokeScale(8.0f, 8.0f, 8.0f); + static DUSK_CONSTEXPR Vec l_shotSmokeOffset = {0.0f, 2500.0f, -600.0f}; cXyz cStack_24; csXyz cStack_98; fopAcM_SearchByName(fpcNm_NPC_TOBY_e); @@ -592,7 +592,7 @@ static int daObjTobyHouse_MoveBGDraw(daObjTobyHouse_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjTobyHouse_METHODS = { +static DUSK_CONST actor_method_class daObjTobyHouse_METHODS = { (process_method_func)daObjTobyHouse_create1st, (process_method_func)daObjTobyHouse_MoveBGDelete, (process_method_func)daObjTobyHouse_MoveBGExecute, @@ -600,7 +600,7 @@ static actor_method_class daObjTobyHouse_METHODS = { (process_method_func)daObjTobyHouse_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_TobyHouse = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TobyHouse = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_togeTrap.cpp b/src/d/actor/d_a_obj_togeTrap.cpp index c1aec26441..479bdece95 100644 --- a/src/d/actor/d_a_obj_togeTrap.cpp +++ b/src/d/actor/d_a_obj_togeTrap.cpp @@ -22,14 +22,14 @@ daTogeTrap_HIO_c::daTogeTrap_HIO_c() { static daTogeTrap_HIO_c l_HIO; -const dCcD_SrcGObjInf daTogeTrap_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daTogeTrap_c::mCcDObjInfo = { {0, {{2, 1, 0x1D}, {0x480028, 0x11}, {0}}}, {dCcD_SE_SWORD, 0, 0, 0, 0}, {dCcD_SE_STONE, 0, 0, 0, 0}, {0}, }; -dCcD_SrcCyl daTogeTrap_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daTogeTrap_c::mCcDCyl = { daTogeTrap_c::mCcDObjInfo, { { @@ -293,7 +293,7 @@ static int daTogeTrap_Create(fopAc_ac_c* i_this) { return ((daTogeTrap_c*)i_this)->create(); } -static actor_method_class l_daTogeTrap_Method = { +static DUSK_CONST actor_method_class l_daTogeTrap_Method = { (process_method_func)daTogeTrap_Create, (process_method_func)daTogeTrap_Delete, (process_method_func)daTogeTrap_Execute, @@ -301,7 +301,7 @@ static actor_method_class l_daTogeTrap_Method = { (process_method_func)daTogeTrap_Draw, }; -actor_process_profile_definition g_profile_Obj_TogeTrap = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TogeTrap = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tombo.cpp b/src/d/actor/d_a_obj_tombo.cpp index a518e3cf25..7d392408c9 100644 --- a/src/d/actor/d_a_obj_tombo.cpp +++ b/src/d/actor/d_a_obj_tombo.cpp @@ -673,7 +673,7 @@ static int daObjTOMBO_IsDelete(daObjTOMBO_c* param_0) { return 1; } -static actor_method_class l_daObjTOMBO_Method = { +static DUSK_CONST actor_method_class l_daObjTOMBO_Method = { (process_method_func)daObjTOMBO_Create, (process_method_func)daObjTOMBO_Delete, (process_method_func)daObjTOMBO_Execute, @@ -681,7 +681,7 @@ static actor_method_class l_daObjTOMBO_Method = { (process_method_func)daObjTOMBO_Draw, }; -actor_process_profile_definition g_profile_Obj_Tombo = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Tombo = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tornado.cpp b/src/d/actor/d_a_obj_tornado.cpp index b7e8ce3725..b64c268e79 100644 --- a/src/d/actor/d_a_obj_tornado.cpp +++ b/src/d/actor/d_a_obj_tornado.cpp @@ -220,13 +220,13 @@ static void dummyString() { DEAD_STRING(""); } -static actor_method_class l_daObjTrnd_Method = { +static DUSK_CONST actor_method_class l_daObjTrnd_Method = { (process_method_func)daObjTrnd_Create, (process_method_func)daObjTrnd_Delete, (process_method_func)daObjTrnd_Execute, (process_method_func)NULL, (process_method_func)daObjTrnd_Draw, }; -actor_process_profile_definition g_profile_Obj_Tornado = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Tornado = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tornado2.cpp b/src/d/actor/d_a_obj_tornado2.cpp index 4b9a8fe38e..73bf50a073 100644 --- a/src/d/actor/d_a_obj_tornado2.cpp +++ b/src/d/actor/d_a_obj_tornado2.cpp @@ -392,13 +392,13 @@ static int daObjTrnd2_Create(daObjTrnd2_c* i_this) { return i_this->create(); } -static actor_method_class l_daObjTrnd2_Method = { +static DUSK_CONST actor_method_class l_daObjTrnd2_Method = { (process_method_func)daObjTrnd2_Create, (process_method_func)daObjTrnd2_Delete, (process_method_func)daObjTrnd2_Execute, (process_method_func)NULL, (process_method_func)daObjTrnd2_Draw, }; -actor_process_profile_definition g_profile_Obj_Tornado2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Tornado2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_tp.cpp b/src/d/actor/d_a_obj_tp.cpp index 2690de3e04..bd3fa4d6a2 100644 --- a/src/d/actor/d_a_obj_tp.cpp +++ b/src/d/actor/d_a_obj_tp.cpp @@ -490,7 +490,7 @@ static int daObj_Tp_Create(fopAc_ac_c* i_this) { return rv; } -static actor_method_class l_daObj_Tp_Method = { +static DUSK_CONST actor_method_class l_daObj_Tp_Method = { (process_method_func)daObj_Tp_Create, (process_method_func)daObj_Tp_Delete, (process_method_func)daObj_Tp_Execute, @@ -498,7 +498,7 @@ static actor_method_class l_daObj_Tp_Method = { (process_method_func)daObj_Tp_Draw, }; -actor_process_profile_definition g_profile_OBJ_TP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_TP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_treesh.cpp b/src/d/actor/d_a_obj_treesh.cpp index dea5b1ed78..8a19dc9533 100644 --- a/src/d/actor/d_a_obj_treesh.cpp +++ b/src/d/actor/d_a_obj_treesh.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_obj_treesh.h" #include "d/d_com_inf_game.h" -static char* l_arcName = "M_TreeSh"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_TreeSh"; daTreeSh_HIO_c::daTreeSh_HIO_c() { shake_strength = 800; @@ -151,7 +151,7 @@ static int daTreeSh_MoveBGDraw(daTreeSh_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daTreeSh_METHODS = { +static DUSK_CONST actor_method_class daTreeSh_METHODS = { (process_method_func)daTreeSh_create1st, (process_method_func)daTreeSh_MoveBGDelete, (process_method_func)daTreeSh_MoveBGExecute, @@ -159,7 +159,7 @@ static actor_method_class daTreeSh_METHODS = { (process_method_func)daTreeSh_MoveBGDraw, }; -actor_process_profile_definition g_profile_TREESH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TREESH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_twGate.cpp b/src/d/actor/d_a_obj_twGate.cpp index 1003f97a7e..d7151f5ead 100644 --- a/src/d/actor/d_a_obj_twGate.cpp +++ b/src/d/actor/d_a_obj_twGate.cpp @@ -29,7 +29,7 @@ void daTwGate_HIO_c::genMessage(JORMContext* ctx) { } #endif -static char* l_resNameIdx[13] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameIdx[13] = { "twGtFiro", "twGtK0102", "twGtK0709", @@ -222,7 +222,7 @@ static int daTwGate_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daTwGate_Method = { +static DUSK_CONST actor_method_class l_daTwGate_Method = { (process_method_func)daTwGate_Create, (process_method_func)daTwGate_Delete, (process_method_func)daTwGate_Execute, @@ -230,7 +230,7 @@ static actor_method_class l_daTwGate_Method = { (process_method_func)daTwGate_Draw, }; -actor_process_profile_definition g_profile_Obj_TwGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_TwGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_udoor.cpp b/src/d/actor/d_a_obj_udoor.cpp index ea4f79adfc..86ab9147bc 100644 --- a/src/d/actor/d_a_obj_udoor.cpp +++ b/src/d/actor/d_a_obj_udoor.cpp @@ -156,7 +156,7 @@ static cPhs_Step daObj_Udoor_Create(fopAc_ac_c* i_this) { return phase_state; } -static actor_method_class l_daObj_Udoor_Method = { +static DUSK_CONST actor_method_class l_daObj_Udoor_Method = { (process_method_func)daObj_Udoor_Create, (process_method_func)daObj_Udoor_Delete, (process_method_func)daObj_Udoor_Execute, @@ -164,7 +164,7 @@ static actor_method_class l_daObj_Udoor_Method = { (process_method_func)daObj_Udoor_Draw, }; -actor_process_profile_definition g_profile_OBJ_UDOOR = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_UDOOR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_usaku.cpp b/src/d/actor/d_a_obj_usaku.cpp index 07561ec0a3..7598cf11d7 100644 --- a/src/d/actor/d_a_obj_usaku.cpp +++ b/src/d/actor/d_a_obj_usaku.cpp @@ -110,13 +110,13 @@ static int daObj_Usaku_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daObj_Usaku_Method = { +static DUSK_CONST actor_method_class l_daObj_Usaku_Method = { (process_method_func)daObj_Usaku_Create, (process_method_func)daObj_Usaku_Delete, (process_method_func)daObj_Usaku_Execute, (process_method_func)daObj_Usaku_IsDelete, (process_method_func)daObj_Usaku_Draw, }; -actor_process_profile_definition g_profile_OBJ_USAKU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_USAKU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_vground.cpp b/src/d/actor/d_a_obj_vground.cpp index 9041b3da92..daf0709ff6 100644 --- a/src/d/actor/d_a_obj_vground.cpp +++ b/src/d/actor/d_a_obj_vground.cpp @@ -33,7 +33,7 @@ int daObjVGnd_c::Create() { return 1; } -static char* l_arcName = "M_VolcGnd"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_VolcGnd"; int daObjVGnd_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 0x5); @@ -130,13 +130,13 @@ static int daObjVGnd_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjVGnd_Method = { +static DUSK_CONST actor_method_class l_daObjVGnd_Method = { (process_method_func)daObjVGnd_Create, (process_method_func)daObjVGnd_Delete, (process_method_func)daObjVGnd_Execute, (process_method_func)NULL, (process_method_func)daObjVGnd_Draw, }; -actor_process_profile_definition g_profile_Obj_VolcGnd = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_VolcGnd = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_volcball.cpp b/src/d/actor/d_a_obj_volcball.cpp index 0997d36900..62ccb199db 100644 --- a/src/d/actor/d_a_obj_volcball.cpp +++ b/src/d/actor/d_a_obj_volcball.cpp @@ -604,7 +604,7 @@ static int daObjVolcBall_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjVolcBall_Method = { +static DUSK_CONST actor_method_class l_daObjVolcBall_Method = { (process_method_func)daObjVolcBall_Create, (process_method_func)daObjVolcBall_Delete, (process_method_func)daObjVolcBall_Execute, @@ -612,7 +612,7 @@ static actor_method_class l_daObjVolcBall_Method = { (process_method_func)daObjVolcBall_Draw, }; -actor_process_profile_definition g_profile_Obj_VolcanicBall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_VolcanicBall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_volcbom.cpp b/src/d/actor/d_a_obj_volcbom.cpp index 6399071bfe..6ffeea3695 100644 --- a/src/d/actor/d_a_obj_volcbom.cpp +++ b/src/d/actor/d_a_obj_volcbom.cpp @@ -66,13 +66,13 @@ static u16 const l_bind_eff[4] = { 0x8B47, 0x8B48, 0x8B49, 0x8B4A, }; -static char* l_arcName = "M_VolcBom"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "M_VolcBom"; -static char* l_portal_warp_name = "PORTAL_WARP_BIGVOLC"; +static DUSK_CONSTEXPR char DUSK_CONST* l_portal_warp_name = "PORTAL_WARP_BIGVOLC"; -static char* l_staff_name = "BigVolc"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staff_name = "BigVolc"; -static dCcD_SrcCyl l_cyl_src = { +static DUSK_CONSTEXPR dCcD_SrcCyl l_cyl_src = { { {0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0x1f}, {0x0, 0x10}, 0x78}}, // mObj {dCcD_SE_NONE, 0x0, 0xc, 0x0, 0x0}, // mGObjAt @@ -252,7 +252,7 @@ int daObjVolcBom_c::Execute(Mtx** i_mtx) { } void daObjVolcBom_c::mode_proc_call() { - static daObjVolcBom_c::modeFunc mode_proc[4] = { + static DUSK_CONSTEXPR daObjVolcBom_c::modeFunc mode_proc[4] = { &daObjVolcBom_c::modeWaitAppear, &daObjVolcBom_c::modeFall, &daObjVolcBom_c::modeWaitEndFallDemo, @@ -553,7 +553,7 @@ void daObjVolcBom_c::endSrcEffect() { } void daObjVolcBom_c::event_proc_call() { - static daObjVolcBom_c::actionFunc l_func[6] = { + static DUSK_CONSTEXPR daObjVolcBom_c::actionFunc l_func[6] = { &daObjVolcBom_c::actionWait, &daObjVolcBom_c::actionOrderEvent, &daObjVolcBom_c::actionTalkEvent, @@ -875,7 +875,7 @@ static int daObjVolcBom_MoveBGDraw(daObjVolcBom_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjVolcBom_METHODS = { +static DUSK_CONST actor_method_class daObjVolcBom_METHODS = { (process_method_func)daObjVolcBom_create1st, (process_method_func)daObjVolcBom_MoveBGDelete, (process_method_func)daObjVolcBom_MoveBGExecute, @@ -883,7 +883,7 @@ static actor_method_class daObjVolcBom_METHODS = { (process_method_func)daObjVolcBom_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_VolcanicBomb = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_VolcanicBomb = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_warp_kbrg.cpp b/src/d/actor/d_a_obj_warp_kbrg.cpp index 246bad9686..007ebd6d83 100644 --- a/src/d/actor/d_a_obj_warp_kbrg.cpp +++ b/src/d/actor/d_a_obj_warp_kbrg.cpp @@ -78,19 +78,19 @@ void daObjWarpKBrg_c::setBaseMtx() { } } -static char* l_arcName[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[2] = { "Obj_kbrgS", "Obj_kbrgD", }; -static char* l_evArcName = "Obj_kbrg"; +static DUSK_CONSTEXPR char DUSK_CONST* l_evArcName = "Obj_kbrg"; -static char* l_portal_warp_name[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_portal_warp_name[2] = { "PORTAL_WARP_KBRIDGE", "PORTAL_WARP_KBRIDGE_OUT", }; -static char* l_staff_name = "WarpBrg"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staff_name = "WarpBrg"; int daObjWarpKBrg_c::Create() { switch (getNameArg()) { @@ -273,7 +273,7 @@ int daObjWarpKBrg_c::Execute(Mtx** param_0) { } void daObjWarpKBrg_c::event_proc_call() { - static void (daObjWarpKBrg_c::*l_func[])() = { + static DUSK_CONSTEXPR void (daObjWarpKBrg_c::*l_func[])() = { &daObjWarpKBrg_c::actionWait, &daObjWarpKBrg_c::actionOrderEvent, &daObjWarpKBrg_c::actionTalkEvent, @@ -439,7 +439,7 @@ void daObjWarpKBrg_c::actionWarpEvent2() { void daObjWarpKBrg_c::actionDead2() {} void daObjWarpKBrg_c::demoProc() { - static char* action_table[7] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[7] = { "WAIT", "FLY", "DOWN", @@ -815,7 +815,7 @@ static int daObjWarpKBrg_MoveBGDraw(daObjWarpKBrg_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjWarpKBrg_METHODS = { +static DUSK_CONST actor_method_class daObjWarpKBrg_METHODS = { (process_method_func)daObjWarpKBrg_create1st, (process_method_func)daObjWarpKBrg_MoveBGDelete, (process_method_func)daObjWarpKBrg_MoveBGExecute, @@ -823,7 +823,7 @@ static actor_method_class daObjWarpKBrg_METHODS = { (process_method_func)daObjWarpKBrg_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_KakarikoBrg = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_KakarikoBrg = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_warp_obrg.cpp b/src/d/actor/d_a_obj_warp_obrg.cpp index 65662d37c0..3741880e15 100644 --- a/src/d/actor/d_a_obj_warp_obrg.cpp +++ b/src/d/actor/d_a_obj_warp_obrg.cpp @@ -13,9 +13,9 @@ #include "d/d_bg_w.h" #include -static char* l_arcName = "Obj_obrg"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_obrg"; -static char* l_portal_warp_name[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_portal_warp_name[2] = { "PORTAL_WARP_OBRIDGE", "PORTAL_WARP_OUT_OBRIDGE", }; @@ -36,7 +36,7 @@ static const u16 l_app_eff[] = {0x8B34, 0x8B36, 0x8B37}; static const Vec l_midna_wait_offset = {100.0f, -1265.0f, -760.0f}; -static char* l_staff_name[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_staff_name[2] = { "WarpOB1", "WarpOB2", }; @@ -346,7 +346,7 @@ void daObjWarpOBrg_c::actionWarpEventDst() { void daObjWarpOBrg_c::actionDead() {} void daObjWarpOBrg_c::demoProc() { - static char* action_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[4] = { "WAIT", "OBJ_DISAPP", "OBJ_APP", @@ -591,7 +591,7 @@ static int daObjWarpOBrg_MoveBGDraw(daObjWarpOBrg_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjWarpOBrg_METHODS = { +static DUSK_CONST actor_method_class daObjWarpOBrg_METHODS = { (process_method_func)daObjWarpOBrg_create1st, (process_method_func)daObjWarpOBrg_MoveBGDelete, (process_method_func)daObjWarpOBrg_MoveBGExecute, @@ -599,7 +599,7 @@ static actor_method_class daObjWarpOBrg_METHODS = { (process_method_func)daObjWarpOBrg_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_OrdinBrg = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_OrdinBrg = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_waterGate.cpp b/src/d/actor/d_a_obj_waterGate.cpp index 2f2b623dd1..e5385530fa 100644 --- a/src/d/actor/d_a_obj_waterGate.cpp +++ b/src/d/actor/d_a_obj_waterGate.cpp @@ -206,7 +206,7 @@ static int daWtGate_Create(fopAc_ac_c* i_this) { return waterGate->create(); } -static actor_method_class l_daWtGate_Method = { +static DUSK_CONST actor_method_class l_daWtGate_Method = { (process_method_func)daWtGate_Create, (process_method_func)daWtGate_Delete, (process_method_func)daWtGate_Execute, @@ -214,7 +214,7 @@ static actor_method_class l_daWtGate_Method = { (process_method_func)daWtGate_Draw, }; -actor_process_profile_definition g_profile_Obj_WtGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WtGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_waterPillar.cpp b/src/d/actor/d_a_obj_waterPillar.cpp index 67d454bc9a..1e65f3adf9 100644 --- a/src/d/actor/d_a_obj_waterPillar.cpp +++ b/src/d/actor/d_a_obj_waterPillar.cpp @@ -130,13 +130,13 @@ int daWtPillar_c::createHeapCallBack(fopAc_ac_c* i_this) { return actor->CreateHeap(); } -const dCcD_SrcGObjInf daWtPillar_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daWtPillar_c::mCcDObjInfo = { {0x0, {{AT_TYPE_100, 0x0, 0x1D}, {AT_TYPE_0, 0x0}, 0x0}}, // mObj {dCcD_SE_SWORD, 0x0, 0x0, dCcD_MTRL_NONE, 0x0}, // mGObjAt {dCcD_SE_STONE, 0x0, 0x0, dCcD_MTRL_NONE, 0x0}, // mGObjTg {}, // mGObjCo }; -const dCcD_SrcGObjInf daWtPillar_c::mCcDObjCoInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daWtPillar_c::mCcDObjCoInfo = { {0x0, {{AT_TYPE_0, 0x0, 0x0}, {0x00, 0x0}, 0x79}}, // mObj {dCcD_SE_SWORD, 0x0, 0x0, dCcD_MTRL_NONE, 0x0}, // mGObjAt {dCcD_SE_STONE, 0x0, 0x0, dCcD_MTRL_NONE, 0x0}, // mGObjTg @@ -145,17 +145,17 @@ const dCcD_SrcGObjInf daWtPillar_c::mCcDObjCoInfo = { static daWtPillar_HIO_c l_HIO; -cull_box l_cull_box = { +DUSK_GAME_DATA cull_box l_cull_box = { {-30.0f, -10.0f, -30.0f}, {30.0f, 60.0f, 30.0f} }; -dCcD_SrcCps daWtPillar_c::mCcDCps = { +DUSK_GAME_DATA dCcD_SrcCps daWtPillar_c::mCcDCps = { daWtPillar_c::mCcDObjInfo, { { {0.0f, 0.0f, 0.0f}, {0.0f,1100.0f, 0.0f}, 150.0f }} }; -dCcD_SrcCyl daWtPillar_c::mCcDCyl = {daWtPillar_c::mCcDObjCoInfo}; +DUSK_GAME_DATA dCcD_SrcCyl daWtPillar_c::mCcDCyl = {daWtPillar_c::mCcDObjCoInfo}; int daWtPillar_c::CreateHeap() { J3DModelData* modelData = static_cast(dComIfG_getObjectRes("efWater", 8)); @@ -694,7 +694,7 @@ int daWtPillar_Create(fopAc_ac_c* i_this) { return actor->create(); } -actor_method_class l_daWtPillar_Method = { +DUSK_GAME_DATA actor_method_class l_daWtPillar_Method = { (process_method_func)daWtPillar_Create, (process_method_func)daWtPillar_Delete, (process_method_func)daWtPillar_Execute, @@ -702,7 +702,7 @@ actor_method_class l_daWtPillar_Method = { (process_method_func)daWtPillar_Draw, }; -actor_process_profile_definition g_profile_Obj_WaterPillar = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WaterPillar = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_waterfall.cpp b/src/d/actor/d_a_obj_waterfall.cpp index 851e95080f..a7707f36b9 100644 --- a/src/d/actor/d_a_obj_waterfall.cpp +++ b/src/d/actor/d_a_obj_waterfall.cpp @@ -27,10 +27,10 @@ static int daObjWaterFall_Create(fopAc_ac_c* i_this); static fopAc_ac_c* target_info[MAX_TARGET_INFO_COUNT]; // Mutually exclusive list of bomb/arrow actors to be potentially deleted static int target_info_count; -const char* l_arcName = "sample"; +DUSK_GAME_DATA const char* l_arcName = "sample"; #if DEBUG -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-200.0f, -100.0f, -200.0f}, {200.0f, 100.0f, 200.0f} }; @@ -391,7 +391,7 @@ static int daObjWaterFall_Create(fopAc_ac_c* i_this) { return actor->create(); } -static actor_method_class l_daObjWaterFall_Method = { +static DUSK_CONST actor_method_class l_daObjWaterFall_Method = { (process_method_func)daObjWaterFall_Create, (process_method_func)daObjWaterFall_Delete, (process_method_func)daObjWaterFall_Execute, @@ -399,7 +399,7 @@ static actor_method_class l_daObjWaterFall_Method = { (process_method_func)daObjWaterFall_Draw, }; -actor_process_profile_definition g_profile_Obj_WaterFall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WaterFall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wchain.cpp b/src/d/actor/d_a_obj_wchain.cpp index 25e2c4f69f..a8f5c39086 100644 --- a/src/d/actor/d_a_obj_wchain.cpp +++ b/src/d/actor/d_a_obj_wchain.cpp @@ -378,7 +378,7 @@ static int daObjWchain_Draw(daObjWchain_c* i_this) { return i_this->draw(); } -static actor_method_class l_daObjWchain_Method = { +static DUSK_CONST actor_method_class l_daObjWchain_Method = { (process_method_func)daObjWchain_Create, (process_method_func)daObjWchain_Delete, (process_method_func)daObjWchain_Execute, @@ -386,7 +386,7 @@ static actor_method_class l_daObjWchain_Method = { (process_method_func)daObjWchain_Draw, }; -actor_process_profile_definition g_profile_Obj_Wchain = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Wchain = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wdStick.cpp b/src/d/actor/d_a_obj_wdStick.cpp index d26f3aae4b..57a3f8b7b8 100644 --- a/src/d/actor/d_a_obj_wdStick.cpp +++ b/src/d/actor/d_a_obj_wdStick.cpp @@ -14,7 +14,7 @@ static daWdStick_HIO_c l_HIO; -dCcD_SrcSph daWdStick_c::mCcDSph = {daWdStick_c::mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 4.0f}}}; +DUSK_GAME_DATA dCcD_SrcSph daWdStick_c::mCcDSph = {daWdStick_c::mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 4.0f}}}; daWdStick_HIO_c::daWdStick_HIO_c() { field_0x04 = 60; @@ -37,7 +37,7 @@ int daWdStick_c::CreateHeap() { return mModel != 0 ? 1 : 0; } -dCcD_SrcGObjInf const daWdStick_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daWdStick_c::mCcDObjInfo = { {0, {{0x200, 0, 0x1f}, {0xd8fbffff, 0x1f}, {0x0}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 4}, @@ -499,7 +499,7 @@ static int daWdStick_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daWdStick_Method = { +static DUSK_CONST actor_method_class l_daWdStick_Method = { (process_method_func)daWdStick_Create, (process_method_func)daWdStick_Delete, (process_method_func)daWdStick_Execute, @@ -507,7 +507,7 @@ static actor_method_class l_daWdStick_Method = { (process_method_func)daWdStick_Draw, }; -actor_process_profile_definition g_profile_Obj_WdStick = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WdStick = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_web0.cpp b/src/d/actor/d_a_obj_web0.cpp index 2ad9351ee6..a68253faa9 100644 --- a/src/d/actor/d_a_obj_web0.cpp +++ b/src/d/actor/d_a_obj_web0.cpp @@ -280,13 +280,13 @@ static int daObj_Web0_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daObj_Web0_Method = { +static DUSK_CONST actor_method_class l_daObj_Web0_Method = { (process_method_func)daObj_Web0_Create, (process_method_func)daObj_Web0_Delete, (process_method_func)daObj_Web0_Execute, (process_method_func)daObj_Web0_IsDelete, (process_method_func)daObj_Web0_Draw, }; -actor_process_profile_definition g_profile_OBJ_WEB0 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_WEB0 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_web1.cpp b/src/d/actor/d_a_obj_web1.cpp index 104191ad1b..9e450e00e4 100644 --- a/src/d/actor/d_a_obj_web1.cpp +++ b/src/d/actor/d_a_obj_web1.cpp @@ -242,7 +242,7 @@ static int daObj_Web1_Create(fopAc_ac_c* i_this) { fopAcM_ct(i_this, obj_web1_class); obj_web1_class* _this = static_cast(i_this); - static dCcD_SrcCyl cc_cyl_src = { + static DUSK_CONSTEXPR dCcD_SrcCyl cc_cyl_src = { { {0, {{0, 0, 0}, {0xD8FBFFFF, 17}, 0}}, {dCcD_SE_NONE, 0, 0, 0, {0}}, @@ -309,13 +309,13 @@ static int daObj_Web1_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daObj_Web1_Method = { +static DUSK_CONST actor_method_class l_daObj_Web1_Method = { (process_method_func)daObj_Web1_Create, (process_method_func)daObj_Web1_Delete, (process_method_func)daObj_Web1_Execute, (process_method_func)daObj_Web1_IsDelete, (process_method_func)daObj_Web1_Draw, }; -actor_process_profile_definition g_profile_OBJ_WEB1 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_WEB1 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_well_cover.cpp b/src/d/actor/d_a_obj_well_cover.cpp index 34b5253978..a26a9879c8 100644 --- a/src/d/actor/d_a_obj_well_cover.cpp +++ b/src/d/actor/d_a_obj_well_cover.cpp @@ -28,7 +28,7 @@ int daObjWCover_c::Create() { return 1; } -static char* l_arcName = "H_Idohuta"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "H_Idohuta"; int daObjWCover_c::CreateHeap() { J3DModelData* modelData = static_cast(dComIfG_getObjectRes(l_arcName, 4)); @@ -138,7 +138,7 @@ static int daObjWCover_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjWCover_Method = { +static DUSK_CONST actor_method_class l_daObjWCover_Method = { (process_method_func)daObjWCover_Create, (process_method_func)daObjWCover_Delete, (process_method_func)daObjWCover_Execute, @@ -146,7 +146,7 @@ static actor_method_class l_daObjWCover_Method = { (process_method_func)daObjWCover_Draw, }; -actor_process_profile_definition g_profile_Obj_WellCover = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WellCover = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wflag.cpp b/src/d/actor/d_a_obj_wflag.cpp index df3112c6fb..b80b1f8b07 100644 --- a/src/d/actor/d_a_obj_wflag.cpp +++ b/src/d/actor/d_a_obj_wflag.cpp @@ -247,7 +247,7 @@ static int daObj_Wflag_Create(fopAc_ac_c* actor) { return rv; } -static actor_method_class l_daObj_Wflag_Method = { +static DUSK_CONST actor_method_class l_daObj_Wflag_Method = { (process_method_func)daObj_Wflag_Create, (process_method_func)daObj_Wflag_Delete, (process_method_func)daObj_Wflag_Execute, @@ -255,7 +255,7 @@ static actor_method_class l_daObj_Wflag_Method = { (process_method_func)daObj_Wflag_Draw, }; -actor_process_profile_definition g_profile_OBJ_WFLAG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_WFLAG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wind_stone.cpp b/src/d/actor/d_a_obj_wind_stone.cpp index 3158b93848..0d51999789 100644 --- a/src/d/actor/d_a_obj_wind_stone.cpp +++ b/src/d/actor/d_a_obj_wind_stone.cpp @@ -14,7 +14,7 @@ static int daWindStone_c_createHeap(fopAc_ac_c* i_this) { return static_cast(i_this)->createHeap(); } -static char* l_arcName = "WindStone"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "WindStone"; daWindStone_c::daWindStone_c() : mpBgW(NULL), field_0x5c4(0) {} @@ -241,13 +241,13 @@ static int daWindStone_draw(daWindStone_c* i_this) { return i_this->draw(); } -static actor_method_class daWindStone_METHODS = { +static DUSK_CONST actor_method_class daWindStone_METHODS = { (process_method_func)daWindStone_create, (process_method_func)daWindStone_Delete, (process_method_func)daWindStone_execute, (process_method_func)NULL, (process_method_func)daWindStone_draw, }; -actor_process_profile_definition g_profile_Obj_WindStone = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WindStone = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_window.cpp b/src/d/actor/d_a_obj_window.cpp index 3b6f258942..2710bd31d8 100644 --- a/src/d/actor/d_a_obj_window.cpp +++ b/src/d/actor/d_a_obj_window.cpp @@ -9,7 +9,7 @@ #include "d/d_com_inf_game.h" #include "f_pc/f_pc_name.h" -static char* l_arcName = "J_KazeD"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "J_KazeD"; static int const l_bck[3] = {5, 6, -1}; @@ -169,7 +169,7 @@ static int daObjWindow_MoveBGDraw(daObjWindow_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daObjWindow_METHODS = { +static DUSK_CONST actor_method_class daObjWindow_METHODS = { (process_method_func)daObjWindow_create1st, (process_method_func)daObjWindow_MoveBGDelete, (process_method_func)daObjWindow_MoveBGExecute, @@ -177,7 +177,7 @@ static actor_method_class daObjWindow_METHODS = { (process_method_func)daObjWindow_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_Window = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Window = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wood_pendulum.cpp b/src/d/actor/d_a_obj_wood_pendulum.cpp index b01504b480..a1d0a42bdb 100644 --- a/src/d/actor/d_a_obj_wood_pendulum.cpp +++ b/src/d/actor/d_a_obj_wood_pendulum.cpp @@ -69,7 +69,7 @@ int daObjWPndlm_c::Create() { return 1; } -static char* l_arcName = "A_Turuki"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "A_Turuki"; int daObjWPndlm_c::CreateHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 3); @@ -162,13 +162,13 @@ static int daObjWPndlm_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjWPndlm_Method = { +static DUSK_CONST actor_method_class l_daObjWPndlm_Method = { (process_method_func)daObjWPndlm_Create, (process_method_func)daObjWPndlm_Delete, (process_method_func)daObjWPndlm_Execute, 0, (process_method_func)daObjWPndlm_Draw, }; -actor_process_profile_definition g_profile_Obj_WoodPendulum = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WoodPendulum = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wood_statue.cpp b/src/d/actor/d_a_obj_wood_statue.cpp index 208ccd2729..7c6d69d576 100644 --- a/src/d/actor/d_a_obj_wood_statue.cpp +++ b/src/d/actor/d_a_obj_wood_statue.cpp @@ -28,9 +28,9 @@ const static dCcD_SrcCyl l_cyl_src = { } }; -static char* l_arcName = "O_wood"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "O_wood"; -static char* l_eventName = "GET_WOOD_STATUE"; +static DUSK_CONSTEXPR char DUSK_CONST* l_eventName = "GET_WOOD_STATUE"; class daObjWStatue_HIO_c : public fOpAcm_HIO_entry_c { public: @@ -351,7 +351,7 @@ int daObjWStatue_c::actionBoomerangCarry() { } void daObjWStatue_c::demoProc() { - static char* action_table[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* action_table[4] = { "WAIT", "MOVE", "SETPOS", @@ -478,13 +478,13 @@ static int daObjWStatue_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjWStatue_Method = { +static DUSK_CONST actor_method_class l_daObjWStatue_Method = { (process_method_func)daObjWStatue_Create, (process_method_func)daObjWStatue_Delete, (process_method_func)daObjWStatue_Execute, NULL, (process_method_func)daObjWStatue_Draw, }; -actor_process_profile_definition g_profile_Obj_WoodStatue = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WoodStatue = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_wsword.cpp b/src/d/actor/d_a_obj_wsword.cpp index 8598371674..4cb446cef2 100644 --- a/src/d/actor/d_a_obj_wsword.cpp +++ b/src/d/actor/d_a_obj_wsword.cpp @@ -9,7 +9,7 @@ #include "d/d_com_inf_game.h" #include "f_op/f_op_actor_mng.h" -static char* l_arcName = "Obj_brksw"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Obj_brksw"; static dCcD_SrcCyl l_cyl_src = { { @@ -106,7 +106,7 @@ static int daObjWSword_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjWSword_Method = { +static DUSK_CONST actor_method_class l_daObjWSword_Method = { (process_method_func)daObjWSword_Create, (process_method_func)daObjWSword_Delete, (process_method_func)daObjWSword_Execute, @@ -114,7 +114,7 @@ static actor_method_class l_daObjWSword_Method = { (process_method_func)daObjWSword_Draw, }; -actor_process_profile_definition g_profile_Obj_WoodenSword = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_WoodenSword = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_yel_bag.cpp b/src/d/actor/d_a_obj_yel_bag.cpp index a4ddd1ee60..baacdbd934 100644 --- a/src/d/actor/d_a_obj_yel_bag.cpp +++ b/src/d/actor/d_a_obj_yel_bag.cpp @@ -20,14 +20,14 @@ static int l_loadRes_YBAG0[3] = { 0, -1, -1, }; -static int* l_loadRes_list[2] = { +static DUSK_CONSTEXPR int DUSK_CONST* l_loadRes_list[2] = { l_loadRes_YBAG0, l_loadRes_YBAG0, }; -static char* l_resNames[] = {"yel_bag"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_resNames[] = {"yel_bag"}; -dCcD_SrcCyl daObj_YBag_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daObj_YBag_c::mCcDCyl = { daNpcT_c::mCcDObjData, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f} @@ -69,14 +69,14 @@ daObj_YBag_c::~daObj_YBag_c() { #endif } -const dCcD_SrcGObjInf daObj_YBag_c::mCcDObjInfo = { +DUSK_GAME_DATA const dCcD_SrcGObjInf daObj_YBag_c::mCcDObjInfo = { {0, {{0, 0, 0}, {0, 0x00}, {0x79}}}, {dCcD_SE_NONE, 0, 0, 0, 0}, {dCcD_SE_NONE, 0, 0, 0, 0}, {0}, }; -daObj_YBag_HIOParam const daObj_YBag_Param_c::m = { +DUSK_GAME_DATA daObj_YBag_HIOParam const daObj_YBag_Param_c::m = { 0.0f, -4.0f, 1.0f, 400.0f, 255.0f, 10.0f, 4.0f, 10.0f, 41.0f, 32.0f, 3.0f, }; @@ -534,7 +534,7 @@ static int daObj_YBag_IsDelete(void* i_this) { return 1; } -static actor_method_class daObj_YBag_MethodTable = { +static DUSK_CONST actor_method_class daObj_YBag_MethodTable = { (process_method_func)daObj_YBag_Create, (process_method_func)daObj_YBag_Delete, (process_method_func)daObj_YBag_Execute, @@ -542,7 +542,7 @@ static actor_method_class daObj_YBag_MethodTable = { (process_method_func)daObj_YBag_Draw, }; -actor_process_profile_definition g_profile_OBJ_YBAG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_YBAG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_yobikusa.cpp b/src/d/actor/d_a_obj_yobikusa.cpp index a880f28a45..32e9ba4145 100644 --- a/src/d/actor/d_a_obj_yobikusa.cpp +++ b/src/d/actor/d_a_obj_yobikusa.cpp @@ -16,7 +16,7 @@ static const char* l_arcName1 = "J_Tobi"; static const char* l_arcName2 = "J_Umak"; -daObjYobikusa_c::actionFuncEntry daObjYobikusa_c::ActionTable[] = { +DUSK_GAME_DATA daObjYobikusa_c::actionFuncEntry daObjYobikusa_c::ActionTable[] = { {&daObjYobikusa_c::initSwingWind, &daObjYobikusa_c::executeSwingWind}, {&daObjYobikusa_c::initPushDown, &daObjYobikusa_c::executePushDown}, {&daObjYobikusa_c::initPickLeaf, &daObjYobikusa_c::executePickLeaf}, @@ -39,7 +39,7 @@ void daObjYobikusa_c::initSwingWind() { mMode = MODE_SWING_WIND; } -daObjYobikusa_c::attributes const daObjYobikusa_c::M_attr = { +DUSK_GAME_DATA daObjYobikusa_c::attributes const daObjYobikusa_c::M_attr = { 1000.0f, 4000.0f, 0.0f, 1500.0f, 500.0f, 1152.0f, 512.0f, 200.0f, 400.0f, 0.02f, 0.0f, 0.0f, 5000.0f, 150.0f, 1024, 64, 10000, 6582}; @@ -263,8 +263,8 @@ bool daObjYobikusa_c::setNewLeaf() { } int daObjYobikusa_c::createHeap() { - char* res_name1; - char* res_name2; + DUSK_CONST char* res_name1; + DUSK_CONST char* res_name2; J3DModelData* model_data1; J3DModelData* model_data2; @@ -412,13 +412,13 @@ static int daObjYobikusa_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjYobikusa_Method = { +static DUSK_CONST actor_method_class l_daObjYobikusa_Method = { (process_method_func)daObjYobikusa_Create, (process_method_func)daObjYobikusa_Delete, (process_method_func)daObjYobikusa_Execute, (process_method_func)daObjYobikusa_IsDelete, (process_method_func)daObjYobikusa_Draw, }; -actor_process_profile_definition g_profile_Obj_Yobikusa = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Yobikusa = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_yousei.cpp b/src/d/actor/d_a_obj_yousei.cpp index 7bd087157a..63f826483a 100644 --- a/src/d/actor/d_a_obj_yousei.cpp +++ b/src/d/actor/d_a_obj_yousei.cpp @@ -851,7 +851,7 @@ static int daObjYOUSEI_IsDelete(daObjYOUSEI_c* i_this) { return 1; } -static actor_method_class l_daObjYOUSEI_Method = { +static DUSK_CONST actor_method_class l_daObjYOUSEI_Method = { (process_method_func)daObjYOUSEI_Create, (process_method_func)daObjYOUSEI_Delete, (process_method_func)daObjYOUSEI_Execute, @@ -859,7 +859,7 @@ static actor_method_class l_daObjYOUSEI_Method = { (process_method_func)daObjYOUSEI_Draw, }; -actor_process_profile_definition g_profile_Obj_Yousei = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_Yousei = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_ystone.cpp b/src/d/actor/d_a_obj_ystone.cpp index 50f751d987..6484c31cff 100644 --- a/src/d/actor/d_a_obj_ystone.cpp +++ b/src/d/actor/d_a_obj_ystone.cpp @@ -284,7 +284,7 @@ static cPhs_Step daObj_Ystone_Create(fopAc_ac_c* i_this) { } -static actor_method_class l_daObj_Ystone_Method = { +static DUSK_CONST actor_method_class l_daObj_Ystone_Method = { (process_method_func)daObj_Ystone_Create, (process_method_func)daObj_Ystone_Delete, (process_method_func)daObj_Ystone_Execute, @@ -292,7 +292,7 @@ static actor_method_class l_daObj_Ystone_Method = { (process_method_func)daObj_Ystone_Draw, }; -actor_process_profile_definition g_profile_OBJ_YSTONE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_YSTONE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zcloth.cpp b/src/d/actor/d_a_obj_zcloth.cpp index c2eb40be00..49580d2589 100644 --- a/src/d/actor/d_a_obj_zcloth.cpp +++ b/src/d/actor/d_a_obj_zcloth.cpp @@ -78,7 +78,7 @@ static int daObjZCloth_Create(fopAc_ac_c* i_this) { return a_this->create(); } -static actor_method_class l_daObjZCloth_Method = { +static DUSK_CONST actor_method_class l_daObjZCloth_Method = { (process_method_func)daObjZCloth_Create, (process_method_func)daObjZCloth_Delete, (process_method_func)daObjZCloth_Execute, @@ -86,7 +86,7 @@ static actor_method_class l_daObjZCloth_Method = { (process_method_func)daObjZCloth_Draw, }; -actor_process_profile_definition g_profile_Obj_ZoraCloth = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ZoraCloth = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zdoor.cpp b/src/d/actor/d_a_obj_zdoor.cpp index 5787a6f7b8..2038e49357 100644 --- a/src/d/actor/d_a_obj_zdoor.cpp +++ b/src/d/actor/d_a_obj_zdoor.cpp @@ -237,13 +237,13 @@ int daZdoor_c::Create() { return 1; } -static char* l_arcName[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[3] = { "J_Zdoor", "J_Rdoor", "J_STdoa", }; -static char* l_bmdName[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_bmdName[3] = { "J_Zdoor.bmd", "J_Rdoor.bmd", "J_STdoa.bmd", @@ -267,7 +267,7 @@ static const u16 estimateSizeTbl[2] = { 0x0D30, }; -static char* l_dzbName[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_dzbName[3] = { "J_Zdoor.dzb", "J_Rdoor.dzb", "J_STdoa.dzb", @@ -377,7 +377,7 @@ static int daZdoor_MoveBGDraw(daZdoor_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daZdoor_METHODS = { +static DUSK_CONST actor_method_class daZdoor_METHODS = { (process_method_func)daZdoor_create1st, (process_method_func)daZdoor_MoveBGDelete, (process_method_func)daZdoor_MoveBGExecute, @@ -385,7 +385,7 @@ static actor_method_class daZdoor_METHODS = { (process_method_func)daZdoor_MoveBGDraw, }; -actor_process_profile_definition g_profile_Obj_ZDoor = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ZDoor = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zrTurara.cpp b/src/d/actor/d_a_obj_zrTurara.cpp index 956508f375..93feb1a70e 100644 --- a/src/d/actor/d_a_obj_zrTurara.cpp +++ b/src/d/actor/d_a_obj_zrTurara.cpp @@ -19,7 +19,7 @@ daZrTurara_HIO_c::daZrTurara_HIO_c() { static daZrTurara_HIO_c l_HIO; -dCcD_SrcGObjInf const daZrTurara_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daZrTurara_c::mCcDObjInfo = { {0, { {0, 0, 0}, {0x20, 0x11}, @@ -30,7 +30,7 @@ dCcD_SrcGObjInf const daZrTurara_c::mCcDObjInfo = { {0} }; -dCcD_SrcCyl daZrTurara_c::mCcDCyl = { +DUSK_GAME_DATA dCcD_SrcCyl daZrTurara_c::mCcDCyl = { mCcDObjInfo, { {{0.0f, 0.0f, 0.0f}, 0.0f, 0.0f} @@ -252,7 +252,7 @@ static cPhs_Step daZrTurara_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daZrTurara_Method = { +static DUSK_CONST actor_method_class l_daZrTurara_Method = { (process_method_func)daZrTurara_Create, (process_method_func)daZrTurara_Delete, (process_method_func)daZrTurara_Execute, @@ -260,7 +260,7 @@ static actor_method_class l_daZrTurara_Method = { (process_method_func)daZrTurara_Draw, }; -actor_process_profile_definition g_profile_Obj_zrTurara = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_zrTurara = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zrTuraraRock.cpp b/src/d/actor/d_a_obj_zrTuraraRock.cpp index cf004c7339..8b3a2d6dd3 100644 --- a/src/d/actor/d_a_obj_zrTuraraRock.cpp +++ b/src/d/actor/d_a_obj_zrTuraraRock.cpp @@ -23,7 +23,7 @@ daZrTuraRc_HIO_c::daZrTuraRc_HIO_c() { field_0x1c = 5.0f; } -dCcD_SrcGObjInf const daZrTuraRc_c::mCcDObjInfo = { +DUSK_GAME_DATA dCcD_SrcGObjInf const daZrTuraRc_c::mCcDObjInfo = { {0, { {0x20, 1, 0x1F}, {0, 0}, @@ -34,7 +34,7 @@ dCcD_SrcGObjInf const daZrTuraRc_c::mCcDObjInfo = { {0} }; -dCcD_SrcSph daZrTuraRc_c::mCcDSph = { +DUSK_GAME_DATA dCcD_SrcSph daZrTuraRc_c::mCcDSph = { mCcDObjInfo, {{{0.0f, 0.0f, 0.0f}, 0.0f}} }; @@ -169,7 +169,7 @@ static cPhs_Step daZrTuraRc_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daZrTuraRc_Method = { +static DUSK_CONST actor_method_class l_daZrTuraRc_Method = { (process_method_func)daZrTuraRc_Create, (process_method_func)daZrTuraRc_Delete, (process_method_func)daZrTuraRc_Execute, @@ -177,7 +177,7 @@ static actor_method_class l_daZrTuraRc_Method = { (process_method_func)daZrTuraRc_Draw, }; -actor_process_profile_definition g_profile_Obj_zrTuraraRc = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_zrTuraraRc = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zraMark.cpp b/src/d/actor/d_a_obj_zraMark.cpp index 81332dad8c..1ff2272e3b 100644 --- a/src/d/actor/d_a_obj_zraMark.cpp +++ b/src/d/actor/d_a_obj_zraMark.cpp @@ -42,7 +42,7 @@ static const dCcD_SrcCyl l_sph_src = { static const int l_arcIdx[] = {3, 6, 5, 4}; -static char* l_arcName[1] = {"buoy"}; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName[1] = {"buoy"}; int daObjZraMark_c::Create() { fopAcM_ct(this, daObjZraMark_c); @@ -529,7 +529,7 @@ void _ZraMark_Hahen_Mng_c::draw() { } } -static actor_method_class l_daObjZraMark_Method = { +static DUSK_CONST actor_method_class l_daObjZraMark_Method = { (process_method_func)daObjZraMark_create, (process_method_func)daObjZraMark_Delete, (process_method_func)daObjZraMark_Execute, @@ -537,7 +537,7 @@ static actor_method_class l_daObjZraMark_Method = { (process_method_func)daObjZraMark_Draw, }; -actor_process_profile_definition g_profile_ZRA_MARK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ZRA_MARK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zra_freeze.cpp b/src/d/actor/d_a_obj_zra_freeze.cpp index 1525bdb572..c231fc9322 100644 --- a/src/d/actor/d_a_obj_zra_freeze.cpp +++ b/src/d/actor/d_a_obj_zra_freeze.cpp @@ -12,7 +12,7 @@ #include "d/actor/d_a_player.h" #include "f_pc/f_pc_name.h" -static char* l_arcName = "zrF"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "zrF"; static f32 const l_DATA[2] = { 800.0f, 0.0f }; @@ -80,7 +80,7 @@ cPhs_Step daZraFreeze_c::Create() { } int daZraFreeze_c::CreateHeap() { - static char* l_bmdName[3] = { + static DUSK_CONSTEXPR char DUSK_CONST* l_bmdName[3] = { "zrA_a_TW.bmd", "zrA_pain_TW.bmd", "zrA_sol_TW.bmd", @@ -191,7 +191,7 @@ static cPhs_Step daZraFreeze_create(fopAc_ac_c* i_this) { return static_cast(i_this)->Create(); } -static actor_method_class l_daZraFreeze_Method = { +static DUSK_CONST actor_method_class l_daZraFreeze_Method = { (process_method_func)daZraFreeze_create, (process_method_func)daZraFreeze_Delete, (process_method_func)daZraFreeze_Execute, @@ -199,7 +199,7 @@ static actor_method_class l_daZraFreeze_Method = { (process_method_func)daZraFreeze_Draw, }; -actor_process_profile_definition g_profile_OBJ_ZRAFREEZE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_OBJ_ZRAFREEZE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_obj_zra_rock.cpp b/src/d/actor/d_a_obj_zra_rock.cpp index df8b9333a7..d482b3d62d 100644 --- a/src/d/actor/d_a_obj_zra_rock.cpp +++ b/src/d/actor/d_a_obj_zra_rock.cpp @@ -140,7 +140,7 @@ static cPhs_Step daObjZraRock_create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daObjZraRock_Method = { +static DUSK_CONST actor_method_class l_daObjZraRock_Method = { (process_method_func)daObjZraRock_create, (process_method_func)daObjZraRock_Delete, (process_method_func)daObjZraRock_Execute, @@ -149,7 +149,7 @@ static actor_method_class l_daObjZraRock_Method = { }; -actor_process_profile_definition g_profile_Obj_ZraRock = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Obj_ZraRock = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_passer_mng.cpp b/src/d/actor/d_a_passer_mng.cpp index fe57254149..ecdcd419ba 100644 --- a/src/d/actor/d_a_passer_mng.cpp +++ b/src/d/actor/d_a_passer_mng.cpp @@ -67,7 +67,7 @@ static SizedGroup<7> const groupD = { {0x01000014, 0x21000015, 0x00000016, 0x1100000C, 0x5000000E, 0x4000000F, 0x0100000D}, }; -const daPasserMng_c::Group* daPasserMng_c::mGroupTbl[4] = { +DUSK_GAME_DATA const daPasserMng_c::Group* daPasserMng_c::mGroupTbl[4] = { (const Group*)&groupA, (const Group*)&groupB, (const Group*)&groupC, @@ -601,14 +601,14 @@ void daPasserMng_c::create_init() { } } -static actor_method_class l_daPasserMng_Method = { +static DUSK_CONST actor_method_class l_daPasserMng_Method = { (process_method_func)daPasserMng_Create, (process_method_func)daPasserMng_Delete, (process_method_func)daPasserMng_Execute, (process_method_func)daPasserMng_IsDelete, }; -actor_process_profile_definition g_profile_PASSER_MNG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_PASSER_MNG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_path_line.cpp b/src/d/actor/d_a_path_line.cpp index 23048b4e87..d356c6e22b 100644 --- a/src/d/actor/d_a_path_line.cpp +++ b/src/d/actor/d_a_path_line.cpp @@ -8,7 +8,7 @@ #include "d/actor/d_a_path_line.h" #include "f_op/f_op_actor_mng.h" -actor_process_profile_definition2 g_profile_PATH_LINE = { +DUSK_PROFILE actor_process_profile_definition2 DUSK_CONST g_profile_PATH_LINE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_peru.cpp b/src/d/actor/d_a_peru.cpp index b02c740c06..578e235601 100644 --- a/src/d/actor/d_a_peru.cpp +++ b/src/d/actor/d_a_peru.cpp @@ -9,32 +9,32 @@ #include "Z2AudioLib/Z2Instances.h" #include "d/actor/d_a_obj_catdoor.h" -static int l_bmdData[1][2] = { +static DUSK_CONSTEXPR int l_bmdData[1][2] = { 24, 1, }; -static daNpcT_evtData_c l_evtList[3] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[3] = { {"", 0}, {"PERU_APPEAR", 1}, {"PERU_APPEAR_SKIP", 1}, }; -static char* l_resNameList[2] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[2] = { "", "Peru", }; -static s8 l_loadResPtrn0[2] = { +static DUSK_CONSTEXPR s8 l_loadResPtrn0[2] = { 1, -1, }; -static s8* l_loadResPtrnList[3] = { +static DUSK_CONSTEXPR s8 DUSK_CONST* l_loadResPtrnList[3] = { l_loadResPtrn0, l_loadResPtrn0, l_loadResPtrn0, }; -static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { +static DUSK_CONSTEXPR daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {-1, 0, 0, 30, 2, 1, 1}, {10, 0, 1, 30, 2, 1, 1}, {8, 2, 1, 32, 2, 1, 0}, @@ -42,7 +42,7 @@ static daNpcT_faceMotionAnmData_c l_faceMotionAnmData[5] = { {7, 0, 1, 31, 0, 1, 0}, }; -static daNpcT_motionAnmData_c l_motionAnmData[11] = { +static DUSK_CONSTEXPR daNpcT_motionAnmData_c l_motionAnmData[11] = { {20, 2, 1, 27, 0, 1, 1, 0}, {17, 2, 1, 27, 0, 1, 1, 0}, {18, 2, 1, 27, 0, 1, 1, 0}, @@ -56,13 +56,13 @@ static daNpcT_motionAnmData_c l_motionAnmData[11] = { {11, 0, 1, 27, 0, 1, 1, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_faceMotionSequenceData[20] = { {1, -1, 1}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[40] = { +static DUSK_CONSTEXPR daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[40] = { {0, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {1, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {2, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {5, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {6, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {7, -1, 0}, {8, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, @@ -70,19 +70,19 @@ static daNpcT_MotionSeqMngr_c::sequenceStepData_c l_motionSequenceData[40] = { {3, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, {4, -1, 0}, {-1, 0, 0}, {-1, 0, 0}, {-1, 0, 0}, }; -const char* daPeru_c::mCutNameList[3] = { +DUSK_GAME_DATA const char* daPeru_c::mCutNameList[3] = { "", "PERU_APPEAR", "PERU_APPEAR_SKIP", }; -daPeru_c::cutAppearFunc daPeru_c::mCutList[3] = { +DUSK_GAME_DATA daPeru_c::cutAppearFunc daPeru_c::mCutList[3] = { NULL, &daPeru_c::cutAppear, &daPeru_c::cutAppear_skip, }; -daPeru_HIOParam const daPeru_Param_c::m = { +DUSK_GAME_DATA daPeru_HIOParam const daPeru_Param_c::m = { 60.0f, -3.0f, 1.0f, @@ -1242,7 +1242,7 @@ static int daPeru_IsDelete(void* i_this) { AUDIO_INSTANCES -static actor_method_class daPeru_MethodTable = { +static DUSK_CONST actor_method_class daPeru_MethodTable = { (process_method_func)daPeru_Create, (process_method_func)daPeru_Delete, (process_method_func)daPeru_Execute, @@ -1250,7 +1250,7 @@ static actor_method_class daPeru_MethodTable = { (process_method_func)daPeru_Draw, }; -actor_process_profile_definition g_profile_PERU = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_PERU = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_player.cpp b/src/d/actor/d_a_player.cpp index 6148d23e3a..8ab70d8907 100644 --- a/src/d/actor/d_a_player.cpp +++ b/src/d/actor/d_a_player.cpp @@ -64,11 +64,11 @@ void daPy_boomerangMove_c::initOffset(const cXyz* i_pos) { field_0x0 = 0; } -daMidna_c* daPy_py_c::m_midnaActor; +DUSK_GAME_DATA daMidna_c* daPy_py_c::m_midnaActor; -s16 daPy_boomerangMove_c::m_dropAngleY; +DUSK_GAME_DATA s16 daPy_boomerangMove_c::m_dropAngleY; -s16 daPy_boomerangMove_c::m_eventKeepFlg; +DUSK_GAME_DATA s16 daPy_boomerangMove_c::m_eventKeepFlg; int daPy_boomerangMove_c::posMove(cXyz* o_pos, s16* o_rotY, fopAc_ac_c* i_objActor, s16 i_rotStep) { daBoomerang_c* boomerang_p = daPy_py_c::getThrowBoomerangActor(); @@ -392,7 +392,10 @@ static const u8* l_sightDL_get() { #endif void daPy_sightPacket_c::draw() { + ZoneScoped; +#if !TARGET_PC TGXTexObj texObj; +#endif j3dSys.reinitGX(); GXSetNumIndStages(0); @@ -407,10 +410,24 @@ void daPy_sightPacket_c::draw() { GXSetTevColor(GX_TEVREG0, reg0); GXSetTevColor(GX_TEVREG1, reg1); +#if TARGET_PC + if (mpCachedImg != mpImg) { + mTexObj.reset(); + GXInitTexObj(&mTexObj, mpData, mpImg->width, mpImg->height, + static_cast(mpImg->format), static_cast(mpImg->wrapS), + static_cast(mpImg->wrapT), + mpImg->mipmapCount > 1 ? GX_ENABLE : GX_DISABLE); + GXInitTexObjLOD( + &mTexObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, GX_FALSE, GX_FALSE, GX_ANISO_1); + mpCachedImg = mpImg; + } + GXLoadTexObj(&mTexObj, GX_TEXMAP0); +#else GXInitTexObj(&texObj, mpData, mpImg->width, mpImg->height, (GXTexFmt)mpImg->format, (GXTexWrapMode)mpImg->wrapS, (GXTexWrapMode)mpImg->wrapT, mpImg->mipmapCount > 1 ? GX_ENABLE : GX_DISABLE); GXInitTexObjLOD(&texObj, GX_LINEAR, GX_LINEAR, 0.0, 0.0, 0.0, GX_FALSE, GX_FALSE, GX_ANISO_1); GXLoadTexObj(&texObj, GX_TEXMAP0); +#endif GXLoadPosMtxImm(mProjMtx, GX_PNMTX0); GXSetCurrentMtx(0); GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); diff --git a/src/d/actor/d_a_ppolamp.cpp b/src/d/actor/d_a_ppolamp.cpp index 829712f23a..6efc10c5ff 100644 --- a/src/d/actor/d_a_ppolamp.cpp +++ b/src/d/actor/d_a_ppolamp.cpp @@ -14,7 +14,7 @@ static int daPPolamp_c_createHeap(fopAc_ac_c* i_this) { return ((daPPolamp_c*)i_this)->createHeap(); } -static char* l_arcName = "PPolamp"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "PPolamp"; daPPolamp_c::~daPPolamp_c() { dComIfG_resDelete(this, l_arcName); @@ -174,7 +174,7 @@ static int daPPolamp_draw(daPPolamp_c* i_this) { return i_this->draw(); } -static actor_method_class daPPolamp_METHODS = { +static DUSK_CONST actor_method_class daPPolamp_METHODS = { (process_method_func)daPPolamp_create, (process_method_func)daPPolamp_Delete, (process_method_func)daPPolamp_execute, @@ -182,7 +182,7 @@ static actor_method_class daPPolamp_METHODS = { (process_method_func)daPPolamp_draw, }; -actor_process_profile_definition g_profile_PPolamp = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_PPolamp = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_scene_exit.cpp b/src/d/actor/d_a_scene_exit.cpp index ce328480d8..cf490848f2 100644 --- a/src/d/actor/d_a_scene_exit.cpp +++ b/src/d/actor/d_a_scene_exit.cpp @@ -98,13 +98,13 @@ int daScex_c::execute() { return 1; } -static actor_method_class l_daScex_Method = { +static DUSK_CONST actor_method_class l_daScex_Method = { (process_method_func)daScex_Create, NULL, (process_method_func)daScex_Execute, }; -actor_process_profile_definition2 g_profile_SCENE_EXIT = { +DUSK_PROFILE actor_process_profile_definition2 DUSK_CONST g_profile_SCENE_EXIT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 10, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_scene_exit2.cpp b/src/d/actor/d_a_scene_exit2.cpp index 5e9032d9b6..30f3819f55 100644 --- a/src/d/actor/d_a_scene_exit2.cpp +++ b/src/d/actor/d_a_scene_exit2.cpp @@ -18,9 +18,9 @@ void daScExit_c::setBaseMtx() { mDoMtx_stack_c::ZXYrotM(shape_angle); } -static char* l_arcName = "SceneExit"; +static DUSK_CONST char* l_arcName = "SceneExit"; -static char* l_evName = "SCENE_EXIT"; +static DUSK_CONST char* l_evName = "SCENE_EXIT"; int daScExit_c::Create() { mRadius = scale.x * 100.0f; @@ -90,7 +90,7 @@ void daScExit_c::actionEvent() { void daScExit_c::actionDead() {} int daScExit_c::demoProc() { - static char* action_table[3] = {"WAIT", "START", "SCENE_CHG"}; + static DUSK_CONST char* action_table[3] = {"WAIT", "START", "SCENE_CHG"}; u8 scene_id = getSceneID(); int act_id = dComIfGp_evmng_getMyActIdx(mStaffID, action_table, 3, 0, 0); @@ -166,13 +166,13 @@ static int daScExit_Create(daScExit_c* i_this) { return i_this->create(); } -static actor_method_class l_daScExit_Method = { +static DUSK_CONST actor_method_class l_daScExit_Method = { (process_method_func)daScExit_Create, (process_method_func)daScExit_Delete, (process_method_func)daScExit_Execute, (process_method_func)NULL, (process_method_func)daScExit_Draw, }; -actor_process_profile_definition g_profile_SCENE_EXIT2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SCENE_EXIT2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_set_bgobj.cpp b/src/d/actor/d_a_set_bgobj.cpp index 792f14840a..f544c2d2fc 100644 --- a/src/d/actor/d_a_set_bgobj.cpp +++ b/src/d/actor/d_a_set_bgobj.cpp @@ -26,7 +26,7 @@ int daSetBgObj_c::CreateInit() { int daSetBgObj_c::create() { fopAcM_ct(this, daSetBgObj_c); - sprintf(mArcName, "%s", getArcName(this)); + SAFE_SPRINTF(mArcName, "%s", getArcName(this)); int phase = dComIfG_resLoad(&mPhase, mArcName); if (phase == cPhs_COMPLEATE_e) { @@ -50,12 +50,12 @@ static int daSetBgObj_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daSetBgObj_Method = { +static DUSK_CONST actor_method_class l_daSetBgObj_Method = { (process_method_func)daSetBgObj_Create, (process_method_func)daSetBgObj_Delete, }; -actor_process_profile_definition g_profile_SET_BG_OBJ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SET_BG_OBJ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_shop_item.cpp b/src/d/actor/d_a_shop_item.cpp index 09f99c1ca7..e8fafd1012 100644 --- a/src/d/actor/d_a_shop_item.cpp +++ b/src/d/actor/d_a_shop_item.cpp @@ -91,7 +91,7 @@ const char* daShopItem_c::getShopArcname() { return mData[mShopItemID].get_arcName(); } -const f32 daShopItem_c::m_cullfar_max = 5000.0f; +DUSK_GAME_DATA const f32 daShopItem_c::m_cullfar_max = 5000.0f; u16 daShopItem_c::getHeapSize() { static const u16 HeapSizeTbl[] = { @@ -269,13 +269,13 @@ static int daShopItem_IsDelete(void* i_this) { return 1; } -static actor_method_class daShopItemMethodTable = { +static DUSK_CONST actor_method_class daShopItemMethodTable = { (process_method_func)daShopItem_Create, (process_method_func)daShopItem_Delete, (process_method_func)daShopItem_Execute, (process_method_func)daShopItem_IsDelete, (process_method_func)daShopItem_Draw, }; -actor_process_profile_definition g_profile_ShopItem = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_ShopItem = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_skip_2D.cpp b/src/d/actor/d_a_skip_2D.cpp index b4edbf6136..01be9ac7e7 100644 --- a/src/d/actor/d_a_skip_2D.cpp +++ b/src/d/actor/d_a_skip_2D.cpp @@ -72,13 +72,13 @@ static int daSkip2D_IsDelete(void*) { return 1; } -static actor_method_class daSkip2D_MethodTable = { +static DUSK_CONST actor_method_class daSkip2D_MethodTable = { (process_method_func)daSkip2D_Create, (process_method_func)daSkip2D_Delete, (process_method_func)daSkip2D_Execute, (process_method_func)daSkip2D_IsDelete, (process_method_func)daSkip2D_Draw, }; -actor_process_profile_definition g_profile_SKIP2D = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SKIP2D = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_spinner.cpp b/src/d/actor/d_a_spinner.cpp index b879c919b0..730f120905 100644 --- a/src/d/actor/d_a_spinner.cpp +++ b/src/d/actor/d_a_spinner.cpp @@ -933,7 +933,7 @@ static int daSpinner_Draw(daSpinner_c* i_this) { return i_this->draw(); } -static actor_method_class l_daSpinner_Method = { +static DUSK_CONST actor_method_class l_daSpinner_Method = { (process_method_func)daSpinner_Create, (process_method_func)daSpinner_Delete, (process_method_func)daSpinner_Execute, @@ -941,7 +941,7 @@ static actor_method_class l_daSpinner_Method = { (process_method_func)daSpinner_Draw, }; -actor_process_profile_definition g_profile_SPINNER = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SPINNER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_sq.cpp b/src/d/actor/d_a_sq.cpp index ee0aafa1be..8e60c6e939 100644 --- a/src/d/actor/d_a_sq.cpp +++ b/src/d/actor/d_a_sq.cpp @@ -577,7 +577,7 @@ static cPhs_Step daSq_Create(fopAc_ac_c* i_this) { return step; } -static actor_method_class l_daSq_Method = { +static DUSK_CONST actor_method_class l_daSq_Method = { (process_method_func)daSq_Create, (process_method_func)daSq_Delete, (process_method_func)daSq_Execute, @@ -585,7 +585,7 @@ static actor_method_class l_daSq_Method = { (process_method_func)daSq_Draw, }; -actor_process_profile_definition g_profile_SQ = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SQ = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_startAndGoal.cpp b/src/d/actor/d_a_startAndGoal.cpp index 53d5a3f007..3132e148f0 100644 --- a/src/d/actor/d_a_startAndGoal.cpp +++ b/src/d/actor/d_a_startAndGoal.cpp @@ -182,13 +182,13 @@ static int daStartAndGoal_create(fopAc_ac_c* i_this) { return static_cast(i_this)->Create(); } -static actor_method_class l_daStartAndGoal_Method = { +static DUSK_CONST actor_method_class l_daStartAndGoal_Method = { (process_method_func)daStartAndGoal_create, (process_method_func)daStartAndGoal_Delete, (process_method_func)daStartAndGoal_Execute, (process_method_func)daStartAndGoal_IsDelete, (process_method_func)daStartAndGoal_Draw, }; -actor_process_profile_definition g_profile_START_AND_GOAL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_START_AND_GOAL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_suspend.cpp b/src/d/actor/d_a_suspend.cpp index 25e7a3934a..ad62e80430 100644 --- a/src/d/actor/d_a_suspend.cpp +++ b/src/d/actor/d_a_suspend.cpp @@ -38,11 +38,11 @@ static int daSus_create(daSus_c* i_this) { return i_this->create(); } -static actor_method_class daSus_METHODS = { +static DUSK_CONST actor_method_class daSus_METHODS = { (process_method_func)daSus_create, NULL, NULL, NULL, NULL, }; -actor_process_profile_definition g_profile_SUSPEND = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SUSPEND = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 11, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_swBall.cpp b/src/d/actor/d_a_swBall.cpp index 02580416cb..e0d3c98594 100644 --- a/src/d/actor/d_a_swBall.cpp +++ b/src/d/actor/d_a_swBall.cpp @@ -270,13 +270,13 @@ static int daSwBall_Create(fopAc_ac_c* i_this) { return ((daSwBall_c*)i_this)->create(); } -static actor_method_class l_daSwBall_Method = { +static DUSK_CONST actor_method_class l_daSwBall_Method = { (process_method_func)daSwBall_Create, (process_method_func)daSwBall_Delete, (process_method_func)daSwBall_Execute, }; -actor_process_profile_definition g_profile_SwBall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SwBall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_swLBall.cpp b/src/d/actor/d_a_swLBall.cpp index 12fe142cef..130648ccce 100644 --- a/src/d/actor/d_a_swLBall.cpp +++ b/src/d/actor/d_a_swLBall.cpp @@ -246,7 +246,7 @@ static int daSwLBall_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daSwLBall_Method = { +static DUSK_CONST actor_method_class l_daSwLBall_Method = { (process_method_func)daSwLBall_Create, (process_method_func)daSwLBall_Delete, (process_method_func)daSwLBall_Execute, @@ -254,7 +254,7 @@ static actor_method_class l_daSwLBall_Method = { NULL, }; -actor_process_profile_definition g_profile_SwLBall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SwLBall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_swTime.cpp b/src/d/actor/d_a_swTime.cpp index 2d867109d4..2e7a6d36a5 100644 --- a/src/d/actor/d_a_swTime.cpp +++ b/src/d/actor/d_a_swTime.cpp @@ -52,13 +52,13 @@ static int daSwTime_Create(daSwTime_c* i_this) { return i_this->create(); } -static actor_method_class l_daSwTime_Method = { +static DUSK_CONST actor_method_class l_daSwTime_Method = { (process_method_func)daSwTime_Create, (process_method_func)daSwTime_Delete, (process_method_func)daSwTime_Execute }; -actor_process_profile_definition g_profile_SwTime = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SwTime = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_swc00.cpp b/src/d/actor/d_a_swc00.cpp index 0925ae0829..cb7d48d05b 100644 --- a/src/d/actor/d_a_swc00.cpp +++ b/src/d/actor/d_a_swc00.cpp @@ -324,7 +324,7 @@ static int daSwc00_Create(fopAc_ac_c* a_this) { return cPhs_COMPLEATE_e; } -static actor_method_class l_daSwc00_Method = { +static DUSK_CONST actor_method_class l_daSwc00_Method = { (process_method_func)daSwc00_Create, (process_method_func)daSwc00_Delete, (process_method_func)daSwc00_Execute, @@ -336,7 +336,7 @@ static actor_method_class l_daSwc00_Method = { #endif }; -actor_process_profile_definition g_profile_SWC00 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SWC00 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_swhit0.cpp b/src/d/actor/d_a_swhit0.cpp index 416a635c7f..2ad71589b2 100644 --- a/src/d/actor/d_a_swhit0.cpp +++ b/src/d/actor/d_a_swhit0.cpp @@ -14,7 +14,7 @@ #define COLOR_RED 2 #define COLOR_GREEN 3 -static char* l_arcName = "S_swHit00"; +static DUSK_CONST char* l_arcName = "S_swHit00"; int daSwhit0_c::getSwNo() { return fopAcM_GetParam(this) & 0xFF; @@ -196,7 +196,7 @@ void daSwhit0_c::offSwitch() { } int daSwhit0_c::DemoProc() { - static char* action_table[2] = { + static DUSK_CONST char* action_table[2] = { "WAIT", "CHANGE", }; @@ -469,7 +469,7 @@ static int daSwhit0_Create(fopAc_ac_c* i_this) { return ((daSwhit0_c*)i_this)->create(); } -static actor_method_class l_daSwhit0_Method = { +static DUSK_CONST actor_method_class l_daSwhit0_Method = { (process_method_func)daSwhit0_Create, (process_method_func)daSwhit0_Delete, (process_method_func)daSwhit0_Execute, @@ -477,7 +477,7 @@ static actor_method_class l_daSwhit0_Method = { (process_method_func)daSwhit0_Draw, }; -actor_process_profile_definition g_profile_SWHIT0 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_SWHIT0 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_CstaSw.cpp b/src/d/actor/d_a_tag_CstaSw.cpp index bd945ec07f..41584286da 100644 --- a/src/d/actor/d_a_tag_CstaSw.cpp +++ b/src/d/actor/d_a_tag_CstaSw.cpp @@ -121,13 +121,13 @@ static int daTagCstaSw_Create(fopAc_ac_c* i_this) { return cstaSw->create(); } -static actor_method_class l_daTagCstaSw_Method = { +static DUSK_CONST actor_method_class l_daTagCstaSw_Method = { (process_method_func)daTagCstaSw_Create, (process_method_func)daTagCstaSw_Delete, (process_method_func)daTagCstaSw_Execute, (process_method_func)NULL, (process_method_func)daTagCstaSw_Draw, }; -actor_process_profile_definition g_profile_Tag_CstaSw = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_CstaSw = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_Lv6Gate.cpp b/src/d/actor/d_a_tag_Lv6Gate.cpp index 8f9a282d9f..bdd78af32c 100644 --- a/src/d/actor/d_a_tag_Lv6Gate.cpp +++ b/src/d/actor/d_a_tag_Lv6Gate.cpp @@ -14,7 +14,7 @@ static f32 const l_minRelative[] = {-700.0f, -300.0f, -2000.0f}; static f32 const l_maxRelative[] = {700.0f, 0.0f, 1000.0f}; -static char* l_arcName = "Lv6Gate"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Lv6Gate"; static int createSolidHeap(fopAc_ac_c* i_this) { daTagLv6Gate_c* gate = static_cast(i_this); @@ -372,13 +372,13 @@ static int daTagLv6Gate_Delete(daTagLv6Gate_c* i_this) { return 1; } -static actor_method_class l_daTagLv6Gate_Method = { +static DUSK_CONST actor_method_class l_daTagLv6Gate_Method = { (process_method_func)daTagLv6Gate_Create, (process_method_func)daTagLv6Gate_Delete, (process_method_func)daTagLv6Gate_Execute, (process_method_func)daTagLv6Gate_IsDelete, (process_method_func)daTagLv6Gate_Draw, }; -actor_process_profile_definition g_profile_Tag_Lv6Gate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv6Gate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_Lv7Gate.cpp b/src/d/actor/d_a_tag_Lv7Gate.cpp index 4bb0fc7691..d745679513 100644 --- a/src/d/actor/d_a_tag_Lv7Gate.cpp +++ b/src/d/actor/d_a_tag_Lv7Gate.cpp @@ -10,7 +10,7 @@ #include "d/d_path.h" #include "f_pc/f_pc_name.h" -static char* l_arcName = "Lv7Gate"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Lv7Gate"; int daTagLv7Gate_c::createHeap() { // Watched City in the Sky start cutscene @@ -353,13 +353,13 @@ static int daTagLv7Gate_Delete(daTagLv7Gate_c* i_this) { return 1; } -static actor_method_class l_daTagLv7Gate_Method = { +static DUSK_CONST actor_method_class l_daTagLv7Gate_Method = { (process_method_func)daTagLv7Gate_Create, (process_method_func)daTagLv7Gate_Delete, (process_method_func)daTagLv7Gate_Execute, (process_method_func)daTagLv7Gate_IsDelete, (process_method_func)daTagLv7Gate_Draw, }; -actor_process_profile_definition g_profile_Tag_Lv7Gate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv7Gate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_Lv8Gate.cpp b/src/d/actor/d_a_tag_Lv8Gate.cpp index a2214ec750..82aac1029c 100644 --- a/src/d/actor/d_a_tag_Lv8Gate.cpp +++ b/src/d/actor/d_a_tag_Lv8Gate.cpp @@ -9,7 +9,7 @@ #include "d/actor/d_a_obj_mirror_table.h" #include -static char* l_arcName = "Lv8Gate"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "Lv8Gate"; static int createSolidHeap(fopAc_ac_c* i_this) { daTagLv8Gate_c* gate = static_cast(i_this); @@ -228,13 +228,13 @@ static int daTagLv8Gate_Delete(daTagLv8Gate_c* i_this) { return TRUE; } -static actor_method_class l_daTagLv8Gate_Method = { +static DUSK_CONST actor_method_class l_daTagLv8Gate_Method = { (process_method_func)daTagLv8Gate_Create, (process_method_func)daTagLv8Gate_Delete, (process_method_func)daTagLv8Gate_Execute, (process_method_func)daTagLv8Gate_IsDelete, (process_method_func)daTagLv8Gate_Draw, }; -actor_process_profile_definition g_profile_Tag_Lv8Gate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv8Gate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_TWgate.cpp b/src/d/actor/d_a_tag_TWgate.cpp index 8eba989b7e..642eab8a23 100644 --- a/src/d/actor/d_a_tag_TWgate.cpp +++ b/src/d/actor/d_a_tag_TWgate.cpp @@ -13,18 +13,18 @@ #include "f_op/f_op_actor_mng.h" struct daTagTWGate_zevParam { - /* 0x00 */ char* mArcName; - /* 0x04 */ char* mEventName; - /* 0x08 */ char* mTalkEventName; - /* 0x0C */ char* mInEventName; + /* 0x00 */ DUSK_CONST char* mArcName; + /* 0x04 */ DUSK_CONST char* mEventName; + /* 0x08 */ DUSK_CONST char* mTalkEventName; + /* 0x0C */ DUSK_CONST char* mInEventName; /* 0x10 */ int mLv; - /* 0x14 */ char* mStage; + /* 0x14 */ DUSK_CONST char* mStage; /* 0x18 */ s16 mPoint; /* 0x1A */ s8 mRoomNo; /* 0x1B */ s8 mLayer; }; -daTagTWGate_Attr_c const daTagTWGate_c::mAttr = {}; +DUSK_GAME_DATA daTagTWGate_Attr_c const daTagTWGate_c::mAttr = {}; #if DEBUG daTagTWGate_Hio_c daTagTWGate_c::mHio; @@ -77,9 +77,9 @@ static daTagTWGate_zevParam const l_zevParamTbl[4] = { }, }; -static const char* l_myName = "Gate"; +static DUSK_CONSTEXPR const char* l_myName = "Gate"; -const actionFunc daTagTWGate_c::ActionTable[][2] = { +DUSK_GAME_DATA const actionFunc daTagTWGate_c::ActionTable[][2] = { {&daTagTWGate_c::initWait, &daTagTWGate_c::executeWait}, {&daTagTWGate_c::initDemoFilone1, &daTagTWGate_c::executeDemoFilone1}, {&daTagTWGate_c::initDemoFilone2, &daTagTWGate_c::executeDemoFilone2}, @@ -1170,13 +1170,13 @@ static int daTagTWGate_IsDelete(daTagTWGate_c* i_this) { return 1; } -static actor_method_class l_daTagTWGate_Method = { +static DUSK_CONST actor_method_class l_daTagTWGate_Method = { (process_method_func)daTagTWGate_Create, (process_method_func)daTagTWGate_Delete, (process_method_func)daTagTWGate_Execute, (process_method_func)daTagTWGate_IsDelete, (process_method_func)daTagTWGate_Draw, }; -actor_process_profile_definition g_profile_Tag_TWGate = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_TWGate = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_ajnot.cpp b/src/d/actor/d_a_tag_ajnot.cpp index 6634e7c334..c3da04b053 100644 --- a/src/d/actor/d_a_tag_ajnot.cpp +++ b/src/d/actor/d_a_tag_ajnot.cpp @@ -59,13 +59,13 @@ static int daTagAJnot_Draw(daTagAJnot_c* i_this) { return 1; } -static actor_method_class l_daTagAJnot_Method = { +static DUSK_CONST actor_method_class l_daTagAJnot_Method = { (process_method_func)daTagAJnot_Create, (process_method_func)daTagAJnot_Delete, (process_method_func)daTagAJnot_Execute, (process_method_func)NULL, (process_method_func)daTagAJnot_Draw, }; -actor_process_profile_definition g_profile_Tag_AJnot = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_AJnot = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_allmato.cpp b/src/d/actor/d_a_tag_allmato.cpp index c9414bf755..4ab2f1765a 100644 --- a/src/d/actor/d_a_tag_allmato.cpp +++ b/src/d/actor/d_a_tag_allmato.cpp @@ -8,7 +8,7 @@ #include "f_op/f_op_camera_mng.h" #include -static daNpcT_evtData_c l_evtList[8] = { +static DUSK_CONSTEXPR daNpcT_evtData_c l_evtList[8] = { {"", 0}, {"FOCUS_BOUMATO", 2}, {"FOCUS_ITAMATO", 2}, @@ -28,7 +28,7 @@ static daNpcT_evtData_c l_evtList[8] = { #define EVT_HIT_BOUMATO3 6 #define EVT_NEARPIN_BOUMATO 7 -static char* l_resNameList[3] = { +static DUSK_CONSTEXPR char DUSK_CONST* l_resNameList[3] = { "", "Taro1", "Taro2", @@ -584,7 +584,7 @@ static int daTag_AllMato_IsDelete(void* i_this) { return 1; } -static actor_method_class daTag_AllMato_MethodTable = { +static DUSK_CONST actor_method_class daTag_AllMato_MethodTable = { (process_method_func)daTag_AllMato_Create, (process_method_func)daTag_AllMato_Delete, (process_method_func)daTag_AllMato_Execute, @@ -592,7 +592,7 @@ static actor_method_class daTag_AllMato_MethodTable = { (process_method_func)daTag_AllMato_Draw }; -actor_process_profile_definition g_profile_TAG_ALLMATO = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_ALLMATO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 10, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_arena.cpp b/src/d/actor/d_a_tag_arena.cpp index f8eaef153c..878948c084 100644 --- a/src/d/actor/d_a_tag_arena.cpp +++ b/src/d/actor/d_a_tag_arena.cpp @@ -19,12 +19,12 @@ static int daTagArena_Delete(daTagArena_c* i_this) { return 1; } -static actor_method_class l_daTagArena_Method = { +static DUSK_CONST actor_method_class l_daTagArena_Method = { (process_method_func)daTagArena_Create, (process_method_func)daTagArena_Delete, }; -actor_process_profile_definition g_profile_Tag_Arena = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Arena = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_assistance.cpp b/src/d/actor/d_a_tag_assistance.cpp index a78a43f264..d95de3bd01 100644 --- a/src/d/actor/d_a_tag_assistance.cpp +++ b/src/d/actor/d_a_tag_assistance.cpp @@ -45,14 +45,14 @@ static int daTagAssist_Delete(daTagAssist_c* i_this) { return 1; } -static actor_method_class l_daTagAssist_Method = { +static DUSK_CONST actor_method_class l_daTagAssist_Method = { (process_method_func)daTagAssist_Create, (process_method_func)daTagAssist_Delete, (process_method_func)daTagAssist_Execute, (process_method_func)daTagAssist_IsDelete }; -actor_process_profile_definition g_profile_Tag_Assist = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Assist = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_attack_item.cpp b/src/d/actor/d_a_tag_attack_item.cpp index 3c61256e3b..c98d268ad1 100644 --- a/src/d/actor/d_a_tag_attack_item.cpp +++ b/src/d/actor/d_a_tag_attack_item.cpp @@ -195,7 +195,7 @@ static int daTagAtkItem_Create(daTagAtkItem_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagAtkItem_Method = { +static DUSK_CONST actor_method_class l_daTagAtkItem_Method = { (process_method_func)daTagAtkItem_Create, (process_method_func)daTagAtkItem_Delete, (process_method_func)daTagAtkItem_Execute, @@ -207,7 +207,7 @@ static actor_method_class l_daTagAtkItem_Method = { #endif }; -actor_process_profile_definition g_profile_Tag_AttackItem = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_AttackItem = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_attention.cpp b/src/d/actor/d_a_tag_attention.cpp index a0b8bf0339..702193ec65 100644 --- a/src/d/actor/d_a_tag_attention.cpp +++ b/src/d/actor/d_a_tag_attention.cpp @@ -283,13 +283,13 @@ static int daAttp_Create(fopAc_ac_c* i_this) { return attp->create(); } -static actor_method_class l_daAttp_Method = { +static DUSK_CONST actor_method_class l_daAttp_Method = { (process_method_func)daAttp_Create, (process_method_func)daAttp_Delete, (process_method_func)daAttp_Execute, (process_method_func)NULL, (process_method_func)daAttp_Draw, }; -actor_process_profile_definition g_profile_Tag_Attp = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Attp = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_bottle_item.cpp b/src/d/actor/d_a_tag_bottle_item.cpp index 1cfd2447a8..c30dacdee1 100644 --- a/src/d/actor/d_a_tag_bottle_item.cpp +++ b/src/d/actor/d_a_tag_bottle_item.cpp @@ -183,7 +183,7 @@ static int daTag_BottleItem_IsDelete(void* i_this) { daTag_BottleItem_c::~daTag_BottleItem_c() {} -static actor_method_class daTag_BottleItem_MethodTable = { +static DUSK_CONST actor_method_class daTag_BottleItem_MethodTable = { (process_method_func)daTag_BottleItem_Create, (process_method_func)daTag_BottleItem_Delete, (process_method_func)daTag_BottleItem_Execute, @@ -191,7 +191,7 @@ static actor_method_class daTag_BottleItem_MethodTable = { (process_method_func)daTag_BottleItem_Draw }; -actor_process_profile_definition g_profile_TAG_BTLITM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_BTLITM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_camera.cpp b/src/d/actor/d_a_tag_camera.cpp index ce5a929c9c..e83a067ebe 100644 --- a/src/d/actor/d_a_tag_camera.cpp +++ b/src/d/actor/d_a_tag_camera.cpp @@ -326,13 +326,13 @@ static int daTag_Cam_Create(fopAc_ac_c* i_this) { return result; } -static actor_method_class l_daTag_Cam_Method = { +static DUSK_CONST actor_method_class l_daTag_Cam_Method = { (process_method_func)daTag_Cam_Create, (process_method_func)daTag_Cam_Delete, (process_method_func)daTag_Cam_Execute, (process_method_func)daTag_Cam_IsDelete, (process_method_func)daTag_Cam_Draw, }; -actor_process_profile_definition g_profile_TAG_CAMERA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_CAMERA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_chgrestart.cpp b/src/d/actor/d_a_tag_chgrestart.cpp index 352341051e..504fe65dd7 100644 --- a/src/d/actor/d_a_tag_chgrestart.cpp +++ b/src/d/actor/d_a_tag_chgrestart.cpp @@ -175,7 +175,7 @@ static int daTagChgRestart_Draw(daTagChgRestart_c* i_this) { return i_this->draw(); } -static actor_method_class l_daTagChgRestart_Method = { +static DUSK_CONST actor_method_class l_daTagChgRestart_Method = { (process_method_func)daTagChgRestart_Create, (process_method_func)daTagChgRestart_Delete, (process_method_func)daTagChgRestart_Execute, @@ -187,7 +187,7 @@ static actor_method_class l_daTagChgRestart_Method = { #endif }; -actor_process_profile_definition g_profile_Tag_ChgRestart = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_ChgRestart = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_chkpoint.cpp b/src/d/actor/d_a_tag_chkpoint.cpp index 56df12bd53..352bb38db0 100644 --- a/src/d/actor/d_a_tag_chkpoint.cpp +++ b/src/d/actor/d_a_tag_chkpoint.cpp @@ -129,12 +129,12 @@ static int daTag_Chk_Create(fopAc_ac_c* i_this) { return result; } -static actor_method_class l_daTag_Chk_Method = { +static DUSK_CONST actor_method_class l_daTag_Chk_Method = { (process_method_func)daTag_Chk_Create, (process_method_func)daTag_Chk_Delete, (process_method_func)daTag_Chk_Execute, (process_method_func)daTag_Chk_IsDelete, (process_method_func)daTag_Chk_Draw}; -actor_process_profile_definition g_profile_TAG_CHKPOINT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_CHKPOINT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_csw.cpp b/src/d/actor/d_a_tag_csw.cpp index 106785a9c0..af5a2ef78e 100644 --- a/src/d/actor/d_a_tag_csw.cpp +++ b/src/d/actor/d_a_tag_csw.cpp @@ -541,7 +541,7 @@ static int daTagCsw_Create(fopAc_ac_c* i_this) { return csw->create(); } -static actor_method_class l_daTagCsw_Method = { +static DUSK_CONST actor_method_class l_daTagCsw_Method = { (process_method_func)daTagCsw_Create, (process_method_func)daTagCsw_Delete, (process_method_func)daTagCsw_Execute, @@ -549,7 +549,7 @@ static actor_method_class l_daTagCsw_Method = { (process_method_func)daTagCsw_Draw, }; -actor_process_profile_definition g_profile_TAG_CSW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_CSW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_escape.cpp b/src/d/actor/d_a_tag_escape.cpp index 7300968c4d..ddf14f990b 100644 --- a/src/d/actor/d_a_tag_escape.cpp +++ b/src/d/actor/d_a_tag_escape.cpp @@ -25,7 +25,7 @@ static int daTagEscape_Delete(daTagEscape_c* i_this) { return 1; } -static actor_method_class l_daTagEscape_Method = { +static DUSK_CONST actor_method_class l_daTagEscape_Method = { (process_method_func)daTagEscape_Create, (process_method_func)daTagEscape_Delete, (process_method_func)NULL, @@ -33,7 +33,7 @@ static actor_method_class l_daTagEscape_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Tag_Escape = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Escape = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_event.cpp b/src/d/actor/d_a_tag_event.cpp index adcef6c611..77783396ef 100644 --- a/src/d/actor/d_a_tag_event.cpp +++ b/src/d/actor/d_a_tag_event.cpp @@ -363,13 +363,13 @@ static int daTag_Event_Create(fopAc_ac_c* i_this) { return result; } -static actor_method_class l_daTag_Event_Method = { +static DUSK_CONST actor_method_class l_daTag_Event_Method = { (process_method_func)daTag_Event_Create, (process_method_func)daTag_Event_Delete, (process_method_func)daTag_Event_Execute, (process_method_func)daTag_Event_IsDelete, (process_method_func)daTag_Event_Draw, }; -actor_process_profile_definition g_profile_TAG_EVENT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_EVENT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_evt.cpp b/src/d/actor/d_a_tag_evt.cpp index 8dc5954ef0..780fc1d38c 100644 --- a/src/d/actor/d_a_tag_evt.cpp +++ b/src/d/actor/d_a_tag_evt.cpp @@ -8,14 +8,16 @@ #include "f_op/f_op_actor_mng.h" #include -static char* l_evtNameList[] = { +#include "helpers/string.hpp" + +static DUSK_CONST char* l_evtNameList[] = { NULL, "JUMP_DEMOSTAGE", }; -static char* l_resFileName = "TAGEVT"; +static DUSK_CONST char* l_resFileName = "TAGEVT"; -char* daTag_Evt_c::mEvtCutList[] = { +DUSK_GAME_DATA DUSK_CONST char* daTag_Evt_c::mEvtCutList[] = { "WAIT", "TALK", "NEXT", @@ -26,7 +28,7 @@ int daTag_Evt_c::create() { cPhs_Step phase = dComIfG_resLoad(&mPhase, l_resFileName); if (phase == cPhs_COMPLEATE_e) { eventInfo.setArchiveName(l_resFileName); - strcpy(field_0x568, "TagEvt"); + SAFE_STRCPY(field_0x568, "TagEvt"); getParam(); field_0x572 = -1; } @@ -236,13 +238,13 @@ static int daTag_Evt_IsDelete(void* i_this) { daTag_Evt_c::~daTag_Evt_c() {} -static actor_method_class daTag_Evt_MethodTable = { +static DUSK_CONST actor_method_class daTag_Evt_MethodTable = { (process_method_func)daTag_Evt_Create, (process_method_func)daTag_Evt_Delete, (process_method_func)daTag_Evt_Execute, (process_method_func)daTag_Evt_IsDelete, (process_method_func)daTag_Evt_Draw, }; -actor_process_profile_definition g_profile_TAG_EVT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_EVT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_evtarea.cpp b/src/d/actor/d_a_tag_evtarea.cpp index a3f403eb94..2093c0cb64 100644 --- a/src/d/actor/d_a_tag_evtarea.cpp +++ b/src/d/actor/d_a_tag_evtarea.cpp @@ -225,13 +225,13 @@ static BOOL daTag_EvtArea_IsDelete(void* i_this) { return true; } -static actor_method_class daTag_EvtArea_MethodTable = { +static DUSK_CONST actor_method_class daTag_EvtArea_MethodTable = { (process_method_func)daTag_EvtArea_Create, (process_method_func)daTag_EvtArea_Delete, (process_method_func)daTag_EvtArea_Execute, (process_method_func)daTag_EvtArea_IsDelete, (process_method_func)daTag_EvtArea_Draw, }; -actor_process_profile_definition g_profile_TAG_EVTAREA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_EVTAREA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_evtmsg.cpp b/src/d/actor/d_a_tag_evtmsg.cpp index b5e71f00e3..e106ed2006 100644 --- a/src/d/actor/d_a_tag_evtmsg.cpp +++ b/src/d/actor/d_a_tag_evtmsg.cpp @@ -17,15 +17,15 @@ enum evt_cut_e { NUM_EVT_CUTS_e, }; -char* daTag_EvtMsg_c::mEvtCutNameList[] = {"", "TALK", "WAIT"}; +DUSK_GAME_DATA DUSK_CONST char* daTag_EvtMsg_c::mEvtCutNameList[] = {"", "TALK", "WAIT"}; -EvtCutFunc daTag_EvtMsg_c::mEvtCutList[] = { +DUSK_GAME_DATA EvtCutFunc daTag_EvtMsg_c::mEvtCutList[] = { NULL, &daTag_EvtMsg_c::ECut_talk, &daTag_EvtMsg_c::ECut_wait, }; -static char* l_myName = "EvtMsg"; +static DUSK_CONST char* l_myName = "EvtMsg"; int daTag_EvtMsg_c::create() { int var_r28 = 0; @@ -238,13 +238,13 @@ static int daTag_EvtMsg_IsDelete(void* i_this) { daTag_EvtMsg_c::~daTag_EvtMsg_c() {} -static actor_method_class daTag_EvtMsg_MethodTable = { +static DUSK_CONST actor_method_class daTag_EvtMsg_MethodTable = { (process_method_func)daTag_EvtMsg_Create, (process_method_func)daTag_EvtMsg_Delete, (process_method_func)daTag_EvtMsg_Execute, (process_method_func)daTag_EvtMsg_IsDelete, (process_method_func)daTag_EvtMsg_Draw, }; -actor_process_profile_definition g_profile_TAG_EVTMSG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_EVTMSG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_firewall.cpp b/src/d/actor/d_a_tag_firewall.cpp index 34264045bb..9168899f76 100644 --- a/src/d/actor/d_a_tag_firewall.cpp +++ b/src/d/actor/d_a_tag_firewall.cpp @@ -14,15 +14,15 @@ #include "d/d_s_play.h" struct Tag_FWall_n { - static dCcD_SrcSph cc_sph_src; - static u16 game_over_eff_name[]; + static DUSK_GAME_DATA dCcD_SrcSph cc_sph_src; + static DUSK_GAME_DATA u16 game_over_eff_name[]; }; static int daTag_FWall_Draw(daTag_FWall_c* i_this) { return 1; } -dCcD_SrcSph Tag_FWall_n::cc_sph_src = { +DUSK_GAME_DATA dCcD_SrcSph Tag_FWall_n::cc_sph_src = { { {0x0, {{0x400, 0x1, 0xC}, {0x0, 0x0}, 0x0}}, // mObj {dCcD_SE_METAL, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -34,7 +34,7 @@ dCcD_SrcSph Tag_FWall_n::cc_sph_src = { } // mSphAttr }; -u16 Tag_FWall_n::game_over_eff_name[] = {0x84CC, 0x84CD, 0x84CE, 0x84CF}; +DUSK_GAME_DATA u16 Tag_FWall_n::game_over_eff_name[] = {0x84CC, 0x84CD, 0x84CE, 0x84CF}; static daTag_FWall_c* fire_leader; @@ -212,13 +212,13 @@ static int daTag_FWall_Create(daTag_FWall_c* i_this) { return i_this->create(); } -static actor_method_class l_daTag_FWall_Method = { +static DUSK_CONST actor_method_class l_daTag_FWall_Method = { (process_method_func)daTag_FWall_Create, (process_method_func)daTag_FWall_Delete, (process_method_func)daTag_FWall_Execute, (process_method_func)daTag_FWall_IsDelete, (process_method_func)daTag_FWall_Draw, }; -actor_process_profile_definition g_profile_Tag_FWall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_FWall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_gra.cpp b/src/d/actor/d_a_tag_gra.cpp index d42cfdd26e..ec690eaf70 100644 --- a/src/d/actor/d_a_tag_gra.cpp +++ b/src/d/actor/d_a_tag_gra.cpp @@ -19,12 +19,12 @@ static int daTagGra_Delete(daTagGra_c* i_this) { return 1; } -static actor_method_class l_daTagGra_Method = { +static DUSK_CONST actor_method_class l_daTagGra_Method = { (process_method_func)daTagGra_Create, (process_method_func)daTagGra_Delete }; -actor_process_profile_definition g_profile_TAG_GRA = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_GRA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_gstart.cpp b/src/d/actor/d_a_tag_gstart.cpp index d982cb1c51..14960e706a 100644 --- a/src/d/actor/d_a_tag_gstart.cpp +++ b/src/d/actor/d_a_tag_gstart.cpp @@ -55,13 +55,13 @@ static int daTagGstart_Draw(daTagGstart_c*) { return 1; } -static actor_method_class l_daTagGstart_Method = { +static DUSK_CONST actor_method_class l_daTagGstart_Method = { (process_method_func)daTagGstart_Create, (process_method_func)daTagGstart_Delete, (process_method_func)daTagGstart_Execute, (process_method_func)NULL, (process_method_func)daTagGstart_Draw, }; -actor_process_profile_definition g_profile_Tag_Gstart = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Gstart = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_guard.cpp b/src/d/actor/d_a_tag_guard.cpp index 237c873444..0a6d0ddcfd 100644 --- a/src/d/actor/d_a_tag_guard.cpp +++ b/src/d/actor/d_a_tag_guard.cpp @@ -75,12 +75,12 @@ static int daTagGuard_Delete(daTagGuard_c* i_this) { return 1; } -static actor_method_class l_daTagGuard_Method = { +static DUSK_CONST actor_method_class l_daTagGuard_Method = { (process_method_func)daTagGuard_Create, (process_method_func)daTagGuard_Delete, }; -actor_process_profile_definition g_profile_TAG_GUARD = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_GUARD = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_hinit.cpp b/src/d/actor/d_a_tag_hinit.cpp index 80f598515e..60fd5f508d 100644 --- a/src/d/actor/d_a_tag_hinit.cpp +++ b/src/d/actor/d_a_tag_hinit.cpp @@ -66,14 +66,14 @@ static int daTagHinit_Draw(daTagHinit_c*) { return 1; } -static actor_method_class l_daTagHinit_Method = { +static DUSK_CONST actor_method_class l_daTagHinit_Method = { (process_method_func)daTagHinit_Create, (process_method_func)daTagHinit_Delete, (process_method_func)daTagHinit_Execute, (process_method_func)NULL, (process_method_func)daTagHinit_Draw, }; -actor_process_profile_definition g_profile_Tag_Hinit = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Hinit = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_hjump.cpp b/src/d/actor/d_a_tag_hjump.cpp index 36613aaaee..845fa6370d 100644 --- a/src/d/actor/d_a_tag_hjump.cpp +++ b/src/d/actor/d_a_tag_hjump.cpp @@ -222,13 +222,13 @@ static int daTagHjump_Draw(daTagHjump_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class l_daTagHjump_Method = { +static DUSK_CONST actor_method_class l_daTagHjump_Method = { (process_method_func)daTagHjump_Create, (process_method_func)daTagHjump_Delete, (process_method_func)daTagHjump_Execute, (process_method_func)NULL, (process_method_func)daTagHjump_Draw, }; -actor_process_profile_definition g_profile_Tag_Hjump = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Hjump = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_howl.cpp b/src/d/actor/d_a_tag_howl.cpp index ea1e2b013e..b06aa26562 100644 --- a/src/d/actor/d_a_tag_howl.cpp +++ b/src/d/actor/d_a_tag_howl.cpp @@ -91,14 +91,14 @@ static int daTag_Howl_IsDelete(void* i_this) { return 1; } -static actor_method_class daTag_Howl_MethodTable = { +static DUSK_CONST actor_method_class daTag_Howl_MethodTable = { (process_method_func)daTag_Howl_Create, (process_method_func)daTag_Howl_Delete, (process_method_func)daTag_Howl_Execute, (process_method_func)daTag_Howl_IsDelete, (process_method_func)daTag_Howl_Draw, }; -actor_process_profile_definition g_profile_TAG_HOWL = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_HOWL = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_hstop.cpp b/src/d/actor/d_a_tag_hstop.cpp index 589fb71b29..2cb2426fca 100644 --- a/src/d/actor/d_a_tag_hstop.cpp +++ b/src/d/actor/d_a_tag_hstop.cpp @@ -102,7 +102,7 @@ void daTagHstop_c::setActive() { } } -dMsgFlow_c daTagHstop_c::m_msgFlow; +DUSK_GAME_DATA dMsgFlow_c daTagHstop_c::m_msgFlow; int daTagHstop_c::execute() { if (eventInfo.checkCommandTalk()) { @@ -199,13 +199,13 @@ static int daTagHstop_Draw(daTagHstop_c* i_this) { return 1; } -static actor_method_class l_daTagHstop_Method = { +static DUSK_CONST actor_method_class l_daTagHstop_Method = { (process_method_func)daTagHstop_Create, (process_method_func)daTagHstop_Delete, (process_method_func)daTagHstop_Execute, (process_method_func)NULL, (process_method_func)daTagHstop_Draw, }; -actor_process_profile_definition g_profile_Tag_Hstop = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Hstop = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_instruction.cpp b/src/d/actor/d_a_tag_instruction.cpp index e59488c37b..0c287d665d 100644 --- a/src/d/actor/d_a_tag_instruction.cpp +++ b/src/d/actor/d_a_tag_instruction.cpp @@ -20,7 +20,7 @@ static int daTagInst_Delete(daTagInst_c* i_this) { return 1; } -static actor_method_class l_daTagInst_Method = { +static DUSK_CONST actor_method_class l_daTagInst_Method = { (process_method_func)daTagInst_Create, (process_method_func)daTagInst_Delete, (process_method_func)NULL, @@ -28,7 +28,7 @@ static actor_method_class l_daTagInst_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Tag_Instruction = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Instruction = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_kago_fall.cpp b/src/d/actor/d_a_tag_kago_fall.cpp index 2ce69dabf9..e805f4d0a8 100644 --- a/src/d/actor/d_a_tag_kago_fall.cpp +++ b/src/d/actor/d_a_tag_kago_fall.cpp @@ -268,13 +268,13 @@ static int daTagKagoFall_Create(daTagKagoFall_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagKagoFall_Method = { +static DUSK_CONST actor_method_class l_daTagKagoFall_Method = { (process_method_func)daTagKagoFall_Create, (process_method_func)daTagKagoFall_Delete, (process_method_func)daTagKagoFall_Execute, }; -actor_process_profile_definition g_profile_Tag_KagoFall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_KagoFall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_kmsg.cpp b/src/d/actor/d_a_tag_kmsg.cpp index 760884bc3a..fb703e8d5a 100644 --- a/src/d/actor/d_a_tag_kmsg.cpp +++ b/src/d/actor/d_a_tag_kmsg.cpp @@ -7,17 +7,17 @@ #include struct EventListItem { - char* mEventName; + DUSK_CONST char* mEventName; u32 field_0x4; }; -static EventListItem l_evtList[3] = { +static DUSK_CONSTEXPR EventListItem l_evtList[3] = { {"", 0}, {"EXTINCTION", 2}, {"PURCHASE", 1}, }; -static char* l_resNameList[3] = { +static DUSK_CONST char* l_resNameList[3] = { "", "Bans1", "sekizoA", @@ -261,7 +261,7 @@ static int daTag_KMsg_IsDelete(void* param_0) { return 1; } -static actor_method_class daTag_KMsg_MethodTable = { +static DUSK_CONST actor_method_class daTag_KMsg_MethodTable = { (process_method_func)daTag_KMsg_Create, (process_method_func)daTag_KMsg_Delete, (process_method_func)daTag_KMsg_Execute, @@ -269,7 +269,7 @@ static actor_method_class daTag_KMsg_MethodTable = { (process_method_func)daTag_KMsg_Draw, }; -actor_process_profile_definition g_profile_TAG_KMSG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_KMSG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_lantern.cpp b/src/d/actor/d_a_tag_lantern.cpp index 88660a029d..861d80c66a 100644 --- a/src/d/actor/d_a_tag_lantern.cpp +++ b/src/d/actor/d_a_tag_lantern.cpp @@ -14,7 +14,7 @@ static TAG_LANTERN_HIO_CLASS l_HIO; -daTag_Lantern_HIOParam const daTag_Lantern_Param_c::m = {0}; +DUSK_GAME_DATA daTag_Lantern_HIOParam const daTag_Lantern_Param_c::m = {0}; #if DEBUG daTag_Lantern_HIO_c::daTag_Lantern_HIO_c() { @@ -165,13 +165,13 @@ static int daTag_Lantern_IsDelete(void* i_this) { return 1; } -static actor_method_class daTag_Lantern_MethodTable = { +static DUSK_CONST actor_method_class daTag_Lantern_MethodTable = { (process_method_func)daTag_Lantern_Create, (process_method_func)daTag_Lantern_Delete, (process_method_func)daTag_Lantern_Execute, (process_method_func)daTag_Lantern_IsDelete, (process_method_func)daTag_Lantern_Draw, }; -actor_process_profile_definition g_profile_TAG_LANTERN = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_LANTERN = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_lightball.cpp b/src/d/actor/d_a_tag_lightball.cpp index e6bc73ed78..6a553381f6 100644 --- a/src/d/actor/d_a_tag_lightball.cpp +++ b/src/d/actor/d_a_tag_lightball.cpp @@ -112,13 +112,13 @@ static int daTagLightBall_Create(fopAc_ac_c* i_this) { return lightBall->create(); } -static actor_method_class l_daTagLightBall_Method = { +static DUSK_CONST actor_method_class l_daTagLightBall_Method = { (process_method_func)daTagLightBall_Create, (process_method_func)daTagLightBall_Delete, (process_method_func)daTagLightBall_Execute, (process_method_func)NULL, (process_method_func)daTagLightBall_Draw, }; -actor_process_profile_definition g_profile_Tag_LightBall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_LightBall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_lv2prchk.cpp b/src/d/actor/d_a_tag_lv2prchk.cpp index dbea932afd..12df655e5e 100644 --- a/src/d/actor/d_a_tag_lv2prchk.cpp +++ b/src/d/actor/d_a_tag_lv2prchk.cpp @@ -180,7 +180,7 @@ static int daTagLv2PrChk_Create(daTagLv2PrChk_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagLv2PrChk_Method = { +static DUSK_CONST actor_method_class l_daTagLv2PrChk_Method = { (process_method_func)daTagLv2PrChk_Create, (process_method_func)daTagLv2PrChk_Delete, (process_method_func)daTagLv2PrChk_Execute, @@ -188,7 +188,7 @@ static actor_method_class l_daTagLv2PrChk_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Tag_Lv2PrChk = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv2PrChk = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_lv5soup.cpp b/src/d/actor/d_a_tag_lv5soup.cpp index 6039804791..f0f6b9fc26 100644 --- a/src/d/actor/d_a_tag_lv5soup.cpp +++ b/src/d/actor/d_a_tag_lv5soup.cpp @@ -76,13 +76,13 @@ static int daTag_Lv5Soup_IsDelete(void* i_this) { daTag_Lv5Soup_c::~daTag_Lv5Soup_c() {} -static actor_method_class daTag_Lv5Soup_MethodTable = { +static DUSK_CONST actor_method_class daTag_Lv5Soup_MethodTable = { (process_method_func)daTag_Lv5Soup_Create, (process_method_func)daTag_Lv5Soup_Delete, (process_method_func)daTag_Lv5Soup_Execute, (process_method_func)daTag_Lv5Soup_IsDelete, (process_method_func)daTag_Lv5Soup_Draw, }; -actor_process_profile_definition g_profile_TAG_LV5SOUP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_LV5SOUP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_lv6CstaSw.cpp b/src/d/actor/d_a_tag_lv6CstaSw.cpp index 843bc68294..728e877585 100644 --- a/src/d/actor/d_a_tag_lv6CstaSw.cpp +++ b/src/d/actor/d_a_tag_lv6CstaSw.cpp @@ -121,13 +121,13 @@ static int daLv6CstaSw_Create(fopAc_ac_c* i_this) { return cStaSw->create(); } -static actor_method_class l_daLv6CstaSw_Method = { +static DUSK_CONST actor_method_class l_daLv6CstaSw_Method = { (process_method_func)daLv6CstaSw_Create, (process_method_func)daLv6CstaSw_Delete, (process_method_func)daLv6CstaSw_Execute, (process_method_func)NULL, (process_method_func)daLv6CstaSw_Draw, }; -actor_process_profile_definition g_profile_Tag_Lv6CstaSw = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Lv6CstaSw = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_magne.cpp b/src/d/actor/d_a_tag_magne.cpp index ca74c0655a..7df0d78f5d 100644 --- a/src/d/actor/d_a_tag_magne.cpp +++ b/src/d/actor/d_a_tag_magne.cpp @@ -55,7 +55,7 @@ static int daTagMagne_Create(fopAc_ac_c* i_this) { return magne->create(); } -static actor_method_class l_daTagMagne_Method = { +static DUSK_CONST actor_method_class l_daTagMagne_Method = { (process_method_func)daTagMagne_Create, (process_method_func)daTagMagne_Delete, (process_method_func)NULL, @@ -63,7 +63,7 @@ static actor_method_class l_daTagMagne_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Tag_Magne = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Magne = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_mhint.cpp b/src/d/actor/d_a_tag_mhint.cpp index c1afbde4e4..c32311a41c 100644 --- a/src/d/actor/d_a_tag_mhint.cpp +++ b/src/d/actor/d_a_tag_mhint.cpp @@ -233,13 +233,13 @@ static int daTagMhint_Draw(daTagMhint_c* i_this) { return 1; } -static actor_method_class l_daTagMhint_Method = { +static DUSK_CONST actor_method_class l_daTagMhint_Method = { (process_method_func)daTagMhint_Create, (process_method_func)daTagMhint_Delete, (process_method_func)daTagMhint_Execute, (process_method_func)NULL, (process_method_func)daTagMhint_Draw, }; -actor_process_profile_definition g_profile_Tag_Mhint = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Mhint = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_mist.cpp b/src/d/actor/d_a_tag_mist.cpp index de8756a971..4683b25034 100644 --- a/src/d/actor/d_a_tag_mist.cpp +++ b/src/d/actor/d_a_tag_mist.cpp @@ -198,7 +198,7 @@ static int daTagMist_Create(fopAc_ac_c* i_this) { return mist->create(); } -static actor_method_class l_daTagMist_Method = { +static DUSK_CONST actor_method_class l_daTagMist_Method = { (process_method_func)daTagMist_Create, (process_method_func)daTagMist_Delete, (process_method_func)daTagMist_Execute, @@ -210,7 +210,7 @@ static actor_method_class l_daTagMist_Method = { #endif }; -actor_process_profile_definition g_profile_Tag_Mist = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Mist = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_mmsg.cpp b/src/d/actor/d_a_tag_mmsg.cpp index f5da6c8ab0..3c5ebfb5f7 100644 --- a/src/d/actor/d_a_tag_mmsg.cpp +++ b/src/d/actor/d_a_tag_mmsg.cpp @@ -92,13 +92,13 @@ static int daTagMmsg_Draw(daTagMmsg_c* i_this) { return 1; } -static actor_method_class l_daTagMmsg_Method = { +static DUSK_CONST actor_method_class l_daTagMmsg_Method = { (process_method_func)daTagMmsg_Create, (process_method_func)daTagMmsg_Delete, (process_method_func)daTagMmsg_Execute, (process_method_func)NULL, (process_method_func)daTagMmsg_Draw, }; -actor_process_profile_definition g_profile_Tag_Mmsg = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Mmsg = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_msg.cpp b/src/d/actor/d_a_tag_msg.cpp index 6e052f74ea..e023319a9f 100644 --- a/src/d/actor/d_a_tag_msg.cpp +++ b/src/d/actor/d_a_tag_msg.cpp @@ -11,14 +11,16 @@ #include "d/d_debug_viewer.h" #include +#include "helpers/string.hpp" + static int createHeapCallBack(fopAc_ac_c* i_this) { daTag_Msg_c* msg = (daTag_Msg_c*)i_this; return msg->createHeap(); } -static char* l_resName = "TagMsg"; +static DUSK_CONST char* l_resName = "TagMsg"; -static char* l_evtNameTBL[2] = { +static DUSK_CONST char* l_evtNameTBL[2] = { NULL, "SPEAK", }; @@ -77,7 +79,7 @@ int daTag_Msg_c::destroy() { return 1; } -const daTag_Msg_HIO_Param_c daTag_Msg_Param_c::m = {0}; +DUSK_GAME_DATA const daTag_Msg_HIO_Param_c daTag_Msg_Param_c::m = {0}; int daTag_Msg_c::execute() { bool set_event = true; @@ -198,7 +200,7 @@ BOOL daTag_Msg_c::otherCheck() { } } -char* daTag_Msg_c::getResName() { +DUSK_CONST char* daTag_Msg_c::getResName() { return l_resName; } @@ -219,10 +221,10 @@ void daTag_Msg_c::getParam() { scale.x *= 100.0f; scale.y *= 100.0f; - strcpy(mStaffName, "Tag_ms"); + SAFE_STRCPY(mStaffName, "Tag_ms"); } -char* daTag_Msg_c::mEvtCutTBL[2] = { +DUSK_GAME_DATA DUSK_CONST char* daTag_Msg_c::mEvtCutTBL[2] = { "SPEAK", "PAUSE", }; @@ -269,13 +271,13 @@ static void dummyString() { DEAD_STRING("Timer"); } -static actor_method_class daTag_Msg_MethodTable = { +static DUSK_CONST actor_method_class daTag_Msg_MethodTable = { (process_method_func)daTag_Msg_Create, (process_method_func)daTag_Msg_Delete, (process_method_func)daTag_Msg_Execute, (process_method_func)daTag_Msg_IsDelete, (process_method_func)daTag_Msg_Draw, }; -actor_process_profile_definition g_profile_TAG_MSG = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_MSG = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_mstop.cpp b/src/d/actor/d_a_tag_mstop.cpp index d3fecddebf..276c6632ab 100644 --- a/src/d/actor/d_a_tag_mstop.cpp +++ b/src/d/actor/d_a_tag_mstop.cpp @@ -168,11 +168,11 @@ static int daTagMstop_Draw(daTagMstop_c* i_this) { return 1; } -static actor_method_class l_daTagMstop_Method = { +static DUSK_CONST actor_method_class l_daTagMstop_Method = { (process_method_func)daTagMstop_Create, (process_method_func)daTagMstop_Delete, (process_method_func)daTagMstop_Execute, NULL, (process_method_func)daTagMstop_Draw}; -actor_process_profile_definition g_profile_Tag_Mstop = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Mstop = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_mwait.cpp b/src/d/actor/d_a_tag_mwait.cpp index c8ea32413b..8c3bbb761e 100644 --- a/src/d/actor/d_a_tag_mwait.cpp +++ b/src/d/actor/d_a_tag_mwait.cpp @@ -152,13 +152,13 @@ static int daTagMwait_Draw(daTagMwait_c* i_this) { return 1; } -static actor_method_class l_daTagMwait_Method = { +static DUSK_CONST actor_method_class l_daTagMwait_Method = { (process_method_func)daTagMwait_Create, (process_method_func)daTagMwait_Delete, (process_method_func)daTagMwait_Execute, (process_method_func)NULL, (process_method_func)daTagMwait_Draw, }; -actor_process_profile_definition g_profile_Tag_Mwait = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Mwait = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_myna2.cpp b/src/d/actor/d_a_tag_myna2.cpp index ec518c48ea..73f0f98115 100644 --- a/src/d/actor/d_a_tag_myna2.cpp +++ b/src/d/actor/d_a_tag_myna2.cpp @@ -66,13 +66,13 @@ static s32 daTagMyna2_Delete(daTagMyna2_c* i_this) { return 1; } -static actor_method_class l_daTagMyna2_Method = { +static DUSK_CONST actor_method_class l_daTagMyna2_Method = { (process_method_func)daTagMyna2_Create, (process_method_func)daTagMyna2_Delete, (process_method_func)daTagMyna2_Execute, }; -actor_process_profile_definition g_profile_TAG_MYNA2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_MYNA2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_myna_light.cpp b/src/d/actor/d_a_tag_myna_light.cpp index 84dd0da316..55cdf80ff3 100644 --- a/src/d/actor/d_a_tag_myna_light.cpp +++ b/src/d/actor/d_a_tag_myna_light.cpp @@ -152,13 +152,13 @@ static int daTag_MynaLight_IsDelete(void* i_this) { daTag_MynaLight_c::~daTag_MynaLight_c() {} -static actor_method_class daTag_MynaLight_MethodTable = { +static DUSK_CONST actor_method_class daTag_MynaLight_MethodTable = { (process_method_func)daTag_MynaLight_Create, (process_method_func)daTag_MynaLight_Delete, (process_method_func)daTag_MynaLight_Execute, (process_method_func)daTag_MynaLight_IsDelete, (process_method_func)daTag_MynaLight_Draw, }; -actor_process_profile_definition g_profile_TAG_MNLIGHT = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_MNLIGHT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_pachi.cpp b/src/d/actor/d_a_tag_pachi.cpp index cb7c3b3399..4718e8d33c 100644 --- a/src/d/actor/d_a_tag_pachi.cpp +++ b/src/d/actor/d_a_tag_pachi.cpp @@ -80,13 +80,13 @@ static int daTagPati_Delete(daTagPati_c* i_this) { return 1; } -static actor_method_class l_daTagPati_Method = { +static DUSK_CONST actor_method_class l_daTagPati_Method = { (process_method_func)daTagPati_Create, (process_method_func)daTagPati_Delete, (process_method_func)daTagPati_Execute, }; -actor_process_profile_definition g_profile_TAG_PATI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_PATI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_poFire.cpp b/src/d/actor/d_a_tag_poFire.cpp index a801209578..2449a37863 100644 --- a/src/d/actor/d_a_tag_poFire.cpp +++ b/src/d/actor/d_a_tag_poFire.cpp @@ -70,13 +70,13 @@ static u8 lit_3617[12]; static daTagPoFire_HIO_c l_HIO; -static actor_method_class l_daTagPoFire_Method = { +static DUSK_CONST actor_method_class l_daTagPoFire_Method = { (process_method_func)daTagPoFire_Create, (process_method_func)daTagPoFire_Delete, (process_method_func)daTagPoFire_Execute, (process_method_func)NULL, (process_method_func)daTagPoFire_Draw, }; -actor_process_profile_definition g_profile_Tag_poFire = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_poFire = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_push.cpp b/src/d/actor/d_a_tag_push.cpp index 336477613b..f6bc9f2268 100644 --- a/src/d/actor/d_a_tag_push.cpp +++ b/src/d/actor/d_a_tag_push.cpp @@ -158,13 +158,13 @@ static int daTag_Push_IsDelete(void*) { return 1; } -static actor_method_class daTag_Push_MethodTable = { +static DUSK_CONST actor_method_class daTag_Push_MethodTable = { (process_method_func)daTag_Push_Create, (process_method_func)daTag_Push_Delete, (process_method_func)daTag_Push_Execute, (process_method_func)daTag_Push_IsDelete, (process_method_func)daTag_Push_Draw, }; -actor_process_profile_definition g_profile_TAG_PUSH = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_PUSH = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 8, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_qs.cpp b/src/d/actor/d_a_tag_qs.cpp index 76a5dec8b9..92c2fb2ade 100644 --- a/src/d/actor/d_a_tag_qs.cpp +++ b/src/d/actor/d_a_tag_qs.cpp @@ -403,13 +403,13 @@ static int daTagQs_Create(fopAc_ac_c* i_this) { return qs->create(); } -static actor_method_class l_daTagQs_Method = { +static DUSK_CONST actor_method_class l_daTagQs_Method = { (process_method_func)daTagQs_Create, (process_method_func)daTagQs_Delete, (process_method_func)daTagQs_Execute, (process_method_func)daTagQs_IsDelete, (process_method_func)daTagQs_Draw, }; -actor_process_profile_definition g_profile_TAG_QS = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_QS = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_ret_room.cpp b/src/d/actor/d_a_tag_ret_room.cpp index 382476b96a..cd2b7f2b9c 100644 --- a/src/d/actor/d_a_tag_ret_room.cpp +++ b/src/d/actor/d_a_tag_ret_room.cpp @@ -157,14 +157,14 @@ static int daTagRetRm_draw(daTagRetRm_c* i_this) { return i_this->draw(); } -static actor_method_class daTagRetRm_METHODS = { +static DUSK_CONST actor_method_class daTagRetRm_METHODS = { (process_method_func)daTagRetRm_create, (process_method_func)daTagRetRm_Delete, (process_method_func)daTagRetRm_execute, (process_method_func)NULL, (process_method_func)daTagRetRm_draw, }; -actor_process_profile_definition g_profile_Tag_RetRoom = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_RetRoom = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_river_back.cpp b/src/d/actor/d_a_tag_river_back.cpp index 3a31d7f505..04a46393d7 100644 --- a/src/d/actor/d_a_tag_river_back.cpp +++ b/src/d/actor/d_a_tag_river_back.cpp @@ -8,11 +8,11 @@ #include "d/actor/d_a_tag_river_back.h" #include "f_pc/f_pc_name.h" -static char* l_arcName = "RvBack"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "RvBack"; -static char* l_evName = "RIVER_BACK"; +static DUSK_CONSTEXPR char DUSK_CONST* l_evName = "RIVER_BACK"; -static char* l_staffName = "rvback"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staffName = "rvback"; int daTagRiverBack_c::Create() { mMapToolID = -1; @@ -97,7 +97,7 @@ void daTagRiverBack_c::actionEvent() { void daTagRiverBack_c::actionDead() {} int daTagRiverBack_c::demoProc() { - static char* action_table[] = {"WAIT", "SCENE_CHG"}; + static DUSK_CONSTEXPR char DUSK_CONST* action_table[] = {"WAIT", "SCENE_CHG"}; daPy_py_c* player = daPy_getPlayerActorClass(); int act_id = dComIfGp_evmng_getMyActIdx(mStaffID, action_table, ARRAY_SIZEU(action_table), 0, 0); @@ -153,11 +153,11 @@ static int daTagRiverBack_Create(daTagRiverBack_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagRiverBack_Method = {(process_method_func)daTagRiverBack_Create, +static DUSK_CONST actor_method_class l_daTagRiverBack_Method = {(process_method_func)daTagRiverBack_Create, (process_method_func)daTagRiverBack_Delete, (process_method_func)daTagRiverBack_Execute}; -actor_process_profile_definition g_profile_Tag_RiverBack = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_RiverBack = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_rmbit_sw.cpp b/src/d/actor/d_a_tag_rmbit_sw.cpp index 43106c773d..eacb1580d5 100644 --- a/src/d/actor/d_a_tag_rmbit_sw.cpp +++ b/src/d/actor/d_a_tag_rmbit_sw.cpp @@ -196,14 +196,14 @@ static int daTagRmbitSw_draw(daTagRmbitSw_c* i_this) { return i_this->draw(); } -static actor_method_class daTagRmbitSw_METHODS = { +static DUSK_CONST actor_method_class daTagRmbitSw_METHODS = { (process_method_func)daTagRmbitSw_create, (process_method_func)daTagRmbitSw_Delete, (process_method_func)daTagRmbitSw_execute, (process_method_func)NULL, (process_method_func)daTagRmbitSw_draw, }; -actor_process_profile_definition g_profile_Tag_RmbitSw = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_RmbitSw = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_schedule.cpp b/src/d/actor/d_a_tag_schedule.cpp index b1efb05c10..9dd8f25c9f 100644 --- a/src/d/actor/d_a_tag_schedule.cpp +++ b/src/d/actor/d_a_tag_schedule.cpp @@ -19,12 +19,12 @@ static int daTagSchedule_Delete(daTagSchedule_c* i_this) { return 1; } -static actor_method_class l_daTagSchedule_Method = { +static DUSK_CONST actor_method_class l_daTagSchedule_Method = { (process_method_func)daTagSchedule_Create, (process_method_func)daTagSchedule_Delete }; -actor_process_profile_definition g_profile_Tag_Schedule = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Schedule = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_setBall.cpp b/src/d/actor/d_a_tag_setBall.cpp index bffd6bfdc8..b2e7798d5c 100644 --- a/src/d/actor/d_a_tag_setBall.cpp +++ b/src/d/actor/d_a_tag_setBall.cpp @@ -52,7 +52,7 @@ static int daTagSetBall_Create(daTagSetBall_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagSetBall_Method = { +static DUSK_CONST actor_method_class l_daTagSetBall_Method = { (process_method_func)daTagSetBall_Create, (process_method_func)daTagSetBall_Delete, (process_method_func)daTagSetBall_Execute, @@ -60,7 +60,7 @@ static actor_method_class l_daTagSetBall_Method = { (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Tag_SetBall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_SetBall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_setrestart.cpp b/src/d/actor/d_a_tag_setrestart.cpp index 4230abb920..637f1464de 100644 --- a/src/d/actor/d_a_tag_setrestart.cpp +++ b/src/d/actor/d_a_tag_setrestart.cpp @@ -173,7 +173,7 @@ static int daTagRestart_Create(fopAc_ac_c* i_this) { return restart->create(); } -static actor_method_class l_daTagRestart_Method = { +static DUSK_CONST actor_method_class l_daTagRestart_Method = { (process_method_func)daTagRestart_Create, (process_method_func)daTagRestart_Delete, (process_method_func)daTagRestart_Execute, @@ -185,7 +185,7 @@ static actor_method_class l_daTagRestart_Method = { #endif }; -actor_process_profile_definition g_profile_Tag_Restart = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Restart = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_shop_camera.cpp b/src/d/actor/d_a_tag_shop_camera.cpp index 021ac7f276..ca730b2eae 100644 --- a/src/d/actor/d_a_tag_shop_camera.cpp +++ b/src/d/actor/d_a_tag_shop_camera.cpp @@ -52,7 +52,7 @@ static int daTag_ShopCamera_IsDelete(void* param_0) { return 1; } -static actor_method_class daTag_ShopCamera_MethodTable = { +static DUSK_CONST actor_method_class daTag_ShopCamera_MethodTable = { (process_method_func)daTag_ShopCamera_Create, (process_method_func)daTag_ShopCamera_Delete, (process_method_func)daTag_ShopCamera_Execute, @@ -60,7 +60,7 @@ static actor_method_class daTag_ShopCamera_MethodTable = { (process_method_func)daTag_ShopCamera_Draw, }; -actor_process_profile_definition g_profile_TAG_SHOPCAM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_SHOPCAM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_shop_item.cpp b/src/d/actor/d_a_tag_shop_item.cpp index 302b6d1503..b76bdb3dde 100644 --- a/src/d/actor/d_a_tag_shop_item.cpp +++ b/src/d/actor/d_a_tag_shop_item.cpp @@ -178,13 +178,13 @@ static int daTag_ShopItem_IsDelete(void* i_this) { daTag_ShopItem_c::~daTag_ShopItem_c() {} -static actor_method_class daTag_ShopItem_MethodTable = { +static DUSK_CONST actor_method_class daTag_ShopItem_MethodTable = { (process_method_func)daTag_ShopItem_Create, (process_method_func)daTag_ShopItem_Delete, (process_method_func)daTag_ShopItem_Execute, (process_method_func)daTag_ShopItem_IsDelete, (process_method_func)daTag_ShopItem_Draw, }; -actor_process_profile_definition g_profile_TAG_SHOPITM = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_SHOPITM = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_smk_emt.cpp b/src/d/actor/d_a_tag_smk_emt.cpp index 262804610e..d878654760 100644 --- a/src/d/actor/d_a_tag_smk_emt.cpp +++ b/src/d/actor/d_a_tag_smk_emt.cpp @@ -76,7 +76,7 @@ static int daTagSmkEmt_draw(daTagSmkEmt_c* i_this) { return i_this->draw(); } -static actor_method_class daTagSmkEmt_METHODS = { +static DUSK_CONST actor_method_class daTagSmkEmt_METHODS = { (process_method_func)daTagSmkEmt_create, (process_method_func)daTagSmkEmt_Delete, (process_method_func)daTagSmkEmt_execute, @@ -84,7 +84,7 @@ static actor_method_class daTagSmkEmt_METHODS = { (process_method_func)daTagSmkEmt_draw }; -actor_process_profile_definition g_profile_Tag_SmkEmt = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_SmkEmt = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_spinner.cpp b/src/d/actor/d_a_tag_spinner.cpp index f4f64d6eea..c19e2b9217 100644 --- a/src/d/actor/d_a_tag_spinner.cpp +++ b/src/d/actor/d_a_tag_spinner.cpp @@ -150,7 +150,7 @@ static int daTagSpinner_Create(fopAc_ac_c* i_this) { return spinner->create(); } -static actor_method_class l_daTagSpinner_Method = { +static DUSK_CONST actor_method_class l_daTagSpinner_Method = { (process_method_func)daTagSpinner_Create, (process_method_func)daTagSpinner_Delete, (process_method_func)daTagSpinner_Execute, @@ -163,7 +163,7 @@ static actor_method_class l_daTagSpinner_Method = { }; -actor_process_profile_definition g_profile_Tag_Spinner = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Spinner = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_sppath.cpp b/src/d/actor/d_a_tag_sppath.cpp index 9fdb00fe55..2d654c256d 100644 --- a/src/d/actor/d_a_tag_sppath.cpp +++ b/src/d/actor/d_a_tag_sppath.cpp @@ -213,13 +213,13 @@ static int daTagSppath_Draw(daTagSppath_c* i_this) { return 1; } -static actor_method_class l_daTagSppath_Method = { +static DUSK_CONST actor_method_class l_daTagSppath_Method = { (process_method_func)daTagSppath_Create, (process_method_func)daTagSppath_Delete, (process_method_func)daTagSppath_Execute, (process_method_func)NULL, (process_method_func)daTagSppath_Draw, }; -actor_process_profile_definition g_profile_Tag_Sppath = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Sppath = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_spring.cpp b/src/d/actor/d_a_tag_spring.cpp index f7aa3b26ba..61f8216578 100644 --- a/src/d/actor/d_a_tag_spring.cpp +++ b/src/d/actor/d_a_tag_spring.cpp @@ -155,14 +155,14 @@ static int daTagSpring_Create(daTagSpring_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagSpring_Method = { +static DUSK_CONST actor_method_class l_daTagSpring_Method = { (process_method_func)daTagSpring_Create, (process_method_func)daTagSpring_Delete, (process_method_func)daTagSpring_Execute, (process_method_func)NULL, }; -actor_process_profile_definition g_profile_Tag_Spring = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Spring = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_ss_drink.cpp b/src/d/actor/d_a_tag_ss_drink.cpp index 8f2ee55815..b027891fb8 100644 --- a/src/d/actor/d_a_tag_ss_drink.cpp +++ b/src/d/actor/d_a_tag_ss_drink.cpp @@ -252,13 +252,13 @@ void daObj_SSBase_c::setSoldOut() { } #endif -static actor_method_class daTag_SSDrink_MethodTable = { +static DUSK_CONST actor_method_class daTag_SSDrink_MethodTable = { (process_method_func)daTag_SSDrink_Create, (process_method_func)daTag_SSDrink_Delete, (process_method_func)daTag_SSDrink_Execute, (process_method_func)daTag_SSDrink_IsDelete, (process_method_func)daTag_SSDrink_Draw, }; -actor_process_profile_definition g_profile_TAG_SSDRINK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_SSDRINK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_statue_evt.cpp b/src/d/actor/d_a_tag_statue_evt.cpp index 806d8ee3b6..8a4c0c4397 100644 --- a/src/d/actor/d_a_tag_statue_evt.cpp +++ b/src/d/actor/d_a_tag_statue_evt.cpp @@ -54,13 +54,13 @@ static const u16 l_event_bit[6] = { dSv_event_flag_c::F_0812, /* N/A - N/A */ }; -static char* l_arcName = "Obj_cs_f"; +static DUSK_CONST char* l_arcName = "Obj_cs_f"; -static u16 l_eff_id[3] = { +static DUSK_CONSTEXPR u16 l_eff_id[3] = { 0x8C7E, 0x8C7F, 0x8C84 }; -static char* l_eventName[6] = { +static DUSK_CONST char* l_eventName[6] = { "SKY_LETTERS_00", // Faron Woods "SKY_LETTERS_01", // Gerudo Desert "SKY_LETTERS_02", // Kakariko Gorge @@ -69,7 +69,7 @@ static char* l_eventName[6] = { "SKY_LETTERS_05" // Ruined Theatre }; -static char* l_evArcName[6] = { +static DUSK_CONST char* l_evArcName[6] = { NULL, // Faron Woods "cs_ev_01", // Gerudo Desert "cs_ev_02", // Kakariko Gorge @@ -78,7 +78,7 @@ static char* l_evArcName[6] = { "cs_ev_05" // Ruined Theatre }; -static cull_box l_cull_box = { +static DUSK_CONSTEXPR cull_box l_cull_box = { {-300.0f, -100.0f, -300.0f}, // Min {300.0f, 400.0f, 300.0f} // Max }; @@ -290,14 +290,14 @@ void daTagStatue_c::actionDead() { } int daTagStatue_c::demoProc() { - static char* action_table[3] = { + static DUSK_CONST char* action_table[3] = { "WAIT", "ST_MOVE", "ITEM" }; // Saved positions of Owl Statues for cutscenes - static Vec l_statue_pos[6] = { + static DUSK_CONSTEXPR Vec l_statue_pos[6] = { {-17312.3007812f, -349.100006104f, -20523.1992188f}, // Faron Woods {-17312.3007812f, -349.100006104f, -20523.1992188f}, // Gerudo Desert {-9675.59960938f, -4800.0f, 39693.8984375f}, // Kakariko Gorge @@ -307,7 +307,7 @@ int daTagStatue_c::demoProc() { }; // Saved y orientations of Owl Statues for cutscenes - static s16 l_statue_ang[6] = { + static DUSK_CONSTEXPR s16 l_statue_ang[6] = { 16384, // Faron Woods 16384, // Gerudo Desert 8485, // Kakariko Gorge @@ -529,7 +529,7 @@ static int daTagStatue_Create(daTagStatue_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagStatue_Method = { +static DUSK_CONST actor_method_class l_daTagStatue_Method = { reinterpret_cast(daTagStatue_Create), reinterpret_cast(daTagStatue_Delete), reinterpret_cast(daTagStatue_Execute), @@ -537,7 +537,7 @@ NULL, reinterpret_cast(daTagStatue_Draw), }; -actor_process_profile_definition g_profile_Tag_Statue = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Statue = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_stream.cpp b/src/d/actor/d_a_tag_stream.cpp index 40e2dad415..d1021dd0a7 100644 --- a/src/d/actor/d_a_tag_stream.cpp +++ b/src/d/actor/d_a_tag_stream.cpp @@ -132,7 +132,7 @@ static int daTagStream_Draw(daTagStream_c* i_this) { return 1; } -static actor_method_class l_daTagStream_Method = { +static DUSK_CONST actor_method_class l_daTagStream_Method = { (process_method_func)daTagStream_Create, (process_method_func)daTagStream_Delete, (process_method_func)daTagStream_Execute, @@ -140,7 +140,7 @@ static actor_method_class l_daTagStream_Method = { (process_method_func)daTagStream_Draw }; -actor_process_profile_definition g_profile_Tag_Stream = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Stream = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_telop.cpp b/src/d/actor/d_a_tag_telop.cpp index a46102cbf2..82094f90cb 100644 --- a/src/d/actor/d_a_tag_telop.cpp +++ b/src/d/actor/d_a_tag_telop.cpp @@ -63,13 +63,13 @@ static int daTag_Telop_Create(fopAc_ac_c* i_this) { return telop->create(); } -static actor_method_class l_daTag_Telop_Method = { +static DUSK_CONST actor_method_class l_daTag_Telop_Method = { (process_method_func)daTag_Telop_Create, (process_method_func)daTag_Telop_Delete, (process_method_func)daTag_Telop_Execute, (process_method_func)daTag_Telop_IsDelete, (process_method_func)daTag_Telop_Draw, }; -actor_process_profile_definition g_profile_TAG_TELOP = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_TELOP = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_theB_hint.cpp b/src/d/actor/d_a_tag_theB_hint.cpp index 58887f976e..aa8962b4a1 100644 --- a/src/d/actor/d_a_tag_theB_hint.cpp +++ b/src/d/actor/d_a_tag_theB_hint.cpp @@ -49,13 +49,13 @@ static int daTagTheBHint_Execute(daTagTheBHint_c* i_this) { return i_this->execute(); } -static actor_method_class l_daTagTheBHint_Method = { +static DUSK_CONST actor_method_class l_daTagTheBHint_Method = { (process_method_func)daTagTheBHint_Create, (process_method_func)daTagTheBHint_Delete, (process_method_func)daTagTheBHint_Execute }; -actor_process_profile_definition g_profile_Tag_TheBHint = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_TheBHint = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_wara_howl.cpp b/src/d/actor/d_a_tag_wara_howl.cpp index 1a15938c4d..a1525e99ac 100644 --- a/src/d/actor/d_a_tag_wara_howl.cpp +++ b/src/d/actor/d_a_tag_wara_howl.cpp @@ -77,13 +77,13 @@ static int daTagWrHowl_draw(daTagWrHowl_c* i_this) { return i_this->draw(); } -static actor_method_class daTagWrHowl_METHODS = { +static DUSK_CONST actor_method_class daTagWrHowl_METHODS = { (process_method_func)daTagWrHowl_create, (process_method_func)daTagWrHowl_Delete, (process_method_func)daTagWrHowl_execute, (process_method_func)NULL, (process_method_func)daTagWrHowl_draw, }; -actor_process_profile_definition g_profile_Tag_WaraHowl = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_WaraHowl = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_watchge.cpp b/src/d/actor/d_a_tag_watchge.cpp index 2b87c74d73..0e71587fb3 100644 --- a/src/d/actor/d_a_tag_watchge.cpp +++ b/src/d/actor/d_a_tag_watchge.cpp @@ -86,7 +86,7 @@ static int daTagWatchGe_Create(daTagWatchGe_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagWatchGe_Method = { +static DUSK_CONST actor_method_class l_daTagWatchGe_Method = { (process_method_func)daTagWatchGe_Create, (process_method_func)daTagWatchGe_Delete, (process_method_func)daTagWatchGe_Execute, @@ -94,7 +94,7 @@ static actor_method_class l_daTagWatchGe_Method = { (process_method_func)daTagWatchGe_Draw }; -actor_process_profile_definition g_profile_Tag_WatchGe = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_WatchGe = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_waterfall.cpp b/src/d/actor/d_a_tag_waterfall.cpp index 6fac4d4d00..ce57b0d23e 100644 --- a/src/d/actor/d_a_tag_waterfall.cpp +++ b/src/d/actor/d_a_tag_waterfall.cpp @@ -328,13 +328,13 @@ static int daTagWaterFall_Create(daTagWaterFall_c* i_this) { return i_this->create(); } -static actor_method_class l_daTagWaterFall_Method = { +static DUSK_CONST actor_method_class l_daTagWaterFall_Method = { (process_method_func)daTagWaterFall_Create, (process_method_func)daTagWaterFall_Delete, (process_method_func)daTagWaterFall_Execute, (process_method_func)daTagWaterFall_IsDelete, (process_method_func)daTagWaterFall_Draw, }; -actor_process_profile_definition g_profile_Tag_WaterFall = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_WaterFall = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_wljump.cpp b/src/d/actor/d_a_tag_wljump.cpp index 9c09a8ad71..ac8487f966 100644 --- a/src/d/actor/d_a_tag_wljump.cpp +++ b/src/d/actor/d_a_tag_wljump.cpp @@ -232,7 +232,7 @@ static int daTagWljump_Draw(daTagWljump_c* i_this) { return i_this->draw(); } -static actor_method_class l_daTagWljump_Method = { +static DUSK_CONST actor_method_class l_daTagWljump_Method = { (process_method_func)daTagWljump_Create, (process_method_func)daTagWljump_Delete, (process_method_func)daTagWljump_Execute, @@ -240,7 +240,7 @@ static actor_method_class l_daTagWljump_Method = { (process_method_func)daTagWljump_Draw, }; -actor_process_profile_definition g_profile_Tag_Wljump = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Tag_Wljump = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tag_yami.cpp b/src/d/actor/d_a_tag_yami.cpp index 19467a0e25..0367d1a447 100644 --- a/src/d/actor/d_a_tag_yami.cpp +++ b/src/d/actor/d_a_tag_yami.cpp @@ -125,13 +125,13 @@ int daTagYami_Delete(daTagYami_c* i_this) { return 1; } -static actor_method_class l_daTagYami_Method = { +static DUSK_CONST actor_method_class l_daTagYami_Method = { (process_method_func)daTagYami_Create, (process_method_func)daTagYami_Delete, (process_method_func)daTagYami_Execute, }; -actor_process_profile_definition g_profile_TAG_YAMI = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TAG_YAMI = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 3, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_talk.cpp b/src/d/actor/d_a_talk.cpp index 849dea194a..67e4bb0a0e 100644 --- a/src/d/actor/d_a_talk.cpp +++ b/src/d/actor/d_a_talk.cpp @@ -100,13 +100,13 @@ static int daTalk_Draw(daTalk_c* i_this) { return i_this->draw(); } -static actor_method_class l_daTalk_Method = { +static DUSK_CONST actor_method_class l_daTalk_Method = { (process_method_func)daTalk_Create, (process_method_func)daTalk_Delete, (process_method_func)daTalk_Execute, (process_method_func)NULL, (process_method_func)daTalk_Draw, }; -actor_process_profile_definition g_profile_TALK = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TALK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tbox.cpp b/src/d/actor/d_a_tbox.cpp index 6cad41b4e3..1d1826b7e7 100644 --- a/src/d/actor/d_a_tbox.cpp +++ b/src/d/actor/d_a_tbox.cpp @@ -20,9 +20,9 @@ static const cM3dGCylS l_cyl_info[3] = { { 0.0f, 0.0f, -60.0f, 70.0f, 80.0f }, }; -static char* l_staff_name = "TREASURE"; +static DUSK_CONSTEXPR char DUSK_CONST* l_staff_name = "TREASURE"; -static dCcD_SrcCyl l_cyl_src = { +static DUSK_CONSTEXPR dCcD_SrcCyl l_cyl_src = { { {0x0, {{0x0, 0x0, 0x1e}, {0x0, 0x0}, 0x79}}, // mObj {dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt @@ -38,13 +38,13 @@ static dCcD_SrcCyl l_cyl_src = { } }; -static daTbox_ModelInfo l_modelInfo[3] = { +static DUSK_CONSTEXPR daTbox_ModelInfo l_modelInfo[3] = { { "Dalways", 12, 7, 25, 26, 14, 19 }, { "Dalways", 13, 8, 27, 28, 14, 19 }, { "BoxC", 14, 8, 20, 21, 11, 17 }, }; -static cXyz l_light_offset(0.0f, 35.0f, 0.0f); +static DUSK_CONSTEXPR cXyz l_light_offset(0.0f, 35.0f, 0.0f); class daTbox_HIO_c : public mDoHIO_entry_c { public: @@ -96,14 +96,14 @@ daTbox_HIO_c::daTbox_HIO_c() { mForPlacementCheck = 0; } -daTbox_ModelInfo* daTbox_c::getModelInfo() { +DUSK_CONST daTbox_ModelInfo* daTbox_c::getModelInfo() { return &l_modelInfo[getShapeType()]; } static const u32 l_open_se_id[3] = { Z2SE_OBJ_TBOX_OPEN_A, Z2SE_OBJ_TBOX_OPEN_B, Z2SE_OBJ_TBOX_OPEN_C }; cPhs_Step daTbox_c::commonShapeSet() { - daTbox_ModelInfo* model_info = getModelInfo(); + DUSK_CONST daTbox_ModelInfo* model_info = getModelInfo(); J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(model_info->mArcName, model_info->mModelResNo); JUT_ASSERT(0x191, modelData != NULL); @@ -180,7 +180,7 @@ cPhs_Step daTbox_c::envShapeSet() { } cPhs_Step daTbox_c::bgCheckSet() { - daTbox_ModelInfo* model_info = getModelInfo(); + DUSK_CONST daTbox_ModelInfo* model_info = getModelInfo(); cBgD_t* bgd = (cBgD_t*)dComIfG_getObjectRes(model_info->mArcName, model_info->mOpenDzbResNo); JUT_ASSERT(528, bgd != NULL); @@ -845,7 +845,7 @@ void daTbox_c::demoProcAppear() { } int daTbox_c::demoProc() { - static char* action_table[] = {"WAIT", "OPEN", "APPEAR", "OPEN_SHORT", "DROP"}; + static DUSK_CONSTEXPR char DUSK_CONST* action_table[] = {"WAIT", "OPEN", "APPEAR", "OPEN_SHORT", "DROP"}; int act_idx = dComIfGp_evmng_getMyActIdx(mStaffId, action_table, ARRAY_SIZEU(action_table), 0, 0); int tbox_no; @@ -1796,7 +1796,7 @@ cPhs_Step daTbox_c::create1st() { JUT_ASSERT(3544, FALSE); } - daTbox_ModelInfo* model_info = getModelInfo(); + DUSK_CONST daTbox_ModelInfo* model_info = getModelInfo(); cPhs_Step step = dComIfG_resLoad(&mPhase, model_info->mArcName); if (step != cPhs_COMPLEATE_e) { return step; @@ -1895,7 +1895,7 @@ static int daTbox_MoveBGDraw(daTbox_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daTbox_METHODS = { +static DUSK_CONST actor_method_class daTbox_METHODS = { (process_method_func)daTbox_create1st, (process_method_func)daTbox_MoveBGDelete, (process_method_func)daTbox_MoveBGExecute, @@ -1903,7 +1903,7 @@ static actor_method_class daTbox_METHODS = { (process_method_func)daTbox_MoveBGDraw, }; -actor_process_profile_definition g_profile_TBOX = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TBOX = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tbox2.cpp b/src/d/actor/d_a_tbox2.cpp index f2ac844bce..2f2a3a8276 100644 --- a/src/d/actor/d_a_tbox2.cpp +++ b/src/d/actor/d_a_tbox2.cpp @@ -46,9 +46,9 @@ static const cM3dGCylS l_cyl_info[] = { }, }; -static char* l_arcName = "Tbox2"; +static DUSK_CONST char* l_arcName = "Tbox2"; -static char* l_staff_name = "TREASURE"; +static DUSK_CONST char* l_staff_name = "TREASURE"; static dCcD_SrcCyl l_cyl_src = { { @@ -158,7 +158,7 @@ int daTbox2_c::create1st() { } int daTbox2_c::demoProc() { - static char* action_table[] = {"WAIT", "OPEN", "APPEAR", "OPEN_SHORT"}; + static DUSK_CONST char* action_table[] = {"WAIT", "OPEN", "APPEAR", "OPEN_SHORT"}; int act_idx = dComIfGp_evmng_getMyActIdx(mStaffIdx, action_table, ARRAY_SIZEU(action_table), 0, 0); @@ -449,13 +449,13 @@ static int daTbox2_MoveBGDraw(daTbox2_c* i_this) { return i_this->MoveBGDraw(); } -static actor_method_class daTbox2_METHODS = { +static DUSK_CONST actor_method_class daTbox2_METHODS = { (process_method_func)daTbox2_create1st, (process_method_func)daTbox2_MoveBGDelete, (process_method_func)daTbox2_MoveBGExecute, (process_method_func)NULL, (process_method_func)daTbox2_MoveBGDraw, }; -actor_process_profile_definition g_profile_TBOX2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TBOX2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 4, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_tboxSw.cpp b/src/d/actor/d_a_tboxSw.cpp index e3ab3aed8e..69b61b8168 100644 --- a/src/d/actor/d_a_tboxSw.cpp +++ b/src/d/actor/d_a_tboxSw.cpp @@ -56,13 +56,13 @@ static int daTboxSw_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daTboxSw_Method = { +static DUSK_CONST actor_method_class l_daTboxSw_Method = { (process_method_func)daTboxSw_Create, (process_method_func)daTboxSw_Delete, (process_method_func)daTboxSw_Execute, (process_method_func)NULL, (process_method_func)daTboxSw_Draw, }; -actor_process_profile_definition g_profile_TBOX_SW = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TBOX_SW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_title.cpp b/src/d/actor/d_a_title.cpp index a75a96cb2e..5ff7dad881 100644 --- a/src/d/actor/d_a_title.cpp +++ b/src/d/actor/d_a_title.cpp @@ -170,7 +170,7 @@ int daTitle_c::Execute() { } #ifdef TARGET_PC - if (!dusk::getSettings().game.enableFrameInterpolation) { + if (!dusk::frame_interp::is_enabled()) { #endif dMenu_Collect3D_c::setViewPortOffsetY(0.0f); #ifdef TARGET_PC @@ -250,7 +250,7 @@ void daTitle_c::loadWait_proc() { text[i]->setFont(mpFont); text[i]->setString(0x80, ""); - char* msg = text[i]->getStringPtr(); + TEXT_SPAN msg = text[i]->getStringPtr(); fopMsgM_messageGet(msg, 100); } @@ -354,7 +354,7 @@ void daTitle_c::fastLogoDispInit() { mProcID = 5; #ifdef TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { dusk::frame_interp::request_presentation_sync(); } #endif @@ -447,7 +447,7 @@ void dDlst_daTitle_c::draw() { Scr->draw(0.0f, 0.0f, ctx); } -static actor_method_class l_daTitle_Method = { +static DUSK_CONST actor_method_class l_daTitle_Method = { (process_method_func)daTitle_Create, (process_method_func)daTitle_Delete, (process_method_func)daTitle_Execute, @@ -455,7 +455,7 @@ static actor_method_class l_daTitle_Method = { (process_method_func)daTitle_Draw, }; -actor_process_profile_definition g_profile_TITLE = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_TITLE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_vrbox.cpp b/src/d/actor/d_a_vrbox.cpp index e1eedb10c0..ad731fb08a 100644 --- a/src/d/actor/d_a_vrbox.cpp +++ b/src/d/actor/d_a_vrbox.cpp @@ -146,13 +146,13 @@ static int daVrbox_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daVrbox_Method = { +static DUSK_CONST actor_method_class l_daVrbox_Method = { (process_method_func)daVrbox_Create, (process_method_func)daVrbox_Delete, (process_method_func)daVrbox_Execute, (process_method_func)daVrbox_IsDelete, (process_method_func)daVrbox_Draw, }; -actor_process_profile_definition g_profile_VRBOX = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_VRBOX = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_vrbox2.cpp b/src/d/actor/d_a_vrbox2.cpp index a980eeb61f..b2681bc438 100644 --- a/src/d/actor/d_a_vrbox2.cpp +++ b/src/d/actor/d_a_vrbox2.cpp @@ -451,13 +451,13 @@ static int daVrbox2_Create(fopAc_ac_c* i_this) { return phase; } -static actor_method_class l_daVrbox2_Method = { +static DUSK_CONST actor_method_class l_daVrbox2_Method = { (process_method_func)daVrbox2_Create, (process_method_func)daVrbox2_Delete, (process_method_func)daVrbox2_Execute, (process_method_func)daVrbox2_IsDelete, (process_method_func)daVrbox2_Draw, }; -actor_process_profile_definition g_profile_VRBOX2 = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_VRBOX2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_warp_bug.cpp b/src/d/actor/d_a_warp_bug.cpp index a80953cbb5..be37c25955 100644 --- a/src/d/actor/d_a_warp_bug.cpp +++ b/src/d/actor/d_a_warp_bug.cpp @@ -12,7 +12,7 @@ void daWarpBug_c::create_init() {} -static char* l_arcName = "WarpBug"; +static DUSK_CONSTEXPR char DUSK_CONST* l_arcName = "WarpBug"; int daWarpBug_c::createHeap() { J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, "kisei.bmd"); @@ -152,13 +152,13 @@ static int daWarpBug_Create(fopAc_ac_c* i_this) { return static_cast(i_this)->create(); } -static actor_method_class l_daWarpBug_Method = { +static DUSK_CONST actor_method_class l_daWarpBug_Method = { (process_method_func)daWarpBug_Create, (process_method_func)daWarpBug_Delete, (process_method_func)daWarpBug_Execute, (process_method_func)daWarpBug_IsDelete, (process_method_func)daWarpBug_Draw, }; -actor_process_profile_definition g_profile_WarpBug = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_WarpBug = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_a_ykgr.cpp b/src/d/actor/d_a_ykgr.cpp index 980da689f5..4954bf94ce 100644 --- a/src/d/actor/d_a_ykgr.cpp +++ b/src/d/actor/d_a_ykgr.cpp @@ -282,7 +282,7 @@ static int daYkgrIsDelete(void* param_0) { return 1; } -static actor_method_class daYkgrMethodTable = { +static DUSK_CONST actor_method_class daYkgrMethodTable = { daYkgrCreate, daYkgrDelete, daYkgrExecute, @@ -290,7 +290,7 @@ static actor_method_class daYkgrMethodTable = { daYkgrDraw, }; -actor_process_profile_definition g_profile_Ykgr = { +DUSK_PROFILE actor_process_profile_definition DUSK_CONST g_profile_Ykgr = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/actor/d_flower.inc b/src/d/actor/d_flower.inc index 4b78e2950d..accaff88fa 100644 --- a/src/d/actor/d_flower.inc +++ b/src/d/actor/d_flower.inc @@ -15,6 +15,12 @@ const u16 l_J_Ohana00_64TEX__height = 63; using GameVersion = dusk::version::GameVersion; static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9060}, {GameVersion::GcnPal, 0x9060}, {GameVersion::GcnJpn, 0x9060}}, 0x800), true); return buf; } #define l_J_Ohana00_64TEX (l_J_Ohana00_64TEX_get()) + +// from d_grass.inc +static MtxP get_model_mtx(Mtx modelMtx, Mtx storage); +static void transform_positions( + const batch::LeafTemplate& tpl, const Vec* posArray, const Mtx mtx, Vec* xfPos); +static void split_batch(u32& emitted, u32 vtxCount); #else #include "assets/l_J_Ohana00_64TEX.h" #endif @@ -588,6 +594,12 @@ dFlower_packet_c::dFlower_packet_c() { GXInitTexObj(&mTexObj_l_J_Ohana01_64128_0419TEX, l_J_Ohana01_64128_0419TEX, l_J_Ohana01_64128_0419TEX__width + 1, l_J_Ohana01_64128_0419TEX__height + 1, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE ); + + batch::decode_leaf_template(l_J_hana00DL, 0x140, mTplHana00); + batch::decode_leaf_template(l_J_hana00_cDL, 0xC0, mTplHana00Cut); + batch::decode_leaf_template(l_J_hana01DL, 0x120, mTplHana01); + batch::decode_leaf_template(l_J_hana01_c_00DL, 0xC0, mTplHana01Cut00); + batch::decode_leaf_template(l_J_hana01_c_01DL, 0x120, mTplHana01Cut); #endif m_deleteRoom = &dFlower_packet_c::deleteRoom; @@ -597,7 +609,373 @@ dFlower_packet_c::dFlower_packet_c() { #endif } +#if TARGET_PC +static void batch_setup_tev(u32 lightMask) { + GXSetCullMode(GX_CULL_NONE); + + GXSetNumChans(2); + GXSetChanCtrl(GX_COLOR0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, 0, GX_DF_NONE, GX_AF_NONE); + GXSetChanCtrl(GX_COLOR1, GX_TRUE, GX_SRC_VTX, GX_SRC_REG, lightMask, GX_DF_CLAMP, GX_AF_SPOT); + + GXSetNumTevStages(3); + + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR1A1); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + + GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0); + GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_ZERO, GX_CC_CPREV, GX_CC_RASC, GX_CC_ZERO); + GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); + + GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_ZERO, GX_CC_TEXC, GX_CC_CPREV, GX_CC_C0); + GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_4, GX_TRUE, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA); + GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); +} + +static GXColor hana00_amb_color(const dFlower_data_c* flower, const dKy_tevstr_c* tevstr) { + GXColor amb = {0, 0, 0, 0xFF}; + if (DEBUG && g_kankyoHIO.navy.grass_adjust_ON != 0) { + amb.r = g_kankyoHIO.navy.grass_ambcol.r * 2; + amb.g = g_kankyoHIO.navy.grass_ambcol.g * 2; + amb.b = g_kankyoHIO.navy.grass_ambcol.b * 2; + } else { + amb.r = (flower->field_0x04 & 0x1F) * 2; + amb.g = ((flower->field_0x04 >> 5) & 0x1F) * 2; + amb.b = ((flower->field_0x04 >> 0xA) & 0x1F) * 2; + } + + if (daPy_py_c::checkNowWolfPowerUp()) { + f32 ambRate = g_env_light.bg_amb_col[0].r / 255.0f; + f32 col = (((flower->field_0x04 & 0x1F) * 2 + 0x10)); + amb.r = col * (ambRate * 4.0f); + + ambRate = g_env_light.bg_amb_col[0].g / 255.0f; + f32 col2 = (((flower->field_0x04 >> 5) & 0x1F) * 2 + 0x10); + amb.g = col2 * (4.0f * ambRate); + + ambRate = g_env_light.bg_amb_col[0].b / 255.0f; + f32 col3 = (((flower->field_0x04 >> 10) & 0x1F) * 2 + 0x10); + amb.b = col3 * (4.0f * ambRate); + } + + if (amb.r == 0x3E) { + amb.r = tevstr->AmbCol.r; + } + + if (amb.g == 0x3E) { + amb.g = tevstr->AmbCol.g; + } + + if (amb.b == 0x3E) { + amb.b = tevstr->AmbCol.b; + } + + return amb; +} + +static GXColor hana01_amb_color(int idx, const dKy_tevstr_c* tevstr) { + f32 rRate = tevstr->AmbCol.r * 0.03125f; + if (rRate > 1.0f) { + rRate = 1.0f; + } + + f32 gRate = tevstr->AmbCol.g * 0.03125f; + if (gRate > 1.0f) { + gRate = 1.0f; + } + + f32 bRate = tevstr->AmbCol.b * 0.03125f; + if (bRate > 1.0f) { + bRate = 1.0f; + } + + GXColor amb = {1, 1, 1, 1}; + + GXColor sub; + sub.r = -0.4f * tevstr->AmbCol.r * rRate; + sub.g = -0.4f * tevstr->AmbCol.g * gRate; + sub.b = -0.4f * tevstr->AmbCol.b * bRate; + + switch (idx & 7) { + case 0: + amb.r = tevstr->AmbCol.r + sub.r; + amb.g = tevstr->AmbCol.g; + amb.b = tevstr->AmbCol.b; + break; + case 1: + amb.r = tevstr->AmbCol.r; + amb.g = tevstr->AmbCol.g + sub.g; + amb.b = tevstr->AmbCol.b; + break; + case 2: + amb.r = tevstr->AmbCol.r; + amb.g = tevstr->AmbCol.g; + amb.b = tevstr->AmbCol.b + sub.b; + break; + case 3: + amb.r = tevstr->AmbCol.r + sub.r; + amb.g = tevstr->AmbCol.g + sub.g; + amb.b = tevstr->AmbCol.b; + break; + case 4: + amb.r = tevstr->AmbCol.r; + amb.g = tevstr->AmbCol.g + sub.g; + amb.b = tevstr->AmbCol.b + sub.b; + break; + case 5: + amb.r = tevstr->AmbCol.r + sub.r; + amb.g = tevstr->AmbCol.g; + amb.b = tevstr->AmbCol.b + sub.b; + break; + case 6: + amb.r = tevstr->AmbCol.r + sub.r; + amb.g = tevstr->AmbCol.g + sub.g; + amb.b = tevstr->AmbCol.b + sub.b; + break; + case 7: + break; + } + + if (daPy_py_c::checkNowWolfPowerUp()) { + f32 ambRate = g_env_light.bg_amb_col[0].r / 255.0f; + amb.r = (amb.r + 8) * (6.0f * ambRate); + + ambRate = g_env_light.bg_amb_col[0].g / 255.0f; + amb.g = (amb.g + 8) * (6.0f * ambRate); + + ambRate = g_env_light.bg_amb_col[0].b / 255.0f; + amb.b = (amb.b + 8) * (6.0f * ambRate); + } + + amb.a = 0xFF; + return amb; +} + +static void flower_emit(const batch::LeafTemplate& tpl, const Vec* xformedPos, GXColor amb) { + for (u32 i = 0; i < tpl.vtxCount; i++) { + const batch::LeafTemplate::Vtx& v = tpl.vtx[i]; + const Vec& p = xformedPos[v.pos]; + GXPosition3f32(p.x, p.y, p.z); + GXNormal1x8(v.nrm); + GXColor1x8(v.clr); + GXColor4u8(amb.r, amb.g, amb.b, amb.a); + GXTexCoord1x8(v.tex); + } +} + void dFlower_packet_c::draw() { + ZoneScoped; + dScnKy_env_light_c* kankyo = dKy_getEnvlight(); + j3dSys.reinitGX(); + + GXSetNumIndStages(0); + dKy_setLight_again(); + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_INDEX8); + GXSetVtxDesc(GX_VA_NRM, GX_INDEX8); + GXSetVtxDesc(GX_VA_CLR0, GX_INDEX8); + GXSetVtxDesc(GX_VA_TEX0, GX_INDEX8); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_CLR1, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GXSETARRAY(GX_VA_POS, &l_flowerPos, sizeof(l_flowerPos), sizeof(Vec), true); + GXSETARRAY(GX_VA_NRM, &l_flowerNormal, sizeof(l_flowerNormal), sizeof(Vec), true); + GXSETARRAY(GX_VA_CLR0, &l_flowerColor, sizeof(l_flowerColor), sizeof(GXColor), true); + GXSETARRAY(GX_VA_TEX0, &l_flowerTexCoord, sizeof(l_flowerTexCoord), 8, true); + + static GXVtxDescList vtxDescList[] = { + {GX_VA_POS, GX_DIRECT}, + {GX_VA_NRM, GX_INDEX8}, + {GX_VA_CLR0, GX_INDEX8}, + {GX_VA_CLR1, GX_DIRECT}, + {GX_VA_TEX0, GX_INDEX8}, + {GX_VA_NULL, GX_NONE}, + }; + static Vec xfPos[256]; + Mtx identity; + MTXIdentity(identity); + + // --- hana00 --- + for (int i = 0; i < 64; i++) { + dFlower_data_c* first = m_room[i].getData(); + if (first == nullptr || !dComIfGp_roomControl_checkStatusFlag(i, 0x10)) { + continue; + } + + dKy_tevstr_c* tevstr = dComIfGp_roomControl_getTevStr(i); + int lightCount = 6; + + if (dComIfGp_roomControl_getStatusRoomDt(i) != nullptr) { + lightCount = dComIfGp_roomControl_getStatusRoomDt(i)->getLightVecInfoNum(); + } + + if (dKy_SunMoon_Light_Check() && lightCount < 2) { + lightCount = 2; + } + + for (int j = 0; j < 6; j++) { + if (kankyo->field_0x0c18[j].field_0x26 == 1) { + lightCount++; + } + } + + if (lightCount <= 2) { + GXCallDisplayList(l_matLight4DL, 0x80); + } else { + GXCallDisplayList(l_matDL, 0x80); + } + + GXSetTevColorS10(GX_TEVREG0, {0, 0, 0, 0}); + dKy_Global_amb_set(tevstr); + dKy_GxFog_tevstr_set(tevstr); + dKy_setLight_nowroom_grass(tevstr->room_no, 1.0f); + + GXLoadTexObj(&mTexObj_l_J_Ohana00_64TEX, GX_TEXMAP0); + batch_setup_tev(lightCount <= 2 ? (GX_LIGHT1 | GX_LIGHT2 | GX_LIGHT3 | GX_LIGHT4) : + (GX_LIGHT1 | GX_LIGHT2 | GX_LIGHT3 | GX_LIGHT4 | + GX_LIGHT5 | GX_LIGHT6 | GX_LIGHT7)); + GXSetVtxDescv(vtxDescList); + GXLoadPosMtxImm(identity, GX_PNMTX0); + GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0); + + for (int bucket = 0; bucket < 2; bucket++) { + const bool cut = bucket != 0; + const batch::LeafTemplate& tpl = cut ? mTplHana00Cut : mTplHana00; + + bool open = false; + u32 emitted = 0; + for (dFlower_data_c* flower = first; flower != nullptr; flower = flower->mp_next) { + if (cLib_checkBit(flower->m_state, 4) || + cLib_checkBit(flower->m_state, 0x40)) + { + continue; + } + if ((cLib_checkBit(flower->m_state, 8) != 0) != cut) { + continue; + } + + if (!open) { + GXBegin(GX_TRIANGLES, GX_VTXFMT1, GX_AUTO); + open = true; + } + split_batch(emitted, tpl.vtxCount); + + Mtx interpMtx; + MtxP mtx = get_model_mtx(flower->m_modelMtx, interpMtx); + transform_positions(tpl, reinterpret_cast(l_flowerPos), mtx, xfPos); + flower_emit(tpl, xfPos, hana00_amb_color(flower, tevstr)); + } + if (open) { + GXEnd(); + } + } + } + + // --- hana01 --- + GXSETARRAY(GX_VA_POS, mp_pos, sizeof(l_flowerPos2), sizeof(Vec), true); + GXSETARRAY(GX_VA_NRM, &l_flowerNormal2, sizeof(l_flowerNormal2), sizeof(Vec), true); + GXSETARRAY(GX_VA_CLR0, mp_colors, sizeof(l_flowerColor2), sizeof(GXColor), true); + GXSETARRAY(GX_VA_TEX0, mp_texCoords, sizeof(l_flowerTexCoord2), 8, true); + + for (int i = 0; i < 64; i++) { + dFlower_data_c* first = m_room[i].getData(); + if (first == NULL) { + continue; + } + + dKy_tevstr_c* tevstr = dComIfGp_roomControl_getTevStr(i); + int lightCount = 6; + + if (dComIfGp_roomControl_getStatusRoomDt(i) != NULL) { + lightCount = dComIfGp_roomControl_getStatusRoomDt(i)->getLightVecInfoNum(); + } + +#if DEBUG + if (g_kankyoHIO.light.m_HOSTIO_setting != 0) { + lightCount = g_kankyoHIO.dungeonLight.usedLights; + } +#endif + + if (dKy_SunMoon_Light_Check() == TRUE && lightCount < 2) { + lightCount = 2; + } + + if (lightCount <= 2) { + GXCallDisplayList(mp_mat2Light4DL, m_mat2Light4DL_size); + } else { + GXCallDisplayList(mp_mat2DL, m_mat2DL_size); + } + + GXSetTevColorS10(GX_TEVREG0, {0, 0, 0, 0}); + dKy_Global_amb_set(tevstr); + dKy_GxFog_tevstr_set(tevstr); + dKy_setLight_nowroom_grass(tevstr->room_no, 1.0f); + + GXLoadTexObj(&mTexObj_l_J_Ohana01_64128_0419TEX, GX_TEXMAP0); + batch_setup_tev(lightCount <= 2 ? (GX_LIGHT1 | GX_LIGHT2 | GX_LIGHT3 | GX_LIGHT4) : + (GX_LIGHT1 | GX_LIGHT2 | GX_LIGHT3 | GX_LIGHT4 | + GX_LIGHT5 | GX_LIGHT6 | GX_LIGHT7)); + GXSetVtxDescv(vtxDescList); + GXLoadPosMtxImm(identity, GX_PNMTX0); + GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0); + + const batch::LeafTemplate* const buckets[3] = { + &mTplHana01, &mTplHana01Cut00, &mTplHana01Cut}; + for (int bucket = 0; bucket < 3; bucket++) { + const batch::LeafTemplate& tpl = *buckets[bucket]; + + bool open = false; + u32 emitted = 0; + int idx = 0; + for (dFlower_data_c* flower = first; flower != NULL; flower = flower->mp_next, idx++) { + if (cLib_checkBit(flower->m_state, 4) || + !cLib_checkBit(flower->m_state, 0x40)) + { + continue; + } + const int flowerBucket = cLib_checkBit(flower->m_state, 8) ? 2 : + cLib_checkBit(flower->m_state, 0x10) ? 1 : + 0; + if (flowerBucket != bucket) { + continue; + } + + if (!open) { + GXBegin(GX_TRIANGLES, GX_VTXFMT1, GX_AUTO); + open = true; + } + split_batch(emitted, tpl.vtxCount); + + Mtx interpMtx; + MtxP mtx = get_model_mtx(flower->m_modelMtx, interpMtx); + transform_positions(tpl, mp_pos, mtx, xfPos); + flower_emit(tpl, xfPos, hana01_amb_color(idx, tevstr)); + } + if (open) { + GXEnd(); + } + } + } + + GXSetNumTevStages(1); + GXSetNumChans(1); + J3DShape::resetVcdVatCache(); +} +#else +void dFlower_packet_c::draw() { + ZoneScoped; dScnKy_env_light_c* kankyo = dKy_getEnvlight(); j3dSys.reinitGX(); @@ -885,6 +1263,7 @@ void dFlower_packet_c::draw() { J3DShape::resetVcdVatCache(); } +#endif void dFlower_packet_c::calc() { dFlower_anm_c* anm_p = getAnm(); diff --git a/src/d/actor/d_grass.inc b/src/d/actor/d_grass.inc index 785b05c281..2e20394620 100644 --- a/src/d/actor/d_grass.inc +++ b/src/d/actor/d_grass.inc @@ -512,12 +512,368 @@ dGrass_packet_c::dGrass_packet_c() { m_Mkusa_9q_cDL_size = 0xC0; field_0x1d714 = 0; +#if TARGET_PC + batch::decode_leaf_template(mp_Mkusa_9q_DL, m_Mkusa_9q_DL_size, mTplKusa9q); + batch::decode_leaf_template(mp_Mkusa_9q_cDL, m_Mkusa_9q_cDL_size, mTplKusa9qCut); + batch::decode_leaf_template(l_M_TenGusaDL, 0xC0, mTplTengusa); +#endif + OS_REPORT("草群メモリ=%fK\n", 117.7734375f); m_deleteRoom = &dGrass_packet_c::deleteRoom; } +#if TARGET_PC +static MtxP get_model_mtx(Mtx modelMtx, Mtx storage) { + if (dusk::frame_interp::lookup_replacement(modelMtx, storage)) { + cMtx_concat(j3dSys.getViewMtx(), storage, storage); + return storage; + } + return modelMtx; +} + +static void transform_positions( + const batch::LeafTemplate& tpl, const Vec* posArray, const Mtx mtx, Vec* xfPos) { + for (u32 i = 0; i < tpl.posRefCount; i++) { + const u8 idx = tpl.posRefs[i]; + MTXMultVec(mtx, &posArray[idx], &xfPos[idx]); + } +} + +static void split_batch(u32& emitted, u32 vtxCount) { + if (emitted + vtxCount > 0xFFFF) { + GXEnd(); + GXBegin(GX_TRIANGLES, GX_VTXFMT1, GX_AUTO); + emitted = 0; + } + emitted += vtxCount; +} + +static GXColor blade_amb_color(const dGrass_data_c* blade, const dKy_tevstr_c* tevstr) { + GXColor amb; + amb.a = 0; + +#if DEBUG + if (g_kankyoHIO.navy.grass_adjust_ON) { + amb.r = g_kankyoHIO.navy.grass_ambcol.r * 2; + amb.g = g_kankyoHIO.navy.grass_ambcol.g * 2; + amb.b = g_kankyoHIO.navy.grass_ambcol.b * 2; + return amb; + } +#endif + + amb.r = (blade->m_addCol & 0x1F) * 2; + amb.g = ((blade->m_addCol >> 5) & 0x1F) * 2; + amb.b = ((blade->m_addCol >> 0xA) & 0x1F) * 2; + + if (daPy_py_c::checkNowWolfPowerUp()) { + f32 ambRate = g_env_light.bg_amb_col[0].r / 255.0f; + f32 col = (((blade->m_addCol & 0x1F) * 2 + 0x10)); + amb.r = col * (ambRate * 4.0f); + + ambRate = g_env_light.bg_amb_col[0].g / 255.0f; + f32 col2 = (((blade->m_addCol >> 5) & 0x1F) * 2 + 0x10); + amb.g = col2 * (4.0f * ambRate); + + ambRate = g_env_light.bg_amb_col[0].b / 255.0f; + f32 col3 = (((blade->m_addCol >> 10) & 0x1F) * 2 + 0x10); + amb.b = col3 * (4.0f * ambRate); + } + + f32 roomAmbScale = 1.0f - (static_cast(blade->m_pos.x) & 0xFF) * 0.001953125f; + f32 colScale = 1.1f - (static_cast(static_cast(blade->m_pos.x)) & 0xFF) / 2000.0f; + colScale -= (static_cast(blade->m_pos.z) & 0xFF) / 2000.0f; + + if (colScale > 1.0f) { + colScale = 1.0f; + } + + if (amb.r == 0x3E) { + amb.r = tevstr->AmbCol.r * roomAmbScale; + } else { + amb.r = amb.r * colScale; + } + + if (amb.g == 0x3E) { + amb.g = tevstr->AmbCol.g * roomAmbScale; + } else { + amb.g = amb.g * colScale; + } + + if (amb.b == 0x3E) { + amb.b = tevstr->AmbCol.b * roomAmbScale; + } else { + amb.b = amb.b * colScale; + } + + return amb; +} + +static void blade_emit(const batch::LeafTemplate& tpl, const Vec* xformedPos, + const GXColor* colors, GXColor amb) { + for (u32 i = 0; i < tpl.vtxCount; i++) { + const batch::LeafTemplate::Vtx& v = tpl.vtx[i]; + const Vec& p = xformedPos[v.pos]; + GXPosition3f32(p.x, p.y, p.z); + GXNormal1x8(v.nrm); + GXColor4u8(amb.r, amb.g, amb.b, colors[v.clr].a); + GXTexCoord1x8(v.tex); + } +} + void dGrass_packet_c::draw() { + ZoneScoped; + dScnKy_env_light_c* kankyo = dKy_getEnvlight(); + + j3dSys.reinitGX(); + GXSetNumIndStages(0); + dKy_setLight_again(); + GXClearVtxDesc(); + + static GXVtxDescList l_vtxDescList[] = { + {GX_VA_POS, GX_INDEX8}, + {GX_VA_NRM, GX_INDEX8}, + {GX_VA_CLR0, GX_INDEX8}, + {GX_VA_TEX0, GX_INDEX8}, + {GX_VA_NULL, GX_NONE}, + }; + + static GXVtxDescList l_batchVtxDescList[] = { + {GX_VA_POS, GX_DIRECT}, + {GX_VA_NRM, GX_INDEX8}, + {GX_VA_CLR0, GX_DIRECT}, + {GX_VA_TEX0, GX_INDEX8}, + {GX_VA_NULL, GX_NONE}, + }; + + GXSetVtxDescv(l_vtxDescList); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_NRM, GX_NRM_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + GXSetVtxAttrFmt(GX_VTXFMT1, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0); + GXSETARRAY(GX_VA_POS, mp_pos, sizeof(l_pos), sizeof(Vec), true); + GXSETARRAY(GX_VA_NRM, mp_normal, sizeof(l_normal), sizeof(Vec), true); + GXSETARRAY(GX_VA_CLR0, mp_colors, sizeof(l_color), sizeof(GXColor), true); + GXSETARRAY(GX_VA_TEX0, mp_texCoords, sizeof(l_texCoord), 8, true); + + GXColorS10 reg1 = {0, 0, 0, 0}; + + // daytime "shine" alpha curve (TEVREG1 alpha) + f32 daytime = g_env_light.getDaytime(); + f32 ratio; + f32 shine; + if (daytime >= 90.0f && daytime < 135.0f) { + ratio = 1.0f - (0.022222223f * (135.0f - daytime)); + shine = 100.0f - (18.0f * ratio); + } else if (daytime >= 135.0f && daytime < 225.0f) { + ratio = 1.0f - (0.011111111f * (225.0f - daytime)); + shine = 82.0f - (25.0f * ratio); + } else if (daytime >= 225.0f && daytime < 270.0f) { + ratio = 1.0f - (0.022222223f * (270.0f - daytime)); + shine = 57.0f - (-25.0f * ratio); + } else if (daytime >= 270.0f && daytime < 315.0f) { + ratio = (1.0f - (0.022222223f * (315.0f - daytime))); + shine = 82.0f - (-18.0f * ratio); + } else { + shine = 100.0f; + } + +#if DEBUG + if (g_kankyoHIO.navy.grass_shine_value != 0.0f) { + shine = g_kankyoHIO.navy.grass_shine_value; + } +#endif + + static Vec xfPos[256]; + Mtx identity; + PSMTXIdentity(identity); + + for (int i = 0; i < 64; i++) { + dGrass_data_c* first = m_room[i].getData(); + if (first == NULL || !dComIfGp_roomControl_checkStatusFlag(i, 0x10)) { + continue; + } + + int lightCount = 6; + dKy_tevstr_c* tevstr = dComIfGp_roomControl_getTevStr(i); + + f32 lightInf = g_env_light.grass_light_inf_rate * g_env_light.bg_light_influence; + lightInf += 0.5f * (1.0f - lightInf); + + J3DLightInfo* lightInfo = tevstr->mLights[0].getLightInfo(); + reg1.r = lightInfo->mColor.r * lightInf; + reg1.g = lightInfo->mColor.g * lightInf; + reg1.b = lightInfo->mColor.b * lightInf; + reg1.a = shine; + if (memcmp(dComIfGp_getStartStageName(), "D_MN01", 6) == 0) { + reg1.r = 0; + reg1.g = 0x1E; + reg1.b = 5; + reg1.a = 0x50; + } + GFSetTevColorS10(GX_TEVREG1, reg1); + + if (dComIfGp_roomControl_getStatusRoomDt(i) != nullptr) { + lightCount = dComIfGp_roomControl_getStatusRoomDt(i)->getLightVecInfoNum(); + } + +#if DEBUG + if (g_kankyoHIO.light.m_HOSTIO_setting != 0) { + lightCount = g_kankyoHIO.dungeonLight.usedLights; + } +#endif + + if (dKy_SunMoon_Light_Check() == TRUE && lightCount < 2) { + lightCount = 2; + } + + for (int j = 0; j < 6; j++) { + if (kankyo->field_0x0c18[j].field_0x26 == 1) { + lightCount++; + } + } + + // room-level setup + if (first->field_0x05 <= 3 || first->field_0x05 >= 10) { + GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0); + if (lightCount <= 3) { + GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size); + } else { + GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size); + } + } else { + GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0); + GXCallDisplayList(l_Tengusa_matDL, 0xA0); + } + + GFSetTevColorS10(GX_TEVREG2, {0, 0, 0, 0}); + + dKy_Global_amb_set(tevstr); + dKy_GfFog_tevstr_set(tevstr); + dKy_setLight_nowroom_grass(tevstr->room_no, 0.0f); + + GXSetVtxDescv(l_batchVtxDescList); + GXLoadPosMtxImm(identity, GX_PNMTX0); + GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0); + + // buckets: (kusa05 vs tengusa) x (standing vs cut) + bool hasRegrowing = false; + for (int bucket = 0; bucket < 4; bucket++) { + const bool kusaTex = bucket < 2; + const bool cut = (bucket & 1) != 0; + const batch::LeafTemplate& tpl = + cut ? mTplKusa9qCut : (kusaTex ? mTplKusa9q : mTplTengusa); + + bool open = false; + u32 emitted = 0; + for (dGrass_data_c* blade = first; blade != NULL; blade = blade->mp_next) { + if (cLib_checkBit(blade->field_0x01, 2)) { + continue; // clipped + } + if (blade->field_0x02 < -1) { + hasRegrowing = true; + continue; + } + const bool bladeKusaTex = blade->field_0x05 <= 3 || blade->field_0x05 >= 10; + if (bladeKusaTex != kusaTex || (blade->field_0x02 < 0) != cut) { + continue; + } + + if (!open) { + if (kusaTex) { + GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0); + if (lightCount <= 2) { + GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size); + } else { + GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size); + } + } else { + GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0); + GXCallDisplayList(l_Tengusa_matDL, 0xA0); + } + // change amb_src to GX_SRC_VTX + const u32 lightMask = + (kusaTex && lightCount <= 2) + ? (GX_LIGHT1 | GX_LIGHT2 | GX_LIGHT3 | GX_LIGHT4) + : (GX_LIGHT1 | GX_LIGHT2 | GX_LIGHT3 | GX_LIGHT4 | GX_LIGHT5 | + GX_LIGHT6 | GX_LIGHT7); + GXSetChanCtrl(GX_COLOR0, GX_TRUE, GX_SRC_VTX, GX_SRC_REG, lightMask, + GX_DF_CLAMP, GX_AF_SPOT); + reg1.a = cut ? 0 : shine; + GFSetTevColorS10(GX_TEVREG1, reg1); + GXBegin(GX_TRIANGLES, GX_VTXFMT1, GX_AUTO); + open = true; + } + + split_batch(emitted, tpl.vtxCount); + + Mtx interpMtx; + MtxP mtx = get_model_mtx(blade->m_modelMtx, interpMtx); + transform_positions(tpl, mp_pos, mtx, xfPos); + blade_emit(tpl, xfPos, mp_colors, blade_amb_color(blade, tevstr)); + } + if (open) { + GXEnd(); + } + } + + // regrowing blades have per-blade TEVREG2 alpha + // draw them with the original immediate path + if (hasRegrowing) { + GXSetVtxDescv(l_vtxDescList); + for (dGrass_data_c* blade = first; blade != NULL; blade = blade->mp_next) { + if (blade->field_0x02 >= -1 || cLib_checkBit(blade->field_0x01, 2)) { + continue; + } + + const bool kusaTex = blade->field_0x05 <= 3 || blade->field_0x05 >= 10; + if (kusaTex) { + GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0); + if (lightCount <= 2) { + GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size); + } else { + GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size); + } + } else { + GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0); + GXCallDisplayList(l_Tengusa_matDL, 0xA0); + } + + reg1.a = 0; + GFSetTevColorS10(GX_TEVREG1, reg1); + GXSetChanAmbColor(GX_COLOR0A0, blade_amb_color(blade, tevstr)); + + Mtx modelMtx; + GXLoadPosMtxImm(get_model_mtx(blade->m_modelMtx, modelMtx), GX_PNMTX0); + GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0); + + GFSetTevColorS10(GX_TEVREG2, + {0, 0, 0, static_cast(-0x100 - (blade->field_0x02 << 8) / 40)}); + + if (blade->field_0x02 != -2) { + if (kusaTex) { + GXCallDisplayList(mp_Mkusa_9q_DL, m_Mkusa_9q_DL_size); + } else { + GXCallDisplayList(l_M_TenGusaDL, 0xC0); + } + } else { + GXCallDisplayList(mp_Mkusa_9q_cDL, m_Mkusa_9q_cDL_size); + } + + GFSetTevColorS10(GX_TEVREG2, {0, 0, 0, 0}); + } + } + } + + J3DShape::resetVcdVatCache(); +} +#else +void dGrass_packet_c::draw() { + ZoneScoped; dScnKy_env_light_c* kankyo = dKy_getEnvlight(); cXyz spB4; cXyz spA8; @@ -810,6 +1166,7 @@ void dGrass_packet_c::draw() { J3DShape::resetVcdVatCache(); } +#endif void dGrass_packet_c::calc() { cXyz* temp_r29 = dKyw_get_wind_vec(); diff --git a/src/d/d_a_horse_static.cpp b/src/d/d_a_horse_static.cpp index 1c196043ed..e4db3519a9 100644 --- a/src/d/d_a_horse_static.cpp +++ b/src/d/d_a_horse_static.cpp @@ -50,4 +50,4 @@ void e_wb_class::setRunRideMode() { } } -daTagHstop_c* daTagHstop_c::m_top; +DUSK_GAME_DATA daTagHstop_c* daTagHstop_c::m_top; diff --git a/src/d/d_a_itembase_static.cpp b/src/d/d_a_itembase_static.cpp index 9099c5a147..5e98a20409 100644 --- a/src/d/d_a_itembase_static.cpp +++ b/src/d/d_a_itembase_static.cpp @@ -68,7 +68,7 @@ int CheckFieldItemCreateHeap(fopAc_ac_c* i_this) { dItem_data::getItemBrkName(item_no), dItem_data::getItemBtpName(item_no)); } -const daItemBase_data daItemBase_c::m_data = { +DUSK_GAME_DATA const daItemBase_data daItemBase_c::m_data = { -4.5f, // mGravity 0.62f, // mGroundReflect 45.0f, // mLaunchSpeed diff --git a/src/d/d_a_shop_item_static.cpp b/src/d/d_a_shop_item_static.cpp index 902e09a9c4..ece0a288c5 100644 --- a/src/d/d_a_shop_item_static.cpp +++ b/src/d/d_a_shop_item_static.cpp @@ -15,7 +15,7 @@ cXyz* daShopItem_c::getPosP() { return ¤t.pos; } -ResourceData const daShopItem_c::mData[23] = { +DUSK_GAME_DATA ResourceData const daShopItem_c::mData[23] = { {"B_mD_sold", 3, -1, -1, -1, -1, -1, -1, 0.0f, 1.0f, 0, {0, -0x8000, 0}, 0, 0, 0, 0, -1, -1}, {"B_mD_oil", 3, -1, -1, -1, -1, -1, -1, 0.0f, 1.0f, 0, {0, 0, 0}, 0, 0, 0, 0, -1, -1}, {"O_mD_red", 3, -1, -1, -1, -1, -1, -11, 0.0f, 1.0f, 0, {0, 0, 0}, 0, 0, 0, 0, -1, -1}, diff --git a/src/d/d_att_dist.cpp b/src/d/d_att_dist.cpp index d2b9ac2b1b..761eb1074c 100644 --- a/src/d/d_att_dist.cpp +++ b/src/d/d_att_dist.cpp @@ -3,7 +3,7 @@ #include "d/d_att_dist.h" #include "d/d_attention.h" -dist_entry dAttention_c::dist_table[234] = { +DUSK_GAME_DATA dist_entry dAttention_c::dist_table[234] = { {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.01f, 0}, {250.0f, 375.0f, 500.0f, 400.0f, -400.0f, 0.5f, 0}, {187.5f, 250.0f, 312.5f, 300.0f, -300.0f, 1.0f, 0}, diff --git a/src/d/d_attention.cpp b/src/d/d_attention.cpp index 1bb9e84f70..beea40e806 100644 --- a/src/d/d_attention.cpp +++ b/src/d/d_attention.cpp @@ -41,13 +41,13 @@ static bool padLockButton(s32 i_padNo) { } } // namespace -type_tbl_entry dAttention_c::loc_type_tbl[3] = { +DUSK_GAME_DATA type_tbl_entry dAttention_c::loc_type_tbl[3] = { {fopAc_attn_LOCK_e, fopAc_AttnFlag_LOCK_e}, {fopAc_attn_TALK_e, fopAc_AttnFlag_TALK_e}, {fopAc_attn_BATTLE_e, fopAc_AttnFlag_BATTLE_e}, }; -type_tbl_entry dAttention_c::act_type_tbl[5] = { +DUSK_GAME_DATA type_tbl_entry dAttention_c::act_type_tbl[5] = { {fopAc_attn_SPEAK_e, fopAc_AttnFlag_SPEAK_e}, {fopAc_attn_CARRY_e, fopAc_AttnFlag_CARRY_e}, {fopAc_attn_DOOR_e, fopAc_AttnFlag_DOOR_e}, @@ -157,7 +157,7 @@ int dAttDraw_CallBack_c::execute(u16 param_0, J3DTransformInfo* transform) { return 1; } -dAttDrawParam_c g_AttDwHIO; +DUSK_GAME_DATA dAttDrawParam_c g_AttDwHIO; dAttention_c::dAttention_c(fopAc_ac_c* i_player, u32 i_padNo) { mpPlayer = i_player; @@ -339,7 +339,7 @@ dAttList_c* dAttention_c::getActionBtnXY() { return NULL; } -int dAttention_c::loc_type_num = 3; +DUSK_GAME_DATA int dAttention_c::loc_type_num = 3; int dAttention_c::chkAttMask(u32 i_type, u32 i_mask) { int i; @@ -375,13 +375,13 @@ static int check_event_condition(u32 i_attnType, u16 i_condition) { return false; } -int dAttention_c::act_type_num = 5; +DUSK_GAME_DATA int dAttention_c::act_type_num = 5; -type_tbl_entry dAttention_c::chk_type_tbl[1] = { +DUSK_GAME_DATA type_tbl_entry dAttention_c::chk_type_tbl[1] = { {fopAc_attn_CHECK_e, fopAc_AttnFlag_CHECK_e}, }; -int dAttention_c::chk_type_num = 1; +DUSK_GAME_DATA int dAttention_c::chk_type_num = 1; static bool attn_opt_hold = true; diff --git a/src/d/d_bg_parts.cpp b/src/d/d_bg_parts.cpp index 3c378bf325..07c91f8807 100644 --- a/src/d/d_bg_parts.cpp +++ b/src/d/d_bg_parts.cpp @@ -8,6 +8,8 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include +#include "helpers/string.hpp" + void dBgp_c::material_c::draw() { material_c* material = this; do { @@ -220,8 +222,8 @@ dBgp_c::share_c::share_c() { mCount = 0; } -JKRSolidHeap* dBgp_c::mShareHeap; -dBgp_c::share_c* dBgp_c::mShare; +DUSK_GAME_DATA JKRSolidHeap* dBgp_c::mShareHeap; +DUSK_GAME_DATA dBgp_c::share_c* dBgp_c::mShare; void dBgp_c::share_c::set(u16 i_id) { JUT_ASSERT(441, mCount != static_cast(~0)); @@ -255,7 +257,7 @@ void dBgp_c::share_c::reset() { const char* dBgp_c::share_c::getArcName() { static char arcName[8]; - sprintf(arcName, "@mt%04x", mId); + SAFE_SPRINTF(arcName, "@mt%04x", mId); return arcName; } @@ -430,7 +432,7 @@ dBgp_c::packet_c::packet_c() { void dBgp_c::create(s8 i_roomNo, void* i_data) { mPointer = i_data; mPacket.setRoomNo(i_roomNo); - strcpy(mArcName, dComIfG_getRoomArcName(i_roomNo)); + SAFE_STRCPY(mArcName, dComIfG_getRoomArcName(i_roomNo)); if (mPointer != NULL) { JKRExpHeap* block = dStage_roomControl_c::getMemoryBlock(i_roomNo); @@ -457,7 +459,7 @@ void dBgp_c::create(s8 i_roomNo, void* i_data) { unit_group_class* unitGroup = mapUnit->groups; for (int i = 0; i < mapUnit->num; i++) { char resName[16]; - sprintf(resName, "bp%04d.dzb", i); + SAFE_SPRINTF(resName, "bp%04d.dzb", i); cBgD_t* dzb = (cBgD_t*)dComIfG_getStageRes(mArcName, resName); if (dzb != NULL) { @@ -534,7 +536,7 @@ int dBgp_c::remove() { const char* dBgp_c::getArcName(u16 i_id, u16 i_arg) { static char arcName[8]; - sprintf(arcName, "@%03x%03x", i_id, i_arg); + SAFE_SPRINTF(arcName, "@%03x%03x", i_id, i_arg); return arcName; } diff --git a/src/d/d_bg_s.cpp b/src/d/d_bg_s.cpp index f48c58fead..51811d9538 100644 --- a/src/d/d_bg_s.cpp +++ b/src/d/d_bg_s.cpp @@ -15,7 +15,7 @@ #include "d/d_bg_s_capt_poly.h" #if TARGET_PC -#include "dusk/offset_ptr.h" +#include "helpers/offset_ptr.h" #include "dusk/settings.h" #endif diff --git a/src/d/d_bg_s_movebg_actor.cpp b/src/d/d_bg_s_movebg_actor.cpp index 176beadb73..5d5aa13203 100644 --- a/src/d/d_bg_s_movebg_actor.cpp +++ b/src/d/d_bg_s_movebg_actor.cpp @@ -51,11 +51,11 @@ int dBgS_MoveBgActor::ToBack() { return 1; } -const char* dBgS_MoveBgActor::m_name; +DUSK_GAME_DATA const char* dBgS_MoveBgActor::m_name; -int dBgS_MoveBgActor::m_dzb_id; +DUSK_GAME_DATA int dBgS_MoveBgActor::m_dzb_id; -MoveBGActor_SetFunc dBgS_MoveBgActor::m_set_func; +DUSK_GAME_DATA MoveBGActor_SetFunc dBgS_MoveBgActor::m_set_func; int dBgS_MoveBgActor::MoveBGCreateHeap() { if (!CreateHeap()) { diff --git a/src/d/d_bg_w.cpp b/src/d/d_bg_w.cpp index ecbc7fa6d3..64a2df2afd 100644 --- a/src/d/d_bg_w.cpp +++ b/src/d/d_bg_w.cpp @@ -2485,5 +2485,5 @@ dBgW* dBgW_NewSet(cBgD_t* pbgd, u32 flags, Mtx* pbase_mtx) { return nw; } -extern u8 struct_80450F88[8]; -u8 struct_80450F88[8]; +DUSK_GAME_EXTERN u8 struct_80450F88[8]; +DUSK_GAME_DATA u8 struct_80450F88[8]; diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index bfc4c809c9..888f9d9ccf 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -32,6 +32,9 @@ #include "dusk/frame_interpolation.h" #include "dusk/logging.h" #include "dusk/action_bindings.h" +#include "dusk/mouse.h" +#include "dusk/settings.h" +#include "dusk/touch_camera.h" #include "imgui.h" #endif @@ -193,7 +196,7 @@ int dCamMapToolData::Set(s32 param_0, s32 roomNo, fopAc_ac_c* param_2, u16 param return 0; } -engine_fn dCamera_c::engine_tbl[] = { +DUSK_GAME_DATA engine_fn dCamera_c::engine_tbl[] = { &dCamera_c::letCamera, &dCamera_c::chaseCamera, &dCamera_c::lockonCamera, &dCamera_c::talktoCamera, &dCamera_c::subjectCamera, &dCamera_c::fixedPositionCamera, &dCamera_c::fixedFrameCamera, &dCamera_c::towerCamera, &dCamera_c::rideCamera, @@ -7497,6 +7500,15 @@ static constexpr s16 FLYCAM_ROLL_SPEED = 256; static ImVec2 sFlyCamLastMousePos = {-1.f, -1.f}; #if TARGET_PC +static constexpr f32 TOUCH_CAMERA_CSTICK_EXIT_THRESHOLD = 0.05f; +static bool sTouchFreeCameraActive = false; + +bool dCamera_c::isAimActive() { + auto* link = daAlink_getAlinkActorClass(); + return link != nullptr && link->checkAimInputContext() && + dComIfGp_checkCameraAttentionStatus(link->field_0x317c, 0x10); +} + bool dCamera_c::executeDebugFlyCam() { if (!dusk::getSettings().game.debugFlyCam) { if (mDebugFlyCam.initialized) { @@ -7590,6 +7602,10 @@ bool dCamera_c::executeDebugFlyCam() { sFlyCamLastMousePos = mouseValid ? io.MousePos : ImVec2{-1.0f, -1.0f}; } + if (dusk::getSettings().game.enableMirrorMode) { + stickX *= -1.0f; + } + f32 verticalDisp = 0.0f; if (trigR >= FLYCAM_TRIGGER_DEADZONE) { verticalDisp += trigR; @@ -7639,11 +7655,29 @@ void dCamera_c::deactivateDebugFlyCam() { } bool dCamera_c::freeCamera() { - if (dusk::getSettings().game.freeCamera && mGear == 1) { + f32 touchYawDp = 0.0f; + f32 touchPitchDp = 0.0f; + bool touchCameraMoved = false; + const bool touchControlsEnabled = dusk::getSettings().game.enableTouchControls; + if (touchControlsEnabled && !isAimActive()) { + touchCameraMoved = dusk::touch_camera::consume_delta(touchYawDp, touchPitchDp); + } + if (!touchControlsEnabled || + mPadInfo.mCStick.mLastValue > TOUCH_CAMERA_CSTICK_EXIT_THRESHOLD) + { + sTouchFreeCameraActive = false; + } + if (touchCameraMoved) { + sTouchFreeCameraActive = true; + } + + const bool useFreeCamera = dusk::getSettings().game.freeCamera || + dusk::getSettings().game.enableMouseCamera || sTouchFreeCameraActive; + if (useFreeCamera && mGear == 1) { mGear = 0; } - if (!dusk::getSettings().game.freeCamera || mCamStyle == 70) + if (!useFreeCamera || mCamStyle == 70) { mCamParam.mManualMode = 0; return false; @@ -7654,6 +7688,17 @@ bool dCamera_c::freeCamera() { mCamParam.freeYAngle = mViewCache.mDirection.mInclination.Degree(); } + if (touchCameraMoved) { + mCamParam.mManualMode = 1; + const f32 yawInput = dusk::getSettings().game.invertCameraXAxis ? -touchYawDp : touchYawDp; + const f32 pitchInput = + touchPitchDp * (dusk::getSettings().game.invertCameraYAxis ? -1.0f : 1.0f); + mCamParam.freeXAngle += yawInput * dusk::getSettings().game.touchCameraXSensitivity * + dusk::touch_camera::YAW_DEGREES_PER_DP; + mCamParam.freeYAngle += pitchInput * dusk::getSettings().game.touchCameraYSensitivity * + dusk::touch_camera::PITCH_DEGREES_PER_DP; + } + cXyz camMovement = {mPadInfo.mCStick.mLastPosX, mPadInfo.mCStick.mLastPosY, 0.0f}; f32 magnitude = sqrt(mPadInfo.mCStick.mLastPosX * mPadInfo.mCStick.mLastPosX + mPadInfo.mCStick.mLastPosY * mPadInfo.mCStick.mLastPosY); @@ -7665,8 +7710,19 @@ bool dCamera_c::freeCamera() { mCamParam.mManualMode = 1; camMovement = camMovement.normalize(); camMovement.y *= dusk::getSettings().game.invertCameraYAxis ? 1.0f : -1.0f; - mCamParam.freeXAngle += camMovement.x * magnitude * dusk::getSettings().game.freeCameraSensitivity * 5.0f; - mCamParam.freeYAngle += camMovement.y * magnitude * dusk::getSettings().game.freeCameraSensitivity * 5.0f; + mCamParam.freeXAngle += camMovement.x * magnitude * dusk::getSettings().game.freeCameraXSensitivity * 5.0f; + mCamParam.freeYAngle += camMovement.y * magnitude * dusk::getSettings().game.freeCameraYSensitivity * 5.0f; + } + + f32 yaw_rad = 0.0f; + f32 pitch_rad = 0.0f; + dusk::mouse::get_camera_deltas(yaw_rad, pitch_rad); + if (dusk::getSettings().game.enableMouseCamera && (yaw_rad != 0.0f || pitch_rad != 0.0f) && + !dComIfGp_checkCameraAttentionStatus(dComIfGp_getPlayerCameraID(0), 0x8)) + { + mCamParam.mManualMode = 1; + mCamParam.freeXAngle += MTXRadToDeg(yaw_rad); + mCamParam.freeYAngle += -MTXRadToDeg(pitch_rad); } fopAc_ac_c* player = dComIfGp_getPlayer(0); @@ -9350,6 +9406,10 @@ bool dCamera_c::rideCamera(s32 param_0) { mStyleSettle.mFinished = true; } +#if TARGET_PC + freeCamera(); +#endif + return true; } @@ -9479,6 +9539,10 @@ bool dCamera_c::rideCamera(s32 param_0) { setFlag(0x400); } +#if TARGET_PC + freeCamera(); +#endif + return true; } @@ -10233,7 +10297,7 @@ bool dCamera_c::eventCamera(s32 param_0) { int var_r29 = -1; typedef bool (dCamera_c::*func)(); - func l_func[] = { + DUSK_CONSTEXPR func l_func[] = { &dCamera_c::pauseEvCamera, &dCamera_c::pauseEvCamera, &dCamera_c::talktoEvCamera, @@ -10270,7 +10334,7 @@ bool dCamera_c::eventCamera(s32 param_0) { &dCamera_c::maptoolIdEvCamera, }; - static char* ActionNames[34] = { + static DUSK_CONSTEXPR char DUSK_CONST* ActionNames[34] = { "PAUSE", "WAIT", "TALK", @@ -10431,7 +10495,7 @@ bool dCamera_c::eventCamera(s32 param_0) { #endif #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { switch (var_r29) { case 3: case 4: @@ -11322,7 +11386,7 @@ static int camera_execute(camera_process_class* i_this) { #ifdef TARGET_PC widezoom_correction(i_this, i_this->mCamera.TrimHeight()); - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { dusk::frame_interp::add_interpolation_callback([](bool _, void* pUserWork) { const auto i_this = static_cast(pUserWork); const auto camera = &i_this->mCamera; @@ -11334,7 +11398,7 @@ static int camera_execute(camera_process_class* i_this) { const auto target = get_target_trim_height(i_this); const auto step = dusk::frame_interp::get_interpolation_step(); const auto cur = camera->TrimHeight(); - const auto prev = (4.0f * cur - target) / 3.0f; + const auto prev = (4.0f * cur - target) / 3.0f; const auto trim_height = prev + (cur - prev) * step; widezoom_correction(i_this, trim_height); @@ -11627,7 +11691,7 @@ static leafdraw_method_class method = { (process_method_func)camera_draw, }; -camera_process_profile_definition g_profile_CAMERA = { +DUSK_PROFILE camera_process_profile_definition DUSK_CONST g_profile_CAMERA = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 11, /* List Prio */ fpcPi_CURRENT_e, @@ -11648,7 +11712,7 @@ camera_process_profile_definition g_profile_CAMERA = { 0, }; -camera_process_profile_definition g_profile_CAMERA2 = { +DUSK_PROFILE camera_process_profile_definition DUSK_CONST g_profile_CAMERA2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 11, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_cc_d.cpp b/src/d/d_cc_d.cpp index 6cc5ab63e3..7edb0f9d07 100644 --- a/src/d/d_cc_d.cpp +++ b/src/d/d_cc_d.cpp @@ -259,7 +259,7 @@ u8 dCcD_GObjInf::GetTgHitObjSe() { } } -Z2SoundID const dCcD_GObjInf::m_hitSeID[24] = { +DUSK_GAME_DATA Z2SoundID const dCcD_GObjInf::m_hitSeID[24] = { Z2SE_HIT_DUMMY_CANCEL, Z2SE_HIT_SWORD, Z2SE_HIT_SHIELD_ATTACK, Z2SE_HIT_WOLFKICK, Z2SE_HIT_WOLFBITE, Z2SE_HIT_WOOD_WEAPON, Z2SE_HIT_HAMMER, Z2SE_HIT_ARROW_STICK, Z2SE_HIT_HOOKSHOT_STICK, diff --git a/src/d/d_cc_s.cpp b/src/d/d_cc_s.cpp index 2a19de3dda..6a1d0c332c 100644 --- a/src/d/d_cc_s.cpp +++ b/src/d/d_cc_s.cpp @@ -872,7 +872,7 @@ void dCcS::MassClear() { } // clang-format off -bool dCcS::m_mtrl_hit_tbl[64] = { +DUSK_GAME_DATA bool dCcS::m_mtrl_hit_tbl[64] = { true, true, true, true, true, true, true, true, false, true, false, false, false, false, false, false, false, false, true, false, false, false, false, false, diff --git a/src/d/d_cc_uty.cpp b/src/d/d_cc_uty.cpp index 218cb362f4..91fc6677c1 100644 --- a/src/d/d_cc_uty.cpp +++ b/src/d/d_cc_uty.cpp @@ -16,6 +16,7 @@ #if TARGET_PC #include "dusk/achievements.h" #include "dusk/settings.h" +#include "d/actor/d_a_alink.h" #endif static int plCutLRC[58] = { @@ -448,6 +449,10 @@ fopAc_ac_c* cc_at_check(fopAc_ac_c* i_enemy, dCcU_AtInfo* i_AtInfo) { #if TARGET_PC if (fopAcM_GetGroup(i_enemy) == fopAc_ENEMY_e) { dusk::AchievementSystem::get().signal("enemy_killed"); + const auto* link = static_cast(daPy_getPlayerActorClass()); + if (link != nullptr && link->mProcID == daAlink_c::PROC_CUT_FINISH && link->mIsRollstab) { + dusk::AchievementSystem::get().signal("rollstab_kill"); + } } #endif } diff --git a/src/d/d_com_inf_actor.cpp b/src/d/d_com_inf_actor.cpp index 772ad8542a..0c80f9b1ab 100644 --- a/src/d/d_com_inf_actor.cpp +++ b/src/d/d_com_inf_actor.cpp @@ -8,11 +8,11 @@ #include "d/d_com_inf_actor.h" #include -dComIfAc_info_c g_dComIfAc_gameInfo = { +DUSK_GAME_DATA dComIfAc_info_c g_dComIfAc_gameInfo = { 0, // field_0x0 false, // mPause }; -dComIfGoat_info_c g_dComIfGoat_gameInfo = { +DUSK_GAME_DATA dComIfGoat_info_c g_dComIfGoat_gameInfo = { NULL, // field_0x0 }; diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 7e17cb501e..cfadb5aa8a 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -26,6 +26,12 @@ #include #include +#include "helpers/string.hpp" + +#if TARGET_PC +#include "dusk/settings.h" +#endif + void dComIfG_play_c::ct() { mWindowNum = 0; mParticle = NULL; @@ -1205,9 +1211,9 @@ void dComIfG_inf_c::createBaseCsr() { } #endif -GXColor g_clearColor = {0, 0, 0, 0}; +DUSK_GAME_DATA GXColor g_clearColor = {0, 0, 0, 0}; -GXColor g_blackColor = {0, 0, 0, 255}; +DUSK_GAME_DATA GXColor g_blackColor = {0, 0, 0, 255}; int dComIfG_changeOpeningScene(scene_class* i_scene, s16 i_procName) { dComIfGp_offEnableNextStage(); @@ -1226,7 +1232,7 @@ int dComIfG_changeOpeningScene(scene_class* i_scene, s16 i_procName) { return 1; } -dComIfG_inf_c g_dComIfG_gameInfo; +DUSK_GAME_DATA dComIfG_inf_c g_dComIfG_gameInfo; BOOL dComIfG_resetToOpening(scene_class* i_scene) { #if PLATFORM_WII || VERSION == VERSION_SHIELD_DEBUG @@ -2649,7 +2655,7 @@ static void dComIfGs_setWarpItemData(int param_0, char const* i_stage, cXyz i_po void dComIfG_play_c::setWarpItemData(char const* i_stage, cXyz i_pos, s16 i_angle, s8 i_roomNo, u8 param_4, u8 param_5) { - strcpy(mItemInfo.mWarpItemData.mWarpItemStage, i_stage); + SAFE_STRCPY(mItemInfo.mWarpItemData.mWarpItemStage, i_stage); mItemInfo.mWarpItemData.mWarpItemPos.set(i_pos); mItemInfo.mWarpItemData.mWarpItemAngle = i_angle; mItemInfo.mWarpItemData.mWarpItemRoom = i_roomNo; @@ -2736,7 +2742,7 @@ void* dComIfG_getOldStageRes(char const* i_resName) { char* dComIfG_getRoomArcName(int i_roomNo) { static char buf[32]; - sprintf(buf, "R%02d_00", i_roomNo); + SAFE_SPRINTF(buf, "R%02d_00", i_roomNo); return buf; } @@ -2985,6 +2991,22 @@ u8 dComIfGs_staffroll_next_go_check() { return envLight->staffroll_next_timer; } -GXColor g_whiteColor = {255, 255, 255, 255}; +DUSK_GAME_DATA GXColor g_whiteColor = {255, 255, 255, 255}; -GXColor g_saftyWhiteColor = {160, 160, 160, 255}; +DUSK_GAME_DATA GXColor g_saftyWhiteColor = {160, 160, 160, 255}; + +#if TARGET_PC +void dComIfGd_drawXluListInvisible() { + ZoneScoped; + if (!dusk::getSettings().game.disableWaterRefraction) { + g_dComIfG_gameInfo.drawlist.drawXluListInvisible(); + } +} + +void dComIfGd_drawOpaListInvisible() { + ZoneScoped; + if (!dusk::getSettings().game.disableWaterRefraction) { + g_dComIfG_gameInfo.drawlist.drawOpaListInvisible(); + } +} +#endif diff --git a/src/d/d_com_static.cpp b/src/d/d_com_static.cpp index ee05d34170..bc6f99afbf 100644 --- a/src/d/d_com_static.cpp +++ b/src/d/d_com_static.cpp @@ -19,7 +19,7 @@ #include #include -s16 const daObjMovebox::Act_c::M_dir_base[4] = { +DUSK_GAME_DATA s16 const daObjMovebox::Act_c::M_dir_base[4] = { 0x0000, 0x4000, -0x8000, @@ -132,17 +132,17 @@ void daSus_c::room_c::reset() { } } -daSus_c::data_c daSus_c::mData[0x20]; +DUSK_GAME_DATA daSus_c::data_c daSus_c::mData[0x20]; -daSus_c::room_c daSus_c::mRoom[0x40]; +DUSK_GAME_DATA daSus_c::room_c daSus_c::mRoom[0x40]; #if DEBUG daCanBall_c::Hio_c daCanBall_c::mHIO; #endif -s16 daArrow_c::m_count; +DUSK_GAME_DATA s16 daArrow_c::m_count; -s16 daSus_c::mSetTop; +DUSK_GAME_DATA s16 daSus_c::mSetTop; int daSus_c::newData(s8 i_roomNo, cXyz const& param_1, cXyz const& param_2, u8 param_3, u8 param_4, u8 i_type) { @@ -334,51 +334,51 @@ void daNpcKakashi_clrSuccessCount() { dComIfGs_setTmpReg(0xFEFF, 0); } -bool daYkgr_c::m_flag; +DUSK_GAME_DATA bool daYkgr_c::m_flag; -bool daYkgr_c::m_alpha_flag; +DUSK_GAME_DATA bool daYkgr_c::m_alpha_flag; -u8 daYkgr_c::m_alpha; +DUSK_GAME_DATA u8 daYkgr_c::m_alpha; -f32 daYkgr_c::m_aim_rate; +DUSK_GAME_DATA f32 daYkgr_c::m_aim_rate; -dPath* daYkgr_c::m_path; +DUSK_GAME_DATA dPath* daYkgr_c::m_path; -JPABaseEmitter* daYkgr_c::m_emitter; +DUSK_GAME_DATA JPABaseEmitter* daYkgr_c::m_emitter; const char* daSetBgObj_c::getArcName(fopAc_ac_c* i_this) { static char arcName[8]; u32 r30 = fopAcM_GetParam(i_this); u16 r29 = fopAcM_GetParam(i_this); - sprintf(arcName, "@bg%04x", r29); + SAFE_SPRINTF(arcName, "@bg%04x", r29); if (DEBUG && r30 & 0x80000000) { OS_REPORT("\e[43;30m旧仕様の地形ユニットMoveBGが残っています!!!\n\e[m"); u16 r28 = r30 >> 12 & 0x1FF; u16 r27 = r30 & 0xFFF; - sprintf(arcName, "@%03x%03x", r28, (u16)r27); + SAFE_SPRINTF(arcName, "@%03x%03x", r28, (u16)r27); } return arcName; } -f32 const daDsh_c::OPEN_SIZE = 270.1f; +DUSK_GAME_DATA f32 const daDsh_c::OPEN_SIZE = 270.1f; -f32 const daDsh_c::OPEN_ACCEL = 10.0f; +DUSK_GAME_DATA f32 const daDsh_c::OPEN_ACCEL = 10.0f; -f32 const daDsh_c::OPEN_SPEED = -40.0f; +DUSK_GAME_DATA f32 const daDsh_c::OPEN_SPEED = -40.0f; -f32 const daDsh_c::OPEN_BOUND_SPEED = -30.0f; +DUSK_GAME_DATA f32 const daDsh_c::OPEN_BOUND_SPEED = -30.0f; -f32 const daDsh_c::OPEN_BOUND_RATIO = -0.4f; +DUSK_GAME_DATA f32 const daDsh_c::OPEN_BOUND_RATIO = -0.4f; -f32 const daDsh_c::CLOSE_ACCEL = 10.0f; +DUSK_GAME_DATA f32 const daDsh_c::CLOSE_ACCEL = 10.0f; -f32 const daDsh_c::CLOSE_SPEED = 40.0f; +DUSK_GAME_DATA f32 const daDsh_c::CLOSE_SPEED = 40.0f; -f32 const daDsh_c::CLOSE_BOUND_SPEED = 30.0f; +DUSK_GAME_DATA f32 const daDsh_c::CLOSE_BOUND_SPEED = 30.0f; -f32 const daDsh_c::CLOSE_BOUND_RATIO = -0.4f; +DUSK_GAME_DATA f32 const daDsh_c::CLOSE_BOUND_RATIO = -0.4f; int daTagStream_c::checkArea(cXyz const* param_0) { cXyz relativePos; @@ -391,11 +391,11 @@ int daTagStream_c::checkArea(cXyz const* param_0) { return 0; } -daMirror_c::entryModelFunc daMirror_c::m_entryModel = NULL; +DUSK_GAME_DATA daMirror_c::entryModelFunc daMirror_c::m_entryModel = NULL; -daTagStream_c* daTagStream_c::m_top; +DUSK_GAME_DATA daTagStream_c* daTagStream_c::m_top; -daMirror_c* daMirror_c::m_myObj; +DUSK_GAME_DATA daMirror_c* daMirror_c::m_myObj; int daMirror_c::entry(J3DModel* param_0) { if (m_myObj == NULL) { @@ -413,11 +413,11 @@ bool daMirror_c::remove() { return true; } -dGrass_packet_c::deleteFunc dGrass_packet_c::m_deleteRoom = NULL; +DUSK_GAME_DATA dGrass_packet_c::deleteFunc dGrass_packet_c::m_deleteRoom = NULL; -daGrass_c* daGrass_c::m_myObj; +DUSK_GAME_DATA daGrass_c* daGrass_c::m_myObj; -dGrass_packet_c* daGrass_c::m_grass; +DUSK_GAME_DATA dGrass_packet_c* daGrass_c::m_grass; void daGrass_c::deleteRoomGrass(int param_0) { if (m_grass) { @@ -425,9 +425,9 @@ void daGrass_c::deleteRoomGrass(int param_0) { } } -dFlower_packet_c::deleteFunc dFlower_packet_c::m_deleteRoom = NULL; +DUSK_GAME_DATA dFlower_packet_c::deleteFunc dFlower_packet_c::m_deleteRoom = NULL; -dFlower_packet_c* daGrass_c::m_flower; +DUSK_GAME_DATA dFlower_packet_c* daGrass_c::m_flower; void daGrass_c::deleteRoomFlower(int param_0) { if (m_flower != NULL) { @@ -435,7 +435,7 @@ void daGrass_c::deleteRoomFlower(int param_0) { } } -daMP_c* daMP_c::m_myObj; +DUSK_GAME_DATA daMP_c* daMP_c::m_myObj; u32 daMP_c::daMP_c_Get_MovieRestFrame() { JUT_ASSERT(668, m_myObj != NULL); @@ -462,7 +462,7 @@ void daMP_c::daMP_c_THPPlayerPause() { m_myObj->mpTHPPause(); } -daTagMagne_c* daTagMagne_c::mTagMagne; +DUSK_GAME_DATA daTagMagne_c* daTagMagne_c::mTagMagne; int daTagMagne_c::checkMagnetCode(cBgS_PolyInfo& poly) { #if DEBUG @@ -508,9 +508,9 @@ int daTagMagne_c::checkMagneC() { return 0; } -u8 daTagMist_c::mPlayerNo; +DUSK_GAME_DATA u8 daTagMist_c::mPlayerNo; -bool daObjCarry_c::mSaveFlag; +DUSK_GAME_DATA bool daObjCarry_c::mSaveFlag; u8 daTagMist_c::getPlayerNo() { return mPlayerNo; @@ -528,7 +528,7 @@ bool daObjCarry_c::chkSaveFlag() { return mSaveFlag == true; } -cXyz daObjCarry_c::mPos[5]; +DUSK_GAME_DATA cXyz daObjCarry_c::mPos[5]; const cXyz& daObjCarry_c::getPos(int param_0) { #if DEBUG @@ -548,7 +548,7 @@ void daObjCarry_c::savePos(int param_0, cXyz param_1) { mPos[param_0] = param_1; } -u8 daObjCarry_c::mSttsFlag[5]; +DUSK_GAME_DATA u8 daObjCarry_c::mSttsFlag[5]; void daObjCarry_c::onSttsFlag(int idx, u8 flag) { #if DEBUG @@ -577,7 +577,7 @@ u8 daObjCarry_c::chkSttsFlag(int idx, u8 flag) { return cLib_checkBit(mSttsFlag[idx], flag) > 0; } -s8 daObjCarry_c::mRoomNo[5]; +DUSK_GAME_DATA s8 daObjCarry_c::mRoomNo[5]; void daObjCarry_c::setRoomNo(int idx, s8 roomNo) { #if DEBUG diff --git a/src/d/d_cursor_mng.cpp b/src/d/d_cursor_mng.cpp index 230b4e740e..b99ec8f4db 100644 --- a/src/d/d_cursor_mng.cpp +++ b/src/d/d_cursor_mng.cpp @@ -1,10 +1,7 @@ #include "JSystem/JKernel/JKRHeap.h" #include "d/dolzel.h" // IWYU pragma: keep - #include "d/d_cursor_mng.h" - -#include "../../libs/JSystem/include/JSystem/JKernel/JKRHeap.h" #include "d/d_com_inf_game.h" dCsr_mng_c* dCsr_mng_c::m_myObj; diff --git a/src/d/d_debug_camera.cpp b/src/d/d_debug_camera.cpp index 131a2c05ae..9ff5b0fcf8 100644 --- a/src/d/d_debug_camera.cpp +++ b/src/d/d_debug_camera.cpp @@ -1349,11 +1349,11 @@ void dDbgCamera_c::monitor() { for (var_r27 = 0; var_r27 < 4; var_r27++) { if (var_r27 == mCmdMode) { - strcat(spC0, "____ "); + SAFE_STRCAT(spC0, "____ "); break; } - strcat(spC0, " "); + SAFE_STRCAT(spC0, " "); } Report(pos_x, pos_y, 7, " %s", spC0); diff --git a/src/d/d_debug_viewer.cpp b/src/d/d_debug_viewer.cpp index 288e073259..b88f095ff9 100644 --- a/src/d/d_debug_viewer.cpp +++ b/src/d/d_debug_viewer.cpp @@ -8,8 +8,8 @@ #include "JSystem/JUtility/JUTDbPrint.h" #include "JSystem/JUtility/JUTReport.h" -J3DPacket* l_drawPacketList[1000]; -int l_drawPacketListNum; +DUSK_GAME_DATA J3DPacket* l_drawPacketList[1000]; +DUSK_GAME_DATA int l_drawPacketListNum; J3DPacket* dDbVw_setDrawPacketList(J3DPacket* i_packet, int i_bufferType) { if (i_packet == NULL) { diff --git a/src/d/d_demo.cpp b/src/d/d_demo.cpp index 2f099f2c2a..a45b681693 100644 --- a/src/d/d_demo.cpp +++ b/src/d/d_demo.cpp @@ -67,7 +67,7 @@ static void unpause_streams(bool require_prelaunch_hidden) { } // namespace #endif -s16 dDemo_c::m_branchId = -1; +DUSK_GAME_DATA s16 dDemo_c::m_branchId = -1; namespace { class jstudio_tAdaptor_message : public JStudio::TAdaptor_message { @@ -232,41 +232,41 @@ f32 dDemo_actor_c::getPrm_Morf() { } } -dDemo_system_c* dDemo_c::m_system; +DUSK_GAME_DATA dDemo_system_c* dDemo_c::m_system; -JStudio::TControl* dDemo_c::m_control; +DUSK_GAME_DATA JStudio::TControl* dDemo_c::m_control; -JStudio_JStage::TCreateObject* dDemo_c::m_stage; +DUSK_GAME_DATA JStudio_JStage::TCreateObject* dDemo_c::m_stage; -JStudio_JAudio2::TCreateObject* dDemo_c::m_audio; +DUSK_GAME_DATA JStudio_JAudio2::TCreateObject* dDemo_c::m_audio; -dDemo_particle_c* dDemo_c::m_particle; +DUSK_GAME_DATA dDemo_particle_c* dDemo_c::m_particle; -JStudio::TCreateObject* dDemo_c::m_message; +DUSK_GAME_DATA JStudio::TCreateObject* dDemo_c::m_message; -JStudio::TFactory* dDemo_c::m_factory; +DUSK_GAME_DATA JStudio::TFactory* dDemo_c::m_factory; -jmessage_tControl* dDemo_c::m_mesgControl; +DUSK_GAME_DATA jmessage_tControl* dDemo_c::m_mesgControl; -dDemo_object_c* dDemo_c::m_object; +DUSK_GAME_DATA dDemo_object_c* dDemo_c::m_object; -const u8* dDemo_c::m_data; +DUSK_GAME_DATA const u8* dDemo_c::m_data; -int dDemo_c::m_frame; +DUSK_GAME_DATA int dDemo_c::m_frame; -cXyz* dDemo_c::m_translation; +DUSK_GAME_DATA cXyz* dDemo_c::m_translation; -f32 dDemo_c::m_rotationY; +DUSK_GAME_DATA f32 dDemo_c::m_rotationY; -u32 dDemo_c::m_frameNoMsg; +DUSK_GAME_DATA u32 dDemo_c::m_frameNoMsg; -s32 dDemo_c::m_mode; +DUSK_GAME_DATA s32 dDemo_c::m_mode; -u32 dDemo_c::m_status; +DUSK_GAME_DATA u32 dDemo_c::m_status; -u16 dDemo_c::m_branchType; +DUSK_GAME_DATA u16 dDemo_c::m_branchType; -const u8* dDemo_c::m_branchData; +DUSK_GAME_DATA const u8* dDemo_c::m_branchData; #if DEBUG u16 dDemo_c::m_branchNum = 0; diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index 1f16b2f655..8552ead16e 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -20,7 +20,7 @@ #include "absl/container/flat_hash_map.h" #include "client/TracyScoped.hpp" #include "dusk/frame_interpolation.h" -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" #include "dusk/logging.h" static const void* getInterpKey(const void* base, int idx) { @@ -41,12 +41,12 @@ public: /* 0x14 */ GXColor field_0x14; /* 0x18 */ GXColor field_0x18; /* 0x1C */ TGXTexObj field_0x1c; - /* 0x3C */ GXTlutObj field_0x3c; + /* 0x3C */ TGXTlutObj field_0x3c; /* 0x48 */ s16 field_0x48; /* 0x4A */ s16 field_0x4a; /* 0x4C */ u8 field_0x4c; /* 0x50 */ TGXTexObj field_0x50; - /* 0x70 */ GXTlutObj field_0x70; + /* 0x70 */ TGXTlutObj field_0x70; /* 0x7C */ s16 field_0x7c; /* 0x7E */ s16 field_0x7e; /* 0x80 */ u8 field_0x80; @@ -100,7 +100,7 @@ public: u8 check() { return field_0x0; } int getCI() { return mCI; } TGXTexObj* getTexObj() { return &mTexObj; } - GXTlutObj* getTlutObj() { return &mTlutObj; } + TGXTlutObj* getTlutObj() { return &mTlutObj; } GXColor* getColor() { return &mColor; } f32 getS() { return mS; } f32 getT() { return mT; } @@ -110,7 +110,7 @@ public: /* 0x00 */ u8 field_0x0; /* 0x01 */ u8 mCI; /* 0x04 */ TGXTexObj mTexObj; - /* 0x24 */ GXTlutObj mTlutObj; + /* 0x24 */ TGXTlutObj mTlutObj; /* 0x30 */ GXColor mColor; /* 0x34 */ f32 mS; /* 0x38 */ f32 mT; @@ -188,6 +188,7 @@ void dDlst_window_c::setScissor(f32 xOrig, f32 yOrig, f32 width, f32 height) { } void dDlst_2DTri_c::draw() { + ZoneScoped; f32 f4; f32 f5; f32 f2 = cM_scos(field_0xc); @@ -224,6 +225,7 @@ void dDlst_2DTri_c::draw() { } void dDlst_2DQuad_c::draw() { + ZoneScoped; GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0); @@ -247,6 +249,7 @@ void dDlst_2DQuad_c::draw() { } void dDlst_2DPoint_c::draw() { + ZoneScoped; GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0); @@ -268,6 +271,7 @@ void dDlst_2DPoint_c::draw() { } void dDlst_2DT_c::draw() { + ZoneScoped; static GXColor l_color = {0xFF, 0xFF, 0xFF, 0xE0}; f32 var5 = field_0xe; f32 var6 = field_0x10; @@ -326,6 +330,7 @@ void dDlst_2DT_c::draw() { } void dDlst_2DT2_c::draw() { + ZoneScoped; GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XY, GX_F32, 0); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA6, 0); GXClearVtxDesc(); @@ -665,6 +670,7 @@ void dDlst_2DT2_c::init(ResTIMG* i_timg, f32 param_1, f32 param_2, f32 param_3, } void dDlst_2DM_c::draw() { + ZoneScoped; s16 r31 = field_0x22; s16 r30 = field_0x24; int r29 = field_0x22 + 256.0f; @@ -728,6 +734,7 @@ void dDlst_2DM_c::draw() { void dDlst_2Dm_c::draw() { + ZoneScoped; s16 r31 = field_0x48; s16 r30 = field_0x4a; int r29 = field_0x48 + 256.0f; @@ -794,6 +801,7 @@ void dDlst_2Dm_c::draw() { void dDlst_2DMt_c::draw() { + ZoneScoped; GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_S16, 0); GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); @@ -933,6 +941,7 @@ f32 cM_rnd_c::getValue(f32 param_0, f32 param_1) { } void dDlst_effectLine_c::draw() { + ZoneScoped; GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); @@ -1034,6 +1043,7 @@ void dDlst_shadowPoly_c::draw() { return; #endif + ZoneScoped; dDlst_shadowTri_c* tri = getTri(); GXBegin(GX_TRIANGLES, GX_VTXFMT0, mCount * 3); @@ -1610,6 +1620,7 @@ void dDlst_shadowControl_c::imageDraw(Mtx param_0) { } void dDlst_shadowControl_c::draw(Mtx param_0) { + ZoneScoped; static GXTevColorChan l_tevColorChan[4] = { GX_CH_RED, GX_CH_GREEN, @@ -1800,7 +1811,7 @@ int dDlst_shadowControl_c::setSimple(cXyz* param_0, f32 param_1, f32 param_2, cX return 1; } -TGXTexObj dDlst_shadowControl_c::mSimpleTexObj; +DUSK_GAME_DATA TGXTexObj dDlst_shadowControl_c::mSimpleTexObj; void dDlst_shadowControl_c::setSimpleTex(ResTIMG const* i_timg) { mDoLib_setResTimgObj(i_timg, &mSimpleTexObj, 0, NULL); @@ -1985,7 +1996,7 @@ int dDlst_list_c::set(dDlst_base_c**& p_start, dDlst_base_c**& p_end, dDlst_base return 1; } -#if TARGET_PC && (TRACY_ENABLE || PARTIAL_DEBUG) +#if DUSK_GFX_DEBUG_GROUPS static absl::flat_hash_map typeDrawNames; static const char* getTypeDrawName(dDlst_base_c* dlst) { @@ -2008,7 +2019,7 @@ void dDlst_list_c::draw(dDlst_base_c** p_start, dDlst_base_c** p_end) { for (; p_start < p_end; p_start++) { dDlst_base_c* dlst = *p_start; -#if TARGET_PC && (TRACY_ENABLE || PARTIAL_DEBUG) +#if DUSK_GFX_DEBUG_GROUPS const auto name = getTypeDrawName(dlst); GXScopedDebugGroup scope(name); #endif @@ -2016,15 +2027,15 @@ void dDlst_list_c::draw(dDlst_base_c** p_start, dDlst_base_c** p_end) { } } -dDlst_2DT2_c dDlst_list_c::mWipeDlst; +DUSK_GAME_DATA dDlst_2DT2_c dDlst_list_c::mWipeDlst; -GXColor dDlst_list_c::mWipeColor = {0, 0, 0, 0}; +DUSK_GAME_DATA GXColor dDlst_list_c::mWipeColor = {0, 0, 0, 0}; -u8 dDlst_list_c::mWipe; +DUSK_GAME_DATA u8 dDlst_list_c::mWipe; -f32 dDlst_list_c::mWipeRate; +DUSK_GAME_DATA f32 dDlst_list_c::mWipeRate; -f32 dDlst_list_c::mWipeSpeed; +DUSK_GAME_DATA f32 dDlst_list_c::mWipeSpeed; void dDlst_list_c::wipeIn(f32 i_wipeSpeed, GXColor& i_wipeColor) { mWipe = true; diff --git a/src/d/d_envse.cpp b/src/d/d_envse.cpp index cbcd32ccf7..6392048bfb 100644 --- a/src/d/d_envse.cpp +++ b/src/d/d_envse.cpp @@ -248,7 +248,7 @@ static leafdraw_method_class l_dEnvSe_Method = { (process_method_func)dEnvSe_Draw, }; -kankyo_process_profile_definition g_profile_ENVSE = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_ENVSE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_ev_camera.cpp b/src/d/d_ev_camera.cpp index 736f9f7a82..2650c2d05e 100644 --- a/src/d/d_ev_camera.cpp +++ b/src/d/d_ev_camera.cpp @@ -13,6 +13,8 @@ #include "d/actor/d_a_alink.h" #include +#include "helpers/string.hpp" + #ifdef __MWERKS__ #define LOAD_4BYTE_STRING_LITERAL(x) (*(u32*)(x)) #else @@ -46,7 +48,7 @@ int dCamera_c::StartEventCamera(int param_0, int param_1, ...) { for (int i = 0; i < 8; i++) { char* param_name = va_arg(args, char*); if (param_name != NULL) { - strcpy(mEventData.mEventParams[i].name, param_name); + SAFE_STRCPY(mEventData.mEventParams[i].name, param_name); mEventData.mEventParams[i].field_0x10 = va_arg(args, int); mEventData.mEventParams[i].value = va_arg(args, uintptr_t); } else { @@ -81,7 +83,7 @@ int dCamera_c::EndEventCamera(int param_1) { return 0; } -int dCamera_c::searchEventArgData(char* i_eventName) { +int dCamera_c::searchEventArgData(DUSK_CONST char* i_eventName) { int i; bool found_event = false; @@ -99,7 +101,7 @@ int dCamera_c::searchEventArgData(char* i_eventName) { return found_event ? i : -1; } -bool dCamera_c::getEvIntData(int* i_data, char* i_event) { +bool dCamera_c::getEvIntData(int* i_data, DUSK_CONST char* i_event) { if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); if (index == -1) { @@ -132,7 +134,7 @@ bool dCamera_c::getEvIntData(int* i_data, char* i_event) { return 1; } -bool dCamera_c::getEvFloatData(f32* i_data, char* i_event) { +bool dCamera_c::getEvFloatData(f32* i_data, DUSK_CONST char* i_event) { if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); if (index == -1) { @@ -161,7 +163,7 @@ bool dCamera_c::getEvFloatData(f32* i_data, char* i_event) { return 1; } -int dCamera_c::getEvFloatListData(f32** i_data, char* i_event) { +int dCamera_c::getEvFloatListData(f32** i_data, DUSK_CONST char* i_event) { int num = 0; if (chkFlag(0x20000000)) { @@ -193,7 +195,7 @@ int dCamera_c::getEvFloatListData(f32** i_data, char* i_event) { return num; } -int dCamera_c::getEvXyzListData(cXyz** i_data, char* i_event) { +int dCamera_c::getEvXyzListData(cXyz** i_data, DUSK_CONST char* i_event) { int num = 0; if (chkFlag(0x20000000)) { @@ -225,8 +227,8 @@ int dCamera_c::getEvXyzListData(cXyz** i_data, char* i_event) { return num; } -char* dCamera_c::getEvStringPntData(char* i_event) { - char* string = NULL; +char DUSK_CONST* dCamera_c::getEvStringPntData(DUSK_CONST char* i_event) { + char DUSK_CONST* string = NULL; if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); @@ -256,7 +258,7 @@ char* dCamera_c::getEvStringPntData(char* i_event) { return string; } -bool dCamera_c::getEvIntData(int* i_data, char* i_event, int param_2) { +bool dCamera_c::getEvIntData(int* i_data, DUSK_CONST char* i_event, int param_2) { if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); if (index == -1) { @@ -285,7 +287,7 @@ bool dCamera_c::getEvIntData(int* i_data, char* i_event, int param_2) { return 1; } -bool dCamera_c::getEvFloatData(f32* i_data, char* i_event, f32 param_2) { +bool dCamera_c::getEvFloatData(f32* i_data, DUSK_CONST char* i_event, f32 param_2) { if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); if (index == -1) { @@ -313,7 +315,7 @@ bool dCamera_c::getEvFloatData(f32* i_data, char* i_event, f32 param_2) { return 1; } -bool dCamera_c::getEvXyzData(cXyz* i_data, char* i_event, cXyz param_2) { +bool dCamera_c::getEvXyzData(cXyz* i_data, DUSK_CONST char* i_event, cXyz param_2) { if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); if (index == -1) { @@ -341,18 +343,23 @@ bool dCamera_c::getEvXyzData(cXyz* i_data, char* i_event, cXyz param_2) { return 1; } -bool dCamera_c::getEvStringData(char* i_data, char* i_event, char* param_2) { +#if TARGET_PC +template +bool dCamera_c::getEvStringData(char (&i_data)[N], char DUSK_CONST* i_event, char DUSK_CONST* param_2) { +#else +bool dCamera_c::getEvStringData(char* i_data, char DUSK_CONST* i_event, char DUSK_CONST* param_2) { +#endif if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); if (index == -1) { - strcpy(i_data, param_2); + SAFE_STRCPY(i_data, param_2); } else { - strcpy(i_data, (char*)mEventData.mEventParams[index].value); + SAFE_STRCPY(i_data, (char*)mEventData.mEventParams[index].value); } } else if (dComIfGp_evmng_getMySubstanceNum(mEventData.mStaffIdx, i_event) != 0) { - strcpy(i_data, dComIfGp_evmng_getMyStringP(mEventData.mStaffIdx, i_event)); + SAFE_STRCPY(i_data, dComIfGp_evmng_getMyStringP(mEventData.mStaffIdx, i_event)); } else { - strcpy(i_data, param_2); + SAFE_STRCPY(i_data, param_2); #if DEBUG if (mCurCamStyleTimer == 0 && mCamSetup.CheckFlag(0x40)) { OS_REPORT("camera: event: %16s: %s (d)\n", i_event, i_data); @@ -369,8 +376,13 @@ bool dCamera_c::getEvStringData(char* i_data, char* i_event, char* param_2) { return 1; } -char* dCamera_c::getEvStringPntData(char* i_event, char* param_1) { - char* string = NULL; +#if TARGET_PC +// Used in another TU, so force instantiation to avoid linker issues. +template bool dCamera_c::getEvStringData(char (&i_data)[12], DUSK_CONST char* i_event, char DUSK_CONST* param_2); +#endif + +char DUSK_CONST* dCamera_c::getEvStringPntData(DUSK_CONST char* i_event, char DUSK_CONST* param_1) { + char DUSK_CONST* string = NULL; if (chkFlag(0x20000000)) { int index = searchEventArgData(i_event); @@ -400,8 +412,8 @@ char* dCamera_c::getEvStringPntData(char* i_event, char* param_1) { return string; } -fopAc_ac_c* dCamera_c::getEvActor(char* i_event) { - char* string = getEvStringPntData(i_event); +fopAc_ac_c* dCamera_c::getEvActor(DUSK_CONST char* i_event) { + char DUSK_CONST* string = getEvStringPntData(i_event); if (string == NULL) { return NULL; } @@ -440,7 +452,7 @@ fopAc_ac_c* dCamera_c::getEvActor(char* i_event) { return actor; } -fopAc_ac_c* dCamera_c::getEvActor(char* i_event, char* param_1) { +fopAc_ac_c* dCamera_c::getEvActor(DUSK_CONST char* i_event, char DUSK_CONST* param_1) { char string[16]; string[0] = 0; getEvStringData(string, i_event, param_1); @@ -520,7 +532,7 @@ bool dCamera_c::fixedFrameEvCamera() { #if DEBUG if (strlen(fframe_p->mRelUseMask) != 2) { OSReport("camera: event: bad length -> xx\n"); - strcpy(fframe_p->mRelUseMask, "xx"); + SAFE_STRCPY(fframe_p->mRelUseMask, "xx"); JUTAssertion::showAssert(JUTAssertion::getSDevice(), "d_ev_camera.cpp", 0x32e, "0"); OSPanic("d_ev_camera.cpp", 0x32e, "Halt"); } @@ -613,7 +625,7 @@ bool dCamera_c::fixedFrameEvCamera() { } fframe_p->field_0x4 = relationalPos(fframe_p->mpRelActor, &sp44); - } else if (fframe_p->mRelUseMask[1] == 116) { + } else if (fframe_p->mRelUseMask[1] == 't') { fframe_p->field_0x4 = attentionPos(fframe_p->mpRelActor) + sp44; } else { fframe_p->field_0x4 = sp44; @@ -866,7 +878,7 @@ bool dCamera_c::fixedPositionEvCamera() { getEvFloatData(&fpos_p->field_0x38, "Radius", 100000.0f); getEvFloatData(&fpos_p->field_0x34, "StartRadius", fpos_p->field_0x38); fpos_p->field_0x1 = getEvFloatData(&fpos_p->field_0x2c, "Bank", 0.0f); - getEvStringData(&fpos_p->field_0x48, "RelUseMask", "o"); + getEvStringData(fpos_p->field_0x48, "RelUseMask", "o"); fpos_p->field_0x0 = getEvIntData(&fpos_p->field_0x4c, "Timer", -1); if ((fpos_p->field_0x40 = getEvActor("Target", "@PLAYER")) == NULL) { @@ -877,7 +889,7 @@ bool dCamera_c::fixedPositionEvCamera() { fpos_p->field_0x44 = fopAcM_GetID(fpos_p->field_0x40); fpos_p->field_0x3c = getEvActor("RelActor"); - if (fpos_p->field_0x3c && isRelChar(fpos_p->field_0x48)) { + if (fpos_p->field_0x3c && isRelChar(fpos_p->field_0x48[0])) { fpos_p->field_0x4 = relationalPos(fpos_p->field_0x3c, &sp24); } else { fpos_p->field_0x4 = sp24; @@ -1021,7 +1033,7 @@ bool dCamera_c::transEvCamera(int param_1) { getEvIntData(&trans->mTransType, "TransType", 0); trans->mRelActor = getEvActor("RelActor"); - getEvStringData(&trans->mRelUseMask, "RelUseMask", "--oo"); + getEvStringData(trans->mRelUseMask, "RelUseMask", "--oo"); getEvFloatData(&trans->mCushion, "Cushion", 1.0f); if (trans->mRelActor) { @@ -1034,36 +1046,36 @@ bool dCamera_c::transEvCamera(int param_1) { mAdditionVec = MidnaAdditionVec; } - if (trans->mRelUseMask == 119) { + if (trans->mRelUseMask[0] == 'w') { trans->mStartCenter += mAdditionVec; } - if (trans->mRelUseMask == 87) { + if (trans->mRelUseMask[0] == 'W') { trans->mStartCenter -= mAdditionVec; } - if (trans->field_0x49 == 119) { + if (trans->mRelUseMask[1] == 'w') { trans->mStartEye += mAdditionVec; } - if (trans->field_0x49 == 87) { + if (trans->mRelUseMask[1] == 'W') { trans->mStartEye -= mAdditionVec; } - if (trans->field_0x4a == 119) { + if (trans->mRelUseMask[2] == 'w') { trans->mCenter += mAdditionVec; } - if (trans->field_0x4a == 87) { + if (trans->mRelUseMask[2] == 'W') { trans->mCenter -= mAdditionVec; } - if (trans->field_0x4b == 119) { + if (trans->mRelUseMask[3] == 'w') { trans->mEye += mAdditionVec; } - if (trans->field_0x4b == 87) { + if (trans->mRelUseMask[3] == 'W') { trans->mEye -= mAdditionVec; } } - if (trans->field_0x49 == 114) { + if (trans->mRelUseMask[1] == 'r') { my_vec_0 = relationalPos(trans->mRelActor, &trans->mStartCenter); if ((mTicks & 1) != 0) { trans->mStartEye.x = -trans->mStartEye.x; @@ -1075,14 +1087,14 @@ bool dCamera_c::transEvCamera(int param_1) { } } - if (trans->mRelUseMask == 110 || trans->field_0x49 == 110) { + if (trans->mRelUseMask[0] == 'n' || trans->mRelUseMask[1] == 'n') { cSGlobe cStack_7b8(mEye - positionOf(trans->mRelActor)); cSAngle acStack_898 = cStack_7b8.U() - directionOf(trans->mRelActor); if (acStack_898 < cSAngle::_0) { - if (trans->mRelUseMask == 110) { + if (trans->mRelUseMask[0] == 'n') { trans->mStartCenter.x = -trans->mStartCenter.x; } - if (trans->field_0x49 == 110) { + if (trans->mRelUseMask[1] == 'n') { trans->mStartEye.x = -trans->mStartEye.x; } } @@ -1094,15 +1106,15 @@ bool dCamera_c::transEvCamera(int param_1) { } } - if (trans->field_0x4a == 110 || trans->field_0x4b == 110) { + if (trans->mRelUseMask[2] == 'n' || trans->mRelUseMask[3] == 'n') { cSGlobe cStack_7c0(mEye - positionOf(trans->mRelActor)); cSAngle acStack_89c = cStack_7c0.U() - directionOf(trans->mRelActor); if (acStack_89c < cSAngle::_0) { - if (trans->field_0x4a == 110) { + if (trans->mRelUseMask[2] == 'n') { trans->mCenter.x = -trans->mCenter.x; } - if (trans->field_0x4b == 110) { + if (trans->mRelUseMask[3] == 'n') { trans->mEye.x = -trans->mEye.x; } } @@ -1114,15 +1126,15 @@ bool dCamera_c::transEvCamera(int param_1) { } } - if (trans->mRelUseMask == 78 || trans->field_0x49 == 78) { + if (trans->mRelUseMask[0] == 'N' || trans->mRelUseMask[1] == 'N') { cSGlobe cStack_7c8(mEye - positionOf(trans->mRelActor)); cSAngle acStack_8a0 = cStack_7c8.U() - directionOf(trans->mRelActor); if (acStack_8a0 > cSAngle::_0) { - if (trans->mRelUseMask == 78) { + if (trans->mRelUseMask[0] == 'N') { trans->mStartCenter.x = -trans->mStartCenter.x; } - if (trans->field_0x49 == 78) { + if (trans->mRelUseMask[1] == 'N') { trans->mStartEye.x = -trans->mStartEye.x; } } @@ -1134,15 +1146,15 @@ bool dCamera_c::transEvCamera(int param_1) { } } - if (trans->field_0x4a == 78 || trans->field_0x4b == 78) { + if (trans->mRelUseMask[2] == 'N' || trans->mRelUseMask[3] == 'N') { cSGlobe cStack_7d0(mEye - positionOf(trans->mRelActor)); cSAngle acStack_8a4 = cStack_7d0.U() - directionOf(trans->mRelActor); if (acStack_8a4 > cSAngle::_0) { - if (trans->field_0x4a == 78) { + if (trans->mRelUseMask[2] == 'N') { trans->mCenter.x = -trans->mCenter.x; } - if (trans->field_0x4b == 78) { + if (trans->mRelUseMask[3] == 'N') { trans->mEye.x = -trans->mEye.x; } } @@ -1154,21 +1166,21 @@ bool dCamera_c::transEvCamera(int param_1) { } } - if (trans->mRelUseMask == 102) { + if (trans->mRelUseMask[0] == 'f') { cSGlobe cStack_7d8(trans->mStartCenter); cStack_7d8.U(directionOf(trans->mRelActor) + cStack_7d8.U()); trans->mStartCenter = attentionPos(trans->mRelActor) + cStack_7d8.Xyz(); - trans->mRelUseMask = 120; + trans->mRelUseMask[0] = 'x'; } - if (trans->field_0x49 == 102) { + if (trans->mRelUseMask[1] == 'f') { cSGlobe cStack_7e0(trans->mStartEye); cStack_7e0.U(directionOf(trans->mRelActor) + cStack_7e0.U()); trans->mStartEye = attentionPos(trans->mRelActor) + cStack_7e0.Xyz(); - trans->field_0x49 = 120; + trans->mRelUseMask[1] = 'x'; } - if (trans->field_0x4a == 112) { + if (trans->mRelUseMask[2] == 'p') { cXyz sp114(trans->mCenter); cXyz sp120 = relationalPos(trans->mRelActor, &sp114); f32 fVar1 = cXyz(sp120 - positionOf(mpPlayerActor)).abs(); @@ -1178,14 +1190,14 @@ bool dCamera_c::transEvCamera(int param_1) { if (fVar1 < fVar2) { trans->mCenter.x = -trans->mCenter.x; } - } else if (trans->field_0x4a == 102) { + } else if (trans->mRelUseMask[2] == 'f') { cSGlobe cStack_7e8(trans->mCenter); cStack_7e8.U(directionOf(trans->mRelActor) + cStack_7e8.U()); trans->mCenter = attentionPos(trans->mRelActor) + cStack_7e8.Xyz(); - trans->field_0x4a = 120; + trans->mRelUseMask[2] = 'x'; } - if (trans->field_0x4b == 112) { + if (trans->mRelUseMask[3] == 'p') { cXyz sp12c = trans->mEye; cXyz sp138(relationalPos(trans->mRelActor, &sp12c)); f32 fVar3 = cXyz(sp138 - positionOf(mpPlayerActor)).abs(); @@ -1195,7 +1207,7 @@ bool dCamera_c::transEvCamera(int param_1) { if (fVar3 < fVar4) { trans->mEye.x = -trans->mEye.x; } - } else if (trans->field_0x4b == 114) { + } else if (trans->mRelUseMask[3] == 'r') { my_vec_0 = relationalPos(trans->mRelActor, &trans->mCenter); if ((mTicks & 1) != 0) { trans->mEye.x = -trans->mEye.x; @@ -1205,19 +1217,19 @@ bool dCamera_c::transEvCamera(int param_1) { if (lineBGCheck(&my_vec_0, &my_vec_1, 0x4007)) { trans->mEye.x = -trans->mEye.x; } - } else if (trans->field_0x4b == 102) { + } else if (trans->mRelUseMask[3] == 'f') { cSGlobe cStack_7f0(trans->mEye); cStack_7f0.U(directionOf(trans->mRelActor) + cStack_7f0.U()); trans->mEye = attentionPos(trans->mRelActor) + cStack_7f0.Xyz(); - trans->field_0x4b = 120; + trans->mRelUseMask[3] = 'x'; } } else { - if (trans->field_0x4a == 97) { + if (trans->mRelUseMask[2] == 'a') { cXyz cStack_320 = dCamMath::xyzRotateY(trans->mCenter, cSAngle(mViewCache.mDirection.U().Inv())); trans->mCenter = mViewCache.mCenter + cStack_320; } - if (trans->field_0x4b == 97) { + if (trans->mRelUseMask[3] == 'a') { cXyz cStack_32c = dCamMath::xyzRotateY(trans->mEye, cSAngle(mViewCache.mDirection.U().Inv())); trans->mEye = mViewCache.mEye + cStack_32c; } @@ -1246,47 +1258,47 @@ bool dCamera_c::transEvCamera(int param_1) { } if (trans->mRelActor) { - if (trans->mRelUseMask == 116) { + if (trans->mRelUseMask[0] == 't') { pos.mXyz_1 = attentionPos(trans->mRelActor) + trans->mStartCenter; - } else if (trans->mRelUseMask == 99) { + } else if (trans->mRelUseMask[0] == 'c') { cSGlobe cStack_7f8(trans->mStartCenter); cStack_7f8.U(trans->field_0x60.U() + cStack_7f8.U()); pos.mXyz_1 = attentionPos(trans->mRelActor) + cStack_7f8.Xyz(); - } else if (trans->mRelUseMask == 119 || trans->mRelUseMask == 87) { + } else if (trans->mRelUseMask[0] == 'w' || trans->mRelUseMask[0] == 'W') { pos.mXyz_1 = relationalPos(trans->mRelActor, &trans->mStartCenter); } else { - if (isRelChar(trans->mRelUseMask)) { + if (isRelChar(trans->mRelUseMask[0])) { pos.mXyz_1 = relationalPos(trans->mRelActor, &trans->mStartCenter); } else { pos.mXyz_1 = trans->mStartCenter; } } - if (trans->field_0x49 == 116) { + if (trans->mRelUseMask[1] == 't') { pos.mXyz_0 = attentionPos(trans->mRelActor) + trans->mStartEye; - } else if (trans->field_0x49 == 99) { + } else if (trans->mRelUseMask[1] == 'c') { cSGlobe cStack_800(trans->mStartEye); cStack_800.U(trans->field_0x60.U() + cStack_800.U()); pos.mXyz_0 = attentionPos(trans->mRelActor) + cStack_800.Xyz(); - } else if (trans->field_0x49 == 119 || trans->field_0x49 == 87) { + } else if (trans->mRelUseMask[1] == 'w' || trans->mRelUseMask[1] == 'W') { pos.mXyz_0 = relationalPos(trans->mRelActor, &trans->mStartEye); } else { - if (isRelChar(trans->field_0x49)) { + if (isRelChar(trans->mRelUseMask[1])) { pos.mXyz_0 = relationalPos(trans->mRelActor, &trans->mStartEye); } else { pos.mXyz_0 = trans->mStartEye; } } - if (trans->field_0x4a == 116) { + if (trans->mRelUseMask[2] == 't') { pos2.mXyz_1 = attentionPos(trans->mRelActor) + trans->mCenter; - } else if (trans->field_0x4a == 99) { + } else if (trans->mRelUseMask[2] == 'c') { cSGlobe cStack_808(trans->mCenter); cStack_808.U(trans->field_0x60.U() + cStack_808.U()); pos2.mXyz_1 = attentionPos(trans->mRelActor) + cStack_808.Xyz(); - } else if (trans->field_0x4a == 119 || trans->field_0x4a == 87) { + } else if (trans->mRelUseMask[2] == 'w' || trans->mRelUseMask[2] == 'W') { pos2.mXyz_1 = relationalPos(trans->mRelActor, &trans->mCenter); - } else if (isRelChar(trans->field_0x4a)) { + } else if (isRelChar(trans->mRelUseMask[2])) { pos2.mXyz_1 = relationalPos(trans->mRelActor, &trans->mCenter); } else if (trans->mTransType == 2) { pos2.mXyz_1 = dCamMath::xyzRotateY(trans->mCenter, directionOf(trans->mRelActor)); @@ -1294,16 +1306,16 @@ bool dCamera_c::transEvCamera(int param_1) { pos2.mXyz_1 = trans->mCenter; } - if (trans->field_0x4b == 116) { + if (trans->mRelUseMask[3] == 't') { pos2.mXyz_0 = attentionPos(trans->mRelActor) + trans->mEye; - } else if (trans->field_0x4b == 99) { + } else if (trans->mRelUseMask[3] == 'c') { cSGlobe cStack_810(trans->mEye); cStack_810.U(trans->field_0x60.U() + cStack_810.U()); pos2.mXyz_0 = attentionPos(trans->mRelActor) + cStack_810.Xyz(); } else { - if (trans->field_0x4b == 119 || trans->field_0x4b == 87) { + if (trans->mRelUseMask[3] == 'w' || trans->mRelUseMask[3] == 'W') { pos2.mXyz_0 = relationalPos(trans->mRelActor, &trans->mEye); - } else if (isRelChar(trans->field_0x4b)) { + } else if (isRelChar(trans->mRelUseMask[3])) { pos2.mXyz_0 = relationalPos(trans->mRelActor, &trans->mEye); } else if (trans->mTransType == 2) { pos2.mXyz_0 = dCamMath::xyzRotateY(trans->mEye, directionOf(trans->mRelActor)); @@ -3385,7 +3397,7 @@ bool dCamera_c::fixedFramesEvCamera() { fframes_p->field_0x38 = 9999; int substanceNum; - char* key = "Centers"; + char DUSK_CONST* key = "Centers"; if ((substanceNum = dComIfGp_evmng_getMySubstanceNum(mEventData.mStaffIdx, key)) != 0) { fframes_p->field_0x1c[1] = dComIfGp_evmng_getMyXyzP(mEventData.mStaffIdx, key); if (fframes_p->field_0x38 > substanceNum) { @@ -3420,11 +3432,11 @@ bool dCamera_c::fixedFramesEvCamera() { fframes_p->field_0x0 = getEvIntData(&fframes_p->mTimer, "Timer", const_1_val); - getEvStringData(&fframes_p->mRelUseMask, "RelUseMask", "oo"); + getEvStringData(fframes_p->mRelUseMask, "RelUseMask", "oo"); #if DEBUG - if (strlen(&fframes_p->mRelUseMask) != 2) { + if (strlen(fframes_p->mRelUseMask) != 2) { OSReport("camera: event: bad length -> xx\n"); - strcpy(&fframes_p->mRelUseMask, "xx"); + SAFE_STRCPY(fframes_p->mRelUseMask, "xx"); JUTAssertion::showAssert(JUTAssertion::getSDevice(), "d_ev_camera.cpp", 0x129c, "Halt"); OSPanic("d_ev_camera.cpp", 0x129c, "Halt"); } @@ -3442,13 +3454,13 @@ bool dCamera_c::fixedFramesEvCamera() { sp30 = fframes_p->field_0x1c[1][iVar1]; sp3c = fframes_p->field_0x1c[0][iVar1]; - if (fframes_p->mRelActor && fframes_p->mRelUseMask == 111) { + if (fframes_p->mRelActor && fframes_p->mRelUseMask[0] == 111) { fframes_p->field_0x4 = relationalPos(fframes_p->mRelActor, &sp30); } else { fframes_p->field_0x4 = sp30; } - if (fframes_p->mRelActor && fframes_p->field_0x31 == 111) { + if (fframes_p->mRelActor && fframes_p->mRelUseMask[1] == 111) { fframes_p->field_0x10 = relationalPos(fframes_p->mRelActor, &sp3c); } else { fframes_p->field_0x10 = sp3c; @@ -3488,7 +3500,7 @@ bool dCamera_c::bSplineEvCamera() { if (mCurCamStyleTimer == 0) { bSpline->field_0x1c = 0; bSpline->field_0x10 = 9999; - char* key = "Centers"; + char DUSK_CONST* key = "Centers"; int iVar1 = getEvXyzListData(&bSpline->mCenters, key); if (iVar1 != 0) { if (bSpline->field_0x10 > iVar1) { @@ -3959,7 +3971,7 @@ bool dCamera_c::bspTransEvCamera() { bspTrans->mSet1 = 0; char use1[8]; - strcpy(use1, "xxxxxx"); + SAFE_STRCPY(use1, "xxxxxx"); iVar1 = getEvFloatListData(&bspTrans->mSet1, "Set1"); if (iVar1 != 0) { @@ -3970,7 +3982,7 @@ bool dCamera_c::bspTransEvCamera() { #if DEBUG if (strlen(use1) != 6) { OSReport("camera: event: bad length -> xxxxxx\n"); - strcpy(use1, "xxxxxx"); + SAFE_STRCPY(use1, "xxxxxx"); JUTAssertion::showAssert(JUTAssertion::getSDevice(), "d_ev_camera.cpp", 0x14f9, "0"); OSPanic("d_ev_camera.cpp", 0x14f9, "Halt"); } @@ -3979,7 +3991,7 @@ bool dCamera_c::bspTransEvCamera() { bspTrans->mSet2 = 0; char use2[8]; - strcpy(use2, "xxxxxx"); + SAFE_STRCPY(use2, "xxxxxx"); iVar1 = getEvFloatListData(&bspTrans->mSet2, "Set2"); if (iVar1 != 0) { @@ -3990,7 +4002,7 @@ bool dCamera_c::bspTransEvCamera() { #if DEBUG if (strlen(use2) != 6) { OSReport_Error("camera: event: bad length -> xxxxxx\n"); - strcpy(use2, "xxxxxx"); + SAFE_STRCPY(use2, "xxxxxx"); JUTAssertion::showAssert(JUTAssertion::getSDevice(), "d_ev_camera.cpp", 0x1509, "0"); OSPanic("d_ev_camera.cpp", 0x1509, "Halt"); } @@ -4000,12 +4012,12 @@ bool dCamera_c::bspTransEvCamera() { bspTrans->mRelActorID = -1; bspTrans->mRelActor = getEvActor("RelActor"); if (bspTrans->mRelActor) { - getEvStringData(&bspTrans->mRelUseMask, "RelUseMask", "oo"); + getEvStringData(bspTrans->mRelUseMask, "RelUseMask", "oo"); #if DEBUG - if (strlen(&bspTrans->mRelUseMask) != 2) { + if (strlen(bspTrans->mRelUseMask) != 2) { OSReport_Error("camera: event: bad length -> xx\n"); - strcpy(&bspTrans->mRelUseMask, "xx"); + SAFE_STRCPY(bspTrans->mRelUseMask, "xx"); JUTAssertion::showAssert(JUTAssertion::getSDevice(), "d_ev_camera.cpp", 0x1515, "0"); OSPanic("d_ev_camera.cpp", 0x1515, "Halt"); } @@ -4041,13 +4053,13 @@ bool dCamera_c::bspTransEvCamera() { } pos; if (bspTrans->mRelActor != NULL) { - if (isRelChar(bspTrans->mRelUseMask)) { + if (isRelChar(bspTrans->mRelUseMask[0])) { pos.sp48 = relationalPos(bspTrans->mRelActor, &bspTrans->field_0x94); } else { pos.sp48 = bspTrans->field_0x94; } - if (isRelChar(bspTrans->field_0xb9)) { + if (isRelChar(bspTrans->mRelUseMask[1])) { pos.sp3c = relationalPos(bspTrans->mRelActor, &bspTrans->field_0xa0); } else { pos.sp3c = bspTrans->field_0xa0; diff --git a/src/d/d_event.cpp b/src/d/d_event.cpp index 73891276df..b17ebf61f0 100644 --- a/src/d/d_event.cpp +++ b/src/d/d_event.cpp @@ -13,6 +13,8 @@ #include "SSystem/SComponent/c_counter.h" #include +#include "helpers/string.hpp" + namespace { static u8 event_debug_evnt() { #if DEBUG @@ -229,7 +231,7 @@ int dEvt_control_c::commonCheck(dEvt_order_c* order, u16 condition, u16 command) } int dEvt_control_c::talkCheck(dEvt_order_c* order) { - char* eventname = "DEFAULT_TALK"; + DUSK_CONST char* eventname = "DEFAULT_TALK"; fopAc_ac_c* actor = order->mpTargetActor; if ((fopAcM_GetName(actor) == fpcNm_Tag_Mhint_e && ((daTagMhint_c*)actor)->checkNoAttention()) || (fopAcM_GetName(actor) == fpcNm_Tag_Mstop_e && ((daTagMstop_c*)actor)->checkNoAttention()) || @@ -756,8 +758,8 @@ int dEv_defaultSkipZev(void* actor, int parameter) { char* skipName; switch (parameter) { case 0: - strcpy(eventName, data->data.event_name); - strcat(eventName, "$0"); + SAFE_STRCPY(eventName, data->data.event_name); + SAFE_STRCAT(eventName, "$0"); eventID = dComIfGp_getEventManager().getEventIdx(eventName, 0xFF, -1); OS_REPORT("%06d: event: [%d] %s!\n", g_Counter.mCounter0, eventID, eventName); break; @@ -804,8 +806,8 @@ int dEv_defaultSkipStb(void* actor, int parameter) { char* skipName; switch (parameter) { case 0: - strcpy(eventName, data->data.event_name); - strcat(eventName, "$0"); + SAFE_STRCPY(eventName, data->data.event_name); + SAFE_STRCAT(eventName, "$0"); eventID = dComIfGp_getEventManager().getEventIdx(eventName, 0xFF, -1); OS_REPORT("%06d: event: [%d] %s!\n", g_Counter.mCounter0, eventID, eventName); break; @@ -849,9 +851,9 @@ void dEvt_control_c::setSkipProc(void* skipActor, dEvt_SkipCb skipCb, int skipPa mSkipParameter = skipParameter; } -void dEvt_control_c::setSkipZev(void* skipActor, char* eventName) { +void dEvt_control_c::setSkipZev(void* skipActor, DUSK_CONST char* eventName) { setSkipProc(skipActor, dEv_defaultSkipZev, 1); - strcpy(mSkipEventName, eventName); + SAFE_STRCPY(mSkipEventName, eventName); } void dEvt_control_c::onSkipFade() { @@ -1305,7 +1307,7 @@ dEvt_info_c::dEvt_info_c() { mIndex = 0; } -void dEvt_info_c::setEventName(char* name) { +void dEvt_info_c::setEventName(DUSK_CONST char* name) { if (name == NULL) { mEventId = -1; } else { diff --git a/src/d/d_event_manager.cpp b/src/d/d_event_manager.cpp index 598b973b84..154a1c9288 100644 --- a/src/d/d_event_manager.cpp +++ b/src/d/d_event_manager.cpp @@ -15,6 +15,8 @@ #include "SSystem/SComponent/c_counter.h" #include +#include "helpers/string.hpp" + #if DEBUG static dEvM_HIO_c l_HIO; #endif @@ -328,7 +330,7 @@ int dEvent_manager_c::create() { return 1; } -bool dEvent_manager_c::setObjectArchive(char* arcname) { +bool dEvent_manager_c::setObjectArchive(DUSK_CONST char* arcname) { void* rt = NULL; if (arcname != NULL) { @@ -388,7 +390,7 @@ void dEvent_manager_c::roomInit(int roomNo) { } char arcname[8]; - strcpy(arcname, dComIfG_getRoomArcName(roomNo)); + SAFE_STRCPY(arcname, dComIfG_getRoomArcName(roomNo)); char* res = (char*)dComIfG_getStageRes(arcname, DataFileName); int i; @@ -836,7 +838,7 @@ s16 dEvent_manager_c::getEventIdx(const char* eventName, u8 mapToolID, s32 roomN case dStage_MapEvent_dt_TYPE_STB: return getEventIdx(mapdata->data.event_name, 0xFF, roomNo); case dStage_MapEvent_dt_TYPE_MAPTOOLCAMERA: - sprintf(map_tool_name, "MapToolCamera%d", mapToolID); + SAFE_SPRINTF(map_tool_name, "MapToolCamera%d", mapToolID); return getEventIdx(map_tool_name, 0xFF, roomNo); default: JUT_ASSERT(1278, FALSE); @@ -876,7 +878,7 @@ s16 dEvent_manager_c::getEventIdx(fopAc_ac_c* actor, u8 mapToolID) { case dStage_MapEvent_dt_TYPE_STB: return getEventIdx(actor, mapdata->data.event_name, 0xFF); case dStage_MapEvent_dt_TYPE_MAPTOOLCAMERA: - sprintf(map_tool_name, "MapToolCamera%d", mapToolID); + SAFE_SPRINTF(map_tool_name, "MapToolCamera%d", mapToolID); return getEventIdx(actor, map_tool_name, 0xFF); default: JUT_ASSERT(1341, FALSE); @@ -901,7 +903,7 @@ s16 dEvent_manager_c::getEventIdx(fopAc_ac_c* actor, const char* eventName, u8 m case dStage_MapEvent_dt_TYPE_STB: return getEventIdx(actor, mapdata->data.event_name, 0xFF); case dStage_MapEvent_dt_TYPE_MAPTOOLCAMERA: - sprintf(map_tool_name, "MapToolCamera%d", mapToolID); + SAFE_SPRINTF(map_tool_name, "MapToolCamera%d", mapToolID); return getEventIdx(actor, map_tool_name, 0xFF); default: JUT_ASSERT(1376, FALSE); @@ -918,7 +920,7 @@ s16 dEvent_manager_c::getEventIdx(fopAc_ac_c* actor, const char* eventName, u8 m dEvDtBase_c actor_event; if (type < BASE_ROOM0 || BASE_ROOM5 < type || actorRoomNo == mEventList[type].roomNo()) { if (actor != NULL && type == BASE_ACTOR) { - char* arcname = actor->eventInfo.getArchiveName(); + DUSK_CONST char* arcname = actor->eventInfo.getArchiveName(); if (arcname != NULL) { char* data = (char*)dComIfG_getObjectRes(arcname, DataFileName); actor_event.init(data, -1); @@ -1040,7 +1042,7 @@ int dEvent_manager_c::getMyStaffId(const char* staffName, fopAc_ac_c* actor, int dEvDtStaff_c* staff = getBase().getStaffP(staff_id); if (staff->getType() != dEvDtStaff_c::TYPE_ALL) { char buf[20]; - strcpy(buf, staff->getName()); + SAFE_STRCPY(buf, staff->getName()); char* ptr = NULL; if (!hasDp) { @@ -1286,7 +1288,7 @@ int dEvent_manager_c::getEventPrio(fopAc_ac_c* actor, s16 evCompositId) { dEvDtBase_c eventBase; if (getTypeCompositId(evCompositId) == 2 && actor != NULL) { - char* arcname = actor->eventInfo.getArchiveName(); + DUSK_CONST char* arcname = actor->eventInfo.getArchiveName(); if (arcname != NULL) { char* data = (char*)dComIfG_getObjectRes(arcname, DataFileName); eventBase.init(data, -1); @@ -1310,7 +1312,7 @@ void dEvent_manager_c::issueStaff(const char* staffname) { fopAcM_Search((fopAcIt_JudgeFunc)extraOnObjectCallBack, NULL); } else { char nameBuf[32]; - strcpy(nameBuf, staffname); + SAFE_STRCPY(nameBuf, staffname); fopAc_ac_c* actor = fopAcM_searchFromName4Event(nameBuf, -1); fopAcM_OnStatus(actor, fopAcStts_STAFF_EXTRA_e); } @@ -1321,7 +1323,7 @@ void dEvent_manager_c::cancelStaff(const char* staffname) { fopAcM_Search((fopAcIt_JudgeFunc)extraOffObjectCallBack, NULL); } else { char nameBuf[32]; - strcpy(nameBuf, staffname); + SAFE_STRCPY(nameBuf, staffname); fopAc_ac_c* actor = fopAcM_searchFromName4Event(nameBuf, -1); fopAcM_OffStatus(actor, fopAcStts_STAFF_EXTRA_e); } diff --git a/src/d/d_eye_hl.cpp b/src/d/d_eye_hl.cpp index 16161b5ee7..80cc416f17 100644 --- a/src/d/d_eye_hl.cpp +++ b/src/d/d_eye_hl.cpp @@ -35,7 +35,7 @@ void dEyeHL_c::remove() { dEyeHL_mng_c::remove(this); } -dEyeHL_c* dEyeHL_mng_c::m_obj; +DUSK_GAME_DATA dEyeHL_c* dEyeHL_mng_c::m_obj; void dEyeHL_mng_c::update() { dEyeHL_c* obj = m_obj; diff --git a/src/d/d_file_sel_info.cpp b/src/d/d_file_sel_info.cpp index 0c987e6d63..e107d6dacc 100644 --- a/src/d/d_file_sel_info.cpp +++ b/src/d/d_file_sel_info.cpp @@ -14,6 +14,7 @@ #include #include +#include "helpers/string.hpp" #include "dusk/version.hpp" dFile_info_c::dFile_info_c(JKRArchive* i_archive, u8 param_1) { @@ -80,9 +81,11 @@ void dFile_info_c::screenSet() { info_text[2] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_time01')); info_text[3] = (J2DTextBox*)mFileInfo.Scr->search(MULTI_CHAR('w_ptim01')); +#define INFO_TEXT_SIZE 0x40 + for (int i = 0; i < 4; i++) { info_text[i]->setFont(mFileInfo.mFont); - info_text[i]->setString(0x40, ""); + info_text[i]->setString(INFO_TEXT_SIZE, ""); } mPlayerName = info_text[0]->getStringPtr(); mSaveStatus = info_text[1]->getStringPtr(); @@ -99,9 +102,9 @@ int dFile_info_c::setSaveData(dSv_save_c* i_savedata, BOOL i_validChksum, u8 i_d i_savedata->getPlayer().getPlayerStatusA().setLife(dComIfGs_getLife()); setHeartCnt(i_savedata); i_savedata->getPlayer().getPlayerStatusA().setLife(12); - strcpy(mPlayerName, dComIfGs_getPlayerName()); - strcpy(mSaveDate, ""); - strcpy(mPlayTime, ""); + SAFE_STRCPY(mPlayerName, dComIfGs_getPlayerName()); + SAFE_STRCPY(mSaveDate, ""); + SAFE_STRCPY(mPlayTime, ""); dMeter2Info_getString(0x4D, mSaveStatus, NULL); // New Quest Log result = 2; } else { @@ -110,7 +113,7 @@ int dFile_info_c::setSaveData(dSv_save_c* i_savedata, BOOL i_validChksum, u8 i_d } } else { setHeartCnt(i_savedata); - strcpy(mPlayerName, player_name); + SAFE_STRCPY(mPlayerName, player_name); setSaveDate(i_savedata); setPlayTime(i_savedata); result = 0; @@ -173,13 +176,13 @@ void dFile_info_c::setSaveDate(dSv_save_c* i_savedata) { #if TARGET_PC if (dusk::version::isRegionJpn()) { - sprintf(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday, + SAFE_SPRINTF(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday, time.hour, time.min); } else if (dusk::version::isRegionPal() && dComIfGs_getPalLanguage() != dSv_player_config_c::LANGUAGE_ENGLISH) { - sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mday, time.mon + 1, time.year, time.hour, + SAFE_SPRINTF(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mday, time.mon + 1, time.year, time.hour, time.min); } else { - sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mon + 1, time.mday, time.year, time.hour, + SAFE_SPRINTF(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mon + 1, time.mday, time.year, time.hour, time.min); } #elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN) @@ -204,11 +207,11 @@ void dFile_info_c::setPlayTime(dSv_save_c* i_savedata) { // 3599940 = 999:59 in seconds if (time >= 3599940) { - sprintf(mPlayTime, "999:59"); + SAFE_SPRINTF(mPlayTime, "999:59"); } else { u32 min = (time % 3600) / 60; u32 hours = time / 3600; - sprintf(mPlayTime, "%d:%02d", hours, min); + SAFE_SPRINTF(mPlayTime, "%d:%02d", hours, min); } } diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index 17d5f2c4e4..f57265aa77 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -23,6 +23,22 @@ #include "m_Do/m_Do_graphic.h" #include +#if TARGET_PC +#include "dusk/menu_pointer.h" +#include "helpers/string.hpp" + +namespace { +constexpr u8 pointer_target(u8 group, u8 index) noexcept { + return static_cast((group << 4) | (index & 0x0F)); +} + +constexpr u8 s_pointerDataSelectTarget = 0; +constexpr u8 s_pointerMenuSelectTarget = 1; +constexpr u8 s_pointerCopySelectTarget = 2; +constexpr u8 s_pointerYesNoSelectTarget = 3; +} // namespace +#endif + static s32 SelStartFrameTbl[3] = { 59, 99, @@ -754,8 +770,147 @@ void dFile_select_c::dataSelectInit() { } } +#if TARGET_PC +bool dFile_select_c::pointerDataSelect() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + for (u8 i = 0; i < 3; ++i) { + if (!dusk::menu_pointer::hit_pane(mSelFilePanes[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerDataSelectTarget, i)); + const bool clicked = dusk::menu_pointer::consume_click(); + if (mSelectNum != i) { + mDoAud_seStart(Z2SE_FILE_SELECT_CURSOR, NULL, 0, 0); + mLastSelectNum = mSelectNum; + mSelectNum = i; + if (clicked) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerDataSelectTarget, i)); + } + dataSelectAnmSet(); + mDataSelProc = DATASELPROC_DATA_SELECT_MOVE_ANIME; + return true; + } + if (clicked) { + dataSelectStart(); + return true; + } + } + return false; +} + +bool dFile_select_c::pointerMenuSelect() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + for (u8 i = 0; i < 3; ++i) { + if (!dusk::menu_pointer::hit_pane(m3mSelPane[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerMenuSelectTarget, i)); + const bool clicked = dusk::menu_pointer::consume_click(); + if (!mIsDataNew[mSelectNum] && mSelectMenuNum != i) { + mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON, NULL, 0, 0); + mLastSelectMenuNum = mSelectMenuNum; + mSelectMenuNum = i; + if (clicked) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerMenuSelectTarget, i)); + } + menuSelectAnmSet(); + mDataSelProc = DATASELPROC_MENU_SELECT_MOVE_ANM; + return true; + } + if (clicked) { + menuSelectStart(); + return true; + } + } + return false; +} + +bool dFile_select_c::pointerCopyDataToSelect() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + for (u8 i = 0; i < 2; ++i) { + if (!dusk::menu_pointer::hit_pane(mCpSelPane[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerCopySelectTarget, i)); + const bool clicked = dusk::menu_pointer::consume_click(); + if (field_0x026b != i) { + mDoAud_seStart(Z2SE_FILE_SELECT_CURSOR, NULL, 0, 0); + field_0x026c = field_0x026b; + field_0x026b = i; + if (clicked) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerCopySelectTarget, i)); + } + copyDataToSelectMoveAnmSet(); + mDataSelProc = DATASELPROC_COPY_DATA_TO_SELECT_MOVE_ANM; + return true; + } + if (clicked) { + copyDataToSelectStart(); + return true; + } + } + return false; +} + +bool dFile_select_c::pointerYesNoSelect(bool errorSelect) { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + for (u8 i = 0; i < 2; ++i) { + if (!dusk::menu_pointer::hit_pane(mYnSelPane[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerYesNoSelectTarget, i)); + const bool clicked = + (!errorSelect || field_0x0268 == i) && dusk::menu_pointer::consume_click(); + if (field_0x0268 != i) { + field_0x0269 = field_0x0268; + field_0x0268 = i; + if (errorSelect) { + errCurMove(0); + return false; + } else { + mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON, NULL, 0, 0); + if (clicked) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerYesNoSelectTarget, i)); + } + yesnoSelectAnmSet(); + mDataSelProc = DATASELPROC_YES_NO_CURSOR_MOVE_ANM; + return true; + } + } + if (clicked) { + if (errorSelect) { + if (field_0x0268 != 0) { + mDoAud_seStart(Z2SE_SY_CURSOR_OK, 0, 0, 0); + } else { + mDoAud_seStart(Z2SE_SY_CURSOR_CANCEL, 0, 0, 0); + } + mSelIcon->setAlphaRate(0.0f); + } else { + yesNoSelectStart(); + } + return true; + } + } + return false; +} +#endif + // handles switching between quest logs void dFile_select_c::dataSelect() { +#if TARGET_PC + if (pointerDataSelect()) { + return; + } +#endif + stick->checkTrigger(); // If A or Start was pressed @@ -799,6 +954,9 @@ static u16 msgTbl[3] = { }; void dFile_select_c::dataSelectStart() { +#if TARGET_PC + dusk::menu_pointer::clear_deferred_activation(dusk::menu_pointer::Context::FileSelect); +#endif mSelIcon->setAlphaRate(0.0f); if (mIsNoData[mSelectNum]) { @@ -947,6 +1105,17 @@ void dFile_select_c::dataSelectAnmSet() { } void dFile_select_c::dataSelectMoveAnime() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + if (mSelectNum != 0xFF && dusk::menu_pointer::hit_pane(mSelFilePanes[mSelectNum], 8.0f)) { + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerDataSelectTarget, mSelectNum)); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerDataSelectTarget, mSelectNum)); + } + } +#endif bool iVar7 = true; bool iVar6 = true; bool bVar1 = true; @@ -995,6 +1164,14 @@ void dFile_select_c::dataSelectMoveAnime() { mSelFilePanes[mLastSelectNum]->getPanePtr()->setAnimation((J2DAnmTransform*)NULL); } +#if TARGET_PC + if (dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerDataSelectTarget, mSelectNum))) { + dataSelectStart(); + return; + } +#endif mDataSelProc = DATASELPROC_DATA_SELECT; } } @@ -1159,6 +1336,12 @@ void dFile_select_c::selectDataOpenEraseMove() { // Handles selecting between copy / start / delete menus in quest log void dFile_select_c::menuSelect() { +#if TARGET_PC + if (pointerMenuSelect()) { + return; + } +#endif + stick->checkTrigger(); // if a was pressed, do the menu selection process @@ -1189,6 +1372,9 @@ void dFile_select_c::menuSelect() { // Handles copy / start / delete actions depending on which menu is selected from menuSelect void dFile_select_c::menuSelectStart() { +#if TARGET_PC + dusk::menu_pointer::clear_deferred_activation(dusk::menu_pointer::Context::FileSelect); +#endif #if TARGET_PC if (!dusk::getSettings().game.hideTvSettingsScreen || mSelectMenuNum != 1) { mDoAud_seStart(Z2SE_SY_CURSOR_OK, NULL, 0, 0); @@ -1310,6 +1496,19 @@ void dFile_select_c::menuSelectAnmSet() { } void dFile_select_c::menuSelectMoveAnm() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + if (mSelectMenuNum != 0xFF && + dusk::menu_pointer::hit_pane(m3mSelPane[mSelectMenuNum], 8.0f)) + { + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerMenuSelectTarget, mSelectMenuNum)); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerMenuSelectTarget, mSelectMenuNum)); + } + } +#endif bool tmp1 = true; if (mSelectMenuNum != 0xFF && @@ -1367,6 +1566,14 @@ void dFile_select_c::menuSelectMoveAnm() { m3mSelPane[mLastSelectMenuNum]->getPanePtr()->setAnimation((J2DAnmTransform*)NULL); } +#if TARGET_PC + if (dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerMenuSelectTarget, mSelectMenuNum))) { + menuSelectStart(); + return; + } +#endif mDataSelProc = DATASELPROC_MENU_SELECT; } } @@ -1666,7 +1873,7 @@ void dFile_select_c::copySelMoveAnmInitSet(int param_0, int param_1) { void dFile_select_c::setSaveDataForCopySel() { static u64 l_tagName101[2] = {MULTI_CHAR('w_nun01'), MULTI_CHAR('w_nun02')}; - static char* l_numTex[3] = {"tt_1_metal_40x40.bti", "tt_2_metal_40x40.bti", + static DUSK_CONST char* l_numTex[3] = {"tt_1_metal_40x40.bti", "tt_2_metal_40x40.bti", "tt_3_metal_40x40.bti"}; SaveDataBuf* pSave = mSaveData; int notSelectedIndex = 0; @@ -1696,6 +1903,12 @@ void dFile_select_c::setSaveDataForCopySel() { } void dFile_select_c::copyDataToSelect() { +#if TARGET_PC + if (pointerCopyDataToSelect()) { + return; + } +#endif + stick->checkTrigger(); if (mDoCPd_c::getTrigA(PAD_1)) { @@ -1720,6 +1933,9 @@ void dFile_select_c::copyDataToSelect() { } void dFile_select_c::copyDataToSelectStart() { +#if TARGET_PC + dusk::menu_pointer::clear_deferred_activation(dusk::menu_pointer::Context::FileSelect); +#endif mDoAud_seStart(Z2SE_SY_CURSOR_OK, NULL, 0, 0); mCpDataToNum = getCptoNum(field_0x026b); @@ -1785,6 +2001,19 @@ void dFile_select_c::copyDataToSelectMoveAnmSet() { } void dFile_select_c::copyDataToSelectMoveAnm() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + if (field_0x026b != 0xFF && + dusk::menu_pointer::hit_pane(mCpSelPane[field_0x026b], 8.0f)) + { + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerCopySelectTarget, field_0x026b)); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerCopySelectTarget, field_0x026b)); + } + } +#endif bool iVar7 = true; bool iVar6 = true; bool bVar1 = true; @@ -1834,6 +2063,14 @@ void dFile_select_c::copyDataToSelectMoveAnm() { mSelIcon2->setAlphaRate(1.0f); } +#if TARGET_PC + if (dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerCopySelectTarget, field_0x026b))) { + copyDataToSelectStart(); + return; + } +#endif mDataSelProc = DATASELPROC_COPY_DATA_TO_SELECT; } } @@ -2103,6 +2340,12 @@ void dFile_select_c::yesnoCursorShow() { } void dFile_select_c::YesNoSelect() { +#if TARGET_PC + if (pointerYesNoSelect(false)) { + return; + } +#endif + stick->checkTrigger(); if (mDoCPd_c::getTrigA(PAD_1)) { @@ -2127,6 +2370,9 @@ void dFile_select_c::YesNoSelect() { } void dFile_select_c::yesNoSelectStart() { +#if TARGET_PC + dusk::menu_pointer::clear_deferred_activation(dusk::menu_pointer::Context::FileSelect); +#endif if (field_0x0268 != 0) { mDoAud_seStart(Z2SE_SY_CURSOR_OK, NULL, 0, 0); field_0x03b1 = 1; @@ -2282,10 +2528,31 @@ void dFile_select_c::YesNoCancelMove() { } void dFile_select_c::yesNoCursorMoveAnm() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::FileSelect); + if (field_0x0268 != 0xFF && + dusk::menu_pointer::hit_pane(mYnSelPane[field_0x0268], 8.0f)) + { + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerYesNoSelectTarget, field_0x0268)); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerYesNoSelectTarget, field_0x0268)); + } + } +#endif bool isYnSelMove = yesnoSelectMoveAnm(); bool isYnWakuAlpha = yesnoWakuAlpahAnm(field_0x0269); if (isYnSelMove == true && isYnWakuAlpha == true) { yesnoCursorShow(); +#if TARGET_PC + if (dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::FileSelect, + pointer_target(s_pointerYesNoSelectTarget, field_0x0268))) { + yesNoSelectStart(); + return; + } +#endif mDataSelProc = DATASELPROC_YES_NO_SELECT; } } @@ -3507,7 +3774,7 @@ void dFile_select_c::headerTxtSet(u16 i_msgId, u8 i_type, u8 param_3) { } if (i_msgId == 0xFFFF) { - strcpy(mHeaderStringPtr[dispIdx], ""); + SAFE_STRCPY(mHeaderStringPtr[dispIdx], ""); } else { static f32 fontsize[2] = {21.0f, 27.0f}; #if VERSION == VERSION_GCN_JPN @@ -3750,74 +4017,209 @@ bool dFile_select_c::yesnoWakuAlpahAnm(u8 param_1) { #if TARGET_PC void dFile_select_c::fileSelectWide() { - mYnSel.ScrYn->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f); - mYnSel.ScrYn->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f); - - mYnSel.ScrYn->search(MULTI_CHAR('w_no_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mYnSel.ScrYn->search(MULTI_CHAR('f_no_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mYnSel.ScrYn->search(MULTI_CHAR('w_yes_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mYnSel.ScrYn->search(MULTI_CHAR('f_yes_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - m3mSel.Scr3m->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f); - m3mSel.Scr3m->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f); - - m3mSel.Scr3m->search(MULTI_CHAR('w_sta'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - m3mSel.Scr3m->search(MULTI_CHAR('f_sta'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - m3mSel.Scr3m->search(MULTI_CHAR('w_del'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - m3mSel.Scr3m->search(MULTI_CHAR('f_del'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - m3mSel.Scr3m->search(MULTI_CHAR('w_cop_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - m3mSel.Scr3m->search(MULTI_CHAR('f_cop_t'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - fileSel.Scr->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f); - fileSel.Scr->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f); - - fileSel.Scr->search(MULTI_CHAR('t_for'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('t_for1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - fileSel.Scr->search(MULTI_CHAR('w_btn_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - fileSel.Scr->search(MULTI_CHAR('w_n_bk00'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_n_bk01'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_n_bk02'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - fileSel.Scr->search(MULTI_CHAR('w_dat_i0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_dat_i1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_dat_i2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - mCpSel.Scr->search(MULTI_CHAR('w_dat_i1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mCpSel.Scr->search(MULTI_CHAR('w_dat_i2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mCpSel.Scr->search(MULTI_CHAR('w_n_bk01'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mCpSel.Scr->search(MULTI_CHAR('w_n_bk02'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - mSelDt.ScrDt->search(MULTI_CHAR('tate_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mSelDt.ScrDt->search(MULTI_CHAR('tate_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mSelDt.ScrDt->search(MULTI_CHAR('ken_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mSelDt.ScrDt->search(MULTI_CHAR('ken_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mSelDt.ScrDt->search(MULTI_CHAR('fuku_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mSelDt.ScrDt->search(MULTI_CHAR('fuku_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mSelDt.ScrDt->search(MULTI_CHAR('fuku_n2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Spirals - fileSel.Scr->search(MULTI_CHAR('w_uzu00'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu01'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu02'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu03'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu04'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu05'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu06'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu07'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu08'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - fileSel.Scr->search(MULTI_CHAR('w_uzu09'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - #if TARGET_PC - if (mSelIcon) { - mSelIcon->refreshAspectScale(); + static bool cachedPanes = false; + // Get pre-scale values for each pane + if (!cachedPanes) { + for (PaneCache& entry : mSelDtPanes) { + J2DPane* pane = mSelDt.ScrDt->search(entry.tag); + if (!entry.cached) { + entry.origTransX = pane->getTranslateX(); + entry.origTransY = pane->getTranslateY(); + entry.cached = true; + } + } + for (PaneCache& entry : fileSelPanes) { + J2DPane* pane = fileSel.Scr->search(entry.tag); + if (!entry.cached) { + entry.origTransX = pane->getTranslateX(); + entry.origTransY = pane->getTranslateY(); + entry.cached = true; + } + } + cachedPanes = true; } - - if (mSelIcon2) { - mSelIcon2->refreshAspectScale(); + + // Reset all panes + mSelDt.ScrDt->scale(1.0f, 1.0f); + mSelDt.ScrDt->translate(0.0f, 0.0f); + for (PaneCache& entry : mSelDtPanes) { + J2DPane* pane = mSelDt.ScrDt->search(entry.tag); + pane->setBasePosition(J2DBasePosition_4); + pane->scale(1.0f, 1.0f); + pane->translate(entry.origTransX, entry.origTransY); + } + for (PaneCache& entry : fileSelPanes) { + J2DPane* pane = fileSel.Scr->search(entry.tag); + pane->setBasePosition(J2DBasePosition_4); + pane->scale(1.0f, 1.0f); + pane->translate(entry.origTransX, entry.origTransY); + } + + bool wideScaling = dusk::getSettings().game.menuScalingMode.getValue() != dusk::MenuScaling::GameCube; + const f32 rootScale = wideScaling ? mDoGph_gInf_c::hudAspectScaleUp : 1.0f; + const f32 childScale = wideScaling ? mDoGph_gInf_c::hudAspectScaleDown : 1.0f; + const f32 rootTransX = wideScaling ? mDoGph_gInf_c::getSafeMinXF() : 0.0f; + + mYnSel.ScrYn->scale(rootScale, 1.0f); + mYnSel.ScrYn->translate(rootTransX, 0.0f); + + mYnSel.ScrYn->search(MULTI_CHAR('w_no_t'))->scale(childScale, 1.0f); + mYnSel.ScrYn->search(MULTI_CHAR('f_no_t'))->scale(childScale, 1.0f); + mYnSel.ScrYn->search(MULTI_CHAR('w_yes_t'))->scale(childScale, 1.0f); + mYnSel.ScrYn->search(MULTI_CHAR('f_yes_t'))->scale(childScale, 1.0f); + + m3mSel.Scr3m->scale(rootScale, 1.0f); + m3mSel.Scr3m->translate(rootTransX, 0.0f); + + m3mSel.Scr3m->search(MULTI_CHAR('w_sta'))->scale(childScale, 1.0f); + m3mSel.Scr3m->search(MULTI_CHAR('f_sta'))->scale(childScale, 1.0f); + m3mSel.Scr3m->search(MULTI_CHAR('w_del'))->scale(childScale, 1.0f); + m3mSel.Scr3m->search(MULTI_CHAR('f_del'))->scale(childScale, 1.0f); + m3mSel.Scr3m->search(MULTI_CHAR('w_cop_t'))->scale(childScale, 1.0f); + m3mSel.Scr3m->search(MULTI_CHAR('f_cop_t'))->scale(childScale, 1.0f); + + fileSel.Scr->scale(rootScale, 1.0f); + fileSel.Scr->translate(rootTransX, 0.0f); + + fileSel.Scr->search(MULTI_CHAR('t_for'))->scale(childScale, 1.0f); + fileSel.Scr->search(MULTI_CHAR('t_for1'))->scale(childScale, 1.0f); + + fileSel.Scr->search(MULTI_CHAR('w_btn_n'))->scale(childScale, 1.0f); + + fileSel.Scr->search(MULTI_CHAR('w_n_bk00'))->scale(childScale, 1.0f); + fileSel.Scr->search(MULTI_CHAR('w_n_bk01'))->scale(childScale, 1.0f); + fileSel.Scr->search(MULTI_CHAR('w_n_bk02'))->scale(childScale, 1.0f); + + fileSel.Scr->search(MULTI_CHAR('w_dat_i0'))->scale(childScale, 1.0f); + fileSel.Scr->search(MULTI_CHAR('w_dat_i1'))->scale(childScale, 1.0f); + fileSel.Scr->search(MULTI_CHAR('w_dat_i2'))->scale(childScale, 1.0f); + + mCpSel.Scr->search(MULTI_CHAR('w_dat_i1'))->scale(childScale, 1.0f); + mCpSel.Scr->search(MULTI_CHAR('w_dat_i2'))->scale(childScale, 1.0f); + mCpSel.Scr->search(MULTI_CHAR('w_n_bk01'))->scale(childScale, 1.0f); + mCpSel.Scr->search(MULTI_CHAR('w_n_bk02'))->scale(childScale, 1.0f); + + switch (dusk::getSettings().game.menuScalingMode) { + case (dusk::MenuScaling::GameCube): + // Selection Cursor + if (mSelIcon) { + mSelIcon->refreshAspectScale(1.0f); + } + if (mSelIcon2) { + mSelIcon2->refreshAspectScale(1.0f); + } + break; + case (dusk::MenuScaling::Wii): + // Icons + mSelDt.ScrDt->search(MULTI_CHAR('tate_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mSelDt.ScrDt->search(MULTI_CHAR('tate_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mSelDt.ScrDt->search(MULTI_CHAR('ken_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mSelDt.ScrDt->search(MULTI_CHAR('ken_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mSelDt.ScrDt->search(MULTI_CHAR('fuku_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mSelDt.ScrDt->search(MULTI_CHAR('fuku_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mSelDt.ScrDt->search(MULTI_CHAR('fuku_n2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Spirals & Memory Card Text + for (PaneCache& entry : fileSelPanes) { + J2DPane* pane = fileSel.Scr->search(entry.tag); + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + } + + // Selection Cursor + if (mSelIcon) { + mSelIcon->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); + } + + if (mSelIcon2) { + mSelIcon2->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); + } + break; + case (dusk::MenuScaling::Dusklight): + constexpr f32 minAspect = 4.0f / 2.94f; + constexpr f32 wideAspect = 16.0f / 9.0f + 0.05f; + constexpr f32 ultraAspect = 21.0f / 9.0f + 0.05f; + const f32 screenAspect = mDoGph_gInf_c::getAspect(); + + const f32 wideScaleFactor = 1.0f + 0.16f * (mDoGph_gInf_c::hudAspectScaleUp - 1.0f); + const f32 ultraScaleFactor = 1.0f + 0.115f * (mDoGph_gInf_c::hudAspectScaleUp - 1.0f); + + const f32 wideShiftFactor = mSelDt.ScrDt->search(MULTI_CHAR('gray_n'))->getTranslateX() * (wideScaleFactor - mDoGph_gInf_c::hudAspectScaleDown); + const f32 ultraShiftFactor = mSelDt.ScrDt->search(MULTI_CHAR('gray_n'))->getTranslateX() * (ultraScaleFactor - mDoGph_gInf_c::hudAspectScaleDown); + + for (PaneCache& entry : mSelDtPanes) { + const size_t index = &entry - mSelDtPanes; + J2DPane* pane = mSelDt.ScrDt->search(entry.tag); + pane->setBasePosition(J2DBasePosition_0); + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + if (screenAspect >= minAspect && screenAspect <= wideAspect) { // Handle widescreen + if (entry.tag == MULTI_CHAR('b_base')) { // Slots BG + if (screenAspect > 1.75f) { + pane->translate((entry.origTransX + 11.0f) * wideScaleFactor, pane->getTranslateY()); + } else { // Between 4:3 and 16:9 + pane->translate((entry.origTransX + 8.0f) * wideScaleFactor, pane->getTranslateY()); + } + } + if (entry.tag == MULTI_CHAR('b_base1')) { // Magic Armor Slot BG + if (screenAspect > 1.75f) { + pane->translate((entry.origTransX - 21.5f) * wideScaleFactor, pane->getTranslateY()); + } else { // Between 4:3 and 16:9 + pane->translate((entry.origTransX - 12.0f) * wideScaleFactor, pane->getTranslateY()); + } + } + if (entry.tag == MULTI_CHAR('gray_n')) { // Slots + pane->translate(entry.origTransX * wideScaleFactor, pane->getTranslateY()); + } + if (index <= 6) { // Icons + pane->translate(mDoGph_gInf_c::hudAspectScaleDown * entry.origTransX + wideShiftFactor - 60.0f * (1.0f - mDoGph_gInf_c::hudAspectScaleDown), pane->getTranslateY()); + } + } else if (screenAspect >= minAspect && screenAspect >= wideAspect && screenAspect <= ultraAspect) // Handle ultrawide + { + if (entry.tag == MULTI_CHAR('b_base')) { // Slots BG + pane->translate((entry.origTransX + 18.0f) * ultraScaleFactor, pane->getTranslateY()); + } + if (entry.tag == MULTI_CHAR('b_base1')) { // Magic Armor Slot BG + pane->translate((entry.origTransX - 40.0f) * ultraScaleFactor, pane->getTranslateY()); + } + if (entry.tag == MULTI_CHAR('gray_n')) { // Slots + pane->translate(entry.origTransX * ultraScaleFactor, pane->getTranslateY()); + } + if (index <= 6) { // Icons + pane->translate(mDoGph_gInf_c::hudAspectScaleDown * entry.origTransX + ultraShiftFactor - 62.0f * (1.0f - mDoGph_gInf_c::hudAspectScaleDown), pane->getTranslateY()); + } + } else { // 4:3/default behavior + pane->setBasePosition(J2DBasePosition_4); + pane->translate(entry.origTransX, pane->getTranslateY()); + if (entry.tag == MULTI_CHAR('gray_n')) { // Slots + pane->scale(1.0f, 1.0f); + } + if (entry.tag == MULTI_CHAR('b_base')) { // Slots BG + pane->scale(1.0f, 1.0f); + } + if (entry.tag == MULTI_CHAR('b_base1')) { // Magic Armor Slot BG + pane->scale(1.0f, 1.0f); + } + if (index <= 6) { // Icons + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + } + } + } + + // Selection Cursor + if (mSelIcon) { + mSelIcon->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); + } + + if (mSelIcon2) { + mSelIcon2->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); + } + + // Spirals & Memory Card Text + for (PaneCache& entry : fileSelPanes) { + J2DPane* pane = fileSel.Scr->search(entry.tag); + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + } + break; } - #endif } #endif @@ -4036,7 +4438,7 @@ void dFile_select_c::errDispInitSet(char* i_errMesg) { mErrorMsgTxtPane[mErrorTxtDispIdx]->setAlpha(0xFF); mErrorMsgTxtPane[mErrorTxtDispIdx ^ 1]->setAlpha(0); - strcpy(mErrorMsgStringPtr[mErrorTxtDispIdx], i_errMesg); + SAFE_STRCPY_BOUNDED(mErrorMsgStringPtr[mErrorTxtDispIdx], i_errMesg); if (field_0x014a) { errorMoveAnmInitSet(2859, 2849); @@ -4101,6 +4503,11 @@ static MemCardCheckFuncT MemCardCheckProc[] = { &dFile_select_c::MemCardErrYesNoCursorMoveAnm, &dFile_select_c::MemCardSaveDataClear, +#if TARGET_PC + &dFile_select_c::MemCardAutoMakeGameFile, + &dFile_select_c::MemCardAutoMakeGameFileErrWait, +#endif + #if PLATFORM_WII || PLATFORM_SHIELD &dFile_select_c::nandStatCheck, &dFile_select_c::gameFileInitSel, @@ -4184,11 +4591,33 @@ void dFile_select_c::MemCardStatCheck() { mDoMemCd_Load(); mCardCheckProc = MEMCARDCHECKPROC_LOAD_WAIT; break; +#if TARGET_PC + case 1: { // no save file + if (dusk::getSettings().game.instantSaves) { + field_0x03b1 = 1; + setInitSaveData(); + dataSave(); + mCardCheckProc = MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE; + } else { + errDispInitSet(22, 0); + field_0x0280 = true; + mNextCardCheckProc = MEMCARDCHECKPROC_MAKE_GAMEFILE_SEL; + } + break; + } + case 4: // card is writing + if (dusk::getSettings().game.instantSaves) { + field_0x03b1 = 1; + mCardCheckProc = MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE; + } + break; +#else case 1: errDispInitSet(22, 0); field_0x0280 = true; mNextCardCheckProc = MEMCARDCHECKPROC_MAKE_GAMEFILE_SEL; break; +#endif } #else switch (status) { @@ -4245,7 +4674,7 @@ void dFile_select_c::MemCardLoadWait() { if (mDoMemCd_getDataVersion() != 6) { char errmsg[264]; // "Savedata version is different\n\nVersion %d\n\nFormatting data." - sprintf(errmsg, "セーブデータのバージョンが違います\n\nバージョン %d\n\nデータを初期化します。", mDoMemCd_getDataVersion()); + SAFE_SPRINTF(errmsg, "セーブデータのバージョンが違います\n\nバージョン %d\n\nデータを初期化します。", mDoMemCd_getDataVersion()); errDispInitSet(errmsg); field_0x0280 = false; mWindowCloseMsgDispCb = NULL; @@ -4894,6 +5323,33 @@ void dFile_select_c::MemCardMakeGameFileCheck() { } } +#if TARGET_PC +void dFile_select_c::MemCardAutoMakeGameFile() { + field_0x03b4 = mDoMemCd_SaveSync(); + if (field_0x03b4 == 0) { + return; + } + + field_0x03b1 = 0; + if (field_0x03b4 == 1) { + mDoMemCd_Load(); + mCardCheckProc = MEMCARDCHECKPROC_LOAD_WAIT; + } else { + errDispInitSet(0x1A, 0); + field_0x0280 = false; + mWindowCloseMsgDispCb = NULL; + mKeyWaitMsgDispCb = NULL; + mNextCardCheckProc = MEMCARDCHECKPROC_AUTO_MAKE_GAMEFILE_ERR_WAIT; + } +} + +void dFile_select_c::MemCardAutoMakeGameFileErrWait() { + mNextCardCheckProc = MEMCARDCHECKPROC_STAT_CHECK; + mKeyWaitCardCheckProc = MEMCARDCHECKPROC_MSG_WINDOW_CLOSE; + mCardCheckProc = MEMCARDCHECKPROC_ERRMSG_WAIT_KEY; +} +#endif + #if PLATFORM_WII || PLATFORM_SHIELD void dFile_select_c::gameFileInitSel() { if (errYesNoSelect() != 0) { @@ -5047,6 +5503,12 @@ void dFile_select_c::MemCardMsgWindowClose() { bool dFile_select_c::errYesNoSelect() { bool rv = false; +#if TARGET_PC + if (pointerYesNoSelect(true)) { + return true; + } +#endif + stick->checkTrigger(); if (mDoCPd_c::getTrigA(PAD_1)) { @@ -5091,7 +5553,7 @@ void dFile_select_c::MemCardErrYesNoCursorMoveAnm() { void dFile_select_c::errorTxtSet(u16 i_msgId) { if (i_msgId == 0xffff) { - strcpy(mErrorMsgStringPtr[mErrorTxtDispIdx ^ 1], ""); + SAFE_STRCPY(mErrorMsgStringPtr[mErrorTxtDispIdx ^ 1], ""); } else { fileSel.mMessageString->getString( i_msgId, (J2DTextBox*)mErrorMsgTxtPane[mErrorTxtDispIdx ^ 1]->getPanePtr(), NULL, diff --git a/src/d/d_gameover.cpp b/src/d/d_gameover.cpp index 870fb00f14..c7dcde357c 100644 --- a/src/d/d_gameover.cpp +++ b/src/d/d_gameover.cpp @@ -14,7 +14,7 @@ #include "JSystem/J2DGraph/J2DGrafContext.h" #include -#include "dusk/gx_helper.h" +#include "helpers/gx_helper.h" class dGov_HIO_c : public mDoHIO_entry_c { public: @@ -517,7 +517,7 @@ static leafdraw_method_class l_dGameover_Method = { (process_method_func)dGameover_Draw, }; -msg_process_profile_definition g_profile_GAMEOVER = { +DUSK_PROFILE msg_process_profile_definition DUSK_CONST g_profile_GAMEOVER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_item.cpp b/src/d/d_item.cpp index cb525139db..8ca950a52a 100644 --- a/src/d/d_item.cpp +++ b/src/d/d_item.cpp @@ -2187,4 +2187,4 @@ int addBombCount(u8 i_bombType, u8 i_addNum) { return i_addNum; } -u8* dEnemyItem_c::mData; +DUSK_GAME_DATA u8* dEnemyItem_c::mData; diff --git a/src/d/d_item_data.cpp b/src/d/d_item_data.cpp index 2a84fb615a..9ff4321aa5 100644 --- a/src/d/d_item_data.cpp +++ b/src/d/d_item_data.cpp @@ -2,7 +2,7 @@ #include "d/d_item_data.h" -dItem_itemResource dItem_data::item_resource[] = { +DUSK_GAME_DATA dItem_itemResource dItem_data::item_resource[] = { {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x64, 0x0000}, {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x0, -0x1, 0x002D, 0x3C, 0x0000}, {"F_gD_rupy", 0x0004,-0x0001,-0x0001, 0x0007,-0x0001, 0x1, -0x1, 0x002D, 0x3C, 0x0000}, @@ -260,7 +260,7 @@ dItem_itemResource dItem_data::item_resource[] = { {"T_gD_key", 0x0003,-0x0001,-0x0001,-0x0001,-0x0001, -0x1, -0x1, 0x006E, 0x64, 0x0000}, }; -dItem_fieldItemResource dItem_data::field_item_res[] = { +DUSK_GAME_DATA dItem_fieldItemResource dItem_data::field_item_res[] = { {"Always", 0x0014,-0x0001, 0x0030, 0xFF, 0x1000}, {"Always", 0x0017,-0x0001, 0x0031, 0x0, 0x1000}, {"Always", 0x0017,-0x0001, 0x0031, 0x1, 0x1000}, @@ -518,7 +518,7 @@ dItem_fieldItemResource dItem_data::field_item_res[] = { {"T_g_key", 0x0003,-0x0001,-0x0001, 0xFF, 0x1000}, }; -dItem_itemInfo dItem_data::item_info[] = { +DUSK_GAME_DATA dItem_itemInfo dItem_data::item_info[] = { {15, 40, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 70, 30, 4}, {20, 40, 30, 4}, {20, 40, 30, 4}, {40, 60, 30, 0}, {40, 60, 30, 0}, {40, 60, 30, 0}, {40, 60, 30, 0}, {20, 80, 50, 0}, diff --git a/src/d/d_k_wmark.cpp b/src/d/d_k_wmark.cpp index b93ab14211..80c2523c8a 100644 --- a/src/d/d_k_wmark.cpp +++ b/src/d/d_k_wmark.cpp @@ -14,7 +14,7 @@ #include "f_op/f_op_actor_mng.h" #include "m_Do/m_Do_lib.h" -int dkWmark_c::m_nowID; +DUSK_GAME_DATA int dkWmark_c::m_nowID; int dkWmark_c::create() { static cXyz wolfFootScale(1.1f, 1.0f, 0.6f); @@ -170,7 +170,7 @@ static leafdraw_method_class l_dkWmark_Method = { (process_method_func)dkWmark_Draw, }; -kankyo_process_profile_definition g_profile_WMARK = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_WMARK = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_k_wpillar.cpp b/src/d/d_k_wpillar.cpp index 70efec89a2..20685ea675 100644 --- a/src/d/d_k_wpillar.cpp +++ b/src/d/d_k_wpillar.cpp @@ -133,7 +133,7 @@ static leafdraw_method_class l_dkWpillar_Method = { (process_method_func)dkWpillar_Draw, }; -kankyo_process_profile_definition g_profile_WPILLAR = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_WPILLAR = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 9, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_kankyo.cpp b/src/d/d_kankyo.cpp index 468f694b32..e6f155a989 100644 --- a/src/d/d_kankyo.cpp +++ b/src/d/d_kankyo.cpp @@ -37,6 +37,7 @@ #include "dusk/settings.h" #include "dusk/frame_interpolation.h" #include "dusk/game_clock.h" +static f32 timeScale = 1.0f; #endif static void GxXFog_set(); @@ -106,9 +107,9 @@ static u16 lightMaskData[8] = { GX_LIGHT0, GX_LIGHT1, GX_LIGHT2, GX_LIGHT3, GX_LIGHT4, GX_LIGHT5, GX_LIGHT6, GX_LIGHT7, }; -dScnKy_env_light_c g_env_light; +DUSK_GAME_DATA dScnKy_env_light_c g_env_light; -Z2EnvSeMgr g_mEnvSeMgr; +DUSK_GAME_DATA Z2EnvSeMgr g_mEnvSeMgr; #if DEBUG dKankyo_HIO_c g_kankyoHIO; @@ -1799,6 +1800,9 @@ void dScnKy_env_light_c::setLight_palno_get(u8* prev_envr_id_p, u8* next_envr_id u8 psel_idx = 0; int i; int sp14 = 0; +#if TARGET_PC + const f32 timeScale = (pattern_ratio_p == &g_env_light.pat_ratio) ? ::timeScale : 1.0f; +#endif if (*init_timer_p != 0) { (*init_timer_p)++; @@ -2132,14 +2136,22 @@ void dScnKy_env_light_c::setLight_palno_get(u8* prev_envr_id_p, u8* next_envr_id if (g_env_light.mColPatMode == 0) { if (pselect_p->change_rate > 0.0f) { +#if TARGET_PC + *pattern_ratio_p += timeScale * ((1.0f / 30) / pselect_p->change_rate); +#else *pattern_ratio_p += (1.0f / 30) / pselect_p->change_rate; +#endif } // pattern change rate is faster in hyrule field if (strcmp(dComIfGp_getStartStageName(), "F_SP121") == 0 && *prev_pat_p == *next_pat_p) { +#if TARGET_PC + *pattern_ratio_p += timeScale * (1.0f / 15); +#else *pattern_ratio_p += (1.0f / 15); +#endif } if (*pattern_ratio_p >= 1.0f) { @@ -2332,6 +2344,10 @@ void dScnKy_env_light_c::setLight() { u8 next_pal_start_id; u8 prev_pal_end_id; u8 next_pal_end_id; +#if TARGET_PC + const f32 deltaTime = dusk::game_clock::consume_interval(this); + timeScale = deltaTime / dusk::game_clock::period_for_original_frames(1.0f); +#endif setLight_palno_get(&g_env_light.PrevCol, &g_env_light.UseCol, &g_env_light.wether_pat0, &g_env_light.wether_pat1, &prev_pal_start_id, &prev_pal_end_id, &next_pal_start_id, &next_pal_end_id, &color_ratio, &start_pat_pal_id, @@ -2517,8 +2533,6 @@ void dScnKy_env_light_c::setLight() { f32 sin = cM_ssin(S_fuwan_sin); #if TARGET_PC - const f32 deltaTime = dusk::game_clock::consume_interval(this); - const f32 timeScale = deltaTime / dusk::game_clock::period_for_original_frames(1.0f); S_fuwan_sin += (s16)((cM_rndF(2000.0f) + 500) * timeScale); #else S_fuwan_sin += (s16)cM_rndF(2000.0f) + 500; @@ -8346,7 +8360,7 @@ static leafdraw_method_class l_dKy_Method = { (process_method_func)dKy_Draw, }; -kankyo_process_profile_definition g_profile_KANKYO = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_KANKYO = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, @@ -8361,8 +8375,8 @@ kankyo_process_profile_definition g_profile_KANKYO = { }; static void dummy_str_0x40a0() { - char* str1 = "ステージが変わったときかなぁ~???"; - char* str2 = "POINTLIGHT RECALL![%f][%f][%f]"; + DUSK_CONST char* str1 = "ステージが変わったときかなぁ~???"; + DUSK_CONST char* str2 = "POINTLIGHT RECALL![%f][%f][%f]"; } void dKy_setLight_init() { diff --git a/src/d/d_kankyo_rain.cpp b/src/d/d_kankyo_rain.cpp index 09e230c9fd..bcc8b228e6 100644 --- a/src/d/d_kankyo_rain.cpp +++ b/src/d/d_kankyo_rain.cpp @@ -94,6 +94,39 @@ static void dKyr_set_btitex(TGXTexObj* i_obj, ResTIMG* i_img) { dKyr_set_btitex_common(i_obj, i_img, GX_TEXMAP0); } +#if TARGET_PC +template +struct CachedTexObjs { + TGXTexObj texObj[N]; + ResTIMG* timg[N] = {}; +}; + +template +static GXTexObj* load_cached_tex(CachedTexObjs& cache, ResTIMG* img, GXTexMapID mapID) { + for (int i = 0; i < N; i++) { + if (img != nullptr && cache.timg[i] == img) { + GXLoadTexObj(&cache.texObj[i], mapID); + return &cache.texObj[i]; + } + } + + int slot = 0; + for (int i = 0; i < N; i++) { + if (cache.timg[i] == nullptr) { + slot = i; + break; + } + } + + if (cache.timg[slot] != nullptr) { + cache.texObj[slot].reset(); + } + cache.timg[slot] = img; + dKyr_set_btitex_common(&cache.texObj[slot], img, mapID); + return &cache.texObj[slot]; +} +#endif + void dKyr_lenzflare_move() { dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket; dKankyo_sunlenz_Packet* lenz_packet = g_env_light.mpSunLenzPacket; @@ -929,7 +962,7 @@ void dKyr_housi_move() { if (g_env_light.mHousiCount != 0 || (g_env_light.mHousiCount == 0 && housi_packet->field_0x5de8 <= 0.0f)) { - housi_packet->field_0x5dec = g_env_light.mHousiCount; + housi_packet->mHousiCount = g_env_light.mHousiCount; } if (g_env_light.mHousiCount != 0) { @@ -938,7 +971,7 @@ void dKyr_housi_move() { cLib_addCalc(&housi_packet->field_0x5de8, 0.0f, 0.2f, 0.05f, 0.01f); } - if (housi_packet->field_0x5dec == 0) { + if (housi_packet->mHousiCount == 0) { return; } @@ -977,7 +1010,7 @@ void dKyr_housi_move() { } } - for (int i = housi_packet->field_0x5dec - 1; i >= 0; i--) { + for (int i = housi_packet->mHousiCount - 1; i >= 0; i--) { f32 var_f26 = 0.4f * housi_packet->field_0x5de8; effect = &housi_packet->mHousiEff[i]; @@ -2025,16 +2058,27 @@ void vrkumo_move() { } } -static void dKr_cullVtx_Set() { +static void dKr_cullVtx_Set(IF_DUSK(bool const vtxColor = false)) { GXSetCullMode(GX_CULL_NONE); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8); +#if TARGET_PC + if (vtxColor) { + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0); + } +#endif GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); +#if TARGET_PC + if (vtxColor) { + GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT); + } +#endif } static void dKyr_draw_rev_moon(Mtx drawMtx, u8** tex) { + ZoneScoped; dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket; dKankyo_sunlenz_Packet* lenz_packet = g_env_light.mpSunLenzPacket; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); @@ -2122,10 +2166,17 @@ static void dKyr_draw_rev_moon(Mtx drawMtx, u8** tex) { return; } +#if TARGET_PC + static CachedTexObjs<8> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); + load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP1); + load_cached_tex(texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2); +#else TGXTexObj texobj; dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP0); dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[1], GX_TEXMAP1); dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); @@ -2205,7 +2256,11 @@ static void dKyr_draw_rev_moon(Mtx drawMtx, u8** tex) { for (int i = 0; i < 2; i++) { if (i == 1) { +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)lenz_packet->mpResBall, GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)lenz_packet->mpResBall); +#endif GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); @@ -2470,10 +2525,17 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) { return; } +#if TARGET_PC + static CachedTexObjs<8> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); + load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP1); + load_cached_tex(texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2); +#else TGXTexObj texobj; dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP0); dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[1], GX_TEXMAP1); dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[texidx + 2], GX_TEXMAP2); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); @@ -2567,7 +2629,11 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) { for (int i = 0; i < 2; i++) { if (i == 1) { +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)lenz_packet->mpResBall, GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)lenz_packet->mpResBall); +#endif GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); @@ -2680,6 +2746,7 @@ void dKyr_drawSun(Mtx drawMtx, cXyz* ppos, GXColor& unused, u8** tex) { } void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) { + ZoneScoped; dKankyo_sunlenz_Packet* lenz_packet = g_env_light.mpSunLenzPacket; dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); @@ -2730,8 +2797,13 @@ void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) { j3dSys.reinitGX(); +#if TARGET_PC + static CachedTexObjs<3> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); +#else TGXTexObj texobj; dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); GXSetTevColor(GX_TEVREG1, color_reg1); @@ -3036,11 +3108,23 @@ void dKyr_drawLenzflare(Mtx drawMtx, cXyz* ppos, GXColor& param_2, u8** tex) { } if (i == 1) { +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)tex[2], GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)tex[2]); +#endif } else if (i == 2) { +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)tex[3], GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)tex[3]); +#endif } else { +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif } spE4.x = -var_f31; @@ -3131,8 +3215,13 @@ void dKyr_drawRain(Mtx drawMtx, u8** tex) { return; } +#if TARGET_PC + static CachedTexObjs<1> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); +#else TGXTexObj texobj; dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); GXSetNumTexGens(1); @@ -3296,8 +3385,13 @@ void dKyr_drawSibuki(Mtx drawMtx, u8** tex) { color.b = 0xC8; color.a = rain_packet->mSibukiAlpha * alphaFade; +#if TARGET_PC + static CachedTexObjs<1> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP0); +#else TGXTexObj texobj; dKyr_set_btitex(&texobj, (ResTIMG*)tex[1]); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color); GXSetTevColor(GX_TEVREG1, color); @@ -3378,21 +3472,26 @@ void dKyr_drawSibuki(Mtx drawMtx, u8** tex) { } void dKyr_drawHousi(Mtx drawMtx, u8** tex) { + ZoneScoped; dKankyo_housi_Packet* housi_packet = g_env_light.mpHousiPacket; static f32 rot = 0.0f; Mtx camMtx; Mtx rotMtx; cXyz pos[4]; +#if TARGET_PC + static CachedTexObjs<1> texobj; +#else TGXTexObj spDC; +#endif cXyz spD0; Vec spC4; Vec spB8; - bool var_r28 = 0; - if (housi_packet->field_0x5dec != 0) { + bool isPalaceOfTwilight = 0; + if (housi_packet->mHousiCount != 0) { if (strcmp(dComIfGp_getStartStageName(), "D_MN08") == 0) { - var_r28 = 1; + isPalaceOfTwilight = 1; } if (strcmp(dComIfGp_getStartStageName(), "D_MN08") != 0 || @@ -3419,7 +3518,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { color_reg1.b = 0xCA; color_reg1.a = 0xFF; - if (dKy_darkworld_check() == 1 || var_r28 == 1) { + if (dKy_darkworld_check() == 1 || isPalaceOfTwilight == 1) { color_reg0.r = 0; color_reg0.g = 0; color_reg0.b = 0; @@ -3471,18 +3570,27 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { f32 temp_f24 = 6.5f; for (int i = 0; i < 1; i++) { - dKyr_set_btitex(&spDC, (ResTIMG*)*tex); +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)*tex, GX_TEXMAP0); +#else + dKyr_set_btitex(&texobj, (ResTIMG*)*tex); +#endif +#if TARGET_PC + GXSetNumChans(1); + GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE); +#else GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); +#endif GXSetTevColor(GX_TEVREG1, color_reg1); GXSetNumTexGens(1); GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY); GXSetNumTevStages(1); - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); - GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, DUSK_IF_ELSE(GX_COLOR0A0, GX_COLOR_NULL)); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0), GX_CC_TEXC, GX_CC_ZERO); GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); - GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_CA), GX_CA_TEXA, GX_CA_ZERO); GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); @@ -3505,7 +3613,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { GXSetClipMode(GX_CLIP_DISABLE); GXSetNumIndStages(0); - dKr_cullVtx_Set(); + dKr_cullVtx_Set(IF_DUSK(true)); rot += 1.2f; MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot)); @@ -3514,7 +3622,13 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { GXLoadPosMtxImm(drawMtx, GX_PNMTX0); GXSetCurrentMtx(GX_PNMTX0); - for (int j = 0; j < housi_packet->field_0x5dec; j++) { +#if TARGET_PC + // Dusklight optimization: we submit a single large draw call, rather than hundreds. + u32 vertCount = 4 * housi_packet->mHousiCount; + GXBegin(GX_QUADS, GX_VTXFMT0, vertCount); +#endif + + for (int j = 0; j < housi_packet->mHousiCount; j++) { fopAc_ac_c* player = dComIfGp_getPlayer(0); spD0.x = @@ -3525,6 +3639,10 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { housi_packet->mHousiEff[j].mBasePos.z + housi_packet->mHousiEff[j].mPosition.z; if (i == 1 && j == 0) { +#if TARGET_PC + // Never gets hit I think? + abort(); +#endif color_reg0.r = 0; color_reg0.g = 0; color_reg0.b = 0; @@ -3553,8 +3671,10 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { color_reg0.a = housi_packet->mHousiEff[j].mAlpha * var_f25; block_14: - GXLoadTexObj(&spDC, GX_TEXMAP0); +#if !TARGET_PC // GXLoadTextObj does nothing, TEV colors replaced with vertex colors + GXLoadTexObj(&texobj, GX_TEXMAP0); GXSetTevColor(GX_TEVREG0, color_reg0); +#endif f32 var_f27 = housi_packet->mHousiEff[j].field_0x48 * 9.0f; if (g_env_light.field_0xea9 == 1) { @@ -3566,7 +3686,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { f32 temp_f30 = (var_f27 * 0.2f) * cM_fcos(housi_packet->mHousiEff[j].mScale.y * 6.0f); - if (dKy_darkworld_check() == 1 || var_r28 == 1) { + if (dKy_darkworld_check() == 1 || isPalaceOfTwilight == 1) { cXyz sp7C[] = { cXyz(-1.0f, -0.5f, 0.0f), cXyz(-1.0f, 1.5f, 0.0f), @@ -3711,24 +3831,34 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { pos[3].z = spD0.z + spB8.z; } - GXBegin(GX_QUADS, GX_VTXFMT0, 4); + IF_NOT_DUSK(GXBegin(GX_QUADS, GX_VTXFMT0, 4)); s16 var_r17 = 0x1FF; - if (dKy_darkworld_check() == true || var_r28 == 1) { + if (dKy_darkworld_check() == true || isPalaceOfTwilight == 1) { var_r17 = 0xFA; } GXPosition3f32(pos[0].x, pos[0].y, pos[0].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0); GXPosition3f32(pos[1].x, pos[1].y, pos[1].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(var_r17, 0); GXPosition3f32(pos[2].x, pos[2].y, pos[2].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(var_r17, var_r17); GXPosition3f32(pos[3].x, pos[3].y, pos[3].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, var_r17); - GXEnd(); + + + IF_NOT_DUSK(GXEnd()); } } + +#if TARGET_PC + GXEnd(); +#endif } GXSetClipMode(GX_CLIP_ENABLE); @@ -3738,6 +3868,7 @@ void dKyr_drawHousi(Mtx drawMtx, u8** tex) { } void dKyr_drawSnow(Mtx drawMtx, u8** tex) { + ZoneScoped; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); dKankyo_snow_Packet* snow_packet = g_env_light.mpSnowPacket; @@ -3801,25 +3932,37 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) { } if (tex[0] != NULL) { - TGXTexObj spA0; - dKyr_set_btitex(&spA0, (ResTIMG*)tex[0]); +#if TARGET_PC + static CachedTexObjs<1> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); +#else + TGXTexObj texobj; + dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif +#if TARGET_PC + // Dusklight optimization: enable draw call merging + // by using vertex color instead of GX_TEVREG0 + GXSetNumChans(1); + GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE); +#else GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); +#endif GXSetTevColor(GX_TEVREG1, color_reg1); GXSetNumTexGens(1); GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY); GXSetNumTevStages(1); - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); - GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, DUSK_IF_ELSE(GX_COLOR0A0, GX_COLOR_NULL)); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0), GX_CC_TEXC, GX_CC_ZERO); GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); - GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_CA), GX_CA_TEXA, GX_CA_ZERO); GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_ONE, GX_LO_COPY); GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0); GXSetZMode(GX_ENABLE, GX_LEQUAL, GX_DISABLE); GXSetClipMode(GX_CLIP_DISABLE); GXSetNumIndStages(0); - dKr_cullVtx_Set(); + dKr_cullVtx_Set(IF_DUSK(true)); Mtx rotMtx; MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot)); @@ -3896,7 +4039,7 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) { } } - GXSetTevColor(GX_TEVREG0, color_reg0); + IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0)); f32 sp38 = 2.0f * (i / 500.0f) * snow_packet->field_0x6d80; f32 sp68 = sp50 * (camera->view.lookat.eye.abs(sp7C) / 1000.0f); if (sp68 > 1.0f) { @@ -3944,19 +4087,23 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) { for (int k = 0; k < spC; k++) { GXBegin(GX_QUADS, GX_VTXFMT0, 4); GXPosition3f32(pos[0].x + (temp_f31 * add_table[k].x), pos[0].y + (temp_f31 * add_table[k].y), pos[0].z + (temp_f31 * add_table[k].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0); GXPosition3f32(pos[1].x + (temp_f31 * add_table[k].x), pos[1].y + (temp_f31 * add_table[k].y), pos[1].z + (temp_f31 * add_table[k].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0xFF, 0); GXPosition3f32(pos[2].x + (temp_f31 * add_table[k].x), pos[2].y + (temp_f31 * add_table[k].y), pos[2].z + (temp_f31 * add_table[k].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0xFF, 0xFF); GXPosition3f32(pos[3].x + (temp_f31 * add_table[k].x), pos[3].y + (temp_f31 * add_table[k].y), pos[3].z + (temp_f31 * add_table[k].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0xFF); GXEnd(); } if ((g_env_light.field_0xe90 != 0 && dComIfGp_roomControl_getStayNo() == 0 && sp7C.z < 3000.0f) || dComIfGp_roomControl_getStayNo() == 3 || dComIfGp_roomControl_getStayNo() == 6 || dComIfGp_roomControl_getStayNo() == 9 || dComIfGp_roomControl_getStayNo() == 13) { color_reg0.a = 255.0f * ((0.4f * snow_packet->mSnowEff[i].field_0x30) + temp_f29); - GXSetTevColor(GX_TEVREG0, color_reg0); + IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0)); f32 sp34; f32 sp30; @@ -4012,12 +4159,16 @@ void dKyr_drawSnow(Mtx drawMtx, u8** tex) { GXBegin(GX_QUADS, GX_VTXFMT0, 4); int var_r27 = 0; GXPosition3f32(pos[0].x + (temp_f31 * add_table[var_r27].x), pos[0].y + (temp_f31 * add_table[var_r27].y), pos[0].z + (temp_f31 * add_table[var_r27].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0); GXPosition3f32(pos[1].x + (temp_f31 * add_table[var_r27].x), pos[1].y + (temp_f31 * add_table[var_r27].y), pos[1].z + (temp_f31 * add_table[var_r27].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0xFF, 0); GXPosition3f32(pos[2].x + (temp_f31 * add_table[var_r27].x), pos[2].y + (temp_f31 * add_table[var_r27].y), pos[2].z + (temp_f31 * add_table[var_r27].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0xFF, 0xFF); GXPosition3f32(pos[3].x + (temp_f31 * add_table[var_r27].x), pos[3].y + (temp_f31 * add_table[var_r27].y), pos[3].z + (temp_f31 * add_table[var_r27].z)); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0xFF); GXEnd(); } @@ -4353,6 +4504,7 @@ void dKyr_drawStar(Mtx drawMtx, u8** tex) { } void drawCloudShadow(Mtx drawMtx, u8** tex) { + ZoneScoped; dScnKy_env_light_c* envlight = dKy_getEnvlight(); dKankyo_cloud_Packet* cloud_packet = g_env_light.mpCloudPacket; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); @@ -4388,7 +4540,12 @@ void drawCloudShadow(Mtx drawMtx, u8** tex) { GXSetClipMode(GX_CLIP_DISABLE); +#if TARGET_PC + static CachedTexObjs<1> texobj; + TGXTexObj fb_texobj; +#else TGXTexObj texobj, fb_texobj; +#endif if (g_env_light.mMoyaMode < 50) { dKy_ParticleColor_get_bg(&camera->view.lookat.eye, NULL, &sp48, &sp44, &sp40, &sp3C, 0.0f); f32 temp_f30 = 0.4f; @@ -4401,7 +4558,11 @@ void drawCloudShadow(Mtx drawMtx, u8** tex) { color_reg1.g = (0.45f * sp38.g) + (0.55f * sp44.g); color_reg1.b = (0.45f * sp38.b) + (0.55f * sp44.b); +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); GXSetTevColor(GX_TEVREG1, color_reg1); @@ -4446,7 +4607,11 @@ void drawCloudShadow(Mtx drawMtx, u8** tex) { color_reg1.b = 0; color_reg1.a = 0xFF; +#if TARGET_PC + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP1); +#else dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP1); +#endif ResTIMG* fb_timg = mDoGph_gInf_c::getFrameBufferTimg(); dDlst_window_c* window = dComIfGp_getWindow(0); @@ -4593,7 +4758,11 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) { Mtx camMtx; Mtx rotMtx; +#if TARGET_PC + static CachedTexObjs<3> texobj; +#else TGXTexObj texobj; +#endif cXyz proj; f32 rot; @@ -4703,7 +4872,11 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) { color_reg1.r = 0; color_reg1.g = 0; color_reg1.b = 0; +#if TARGET_PC + auto* loaded_texobj = load_cached_tex(texobj, (ResTIMG*)tex[j], GX_TEXMAP0); +#else dKyr_set_btitex(&texobj, (ResTIMG*)tex[j]); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color); @@ -4808,7 +4981,11 @@ void drawVrkumo(Mtx drawMtx, GXColor& color, u8** tex) { } if (!(vrkumo_packet->mVrkumoEff[k].mAlpha <= 0.000001f)) { +#if TARGET_PC + GXLoadTexObj(loaded_texobj, GX_TEXMAP0); +#else GXLoadTexObj(&texobj, GX_TEXMAP0); +#endif GXSetTevColor(GX_TEVREG0, color); sp60 = sp68 * (0.2f + (0.2f * (k / 100.0f))); @@ -5341,6 +5518,7 @@ void dKyr_odour_move() { } void dKyr_odour_draw(Mtx drawMtx, u8** tex) { + ZoneScoped; dScnKy_env_light_c* envlight = dKy_getEnvlight(); dKankyo_odour_Packet* odour_packet = envlight->mOdourData.mpOdourPacket; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); @@ -5429,8 +5607,14 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) { break; } +#if TARGET_PC + static CachedTexObjs<1> texobj; + TGXTexObj fb_texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP1); +#else TGXTexObj texobj, fb_texobj; dKyr_set_btitex_common(&texobj, (ResTIMG*)tex[0], GX_TEXMAP1); +#endif ResTIMG* fb_timg = mDoGph_gInf_c::getFrameBufferTimg(); dDlst_window_c* window = dComIfGp_getWindow(0); @@ -5445,18 +5629,23 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) { MTXRotRad(rotMtx, 'Z', DEG_TO_RAD(rot)); MTXConcat(camMtx, rotMtx, camMtx); + // Dusklight opt: enable draw call merging + // by using vertex color instead of GX_TEVREG0 + GXLoadPosMtxImm(drawMtx, GX_PNMTX0); GXSetCurrentMtx(GX_PNMTX0); GXLoadTexMtxImm(spF0, GX_TEXMTX0, GX_MTX3x4); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBA4, 8); GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX1, GX_CLR_RGBA, GX_RGBA4, 8); + IF_DUSK(GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBA8, 0)); GXClearVtxDesc(); GXSetVtxDesc(GX_VA_POS, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT); GXSetVtxDesc(GX_VA_TEX1, GX_DIRECT); + IF_DUSK(GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT)); GXSetNumChans(1); - GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE); + GXSetChanCtrl(GX_COLOR0, GX_DISABLE, GX_SRC_REG, DUSK_IF_ELSE(GX_SRC_VTX, GX_SRC_REG), GX_LIGHT_NULL, GX_DF_CLAMP, GX_AF_NONE); GXSetTevColor(GX_TEVREG0, color_reg0); GXSetTevColor(GX_TEVREG1, color_reg1); GXSetNumTexGens(2); @@ -5464,14 +5653,14 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) { GXSetTexCoordGen(GX_TEXCOORD1, GX_TG_MTX2x4, GX_TG_TEX1, GX_IDENTITY); GXSetNumTevStages(2); GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0); - GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, GX_CC_C0, GX_CC_C1); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_TEXC, DUSK_IF_ELSE(GX_CC_RASC, GX_CC_C0), GX_CC_C1); GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_TEXA, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO); GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV); GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD1, GX_TEXMAP1, GX_COLOR0A0); GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_CPREV, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO); GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV); - GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO); + GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_ZERO, DUSK_IF_ELSE(GX_CA_RASA, GX_CA_A0), GX_CA_TEXA, GX_CA_ZERO); GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_FALSE, GX_TEVPREV); GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_COPY); GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0); @@ -5513,7 +5702,7 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) { if (effect->mStatus != 0) { if (!(temp_f29 <= 0.000001f)) { color_reg0.a = 255.0f * temp_f29; - GXSetTevColor(GX_TEVREG0, color_reg0); + IF_NOT_DUSK(GXSetTevColor(GX_TEVREG0, color_reg0)); sp70 = sp4C; @@ -5551,15 +5740,19 @@ void dKyr_odour_draw(Mtx drawMtx, u8** tex) { GXBegin(GX_QUADS, GX_VTXFMT0, 4); GXPosition3f32(pos[0].x, pos[0].y, pos[0].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0); GXTexCoord2s16(0, 0); GXPosition3f32(pos[1].x, pos[1].y, pos[1].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0xFF, 0); GXTexCoord2s16(0xFF, 0); GXPosition3f32(pos[2].x, pos[2].y, pos[2].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0xFF, 0xFF); GXTexCoord2s16(0xFF, 0xFF); GXPosition3f32(pos[3].x, pos[3].y, pos[3].z); + IF_DUSK(GXColor4u8(color_reg0.r, color_reg0.g, color_reg0.b, color_reg0.a)); GXTexCoord2s16(0, 0xFF); GXTexCoord2s16(0, 0xFF); GXEnd(); @@ -5730,6 +5923,7 @@ void dKyr_mud_move() { } void dKyr_mud_draw(Mtx drawMtx, u8** tex) { + ZoneScoped; dKankyo_mud_Packet* mud_packet = g_env_light.mpMudPacket; dKankyo_sun_Packet* sun_packet = g_env_light.mpSunPacket; @@ -5823,8 +6017,13 @@ void dKyr_mud_draw(Mtx drawMtx, u8** tex) { if (g_env_light.camera_water_in_status == 0) { for (int i = 0; i < 1; i++) { +#if TARGET_PC + static CachedTexObjs<1> texobj_cache; + auto* texobj = load_cached_tex(texobj_cache, (ResTIMG*)tex[0], GX_TEXMAP0); +#else TGXTexObj texobj; dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif GXSetNumChans(0); GXSetTevColor(GX_TEVREG0, color_reg0); @@ -5864,7 +6063,11 @@ void dKyr_mud_draw(Mtx drawMtx, u8** tex) { color_reg0.a = mud_packet->mEffect[j].field_0x38 * var_f31; +#if TARGET_PC + GXLoadTexObj(texobj, GX_TEXMAP0); +#else GXLoadTexObj(&texobj, GX_TEXMAP0); +#endif GXSetTevColor(GX_TEVREG0, color_reg0); f32 sp30 = 1.0f; @@ -5949,6 +6152,7 @@ void dKyr_evil_move() { } static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) { + ZoneScoped; dScnKy_env_light_c* envlight = dKy_getEnvlight(); dKankyo_evil_Packet* evil_packet = envlight->mpEvilPacket; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); @@ -5985,8 +6189,13 @@ static void dKyr_evil_draw2(Mtx drawMtx, u8** tex) { color_reg0.b = 0x87; color_reg0.a = 0xFF; +#if TARGET_PC + static CachedTexObjs<1> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[1], GX_TEXMAP0); +#else TGXTexObj texobj; dKyr_set_btitex(&texobj, (ResTIMG*)tex[1]); +#endif #if TARGET_PC if (dusk::frame_interp::get_ui_tick_pending()) @@ -6187,6 +6396,7 @@ static f32 dKyr_near_bosslight_check(cXyz pos) { } void dKyr_evil_draw(Mtx drawMtx, u8** tex) { + ZoneScoped; dScnKy_env_light_c* envlight = dKy_getEnvlight(); dKankyo_evil_Packet* evil_packet = envlight->mpEvilPacket; camera_class* camera = (camera_class*)dComIfGp_getCamera(0); @@ -6223,8 +6433,13 @@ void dKyr_evil_draw(Mtx drawMtx, u8** tex) { color_reg1.b = 10; color_reg1.a = 255; +#if TARGET_PC + static CachedTexObjs<1> texobj; + load_cached_tex(texobj, (ResTIMG*)tex[0], GX_TEXMAP0); +#else TGXTexObj texobj; dKyr_set_btitex(&texobj, (ResTIMG*)tex[0]); +#endif #if TARGET_PC if (dusk::frame_interp::get_ui_tick_pending()) diff --git a/src/d/d_kankyo_wether.cpp b/src/d/d_kankyo_wether.cpp index 00a3d6412d..abcc3e33d9 100644 --- a/src/d/d_kankyo_wether.cpp +++ b/src/d/d_kankyo_wether.cpp @@ -79,7 +79,7 @@ SNOW_EFF::~SNOW_EFF() {} SNOW_EFF::SNOW_EFF() {} void dKankyo_snow_Packet::draw() { - dKyr_drawSnow(j3dSys.getViewMtx(), &mpTex); + GX_DEBUG_GROUP(dKyr_drawSnow, j3dSys.getViewMtx(), &mpTex); } STAR_EFF::~STAR_EFF() {} @@ -103,7 +103,7 @@ HOUSI_EFF::~HOUSI_EFF() {} HOUSI_EFF::HOUSI_EFF() {} void dKankyo_housi_Packet::draw() { - dKyr_drawHousi(j3dSys.getViewMtx(), &mpResTex); + GX_DEBUG_GROUP(dKyr_drawHousi, j3dSys.getViewMtx(), &mpResTex); } VRKUMO_EFF::~VRKUMO_EFF() {} @@ -119,7 +119,7 @@ EF_ODOUR_EFF::~EF_ODOUR_EFF() {} EF_ODOUR_EFF::EF_ODOUR_EFF() {} void dKankyo_odour_Packet::draw() { - dKyr_odour_draw(j3dSys.getViewMtx(), &mpResTex); + GX_DEBUG_GROUP(dKyr_odour_draw, j3dSys.getViewMtx(), &mpResTex); } EF_MUD_EFF::~EF_MUD_EFF() {} diff --git a/src/d/d_ky_thunder.cpp b/src/d/d_ky_thunder.cpp index 77c2a92769..396ab9cb9d 100644 --- a/src/d/d_ky_thunder.cpp +++ b/src/d/d_ky_thunder.cpp @@ -274,7 +274,7 @@ static leafdraw_method_class l_dThunder_Method = { (process_method_func)dThunder_Draw, }; -kankyo_process_profile_definition g_profile_KY_THUNDER = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_KY_THUNDER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 7, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_kyeff.cpp b/src/d/d_kyeff.cpp index 4f64365901..984478f74d 100644 --- a/src/d/d_kyeff.cpp +++ b/src/d/d_kyeff.cpp @@ -143,7 +143,7 @@ static leafdraw_method_class l_dKyeff_Method = { (process_method_func)dKyeff_Draw, }; -kankyo_process_profile_definition g_profile_KYEFF = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_KYEFF = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_kyeff2.cpp b/src/d/d_kyeff2.cpp index 2fb6b42588..c23138f60c 100644 --- a/src/d/d_kyeff2.cpp +++ b/src/d/d_kyeff2.cpp @@ -43,7 +43,7 @@ static leafdraw_method_class l_dKyeff2_Method = { (process_method_func)dKyeff2_Draw, }; -kankyo_process_profile_definition g_profile_KYEFF2 = { +DUSK_PROFILE kankyo_process_profile_definition DUSK_CONST g_profile_KYEFF2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_lib.cpp b/src/d/d_lib.cpp index 80aa72ff3c..91b7726459 100644 --- a/src/d/d_lib.cpp +++ b/src/d/d_lib.cpp @@ -32,7 +32,7 @@ static void dummy1(mDoExt_btkAnm* btk, cXyz& pos) { dDbVw_drawLineOpa(pos, pos, color, 0, 0); } -Quaternion ZeroQuat = { +DUSK_GAME_DATA Quaternion ZeroQuat = { 0.0f, 0.0f, 0.0f, @@ -316,11 +316,11 @@ u32 dLib_getExpandSizeFromAramArchive(JKRAramArchive* i_aramArchive, char const* return uVar1 > uVar5 ? uVar1 : uVar5; } -OSTime dLib_time_c::m_diffTime; +DUSK_GAME_DATA OSTime dLib_time_c::m_diffTime; -OSTime dLib_time_c::m_stopTime; +DUSK_GAME_DATA OSTime dLib_time_c::m_stopTime; -bool dLib_time_c::m_timeStopped; +DUSK_GAME_DATA bool dLib_time_c::m_timeStopped; OSTime dLib_time_c::getTime() { if (!m_timeStopped) { diff --git a/src/d/d_map.cpp b/src/d/d_map.cpp index fa9049fb00..88cc1d19ba 100644 --- a/src/d/d_map.cpp +++ b/src/d/d_map.cpp @@ -337,7 +337,7 @@ f32 renderingAmap_c::getIconSize(u8 i_typeGroup) const { return iconSize; } -dMap_prm_res_s* dMap_HIO_prm_res_dst_s::m_res; +DUSK_GAME_DATA dMap_prm_res_s* dMap_HIO_prm_res_dst_s::m_res; inline u8 twoValueLineInterpolation(u8 param_0, u8 param_1, f32 param_2) { return ((f32)param_0 + (param_2 * ((f32)param_1 - (f32)param_0))); @@ -931,6 +931,13 @@ bool renderingAmap_c::isDrawIconSingle2(dTres_c::data_s const* i_data, bool para } break; case 5: +#if TARGET_PC + if (dusk::getSettings().game.removeQuestMapMarkers && + dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x190])) + { + break; + } +#endif if (((i_data->mNo == 255 || (i_data->mNo != 255 && !dComIfGs_isTbox(i_data->mNo))) && (i_data->mSwBit == 255 || (i_data->mSwBit != 255 && dComIfGs_isSwitch(i_data->mSwBit, i_data->mRoomNo)))) && @@ -1206,6 +1213,10 @@ void dMap_c::changeTextureSize(int param_1, int param_2, int param_3) { JUT_ASSERT(2672, mImage_p != NULL); JUT_ASSERT(2673, mResTIMG != NULL); +#if TARGET_PC + GXDestroyCopyTex(mImage_p); +#endif + mTexSizeX = param_1 >> param_3; mTexSizeY = param_2 >> param_3; @@ -1219,6 +1230,24 @@ void dMap_c::changeTextureSize(int param_1, int param_2, int param_3) { } #endif +#if TARGET_PC +bool dMap_c::refreshTextureSize() { + JUT_ASSERT(2688, mImage_p != NULL); + JUT_ASSERT(2689, mResTIMG != NULL); + + const u16 oldWidth = mResTIMG->width; + const u16 oldHeight = mResTIMG->height; + makeResTIMG(mResTIMG, mTexSizeX, mTexSizeY, mImage_p, (u8*)m_res, 0x33); + + if (mResTIMG->width == oldWidth && mResTIMG->height == oldHeight) { + return false; + } + + GXDestroyCopyTex(mImage_p); + return true; +} +#endif + void dMap_c::_remove() { if (mImage_p != NULL) { #if TARGET_PC @@ -1611,7 +1640,7 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) { mCenterX += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -mPackX :) mPackX; mCenterZ -= mPackZ; - mCenterX += field_0x64; + mCenterX += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -field_0x64 : ) field_0x64; mCenterZ += mPackPlusZ; } @@ -1620,6 +1649,8 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) { { #if DEBUG field_0x64 = 33830.0f; +#elif TARGET_PC + field_0x64 = dusk::getSettings().game.enableMirrorMode ? 33830.0f : 0.0f; #else field_0x64 = 0.0f; #endif @@ -1628,6 +1659,9 @@ void dMap_c::_move(f32 i_centerX, f32 i_centerZ, int i_roomNo, f32 param_3) { f32 temp = (field_0x58 * (f32)(field_0x74 + 4)) * 0.5f; #if DEBUG mRightEdgePlus = -(((dMpath_c::getMinZ() - (-127103.67f)) - temp) / field_0x58); + +#elif TARGET_PC + mRightEdgePlus = dusk::getSettings().game.enableMirrorMode ? -(((dMpath_c::getMinX() - (-127103.67f)) - temp) / field_0x58) : 0.0f; #else mRightEdgePlus = 0.0f; #endif diff --git a/src/d/d_map_path.cpp b/src/d/d_map_path.cpp index f5e447a2aa..08591007ec 100644 --- a/src/d/d_map_path.cpp +++ b/src/d/d_map_path.cpp @@ -15,16 +15,51 @@ #include #ifdef TARGET_PC -#include -#include -#include +#include "dusk/settings.h" +#include "m_Do/m_Do_graphic.h" +#include +#include -constexpr u16 kMapResolutionMultiplier = 4; -constexpr u16 kMapImageSide = 16 * kMapResolutionMultiplier; +#include +#include +#include +#include +#include +#include +#include + +constexpr u16 kMapIconResolutionMultiplier = 4; +constexpr u16 kMapImageSide = 16 * kMapIconResolutionMultiplier; constexpr u32 kMapImageTotalPixels = kMapImageSide * kMapImageSide; typedef std::function PaintI8Fn; +u16 scaled_map_axis(u16 value, f32 scale) { + const auto scaledValue = + static_cast(std::max(1.0f, std::round(static_cast(value) * scale))); + return static_cast(std::min(scaledValue, std::numeric_limits::max())); +} + +aurora::Vec2 map_render_size_for(u16 width, u16 height) { + if (width == 0 || height == 0) { + return {width, height}; + } + + u32 renderWidth = 0; + u32 renderHeight = 0; + AuroraGetRenderSize(&renderWidth, &renderHeight); + + const f32 logicalWidth = std::max(mDoGph_gInf_c::getWidthF(), 1.0f); + const f32 logicalHeight = std::max(mDoGph_gInf_c::getHeightF(), 1.0f); + const f32 irScaleX = renderWidth > 0 ? static_cast(renderWidth) / logicalWidth : 1.0f; + const f32 irScaleY = renderHeight > 0 ? static_cast(renderHeight) / logicalHeight : 1.0f; + const f32 hudScale = std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f); + return { + scaled_map_axis(width, irScaleX * hudScale), + scaled_map_axis(height, irScaleY * hudScale), + }; +} + void paint_i8(std::span dst, size_t width, PaintI8Fn paint) { const auto blocksAcross = width >> 3; @@ -478,9 +513,9 @@ void dRenderingMap_c::makeResTIMG(ResTIMG* p_image, u16 width, u16 height, u8* p p_image->format = GX_TF_C8; p_image->alphaEnabled = 2; #ifdef TARGET_PC - // Increase map render resolution - p_image->width = width * kMapResolutionMultiplier; - p_image->height = height * kMapResolutionMultiplier; + const auto [rw, rh] = map_render_size_for(width, height); + p_image->width = rw; + p_image->height = rh; #else p_image->width = width; p_image->height = height; @@ -563,16 +598,14 @@ void dRenderingFDAmap_c::drawBack() const { void dRenderingFDAmap_c::preRenderingMap() { #ifdef TARGET_PC - // Increase map render resolution - const u16 w = mTexWidth * kMapResolutionMultiplier; - const u16 h = mTexHeight * kMapResolutionMultiplier; - GXCreateFrameBuffer(w, h); + const auto [rw, rh] = map_render_size_for(mTexWidth, mTexHeight); + GXCreateFrameBuffer(rw, rh); // Set logical viewport dimensions GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f); GXSetScissor(0, 0, mTexWidth, mTexHeight); // Set render viewport dimensions - GXSetViewportRender(0.0f, 0.0f, w, h, 0.0f, 1.0f); - GXSetScissorRender(0, 0, w, h); + GXSetViewportRender(0.0f, 0.0f, rw, rh, 0.0f, 1.0f); + GXSetScissorRender(0, 0, rw, rh); #else GXSetViewport(0.0f, 0.0f, mTexWidth, mTexHeight, 0.0f, 1.0f); GXSetScissor(0, 0, mTexWidth, mTexHeight); @@ -610,11 +643,9 @@ void dRenderingFDAmap_c::preRenderingMap() { void dRenderingFDAmap_c::postRenderingMap() { GXSetCopyFilter(GX_FALSE, NULL, GX_FALSE, NULL); #ifdef TARGET_PC - // Increase map render resolution - const u16 w = mTexWidth * kMapResolutionMultiplier; - const u16 h = mTexHeight * kMapResolutionMultiplier; - GXSetTexCopySrc(0, 0, w, h); - GXSetTexCopyDst(w, h, GX_CTF_R8, GX_FALSE); + const auto [rw, rh] = map_render_size_for(mTexWidth, mTexHeight); + GXSetTexCopySrc(0, 0, rw, rh); + GXSetTexCopyDst(rw, rh, GX_CTF_R8, GX_FALSE); GXCopyTex(field_0x4, GX_TRUE); GXRestoreFrameBuffer(); #else @@ -628,7 +659,7 @@ void dRenderingFDAmap_c::postRenderingMap() { dComIfGp_getCurrentGrafPort()->setup2D(); } -dMpath_n::dTexObjAggregate_c dMpath_n::m_texObjAgg; +DUSK_GAME_DATA dMpath_n::dTexObjAggregate_c dMpath_n::m_texObjAgg; void dRenderingFDAmap_c::renderingDecoration(dDrawPath_c::line_class const* p_line) { s32 width = getDecorationLineWidth(p_line->field_0x1); diff --git a/src/d/d_map_path_dmap.cpp b/src/d/d_map_path_dmap.cpp index f2a41e8fd3..f9d2f4d5f9 100644 --- a/src/d/d_map_path_dmap.cpp +++ b/src/d/d_map_path_dmap.cpp @@ -226,11 +226,11 @@ void dMapInfo_n::getFloorParameter(f32 param_0, s8* i_floorNo, f32* param_2, f32 } } -s8 dMapInfo_c::mNowStayFloorNo; +DUSK_GAME_DATA s8 dMapInfo_c::mNowStayFloorNo; -int dMapInfo_c::mNowStayRoomNo; +DUSK_GAME_DATA int dMapInfo_c::mNowStayRoomNo; -u8 dMapInfo_c::mNowStayFloorNoDecisionFlg; +DUSK_GAME_DATA u8 dMapInfo_c::mNowStayFloorNoDecisionFlg; s8 dMapInfo_c::calcFloorNo(f32 param_0, bool i_chkMinMax, int i_roomNo) { f32 sp10; @@ -330,24 +330,24 @@ void dMapInfo_c::create() { void dMapInfo_c::remove() {} -dDrawPath_c::layer_data* dMpath_c::mLayerList; +DUSK_GAME_DATA dDrawPath_c::layer_data* dMpath_c::mLayerList; // these are needed for sinit, but its got reversed reg alloc? -f32 dMpath_c::mMinX = FLT_MAX; +DUSK_GAME_DATA f32 dMpath_c::mMinX = FLT_MAX; -f32 dMpath_c::mMaxX = -FLT_MAX; +DUSK_GAME_DATA f32 dMpath_c::mMaxX = -FLT_MAX; -f32 dMpath_c::mMinZ = FLT_MAX; +DUSK_GAME_DATA f32 dMpath_c::mMinZ = FLT_MAX; -f32 dMpath_c::mMaxZ = -FLT_MAX; +DUSK_GAME_DATA f32 dMpath_c::mMaxZ = -FLT_MAX; -f32 dMpath_c::mAllCenterX; +DUSK_GAME_DATA f32 dMpath_c::mAllCenterX; -f32 dMpath_c::mAllCenterZ; +DUSK_GAME_DATA f32 dMpath_c::mAllCenterZ; -f32 dMpath_c::mAllSizeX; +DUSK_GAME_DATA f32 dMpath_c::mAllSizeX; -f32 dMpath_c::mAllSizeZ; +DUSK_GAME_DATA f32 dMpath_c::mAllSizeZ; static bool data_80450E88; @@ -355,11 +355,11 @@ bool dMpath_c::isExistMapPathData() { return data_80450E88; } -int dMapInfo_c::mNextRoomNo = -1; +DUSK_GAME_DATA int dMapInfo_c::mNextRoomNo = -1; -s8 dMpath_c::mBottomFloorNo = 127; +DUSK_GAME_DATA s8 dMpath_c::mBottomFloorNo = 127; -s8 dMpath_c::mTopFloorNo = -128; +DUSK_GAME_DATA s8 dMpath_c::mTopFloorNo = -128; int dMpath_c::getTopBottomFloorNo(s8* i_topFloorNo, s8* i_bottomFloorNo) { if (isExistMapPathData()) { diff --git a/src/d/d_menu_calibration.cpp b/src/d/d_menu_calibration.cpp index 0cc238e5d2..23f81121bc 100644 --- a/src/d/d_menu_calibration.cpp +++ b/src/d/d_menu_calibration.cpp @@ -14,7 +14,10 @@ #include "m_Do/m_Do_controller_pad.h" #include -// Need 0xC bytes of padding with no symbol between dMenu_Calibration_c::__vtable and the end of .data +#include "helpers/string.hpp" + +// Need 0xC bytes of padding with no symbol between dMenu_Calibration_c::__vtable and the end of +// .data // This is likely caused by the vtable of an abstract base class getting put there and then stripped out. // Not sure which abstract base class could go there though, so we simulate it with some dummy classes for now. class dummy_abstract_class { @@ -252,7 +255,7 @@ void dMenu_Calibration_c::setCalibrationValue() { void dMenu_Calibration_c::setAButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpAButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpAButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -264,7 +267,7 @@ void dMenu_Calibration_c::setAButtonString(u16 i_stringID) { void dMenu_Calibration_c::setBButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpBButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpBButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -276,7 +279,7 @@ void dMenu_Calibration_c::setBButtonString(u16 i_stringID) { void dMenu_Calibration_c::setStepString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 3; i++) { - strcpy(mpStepString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpStepString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 3; i++) { @@ -288,7 +291,7 @@ void dMenu_Calibration_c::setStepString(u16 i_stringID) { void dMenu_Calibration_c::setExplainString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 3; i++) { - strcpy(mpExplainString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpExplainString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 3; i++) { diff --git a/src/d/d_menu_collect.cpp b/src/d/d_menu_collect.cpp index 612806d372..4de8b2c5a4 100644 --- a/src/d/d_menu_collect.cpp +++ b/src/d/d_menu_collect.cpp @@ -36,8 +36,12 @@ #include "d/d_menu_window.h" #include "JSystem/J3DGraphBase/J3DMaterial.h" +#if TARGET_PC +#include "dusk/menu_pointer.h" +#endif + typedef void (dMenu_Collect2D_c::*initFunc)(); -static initFunc init[] = { +static DUSK_CONSTEXPR initFunc init[] = { &dMenu_Collect2D_c::wait_init, &dMenu_Collect2D_c::save_open_init, &dMenu_Collect2D_c::save_move_init, &dMenu_Collect2D_c::save_close_init, &dMenu_Collect2D_c::option_open_init, &dMenu_Collect2D_c::option_move_init, @@ -50,7 +54,7 @@ static initFunc init[] = { &dMenu_Collect2D_c::insect_close_init}; typedef void (dMenu_Collect2D_c::*processFunc)(); -static processFunc process[] = { +static DUSK_CONSTEXPR processFunc process[] = { &dMenu_Collect2D_c::wait_proc, &dMenu_Collect2D_c::save_open_proc, &dMenu_Collect2D_c::save_move_proc, &dMenu_Collect2D_c::save_close_proc, &dMenu_Collect2D_c::option_open_proc, &dMenu_Collect2D_c::option_move_proc, @@ -97,79 +101,158 @@ dMenu_Collect2D_c::~dMenu_Collect2D_c() { #if TARGET_PC void dMenu_Collect2D_c::menuCollectWide() { - // Main Canvas - mpScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f); - mpScreen->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f); - - // Pieces of Heart - mpScreen->search(MULTI_CHAR('heart_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Scents - mpScreen->search(MULTI_CHAR('wolf_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Quiver - mpScreen->search(MULTI_CHAR('item_0_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Wallet - mpScreen->search(MULTI_CHAR('item_1_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Poes - mpScreen->search(MULTI_CHAR('item_2_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Fish Bestiary - mpScreen->search(MULTI_CHAR('fish_3_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Letters - mpScreen->search(MULTI_CHAR('lett_4_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Hidden Skills - mpScreen->search(MULTI_CHAR('maki_5_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Green Tunic - mpScreen->search(MULTI_CHAR('fuku_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Zora Armor - mpScreen->search(MULTI_CHAR('fuku_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Magic Armor - mpScreen->search(MULTI_CHAR('fuku_n2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Ordon Shield - mpScreen->search(MULTI_CHAR('tate_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Hylian Shield - mpScreen->search(MULTI_CHAR('tate_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Ordon Sword - mpScreen->search(MULTI_CHAR('ken_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Master Sword - mpScreen->search(MULTI_CHAR('ken_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Bugs - mpScreen->search(MULTI_CHAR('kabu_6n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // "Collection" Text - mpScreen->search(MULTI_CHAR('t_t00'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - mpScreen->search(MULTI_CHAR('f_t00'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // "Save" Text - mpScreen->search(MULTI_CHAR('sa_tex_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // "Options" Text - mpScreen->search(MULTI_CHAR('op_tex_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Item Name Text - mpScreen->search(MULTI_CHAR('itemn_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Item Description Text - mpScreen->search(MULTI_CHAR('infotxtn'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - #if TARGET_PC - if (mpDrawCursor) { - mpDrawCursor->refreshAspectScale(); + static bool cachedPanes = false; + // Get pre-scale values for each pane + if (!cachedPanes) { + for (PaneCache& entry : mpScreenPanes) { + J2DPane* pane = mpScreen->search(entry.tag); + if (!entry.cached) { + entry.origTransX = pane->getTranslateX(); + entry.origTransY = pane->getTranslateY(); + entry.cached = true; + } + } + cachedPanes = true; + } + + // Reset all panes + mpScreen->scale(1.0f, 1.0f); + mpScreen->translate(0.0f, 0.0f); + for (PaneCache& entry : mpScreenPanes) { + J2DPane* pane = mpScreen->search(entry.tag); + pane->scale(1.0f, 1.0f); + pane->translate(entry.origTransX, entry.origTransY); + } + + // Reset button overlay + mpScreenIcon->translate(0.0f, 0.0f); + + switch (dusk::getSettings().game.menuScalingMode) { + case dusk::MenuScaling::GameCube: + // Selection Cursor + if (mpDrawCursor) { + mpDrawCursor->refreshAspectScale(1.0f); + } + break; + case dusk::MenuScaling::Wii: + // Main Canvas + mpScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f); + mpScreen->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f); + + // Button Overlay + mpScreenIcon->translate(-mDoGph_gInf_c::getSafeMinXF(), 0.0f); + + // "Save" Text + mpScreen->search(MULTI_CHAR('sa_tex_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // "Options" Text + mpScreen->search(MULTI_CHAR('op_tex_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Pieces of Heart + mpScreen->search(MULTI_CHAR('heart_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Scents + mpScreen->search(MULTI_CHAR('wolf_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Quiver + mpScreen->search(MULTI_CHAR('item_0_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Wallet + mpScreen->search(MULTI_CHAR('item_1_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Poes + mpScreen->search(MULTI_CHAR('item_2_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Fish Bestiary + mpScreen->search(MULTI_CHAR('fish_3_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Letters + mpScreen->search(MULTI_CHAR('lett_4_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Hidden Skills + mpScreen->search(MULTI_CHAR('maki_5_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Green Tunic + mpScreen->search(MULTI_CHAR('fuku_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Zora Armor + mpScreen->search(MULTI_CHAR('fuku_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Magic Armor + mpScreen->search(MULTI_CHAR('fuku_n2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Ordon Shield + mpScreen->search(MULTI_CHAR('tate_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Hylian Shield + mpScreen->search(MULTI_CHAR('tate_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Ordon Sword + mpScreen->search(MULTI_CHAR('ken_n0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Master Sword + mpScreen->search(MULTI_CHAR('ken_n1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Bugs + mpScreen->search(MULTI_CHAR('kabu_6n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // "Collection" Text + mpScreen->search(MULTI_CHAR('t_t00'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mpScreen->search(MULTI_CHAR('f_t00'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Item Name Text + mpScreen->search(MULTI_CHAR('itemn_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Item Description Text + mpScreen->search(MULTI_CHAR('infotxtn'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Selection Cursor + if (mpDrawCursor) { + mpDrawCursor->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); + } + break; + case dusk::MenuScaling::Dusklight: + // Main Canvas + mpScreen->scale(mDoGph_gInf_c::hudAspectScaleUp, 1.0f); + mpScreen->translate(mDoGph_gInf_c::getSafeMinXF(), 0.0f); + + // Save/Options Buttons + mpScreen->search(MULTI_CHAR('sa_op_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // "Collection" Title Bar + mpScreen->search(MULTI_CHAR('title_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + // Main Central Elements + mpScreen->search(MULTI_CHAR('menu_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mpScreen->search(MULTI_CHAR('w_er_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + mpScreen->search(MULTI_CHAR('center_n'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + + const f32 leftShift = 48.0f * (mDoGph_gInf_c::hudAspectScaleUp - 1.0f); // Shifting certain items left to keep center (> 4:3 only) + + // Item Name/Description Text + J2DPane* info_n = mpScreen->search(MULTI_CHAR('info_n')); + static f32 infoTransX_orig = info_n->getTranslateX(); + info_n->translate(infoTransX_orig - leftShift, info_n->getTranslateY()); + + // Designs + J2DPane* lavel_n = mpScreen->search(MULTI_CHAR('lavel_n')); + static f32 lavelTransX_orig = lavel_n->getTranslateX(); + lavel_n->translate(lavelTransX_orig - leftShift, lavel_n->getTranslateY()); + + // Fused Shadow/Mirror Background + J2DPane* modelbgn = mpScreen->search(MULTI_CHAR('modelbgn')); + static f32 modelbgnTransX_orig = modelbgn->getTranslateX(); + modelbgn->setBasePosition(J2DBasePosition_0); + modelbgn->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.3f); + f32 modelbgn_scaleFactor = 1.0f + 0.16f * (mDoGph_gInf_c::hudAspectScaleDown - 1.0f); + modelbgn->translate((modelbgnTransX_orig - 12.0f) * modelbgn_scaleFactor, modelbgn->getTranslateY()); + + // Selection Cursor + if (mpDrawCursor) { + mpDrawCursor->refreshAspectScale(1.0f); + } + break; } - #endif } #endif @@ -1707,6 +1790,12 @@ void dMenu_Collect2D_c::wait_init() { } void dMenu_Collect2D_c::wait_proc() { +#if TARGET_PC + if (pointerWait()) { + return; + } +#endif + if (dMw_A_TRIGGER()) { if (mCursorX == 0 && mCursorY == 5) { if (mDoGph_gInf_c::getFader()->mStatus == 1) { @@ -1808,6 +1897,88 @@ void dMenu_Collect2D_c::wait_proc() { } } +#if TARGET_PC +void dMenu_Collect2D_c::pointerActivateCurrent() { + if (mCursorX == 0 && mCursorY == 5) { + if (mDoGph_gInf_c::getFader()->mStatus == 1) { + mSubWindowOpenCheck = 1; + Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_CHANGE_WINDOW, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibrationM(); + } + } else if (mCursorX == 1 && mCursorY == 5) { + if (mDoGph_gInf_c::getFader()->mStatus == 1) { + mSubWindowOpenCheck = 2; + Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_CHANGE_WINDOW, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibrationM(); + } + } else if (mCursorX == 3 && mCursorY == 4) { + if (field_0x22d[3][4] != 0 && mDoGph_gInf_c::getFader()->mStatus == 1) { + mSubWindowOpenCheck = 3; + dMeter2Info_set2DVibration(); + } + } else if (mCursorX == 2 && mCursorY == 4) { + if (isFishIconVisible() && mDoGph_gInf_c::getFader()->mStatus == 1) { + mSubWindowOpenCheck = 4; + dMeter2Info_set2DVibration(); + } + } else if (mCursorX == 3 && mCursorY == 3) { + if (isSkillIconVisible() && mDoGph_gInf_c::getFader()->mStatus == 1) { + mSubWindowOpenCheck = 5; + dMeter2Info_set2DVibration(); + } + } else if (mCursorX == 2 && mCursorY == 3) { + if (isInsectIconVisible() && mDoGph_gInf_c::getFader()->mStatus == 1) { + mSubWindowOpenCheck = 6; + dMeter2Info_set2DVibration(); + } + } else if (field_0x22d[mCursorX][mCursorY] != 0 && !mIsWolf) { + if ((mCursorX >= 3 && mCursorX <= 4) || (mCursorX == 5 && mCursorY == 2)) { + u8 cursorY = mCursorY; + if (cursorY == 0) { + if (daPy_getPlayerActorClass()->getSwordChangeWaitTimer() == 0) { + changeSword(); + } + } else if (cursorY == 1) { + if (daPy_getPlayerActorClass()->getShieldChangeWaitTimer() == 0) { + changeShield(); + } + } else if (cursorY == 2 && + daPy_getPlayerActorClass()->getClothesChangeWaitTimer() == 0) + { + changeClothe(); + } + } + } +} + +bool dMenu_Collect2D_c::pointerWait() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Collection); + for (u8 y = 0; y < 6; ++y) { + for (u8 x = 0; x < 7; ++x) { + if (getItemTag(x, y, true) == 0 || !dusk::menu_pointer::hit_pane(mpSelPm[x][y], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(static_cast(x + y * 7)); + if (mCursorX != x || mCursorY != y) { + mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON, NULL, 0, 0); + mCursorX = x; + mCursorY = y; + cursorPosSet(); + setItemNameString(mCursorX, mCursorY); + } + if (dusk::menu_pointer::consume_click()) { + pointerActivateCurrent(); + return true; + } + return false; + } + } + return false; +} +#endif + void dMenu_Collect2D_c::save_open_init() { JKRHeap* heap = mDoExt_setCurrentHeap(mpSubHeap); @@ -2167,18 +2338,18 @@ void dMenu_Collect2D_c::_draw() { if (mItemNameString == 0) { #if REGION_JPN - char* stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1')))->getStringPtr(); + TEXT_SPAN stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1')))->getStringPtr(); #else - char* stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('f_text1')))->getStringPtr(); + TEXT_SPAN stringPtr1 = static_cast(mpScreen->search(MULTI_CHAR('f_text1')))->getStringPtr(); #endif - strcpy(stringPtr1, ""); + SAFE_STRCPY(stringPtr1, ""); #if REGION_JPN - char* stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0')))->getStringPtr(); + TEXT_SPAN stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('i_text0')))->getStringPtr(); #else - char* stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0')))->getStringPtr(); + TEXT_SPAN stringPtr0 = static_cast(mpScreen->search(MULTI_CHAR('f_text0')))->getStringPtr(); #endif - strcpy(stringPtr0, ""); + SAFE_STRCPY(stringPtr0, ""); } else { #if REGION_JPN J2DTextBox* textBox1 = static_cast(mpScreen->search(MULTI_CHAR('i_text1'))); @@ -2229,13 +2400,13 @@ void dMenu_Collect2D_c::setAButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - char* stringPtr = + TEXT_SPAN stringPtr = static_cast(mpScreenIcon->search(text_a_tag[i]))->getStringPtr(); - strcpy(stringPtr, ""); + SAFE_STRCPY(stringPtr, ""); } } else { for (int i = 0; i < 5; i++) { - char* stringPtr = + TEXT_SPAN stringPtr = static_cast(mpScreenIcon->search(text_a_tag[i]))->getStringPtr(); dMeter2Info_getStringKanji(i_stringID, stringPtr, NULL); } @@ -2253,13 +2424,13 @@ void dMenu_Collect2D_c::setBButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - char* stringPtr = + TEXT_SPAN stringPtr = static_cast(mpScreenIcon->search(text_b_tag[i]))->getStringPtr(); - strcpy(stringPtr, ""); + SAFE_STRCPY(stringPtr, ""); } } else { for (int i = 0; i < 5; i++) { - char* stringPtr = + TEXT_SPAN stringPtr = static_cast(mpScreenIcon->search(text_b_tag[i]))->getStringPtr(); dMeter2Info_getStringKanji(i_stringID, stringPtr, NULL); } @@ -2278,7 +2449,7 @@ void dMenu_Collect2D_c::setItemNameString(u8 param_0, u8 param_1) { setItemNameStringNull(); } else { #if REGION_JPN - char* stringPtr = + TEXT_SPAN stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n00')))->getStringPtr(); dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n01')))->getStringPtr(); @@ -2288,7 +2459,7 @@ void dMenu_Collect2D_c::setItemNameString(u8 param_0, u8 param_1) { stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n03')))->getStringPtr(); dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); #else - char* stringPtr = + TEXT_SPAN stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n04')))->getStringPtr(); dMeter2Info_getStringKanji(uVar6, stringPtr, NULL); stringPtr = static_cast(mpScreen->search(MULTI_CHAR('item_n05')))->getStringPtr(); @@ -2306,22 +2477,22 @@ void dMenu_Collect2D_c::setItemNameStringNull() { mItemNameString = 0; #if REGION_JPN J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n00')); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n01')); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n02')); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n03')); #else J2DTextBox* textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n04')); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n05')); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n06')); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); textBox = (J2DTextBox*)mpScreen->search(MULTI_CHAR('item_n07')); #endif - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); } dMenu_Collect3D_c::dMenu_Collect3D_c(JKRExpHeap* param_0, dMenu_Collect2D_c* param_1, @@ -2566,13 +2737,13 @@ void dMenu_Collect3D_c::createMaskModel() { static const f32 m_kamen_offset_x[5] = {-14.0f, -14.0f, -14.0f, 1.3f, 6.5f}; static const f32 m_kamen_offset_y[5] = {0.0f, 0.0f, 0.0f, 22.0f, 30.0f}; static const f32 m_kamen_scale[5] = {2.6f, 2.6f, 2.2f, 1.8f, 1.8f}; - static char* bck_name[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* bck_name[4] = { "md_mask_parts_spin_1.bck", "md_mask_parts_spin_2.bck", "md_mask_parts_spin_3.bck", "md_mask_parts_spin_4.bck", }; - static char* brk_name[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* brk_name[4] = { "md_mask_parts_spin_1.brk", "md_mask_parts_spin_2_3.brk", "md_mask_parts_spin_2_3.brk", @@ -2609,13 +2780,13 @@ void dMenu_Collect3D_c::createMirrorModel() { static const f32 m_mirror_offset_x[5] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; static const f32 m_mirror_offset_y[5] = {4.0f, 4.0f, 4.0f, 4.0f, 4.0f}; static const f32 m_mirror_scale[5] = {0.6f, 0.6f, 0.6f, 0.6f, 0.6f}; - static char* bck_name[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* bck_name[4] = { "kageri_mirrer_spin_1.bck", "kageri_mirrer_spin_2.bck", "kageri_mirrer_spin_3.bck", "kageri_mirrer_spin_4.bck", }; - static char* brk_name[4] = { + static DUSK_CONSTEXPR char DUSK_CONST* brk_name[4] = { "kageri_mirrer_spin_1.brk", "kageri_mirrer_spin_2_3_4.brk", "kageri_mirrer_spin_2_3_4.brk", @@ -2691,7 +2862,7 @@ u8 dMenu_Collect3D_c::getMaskMdlVisible() { return 2; } -f32 dMenu_Collect3D_c::mViewOffsetY = -100.0f; +DUSK_GAME_DATA f32 dMenu_Collect3D_c::mViewOffsetY = -100.0f; void dMenu_Collect3D_c::setupItem3D(Mtx param_0) { GXSetViewport(0.0f, mViewOffsetY, FB_WIDTH, FB_HEIGHT, 0.0f, 1.0f); diff --git a/src/d/d_menu_dmap.cpp b/src/d/d_menu_dmap.cpp index b39c9bb287..36348b4387 100644 --- a/src/d/d_menu_dmap.cpp +++ b/src/d/d_menu_dmap.cpp @@ -26,6 +26,12 @@ #include "m_Do/m_Do_graphic.h" #include +#include "helpers/string.hpp" + +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#endif + #if (PLATFORM_WII || PLATFORM_SHIELD) #define POINTER_OPT dComIfGs_getOptPointer() #else @@ -116,9 +122,9 @@ dMenu_DmapBg_c::dMenu_DmapBg_c(JKRExpHeap* i_heap, STControl* i_stick) { mapScreenInit(); char archive_path[32]; - strcpy(archive_path, "/res/FieldMap/D_MN10.arc"); + SAFE_STRCPY(archive_path, "/res/FieldMap/D_MN10.arc"); char stage_name[8]; - strcpy(stage_name, dComIfGp_getStartStageName()); + SAFE_STRCPY(stage_name, dComIfGp_getStartStageName()); archive_path[18] = stage_name[4]; archive_path[19] = stage_name[5]; @@ -135,6 +141,16 @@ dMenu_DmapBg_c::dMenu_DmapBg_c(JKRExpHeap* i_heap, STControl* i_stick) { memset(&field_0xd80, 0, 20); buttonIconScreenInit(); field_0xdd0 = 0; + +#if TARGET_PC + mpPoeCountIcon = JKR_NEW J2DPicture((ResTIMG*)JKRGetNameResource("ni_item_icon_pou.bti", dComIfGp_getItemIconArchive())); + + mpPoeCountPane = JKR_NEW J2DTextBox(); + if (mpPoeCountPane != nullptr) { + mpPoeCountPane->setFontSize(15.0f, 15.0f); + mpPoeCountPane->setFont(mDoExt_getMesgFont()); + } +#endif } void dMenu_DmapBg_c::mapScreenInit() { @@ -382,7 +398,7 @@ void dMenu_DmapBg_c::setAButtonString(u32 i_msgNo) { }; for (int i = 0; i < 5; i++) { if (i_msgNo == 0) { - strcpy(((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), ""); + SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), ""); } else { dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_at[i]))->getStringPtr(), NULL); } @@ -399,7 +415,7 @@ void dMenu_DmapBg_c::setBButtonString(u32 i_msgNo) { }; for (int i = 0; i < 5; i++) { if (i_msgNo == 0) { - strcpy(((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), ""); + SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), ""); } else { dMeter2Info_getStringKanji(i_msgNo, ((J2DTextBox*)mButtonScreen->search(cont_bt[i]))->getStringPtr(), NULL); } @@ -410,7 +426,7 @@ static f32 player_px; static f32 player_py; -dMenu_Dmap_c* dMenu_Dmap_c::myclass; +DUSK_GAME_DATA dMenu_Dmap_c* dMenu_Dmap_c::myclass; void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { static u64 const c_tag[2] = { @@ -431,7 +447,7 @@ void dMenu_DmapBg_c::setCButtonString(u32 i_msgNo) { if (msgNo == 0) { for (i = 0; i < 2; i++) { - strcpy(((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), ""); + SAFE_STRCPY(((J2DTextBox*)mButtonScreen->search(c_tag[i]))->getStringPtr(), ""); } mpCButton->setAlphaRate(0.5f); } else { @@ -762,6 +778,14 @@ dMenu_DmapBg_c::~dMenu_DmapBg_c() { mDoExt_destroyExpHeap(mpTalkHeap); mpTalkHeap = NULL; } + +#if TARGET_PC + JKR_DELETE(mpPoeCountIcon); + mpPoeCountIcon = NULL; + + JKR_DELETE(mpPoeCountPane); + mpPoeCountPane = NULL; +#endif } void dMenu_DmapBg_c::setAllAlphaRate(f32 i_rate, bool param_2) { @@ -894,6 +918,20 @@ void dMenu_DmapBg_c::dMapBgWide() { void dMenu_DmapBg_c::draw() { #if TARGET_PC dMapBgWide(); + + static bool prevMirror = false; // default state of panes is not mirrored + if(prevMirror != dusk::getSettings().game.enableMirrorMode) { + if(dusk::getSettings().game.enableMirrorMode) { + static_cast(mFloorScreen->search(MULTI_CHAR('rink')))->setMirror(J2DMirror_X); + static_cast(mBaseScreen->search(MULTI_CHAR('map000')))->setMirror(J2DMirror_X); + } + else { + static_cast(mFloorScreen->search(MULTI_CHAR('rink')))->setMirror(MIRROR0); + static_cast(mBaseScreen->search(MULTI_CHAR('map000')))->setMirror(MIRROR0); + } + + prevMirror = dusk::getSettings().game.enableMirrorMode; + } #endif u32 scissor_left; @@ -940,6 +978,15 @@ void dMenu_DmapBg_c::draw() { mpBackTexture->setAlpha(dVar17 * (field_0xdbc * field_0xd9c)); f32 local_28c = mpBackTexture->getBounds().i.x; + + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + CPaneMgr mgr; + Vec local_94 = mgr.getGlobalVtxCenter(mMapPane, true, 0); + local_28c = (local_94.x * 2.0f) - (local_28c + 0.5f * mpBackTexture->getWidth()) - 0.5f * mpBackTexture->getWidth(); + } + #endif + mpBackTexture->setBlackWhite(color_black, color_white); mpBackTexture->draw(local_28c, field_0xd94 + mpBackTexture->getBounds().i.y, mpBackTexture->getWidth(), mpBackTexture->getHeight(), @@ -991,7 +1038,7 @@ void dMenu_DmapBg_c::draw() { -35.0f + (local_224.x - local_218.x), -35.0f + (local_224.y - local_218.y)); #if TARGET_PC - if (!dusk::getSettings().game.enableFrameInterpolation) { + if (!dusk::frame_interp::is_enabled()) { field_0xdda = 0; } #else @@ -1014,6 +1061,35 @@ void dMenu_DmapBg_c::draw() { } mButtonScreen->draw(field_0xd94, field_0xd98, grafContext); + +#if TARGET_PC + if (dusk::getSettings().game.enhancedMapMenus) { + int nowPoeCount = 0; + int totalPoeCount = 0; + dMenuMapCommon_c::getDmapPoeCount(dComIfGp_getStartStageName(), nowPoeCount, totalPoeCount); + if (dComIfGs_isEventBit(dSv_event_flag_c::F_0456) && totalPoeCount > 0) { + const f32 x = field_0xd94 + mDoGph_gInf_c::ScaleHUDXLeft(80.0f); + const f32 y = 410.0f; + constexpr f32 iconsize = 48.0f * 0.8f; + + if (mpPoeCountIcon != nullptr) + mpPoeCountIcon->draw(x - 35.0f, y - 25.0f, iconsize, iconsize, false, false, false); + + char counter_text[6]; + snprintf(counter_text, sizeof(counter_text), "%d/%d", nowPoeCount, totalPoeCount); + mpPoeCountPane->setString(counter_text); + + mpPoeCountPane->setCharColor(0x000000FF); + mpPoeCountPane->setGradColor(0x000000FF); + mpPoeCountPane->draw(x + 1, y + 1, FB_WIDTH, HBIND_LEFT); + + mpPoeCountPane->setCharColor(0xC8C8C8FF); + mpPoeCountPane->setGradColor(0xC8C8C8FF); + mpPoeCountPane->draw(x, y, FB_WIDTH, HBIND_LEFT); + } + } +#endif + grafContext->scissor(scissor_left, scissor_top, scissor_width, scissor_height); grafContext->setScissor(); grafContext->setup2D(); @@ -1932,7 +2008,7 @@ void dMenu_Dmap_c::mapControl() { f32 temp_f28 = (var_f29 / 100.0f) * var_f31; f32 sp18 = temp_f28 * cM_ssin(stick_angle); f32 sp14 = temp_f28 * cM_scos(stick_angle); - mMapCtrl->setPlusZoomCenterX(sp18); + mMapCtrl->setPlusZoomCenterX(IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -sp18 :) sp18); mMapCtrl->setPlusZoomCenterZ(sp14); } @@ -2624,7 +2700,7 @@ void dMenu_Dmap_c::zoomIn_proc() { void dMenu_Dmap_c::zoomOut_init_proc() { #if TARGET_PC - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { mpDrawBg->resetScrollArrowMask(); } #endif diff --git a/src/d/d_menu_dmap_map.cpp b/src/d/d_menu_dmap_map.cpp index 0bb9717952..825142bb3a 100644 --- a/src/d/d_menu_dmap_map.cpp +++ b/src/d/d_menu_dmap_map.cpp @@ -16,7 +16,7 @@ #endif struct dMdm_HIO_prm_res_dst_s { - static void* m_res; + static DUSK_GAME_DATA void* m_res; }; bool renderingDmap_c::hasMap() const { @@ -69,6 +69,13 @@ bool renderingDmap_c::isDrawIconSingle2(dTres_c::data_s const* i_data, bool para JUT_ASSERT(1044, FALSE); break; case 5: +#if TARGET_PC + if (dusk::getSettings().game.removeQuestMapMarkers && + dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x190])) + { + break; + } +#endif if ((i_data->mNo == 0xFF || (i_data->mNo != 0xFF && !dComIfGs_isTbox(i_data->mNo))) && (i_data->mSwBit == 0xFF || (i_data->mSwBit != 0xFF && dComIfGs_isSwitch(i_data->mSwBit, i_data->mRoomNo))) && param_1) { rt = true; } @@ -281,7 +288,7 @@ void renderingDmap_c::afterDrawPath() { renderingPlusDoor_c::afterDrawPath(); } -void* dMdm_HIO_prm_res_dst_s::m_res; +DUSK_GAME_DATA void* dMdm_HIO_prm_res_dst_s::m_res; void dMenu_DmapMap_c::_create(u16 param_0, u16 param_1, u16 param_2, u16 param_3, void* res) { @@ -908,7 +915,8 @@ void dMenu_StageMapCtrl_c::move() { void dMenu_DmapMapCtrl_c::draw() { if (field_0xef != 0) { - setPos(field_0xeb, field_0xec, field_0x9c, field_0xa0, field_0xbc, true, field_0xd8); + setPos(field_0xeb, field_0xec, field_0x9c, + field_0xa0, field_0xbc, true, field_0xd8); } } @@ -931,13 +939,13 @@ void dMenu_StageMapCtrl_c::_create(u16 param_0, u16 param_1, u16 param_2, u16 pa _create(param_0, param_1, param_2, param_3, var_r31, param_4); } -f32 dMenu_StageMapCtrl_c::m_zoomCenterMinX; +DUSK_GAME_DATA f32 dMenu_StageMapCtrl_c::m_zoomCenterMinX; -f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxX; +DUSK_GAME_DATA f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxX; -f32 dMenu_StageMapCtrl_c::m_zoomCenterMinZ; +DUSK_GAME_DATA f32 dMenu_StageMapCtrl_c::m_zoomCenterMinZ; -f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxZ; +DUSK_GAME_DATA f32 dMenu_StageMapCtrl_c::m_zoomCenterMaxZ; void dMenu_StageMapCtrl_c::_create(u16 width, u16 height, u16 param_2, u16 param_3, s8 param_4, void* param_5) { diff --git a/src/d/d_menu_fishing.cpp b/src/d/d_menu_fishing.cpp index 5e1b124b38..2af4291525 100644 --- a/src/d/d_menu_fishing.cpp +++ b/src/d/d_menu_fishing.cpp @@ -16,15 +16,16 @@ #include "m_Do/m_Do_graphic.h" #include +#include "helpers/string.hpp" #include "dusk/version.hpp" typedef void (dMenu_Fishing_c::*initFunc)(); -initFunc map_init_process[] = { +DUSK_GAME_DATA initFunc map_init_process[] = { &dMenu_Fishing_c::wait_init, }; typedef void (dMenu_Fishing_c::*moveFunc)(); -moveFunc map_move_process[] = { +DUSK_GAME_DATA moveFunc map_move_process[] = { &dMenu_Fishing_c::wait_move, }; @@ -372,7 +373,7 @@ void dMenu_Fishing_c::screenSetDoIcon() { void dMenu_Fishing_c::setAButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpAButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpAButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -384,7 +385,7 @@ void dMenu_Fishing_c::setAButtonString(u16 i_stringID) { void dMenu_Fishing_c::setBButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpBButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpBButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -419,29 +420,29 @@ void dMenu_Fishing_c::setFishParam(int i_fishIdx, u16 i_fishCount, u8 i_fishSize dComIfGp_setMessageCountNumber(i_fishSize); mpString->getString(0x597, field_0x10c[i][i_fishIdx], NULL, NULL, NULL, 0); // "inches" char* stringPtr = field_0x10c[i][i_fishIdx]->getStringPtr(); - strcpy(strBuff1, stringPtr); + SAFE_STRCPY(strBuff1, stringPtr); int j; for (j = 0; strBuff1[j + fishSizeFigure] != 0; j++) { strBuff2[j] = strBuff1[j + fishSizeFigure]; } strBuff2[j] = 0; strBuff1[fishSizeFigure] = 0; - strcpy(field_0x10c[i][i_fishIdx]->getStringPtr(), strBuff1); - strcpy(field_0x16c[i][i_fishIdx]->getStringPtr(), strBuff2); + SAFE_STRCPY(field_0x10c[i][i_fishIdx]->getStringPtr(), strBuff1); + SAFE_STRCPY(field_0x16c[i][i_fishIdx]->getStringPtr(), strBuff2); // part two, i_fishCount dComIfGp_setMessageCountNumber(i_fishCount); mpString->getString(0x598, field_0x13c[i][i_fishIdx], NULL, NULL, NULL, 0); // "fish" stringPtr = field_0x13c[i][i_fishIdx]->getStringPtr(); - strcpy(strBuff1, stringPtr); + SAFE_STRCPY(strBuff1, stringPtr); int k; for (k = 0; strBuff1[k + fishCountFigure] != 0; k++) { strBuff2[k] = strBuff1[k + fishCountFigure]; } strBuff2[k] = 0; strBuff1[fishCountFigure] = 0; - strcpy(field_0x13c[i][i_fishIdx]->getStringPtr(), strBuff1); - strcpy(field_0x19c[i][i_fishIdx]->getStringPtr(), strBuff2); + SAFE_STRCPY(field_0x13c[i][i_fishIdx]->getStringPtr(), strBuff1); + SAFE_STRCPY(field_0x19c[i][i_fishIdx]->getStringPtr(), strBuff2); } } diff --git a/src/d/d_menu_fmap.cpp b/src/d/d_menu_fmap.cpp index d2b06e962c..7db489e51b 100644 --- a/src/d/d_menu_fmap.cpp +++ b/src/d/d_menu_fmap.cpp @@ -21,9 +21,14 @@ #include "d/d_msg_object.h" #include "d/d_msg_scrn_explain.h" #include "d/d_stage.h" -#include "dusk/memory.h" +#include "helpers/string.hpp" #include "f_op/f_op_msg_mng.h" +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#include "dusk/memory.h" +#endif + static dMf_HIO_c g_fmHIO; static dMenu_Fmap_c::process init_process[30] = { @@ -92,7 +97,7 @@ static dMenu_Fmap_c::process move_process[30] = { &dMenu_Fmap_c::howl_demo3_move, }; -dMf_HIO_c* dMf_HIO_c::mMySelfPointer; +DUSK_GAME_DATA dMf_HIO_c* dMf_HIO_c::mMySelfPointer; dMf_HIO_c::dMf_HIO_c() { mMySelfPointer = this; @@ -126,7 +131,7 @@ const char* dMenuFmap_getStartStageName(void* i_fieldData) { if (!strcmp(dComIfGp_getStartStageName(), data[i].mStageName)) { // !@bug: probably supposed to be data[i].mVirtualStageName, but doesn't matter // because the two entries have the same virtual stage name - strcpy(virtual_stage, data->mVirtualStageName); + SAFE_STRCPY(virtual_stage, data->mVirtualStageName); return virtual_stage; } } @@ -135,7 +140,7 @@ const char* dMenuFmap_getStartStageName(void* i_fieldData) { return dComIfGp_getStartStageName(); } -dMenu_Fmap_c* dMenu_Fmap_c::MyClass; +DUSK_GAME_DATA dMenu_Fmap_c* dMenu_Fmap_c::MyClass; dMenu_Fmap_c::dMenu_Fmap_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i_cstick, u8 i_process, u8 i_regionCursor, u8 i_stageCursor, f32 i_stageTransX, @@ -197,7 +202,7 @@ dMenu_Fmap_c::dMenu_Fmap_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i mIsWarpMap = false; mProcess = PROC_REGION_MAP; - strcpy(mMarkedStageName, ""); + SAFE_STRCPY(mMarkedStageName, ""); if (g_fmapHIO.mpArcData != NULL && g_fmapHIO.mpArcData->isMounted()) { mProcess = i_process; mpMapArchive = g_fmapHIO.mpArcData; @@ -525,6 +530,16 @@ void dMenu_Fmap_c::_move() { } mpDraw2DBack->setSpotTextureFadeAlpha(mSpotTextureFadeAlpha); } + +#if TARGET_PC + u8 region = mpDraw2DBack->getSelectRegion(); + if (region != 0xFF && mpDraw2DBack->isShowRegion(region)) { + mpDraw2DTop->mSelectRegionNo = region; + } else { + mpDraw2DTop->mSelectRegionNo = 0xFF; + } + +#endif } void dMenu_Fmap_c::_draw() { @@ -920,17 +935,8 @@ void dMenu_Fmap_c::region_map_proc() { mpDraw2DBack->regionMapMove(mpStick); int stage_no, room_no; -#if TARGET_PC - f32 arrow_pos_x = mpDraw2DBack->getArrowPos2DX(); - if (dusk::getSettings().game.enableMirrorMode) { - arrow_pos_x = mpDraw2DBack->getMirrorPosX(arrow_pos_x, 0.0f); - } - - f32 pos_x = arrow_pos_x - mDoGph_gInf_c::getMinXF() - mDoGph_gInf_c::getWidthF() * 0.5f; -#else f32 pos_x = mpDraw2DBack->getArrowPos2DX() - mDoGph_gInf_c::getMinXF() - mDoGph_gInf_c::getWidthF() * 0.5f; -#endif f32 pos_y = mpDraw2DBack->getArrowPos2DY() - mDoGph_gInf_c::getHeightF() * 0.5f; mpMenuFmapMap->getPointStagePathInnerNo(getNowFmapRegionData(), pos_x, pos_y, @@ -1146,7 +1152,7 @@ void dMenu_Fmap_c::zoom_spot_to_region_init() { field_0x1ec = 1.0f; #if TARGET_PC // Frame interp note: field_0x122d used to be set every draw, causing flickering. Do it here instead. - if (dusk::getSettings().game.enableFrameInterpolation) { + if (dusk::frame_interp::is_enabled()) { mpDraw2DBack->resetScrollArrowMask(); } #endif @@ -1853,7 +1859,7 @@ bool dMenu_Fmap_c::isRoomCheck(int i_stageNo, int i_roomNo) { for (; i < mDataNumMax; i++) { if (checked_data[i]) continue; - strcpy(stage_name, stages[i].mName); + SAFE_STRCPY(stage_name, stages[i].mName); for (int k = 0; k < 64; k++) { local_e0[k] = false; @@ -2072,14 +2078,14 @@ bool dMenu_Fmap_c::readAreaData(u8 i_regionNo, bool i_isSelectedRegion) { for (; i < mDataNumMax; i++) { if (checked_data[i]) continue; - strcpy(tmp_stage_name, mTmpStageName); + SAFE_STRCPY(tmp_stage_name, mTmpStageName); resetRoomDataBit(); if (i_isSelectedRegion) { - strcpy(mTmpStageName, stages[i].mName); + SAFE_STRCPY(mTmpStageName, stages[i].mName); } else { - strcpy(mTmpStageName, tmp_stage_name); + SAFE_STRCPY(mTmpStageName, tmp_stage_name); } - strcpy(tmp_stage_name, stages[i].mName); + SAFE_STRCPY(tmp_stage_name, stages[i].mName); for (int k = 0; k < 64; k++) { local_e0[k] = false; @@ -2155,7 +2161,7 @@ bool dMenu_Fmap_c::readAreaData(u8 i_regionNo, bool i_isSelectedRegion) { mpDraw2DBack->setStageOriginXZ(mSpotNum, stages[stage_index].mOffsetX, stages[stage_index].mOffsetZ); mAreaName[mSpotNum] = stages[stage_index].mAreaName; - strcpy(mStageName[mSpotNum], stage_name); + SAFE_STRCPY(mStageName[mSpotNum], stage_name); mSpotNum++; } @@ -2203,7 +2209,7 @@ bool dMenu_Fmap_c::readRoomData(char const* i_stageName, dMenu_Fmap_stage_data_c dMenu_Fmap_stage_arc_data_c* room_data = NULL; char stage_path[20]; - sprintf(stage_path, "%s/stage.dat", i_stageName); + SAFE_SPRINTF(stage_path, "%s/stage.dat", i_stageName); if (readFieldMapData((void**)&room_data, stage_path, false, false)) { ((dMenuMapCommon_c::RoomData_c*)o_roomData)->setRoomData(room_data); } @@ -2217,7 +2223,7 @@ bool dMenu_Fmap_c::readRoomData(char const* i_stageName, dMenu_Fmap_stage_data_c void* dzs_data = NULL; char room_path[20]; - sprintf(room_path, "%s/room%d.dzs", i_stageName, room_nos[i]); + SAFE_SPRINTF(room_path, "%s/room%d.dzs", i_stageName, room_nos[i]); if (readRoomDzsData(&dzs_data, 0x1500, room_path)) { dMenu_Fmap_data_c* map_data = JKR_NEW dMenu_Fmap_data_c(); @@ -2308,9 +2314,9 @@ void dMenu_Fmap_c::decodeFieldMapData() { bool local_3f = false; if (j == 7) { local_3f = true; - sprintf(tex_path, "tex/region8.bti"); + SAFE_SPRINTF(tex_path, "tex/region8.bti"); } else { - sprintf(tex_path, "tex/region%d.bti", regions[i].mTextureReadNum); + SAFE_SPRINTF(tex_path, "tex/region%d.bti", regions[i].mTextureReadNum); } if (readFieldMapData((void**)&mRegionTexture[j], tex_path, true, local_3f)) { @@ -2428,7 +2434,7 @@ bool dMenu_Fmap_c::removeAreaData() { } for (int i = 0; i < 20; i++) { - strcpy(mStageName[i], ""); + SAFE_STRCPY(mStageName[i], ""); } field_0x305 = false; @@ -2475,12 +2481,6 @@ void dMenu_Fmap_c::portalWarpMapMove(STControl* i_stick) { f32 arrow_y = mpDraw2DBack->getArrowPos2DY(); u8 uVar6 = 0xff; -#if TARGET_PC - if (dusk::getSettings().game.enableMirrorMode) { - arrow_x = mpDraw2DBack->getMirrorPosX(arrow_x, 0.0f); - } -#endif - for (int i = 0; i < portal_dat->mCount; i++) { if (portals[i].mRegionNo == mpDraw2DBack->getRegionCursor() + 1 @@ -2539,17 +2539,22 @@ void dMenu_Fmap_c::drawIcon(f32 param_0, bool param_1) { fopAc_ac_c* player = daPy_getPlayerActorClass(); pos.set(dMapInfo_n::getMapPlayerPos()); angle = player->shape_angle.y; - strcpy(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); + SAFE_STRCPY(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); } else { pos = dComIfGs_getPlayerFieldLastStayPos(); angle = dComIfGs_getPlayerFieldLastStayAngleY(); - strcpy(stage_name, dComIfGs_getPlayerFieldLastStayName()); + SAFE_STRCPY(stage_name, dComIfGs_getPlayerFieldLastStayName()); } u8 is_portal_demo1 = 0; if (mProcess == PROC_PORTAL_DEMO1) { is_portal_demo1 = 1; } + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + angle = 0x10000 - angle; + } + #endif mpDraw2DBack->setIcon2DPos(0x11, stage_name, pos.x, pos.z, cM_sht2d(angle), is_portal_demo1, param_1); @@ -2600,6 +2605,13 @@ void dMenu_Fmap_c::drawLightDropIcon() { } void dMenu_Fmap_c::drawBatsumarkIcon() { +#if TARGET_PC + if (dusk::getSettings().game.removeQuestMapMarkers && + dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[0x190])) + { + return; + } +#endif drawIcon(5, 0x12); } @@ -2625,12 +2637,17 @@ void dMenu_Fmap_c::drawPlayEnterIcon() { if (dComIfGs_isPlayerFieldLastStayFieldDataExistFlag()) { pos.set(dMapInfo_n::getMapRestartPos()); angle = dComIfGs_getRestartRoomAngleY(); - strcpy(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); + SAFE_STRCPY(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); } else { pos = dComIfGs_getPlayerFieldLastStayPos(); angle = dComIfGs_getPlayerFieldLastStayAngleY(); - strcpy(stage_name, dComIfGs_getPlayerFieldLastStayName()); + SAFE_STRCPY(stage_name, dComIfGs_getPlayerFieldLastStayName()); } + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + angle = 0x10000 - angle; + } + #endif mpDraw2DBack->setIcon2DPos(0x15, stage_name, pos.x, pos.z, cM_sht2d(angle), 0, false); } } @@ -2771,10 +2788,10 @@ void dMenu_Fmap_c::arrowPosInit() { char stage_name[8]; if (dComIfGs_isPlayerFieldLastStayFieldDataExistFlag()) { pos.set(dMapInfo_n::getMapPlayerPos()); - strcpy(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); + SAFE_STRCPY(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); } else { pos = dComIfGs_getPlayerFieldLastStayPos(); - strcpy(stage_name, dComIfGs_getPlayerFieldLastStayName()); + SAFE_STRCPY(stage_name, dComIfGs_getPlayerFieldLastStayName()); } f32 fVar1 = 0.0f; @@ -2826,8 +2843,8 @@ void dMenu_Fmap_c::tableArrowPosInit(bool param_0) { break; } - static char* stage_name[4] = {"F_SP115", "F_SP113", "F_SP109", "F_SP108"}; - strcpy(mMarkedStageName, stage_name[iVar5]); + static DUSK_CONST char* stage_name[4] = {"F_SP115", "F_SP113", "F_SP109", "F_SP108"}; + SAFE_STRCPY(mMarkedStageName, stage_name[iVar5]); if (param_0) { f32 pos1_x, pos2_x, pos1_z, pos2_z, icon_x, icon_z; @@ -2855,8 +2872,8 @@ void dMenu_Fmap_c::yamibossArrowPosInit() { void dMenu_Fmap_c::howlArrowPosInit() { u8 type = dMeter2Info_getGoldWolfMapType(); - static char* stage_name[6] = {"F_SP104", "F_SP122", "F_SP122", "F_SP124", "F_SP111", "F_SP116"}; - strcpy(mMarkedStageName, stage_name[type - 2]); + static DUSK_CONST char* stage_name[6] = {"F_SP104", "F_SP122", "F_SP122", "F_SP124", "F_SP111", "F_SP116"}; + SAFE_STRCPY(mMarkedStageName, stage_name[type - 2]); static const int i_swBit[6] = {0x41, 0x29, 0x2a, 0x32, 0x79, 0x32}; f32 icon_x, icon_z; if (searchIcon(6, i_swBit[type - 2], &icon_x, &icon_z)) { @@ -2893,10 +2910,10 @@ cXyz* dMenu_Fmap_c::getPlayerPos2D() { char stage_name[8]; if (dComIfGs_isPlayerFieldLastStayFieldDataExistFlag()) { pos.set(dMapInfo_n::getMapPlayerPos()); - strcpy(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); + SAFE_STRCPY(stage_name, dMenuFmap_getStartStageName(mpFieldDat)); } else { pos = dComIfGs_getPlayerFieldLastStayPos(); - strcpy(stage_name, dComIfGs_getPlayerFieldLastStayName()); + SAFE_STRCPY(stage_name, dComIfGs_getPlayerFieldLastStayName()); } mpDraw2DBack->calcAllMapPos2D(stage_name, pos.x - mpDraw2DBack->getStageTransX(), pos.z - mpDraw2DBack->getStageTransZ(), diff --git a/src/d/d_menu_fmap2D.cpp b/src/d/d_menu_fmap2D.cpp index d62f7d1037..8b4e4b59b9 100644 --- a/src/d/d_menu_fmap2D.cpp +++ b/src/d/d_menu_fmap2D.cpp @@ -17,7 +17,10 @@ #include "d/d_msg_scrn_explain.h" #include "m_Do/m_Do_graphic.h" #include "d/actor/d_a_midna.h" +#if TARGET_PC #include "dusk/frame_interpolation.h" +#include "dusk/ui/touch_controls.hpp" +#endif #include #if TARGET_PC @@ -423,7 +426,15 @@ void dMenu_Fmap2DBack_c::draw() { } mpPointParent->setAlphaRate(mArrowAlpha * mSpotTextureFadeAlpha); - mpPointParent->translate(mArrowPos2DX + mTransX, mArrowPos2DY + mTransZ); + + f32 drawX = mArrowPos2DX + mTransX; +#ifdef TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + drawX = getMirrorPosX(drawX, 0.0f); + } +#endif + + mpPointParent->translate(drawX, mArrowPos2DY + mTransZ); mpPointScreen->draw(0.0f, 0.0f, grafPort); } @@ -437,7 +448,7 @@ void dMenu_Fmap2DBack_c::draw() { if (field_0x122d) { mpMeterHaihai->drawHaihai(field_0x122d); #if TARGET_PC - if (!dusk::getSettings().game.enableFrameInterpolation) { + if (!dusk::frame_interp::is_enabled()) { field_0x122d = 0; } #else @@ -742,7 +753,7 @@ void dMenu_Fmap2DBack_c::zoomMapCalc(f32 i_zoom) { f32 tmp2 = (dVar12 + (i_zoom * (centerX - dVar12))); f32 tmp2_ = (dVar11 + (i_zoom * (centerY - dVar11))); - + field_0xf0c[mRegionCursor] = ((tmp2 + (tmp3 * mZoom)) - mRegionMapSizeX[mRegionCursor] * mZoom * 0.5f) - mRegionMinMapX[mRegionCursor]; @@ -1015,6 +1026,11 @@ void dMenu_Fmap2DBack_c::allmap_move2(STControl* param_0) { f32 delta_y = speed * cM_ssin(angle); f32 delta_x = speed * cM_scos(angle); +#ifdef TARGET_PC + if (dusk::getSettings().game.enableMirrorMode) { + delta_y = -delta_y; + } +#endif control_xpos = control_xpos + delta_y; control_ypos = control_ypos + delta_x; } @@ -1043,11 +1059,6 @@ void dMenu_Fmap2DBack_c::allmap_move2(STControl* param_0) { calcAllMapPos2D((mArrowPos3DX + control_xpos) - mStageTransX, (mArrowPos3DZ + control_ypos) - mStageTransZ, &sp14, &sp10); -#if TARGET_PC - if (dusk::getSettings().game.enableMirrorMode) { - sp14 = getMirrorPosX(sp14, 0.0f); - } -#endif mSelectRegion = 0xff; for (int i = 7; i >= 0; i--) { @@ -1462,6 +1473,12 @@ void dMenu_Fmap2DBack_c::worldGridDraw() { f32 dVar8 = -mStageTransZ; calcAllMapPos2D(dVar9, dVar8, &local_74, &local_78); + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + local_74 = getMirrorPosX(local_74, 0.0f); + } + #endif + J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74, mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(), JUtility::TColor(255, 255, 255, 255), 6); @@ -1470,6 +1487,11 @@ void dMenu_Fmap2DBack_c::worldGridDraw() { while (true) { calcAllMapPos2D(xPos, dVar8, &local_74, &local_78); if (local_74 >= getMapScissorAreaLX()) { + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + local_74 = getMirrorPosX(local_74, 0.0f); + } + #endif J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74, mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(), JUtility::TColor(255, 255, 255, 255), 6); @@ -1531,6 +1553,12 @@ void dMenu_Fmap2DBack_c::regionGridDraw() { f32 dVar8 = mRegionOriginZ[mRegionCursor] - mStageTransZ; calcAllMapPos2D(dVar9, dVar8, &local_74, &local_78); + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + local_74 = getMirrorPosX(local_74, 0.0f); + } + #endif + J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74, mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(), JUtility::TColor(180, 0, 0, 255), 6); @@ -1539,6 +1567,12 @@ void dMenu_Fmap2DBack_c::regionGridDraw() { while (true) { calcAllMapPos2D(xPos, dVar8, &local_74, &local_78); if (local_74 >= getMapScissorAreaLX()) { + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + local_74 = getMirrorPosX(local_74, 0.0f); + } + #endif + J2DDrawLine(local_74, mDoGph_gInf_c::getMinYF(), local_74, mDoGph_gInf_c::getMinYF() + mDoGph_gInf_c::getHeightF(), JUtility::TColor(180, 0, 0, 255), 6); @@ -1601,6 +1635,12 @@ void dMenu_Fmap2DBack_c::worldOriginDraw() { f32 local_44, local_48; calcAllMapPos2D(-mStageTransX, -mStageTransZ, &local_44, &local_48); + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + local_44 = getMirrorPosX(local_44, 0.0f); + } + #endif + J2DDrawLine(mDoGph_gInf_c::getMinXF(), local_48 - local_44 + mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF(), local_48 - local_44 + (mDoGph_gInf_c::getMinXF() + mDoGph_gInf_c::getWidthF()), @@ -1635,6 +1675,13 @@ void dMenu_Fmap2DBack_c::scrollAreaDraw() { calcAllMapPos2D(x_min - mStageTransX, z_min - mStageTransZ, &local_4c, &local_50); calcAllMapPos2D(x_max - mStageTransX, z_max - mStageTransZ, &local_54, &local_58); + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + local_4c = getMirrorPosX(local_4c, 0.0f); + local_54 = getMirrorPosX(local_54, 0.0f); + } + #endif + J2DDrawLine(local_4c, local_50, local_4c, local_58, JUtility::TColor(255, 255, 255, 255), 6); J2DDrawLine(local_54, local_50, local_54, local_58, @@ -1655,6 +1702,11 @@ void dMenu_Fmap2DBack_c::regionOriginDraw() { f32 center_x, center_y; calcAllMapPos2D(mRegionOriginX[i] - mStageTransX, mRegionOriginZ[i] - mStageTransZ, ¢er_x, ¢er_y); + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + center_x = getMirrorPosX(center_x - 3.0f, 3.0f); + } + #endif J2DFillBox(center_x - 3.0f, center_y - 3.0f, 6.0f, 6.0f, JUtility::TColor(255, 0, 0, 255)); } } @@ -1672,6 +1724,11 @@ void dMenu_Fmap2DBack_c::stageOriginDraw() { f32 v1 = mRegionOriginX[mRegionCursor] + stage_data[i].mOffsetX - mStageTransX; f32 v2 = mRegionOriginZ[mRegionCursor] + stage_data[i].mOffsetZ - mStageTransZ; calcAllMapPos2D(v1, v2, ¢er_x, ¢er_y); + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + center_x = getMirrorPosX(center_x - 3.0f, 3.0f); + } + #endif J2DFillBox(center_x - 3.0f, center_y - 3.0f, 6.0f, 6.0f, JUtility::TColor(0, 0, 255, 255)); } @@ -1918,7 +1975,7 @@ void dMenu_Fmap2DBack_c::regionMapMove(STControl* i_stick) { f32 speed = base_speed / 100.0f * local_78; f32 speed_y = speed * cM_ssin(angle); f32 speed_x = speed * cM_scos(angle); - control_xpos += speed_y; + control_xpos += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -speed_y :) speed_y; control_ypos += speed_x; } } @@ -1943,6 +2000,7 @@ void dMenu_Fmap2DBack_c::regionMapMove(STControl* i_stick) { calcAllMapPos2D(mArrowPos3DX + control_xpos - mStageTransX, mArrowPos3DZ + control_ypos - mStageTransZ, &pos_x, &pos_y); + mSelectRegion = 0xff; int region = mRegionCursor; if (region != 0xff && region != 7) { @@ -1987,7 +2045,7 @@ void dMenu_Fmap2DBack_c::stageMapMove(STControl* i_stick, u8 param_1, bool param f32 speed = base_speed / 100.0f * local_78; f32 speed_x = speed * cM_ssin(angle); f32 speed_z = speed * cM_scos(angle); - mStageTransX += speed_x; + mStageTransX += IF_DUSK(dusk::getSettings().game.enableMirrorMode ? -speed_x :) speed_x; mStageTransZ += speed_z; } else if (!param_2) { return; @@ -2081,6 +2139,11 @@ void dMenu_Fmap2DBack_c::drawDebugStageArea() { if (stage_no >= 0) { f32 v = i + mDoGph_gInf_c::getMinXF(); f32 v2 = j; + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + v = getMirrorPosX(v - 3.0f, 3.0f); + } + #endif J2DFillBox(v - 3.0f, v2 - 3.0f, 6.0f, 6.0f, colors[stage_no % 6]); } } @@ -2116,6 +2179,11 @@ void dMenu_Fmap2DBack_c::drawDebugRegionArea() { mRegionMapSizeX[region] * mZoom, mRegionMapSizeY[region] * mZoom, mpAreaTex[region]->getTexture(0)->getTexInfo()); if (u) { + #if TARGET_PC + if(dusk::getSettings().game.enableMirrorMode) { + pos_x = getMirrorPosX(pos_x - 3.0f, 3.0f); + } + #endif J2DFillBox(pos_x - 3.0f, pos_y - 3.0f, 6.0f, 6.0f, colors[region]); break; } @@ -2482,10 +2550,26 @@ dMenu_Fmap2DTop_c::dMenu_Fmap2DTop_c(JKRExpHeap* i_heap, STControl* i_stick) { set3DStickString(0x524); #endif +#if TARGET_PC + mpPoeCountIcon = JKR_NEW J2DPicture((ResTIMG*)JKRGetNameResource("ni_item_icon_pou.bti", dComIfGp_getItemIconArchive())); + + mpPoeCountPane = JKR_NEW J2DTextBox(); + if (mpPoeCountPane != nullptr) { + mpPoeCountPane->setFontSize(15.0f, 15.0f); + mpPoeCountPane->setFont(mDoExt_getMesgFont()); + } + + mSelectRegionNo = 0xFF; +#endif + setHIO(true); } dMenu_Fmap2DTop_c::~dMenu_Fmap2DTop_c() { +#if TARGET_PC + dusk::ui::set_control_override(dusk::ui::Control::Z, dusk::ui::ControlOverride::Default); +#endif + deleteExplain(); JKR_DELETE(mpTitleScreen); mpTitleScreen = NULL; @@ -2540,6 +2624,14 @@ dMenu_Fmap2DTop_c::~dMenu_Fmap2DTop_c() { } JKR_DELETE(mpAnm); mpAnm = NULL; + +#if TARGET_PC + JKR_DELETE(mpPoeCountIcon); + mpPoeCountIcon = NULL; + + JKR_DELETE(mpPoeCountPane); + mpPoeCountPane = NULL; +#endif } void dMenu_Fmap2DTop_c::_execute() { @@ -2636,6 +2728,35 @@ void dMenu_Fmap2DTop_c::draw() { ctx->scissor(mTransX, 0.0f, FB_WIDTH, FB_HEIGHT); ctx->setScissor(); mpTitleScreen->draw(mTransX, mTransY, ctx); + +#if TARGET_PC + if (dusk::getSettings().game.enhancedMapMenus) { + int nowPoeCount = 0; + int totalPoeCount = 0; + dMenuMapCommon_c::getFmapPoeCount(mSelectRegionNo, nowPoeCount, totalPoeCount); + if (dComIfGs_isEventBit(dSv_event_flag_c::F_0456) && totalPoeCount > 0) { + const f32 x = mTransX + mDoGph_gInf_c::ScaleHUDXRight(485.0f); + const f32 y = 380.0f; + constexpr f32 iconsize = 48.0f * 0.8f; + + if (mpPoeCountIcon != nullptr) + mpPoeCountIcon->draw(x - 35.0f, y - 25.0f, iconsize, iconsize, false, false, false); + + char counter_text[6]; + snprintf(counter_text, sizeof(counter_text), "%d/%d", nowPoeCount, totalPoeCount); + mpPoeCountPane->setString(counter_text); + + mpPoeCountPane->setCharColor(0x000000FF); + mpPoeCountPane->setGradColor(0x000000FF); + mpPoeCountPane->draw(x + 1, y + 1, FB_WIDTH, HBIND_LEFT); + + mpPoeCountPane->setCharColor(0xC8C8C8FF); + mpPoeCountPane->setGradColor(0xC8C8C8FF); + mpPoeCountPane->draw(x, y, FB_WIDTH, HBIND_LEFT); + } + } +#endif + ctx->scissor(scissor_left, scissor_top, scissor_width, scissor_height); ctx->setScissor(); if (mpScrnExplain) { @@ -2681,7 +2802,7 @@ void dMenu_Fmap2DTop_c::setTitleNameString(u32 param_0) { #endif for (int i = 0; i < 7; i++) { if (param_0 == 0) { - strcpy(((J2DTextBox*)(mpTitleScreen->search(setTitleNameString_font_name[i]))) + SAFE_STRCPY(((J2DTextBox*)(mpTitleScreen->search(setTitleNameString_font_name[i]))) ->getStringPtr(), ""); } else { @@ -2704,7 +2825,7 @@ void dMenu_Fmap2DTop_c::setAreaNameString(u32 param_0) { #endif for (int i = 0; i < 3; i++) { if (param_0 == 0) { - strcpy(((J2DTextBox*)(mpTitleScreen->search(setAreaNameString_area_name[i]))) + SAFE_STRCPY(((J2DTextBox*)(mpTitleScreen->search(setAreaNameString_area_name[i]))) ->getStringPtr(), ""); } else { @@ -2722,6 +2843,12 @@ void dMenu_Fmap2DTop_c::setZButtonString(u32 param_0, u8 i_alpha) { param_0 = 0x533; } +#if TARGET_PC + dusk::ui::set_control_override(dusk::ui::Control::Z, + param_0 != 0 && isWarpAccept() ? dusk::ui::ControlOverride::Action : + dusk::ui::ControlOverride::Default); +#endif + #if VERSION == VERSION_GCN_JPN static const u64 cont_zt[5] = {MULTI_CHAR('cont_zt'), MULTI_CHAR('cont_zt1'), MULTI_CHAR('cont_zt2'), MULTI_CHAR('cont_zt3'), MULTI_CHAR('cont_zt4')}; #define setZButtonString_font_zt cont_zt @@ -2817,7 +2944,7 @@ void dMenu_Fmap2DTop_c::setCrossLRString(u32 param_0) { if (param_0 == 0) { for (int i = 0; i < 5; i++) { J2DTextBox* text_box = static_cast(mpTitleScreen->search(juji_c[i])); - strcpy(text_box->getStringPtr(), ""); + SAFE_STRCPY(text_box->getStringPtr(), ""); } mpTitleScreen->search(MULTI_CHAR('juy_sha0'))->show(); mAlphaDpad = 1; @@ -2842,7 +2969,7 @@ void dMenu_Fmap2DTop_c::set3DStickString(u32 param_0) { if (param_0 == 0) { for (int i = 0; i < 5; i++) { J2DTextBox* text_box = static_cast(mpTitleScreen->search(ast_c[i])); - strcpy(text_box->getStringPtr(), ""); + SAFE_STRCPY(text_box->getStringPtr(), ""); } mpTitleScreen->search(MULTI_CHAR('as_sha0'))->show(); mAlphaAnalogStick = 1; diff --git a/src/d/d_menu_fmap_map.cpp b/src/d/d_menu_fmap_map.cpp index c500aff0be..b2477b8b06 100644 --- a/src/d/d_menu_fmap_map.cpp +++ b/src/d/d_menu_fmap_map.cpp @@ -505,7 +505,7 @@ void dMenu_FmapMap_c::_delete() { } } -const dMfm_HIO_prm_res_src_s dMfm_HIO_prm_res_src_s::m_other = {30}; +DUSK_GAME_DATA const dMfm_HIO_prm_res_src_s dMfm_HIO_prm_res_src_s::m_other = {30}; void dMenu_FmapMap_c::draw() { { int unused; } diff --git a/src/d/d_menu_insect.cpp b/src/d/d_menu_insect.cpp index 88e05226e8..aa18407b09 100644 --- a/src/d/d_menu_insect.cpp +++ b/src/d/d_menu_insect.cpp @@ -22,6 +22,10 @@ #include #include +#if TARGET_PC +#include "dusk/menu_pointer.h" +#endif + typedef void (dMenu_Insect_c::*initFunc)(); static initFunc map_init_process[] = { &dMenu_Insect_c::wait_init, &dMenu_Insect_c::explain_open_init, @@ -280,6 +284,12 @@ void dMenu_Insect_c::wait_init() { void dMenu_Insect_c::wait_move() { if (mDoGph_gInf_c::getFader()->getStatus() == 1) { +#if TARGET_PC + if (pointerWait()) { + return; + } +#endif + if (mDoCPd_c::getTrigB(PAD_1) || field_0xf7 == 0) { if (mDoCPd_c::getTrigB(PAD_1) && field_0xf6 == 1) { dMeter2Info_setInsectSelectType(0); @@ -301,6 +311,40 @@ void dMenu_Insect_c::wait_move() { } } +#if TARGET_PC +bool dMenu_Insect_c::pointerWait() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Collection); + for (u8 y = 0; y < 4; ++y) { + for (u8 x = 0; x < 6; ++x) { + const int index = x + y * 6; + if (!isGetInsect(x, y) || !dusk::menu_pointer::hit_pane(mpINSParent[index], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(index); + + if (field_0xf4 != x || field_0xf5 != y) { + field_0xf4 = x; + field_0xf5 = y; + setCursorPos(); + setAButtonString(0x368); + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } + if (dusk::menu_pointer::consume_click()) { + field_0xf3 = 1; + Z2GetAudioMgr()->seStart(Z2SE_SY_EXP_WIN_OPEN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibration(); + return true; + } + return false; + } + } + + return false; +} +#endif + void dMenu_Insect_c::explain_open_init() { char local_78[32]; char local_98[32]; @@ -352,12 +396,12 @@ void dMenu_Insect_c::explain_open_init() { "\x1B" "CR[%d]", (int)(0.5f * (length - stringLength1))); - strcat(local_b8, local_78); + SAFE_STRCAT(local_b8, local_78); snprintf(cStack_d8, 32, "\x1B" "CR[%d]", (int)(0.5f * (length - stringLength2))); - strcat(cStack_d8, local_98); + SAFE_STRCAT(cStack_d8, local_98); mpSelect_c->setString("", local_b8, cStack_d8); mpSelect_c->setRubyString("", "", ""); mpSelect_c->selAnimeInit(2, field_0xf7 + 1, 0, length, 0); @@ -730,7 +774,7 @@ u8 dMenu_Insect_c::dpdMove() { void dMenu_Insect_c::setAButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpAButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpAButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -742,7 +786,7 @@ void dMenu_Insect_c::setAButtonString(u16 i_stringID) { void dMenu_Insect_c::setBButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpBButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpBButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { diff --git a/src/d/d_menu_item_explain.cpp b/src/d/d_menu_item_explain.cpp index dd3af54571..bebcb2cdb0 100644 --- a/src/d/d_menu_item_explain.cpp +++ b/src/d/d_menu_item_explain.cpp @@ -508,12 +508,12 @@ void dMenu_ItemExplain_c::move_select_init() { "\x1B" "CR[%d]", (int)(0.5f * (length - stringLength1))); - strcat(local_64, local_88); + SAFE_STRCAT(local_64, local_88); snprintf(cStack78, 20, "\x1B" "CR[%d]", (int)(0.5f * (length - stringLength2))); - strcat(cStack78, local_80); + SAFE_STRCAT(cStack78, local_80); mpSelect_c->setString("", local_64, cStack78); mpSelect_c->setRubyString("", "", ""); mpSelect_c->selAnimeInit(2, field_0xe2 + 1, 0, length, 0); diff --git a/src/d/d_menu_letter.cpp b/src/d/d_menu_letter.cpp index 4bfda4b9cd..3f997bbda5 100644 --- a/src/d/d_menu_letter.cpp +++ b/src/d/d_menu_letter.cpp @@ -19,6 +19,15 @@ #ifdef TARGET_PC #include "dusk/achievements.h" +#include "dusk/menu_pointer.h" +#include "dusk/ui/touch_controls.hpp" + +static void enable_turn_page_controls(bool enabled) { + const auto controlOverride = + enabled ? dusk::ui::ControlOverride::Action : dusk::ui::ControlOverride::Default; + dusk::ui::set_control_override(dusk::ui::Control::L, controlOverride); + dusk::ui::set_control_override(dusk::ui::Control::R, controlOverride); +} #endif #if VERSION == VERSION_GCN_JPN @@ -82,6 +91,10 @@ dMenu_Letter_c::dMenu_Letter_c(JKRExpHeap* i_heap, STControl* i_stick, CSTContro dMenu_Letter_c::~dMenu_Letter_c() { +#if TARGET_PC + enable_turn_page_controls(false); +#endif + JKR_DELETE(mpDrawCursor); mpDrawCursor = NULL; @@ -357,6 +370,10 @@ int dMenu_Letter_c::_open() { } int dMenu_Letter_c::_close() { +#if TARGET_PC + enable_turn_page_controls(false); +#endif + s16 closeWindowFrame = g_drawHIO.mLetterSelectScreen.mCloseFrame[dMeter_drawLetterHIO_c::WINDOW_FRAME]; field_0x368 = 0; @@ -386,6 +403,10 @@ int dMenu_Letter_c::_close() { } void dMenu_Letter_c::wait_init() { +#if TARGET_PC + enable_turn_page_controls(field_0x374 > 1); +#endif + setAButtonString(0x40c); setBButtonString(0x3f9); } @@ -393,6 +414,12 @@ void dMenu_Letter_c::wait_init() { void dMenu_Letter_c::wait_move() { u8 oldIndex = mIndex; if (mDoGph_gInf_c::getFader()->getStatus() == 1) { +#if TARGET_PC + if (pointerWait()) { + return; + } +#endif + if (mDoCPd_c::getTrigB(PAD_1) != 0) { mpDrawCursor->offPlayAnime(0); mStatus = 3; @@ -448,8 +475,41 @@ void dMenu_Letter_c::wait_move() { } } +#if TARGET_PC +bool dMenu_Letter_c::pointerWait() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Collection); + for (u8 i = 0; i < field_0x373; ++i) { + if (!dusk::menu_pointer::hit_pane(mpLetterParent[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(i); + + if (mIndex != i) { + mIndex = i; + changeActiveColor(); + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } + if (dusk::menu_pointer::consume_click()) { + mProcess = 3; + Z2GetAudioMgr()->seStart(Z2SE_SY_LETTER_OPEN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibration(); + return true; + } + return false; + } + + return false; +} +#endif + void dMenu_Letter_c::slide_right_init() { +#if TARGET_PC + enable_turn_page_controls(false); +#endif + field_0x358 = -field_0x1ec->getWidth() * mDoGph_gInf_c::getInvScale(); field_0x35c = field_0x1ec->getWidth() IF_NOT_DUSK(* mDoGph_gInf_c::getInvScale()); changePageLight(); @@ -467,6 +527,10 @@ void dMenu_Letter_c::slide_right_move() { } void dMenu_Letter_c::slide_left_init() { +#if TARGET_PC + enable_turn_page_controls(false); +#endif + field_0x358 = field_0x1ec->getWidth() * mDoGph_gInf_c::getInvScale(); field_0x35c = -field_0x1ec->getWidth() IF_NOT_DUSK(* mDoGph_gInf_c::getInvScale()); changePageLight(); @@ -484,6 +548,10 @@ void dMenu_Letter_c::slide_left_move() { } void dMenu_Letter_c::read_open_init() { +#if TARGET_PC + enable_turn_page_controls(false); +#endif + field_0x36a = 0; u8 idx = field_0x3ac[field_0x36f * 6 + mIndex] - 1; field_0x3e3 = 1; @@ -501,10 +569,10 @@ void dMenu_Letter_c::read_open_init() { field_0x3e2 = mpString->getPageMax(D_MENU_LETTER_LINE_MAX); if (field_0x3e2 > 1) { char acStack_30[20]; - sprintf(acStack_30, "%d/%d", field_0x3e3, field_0x3e2); + SAFE_SPRINTF(acStack_30, "%d/%d", field_0x3e3, field_0x3e2); for (int i = 0; i < 2; i++) { field_0x1e4[i]->show(); - strcpy(field_0x1e4[i]->getStringPtr(), acStack_30); + SAFE_STRCPY(field_0x1e4[i]->getStringPtr(), acStack_30); } } else { for (int i = 0; i < 2; i++) { @@ -654,10 +722,10 @@ void dMenu_Letter_c::read_next_fadein_init() { D_MENU_LETTER_LINE_MAX, text2, text1, NULL, NULL, 0); } char acStack_30[10]; - sprintf(acStack_30, "%d/%d", field_0x3e3, field_0x3e2); + SAFE_SPRINTF(acStack_30, "%d/%d", field_0x3e3, field_0x3e2); for (int i = 0; i < 2; i++) { field_0x1e4[i]->show(); - strcpy(field_0x1e4[i]->getStringPtr(), acStack_30); + SAFE_STRCPY(field_0x1e4[i]->getStringPtr(), acStack_30); } } @@ -1273,7 +1341,7 @@ void dMenu_Letter_c::copyDMYMenu() { void dMenu_Letter_c::setAButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpAButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpAButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -1286,7 +1354,7 @@ void dMenu_Letter_c::setAButtonString(u16 i_stringID) { void dMenu_Letter_c::setBButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpBButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpBButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { diff --git a/src/d/d_menu_map_common.cpp b/src/d/d_menu_map_common.cpp index 0017975c4e..c18f5825ff 100644 --- a/src/d/d_menu_map_common.cpp +++ b/src/d/d_menu_map_common.cpp @@ -410,10 +410,15 @@ void dMenuMapCommon_c::drawIcon(f32 i_posX, f32 i_posY, f32 param_3, f32 param_4 } f32 pos_x = i_posX + (icon_pos_x - (icon_size_x / 2)); + bool r4 = false; #if TARGET_PC if (dusk::getSettings().game.enableMirrorMode) { pos_x = getMirrorCenterPosX(i_posX + (icon_pos_x - (icon_size_x / 2)), icon_size_x / 2); } + + if(mIconInfo[info_idx].icon_no == ICON_GOLD_WOLF_e) { + r4 = true; + } #endif mPictures[mIconInfo[info_idx].icon_no]->draw(pos_x, (i_posY + (icon_pos_y - icon_size_y / 2)), @@ -422,7 +427,7 @@ void dMenuMapCommon_c::drawIcon(f32 i_posX, f32 i_posY, f32 param_3, f32 param_4 if (mIconInfo[info_idx].icon_no == ICON_LIGHT_DROP_e) { mLightDropPic->draw((pos_x + (icon_size_x / 2)) - (var_f29 / 2), ((icon_size_y / 2) + (i_posY + (icon_pos_y - icon_size_y / 2))) - (var_f28 / 2), - var_f29, var_f28, false, false, false); + var_f29, var_f28, r4, false, false); } } } @@ -747,3 +752,113 @@ void dMenuMapCommon_c::debugIcon() { setIconInfo(ICON_LV8_WARP_e, pos_x, pos_y, 0.0f, scale, 1.0f, 1); } } + +#if TARGET_PC +static constexpr struct { + std::string_view stagename; + u8 switch_no; + s8 region_id; + u8 save_id; +} l_poeInfo[] = { + // Dungeons + {"D_MN06", 0x19, -1, 0x15}, + {"D_MN06", 0x18, -1, 0x15}, + {"D_MN07", 0x54, -1, 0x16}, + {"D_MN07", 0x55, -1, 0x16}, + {"D_MN10", 0x1E, -1, 0x13}, + {"D_MN10", 0x1F, -1, 0x13}, + {"D_MN10", 0x20, -1, 0x13}, + {"D_MN10", 0x21, -1, 0x13}, + {"D_MN11", 0x72, -1, 0x14}, + {"D_MN11", 0x15, -1, 0x14}, + {"D_MN11", 0x7F, -1, 0x14}, + + // Sub-Dungeons + {"D_SB01", 0x45, 4, 0x19}, + {"D_SB01", 0x46, 4, 0x19}, + {"D_SB01", 0x47, 4, 0x19}, + {"D_SB02", 0x60, 2, 0x19}, + {"D_SB03", 0x5E, 3, 0x1A}, + {"D_SB03", 0x5F, 3, 0x1A}, + {"D_SB03", 0x5D, 3, 0x1A}, + {"D_SB05", 0xA, 3, 0x1B}, + {"D_SB05", 0xB, 3, 0x1B}, + {"D_SB07", 0xF, 4, 0x1B}, + {"D_SB07", 0x10, 4, 0x1B}, + + // Field Spots + {"F_SP108", 0x5D, 1, 0x2}, + {"F_SP109", 0x5E, 2, 0x3}, + {"F_SP109", 0x5F, 2, 0x3}, + {"F_SP110", 0x59, 2, 0x3}, + {"F_SP111", 0x57, 2, 0x3}, + {"F_SP111", 0x58, 2, 0x3}, + {"F_SP113", 0x49, 3, 0x4}, + {"F_SP113", 0x4A, 3, 0x4}, + {"F_SP114", 0x7C, 5, 0x8}, + {"F_SP114", 0x7D, 5, 0x8}, + {"F_SP114", 0x7B, 5, 0x8}, + {"F_SP114", 0x7E, 5, 0x8}, + {"F_SP114", 0x7F, 5, 0x8}, + {"F_SP115", 0x46, 3, 0x4}, + {"F_SP115", 0x47, 3, 0x4}, + {"F_SP115", 0x4B, 3, 0x4}, + {"F_SP115", 0x4C, 3, 0x4}, + {"F_SP115", 0x4D, 3, 0x4}, + {"F_SP117", 0xF, 1, 0x7}, + {"F_SP117", 0x1E, 1, 0x7}, + {"F_SP117", 0x10, 1, 0x7}, + {"F_SP117", 0x11, 1, 0x7}, + {"F_SP118", 0x78, 4, 0xA}, + {"F_SP118", 0x5A, 4, 0xA}, + {"F_SP121", 0x3A, 2, 0x6}, + {"F_SP121", 0x39, 1, 0x6}, + {"F_SP121", 0x33, 3, 0x6}, + {"F_SP121", 0x3B, 3, 0x6}, + {"F_SP122", 0x49, 3, 0x6}, + {"F_SP122", 0x30, 3, 0x6}, + {"F_SP122", 0x47, 3, 0x6}, + {"F_SP124", 0x5B, 4, 0xA}, + {"F_SP124", 0x5C, 4, 0xA}, + {"F_SP124", 0x5D, 4, 0xA}, + {"F_SP124", 0x33, 4, 0xA}, + {"F_SP126", 0x48, 3, 0x4}, + {"F_SP128", 0x40, 2, 0x3}, + {"R_SP160", 0x1F, 3, 0x9}, +}; + +void dMenuMapCommon_c::getDmapPoeCount(const std::string& stageName, int& nowCount, int& totalCount) { + nowCount = 0; + totalCount = 0; + + for (const auto& i : l_poeInfo) { + if (stageName == i.stagename) { + if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == i.save_id) { + nowCount += dComIfGs_isSwitch(i.switch_no, -1); + } else { + nowCount += dComIfGs_isSaveSwitch(i.save_id, i.switch_no); + } + totalCount++; + } + } +} + +void dMenuMapCommon_c::getFmapPoeCount(const int regionNo, int& nowCount, int& totalCount) { + nowCount = 0; + totalCount = 0; + + if (regionNo < 0) + return; + + for (const auto& i : l_poeInfo) { + if (regionNo == i.region_id) { + if (dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == i.save_id) { + nowCount += dComIfGs_isSwitch(i.switch_no, -1); + } else { + nowCount += dComIfGs_isSaveSwitch(i.save_id, i.switch_no); + } + totalCount++; + } + } +} +#endif diff --git a/src/d/d_menu_option.cpp b/src/d/d_menu_option.cpp index af322a1c01..94babc8342 100644 --- a/src/d/d_menu_option.cpp +++ b/src/d/d_menu_option.cpp @@ -26,6 +26,11 @@ #include "JSystem/JAudio2/JASDriverIF.h" +#if TARGET_PC +#include "dusk/menu_pointer.h" +#include "dusk/ui/touch_controls.hpp" +#endif + typedef void (dMenu_Option_c::*initFunc)(); static initFunc init[] = { &dMenu_Option_c::atten_init, @@ -78,6 +83,12 @@ enum SelectType { SelectType8, }; +#if TARGET_PC +static dusk::menu_pointer::TargetId option_yes_no_target(u8 index) noexcept { + return static_cast(0x100 + index); +} +#endif + dMenu_Option_c::dMenu_Option_c(JKRArchive* i_archive, STControl* i_stick) { mUseFlag = 0; mBarScale[0] = g_drawHIO.mOptionScreen.mBarScale[0]; @@ -293,6 +304,10 @@ void dMenu_Option_c::_create() { } void dMenu_Option_c::_delete() { +#if TARGET_PC + dusk::ui::set_control_override(dusk::ui::Control::Z, dusk::ui::ControlOverride::Default); +#endif + JKR_DELETE(mpString); mpString = NULL; @@ -518,6 +533,15 @@ void dMenu_Option_c::_move() { (this->*init[field_0x3ef])(); } } + +#if TARGET_PC + if (field_0x3f4 == 5 && field_0x3ef != SelectType3 && field_0x3f3 == 5 && + field_0x3ef != SelectType4 && field_0x3ef != SelectType5 && field_0x3ef != SelectType6 && + field_0x3ef != SelectType7 && pointerConfirmSelect()) + { + goto skip; + } +#endif } skip: u8 oldValue = field_0x3ef; @@ -1074,6 +1098,44 @@ void dMenu_Option_c::confirm_move_move() { bool leftTrigger = checkLeftTrigger(); bool rightTrigger = checkRightTrigger(); +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Options); + for (u8 i = 0; i < 2; ++i) { + if (!dusk::menu_pointer::hit_pane(mpYesNoSelBase_c[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(option_yes_no_target(i)); + const bool clicked = dusk::menu_pointer::consume_click(); + if (field_0x3f9 != i) { + Z2GetAudioMgr()->seStart(Z2SE_SY_MENU_CURSOR_COMMON, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + field_0x3fa = field_0x3f9; + field_0x3f9 = i; + if (clicked) { + yesNoSelectStart(); + field_0x3ef = SelectType7; + dMeter2Info_set2DVibrationM(); + mpWarning->_move(); + setAnimation(); + return; + } + yesnoSelectAnmSet(); + field_0x3ef = SelectType6; + mpWarning->_move(); + setAnimation(); + return; + } + if (clicked) { + yesNoSelectStart(); + field_0x3ef = SelectType7; + dMeter2Info_set2DVibrationM(); + mpWarning->_move(); + setAnimation(); + return; + } + } +#endif + if (mDoCPd_c::getTrigA(PAD_1) != 0) { yesNoSelectStart(); field_0x3ef = SelectType7; @@ -1110,11 +1172,36 @@ void dMenu_Option_c::confirm_select_init() { } void dMenu_Option_c::confirm_select_move() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Options); + if (field_0x3f9 != 0xff && + dusk::menu_pointer::hit_pane(mpYesNoSelBase_c[field_0x3f9], 8.0f)) + { + const dusk::menu_pointer::TargetId target = option_yes_no_target(field_0x3f9); + dusk::menu_pointer::set_hover_target(target); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation(dusk::menu_pointer::Context::Options, target); + } + } +#endif u8 selectMoveAnm = yesnoSelectMoveAnm(); u8 wakuAlphaAnm = yesnoWakuAlpahAnm(field_0x3fa); if (selectMoveAnm == 1 && wakuAlphaAnm == 1) { yesnoCursorShow(); +#if TARGET_PC + if (field_0x3f9 != 0xff && + dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::Options, option_yes_no_target(field_0x3f9))) + { + yesNoSelectStart(); + field_0x3ef = SelectType7; + dMeter2Info_set2DVibrationM(); + mpWarning->_move(); + setAnimation(); + return; + } +#endif field_0x3ef = SelectType5; } mpWarning->_move(); @@ -2063,6 +2150,11 @@ void dMenu_Option_c::cursorAnime(f32 i_cursorValue) { } void dMenu_Option_c::setZButtonString(u16 i_stringID) { +#if TARGET_PC + dusk::ui::set_control_override(dusk::ui::Control::Z, + i_stringID != 0 ? dusk::ui::ControlOverride::Action : dusk::ui::ControlOverride::Default); +#endif + if (i_stringID == 0) { for (int i = 0; i < 3; i++) { if (mpZButtonText[i] != NULL) { @@ -2107,7 +2199,7 @@ void dMenu_Option_c::setAButtonString(u16 i_stringID) { if (stringId == 0) { for (int i = 0; i < 5; i++) { J2DTextBox* textBox = (J2DTextBox*)mpScreenIcon->search(text_a_tag[i]); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -2127,7 +2219,7 @@ void dMenu_Option_c::setBButtonString(u16 i_stringID) { if (stringId == 0) { for (int i = 0; i < 5; i++) { J2DTextBox* textBox = (J2DTextBox*)mpScreenIcon->search(text_b_tag[i]); - strcpy(textBox->getStringPtr(), ""); + SAFE_STRCPY(textBox->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -2142,7 +2234,87 @@ bool dMenu_Option_c::isRumbleSupported() { return JUTGamePad::sRumbleSupported >> 0x1f; } +#if TARGET_PC +bool dMenu_Option_c::pointerConfirmSelect() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Options); + for (u8 i = 0; i < SelectType3; ++i) { + if (dusk::menu_pointer::hit_pane(mpMenuPane[i], 8.0f)) { + dusk::menu_pointer::set_hover_target(i); + return false; + } + } + + dusk::menu_pointer::set_hover_target(0x200); + if (!dusk::menu_pointer::consume_click()) { + return false; + } + + field_0x3f7 = 1; + field_0x3f5 = field_0x3ef; + field_0x3ef = SelectType4; + dMeter2Info_set2DVibration(); + (this->*init[field_0x3ef])(); + return true; +} +#endif + bool dMenu_Option_c::dpdMenuMove() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Options); + for (u8 i = 0; i < SelectType3; ++i) { + if (!dusk::menu_pointer::hit_pane(mpMenuPane[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(i); + if (getSelectType() != i) { + field_0x3ef = i; + setCursorPos(i); + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_OPTION, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } + if (!dusk::menu_pointer::consume_click()) { + return true; + } + + switch (i) { + case SelectType0: + field_0x3e4 ^= 1; + field_0x3da = 5; + field_0x3ef = SelectType3; + field_0x3f5 = SelectType0; + Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + return true; + case SelectType1: + if (isRumbleSupported()) { + field_0x3ea ^= 1; + if (field_0x3ea != 0) { + mDoCPd_c::startMotorWave(0, &field_0x3e0, JUTGamePad::CRumble::VAL_0, 0x3c); + } + field_0x3da = 5; + field_0x3ef = SelectType3; + field_0x3f5 = SelectType1; + Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } + return true; + case SelectType2: + if (field_0x3e9 == 0) { + field_0x3e9 = 2; + } else { + field_0x3e9--; + } + field_0x3da = 5; + mDoAud_setOutputMode(dMo_soundMode[field_0x3e9]); + setSoundMode(dMo_soundMode[field_0x3e9]); + field_0x3ef = SelectType3; + field_0x3f5 = SelectType2; + Z2GetAudioMgr()->seStart(Z2SE_SY_OPTION_SWITCH, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + return true; + } + } +#endif return false; } diff --git a/src/d/d_menu_ring.cpp b/src/d/d_menu_ring.cpp index ba2b86b760..a50d6def3a 100644 --- a/src/d/d_menu_ring.cpp +++ b/src/d/d_menu_ring.cpp @@ -30,7 +30,11 @@ #include #if TARGET_PC +#include "dusk/frame_interpolation.h" #include "dusk/game_clock.h" +#include "dusk/menu_pointer.h" +#include "dusk/settings.h" +#include "dusk/ui/touch_controls.hpp" #endif typedef void (dMenu_Ring_c::*initFunc)(); @@ -195,6 +199,7 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i mCursorInterpPrevAngular = false; mCursorInterpCurrAngular = false; mCursorInterpInit = false; + mPointerTouchPressHoveredCurrent = false; #endif for (int i = 0; i < 4; i++) { field_0x674[i] = 0; @@ -349,11 +354,33 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i } for (i = 0; i < 5; i++) { #if VERSION == VERSION_GCN_JPN + #if TARGET_PC + J2DTextBox* fc_TextBox; + if (dusk::getSettings().game.swapDirectSelect) { + fc_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); + mpScreen->search(fc_text1[i])->hide(); + } else { + fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); + mpScreen->search(fc_text[i])->hide(); + } + #else J2DTextBox* fc_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); mpScreen->search(fc_text[i])->hide(); + #endif #else + #if TARGET_PC + J2DTextBox* fc_TextBox; + if (dusk::getSettings().game.swapDirectSelect) { + fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); + mpScreen->search(c_text1[i])->hide(); + } else { + fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); + mpScreen->search(c_text[i])->hide(); + } + #else J2DTextBox* fc_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); mpScreen->search(c_text[i])->hide(); + #endif #endif fc_TextBox->setFont(mDoExt_getMesgFont()); fc_TextBox->setString(0x40, ""); @@ -361,11 +388,33 @@ dMenu_Ring_c::dMenu_Ring_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i } for (i = 0; i < 5; i++) { #if VERSION == VERSION_GCN_JPN + #if TARGET_PC + J2DTextBox* fc1_TextBox; + if (dusk::getSettings().game.swapDirectSelect) { + fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text[i]); + mpScreen->search(fc_text[i])->hide(); + } else { + fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); + mpScreen->search(fc_text1[i])->hide(); + } + #else J2DTextBox* fc1_TextBox = (J2DTextBox*)mpScreen->search(c_text1[i]); mpScreen->search(fc_text1[i])->hide(); + #endif #else + #if TARGET_PC + J2DTextBox* fc1_TextBox; + if (dusk::getSettings().game.swapDirectSelect) { + fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text[i]); + mpScreen->search(c_text[i])->hide(); + } else { + fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); + mpScreen->search(c_text1[i])->hide(); + } + #else J2DTextBox* fc1_TextBox = (J2DTextBox*)mpScreen->search(fc_text1[i]); mpScreen->search(c_text1[i])->hide(); + #endif #endif fc1_TextBox->setFont(mDoExt_getMesgFont()); fc1_TextBox->setString(0x40, ""); @@ -569,6 +618,9 @@ void dMenu_Ring_c::_delete() { * initializes a new process if mStatus changes */ void dMenu_Ring_c::_move() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::ItemWheel); +#endif mRingRadiusH = g_ringHIO.mRingRadiusH; mRingRadiusV = g_ringHIO.mRingRadiusV; mOldStatus = mStatus; // Save current status for check @@ -852,7 +904,12 @@ u8 dMenu_Ring_c::getStickInfo(STControl* i_stick) { } if (mCurrentSlot != val2) { + #ifdef TARGET_PC + if ((mDoCPd_c::getHoldL(PAD_1) && !dusk::getSettings().game.swapDirectSelect) || + (!mDoCPd_c::getHoldL(PAD_1) && dusk::getSettings().game.swapDirectSelect)) { + #else if (mDoCPd_c::getHoldL(PAD_1)) { + #endif mDirectSelectCursorPos.x = mItemSlotPosX[mCurrentSlot]; mDirectSelectCursorPos.z = mItemSlotPosY[mCurrentSlot]; mCurrentSlot = val2; @@ -1203,7 +1260,7 @@ void dMenu_Ring_c::setNameString(u32 i_stringID) { if (mNameStringID != i_stringID) { for (int i = 0; i < 4; i++) { if (i_stringID == 0) { - strcpy(textBox[i]->getStringPtr(), ""); + SAFE_STRCPY(textBox[i]->getStringPtr(), ""); } else { mpString->getString(i_stringID, textBox[i], NULL, NULL, NULL, 0); } @@ -1433,7 +1490,12 @@ void dMenu_Ring_c::drawItem2() { } void dMenu_Ring_c::stick_wait_init() { + #ifdef TARGET_PC + if ((mDoCPd_c::getHoldL(PAD_1) && !dusk::getSettings().game.swapDirectSelect) || + (!mDoCPd_c::getHoldL(PAD_1) && dusk::getSettings().game.swapDirectSelect)) { + #else if (mDoCPd_c::getHoldL(PAD_1) != 0) { + #endif if (mDirectSelectActive) { mWaitFrames = g_ringHIO.mDirectSelectWaitFrames; } else { @@ -1462,6 +1524,11 @@ void dMenu_Ring_c::stick_wait_proc() { setDoStatus(0); return; } +#if TARGET_PC + if (pointerMove()) { + return; + } +#endif if (dMw_A_TRIGGER() && !dMeter2Info_isTouchKeyCheck(0xe)) { Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } @@ -1473,6 +1540,70 @@ void dMenu_Ring_c::stick_wait_proc() { } } +#if TARGET_PC +bool dMenu_Ring_c::pointerMove() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::ItemWheel); + const auto& pointer = dusk::menu_pointer::state(); + if (!pointer.valid || mItemsTotal == 0) { + return false; + } + + int hoveredSlot = -1; + f32 bestDistance = 42.0f; + for (u8 i = 0; i < mItemsTotal; ++i) { + const f32 x = mItemSlotPosX[i] + mCenterPosX; + const f32 y = mItemSlotPosY[i] + mCenterPosY; + const f32 distance = calcDistance(pointer.x, pointer.y, x, y); + if (distance < bestDistance) { + bestDistance = distance; + hoveredSlot = i; + } + } + + if (hoveredSlot < 0) { + return false; + } + if (pointer.pressed) { + mPointerTouchPressHoveredCurrent = pointer.touch && hoveredSlot == mCurrentSlot; + } + dusk::menu_pointer::set_hover_target(static_cast(hoveredSlot)); + + if (mCurrentSlot != hoveredSlot) { + mDirectSelectCursorPos.x = mItemSlotPosX[mCurrentSlot]; + mDirectSelectCursorPos.z = mItemSlotPosY[mCurrentSlot]; + mCurrentSlot = hoveredSlot; + mDirectSelectActive = true; + field_0x670 = field_0x63e[mCurrentSlot]; + setStatus(STATUS_MOVE); + field_0x6b2 = 0; + return true; + } + + const bool clickOpensExplain = !pointer.touch || mPointerTouchPressHoveredCurrent; + if (clickOpensExplain && dusk::menu_pointer::consume_click()) { + const u8 item = dComIfGs_getItem(mItemSlots[mCurrentSlot], false); + if (!dMeter2Info_isTouchKeyCheck(0xe) && openExplain(item)) { + dMeter2Info_setItemExplainWindowStatus(1); + field_0x6c4 = mCurrentSlot; + setStatus(STATUS_EXPLAIN); + dMeter2Info_set2DVibration(); + setDoStatus(0); + } else { + Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } + mPointerTouchPressHoveredCurrent = false; + return true; + } + + if (pointer.released) { + mPointerTouchPressHoveredCurrent = false; + } + + return false; +} +#endif + void dMenu_Ring_c::stick_move_init() { if (mCursorSpeed == 0) { mCursorSpeed = g_ringHIO.mCursorInitSpeed; @@ -1617,12 +1748,40 @@ void dMenu_Ring_c::drawSelectItem() { #else if (field_0x674[i] < 10) { #endif +#if TARGET_PC + f32 initSizeX; + f32 initSizeY; + f32 initScaleX; + f32 initScaleY; + Vec pos; + dusk::ui::EquipTarget touchTarget; + if (dusk::ui::get_equip_target(i, touchTarget)) { + initSizeX = touchTarget.width; + initSizeY = touchTarget.height; + initScaleX = 1.0f; + initScaleY = 1.0f; + pos.x = touchTarget.left; + pos.y = touchTarget.top; + pos.z = 0.0f; + } else { + CPaneMgr* meterItemPane = dMeter2Info_getMeterItemPanePtr(i); + if (meterItemPane == NULL) { + continue; + } + initSizeX = meterItemPane->getInitSizeX() * 1.7f; + initSizeY = meterItemPane->getInitSizeY() * 1.7f; + initScaleX = meterItemPane->getInitScaleX(); + initScaleY = meterItemPane->getInitScaleY(); + pos = meterItemPane->getGlobalVtxCenter(meterItemPane->mPane, true, 0); + } +#else f32 initSizeX = dMeter2Info_getMeterItemPanePtr(i)->getInitSizeX() * 1.7f; f32 initSizeY = dMeter2Info_getMeterItemPanePtr(i)->getInitSizeY() * 1.7f; f32 initScaleX = dMeter2Info_getMeterItemPanePtr(i)->getInitScaleX(); f32 initScaleY = dMeter2Info_getMeterItemPanePtr(i)->getInitScaleY(); Vec pos = dMeter2Info_getMeterItemPanePtr(i)->getGlobalVtxCenter( dMeter2Info_getMeterItemPanePtr(i)->mPane, true, 0); +#endif #if TARGET_PC f32 fVar14 = 0.1f + 0.8f * u; diff --git a/src/d/d_menu_save.cpp b/src/d/d_menu_save.cpp index 53dbe37ca4..78ebd3e064 100644 --- a/src/d/d_menu_save.cpp +++ b/src/d/d_menu_save.cpp @@ -18,11 +18,15 @@ #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" #include "d/d_msg_scrn_explain.h" -#include "dusk/frame_interpolation.h" -#include "dusk/settings.h" #include "JSystem/J2DGraph/J2DAnmLoader.h" #include "f_op/f_op_msg_mng.h" +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#include "dusk/menu_pointer.h" +#include "dusk/settings.h" +#endif + static int SelStartFrameTbl[3] = { 59, 99, @@ -54,6 +58,17 @@ static int YnSelStartFrameTbl[2][2] = { static int YnSelEndFrameTbl[2][2] = {{2138, 3171}, {2150, 3181}}; +#if TARGET_PC +namespace { +constexpr u8 pointer_target(u8 group, u8 index) noexcept { + return static_cast((group << 4) | (index & 0x0F)); +} + +constexpr u8 s_pointerSaveSelectTarget = 0; +constexpr u8 s_pointerYesNoSelectTarget = 1; +} // namespace +#endif + static dMs_HIO_c g_msHIO; dMs_HIO_c::dMs_HIO_c() { @@ -641,7 +656,7 @@ void dMenu_save_c::_delete() { } typedef void (dMenu_save_c::*menuProcFunc)(); -menuProcFunc MenuSaveProc[62] = { +DUSK_GAME_DATA menuProcFunc MenuSaveProc[62] = { &dMenu_save_c::saveQuestion, &dMenu_save_c::saveQuestion2, &dMenu_save_c::saveQuestion21, @@ -816,8 +831,8 @@ void dMenu_save_c::saveQuestion() { field_0x9c = 0; field_0x17a = 0; - strcpy(mpHeaderTxt[mHeaderTxtType], ""); - strcpy(mpHeaderTxt[mHeaderTxtType ^ 1], ""); + SAFE_STRCPY(mpHeaderTxt[mHeaderTxtType], ""); + SAFE_STRCPY(mpHeaderTxt[mHeaderTxtType ^ 1], ""); field_0x64 = 0; field_0x50 = 1; field_0x40->setFrame(field_0x50); @@ -1766,6 +1781,12 @@ void dMenu_save_c::openSaveSelect3() { void dMenu_save_c::saveSelect() { if (!mDoRst::isReset()) { +#if TARGET_PC + if (pointerSaveSelect()) { + return; + } +#endif + stick->checkTrigger(); if (mDoCPd_c::getTrigA(PAD_1)) { @@ -1792,7 +1813,86 @@ void dMenu_save_c::saveSelect() { } } +#if TARGET_PC +bool dMenu_save_c::pointerSaveSelect() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Save); + for (u8 i = 0; i < 3; ++i) { + if (!dusk::menu_pointer::hit_pane(mpSelData[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerSaveSelectTarget, i)); + const bool clicked = dusk::menu_pointer::consume_click(); + if (mSelectedFile != i) { + mDoAud_seStart(Z2SE_FILE_SELECT_CURSOR, NULL, 0, 0); + mLastSelFile = mSelectedFile; + mSelectedFile = i; + if (clicked) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::Save, + pointer_target(s_pointerSaveSelectTarget, i)); + } + dataSelectAnmSet(); + mMenuProc = PROC_SAVE_SELECT_MOVE_ANM; + return true; + } + if (clicked) { + saveSelectStart(); + return true; + } + } + return false; +} + +bool dMenu_save_c::pointerYesNoSelect(bool errorSelect, u8 errParam, u8 soundParam) { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Save); + for (u8 i = 0; i < 2; ++i) { + if (!dusk::menu_pointer::hit_pane(mpNoYes[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerYesNoSelectTarget, i)); + const bool clicked = + (!errorSelect || mYesNoCursor == i) && dusk::menu_pointer::consume_click(); + if (mYesNoCursor != i) { + if (errorSelect) { + errCurMove(errParam, soundParam); + return false; + } + mDoAud_seStart(Z2SE_SY_MENU_CURSOR_COMMON, NULL, 0, 0); + mYesNoPrevCursor = mYesNoCursor; + mYesNoCursor = i; + if (clicked) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::Save, + pointer_target(s_pointerYesNoSelectTarget, i)); + } + yesnoSelectAnmSet(0); + mMenuProc = PROC_YES_NO_CURSOR_MOVE_ANM; + return true; + } + if (clicked) { + if (errorSelect) { + if (mYesNoCursor != CURSOR_NO) { + if (soundParam == 0) { + mDoAud_seStart(Z2SE_SY_CURSOR_OK, NULL, 0, 0); + } + } else if (soundParam == 0) { + mDoAud_seStart(Z2SE_SY_CURSOR_CANCEL, NULL, 0, 0); + } + mSelIcon->setAlphaRate(0.0f); + } else { + yesnoSelectStart(); + } + return true; + } + } + return false; +} +#endif + void dMenu_save_c::saveSelectStart() { +#if TARGET_PC + dusk::menu_pointer::clear_deferred_activation(dusk::menu_pointer::Context::Save); +#endif mDoAud_seStart(Z2SE_SY_CURSOR_OK, NULL, 0, 0); selectDataMoveAnmInitSet(SelOpenStartFrameTbl[mSelectedFile], SelOpenEndFrameTbl[mSelectedFile]); @@ -1851,6 +1951,19 @@ void dMenu_save_c::dataSelectAnmSet() { } void dMenu_save_c::saveSelectMoveAnime() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Save); + if (mSelectedFile != 0xFF && + dusk::menu_pointer::hit_pane(mpSelData[mSelectedFile], 8.0f)) + { + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerSaveSelectTarget, mSelectedFile)); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::Save, + pointer_target(s_pointerSaveSelectTarget, mSelectedFile)); + } + } +#endif bool bookWakuAnmComplete = true; bool selWakuAnmComplete = true; bool var_r29 = true; @@ -1900,12 +2013,26 @@ void dMenu_save_c::saveSelectMoveAnime() { if (mLastSelFile != 0xFF) { mpSelData[mLastSelFile]->getPanePtr()->setAnimation((J2DAnmTransformKey*)NULL); } +#if TARGET_PC + if (dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::Save, + pointer_target(s_pointerSaveSelectTarget, mSelectedFile))) { + saveSelectStart(); + return; + } +#endif mMenuProc = PROC_SAVE_SELECT; } } void dMenu_save_c::saveYesNoSelect() { if (!mDoRst::isReset()) { +#if TARGET_PC + if (pointerYesNoSelect(false)) { + return; + } +#endif + stick->checkTrigger(); if (mDoCPd_c::getTrigA(PAD_1)) { @@ -1933,6 +2060,9 @@ void dMenu_save_c::saveYesNoSelect() { } void dMenu_save_c::yesnoSelectStart() { +#if TARGET_PC + dusk::menu_pointer::clear_deferred_activation(dusk::menu_pointer::Context::Save); +#endif if (mYesNoCursor != CURSOR_NO) { mDoAud_seStart(Z2SE_SY_CURSOR_OK, NULL, 0, 0); mSelIcon->setAlphaRate(0.0f); @@ -2001,11 +2131,32 @@ void dMenu_save_c::yesnoSelectAnmSet(u8 param_0) { } void dMenu_save_c::yesNoCursorMoveAnm() { +#if TARGET_PC + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Save); + if (mYesNoCursor != 0xFF && + dusk::menu_pointer::hit_pane(mpNoYes[mYesNoCursor], 8.0f)) + { + dusk::menu_pointer::set_hover_target(pointer_target(s_pointerYesNoSelectTarget, mYesNoCursor)); + if (dusk::menu_pointer::consume_click()) { + dusk::menu_pointer::defer_activation( + dusk::menu_pointer::Context::Save, + pointer_target(s_pointerYesNoSelectTarget, mYesNoCursor)); + } + } +#endif bool selAnmComplete = yesnoSelectMoveAnm(0); bool wakuAnmComplete = yesnoWakuAlpahAnm(mYesNoPrevCursor); if (selAnmComplete == true && wakuAnmComplete == true) { yesnoCursorShow(); +#if TARGET_PC + if (dusk::menu_pointer::consume_deferred_activation( + dusk::menu_pointer::Context::Save, + pointer_target(s_pointerYesNoSelectTarget, mYesNoCursor))) { + yesnoSelectStart(); + return; + } +#endif mMenuProc = PROC_SAVE_YES_NO_SELECT; } } @@ -2033,7 +2184,7 @@ void dMenu_save_c::saveYesNoCancelMove() { void dMenu_save_c::headerTxtSet(u16 msgID) { if (msgID == 0xFFFF) { - strcpy(mpHeaderTxt[mHeaderTxtType ^ 1], ""); + SAFE_STRCPY(mpHeaderTxt[mHeaderTxtType ^ 1], ""); } else { mSaveSel.mMsgString->getString( msgID, (J2DTextBox*)mpHeaderTxtPane[mHeaderTxtType ^ 1]->getPanePtr(), NULL, @@ -2181,6 +2332,12 @@ bool dMenu_save_c::errYesNoSelect(u8 param_0, u8 param_1) { return false; } +#if TARGET_PC + if (pointerYesNoSelect(true, param_0, param_1)) { + return true; + } +#endif + stick->checkTrigger(); if (mDoCPd_c::getTrigA(PAD_1)) { @@ -2230,7 +2387,7 @@ void dMenu_save_c::errYesNoCursorMoveAnm() { void dMenu_save_c::errorTxtSet(u16 msgID) { if (msgID == 0xFFFF) { - strcpy(mpErrTxt[mErrTxtType ^ 1], ""); + SAFE_STRCPY(mpErrTxt[mErrTxtType ^ 1], ""); } else { J2DTextBox* tbox = (J2DTextBox*)mpErrTxtPane[mErrTxtType ^ 1]->getPanePtr(); mSaveSel.mMsgString->getString(msgID, tbox, NULL, mSaveSel.font[0], NULL, 0); @@ -2817,7 +2974,7 @@ void dMenu_save_c::menuSaveWide() { #if TARGET_PC if (mSelIcon) { - mSelIcon->refreshAspectScale(); + mSelIcon->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); } #endif } diff --git a/src/d/d_menu_skill.cpp b/src/d/d_menu_skill.cpp index 78ab82af94..0c970e76c3 100644 --- a/src/d/d_menu_skill.cpp +++ b/src/d/d_menu_skill.cpp @@ -18,6 +18,10 @@ #include "m_Do/m_Do_graphic.h" #include +#if TARGET_PC +#include "dusk/menu_pointer.h" +#endif + typedef void (dMenu_Skill_c::*initFunc)(); static initFunc map_init_process[] = { &dMenu_Skill_c::wait_init, @@ -275,6 +279,12 @@ void dMenu_Skill_c::wait_init() { void dMenu_Skill_c::wait_move() { u8 oldIndex = mIndex; if (mDoGph_gInf_c::getFader()->getStatus() == 1) { +#if TARGET_PC + if (pointerWait()) { + return; + } +#endif + if (mDoCPd_c::getTrigB(PAD_1) != 0) { mpDrawCursor->offPlayAnime(0); mStatus = 3; @@ -299,6 +309,35 @@ void dMenu_Skill_c::wait_move() { } } +#if TARGET_PC +bool dMenu_Skill_c::pointerWait() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Collection); + for (u8 i = 0; i < mSkillNum; ++i) { + if (!dusk::menu_pointer::hit_pane(mpLetterParent[i], 8.0f)) { + continue; + } + dusk::menu_pointer::set_hover_target(i); + + if (mIndex != i) { + mIndex = i; + changeActiveColor(); + Z2GetAudioMgr()->seStart(Z2SE_SY_CURSOR_ITEM, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } + if (dusk::menu_pointer::consume_click()) { + mProcess = PROC_WAIT_MOVE; + Z2GetAudioMgr()->seStart(Z2SE_SY_EXP_WIN_OPEN, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibration(); + return true; + } + return false; + } + + return false; +} +#endif + void dMenu_Skill_c::read_open_init() { static const u32 i_id[7] = { 1716, 1715, 1717, 1718, 1719, 1720, 1721, @@ -610,7 +649,7 @@ void dMenu_Skill_c::setPageText() { void dMenu_Skill_c::setAButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpAButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpAButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -622,7 +661,7 @@ void dMenu_Skill_c::setAButtonString(u16 i_stringID) { void dMenu_Skill_c::setBButtonString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 5; i++) { - strcpy(mpBButtonString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpBButtonString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 5; i++) { @@ -634,7 +673,7 @@ void dMenu_Skill_c::setBButtonString(u16 i_stringID) { void dMenu_Skill_c::setNameString(u16 i_stringID) { if (i_stringID == 0) { for (int i = 0; i < 4; i++) { - strcpy(mpNameString[i]->getStringPtr(), ""); + SAFE_STRCPY(mpNameString[i]->getStringPtr(), ""); } } else { for (int i = 0; i < 4; i++) { diff --git a/src/d/d_menu_window.cpp b/src/d/d_menu_window.cpp index e2e7b4e91f..7873632265 100644 --- a/src/d/d_menu_window.cpp +++ b/src/d/d_menu_window.cpp @@ -219,7 +219,7 @@ static BOOL dMw_isMenuRing() { } typedef void (dMw_c::*initFunc)(u8); -initFunc init_proc[] = { +DUSK_GAME_DATA initFunc init_proc[] = { &dMw_c::key_wait_init, &dMw_c::ring_open_init, &dMw_c::ring_move_init, @@ -258,7 +258,7 @@ initFunc init_proc[] = { }; typedef void (dMw_c::*procFunc)(); -procFunc move_proc[] = { +DUSK_GAME_DATA procFunc move_proc[] = { &dMw_c::key_wait_proc, &dMw_c::ring_open_proc, &dMw_c::ring_move_proc, @@ -1771,7 +1771,7 @@ static leafdraw_method_class l_dMw_Method = { (process_method_func)dMw_Draw, }; -msg_process_profile_definition g_profile_MENUWINDOW = { +DUSK_PROFILE msg_process_profile_definition DUSK_CONST g_profile_MENUWINDOW = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_menu_window_HIO.cpp b/src/d/d_menu_window_HIO.cpp index 053aeaf837..6302b7b897 100644 --- a/src/d/d_menu_window_HIO.cpp +++ b/src/d/d_menu_window_HIO.cpp @@ -1321,6 +1321,6 @@ void dMw_DHIO_c::bitCheck() { } #endif -dMw_HIO_c g_mwHIO; +DUSK_GAME_DATA dMw_HIO_c g_mwHIO; -dMw_DHIO_c g_mwDHIO; +DUSK_GAME_DATA dMw_DHIO_c g_mwDHIO; diff --git a/src/d/d_meter2.cpp b/src/d/d_meter2.cpp index 097cde7c37..8d396e0185 100644 --- a/src/d/d_meter2.cpp +++ b/src/d/d_meter2.cpp @@ -27,6 +27,15 @@ #if TARGET_PC #include "dusk/memory.h" #include "dusk/settings.h" + +namespace { + +// Reads the user HUD scale setting, clamped to a safe range. +f32 dGetUserHudScale() { + return std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f); +} + +} // namespace #endif int dMeter2_c::_create() { @@ -437,7 +446,12 @@ void dMeter2_c::checkStatus() { field_0x128 = daPy_py_c::checkNowWolf(); +#if TARGET_PC + dMsgObject_c* msgObject = dMsgObject_getMsgObjectClass(); + if (!dComIfGp_2dShowCheck() || (msgObject != NULL && msgObject->isPlaceMessage())) { +#else if (!dComIfGp_2dShowCheck() || dMsgObject_getMsgObjectClass()->isPlaceMessage()) { +#endif mStatus |= 0x4000; } else if (dComIfGp_checkPlayerStatus1(0, 1) && dComIfGp_getAStatus() == 0x12) { mStatus |= 0x200000; @@ -663,8 +677,13 @@ void dMeter2_c::moveLife() { draw_life = true; } - if (mLifeGaugeScale != g_drawHIO.mLifeParentScale) { - mLifeGaugeScale = g_drawHIO.mLifeParentScale; +#if TARGET_PC + const f32 lifeGaugeScale = g_drawHIO.mLifeParentScale * dGetUserHudScale(); +#else + const f32 lifeGaugeScale = g_drawHIO.mLifeParentScale; +#endif + if (mLifeGaugeScale != lifeGaugeScale) { + mLifeGaugeScale = lifeGaugeScale; draw_life = true; } @@ -1096,8 +1115,13 @@ void dMeter2_c::moveRupee() { } } - if (mRupeeKeyScale != g_drawHIO.mRupeeKeyScale) { - mRupeeKeyScale = g_drawHIO.mRupeeKeyScale; +#if TARGET_PC + const f32 rupeeKeyScale = g_drawHIO.mRupeeKeyScale * dGetUserHudScale(); +#else + const f32 rupeeKeyScale = g_drawHIO.mRupeeKeyScale; +#endif + if (mRupeeKeyScale != rupeeKeyScale) { + mRupeeKeyScale = rupeeKeyScale; draw_rupee = true; } @@ -1195,8 +1219,13 @@ void dMeter2_c::moveKey() { } } - if (mKeyScale != g_drawHIO.mKeyScale) { - mKeyScale = g_drawHIO.mKeyScale; +#if TARGET_PC + const f32 keyScale = g_drawHIO.mKeyScale * dGetUserHudScale(); +#else + const f32 keyScale = g_drawHIO.mKeyScale; +#endif + if (mKeyScale != keyScale) { + mKeyScale = keyScale; draw_key = true; } @@ -2127,8 +2156,13 @@ void dMeter2_c::moveButtonCross() { draw_cross = true; } - if (mButtonCrossScale != g_drawHIO.mButtonCrossScale) { - mButtonCrossScale = g_drawHIO.mButtonCrossScale; +#if TARGET_PC + const f32 buttonCrossScale = g_drawHIO.mButtonCrossScale * dGetUserHudScale(); +#else + const f32 buttonCrossScale = g_drawHIO.mButtonCrossScale; +#endif + if (mButtonCrossScale != buttonCrossScale) { + mButtonCrossScale = buttonCrossScale; draw_cross = true; } @@ -2863,8 +2897,14 @@ void dMeter2_c::alphaAnimeButton() { u8 var_31; var_31 = 0; +#if TARGET_PC + dMsgObject_c* msgObject = dMsgObject_getMsgObjectClass(); + if ((mStatus & 0x4000) || + ((mStatus & 0x100) && (msgObject != NULL && msgObject->isAutoMessageFlag())) || +#else if ((mStatus & 0x4000) || ((mStatus & 0x100) && dMsgObject_getMsgObjectClass()->isAutoMessageFlag()) || +#endif ((mStatus & 0x40000000) && !(mStatus & 0x100)) || (mStatus & 0x80000000) || (mStatus & 8) || (mStatus & 0x10) || (mStatus & 0x20) || (mStatus & 0x04000000) || (mStatus & 0x10000000)) { @@ -2966,7 +3006,15 @@ void dMeter2_c::alphaAnimeButtonCross() { field_0x190++; } } else { +#if TARGET_PC + if (dusk::getSettings().game.enableTouchControls) { + mpMeterDraw->setAlphaButtonCrossAnimeMin(); + } else { + mpMeterDraw->setAlphaButtonCrossAnimeMax(); + } +#else mpMeterDraw->setAlphaButtonCrossAnimeMax(); +#endif if (field_0x190 < 5) { field_0x190++; @@ -3100,7 +3148,7 @@ static leafdraw_method_class l_dMeter2_Method = { (process_method_func)dMeter2_Draw, }; -msg_process_profile_definition g_profile_METER2 = { +DUSK_PROFILE msg_process_profile_definition DUSK_CONST g_profile_METER2 = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_meter2_draw.cpp b/src/d/d_meter2_draw.cpp index 8e824f583b..7ce7bb29d4 100644 --- a/src/d/d_meter2_draw.cpp +++ b/src/d/d_meter2_draw.cpp @@ -23,6 +23,41 @@ #include "dusk/frame_interpolation.h" #include +#if TARGET_PC +#include "dusk/settings.h" +#include "dusk/ui/icon_provider.hpp" +#include + +namespace { + +// Reads the user HUD scale setting, clamped to a safe range. +f32 dGetUserHudScale() { + return std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f); +} + +// The screen corner each HUD group is anchored to. A pane scales around its own origin, +// so without correction it drifts away from the screen edge; this names the corner that +// must stay put. +enum class HudCorner { TopLeft, TopRight, BottomLeft, BottomRight }; + +// Adds the paneTrans offset that keeps i_corner pinned in place while the user HUD scale +// grows or shrinks the pane. The shift is half the change in size pushed toward the +// anchor corner, so it depends only on the pane's size (not its on-screen position) and +// works whether the HUD is scaled down or up. i_pull < 1 applies a partial horizontal +// push for a pane whose content sits inset from its box edge (the heart row). +void dAnchorHudScale(CPaneMgr* i_pane, HudCorner i_corner, f32* io_x, f32* io_y, f32 i_pull = 1.0f) { + const f32 half = (1.0f - dGetUserHudScale()) * 0.5f; + const f32 dirX = + (i_corner == HudCorner::TopRight || i_corner == HudCorner::BottomRight) ? 1.0f : -1.0f; + const f32 dirY = + (i_corner == HudCorner::BottomLeft || i_corner == HudCorner::BottomRight) ? 1.0f : -1.0f; + *io_x += dirX * i_pane->getInitSizeX() * half * i_pull; + *io_y += dirY * i_pane->getInitSizeY() * half; +} + +} // namespace +#endif + dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) { OS_REPORT("enter dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap *mp_heap)\n"); @@ -536,6 +571,12 @@ void dMeter2Draw_c::init() { } void dMeter2Draw_c::exec(u32 i_status) { +#if TARGET_PC + // n_all keeps the vanilla scale. Scaling the root pane shrinks every child toward + // its centred origin; per-child scaling in each drawXxx() path keeps each HUD group + // anchored to its own pane origin and also pulls it toward the screen corner. + const f32 userHudScale = dGetUserHudScale(); +#endif if (mParentScale != g_drawHIO.mParentScale) { mParentScale = g_drawHIO.mParentScale; mpParent->scale(g_drawHIO.mParentScale, g_drawHIO.mParentScale); @@ -546,6 +587,39 @@ void dMeter2Draw_c::exec(u32 i_status) { mpParent->setAlphaRate(g_drawHIO.mParentAlpha); } +#if TARGET_PC + if (i_status & 0x1000000) { + f32 ringPosX = g_drawHIO.mRingHUDButtonsPosX; + f32 ringPosY = g_drawHIO.mRingHUDButtonsPosY; + dAnchorHudScale(mpButtonParent, HudCorner::TopRight, &ringPosX, &ringPosY); + if (mButtonsPosX != ringPosX || mButtonsPosY != ringPosY) { + mButtonsPosX = ringPosX; + mButtonsPosY = ringPosY; + mpButtonParent->paneTrans(ringPosX, ringPosY); + } + + const f32 ringButtonsScale = g_drawHIO.mRingHUDButtonsScale * userHudScale; + if (mButtonsScale != ringButtonsScale) { + mButtonsScale = ringButtonsScale; + mpButtonParent->scale(ringButtonsScale, ringButtonsScale); + } + } else { + f32 mainPosX = g_drawHIO.mMainHUDButtonsPosX; + f32 mainPosY = g_drawHIO.mMainHUDButtonsPosY; + dAnchorHudScale(mpButtonParent, HudCorner::TopRight, &mainPosX, &mainPosY); + if (mButtonsPosX != mainPosX || mButtonsPosY != mainPosY) { + mButtonsPosX = mainPosX; + mButtonsPosY = mainPosY; + mpButtonParent->paneTrans(mainPosX, mainPosY); + } + + const f32 mainButtonsScale = g_drawHIO.mMainHUDButtonsScale * userHudScale; + if (mButtonsScale != mainButtonsScale) { + mButtonsScale = mainButtonsScale; + mpButtonParent->scale(mainButtonsScale, mainButtonsScale); + } + } +#else if (i_status & 0x1000000) { if (mButtonsPosX != g_drawHIO.mRingHUDButtonsPosX || mButtonsPosY != g_drawHIO.mRingHUDButtonsPosY) @@ -574,20 +648,36 @@ void dMeter2Draw_c::exec(u32 i_status) { mpButtonParent->scale(g_drawHIO.mMainHUDButtonsScale, g_drawHIO.mMainHUDButtonsScale); } } +#endif } void dMeter2Draw_c::draw() { J2DGrafContext* graf_ctx = dComIfGp_getCurrentGrafPort(); graf_ctx->setup2D(); +#if TARGET_PC + const bool touchControlsEnabled = dusk::getSettings().game.enableTouchControls; + if (touchControlsEnabled) { + mpButtonParent->hide(); + } else { + mpButtonParent->show(); + } +#endif + mpScreen->draw(0.0f, 0.0f, graf_ctx); drawKanteraScreen(1); drawKanteraScreen(2); +#if TARGET_PC + if (!touchControlsEnabled) { +#endif for (int i = 0; i < 2; i++) { if (mpItemXY[i] != NULL) { for (int j = 0; j < 3; j++) { f32 temp_f30 = mItemParams[i].num_scale * 16.0f; +#if TARGET_PC + temp_f30 *= dGetUserHudScale(); +#endif Vec vtx0 = mpItemXY[i]->getPanePtr()->getGlbVtx(0); Vec vtx3 = mpItemXY[i]->getPanePtr()->getGlbVtx(3); @@ -629,6 +719,9 @@ void dMeter2Draw_c::draw() { } } } +#if TARGET_PC + } +#endif if (mpLightDropParent->getAlphaRate() != 0.0f) { f32 var_f28 = g_drawHIO.mLightDrop.mPikariScaleNormal; @@ -711,7 +804,11 @@ void dMeter2Draw_c::draw() { } } +#if TARGET_PC + if (!touchControlsEnabled && field_0x738 > 0.0f) { +#else if (field_0x738 > 0.0f) { +#endif drawPikari(mpButtonMidona, &field_0x738, g_drawHIO.mMidnaIconPikariScale, g_drawHIO.mMidnaIconPikariFrontOuter, g_drawHIO.mMidnaIconPikariFrontInner, g_drawHIO.mMidnaIconPikariBackOuter, g_drawHIO.mMidnaIconPikariBackInner, @@ -1478,7 +1575,12 @@ void dMeter2Draw_c::drawLife(s16 i_maxLife, s16 i_life, f32 i_posX, f32 i_posY) } } +#if TARGET_PC + const f32 lifeParentScale = g_drawHIO.mLifeParentScale * dGetUserHudScale(); + mpLifeParent->scale(lifeParentScale, lifeParentScale); +#else mpLifeParent->scale(g_drawHIO.mLifeParentScale, g_drawHIO.mLifeParentScale); +#endif for (int i = 0; i < 20; i++) { mpHeartMark[i]->scale(g_drawHIO.mHeartMarkScale, g_drawHIO.mHeartMarkScale); @@ -1488,7 +1590,16 @@ void dMeter2Draw_c::drawLife(s16 i_maxLife, s16 i_life, f32 i_posX, f32 i_posY) mpBigHeart->scale(g_drawHIO.mBigHeartScale, g_drawHIO.mBigHeartScale); } +#if TARGET_PC + f32 lifePosX = i_posX; + f32 lifePosY = i_posY; + // The heart row sits inset from its box's left edge, so use a partial horizontal pull + // to keep it from jamming against the screen edge. + dAnchorHudScale(mpLifeParent, HudCorner::TopLeft, &lifePosX, &lifePosY, 0.6f); + mpLifeParent->paneTrans(lifePosX, lifePosY); +#else mpLifeParent->paneTrans(i_posX, i_posY); +#endif } void dMeter2Draw_c::setAlphaLifeChange(bool param_0) { @@ -1601,9 +1712,22 @@ void dMeter2Draw_c::drawKanteraScreen(u8 i_meterType) { mpMagicMeter->resize(field_0x584[i_meterType], field_0x590[i_meterType]); mpMagicFrameR->move(field_0x59c[i_meterType], field_0x5a8[i_meterType]); mpMagicBase->resize(field_0x5b4[i_meterType], field_0x5c0[i_meterType]); +#if TARGET_PC + const f32 magicUserScale = dGetUserHudScale(); + mpMagicParent->scale(field_0x5cc[i_meterType] * magicUserScale, + field_0x5d8[i_meterType] * magicUserScale); + + f32 magicPosX = field_0x5e4[i_meterType]; + f32 magicPosY = field_0x5f0[i_meterType]; + // The oil/magic bar sits inset within its pane box, so use a reduced horizontal pull + // (like the heart row) to keep it from overshooting off the left edge when shrunk. + dAnchorHudScale(mpMagicParent, HudCorner::TopLeft, &magicPosX, &magicPosY, 0.3f); + mpMagicParent->paneTrans(magicPosX, magicPosY); +#else mpMagicParent->scale(field_0x5cc[i_meterType], field_0x5d8[i_meterType]); mpMagicParent->paneTrans(field_0x5e4[i_meterType], field_0x5f0[i_meterType]); +#endif mpKanteraScreen->draw(0.0f, 0.0f, graf_ctx); } @@ -1867,10 +1991,21 @@ void dMeter2Draw_c::drawLightDrop(u8 i_num, u8 i_needNum, f32 i_posX, f32 i_posY field_0x6fc = param_5; mLightDropVesselScale = i_vesselScale; +#if TARGET_PC + const f32 lightDropUserScale = dGetUserHudScale(); + const f32 lightDropScale = mLightDropVesselScale * field_0x6f8 * lightDropUserScale; + mpLightDropParent->scale(lightDropScale, lightDropScale); + + f32 lightDropPosX = i_posX; + f32 lightDropPosY = i_posY; + dAnchorHudScale(mpLightDropParent, HudCorner::TopRight, &lightDropPosX, &lightDropPosY); + mpLightDropParent->paneTrans(lightDropPosX, lightDropPosY); +#else mpLightDropParent->scale(mLightDropVesselScale * field_0x6f8, mLightDropVesselScale * field_0x6f8); mpLightDropParent->paneTrans(i_posX, i_posY); +#endif } void dMeter2Draw_c::setAlphaLightDropChange(bool unused) {} @@ -1943,8 +2078,13 @@ void dMeter2Draw_c::setAlphaLightDropAnimeMax() { field_0x6f8 = 1.0f; } +#if TARGET_PC + const f32 dropAnimScale = mLightDropVesselScale * field_0x6f8 * dGetUserHudScale(); + mpLightDropParent->scale(dropAnimScale, dropAnimScale); +#else mpLightDropParent->scale(mLightDropVesselScale * field_0x6f8, mLightDropVesselScale * field_0x6f8); +#endif if (g_drawHIO.mLightDrop.mDropGetScaleAnimFrameNum == mpLightDropParent->getAlphaTimer()) { dMeter2Info_setLightDropGetFlag(dComIfGp_getStartStageDarkArea(), 0xFF); @@ -2015,10 +2155,22 @@ void dMeter2Draw_c::drawRupee(s16 i_rupeeNum) { static_cast(mpRupeeTexture[0][0]->getPanePtr())->changeTexture(timg, 0); static_cast(mpRupeeTexture[0][1]->getPanePtr())->changeTexture(timg, 0); +#if TARGET_PC + const f32 rupeeKeyUserScale = dGetUserHudScale(); + const f32 rupeeKeyScale = g_drawHIO.mRupeeKeyScale * field_0x718 * rupeeKeyUserScale; + mpRupeeKeyParent->scale(rupeeKeyScale, rupeeKeyScale); + + f32 rupeeKeyPosX = g_drawHIO.mRupeeKeyPosX; + f32 rupeeKeyPosY = g_drawHIO.mRupeeKeyPosY; + // Rupees/keys read better anchored to the bottom-right corner than the top-right. + dAnchorHudScale(mpRupeeKeyParent, HudCorner::BottomRight, &rupeeKeyPosX, &rupeeKeyPosY); + mpRupeeKeyParent->paneTrans(rupeeKeyPosX, rupeeKeyPosY); +#else mpRupeeKeyParent->scale(g_drawHIO.mRupeeKeyScale * field_0x718, g_drawHIO.mRupeeKeyScale * field_0x718); mpRupeeKeyParent->paneTrans(g_drawHIO.mRupeeKeyPosX, g_drawHIO.mRupeeKeyPosY); +#endif mpRupeeParent[0]->scale(g_drawHIO.mRupeeScale, g_drawHIO.mRupeeScale); mpRupeeParent[0]->paneTrans(g_drawHIO.mRupeePosX, g_drawHIO.mRupeePosY); @@ -2137,8 +2289,18 @@ void dMeter2Draw_c::drawKey(s16 i_keyNum) { } } +#if TARGET_PC + const f32 keyScale = g_drawHIO.mKeyScale * dGetUserHudScale(); + mpKeyParent->scale(keyScale, keyScale); + + f32 keyPosX = g_drawHIO.mKeyPosX; + f32 keyPosY = g_drawHIO.mKeyPosY; + dAnchorHudScale(mpKeyParent, HudCorner::BottomRight, &keyPosX, &keyPosY); + mpKeyParent->paneTrans(keyPosX, keyPosY); +#else mpKeyParent->scale(g_drawHIO.mKeyScale, g_drawHIO.mKeyScale); mpKeyParent->paneTrans(g_drawHIO.mKeyPosX, g_drawHIO.mKeyPosY); +#endif } void dMeter2Draw_c::setAlphaKeyChange(bool param_0) { @@ -2245,11 +2407,11 @@ void dMeter2Draw_c::drawButtonA(u8 i_action, f32 i_posX, f32 i_posY, f32 i_textP mp_string = getActionString(0x15, 1, NULL); for (int i = 0; i < 5; i++) { - strcpy(static_cast(mpAText[i]->getPanePtr())->getStringPtr(), mp_string); + SAFE_STRCPY(static_cast(mpAText[i]->getPanePtr())->getStringPtr(), mp_string); } } else { for (int i = 0; i < 5; i++) { - strcpy(static_cast(mpAText[i]->getPanePtr())->getStringPtr(), mp_string); + SAFE_STRCPY(static_cast(mpAText[i]->getPanePtr())->getStringPtr(), mp_string); } } @@ -2308,9 +2470,14 @@ void dMeter2Draw_c::drawButtonB(u8 i_action, bool param_1, f32 i_posX, f32 i_pos JUT_ASSERT(0, strlen(mp_string) < (64)); for (int i = 0; i < 5; i++) { - strcpy(static_cast(mpBText[i]->getPanePtr())->getStringPtr(), mp_string); + SAFE_STRCPY(static_cast(mpBText[i]->getPanePtr())->getStringPtr(), mp_string); } +#if TARGET_PC + if (dusk::getSettings().game.enableTouchControls) { + mpScreen->search(MULTI_CHAR('item_b_n'))->hide(); + } else +#endif if (i_action == 0x26 || i_action == 0x2E) { mpScreen->search(MULTI_CHAR('item_b_n'))->show(); var_r31 = 1; @@ -2391,7 +2558,7 @@ void dMeter2Draw_c::drawButtonZ(u8 i_action) { JUT_ASSERT(0, strlen(mp_string) < (64)); for (int i = 0; i < 5; i++) { - strcpy(static_cast(mpXYText[i][2]->getPanePtr())->getStringPtr(), mp_string); + SAFE_STRCPY(static_cast(mpXYText[i][2]->getPanePtr())->getStringPtr(), mp_string); } mpButtonXY[2]->scale(g_drawHIO.mButtonZScale, g_drawHIO.mButtonZScale); @@ -2490,7 +2657,7 @@ void dMeter2Draw_c::drawButtonXY(int i_no, u8 i_itemNo, u8 i_action, bool param_ JUT_ASSERT(0, strlen(mp_string) < (64)); for (int i = 0; i < 5; i++) { - strcpy(static_cast(mpXYText[i][i_no]->getPanePtr())->getStringPtr(), + SAFE_STRCPY(static_cast(mpXYText[i][i_no]->getPanePtr())->getStringPtr(), mp_string); } @@ -2588,6 +2755,12 @@ void dMeter2Draw_c::drawButtonXY(int i_no, u8 i_itemNo, u8 i_action, bool param_ mpTextXY[i_no]->scale(g_drawHIO.mButtonXYTextScale, g_drawHIO.mButtonXYTextScale); mpTextXY[i_no]->paneTrans(g_drawHIO.mButtonXYTextPosX, g_drawHIO.mButtonXYTextPosY); } + +#if TARGET_PC + if (dusk::getSettings().game.enableTouchControls) { + mpScreen->search(tag[i_no])->hide(); + } +#endif } } @@ -2596,11 +2769,24 @@ f32 dMeter2Draw_c::getButtonCrossParentInitTransY() { } void dMeter2Draw_c::drawButtonCross(f32 i_posX, f32 i_posY) { +#if TARGET_PC + const f32 buttonCrossUserScale = dGetUserHudScale(); + const f32 buttonCrossScale = g_drawHIO.mButtonCrossScale * buttonCrossUserScale; + mpButtonCrossParent->scale(buttonCrossScale, buttonCrossScale); +#else mpButtonCrossParent->scale(g_drawHIO.mButtonCrossScale, g_drawHIO.mButtonCrossScale); +#endif mpTextI->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale); mpTextM->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale); +#if TARGET_PC + f32 buttonCrossPosX = i_posX; + f32 buttonCrossPosY = i_posY; + dAnchorHudScale(mpButtonCrossParent, HudCorner::BottomLeft, &buttonCrossPosX, &buttonCrossPosY); + mpButtonCrossParent->paneTrans(buttonCrossPosX, buttonCrossPosY); +#else mpButtonCrossParent->paneTrans(i_posX, i_posY); +#endif } void dMeter2Draw_c::setAlphaButtonCrossAnimeMin() { @@ -3140,6 +3326,10 @@ void dMeter2Draw_c::setButtonIconMidonaAlpha(u32 param_0) { } mpButtonXY[2]->setAlpha(255.0f * field_0x724 * temp_f30_2); + +#if TARGET_PC + dusk::ui::update_midna_icon_texture(mpButtonMidona != NULL ? mpButtonMidona->getPanePtr() : NULL); +#endif } void dMeter2Draw_c::setButtonIconAlpha(int i_no, u8 unused0, u32 unused1, bool unused2) { @@ -3243,7 +3433,7 @@ char* dMeter2Draw_c::getActionString(u8 i_action, u8 i_type, u8* param_2) { }; static char i_text_buf[32]; - strcpy(i_text_buf, ""); + SAFE_STRCPY(i_text_buf, ""); if (param_2 != NULL) { *param_2 = 1; @@ -3505,9 +3695,16 @@ void dMeter2Draw_c::drawKanteraMeter(u8 i_button, f32 i_alphaRate) { Vec vtx0 = pane->getPanePtr()->getGlbVtx(0); Vec vtx3 = pane->getPanePtr()->getGlbVtx(3); +#if TARGET_PC + const f32 oilUserScale = dGetUserHudScale(); + mpKanteraMeter[i_button]->setPos(((vtx0.x + vtx3.x) * 0.5f) + 9.0f * oilUserScale + sp10[i_button], + vtx3.y + sp8[i_button]); + mpKanteraMeter[i_button]->setScale(0.6f * oilUserScale, 0.6f * oilUserScale); +#else mpKanteraMeter[i_button]->setPos(((vtx0.x + vtx3.x) * 0.5f) + 9.0f + sp10[i_button], vtx3.y + sp8[i_button]); mpKanteraMeter[i_button]->setScale(0.6f, 0.6f); +#endif mpKanteraMeter[i_button]->setNowGauge(dComIfGs_getMaxOil(), dComIfGs_getOil()); mpKanteraMeter[i_button]->setAlphaRate(i_alphaRate); } diff --git a/src/d/d_meter2_info.cpp b/src/d/d_meter2_info.cpp index bb533e6370..6309e83a86 100644 --- a/src/d/d_meter2_info.cpp +++ b/src/d/d_meter2_info.cpp @@ -15,6 +15,8 @@ #include +#include "helpers/string.hpp" + enum ITEMICON_RES_FILE_ID { ITEMICON_BTI_ARI_MESU_00=0x3, ITEMICON_BTI_ARI_OSU_00=0x4, @@ -350,8 +352,8 @@ void dMeter2Info_c::decMsgKeyWaitTimer() { } } -void dMeter2Info_c::getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) { - strcpy(o_string, ""); +void dMeter2Info_c::getString(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { + SAFE_STRCPY(o_string, ""); u8* msgRes; if (mMsgResource == NULL) { @@ -372,7 +374,7 @@ void dMeter2Info_c::getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_ // check if i_stringID equals the message entry "Message ID" if (i_stringID == bmg_inf->entries[i].message_id) { string_ptr = (char*)(string_data + bmg_inf->entries[i].string_offset); // use entry "String Offset" to get string pointer - strcpy(o_string, string_ptr); + SAFE_STRCPY(o_string, string_ptr); if (i_msgEntry != NULL) { memcpy(i_msgEntry, &bmg_inf->entries[i], sizeof(JMSMesgEntry_c)); @@ -387,8 +389,8 @@ void dMeter2Info_c::getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_ } } -void dMeter2Info_c::getStringKana(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) { - strcpy(o_string, ""); +void dMeter2Info_c::getStringKana(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { + SAFE_STRCPY(o_string, ""); u8* msgRes; if (mMsgResource == NULL) { @@ -456,8 +458,8 @@ void dMeter2Info_c::getStringKana(u32 i_stringID, char* o_string, JMSMesgEntry_c } } -void dMeter2Info_c::getStringKanji(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) { - strcpy(o_string, ""); +void dMeter2Info_c::getStringKanji(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { + SAFE_STRCPY(o_string, ""); u8* msgRes; if (mMsgResource == NULL) { @@ -592,7 +594,7 @@ BOOL dMeter2Info_c::isDirectUseItem(int param_0) { return (mDirectUseItem & (u8)(1 << param_0)) ? TRUE : FALSE; } -dMeter2Info_c g_meter2_info; +DUSK_GAME_DATA dMeter2Info_c g_meter2_info; int dMeter2Info_c::setMeterString(s32 i_string) { if (mMeterString != 0) { @@ -668,7 +670,7 @@ void dMeter2Info_c::resetMeterString() { void dMeter2Info_c::setWarpInfo(const char* i_stageName, const cXyz& i_position, s16 i_angle, u8 i_roomNo, u8 param_4, u8 i_warpPlayerNo) { - strcpy(mWarpInfo.mStageName, i_stageName); + SAFE_STRCPY(mWarpInfo.mStageName, i_stageName); mWarpInfo.mPosition = i_position; mWarpInfo.mAngle = (s16)i_angle; mWarpInfo.mRoomNo = (u8)i_roomNo; @@ -1592,7 +1594,7 @@ void dMeter2Info_c::setMiniGameCount(s8 i_count) { } void dMeter2Info_c::setSaveStageName(const char* i_stageName) { - strcpy(mSaveStageName, i_stageName); + SAFE_STRCPY(mSaveStageName, i_stageName); } s16 dMeter2Info_getNowLifeGauge() { @@ -1740,7 +1742,7 @@ bool dMeter2Info_isItemOpenCheck() { return true; } -dMenu_LetterData dMenu_Letter::letter_data[64] = { +DUSK_GAME_DATA dMenu_LetterData dMenu_Letter::letter_data[64] = { {0x09C5, 0x0A29, 0x0A8D, 0x010B}, {0x09C6, 0x0A2A, 0x0A8E, 0x0237}, {0x09C7, 0x0A2B, 0x0A8F, 0x0236}, {0x09C8, 0x0A2C, 0x0A90, 0x0037}, {0x09C9, 0x0A2D, 0x0A91, 0x0039}, {0x09CA, 0x0A2E, 0x0A92, 0x0067}, diff --git a/src/d/d_meter_HIO.cpp b/src/d/d_meter_HIO.cpp index 584a2852f6..39b5b3b7ea 100644 --- a/src/d/d_meter_HIO.cpp +++ b/src/d/d_meter_HIO.cpp @@ -4310,12 +4310,12 @@ void dMeter_cursorHIO_c::genMessage(JORMContext* mctx) { } #endif -dMeter_menuHIO_c g_menuHIO; +DUSK_GAME_DATA dMeter_menuHIO_c g_menuHIO; -dMeter_drawHIO_c g_drawHIO; +DUSK_GAME_DATA dMeter_drawHIO_c g_drawHIO; -dMeter_ringHIO_c g_ringHIO; +DUSK_GAME_DATA dMeter_ringHIO_c g_ringHIO; -dMeter_fmapHIO_c g_fmapHIO; +DUSK_GAME_DATA dMeter_fmapHIO_c g_fmapHIO; -dMeter_cursorHIO_c g_cursorHIO; +DUSK_GAME_DATA dMeter_cursorHIO_c g_cursorHIO; diff --git a/src/d/d_meter_button.cpp b/src/d/d_meter_button.cpp index e55b42bc1a..0e3354e76e 100644 --- a/src/d/d_meter_button.cpp +++ b/src/d/d_meter_button.cpp @@ -19,6 +19,10 @@ #include "dusk/frame_interpolation.h" #include +#if TARGET_PC +#include "helpers/string.hpp" +#endif + #if VERSION == VERSION_GCN_JPN #define STR_BUF_LEN 528 #else @@ -254,7 +258,7 @@ void dMeterButton_c::draw() { if (mMsgID != 0xFFFF) { char tmp_buf[STR_BUF_LEN]; - strcpy(tmp_buf, static_cast(mpTm_c[0]->getPanePtr())->getStringPtr()); + SAFE_STRCPY(tmp_buf, static_cast(mpTm_c[0]->getPanePtr())->getStringPtr()); mpTextScreen->draw(0.0f, 0.0f, graf_ctx); #if VERSION == VERSION_GCN_JPN @@ -265,7 +269,7 @@ void dMeterButton_c::draw() { NULL, 8); #endif mpString_c->drawOutFont(static_cast(mpTm_c[0]->getPanePtr()), -1.0f); - strcpy(static_cast(mpTm_c[0]->getPanePtr())->getStringPtr(), tmp_buf); + SAFE_STRCPY(static_cast(mpTm_c[0]->getPanePtr())->getStringPtr(), tmp_buf); } for (int i = 0; i < 2; i++) { @@ -1207,7 +1211,7 @@ void dMeterButton_c::screenInitButton() { field_0x360 = mpTextBox[0]->getBounds().i.x; for (int i = 0; i < 2; i++) { - strcpy(mButtonText[i], ""); + SAFE_STRCPY(mButtonText[i], ""); field_0x2e8[i] = 0.0f; field_0x4be[i] = BUTTON_NONE_e; field_0x2f4[i] = 0.0f; @@ -1903,12 +1907,12 @@ void dMeterButton_c::updateText(u32 i_flags) { if (getString) { mMsgID = dMeter2Info_getFloatingMessageID(); - strcpy(static_cast(mpTm_c[0]->getPanePtr())->getStringPtr(), buf1); - strcpy(static_cast(mpTm_c[1]->getPanePtr())->getStringPtr(), buf3); + SAFE_STRCPY(static_cast(mpTm_c[0]->getPanePtr())->getStringPtr(), buf1); + SAFE_STRCPY(static_cast(mpTm_c[1]->getPanePtr())->getStringPtr(), buf3); for (int i = 0; i < 2; i++) { if (field_0x0ec[i] != NULL) { - strcpy( + SAFE_STRCPY( static_cast(field_0x0ec[i]->getPanePtr())->getStringPtr(), buf2); } @@ -3020,7 +3024,7 @@ void dMeterButton_c::setString(char* i_string, u8 i_button, u8 param_2, u8 param } } - strcpy(mButtonText[param_2], i_string); + SAFE_STRCPY(mButtonText[param_2], i_string); if (param_2 == 0) { if (param_3 != 0) { @@ -3030,7 +3034,7 @@ void dMeterButton_c::setString(char* i_string, u8 i_button, u8 param_2, u8 param } for (int i = 0; i < 5; i++) { - strcpy(mpTextBox[i]->getStringPtr(), i_string); + SAFE_STRCPY(mpTextBox[i]->getStringPtr(), i_string); } return; } @@ -3042,7 +3046,7 @@ void dMeterButton_c::setString(char* i_string, u8 i_button, u8 param_2, u8 param } for (int i = 0; i < 5; i++) { - strcpy(mpTextBox[5 + i]->getStringPtr(), i_string); + SAFE_STRCPY(mpTextBox[5 + i]->getStringPtr(), i_string); } } @@ -3297,7 +3301,7 @@ void dMeterButton_c::hide_button(u8 i_button) { field_0x4b8[1] = 0; field_0x4bc[1] = 0; - strcpy(mButtonText[1], ""); + SAFE_STRCPY(mButtonText[1], ""); mpText[0]->alphaAnimeStart(mpText[1]->getAlphaTimer()); mpText[0]->setAlphaRate(mpText[1]->getAlphaRate()); mpText[1]->alphaAnimeStart(0); @@ -3307,14 +3311,14 @@ void dMeterButton_c::hide_button(u8 i_button) { field_0x4be[0] = BUTTON_NONE_e; field_0x4b8[0] = 0; field_0x4bc[0] = 0; - strcpy(mButtonText[0], ""); + SAFE_STRCPY(mButtonText[0], ""); } } else if (field_0x4be[1] == i_button) { field_0x4be[1] = BUTTON_NONE_e; field_0x4b8[1] = 0; field_0x4bc[1] = 0; field_0x2f4[0] = 0.0f; - strcpy(mButtonText[1], ""); + SAFE_STRCPY(mButtonText[1], ""); } } diff --git a/src/d/d_meter_map.cpp b/src/d/d_meter_map.cpp index 419235c970..d526d7877f 100644 --- a/src/d/d_meter_map.cpp +++ b/src/d/d_meter_map.cpp @@ -16,8 +16,25 @@ #include "f_op/f_op_overlap_mng.h" #include "m_Do/m_Do_controller_pad.h" #include "d/d_camera.h" +#if TARGET_PC +#include "dusk/settings.h" +#include +#endif #include +#if TARGET_PC +#include "dusk/action_bindings.h" + +namespace { + +// Reads the user HUD scale setting, clamped to a safe range. +f32 dGetUserHudScale() { + return std::clamp(dusk::getSettings().game.hudScale.getValue(), 0.5f, 2.0f); +} + +} // namespace +#endif + #if (PLATFORM_WII || PLATFORM_SHIELD) dMeter_map_HIO_c g_meter_mapHIO; #endif @@ -318,7 +335,7 @@ f32 dMeterMap_c::getMapDispEdgeTop() { mMap->getTexelPerCm() * (mMap->getPackZ() + -mMap->getPackPlusZ()) - mMap->getTopEdgePlus(); } - f32 rv = getMapDispEdgeBottomY_Layout() - tmp; + f32 rv = getMapDispEdgeBottomY_Layout() - tmp IF_DUSK(* dGetUserHudScale()); return rv; } @@ -535,6 +552,12 @@ void dMeterMap_c::_move(u32 param_0) { } #endif +#if TARGET_PC + if (mMap->refreshTextureSize()) { + mMapJ2DPicture->changeTexture(mMap->getResTIMGPointer(), 0); + } +#endif + int stayNo = dComIfGp_roomControl_getStayNo(); field_0x14 = param_0; @@ -621,8 +644,15 @@ void dMeterMap_c::draw() { mMapJ2DPicture->setAlpha(alpha); #if TARGET_PC - mMapJ2DPicture->draw(mDoGph_gInf_c::ScaleHUDXLeft(drawPosX), drawPosY, sizeX, sizeY, false, - false, false); + // Scale the minimap with the user HUD scale and shift down so its bottom-left + // corner stays anchored to the same screen position as at scale 1.0. + const f32 userHudScale = dGetUserHudScale(); + const f32 scaledSizeX = sizeX * userHudScale; + const f32 scaledSizeY = sizeY * userHudScale; + const f32 mapBottomShift = sizeY - scaledSizeY; + mMapJ2DPicture->draw(mDoGph_gInf_c::ScaleHUDXLeft(drawPosX), + drawPosY + mapBottomShift, scaledSizeX, scaledSizeY, + false, false, false); #else mMapJ2DPicture->draw(drawPosX, drawPosY, sizeX, sizeY, false, false, false); #endif @@ -720,7 +750,38 @@ void dMeterMap_c::ctrlShowMap() { } } - } else if (!mDoCPd_c::getTrigUp(PAD_1) && !mDoCPd_c::getTrigDown(PAD_1)) { + } +#if TARGET_PC + else if (!isEventRunCheck() && + (dMeter2Info_getMapStatus() == 0 || dMeter2Info_getMapStatus() == 1) && + !dMeter2Info_isSub2DStatus(1) && (isFmapScreen() || isDmapScreen()) && + dusk::getActionBindTrig(dusk::ActionBinds::OPEN_MAP_SCREEN, PAD_1)) + { + dMeter2Info_setMapStatus(2); + dMeter2Info_setMapKeyDirection(0x400); + Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_OPEN_S, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibration(); + } else if (!isEventRunCheck() && + (dMeter2Info_getMapStatus() == 0 || dMeter2Info_getMapStatus() == 1) && + isEnableDispMapAndMapDispSizeTypeNo() && + dusk::getActionBindTrig(dusk::ActionBinds::TOGGLE_MINIMAP, PAD_1)) + { + if (isDispPosInsideFlg()) { + setDispPosOutsideFlg_SE_On(); + Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_CLOSE_S, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_setMapStatus(0); + } else { + setDispPosInsideFlg_SE_On(); + Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_OPEN_S, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibration(); + dMeter2Info_setMapStatus(1); + } + } +#endif + else if (!mDoCPd_c::getTrigUp(PAD_1) && !mDoCPd_c::getTrigDown(PAD_1)) { keyCheck(); } @@ -815,7 +876,21 @@ void dMeterMap_c::meter_map_move(u32 param_0) { dMeter2Info_set2DVibration(); } dMeter2Info_resetPauseStatus(); - } else if ( + } +#if TARGET_PC + else if (!dComIfGp_event_runCheck() && !dMsgObject_isTalkNowCheck() && + (dMeter2Info_getMapStatus() == 0 || dMeter2Info_getMapStatus() == 1) && + !dMeter2Info_isSub2DStatus(1) && (isFmapScreen() || isDmapScreen()) && + dusk::getActionBindTrig(dusk::ActionBinds::OPEN_MAP_SCREEN, PAD_1)) + { + dMeter2Info_setMapStatus(2); + dMeter2Info_setMapKeyDirection(0x400); + Z2GetAudioMgr()->seStart(Z2SE_SY_MAP_OPEN_S, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + dMeter2Info_set2DVibration(); + } +#endif + else if ( #if DEBUG dMw_RIGHT_TRIGGER() && #else diff --git a/src/d/d_meter_string.cpp b/src/d/d_meter_string.cpp index c28d6d5481..c99e7c564e 100644 --- a/src/d/d_meter_string.cpp +++ b/src/d/d_meter_string.cpp @@ -186,8 +186,8 @@ int dMeterString_c::_delete() { int dMeterString_c::createString(int i_stringID) { char str_buf[32]; dMeter2Info_getString(i_stringID, str_buf, NULL); - strcpy(static_cast(mpScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), str_buf); - strcpy(static_cast(mpScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), str_buf); + SAFE_STRCPY(static_cast(mpScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), str_buf); + SAFE_STRCPY(static_cast(mpScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), str_buf); mAnimFrame = 40.0f; mPikariAnimFrame = -1.0f; diff --git a/src/d/d_model.cpp b/src/d/d_model.cpp index 80dfbc0953..bdff472367 100644 --- a/src/d/d_model.cpp +++ b/src/d/d_model.cpp @@ -5,6 +5,10 @@ #include "JSystem/J3DGraphBase/J3DMaterial.h" #include "d/d_com_inf_game.h" +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#endif + void dMdl_c::draw() { j3dSys.setVtxPos(mpModelData->getVtxPosArray(), mpModelData->getVtxNum()); j3dSys.setVtxNrm(mpModelData->getVtxNrmArray(), mpModelData->getNrmNum()); @@ -45,6 +49,20 @@ void dMdl_c::create(J3DModelData* i_modelData, u16 i_materialId, dKy_tevstr_c* i } void dMdl_c::entryObj(dMdl_obj_c* i_obj) { +#ifdef TARGET_PC + // if field_0x1a is false, this dMdl_c is not in the drawlist + // if true, we need to make sure with interp enabled + if (dusk::frame_interp::is_enabled() && field_0x1a) { + auto pkt = dComIfGd_getListPacket()->mpBuffer[0]; + while (pkt && pkt != this) { + pkt = pkt->getNextPacket(); + } + if (!pkt) { + field_0x1a = false; + } + } +#endif + if (!field_0x1a) { dComIfGd_getListPacket()->entryImm(this, 0); field_0x1a = true; @@ -83,7 +101,7 @@ dMdl_c* dMdl_mng_c::entry(J3DModelData* i_modelData, u16 i_materialId, dKy_tevst return model; } -dMdl_mng_c* dMdl_mng_c::m_myObj; +DUSK_GAME_DATA dMdl_mng_c* dMdl_mng_c::m_myObj; void dMdl_mng_c::create() { m_myObj = JKR_NEW dMdl_mng_c(); diff --git a/src/d/d_msg_class.cpp b/src/d/d_msg_class.cpp index f67d6054e6..8dc2a82c01 100644 --- a/src/d/d_msg_class.cpp +++ b/src/d/d_msg_class.cpp @@ -13,6 +13,7 @@ #include "JSystem/JUtility/JUTFont.h" #if TARGET_PC +#include "dusk/menu_pointer.h" #include "dusk/scope_guard.hpp" #endif @@ -308,33 +309,33 @@ static u8 getOutFontNumberType(int param_0) { } #if TARGET_PC || VERSION == VERSION_GCN_PAL -static void setPlayerName(char* i_player_name, u8 param_2) { +static void setPlayerName(TEXT_SPAN i_player_name, u8 param_2) { if (param_2 != 0) { - strcpy(i_player_name, dComIfGs_getPlayerName()); + SAFE_STRCPY(i_player_name, dComIfGs_getPlayerName()); u32 name_length = strlen(i_player_name); char last = i_player_name[name_length - 1]; if (last == 0x73 || last == 0x53 || last == 0x7a || last == 0x5a || last == 0x78 || last == 0x58 || last == 0xdf) { - strcat(i_player_name, "'"); + SAFE_STRCAT(i_player_name, "'"); } else { - strcat(i_player_name, "s"); + SAFE_STRCAT(i_player_name, "s"); } } else { - strcpy(i_player_name, dComIfGs_getPlayerName()); + SAFE_STRCPY(i_player_name, dComIfGs_getPlayerName()); } } -static void setHorseName(char* i_horse_name, u8 param_2) { +static void setHorseName(TEXT_SPAN i_horse_name, u8 param_2) { if (param_2 != 0) { - strcpy(i_horse_name, dComIfGs_getHorseName()); + SAFE_STRCPY(i_horse_name, dComIfGs_getHorseName()); u32 name_length = strlen(i_horse_name); char last = i_horse_name[name_length - 1]; if (last == 0x73 || last == 0x53 || last == 0x7a || last == 0x5a || last == 0x78 || last == 0x58 || last == 0xdf) { - strcat(i_horse_name, "'"); + SAFE_STRCAT(i_horse_name, "'"); } else { - strcat(i_horse_name, "s"); + SAFE_STRCAT(i_horse_name, "s"); } } else { - strcpy(i_horse_name, dComIfGs_getHorseName()); + SAFE_STRCPY(i_horse_name, dComIfGs_getHorseName()); } } #endif @@ -575,6 +576,20 @@ void jmessage_tReference::pageSend() { void jmessage_tReference::selectMessage() { if (mSelectNum != 0) { +#if TARGET_PC + u8 pointerChoice = 0xFF; + if (dusk::menu_pointer::get_dialog_choice(pointerChoice) && pointerChoice < mSelectNum && + pointerChoice != mSelectPos) + { + mSelectPos = pointerChoice; + if (mSelectType != 0) { + getObjectPtr()->getSequenceProcessor()->calcStringLength(); + } + Z2GetAudioMgr()->seStart(Z2SE_SY_TALK_CURSOR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, + -1.0f, 0); + } +#endif + mpStick->checkTrigger(); if (mSelectType == 0) { @@ -707,7 +722,7 @@ void jmessage_tReference::inputNumber() { getObjectPtr()->setInputValue(new_input_val); } -char* jmessage_tReference::getWord(int i_no) { +TEXT_SPAN jmessage_tReference::getWord(int i_no) { if (i_no >= 10) { JUT_WARN(1093, "%s", "message stack over!!"); JUT_ASSERT(1094, i_no < (10)); @@ -1093,14 +1108,14 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz case MSGTAG_CURRENT_LETTER_PAGE: { char buffer[4]; int number = dComIfGp_getMessageCountNumber() / 100; - sprintf(buffer, "%d", number); + SAFE_SPRINTF(buffer, "%d", number); push_word(buffer); return true; } case MSGTAG_MAX_LETTER_PAGE: { char buffer[4]; int number = dComIfGp_getMessageCountNumber() % 100; - sprintf(buffer, "%d", number); + SAFE_SPRINTF(buffer, "%d", number); push_word(buffer); return true; } @@ -1120,7 +1135,7 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz } char player_name[100]; - strcpy(player_name, dComIfGs_getPlayerName()); + SAFE_STRCPY(player_name, dComIfGs_getPlayerName()); push_word(player_name); return true; } @@ -1130,7 +1145,7 @@ bool jmessage_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_siz } char horse_name[100]; - strcpy(horse_name, dComIfGs_getHorseName()); + SAFE_STRCPY(horse_name, dComIfGs_getHorseName()); push_word(horse_name); return true; } @@ -1779,7 +1794,7 @@ void jmessage_tMeasureProcessor::do_rubyset(void const* i_data, u32 i_size) { void jmessage_tMeasureProcessor::push_word(char* i_word) { jmessage_tReference* pReference = (jmessage_tReference*)getReference(); - strcpy(pReference->getWord(field_0x4b), i_word); + SAFE_STRCPY(pReference->getWord(field_0x4b), i_word); stack_pushCurrent(pReference->getWord(field_0x4b)); field_0x4b++; } @@ -2403,7 +2418,7 @@ bool jmessage_tSequenceProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_si u8 sel_bomb_num = objectPtr->getSelectBombNum(); dMsgUnit_setTag(7, sel_bomb_num, buffer); - strcpy((char*)pReference->getWord(field_0xb5), buffer); + SAFE_STRCPY((TEXT_SPAN)pReference->getWord(field_0xb5), buffer); push_word(); return true; } @@ -2413,7 +2428,7 @@ bool jmessage_tSequenceProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_si s16 sel_bomb_price = objectPtr->getSelectBombPrice(); dMsgUnit_setTag(1, sel_bomb_price, buffer); - strcpy((char*)pReference->getWord(field_0xb5), buffer); + SAFE_STRCPY((TEXT_SPAN)pReference->getWord(field_0xb5), buffer); push_word(); return true; } @@ -2760,13 +2775,13 @@ void jmessage_tRenderingProcessor::do_begin(void const* pEntry, char const* pszT } field_0x11c = 0; - strcpy(pReference->getTextPtr(), ""); - strcpy(pReference->getTextSPtr(), ""); - strcpy(pReference->getRubyPtr(), ""); + SAFE_STRCPY(pReference->getTextPtr(), ""); + SAFE_STRCPY(pReference->getTextSPtr(), ""); + SAFE_STRCPY(pReference->getRubyPtr(), ""); for (int i = 0; i < 3; i++) { - strcpy(pReference->getSelTextPtr(i), ""); - strcpy(pReference->getSelRubyPtr(i), ""); + SAFE_STRCPY(pReference->getSelTextPtr(i), ""); + SAFE_STRCPY(pReference->getSelRubyPtr(i), ""); } if (1.0f != pReference->getDistanceScale()) { @@ -2791,12 +2806,12 @@ void jmessage_tRenderingProcessor::do_end() { if (dMsgObject_getSelectWordFlag() != 0) { for (int i = 0; i < dMsgObject_getSelectWordFlag(); i++) { char buffer[200]; - strcpy(buffer, dMsgObject_getSelectWord(i)); + SAFE_STRCPY(buffer, dMsgObject_getSelectWord(i)); if (pReference->getSelectNum() == 2) { - strcat(pReference->getSelTextPtr(i + 1), buffer); + SAFE_STRCAT(pReference->getSelTextPtr(i + 1), buffer); } else if (pReference->getSelectNum() == 3) { - strcat(pReference->getSelTextPtr(i), buffer); + SAFE_STRCAT(pReference->getSelTextPtr(i), buffer); } } } @@ -3108,7 +3123,7 @@ bool jmessage_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_s char buffer[40]; u8 bombNum = pReference->getObjectPtr()->getSelectBombNum(); dMsgUnit_setTag(7, bombNum, buffer); - strcpy(pReference->getWord(field_0x14f), buffer); + SAFE_STRCPY(pReference->getWord(field_0x14f), buffer); push_word(); return 1; } @@ -3116,7 +3131,7 @@ bool jmessage_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_s char buffer[40]; s16 bombPrice = pReference->getObjectPtr()->getSelectBombPrice(); dMsgUnit_setTag(1, bombPrice, buffer); - strcpy(pReference->getWord(field_0x14f), buffer); + SAFE_STRCPY(pReference->getWord(field_0x14f), buffer); push_word(); return 1; } @@ -3501,7 +3516,7 @@ void jmessage_tRenderingProcessor::do_color(u8 i_colorNo) { mGCColor = getFontGCColorTable(i_colorNo, reference_p->getFukiKind()); char buffer[40]; - sprintf(buffer, + SAFE_SPRINTF(buffer, "\x1B" "CC[%08x]" "\x1B" @@ -3529,7 +3544,7 @@ void jmessage_tRenderingProcessor::do_scale(f32 param_1) { } char buffer[32]; - sprintf(buffer, + SAFE_SPRINTF(buffer, "\x1B" "FX[%d]" "\x1B" @@ -3541,7 +3556,7 @@ void jmessage_tRenderingProcessor::do_scale(f32 param_1) { void jmessage_tRenderingProcessor::do_linedown(s16 param_0) { char buffer[16]; - sprintf(buffer, "\x1B" "CD[%d]", param_0); + SAFE_SPRINTF(buffer, "\x1B" "CD[%d]", param_0); do_strcat(buffer, false, true, false); } @@ -3551,11 +3566,11 @@ void jmessage_tRenderingProcessor::do_transY(s16 i_transY, bool unused) { char buffer1[16]; if (i_transY < 0) { - sprintf(buffer0, "\x1B" "CU[%d]", -i_transY); - sprintf(buffer1, "\x1B" "CD[%d]", -i_transY); + SAFE_SPRINTF(buffer0, "\x1B" "CU[%d]", -i_transY); + SAFE_SPRINTF(buffer1, "\x1B" "CD[%d]", -i_transY); } else { - sprintf(buffer0, "\x1B" "CD[%d]", i_transY); - sprintf(buffer1, "\x1B" "CU[%d]", i_transY); + SAFE_SPRINTF(buffer0, "\x1B" "CD[%d]", i_transY); + SAFE_SPRINTF(buffer1, "\x1B" "CU[%d]", i_transY); } field_0x4c -= i_transY; @@ -3643,7 +3658,7 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par field_0x11c += strlen(i_str); if (field_0x14e != 0) { if (field_0x11c < 50) { - strcat(pReference->getSelTextPtr(field_0x14e - 1), i_str); + SAFE_STRCAT(pReference->getSelTextPtr(field_0x14e - 1), i_str); } else { JUT_WARN(5316, "%s", "TextBox Alloc Byte Over!!"); } @@ -3662,22 +3677,22 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par if (pReference->getCharAlpha() < 255.0f) { pReference->addCharAlpha(); if (field_0x148 != 0) { - char* textPtr = pReference->getTextPtr(); + TEXT_SPAN textPtr = pReference->getTextPtr(); textPtr[field_0x148] = 0; - strcat(textPtr, field_0x184); + SAFE_STRCAT(textPtr, field_0x184); } if (field_0x14a != 0) { - char* textPtr = pReference->getTextSPtr(); + TEXT_SPAN textPtr = pReference->getTextSPtr(); textPtr[field_0x14a] = 0; - strcat(textPtr, field_0x184); + SAFE_STRCAT(textPtr, field_0x184); } u32 charColor = (mCCColor & 0xFFFFFF00) | ((int)pReference->getCharAlpha() & 0xFF); u32 gradColor = (mGCColor & 0xFFFFFF00) | ((int)pReference->getCharAlpha() & 0xFF); char buffer[36]; - sprintf(buffer, "\x1b" "CC[%08x]" "\x1b" "GC[%08x]", charColor, gradColor); + SAFE_SPRINTF(buffer, "\x1b" "CC[%08x]" "\x1b" "GC[%08x]", charColor, gradColor); int length = 0; length = strlen(buffer); @@ -3686,9 +3701,9 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par field_0x148 = strlen(pReference->getTextPtr()); field_0x14a = strlen(pReference->getTextSPtr()); - strcpy(field_0x184, i_str); - strcat(pReference->getTextPtr(), buffer); - strcat(pReference->getTextSPtr(), buffer); + SAFE_STRCPY(field_0x184, i_str); + SAFE_STRCAT(pReference->getTextPtr(), buffer); + SAFE_STRCAT(pReference->getTextSPtr(), buffer); } else { JUT_WARN(5362, "%s", "TextBox Alloc Byte Over!!"); } @@ -3699,9 +3714,9 @@ void jmessage_tRenderingProcessor::do_strcat(char* i_str, bool param_2, bool par field_0x14a = 0; } - strcat(pReference->getTextPtr(), i_str); + SAFE_STRCAT(pReference->getTextPtr(), i_str); if (param_3) { - strcat(pReference->getTextSPtr(), i_str); + SAFE_STRCAT(pReference->getTextSPtr(), i_str); } } else { JUT_WARN(5380, "%s", "TextBox Alloc Byte Over!!"); @@ -3729,7 +3744,7 @@ void jmessage_tRenderingProcessor::do_rubyset(void const* i_data, u32 i_size) { buffer[0] = pRuby[index++]; buffer[1] = pRuby[index++]; buffer[2] = 0; - strcat(field_0x152, (const char*)buffer); + SAFE_STRCAT(field_0x152, (const char*)buffer); int character = (((char)buffer[0] & 0xFF) << 8) | ((char)buffer[1] & 0xFF); if (field_0x14e != 0) { @@ -3751,7 +3766,7 @@ void jmessage_tRenderingProcessor::do_rubyset(void const* i_data, u32 i_size) { } } -void jmessage_tRenderingProcessor::do_rubystrcat(char* i_src, char* i_dst, f32 i_charSpace, f32 param_4) { +void jmessage_tRenderingProcessor::do_rubystrcat(char* i_src, TEXT_SPAN i_dst, f32 i_charSpace, f32 param_4) { jmessage_tReference* pReference = (jmessage_tReference*)getReference(); if (pReference->isCharSend()) { if (0.0f != param_4) { @@ -3760,18 +3775,18 @@ void jmessage_tRenderingProcessor::do_rubystrcat(char* i_src, char* i_dst, f32 i if (cursor_trans >= 1.0f) { char buffer[16]; snprintf(buffer, sizeof(buffer) - 1, "\x1B" "CR[%d]", (int)cursor_trans); - strcat(i_dst, buffer); + SAFE_STRCAT(i_dst, buffer); field_0x12c += (int)cursor_trans; } else if (cursor_trans <= -1.0f) { char buffer[16]; snprintf(buffer, sizeof(buffer) - 1, "\x1B" "CL[%d]", (int)-cursor_trans); - strcat(i_dst, buffer); + SAFE_STRCAT(i_dst, buffer); field_0x12c += (int)cursor_trans; } field_0x12c += field_0x128 + i_charSpace; } - strcat(i_dst, i_src); + SAFE_STRCAT(i_dst, i_src); } } @@ -4046,13 +4061,13 @@ bool jmessage_string_tMeasureProcessor::do_tag(u32 i_tag, void const* i_data, u3 break; case MSGTAG_CURRENT_LETTER_PAGE: { char buffer[4]; - sprintf(buffer, "%d", dComIfGp_getMessageCountNumber() / 100); + SAFE_SPRINTF(buffer, "%d", dComIfGp_getMessageCountNumber() / 100); stack_pushCurrent(buffer); break; } case MSGTAG_MAX_LETTER_PAGE: { char buffer[4]; - sprintf(buffer, "%d", dComIfGp_getMessageCountNumber() % 100); + SAFE_SPRINTF(buffer, "%d", dComIfGp_getMessageCountNumber() % 100); stack_pushCurrent(buffer); break; } @@ -4469,11 +4484,11 @@ void jmessage_string_tRenderingProcessor::do_begin(void const* pEntry, char cons void jmessage_string_tRenderingProcessor::do_end() { if (mpReference->getPanePtr() != NULL) { - strcpy(mpReference->getPanePtr()->getStringPtr(), field_0x54); + SAFE_STRCPY(mpReference->getPanePtr()->getStringPtr(), field_0x54); } if (mpReference->getRubyPanePtr() != NULL) { - strcpy(mpReference->getRubyPanePtr()->getStringPtr(), field_0x254); + SAFE_STRCPY(mpReference->getRubyPanePtr()->getStringPtr(), field_0x254); } } @@ -4604,13 +4619,13 @@ bool jmessage_string_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data, break; case MSGTAG_CURRENT_LETTER_PAGE: { char buffer[4]; - sprintf(buffer, "%d", dComIfGp_getMessageCountNumber() / 100); + SAFE_SPRINTF(buffer, "%d", dComIfGp_getMessageCountNumber() / 100); push_word(buffer); break; } case MSGTAG_MAX_LETTER_PAGE: { char buffer[4]; - sprintf(buffer, "%d", dComIfGp_getMessageCountNumber() % 100); + SAFE_SPRINTF(buffer, "%d", dComIfGp_getMessageCountNumber() % 100); push_word(buffer); break; } @@ -5086,7 +5101,7 @@ void jmessage_string_tRenderingProcessor::do_strcat(char* i_str) { if (getLineCountNowPage() >= 0) { field_0x54e += strlen(i_str); if (field_0x54e < ARRAY_SIZE(field_0x54)) { - strcat(field_0x54, i_str); + SAFE_STRCAT(field_0x54, i_str); } else { JUT_WARN(7531, "%s", "Message Alloc Byte Over!!"); } @@ -5117,7 +5132,7 @@ void jmessage_string_tRenderingProcessor::do_rubyset(void const* i_data, u32 i_s bytes[0] = pRuby[i++]; bytes[1] = pRuby[i++]; bytes[2] = 0; - strcat(field_0x454, (const char*)bytes); + SAFE_STRCAT(field_0x454, (const char*)bytes); int character = (((char)bytes[0] & 0xFF) << 8) | ((char)bytes[1] & 0xFF); field_0x44 += charSpace + fontSize.mSizeX * ((f32)pFont->getWidth(character) / pFont->getCellWidth()); @@ -5135,7 +5150,7 @@ void jmessage_string_tRenderingProcessor::do_rubystrcat(char* i_str) { if (getLineCountNowPage() >= 0) { field_0x550 += strlen(i_str); if (field_0x550 < ARRAY_SIZE(field_0x254)) { - strcat(field_0x254, i_str); + SAFE_STRCAT(field_0x254, i_str); } else { JUT_WARN(7613, "%s", "Message Alloc Byte Over!!"); } @@ -5209,7 +5224,7 @@ void jmessage_string_tRenderingProcessor::do_color(u8 i_colorNo) { } char buffer[32]; - sprintf(buffer, "\x1b" "CC[%08x]" "\x1b" "GC[%08x]", ccColor, gcColor); + SAFE_SPRINTF(buffer, "\x1b" "CC[%08x]" "\x1b" "GC[%08x]", ccColor, gcColor); do_strcat(buffer); } @@ -5220,13 +5235,13 @@ void jmessage_string_tRenderingProcessor::do_scale(f32 i_scale) { s16 scaleY = 0.5f + fontSize.mSizeY * i_scale; char buffer[32]; - sprintf(buffer, "\x1b" "FX[%d]" "\x1b" "FY[%d]", scaleX, scaleY); + SAFE_SPRINTF(buffer, "\x1b" "FX[%d]" "\x1b" "FY[%d]", scaleX, scaleY); do_strcat(buffer); } void jmessage_string_tRenderingProcessor::do_linedown(s16 i_lineNo) { char buffer[16]; - sprintf(buffer, "\x1B" "CD[%d]", i_lineNo); + SAFE_SPRINTF(buffer, "\x1B" "CD[%d]", i_lineNo); do_strcat(buffer); } @@ -5245,6 +5260,6 @@ void jmessage_string_tRenderingProcessor::do_numset(s16 i_num) { } void jmessage_string_tRenderingProcessor::push_word(char const* i_word) { - strcpy(field_0x486, i_word); + SAFE_STRCPY(field_0x486, i_word); stack_pushCurrent(field_0x486); } diff --git a/src/d/d_msg_flow.cpp b/src/d/d_msg_flow.cpp index c461b179e1..094189679c 100644 --- a/src/d/d_msg_flow.cpp +++ b/src/d/d_msg_flow.cpp @@ -745,7 +745,7 @@ int dMsgFlow_c::getParam(u8* params) { return *(BE(int)*)params; } -queryFunc dMsgFlow_c::mQueryList[53] = { +DUSK_GAME_DATA queryFunc dMsgFlow_c::mQueryList[53] = { &dMsgFlow_c::query005, &dMsgFlow_c::query001, &dMsgFlow_c::query002, &dMsgFlow_c::query003, &dMsgFlow_c::query006, &dMsgFlow_c::query007, &dMsgFlow_c::query004, &dMsgFlow_c::query008, &dMsgFlow_c::query009, &dMsgFlow_c::query010, &dMsgFlow_c::query011, &dMsgFlow_c::query012, @@ -1730,7 +1730,7 @@ u16 dMsgFlow_c::query053(mesg_flow_node_branch* i_flowNode_p, fopAc_ac_c* i_spea return ret; } -eventFunc dMsgFlow_c::mEventList[43] = { +DUSK_GAME_DATA eventFunc dMsgFlow_c::mEventList[43] = { &dMsgFlow_c::event000, &dMsgFlow_c::event001, &dMsgFlow_c::event002, &dMsgFlow_c::event003, &dMsgFlow_c::event004, &dMsgFlow_c::event005, &dMsgFlow_c::event006, &dMsgFlow_c::event007, &dMsgFlow_c::event008, &dMsgFlow_c::event009, &dMsgFlow_c::event010, &dMsgFlow_c::event011, diff --git a/src/d/d_msg_object.cpp b/src/d/d_msg_object.cpp index 44b5c66571..712ee61584 100644 --- a/src/d/d_msg_object.cpp +++ b/src/d/d_msg_object.cpp @@ -26,12 +26,13 @@ #include #include "JSystem/JKernel/JKRExpHeap.h" -#include "dusk/version.hpp" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_lib.h" #if TARGET_PC +#include "dusk/menu_pointer.h" #include "dusk/settings.h" +#include "dusk/version.hpp" #include #include #include @@ -424,20 +425,9 @@ static void dummyStrings() { DEAD_STRING(""); } -dMsgObject_HIO_c g_MsgObject_HIO_c; +DUSK_GAME_DATA dMsgObject_HIO_c g_MsgObject_HIO_c; int dMsgObject_c::_execute() { -// TODO: enabling wii message overrides fixes direction text, but gives wrong item control text -/*#if TARGET_PC - if (dusk::getSettings().game.enableMirrorMode) { - // enable wii message index override - g_MsgObject_HIO_c.mMessageDisplay = 1; - } else if (!dusk::getSettings().game.enableMirrorMode && g_MsgObject_HIO_c.mMessageDisplay == 1) { - g_MsgObject_HIO_c.mMessageDisplay = 0; - } -#endif*/ - - field_0x4c7 = 0; if (mpTalkHeap != NULL) { field_0x148 = mDoExt_setCurrentHeap(mpTalkHeap); @@ -461,12 +451,12 @@ int dMsgObject_c::_execute() { mpCtrl->setMessageCode(mpRefer->getRevoMessageID()); mpRefer->setRevoMessageID(0); jmessage_tReference* pRef = (jmessage_tReference*)mpRenProc->getReference(); - strcpy(pRef->getTextPtr(), ""); - strcpy(pRef->getTextSPtr(), ""); - strcpy(pRef->getRubyPtr(), ""); + SAFE_STRCPY(pRef->getTextPtr(), ""); + SAFE_STRCPY(pRef->getTextSPtr(), ""); + SAFE_STRCPY(pRef->getRubyPtr(), ""); for (int i = 0; i < 3; i++) { - strcpy(pRef->getSelTextPtr(i), ""); - strcpy(pRef->getSelRubyPtr(i), ""); + SAFE_STRCPY(pRef->getSelTextPtr(i), ""); + SAFE_STRCPY(pRef->getSelRubyPtr(i), ""); } } field_0x4ca = mpCtrl->update(); @@ -604,6 +594,83 @@ int dMsgObject_c::_delete() { return 1; } +#if TARGET_PC +struct MirrorMsgOverride { + u32 gcMsgId; + u32 wiiMsgId; +}; + +static const MirrorMsgOverride mirrorMsgOverrides[] = { + {0x153a, 0x3c4a}, + {0x1553, 0x3c63}, + {0x1558, 0x3c68}, + {0x155c, 0x3c6c}, + {0x1569, 0x3c79}, + {0x156f, 0x3c7f}, + {0x1f81, 0x4691}, + {0x232a, 0x4a3a}, + {0x13f2, 0x3b02}, + {0x1416, 0x3b26}, + {0x1417, 0x3b27}, + {0x1419, 0x3b29}, + {0x1521, 0x3c31}, + {0x1614, 0x3d24}, + {0x1626, 0x3d36}, + {0x1628, 0x3d38}, + {0x16aa, 0x3dba}, + {0x16b8, 0x3dc8}, + {0x16b9, 0x3dc9}, + {0x1904, 0x4014}, + {0x1919, 0x4029}, + {0x19cd, 0x40dd}, + {0x19d3, 0x40e3}, + {0x19d6, 0x40e6}, + {0x19e6, 0x40f6}, + {0x19eb, 0x40fb}, + {0x14b6, 0x3bc6}, + {0x151a, 0x3c2a}, + {0x1530, 0x3c40}, + {0x1532, 0x3c42}, + {0x2726, 0x4e36}, + {0x2736, 0x4e46}, + {0x2739, 0x4e49}, + {0x274c, 0x4e5c}, + {0x24da, 0x4bea}, + {0x24db, 0x4beb}, + {0x13d8, 0x3ae8}, + {0x13dc, 0x3aec}, + {0x13eb, 0x3afb}, + {0x17df, 0x3eef}, + {0x17e2, 0x3ef2}, + {0x1dae, 0x44be}, + {0x14ca, 0x3bda}, + {0x470, 0x493}, + {0x473, 0x492}, + {0x1f41, 0x4651}, + {0x1f42, 0x4652}, + {0x0847, 0x0870}, + {0x0d5c, 0x0d65}, + {0x0a97, 0x0a98}, + {0x0327, 0x12ba}, + {0x0328, 0x12bb}, + {0x1534, 0x3c44}, + {0x1536, 0x3c46}, + {0x1557, 0x3c67}, + {0x1b88, 0x4298}, + {0x14c8, 0x3bd8}, + {0x151b, 0x3c2b}, +}; + +static u32 getMirrorMsgOverride(u32 msgId) { + for (size_t i = 0; i < sizeof(mirrorMsgOverrides) / sizeof(mirrorMsgOverrides[0]); i++) { + if (mirrorMsgOverrides[i].gcMsgId == msgId) { + return mirrorMsgOverrides[i].wiiMsgId; + } + } + return msgId; +} +#endif + void dMsgObject_c::setMessageIndex(u32 revoIndex, u32 param_2, bool param_3) { field_0x158 = revoIndex; revoIndex = getRevoMessageIndex(revoIndex); @@ -692,9 +759,14 @@ u32 dMsgObject_c::getMessageIndex(u32 param_0) { } u32 dMsgObject_c::getRevoMessageIndex(u32 param_1) { - if (!g_MsgObject_HIO_c.mMessageDisplay) { - return param_1; - } +#if TARGET_PC + if (!dusk::getSettings().game.enableMirrorMode) { + if (!g_MsgObject_HIO_c.mMessageDisplay) { return param_1; } } + if (param_1 == getMirrorMsgOverride(param_1)) { return param_1; } +#else + if (!g_MsgObject_HIO_c.mMessageDisplay) { return param_1; } +#endif + u32 msgIndexCount; JMSMesgInfo_c* pMsg; int i = 0; @@ -1021,12 +1093,12 @@ void dMsgObject_c::continueProc() { offAutoMessageFlagLocal(); setMessageIndex(field_0x100->msg_idx, field_0x100->field_0xf0, true); mpScrnDraw->fukiPosCalc(pRef->getFukiPosType()); - strcpy(pRef->getTextPtr(), ""); - strcpy(pRef->getTextSPtr(), ""); - strcpy(pRef->getRubyPtr(), ""); + SAFE_STRCPY(pRef->getTextPtr(), ""); + SAFE_STRCPY(pRef->getTextSPtr(), ""); + SAFE_STRCPY(pRef->getRubyPtr(), ""); for (int i = 0; i < 3; i++) { - strcpy(pRef->getSelTextPtr(i), ""); - strcpy(pRef->getSelRubyPtr(i), ""); + SAFE_STRCPY(pRef->getSelTextPtr(i), ""); + SAFE_STRCPY(pRef->getSelRubyPtr(i), ""); } mpScrnDraw->arwAnimeInit(); mpRenProc->setTextInitPos(mpScrnDraw->getTextBoxPosX(), mpScrnDraw->getTextBoxPosY()); @@ -1054,7 +1126,20 @@ void dMsgObject_c::selectProc() { dComIfGp_setAStatusForce(0x2a, 0); } } - if (mDoCPd_c::getTrigA(0)) { +#if TARGET_PC + jmessage_tReference* pRef = (jmessage_tReference*)mpRenProc->getReference(); + u8 pointerChoice = 0xFF; + bool pointerConfirm = dusk::menu_pointer::consume_dialog_click(pointerChoice) && + pointerChoice < pRef->getSelectNum(); + if (pointerConfirm) { + pRef->setSelectPos(pointerChoice); + } +#endif + if (mDoCPd_c::getTrigA(0) +#if TARGET_PC + || pointerConfirm +#endif + ) { if (getSelectCursorPosLocal() != 0xff) { field_0x1a3 = 1; } @@ -1076,7 +1161,9 @@ void dMsgObject_c::selectProc() { } field_0x1a3 = 2; } +#ifndef TARGET_PC jmessage_tReference* pRef = (jmessage_tReference*)mpRenProc->getReference(); +#endif if (getStatusLocal() == 8) { if (isMidonaMessage() && field_0x1a3 != 0) { if (field_0x1a3 == 2 && getSelectCancelPos() == 3) { @@ -1737,8 +1824,8 @@ void dMsgObject_c::changeGroupLocal(s16 param_1) { } bool dMsgObject_c::getStringLocal(u32 param_1, J2DTextBox* param_2, J2DTextBox* param_3, - JUTFont* param_4, COutFont_c* param_5, char* param_6, - char* param_7, char* param_8, s16* param_9) { + JUTFont* param_4, COutFont_c* param_5, TEXT_SPAN param_6, + TEXT_SPAN param_7, TEXT_SPAN param_8, s16* param_9) { if (field_0x4cd == 0) { if (getStatusLocal() == 1) { s16 groupID = getMessageGroup(param_1); @@ -1781,13 +1868,13 @@ bool dMsgObject_c::getStringLocal(u32 param_1, J2DTextBox* param_2, J2DTextBox* *param_9 = mpRefer->getCharSoundInfo().field_0x40e; } if (param_6 != NULL) { - strcpy(param_6, pRef->getTextPtr()); + SAFE_STRCPY(param_6, pRef->getTextPtr()); } if (param_7 != NULL) { - strcpy(param_7, pRef->getRubyPtr()); + SAFE_STRCPY(param_7, pRef->getRubyPtr()); } if (param_8 != NULL) { - strcpy(param_8, pRef->getTextSPtr()); + SAFE_STRCPY(param_8, pRef->getTextSPtr()); } mpCtrl->reset(); mpCtrl->resetResourceCache(); @@ -2309,8 +2396,8 @@ void dMsgObject_c::changeGroup(s16 param_0) { } bool dMsgObject_c::getString(u32 param_0, J2DTextBox* param_1, J2DTextBox* param_2, - JUTFont* param_3, COutFont_c* param_4, char* param_5, char* param_6, - char* param_7, s16* param_8) { + JUTFont* param_3, COutFont_c* param_4, TEXT_SPAN param_5, TEXT_SPAN param_6, + TEXT_SPAN param_7, s16* param_8) { return dMsgObject_getMsgObjectClass()->getStringLocal( param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8); } @@ -2555,7 +2642,7 @@ static leafdraw_method_class l_dMsgObject_Method = { (process_method_func)dMsgObject_Draw, }; -msg_process_profile_definition g_profile_MSG_OBJECT = { +DUSK_PROFILE msg_process_profile_definition DUSK_CONST g_profile_MSG_OBJECT = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_msg_scrn_3select.cpp b/src/d/d_msg_scrn_3select.cpp index 27a0bf5e1b..2f19f23c83 100644 --- a/src/d/d_msg_scrn_3select.cpp +++ b/src/d/d_msg_scrn_3select.cpp @@ -16,8 +16,19 @@ #include "d/d_msg_object.h" #include "d/d_pane_class.h" +#if TARGET_PC +#include "dusk/menu_pointer.h" + +namespace { +bool hit_choice_pane(CPaneMgr* pane, f32 padding) { + return pane != NULL && pane->getPanePtr() != NULL && pane->getPanePtr()->isVisible() && + dusk::menu_pointer::hit_pane(pane, padding); +} +} // namespace +#endif + typedef void (dMsgScrn3Select_c::*processFn)(); -processFn process[] = { +DUSK_GAME_DATA processFn process[] = { &dMsgScrn3Select_c::open1Proc, &dMsgScrn3Select_c::open2Proc, &dMsgScrn3Select_c::waitProc, &dMsgScrn3Select_c::selectProc, &dMsgScrn3Select_c::changeProc, &dMsgScrn3Select_c::closeProc, }; @@ -277,7 +288,7 @@ bool dMsgScrn3Select_c::isSelect() { return mProcess == PROC_SELECT_e ? TRUE : FALSE; } -void dMsgScrn3Select_c::setString(char* mpText0, char* mpText1, char* mpText2) { +void dMsgScrn3Select_c::setString(DUSK_CONST char* mpText0, DUSK_CONST char* mpText1, DUSK_CONST char* mpText2) { if (mpTmSel_c[0] != NULL) { JUT_ASSERT(0, ((J2DTextBox*)(mpTmSel_c[0]->getPanePtr()))->getStringAllocByte() > strlen(mpText0)); @@ -294,19 +305,19 @@ void dMsgScrn3Select_c::setString(char* mpText0, char* mpText1, char* mpText2) { } if (mpTmSel_c[0] != NULL) { - strcpy(((J2DTextBox*)(mpTmSel_c[0]->getPanePtr()))->getStringPtr(), mpText0); + SAFE_STRCPY(((J2DTextBox*)(mpTmSel_c[0]->getPanePtr()))->getStringPtr(), mpText0); } if (mpTmSel_c[1] != NULL) { - strcpy(((J2DTextBox*)(mpTmSel_c[1]->getPanePtr()))->getStringPtr(), mpText1); + SAFE_STRCPY(((J2DTextBox*)(mpTmSel_c[1]->getPanePtr()))->getStringPtr(), mpText1); } if (mpTmSel_c[2] != NULL) { - strcpy(((J2DTextBox*)(mpTmSel_c[2]->getPanePtr()))->getStringPtr(), mpText2); + SAFE_STRCPY(((J2DTextBox*)(mpTmSel_c[2]->getPanePtr()))->getStringPtr(), mpText2); } } -void dMsgScrn3Select_c::setRubyString(char* pText0, char* pText1, char* pText2) { +void dMsgScrn3Select_c::setRubyString(DUSK_CONST char* pText0, DUSK_CONST char* pText1, DUSK_CONST char* pText2) { if (mpTmrSel_c[0] != NULL) { JUT_ASSERT(0, ((J2DTextBox*)(mpTmrSel_c[0]->getPanePtr()))->getStringAllocByte() > strlen(pText0)); @@ -323,15 +334,15 @@ void dMsgScrn3Select_c::setRubyString(char* pText0, char* pText1, char* pText2) } if (mpTmrSel_c[0] != NULL) { - strcpy(((J2DTextBox*)(mpTmrSel_c[0]->getPanePtr()))->getStringPtr(), pText0); + SAFE_STRCPY(((J2DTextBox*)(mpTmrSel_c[0]->getPanePtr()))->getStringPtr(), pText0); } if (mpTmrSel_c[1] != NULL) { - strcpy(((J2DTextBox*)(mpTmrSel_c[1]->getPanePtr()))->getStringPtr(), pText1); + SAFE_STRCPY(((J2DTextBox*)(mpTmrSel_c[1]->getPanePtr()))->getStringPtr(), pText1); } if (mpTmrSel_c[2] != NULL) { - strcpy(((J2DTextBox*)(mpTmrSel_c[2]->getPanePtr()))->getStringPtr(), pText2); + SAFE_STRCPY(((J2DTextBox*)(mpTmrSel_c[2]->getPanePtr()))->getStringPtr(), pText2); } } @@ -470,6 +481,9 @@ bool dMsgScrn3Select_c::selAnimeMove(u8 i_selNum, u8 param_1, bool param_2) { mSelNum = i_selNum; field_0x114 = 0; field_0x108 = param_2; +#if TARGET_PC + pointerMove(); +#endif (this->*process[mProcess])(); @@ -518,6 +532,48 @@ bool dMsgScrn3Select_c::selAnimeMove(u8 i_selNum, u8 param_1, bool param_2) { return mProcess == PROC_SELECT_e ? TRUE : FALSE; } +#if TARGET_PC +bool dMsgScrn3Select_c::pointerMove() { + dusk::menu_pointer::begin_context(dusk::menu_pointer::Context::Dialog); + mDPDPoint = 0xFF; + + const u8 firstPane = mSelNum == 2 ? 1 : 0; + for (u8 choice = 0; choice < mSelNum; ++choice) { + const u8 paneIndex = firstPane + choice; + if (paneIndex >= 3) { + continue; + } + + // TODO: this sucks and should be replaced with Wii mpTouchArea + bool hit = hit_choice_pane(mpSel_c[paneIndex], 8.0f) || + hit_choice_pane(mpTmSel_c[paneIndex], 24.0f) || + hit_choice_pane(mpTmrSel_c[paneIndex], 24.0f) || + hit_choice_pane(mpKahen_c[paneIndex], 8.0f) || + hit_choice_pane(mpCursor_c[paneIndex], 8.0f); + for (int i = 0; i < 5 && !hit; ++i) { + hit = hit_choice_pane(mpSelCldw_c[i][paneIndex], 8.0f); + } + + if (!hit) { + continue; + } + + mDPDPoint = choice; + field_0x110 = paneIndex; + dusk::menu_pointer::set_hover_target(choice); + dusk::menu_pointer::set_dialog_choice(choice, dusk::menu_pointer::peek_click()); + return true; + } + + return false; +} + +bool dMsgScrn3Select_c::consumePointerClick() { + u8 choice = 0xFF; + return dusk::menu_pointer::consume_dialog_click(choice); +} +#endif + bool dMsgScrn3Select_c::selAnimeEnd() { if (mProcess == PROC_MAX_e) { return true; diff --git a/src/d/d_msg_scrn_base.cpp b/src/d/d_msg_scrn_base.cpp index fdd9e57f9c..5488b76648 100644 --- a/src/d/d_msg_scrn_base.cpp +++ b/src/d/d_msg_scrn_base.cpp @@ -103,24 +103,24 @@ void dMsgScrnBase_c::drawOutFont(f32 param_0, f32 param_1, f32 param_2) { mpOutFont->draw(NULL, param_0, param_1, param_2); } -void dMsgScrnBase_c::setString(char* mpText, char* i_stringB) { +void dMsgScrnBase_c::setString(char DUSK_CONST* mpText, char DUSK_CONST* i_stringB) { for (int i = 0; i < 7; i++) { if (mpTm_c[i] != NULL) { JUT_ASSERT(262, ((J2DTextBox*)(mpTm_c[i]->getPanePtr()))->getStringAllocByte() > strlen(mpText)); if (i == 0) { - strcpy(((J2DTextBox*)mpTm_c[i]->getPanePtr())->getStringPtr(), mpText); + SAFE_STRCPY(((J2DTextBox*)mpTm_c[i]->getPanePtr())->getStringPtr(), mpText); } else { - strcpy(((J2DTextBox*)mpTm_c[i]->getPanePtr())->getStringPtr(), i_stringB); + SAFE_STRCPY(((J2DTextBox*)mpTm_c[i]->getPanePtr())->getStringPtr(), i_stringB); } } } } -void dMsgScrnBase_c::setRubyString(char* mpText) { +void dMsgScrnBase_c::setRubyString(char DUSK_CONST* mpText) { for (int i = 0; i < 3; i++) { if (mpTmr_c[i] != NULL) { JUT_ASSERT(288, ((J2DTextBox*)(mpTmr_c[i]->getPanePtr()))->getStringAllocByte() > strlen(mpText)); - strcpy(((J2DTextBox*)mpTmr_c[i]->getPanePtr())->getStringPtr(), mpText); + SAFE_STRCPY(((J2DTextBox*)mpTmr_c[i]->getPanePtr())->getStringPtr(), mpText); } } } diff --git a/src/d/d_msg_scrn_explain.cpp b/src/d/d_msg_scrn_explain.cpp index 945f75e927..29a88590ee 100644 --- a/src/d/d_msg_scrn_explain.cpp +++ b/src/d/d_msg_scrn_explain.cpp @@ -317,7 +317,7 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) { } char string_buf[STR_BUF_LEN]; - strcpy(string_buf, ((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr()); + SAFE_STRCPY(string_buf, ((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr()); mpTxScreen->draw(0.0f, 0.0f, (J2DGrafContext*)i_graf); #if VERSION == VERSION_GCN_JPN @@ -327,7 +327,7 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) { #endif mpString_c->drawOutFont((J2DTextBox*)mpTm_c[0]->getPanePtr(), -1.0f); - strcpy(((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr(), string_buf); + SAFE_STRCPY(((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr(), string_buf); if (mpSelect_c != NULL && (field_0x64 == 1 || field_0x64 == 2)) { // the magic numbers here are relative to the framebuffer size, but were likely @@ -370,11 +370,11 @@ void dMsgScrnExplain_c::open_request_proc() { bool rt = dMsgObject_getString(mOpenMsgId, tbox, rubyTbox, mDoExt_getMesgFont(), mpOutFont, text, ruby, textShadow, &field_0x5c); if (rt) { - strcpy(((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr(), text); - strcpy(((J2DTextBox*)mpTm_c[1]->getPanePtr())->getStringPtr(), textShadow); + SAFE_STRCPY(((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr(), text); + SAFE_STRCPY(((J2DTextBox*)mpTm_c[1]->getPanePtr())->getStringPtr(), textShadow); for (int i = 0; i < 2; i++) { if (mpTmr_c[i] != NULL) { - strcpy(((J2DTextBox*)mpTmr_c[i]->getPanePtr())->getStringPtr(), ruby); + SAFE_STRCPY(((J2DTextBox*)mpTmr_c[i]->getPanePtr())->getStringPtr(), ruby); } } @@ -483,12 +483,12 @@ void dMsgScrnExplain_c::move_select_init() { "\x1B" "CR[%d]", (int)var_f28); - strcat(string_buf_yes, msg_buf_yes); + SAFE_STRCAT(string_buf_yes, msg_buf_yes); snprintf(string_buf_no, 20, "\x1B" "CR[%d]", (int)var_f27); - strcat(string_buf_no, msg_buf_no); + SAFE_STRCAT(string_buf_no, msg_buf_no); mpSelect_c->setString("", string_buf_yes, string_buf_no); mpSelect_c->setRubyString("", "", ""); @@ -643,6 +643,10 @@ f32 dMsgScrnExplain_c::getAlphaRatio() { bool dMsgScrnExplain_c::checkTriggerA() { if (mDoCPd_c::getTrigA(PAD_1)) { return true; +#if TARGET_PC + } else if (mpSelect_c != NULL && mpSelect_c->consumePointerClick()) { + return true; +#endif } else { return false; } diff --git a/src/d/d_msg_scrn_item.cpp b/src/d/d_msg_scrn_item.cpp index 672700682d..26a741e320 100644 --- a/src/d/d_msg_scrn_item.cpp +++ b/src/d/d_msg_scrn_item.cpp @@ -504,11 +504,11 @@ void dMsgScrnItem_c::dotAnimeMove() { mpArrow_c->dotAnimeMove(); } -void dMsgScrnItem_c::setSelectString(char* param_0, char* param_1, char* param_2) { +void dMsgScrnItem_c::setSelectString(char DUSK_CONST* param_0, char DUSK_CONST* param_1, char DUSK_CONST* param_2) { mpSelect_c->setString(param_0, param_1, param_2); } -void dMsgScrnItem_c::setSelectRubyString(char* param_0, char* param_1, char* param_2) { +void dMsgScrnItem_c::setSelectRubyString(char DUSK_CONST* param_0, char DUSK_CONST* param_1, char DUSK_CONST* param_2) { mpSelect_c->setRubyString(param_0, param_1, param_2); } diff --git a/src/d/d_msg_scrn_talk.cpp b/src/d/d_msg_scrn_talk.cpp index ace5abd3bb..5cf1b184da 100644 --- a/src/d/d_msg_scrn_talk.cpp +++ b/src/d/d_msg_scrn_talk.cpp @@ -383,13 +383,13 @@ void dMsgScrnTalk_c::dotAnimeMove() { mpArrow_c->dotAnimeMove(); } -void dMsgScrnTalk_c::setSelectString(char* param_0, char* param_1, char* param_2) { +void dMsgScrnTalk_c::setSelectString(char DUSK_CONST* param_0, char DUSK_CONST* param_1, char DUSK_CONST* param_2) { if (mpSelect_c != NULL) { mpSelect_c->setString(param_0, param_1, param_2); } } -void dMsgScrnTalk_c::setSelectRubyString(char* param_0, char* param_1, char* param_2) { +void dMsgScrnTalk_c::setSelectRubyString(char DUSK_CONST* param_0, char DUSK_CONST* param_1, char DUSK_CONST* param_2) { if (mpSelect_c != NULL) { mpSelect_c->setRubyString(param_0, param_1, param_2); } diff --git a/src/d/d_msg_scrn_tree.cpp b/src/d/d_msg_scrn_tree.cpp index d17ced9bd8..899a8f449a 100644 --- a/src/d/d_msg_scrn_tree.cpp +++ b/src/d/d_msg_scrn_tree.cpp @@ -188,6 +188,14 @@ void dMsgScrnTree_c::exec() { fukiAlpha(1.0f); } mpPmP_c->scale(g_MsgObject_HIO_c.mBoxWoodScaleX, g_MsgObject_HIO_c.mBoxWoodScaleY); + +#if TARGET_PC + const f32 hudScale = mDoGph_gInf_c::hudAspectScaleUp; + if (hudScale > 1.0f) { + field_0xc4->getPanePtr()->setBasePosition(J2DBasePosition_4); + field_0xc4->getPanePtr()->scale(hudScale, 1.0f); + } +#endif } void dMsgScrnTree_c::draw() { diff --git a/src/d/d_msg_string_base.cpp b/src/d/d_msg_string_base.cpp index 7346047661..003375d6b4 100644 --- a/src/d/d_msg_string_base.cpp +++ b/src/d/d_msg_string_base.cpp @@ -126,7 +126,7 @@ u8 dMsgStringBase_c::getPageMax(int param_0) { return pageMax; } -f32 dMsgStringBase_c::getMessageLocal(u32 param_1, char* param_2) { +f32 dMsgStringBase_c::getMessageLocal(u32 param_1, TEXT_SPAN param_2) { if (dMeter2Info_getMsgResource() != NULL) { if (param_1 > 5000) { if (field_0x1c != dMeter2Info_getStageMsgResource()) { @@ -146,7 +146,7 @@ f32 dMsgStringBase_c::getMessageLocal(u32 param_1, char* param_2) { mpCtrl->render(); mpCtrl->reset(); mpCtrl->resetResourceCache(); - strcpy(param_2, mpRenProc->getString()); + SAFE_STRCPY(param_2, mpRenProc->getString()); return 0.0f; } @@ -165,7 +165,7 @@ f32 dMsgStringBase_c::getStringPage(u32 param_0, u8 param_1, u8 param_2, J2DText return getStringPageLocal(param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7); } -f32 dMsgStringBase_c::getMessage(u32 param_0, char* param_1) { +f32 dMsgStringBase_c::getMessage(u32 param_0, TEXT_SPAN param_1) { return getMessageLocal(param_0, param_1); } diff --git a/src/d/d_msg_unit.cpp b/src/d/d_msg_unit.cpp index 7bbe8b3d70..130b5da906 100644 --- a/src/d/d_msg_unit.cpp +++ b/src/d/d_msg_unit.cpp @@ -42,21 +42,21 @@ dMsgUnit_c::dMsgUnit_c() {} dMsgUnit_c::~dMsgUnit_c() {} #if REGION_JPN -void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { +void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) { *o_buffer = 0; bool stack9 = false; bool stack8 = false; int value = i_value; if (i_type == 0x10000) { - sprintf(o_buffer, "%d", i_value); + SAFE_SPRINTF(o_buffer, "%d", i_value); return; } if (i_type == 0x10001) { int tens_digit = i_value / 10; int ones_digit = i_value % 10; - sprintf(o_buffer, "%d-%d", tens_digit, ones_digit); + SAFE_SPRINTF(o_buffer, "%d-%d", tens_digit, ones_digit); return; } @@ -108,7 +108,7 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { } if (i_type == 9 && param_4 == true) { - sprintf(o_buffer, "%d", i_value); + SAFE_SPRINTF(o_buffer, "%d", i_value); stack8 = true; } @@ -170,9 +170,9 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { int uVar5Len = strlen(uVar5); if (uVar5Len == 0) { if (stack8) { - strcat(o_buffer, value2); + SAFE_STRCAT(o_buffer, value2); } else { - sprintf(o_buffer, "%d%s", i_value, value2); + SAFE_SPRINTF(o_buffer, "%d%s", i_value, value2); } } else { char unkCharArr[7]; @@ -185,11 +185,11 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { unkCharArr[6] = 0; if (stack8) { - strcat(o_buffer, unkCharArr); - strcat(o_buffer, uVar5); - strcat(o_buffer, value2); + SAFE_STRCAT(o_buffer, unkCharArr); + SAFE_STRCAT(o_buffer, uVar5); + SAFE_STRCAT(o_buffer, value2); } else { - sprintf(o_buffer, "%d%s%s%s", i_value, unkCharArr, uVar5, value2); + SAFE_SPRINTF(o_buffer, "%d%s%s%s", i_value, unkCharArr, uVar5, value2); } } } @@ -197,17 +197,17 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { if (i_type == 3 && param_4 == true) { char buffer[20]; setTag(4, 0, buffer, false); - strcat(o_buffer, buffer); + SAFE_STRCAT(o_buffer, buffer); } if (i_type == 4 && param_4 == true) { char buffer[20]; setTag(5, value, buffer, false); - strcat(o_buffer, buffer); + SAFE_STRCAT(o_buffer, buffer); } } #else -void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { +void dMsgUnit_c::setTag(int i_type, int i_value, TEXT_SPAN o_buffer, bool param_4) { *o_buffer = 0; bool stack9 = false; bool stack8 = false; @@ -218,14 +218,14 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { int minutes; // sp34 if (i_type == 0x10000) { - sprintf(o_buffer, "%d", i_value); + SAFE_SPRINTF(o_buffer, "%d", i_value); return; } if (i_type == 0x10001) { tens_digit = i_value / 10; ones_digit = i_value % 10; - sprintf(o_buffer, "%d-%d", tens_digit, ones_digit); + SAFE_SPRINTF(o_buffer, "%d-%d", tens_digit, ones_digit); return; } @@ -238,7 +238,7 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { seconds = 59; } if (minutes != 0 || seconds != 0) { - sprintf(o_buffer, "%d:%02d", minutes, seconds); + SAFE_SPRINTF(o_buffer, "%d:%02d", minutes, seconds); } return; @@ -254,11 +254,11 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { iVar8b = ((s32)(1000000.0f * dayTime) % 250000) / 1000000.0f; f32 iVar9 = 60.0f * (iVar8b / 0.25f); - sprintf(o_buffer, "%d:%02d", (s32)hour, (s32)minute); + SAFE_SPRINTF(o_buffer, "%d:%02d", (s32)hour, (s32)minute); } else { if (i_type == 9 && param_4 == true) { int value = i_value; - sprintf(o_buffer, "%d", value); + SAFE_SPRINTF(o_buffer, "%d", value); stack8 = true; } @@ -359,24 +359,24 @@ void dMsgUnit_c::setTag(int i_type, int i_value, char* o_buffer, bool param_4) { } if (strcmp(uVar5, "") == 0) { - sprintf(o_buffer, "%d%s", i_value, uVar5); + SAFE_SPRINTF(o_buffer, "%d%s", i_value, uVar5); } else { - sprintf(o_buffer, "%d %s", i_value, uVar5); + SAFE_SPRINTF(o_buffer, "%d %s", i_value, uVar5); } } if (i_type == 3 && param_4 == true) { char buffer[20]; setTag(4, 0, buffer, false); - strcat(o_buffer, buffer); + SAFE_STRCAT(o_buffer, buffer); } if (i_type == 4 && param_4 == true) { char buffer[20]; setTag(5, param_2b, buffer, false); - strcat(o_buffer, buffer); + SAFE_STRCAT(o_buffer, buffer); } } } #endif -dMsgUnit_c g_msg_unit; +DUSK_GAME_DATA dMsgUnit_c g_msg_unit; diff --git a/src/d/d_name.cpp b/src/d/d_name.cpp index 09917fa804..50d861d1b9 100644 --- a/src/d/d_name.cpp +++ b/src/d/d_name.cpp @@ -965,7 +965,7 @@ void dName_c::setNameText() { #if REGION_JPN if (mChrInfo[i].mMojiSet == 2) { #endif - sprintf(mNameText[i], + SAFE_SPRINTF(mNameText[i], "\x1b" "CD\x1b" "CR\x1b" @@ -976,7 +976,7 @@ void dName_c::setNameText() { ); #if REGION_JPN } else { - sprintf(mNameText[i], + SAFE_SPRINTF(mNameText[i], "\x1b" "CD\x1b" "CR\x1b" @@ -1387,7 +1387,7 @@ void dName_c::mojiListChange() { char buf[74]; for (int i = 0; i < 65; i++) { - strcpy(buf, "\x1B" + SAFE_STRCPY(buf, "\x1B" "CD" "\x1B" "CR" @@ -1395,15 +1395,15 @@ void dName_c::mojiListChange() { "CC[000000]" "\x1B" "GM[0]"); - strcat(buf, mojiSet[i]); - strcat(buf, "\x1B" + SAFE_STRCAT(buf, mojiSet[i]); + SAFE_STRCAT(buf, "\x1B" "HM" "\x1B" "CC[ffffff]" "\x1B" "GM[0]"); - strcat(buf, mojiSet[i]); - strcpy(mMojiText[i], buf); + SAFE_STRCAT(buf, mojiSet[i]); + SAFE_STRCPY(mMojiText[i], buf); } #if TARGET_PC || REGION_PAL || REGION_JPN @@ -1487,51 +1487,86 @@ void dName_c::selectCursorPosSet(int row) { #if TARGET_PC void dName_c::nameWide() { - //Resize Select Icon - #if TARGET_PC - if (mSelIcon) { - mSelIcon->refreshAspectScale(); - } - #endif - - // List of Characters Box - static u64 l_tagName[65] = { - MULTI_CHAR('m_00_0'), MULTI_CHAR('m_00_1'), MULTI_CHAR('m_00_2'), MULTI_CHAR('m_00_3'), MULTI_CHAR('m_00_4'), MULTI_CHAR('m_01_0'), MULTI_CHAR('m_01_1'), MULTI_CHAR('m_01_2'), MULTI_CHAR('m_01_3'), - MULTI_CHAR('m_01_4'), MULTI_CHAR('m_02_0'), MULTI_CHAR('m_02_1'), MULTI_CHAR('m_02_2'), MULTI_CHAR('m_02_3'), MULTI_CHAR('m_02_4'), MULTI_CHAR('m03_0'), MULTI_CHAR('m03_1'), MULTI_CHAR('m03_2'), - MULTI_CHAR('m03_3'), MULTI_CHAR('m03_4'), MULTI_CHAR('m_04_0'), MULTI_CHAR('m_04_1'), MULTI_CHAR('m_04_2'), MULTI_CHAR('m_04_3'), MULTI_CHAR('m_04_4'), MULTI_CHAR('m_05_0'), MULTI_CHAR('m_05_1'), - MULTI_CHAR('m_05_2'), MULTI_CHAR('m_05_3'), MULTI_CHAR('m_05_4'), MULTI_CHAR('m_06_0'), MULTI_CHAR('m_06_1'), MULTI_CHAR('m_06_2'), MULTI_CHAR('m_06_3'), MULTI_CHAR('m_06_4'), MULTI_CHAR('m_07_0'), - MULTI_CHAR('m_07_1'), MULTI_CHAR('m_07_2'), MULTI_CHAR('m_07_3'), MULTI_CHAR('m_07_4'), MULTI_CHAR('m_08_0'), MULTI_CHAR('m_08_1'), MULTI_CHAR('m_08_2'), MULTI_CHAR('m_08_3'), MULTI_CHAR('m_08_4'), - MULTI_CHAR('m_09_0'), MULTI_CHAR('m_09_1'), MULTI_CHAR('m_09_2'), MULTI_CHAR('m_09_3'), MULTI_CHAR('m_09_4'), MULTI_CHAR('m_10_0'), MULTI_CHAR('m_10_1'), MULTI_CHAR('m_10_2'), MULTI_CHAR('m_10_3'), - MULTI_CHAR('m_10_4'), MULTI_CHAR('m_11_0'), MULTI_CHAR('m_11_1'), MULTI_CHAR('m_11_2'), MULTI_CHAR('m_11_3'), MULTI_CHAR('m_11_4'), MULTI_CHAR('m12_0'), MULTI_CHAR('m12_1'), MULTI_CHAR('m12_2'), - MULTI_CHAR('m12_3'), MULTI_CHAR('m12_4'), - }; - - for (u32 i = 0; i < 65; i++) { - nameIn.NameInScr->search(l_tagName[i])->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + static bool cachedPanes = false; + // Get pre-scale values for each pane + if (!cachedPanes) { + for (PaneCache& entry : l_tagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + if (!entry.cached) { + entry.origTransX = pane->getTranslateX(); + entry.origTransY = pane->getTranslateY(); + entry.cached = true; + } + } + for (PaneCache& entry : l_nameTagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + if (!entry.cached) { + entry.origTransX = pane->getTranslateX(); + entry.origTransY = pane->getTranslateY(); + entry.cached = true; + } + } + for (PaneCache& entry : l_nameCurTagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + if (!entry.cached) { + entry.origTransX = pane->getTranslateX(); + entry.origTransY = pane->getTranslateY(); + entry.cached = true; + } + } + cachedPanes = true; } - // "END" Text - nameIn.NameInScr->search(MULTI_CHAR('p_end_2'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - nameIn.NameInScr->search(MULTI_CHAR('p_end_1'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - nameIn.NameInScr->search(MULTI_CHAR('p_end_0'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); - - // Letters being typed - static u64 l_nameTagName[8] = { - MULTI_CHAR('name_00'), MULTI_CHAR('name_01'), MULTI_CHAR('name_02'), MULTI_CHAR('name_03'), MULTI_CHAR('name_04'), MULTI_CHAR('name_05'), MULTI_CHAR('name_06'), MULTI_CHAR('name_07'), - }; - - for (u32 i = 0; i < 8; i++) { - nameIn.NameInScr->search(l_nameTagName[i])->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + // Reset all panes + nameIn.NameInScr->scale(1.0f, 1.0f); + nameIn.NameInScr->translate(0.0f, 0.0f); + for (PaneCache& entry : l_tagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + pane->setBasePosition(J2DBasePosition_4); + pane->scale(1.0f, 1.0f); + pane->translate(entry.origTransX, entry.origTransY); + } + for (PaneCache& entry : l_nameTagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + pane->setBasePosition(J2DBasePosition_4); + pane->scale(1.0f, 1.0f); + pane->translate(entry.origTransX, entry.origTransY); + } + for (PaneCache& entry : l_nameCurTagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + pane->setBasePosition(J2DBasePosition_4); + pane->scale(1.0f, 1.0f); + pane->translate(entry.origTransX, entry.origTransY); } - // Underscores when typing below letters - static u64 l_nameCurTagName[8] = { - MULTI_CHAR('s__n_00'), MULTI_CHAR('s__n_01'), MULTI_CHAR('s__n_02'), MULTI_CHAR('s__n_03'), MULTI_CHAR('s__n_04'), MULTI_CHAR('s__n_05'), MULTI_CHAR('s__n_06'), MULTI_CHAR('s__n_07'), - }; - - for (u32 i = 0; i < 8; i++) { - nameIn.NameInScr->search(l_nameCurTagName[i]) - ->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + switch (dusk::getSettings().game.menuScalingMode) { + case (dusk::MenuScaling::GameCube): + // Selection Cursor + if (mSelIcon) { + mSelIcon->refreshAspectScale(1.0f); + } + break; + default: // Wii and Dusklight + // List of Characters Box + for (PaneCache& entry : l_tagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + } + // Letters being typed + for (PaneCache& entry : l_nameTagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + } + // Underscores when typing below letters + for (PaneCache& entry : l_nameCurTagName) { + J2DPane* pane = nameIn.NameInScr->search(entry.tag); + pane->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f); + } + // Selection Cursor + if (mSelIcon) { + mSelIcon->refreshAspectScale(mDoGph_gInf_c::hudAspectScaleUp); + } + break; } } #endif diff --git a/src/d/d_ovlp_fade.cpp b/src/d/d_ovlp_fade.cpp index 43732cf4be..a378f982a0 100644 --- a/src/d/d_ovlp_fade.cpp +++ b/src/d/d_ovlp_fade.cpp @@ -132,7 +132,7 @@ static leafdraw_method_class l_dOvlpFd_Method = { (process_method_func)dOvlpFd_Draw, }; -overlap_process_profile_definition g_profile_OVERLAP0 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP0 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -146,7 +146,7 @@ overlap_process_profile_definition g_profile_OVERLAP0 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP1 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP1 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -160,7 +160,7 @@ overlap_process_profile_definition g_profile_OVERLAP1 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP6 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP6 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -174,7 +174,7 @@ overlap_process_profile_definition g_profile_OVERLAP6 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP7 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP7 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -188,7 +188,7 @@ overlap_process_profile_definition g_profile_OVERLAP7 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP8 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP8 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -202,7 +202,7 @@ overlap_process_profile_definition g_profile_OVERLAP8 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP9 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP9 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -216,7 +216,7 @@ overlap_process_profile_definition g_profile_OVERLAP9 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP10 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP10 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, @@ -230,7 +230,7 @@ overlap_process_profile_definition g_profile_OVERLAP10 = { /* Fade SubMtd */ &l_dOvlpFd_Method, }; -overlap_process_profile_definition g_profile_OVERLAP11 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP11 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_ovlp_fade2.cpp b/src/d/d_ovlp_fade2.cpp index c6c6cc735e..64a63a298c 100644 --- a/src/d/d_ovlp_fade2.cpp +++ b/src/d/d_ovlp_fade2.cpp @@ -245,7 +245,7 @@ static leafdraw_method_class l_dOvlpFd2_Method = { (process_method_func)dOvlpFd2_Draw, }; -overlap_process_profile_definition g_profile_OVERLAP2 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP2 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 2, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_ovlp_fade3.cpp b/src/d/d_ovlp_fade3.cpp index 0b3c03db2b..60bea1337f 100644 --- a/src/d/d_ovlp_fade3.cpp +++ b/src/d/d_ovlp_fade3.cpp @@ -249,7 +249,7 @@ static leafdraw_method_class l_dOvlpFd3_Method = { (process_method_func)dOvlpFd3_Draw, }; -overlap_process_profile_definition g_profile_OVERLAP3 = { +DUSK_PROFILE overlap_process_profile_definition DUSK_CONST g_profile_OVERLAP3 = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_particle.cpp b/src/d/d_particle.cpp index 9b89afc7b1..e33de068db 100644 --- a/src/d/d_particle.cpp +++ b/src/d/d_particle.cpp @@ -26,8 +26,12 @@ #include "m_Do/m_Do_lib.h" #include "tracy/Tracy.hpp" +#if TARGET_PC +#include "dusk/frame_interpolation.h" +#endif + #ifndef __MWERKS__ -#include "dusk/math.h" +#include "helpers/math.h" #endif #if DEBUG @@ -35,7 +39,7 @@ #endif extern "C" { - extern dPa_particleTracePcallBack_c JPTracePCB4; + DUSK_GAME_EXTERN dPa_particleTracePcallBack_c JPTracePCB4; } void dPa_cleanupGX() { @@ -125,11 +129,11 @@ u32 dummy(JPABaseEmitter* i_emitter) { return i_emitter->getAge(); } -dPa_modelEcallBack dPa_modelEcallBack::mEcallback; +DUSK_GAME_DATA dPa_modelEcallBack dPa_modelEcallBack::mEcallback; -dPa_modelPcallBack dPa_modelEcallBack::mPcallback; +DUSK_GAME_DATA dPa_modelPcallBack dPa_modelEcallBack::mPcallback; -dPa_modelEcallBack::model_c* dPa_modelEcallBack::mModel; +DUSK_GAME_DATA dPa_modelEcallBack::model_c* dPa_modelEcallBack::mModel; #if DEBUG u8 dPa_modelEcallBack::mNum; @@ -1120,7 +1124,7 @@ void dPa_control_c::level_c::cutTable(dPa_control_c::level_c::emitter_c* i_emitt i_emitter->cleanup(); } -dPa_selectTexEcallBack dPa_control_c::mTsubo[] = { +DUSK_GAME_DATA dPa_selectTexEcallBack dPa_control_c::mTsubo[] = { dPa_selectTexEcallBack(0), dPa_selectTexEcallBack(1), dPa_selectTexEcallBack(2), @@ -1137,35 +1141,35 @@ static GXColor l_lifeBallColor[3] = { {0xEB, 0xD7, 0x2F, 0xFF}, }; -dPa_setColorEcallBack dPa_control_c::mLifeBall[3] = { +DUSK_GAME_DATA dPa_setColorEcallBack dPa_control_c::mLifeBall[3] = { dPa_setColorEcallBack(l_lifeBallColor[0]), dPa_setColorEcallBack(l_lifeBallColor[1]), dPa_setColorEcallBack(l_lifeBallColor[2]), }; -JPAEmitterManager* dPa_control_c::mEmitterMng; +DUSK_GAME_DATA JPAEmitterManager* dPa_control_c::mEmitterMng; -dPa_wbPcallBack_c dPa_control_c::mWaterBubblePcallBack; +DUSK_GAME_DATA dPa_wbPcallBack_c dPa_control_c::mWaterBubblePcallBack; -dPa_fsenthPcallBack dPa_control_c::mFsenthPcallBack; +DUSK_GAME_DATA dPa_fsenthPcallBack dPa_control_c::mFsenthPcallBack; -dPa_light8EcallBack dPa_control_c::mLight8EcallBack; +DUSK_GAME_DATA dPa_light8EcallBack dPa_control_c::mLight8EcallBack; -dPa_light8PcallBack dPa_control_c::mLight8PcallBack; +DUSK_GAME_DATA dPa_light8PcallBack dPa_control_c::mLight8PcallBack; -dPa_gen_b_light8EcallBack dPa_control_c::m_b_Light8EcallBack; +DUSK_GAME_DATA dPa_gen_b_light8EcallBack dPa_control_c::m_b_Light8EcallBack; -dPa_gen_b_light8PcallBack dPa_control_c::m_b_Light8PcallBack; +DUSK_GAME_DATA dPa_gen_b_light8PcallBack dPa_control_c::m_b_Light8PcallBack; -dPa_gen_d_light8EcallBack dPa_control_c::m_d_Light8EcallBack; +DUSK_GAME_DATA dPa_gen_d_light8EcallBack dPa_control_c::m_d_Light8EcallBack; -dPa_gen_d_light8PcallBack dPa_control_c::m_d_Light8PcallBack; +DUSK_GAME_DATA dPa_gen_d_light8PcallBack dPa_control_c::m_d_Light8PcallBack; -u8 dPa_control_c::mStatus; +DUSK_GAME_DATA u8 dPa_control_c::mStatus; -Mtx dPa_control_c::mWindViewMatrix; +DUSK_GAME_DATA Mtx dPa_control_c::mWindViewMatrix; -dPa_particleTracePcallBack_c dPa_control_c::mParticleTracePCB; +DUSK_GAME_DATA dPa_particleTracePcallBack_c dPa_control_c::mParticleTracePCB; dPa_control_c::dPa_control_c() { #if DEBUG @@ -1263,7 +1267,7 @@ bool dPa_control_c::readScene(u8 param_0, mDoDvdThd_toMainRam_c** param_1) { JUT_ASSERT(2647, !mSceneCount++); field_0x18 = param_0; static char jpcName[32]; - sprintf(jpcName, "/res/Particle/Pscene%03d.jpc", param_0); + SAFE_SPRINTF(jpcName, "/res/Particle/Pscene%03d.jpc", param_0); *param_1 = mDoDvdThd_toMainRam_c::create(jpcName, 0, m_resHeap); return 1; } @@ -1359,6 +1363,7 @@ void dPa_control_c::calcMenu() { } void dPa_control_c::draw(JPADrawInfo* param_0, u8 param_1) { + ZoneScoped; if (mEmitterMng != NULL) { j3dSys.reinitGX(); dKy_setLight_again(); @@ -1957,6 +1962,7 @@ void dPa_gen_d_light8PcallBack::execute(JPABaseEmitter* i_emitter, JPABasePartic } void dPa_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) { + ZoneScoped; Mtx local_60; Mtx auStack_90; Mtx auStack_c0; @@ -2084,6 +2090,7 @@ void dPa_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2 } void dPa_gen_b_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) { + ZoneScoped; Mtx local_80; JGeometry::TVec3 local_8c; JGeometry::TVec3 aTStack_98; @@ -2172,6 +2179,7 @@ void dPa_gen_b_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* p } void dPa_gen_d_light8PcallBack::draw(JPABaseEmitter* param_1, JPABaseParticle* param_2) { + ZoneScoped; Mtx local_60; Mtx auStack_90; Mtx auStack_c0; diff --git a/src/d/d_particle_copoly.cpp b/src/d/d_particle_copoly.cpp index f14e90e488..a6ce6e573e 100644 --- a/src/d/d_particle_copoly.cpp +++ b/src/d/d_particle_copoly.cpp @@ -214,24 +214,24 @@ void dPaPoF_c::clearFourAllID() { clearTwoAllID(); } -const dPaPoT_c::effTypeFunc dPaPoT_c::m_typeTwoData[] = { +DUSK_GAME_DATA const dPaPoT_c::effTypeFunc dPaPoT_c::m_typeTwoData[] = { &dPaPoT_c::getCenterEffType, &dPaPoT_c::getLeftEffType, &dPaPoT_c::getRightEffType, }; -const dPaPoT_c::emitterFunc dPaPoT_c::m_emitterTwoData[] = { +DUSK_GAME_DATA const dPaPoT_c::emitterFunc dPaPoT_c::m_emitterTwoData[] = { &dPaPoT_c::getCenterEmitter, &dPaPoT_c::getLeftEmitter, &dPaPoT_c::getRightEmitter, }; -const dPaPoF_c::effTypeFunc dPaPoF_c::m_typeFourData[] = { +DUSK_GAME_DATA const dPaPoF_c::effTypeFunc dPaPoF_c::m_typeFourData[] = { &dPaPoF_c::getCenterEffType, &dPaPoF_c::getLeftEffType, &dPaPoF_c::getRightEffType, &dPaPoF_c::getBackLeftEffType, &dPaPoF_c::getBackRightEffType, }; -const dPaPoF_c::emitterFunc dPaPoF_c::m_emitterFourData[] = { +DUSK_GAME_DATA const dPaPoF_c::emitterFunc dPaPoF_c::m_emitterFourData[] = { &dPaPoF_c::getCenterEmitter, &dPaPoF_c::getLeftEmitter, &dPaPoF_c::getRightEmitter, &dPaPoF_c::getBackLeftEmitter, &dPaPoF_c::getBackRightEmitter, }; diff --git a/src/d/d_particle_name.cpp b/src/d/d_particle_name.cpp index 5cf1fdfa32..b9a3cd9ea0 100644 --- a/src/d/d_particle_name.cpp +++ b/src/d/d_particle_name.cpp @@ -2,7 +2,7 @@ #include "d/d_particle_name.h" -u16 dPa_name::j_o_id[5] = { +DUSK_GAME_DATA u16 dPa_name::j_o_id[5] = { ID_ZI_J_O_DIGTGA_A, ID_ZI_J_O_DIGTGA_B, ID_ZI_J_O_FIRE_A, @@ -10,7 +10,7 @@ u16 dPa_name::j_o_id[5] = { ID_ZI_J_O_KAGEROU, }; -u16 dPa_name::s_o_id[14] = { +DUSK_GAME_DATA u16 dPa_name::s_o_id[14] = { dPa_RM(ID_ZI_S_O_FIRE2_A), dPa_RM(ID_ZI_S_O_FIRE2_B), dPa_RM(ID_ZI_S_O_KAGEROU2), @@ -27,7 +27,7 @@ u16 dPa_name::s_o_id[14] = { dPa_RM(ID_ZI_S_O_WAKIMIZU_C), }; -char* dPa_name::getName(u32 i_id) { +DUSK_CONST char* dPa_name::getName(u32 i_id) { if ((i_id & 0xFFFF1FFF) >= ID_PARTICLE_MAX) { return NULL; } @@ -35,7 +35,7 @@ char* dPa_name::getName(u32 i_id) { return jpaName[i_id]; } -char* dPa_name::jpaName[] = { +DUSK_GAME_DATA DUSK_CONST char* dPa_name::jpaName[] = { "AK_JN_M_breakFaceRock00.jpa", "AK_JN_M_breakGreatRock00.jpa", "AK_JN_M_breakLittleRock00.jpa", diff --git a/src/d/d_resorce.cpp b/src/d/d_resorce.cpp index bb982c4afb..b224343983 100644 --- a/src/d/d_resorce.cpp +++ b/src/d/d_resorce.cpp @@ -581,7 +581,7 @@ int dRes_info_c::setRes(JKRArchive* i_archive, JKRHeap* i_heap) { return rt >> 0x1F; } -bool data_8074C6C0_debug; +DUSK_GAME_DATA bool data_8074C6C0_debug; int dRes_info_c::setRes() { if (mArchive == NULL) { diff --git a/src/d/d_s_logo.cpp b/src/d/d_s_logo.cpp index 7a58a4cf77..69087a78c2 100644 --- a/src/d/d_s_logo.cpp +++ b/src/d/d_s_logo.cpp @@ -23,8 +23,12 @@ #include "m_Do/m_Do_main.h" #include "JSystem/JUtility/JUTConsole.h" +#ifdef TARGET_PC #include "dusk/logging.h" #include "dusk/version.hpp" +#include "dusk/main.h" +#include "m_Do/m_Do_MemCard.h" +#endif #if !PLATFORM_GCN #include @@ -757,7 +761,63 @@ void dScnLogo_c::nextSceneChange() { if (!mDoRst::isReset()) { if (!isOpeningCut()) { - dComIfG_changeOpeningScene(this, fpcNm_OPENING_SCENE_e); +#ifdef TARGET_PC + // If we are requesting a save from the command line, load it here and set the scene to play instead of loading the LOGO SCENE + if (dusk::SaveRequested >= 1 && dusk::SaveRequested <= 3) { + u8 buf[SAVEDATA_SIZE * 3]; + mDoMemCd_Load(); + uint8_t status; + do { + status = mDoMemCd_LoadSync(buf, sizeof(buf), 0); + // Wait until the card is loaded + } while (status == 0); + + if (status == 1) { + dComIfGs_setCardToMemory(buf, dusk::SaveRequested - 1); + } else { + dComIfGs_init(); + } + + dComIfGs_setNoFile(dusk::SaveRequested); + dComIfGs_setDataNum(dusk::SaveRequested-1); + + dComIfGs_gameStart(); + + fopScnM_ChangeReq(this, fpcNm_PLAY_SCENE_e, 0, 30); + + dKy_clear_game_init(); + dComIfGs_resetDan(); + dComIfGs_setRestartRoomParam(0); + + DuskLog.info("Loaded Save From Slot {}",dusk::SaveRequested); + dusk::SaveRequested = 0xff; + } else if (dusk::SaveRequested == 0xff) { + // This indicates that the save has loaded, but we are waiting for the scene + // manager to change to play + } else if (dusk::StageRequested.set) { + // Do nothing if we need to request a stage to load later in the function + } else{ +#endif + dComIfG_changeOpeningScene(this, fpcNm_OPENING_SCENE_e); +#ifdef TARGET_PC + } + + if (dusk::StageRequested.set) { + // If we aren't loading a save, initialize a blank save file and request the correct scene to load + if (dusk::SaveRequested == 0) { + dComIfGs_init(); + + fopScnM_ChangeReq(this, fpcNm_PLAY_SCENE_e, 0, 30); + dusk::SaveRequested = 0xff; //Skip requesting the scene from above + } + + // Use both to force-set start stage + dComIfGp_setNextStage(dusk::StageRequested.stage.c_str(), dusk::StageRequested.point, dusk::StageRequested.room, dusk::StageRequested.layer); + g_dComIfG_gameInfo.play.mNextStage.getStartStage()->set(dusk::StageRequested.stage.c_str(), dusk::StageRequested.room, dusk::StageRequested.point, dusk::StageRequested.layer); + + dusk::StageRequested.set = false; // Setting the stage should only happen once + } +#endif } else { #if DEBUG fopScnM_ChangeReq(this, fpcNm_MENU_SCENE_e, 0, 30); @@ -1803,7 +1863,7 @@ static scene_method_class l_dScnLogo_Method = { (process_method_func)dScnLogo_Draw, }; -scene_process_profile_definition g_profile_LOGO_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_LOGO_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_s_menu.cpp b/src/d/d_s_menu.cpp index 34f02908bb..40f2105120 100644 --- a/src/d/d_s_menu.cpp +++ b/src/d/d_s_menu.cpp @@ -2004,7 +2004,7 @@ static scene_method_class l_dScnMenu_Method = { (process_method_func)dScnMenu_Draw, }; -scene_process_profile_definition g_profile_MENU_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_MENU_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, @@ -2017,7 +2017,7 @@ scene_process_profile_definition g_profile_MENU_SCENE = { /* Scene SubMtd */ &l_dScnMenu_Method, }; #else -scene_process_profile_definition g_profile_MENU_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_MENU_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_s_name.cpp b/src/d/d_s_name.cpp index 92f5a6c518..d0e33adce4 100644 --- a/src/d/d_s_name.cpp +++ b/src/d/d_s_name.cpp @@ -46,7 +46,7 @@ void dSn_HIO_c::genMessage(JORMContext* mctx) { } #endif -static s32 phase_1(char* i_resName) { +static s32 phase_1(DUSK_CONST char* i_resName) { mDoAud_bgmStart(-1); if (dComIfG_setObjectRes(i_resName, (u8)0, NULL) == 0) { return cPhs_ERROR_e; @@ -55,7 +55,7 @@ static s32 phase_1(char* i_resName) { return cPhs_NEXT_e; } -static s32 phase_2(char* i_resName) { +static s32 phase_2(DUSK_CONST char* i_resName) { int rt = dComIfG_syncObjectRes(i_resName); if (rt < 0) { return cPhs_ERROR_e; @@ -68,13 +68,13 @@ static s32 phase_2(char* i_resName) { } } -static s32 resLoad(request_of_phase_process_class* i_phase, char* i_resName) { +static s32 resLoad(request_of_phase_process_class* i_phase, char DUSK_CONST* i_resName) { static request_of_phase_process_fn l_method[2] = { (request_of_phase_process_fn)phase_1, (request_of_phase_process_fn)phase_2 }; - return dComLbG_PhaseHandler(i_phase, l_method, i_resName); + return dComLbG_PhaseHandler(i_phase, l_method, IF_DUSK((void*)) i_resName); } s32 dScnName_c::create() { @@ -472,7 +472,7 @@ static scene_method_class l_dScnName_Method = { (process_method_func)dScnName_Draw, }; -scene_process_profile_definition g_profile_NAME_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_NAME_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, @@ -486,7 +486,7 @@ scene_process_profile_definition g_profile_NAME_SCENE = { 0, }; -scene_process_profile_definition g_profile_NAMEEX_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_NAMEEX_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index f2e7d5d926..ab82ca1b9b 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -93,9 +93,9 @@ static OSTime resPreLoadTime1; static dScnPly_preLoad_HIO_c g_preLoadHIO; -s8 dScnPly_c::pauseTimer; +DUSK_GAME_DATA s8 dScnPly_c::pauseTimer; -s8 dScnPly_c::nextPauseTimer; +DUSK_GAME_DATA s8 dScnPly_c::nextPauseTimer; #if DEBUG u8 dScnPly_c::debugPause; @@ -163,22 +163,22 @@ void dScnPly_reg_childHIO_c::genMessage(JORMContext* mctx) { char textbuf[8]; for (int i = 0; i < 20; i++) { - sprintf(textbuf, " F(%02d)", i); + SAFE_SPRINTF(textbuf, " F(%02d)", i); mctx->genSlider(textbuf, &mFloatReg[i], -100000.0f, 100000.0f); } for (int i = 20; i < 25; i++) { - sprintf(textbuf, " F(%02d)", i); + SAFE_SPRINTF(textbuf, " F(%02d)", i); mctx->genSlider(textbuf, &mFloatReg[i], 0.0f, 1.0f); } for (int i = 25; i < 30; i++) { - sprintf(textbuf, " F(%02d)", i); + SAFE_SPRINTF(textbuf, " F(%02d)", i); mctx->genSlider(textbuf, &mFloatReg[i], -1.0f, 1.0f); } for (int i = 0; i < 10; i++) { - sprintf(textbuf, " S(%02d)", i); + SAFE_SPRINTF(textbuf, " S(%02d)", i); mctx->genSlider(textbuf, &mShortReg[i], -0x8000, 0x7FFF); } } @@ -1393,9 +1393,9 @@ static int phase_3(dScnPly_c* i_this) { return cPhs_NEXT_e; } -dScnPly_reg_HIO_c g_regHIO; +DUSK_GAME_DATA dScnPly_reg_HIO_c g_regHIO; -dScnPly_env_HIO_c g_envHIO; +DUSK_GAME_DATA dScnPly_env_HIO_c g_envHIO; #if DEBUG dScnPly_preset_HIO_c g_presetHIO; @@ -1636,7 +1636,7 @@ static scene_method_class l_dScnPly_Method = { (process_method_func)dScnPly_Draw, }; -scene_process_profile_definition g_profile_PLAY_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_PLAY_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, @@ -1649,7 +1649,7 @@ scene_process_profile_definition g_profile_PLAY_SCENE = { /* Scene SubMtd */ &l_dScnPly_Method, }; -scene_process_profile_definition g_profile_OPENING_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_OPENING_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_s_room.cpp b/src/d/d_s_room.cpp index 0fcdb58ac0..dd34f09fe2 100644 --- a/src/d/d_s_room.cpp +++ b/src/d/d_s_room.cpp @@ -47,7 +47,7 @@ static int getResetArchiveBank(int i_roomNo, const u8** o_bankIDList) { const u8* pbank = *o_bankIDList; for (int i = 0; i < bankNum; pbank++, i++) { char* arcBank = dStage_roomControl_c::getArcBank(i); - char* name = ""; + DUSK_CONST char* name = ""; int id = *pbank; if (id != 0xFF) { @@ -178,7 +178,7 @@ static int loadDemoArchive(int i_roomNo) { int bank2 = entries[dComIfG_play_c::getLayerNo(i_roomNo)].bank2; JUT_ASSERT(353, 0 <= bank2 && bank2 < 100); - sprintf(dStage_roomControl_c::getDemoArcName(), "Demo%02d_%02d", bank, bank2); + SAFE_SPRINTF(dStage_roomControl_c::getDemoArcName(), "Demo%02d_%02d", bank, bank2); if (!dComIfG_setObjectRes(dStage_roomControl_c::getDemoArcName(), 0, (JKRHeap*)NULL)) { const char* name = dStage_roomControl_c::getDemoArcName(); *dStage_roomControl_c::getDemoArcName() = 0; @@ -511,7 +511,7 @@ static scene_method_class l_dScnRoom_Method = { (process_method_func)dScnRoom_Draw, }; -scene_process_profile_definition g_profile_ROOM_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_ROOM_SCENE = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 0, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_s_title.cpp b/src/d/d_s_title.cpp index 16a29a437e..ec626eca3d 100644 --- a/src/d/d_s_title.cpp +++ b/src/d/d_s_title.cpp @@ -9,7 +9,7 @@ #include "f_op/f_op_scene.h" #include "f_pc/f_pc_leaf.h" -scene_process_profile_definition g_profile_WARNING_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_WARNING_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, @@ -22,7 +22,7 @@ scene_process_profile_definition g_profile_WARNING_SCENE = { /* Scene SubMtd */ NULL, }; -scene_process_profile_definition g_profile_WARNING2_SCENE = { +DUSK_PROFILE scene_process_profile_definition DUSK_CONST g_profile_WARNING2_SCENE = { /* Layer ID */ fpcLy_ROOT_e, /* List ID */ 1, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_save.cpp b/src/d/d_save.cpp index fc1cbc4efe..22729ad43e 100644 --- a/src/d/d_save.cpp +++ b/src/d/d_save.cpp @@ -31,8 +31,8 @@ #include "dusk/settings.h" #include -#include "dusk/string.hpp" -#define strcpy dusk::SafeStringCopy +#include "helpers/string.hpp" +#define strcpy SafeStringCopy #endif static u8 dSv_item_rename(u8 i_itemNo) { @@ -2034,7 +2034,7 @@ void flagFile_c::listenPropertyEvent(const JORPropertyEvent* i_event) { const char* start_stage_name = dComIfGp_getStartStageName(); char filename[64]; - sprintf(filename, "_%02d%02d%02d%02d%02d-%s.zff", time.mon + 1, time.mday, time.hour, time.min, time.sec, start_stage_name); + SAFE_SPRINTF(filename, "_%02d%02d%02d%02d%02d-%s.zff", time.mon + 1, time.mday, time.hour, time.min, time.sec, start_stage_name); OS_REPORT("write to %s\n", filename); JORFile file; @@ -2089,7 +2089,7 @@ const #if PLATFORM_SHIELD s16 #else -u16 +DUSK_GAME_DATA u16 #endif dSv_event_flag_c::saveBitLabels[822] = { UNUSED, TEST_001, TEST_002, TEST_003, TEST_004, F_0001, F_0002, F_0003, F_0004, F_0005, F_0006, @@ -2166,7 +2166,7 @@ dSv_event_flag_c::saveBitLabels[822] = { F_0816, F_0817, F_0818, F_0819, F_0820, KORO2_ALLCLEAR, }; -u16 const dSv_event_tmp_flag_c::tempBitLabels[185] = { +DUSK_GAME_DATA u16 const dSv_event_tmp_flag_c::tempBitLabels[185] = { UNUSED, UNUSED, T_0002, T_0003, T_0004, T_0005, T_0006, T_0007, T_0001, T_0008, T_0009, T_0010, T_0011, T_0012, T_0013, T_0014, T_0015, T_0016, T_0017, T_0018, T_0019, T_0020, T_0021, T_0022, T_0023, T_0024, T_0025, T_0026, T_0027, T_0028, T_0029, T_0030, T_0031, T_0032, TREG_000, diff --git a/src/d/d_save_HIO.cpp b/src/d/d_save_HIO.cpp index 013bc709bd..1f2d2bb212 100644 --- a/src/d/d_save_HIO.cpp +++ b/src/d/d_save_HIO.cpp @@ -186,4 +186,4 @@ void dSvBit_HIO_c::init() { mTransformFlag = field_0x49d = dComIfGs_isEventBit(dSv_event_flag_c::M_077); } -dSvBit_HIO_c g_save_bit_HIO; +DUSK_GAME_DATA dSvBit_HIO_c g_save_bit_HIO; diff --git a/src/d/d_scope.cpp b/src/d/d_scope.cpp index 2f68f534ed..cf58a8a6c2 100644 --- a/src/d/d_scope.cpp +++ b/src/d/d_scope.cpp @@ -10,14 +10,14 @@ #include "JSystem/J2DGraph/J2DOrthoGraph.h" typedef void (dScope_c::*initFunc)(); -initFunc init_process[] = { +DUSK_GAME_DATA initFunc init_process[] = { &dScope_c::open_init, &dScope_c::move_init, &dScope_c::close_init, }; typedef void (dScope_c::*moveFunc)(); -moveFunc move_process[] = { +DUSK_GAME_DATA moveFunc move_process[] = { &dScope_c::open_proc, &dScope_c::move_proc, &dScope_c::close_proc, diff --git a/src/d/d_select_cursor.cpp b/src/d/d_select_cursor.cpp index 0773433b4d..640f8072cd 100644 --- a/src/d/d_select_cursor.cpp +++ b/src/d/d_select_cursor.cpp @@ -20,35 +20,35 @@ dSelect_cursorHIO_c::dSelect_cursorHIO_c() { } dSelect_cursor_c::dSelect_cursor_c(u8 param_0, f32 param_1, JKRArchive* param_2) { - static char* blo_name[4] = { + static DUSK_CONST char* blo_name[4] = { "zelda_select_cursor_4parts.blo", "zelda_store_select_icon.blo", "zelda_map_screen_portal_icon.blo", "zelda_map_screen_batsumark.blo", }; - static char* bck_name[4] = { + static DUSK_CONST char* bck_name[4] = { "", "zelda_store_select_icon.bck", "", "", }; - static char* bpk_name[4] = { + static DUSK_CONST char* bpk_name[4] = { "zelda_select_cursor_4parts.bpk", "zelda_store_select_icon.bpk", "zelda_map_screen_portal_icon.bpk", "zelda_map_screen_batsumark.bpk", }; - static char* btk_name[4] = { + static DUSK_CONST char* btk_name[4] = { "zelda_select_cursor_4parts.btk", "zelda_store_select_icon.btk", "", "", }; - static char* btk2_name[4] = { + static DUSK_CONST char* btk2_name[4] = { "", "zelda_store_select_icon_02.btk", "", @@ -577,7 +577,7 @@ void dSelect_cursor_c::moveCenter(J2DPane* i_pane, f32 i_x, f32 i_y) { } #ifdef TARGET_PC -void dSelect_cursor_c::refreshAspectScale() { - mParam1 = mBaseParam1 * mDoGph_gInf_c::hudAspectScaleUp; +void dSelect_cursor_c::refreshAspectScale(f32 param_0) { + mParam1 = mBaseParam1 * param_0; } #endif diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index f3cdfed17b..a27f0482f8 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -23,7 +23,7 @@ #include #include "dusk/logging.h" -#include "dusk/string.hpp" +#include "helpers/string.hpp" #if TARGET_PC #include #include @@ -157,7 +157,7 @@ void dStage_startStage_c::set(const char* i_Name, s8 i_RoomNo, s16 i_Point, s8 i #if TARGET_PC // UB fix. if (mName != i_Name) { - dusk::SafeStringCopy(mName, i_Name); + SafeStringCopy(mName, i_Name); } #else strcpy(mName, i_Name); @@ -167,7 +167,7 @@ void dStage_startStage_c::set(const char* i_Name, s8 i_RoomNo, s16 i_Point, s8 i mLayer = i_Layer; } -dStage_roomStatus_c dStage_roomControl_c::mStatus[0x40]; +DUSK_GAME_DATA dStage_roomStatus_c dStage_roomControl_c::mStatus[0x40]; void dStage_roomControl_c::init() { mStayNo = -1; @@ -482,7 +482,7 @@ void* dStage_roomControl_c::roomDzs_c::add(u8 i_no, u8 roomNo) { void** dzs = m_dzs + i_no; if (*dzs == NULL) { char dzsName[20]; - sprintf(dzsName, "%s/room%d.dzs", dComIfGp_getStartStageName(), roomNo); + SAFE_SPRINTF(dzsName, "%s/room%d.dzs", dComIfGp_getStartStageName(), roomNo); JUT_ASSERT(1167, strlen(dzsName) <= sizeof(dzsName)); u32 expandSize = @@ -1565,29 +1565,29 @@ const char* dStage_getName2(s16 procName, s8 argument) { return dStage_getName(procName, argument); } -u8 data_8074C568_debug; -u8 data_8074C569_debug; -u8 data_8074C56A_debug; -u8 data_8074C56B_debug; -u8 data_8074C56C_debug; +DUSK_GAME_DATA u8 data_8074C568_debug; +DUSK_GAME_DATA u8 data_8074C569_debug; +DUSK_GAME_DATA u8 data_8074C56A_debug; +DUSK_GAME_DATA u8 data_8074C56B_debug; +DUSK_GAME_DATA u8 data_8074C56C_debug; -fpc_ProcID dStage_roomControl_c::mProcID; +DUSK_GAME_DATA fpc_ProcID dStage_roomControl_c::mProcID; -s8 dStage_roomControl_c::mStayNo; +DUSK_GAME_DATA s8 dStage_roomControl_c::mStayNo; -s8 dStage_roomControl_c::mOldStayNo; +DUSK_GAME_DATA s8 dStage_roomControl_c::mOldStayNo; -s8 dStage_roomControl_c::mNextStayNo; +DUSK_GAME_DATA s8 dStage_roomControl_c::mNextStayNo; -u8 dStage_roomControl_c::m_time_pass; +DUSK_GAME_DATA u8 dStage_roomControl_c::m_time_pass; -u8 dStage_roomControl_c::mNoChangeRoom; +DUSK_GAME_DATA u8 dStage_roomControl_c::mNoChangeRoom; -dStage_roomControl_c::dStage_bankName* dStage_roomControl_c::mArcBankName; +DUSK_GAME_DATA dStage_roomControl_c::dStage_bankName* dStage_roomControl_c::mArcBankName; -dStage_roomControl_c::dStage_bankData* dStage_roomControl_c::mArcBankData; +DUSK_GAME_DATA dStage_roomControl_c::dStage_bankData* dStage_roomControl_c::mArcBankData; -dStage_roomControl_c::roomDzs_c dStage_roomControl_c::m_roomDzs; +DUSK_GAME_DATA dStage_roomControl_c::roomDzs_c dStage_roomControl_c::m_roomDzs; #if DEBUG u8 dStage_roomControl_c::mNoArcBank; #endif @@ -2396,7 +2396,7 @@ static void readMult(dStage_dt_c* i_stage, dStage_Multi_c* multi, bool useOldRes if (dzs == NULL) { char dzsName[11]; - sprintf(dzsName, "room%d.dzs", info->mRoomNo); + SAFE_SPRINTF(dzsName, "room%d.dzs", info->mRoomNo); JUT_ASSERT(3548, strlen(dzsName) <= sizeof(dzsName)); if (useOldRes) { @@ -2723,12 +2723,12 @@ void dStage_dt_c_fieldMapLoader(void* i_data, dStage_dt_c* i_stage) { dStage_dt_c_decode(i_data, i_stage, l_funcTable, ARRAY_SIZEU(l_funcTable)); } -JKRExpHeap* dStage_roomControl_c::mMemoryBlock[MEMORY_BLOCK_MAX] = { +DUSK_GAME_DATA JKRExpHeap* dStage_roomControl_c::mMemoryBlock[MEMORY_BLOCK_MAX] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, }; -char dStage_roomControl_c::mArcBank[32][10] = {0}; +DUSK_GAME_DATA char dStage_roomControl_c::mArcBank[32][10] = {0}; void dStage_infoCreate() { OS_REPORT("dStage_Create\n"); @@ -2739,7 +2739,7 @@ void dStage_infoCreate() { dStage_dt_c_stageInitLoader(stageRsrc, dComIfGp_getStage()); } -char dStage_roomControl_c::mDemoArcName[10]; +DUSK_GAME_DATA char dStage_roomControl_c::mDemoArcName[10]; void dStage_Create() { void* stageRsrc = dComIfG_getStageRes("stage.dzs"); @@ -2807,7 +2807,7 @@ void dStage_Delete() { dComIfGp_getStage()->init(); } -s8 dStage_roomControl_c::mRoomReadId = -1; +DUSK_GAME_DATA s8 dStage_roomControl_c::mRoomReadId = -1; int dStage_RoomCheck(cBgS_GndChk* gndChk) { int roomReadId = dStage_roomControl_c::getRoomReadId(); diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp index cb40e3444a..1b4febc9f4 100644 --- a/src/d/d_timer.cpp +++ b/src/d/d_timer.cpp @@ -1224,8 +1224,8 @@ BOOL dDlst_TimerScrnDraw_c::closeAnime() { int dDlst_TimerScrnDraw_c::createGetIn(cXyz i_pos) { char string[104]; dMeter2Info_getString(0x3E4, string, NULL); // "GOAT IN!" - strcpy(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), string); - strcpy(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), string); + SAFE_STRCPY(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), string); + SAFE_STRCPY(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), string); if (mCowID < 50) { m_getin_info[mCowID].bck_frame = 40.0f; @@ -1313,8 +1313,8 @@ int dDlst_TimerScrnDraw_c::createGetIn(cXyz i_pos) { s32 dDlst_TimerScrnDraw_c::createStart(u16 i_messageID) { char string[112]; dMeter2Info_getString(i_messageID, string, NULL); - strcpy(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), string); - strcpy(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), string); + SAFE_STRCPY(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in_s')))->getStringPtr(), string); + SAFE_STRCPY(static_cast(mpGetInScreen->search(MULTI_CHAR('get_in')))->getStringPtr(), string); if (mCowID == 0) { m_getin_info[mCowID].bck_frame = 40.0f; @@ -1650,7 +1650,7 @@ static leafdraw_method_class l_dTimer_Method = { (process_method_func)dTimer_Draw, }; -msg_process_profile_definition g_profile_TIMER = { +DUSK_PROFILE msg_process_profile_definition DUSK_CONST g_profile_TIMER = { /* Layer ID */ fpcLy_CURRENT_e, /* List ID */ 12, /* List Prio */ fpcPi_CURRENT_e, diff --git a/src/d/d_tresure.cpp b/src/d/d_tresure.cpp index 90044360c8..54b416a69f 100644 --- a/src/d/d_tresure.cpp +++ b/src/d/d_tresure.cpp @@ -8,7 +8,7 @@ static bool data_80450680 = true; -dTres_c::typeGroupData_c* dTres_c::mTypeGroupData; +DUSK_GAME_DATA dTres_c::typeGroupData_c* dTres_c::mTypeGroupData; int dTres_c::createWork() { mTypeGroupData = JKR_NEW_ARRAY(dTres_c::typeGroupData_c, 0x40); @@ -25,9 +25,9 @@ void dTres_c::remove() { data_80450680 = true; } -dTres_c::type_group_list dTres_c::mTypeGroupListAll[17]; +DUSK_GAME_DATA dTres_c::type_group_list dTres_c::mTypeGroupListAll[17]; -u16 dTres_c::mNum; +DUSK_GAME_DATA u16 dTres_c::mNum; void dTres_c::reset() { if (data_80450680) { @@ -229,7 +229,7 @@ void dTres_c::setPosition(int dataNo, u8 listIdx, Vec const* i_pos, int i_roomNo } } -u8 const dTres_c::typeToTypeGroup[17][2] = { +DUSK_GAME_DATA u8 const dTres_c::typeToTypeGroup[17][2] = { {0xFF, 0x00}, {0x00, 0x01}, {0x01, 0x02}, {0x02, 0x03}, {0x03, 0x04}, {0x04, 0x05}, {0x05, 0x06}, {0x06, 0x07}, {0x07, 0x08}, {0x80, 0x09}, {0x81, 0x0A}, {0x82, 0x0B}, {0x83, 0x0C}, {0x84, 0x0D}, {0x85, 0x0E}, {0x87, 0x0F}, {0x88, 0x10}, diff --git a/src/d/d_vib_pattern.cpp b/src/d/d_vib_pattern.cpp index 6c06016cf5..774e16b3d9 100644 --- a/src/d/d_vib_pattern.cpp +++ b/src/d/d_vib_pattern.cpp @@ -3,7 +3,7 @@ #include "d/d_vibration.h" // Motor Shock patterns -const vib_pattern dVibration_c::MS_patt[VIBMODE_S_MAX] = { +DUSK_GAME_DATA const vib_pattern dVibration_c::MS_patt[VIBMODE_S_MAX] = { /* VIBMODE_S_CUSTOM */ {0, 0, 0x00000000}, /* VIBMODE_S_POWER1 */ {0, 3, 0xC0000000}, /* VIBMODE_S_POWER2 */ {0, 4, 0xE0000000}, @@ -18,7 +18,7 @@ const vib_pattern dVibration_c::MS_patt[VIBMODE_S_MAX] = { }; // Camera Shock patterns -const vib_pattern dVibration_c::CS_patt[VIBMODE_S_MAX] = { +DUSK_GAME_DATA const vib_pattern dVibration_c::CS_patt[VIBMODE_S_MAX] = { /* VIBMODE_S_CUSTOM */ {0, 0, 0x00000000}, /* VIBMODE_S_POWER1 */ {0, 3, 0xC0000000}, /* VIBMODE_S_POWER2 */ {0, 4, 0xE0000000}, @@ -33,7 +33,7 @@ const vib_pattern dVibration_c::CS_patt[VIBMODE_S_MAX] = { }; // Motor Quake patterns -const vib_pattern dVibration_c::MQ_patt[VIBMODE_Q_MAX] = { +DUSK_GAME_DATA const vib_pattern dVibration_c::MQ_patt[VIBMODE_Q_MAX] = { /* VIBMODE_Q_CUSTOM */ {0, 0, 0x00000000}, /* VIBMODE_Q_POWER1 */ {1, 32, 0x10202020}, /* VIBMODE_Q_POWER2 */ {1, 32, 0x42104208}, @@ -47,7 +47,7 @@ const vib_pattern dVibration_c::MQ_patt[VIBMODE_Q_MAX] = { }; // Camera Quake patterns -const vib_pattern dVibration_c::CQ_patt[VIBMODE_Q_MAX] = { +DUSK_GAME_DATA const vib_pattern dVibration_c::CQ_patt[VIBMODE_Q_MAX] = { /* VIBMODE_Q_CUSTOM */ {0, 0, 0x00000000}, /* VIBMODE_Q_POWER1 */ {1, 32, 0x10202020}, /* VIBMODE_Q_POWER2 */ {1, 32, 0x42104208}, @@ -60,7 +60,7 @@ const vib_pattern dVibration_c::CQ_patt[VIBMODE_Q_MAX] = { /* VIBMODE_Q_HORSE */ {0, 27, 0x20201000}, }; -const char* shock_names[VIBMODE_S_MAX] = { +DUSK_GAME_DATA const char* shock_names[VIBMODE_S_MAX] = { "VIBMODE_S_CUSTOM", "VIBMODE_S_POWER1", "VIBMODE_S_POWER2", @@ -74,7 +74,7 @@ const char* shock_names[VIBMODE_S_MAX] = { "VIBMODE_S_FOR2D", }; -const char* quake_names[VIBMODE_Q_MAX] = { +DUSK_GAME_DATA const char* quake_names[VIBMODE_Q_MAX] = { "VIBMODE_Q_CUSTOM", "VIBMODE_Q_POWER1", "VIBMODE_Q_POWER2", diff --git a/src/dusk/OSMutex.cpp b/src/dusk/OSMutex.cpp index ef1a528f1b..b3127eb6fc 100644 --- a/src/dusk/OSMutex.cpp +++ b/src/dusk/OSMutex.cpp @@ -181,20 +181,22 @@ void OSWaitCond(OSCond* cond, OSMutex* mutex) { mutex->count = 0; mutex->thread = nullptr; - // Unlock the recursive mutex the same number of times it was locked - for (s32 i = 0; i < savedCount; i++) { - mutexData.nativeMutex.unlock(); - } - - // Wait on the condition variable - { - std::unique_lock lock(mutexData.nativeMutex); + // Keep one recursion level held so cv.wait() is what releases the mutex; + // fully unlocking before the wait opens a window where a signal is lost. + if (savedCount >= 1) { + for (s32 i = 1; i < savedCount; i++) { + mutexData.nativeMutex.unlock(); + } + std::unique_lock lock(mutexData.nativeMutex, std::adopt_lock); + condData.cv.wait(lock); + lock.release(); + for (s32 i = 1; i < savedCount; i++) { + mutexData.nativeMutex.lock(); + } + } else { + // Mutex wasn't held on entry (contract violation); wait anyway. + std::unique_lock lock(mutexData.nativeMutex); condData.cv.wait(lock); - } - - // Re-lock the recursive mutex the same number of times - for (s32 i = 0; i < savedCount; i++) { - mutexData.nativeMutex.lock(); } // Restore GC mutex state diff --git a/src/dusk/OSReport.cpp b/src/dusk/OSReport.cpp index 422b88f03c..78bfd652c9 100644 --- a/src/dusk/OSReport.cpp +++ b/src/dusk/OSReport.cpp @@ -1,6 +1,7 @@ #include #include "aurora/lib/logging.hpp" +#include "dusk/os.h" #include "os_report.h" aurora::Module Log("dusk::osReport"); @@ -143,4 +144,4 @@ void OSAttention(const char* fmt, ...) { va_start(args, fmt); OSVAttention(fmt, args); va_end(args); -} \ No newline at end of file +} diff --git a/src/dusk/achievements.cpp b/src/dusk/achievements.cpp index a8e4ff3916..6c4de43487 100644 --- a/src/dusk/achievements.cpp +++ b/src/dusk/achievements.cpp @@ -11,6 +11,7 @@ #include "d/actor/d_a_alink.h" #include "d/actor/d_a_ni.h" #include "d/actor/d_a_npc4.h" +#include "d/actor/d_a_b_gnd.h" #include "d/actor/d_a_b_ob.h" #include "d/actor/d_a_player.h" #include "d/d_demo.h" @@ -18,6 +19,7 @@ #include "f_pc/f_pc_name.h" #include "f_op/f_op_actor_mng.h" #include "f_pc/f_pc_name.h" +#include "dusk/logging.h" #include #include @@ -35,6 +37,9 @@ static void* s_cucco_play_search(void* i_actor, void*) { } static void checkGoatHerding(Achievement& a, int32_t threshMs) { + if (strcmp(dComIfGp_getStartStageName(), "F_SP00") != 0) { + return; + } if (dMeter2Info_getMaxCount() != 20 || dMeter2Info_getNowCount() != 20) { return; } @@ -65,6 +70,25 @@ std::vector AchievementSystem::makeEntries() { }, {} }, + { + { + "three_heart_clear", + "Hero Mode", + "Defeat Ganondorf with only 3 heart containers.", + AchievementCategory::Challenge, + false, 0, 0, false + }, + [](Achievement& a, json&) { + const auto* link = static_cast(daPy_getPlayerActorClass()); + if (link == nullptr || link->mProcID != daAlink_c::PROC_GANON_FINISH) { + return; + } + if (dComIfGs_getMaxLife() < 20) { + a.progress = 1; + } + }, + {} + }, { { "completionist", @@ -201,7 +225,7 @@ std::vector AchievementSystem::makeEntries() { hasAncientDoc = true; } } - if (!hasJewelRod || !hasAncientDoc) { + if (!hasJewelRod || (!hasAncientDoc && !dComIfGs_isEventBit(dSv_event_flag_c::F_0302))) { return; } @@ -265,7 +289,7 @@ std::vector AchievementSystem::makeEntries() { { "hylian_loach", "Legendary Catch", - "Catch a Hylian Loach.", + "Obtain the Hylian Loach in your fishing journal.", AchievementCategory::Collection, false, 0, 0, false }, @@ -280,7 +304,7 @@ std::vector AchievementSystem::makeEntries() { { "all_fish", "Gone Fishin'", - "Catch all 6 species of fish.", + "Obtain all 6 species of fish in your fishing journal.", AchievementCategory::Collection, true, 6, 0, false }, @@ -392,7 +416,7 @@ std::vector AchievementSystem::makeEntries() { false, 0, 0, false }, [](Achievement& a, json&) { - if (daNpcF_chkEvtBit(0x1F9) && dComIfGs_getMaxLife() <= 15) { + if (daNpcF_chkEvtBit(0x1F9) && dComIfGs_getMaxLife() < 20) { a.progress = 1; } }, @@ -442,7 +466,7 @@ std::vector AchievementSystem::makeEntries() { { "dark_hammer_one_hit", "Mortal Edge", - "Defeat Dark Hammer in a single hit.", + "Defeat Darkhammer in a single hit.", AchievementCategory::Misc, false, 0, 0, false }, @@ -506,6 +530,29 @@ std::vector AchievementSystem::makeEntries() { }, {} }, + { + { + "rollstab_triple", + "Surgical Skewer", + "Kill 3 enemies with a single rollstab.", + AchievementCategory::Misc, + false, 0, 0, false + }, + [](Achievement& a, json&) { + static int rollstabKills = 0; + const auto* link = static_cast(daPy_getPlayerActorClass()); + const bool inRollstab = link != nullptr && link->mProcID == daAlink_c::PROC_CUT_FINISH && link->mIsRollstab; + if (!inRollstab) { + rollstabKills = 0; + return; + } + rollstabKills += AchievementSystem::get().signalCount("rollstab_kill"); + if (rollstabKills >= 3) { + a.progress = 1; + } + }, + {} + }, // Minigame { { @@ -600,6 +647,9 @@ std::vector AchievementSystem::makeEntries() { false, 0, 0, false }, [](Achievement& a, json&) { + if (strcmp(dComIfGp_getStartStageName(), "F_SP114") != 0) { + return; + } const int32_t bestMs = dComIfGs_getRaceGameTime(); if (dComIfGs_isEventBit(dSv_event_flag_c::F_0481) && bestMs > 0 && bestMs <= 70000) { @@ -681,7 +731,7 @@ std::vector AchievementSystem::makeEntries() { { "long_jump_attack", "Long Jump Attack", - "Travel more than 20 meters in a single jump attack before landing.", + "Travel more than 15 meters in a single jump attack before landing.", AchievementCategory::Misc, false, 0, 0, false }, @@ -711,7 +761,7 @@ std::vector AchievementSystem::makeEntries() { inJump = false; const float dx = link->current.pos.x - startX; const float dz = link->current.pos.z - startZ; - if (dx * dx + dz * dz >= 2000.0f * 2000.0f) { + if (dx * dx + dz * dz >= 1500.0f * 1500.0f) { a.progress = 1; } } else if (link->mProcID != daAlink_c::PROC_CUT_JUMP) { @@ -800,6 +850,66 @@ std::vector AchievementSystem::makeEntries() { }, {} }, + { + { + "ganondorf_3hit", + "Autospin Annihilation", + "Finish off Ganondorf in the final duel after only 3 attacks.", + AchievementCategory::Misc, + false, 0, 0, false + }, + [](Achievement& a, json&) { + auto& sys = AchievementSystem::get(); + const auto* link = static_cast(daPy_getPlayerActorClass()); + + static int autospinCount = 0; + static int pendingHits = 0; + static bool invalidated = false; + static bool wasInFight = false; + + auto* gnd = static_cast(fopAcM_SearchByName(fpcNm_B_GND_e)); + const bool inFight = gnd != nullptr && !gnd->checkRide(); + + if (inFight && !wasInFight) { + autospinCount = 0; + pendingHits = 0; + invalidated = false; + } + wasInFight = inFight; + + if (!inFight) { + return; + } + + const bool hitOccurred = sys.hasSignal("ganondorf_hit"); + const bool knockedDown = sys.hasSignal("ganondorf_knocked_down"); + + if (hitOccurred && knockedDown) { + // Spin completing an autospin: pendingHits should be exactly 1 (the spin attack) + if (pendingHits == 1) { + autospinCount++; + pendingHits = 0; + } else { + invalidated = true; + } + } else if (hitOccurred) { + pendingHits++; + if (pendingHits > 1) { + invalidated = true; + } + } + + if (link != nullptr && link->mProcID == daAlink_c::PROC_GANON_FINISH) { + if (!invalidated && autospinCount == 3) { + a.progress = 1; + } + autospinCount = 0; + pendingHits = 0; + invalidated = false; + } + }, + {} + }, // Glitched { { @@ -1012,6 +1122,55 @@ std::vector AchievementSystem::makeEntries() { a.progress = 1; }, {} + }, + { + { + "early_city", + "Early City", + "Obtain the Double Clawshots without obtaining the Dominion Rod.", + AchievementCategory::Glitched, + false, 0, 0, false + }, + [](Achievement& a, json&) { + if (daPy_getPlayerActorClass() == nullptr) { + return; + } + bool hasDoubleClawshot = false; + bool hasDominionRod = false; + for (int i = 0; i < 24; ++i) { + const auto item = dComIfGs_getItem(i, false); + if (item == dItemNo_W_HOOKSHOT_e) { + hasDoubleClawshot = true; + } + if (item == dItemNo_COPY_ROD_e || item == dItemNo_COPY_ROD_2_e) { + hasDominionRod = true; + } + } + if (hasDoubleClawshot && !hasDominionRod) { + a.progress = 1; + } + }, + {} + }, + { + { + "early_kakariko", + "Gorge Skip", + "Collect the Kakariko warp portal without warping the gorge bridge.", + AchievementCategory::Glitched, + false, 0, 0, false + }, + [](Achievement& a, json&) { + if (dComIfGs_isEventBit(dSv_event_flag_c::M_018) || dComIfGp_getStageStagInfo() == nullptr) { + return; + } + const bool savedPortal = g_dComIfG_gameInfo.info.getSavedata().getSave(dStage_SaveTbl_ELDIN).getBit().isSwitch(31); + const bool livePortal = dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo()) == dStage_SaveTbl_ELDIN && dComIfGs_isSaveSwitch(31); + if (savedPortal || livePortal) { + a.progress = 1; + } + }, + {} } }; } @@ -1088,11 +1247,17 @@ void AchievementSystem::clearAll() { } void AchievementSystem::signal(const char* key) { - m_signals.insert(key); + m_signals[key]++; } bool AchievementSystem::hasSignal(const char* key) const { - return m_signals.count(key) > 0; + const auto it = m_signals.find(key); + return it != m_signals.end() && it->second > 0; +} + +int AchievementSystem::signalCount(const char* key) const { + const auto it = m_signals.find(key); + return it != m_signals.end() ? it->second : 0; } void AchievementSystem::clearOne(const char* key) { diff --git a/include/dusk/achievements.h b/src/dusk/achievements.h similarity index 92% rename from include/dusk/achievements.h rename to src/dusk/achievements.h index 5c2758b6b7..c93ea5d626 100644 --- a/include/dusk/achievements.h +++ b/src/dusk/achievements.h @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "nlohmann/json.hpp" @@ -47,6 +47,7 @@ public: // Signals are visible to all achievement checks within the same tick, then cleared. void signal(const char* key); bool hasSignal(const char* key) const; + int signalCount(const char* key) const; std::vector getAchievements() const; @@ -62,7 +63,7 @@ private: void processEntry(Entry& e); std::vector m_entries; - std::unordered_set m_signals; + std::unordered_map m_signals; bool m_loaded = false; bool m_dirty = false; }; diff --git a/src/dusk/action_bindings.cpp b/src/dusk/action_bindings.cpp index 204f219558..68b07d6c0a 100644 --- a/src/dusk/action_bindings.cpp +++ b/src/dusk/action_bindings.cpp @@ -8,10 +8,19 @@ namespace dusk { static std::array(ActionBinds::COUNT)>, PAD_CHANMAX> actionPressData{}; +struct VirtualActionBindData { + bool pressed = false; + bool available = false; +}; + +static std::array(ActionBinds::COUNT)>, PAD_CHANMAX> virtualActionData{}; + ActionBindsMap& getActionBinds() { static ActionBindsMap actionBinds = { {ActionBinds::FIRST_PERSON_CAMERA, {&getSettings().actionBindings.firstPersonCamera, "First Person Camera"}}, {ActionBinds::CALL_MIDNA, {&getSettings().actionBindings.callMidna, "Call Midna"}}, + {ActionBinds::OPEN_MAP_SCREEN, {&getSettings().actionBindings.openMapScreen, "Open Map Screen"}}, + {ActionBinds::TOGGLE_MINIMAP, {&getSettings().actionBindings.toggleMinimap, "Toggle Minimap"}}, {ActionBinds::OPEN_DUSKLIGHT_MENU, {&getSettings().actionBindings.openDusklightMenu, "Open Dusklight Menu"}}, {ActionBinds::TURBO_SPEED_BUTTON, {&getSettings().actionBindings.turboSpeedButton, "Turbo Speed Button"}}, }; @@ -25,6 +34,10 @@ bool isActionBound(ActionBinds action, u32 port) { return false; } + if (port < PAD_CHANMAX && virtualActionData[port][static_cast(action)].available) { + return true; + } + return getActionBindButton(action, port) != PAD_NATIVE_BUTTON_INVALID; } @@ -41,43 +54,71 @@ void updateActionBindings() { // If the action isn't bound, or if documents are visible and the action isn't // opening the dusklight menu, don't update. Otherwise, we may accidentally // perform actions while the dusklight menu is open. - if (!isActionBound(action, port) || + const int button = boundAction.configVars->at(port); + const bool virtualAvailable = virtualActionData[port][static_cast(action)].available; + if ((button == PAD_NATIVE_BUTTON_INVALID && !virtualAvailable) || (ui::any_document_visible() && action != ActionBinds::OPEN_DUSKLIGHT_MENU)) { continue; } - int button = boundAction.configVars->at(port); - - // If keyboard is active for this port - u32 count = 0; - if (PADGetKeyButtonBindings(port, &count) != nullptr) { - int numKeys = 0; - const bool* kbState = SDL_GetKeyboardState(&numKeys); - if (kbState[button]) { - actionPressData[port][static_cast(action)].pressedCurFrame = true; - } - } else { - // If controller is active - auto controller = aurora::input::get_controller_for_player(port); - if (controller) { - if (SDL_GetGamepadButton(controller->m_controller, static_cast(button))) { + if (button != PAD_NATIVE_BUTTON_INVALID) { + // If keyboard is active for this port + u32 count = 0; + if (PADGetKeyButtonBindings(port, &count) != nullptr) { + int numKeys = 0; + const bool* kbState = SDL_GetKeyboardState(&numKeys); + if (kbState[button]) { actionPressData[port][static_cast(action)].pressedCurFrame = true; } + } else { + // If controller is active + auto controller = aurora::input::get_controller_for_player(port); + if (controller) { + if (SDL_GetGamepadButton(controller->m_controller, static_cast(button))) { + actionPressData[port][static_cast(action)].pressedCurFrame = true; + } + } } } } + + for (auto& [action, _] : getActionBinds()) { + const auto& virtualAction = virtualActionData[port][static_cast(action)]; + if (virtualAction.available && virtualAction.pressed && !ui::any_document_visible()) { + actionPressData[port][static_cast(action)].pressedCurFrame = true; + } + } } } +void setVirtualActionBind(ActionBinds action, u32 port, bool pressed, bool available) { + if (port >= PAD_CHANMAX) { + return; + } + virtualActionData[port][static_cast(action)] = { + .pressed = pressed, + .available = available, + }; +} + +void clearVirtualActionBind(ActionBinds action, u32 port) { + if (port >= PAD_CHANMAX) { + return; + } + virtualActionData[port][static_cast(action)] = {}; +} + +void clearAllVirtualActionBinds() { + virtualActionData = {}; +} + bool getActionBindTrig(ActionBinds action, u32 port) { - return isActionBound(action, port) && - actionPressData[port][static_cast(action)].pressedCurFrame && + return actionPressData[port][static_cast(action)].pressedCurFrame && !actionPressData[port][static_cast(action)].pressedPrevFrame; } bool getActionBindHold(ActionBinds action, u32 port) { - return isActionBound(action, port) && - actionPressData[port][static_cast(action)].pressedCurFrame && + return actionPressData[port][static_cast(action)].pressedCurFrame && actionPressData[port][static_cast(action)].pressedPrevFrame; } diff --git a/include/dusk/action_bindings.h b/src/dusk/action_bindings.h similarity index 78% rename from include/dusk/action_bindings.h rename to src/dusk/action_bindings.h index 7eba412fe8..a71dac5dfe 100644 --- a/include/dusk/action_bindings.h +++ b/src/dusk/action_bindings.h @@ -9,6 +9,8 @@ namespace dusk { enum class ActionBinds { FIRST_PERSON_CAMERA, CALL_MIDNA, + OPEN_MAP_SCREEN, + TOGGLE_MINIMAP, OPEN_DUSKLIGHT_MENU, TURBO_SPEED_BUTTON, COUNT, @@ -32,6 +34,12 @@ bool isActionBound(ActionBinds action, u32 port); void updateActionBindings(); +void setVirtualActionBind(ActionBinds action, u32 port, bool pressed, bool available = true); + +void clearVirtualActionBind(ActionBinds action, u32 port); + +void clearAllVirtualActionBinds(); + bool getActionBindTrig(ActionBinds action, u32 port); bool getActionBindHold(ActionBinds action, u32 port); diff --git a/src/dusk/android_frame_rate.cpp b/src/dusk/android_frame_rate.cpp new file mode 100644 index 0000000000..bf889a9482 --- /dev/null +++ b/src/dusk/android_frame_rate.cpp @@ -0,0 +1,74 @@ +#include "dusk/android_frame_rate.hpp" + +#if defined(TARGET_ANDROID) || defined(__ANDROID__) || defined(ANDROID) +#include "dusk/settings.h" + +#include +#include + +namespace dusk::android { +namespace { + +float preferred_surface_frame_rate() { + switch (getSettings().game.enableFrameInterpolation.getValue()) { + case FrameInterpMode::Off: + return 30.0f; + case FrameInterpMode::Unlimited: + default: + return 0.0f; + case FrameInterpMode::Capped: + return static_cast(getSettings().video.maxFrameRate.getValue()); + } +} + +bool clear_pending_exception(JNIEnv* env) { + if (env == nullptr || !env->ExceptionCheck()) { + return false; + } + env->ExceptionClear(); + return true; +} + +} // namespace + +void update_surface_frame_rate() { + auto* env = static_cast(SDL_GetAndroidJNIEnv()); + if (env == nullptr) { + return; + } + + jobject activity = static_cast(SDL_GetAndroidActivity()); + if (activity == nullptr || clear_pending_exception(env)) { + if (activity != nullptr) { + env->DeleteLocalRef(activity); + } + return; + } + + jclass activityClass = env->GetObjectClass(activity); + if (activityClass == nullptr || clear_pending_exception(env)) { + env->DeleteLocalRef(activity); + return; + } + + jmethodID setPreferredFrameRate = + env->GetMethodID(activityClass, "setPreferredSurfaceFrameRate", "(F)V"); + env->DeleteLocalRef(activityClass); + if (setPreferredFrameRate == nullptr || clear_pending_exception(env)) { + env->DeleteLocalRef(activity); + return; + } + + jvalue args[1]{}; + args[0].f = preferred_surface_frame_rate(); + env->CallVoidMethodA(activity, setPreferredFrameRate, args); + env->DeleteLocalRef(activity); + clear_pending_exception(env); +} + +} // namespace dusk::android +#else +namespace dusk::android { +void update_surface_frame_rate() {} +} // namespace dusk::android +#endif diff --git a/src/dusk/android_frame_rate.hpp b/src/dusk/android_frame_rate.hpp new file mode 100644 index 0000000000..03a7876633 --- /dev/null +++ b/src/dusk/android_frame_rate.hpp @@ -0,0 +1,7 @@ +#pragma once + +namespace dusk::android { + +void update_surface_frame_rate(); + +} // namespace dusk::android diff --git a/include/dusk/app_info.hpp b/src/dusk/app_info.hpp similarity index 86% rename from include/dusk/app_info.hpp rename to src/dusk/app_info.hpp index e08fe680d9..bb8c15856e 100644 --- a/include/dusk/app_info.hpp +++ b/src/dusk/app_info.hpp @@ -1,5 +1,4 @@ -#ifndef DUSK_APPNAME_HPP -#define DUSK_APPNAME_HPP +#pragma once namespace dusk { /** @@ -21,5 +20,3 @@ namespace dusk { */ constexpr auto OrgName = "TwilitRealm"; } - -#endif // DUSK_APPNAME_HPP diff --git a/src/dusk/asan_options.c b/src/dusk/asan_options.c new file mode 100644 index 0000000000..6bfb55f28d --- /dev/null +++ b/src/dusk/asan_options.c @@ -0,0 +1,3 @@ +const char* __asan_default_options(void) { + return "abort_on_error=1:symbolize=1:intercept_memcmp=0:detect_leaks=0"; +} diff --git a/include/dusk/audio.h b/src/dusk/audio.h similarity index 72% rename from include/dusk/audio.h rename to src/dusk/audio.h index e3dfda9f52..0f247689f6 100644 --- a/include/dusk/audio.h +++ b/src/dusk/audio.h @@ -1,5 +1,4 @@ -#ifndef DUSK_AUDIO_H -#define DUSK_AUDIO_H +#pragma once #if TARGET_PC #define DUSK_AUDIO_DISABLED 0 @@ -12,5 +11,3 @@ #else #define DUSK_AUDIO_SKIP(...) #endif - -#endif // DUSK_AUDIO_H diff --git a/include/dusk/audio/DuskAudioSystem.h b/src/dusk/audio/DuskAudioSystem.h similarity index 100% rename from include/dusk/audio/DuskAudioSystem.h rename to src/dusk/audio/DuskAudioSystem.h diff --git a/src/dusk/audio/DuskDsp.cpp b/src/dusk/audio/DuskDsp.cpp index 697371702f..4009b37e39 100644 --- a/src/dusk/audio/DuskDsp.cpp +++ b/src/dusk/audio/DuskDsp.cpp @@ -10,11 +10,11 @@ #include #include "Adpcm.hpp" -#include "freeverb/revmodel.hpp" #include "dusk/audio/DuskAudioSystem.h" -#include "dusk/endian.h" #include "dusk/logging.h" +#include "freeverb/revmodel.hpp" #include "global.h" +#include "helpers/endian.h" #include "tracy/Tracy.hpp" using namespace dusk::audio; @@ -85,10 +85,9 @@ static bool ValidateChannelWaveFormat(const JASDsp::TChannel& channel) { */ static void ValidateChannel(const JASDsp::TChannel& channel) { if (!ValidateChannelWaveFormat(channel)) { - CRASH( - "Unable to handle channel format: %02x, %02x\n", - channel.mSamplesPerBlock, - channel.mBytesPerBlock); + const auto msg = fmt::format("Unable to handle channel format: {:02x}, {:02x}\n", + channel.mSamplesPerBlock, channel.mBytesPerBlock); + CRASH(msg.c_str()); } } @@ -458,10 +457,7 @@ static int ReadChannelSamplesChunk( auto aramBase = static_cast(ARGetStorageAddress()) + channel.mWaveAramAddress; - // Streaming logic directly modifies mSamplesLeft. - // So we use that as our tracking of where we are. - auto curSamplePosition = channel.mEndSample - channel.mSamplesLeft; - + auto curSamplePosition = channel.mSamplePosition; u32 skipSamples = curSamplePosition % channel.mSamplesPerBlock; if (skipSamples != 0) { // We need to start reading in the middle of a block. This can happen thanks to loops. diff --git a/include/dusk/autosave.h b/src/dusk/autosave.h similarity index 86% rename from include/dusk/autosave.h rename to src/dusk/autosave.h index c32cd1e22b..2ab0887295 100644 --- a/include/dusk/autosave.h +++ b/src/dusk/autosave.h @@ -1,8 +1,5 @@ #pragma once -#ifndef AUTOSAVE_H -#define AUTOSAVE_H - #include #include #include @@ -15,5 +12,3 @@ void autoSaving(); void waitingForWrite(); void endAutoSave(); void toggleAutoSave(bool enabled); - -#endif \ No newline at end of file diff --git a/src/dusk/config.cpp b/src/dusk/config.cpp index f0a4b986bd..a2b79eaac5 100644 --- a/src/dusk/config.cpp +++ b/src/dusk/config.cpp @@ -1,46 +1,169 @@ #include "dusk/config.hpp" +#include "absl/container/flat_hash_map.h" #include "fmt/format.h" #include "nlohmann/json.hpp" -#include "absl/container/flat_hash_map.h" #include "aurora/lib/logging.hpp" #include "dusk/io.hpp" #include "dusk/settings.h" +#include +#include +#include #include +#include #include +#include +#include +#include +#include -#include "dusk/main.h" #include "dusk/action_bindings.h" +#include "dusk/logging.h" +#include "dusk/main.h" -using namespace dusk::config; - +namespace dusk::config { +namespace { constexpr auto ConfigFileName = "config.json"; using json = nlohmann::json; aurora::Module DuskConfigLog("dusk::config"); -static absl::flat_hash_map RegisteredConfigVars; -static bool RegistrationDone = false; +absl::flat_hash_map RegisteredConfigVars; +absl::flat_hash_map UnregisteredConfigVars; +absl::flat_hash_map UnregisteredConfigVarOverrides; -static std::u8string GetConfigJsonPath() { - return (dusk::ConfigPath / ConfigFileName).u8string(); +struct ChangeSubscription { + Subscription token; + ChangeCallback callback; +}; +absl::flat_hash_map > s_changeSubscriptions; +absl::flat_hash_map s_changeTokenNames; +Subscription s_nextChangeToken = 1; +// Names currently being notified; guards against a callback re-notifying its own CVar. +std::vector s_activeChangeNotifications; + +std::optional parse_control_anchor(std::string_view value) { + if (value == "none") { + return ui::ControlAnchor::None; + } + if (value == "top") { + return ui::ControlAnchor::Top; + } + if (value == "left") { + return ui::ControlAnchor::Left; + } + if (value == "bottom") { + return ui::ControlAnchor::Bottom; + } + if (value == "right") { + return ui::ControlAnchor::Right; + } + if (value == "topLeft") { + return ui::ControlAnchor::TopLeft; + } + if (value == "topRight") { + return ui::ControlAnchor::TopRight; + } + if (value == "bottomLeft") { + return ui::ControlAnchor::BottomLeft; + } + if (value == "bottomRight") { + return ui::ControlAnchor::BottomRight; + } + return std::nullopt; } -ConfigVarBase::ConfigVarBase(const char* name, const ConfigImplBase* impl) : name(name), registered(false), layer(ConfigVarLayer::Default), impl(impl) { +const char* control_anchor_value(ui::ControlAnchor anchor) { + switch (anchor) { + case ui::ControlAnchor::None: + return "none"; + case ui::ControlAnchor::Top: + return "top"; + case ui::ControlAnchor::Left: + return "left"; + case ui::ControlAnchor::Bottom: + return "bottom"; + case ui::ControlAnchor::Right: + return "right"; + case ui::ControlAnchor::TopLeft: + return "topLeft"; + case ui::ControlAnchor::TopRight: + return "topRight"; + case ui::ControlAnchor::BottomLeft: + return "bottomLeft"; + case ui::ControlAnchor::BottomRight: + return "bottomRight"; + } + return "none"; } -const char* ConfigVarBase::getName() const noexcept { - return name; +std::optional json_finite_float(const json& object, const char* key) { + const auto iter = object.find(key); + if (iter == object.end() || !iter->is_number()) { + return std::nullopt; + } + + const float value = iter->get(); + if (!std::isfinite(value)) { + return std::nullopt; + } + + return value; } -const ConfigImplBase* ConfigVarBase::getImpl() const noexcept { - return impl; +std::optional parse_control_props(const json& value) { + if (!value.is_object()) { + return std::nullopt; + } + + const auto x = json_finite_float(value, "x"); + const auto y = json_finite_float(value, "y"); + const auto w = json_finite_float(value, "w"); + const auto h = json_finite_float(value, "h"); + const auto scale = json_finite_float(value, "scale"); + const auto anchorIter = value.find("anchor"); + if (!x || !y || !w || !h || !scale || anchorIter == value.end() || !anchorIter->is_string()) { + return std::nullopt; + } + + const auto anchor = parse_control_anchor(anchorIter->get()); + if (!anchor || *w <= 0.0f || *h <= 0.0f || *scale <= 0.0f) { + return std::nullopt; + } + return ui::ControlProps{ + .x = *x, + .y = *y, + .w = *w, + .h = *h, + .scale = *scale, + .anchor = *anchor, + }; +} + +std::filesystem::path GetConfigJsonPath() { + return ConfigPath / ConfigFileName; +} + +std::filesystem::path GetTempConfigJsonPath(const std::filesystem::path& configJsonPath) { + auto tempPath = configJsonPath; + tempPath.replace_filename(fmt::format(".{}.tmp", configJsonPath.filename().string())); + return tempPath; +} + +void ReplaceFile(const std::filesystem::path& source, const std::filesystem::path& target) { + std::error_code ec; + std::filesystem::rename(source, target, ec); + if (ec) { + const auto renameError = ec; + std::filesystem::remove(source, ec); + throw std::system_error(renameError); + } } template -static T sanitizeEnumValue(const ConfigVar& cVar, T value) { +T sanitizeEnumValue(const ConfigVar& cVar, T value) { if constexpr (std::is_enum_v) { using Underlying = std::underlying_type_t; const Underlying raw = static_cast(value); @@ -54,124 +177,272 @@ static T sanitizeEnumValue(const ConfigVar& cVar, T value) { return value; } -template -void ConfigImpl::loadFromJson(ConfigVar& cVar, const json& jsonValue) { - cVar.setValue(sanitizeEnumValue(cVar, jsonValue.get()), false); -} - -template -nlohmann::json ConfigImpl::dumpToJson(const ConfigVar& cVar) { - return cVar.getValueForSave(); -} - -template requires std::is_integral_v && std::is_signed_v -static void loadFromArgImpl(ConfigVar& cVar, const std::string_view stringValue) { +template +requires std::is_integral_v&& std::is_signed_v T parse_arg_value( + const ConfigVar&, const std::string_view stringValue) { const std::string str(stringValue); const auto result = std::stoll(str); if (result >= std::numeric_limits::min() && result <= std::numeric_limits::max()) { - cVar.setOverrideValue(result); - } else { - throw std::out_of_range("Value is too large"); + return static_cast(result); } + throw std::out_of_range("Value is too large"); } -template requires std::is_integral_v && std::is_unsigned_v -static void loadFromArgImpl(ConfigVar& cVar, const std::string_view stringValue) { +template +requires std::is_integral_v&& std::is_unsigned_v T parse_arg_value( + const ConfigVar&, const std::string_view stringValue) { const std::string str(stringValue); const auto result = std::stoull(str); if (result <= std::numeric_limits::max()) { - cVar.setOverrideValue(result); - } else { - throw std::out_of_range("Value is too large"); + return static_cast(result); } + throw std::out_of_range("Value is too large"); } -static void loadFromArgImpl(ConfigVar& cVar, const std::string_view stringValue) { +f32 parse_arg_value(const ConfigVar&, const std::string_view stringValue) { const std::string str(stringValue); - const auto result = std::stof(str); - cVar.setOverrideValue(result); + return std::stof(str); } -static void loadFromArgImpl(ConfigVar& cVar, const std::string_view stringValue) { +f64 parse_arg_value(const ConfigVar&, const std::string_view stringValue) { const std::string str(stringValue); - const auto result = std::stod(str); - cVar.setOverrideValue(result); + return std::stod(str); } -static void loadFromArgImpl(ConfigVar& cVar, const std::string_view stringValue) { - cVar.setOverrideValue(std::string(stringValue)); +std::string parse_arg_value(const ConfigVar&, const std::string_view stringValue) { + return std::string(stringValue); } -template requires std::is_enum_v -static void loadFromArgImpl(ConfigVar& cVar, const std::string_view stringValue) { +template +requires std::is_enum_v T parse_arg_value( + const ConfigVar& cVar, const std::string_view stringValue) { using Underlying = std::underlying_type_t; const std::string str(stringValue); if constexpr (std::is_signed_v) { const auto result = std::stoll(str); - if (result >= std::numeric_limits::min() && result <= std::numeric_limits::max()) { - cVar.setOverrideValue(sanitizeEnumValue(cVar, static_cast(result))); - } else { - throw std::out_of_range("Value is too large"); + if (result >= std::numeric_limits::min() && + result <= std::numeric_limits::max()) + { + return sanitizeEnumValue(cVar, static_cast(result)); } + throw std::out_of_range("Value is too large"); } else { const auto result = std::stoull(str); if (result <= std::numeric_limits::max()) { - cVar.setOverrideValue(sanitizeEnumValue(cVar, static_cast(result))); - } else { - throw std::out_of_range("Value is too large"); + return sanitizeEnumValue(cVar, static_cast(result)); } + throw std::out_of_range("Value is too large"); + } +} +} // namespace + +ConfigVarBase::ConfigVarBase(std::string name, const ConfigImplBase* impl) + : name(std::move(name)), registered(false), layer(ConfigVarLayer::Default), impl(impl) {} + +const char* ConfigVarBase::getName() const noexcept { + return name.c_str(); +} + +const ConfigImplBase* ConfigVarBase::getImpl() const noexcept { + return impl; +} + +ConfigVarBase::~ConfigVarBase() { + if (registered) { + DuskLog.fatal("CVar '{}' was destroyed while still registered!", name); } } -template -void ConfigImpl::loadFromArg(ConfigVar& cVar, const std::string_view stringValue) { - loadFromArgImpl(cVar, stringValue); +template +void ConfigImpl::loadFromJson(ConfigVar& cVar, const json& jsonValue) { + if constexpr (std::is_enum_v) { + if (jsonValue.is_boolean()) { + DuskConfigLog.error("Doing default migration of CVar {} from bool, enum values may not " + "be what is expected!", + cVar.getName()); + + using Underlying = std::underlying_type_t; + const bool b = jsonValue.get(); + + const Underlying raw = b ? static_cast(1) : static_cast(0); + + cVar.load_value(sanitizeEnumValue(cVar, static_cast(raw))); + return; + } + } + + cVar.load_value(sanitizeEnumValue(cVar, jsonValue.get())); } -template<> +template +nlohmann::json ConfigImpl::dumpToJson(const ConfigVar& cVar) { + return cVar.getValueForSave(); +} + +template +void ConfigImpl::loadFromArg(ConfigVar& cVar, const std::string_view stringValue) { + cVar.load_override_value(parse_arg_value(cVar, stringValue)); +} + +template <> void ConfigImpl::loadFromArg(ConfigVar& cVar, const std::string_view stringValue) { - if (stringValue == "1" || stringValue == "TRUE" || stringValue == "true" || stringValue == "True") { - cVar.setOverrideValue(true); - } else if (stringValue == "0" || stringValue == "FALSE" || stringValue == "false" || stringValue == "False") { - cVar.setOverrideValue(false); + if (stringValue == "1" || stringValue == "TRUE" || stringValue == "true" || + stringValue == "True") + { + cVar.load_override_value(true); + } else if (stringValue == "0" || stringValue == "FALSE" || stringValue == "false" || + stringValue == "False") + { + cVar.load_override_value(false); } else { throw InvalidConfigError("Value cannot be parsed as boolean"); } } -// My IDE is convinced this namespace is necessary. It shouldn't be AFAICT? -namespace dusk::config { - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; - template class ConfigImpl; -} +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; -void dusk::config::Register(ConfigVarBase& configVar) { - const auto& name = configVar.getName(); - if (RegistrationDone) { - DuskConfigLog.fatal("Tried to register CVar {} after registrations closed!", name); +template <> +void ConfigImpl::loadFromJson( + ConfigVar& cVar, const json& jsonValue) { + if (jsonValue.is_boolean()) { + const bool b = jsonValue.get(); + + const FrameInterpMode mode = b ? FrameInterpMode::Unlimited : FrameInterpMode::Off; + + cVar.load_value(sanitizeEnumValue(cVar, mode)); + return; } + cVar.load_value(sanitizeEnumValue(cVar, jsonValue.get())); +} + +template <> +void ConfigImpl::loadFromJson( + ConfigVar& cVar, const json& jsonValue) { + if (!jsonValue.is_object()) { + return; + } + + const int version = jsonValue.value("version", 0); + if (version != ui::ControlLayout::Version) { + return; + } + + const auto controlsIter = jsonValue.find("controls"); + if (controlsIter == jsonValue.end() || !controlsIter->is_object()) { + return; + } + + ui::ControlLayout layout{.version = version}; + for (const auto& control : controlsIter->items()) { + if (!ui::is_control_layout_id(control.key())) { + continue; + } + + if (const auto props = parse_control_props(control.value())) { + layout.controls[control.key()] = *props; + } + } + + cVar.load_value(std::move(layout)); +} + +template <> +void ConfigImpl::loadFromArg( + ConfigVar&, const std::string_view) { + throw InvalidConfigError("Touch control layout cannot be parsed from launch arguments"); +} + +template <> +nlohmann::json ConfigImpl::dumpToJson(const ConfigVar& cVar) { + const auto& layout = cVar.getValueForSave(); + json controls = json::object(); + for (const auto& [id, props] : layout.controls) { + controls[id] = { + {"x", props.x}, + {"y", props.y}, + {"w", props.w}, + {"h", props.h}, + {"scale", props.scale}, + {"anchor", control_anchor_value(props.anchor)}, + }; + } + + return { + {"version", ui::ControlLayout::Version}, + {"controls", std::move(controls)}, + }; +} + +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; +template class ConfigImpl; + +void Register(ConfigVarBase& configVar) { + const std::string_view name = configVar.getName(); if (RegisteredConfigVars.contains(name)) { DuskConfigLog.fatal("Tried to register CVar {} twice!", name); } RegisteredConfigVars[name] = &configVar; configVar.markRegistered(); + + const auto unregPair = UnregisteredConfigVars.find(name); + if (unregPair != UnregisteredConfigVars.end()) { + const auto value = std::move(unregPair->second); + UnregisteredConfigVars.erase(name); + + try { + configVar.getImpl()->loadFromJson(configVar, value); + } catch (std::exception& e) { + DuskConfigLog.error("Failed to load key '{}' from config value: {}", name, e.what()); + } + } + + const auto overridePair = UnregisteredConfigVarOverrides.find(name); + if (overridePair != UnregisteredConfigVarOverrides.end()) { + try { + configVar.getImpl()->loadFromArg(configVar, overridePair->second); + } catch (std::exception& e) { + DuskConfigLog.error("Failed to load key '{}' from override arg: {}", name, e.what()); + } + } +} + +void unregister(ConfigVarBase& configVar) { + const std::string_view name = configVar.getName(); + const auto it = RegisteredConfigVars.find(name); + if (it == RegisteredConfigVars.end() || it->second != &configVar) { + DuskConfigLog.fatal("Tried to unregister CVar '{}' that is not registered!", name); + } + + const auto layer = configVar.getLayer(); + if (layer == ConfigVarLayer::Value || layer == ConfigVarLayer::Speedrun) { + UnregisteredConfigVars.insert_or_assign( + std::string{name}, configVar.getImpl()->dumpToJson(configVar)); + } + + RegisteredConfigVars.erase(it); + configVar.unmarkRegistered(); } void ConfigVarBase::markRegistered() { @@ -181,20 +452,24 @@ void ConfigVarBase::markRegistered() { registered = true; } -void dusk::config::FinishRegistration() { - RegistrationDone = true; +void ConfigVarBase::unmarkRegistered() { + if (!registered) + abort(); + + registered = false; } -void dusk::config::LoadFromUserPreferences() { +void load_from_user_preferences() { const auto configJsonPath = GetConfigJsonPath(); if (configJsonPath.empty()) { return; } - LoadFromFileName(reinterpret_cast(configJsonPath.c_str())); + const auto configPathString = io::fs_path_to_string(configJsonPath); + load_from_file_name(configPathString.c_str()); } static void LoadFromPath(const char* path) { - auto data = dusk::io::FileStream::ReadAllBytes(path); + auto data = io::FileStream::ReadAllBytes(path); json j = json::parse(data); if (!j.is_object()) { @@ -202,11 +477,13 @@ static void LoadFromPath(const char* path) { return; } + UnregisteredConfigVars.clear(); + for (const auto& el : j.items()) { const auto& key = el.key(); auto configVar = RegisteredConfigVars.find(key); if (configVar == RegisteredConfigVars.end()) { - DuskConfigLog.error("Unknown key '{}' found in config!", key); + UnregisteredConfigVars.emplace(key, el.value()); continue; } @@ -218,11 +495,7 @@ static void LoadFromPath(const char* path) { } } -void dusk::config::LoadFromFileName(const char* path) { - if (!RegistrationDone) { - DuskConfigLog.fatal("Registration not finished yet!"); - } - +void load_from_file_name(const char* path) { DuskConfigLog.info("Loading config from '{}'", path); try { @@ -233,18 +506,35 @@ void dusk::config::LoadFromFileName(const char* path) { } else { DuskConfigLog.error("Failed to load from config! {}", e.what()); } + } catch (const nlohmann::json::parse_error& e) { + DuskConfigLog.error("Failed to parse config JSON, staying with defaults: {}", e.what()); + } catch (const std::exception& e) { + DuskConfigLog.error("Failed to load from config, staying with defaults: {}", e.what()); } } -void dusk::config::Save() { +void load_arg_override(std::string_view name, std::string_view value) { + const auto cVar = GetConfigVar(name); + if (!cVar) { + UnregisteredConfigVarOverrides.emplace(name, value); + return; + } + + try { + cVar->getImpl()->loadFromArg(*cVar, value); + } catch (const std::exception& e) { + DuskLog.fatal("Unable to parse: '{}': {}", value, e.what()); + } +} + +void save() { const auto configJsonPath = GetConfigJsonPath(); if (configJsonPath.empty()) { return; } + const auto configPathString = io::fs_path_to_string(configJsonPath); - DuskConfigLog.info( - "Saving config to '{}'", - reinterpret_cast(configJsonPath.c_str())); + DuskConfigLog.info("Saving config to '{}'", configPathString); json j; @@ -255,17 +545,27 @@ void dusk::config::Save() { } } - io::FileStream::WriteAllText(reinterpret_cast(configJsonPath.c_str()), j.dump(4)); + for (const auto& pair : UnregisteredConfigVars) { + j[pair.first] = pair.second; + } + + try { + const auto tempConfigJsonPath = GetTempConfigJsonPath(configJsonPath); + io::FileStream::WriteAllText(tempConfigJsonPath, j.dump(4)); + ReplaceFile(tempConfigJsonPath, configJsonPath); + } catch (const std::exception& e) { + DuskConfigLog.error("Failed to save config to '{}': {}", configPathString, e.what()); + } } -void dusk::config::ClearAllActionBindings(int port) { +void ClearAllActionBindings(int port) { for (auto& actionBinding : getActionBinds() | std::views::values) { actionBinding.configVars->at(port).setValue(PAD_NATIVE_BUTTON_INVALID); } - Save(); + save(); } -ConfigVarBase* dusk::config::GetConfigVar(std::string_view name) { +ConfigVarBase* GetConfigVar(std::string_view name) { const auto configVar = RegisteredConfigVars.find(name); if (configVar != RegisteredConfigVars.end()) { return configVar->second; @@ -274,8 +574,69 @@ ConfigVarBase* dusk::config::GetConfigVar(std::string_view name) { return nullptr; } -void dusk::config::EnumerateRegistered(std::function callback) { +void EnumerateRegistered(std::function callback) { for (auto& pair : RegisteredConfigVars) { callback(*pair.second); } } + +Subscription subscribe(std::string_view name, ChangeCallback callback) { + const auto token = s_nextChangeToken++; + s_changeSubscriptions[std::string{name}].push_back({token, std::move(callback)}); + s_changeTokenNames.emplace(token, std::string{name}); + return token; +} + +void unsubscribe(Subscription token) { + const auto nameIt = s_changeTokenNames.find(token); + if (nameIt == s_changeTokenNames.end()) { + DuskConfigLog.fatal("Tried to unsubscribe unknown change token {}!", token); + } + + const auto subsIt = s_changeSubscriptions.find(nameIt->second); + auto& subscriptions = subsIt->second; + std::erase_if( + subscriptions, [token](const ChangeSubscription& sub) { return sub.token == token; }); + if (subscriptions.empty()) { + s_changeSubscriptions.erase(subsIt); + } + s_changeTokenNames.erase(nameIt); +} + +bool ConfigVarBase::has_subscribers() const { + return s_changeSubscriptions.contains(name); +} + +void ConfigVarBase::notify_changed(const void* previousValue) { + const auto subsIt = s_changeSubscriptions.find(name); + if (subsIt == s_changeSubscriptions.end()) { + return; + } + if (std::ranges::find(s_activeChangeNotifications, name) != s_activeChangeNotifications.end()) { + DuskConfigLog.error("Recursive change notification for CVar '{}' suppressed", name); + return; + } + + s_activeChangeNotifications.push_back(name); + // Copied so callbacks can subscribe/unsubscribe safely. + const auto subscriptions = subsIt->second; + for (const auto& sub : subscriptions) { + sub.callback(*this, previousValue); + } + s_activeChangeNotifications.pop_back(); +} + +void shutdown() { + for (auto& pair : RegisteredConfigVars) { + pair.second->unmarkRegistered(); + } + + RegisteredConfigVars.clear(); + UnregisteredConfigVars.clear(); + UnregisteredConfigVarOverrides.clear(); + s_changeSubscriptions.clear(); + s_changeTokenNames.clear(); + s_activeChangeNotifications.clear(); +} + +} // namespace dusk::config \ No newline at end of file diff --git a/include/dusk/config.hpp b/src/dusk/config.hpp similarity index 54% rename from include/dusk/config.hpp rename to src/dusk/config.hpp index 382c4c24c6..53591437db 100644 --- a/include/dusk/config.hpp +++ b/src/dusk/config.hpp @@ -1,9 +1,10 @@ -#ifndef DUSK_CONFIG_HPP -#define DUSK_CONFIG_HPP +#pragma once +#include #include +#include #include -#include "nlohmann/json.hpp" + #include "config_var.hpp" namespace dusk::config { @@ -40,7 +41,7 @@ public: [[nodiscard]] virtual nlohmann::json dumpToJson(const ConfigVarBase& cVar) const = 0; }; -template +template class ConfigImpl : public ConfigImplBase { // Just downcasting the references... void loadFromJson(ConfigVarBase& cVar, const nlohmann::json& jsonValue) const final { @@ -90,20 +91,28 @@ public: void Register(ConfigVarBase& configVar); /** - * \brief Indicate that all registrations have happened and everything should lock in. + * \brief Unregister a CVar, detaching it from the config system. + * + * If the CVar carries a user-set value (Value or Speedrun layer), it is stashed as an + * unregistered key: Save() keeps writing it, and a later Register() of the same name restores + * it through the normal back-fill path. The CVar may be destroyed after this returns. */ -void FinishRegistration(); +void unregister(ConfigVarBase& configVar); /** * \brief Load config from the standard user preferences location. */ -void LoadFromUserPreferences(); -void LoadFromFileName(const char* path); +void load_from_user_preferences(); +void load_from_file_name(const char* path); + +void load_arg_override(std::string_view name, std::string_view value); + +void shutdown(); /** * \brief Save the config to file. */ -void Save(); +void save(); /** * \brief Get a registered CVar by name. @@ -124,6 +133,58 @@ void ClearAllActionBindings(int port); */ void EnumerateRegistered(std::function callback); +/** + * \brief Type-erased change callback. previousValue points at the value before the mutation + * (a `const T*` for a `ConfigVar`) and is valid only for the duration of the call. + */ +using ChangeCallback = std::function; + +/** + * \brief Token identifying a change subscription. 0 is never a valid token. + */ +using Subscription = u64; + +/** + * \brief Subscribe to changes of the named CVar (registered or not yet registered). + * + * Fired synchronously on the mutating thread (in practice the game thread) whenever the CVar's + * effective value changes at runtime: setValue, override/speedrun setters and clears. Values + * applied by config load or launch arguments do *not* notify: loads happen during startup + * before the subsystems callbacks push values into are initialized, and each subsystem reads + * its initial value itself at its own init. Callbacks may mutate other CVars; a nested + * mutation of the same CVar applies but does not re-notify. + */ +Subscription subscribe(std::string_view name, ChangeCallback callback); + +/** + * \brief Typed convenience overload: the callback receives the current and previous values. + */ +template +requires std::invocable Subscription subscribe( + ConfigVar& cVar, Callback&& callback) { + return subscribe(cVar.getName(), + [&cVar, cb = std::forward(callback)](ConfigVarBase&, const void* previousValue) { + cb(cVar.getValue(), *static_cast(previousValue)); + }); +} + +void unsubscribe(Subscription token); + +/** + * \brief Register a CVar and attach a change callback in one step. +* + * Useful for pushing settings into external systems (e.g. aurora) from one place instead of + * every UI setter. The callback fires only for runtime changes (see subscribe); not when + * loaded from config or launch arguments. + */ +template +requires std::invocable Subscription Register( + ConfigVar& cVar, Callback&& onChange) { + auto subscription = subscribe(cVar, std::forward(onChange)); + Register(static_cast(cVar)); + return subscription; +} + template const ConfigImplBase* GetConfigImpl() { static ConfigImpl config; @@ -131,5 +192,3 @@ const ConfigImplBase* GetConfigImpl() { } } // namespace dusk::config - -#endif diff --git a/include/dusk/config_var.hpp b/src/dusk/config_var.hpp similarity index 72% rename from include/dusk/config_var.hpp rename to src/dusk/config_var.hpp index 0bae27bfd3..c4d3ac1d6b 100644 --- a/include/dusk/config_var.hpp +++ b/src/dusk/config_var.hpp @@ -1,10 +1,12 @@ -#ifndef DUSK_CONFIG_VAR_HPP -#define DUSK_CONFIG_VAR_HPP +#pragma once #include "dolphin/types.h" -#include +#include #include +#include +#include #include +#include /** * The configuration system. @@ -68,7 +70,7 @@ protected: /** * The name of this CVar, used in the configuration file. */ - const char* name; + std::string name; /** * Whether this CVar has been registered with the global managing logic. @@ -86,8 +88,8 @@ protected: */ const ConfigImplBase* impl; - ConfigVarBase(const char* name, const ConfigImplBase* impl); - virtual ~ConfigVarBase() = default; + ConfigVarBase(const ConfigVarBase&) = delete; + ConfigVarBase(std::string name, const ConfigImplBase* impl); /** * Check that the CVar is registered, aborting if this is not the case. @@ -97,7 +99,22 @@ protected: abort(); } + /** + * Whether any change subscriber (see config::subscribe) is attached to this CVar's name. + */ + [[nodiscard]] bool has_subscribers() const; + + /** + * Notify change subscribers (see config::subscribe) that the effective value of this CVar + * changed. Called by mutators after the change has been applied; previousValue points at + * the old value (a `const T*` for a `ConfigVar`), valid only for the duration of the + * call. + */ + void notify_changed(const void* previousValue); + public: + virtual ~ConfigVarBase(); + /** * Get the name of this CVar, used in the configuration file. */ @@ -120,6 +137,7 @@ public: * This is necessary to make it legal to access. */ void markRegistered(); + void unmarkRegistered(); /** * Clear a speedrun-mode override if one is active on this CVar. @@ -139,26 +157,36 @@ concept ConfigValueInteger = || std::is_same_v || std::is_same_v; +template +struct ConfigValueTraits { + static constexpr bool enabled = false; +}; + /** * \brief Concept that defines the legal set of types that can be used for CVar values. * * Valid types cannot be cv-qualified and must be basic primitive types (int, float, bool), - * strings, or enums of the basic primitives. + * strings, enums of the basic primitives, or explicitly-enabled structured settings. */ template concept ConfigValue = !std::is_const_v && !std::is_volatile_v + && std::equality_comparable && (std::is_same_v || ConfigValueInteger || std::is_same_v || std::is_same_v || std::is_same_v - || (std::is_enum_v && ConfigValueInteger>)); + || (std::is_enum_v && ConfigValueInteger>) + || ConfigValueTraits::enabled); template const ConfigImplBase* GetConfigImpl(); +template +class ConfigImpl; + template struct ConfigEnumRange { static constexpr auto min = std::numeric_limits>::min(); @@ -185,10 +213,12 @@ public: * @param arg Arguments to forward to construct the default value. */ template - ConfigVar(const char* name, Args&&... arg) - : ConfigVarBase(name, GetConfigImpl()), defaultValue(std::forward(arg)...), + ConfigVar(std::string name, Args&&... arg) + : ConfigVarBase(std::move(name), GetConfigImpl()), defaultValue(std::forward(arg)...), value(), overrideValue() {} + ConfigVar(ConfigVar const&) = delete; + /** * \brief Get the current value of the CVar. * @@ -227,6 +257,7 @@ public: */ void setValue(T newValue, bool replaceOverride = true) { checkRegistered(); + const auto previous = previous_for_notify(); value = std::move(newValue); if (replaceOverride) { @@ -235,6 +266,7 @@ public: } else if (layer != ConfigVarLayer::Override) { layer = ConfigVarLayer::Value; } + notify_if_changed(previous); } operator const T&() { @@ -251,8 +283,10 @@ public: */ void setOverrideValue(T newValue) { checkRegistered(); + const auto previous = previous_for_notify(); overrideValue = std::move(newValue); layer = ConfigVarLayer::Override; + notify_if_changed(previous); } /** @@ -266,25 +300,31 @@ public: void setSpeedrunValue(T newValue) { checkRegistered(); if (layer != ConfigVarLayer::Override) { + const auto previous = previous_for_notify(); priorLayer = layer; overrideValue = std::move(newValue); layer = ConfigVarLayer::Speedrun; + notify_if_changed(previous); } } void clearOverride() { checkRegistered(); if (layer == ConfigVarLayer::Override) { + const auto previous = previous_for_notify(); overrideValue = {}; layer = ConfigVarLayer::Value; + notify_if_changed(previous); } } void clearSpeedrunOverride() override { checkRegistered(); if (layer == ConfigVarLayer::Speedrun) { + const auto previous = previous_for_notify(); overrideValue = {}; layer = priorLayer; + notify_if_changed(previous); } } @@ -298,10 +338,50 @@ public: const ConfigVarLayer effectiveLayer = (layer == ConfigVarLayer::Speedrun) ? priorLayer : layer; return effectiveLayer == ConfigVarLayer::Default ? defaultValue : value; } + +private: + // The config loader applies values through the silent load_* methods below. + friend class ConfigImpl; + + /** + * Copy of the effective value before a mutation, taken only when someone is subscribed. + */ + [[nodiscard]] std::optional previous_for_notify() const { + return has_subscribers() ? std::optional{getValue()} : std::nullopt; + } + + /** + * Notify subscribers if the effective value actually changed across a mutation. + */ + void notify_if_changed(const std::optional& previous) { + if (previous.has_value() && !(getValue() == *previous)) { + notify_changed(&*previous); + } + } + + /** + * setValue(newValue, false) without notifying change subscribers. Used when loading config: + * loads happen during startup before the subsystems change callbacks push values into are + * initialized, and each subsystem applies the loaded value itself at its own init. + */ + void load_value(T newValue) { + checkRegistered(); + value = std::move(newValue); + if (layer != ConfigVarLayer::Override) { + layer = ConfigVarLayer::Value; + } + } + + /** + * setOverrideValue without notifying change subscribers (see load_value). + */ + void load_override_value(T newValue) { + checkRegistered(); + overrideValue = std::move(newValue); + layer = ConfigVarLayer::Override; + } }; using ActionBindConfigVar = ConfigVar; } - -#endif // DUSK_CONFIG_VAR_HPP diff --git a/src/dusk/crash_handler.cpp b/src/dusk/crash_handler.cpp new file mode 100644 index 0000000000..b520a6ff29 --- /dev/null +++ b/src/dusk/crash_handler.cpp @@ -0,0 +1,965 @@ +#if !defined(_WIN32) && !defined(_GNU_SOURCE) +#define _GNU_SOURCE +#endif + +#include "dusk/crash_handler.h" + +#include "dusk/logging.h" +#include "version.h" + +#include +#include +#include +#include + +#if defined(_WIN32) + +#include + +#include + +#if defined(DUSK_CRASH_DBGHELP) +#include +#endif + +#else + +#include +#include +#include +#include +#include +#include + +#if defined(__APPLE__) +#include +#include +#include +#else +#include +#include +#ifndef NT_GNU_BUILD_ID +#define NT_GNU_BUILD_ID 3 +#endif +#endif + +#endif + +#ifndef DUSK_ARCH +#define DUSK_ARCH "unknown" +#endif + +namespace dusk::crash_handler { +namespace { + +constexpr int kStderrFd = 2; +constexpr int kMaxFrames = 128; +constexpr char kHexDigits[] = "0123456789abcdef"; + +struct CrashContext { + uintptr_t moduleBase = 0; + char modulePath[1024] = {}; + uint8_t buildId[64] = {}; + unsigned buildIdLen = 0; + unsigned pdbAge = 0; +}; +CrashContext g_ctx; + +struct ModuleInfo { + uintptr_t base = 0; + uintptr_t size = 0; + char path[1024] = {}; + uint8_t buildId[64] = {}; + unsigned buildIdLen = 0; + unsigned pdbAge = 0; +}; + +void rawWrite(int fd, const char* data, size_t len) { + if (fd < 0) { + return; + } +#if defined(_WIN32) + _write(fd, data, static_cast(len)); +#else + while (len > 0) { + const ssize_t written = ::write(fd, data, len); + if (written <= 0) { + return; + } + data += written; + len -= static_cast(written); + } +#endif +} + +void writeStr(int fd, const char* s) { + if (s != nullptr) { + rawWrite(fd, s, std::strlen(s)); + } +} + +void writeHex(int fd, unsigned long long value) { + char buf[2 + 16]; + size_t o = sizeof(buf); + do { + buf[--o] = kHexDigits[value & 0xF]; + value >>= 4; + } while (value != 0); + buf[--o] = 'x'; + buf[--o] = '0'; + rawWrite(fd, buf + o, sizeof(buf) - o); +} + +void writeDec(int fd, unsigned int value) { + char buf[10]; + size_t o = sizeof(buf); + do { + buf[--o] = static_cast('0' + value % 10); + value /= 10; + } while (value != 0); + rawWrite(fd, buf + o, sizeof(buf) - o); +} + +void writeHexBytes(int fd, const uint8_t* data, unsigned len) { + char buf[2]; + for (unsigned i = 0; i < len; ++i) { + buf[0] = kHexDigits[data[i] >> 4]; + buf[1] = kHexDigits[data[i] & 0xF]; + rawWrite(fd, buf, 2); + } +} + +void writeHexByte(int fd, uint8_t value) { + char buf[2]; + buf[0] = kHexDigits[value >> 4]; + buf[1] = kHexDigits[value & 0xF]; + rawWrite(fd, buf, 2); +} + +void writeQuoted(int fd, const char* s) { + writeStr(fd, "\""); + if (s != nullptr) { + for (const char* p = s; *p != '\0'; ++p) { + if (*p == '"' || *p == '\\') { + rawWrite(fd, "\\", 1); + } + rawWrite(fd, p, 1); + } + } + writeStr(fd, "\""); +} + +const char* baseName(const char* path) { + const char* name = path; + for (const char* p = path; p != nullptr && *p != '\0'; ++p) { + if (*p == '/' || *p == '\\') { + name = p + 1; + } + } + return name[0] != '\0' ? name : "(unknown)"; +} + +void writeBuildId(int fd, const uint8_t* buildId, unsigned buildIdLen, unsigned pdbAge) { + if (buildIdLen == 0) { + writeStr(fd, "(unavailable)"); + return; + } +#if defined(_WIN32) + if (buildIdLen == 16) { + writeHexByte(fd, buildId[3]); + writeHexByte(fd, buildId[2]); + writeHexByte(fd, buildId[1]); + writeHexByte(fd, buildId[0]); + writeStr(fd, "-"); + writeHexByte(fd, buildId[5]); + writeHexByte(fd, buildId[4]); + writeStr(fd, "-"); + writeHexByte(fd, buildId[7]); + writeHexByte(fd, buildId[6]); + writeStr(fd, "-"); + writeHexByte(fd, buildId[8]); + writeHexByte(fd, buildId[9]); + writeStr(fd, "-"); + writeHexBytes(fd, buildId + 10, 6); + if (pdbAge != 0) { + writeStr(fd, "-"); + writeDec(fd, pdbAge); + } + return; + } +#else + (void)pdbAge; +#endif + writeHexBytes(fd, buildId, buildIdLen); +} + +const char* symbolFor(uintptr_t pc, unsigned long long* disp) { +#if defined(_WIN32) && defined(DUSK_CRASH_DBGHELP) + alignas(SYMBOL_INFO) static char storage[sizeof(SYMBOL_INFO) + 512]; + auto* sym = reinterpret_cast(storage); + sym->SizeOfStruct = sizeof(SYMBOL_INFO); + sym->MaxNameLen = 511; + DWORD64 d = 0; + if (SymFromAddr(GetCurrentProcess(), pc, &d, sym)) { + *disp = d; + return sym->Name; + } + return nullptr; +#elif defined(_WIN32) + (void)pc; + (void)disp; + return nullptr; +#else + Dl_info info; + if (dladdr(reinterpret_cast(pc), &info) != 0 && info.dli_sname != nullptr) { + const auto base = reinterpret_cast(info.dli_saddr); + *disp = pc >= base ? pc - base : 0; + return info.dli_sname; + } + return nullptr; +#endif +} + +void fallbackModuleInfo(ModuleInfo& info) { + info = {}; + info.base = g_ctx.moduleBase; + std::strncpy(info.path, g_ctx.modulePath, sizeof(info.path) - 1); + if (g_ctx.buildIdLen > sizeof(info.buildId)) { + info.buildIdLen = sizeof(info.buildId); + } else { + info.buildIdLen = g_ctx.buildIdLen; + } + if (info.buildIdLen != 0) { + std::memcpy(info.buildId, g_ctx.buildId, info.buildIdLen); + } + info.pdbAge = g_ctx.pdbAge; +} + +bool findModuleInfo(uintptr_t pc, ModuleInfo& info); + +void emitAddressDetail(int fd, uintptr_t pc) { + ModuleInfo info; + findModuleInfo(pc, info); + const uintptr_t rva = pc >= info.base ? pc - info.base : 0ull; + writeHex(fd, pc); + writeStr(fd, " module_base="); + writeHex(fd, info.base); + if (info.size != 0) { + writeStr(fd, " image_size="); + writeHex(fd, info.size); + } + writeStr(fd, " rva="); + writeHex(fd, rva); + writeStr(fd, " module="); + writeQuoted(fd, info.path[0] != '\0' ? info.path : baseName(g_ctx.modulePath)); + writeStr(fd, " build_id="); + writeBuildId(fd, info.buildId, info.buildIdLen, info.pdbAge); +} + +void emitFrame(int fd, int index, uintptr_t pc) { + ModuleInfo info; + findModuleInfo(pc, info); + const uintptr_t rva = pc >= info.base ? pc - info.base : 0ull; + + writeStr(fd, "#"); + if (index < 10) { + writeStr(fd, "0"); + } + writeDec(fd, static_cast(index)); + writeStr(fd, " abs="); + writeHex(fd, pc); + writeStr(fd, " module_base="); + writeHex(fd, info.base); + if (info.size != 0) { + writeStr(fd, " image_size="); + writeHex(fd, info.size); + } + writeStr(fd, " rva="); + writeHex(fd, rva); + writeStr(fd, " module="); + writeQuoted(fd, info.path[0] != '\0' ? info.path : baseName(g_ctx.modulePath)); + writeStr(fd, " build_id="); + writeBuildId(fd, info.buildId, info.buildIdLen, info.pdbAge); + unsigned long long disp = 0; + const char* sym = symbolFor(pc, &disp); + if (sym != nullptr && sym[0] != '\0') { + writeStr(fd, " "); + writeStr(fd, sym); + writeStr(fd, "+"); + writeHex(fd, disp); + } + writeStr(fd, "\n"); +} + +void emitHeader(int fd, const char* reason, unsigned long long code, bool hasCode, + uintptr_t faultAddr, uintptr_t crashPc, bool crashPcKnown) { + writeStr(fd, "\n==================== DUSKLIGHT CRASHED ====================\n"); + writeStr(fd, "Build: " DUSK_WC_DESCRIBE " (" DUSK_WC_BRANCH ")\n"); + writeStr(fd, "Revision: " DUSK_WC_REVISION " Date: " DUSK_WC_DATE + " Type: " DUSK_BUILD_TYPE "\n"); + writeStr(fd, "Platform: " DUSK_PLATFORM_NAME " / " DUSK_ARCH "\n"); + writeStr(fd, "Module: "); + writeStr(fd, g_ctx.modulePath[0] != '\0' ? g_ctx.modulePath : "(unknown)"); + writeStr(fd, "\nModule base: "); + writeHex(fd, g_ctx.moduleBase); + writeStr(fd, "\nBuild-ID: "); + writeBuildId(fd, g_ctx.buildId, g_ctx.buildIdLen, g_ctx.pdbAge); + writeStr(fd, "\nReason: "); + writeStr(fd, reason); + if (hasCode) { + writeStr(fd, " ("); + writeHex(fd, code); + writeStr(fd, ")"); + } + writeStr(fd, "\nFault addr: "); + writeHex(fd, faultAddr); + writeStr(fd, "\nCrash PC: "); + if (crashPcKnown) { + emitAddressDetail(fd, crashPc); + } else { + writeStr(fd, "(unavailable on this platform)"); + } + writeStr(fd, "\n"); + writeStr(fd, "Backtrace:\n"); +} + +void emitFooter(int fd) { + writeStr(fd, "========================================================\n"); +} + +#if defined(_WIN32) + +LONG g_inHandler = 0; +LPTOP_LEVEL_EXCEPTION_FILTER g_prevFilter = nullptr; + +bool readPeModuleInfo(uintptr_t moduleBase, ModuleInfo& info) { + const auto* base = reinterpret_cast(moduleBase); + if (base == nullptr) { + return false; + } + const auto* dos = reinterpret_cast(base); + if (dos->e_magic != IMAGE_DOS_SIGNATURE) { + return false; + } + const auto* nt = reinterpret_cast(base + dos->e_lfanew); + if (nt->Signature != IMAGE_NT_SIGNATURE) { + return false; + } + info.base = moduleBase; + info.size = nt->OptionalHeader.SizeOfImage; + const IMAGE_DATA_DIRECTORY& dir = + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG]; + if (dir.VirtualAddress == 0 || dir.Size == 0) { + return true; + } + const auto* dbg = reinterpret_cast(base + dir.VirtualAddress); + const unsigned count = dir.Size / sizeof(IMAGE_DEBUG_DIRECTORY); + for (unsigned i = 0; i < count; ++i) { + if (dbg[i].Type != IMAGE_DEBUG_TYPE_CODEVIEW) { + continue; + } + const auto* cv = base + dbg[i].AddressOfRawData; + if (std::memcmp(cv, "RSDS", 4) != 0) { + continue; + } + std::memcpy(info.buildId, cv + 4, sizeof(GUID)); + info.buildIdLen = sizeof(GUID); + std::memcpy(&info.pdbAge, cv + 4 + sizeof(GUID), sizeof(info.pdbAge)); + break; + } + return true; +} + +void captureBuildId() { + ModuleInfo info; + if (!readPeModuleInfo(g_ctx.moduleBase, info)) { + return; + } + g_ctx.buildIdLen = info.buildIdLen; + if (g_ctx.buildIdLen != 0) { + std::memcpy(g_ctx.buildId, info.buildId, g_ctx.buildIdLen); + } + g_ctx.pdbAge = info.pdbAge; +} + +bool findModuleInfo(uintptr_t pc, ModuleInfo& info) { + fallbackModuleInfo(info); + MEMORY_BASIC_INFORMATION mbi; + if (VirtualQuery(reinterpret_cast(pc), &mbi, sizeof(mbi)) == 0 || + mbi.AllocationBase == nullptr) { + return false; + } + const auto moduleBase = reinterpret_cast(mbi.AllocationBase); + info = {}; + info.base = moduleBase; + GetModuleFileNameA(reinterpret_cast(moduleBase), info.path, + static_cast(sizeof(info.path) - 1)); + readPeModuleInfo(moduleBase, info); + return true; +} + +const char* exceptionName(DWORD code) { + switch (code) { + case EXCEPTION_ACCESS_VIOLATION: + return "EXCEPTION_ACCESS_VIOLATION"; + case EXCEPTION_ILLEGAL_INSTRUCTION: + return "EXCEPTION_ILLEGAL_INSTRUCTION"; + case EXCEPTION_INT_DIVIDE_BY_ZERO: + return "EXCEPTION_INT_DIVIDE_BY_ZERO"; + case EXCEPTION_STACK_OVERFLOW: + return "EXCEPTION_STACK_OVERFLOW"; + case EXCEPTION_DATATYPE_MISALIGNMENT: + return "EXCEPTION_DATATYPE_MISALIGNMENT"; + case EXCEPTION_FLT_DIVIDE_BY_ZERO: + return "EXCEPTION_FLT_DIVIDE_BY_ZERO"; + default: + return "EXCEPTION"; + } +} + +int captureBacktraceWin(CONTEXT ctx, uintptr_t* out, int cap) { + int n = 0; + while (n < cap) { +#if defined(_M_X64) + const DWORD64 ip = ctx.Rip; +#elif defined(_M_ARM64) + const DWORD64 ip = ctx.Pc; +#else + const DWORD64 ip = 0; +#endif + if (ip == 0) { + break; + } + out[n++] = static_cast(ip); +#if defined(_M_X64) || defined(_M_ARM64) + DWORD64 imageBase = 0; + PRUNTIME_FUNCTION fn = RtlLookupFunctionEntry(ip, &imageBase, nullptr); + if (fn != nullptr) { + PVOID handlerData = nullptr; + DWORD64 establisherFrame = 0; + RtlVirtualUnwind(UNW_FLAG_NHANDLER, imageBase, ip, fn, &ctx, &handlerData, + &establisherFrame, nullptr); + continue; + } +#if defined(_M_X64) + if (ctx.Rsp == 0) { + break; + } + ctx.Rip = *reinterpret_cast(ctx.Rsp); + ctx.Rsp += sizeof(DWORD64); +#else + if (ctx.Lr == 0 || ctx.Lr == ip) { + break; + } + ctx.Pc = ctx.Lr; + ctx.Lr = 0; +#endif +#else + break; +#endif + } + return n; +} + +void emit(int fd, EXCEPTION_POINTERS* ep) { + if (fd < 0) { + return; + } + + const DWORD code = ep->ExceptionRecord->ExceptionCode; + const uintptr_t pc = reinterpret_cast(ep->ExceptionRecord->ExceptionAddress); + uintptr_t faultAddr = 0; + if (code == EXCEPTION_ACCESS_VIOLATION && ep->ExceptionRecord->NumberParameters >= 2) { + faultAddr = static_cast(ep->ExceptionRecord->ExceptionInformation[1]); + } + + emitHeader(fd, exceptionName(code), code, true, faultAddr, pc, true); + + uintptr_t frames[kMaxFrames]; + const int frameCount = captureBacktraceWin(*ep->ContextRecord, frames, kMaxFrames); + for (int i = 0; i < frameCount; ++i) { + emitFrame(fd, i, frames[i]); + } + + emitFooter(fd); +} + +LONG WINAPI windowsHandler(EXCEPTION_POINTERS* ep) { + if (InterlockedCompareExchange(&g_inHandler, 1, 0) != 0) { + return EXCEPTION_CONTINUE_SEARCH; + } + emit(kStderrFd, ep); + const int logFd = dusk::GetLogFileDescriptor(); + if (logFd >= 0) { + emit(logFd, ep); + } + if (g_prevFilter != nullptr) { + return g_prevFilter(ep); + } + return EXCEPTION_CONTINUE_SEARCH; +} + +#else + +constexpr int kSignals[] = {SIGSEGV, SIGBUS, SIGABRT, SIGILL, SIGFPE}; +constexpr int kSignalCount = static_cast(sizeof(kSignals) / sizeof(kSignals[0])); +constexpr int kAltStackSize = 128 * 1024; + +volatile std::sig_atomic_t g_inHandler = 0; +char g_altStack[kAltStackSize]; +struct sigaction g_prev[kSignalCount]; +std::terminate_handler g_prevTerminate = nullptr; + +void crashRegs(void* ucv, uintptr_t& pc, uintptr_t& lr, uintptr_t& fp) { + pc = 0; + lr = 0; + fp = 0; + if (ucv == nullptr) { + return; + } + auto* uc = static_cast(ucv); +#if defined(__APPLE__) +#if defined(__aarch64__) || defined(__arm64__) + pc = static_cast(uc->uc_mcontext->__ss.__pc); + lr = static_cast(uc->uc_mcontext->__ss.__lr); + fp = static_cast(uc->uc_mcontext->__ss.__fp); +#elif defined(__x86_64__) + pc = static_cast(uc->uc_mcontext->__ss.__rip); + fp = static_cast(uc->uc_mcontext->__ss.__rbp); +#endif +#elif defined(__ANDROID__) +#if defined(__aarch64__) + pc = static_cast(uc->uc_mcontext.pc); + lr = static_cast(uc->uc_mcontext.regs[30]); + fp = static_cast(uc->uc_mcontext.regs[29]); +#elif defined(__x86_64__) + pc = static_cast(uc->uc_mcontext.gregs[REG_RIP]); + fp = static_cast(uc->uc_mcontext.gregs[REG_RBP]); +#elif defined(__arm__) + pc = static_cast(uc->uc_mcontext.arm_pc); + lr = static_cast(uc->uc_mcontext.arm_lr); + fp = static_cast(uc->uc_mcontext.arm_fp); +#elif defined(__i386__) + pc = static_cast(uc->uc_mcontext.gregs[REG_EIP]); + fp = static_cast(uc->uc_mcontext.gregs[REG_EBP]); +#endif +#elif defined(__linux__) +#if defined(__x86_64__) + pc = static_cast(uc->uc_mcontext.gregs[REG_RIP]); + fp = static_cast(uc->uc_mcontext.gregs[REG_RBP]); +#elif defined(__aarch64__) + pc = static_cast(uc->uc_mcontext.pc); + lr = static_cast(uc->uc_mcontext.regs[30]); + fp = static_cast(uc->uc_mcontext.regs[29]); +#elif defined(__i386__) + pc = static_cast(uc->uc_mcontext.gregs[REG_EIP]); + fp = static_cast(uc->uc_mcontext.gregs[REG_EBP]); +#endif +#endif +} + +bool pcNearFunctionEntry(uintptr_t pc) { + constexpr uintptr_t kPrologueWindow = 20; + Dl_info info; + if (dladdr(reinterpret_cast(pc), &info) == 0 || info.dli_saddr == nullptr) { + return false; + } + const auto start = reinterpret_cast(info.dli_saddr); + return pc >= start && pc - start <= kPrologueWindow; +} + +int captureBacktraceFP(uintptr_t pc, uintptr_t lr, uintptr_t fp, uintptr_t* out, int cap) { + int n = 0; + if (pc != 0 && n < cap) { + out[n++] = pc; + } + bool dedupeLr = false; + if (lr != 0 && lr != pc && n < cap && pcNearFunctionEntry(pc)) { + out[n++] = lr; + dedupeLr = true; + } + uintptr_t cur = fp; + uintptr_t prev = 0; + constexpr uintptr_t kMaxFrameSpan = 16u << 20; + while (n < cap) { + if (cur == 0 || (cur & (sizeof(uintptr_t) - 1)) != 0 || cur <= prev) { + break; + } + const auto* slot = reinterpret_cast(cur); + const uintptr_t next = slot[0]; + const uintptr_t ret = slot[1]; + if (ret == 0) { + break; + } + const bool skip = dedupeLr && ret == lr; + dedupeLr = false; + if (!skip) { + out[n++] = ret; + } + if (next != 0 && next > cur && next - cur > kMaxFrameSpan) { + break; + } + prev = cur; + cur = next; + } + return n; +} + +struct UnwindState { + uintptr_t* pcs; + int count; + int cap; + int skip; +}; + +_Unwind_Reason_Code unwindCb(struct _Unwind_Context* ctx, void* arg) { + auto* s = static_cast(arg); + const uintptr_t ip = static_cast(_Unwind_GetIP(ctx)); + if (ip == 0) { + return _URC_END_OF_STACK; + } + if (s->skip > 0) { + --s->skip; + return _URC_NO_REASON; + } + if (s->count >= s->cap) { + return _URC_END_OF_STACK; + } + s->pcs[s->count++] = ip; + return _URC_NO_REASON; +} + +int captureBacktrace(uintptr_t* pcs, int cap, int skip) { + UnwindState s{pcs, 0, cap, skip}; + _Unwind_Backtrace(&unwindCb, &s); + return s.count; +} + +void prewarmUnwinder() { + uintptr_t warm[4]; + captureBacktrace(warm, 4, 0); +} + +#if defined(__APPLE__) + +bool readMachBuildId(uintptr_t moduleBase, ModuleInfo& info) { + const auto* header = reinterpret_cast(moduleBase); + if (header == nullptr || header->magic != MH_MAGIC_64) { + return false; + } + const auto* lc = reinterpret_cast( + reinterpret_cast(header) + sizeof(struct mach_header_64)); + for (uint32_t i = 0; i < header->ncmds; ++i) { + if (lc->cmd == LC_UUID) { + const auto* uuid = reinterpret_cast(lc); + std::memcpy(info.buildId, uuid->uuid, sizeof(uuid->uuid)); + info.buildIdLen = sizeof(uuid->uuid); + return true; + } + lc = reinterpret_cast( + reinterpret_cast(lc) + lc->cmdsize); + } + return true; +} + +void captureBuildId() { + ModuleInfo info; + if (!readMachBuildId(g_ctx.moduleBase, info)) { + return; + } + g_ctx.buildIdLen = info.buildIdLen; + if (g_ctx.buildIdLen != 0) { + std::memcpy(g_ctx.buildId, info.buildId, g_ctx.buildIdLen); + } +} + +#else + +bool segmentContains(const dl_phdr_info* info, uintptr_t addr) { + for (int i = 0; i < info->dlpi_phnum; ++i) { + const ElfW(Phdr)& ph = info->dlpi_phdr[i]; + if (ph.p_type != PT_LOAD) { + continue; + } + const uintptr_t start = info->dlpi_addr + ph.p_vaddr; + if (addr >= start && addr < start + ph.p_memsz) { + return true; + } + } + return false; +} + +void readElfModuleInfo(const dl_phdr_info* info, ModuleInfo& module) { + uintptr_t minAddr = ~static_cast(0); + uintptr_t maxAddr = 0; + for (int i = 0; i < info->dlpi_phnum; ++i) { + const ElfW(Phdr)& ph = info->dlpi_phdr[i]; + if (ph.p_type != PT_LOAD) { + continue; + } + const uintptr_t start = info->dlpi_addr + ph.p_vaddr; + const uintptr_t end = start + ph.p_memsz; + if (start < minAddr) { + minAddr = start; + } + if (end > maxAddr) { + maxAddr = end; + } + } + if (minAddr <= maxAddr && maxAddr != 0) { + module.base = minAddr; + module.size = maxAddr - minAddr; + } + + for (int i = 0; i < info->dlpi_phnum; ++i) { + const ElfW(Phdr)& ph = info->dlpi_phdr[i]; + if (ph.p_type != PT_NOTE) { + continue; + } + const auto* p = reinterpret_cast(info->dlpi_addr + ph.p_vaddr); + const uint8_t* end = p + ph.p_memsz; + while (p + sizeof(ElfW(Nhdr)) <= end) { + const auto* nh = reinterpret_cast(p); + const char* name = reinterpret_cast(nh + 1); + const uint8_t* desc = + reinterpret_cast(name + ((nh->n_namesz + 3) & ~3u)); + if (nh->n_type == NT_GNU_BUILD_ID && nh->n_namesz == 4 && + std::memcmp(name, "GNU", 4) == 0) { + unsigned n = nh->n_descsz; + if (n > sizeof(module.buildId)) { + n = sizeof(module.buildId); + } + std::memcpy(module.buildId, desc, n); + module.buildIdLen = n; + return; + } + p = desc + ((nh->n_descsz + 3) & ~3u); + } + } +} + +int elfBuildIdCallback(dl_phdr_info* info, size_t, void* arg) { + const auto self = *static_cast(arg); + if (!segmentContains(info, self)) { + return 0; + } + ModuleInfo module; + readElfModuleInfo(info, module); + g_ctx.buildIdLen = module.buildIdLen; + if (g_ctx.buildIdLen != 0) { + std::memcpy(g_ctx.buildId, module.buildId, g_ctx.buildIdLen); + } + return 1; +} + +void captureBuildId() { + uintptr_t self = reinterpret_cast(&install); + dl_iterate_phdr(&elfBuildIdCallback, &self); +} + +#endif + +#if !defined(__APPLE__) +struct ElfModuleSearch { + uintptr_t pc; + ModuleInfo* module; +}; + +int elfModuleInfoCallback(dl_phdr_info* info, size_t, void* arg) { + auto* search = static_cast(arg); + if (!segmentContains(info, search->pc)) { + return 0; + } + if (info->dlpi_name != nullptr && info->dlpi_name[0] != '\0') { + std::strncpy(search->module->path, info->dlpi_name, + sizeof(search->module->path) - 1); + } + readElfModuleInfo(info, *search->module); + return 1; +} +#endif + +bool findModuleInfo(uintptr_t pc, ModuleInfo& info) { + fallbackModuleInfo(info); + Dl_info moduleInfo; + if (dladdr(reinterpret_cast(pc), &moduleInfo) == 0) { + return false; + } + if (moduleInfo.dli_fbase != nullptr) { + info.base = reinterpret_cast(moduleInfo.dli_fbase); + } + if (moduleInfo.dli_fname != nullptr && moduleInfo.dli_fname[0] != '\0') { + info.path[0] = '\0'; + std::strncpy(info.path, moduleInfo.dli_fname, sizeof(info.path) - 1); + } + info.buildIdLen = 0; + info.pdbAge = 0; +#if defined(__APPLE__) + readMachBuildId(info.base, info); +#else + ElfModuleSearch search{pc, &info}; + dl_iterate_phdr(&elfModuleInfoCallback, &search); +#endif + return true; +} + +const char* signalName(int sig) { + switch (sig) { + case SIGSEGV: + return "SIGSEGV (segmentation fault)"; + case SIGBUS: + return "SIGBUS (bus error)"; + case SIGABRT: + return "SIGABRT (abort)"; + case SIGILL: + return "SIGILL (illegal instruction)"; + case SIGFPE: + return "SIGFPE (floating point exception)"; + default: + return "unknown signal"; + } +} + +void emit(int fd, int sig, siginfo_t* info, const uintptr_t* frames, int frameCount, + uintptr_t pc) { + if (fd < 0) { + return; + } + const uintptr_t faultAddr = + info != nullptr ? reinterpret_cast(info->si_addr) : 0; + emitHeader(fd, signalName(sig), 0, false, faultAddr, pc, pc != 0); + for (int i = 0; i < frameCount; ++i) { + emitFrame(fd, i, frames[i]); + } + emitFooter(fd); +} + +void chainPrevious(int sig, siginfo_t* info, void* uc) { + for (int i = 0; i < kSignalCount; ++i) { + if (kSignals[i] != sig) { + continue; + } + const struct sigaction& o = g_prev[i]; + if ((o.sa_flags & SA_SIGINFO) != 0) { + if (o.sa_sigaction != nullptr) { + o.sa_sigaction(sig, info, uc); + return; + } + } else { + if (o.sa_handler == SIG_IGN) { + return; + } + if (o.sa_handler != SIG_DFL && o.sa_handler != nullptr) { + o.sa_handler(sig); + return; + } + } + break; + } + ::signal(sig, SIG_DFL); + ::raise(sig); +} + +void handler(int sig, siginfo_t* info, void* ucv) { + if (g_inHandler != 0) { + _exit(128 + sig); + } + g_inHandler = 1; + + uintptr_t pc = 0; + uintptr_t lr = 0; + uintptr_t fp = 0; + crashRegs(ucv, pc, lr, fp); + uintptr_t frames[kMaxFrames]; + int frameCount = captureBacktraceFP(pc, lr, fp, frames, kMaxFrames); + if (frameCount < 2) { + frameCount = captureBacktrace(frames, kMaxFrames, 2); + } + + emit(kStderrFd, sig, info, frames, frameCount, pc); + const int logFd = dusk::GetLogFileDescriptor(); + if (logFd >= 0) { + emit(logFd, sig, info, frames, frameCount, pc); + ::fsync(logFd); + } + + chainPrevious(sig, info, ucv); +} + +void writeTerminateMessage(int fd, const char* body, const char* what) { + writeStr(fd, "\nterminate: "); + writeStr(fd, body); + writeStr(fd, what); + writeStr(fd, "\n"); +} + +void onTerminate() { + const char* body = "unknown reason"; + const char* what = nullptr; + if (std::exception_ptr ep = std::current_exception()) { + try { + std::rethrow_exception(ep); + } catch (const std::exception& e) { + body = "uncaught exception: "; + what = e.what(); + } catch (...) { + body = "uncaught non-std exception"; + } + } else { + body = "no active exception"; + } + writeTerminateMessage(kStderrFd, body, what); + writeTerminateMessage(dusk::GetLogFileDescriptor(), body, what); + if (g_prevTerminate != nullptr) { + g_prevTerminate(); + } + std::abort(); +} + +#endif + +} // namespace + +void install() { +#if defined(_WIN32) + g_ctx.moduleBase = reinterpret_cast(GetModuleHandleW(nullptr)); + GetModuleFileNameA(nullptr, g_ctx.modulePath, sizeof(g_ctx.modulePath) - 1); + captureBuildId(); +#if defined(DUSK_CRASH_DBGHELP) + SymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_LOAD_LINES); + SymInitialize(GetCurrentProcess(), nullptr, TRUE); +#endif + g_prevFilter = SetUnhandledExceptionFilter(&windowsHandler); +#elif !defined(__APPLE__) || !TARGET_OS_TV + Dl_info moduleInfo; + if (dladdr(reinterpret_cast(&install), &moduleInfo) != 0) { + g_ctx.moduleBase = reinterpret_cast(moduleInfo.dli_fbase); + if (moduleInfo.dli_fname != nullptr) { + std::strncpy(g_ctx.modulePath, moduleInfo.dli_fname, + sizeof(g_ctx.modulePath) - 1); + } + } + captureBuildId(); + prewarmUnwinder(); + + static stack_t altStack; + altStack.ss_sp = g_altStack; + altStack.ss_size = sizeof(g_altStack); + altStack.ss_flags = 0; + sigaltstack(&altStack, nullptr); + + struct sigaction sa; + std::memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = &handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = SA_SIGINFO | SA_ONSTACK; + + for (int i = 0; i < kSignalCount; ++i) { + sigaction(kSignals[i], &sa, &g_prev[i]); + } + + g_prevTerminate = std::set_terminate(&onTerminate); +#endif +} + +} // namespace dusk::crash_handler diff --git a/src/dusk/crash_handler.h b/src/dusk/crash_handler.h new file mode 100644 index 0000000000..c2cfadf5d1 --- /dev/null +++ b/src/dusk/crash_handler.h @@ -0,0 +1,7 @@ +#pragma once + +namespace dusk::crash_handler { + +void install(); + +} // namespace dusk::crash_handler diff --git a/include/dusk/crash_reporting.h b/src/dusk/crash_reporting.h similarity index 100% rename from include/dusk/crash_reporting.h rename to src/dusk/crash_reporting.h diff --git a/src/dusk/data.cpp b/src/dusk/data.cpp index ce61965947..48517b7308 100644 --- a/src/dusk/data.cpp +++ b/src/dusk/data.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -28,8 +27,6 @@ namespace { aurora::Module Log{"dusk::data"}; constexpr auto kLocationDescriptorName = "data_location.json"; -constexpr auto kPipelineCacheName = "pipeline_cache.db"; -constexpr auto kInitialPipelineCacheName = "initial_pipeline_cache.db"; constexpr std::array kUserDataDirectories = { "texture_replacements", @@ -37,10 +34,11 @@ constexpr std::array kUserDataDirectories = { "EUR", "JAP", }; -constexpr std::array kUserDataFiles = { +constexpr std::array kUserDataFiles = { "achievements.json", "config.json", "controller_ports.dat", + "gamecontrollerdb.txt", "imgui.ini", "keyboard_bindings.dat", "states.json", @@ -111,7 +109,7 @@ std::filesystem::path get_pref_path() { Log.fatal("Unable to get PrefPath: {}", SDL_GetError()); } - std::filesystem::path result{reinterpret_cast(prefPath)}; + std::filesystem::path result = path_from_utf8(prefPath); SDL_free(prefPath); return result; } @@ -123,14 +121,6 @@ std::filesystem::path active_pref_path() { return get_pref_path(); } -std::filesystem::path base_path_relative(const std::filesystem::path& path) { - const auto* basePath = SDL_GetBasePath(); - if (!basePath) { - return path; - } - return std::filesystem::path{basePath} / path; -} - std::filesystem::path default_data_path(const std::filesystem::path& prefPath) { #ifdef __APPLE__ #if TARGET_OS_IOS && !TARGET_OS_TV @@ -525,7 +515,14 @@ bool validate_writable_data_path(const std::filesystem::path& path, std::string* try { io::FileStream::WriteAllText(probePath, "dusk"); } catch (const std::exception& e) { +#if defined(__ANDROID__) + set_error(errorOut, + fmt::format("{} could not write to the selected folder. On Android, allow " + "\"All files access\" for Dusklight and try again.", + AppName)); +#else set_error(errorOut, fmt::format("{} could not write to the selected folder.", AppName)); +#endif Log.warn("Failed write probe for custom data folder '{}': {}", io::fs_path_to_string(path), e.what()); return false; @@ -881,104 +878,16 @@ void ensure_data_directory(const std::filesystem::path& dataPath) { } } -SDL_IOStream* open_initial_pipeline_cache_source(std::string& sourcePathString) { - const auto basePath = base_path_relative(kInitialPipelineCacheName); - sourcePathString = io::fs_path_to_string(basePath); - auto* source = SDL_IOFromFile(sourcePathString.c_str(), "rb"); - if (source != nullptr) { - return source; - } - - sourcePathString = std::string{kInitialPipelineCacheName}; - return SDL_IOFromFile(sourcePathString.c_str(), "rb"); -} - -void ensure_initial_pipeline_cache(const std::filesystem::path& configDir) { - if (configDir.empty()) { - return; - } - - std::error_code ec; - std::filesystem::create_directories(configDir, ec); - if (ec) { - Log.warn("Failed to create config directory '{}' for pipeline cache: {}", - io::fs_path_to_string(configDir), ec.message()); - return; - } - - const auto pipelineCachePath = configDir / kPipelineCacheName; - if (std::filesystem::exists(pipelineCachePath, ec)) { - return; - } - - std::string sourcePathString; - SDL_IOStream* source = open_initial_pipeline_cache_source(sourcePathString); - if (source == nullptr) { - Log.info("No bundled initial pipeline cache found"); - return; - } - - const auto pipelineCacheString = io::fs_path_to_string(pipelineCachePath); - SDL_IOStream* destination = SDL_IOFromFile(pipelineCacheString.c_str(), "wb"); - if (destination == nullptr) { - Log.warn("Failed to open '{}' for seeded pipeline cache: {}", pipelineCacheString, - SDL_GetError()); - SDL_CloseIO(source); - return; - } - - bool copied = true; - std::array buffer{}; - while (true) { - const size_t bytesRead = SDL_ReadIO(source, buffer.data(), buffer.size()); - if (bytesRead > 0) { - size_t bytesWritten = 0; - while (bytesWritten < bytesRead) { - const size_t written = SDL_WriteIO( - destination, buffer.data() + bytesWritten, bytesRead - bytesWritten); - if (written == 0) { - Log.warn("Failed to write seeded pipeline cache '{}': {}", pipelineCacheString, - SDL_GetError()); - copied = false; - break; - } - bytesWritten += written; - } - } - - if (!copied) { - break; - } - - if (bytesRead < buffer.size()) { - if (SDL_GetIOStatus(source) == SDL_IO_STATUS_EOF) { - break; - } - - Log.warn( - "Failed to read bundled pipeline cache '{}': {}", sourcePathString, SDL_GetError()); - copied = false; - break; - } - } - - if (!SDL_CloseIO(destination)) { - Log.warn( - "Failed to close seeded pipeline cache '{}': {}", pipelineCacheString, SDL_GetError()); - copied = false; - } - SDL_CloseIO(source); - - if (!copied) { - std::filesystem::remove(pipelineCachePath, ec); - return; - } - - Log.info("Seeded pipeline cache from '{}'", sourcePathString); -} - } // namespace +std::filesystem::path base_path_relative(const std::filesystem::path& path) { + const auto* basePath = SDL_GetBasePath(); + if (!basePath) { + return path; + } + return path_from_utf8(basePath) / path; +} + bool open_data_path() { #if DUSK_CAN_OPEN_DATA_FOLDER std::error_code ec; @@ -1089,7 +998,6 @@ Paths initialize_data() { migrate_data(prefPath, dataPath, descriptor ? &descriptor->descriptor : nullptr); ensure_data_directory(dataPath); ensure_data_directory(prefPath); - ensure_initial_pipeline_cache(prefPath); return Paths{ .userPath = dataPath, @@ -1097,4 +1005,50 @@ Paths initialize_data() { }; } +std::filesystem::path user_home_path() { + const char* homePath = SDL_GetUserFolder(SDL_FOLDER_HOME); + if (homePath == nullptr || homePath[0] == '\0') { + return {}; + } + return std::filesystem::path{reinterpret_cast(homePath)}; +} + +std::filesystem::path normalized_display_path(const std::filesystem::path& path) { + std::error_code ec; + auto normalized = std::filesystem::weakly_canonical(path, ec); + if (!ec) { + return normalized; + } + + normalized = std::filesystem::absolute(path, ec); + if (!ec) { + return normalized.lexically_normal(); + } + + return path.lexically_normal(); +} + +std::string abbreviated_path_string(const std::filesystem::path& path) { + const auto homePath = user_home_path(); + if (path.empty() || homePath.empty()) { + return io::fs_path_to_string(path); + } + + const auto normalizedPath = normalized_display_path(path); + const auto normalizedHome = normalized_display_path(homePath); + if (normalizedPath == normalizedHome) { + return "~"; + } + + const auto relativePath = normalizedPath.lexically_relative(normalizedHome); + if (!relativePath.empty() && !relativePath.is_absolute()) { + const auto it = relativePath.begin(); + if (it == relativePath.end() || *it != "..") { + return io::fs_path_to_string(std::filesystem::path{"~"} / relativePath); + } + } + + return io::fs_path_to_string(path); +} + } // namespace dusk::data diff --git a/src/dusk/data.hpp b/src/dusk/data.hpp index c3ce495b46..a2f9313852 100644 --- a/src/dusk/data.hpp +++ b/src/dusk/data.hpp @@ -15,7 +15,7 @@ #define DUSK_CAN_OPEN_DATA_FOLDER 0 #endif -#if (defined(__APPLE__) && TARGET_OS_IOS && !TARGET_OS_MACCATALYST) || defined(__ANDROID__) +#if (defined(__APPLE__) && TARGET_OS_IOS && !TARGET_OS_MACCATALYST) #define DUSK_CAN_CHANGE_DATA_FOLDER 0 #else #define DUSK_CAN_CHANGE_DATA_FOLDER 1 @@ -29,6 +29,7 @@ struct Paths { }; Paths initialize_data(); +std::filesystem::path base_path_relative(const std::filesystem::path& path); std::filesystem::path configured_data_path(); std::filesystem::path cache_path(); bool open_data_path(); @@ -38,5 +39,8 @@ bool set_portable_data_path(); bool reset_data_path(); bool is_default_data_path(); bool is_data_path_restart_pending(); +std::filesystem::path user_home_path(); +std::filesystem::path normalized_display_path(const std::filesystem::path& path); +std::string abbreviated_path_string(const std::filesystem::path& path); } // namespace dusk::data diff --git a/include/dusk/discord_presence.hpp b/src/dusk/discord_presence.hpp similarity index 100% rename from include/dusk/discord_presence.hpp rename to src/dusk/discord_presence.hpp diff --git a/include/dusk/dusk.h b/src/dusk/dusk.h similarity index 87% rename from include/dusk/dusk.h rename to src/dusk/dusk.h index 911ddbb535..b95b33515e 100644 --- a/include/dusk/dusk.h +++ b/src/dusk/dusk.h @@ -1,5 +1,4 @@ -#ifndef DUSK_DUSK_H -#define DUSK_DUSK_H +#pragma once #include @@ -19,5 +18,3 @@ constexpr u32 defaultAspectRatioW = 19; constexpr u32 defaultAspectRatioH = 14; static_assert(defaultWindowWidth / defaultAspectRatioW == defaultWindowHeight / defaultAspectRatioH); - -#endif // DUSK_DUSK_H diff --git a/src/dusk/dvd_asset.cpp b/src/dusk/dvd_asset.cpp index 75c82107cc..f5c8e73d4d 100644 --- a/src/dusk/dvd_asset.cpp +++ b/src/dusk/dvd_asset.cpp @@ -1,6 +1,6 @@ #include "dusk/dvd_asset.hpp" #include "dusk/logging.h" -#include "dusk/endian.h" +#include "helpers/endian.h" #include "dolphin/dvd.h" #include "DynamicLink.h" #include "JSystem/JKernel/JKRArchive.h" diff --git a/include/dusk/dvd_asset.hpp b/src/dusk/dvd_asset.hpp similarity index 100% rename from include/dusk/dvd_asset.hpp rename to src/dusk/dvd_asset.hpp diff --git a/include/dusk/extras.h b/src/dusk/extras.h similarity index 73% rename from include/dusk/extras.h rename to src/dusk/extras.h index 562ca051c1..8a3d633a3f 100644 --- a/include/dusk/extras.h +++ b/src/dusk/extras.h @@ -1,5 +1,4 @@ -#ifndef _SRC_EXTRAS_H_ -#define _SRC_EXTRAS_H_ +#pragma once #ifdef __cplusplus extern "C" { @@ -13,5 +12,3 @@ int stricmp(const char* str1, const char* str2); #ifdef __cplusplus } #endif - -#endif // _SRC_EXTRAS_H_ diff --git a/src/dusk/frame_interpolation.cpp b/src/dusk/frame_interpolation.cpp index 06cc70c330..be03d51e96 100644 --- a/src/dusk/frame_interpolation.cpp +++ b/src/dusk/frame_interpolation.cpp @@ -1,14 +1,15 @@ #include "dusk/frame_interpolation.h" -#include -#include "mtx.h" #include "f_op/f_op_camera_mng.h" #include "m_Do/m_Do_graphic.h" +#include "mtx.h" + +#include namespace { struct Recording { - std::unordered_map matrix_values; + absl::flat_hash_map matrix_values; }; bool s_initialized = false; @@ -26,7 +27,7 @@ uint64_t g_sim_tick_seq = 0; Recording g_current_recording; Recording g_previous_recording; -std::unordered_map g_replacements; +absl::flat_hash_map g_replacements; struct CameraSnapshot { cXyz eye{}; @@ -142,8 +143,8 @@ uint64_t sim_tick_seq() { return g_sim_tick_seq; } -void begin_frame(bool enabled, bool is_sim_frame, float step) { - g_enabled = enabled; +void begin_frame(FrameInterpMode mode, bool is_sim_frame, float step) { + g_enabled = mode != FrameInterpMode::Off; g_is_sim_frame = is_sim_frame; g_step = std::clamp(step, 0.0f, 1.0f); } diff --git a/include/dusk/frame_interpolation.h b/src/dusk/frame_interpolation.h similarity index 93% rename from include/dusk/frame_interpolation.h rename to src/dusk/frame_interpolation.h index 0fa8c208bd..5f2f3d134b 100644 --- a/include/dusk/frame_interpolation.h +++ b/src/dusk/frame_interpolation.h @@ -4,6 +4,7 @@ #include #include #include +#include "settings.h" class camera_process_class; class view_class; @@ -18,7 +19,7 @@ void begin_record(); void end_record(); void begin_sim_tick(); uint64_t sim_tick_seq(); -void begin_frame(bool enabled, bool is_sim_frame, float step); +void begin_frame(FrameInterpMode mode, bool is_sim_frame, float step); void interpolate(); float get_interpolation_step(); diff --git a/src/dusk/game_clock.cpp b/src/dusk/game_clock.cpp index 8b887f610c..1dc7fbf322 100644 --- a/src/dusk/game_clock.cpp +++ b/src/dusk/game_clock.cpp @@ -4,6 +4,7 @@ #include #include #include +#include namespace dusk::game_clock { @@ -45,7 +46,8 @@ MainLoopPacer advance_main_loop() { MainLoopPacer out{}; out.presentation_dt_seconds = presentation_dt; - const bool should_interpolate = dusk::getSettings().game.enableFrameInterpolation && + const bool should_interpolate = dusk::getSettings().game.enableFrameInterpolation.getValue() != + dusk::FrameInterpMode::Off && !dusk::getTransientSettings().skipFrameRateLimit; out.is_interpolating = should_interpolate; out.sim_pace = sim_pace(); diff --git a/include/dusk/game_clock.h b/src/dusk/game_clock.h similarity index 100% rename from include/dusk/game_clock.h rename to src/dusk/game_clock.h diff --git a/src/dusk/gamepad_color.cpp b/src/dusk/gamepad_color.cpp index cba32da632..9fea8fd769 100644 --- a/src/dusk/gamepad_color.cpp +++ b/src/dusk/gamepad_color.cpp @@ -5,102 +5,124 @@ #include #include -cXyz currentGamepadColor = {0, 0, 0}; -cXyz finalGamepadColor = {0, 0, 0}; -cXyz additionalGamepadColor = {0, 0, 0}; +#include "ui/controller_config.hpp" -float lerpSpeed = 0.0f; +#include -const cXyz duskColor = {50, 50, -50}; -const cXyz noColor = {0, 0, 0}; +namespace dusk::input { -cXyz LerpColor(cXyz a, cXyz b, float t) { - return {std::lerp(a.x, b.x, t), std::lerp(a.y, b.y, t), std::lerp(a.z, b.z, t)}; -} +namespace { + cXyz currentColor = {0, 0, 0}; + float lerpSpeed = 0.0f; -void FadeLED(cXyz newColor, float speed) { - finalGamepadColor = newColor; - lerpSpeed = speed / 30.0f; -} + enum ColorVariations : u8 { + NO_COLOR = 0, + DUSK_COLOR = 1, + ZHINT = 2, + LINK_WOLF = 3, + LINK_CASUAL = 4, + LINK_KOKIRI = 5, + LINK_ZORA = 6, + LINK_MAGIC = 7, + LINK_MAGIC_HEAVY = 8, + }; -void SetLED(cXyz newColor) { - currentGamepadColor = newColor; - finalGamepadColor = newColor; -} + struct ColorSetting { + cXyz color; + float speed; + }; -void SetGamepadAdditionalColor(cXyz addColor) { - additionalGamepadColor.x = addColor.x; - additionalGamepadColor.y = addColor.y; - additionalGamepadColor.z = addColor.z; -} + const ColorSetting kColorTable[] = { + /* 0: NO_COLOR */ { {0, 0, 0}, 2.0f }, + /* 1: DUSK_COLOR */ { {50, 50, -50}, 2.0f }, + /* 2: ZHINT */ { {50, 50, 175}, 2.0f }, + /* 3: LINK_WOLF */ { {115, 115, 75}, 5.0f }, + /* 4: LINK_CASUAL */ { {235, 230, 115}, 5.0f }, + /* 5: LINK_KOKIRI */ { {0, 100, 0}, 5.0f }, + /* 6: LINK_ZORA */ { {0, 0, 100}, 5.0f }, + /* 7: LINK_MAGIC */ { {100, 0, 5}, 5.0f }, + /* 8: LINK_MAGIC_HEAVY */ { {5, 100, 100}, 5.0f }, + }; -void handleGamepadColor() { - bool setColor = false; - - fopAc_ac_c* zhint = dComIfGp_att_getZHint(); - if (zhint != NULL) { - FadeLED({50, 50, 175}, 2.0f); - setColor = true; + cXyz LerpColor(const cXyz a, const cXyz b, const float t) { + return {std::lerp(a.x, b.x, t), std::lerp(a.y, b.y, t), std::lerp(a.z, b.z, t)}; } - daPy_py_c* player = daPy_getPlayerActorClass(); - daAlink_c* link = daAlink_getAlinkActorClass(); + void clamp(cXyz& color) { + color.x = std::clamp(color.x, 0.0f, 255.0f); + color.y = std::clamp(color.y, 0.0f, 255.0f); + color.z = std::clamp(color.z, 0.0f, 255.0f); + } + + ColorSetting getColorSetting() { + const fopAc_ac_c* zHint = dComIfGp_att_getZHint(); + if (zHint != nullptr) { + return kColorTable[ZHINT]; + } + + const daAlink_c* link = daAlink_getAlinkActorClass(); + + if (link == nullptr) + return kColorTable[DUSK_COLOR]; - if (link != nullptr && !setColor) { if (link->checkWolf()) { - FadeLED({115, 115, 75}, 5.0f); - setColor = true; - } else { - switch (dComIfGs_getSelectEquipClothes()) { - case dItemNo_WEAR_KOKIRI_e: - FadeLED({0, 100, 0}, 5.0f); - setColor = true; - break; - case dItemNo_WEAR_ZORA_e: - FadeLED({0, 0, 100}, 5.0f); - setColor = true; - break; - case dItemNo_ARMOR_e: - if (link->checkMagicArmorHeavy()) { - FadeLED({5, 100, 100}, 5.0f); - } else { - FadeLED({100, 0, 5}, 5.0f); - } - setColor = true; - break; - case dItemNo_WEAR_CASUAL_e: - FadeLED({235, 230, 115}, 5.0f); - setColor = true; - break; + return kColorTable[LINK_WOLF]; + } + + switch (dComIfGs_getSelectEquipClothes()) { + case dItemNo_WEAR_KOKIRI_e: + return kColorTable[LINK_KOKIRI]; + case dItemNo_WEAR_ZORA_e: + return kColorTable[LINK_ZORA]; + case dItemNo_ARMOR_e: + if (link->checkMagicArmorHeavy()) { + return kColorTable[LINK_MAGIC_HEAVY]; } + + return kColorTable[LINK_MAGIC]; + case dItemNo_WEAR_CASUAL_e: + return kColorTable[LINK_CASUAL]; + default: + return kColorTable[LINK_KOKIRI]; } } - if (dKy_darkworld_check()) { - SetGamepadAdditionalColor(duskColor); - } else { - SetGamepadAdditionalColor(noColor); + cXyz getAdditionalColor() { + if (dKy_darkworld_check()) { + return kColorTable[DUSK_COLOR].color; + } + + return kColorTable[NO_COLOR].color; } - f32 finalRed = finalGamepadColor.x + additionalGamepadColor.x; - f32 finalGreen = finalGamepadColor.y + additionalGamepadColor.y; - f32 finalBlue = finalGamepadColor.z + additionalGamepadColor.z; +} // namespace - if (finalRed > 255) - finalRed = 255; - if (finalRed < 0) - finalRed = 0; +bool pad_has_led(const int port) noexcept { + if (port > PAD_MAX_CONTROLLERS || port < 0) + return false; - if (finalGreen > 255) - finalGreen = 255; - if (finalGreen < 0) - finalGreen = 0; + return PADHasLED(port); +} - if (finalBlue > 255) - finalBlue = 255; - if (finalBlue < 0) - finalBlue = 0; +void handleGamepadColor() { + auto [color, speed] = getColorSetting(); + const cXyz additionalColor = getAdditionalColor(); + cXyz finalColor = color + additionalColor; + lerpSpeed = speed / 30.0f; - currentGamepadColor = LerpColor(currentGamepadColor, cXyz{finalRed, finalGreen, finalBlue}, lerpSpeed); - PADSetColor(PAD_CHAN0, (u8)currentGamepadColor.x, (u8)currentGamepadColor.y, (u8)currentGamepadColor.z); -} \ No newline at end of file + clamp(finalColor); + currentColor = LerpColor(currentColor, finalColor, lerpSpeed); + + for (int i = 0; i < 4; i++) { + if (pad_has_led(i) && getSettings().game.enableLED[i]) { + PADSetColor( + i, + static_cast(currentColor.x), + static_cast(currentColor.y), + static_cast(currentColor.z) + ); + } + } +} + +} // namespace dusk::input \ No newline at end of file diff --git a/src/dusk/gamepad_color.h b/src/dusk/gamepad_color.h new file mode 100644 index 0000000000..9e3e35a84e --- /dev/null +++ b/src/dusk/gamepad_color.h @@ -0,0 +1,6 @@ +#pragma once + +namespace dusk::input { + void handleGamepadColor(); + bool pad_has_led(int port) noexcept; +} diff --git a/src/dusk/gfx.hpp b/src/dusk/gfx.hpp new file mode 100644 index 0000000000..adb04bee51 --- /dev/null +++ b/src/dusk/gfx.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include "mods/svc/gfx.h" + +namespace dusk::mods { + +void gfx_run_stage(GfxStage stage, const view_class* gameView = nullptr, + const view_port_class* gameViewport = nullptr); + +} // namespace dusk::mods diff --git a/src/dusk/globals.cpp b/src/dusk/globals.cpp index 49ab54ccbe..591ece679f 100644 --- a/src/dusk/globals.cpp +++ b/src/dusk/globals.cpp @@ -1,6 +1,25 @@ #include #include #include +#include "dusk/dusk.h" +#include "dusk/main.h" + +bool dusk::IsRunning = true; +bool dusk::IsShuttingDown = false; +bool dusk::IsGameLaunched = false; +bool dusk::RestartRequested = false; +uint8_t dusk::SaveRequested = 0; +dusk::StageRequest dusk::StageRequested{"", false}; +std::filesystem::path dusk::ConfigPath; +std::filesystem::path dusk::CachePath; +AuroraStats dusk::lastFrameAuroraStats; +float dusk::frameUsagePct = 0.0f; + +void dusk::RequestRestart() noexcept { + RestartRequested = SupportsProcessRestart; + IsRunning = false; +} + u8 g_printOtherHeapDebug; dKankyo_HIO_c g_kankyoHIO; diff --git a/src/dusk/gyro.cpp b/src/dusk/gyro.cpp index 680d500631..31b32bd412 100644 --- a/src/dusk/gyro.cpp +++ b/src/dusk/gyro.cpp @@ -2,8 +2,6 @@ #include "dusk/ui/ui.hpp" #include "d/actor/d_a_alink.h" -#include -#include #include namespace dusk::gyro { @@ -16,14 +14,11 @@ constexpr float kGravityEmaAlpha = 0.1f; constexpr float kMinGravityProjection = 0.2f; // Let roll contribute more strongly as the pad approaches an upright posture. constexpr float kRollAimBoostMax = 2.0f; -constexpr float kMousePixelToRad = 0.0025f; bool s_sensor_enabled = false; bool s_accel_enabled = false; bool s_was_aiming = false; bool s_have_gravity_baseline = false; -bool s_mouse_enabled = false; -bool s_mouse_relative = false; float s_smooth_gx = 0.0f; float s_smooth_gy = 0.0f; float s_smooth_gz = 0.0f; @@ -43,7 +38,6 @@ void reset_filter_state() { s_baseline_gravity_y = s_baseline_gravity_z = 0.0f; s_was_aiming = false; s_have_gravity_baseline = false; - s_mouse_enabled = false; s_yaw_rad = s_pitch_rad = s_roll_rad = 0.0f; s_rollgoal_ax = s_rollgoal_az = 0; } @@ -72,20 +66,11 @@ bool get_sensor_keep_alive() { return s_sensor_keep_alive; } void set_sensor_keep_alive(bool value) { s_sensor_keep_alive = value; } bool rollgoal_gyro_enabled() { - return getSettings().game.enableGyroRollgoal && getSettings().game.gyroMode.getValue() != GyroMode::Mouse; + return getSettings().game.enableGyroRollgoal; } bool queryGyroAimContext() { - if (!static_cast(getSettings().game.enableGyroAim)) { - return false; - } - - daAlink_c* link = daAlink_getAlinkActorClass(); - if (link == nullptr) { - return false; - } - - return link->checkGyroAimContext() && dComIfGp_checkCameraAttentionStatus(link->field_0x317c, 0x10); + return getSettings().game.enableGyroAim.getValue() && dCamera_c::isAimActive(); } void read(float dt) { @@ -94,26 +79,6 @@ void read(float dt) { const bool aim_just_ended = !aim_active && s_was_aiming; s_was_aiming = aim_active; - const bool mouse_mode = getSettings().game.gyroMode.getValue() == GyroMode::Mouse; - const bool mouse_gyro_active = !ui::any_document_visible() && mouse_mode && (aim_active || s_sensor_keep_alive); - SDL_Window* window = aurora::window::get_sdl_window(); - if (window != nullptr && mouse_gyro_active != s_mouse_relative && - SDL_SetWindowRelativeMouseMode(window, mouse_gyro_active)) - { - s_mouse_relative = mouse_gyro_active; - } - - if (mouse_gyro_active && !s_mouse_enabled && window != nullptr) { - const AuroraWindowSize sz = aurora::window::get_window_size(); - const float cx = static_cast(sz.width) * 0.5f; - const float cy = static_cast(sz.height) * 0.5f; - SDL_WarpMouseInWindow(window, cx, cy); - float discard_x = 0.0f; - float discard_y = 0.0f; - SDL_GetRelativeMouseState(&discard_x, &discard_y); - } - s_mouse_enabled = mouse_gyro_active; - if (!s_sensor_keep_alive && !aim_active) { disable_pad_sensors(); reset_filter_state(); @@ -126,31 +91,6 @@ void read(float dt) { s_have_gravity_baseline = false; } - if (mouse_mode && !mouse_gyro_active) { - s_pitch_rad = 0.0f; - s_yaw_rad = 0.0f; - s_roll_rad = 0.0f; - return; - } - - if (mouse_mode) { - disable_pad_sensors(); - - float mx_rel = 0.0f; - float my_rel = 0.0f; - SDL_GetRelativeMouseState(&mx_rel, &my_rel); - // Convert pixels to radians - s_pitch_rad = my_rel * kMousePixelToRad * getSettings().game.gyroSensitivityY; - s_yaw_rad = -mx_rel * kMousePixelToRad * getSettings().game.gyroSensitivityX; - s_roll_rad = 0.0f; - - s_pitch_rad = getSettings().game.gyroInvertPitch ? -s_pitch_rad : s_pitch_rad; - s_yaw_rad = getSettings().game.gyroInvertYaw ? -s_yaw_rad : s_yaw_rad; - s_yaw_rad = getSettings().game.enableMirrorMode ? -s_yaw_rad : s_yaw_rad; - - return; - } - if (!s_sensor_enabled) { if (!PADHasSensor(PAD_CHAN0, PAD_SENSOR_GYRO)) { return; diff --git a/include/dusk/gyro.h b/src/dusk/gyro.h similarity index 89% rename from include/dusk/gyro.h rename to src/dusk/gyro.h index a206100739..abb56640e5 100644 --- a/include/dusk/gyro.h +++ b/src/dusk/gyro.h @@ -1,5 +1,4 @@ -#ifndef DUSK_GYRO_H -#define DUSK_GYRO_H +#pragma once namespace dusk::gyro { void read(float dt); @@ -14,5 +13,3 @@ bool get_sensor_keep_alive(); void set_sensor_keep_alive(bool value); bool rollgoal_gyro_enabled(); } // namespace dusk::gyro - -#endif diff --git a/include/dusk/hotkeys.h b/src/dusk/hotkeys.h similarity index 89% rename from include/dusk/hotkeys.h rename to src/dusk/hotkeys.h index 7a774bde80..bdf1778c3f 100644 --- a/include/dusk/hotkeys.h +++ b/src/dusk/hotkeys.h @@ -1,5 +1,4 @@ -#ifndef DUSK_HOTKEYS_H -#define DUSK_HOTKEYS_H +#pragma once namespace dusk::hotkeys { @@ -23,5 +22,3 @@ constexpr const char* TOGGLE_FULLSCREEN = "F11"; constexpr const char* TURBO = "Tab"; } - -#endif // DUSK_HOTKEYS_H diff --git a/src/dusk/imgui/ImGuiCameraOverlay.cpp b/src/dusk/imgui/ImGuiCameraOverlay.cpp index 0d2168924c..320c41ec92 100644 --- a/src/dusk/imgui/ImGuiCameraOverlay.cpp +++ b/src/dusk/imgui/ImGuiCameraOverlay.cpp @@ -49,7 +49,9 @@ namespace dusk { dCam->Reset(center, eye); } - ImGui::InputFloat("Camera FOV", &dCam->mFovy); + if (ImGui::InputFloat("Camera FOV", &dCam->mFovy)) { + dCam->mFovy = std::clamp(dCam->mFovy, 0.1f, 179.9f); + } ImGui::SeparatorText("Options"); @@ -75,12 +77,12 @@ namespace dusk { if (!getSettings().game.debugFlyCam) { ImGui::BeginDisabled(); } - config::ImGuiCheckbox("Lock Events", getSettings().game.debugFlyCamLockEvents); + config::ImGuiCheckbox("Freeze Time", getSettings().game.debugFlyCamLockEvents); if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { if (!getSettings().game.debugFlyCam) { ImGui::SetTooltip("Enable Fly Mode first."); } else { - ImGui::SetTooltip("Freeze game events while flying."); + ImGui::SetTooltip("Freezes the game while flying."); } } if (!getSettings().game.debugFlyCam) { diff --git a/src/dusk/imgui/ImGuiConfig.hpp b/src/dusk/imgui/ImGuiConfig.hpp index e3e80b9920..4bceb36a38 100644 --- a/src/dusk/imgui/ImGuiConfig.hpp +++ b/src/dusk/imgui/ImGuiConfig.hpp @@ -9,7 +9,7 @@ namespace dusk::config { bool copy = var.getValue(); if (ImGui::Checkbox(title, ©)) { var.setValue(copy); - Save(); + save(); return true; } @@ -20,7 +20,7 @@ namespace dusk::config { float val = var; if (ImGui::SliderFloat(label, &val, v_min, v_max, format, flags)) { var.setValue(val); - Save(); + save(); return true; } @@ -31,7 +31,7 @@ namespace dusk::config { int val = var; if (ImGui::SliderInt(label, &val, v_min, v_max, format, flags)) { var.setValue(val); - Save(); + save(); return true; } @@ -42,7 +42,7 @@ namespace dusk::config { bool copy = p_selected.getValue(); if (ImGui::MenuItem(label, shortcut, ©, enabled)) { p_selected.setValue(copy); - Save(); + save(); return true; } diff --git a/src/dusk/imgui/ImGuiConsole.cpp b/src/dusk/imgui/ImGuiConsole.cpp index 077b4c15bc..3c0131c729 100644 --- a/src/dusk/imgui/ImGuiConsole.cpp +++ b/src/dusk/imgui/ImGuiConsole.cpp @@ -12,7 +12,6 @@ #include "ImGuiConsole.hpp" #include "ImGuiEngine.hpp" #include "JSystem/JUtility/JUTGamePad.h" -#include "SDL3/SDL_mouse.h" #include "dusk/action_bindings.h" #include "dusk/audio/DuskAudioSystem.h" #include "dusk/config.hpp" @@ -61,10 +60,6 @@ namespace dusk { ImGui::TextUnformatted(text.data(), text.data() + text.size()); } - void DuskToast(std::string_view message, float duration) { - g_imguiConsole.AddToast(message, duration); - } - void ImGuiTextCenter(std::string_view text) { ImGui::NewLine(); float fontSize = ImGui::CalcTextSize( @@ -259,7 +254,7 @@ namespace dusk { if (ImGui::IsKeyPressed(ImGuiKey_F11)) { getSettings().video.enableFullscreen.setValue(!getSettings().video.enableFullscreen); VISetWindowFullscreen(getSettings().video.enableFullscreen); - config::Save(); + config::save(); } if (getSettings().game.enableResetKeybind && ImGui::GetIO().KeyCtrl && @@ -322,8 +317,8 @@ namespace dusk { } ImGui::PushFont(ImGuiEngine::fontLarge); ImGuiTextCenter("Failed to initialize any graphics backend."); - ImGuiTextCenter("\nDusklight requires Vulkan 1.1+, or Direct X 12.0."); - ImGuiTextCenter("\nTry updating your Operating System and GPU drivers."); + ImGuiTextCenter("\nDusklight requires at least Vulkan 1.1 or Direct3D 12."); + ImGuiTextCenter("\nTry updating your operating system and GPU drivers."); const auto& style = ImGui::GetStyle(); const auto retrySize = ImGui::CalcTextSize("Retry (Auto backend)"); const auto quitSize = ImGui::CalcTextSize("Quit"); @@ -341,7 +336,7 @@ namespace dusk { if constexpr (SupportsProcessRestart) { if (ImGui::Button("Retry (Auto backend)")) { getSettings().backend.graphicsBackend.setValue("auto"); - config::Save(); + config::save(); RestartRequested = true; IsRunning = false; } @@ -376,27 +371,10 @@ namespace dusk { m_menuTools.ShowActorSpawner(); } - // Hide mouse cursor if the F1 menu is not open and the cursor is idle for 3 seconds. - if (dusk::getSettings().game.gyroMode.getValue() != GyroMode::Mouse) - { - ImGuiIO& io = ImGui::GetIO(); - if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f) { - mouseHideTimer = 0.0f; - ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouseCursorChange; // Imgui will re-show cursor. - } else if (mouseHideTimer <= 3.0f) { - mouseHideTimer += ImGui::GetIO().DeltaTime; - } else { - ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange; - SDL_HideCursor(); - } - } - - ShowToasts(); } void ImGuiConsole::PostDraw() { m_menuTools.afterDraw(); - ShowPipelineProgress(); } void ImGuiConsole::UpdateDragScroll() { @@ -545,75 +523,4 @@ namespace dusk { return false; } - void ImGuiConsole::AddToast(std::string_view message, float duration) { - m_toasts.emplace_back(std::string(message), duration); - } - - void ImGuiConsole::ShowToasts() { - if (m_toasts.empty()) { - return; - } - auto& toast = m_toasts.front(); - const float dt = ImGui::GetIO().DeltaTime; - toast.remain -= dt; - toast.current += dt; - - const ImGuiViewport* viewport = ImGui::GetMainViewport(); - const ImVec2 workPos = viewport->WorkPos; - const ImVec2 workSize = viewport->WorkSize; - constexpr float padding = 10.0f; - const ImVec2 windowPos{workPos.x + workSize.x / 2, workPos.y + workSize.y - padding}; - ImGui::SetNextWindowPos(windowPos, ImGuiCond_Always, ImVec2{0.5f, 1.f}); - - const float alpha = std::min({toast.remain, toast.current, 1.f}); - ImGui::SetNextWindowBgAlpha(alpha * 0.65f); - ImVec4 textColor = ImGui::GetStyleColorVec4(ImGuiCol_Text); - textColor.w *= alpha; - ImVec4 borderColor = ImGui::GetStyleColorVec4(ImGuiCol_Border); - borderColor.w *= alpha; - ImGui::PushStyleColor(ImGuiCol_Text, textColor); - ImGui::PushStyleColor(ImGuiCol_Border, borderColor); - if (ImGui::Begin("Toast", nullptr, - ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | - ImGuiWindowFlags_NoSavedSettings | - ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav | - ImGuiWindowFlags_NoMove)) - { - ImGuiStringViewText(toast.message); - } - ImGui::End(); - ImGui::PopStyleColor(2); - - if (toast.remain <= 0.f) { - m_toasts.pop_front(); - } - } - - void ImGuiConsole::ShowPipelineProgress() { - const auto* stats = aurora_get_stats(); - const u32 queuedPipelines = stats->queuedPipelines; - if (queuedPipelines == 0 || !getSettings().backend.showPipelineCompilation) { - return; - } - const u32 createdPipelines = stats->createdPipelines; - const u32 totalPipelines = queuedPipelines + createdPipelines; - - const auto* viewport = ImGui::GetMainViewport(); - const auto padding = viewport->WorkPos.y + 10.f; - const auto halfWidth = viewport->GetWorkCenter().x; - ImGui::SetNextWindowPos(ImVec2{halfWidth, padding}, ImGuiCond_Always, ImVec2{0.5f, 0.f}); - ImGui::SetNextWindowSize(ImVec2{halfWidth, 0.f}, ImGuiCond_Always); - ImGui::SetNextWindowBgAlpha(0.65f); - ImGui::Begin("Pipelines", nullptr, - ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMove | - ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing); - const auto percent = static_cast(createdPipelines) / static_cast(totalPipelines); - const auto progressStr = fmt::format("Processing pipelines: {} / {}", createdPipelines, totalPipelines); - const auto textSize = ImGui::CalcTextSize(progressStr.data(), progressStr.data() + progressStr.size()); - ImGui::NewLine(); - ImGui::SameLine(ImGui::GetWindowWidth() / 2.f - textSize.x + textSize.x / 2.f); - ImGuiStringViewText(progressStr); - ImGui::ProgressBar(percent); - ImGui::End(); - } } diff --git a/src/dusk/imgui/ImGuiConsole.hpp b/src/dusk/imgui/ImGuiConsole.hpp index c1adc427eb..be344afa3f 100644 --- a/src/dusk/imgui/ImGuiConsole.hpp +++ b/src/dusk/imgui/ImGuiConsole.hpp @@ -24,30 +24,17 @@ public: void PostDraw(); static bool CheckMenuViewToggle(ImGuiKey key, bool& active); - void AddToast(std::string_view message, float duration = 3.f); private: - struct Toast { - std::string message; - float remain; - float current = 0.f; - Toast(std::string message, float duration) noexcept : message(std::move(message)), - remain(duration) {} - }; - - float mouseHideTimer = 0.0f; bool m_isHidden = true; bool m_isLaunchInitialized = false; ImGuiWindow* m_dragScrollWindow = nullptr; ImVec2 m_dragScrollLastMousePos = {}; - std::deque m_toasts; // Keep always last ImGuiMenuTools m_menuTools; - void ShowToasts(); - void ShowPipelineProgress(); void UpdateDragScroll(); }; @@ -60,7 +47,6 @@ std::string BytesToString(size_t bytes); void SetOverlayWindowLocation(int corner); bool ShowCornerContextMenu(int& corner, int avoidCorner); void ImGuiStringViewText(std::string_view text); -void DuskToast(std::string_view message, float duration = 3.f); void ImGuiBeginGroupPanel(const char* name, const ImVec2& size); void ImGuiEndGroupPanel(); void ImGuiTextCenter(std::string_view text); diff --git a/src/dusk/imgui/ImGuiEngine.cpp b/src/dusk/imgui/ImGuiEngine.cpp index 4b6a7fb531..b2ea1f8e1a 100644 --- a/src/dusk/imgui/ImGuiEngine.cpp +++ b/src/dusk/imgui/ImGuiEngine.cpp @@ -20,7 +20,11 @@ namespace dusk { namespace { std::string GetAssetPath(const char* assetName) { +#ifdef DUSK_ASSET_DIR + const char* basePath = DUSK_ASSET_DIR; +#else const char* basePath = SDL_GetBasePath(); +#endif if (basePath != nullptr && basePath[0] != '\0') { return std::string(basePath) + "res/" + assetName; } diff --git a/src/dusk/imgui/ImGuiMenuTools.cpp b/src/dusk/imgui/ImGuiMenuTools.cpp index 3045e09df1..b9ad5eb021 100644 --- a/src/dusk/imgui/ImGuiMenuTools.cpp +++ b/src/dusk/imgui/ImGuiMenuTools.cpp @@ -15,6 +15,7 @@ #include "dusk/data.hpp" #include "dusk/dusk.h" #include "dusk/main.h" +#include "dusk/os.h" #include "m_Do/m_Do_main.h" #include @@ -73,7 +74,7 @@ namespace dusk { bool disableWaterRefraction = getSettings().game.disableWaterRefraction; if (ImGui::Checkbox("Disable Water Refraction", &disableWaterRefraction)) { getSettings().game.disableWaterRefraction.setValue(disableWaterRefraction); - config::Save(); + config::save(); } ImGui::Checkbox("Enable LOD Bias", &aurora::gx::enableLodBias); ImGui::EndMenu(); @@ -208,6 +209,27 @@ namespace dusk { daAlink_c* player = (daAlink_c*)dComIfGp_getPlayer(0); daHorse_c* horse = dComIfGp_getHorseActor(); + double speedXzy = 0.0; + if (player != nullptr) { + speedXzy = sqrtf(player->speed.x * player->speed.x + + player->speed.z * player->speed.z + + player->speed.y * player->speed.y); + } + + ImGui::Text("Global"); + ImGuiStringViewText( + player != nullptr + ? fmt::format("Stage: {}\n", dComIfGp_getStartStageName()) + : "Stage: ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Layer: {0}\n", dComIfG_play_c::getLayerNo(0)) + : "Layer: ?\n" + ); + + ImGui::Separator(); ImGui::Text("Link"); ImGuiStringViewText( player != nullptr @@ -217,14 +239,38 @@ namespace dusk { ImGuiStringViewText( player != nullptr - ? fmt::format("Angle: {0}\n", player->shape_angle.y) - : "Angle: ?\n" + ? fmt::format("Velocity (XYZ): {: .4f}, {: .4f}, {: .4f}\n", player->speed.x, player->speed.y, player->speed.z) + : "Velocity (XYZ): ?, ?, ?\n" ); ImGuiStringViewText( player != nullptr - ? fmt::format("Speed: {: .4f}\n", player->speedF) - : "Speed: ?\n" + ? fmt::format("Speed (SpeedF): {: .4f}\n", player->speedF) + : "Speed (SpeedF): ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Speed (3D): {: .4f}\n", speedXzy) + : "Speed (3D): ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Angle: {0}\n", player->shape_angle.y) + : "Angle: ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Room: {0}\n", fopAcM_GetRoomNo(player)) + : "Room: ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Entry: {0}\n", dComIfGp_getStartStagePoint()) + : "Entry: ?\n" ); ImGui::Separator(); @@ -235,6 +281,18 @@ namespace dusk { : "Position: ?, ?, ?\n" ); + ImGuiStringViewText( + horse != nullptr + ? fmt::format("Velocity (XYZ): {: .4f}, {: .4f}, {: .4f}\n", horse->speed.x, horse->speed.y, horse->speed.z) + : "Velocity (XYZ): ?, ?, ?\n" + ); + + ImGuiStringViewText( + horse != nullptr + ? fmt::format("Speed (SpeedF): {: .4f}\n", horse->speedF) + : "Speed (SpeedF): ?\n" + ); + ImGuiStringViewText( horse != nullptr ? fmt::format("Angle: {0}\n", horse->shape_angle.y) @@ -243,8 +301,20 @@ namespace dusk { ImGuiStringViewText( horse != nullptr - ? fmt::format("Speed: {: .4f}\n", horse->speedF) - : "Speed: ?\n" + ? fmt::format("Room: {0}\n", fopAcM_GetRoomNo(horse)) + : "Room: ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Saved Stage: {}\n", dComIfGs_getHorseRestartStageName()) + : "Saved Stage: ?\n" + ); + + ImGuiStringViewText( + player != nullptr + ? fmt::format("Saved Room: {0}\n", dComIfGs_getHorseRestartRoomNo()) + : "Saved Room: ?\n" ); ShowCornerContextMenu(m_playerInfoOverlayCorner, m_debugOverlayCorner); diff --git a/src/dusk/imgui/ImGuiProcessOverlay.cpp b/src/dusk/imgui/ImGuiProcessOverlay.cpp index 806a9ea0f6..5b4fff28db 100644 --- a/src/dusk/imgui/ImGuiProcessOverlay.cpp +++ b/src/dusk/imgui/ImGuiProcessOverlay.cpp @@ -46,7 +46,7 @@ namespace dusk { ImGui::TableNextColumn(); char id_buf[32]; - sprintf(id_buf, "%d", proc->id); + SAFE_SPRINTF(id_buf, "%d", proc->id); int flags = ImGuiTreeNodeFlags_SpanAllColumns; bool isLayer = fpcBs_Is_JustOfType(g_fpcNd_type, proc->subtype); diff --git a/src/dusk/imgui/ImGuiSaveEditor.cpp b/src/dusk/imgui/ImGuiSaveEditor.cpp index b08ae2860b..ec2802de44 100644 --- a/src/dusk/imgui/ImGuiSaveEditor.cpp +++ b/src/dusk/imgui/ImGuiSaveEditor.cpp @@ -550,7 +550,7 @@ namespace dusk { char nameBuffer[8]; snprintf(nameBuffer, sizeof(nameBuffer), "%s", playerName); if (ImGui::InputText("##PlayerNameInput", nameBuffer, 8)) { - strcpy(dComIfGs_getPlayerName(), nameBuffer); + SAFE_STRCPY(dComIfGs_getPlayerName(), nameBuffer); } const char* horseName = dComIfGs_getHorseName(); @@ -559,7 +559,7 @@ namespace dusk { char horseNameBuffer[8]; snprintf(horseNameBuffer, sizeof(horseNameBuffer), "%s", horseName); if (ImGui::InputText("##HorseNameInput", horseNameBuffer, 8)) { - strcpy(dComIfGs_getHorseName(), horseNameBuffer); + SAFE_STRCPY(dComIfGs_getHorseName(), horseNameBuffer); } ImGui::Separator(); @@ -713,7 +713,7 @@ namespace dusk { transformLevel++; } } - if (ImGui::SliderInt("Transform Level", &transformLevel, 0, 3)) { + if (ImGui::SliderInt("Transform Level", &transformLevel, 0, 4)) { u8 newFlags = 0; for (int i = 0; i < transformLevel; i++) { newFlags |= (1 << i); @@ -745,8 +745,8 @@ namespace dusk { ImGui::SameLine(); char nameBuffer[8]; snprintf(nameBuffer, sizeof(nameBuffer), "%s", returnPlace.mName); - if (ImGui::InputText("##SaveStageNameInput", nameBuffer, 8)) { - strcpy(returnPlace.mName, nameBuffer); + if (ImGui::InputText("##SaveStageNameInput", nameBuffer, sizeof(nameBuffer))) { + SAFE_STRCPY(returnPlace.mName, nameBuffer); } ImGui::Text("Room: "); @@ -787,8 +787,8 @@ namespace dusk { ImGui::SameLine(); char horseStageBuffer[8]; snprintf(horseStageBuffer, sizeof(horseStageBuffer), "%s", horsePlace.mName); - if (ImGui::InputText("##HorseStageNameInput", horseStageBuffer, 8)) { - strcpy(horsePlace.mName, horseStageBuffer); + if (ImGui::InputText("##HorseStageNameInput", horseStageBuffer, sizeof(horseStageBuffer))) { + SAFE_STRCPY(horsePlace.mName, horseStageBuffer); } ImGui::Text("Room: "); diff --git a/src/dusk/io.cpp b/src/dusk/io.cpp index 4f6ef16a9b..7638194d35 100644 --- a/src/dusk/io.cpp +++ b/src/dusk/io.cpp @@ -1,10 +1,10 @@ +#include #include #include +#include #include "dusk/io.hpp" -using namespace dusk::io; - #if _WIN32 #define MODE_TYPE wchar_t #define MODE(val) L##val @@ -21,7 +21,10 @@ using namespace dusk::io; #define _SH_DENYWR 0 #endif -static FILE* ThrowIfNotOpen(const FileStream& file) { +namespace dusk::io { +namespace { + +FILE* ThrowIfNotOpen(const FileStream& file) { if (!file.GetFileHandle()) { throw std::runtime_error("Invalid file handle!"); } @@ -29,11 +32,14 @@ static FILE* ThrowIfNotOpen(const FileStream& file) { return static_cast(file.GetFileHandle()); } -[[noreturn]] static void ThrowForError(int code) { +[[noreturn]] void ThrowForError(int code) { + if (code == 0) { + throw std::system_error(std::make_error_code(std::errc::io_error)); + } throw std::system_error(std::make_error_code(static_cast(code))); } -static FILE* OpenCore(const std::filesystem::path& path, const MODE_TYPE* mode, int shareFlag) { +FILE* OpenCore(const std::filesystem::path& path, const MODE_TYPE* mode, int shareFlag) { FILE* file; int err; @@ -54,12 +60,13 @@ static FILE* OpenCore(const std::filesystem::path& path, const MODE_TYPE* mode, return file; } -static FILE* OpenCore(const char* path, const MODE_TYPE* mode, int shareFlag) { +FILE* OpenCore(const char* path, const MODE_TYPE* mode, int shareFlag) { return OpenCore(reinterpret_cast(path), mode, shareFlag); } -FileStream::FileStream() noexcept : file(nullptr) { -} +} // namespace + +FileStream::FileStream() noexcept : file(nullptr) {} FileStream::FileStream(FILE* file) : file(file) { if (!file) { @@ -77,6 +84,14 @@ FileStream::~FileStream() { fclose(static_cast(file)); } +void FileStream::Flush() { + FILE* fileHandle = ThrowIfNotOpen(*this); + + if (fflush(fileHandle) != 0) { + ThrowForError(errno); + } +} + FileStream FileStream::OpenRead(const char* utf8Path) { return FileStream(OpenCore(utf8Path, MODE("rb"), _SH_DENYWR)); } @@ -163,10 +178,13 @@ void FileStream::WriteAllText(const char* utf8Path, const std::string_view text) void FileStream::WriteAllText(const std::filesystem::path& path, const std::string_view text) { auto handle = Create(path); handle.Write(text.data(), text.size()); + handle.Flush(); } FILE* FileStream::ToInner() { auto handle = file; file = nullptr; return handle; -} \ No newline at end of file +} + +} // namespace dusk::io diff --git a/include/dusk/io.hpp b/src/dusk/io.hpp similarity index 96% rename from include/dusk/io.hpp rename to src/dusk/io.hpp index 2efc4a8d3b..c8f9ae771b 100644 --- a/include/dusk/io.hpp +++ b/src/dusk/io.hpp @@ -1,5 +1,4 @@ -#ifndef DUSK_IO_HPP -#define DUSK_IO_HPP +#pragma once #include #include @@ -30,6 +29,11 @@ public: ~FileStream(); + /** + * \brief Flush buffered writes and throw if the flush fails. + */ + void Flush(); + /** * \brief Open a file for reading at the given path. */ @@ -101,5 +105,3 @@ inline std::string fs_path_to_string(const std::filesystem::path& path) { } } // namespace dusk::io - -#endif // DUSK_IO_HPP diff --git a/include/dusk/layout.hpp b/src/dusk/layout.hpp similarity index 90% rename from include/dusk/layout.hpp rename to src/dusk/layout.hpp index 78316d2e09..bb207c2000 100644 --- a/include/dusk/layout.hpp +++ b/src/dusk/layout.hpp @@ -1,5 +1,4 @@ -#ifndef DUSK_LAYOUT_H -#define DUSK_LAYOUT_H +#pragma once #include "dolphin/types.h" @@ -33,5 +32,3 @@ struct LayoutRect { f32 heightInner); }; } - -#endif // DUSK_LAYOUT_H diff --git a/include/dusk/livesplit.h b/src/dusk/livesplit.h similarity index 100% rename from include/dusk/livesplit.h rename to src/dusk/livesplit.h diff --git a/src/dusk/logging.cpp b/src/dusk/logging.cpp index 4319d2dc7e..1303515e5a 100644 --- a/src/dusk/logging.cpp +++ b/src/dusk/logging.cpp @@ -1,12 +1,16 @@ #include "dusk/logging.h" +#include #include #include #include +#include +#include #include #include #include #include #include +#include #include "dusk/io.hpp" #include "tracy/Tracy.hpp" @@ -33,10 +37,20 @@ static constexpr std::string_view StubFragments[] = { "but selective updates are not implemented"sv, }; +#if _WIN32 +#define DUSK_FILENO _fileno +#else +#define DUSK_FILENO fileno +#endif + namespace { // On macOS, std::mutex becomes poisoned when its dtor is run. // We use this to check if the LogState is destroyed before attempting to acquire it. std::atomic g_logStateAlive(true); +std::atomic g_logFd(-1); +constexpr size_t MaxRetainedLogCount = 10; +constexpr size_t MaxRetainedOldLogCount = MaxRetainedLogCount - 1; +constexpr uintmax_t MaxRetainedOldLogBytes = 100ull * 1024ull * 1024ull; struct LogState { std::mutex mutex; @@ -54,6 +68,7 @@ struct LogState { } std::lock_guard lock(mutex); if (file != nullptr) { + g_logFd.store(-1, std::memory_order_release); std::fflush(file); std::fclose(file); file = nullptr; @@ -83,6 +98,121 @@ FILE* LogStreamForLevel(AuroraLogLevel level) { return level >= LOG_ERROR ? stderr : stdout; } +struct LogFileCandidate { + std::filesystem::path path; + std::string filename; + uintmax_t size; +}; + +void warn_log_cleanup_failure( + const char* action, const std::filesystem::path& path, const std::error_code& ec) { + std::fprintf(stderr, "[WARNING | dusk] Failed to %s '%s': %s\n", action, + dusk::io::fs_path_to_string(path).c_str(), ec.message().c_str()); +} + +bool is_digit_at(const std::string_view value, size_t index) { + return std::isdigit(static_cast(value[index])) != 0; +} + +bool is_generated_log_file_name(const std::filesystem::path& path) { + const std::string filename = path.filename().string(); + constexpr std::string_view currentPrefix = "dusklight-"sv; + constexpr std::string_view legacyPrefix = "dusk-"sv; + constexpr std::string_view suffix = ".log"sv; + size_t timestampOffset = 0; + + if (filename.starts_with(currentPrefix)) { + timestampOffset = currentPrefix.size(); + } else if (filename.starts_with(legacyPrefix)) { + timestampOffset = legacyPrefix.size(); + } else { + return false; + } + + if (filename.size() != timestampOffset + 19 || !filename.ends_with(suffix) || + filename[timestampOffset + 8] != '-') { + return false; + } + + for (size_t i = timestampOffset; i < timestampOffset + 8; ++i) { + if (!is_digit_at(filename, i)) { + return false; + } + } + for (size_t i = timestampOffset + 9; i < timestampOffset + 15; ++i) { + if (!is_digit_at(filename, i)) { + return false; + } + } + + return true; +} + +void delete_log_file(const std::filesystem::path& path) { + std::error_code ec; + std::filesystem::remove(path, ec); + if (ec) { + warn_log_cleanup_failure("remove old log file", path, ec); + } +} + +void prune_old_log_files(const std::filesystem::path& logsDir) { + std::error_code ec; + std::filesystem::directory_iterator entries{logsDir, ec}; + if (ec) { + warn_log_cleanup_failure("inspect log directory", logsDir, ec); + return; + } + + std::vector candidates; + for (const auto& entry : entries) { + const std::filesystem::path path = entry.path(); + if (!is_generated_log_file_name(path)) { + continue; + } + + ec.clear(); + const auto status = entry.symlink_status(ec); + if (ec) { + warn_log_cleanup_failure("inspect log file", path, ec); + continue; + } + if (!std::filesystem::is_regular_file(status)) { + continue; + } + + ec.clear(); + const uintmax_t size = entry.file_size(ec); + if (ec) { + warn_log_cleanup_failure("inspect size of log file", path, ec); + continue; + } + + candidates.push_back({path, path.filename().string(), size}); + } + + std::sort(candidates.begin(), candidates.end(), + [](const LogFileCandidate& a, const LogFileCandidate& b) { + return a.filename > b.filename; + }); + + const size_t retainedCount = std::min(candidates.size(), MaxRetainedOldLogCount); + uintmax_t retainedBytes = 0; + for (size_t i = 0; i < retainedCount; ++i) { + retainedBytes += candidates[i].size; + } + + size_t retainedAfterSizeLimit = retainedCount; + while (retainedAfterSizeLimit > 0 && retainedBytes > MaxRetainedOldLogBytes) { + --retainedAfterSizeLimit; + retainedBytes -= candidates[retainedAfterSizeLimit].size; + } + + for (size_t i = retainedAfterSizeLimit; i < candidates.size(); ++i) { + delete_log_file(candidates[i].path); + } +} + std::string MakeTimestampedLogName() { const auto now = std::chrono::system_clock::now(); const std::time_t nowTime = std::chrono::system_clock::to_time_t(now); @@ -222,6 +352,7 @@ void dusk::InitializeFileLogging(const std::filesystem::path& configDir, AuroraL io::fs_path_to_string(logsDir).c_str(), ec.message().c_str()); return; } + prune_old_log_files(logsDir); const std::filesystem::path logPath = logsDir / MakeTimestampedLogName(); g_logState.file = io::FileStream::Create(logPath).ToInner(); @@ -232,6 +363,7 @@ void dusk::InitializeFileLogging(const std::filesystem::path& configDir, AuroraL } g_logState.filePath = logPath.u8string(); + g_logFd.store(DUSK_FILENO(g_logState.file), std::memory_order_release); aurora::g_config.logCallback = &aurora_log_callback; aurora::g_config.logLevel = logLevel; WriteLogLine(g_logState.file, "INFO", "dusk", "File logging initialized", 24); @@ -252,3 +384,7 @@ const char* dusk::GetLogFilePath() { return reinterpret_cast( g_logState.filePath.empty() ? nullptr : g_logState.filePath.c_str()); } + +int dusk::GetLogFileDescriptor() { + return g_logFd.load(std::memory_order_acquire); +} diff --git a/include/dusk/logging.h b/src/dusk/logging.h similarity index 89% rename from include/dusk/logging.h rename to src/dusk/logging.h index 9b31b96bf2..fdf315752e 100644 --- a/include/dusk/logging.h +++ b/src/dusk/logging.h @@ -1,5 +1,4 @@ -#ifndef DUSK_LOGGING_H -#define DUSK_LOGGING_H +#pragma once #include #include @@ -12,6 +11,7 @@ namespace dusk { void InitializeFileLogging(const std::filesystem::path& configDir, AuroraLogLevel logLevel); void ShutdownFileLogging(); const char* GetLogFilePath(); + int GetLogFileDescriptor(); void SendToStubLog(AuroraLogLevel level, const char* module, const char* message); } @@ -19,7 +19,11 @@ extern bool StubLogEnabled; extern aurora::Module DuskLog; +#ifndef NDEBUG #define STUB_LOG() DuskLog.debug("{} is a stub", __FUNCTION__) +#else +#define STUB_LOG() +#endif #if TARGET_PC #define STUB_RET(...) \ @@ -29,5 +33,3 @@ extern aurora::Module DuskLog; #else #define STUB_RET() (void)0 #endif - -#endif diff --git a/src/dusk/main.cpp b/src/dusk/main.cpp index a35f695b50..c1003a7718 100644 --- a/src/dusk/main.cpp +++ b/src/dusk/main.cpp @@ -5,6 +5,7 @@ #endif #include +#include "d/actor/d_a_movie_player.h" #include "dusk/main.h" #include "dusk/io.hpp" diff --git a/include/dusk/main.h b/src/dusk/main.h similarity index 74% rename from include/dusk/main.h rename to src/dusk/main.h index 0a2be8734d..1378e48a1b 100644 --- a/include/dusk/main.h +++ b/src/dusk/main.h @@ -1,5 +1,4 @@ -#ifndef DUSK_MAIN_H -#define DUSK_MAIN_H +#pragma once #include @@ -12,6 +11,18 @@ extern bool RestartRequested; extern std::filesystem::path ConfigPath; extern std::filesystem::path CachePath; +extern uint8_t SaveRequested; +struct StageRequest { + std::string stage; + bool set; + s8 room; + s16 point; + s8 layer; +}; +extern StageRequest StageRequested; + + + #if defined(__ANDROID__) || (defined(TARGET_OS_IOS) && TARGET_OS_IOS) || \ (defined(TARGET_OS_TV) && TARGET_OS_TV) inline constexpr bool SupportsProcessRestart = false; @@ -22,5 +33,3 @@ inline constexpr bool SupportsProcessRestart = true; void RequestRestart() noexcept; } // namespace dusk - -#endif // DUSK_MAIN_H diff --git a/include/dusk/map_loader_definitions.h b/src/dusk/map_loader_definitions.h similarity index 100% rename from include/dusk/map_loader_definitions.h rename to src/dusk/map_loader_definitions.h diff --git a/include/dusk/memory.h b/src/dusk/memory.h similarity index 68% rename from include/dusk/memory.h rename to src/dusk/memory.h index dd55181170..2d24e5b957 100644 --- a/include/dusk/memory.h +++ b/src/dusk/memory.h @@ -1,10 +1,7 @@ -#ifndef DUSK_MEMORY_H -#define DUSK_MEMORY_H +#pragma once #if TARGET_PC #define HEAP_SIZE(original, dusk) (dusk) #else #define HEAP_SIZE(original, dusk) (original) #endif - -#endif diff --git a/src/dusk/menu_pointer.cpp b/src/dusk/menu_pointer.cpp new file mode 100644 index 0000000000..0f1688f698 --- /dev/null +++ b/src/dusk/menu_pointer.cpp @@ -0,0 +1,514 @@ +#include "dusk/menu_pointer.h" + +#include "d/d_pane_class.h" +#include "dusk/settings.h" +#include "m_Do/m_Do_graphic.h" + +#include +#include + +#include +#include + +namespace dusk::menu_pointer { +namespace { +using Clock = std::chrono::steady_clock; + +constexpr auto kTapMaxDuration = std::chrono::milliseconds(300); +constexpr f32 kTapMoveThresholdDp = 12.0f; + +struct Gesture { + bool active = false; + bool movedTooFar = false; + bool crossedTarget = false; + bool pressTargetValid = false; + Context pressContext = Context::None; + TargetId pressTarget = InvalidTarget; + f32 startX = 0.0f; + f32 startY = 0.0f; + Clock::time_point startedAt{}; +}; + +State s_state; +bool s_clickConsumed = false; +Context s_lastContext = Context::None; +Context s_currentContext = Context::None; +u8 s_lastDialogChoice = 0xFF; +u8 s_currentDialogChoice = 0xFF; +bool s_lastDialogChoiceValid = false; +bool s_currentDialogChoiceValid = false; +bool s_lastDialogClicked = false; +bool s_currentDialogClicked = false; +bool s_mouseActive = false; +bool s_mouseButtonCaptured = false; +s32 s_mouseButton = -1; +u32 s_suppressedPadHoldMask = 0; +u32 s_suppressedPadNextReadMask = 0; +Context s_deferredActivationContext = Context::None; +TargetId s_deferredActivationTarget = InvalidTarget; +Gesture s_gesture; +bool s_hoverTargetValid = false; +TargetId s_hoverTarget = InvalidTarget; +bool s_clickPending = false; +Context s_clickContext = Context::None; +TargetId s_clickTarget = InvalidTarget; +bool s_clickTargetValid = false; + +s32 scancode_from_rml_button(s32 button) noexcept { + switch (button) { + case 0: + return PAD_KEY_MOUSE_LEFT; + case 1: + return PAD_KEY_MOUSE_RIGHT; + case 2: + return PAD_KEY_MOUSE_MIDDLE; + default: + return PAD_KEY_INVALID; + } +} + +bool is_mouse_scancode(s32 scancode) noexcept { + return scancode >= PAD_KEY_MOUSE_X2 && scancode <= PAD_KEY_MOUSE_LEFT; +} + +PADButton pad_button_for_scancode(u32 port, s32 scancode) noexcept { + u32 count = 0; + PADKeyButtonBinding* bindings = PADGetKeyButtonBindings(port, &count); + if (bindings == nullptr) { + return 0; + } + + for (u32 i = 0; i < count; ++i) { + if (bindings[i].scancode == scancode) { + return bindings[i].padButton; + } + } + + return 0; +} + +s32 menu_confirm_mouse_scancode() noexcept { + constexpr u32 port = PAD_CHAN0; + u32 count = 0; + PADKeyButtonBinding* bindings = PADGetKeyButtonBindings(port, &count); + if (bindings == nullptr) { + return PAD_KEY_MOUSE_LEFT; + } + + for (u32 i = 0; i < count; ++i) { + if (bindings[i].padButton == PAD_BUTTON_A && is_mouse_scancode(bindings[i].scancode)) { + return bindings[i].scancode; + } + } + + return pad_button_for_scancode(port, PAD_KEY_MOUSE_LEFT) != 0 ? PAD_KEY_INVALID : + PAD_KEY_MOUSE_LEFT; +} + +bool mouse_button_is_menu_confirm(s32 button) noexcept { + const s32 scancode = scancode_from_rml_button(button); + return scancode != PAD_KEY_INVALID && scancode == menu_confirm_mouse_scancode(); +} + +void suppress_pad_for_mouse_button(s32 button, bool held) noexcept { + const s32 scancode = scancode_from_rml_button(button); + if (scancode == PAD_KEY_INVALID) { + return; + } + + const PADButton padButton = pad_button_for_scancode(PAD_CHAN0, scancode); + if (padButton == 0) { + return; + } + + s_suppressedPadNextReadMask |= padButton; + if (held) { + s_suppressedPadHoldMask |= padButton; + } else { + s_suppressedPadHoldMask &= ~padButton; + } +} + +f32 tap_move_threshold() noexcept { + auto* context = aurora::rmlui::get_context(); + if (context == nullptr) { + return kTapMoveThresholdDp; + } + + return kTapMoveThresholdDp * std::max(context->GetDensityIndependentPixelRatio(), 1.0f); +} + +void update_gesture_movement(f32 x, f32 y) noexcept { + if (!s_gesture.active || s_gesture.movedTooFar) { + return; + } + + const f32 dx = x - s_gesture.startX; + const f32 dy = y - s_gesture.startY; + const f32 threshold = tap_move_threshold(); + if (dx * dx + dy * dy > threshold * threshold) { + s_gesture.movedTooFar = true; + } +} + +void clear_click_state() noexcept { + s_clickConsumed = false; + s_clickPending = false; + s_clickContext = Context::None; + s_clickTarget = InvalidTarget; + s_clickTargetValid = false; + s_state.clicked = false; +} + +void set_position_from_rml(f32 x, f32 y) noexcept { + auto* context = aurora::rmlui::get_context(); + if (context == nullptr) { + return; + } + + const auto dimensions = context->GetDimensions(); + const f32 width = std::max(static_cast(dimensions.x), 1.0f); + const f32 height = std::max(static_cast(dimensions.y), 1.0f); + + s_state.x = mDoGph_gInf_c::getMinXF() + x / width * mDoGph_gInf_c::getWidthF(); + s_state.y = mDoGph_gInf_c::getMinYF() + y / height * mDoGph_gInf_c::getHeightF(); + s_state.valid = true; +} + +void clear_input_state() noexcept { + s_state = {}; + clear_click_state(); + s_lastDialogChoice = 0xFF; + s_currentDialogChoice = 0xFF; + s_lastDialogChoiceValid = false; + s_currentDialogChoiceValid = false; + s_lastDialogClicked = false; + s_currentDialogClicked = false; + s_mouseActive = false; + s_mouseButtonCaptured = false; + s_mouseButton = -1; + s_suppressedPadHoldMask = 0; + s_suppressedPadNextReadMask = 0; + s_deferredActivationContext = Context::None; + s_deferredActivationTarget = InvalidTarget; + s_gesture = {}; + s_hoverTargetValid = false; + s_hoverTarget = InvalidTarget; +} + +} // namespace + +bool handle_fallthrough_pointer(f32 x, f32 y, Phase phase, bool touch, s32 mouseButton) noexcept { + if (!enabled()) { + return false; + } + + if (!touch) { + if (phase == Phase::Press) { + if (!mouse_button_is_menu_confirm(mouseButton)) { + return false; + } + s_mouseButtonCaptured = true; + s_mouseButton = mouseButton; + suppress_pad_for_mouse_button(mouseButton, true); + } else if (phase == Phase::Release) { + if (!s_mouseButtonCaptured || s_mouseButton != mouseButton) { + return false; + } + suppress_pad_for_mouse_button(mouseButton, false); + s_mouseButtonCaptured = false; + s_mouseButton = -1; + } else if (phase == Phase::Cancel) { + if (s_mouseButtonCaptured) { + suppress_pad_for_mouse_button(s_mouseButton, false); + s_mouseButtonCaptured = false; + s_mouseButton = -1; + } else if (!s_mouseActive) { + return false; + } + } + s_mouseActive = true; + } + + if (phase != Phase::Cancel) { + update_gesture_movement(x, y); + set_position_from_rml(x, y); + } + s_state.touch = touch; + + switch (phase) { + case Phase::Press: + clear_click_state(); + s_gesture = { + .active = true, + .startX = x, + .startY = y, + .startedAt = Clock::now(), + }; + s_state.down = true; + s_state.pressed = true; + break; + case Phase::Release: { + const bool shortEnough = + s_gesture.active && Clock::now() - s_gesture.startedAt <= kTapMaxDuration; + const bool stillEnough = s_gesture.active && !s_gesture.movedTooFar; + const bool targetClean = s_gesture.active && !s_gesture.crossedTarget; + s_clickContext = s_gesture.pressContext; + s_clickTarget = s_gesture.pressTarget; + s_clickTargetValid = s_gesture.pressTargetValid; + s_clickPending = shortEnough && stillEnough && targetClean; + s_state.down = false; + s_state.released = true; + s_state.clicked = s_clickPending; + s_gesture = {}; + break; + } + case Phase::Cancel: + clear_click_state(); + s_gesture = {}; + s_state.down = false; + break; + case Phase::Move: + default: + break; + } + + return true; +} + +void begin_game_frame() noexcept { + s_currentContext = Context::None; + s_currentDialogChoice = 0xFF; + s_currentDialogChoiceValid = false; + s_currentDialogClicked = false; + s_clickConsumed = false; + if (!enabled()) { + clear_input_state(); + } +} + +void end_game_frame() noexcept { + if (s_gesture.active && s_gesture.pressTargetValid && + s_currentContext == s_gesture.pressContext && !s_hoverTargetValid) + { + s_gesture.crossedTarget = true; + } + + s_lastContext = s_currentContext; + s_lastDialogChoice = s_currentDialogChoice; + s_lastDialogChoiceValid = s_currentDialogChoiceValid; + s_lastDialogClicked = s_currentDialogClicked; + s_state.pressed = false; + s_state.released = false; + s_state.clicked = false; + if (!s_state.down) { + s_state.valid = false; + } + s_clickConsumed = false; + s_clickPending = false; + s_clickContext = Context::None; + s_clickTarget = InvalidTarget; + s_clickTargetValid = false; + s_hoverTargetValid = false; + s_hoverTarget = InvalidTarget; +} + +void begin_context(Context context) noexcept { + if (context == Context::None || !enabled()) { + return; + } + + if (s_lastContext == Context::None && s_currentContext == Context::None) { + s_state = {}; + s_mouseActive = false; + s_mouseButtonCaptured = false; + s_mouseButton = -1; + s_suppressedPadHoldMask = 0; + s_suppressedPadNextReadMask = 0; + s_deferredActivationContext = Context::None; + s_deferredActivationTarget = InvalidTarget; + s_gesture = {}; + s_hoverTargetValid = false; + s_hoverTarget = InvalidTarget; + clear_click_state(); + } + + s_currentContext = context; +} + +bool active() noexcept { + return s_currentContext != Context::None || s_lastContext != Context::None; +} + +bool enabled() noexcept { + return getSettings().game.enableMenuPointer.getValue(); +} + +bool mouse_capture_active() noexcept { + return enabled() && s_mouseButtonCaptured; +} + +const State& state() noexcept { + return s_state; +} + +void set_hover_target(TargetId target) noexcept { + s_hoverTargetValid = true; + s_hoverTarget = target; + + if (s_gesture.active && !s_gesture.pressTargetValid && s_state.down) { + s_gesture.pressContext = s_currentContext; + s_gesture.pressTarget = target; + s_gesture.pressTargetValid = true; + } + + if (s_gesture.active && s_gesture.pressTargetValid && + (s_currentContext != s_gesture.pressContext || target != s_gesture.pressTarget)) + { + s_gesture.crossedTarget = true; + } +} + +bool click_matches_hover_target() noexcept { + if (!s_clickPending || !s_hoverTargetValid) { + return false; + } + + if (!s_clickTargetValid) { + return true; + } + + return s_currentContext == s_clickContext && s_hoverTarget == s_clickTarget; +} + +bool consume_click() noexcept { + if (s_clickConsumed || !click_matches_hover_target()) { + return false; + } + + s_clickConsumed = true; + s_clickPending = false; + s_state.clicked = false; + return true; +} + +bool peek_click() noexcept { + return !s_clickConsumed && click_matches_hover_target(); +} + +void set_dialog_choice(u8 choice, bool clicked) noexcept { + s_currentDialogChoice = choice; + s_currentDialogChoiceValid = true; + s_currentDialogClicked = clicked; +} + +bool get_dialog_choice(u8& choice) noexcept { + if (s_currentDialogChoiceValid) { + choice = s_currentDialogChoice; + return true; + } + if (s_lastDialogChoiceValid) { + choice = s_lastDialogChoice; + return true; + } + return false; +} + +bool consume_dialog_click(u8& choice) noexcept { + if (s_currentDialogChoiceValid && s_currentDialogClicked) { + choice = s_currentDialogChoice; + s_currentDialogClicked = false; + return true; + } + if (s_lastDialogChoiceValid && s_lastDialogClicked) { + choice = s_lastDialogChoice; + s_lastDialogClicked = false; + return true; + } + return false; +} + +void defer_activation(Context context, TargetId target) noexcept { + s_deferredActivationContext = context; + s_deferredActivationTarget = target; +} + +bool consume_deferred_activation(Context context, TargetId target) noexcept { + if (s_deferredActivationContext != context || s_deferredActivationTarget != target) { + return false; + } + + s_deferredActivationContext = Context::None; + s_deferredActivationTarget = InvalidTarget; + return true; +} + +void clear_deferred_activation(Context context) noexcept { + if (s_deferredActivationContext != context) { + return; + } + + s_deferredActivationContext = Context::None; + s_deferredActivationTarget = InvalidTarget; +} + +u32 suppressed_pad_buttons(u32 port) noexcept { + if (port != PAD_CHAN0) { + return 0; + } + + return s_suppressedPadHoldMask | s_suppressedPadNextReadMask; +} + +void finish_pad_suppression_read(u32 port) noexcept { + if (port != PAD_CHAN0) { + return; + } + + s_suppressedPadNextReadMask = 0; +} + +bool hit_rect(f32 left, f32 top, f32 right, f32 bottom, f32 padding) noexcept { + const auto& state = menu_pointer::state(); + if (!state.valid) { + return false; + } + + if (left > right) { + std::swap(left, right); + } + if (top > bottom) { + std::swap(top, bottom); + } + + return state.x >= left - padding && state.x <= right + padding && state.y >= top - padding && + state.y <= bottom + padding; +} + +bool hit_pane(CPaneMgr* pane, f32 padding) noexcept { + if (pane == nullptr || pane->getPanePtr() == nullptr) { + return false; + } + + Mtx mtx; + Vec v0 = pane->getGlobalVtx(&mtx, 0, false, 0); + Vec v1 = pane->getGlobalVtx(&mtx, 1, false, 0); + Vec v2 = pane->getGlobalVtx(&mtx, 2, false, 0); + Vec v3 = pane->getGlobalVtx(&mtx, 3, false, 0); + const f32 left = std::min({v0.x, v1.x, v2.x, v3.x}); + const f32 right = std::max({v0.x, v1.x, v2.x, v3.x}); + const f32 top = std::min({v0.y, v1.y, v2.y, v3.y}); + const f32 bottom = std::max({v0.y, v1.y, v2.y, v3.y}); + return hit_rect(left, top, right, bottom, padding); +} + +bool hit_pane(J2DPane* pane, f32 padding) noexcept { + if (pane == nullptr || !pane->isVisible()) { + return false; + } + + const JGeometry::TBox2& bounds = pane->getBounds(); + return hit_rect(bounds.i.x, bounds.i.y, bounds.f.x, bounds.f.y, padding); +} + +} // namespace dusk::menu_pointer diff --git a/src/dusk/menu_pointer.h b/src/dusk/menu_pointer.h new file mode 100644 index 0000000000..86123f1163 --- /dev/null +++ b/src/dusk/menu_pointer.h @@ -0,0 +1,65 @@ +#pragma once + +#include "dolphin/types.h" + +class CPaneMgr; + +namespace dusk::menu_pointer { + +using TargetId = u16; +constexpr TargetId InvalidTarget = 0xffff; + +enum class Context { + None, + FileSelect, + Save, + ItemWheel, + Collection, + Options, + Dialog, +}; + +enum class Phase { + Move, + Press, + Release, + Cancel, +}; + +struct State { + f32 x = 0.0f; + f32 y = 0.0f; + bool valid = false; + bool down = false; + bool pressed = false; + bool released = false; + bool clicked = false; + bool touch = false; +}; + +void begin_game_frame() noexcept; +void end_game_frame() noexcept; +void begin_context(Context context) noexcept; +bool handle_fallthrough_pointer(f32 x, f32 y, Phase phase, bool touch, s32 mouseButton = -1) noexcept; + +bool active() noexcept; +bool enabled() noexcept; +bool mouse_capture_active() noexcept; +const State& state() noexcept; +void set_hover_target(TargetId target) noexcept; +bool consume_click() noexcept; +bool peek_click() noexcept; +void set_dialog_choice(u8 choice, bool clicked) noexcept; +bool get_dialog_choice(u8& choice) noexcept; +bool consume_dialog_click(u8& choice) noexcept; +void defer_activation(Context context, TargetId target) noexcept; +bool consume_deferred_activation(Context context, TargetId target) noexcept; +void clear_deferred_activation(Context context) noexcept; +u32 suppressed_pad_buttons(u32 port) noexcept; +void finish_pad_suppression_read(u32 port) noexcept; + +bool hit_rect(f32 left, f32 top, f32 right, f32 bottom, f32 padding = 0.0f) noexcept; +bool hit_pane(CPaneMgr* pane, f32 padding = 0.0f) noexcept; +bool hit_pane(J2DPane* pane, f32 padding = 0.0f) noexcept; + +} // namespace dusk::menu_pointer diff --git a/src/dusk/mod_loader.hpp b/src/dusk/mod_loader.hpp new file mode 100644 index 0000000000..34e17274bc --- /dev/null +++ b/src/dusk/mod_loader.hpp @@ -0,0 +1,286 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include "dusk/config.hpp" +#include "dusk/config_var.hpp" +#include "mods/api.h" + +namespace dusk::mods { +struct LoadedMod; +class ModBundle; +} // namespace dusk::mods + +struct ModContext { + dusk::mods::LoadedMod* mod = nullptr; +}; + +namespace dusk::mods::loader { +class NativeModule; +} // namespace dusk::mods::loader + +namespace dusk::mods { + +struct ModDependencyEdge { + LoadedMod* mod = nullptr; + bool required = false; +}; + +struct ModManifestInfo { + struct Import { + std::string id; + uint16_t major = 0; + bool required = false; + bool operator==(const Import&) const = default; + }; + struct Export { + std::string id; + uint16_t major = 0; + bool operator==(const Export&) const = default; + }; + std::vector imports; + std::vector exports; + bool operator==(const ModManifestInfo&) const = default; +}; + +struct ModMetadata { + std::string id; + std::string name; + std::string version; + std::string author; + std::string description; + std::string iconPath; + std::string bannerPath; +}; + +struct ModSearchDir { + std::filesystem::path path; + // Directory bundles dlopen their native lib in place instead of extracting it to the cache. + // Required where extracted code cannot run (iOS), desirable for signed/read-only installs. + bool inPlaceNative = false; + // Native library location for platforms that restrict placement (e.g. iOS/tvOS Frameworks/) + std::filesystem::path nativeLibDir; +}; + +struct ModMetaParsed { + uint32_t abiVersion = 0; + std::vector imports; + std::vector exports; + std::vector hookFns; + std::vector hookMems; + std::vector hookNames; +}; + +inline const char* hook_mem_vtable_symbol(const ModMetaHookMem& rec) { + return reinterpret_cast(&rec) + sizeof(ModMetaHookMem); +} + +inline const char* hook_mem_display_name(const ModMetaHookMem& rec) { + const char* vtable = hook_mem_vtable_symbol(rec); + return vtable + std::char_traits::length(vtable) + 1; +} + +inline const char* hook_name_symbol(const ModMetaHookName& rec) { + return reinterpret_cast(&rec) + sizeof(ModMetaHookName); +} + +struct NativeMod { + std::unique_ptr handle; + const ModMeta* meta = nullptr; + ModMetaParsed parsed; + ModContext** contextSymbol = nullptr; + + ModInitializeFn fn_initialize = nullptr; + ModUpdateFn fn_update = nullptr; + ModShutdownFn fn_shutdown = nullptr; +}; + +enum class NativeModStatus : u8 { + /** + * Mod does not have native code included. + */ + None, + + /** + * Native code mod loaded successfully. + * + * Note that this only indicates load status of the native library. If the native lib throws in + * its init function, it will still be disabled! + */ + Loaded, + + /** + * This build was compiled without native mod support! + */ + BuildDisabled, + + /** + * Mod ships native libraries, but none matches this build's platform and architecture. + */ + ModMissingPlatform, + + /** + * Mod is built for a different ABI version than this build of the game. + */ + ApiVersionMismatch, + + /** + * Mod is missing a required native API export. + */ + MissingExport, + + /** + * Mod's metadata record section is malformed. + */ + InvalidMetadata, + + /** + * Mod bundle contains files in an invalid location. + */ + InvalidBundle, + + /** + * Unknown error loading the native mod. + */ + Unknown, +}; + +struct LoadedMod { + ModMetadata metadata; + std::filesystem::path modPath; + std::filesystem::path dir; + // Stable UTF-8 storage for HostService::mod_dir. + std::string dirUtf8; + + uint32_t searchDirIndex = 0; + // Native lib is dlopen'd in place and stays resident for the session. Reload is unsupported. + bool inPlace = false; + + std::unique_ptr> cvarIsEnabled; + config::Subscription enabledSubscription = 0; + + bool active = false; + bool loadFailed = false; + std::string failureReason; + + // mod_initialize succeeded; a mod_shutdown is owed on deactivation. + bool initialized = false; + // Static service exports are currently present in the registry. + bool servicesRegistered = false; + // Lifecycle state last applied by the loader; diffed against cvarIsEnabled to pick up + // runtime enable/disable requests. + bool enabledApplied = false; + // Deactivated because a provider it imports from was disabled, not by its own cvar. + bool suspendedByProvider = false; + // Bumped per native lib extraction so every dlopen sees a fresh path (and thus a fresh + // image with fresh statics; a previous dlclose may not fully unmap). Also bumped by + // asset-only reloads, so it doubles as a generation for anything caching per-mod content. + uint32_t cacheGeneration = 0; + // Currently extracted native library, empty if none. + std::filesystem::path nativePath; + // Read-only directory containing the current platform's main module and runtime libraries. + std::filesystem::path nativeDir; + // Stable UTF-8 storage for HostService::native_dir. + std::string nativeDirUtf8; + + NativeModStatus nativeStatus = NativeModStatus::None; + std::unique_ptr native; + std::unique_ptr context; + + // Shared with overlay file registrations so in-flight DVD reads survive disable/reload. + std::shared_ptr bundle; + + ModManifestInfo manifestInfo; + + // Mods this mod imports services from, and mods importing services from this mod. + std::vector dependencies; + std::vector dependents; +}; + +class ModLoader { +public: + static ModLoader& instance(); + + void set_search_dirs(std::vector dirs) { m_searchDirs = std::move(dirs); } + void set_cache_dir(std::filesystem::path dir) { m_cacheDir = std::move(dir); } + void init(); + void tick(); + void shutdown(); + + void request_enable(std::string_view id); + void request_disable(std::string_view id); + void request_reload(std::string_view id); + void notify_mod_failure(LoadedMod& mod, bool firstFailure); + + [[nodiscard]] auto mods() const { + return m_mods | std::views::transform([](const auto& m) -> LoadedMod& { return *m; }); + } + + [[nodiscard]] auto active_mods() const { + return mods() | std::views::filter([](const auto& m) { return m.active; }); + } + +private: + enum class RequestKind : u8 { Enable, Disable, Reload }; + struct Request { + std::string modId; + RequestKind kind; + }; + // ModLoader::tick runs inside fapGm_Execute, so code from an unloading mod can still be + // live on the stack (its frame unwinds after the tick). dlclose is therefore deferred to + // the next tick, by which point every per-frame entry into the mod should have returned. + struct RetiredNative { + std::unique_ptr native; + std::filesystem::path directory; + }; + + std::vector> m_mods; + std::vector m_searchDirs; + std::filesystem::path m_cacheDir; + std::vector m_pendingRequests; + std::vector m_pendingFailures; + std::vector m_retiredNatives; + bool m_initialized = false; + bool m_startupComplete = false; + + void try_load_mod(const std::filesystem::path& modPath, bool fromDir, uint32_t searchDirIndex); + void load_native(LoadedMod& mod, const std::string& dllEntry, + const std::vector& runtimeEntries); + bool load_native_if_present(LoadedMod& mod); + // Resolved / if it exists on disk, empty otherwise. + [[nodiscard]] std::filesystem::path external_native_lib_path(const LoadedMod& mod) const; + void unload_native(LoadedMod& mod); + // Registers exports (if needed), resolves imports and runs mod_initialize. + // Returns whether the mod ended up active; failures go through fail_mod. + bool activate_mod(LoadedMod& mod); + // Runs mod_shutdown (if needed), detaches the mod from every service, and unloads the + // native lib. Must only run with no mod code on the stack (startup, shutdown, or top of tick). + void deactivate_mod(LoadedMod& mod); + void init_services(); + bool register_static_service_exports(LoadedMod& mod); + bool resolve_service_imports(LoadedMod& mod); + [[nodiscard]] std::string describe_missing_import( + const char* serviceId, uint16_t majorVersion, uint16_t minMinorVersion) const; + + LoadedMod* find_mod(std::string_view id) const; + void drain_retired_natives(); + void apply_pending_requests(); + void flush_toasts(); + void on_enabled_changed(LoadedMod& mod); + // Deactivates `target` (if needed) and its transitive dependents, optionally re-reads the + // bundle from disk, then reactivates whatever the current cvar/provider state allows. + void apply_lifecycle_change(LoadedMod& target, bool reload); + // `target` plus transitive active/suspended dependents, in m_mods (init) order. + std::vector collect_lifecycle_set(LoadedMod& target); + bool reload_bundle(LoadedMod& mod); + bool ensure_native_loaded(LoadedMod& mod); +}; + +using ModIndex = std::ranges::range_difference_t().mods())>; + +} // namespace dusk::mods diff --git a/src/dusk/mods/loader/bundle_disk.cpp b/src/dusk/mods/loader/bundle_disk.cpp new file mode 100644 index 0000000000..26e1bbd722 --- /dev/null +++ b/src/dusk/mods/loader/bundle_disk.cpp @@ -0,0 +1,60 @@ +#include + +#include "dusk/io.hpp" +#include "loader.hpp" + +namespace fs = std::filesystem; + +namespace dusk::mods { +ModBundleDisk::ModBundleDisk(fs::path root) : root_path(std::move(root)) {} + +std::vector ModBundleDisk::readFile(const std::string& fileName) { + return io::FileStream::ReadAllBytes(toRealPath(fileName)); +} + +std::vector ModBundleDisk::getFileNames() { + std::vector files; + + std::error_code ec; + for (fs::recursive_directory_iterator it(root_path, + fs::directory_options::skip_permission_denied | + fs::directory_options::follow_directory_symlink, + ec); + it != fs::recursive_directory_iterator(); it.increment(ec)) + { + if (ec) { + break; + } + + if (!it->is_regular_file()) { + continue; + } + + const auto& path = it->path(); + const auto relPath = fs::relative(path, root_path); + auto string = io::fs_path_to_string(relPath); + if constexpr (fs::path::preferred_separator != '/') { + // Convert \ to / on Windows + for (auto& chr : string) { + if (chr == fs::path::preferred_separator) { + chr = '/'; + } + } + } + + files.emplace_back(std::move(string)); + } + + return files; +} + +size_t ModBundleDisk::getFileSize(const std::string& fileName) { + return std::filesystem::file_size(toRealPath(fileName)); +} + +std::filesystem::path ModBundleDisk::toRealPath(const std::string& fileName) const { + const fs::path filePath = reinterpret_cast(fileName.c_str()); + return root_path / filePath; +} + +} // namespace dusk::mods diff --git a/src/dusk/mods/loader/bundle_zip.cpp b/src/dusk/mods/loader/bundle_zip.cpp new file mode 100644 index 0000000000..517c5943c2 --- /dev/null +++ b/src/dusk/mods/loader/bundle_zip.cpp @@ -0,0 +1,68 @@ +#include "fmt/format.h" +#include "loader.hpp" + +#include + +namespace dusk::mods { + +ModBundleZip::ModBundleZip(std::vector&& data) : zip_data(std::move(data)) { + if (!mz_zip_reader_init_mem(&res_zip, zip_data.data(), zip_data.size(), 0)) { + const auto error = mz_zip_get_last_error(&res_zip); + throw std::runtime_error( + fmt::format("Opening zip failed: {}", mz_zip_get_error_string(error))); + } +} + +ModBundleZip::~ModBundleZip() { + mz_zip_reader_end(&res_zip); +} + +std::vector ModBundleZip::readFile(const std::string& fileName) { + std::lock_guard lock{m_mutex}; + size_t size; + const auto ptr = mz_zip_reader_extract_file_to_heap(&res_zip, fileName.c_str(), &size, 0); + + if (!ptr) { + throw std::runtime_error(fmt::format("File does not exist: {}", fileName)); + } + + std::span data(static_cast(ptr), size); + std::vector vec(data.begin(), data.end()); + + mz_free(ptr); + + return vec; +} + +std::vector ModBundleZip::getFileNames() { + std::lock_guard lock{m_mutex}; + std::vector results; + + for (mz_uint i = 0, n = mz_zip_reader_get_num_files(&res_zip); i < n; ++i) { + mz_zip_archive_file_stat stat{}; + if (!mz_zip_reader_file_stat(&res_zip, i, &stat)) { + continue; + } + if (mz_zip_reader_is_file_a_directory(&res_zip, i)) { + continue; + } + + results.emplace_back(stat.m_filename); + } + + return results; +} + +size_t ModBundleZip::getFileSize(const std::string& fileName) { + std::lock_guard lock{m_mutex}; + const auto idx = mz_zip_reader_locate_file(&res_zip, fileName.c_str(), nullptr, 0); + if (idx < 0) { + throw std::runtime_error(fmt::format("Unable to locate file in zip: {}", fileName)); + } + + mz_zip_archive_file_stat stat{}; + mz_zip_reader_file_stat(&res_zip, idx, &stat); + return stat.m_uncomp_size; +} + +} // namespace dusk::mods diff --git a/src/dusk/mods/loader/context.cpp b/src/dusk/mods/loader/context.cpp new file mode 100644 index 0000000000..548f0bb06f --- /dev/null +++ b/src/dusk/mods/loader/context.cpp @@ -0,0 +1,61 @@ +#include "loader.hpp" + +#include "dusk/mods/log_buffer.hpp" +#include "dusk/mods/svc/registry.hpp" + +namespace dusk::mods { + +LoadedMod* mod_from_context(ModContext* context) { + return context != nullptr ? context->mod : nullptr; +} + +const LoadedMod* mod_from_context(const ModContext* context) { + return context != nullptr ? context->mod : nullptr; +} + +const char* mod_id_from_context(ModContext* context) { + const auto* mod = mod_from_context(context); + return mod != nullptr ? mod->metadata.id.c_str() : "mod"; +} + +bool is_safe_resource_path(std::string_view path) { + if (path.empty() || path.starts_with('/') || path.starts_with('\\') || + path.find(':') != std::string_view::npos) + { + return false; + } + + while (!path.empty()) { + const auto slash = path.find_first_of("/\\"); + const auto segment = path.substr(0, slash); + if (segment.empty() || segment == "." || segment == "..") { + return false; + } + if (slash == std::string_view::npos) { + break; + } + path.remove_prefix(slash + 1); + } + + return true; +} + +void fail_mod(LoadedMod& mod, ModResult code, std::string_view message) { + const bool firstFailure = !mod.loadFailed; + mod.active = false; + mod.loadFailed = true; + if (firstFailure || mod.failureReason.empty()) { + mod.failureReason = message; + } + // Stop the failed mod's services from resolving; mods that required them fail in turn. + // Pointers already handed to other mods stay callable since the library remains loaded. + // Nothing else is torn down here: fail_mod can run mid-frame (e.g. from a failing mod + // callback), and full teardown happens via deactivate_mod at a safe point. + svc::remove_services_for_provider(mod); + mod.servicesRegistered = false; + ModLoader::instance().notify_mod_failure(mod, firstFailure); + log::write( + mod.metadata.id, LOG_LEVEL_ERROR, "failed: {} ({})", message, static_cast(code)); +} + +} // namespace dusk::mods diff --git a/src/dusk/mods/loader/depgraph.cpp b/src/dusk/mods/loader/depgraph.cpp new file mode 100644 index 0000000000..d1748b56c4 --- /dev/null +++ b/src/dusk/mods/loader/depgraph.cpp @@ -0,0 +1,204 @@ +#include "depgraph.hpp" + +#include +#include + +#include "dusk/logging.h" +#include "loader.hpp" +#include "native_module.hpp" // IWYU pragma: keep + +namespace dusk::mods::loader { +namespace { +aurora::Module Log{"dusk::mods::loader"}; + +struct Edge { + size_t provider; + size_t importer; + bool required; + bool alive = true; +}; + +std::vector collect_edges(const std::vector>& mods) { + for (auto& mod : mods) { + mod->dependencies.clear(); + mod->dependents.clear(); + } + + // Mirrors the registry's first-registration-wins rule for duplicate exports. + const auto findProvider = [&](const ModManifestInfo::Import& serviceImport) -> size_t { + for (size_t i = 0; i < mods.size(); ++i) { + const auto matches = [&](const ModManifestInfo::Export& serviceExport) { + return serviceExport.major == serviceImport.major && + serviceExport.id == serviceImport.id; + }; + if (std::ranges::any_of(mods[i]->manifestInfo.exports, matches)) { + return i; + } + } + return mods.size(); // Host-provided or unavailable: no ordering constraint. + }; + + std::vector edges; + for (size_t importer = 0; importer < mods.size(); ++importer) { + auto& mod = *mods[importer]; + for (const auto& serviceImport : mod.manifestInfo.imports) { + const size_t provider = findProvider(serviceImport); + if (provider >= mods.size() || provider == importer) { + continue; + } + auto& providerMod = *mods[provider]; + const bool required = serviceImport.required; + + const auto existing = std::ranges::find_if(edges, [&](const Edge& edge) { + return edge.provider == provider && edge.importer == importer; + }); + if (existing != edges.end()) { + if (required && !existing->required) { + existing->required = true; + for (auto& dep : mod.dependencies) { + if (dep.mod == &providerMod) { + dep.required = true; + } + } + for (auto& dep : providerMod.dependents) { + if (dep.mod == &mod) { + dep.required = true; + } + } + } + } else { + edges.push_back({provider, importer, required}); + mod.dependencies.push_back({&providerMod, required}); + providerMod.dependents.push_back({&mod, required}); + } + } + } + return edges; +} + +// True if `start` can reach itself following live required edges through unplaced mods. +bool in_required_cycle( + const size_t start, const std::vector& edges, const std::vector& placed) { + std::vector pending{start}; + std::vector visited(placed.size(), false); + while (!pending.empty()) { + const size_t current = pending.back(); + pending.pop_back(); + for (const auto& edge : edges) { + if (!edge.alive || !edge.required || edge.provider != current || placed[edge.importer]) + { + continue; + } + if (edge.importer == start) { + return true; + } + if (!visited[edge.importer]) { + visited[edge.importer] = true; + pending.push_back(edge.importer); + } + } + } + return false; +} + +} // namespace + +void sort_mods(std::vector>& mods) { + const size_t count = mods.size(); + auto edges = collect_edges(mods); + if (edges.empty()) { + return; + } + + std::vector indegree(count, 0); + for (const auto& edge : edges) { + ++indegree[edge.importer]; + } + + std::vector order; + order.reserve(count); + std::vector placed(count, false); + + const auto place = [&](const size_t index) { + placed[index] = true; + order.push_back(index); + for (auto& edge : edges) { + if (edge.alive && edge.provider == index) { + edge.alive = false; + --indegree[edge.importer]; + } + } + }; + + while (order.size() < count) { + // Always take the lowest unplaced scan index that is ready, keeping the + // final order as close to scan (filename) order as the graph allows. + const auto ready = [&]() -> size_t { + for (size_t i = 0; i < count; ++i) { + if (!placed[i] && indegree[i] == 0) { + return i; + } + } + return count; + }(); + if (ready < count) { + place(ready); + continue; + } + + // Stalled: every unplaced mod is on or downstream of a cycle. + std::vector cycleMods; + for (size_t i = 0; i < count; ++i) { + if (!placed[i] && in_required_cycle(i, edges, placed)) { + cycleMods.push_back(i); + } + } + if (!cycleMods.empty()) { + std::string names; + for (const size_t index : cycleMods) { + if (!names.empty()) { + names += ", "; + } + names += mods[index]->metadata.id; + } + for (const size_t index : cycleMods) { + fail_mod(*mods[index], MOD_CONFLICT, + "Required service import cycle between mods: " + names); + place(index); + } + continue; + } + + // Only optional imports left in the cycle: drop one edge and retry. The + // import still resolves, but without any initialization-order guarantee. + const auto optionalEdge = std::ranges::find_if(edges, [&](const Edge& edge) { + return edge.alive && !edge.required && !placed[edge.provider] && !placed[edge.importer]; + }); + if (optionalEdge == edges.end()) { + // Unreachable: a stall with no required cycle implies an optional edge. + Log.error("mod dependency sort stalled unexpectedly"); + break; + } + Log.warn("optional service import cycle: '{}' will initialize before its optional " + "provider '{}'", + mods[optionalEdge->importer]->metadata.id, mods[optionalEdge->provider]->metadata.id); + optionalEdge->alive = false; + --indegree[optionalEdge->importer]; + } + + // Defensive: append anything a stall break left behind, in scan order. + for (size_t i = 0; i < count; ++i) { + if (!placed[i]) { + place(i); + } + } + + std::vector> sorted; + sorted.reserve(count); + for (const size_t index : order) { + sorted.push_back(std::move(mods[index])); + } + mods = std::move(sorted); +} + +} // namespace dusk::mods::loader diff --git a/src/dusk/mods/loader/depgraph.hpp b/src/dusk/mods/loader/depgraph.hpp new file mode 100644 index 0000000000..a6f5b30d50 --- /dev/null +++ b/src/dusk/mods/loader/depgraph.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include +#include + +#include "dusk/mod_loader.hpp" + +namespace dusk::mods::loader { + +// Reorders mods so service providers precede their importers, populating +// LoadedMod::dependencies/dependents from manifest imports along the way. +// Mods whose required imports form a cycle are failed; a cycle that can be +// broken by dropping an optional import is broken with a warning. Scan order +// is preserved between mods with no dependency relationship. +void sort_mods(std::vector>& mods); + +} // namespace dusk::mods::loader diff --git a/src/dusk/mods/loader/loader.cpp b/src/dusk/mods/loader/loader.cpp new file mode 100644 index 0000000000..353a2ab596 --- /dev/null +++ b/src/dusk/mods/loader/loader.cpp @@ -0,0 +1,1373 @@ +#include "loader.hpp" +#include "dusk/logging.h" +#include "dusk/mod_loader.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../manifest.hpp" +#include "depgraph.hpp" +#include "dusk/config.hpp" +#include "dusk/data.hpp" +#include "dusk/io.hpp" +#include "dusk/mods/log_buffer.hpp" +#include "dusk/mods/svc/config.hpp" +#include "dusk/mods/svc/hook.hpp" +#include "dusk/mods/svc/registry.hpp" +#include "dusk/ui/mods_window.hpp" +#include "dusk/ui/ui.hpp" +#include "miniz.h" +#include "native_module.hpp" +#include "nlohmann/json.hpp" + +using namespace std::string_literals; +using namespace std::string_view_literals; + +#if defined(_WIN32) +#if defined(_M_ARM64) +static constexpr std::string_view k_nativePlatform = "windows-arm64"sv; +#elif defined(_M_X64) +static constexpr std::string_view k_nativePlatform = "windows-amd64"sv; +#elif defined(_M_IX86) +static constexpr std::string_view k_nativePlatform = "windows-x86"sv; +#else +static constexpr std::string_view k_nativePlatform = ""sv; +#endif +static constexpr std::string_view k_nativeLibName = "mod.dll"sv; +#elif defined(__ANDROID__) +#if defined(__aarch64__) +static constexpr std::string_view k_nativePlatform = "android-aarch64"sv; +#elif defined(__x86_64__) +static constexpr std::string_view k_nativePlatform = "android-x86_64"sv; +#else +static constexpr std::string_view k_nativePlatform = ""sv; +#endif +static constexpr std::string_view k_nativeLibName = "mod.so"sv; +#elif defined(__APPLE__) +#include +#if TARGET_OS_IOS +static constexpr std::string_view k_nativePlatform = "ios-arm64"sv; +#elif TARGET_OS_TV +static constexpr std::string_view k_nativePlatform = "tvos-arm64"sv; +#elif defined(__aarch64__) +static constexpr std::string_view k_nativePlatform = "macos-arm64"sv; +#elif defined(__x86_64__) +static constexpr std::string_view k_nativePlatform = "macos-x86_64"sv; +#else +static constexpr std::string_view k_nativePlatform = ""sv; +#endif +static constexpr std::string_view k_nativeLibName = "mod.so"sv; +#elif defined(__linux__) +#if defined(__aarch64__) +static constexpr std::string_view k_nativePlatform = "linux-aarch64"sv; +#elif defined(__x86_64__) +static constexpr std::string_view k_nativePlatform = "linux-x86_64"sv; +#elif defined(__i386__) +static constexpr std::string_view k_nativePlatform = "linux-x86"sv; +#else +static constexpr std::string_view k_nativePlatform = ""sv; +#endif +static constexpr std::string_view k_nativeLibName = "mod.so"sv; +#else +static constexpr std::string_view k_nativePlatform = ""sv; +static constexpr std::string_view k_nativeLibName = ""sv; +#endif + +namespace dusk::mods { +namespace { +aurora::Module Log{"dusk::mods::loader"}; +ModLoader g_modLoader; +constexpr std::string_view k_nativeLibDir = "lib/"sv; + +class DirectoryRollback { +public: + ~DirectoryRollback() { + if (!mPath.empty()) { + std::error_code ec; + std::filesystem::remove_all(mPath, ec); + } + } + + void set_path(std::filesystem::path path) { mPath = std::move(path); } + void release() { mPath.clear(); } + +private: + std::filesystem::path mPath; +}; + +std::unique_ptr load_bundle(const std::filesystem::path& modPath, bool fromDir) { + if (fromDir) { + return std::make_unique(modPath); + } else { + std::vector data = io::FileStream::ReadAllBytes(modPath); + return std::make_unique(std::move(data)); + } +} + +struct NativeRuntimeLocation { + std::string entry; + std::vector runtimeEntries; + bool anyLibs = false; +}; + +struct NativeLocateFailure { + NativeModStatus status; + std::string logMessage; +}; + +using NativeLocateResult = std::variant; + +bool has_native_library_extension(std::string_view name) { + const auto endsWith = [name](std::string_view extension) { + if (name.size() < extension.size()) { + return false; + } + const auto suffix = name.substr(name.size() - extension.size()); + return std::ranges::equal(suffix, extension, [](char lhs, char rhs) { + const auto lower = [](char value) { + return value >= 'A' && value <= 'Z' ? static_cast(value + ('a' - 'A')) : + value; + }; + return lower(lhs) == lower(rhs); + }); + }; + return endsWith(".dll"sv) || endsWith(".so"sv) || endsWith(".dylib"sv); +} + +NativeLocateResult locate_native_runtime(ModBundle& bundle) { + NativeRuntimeLocation result; + const std::string platformPrefix = fmt::format("{}{}/", k_nativeLibDir, k_nativePlatform); + const std::string nativeEntry = platformPrefix + std::string{k_nativeLibName}; + for (const auto& name : bundle.getFileNames()) { + if (name.find('/') == std::string::npos && has_native_library_extension(name)) { + return NativeLocateFailure{ + NativeModStatus::InvalidBundle, + fmt::format( + "native library '{}' found at the root (natives go in /lib/{{platform}})", + name), + }; + } + if (!name.starts_with(k_nativeLibDir)) { + continue; + } + + const std::string_view libPath{ + name.data() + k_nativeLibDir.size(), name.size() - k_nativeLibDir.size()}; + const auto platformEnd = libPath.find('/'); + if (platformEnd != std::string_view::npos) { + const auto entryName = libPath.substr(platformEnd + 1); + if (entryName.find('/') == std::string_view::npos && + (entryName == "mod.dll"sv || entryName == "mod.so"sv)) + { + result.anyLibs = true; + } + } + + if (!k_nativePlatform.empty() && name.starts_with(platformPrefix)) { + const std::string_view relativeName{ + name.data() + platformPrefix.size(), name.size() - platformPrefix.size()}; + if (!is_safe_resource_path(relativeName)) { + continue; + } + result.runtimeEntries.push_back(name); + } + if (name == nativeEntry) { + result.entry = name; + } + } + std::ranges::sort(result.runtimeEntries); + result.runtimeEntries.erase( + std::unique(result.runtimeEntries.begin(), result.runtimeEntries.end()), + result.runtimeEntries.end()); + return result; +} +} // namespace + +ModLoader& ModLoader::instance() { + return g_modLoader; +} + +class InvalidModDataException : public std::runtime_error { +public: + explicit InvalidModDataException(const std::string& msg) : runtime_error(msg) {} + explicit InvalidModDataException(const char* msg) : runtime_error(msg) {} +}; + +static void validate_mod_id(std::string_view const str) { + if (str.empty()) { + throw InvalidModDataException("Missing ID value in mod metadata!"); + } + + bool lastWasPeriod = false; + for (auto const chr : str) { + if (chr == '.') { + if (lastWasPeriod) { + throw InvalidModDataException("Cannot have two consecutive periods in mod ID!"); + } + lastWasPeriod = true; + continue; + } + + lastWasPeriod = false; + + if (chr == '_') + continue; + + if (chr >= '0' && chr <= '9') + continue; + + if (chr >= 'a' && chr <= 'z') + continue; + + if (chr >= 'A' && chr <= 'Z') + continue; + + throw InvalidModDataException( + fmt::format("Invalid character '{}' in mod ID. Valid characters are period, " + "underscore, and alphanumerics.", + chr)); + } +} + +static bool bundle_has_file(ModBundle& bundle, const std::string& path) { + try { + bundle.getFileSize(path); + return true; + } catch (const std::runtime_error&) { + return false; + } +} + +static std::string resolve_image_path(ModBundle& bundle, const std::string& modId, + std::string_view key, const std::string& manifestPath, const std::string& defaultPath) { + if (!manifestPath.empty()) { + if (!is_safe_resource_path(manifestPath)) { + log::write( + modId, LOG_LEVEL_WARN, "invalid {} path '{}' in mod.json", key, manifestPath); + } else if (!bundle_has_file(bundle, manifestPath)) { + log::write( + modId, LOG_LEVEL_WARN, "{} path '{}' not found in bundle", key, manifestPath); + } else { + return manifestPath; + } + } + if (bundle_has_file(bundle, defaultPath)) { + return defaultPath; + } + return {}; +} + +static ModMetadata load_metadata(const std::filesystem::path& modPath, ModBundle& bundle) { + const auto metaJson = bundle.readFile("mod.json"); + auto j = nlohmann::json::parse(metaJson); + + std::string metaId = j.value("id", ""); + std::string metaName = j.value("name", ""); + std::string metaVersion = j.value("version", ""); + std::string metaAuthor = j.value("author", ""); + std::string metaDescription = j.value("description", ""); + std::string metaIcon = j.value("icon", ""); + std::string metaBanner = j.value("banner", ""); + + validate_mod_id(metaId); + + if (metaName.empty()) { + metaName = io::fs_path_to_string(modPath.stem()); + } + if (metaVersion.empty()) { + metaVersion = "?"s; + } + if (metaAuthor.empty()) { + metaAuthor = "unknown"s; + } + + std::string iconPath = resolve_image_path(bundle, metaId, "icon", metaIcon, "res/icon.png"s); + std::string bannerPath = + resolve_image_path(bundle, metaId, "banner", metaBanner, "res/banner.png"s); + + return ModMetadata{ + std::move(metaId), + std::move(metaName), + std::move(metaVersion), + std::move(metaAuthor), + std::move(metaDescription), + std::move(iconPath), + std::move(bannerPath), + }; +} + +// True if the first `capacity` bytes of `str` contain a NUL. +static bool terminated_within(const char* str, size_t capacity) { + return std::memchr(str, '\0', capacity) != nullptr; +} + +static bool parse_meta(NativeMod& native, LoadedMod& mod) { + const ModMeta* meta = native.meta; + if (meta->struct_size < sizeof(ModMeta)) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "mod_meta descriptor has invalid size {}", + meta->struct_size); + mod.nativeStatus = NativeModStatus::InvalidMetadata; + return false; + } + const auto* cursor = static_cast(meta->records_begin); + const auto* end = static_cast(meta->records_end); + if (cursor == nullptr || end == nullptr || cursor > end || + (reinterpret_cast(cursor) & 7) != 0) + { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "mod_meta section bounds are invalid"); + mod.nativeStatus = NativeModStatus::InvalidMetadata; + return false; + } + + ModMetaParsed parsed; + size_t headerCount = 0; + const auto invalid = [&](std::string_view why) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "invalid metadata record at offset {}: {}", + cursor - static_cast(meta->records_begin), why); + mod.nativeStatus = NativeModStatus::InvalidMetadata; + return false; + }; + + while (cursor < end) { + if (end - cursor < 8) { + return invalid("trailing bytes"); + } + uint64_t first = 0; + std::memcpy(&first, cursor, sizeof(first)); + if (first == 0) { // linker padding / bounds sentinel + cursor += 8; + continue; + } + + const auto* rec = reinterpret_cast(cursor); + const size_t size = rec->size; + if (size < 8 || size % 8 != 0 || size > static_cast(end - cursor)) { + return invalid("bad record size"); + } + + switch (rec->kind) { + case MOD_META_PAD: + break; + case MOD_META_HEADER: { + if (size < sizeof(ModMetaHeader)) { + return invalid("truncated header record"); + } + const auto* header = reinterpret_cast(rec); + ++headerCount; + parsed.abiVersion = header->abi_version; + break; + } + case MOD_META_IMPORT: { + if (size < sizeof(ModMetaImport)) { + return invalid("truncated import record"); + } + auto* record = reinterpret_cast(const_cast(cursor)); + if (!terminated_within(record->service_id.chars, sizeof(record->service_id.chars))) { + return invalid("unterminated import service id"); + } + parsed.imports.push_back(record); + break; + } + case MOD_META_EXPORT: { + if (size < sizeof(ModMetaExport)) { + return invalid("truncated export record"); + } + auto* record = reinterpret_cast(const_cast(cursor)); + if (!terminated_within(record->service_id.chars, sizeof(record->service_id.chars))) { + return invalid("unterminated export service id"); + } + parsed.exports.push_back(record); + break; + } + case MOD_META_HOOK_FN: { + if (size < sizeof(ModMetaHookFn)) { + return invalid("truncated hook record"); + } + parsed.hookFns.push_back( + reinterpret_cast(const_cast(cursor))); + break; + } + case MOD_META_HOOK_MEM: { + if (size <= sizeof(ModMetaHookMem)) { + return invalid("truncated hook record"); + } + auto* record = reinterpret_cast(const_cast(cursor)); + const char* strings = reinterpret_cast(cursor) + sizeof(ModMetaHookMem); + const size_t capacity = size - sizeof(ModMetaHookMem); + if (!terminated_within(strings, capacity)) { + return invalid("unterminated hook vtable symbol"); + } + const size_t vtableLen = std::char_traits::length(strings); + if (!terminated_within(strings + vtableLen + 1, capacity - vtableLen - 1)) { + return invalid("unterminated hook display name"); + } + parsed.hookMems.push_back(record); + break; + } + case MOD_META_HOOK_NAME: { + if (size <= sizeof(ModMetaHookName)) { + return invalid("truncated hook record"); + } + auto* record = reinterpret_cast(const_cast(cursor)); + const char* name = reinterpret_cast(cursor) + sizeof(ModMetaHookName); + if (!terminated_within(name, size - sizeof(ModMetaHookName))) { + return invalid("unterminated hook symbol name"); + } + parsed.hookNames.push_back(record); + break; + } + default: + // Additive record kinds may appear within a format version; skip them. + log::write(mod.metadata.id, LOG_LEVEL_DEBUG, "skipping unknown metadata record kind {}", + rec->kind); + break; + } + cursor += size; + } + + if (headerCount != 1) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "expected 1 metadata header record, found {}", + headerCount); + mod.nativeStatus = NativeModStatus::InvalidMetadata; + return false; + } + if (parsed.abiVersion != MOD_ABI_VERSION) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "expects ABI v{} but engine is v{}, skipping", + parsed.abiVersion, MOD_ABI_VERSION); + mod.nativeStatus = NativeModStatus::ApiVersionMismatch; + return false; + } + + native.parsed = std::move(parsed); + return true; +} + +static std::string lifecycle_error_message( + const char* fnName, const ModResult result, const ModError& error) { + if (error.message[0] != '\0') { + return error.message; + } + return fmt::format("{} failed with result {}", fnName, static_cast(result)); +} + +static std::string native_status_message(const NativeModStatus status) { + switch (status) { + case NativeModStatus::BuildDisabled: + return "Code mods are disabled on this Dusklight build"; + case NativeModStatus::ModMissingPlatform: + return fmt::format("Mod not supported on this platform ({})", k_nativePlatform); + case NativeModStatus::ApiVersionMismatch: + // TODO: differentiate whether mod or Dusklight is out of date + return "Mod ABI version mismatch"; + case NativeModStatus::MissingExport: + return "Missing required mod API exports"; + case NativeModStatus::InvalidMetadata: + return "Invalid mod metadata records"; + case NativeModStatus::InvalidBundle: + return "Invalid mod bundle layout (old mod?)"; + case NativeModStatus::Unknown: + return "Unknown mod load failure"; + case NativeModStatus::None: + case NativeModStatus::Loaded: + break; + } + return "native mod failed to load"; +} + +std::filesystem::path ModLoader::external_native_lib_path(const LoadedMod& mod) const { + namespace fs = std::filesystem; + if (k_nativeLibName.empty()) { + return {}; + } + const auto& libDir = m_searchDirs[mod.searchDirIndex].nativeLibDir; + if (libDir.empty()) { + return {}; + } + fs::path path = libDir / fs::path(mod.metadata.id + + io::fs_path_to_string(fs::path(k_nativeLibName).extension())); + std::error_code ec; + if (!fs::is_regular_file(path, ec)) { + return {}; + } + return path; +} + +void ModLoader::load_native( + LoadedMod& mod, const std::string& dllEntry, const std::vector& runtimeEntries) { + if (!EnableCodeMods) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "Code mods are not available in this build"); + mod.nativeStatus = NativeModStatus::BuildDisabled; + return; + } + + namespace fs = std::filesystem; + + const fs::path cacheDir = m_cacheDir / mod.metadata.id; + const fs::path scratchDir = cacheDir / "data"; + std::error_code ec; + fs::create_directories(scratchDir, ec); + if (ec) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to create mod directory {}: {}", + data::abbreviated_path_string(scratchDir), ec.message()); + return; + } + mod.dir = fs::absolute(scratchDir); + mod.dirUtf8 = io::fs_path_to_string(mod.dir); + + fs::path libPath; + fs::path runtimeDir; + DirectoryRollback runtimeDirRollback; + if (mod.inPlace) { + if (!dllEntry.empty()) { + libPath = mod.modPath / dllEntry; + } else if (auto external = external_native_lib_path(mod); !external.empty()) { + libPath = std::move(external); + } else { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, + "no native library named {} found; skipping", k_nativeLibName); + mod.nativeStatus = NativeModStatus::ModMissingPlatform; + return; + } + runtimeDir = libPath.parent_path(); + } else { + if (dllEntry.empty()) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, + "no native library named {} found; skipping", k_nativeLibName); + mod.nativeStatus = NativeModStatus::ModMissingPlatform; + return; + } + + // Every generation gets a new directory. The main module and all of its runtime + // libraries therefore have fresh paths and can coexist with a previous generation + // that is still unwinding after a reload. + runtimeDir = cacheDir / fmt::format("g{}", ++mod.cacheGeneration); + runtimeDirRollback.set_path(runtimeDir); + fs::create_directories(runtimeDir, ec); + if (ec) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, + "failed to create native runtime directory {}: {}", + data::abbreviated_path_string(runtimeDir), ec.message()); + return; + } + + const std::string platformPrefix = fmt::format("{}{}/", k_nativeLibDir, k_nativePlatform); + for (const auto& entry : runtimeEntries) { + if (!entry.starts_with(platformPrefix)) { + continue; + } + const std::string_view relativeName{ + entry.data() + platformPrefix.size(), entry.size() - platformPrefix.size()}; + if (!is_safe_resource_path(relativeName)) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, + "unsafe native runtime path '{}'; skipping", entry); + return; + } + + const fs::path outputPath = runtimeDir / fs::path{relativeName}; + fs::create_directories(outputPath.parent_path(), ec); + if (ec) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, + "failed to create directory for {}: {}", entry, ec.message()); + return; + } + + std::vector data; + try { + data = mod.bundle->readFile(entry); + } catch (const std::exception& e) { + log::write( + mod.metadata.id, LOG_LEVEL_ERROR, "failed to extract {}: {}", entry, e.what()); + return; + } + + std::ofstream out(outputPath, std::ios::binary | std::ios::out); + if (!out) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to write {}", entry); + return; + } + out.write(reinterpret_cast(data.data()), + static_cast(data.size())); + if (!out) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to write {}", entry); + return; + } + } + + libPath = runtimeDir / fs::path{dllEntry}.filename(); + } + + auto nativeMod = std::make_unique(); + try { + nativeMod->handle = std::make_unique(libPath); + } catch (const std::runtime_error& e) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to open {}: {}", + data::abbreviated_path_string(libPath), e.what()); + return; + } + + nativeMod->meta = nativeMod->handle->LookupSymbol("mod_meta"); + nativeMod->contextSymbol = nativeMod->handle->LookupSymbol("mod_ctx"); + nativeMod->fn_initialize = nativeMod->handle->LookupSymbol("mod_initialize"); + nativeMod->fn_update = nativeMod->handle->LookupSymbol("mod_update"); + nativeMod->fn_shutdown = nativeMod->handle->LookupSymbol("mod_shutdown"); + + if (!nativeMod->meta || !nativeMod->contextSymbol || !nativeMod->fn_initialize || + !nativeMod->fn_update || !nativeMod->fn_shutdown) + { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, + "{} missing required mod API exports; skipping", + data::abbreviated_path_string(libPath)); + mod.nativeStatus = NativeModStatus::MissingExport; + return; + } + + if (!parse_meta(*nativeMod, mod)) { + return; + } + + if (nativeMod->contextSymbol == nullptr) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "missing required mod_ctx export"); + mod.nativeStatus = NativeModStatus::MissingExport; + return; + } + *nativeMod->contextSymbol = mod.context.get(); + + mod.nativePath = fs::absolute(libPath); + mod.nativeDir = fs::absolute(runtimeDir); + mod.nativeDirUtf8 = io::fs_path_to_string(mod.nativeDir); + mod.native = std::move(nativeMod); + mod.nativeStatus = NativeModStatus::Loaded; + runtimeDirRollback.release(); +} + +bool ModLoader::load_native_if_present(LoadedMod& mod) { + const auto result = locate_native_runtime(*mod.bundle); + if (const auto* failure = std::get_if(&result)) { + mod.nativeStatus = failure->status; + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "{}", failure->logMessage); + fail_mod(mod, MOD_ERROR, native_status_message(failure->status)); + return false; + } + + const auto& native = std::get(result); + if (!native.anyLibs && !(mod.inPlace && !external_native_lib_path(mod).empty())) { + mod.nativeStatus = NativeModStatus::None; + return true; + } + + mod.nativeStatus = NativeModStatus::Unknown; + load_native(mod, native.entry, native.runtimeEntries); + if (mod.nativeStatus != NativeModStatus::Loaded) { + fail_mod(mod, MOD_ERROR, native_status_message(mod.nativeStatus)); + return false; + } + return true; +} + +void ModLoader::unload_native(LoadedMod& mod) { + if (!mod.native || mod.inPlace) { + return; + } + // Deferred dlclose: this mod's code may still be on the stack below the current tick + m_retiredNatives.push_back({std::move(mod.native), std::move(mod.nativeDir)}); + mod.nativePath.clear(); + mod.nativeDir.clear(); + mod.nativeDirUtf8.clear(); +} + +void ModLoader::drain_retired_natives() { + for (auto& retired : m_retiredNatives) { + retired.native.reset(); + if (!retired.directory.empty()) { + std::error_code ec; + std::filesystem::remove_all(retired.directory, ec); + } + } + m_retiredNatives.clear(); +} + +static ModManifestInfo build_manifest_info(const ModMetaParsed& parsed) { + ModManifestInfo info; + info.imports.reserve(parsed.imports.size()); + for (const auto* record : parsed.imports) { + if (!svc::valid_service_id(record->service_id.chars)) { + continue; + } + info.imports.push_back({record->service_id.chars, record->major_version, + (record->rec.flags & SERVICE_IMPORT_OPTIONAL) == 0}); + } + info.exports.reserve(parsed.exports.size()); + for (const auto* record : parsed.exports) { + if (!svc::valid_service_id(record->service_id.chars)) { + continue; + } + info.exports.push_back({record->service_id.chars, record->major_version}); + } + return info; +} + +std::string escape_mod_id_for_config(std::string_view const id) { + std::string buf; + + // Simple escaping. All characters in mod IDs literal, except for '.' and '_'. + // '.' -> '_', '_' -> '__' + for (char const chr : id) { + if (chr == '.') { + buf.push_back('_'); + } else if (chr == '_') { + buf.push_back('_'); + buf.push_back('_'); + } else { + buf.push_back(chr); + } + } + + return buf; +} + +static std::string mod_enabled_cvar_name(std::string_view const id) { + return fmt::format("mod.{}.enabled", escape_mod_id_for_config(id)); +} + +static bool required_deps_active(const LoadedMod& mod) { + return std::ranges::all_of(mod.dependencies, + [](const ModDependencyEdge& edge) { return !edge.required || edge.mod->active; }); +} + +// A deferred export that was not published by the end of the provider's initialization can +// never resolve, which is almost certainly a bug in the provider. +static void warn_unpublished_deferred_exports(const LoadedMod& mod) { + if (!mod.active || !mod.native) { + return; + } + + for (const auto* serviceExport : mod.native->parsed.exports) { + if ((serviceExport->rec.flags & SERVICE_EXPORT_DEFERRED) == 0) { + continue; + } + const auto* record = + svc::find_service_record(serviceExport->service_id.chars, serviceExport->major_version); + if (record != nullptr && record->service == nullptr) { + log::write(mod.metadata.id, LOG_LEVEL_WARN, + "declared deferred service '{}@{}' but never published it during initialization", + serviceExport->service_id.chars, serviceExport->major_version); + } + } +} + +void ModLoader::try_load_mod( + const std::filesystem::path& modPath, bool fromDir, uint32_t searchDirIndex) { + namespace fs = std::filesystem; + + std::unique_ptr bundle; + try { + bundle = load_bundle(modPath, fromDir); + } catch (const std::exception& e) { + Log.error("Failed to open {} bundle: {}", data::abbreviated_path_string(modPath), e.what()); + return; + } + + ModMetadata metadata; + try { + metadata = load_metadata(modPath, *bundle); + } catch (const std::exception& e) { + Log.error("bad mod.json in {}: {}", data::abbreviated_path_string(modPath), e.what()); + return; + } + + if (const auto* existing = find_mod(metadata.id)) { + if (existing->searchDirIndex < searchDirIndex) { + log::write(metadata.id, LOG_LEVEL_INFO, "{} shadowed by higher-priority duplicate {}", + data::abbreviated_path_string(modPath), + data::abbreviated_path_string(existing->modPath)); + } else { + log::write(metadata.id, LOG_LEVEL_ERROR, "duplicate mod id, not loading {}", + data::abbreviated_path_string(modPath)); + } + return; + } + + const auto& inserted = m_mods.emplace_back(std::make_unique()); + auto& mod = *inserted; + mod.active = true; + mod.modPath = fs::absolute(modPath); + mod.searchDirIndex = searchDirIndex; + mod.inPlace = m_searchDirs[searchDirIndex].inPlaceNative && fromDir; + mod.metadata = std::move(metadata); + mod.bundle = std::move(bundle); + mod.context = std::make_unique(); + mod.context->mod = &mod; + mod.cvarIsEnabled = + std::make_unique>(mod_enabled_cvar_name(mod.metadata.id), true); + if (load_native_if_present(mod) && mod.native) { + mod.manifestInfo = build_manifest_info(mod.native->parsed); + } + + log::write(mod.metadata.id, LOG_LEVEL_INFO, "found '{}' v{} by {} ({})", mod.metadata.name, + mod.metadata.version, mod.metadata.author, data::abbreviated_path_string(modPath)); +} + +bool ModLoader::activate_mod(LoadedMod& mod) { + log::write(mod.metadata.id, LOG_LEVEL_INFO, "activating mod"); + mod.active = true; + + // Asset-only mods have no lifecycle beyond their overlay files. + if (!mod.native) { + mod.enabledApplied = true; + return true; + } + + if (!mod.servicesRegistered) { + if (!register_static_service_exports(mod)) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to register service exports"); + deactivate_mod(mod); + return false; + } + mod.servicesRegistered = true; + } + + if (!resolve_service_imports(mod)) { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to resolve service imports"); + deactivate_mod(mod); + return false; + } + + svc::hook_resolve_mod_records(mod); + + *mod.native->contextSymbol = mod.context.get(); + + log::write(mod.metadata.id, LOG_LEVEL_TRACE, "calling mod_initialize"); + try { + ModError error = MOD_ERROR_INIT; + const auto result = mod.native->fn_initialize(&error); + if (result == MOD_OK && !mod.loadFailed) { + mod.initialized = true; + log::write(mod.metadata.id, LOG_LEVEL_TRACE, "mod_initialize succeeded"); + } else if (result != MOD_OK && !mod.loadFailed) { + fail_mod(mod, result, lifecycle_error_message("mod_initialize", result, error)); + } + } catch (const std::exception& e) { + fail_mod(mod, MOD_ERROR, fmt::format("Exception in mod_initialize: {}", e.what())); + } catch (...) { + fail_mod(mod, MOD_ERROR, "Unknown exception in mod_initialize"); + } + + warn_unpublished_deferred_exports(mod); + + if (!mod.active) { + // Failed initialization may have left hooks or other service state behind + deactivate_mod(mod); + return false; + } + + mod.enabledApplied = true; + return true; +} + +void ModLoader::deactivate_mod(LoadedMod& mod) { + if (mod.initialized && mod.native && mod.native->fn_shutdown) { + log::write(mod.metadata.id, LOG_LEVEL_TRACE, "calling mod_shutdown"); + try { + ModError error = MOD_ERROR_INIT; + const auto result = mod.native->fn_shutdown(&error); + if (result == MOD_OK) { + log::write(mod.metadata.id, LOG_LEVEL_TRACE, "mod_shutdown succeeded"); + } else { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "mod_shutdown failed: {}", + lifecycle_error_message("mod_shutdown", result, error)); + } + } catch (...) { + } + } + mod.initialized = false; + + if (mod.servicesRegistered) { + svc::remove_services_for_provider(mod); + mod.servicesRegistered = false; + } + svc::modules_mod_detached(mod); + unload_native(mod); + + mod.active = false; + mod.enabledApplied = false; +} + +void ModLoader::init() { + if (m_initialized) { + return; + } + m_initialized = true; + + manifest::initialize(); + + if (m_searchDirs.empty()) { + Log.warn("no mod search directories configured; mod loading skipped"); + return; + } + + if (m_cacheDir.empty()) { + m_cacheDir = m_searchDirs.front().path / ".cache"; + } + + namespace fs = std::filesystem; + std::error_code ec; + + // Stale libs from previous sessions (see load_native). + fs::remove_all(m_cacheDir, ec); + + for (size_t dirIndex = 0; dirIndex < m_searchDirs.size(); ++dirIndex) { + const auto& searchDir = m_searchDirs[dirIndex]; + + // --mods can point the user dir at the bundled dir; don't scan the same dir twice. + bool alreadyScanned = false; + for (size_t earlier = 0; earlier < dirIndex && !alreadyScanned; ++earlier) { + alreadyScanned = fs::equivalent(m_searchDirs[earlier].path, searchDir.path, ec); + } + if (alreadyScanned) { + continue; + } + + if (!fs::is_directory(searchDir.path)) { + if (dirIndex == 0) { + Log.info( + "mods directory '{}' not found", data::abbreviated_path_string(searchDir.path)); + } else { + Log.debug( + "mods directory '{}' not found", data::abbreviated_path_string(searchDir.path)); + } + continue; + } + + std::vector entries; + for (auto& e : fs::directory_iterator(searchDir.path, ec)) { + if (e.is_directory() && std::filesystem::exists(e.path() / "mod.json")) { + entries.push_back(e); + } else if (e.is_regular_file() && e.path().extension() == ".dusk") { + entries.push_back(e); + } + } + std::sort(entries.begin(), entries.end(), + [](const fs::directory_entry& a, const fs::directory_entry& b) { + return a.path().filename() < b.path().filename(); + }); + + for (auto& entry : entries) { + try_load_mod(entry.path(), entry.is_directory(), static_cast(dirIndex)); + } + } + + if (m_mods.empty()) { + Log.info("no mods found"); + return; + } + + std::stable_sort(m_mods.begin(), m_mods.end(), + [](const auto& a, const auto& b) { return a->searchDirIndex > b->searchDirIndex; }); + + Log.info("initializing {} mod(s)...", m_mods.size()); + for (auto& mod : mods()) { + mod.enabledSubscription = Register(*mod.cvarIsEnabled, + [this, &mod](const bool&, const bool&) { on_enabled_changed(mod); }); + } + + init_services(); + + // Providers must initialize (and publish deferred services) before their importers, so + // imports are resolved per mod, interleaved with initialization, in dependency order. + loader::sort_mods(m_mods); + + // Decide the startup lifecycle state before publishing exports. Config-disabled mods and + // mods blocked by required providers keep dependency edges but must not resolve or provide + // services until they can actually initialize. + for (auto& mod : mods()) { + if (!mod.cvarIsEnabled->getValue()) { + log::write(mod.metadata.id, LOG_LEVEL_INFO, "disabled by config"); + mod.active = false; + mod.suspendedByProvider = false; + continue; + } + if (!mod.loadFailed && !required_deps_active(mod)) { + log::write( + mod.metadata.id, LOG_LEVEL_INFO, "suspended: a required provider is disabled"); + mod.active = false; + mod.suspendedByProvider = true; + continue; + } + mod.suspendedByProvider = false; + } + + for (auto& mod : mods()) { + if (!mod.active || !mod.native) { + continue; + } + if (register_static_service_exports(mod)) { + mod.servicesRegistered = true; + } else { + log::write(mod.metadata.id, LOG_LEVEL_ERROR, "failed to register service exports"); + deactivate_mod(mod); + } + } + + for (auto& mod : mods()) { + if (mod.active) { + activate_mod(mod); + } + } + + svc::modules_lifecycle_applied(); + + auto active = std::ranges::count_if(mods(), [](const LoadedMod& m) { return m.active; }); + Log.info("{}/{} mod(s) active", active, m_mods.size()); + + m_startupComplete = true; +} + +LoadedMod* ModLoader::find_mod(std::string_view id) const { + for (auto& mod : mods()) { + if (mod.metadata.id == id) { + return &mod; + } + } + return nullptr; +} + +void ModLoader::request_enable(std::string_view id) { + if (auto* mod = find_mod(id)) { + mod->cvarIsEnabled->setValue(true); + } +} + +void ModLoader::request_disable(std::string_view id) { + if (auto* mod = find_mod(id)) { + mod->cvarIsEnabled->setValue(false); + } +} + +void ModLoader::request_reload(std::string_view id) { + m_pendingRequests.push_back({std::string{id}, RequestKind::Reload}); +} + +void ModLoader::notify_mod_failure(LoadedMod& mod, bool firstFailure) { + if (firstFailure) { + m_pendingFailures.push_back(mod.metadata.name); + } + // Startup failures are handled inline by activate_mod + if (!m_startupComplete) { + return; + } + m_pendingRequests.push_back({mod.metadata.id, RequestKind::Disable}); +} + +void ModLoader::flush_toasts() { + if (m_pendingFailures.empty()) { + return; + } + + const auto names = std::exchange(m_pendingFailures, {}); + + // Skip displaying toasts if the mods window is currently open + if (const auto* window = dynamic_cast(ui::top_document())) { + if (window->visible()) { + return; + } + } + + ui::Toast toast{.type = "warning", .duration = std::chrono::seconds{5}}; + if (names.size() == 1) { + toast.title = "Mod failed"; + toast.content = + fmt::format("
{} failed and was disabled.
Check Mods for " + "more information.
", + ui::escape(names.front())); + } else { + toast.title = "Mods failed"; + toast.content = fmt::format("
{} mods failed and were disabled.
Check " + "Mods for more information.
", + names.size()); + } + ui::push_toast(std::move(toast)); +} + +std::vector ModLoader::collect_lifecycle_set(LoadedMod& target) { + std::vector included{&target}; + std::vector pending{&target}; + while (!pending.empty()) { + auto* current = pending.back(); + pending.pop_back(); + for (const auto& edge : current->dependents) { + auto* dependent = edge.mod; + if (!dependent->active && !dependent->suspendedByProvider) { + continue; + } + if (std::ranges::find(included, dependent) != included.end()) { + continue; + } + included.push_back(dependent); + pending.push_back(dependent); + } + } + + std::vector ordered; + ordered.reserve(included.size()); + for (auto& mod : mods()) { + if (std::ranges::find(included, &mod) != included.end()) { + ordered.push_back(&mod); + } + } + return ordered; +} + +bool ModLoader::ensure_native_loaded(LoadedMod& mod) { + if (mod.native || mod.nativeStatus == NativeModStatus::None) { + return true; + } + return load_native_if_present(mod); +} + +bool ModLoader::reload_bundle(LoadedMod& mod) { + namespace fs = std::filesystem; + log::write(mod.metadata.id, LOG_LEVEL_INFO, "reloading from {}", + data::abbreviated_path_string(mod.modPath)); + + std::shared_ptr newBundle; + ModMetadata newMetadata; + try { + std::error_code ec; + newBundle = load_bundle(mod.modPath, fs::is_directory(mod.modPath, ec)); + newMetadata = load_metadata(mod.modPath, *newBundle); + } catch (const std::exception& e) { + fail_mod(mod, MOD_ERROR, fmt::format("Reload failed: {}", e.what())); + return false; + } + + if (newMetadata.id != mod.metadata.id) { + fail_mod(mod, MOD_CONFLICT, + fmt::format("Mod ID changed on reload ('{}'); restart required", newMetadata.id)); + return false; + } + + mod.metadata = std::move(newMetadata); + // In-flight readers of the old bundle keep it alive through their shared_ptr. + mod.bundle = std::move(newBundle); + mod.loadFailed = false; + mod.failureReason.clear(); + + ModManifestInfo newInfo; + if (!load_native_if_present(mod)) { + return false; + } + if (mod.native) { + newInfo = build_manifest_info(mod.native->parsed); + } else { + ++mod.cacheGeneration; + } + + if (newInfo != mod.manifestInfo) { + // The reload changes the mod's imports/exports; rebuild the dependency graph so edges, + // init/tick/shutdown order and cascade sets reflect the new manifest. + log::write(mod.metadata.id, LOG_LEVEL_INFO, + "changed its service imports/exports; rebuilding mod dependency graph"); + mod.manifestInfo = std::move(newInfo); + loader::sort_mods(m_mods); + } + + return true; +} + +void ModLoader::apply_lifecycle_change(LoadedMod& target, const bool reload) { + auto affected = collect_lifecycle_set(target); + + // Dependents first (reverse init order), like shutdown. + for (auto* mod : affected | std::views::reverse) { + const bool needsTeardown = + mod->active || + (mod == &target && (mod->initialized || (reload && mod->native != nullptr))); + if (!needsTeardown) { + continue; + } + const bool wasActive = mod->active; + log::write(mod->metadata.id, LOG_LEVEL_INFO, "deactivating mod"); + deactivate_mod(*mod); + if (mod != &target && wasActive) { + // Provisional; cleared below if the mod comes straight back up. + mod->suspendedByProvider = true; + } + } + + if (reload) { + // On failure the target is failed and stays down; dependents get resume attempts below + // and suspend against the failed provider where required. + reload_bundle(target); + + // The reload may have rebuilt the dependency graph and reordered m_mods; refresh the + // set's iteration order so reactivation still runs providers first. + std::vector reordered; + reordered.reserve(affected.size()); + for (auto& mod : mods()) { + if (std::ranges::find(affected, &mod) != affected.end()) { + reordered.push_back(&mod); + } + } + affected = std::move(reordered); + } + + // Mirror startup: publish every candidate's static exports before any of them initialize, + // so importers within the set resolve providers regardless of initialization order + // (optional cycles rely on this). + for (auto* mod : affected) { + if (mod->active || mod->loadFailed || !mod->cvarIsEnabled->getValue()) { + continue; + } + if (!ensure_native_loaded(*mod)) { + continue; + } + if (mod->native && !mod->servicesRegistered) { + if (register_static_service_exports(*mod)) { + mod->servicesRegistered = true; + } else { + log::write(mod->metadata.id, LOG_LEVEL_ERROR, "failed to register service exports"); + deactivate_mod(*mod); + } + } + } + + // Providers first (init order). The target is naturally first among the affected mods. + for (auto* mod : affected) { + if (mod->active || mod->loadFailed || !mod->cvarIsEnabled->getValue()) { + continue; + } + if (!required_deps_active(*mod)) { + mod->suspendedByProvider = true; + log::write( + mod->metadata.id, LOG_LEVEL_INFO, "suspended: a required provider is disabled"); + continue; + } + mod->suspendedByProvider = false; + activate_mod(*mod); + } + + // Mods that stayed down must not leave their exports resolvable. + for (auto* mod : affected) { + if (!mod->active && mod->servicesRegistered) { + svc::remove_services_for_provider(*mod); + mod->servicesRegistered = false; + } + } +} + +void ModLoader::on_enabled_changed(LoadedMod& mod) { + svc::config_mark_dirty(); + if (mod.loadFailed) { + if (!mod.cvarIsEnabled->getValue()) { + mod.loadFailed = false; + mod.failureReason.clear(); + } + return; + } + if (mod.suspendedByProvider) { + if (!mod.cvarIsEnabled->getValue()) { + // The user disabled a suspended mod; stop waiting for its providers. + mod.suspendedByProvider = false; + } + return; + } + m_pendingRequests.push_back({mod.metadata.id, + mod.cvarIsEnabled->getValue() ? RequestKind::Enable : RequestKind::Disable}); +} + +void ModLoader::apply_pending_requests() { + // Images retired by the previous tick have had a full frame to unwind off the stack. + drain_retired_natives(); + + if (m_pendingRequests.empty()) { + return; + } + + // Coalesce per mod, last request wins. Failures during apply re-enqueue for next tick. + const auto requests = std::exchange(m_pendingRequests, {}); + std::vector coalesced; + for (const auto& request : requests) { + const auto existing = std::ranges::find_if( + coalesced, [&](const Request& r) { return r.modId == request.modId; }); + if (existing != coalesced.end()) { + existing->kind = request.kind; + } else { + coalesced.push_back(request); + } + } + + for (const auto& request : coalesced) { + auto* mod = find_mod(request.modId); + if (mod == nullptr) { + Log.warn("lifecycle request for unknown mod '{}'", request.modId); + continue; + } + if (request.kind == RequestKind::Reload && mod->inPlace) { + log::write(mod->metadata.id, LOG_LEVEL_WARN, "is a built-in mod and can't be reloaded"); + continue; + } + if (request.kind == RequestKind::Enable && mod->enabledApplied) { + continue; + } + if (request.kind == RequestKind::Disable && !mod->enabledApplied && !mod->active) { + continue; + } + apply_lifecycle_change(*mod, request.kind == RequestKind::Reload); + } + + svc::modules_lifecycle_applied(); + + auto active = std::ranges::count_if(mods(), [](const LoadedMod& m) { return m.active; }); + Log.info("{}/{} mod(s) active", active, m_mods.size()); +} + +void ModLoader::tick() { + svc::modules_frame_begin(); + apply_pending_requests(); + + for (auto& mod : mods()) { + if (!mod.active || !mod.native) { + continue; + } + try { + ModError error = MOD_ERROR_INIT; + const auto result = mod.native->fn_update(&error); + if (result != MOD_OK) { + fail_mod(mod, result, lifecycle_error_message("mod_update", result, error)); + } + } catch (const std::exception& e) { + fail_mod(mod, MOD_ERROR, fmt::format("Exception in mod_update: {}", e.what())); + } catch (...) { + fail_mod(mod, MOD_ERROR, "Unknown exception in mod_update"); + } + } + + svc::modules_frame_end(); + flush_toasts(); +} + +void ModLoader::shutdown() { + // Reverse initialization order, so importers shut down before their service providers. + for (auto& mod : mods() | std::views::reverse) { + deactivate_mod(mod); + if (mod.enabledSubscription != 0) { + config::unsubscribe(mod.enabledSubscription); + mod.enabledSubscription = 0; + } + unregister(*mod.cvarIsEnabled); + } + + m_mods.clear(); + drain_retired_natives(); + svc::modules_shutdown(); + Log.info("all mods unloaded"); +} + +} // namespace dusk::mods diff --git a/src/dusk/mods/loader/loader.hpp b/src/dusk/mods/loader/loader.hpp new file mode 100644 index 0000000000..6b9fd39232 --- /dev/null +++ b/src/dusk/mods/loader/loader.hpp @@ -0,0 +1,64 @@ +#pragma once + +#include +#include +#include +#include "miniz.h" + +#include "dusk/mod_loader.hpp" + +namespace dusk::mods { + +#if DUSK_CODE_MODS +constexpr bool EnableCodeMods = true; +#else +constexpr bool EnableCodeMods = false; +#endif + +// Implementations must be safe for concurrent calls; bundle reads are not limited to the +// game thread. +class ModBundle { +public: + virtual ~ModBundle() = default; + + virtual std::vector readFile(const std::string& fileName) = 0; + virtual std::vector getFileNames() = 0; + virtual size_t getFileSize(const std::string& fileName) = 0; +}; + +class ModBundleZip final : public ModBundle { +public: + explicit ModBundleZip(std::vector&& data); + ~ModBundleZip() override; + std::vector readFile(const std::string& fileName) override; + std::vector getFileNames() override; + size_t getFileSize(const std::string& fileName) override; + +private: + std::vector zip_data; + mz_zip_archive res_zip{}; + bool res_zip_open = false; + std::mutex m_mutex; +}; + +class ModBundleDisk final : public ModBundle { +public: + explicit ModBundleDisk(std::filesystem::path root); + ~ModBundleDisk() override = default; + std::vector readFile(const std::string& fileName) override; + std::vector getFileNames() override; + size_t getFileSize(const std::string& fileName) override; + +private: + [[nodiscard]] std::filesystem::path toRealPath(const std::string& fileName) const; + std::filesystem::path root_path; +}; + +LoadedMod* mod_from_context(ModContext* context); +const LoadedMod* mod_from_context(const ModContext* context); +const char* mod_id_from_context(ModContext* context); +void fail_mod(LoadedMod& mod, ModResult code, std::string_view message); +bool is_safe_resource_path(std::string_view path); +std::string escape_mod_id_for_config(std::string_view id); + +} // namespace dusk::mods diff --git a/src/dusk/mods/loader/native_module.cpp b/src/dusk/mods/loader/native_module.cpp new file mode 100644 index 0000000000..f6adf20c60 --- /dev/null +++ b/src/dusk/mods/loader/native_module.cpp @@ -0,0 +1,91 @@ +#include "native_module.hpp" + +#if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include +#endif + +#if defined(__SANITIZE_ADDRESS__) +#define ADDRESS_SANITIZER 1 +#elif defined(__has_feature) +#if __has_feature(address_sanitizer) +#define ADDRESS_SANITIZER 1 +#endif +#endif + +namespace { +#if defined(_WIN32) +void* pl_dlopen(const std::filesystem::path& p) { + return LoadLibraryExW(p.wstring().c_str(), nullptr, + LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); +} +void* pl_dlsym(void* h, const char* name) { + return reinterpret_cast(GetProcAddress(static_cast(h), name)); +} +void pl_dlclose(void* h) { + FreeLibrary(static_cast(h)); +} +std::string pl_dlerror() { + char buf[256]{}; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, + GetLastError(), 0, buf, sizeof(buf), nullptr); + std::string s = buf; + while (!s.empty() && (s.back() == '\r' || s.back() == '\n')) { + s.pop_back(); + } + return s; +} +#else +#include +void* pl_dlopen(const std::filesystem::path& p) { + int flags = RTLD_LAZY | RTLD_LOCAL; +#if defined(RTLD_DEEPBIND) && !defined(ADDRESS_SANITIZER) + flags |= RTLD_DEEPBIND; +#endif + return dlopen(p.c_str(), flags); +} +void* pl_dlsym(void* h, const char* name) { + return dlsym(h, name); +} +void pl_dlclose(void* h) { + dlclose(h); +} +std::string pl_dlerror() { + const char* e = dlerror(); + return e ? e : "(unknown error)"; +} +#endif +} // namespace + +namespace dusk::mods::loader { +NativeModule::NativeModule() noexcept : handle(nullptr) {} + +NativeModule::NativeModule(NativeModule&& other) noexcept { + handle = other.handle; + other.handle = nullptr; +} + +NativeModule& NativeModule::operator=(NativeModule&& other) noexcept { + handle = other.handle; + other.handle = nullptr; + return *this; +} + +NativeModule::NativeModule(const std::filesystem::path& path) { + handle = pl_dlopen(path); + if (!handle) { + throw std::runtime_error(pl_dlerror()); + } +} + +NativeModule::~NativeModule() { + if (handle) { + pl_dlclose(handle); + } +} + +void* NativeModule::LookupSymbol(const char* name) const { + return pl_dlsym(handle, name); +} +} // namespace dusk::mods::loader diff --git a/src/dusk/mods/loader/native_module.hpp b/src/dusk/mods/loader/native_module.hpp new file mode 100644 index 0000000000..2632496f96 --- /dev/null +++ b/src/dusk/mods/loader/native_module.hpp @@ -0,0 +1,33 @@ +#pragma once + +#include + +namespace dusk::mods::loader { +class NativeModule final { +public: + NativeModule() noexcept; + NativeModule(const NativeModule& other) = delete; + NativeModule(NativeModule&& other) noexcept; + explicit NativeModule(const std::filesystem::path& path); + ~NativeModule(); + + void* LookupSymbol(const char* name) const; + + template + T LookupSymbol(const char* name) const { + return reinterpret_cast(LookupSymbol(name)); + } + + NativeModule& operator=(NativeModule&& other) noexcept; + +#if defined(_WIN32) + static constexpr auto LibraryExtension = ".dll"; +#else + static constexpr auto LibraryExtension = ".so"; +#endif + +private: + void* handle; +}; + +} diff --git a/src/dusk/mods/log_buffer.cpp b/src/dusk/mods/log_buffer.cpp new file mode 100644 index 0000000000..bfee810767 --- /dev/null +++ b/src/dusk/mods/log_buffer.cpp @@ -0,0 +1,103 @@ +#include "log_buffer.hpp" + +#include +#include + +#include "dusk/logging.h" + +namespace dusk::mods::log { +namespace { + +struct BufferState { + std::mutex mutex; + std::vector ring; + size_t head = 0; + size_t count = 0; + uint64_t nextSeq = 0; + std::vector modIds; + + uint16_t intern(std::string_view modId) { + for (size_t i = 0; i < modIds.size(); ++i) { + if (modIds[i] == modId) { + return static_cast(i); + } + } + modIds.emplace_back(modId); + return static_cast(modIds.size() - 1); + } +}; +BufferState g_buffer; + +} // namespace + +void emit(Source source, const std::string& modId, LogLevel level, const std::string& message) { + const auto timeMs = std::chrono::duration_cast( + std::chrono::system_clock::now().time_since_epoch()) + .count(); + + { + std::lock_guard lock{g_buffer.mutex}; + if (g_buffer.ring.empty()) { + g_buffer.ring.resize(k_capacity); + } + auto& slot = g_buffer.ring[(g_buffer.head + g_buffer.count) % k_capacity]; + if (g_buffer.count == k_capacity) { + g_buffer.head = (g_buffer.head + 1) % k_capacity; + } else { + ++g_buffer.count; + } + slot.seq = g_buffer.nextSeq++; + slot.timeMs = timeMs; + slot.level = level; + slot.modIndex = g_buffer.intern(modId); + slot.source = source; + // assign() reuses the slot's capacity once the ring has wrapped + slot.message.assign(message); + } + + AuroraLogLevel auroraLevel = LOG_INFO; + switch (level) { + case LOG_LEVEL_TRACE: + case LOG_LEVEL_DEBUG: + auroraLevel = LOG_DEBUG; + break; + case LOG_LEVEL_INFO: + auroraLevel = LOG_INFO; + break; + case LOG_LEVEL_WARN: + auroraLevel = LOG_WARNING; + break; + case LOG_LEVEL_ERROR: + auroraLevel = LOG_ERROR; + break; + } + if (aurora::g_config.logLevel <= auroraLevel) { + aurora::log_internal(auroraLevel, modId.c_str(), message.c_str(), + static_cast(message.length())); + } +} + +Range copy_since(uint64_t sinceSeq, std::vector& out) { + std::lock_guard lock{g_buffer.mutex}; + const Range range{ + .firstSeq = g_buffer.nextSeq - g_buffer.count, + .nextSeq = g_buffer.nextSeq, + }; + for (uint64_t seq = std::max(sinceSeq, range.firstSeq); seq < range.nextSeq; ++seq) { + out.push_back(g_buffer.ring[(g_buffer.head + (seq - range.firstSeq)) % k_capacity]); + } + return range; +} + +std::vector ids() { + std::lock_guard lock{g_buffer.mutex}; + return g_buffer.modIds; +} + +void clear() { + std::lock_guard lock{g_buffer.mutex}; + g_buffer.head = 0; + g_buffer.count = 0; +} + +} // namespace dusk::mods::log diff --git a/src/dusk/mods/log_buffer.hpp b/src/dusk/mods/log_buffer.hpp new file mode 100644 index 0000000000..33a143705d --- /dev/null +++ b/src/dusk/mods/log_buffer.hpp @@ -0,0 +1,55 @@ +#pragma once + +#include +#include +#include +#include + +#include + +#include "mods/svc/log.h" + +namespace dusk::mods::log { + +constexpr size_t k_capacity = 2048; + +enum class Source : uint8_t { + Loader, + Mod, +}; + +struct Line { + uint64_t seq = 0; // monotonic, never reset (survives clear) + int64_t timeMs = 0; + LogLevel level = LOG_LEVEL_INFO; + uint16_t modIndex = 0; // index into ids() + Source source = Source::Loader; + std::string message; +}; + +struct Range { + uint64_t firstSeq = 0; // oldest retained entry + uint64_t nextSeq = 0; // one past the newest entry +}; + +// Appends to the mod log buffer and emits through aurora logging with the mod ID as the +// module tag. Console/file output honors the configured log level; the buffer captures +// every level. Thread-safe; mods may log from worker threads. +void emit(Source source, const std::string& modId, LogLevel level, const std::string& message); + +// Appends entries with seq >= sinceSeq to `out` and returns the retained range, +// so callers diffing by seq can detect both new entries and truncation. +Range copy_since(uint64_t sinceSeq, std::vector& out); + +// Append-only intern table of mod ids; indices are stable for the session. +std::vector ids(); + +void clear(); + +// Formatting helper for loader messages. +template +void write(const std::string& modId, LogLevel level, fmt::format_string format, T&&... args) { + emit(Source::Loader, modId, level, fmt::format(format, std::forward(args)...)); +} + +} // namespace dusk::mods::log diff --git a/src/dusk/mods/manifest.cpp b/src/dusk/mods/manifest.cpp new file mode 100644 index 0000000000..17097a518b --- /dev/null +++ b/src/dusk/mods/manifest.cpp @@ -0,0 +1,413 @@ +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#include "manifest.hpp" + +#include +#include +#include +#include +#include + +#include + +#include "aurora/lib/logging.hpp" + +#if defined(_WIN32) +#define WIN32_LEAN_AND_MEAN +#include +#elif defined(__APPLE__) +#include +#include +#elif defined(__linux__) +#include +#include +#endif + +namespace dusk::mods::manifest { +namespace { + +aurora::Module Log("dusk::mods::manifest"); + +constexpr char kMagic[8] = {'S', 'Y', 'M', 'G', 'E', 'N', '\0', '\0'}; +constexpr uint32_t kVersion = 2; + +enum class Compression : uint32_t { + None = 0, + Zstd = 1, +}; + +// Mirrors the symgen manifest writer. +struct Header { + char magic[8]; + uint32_t version; + uint32_t compression; + uint64_t uncompressedLen; + uint64_t compressedLen; + uint32_t buildIdLen; + uint8_t buildId[32]; + uint32_t entryCount; +}; +static_assert(sizeof(Header) == 72); + +struct Entry { + uint64_t hash; + uint64_t rva; + uint32_t nameOff; + HookSymbolFlags flags; +}; +static_assert(sizeof(Entry) == 24); + +/* + * `symgen manifest --embed` appends the symbol manifest to the linked executable as an added + * section and patches this descriptor with its location. + */ +struct SymdbDescriptor { + volatile uint64_t magic; + volatile uint64_t rva; + volatile uint64_t size; +}; +constexpr uint64_t kDescriptorMagic = 0x52444842444d5953ull; // "SYMDBHDR" +#if defined(_WIN32) +#pragma section(".symdbh", read) +__declspec(allocate(".symdbh")) +#if defined(__clang__) +__attribute__((used)) +#endif +constinit const SymdbDescriptor s_symdbDescriptor{kDescriptorMagic, 0, 0}; +#elif defined(__APPLE__) +__attribute__((section("__DATA,__symdbh"), used)) constinit const SymdbDescriptor + s_symdbDescriptor{kDescriptorMagic, 0, 0}; +#else +__attribute__((section("symdbh"), used)) constinit const SymdbDescriptor s_symdbDescriptor{ + kDescriptorMagic, 0, 0}; +#endif + +struct State { + std::vector data; + const Entry* entries = nullptr; + uint32_t entryCount = 0; + const char* strings = nullptr; + uint64_t stringsLen = 0; + uintptr_t imageBase = 0; + // (rva, nameOff) of entries flagged kFlagInlineSites, sorted by rva + std::vector > inlineSites; + bool loaded = false; + bool initialized = false; +}; +State s_state; + +uint64_t fnv1a64(const char* str) { + uint64_t hash = 0xcbf29ce484222325ull; + for (const char* p = str; *p != '\0'; ++p) { + hash ^= static_cast(*p); + hash *= 0x100000001b3ull; + } + return hash; +} + +// Build id of the running executable image, matching what symgen recorded: +// PDB GUID (RFC 4122 byte order) + age on Windows, LC_UUID on Mach-O, GNU +// build-id on ELF. Also reports the address RVAs are relative to. +bool running_image_identity(std::vector& outId, uintptr_t& outBase) { +#if defined(_WIN32) + auto* base = reinterpret_cast(GetModuleHandleW(nullptr)); + outBase = reinterpret_cast(base); + const auto* dos = reinterpret_cast(base); + const auto* nt = reinterpret_cast(base + dos->e_lfanew); + const auto& dir = nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG]; + if (dir.VirtualAddress == 0) { + return false; + } + const auto* entries = reinterpret_cast(base + dir.VirtualAddress); + for (size_t i = 0; i < dir.Size / sizeof(IMAGE_DEBUG_DIRECTORY); ++i) { + if (entries[i].Type != IMAGE_DEBUG_TYPE_CODEVIEW) { + continue; + } + struct CvInfo { + uint32_t signature; // 'RSDS' + uint8_t guid[16]; + uint32_t age; + }; + if (entries[i].SizeOfData < sizeof(CvInfo)) { + continue; + } + const auto* cv = reinterpret_cast(base + entries[i].AddressOfRawData); + if (cv->signature != 0x53445352) { // "RSDS" + continue; + } + // The GUID struct stores Data1..Data3 little-endian in memory; the manifest + // stores RFC 4122 (big-endian) order, so swap them here. + outId.assign(cv->guid, cv->guid + 16); + std::swap(outId[0], outId[3]); + std::swap(outId[1], outId[2]); + std::swap(outId[4], outId[5]); + std::swap(outId[6], outId[7]); + for (int b = 0; b < 4; ++b) { + outId.push_back(static_cast(cv->age >> (8 * b))); + } + return true; + } + return false; +#elif defined(__APPLE__) + // Image 0 is the main executable. The manifest stores link-time vmaddrs + // (nm convention, __TEXT vmaddr included). + const auto* header = _dyld_get_image_header(0); + outBase = static_cast(_dyld_get_image_vmaddr_slide(0)); + const auto* header64 = reinterpret_cast(header); + const auto* cmd = reinterpret_cast(header64 + 1); + for (uint32_t i = 0; i < header64->ncmds; ++i) { + if (cmd->cmd == LC_UUID) { + const auto* uuidCmd = reinterpret_cast(cmd); + outId.assign(uuidCmd->uuid, uuidCmd->uuid + 16); + return true; + } + cmd = reinterpret_cast( + reinterpret_cast(cmd) + cmd->cmdsize); + } + return false; +#elif defined(__linux__) + struct Ctx { + std::vector* id; + uintptr_t probe; + uintptr_t base = 0; + bool found = false; + } ctx{&outId, reinterpret_cast(&s_symdbDescriptor)}; + dl_iterate_phdr( + [](dl_phdr_info* info, size_t, void* data) -> int { + auto* ctx = static_cast(data); + // Select the image containing our descriptor: the game is not always the + // first entry (on Android it is libmain.so, behind the app process). + bool contains = false; + for (int i = 0; i < info->dlpi_phnum; ++i) { + const auto& phdr = info->dlpi_phdr[i]; + if (phdr.p_type == PT_LOAD && ctx->probe >= info->dlpi_addr + phdr.p_vaddr && + ctx->probe - (info->dlpi_addr + phdr.p_vaddr) < phdr.p_memsz) + { + contains = true; + break; + } + } + if (!contains) { + return 0; + } + ctx->base = info->dlpi_addr; + for (int i = 0; i < info->dlpi_phnum; ++i) { + const auto& phdr = info->dlpi_phdr[i]; + if (phdr.p_type != PT_NOTE) { + continue; + } + const auto* p = reinterpret_cast(info->dlpi_addr + phdr.p_vaddr); + const auto* end = p + phdr.p_memsz; + while (p + sizeof(ElfW(Nhdr)) <= end) { + const auto* note = reinterpret_cast(p); + const auto* name = p + sizeof(ElfW(Nhdr)); + const auto* desc = name + ((note->n_namesz + 3) & ~3u); + if (note->n_type == NT_GNU_BUILD_ID && note->n_namesz == 4 && + std::memcmp(name, "GNU", 4) == 0) + { + ctx->id->assign(desc, desc + note->n_descsz); + ctx->found = true; + return 1; + } + p = desc + ((note->n_descsz + 3) & ~3u); + } + } + return 1; // matched our image; stop either way + }, + &ctx); + outBase = ctx.base; + return ctx.found; +#else + (void)outId; + (void)outBase; + return false; +#endif +} + +std::string hex_string(const uint8_t* data, size_t len) { + std::string out; + out.reserve(len * 2); + for (size_t i = 0; i < len; ++i) { + constexpr char kHex[] = "0123456789abcdef"; + out.push_back(kHex[data[i] >> 4]); + out.push_back(kHex[data[i] & 0xF]); + } + return out; +} + +} // namespace + +void initialize() { + if (s_state.initialized) { + return; + } + s_state.initialized = true; + + if (s_symdbDescriptor.magic != kDescriptorMagic) { + Log.error("symbol manifest descriptor is corrupt"); + return; + } + if (s_symdbDescriptor.rva == 0) { + Log.info("no symbol manifest embedded; by-name resolution unavailable"); + return; + } + + std::vector imageId; + uintptr_t imageBase = 0; + if (!running_image_identity(imageId, imageBase)) { + Log.error("cannot determine the running image's build id; ignoring symbol manifest"); + return; + } + + const auto* blob = reinterpret_cast(imageBase + s_symdbDescriptor.rva); + const auto blobLen = static_cast(s_symdbDescriptor.size); + if (blobLen < sizeof(Header)) { + Log.error("embedded symbol manifest is truncated ({} bytes)", blobLen); + return; + } + + Header header{}; + std::memcpy(&header, blob, sizeof(header)); + if (std::memcmp(header.magic, kMagic, sizeof(kMagic)) != 0 || header.version != kVersion) { + Log.error("embedded symbol manifest has wrong magic/version"); + return; + } + const auto compression = static_cast(header.compression); + if ((compression != Compression::None && compression != Compression::Zstd) || + header.buildIdLen > sizeof(header.buildId) || + header.compressedLen > blobLen - sizeof(Header) || + header.uncompressedLen > std::numeric_limits::max() || + (compression == Compression::None && header.compressedLen != header.uncompressedLen)) + { + Log.error("embedded symbol manifest is malformed"); + return; + } + + // The manifest travels inside the image it describes, so a mismatch here means broken + // build tooling rather than a stale file — but it still guards resolved addresses. + if (imageId.size() != header.buildIdLen || + std::memcmp(imageId.data(), header.buildId, imageId.size()) != 0) + { + Log.error("embedded symbol manifest is stale: built for {}, running image is {}", + hex_string(header.buildId, header.buildIdLen), + hex_string(imageId.data(), imageId.size())); + return; + } + + const auto compressedLen = static_cast(header.compressedLen); + const auto uncompressedLen = static_cast(header.uncompressedLen); + std::vector data; + const auto* storedPayload = blob + sizeof(Header); + if (compression == Compression::None) { + data.assign(storedPayload, storedPayload + compressedLen); + } else { + data.resize(uncompressedLen); + const size_t decompressedLen = + ZSTD_decompress(data.data(), data.size(), storedPayload, compressedLen); + if (ZSTD_isError(decompressedLen)) { + Log.error("failed to decompress embedded symbol manifest: {}", + ZSTD_getErrorName(decompressedLen)); + return; + } + if (decompressedLen != data.size()) { + Log.error("embedded symbol manifest decompressed to {} bytes, expected {}", + decompressedLen, data.size()); + return; + } + } + + const uint64_t entriesEnd = uint64_t{header.entryCount} * sizeof(Entry); + if (entriesEnd > data.size()) { + Log.error("decompressed embedded symbol manifest is malformed"); + return; + } + + s_state.data = std::move(data); + s_state.entries = reinterpret_cast(s_state.data.data()); + s_state.entryCount = header.entryCount; + s_state.strings = reinterpret_cast(s_state.data.data() + entriesEnd); + s_state.stringsLen = s_state.data.size() - entriesEnd; + s_state.imageBase = imageBase; + for (uint32_t i = 0; i < s_state.entryCount; ++i) { + const Entry& entry = s_state.entries[i]; + if ((entry.flags & kFlagInlineSites) != 0 && entry.nameOff < s_state.stringsLen) { + s_state.inlineSites.emplace_back(entry.rva, entry.nameOff); + } + } + std::sort(s_state.inlineSites.begin(), s_state.inlineSites.end()); + s_state.inlineSites.erase(std::unique(s_state.inlineSites.begin(), s_state.inlineSites.end(), + [](const auto& a, const auto& b) { return a.first == b.first; }), + s_state.inlineSites.end()); + s_state.loaded = true; + Log.info("symbol manifest loaded: {} symbols, build id {}", s_state.entryCount, + hex_string(header.buildId, header.buildIdLen)); +} + +bool available() { + return s_state.loaded; +} + +const std::vector& image_build_id() { + static const std::vector s_id = [] { + std::vector id; + uintptr_t base = 0; + running_image_identity(id, base); + return id; + }(); + return s_id; +} + +ResolveStatus resolve(const char* name, void** outAddr, HookSymbolFlags* outFlags) { + if (!s_state.loaded) { + return ResolveStatus::Unavailable; + } + const uint64_t hash = fnv1a64(name); + const Entry* begin = s_state.entries; + const Entry* end = begin + s_state.entryCount; + size_t lo = 0; + size_t hi = s_state.entryCount; + while (lo < hi) { + const size_t mid = lo + (hi - lo) / 2; + if (begin[mid].hash < hash) { + lo = mid + 1; + } else { + hi = mid; + } + } + for (const Entry* entry = begin + lo; entry != end && entry->hash == hash; ++entry) { + if (entry->nameOff >= s_state.stringsLen || + std::strcmp(s_state.strings + entry->nameOff, name) != 0) + { + continue; + } + if ((entry->flags & kFlagDupName) != 0) { + return ResolveStatus::Ambiguous; + } + *outAddr = reinterpret_cast(s_state.imageBase + entry->rva); + if (outFlags != nullptr) { + *outFlags = entry->flags; + } + return ResolveStatus::Ok; + } + return ResolveStatus::NotFound; +} + +bool has_inline_sites(const void* addr, const char** outName) { + if (!s_state.loaded || s_state.inlineSites.empty()) { + return false; + } + const auto rva = static_cast(reinterpret_cast(addr) - s_state.imageBase); + const auto it = std::lower_bound(s_state.inlineSites.begin(), s_state.inlineSites.end(), + std::pair{rva, 0}); + if (it == s_state.inlineSites.end() || it->first != rva) { + return false; + } + if (outName != nullptr) { + *outName = s_state.strings + it->second; + } + return true; +} + +} // namespace dusk::mods::manifest diff --git a/src/dusk/mods/manifest.hpp b/src/dusk/mods/manifest.hpp new file mode 100644 index 0000000000..c6bc03f038 --- /dev/null +++ b/src/dusk/mods/manifest.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include +#include + +#include "mods/svc/hook.h" + +namespace dusk::mods::manifest { + +// Symbol flags mirrored from symgen. +constexpr uint32_t kFlagCode = 1u << 0; +constexpr uint32_t kFlagData = 1u << 1; +constexpr uint32_t kFlagLocal = 1u << 2; +constexpr uint32_t kFlagMultiName = 1u << 3; +constexpr uint32_t kFlagDupName = 1u << 4; +constexpr uint32_t kFlagInlineSites = 1u << 5; +constexpr uint32_t kFlagDisplay = 1u << 6; + +enum class ResolveStatus { + Ok, + Unavailable, // no manifest loaded (missing, stale, or malformed) + NotFound, + Ambiguous, // name maps to multiple addresses (overloads / per-TU statics) +}; + +// Maps the symbol manifest next to the game binary and validates it against the +// running image's build id (PDB GUID+age / Mach-O UUID / GNU build-id). A missing or +// stale manifest logs and leaves by-name resolution unavailable; hooks by address are +// unaffected. Safe to call more than once. +void initialize(); + +bool available(); + +// Build id of the running executable image (PDB GUID+age / Mach-O UUID / GNU +// build-id), computed once on first use; empty if it couldn't be determined. +// Independent of whether a manifest file was loaded. +const std::vector& image_build_id(); + +// Resolve a symbol name to its address in the running image. Names can be either the platform's +// mangled name (i.e. the name passed to dlopen; no Mach-O leading underscore) or the function name +// without parameters (e.g. "daAlink_c::execute"). +ResolveStatus resolve(const char* name, void** outAddr, HookSymbolFlags* outFlags = nullptr); + +// True if the manifest records that the function at this code address was inlined into +// at least one caller in this build. An entry hook on it only intercepts the calls +// that were not inlined. outName receives the symbol name (valid for the process lifetime) +// when known. False when no manifest is loaded. +bool has_inline_sites(const void* addr, const char** outName = nullptr); + +} // namespace dusk::mods::manifest diff --git a/src/dusk/mods/svc/camera.cpp b/src/dusk/mods/svc/camera.cpp new file mode 100644 index 0000000000..37057e2397 --- /dev/null +++ b/src/dusk/mods/svc/camera.cpp @@ -0,0 +1,134 @@ +#include "registry.hpp" + +#include "dusk/mods/loader/loader.hpp" +#include "mods/svc/camera.h" + +#include "f_op/f_op_view.h" +#include "m_Do/m_Do_mtx.h" + +#include +#include + +namespace dusk::mods::svc { +namespace { + +void to_column_major(const Mtx44 in, float out[16]) { + for (int c = 0; c < 4; ++c) { + for (int r = 0; r < 4; ++r) { + out[c * 4 + r] = in[r][c]; + } + } +} + +void store_affine(const Mtx in, float out[16]) { + for (int c = 0; c < 4; ++c) { + for (int r = 0; r < 3; ++r) { + out[c * 4 + r] = in[r][c]; + } + out[c * 4 + 3] = 0.0f; + } + out[15] = 1.0f; +} + +/* affine * 4x4; operand-order mirror of cMtx_concatProjView */ +void concat_affine_proj(const Mtx a, const Mtx44 b, Mtx44 out) { + for (int r = 0; r < 3; ++r) { + for (int c = 0; c < 4; ++c) { + out[r][c] = + a[r][0] * b[0][c] + a[r][1] * b[1][c] + a[r][2] * b[2][c] + a[r][3] * b[3][c]; + } + } + std::memcpy(out[3], b[3], sizeof(f32) * 4); +} + +ModResult snapshot_view(const view_class* view, CameraInfo* outInfo) { + if (view == nullptr || !(view->near_ > 0.0f) || !(view->far_ > view->near_) || + !(view->fovy > 0.0f) || view->fovy >= 180.0f || !(view->aspect > 0.0f)) + { + return MOD_UNAVAILABLE; + } + + // Build from the GXSetProjection values + const f32 p00 = view->projMtx[0][0]; + const f32 p02 = view->projMtx[0][2]; + const f32 p11 = view->projMtx[1][1]; + const f32 p12 = view->projMtx[1][2]; + const f32 p22 = view->projMtx[2][2]; + const f32 p23 = view->projMtx[2][3]; + if (view->projMtx[3][2] != -1.0f || p00 == 0.0f || p11 == 0.0f || p23 == 0.0f) { + return MOD_UNAVAILABLE; + } + + // WebGPU-convention projection + Aurora reversed Z + const bool reversedZ = aurora::gfx::uses_reversed_z(); + const f32 e = reversedZ ? -p22 : p22 - 1.0f; + const f32 f = reversedZ ? -p23 : p23; + Mtx44 proj{}; + proj[0][0] = p00; + proj[0][2] = p02; + proj[1][1] = p11; + proj[1][2] = p12; + proj[2][2] = e; + proj[2][3] = f; + proj[3][2] = -1.0f; + + // Analytic inverse of the sparse perspective form + Mtx44 invProj{}; + invProj[0][0] = 1.0f / p00; + invProj[0][3] = p02 / p00; + invProj[1][1] = 1.0f / p11; + invProj[1][3] = p12 / p11; + invProj[2][3] = -1.0f; + invProj[3][2] = 1.0f / f; + invProj[3][3] = e / f; + + Mtx44 projWorld; + cMtx_concatProjView(proj, view->viewMtx, projWorld); + Mtx44 worldProj; + concat_affine_proj(view->invViewMtx, invProj, worldProj); + + store_affine(view->viewMtx, outInfo->view_from_world); + store_affine(view->invViewMtx, outInfo->world_from_view); + to_column_major(proj, outInfo->proj_from_view); + to_column_major(invProj, outInfo->view_from_proj); + to_column_major(projWorld, outInfo->proj_from_world); + to_column_major(worldProj, outInfo->world_from_proj); + + outInfo->eye[0] = view->lookat.eye.x; + outInfo->eye[1] = view->lookat.eye.y; + outInfo->eye[2] = view->lookat.eye.z; + outInfo->fovy = view->fovy; + outInfo->aspect = view->aspect; + outInfo->near_plane = view->near_; + outInfo->far_plane = view->far_; + return MOD_OK; +} + +ModResult camera_get_camera_from_view( + ModContext* context, const void* gameView, CameraInfo* outInfo) { + if (outInfo == nullptr || outInfo->struct_size < sizeof(CameraInfo) || + mod_from_context(context) == nullptr || gameView == nullptr) + { + return MOD_INVALID_ARGUMENT; + } + const uint32_t structSize = outInfo->struct_size; + std::memset(outInfo, 0, sizeof(CameraInfo)); + outInfo->struct_size = structSize; + return snapshot_view(static_cast(gameView), outInfo); +} + +constexpr CameraService s_cameraService{ + .header = SERVICE_HEADER(CameraService, CAMERA_SERVICE_MAJOR, CAMERA_SERVICE_MINOR), + .get_camera = camera_get_camera_from_view, +}; + +} // namespace + +constinit const ServiceModule g_cameraModule{ + .id = CAMERA_SERVICE_ID, + .majorVersion = CAMERA_SERVICE_MAJOR, + .minorVersion = CAMERA_SERVICE_MINOR, + .service = &s_cameraService, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/config.cpp b/src/dusk/mods/svc/config.cpp new file mode 100644 index 0000000000..bf943d61b8 --- /dev/null +++ b/src/dusk/mods/svc/config.cpp @@ -0,0 +1,434 @@ +#include "config.hpp" + +#include "registry.hpp" +#include "slot_map.hpp" + +#include "aurora/lib/logging.hpp" +#include "dusk/config.hpp" +#include "dusk/mods/loader/loader.hpp" +#include "mods/svc/config.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace dusk::mods::svc { +namespace { + +aurora::Module Log("dusk::mods::config"); + +enum class ConfigSlotKind : uint8_t { + Var, + Subscription, +}; + +struct ConfigSlot { + ConfigSlotKind kind = ConfigSlotKind::Var; + // Var payload + ConfigVarType type = CONFIG_VAR_BOOL; + std::unique_ptr var; + // Subscription payload + uint64_t varHandle = 0; + config::Subscription coreSubscription = 0; +}; + +SlotMap s_slots; +bool s_dirty = false; +std::chrono::steady_clock::time_point s_lastSave{}; +constexpr std::chrono::seconds kSaveDebounce{2}; + +void config_flush_if_dirty(const bool force) { + if (!s_dirty) { + return; + } + const auto now = std::chrono::steady_clock::now(); + if (!force && now - s_lastSave < kSaveDebounce) { + return; + } + s_dirty = false; + s_lastSave = now; + config::save(); +} + +// Translate the type-erased previous-value pointer into the C ABI snapshot struct. The string +// pointer aliases the previous std::string, which outlives the notification. +ConfigVarValue translate_previous(const uint32_t type, const void* previous) { + ConfigVarValue value{}; + value.struct_size = sizeof(ConfigVarValue); + value.type = static_cast(type); + switch (type) { + case CONFIG_VAR_BOOL: + value.bool_value = *static_cast(previous); + break; + case CONFIG_VAR_INT: + value.int_value = *static_cast(previous); + break; + case CONFIG_VAR_FLOAT: + value.float_value = *static_cast(previous); + break; + case CONFIG_VAR_STRING: { + const auto* str = static_cast(previous); + value.string_value = str->c_str(); + value.string_length = str->size(); + break; + } + default: + break; + } + return value; +} + +// Snapshot the var's current (new) value for the notification. Strings are copied into +// stringStorage so the snapshot stays valid even if the callback writes the var again. +ConfigVarValue translate_current( + const uint32_t type, config::ConfigVarBase& varBase, std::string& stringStorage) { + ConfigVarValue value{}; + value.struct_size = sizeof(ConfigVarValue); + value.type = static_cast(type); + switch (type) { + case CONFIG_VAR_BOOL: + value.bool_value = static_cast&>(varBase).getValue(); + break; + case CONFIG_VAR_INT: + value.int_value = static_cast&>(varBase).getValue(); + break; + case CONFIG_VAR_FLOAT: + value.float_value = static_cast&>(varBase).getValue(); + break; + case CONFIG_VAR_STRING: + stringStorage = static_cast&>(varBase).getValue(); + value.string_value = stringStorage.c_str(); + value.string_length = stringStorage.size(); + break; + default: + break; + } + return value; +} + +bool valid_var_fragment(const char* name) { + if (name == nullptr) { + return false; + } + const std::string_view fragment{name}; + if (fragment.empty() || fragment.size() > 64) { + return false; + } + return std::ranges::all_of(fragment, [](char ch) { + return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || + ch == '_' || ch == '-'; + }); +} + +config::ConfigVarBase* find_var(LoadedMod& mod, const uint64_t handle, uint32_t expectedType) { + const auto* entry = s_slots.find_owned(handle, mod); + if (entry == nullptr || entry->value.kind != ConfigSlotKind::Var || + entry->value.type != expectedType) + { + return nullptr; + } + return entry->value.var.get(); +} + +template +ConfigVar* find_typed_var(ModContext* context, ConfigVarHandle handle, uint32_t type) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return nullptr; + } + // The type tag was checked, so the downcast is safe. + return static_cast*>(find_var(*mod, handle, type)); +} + +void config_remove_mod(LoadedMod& mod) { + const auto entries = s_slots.take_all(mod); + for (const auto& entry : entries) { + if (entry.value.kind == ConfigSlotKind::Subscription) { + config::unsubscribe(entry.value.coreSubscription); + } + } + for (const auto& entry : entries) { + if (entry.value.kind == ConfigSlotKind::Var) { + config::unregister(*entry.value.var); + } + } +} + +ModResult config_register_var( + ModContext* context, const ConfigVarDesc* desc, ConfigVarHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(ConfigVarDesc) || + !valid_var_fragment(desc->name)) + { + return MOD_INVALID_ARGUMENT; + } + + const auto fullName = + fmt::format("mod.{}.{}", escape_mod_id_for_config(mod->metadata.id), desc->name); + if (config::GetConfigVar(fullName) != nullptr) { + Log.error("[{}] config var '{}' conflicts with an existing config key", mod->metadata.id, + fullName); + return MOD_CONFLICT; + } + + std::unique_ptr var; + switch (desc->type) { + case CONFIG_VAR_BOOL: + var = std::make_unique>(fullName, desc->default_bool); + break; + case CONFIG_VAR_INT: + var = std::make_unique>(fullName, desc->default_int); + break; + case CONFIG_VAR_FLOAT: + var = std::make_unique>(fullName, desc->default_float); + break; + case CONFIG_VAR_STRING: + var = std::make_unique>( + fullName, desc->default_string != nullptr ? desc->default_string : ""); + break; + default: + return MOD_INVALID_ARGUMENT; + } + + // Back-fills a stashed/saved value (or a --cvar override) if one exists for this key. + // Loads apply silently: the registering mod cannot have subscribed to this var yet, and it + // reads the value right after registration anyway. + config::Register(*var); + + const auto handle = s_slots.emplace( + *mod, ConfigSlot{.kind = ConfigSlotKind::Var, .type = desc->type, .var = std::move(var)}); + if (outHandle != nullptr) { + *outHandle = handle; + } + return MOD_OK; +} + +ModResult config_unregister_var(ModContext* context, ConfigVarHandle var) { + auto* mod = mod_from_context(context); + if (mod == nullptr || var == 0) { + return MOD_INVALID_ARGUMENT; + } + const auto* entry = s_slots.find_owned(var, *mod); + if (entry == nullptr || entry->value.kind != ConfigSlotKind::Var) { + Log.error("[{}] config unregister failed: unknown handle {}", mod->metadata.id, var); + return MOD_INVALID_ARGUMENT; + } + + // Only the owning mod can (currently) subscribe to a var + std::vector bound; + s_slots.for_each([&](const uint64_t handle, const auto& e) { + if (e.value.kind == ConfigSlotKind::Subscription && e.value.varHandle == var) { + bound.push_back(handle); + } + }); + for (const auto handle : bound) { + config::unsubscribe(s_slots.take(handle)->value.coreSubscription); + } + + // The persisted value is stashed and restored by a future registration of the same name. + config::unregister(*s_slots.take(var)->value.var); + return MOD_OK; +} + +ModResult config_get_bool(ModContext* context, ConfigVarHandle var, bool* outValue) { + if (outValue != nullptr) { + *outValue = false; + } + auto* cvar = find_typed_var(context, var, CONFIG_VAR_BOOL); + if (cvar == nullptr || outValue == nullptr) { + return MOD_INVALID_ARGUMENT; + } + *outValue = cvar->getValue(); + return MOD_OK; +} + +ModResult config_set_bool(ModContext* context, ConfigVarHandle var, bool value) { + auto* cvar = find_typed_var(context, var, CONFIG_VAR_BOOL); + if (cvar == nullptr) { + return MOD_INVALID_ARGUMENT; + } + cvar->setValue(value); + config_mark_dirty(); + return MOD_OK; +} + +ModResult config_get_int(ModContext* context, ConfigVarHandle var, int64_t* outValue) { + if (outValue != nullptr) { + *outValue = 0; + } + auto* cvar = find_typed_var(context, var, CONFIG_VAR_INT); + if (cvar == nullptr || outValue == nullptr) { + return MOD_INVALID_ARGUMENT; + } + *outValue = cvar->getValue(); + return MOD_OK; +} + +ModResult config_set_int(ModContext* context, ConfigVarHandle var, int64_t value) { + auto* cvar = find_typed_var(context, var, CONFIG_VAR_INT); + if (cvar == nullptr) { + return MOD_INVALID_ARGUMENT; + } + cvar->setValue(value); + config_mark_dirty(); + return MOD_OK; +} + +ModResult config_get_float(ModContext* context, ConfigVarHandle var, double* outValue) { + if (outValue != nullptr) { + *outValue = 0.0; + } + auto* cvar = find_typed_var(context, var, CONFIG_VAR_FLOAT); + if (cvar == nullptr || outValue == nullptr) { + return MOD_INVALID_ARGUMENT; + } + *outValue = cvar->getValue(); + return MOD_OK; +} + +ModResult config_set_float(ModContext* context, ConfigVarHandle var, double value) { + auto* cvar = find_typed_var(context, var, CONFIG_VAR_FLOAT); + if (cvar == nullptr) { + return MOD_INVALID_ARGUMENT; + } + cvar->setValue(value); + config_mark_dirty(); + return MOD_OK; +} + +ModResult config_get_string( + ModContext* context, ConfigVarHandle var, char* buffer, size_t bufferSize, size_t* outLength) { + if (outLength != nullptr) { + *outLength = 0; + } + auto* cvar = find_typed_var(context, var, CONFIG_VAR_STRING); + if (cvar == nullptr) { + return MOD_INVALID_ARGUMENT; + } + const auto& value = cvar->getValue(); + if (outLength != nullptr) { + *outLength = value.size(); + } + if (buffer == nullptr) { + // Length query; any other use of a null buffer is a caller bug. + return bufferSize == 0 ? MOD_OK : MOD_INVALID_ARGUMENT; + } + if (bufferSize < value.size() + 1) { + return MOD_INVALID_ARGUMENT; + } + std::memcpy(buffer, value.c_str(), value.size() + 1); + return MOD_OK; +} + +ModResult config_set_string(ModContext* context, ConfigVarHandle var, const char* value) { + auto* cvar = find_typed_var(context, var, CONFIG_VAR_STRING); + if (cvar == nullptr || value == nullptr) { + return MOD_INVALID_ARGUMENT; + } + cvar->setValue(std::string{value}); + config_mark_dirty(); + return MOD_OK; +} + +ModResult config_subscribe(ModContext* context, ConfigVarHandle var, ConfigChangedFn callback, + void* userData, ConfigSubscriptionHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || var == 0 || callback == nullptr) { + return MOD_INVALID_ARGUMENT; + } + const auto* entry = s_slots.find_owned(var, *mod); + if (entry == nullptr || entry->value.kind != ConfigSlotKind::Var) { + return MOD_INVALID_ARGUMENT; + } + + const auto coreSubscription = config::subscribe(entry->value.var->getName(), + [modPtr = mod, callback, userData, varHandle = var, type = entry->value.type]( + config::ConfigVarBase& varBase, const void* previous) { + const ConfigVarValue previousValue = translate_previous(type, previous); + std::string stringStorage; + const ConfigVarValue currentValue = translate_current(type, varBase, stringStorage); + try { + callback(modPtr->context.get(), varHandle, ¤tValue, &previousValue, userData); + } catch (const std::exception& e) { + fail_mod(*modPtr, MOD_ERROR, + fmt::format("Exception in config change callback: {}", e.what())); + } catch (...) { + fail_mod(*modPtr, MOD_ERROR, "Unknown exception in config change callback"); + } + }); + const auto handle = s_slots.emplace(*mod, ConfigSlot{ + .kind = ConfigSlotKind::Subscription, + .varHandle = var, + .coreSubscription = coreSubscription, + }); + if (outHandle != nullptr) { + *outHandle = handle; + } + return MOD_OK; +} + +ModResult config_unsubscribe(ModContext* context, ConfigSubscriptionHandle handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return MOD_INVALID_ARGUMENT; + } + const auto* entry = s_slots.find_owned(handle, *mod); + if (entry == nullptr || entry->value.kind != ConfigSlotKind::Subscription) { + Log.error("[{}] config unsubscribe failed: unknown handle {}", mod->metadata.id, handle); + return MOD_INVALID_ARGUMENT; + } + config::unsubscribe(entry->value.coreSubscription); + s_slots.erase(handle); + return MOD_OK; +} + +constexpr ConfigService s_configService{ + .header = SERVICE_HEADER(ConfigService, CONFIG_SERVICE_MAJOR, CONFIG_SERVICE_MINOR), + .register_var = config_register_var, + .unregister_var = config_unregister_var, + .get_bool = config_get_bool, + .set_bool = config_set_bool, + .get_int = config_get_int, + .set_int = config_set_int, + .get_float = config_get_float, + .set_float = config_set_float, + .get_string = config_get_string, + .set_string = config_set_string, + .subscribe = config_subscribe, + .unsubscribe = config_unsubscribe, +}; + +} // namespace + +void config_mark_dirty() { + s_dirty = true; +} + +config::ConfigVarBase* config_find_var( + LoadedMod& mod, const ConfigVarHandle handle, const uint32_t expectedType) { + return find_var(mod, handle, expectedType); +} + +constinit const ServiceModule g_configModule{ + .id = CONFIG_SERVICE_ID, + .majorVersion = CONFIG_SERVICE_MAJOR, + .minorVersion = CONFIG_SERVICE_MINOR, + .service = &s_configService, + .modDetached = config_remove_mod, + .frameEnd = [] { config_flush_if_dirty(false); }, + .shutdown = [] { config_flush_if_dirty(true); }, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/config.hpp b/src/dusk/mods/svc/config.hpp new file mode 100644 index 0000000000..b095c05ec6 --- /dev/null +++ b/src/dusk/mods/svc/config.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include "dusk/config.hpp" +#include "mods/svc/config.h" + +namespace dusk::mods { +struct LoadedMod; +} // namespace dusk::mods + +namespace dusk::mods::svc { + +// Returns a config var owned by `mod` when the handle exists and its type matches. +config::ConfigVarBase* config_find_var( + LoadedMod& mod, ConfigVarHandle handle, uint32_t expectedType); + +// Marks the mods' config keys dirty for the config service's debounced save. The loader +// calls this for the enabled cvars it owns. +void config_mark_dirty(); + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/game.cpp b/src/dusk/mods/svc/game.cpp new file mode 100644 index 0000000000..f0bb8639a3 --- /dev/null +++ b/src/dusk/mods/svc/game.cpp @@ -0,0 +1,21 @@ +#include "registry.hpp" + +#include "mods/svc/game.h" + +namespace dusk::mods::svc { +namespace { + +constexpr GameService s_gameService{ + .header = SERVICE_HEADER(GameService, GAME_SERVICE_MAJOR, GAME_SERVICE_MINOR), +}; + +} // namespace + +constinit const ServiceModule g_gameModule{ + .id = GAME_SERVICE_ID, + .majorVersion = GAME_SERVICE_MAJOR, + .minorVersion = GAME_SERVICE_MINOR, + .service = &s_gameService, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/gfx.cpp b/src/dusk/mods/svc/gfx.cpp new file mode 100644 index 0000000000..e14b587f5e --- /dev/null +++ b/src/dusk/mods/svc/gfx.cpp @@ -0,0 +1,798 @@ +#include "registry.hpp" +#include "slot_map.hpp" + +#include "aurora/lib/logging.hpp" +#include "dusk/gfx.hpp" +#include "dusk/mods/loader/loader.hpp" +#include "mods/svc/gfx.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace dusk::mods { +namespace { + +aurora::Module Log("dusk::mods::gfx"); + +enum class GfxSlotKind : uint8_t { + DrawType, + StageHook, + ComputeType, +}; + +enum class GfxStreamBuffer : uint8_t { + Verts, + Indices, + Uniform, + Storage, +}; + +struct GfxSlot { + GfxSlotKind kind = GfxSlotKind::DrawType; + ModContext* ownerContext = nullptr; + std::string ownerId; + void* userData = nullptr; + + GfxDrawFn drawFn = nullptr; + aurora::gfx::DrawTypeId auroraDrawId = aurora::gfx::InvalidDrawType; + + GfxStageFn stageFn = nullptr; + GfxStage stage = GFX_STAGE_SCENE_AFTER_TERRAIN; + + GfxComputeFn computeFn = nullptr; + aurora::gfx::EncoderTaskId auroraTaskId = aurora::gfx::InvalidEncoderTask; +}; + +struct WorkerFailure { + std::string modId; + std::string message; + std::vector drawIds; + std::vector taskIds; +}; + +std::mutex s_mutex; +using GfxSlotMap = svc::SlotMap; +GfxSlotMap s_slots; +std::vector s_workerFailures; +bool s_modOffscreenOpen = false; + +GfxSlotMap::Entry* resolve_entry_locked(uint64_t handle, GfxSlotKind kind) { + auto* entry = s_slots.find(handle); + if (entry == nullptr || entry->value.kind != kind) { + return nullptr; + } + return entry; +} + +GfxSlot* resolve_slot_locked(uint64_t handle, GfxSlotKind kind) { + auto* entry = resolve_entry_locked(handle, kind); + return entry != nullptr ? &entry->value : nullptr; +} + +GfxSlot* resolve_owned_slot_locked(LoadedMod& mod, uint64_t handle, GfxSlotKind kind) { + auto* entry = s_slots.find_owned(handle, mod); + if (entry == nullptr || entry->value.kind != kind) { + return nullptr; + } + return &entry->value; +} + +void collect_mod_slots_locked(LoadedMod& owner, std::vector& drawIds, + std::vector& taskIds) { + auto entries = s_slots.take_all(owner); + for (auto& entry : entries) { + const auto& slot = entry.value; + if (slot.kind == GfxSlotKind::DrawType && slot.auroraDrawId != aurora::gfx::InvalidDrawType) + { + drawIds.push_back(slot.auroraDrawId); + } else if (slot.kind == GfxSlotKind::ComputeType && + slot.auroraTaskId != aurora::gfx::InvalidEncoderTask) + { + taskIds.push_back(slot.auroraTaskId); + } + } +} + +void unregister_aurora_types(const std::vector& drawIds, + const std::vector& taskIds) { + for (const auto id : drawIds) { + aurora::gfx::unregister_draw_type(id); + } + for (const auto id : taskIds) { + aurora::gfx::unregister_encoder_task_type(id); + } +} + +void draw_trampoline(const aurora::gfx::DrawContext& ctx, const wgpu::RenderPassEncoder& pass, + const void* payload, size_t payloadSize, void* userdata) { + const auto handle = static_cast(reinterpret_cast(userdata)); + GfxDrawFn fn = nullptr; + void* userData = nullptr; + ModContext* modContext = nullptr; + LoadedMod* owner = nullptr; + std::string ownerId; + { + std::lock_guard lock{s_mutex}; + auto* entry = resolve_entry_locked(handle, GfxSlotKind::DrawType); + if (entry == nullptr) { + return; + } + const auto& slot = entry->value; + fn = slot.drawFn; + userData = slot.userData; + modContext = slot.ownerContext; + owner = entry->owner; + ownerId = slot.ownerId; + } + + GfxDrawContext drawContext{ + .struct_size = sizeof(GfxDrawContext), + .device = ctx.device.Get(), + .queue = ctx.queue.Get(), + .pass = pass.Get(), + .vertex_buffer = ctx.vertexBuffer.Get(), + .index_buffer = ctx.indexBuffer.Get(), + .uniform_buffer = ctx.uniformBuffer.Get(), + .storage_buffer = ctx.storageBuffer.Get(), + .color_format = static_cast(ctx.colorFormat), + .depth_format = static_cast(ctx.depthFormat), + .sample_count = ctx.sampleCount, + .target_width = ctx.targetWidth, + .target_height = ctx.targetHeight, + .uses_reversed_z = aurora::gfx::uses_reversed_z(), + }; + + std::string failure; + try { + fn(modContext, &drawContext, payload, payloadSize, userData); + return; + } catch (const std::exception& e) { + failure = fmt::format("exception in gfx draw callback: {}", e.what()); + } catch (...) { + failure = "unknown exception in gfx draw callback"; + } + + std::lock_guard lock{s_mutex}; + WorkerFailure record{ + .modId = std::move(ownerId), + .message = std::move(failure), + }; + collect_mod_slots_locked(*owner, record.drawIds, record.taskIds); + s_workerFailures.push_back(std::move(record)); +} + +void compute_trampoline(const aurora::gfx::EncoderTaskContext& ctx, const wgpu::CommandEncoder& cmd, + const void* payload, size_t payloadSize, void* userdata) { + const auto handle = static_cast(reinterpret_cast(userdata)); + GfxComputeFn fn = nullptr; + void* userData = nullptr; + ModContext* modContext = nullptr; + LoadedMod* owner = nullptr; + std::string ownerId; + { + std::lock_guard lock{s_mutex}; + auto* entry = resolve_entry_locked(handle, GfxSlotKind::ComputeType); + if (entry == nullptr) { + return; + } + const auto& slot = entry->value; + fn = slot.computeFn; + userData = slot.userData; + modContext = slot.ownerContext; + owner = entry->owner; + ownerId = slot.ownerId; + } + + GfxComputeContext computeContext{ + .struct_size = sizeof(GfxComputeContext), + .device = ctx.device.Get(), + .queue = ctx.queue.Get(), + .encoder = cmd.Get(), + .vertex_buffer = ctx.vertexBuffer.Get(), + .index_buffer = ctx.indexBuffer.Get(), + .uniform_buffer = ctx.uniformBuffer.Get(), + .storage_buffer = ctx.storageBuffer.Get(), + }; + + std::string failure; + try { + fn(modContext, &computeContext, payload, payloadSize, userData); + return; + } catch (const std::exception& e) { + failure = fmt::format("exception in gfx compute callback: {}", e.what()); + } catch (...) { + failure = "unknown exception in gfx compute callback"; + } + + std::lock_guard lock{s_mutex}; + WorkerFailure record{ + .modId = std::move(ownerId), + .message = std::move(failure), + }; + collect_mod_slots_locked(*owner, record.drawIds, record.taskIds); + s_workerFailures.push_back(std::move(record)); +} + +} // namespace + +ModResult gfx_register_draw_type( + LoadedMod& mod, const char* label, GfxDrawFn draw, void* userData, uint64_t& outHandle) { + outHandle = 0; + + uint64_t handle = 0; + { + std::lock_guard lock{s_mutex}; + handle = s_slots.emplace(mod, GfxSlot{ + .kind = GfxSlotKind::DrawType, + .ownerContext = mod.context.get(), + .ownerId = mod.metadata.id, + .userData = userData, + .drawFn = draw, + }); + } + + const auto auroraId = aurora::gfx::register_draw_type(aurora::gfx::DrawTypeDescriptor{ + .label = label, + .draw = draw_trampoline, + .userdata = reinterpret_cast(static_cast(handle)), + }); + if (auroraId == aurora::gfx::InvalidDrawType) { + std::lock_guard lock{s_mutex}; + s_slots.erase_owned(handle, mod); + return MOD_ERROR; + } + + { + std::lock_guard lock{s_mutex}; + if (auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::DrawType)) { + slot->auroraDrawId = auroraId; + } + } + outHandle = handle; + return MOD_OK; +} + +ModResult gfx_unregister_draw_type(LoadedMod& mod, uint64_t handle) { + aurora::gfx::DrawTypeId auroraId = aurora::gfx::InvalidDrawType; + { + std::lock_guard lock{s_mutex}; + auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::DrawType); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auroraId = slot->auroraDrawId; + s_slots.erase_owned(handle, mod); + } + aurora::gfx::unregister_draw_type(auroraId); + return MOD_OK; +} + +ModResult gfx_push_draw(LoadedMod& mod, uint64_t handle, const void* payload, size_t payloadSize) { + aurora::gfx::DrawTypeId auroraId = aurora::gfx::InvalidDrawType; + { + std::lock_guard lock{s_mutex}; + auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::DrawType); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auroraId = slot->auroraDrawId; + } + if (!aurora::gfx::push_custom_draw(auroraId, payload, payloadSize)) { + return MOD_UNAVAILABLE; + } + return MOD_OK; +} + +ModResult gfx_push_stream( + GfxStreamBuffer buffer, const void* data, size_t size, size_t alignment, GfxRange& outRange) { + aurora::gfx::Range range; + const auto* bytes = static_cast(data); + switch (buffer) { + case GfxStreamBuffer::Verts: + range = aurora::gfx::push_verts(bytes, size, alignment); + break; + case GfxStreamBuffer::Indices: + range = aurora::gfx::push_indices(bytes, size, alignment); + break; + case GfxStreamBuffer::Uniform: + range = aurora::gfx::push_uniform(bytes, size); + break; + case GfxStreamBuffer::Storage: + range = aurora::gfx::push_storage(bytes, size); + break; + } + if (range.size == 0) { + return MOD_UNAVAILABLE; + } + outRange = GfxRange{.offset = range.offset, .size = range.size}; + return MOD_OK; +} + +ModResult gfx_register_stage_hook( + LoadedMod& mod, GfxStage stage, GfxStageFn callback, void* userData, uint64_t& outHandle) { + outHandle = 0; + std::lock_guard lock{s_mutex}; + outHandle = s_slots.emplace(mod, GfxSlot{ + .kind = GfxSlotKind::StageHook, + .ownerContext = mod.context.get(), + .ownerId = mod.metadata.id, + .userData = userData, + .stageFn = callback, + .stage = stage, + }); + return MOD_OK; +} + +ModResult gfx_unregister_stage_hook(LoadedMod& mod, uint64_t handle) { + std::lock_guard lock{s_mutex}; + auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::StageHook); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + s_slots.erase_owned(handle, mod); + return MOD_OK; +} + +ModResult gfx_resolve_pass(LoadedMod& mod, const GfxResolveDesc& desc, GfxResolvedTargets& out) { + out = GfxResolvedTargets{.struct_size = sizeof(GfxResolvedTargets)}; + if (aurora::gfx::is_offscreen() && !s_modOffscreenOpen) { + Log.error( + "[{}] resolve_pass: the active offscreen pass belongs to the game", mod.metadata.id); + return MOD_UNAVAILABLE; + } + const bool closesModOffscreen = s_modOffscreenOpen; + + aurora::gfx::ResolvedTargets resolved; + if (!aurora::gfx::resolve_pass( + aurora::gfx::ResolveDesc{.color = desc.color, .depth = desc.depth}, resolved)) + { + return MOD_UNAVAILABLE; + } + if (closesModOffscreen) { + s_modOffscreenOpen = false; + } + + out.color = resolved.color.Get(); + out.depth = resolved.depth.Get(); + out.color_format = static_cast(resolved.colorFormat); + out.width = resolved.width; + out.height = resolved.height; + return MOD_OK; +} + +ModResult gfx_create_pass(LoadedMod& mod, uint32_t width, uint32_t height) { + if (aurora::gfx::is_offscreen()) { + Log.error("[{}] create_pass: an offscreen pass is already active", mod.metadata.id); + return MOD_UNAVAILABLE; + } + if (!aurora::gfx::create_pass(width, height)) { + return MOD_UNAVAILABLE; + } + s_modOffscreenOpen = true; + return MOD_OK; +} + +ModResult gfx_register_compute_type( + LoadedMod& mod, const char* label, GfxComputeFn callback, void* userData, uint64_t& outHandle) { + outHandle = 0; + + uint64_t handle = 0; + { + std::lock_guard lock{s_mutex}; + handle = s_slots.emplace(mod, GfxSlot{ + .kind = GfxSlotKind::ComputeType, + .ownerContext = mod.context.get(), + .ownerId = mod.metadata.id, + .userData = userData, + .computeFn = callback, + }); + } + + const auto auroraId = + aurora::gfx::register_encoder_task_type(aurora::gfx::EncoderTaskDescriptor{ + .label = label, + .callback = compute_trampoline, + .userdata = reinterpret_cast(static_cast(handle)), + }); + if (auroraId == aurora::gfx::InvalidEncoderTask) { + std::lock_guard lock{s_mutex}; + s_slots.erase_owned(handle, mod); + return MOD_ERROR; + } + + { + std::lock_guard lock{s_mutex}; + if (auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::ComputeType)) { + slot->auroraTaskId = auroraId; + } + } + outHandle = handle; + return MOD_OK; +} + +ModResult gfx_unregister_compute_type(LoadedMod& mod, uint64_t handle) { + aurora::gfx::EncoderTaskId auroraId = aurora::gfx::InvalidEncoderTask; + { + std::lock_guard lock{s_mutex}; + auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::ComputeType); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auroraId = slot->auroraTaskId; + s_slots.erase_owned(handle, mod); + } + aurora::gfx::unregister_encoder_task_type(auroraId); + return MOD_OK; +} + +ModResult gfx_push_compute( + LoadedMod& mod, uint64_t handle, const void* payload, size_t payloadSize) { + aurora::gfx::EncoderTaskId auroraId = aurora::gfx::InvalidEncoderTask; + { + std::lock_guard lock{s_mutex}; + auto* slot = resolve_owned_slot_locked(mod, handle, GfxSlotKind::ComputeType); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auroraId = slot->auroraTaskId; + } + if (!aurora::gfx::push_encoder_task(auroraId, payload, payloadSize)) { + return MOD_UNAVAILABLE; + } + return MOD_OK; +} + +void gfx_run_stage( + GfxStage stage, const view_class* gameView, const view_port_class* gameViewport) { + struct StageEntry { + uint64_t handle; + GfxStageFn fn; + void* userData; + ModContext* context; + LoadedMod* owner; + }; + + std::vector entries; + { + std::lock_guard lock{s_mutex}; + s_slots.for_each([&](uint64_t handle, const auto& slotEntry) { + const auto& slot = slotEntry.value; + if (slot.kind == GfxSlotKind::StageHook && slot.stage == stage) { + entries.push_back(StageEntry{ + .handle = handle, + .fn = slot.stageFn, + .userData = slot.userData, + .context = slot.ownerContext, + .owner = slotEntry.owner, + }); + } + }); + } + if (entries.empty()) { + return; + } + + const GfxStageContext stageContext{ + .struct_size = sizeof(GfxStageContext), + .stage = stage, + .game_view = gameView, + .game_viewport = gameViewport, + }; + + for (const auto& entry : entries) { + { + std::lock_guard lock{s_mutex}; + if (resolve_slot_locked(entry.handle, GfxSlotKind::StageHook) == nullptr) { + continue; + } + } + if (!entry.owner->active) { + continue; + } + + const bool wasOffscreen = aurora::gfx::is_offscreen(); + try { + entry.fn(entry.context, &stageContext, entry.userData); + } catch (const std::exception& e) { + fail_mod(*entry.owner, MOD_ERROR, + fmt::format("exception in gfx stage callback: {}", e.what())); + } catch (...) { + fail_mod(*entry.owner, MOD_ERROR, "unknown exception in gfx stage callback"); + } + + if (aurora::gfx::is_offscreen() != wasOffscreen) { + aurora::gfx::ResolvedTargets discarded; + aurora::gfx::resolve_pass( + aurora::gfx::ResolveDesc{.color = false, .depth = false}, discarded); + s_modOffscreenOpen = false; + fail_mod(*entry.owner, MOD_ERROR, + "gfx stage callback returned with its offscreen pass still open"); + } + } +} + +void gfx_drain_worker_failures() { + std::vector failures; + { + std::lock_guard lock{s_mutex}; + failures.swap(s_workerFailures); + } + if (failures.empty()) { + return; + } + + bool needsSynchronize = false; + for (const auto& failure : failures) { + unregister_aurora_types(failure.drawIds, failure.taskIds); + needsSynchronize = needsSynchronize || !failure.drawIds.empty() || !failure.taskIds.empty(); + } + if (needsSynchronize) { + aurora::gfx::synchronize(); + } + + for (const auto& failure : failures) { + for (auto& mod : ModLoader::instance().mods()) { + if (mod.metadata.id == failure.modId && mod.active) { + fail_mod(mod, MOD_ERROR, failure.message); + break; + } + } + } +} + +void gfx_remove_mod(LoadedMod& mod) { + std::vector drawIds; + std::vector taskIds; + { + std::lock_guard lock{s_mutex}; + collect_mod_slots_locked(mod, drawIds, taskIds); + } + if (drawIds.empty() && taskIds.empty()) { + return; + } + unregister_aurora_types(drawIds, taskIds); + aurora::gfx::synchronize(); +} + +} // namespace dusk::mods + +namespace dusk::mods::svc { +namespace { + +ModResult gfx_get_device_info(ModContext* context, GfxDeviceInfo* outInfo) { + if (outInfo == nullptr || outInfo->struct_size < sizeof(GfxDeviceInfo)) { + return MOD_INVALID_ARGUMENT; + } + const uint32_t structSize = outInfo->struct_size; + *outInfo = GfxDeviceInfo{.struct_size = structSize}; + + auto* mod = mod_from_context(context); + if (mod == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + outInfo->device = aurora::gfx::device().Get(); + outInfo->queue = aurora::gfx::queue().Get(); + outInfo->color_format = static_cast(aurora::gfx::color_format()); + outInfo->depth_format = static_cast(aurora::gfx::depth_format()); + outInfo->sample_count = aurora::gfx::sample_count(); + outInfo->uses_reversed_z = aurora::gfx::uses_reversed_z(); + return MOD_OK; +} + +void* gfx_get_proc_address(ModContext* context, const char* name) { + if (mod_from_context(context) == nullptr || name == nullptr) { + return nullptr; + } + return reinterpret_cast(wgpuGetProcAddress(WGPUStringView{name, WGPU_STRLEN})); +} + +ModResult gfx_register_draw_type_impl( + ModContext* context, const GfxDrawTypeDesc* desc, GfxDrawTypeHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(GfxDrawTypeDesc) || + desc->draw == nullptr || outHandle == nullptr) + { + return MOD_INVALID_ARGUMENT; + } + uint64_t handle = 0; + const auto result = + gfx_register_draw_type(*mod, desc->label, desc->draw, desc->user_data, handle); + if (result != MOD_OK) { + return result; + } + *outHandle = handle; + return MOD_OK; +} + +ModResult gfx_unregister_draw_type_impl(ModContext* context, GfxDrawTypeHandle handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return MOD_INVALID_ARGUMENT; + } + return gfx_unregister_draw_type(*mod, handle); +} + +ModResult gfx_push_draw_impl( + ModContext* context, GfxDrawTypeHandle handle, const void* payload, size_t payloadSize) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0 || payloadSize > GFX_INLINE_DRAW_PAYLOAD_SIZE || + (payloadSize > 0 && payload == nullptr)) + { + return MOD_INVALID_ARGUMENT; + } + return gfx_push_draw(*mod, handle, payload, payloadSize); +} + +ModResult gfx_push_stream_impl(ModContext* context, GfxStreamBuffer buffer, const void* data, + size_t size, size_t alignment, GfxRange* outRange) { + if (outRange != nullptr) { + *outRange = GfxRange{0, 0}; + } + if (mod_from_context(context) == nullptr || data == nullptr || size == 0 || outRange == nullptr) + { + return MOD_INVALID_ARGUMENT; + } + return gfx_push_stream(buffer, data, size, alignment, *outRange); +} + +ModResult gfx_push_verts_impl( + ModContext* context, const void* data, size_t size, size_t alignment, GfxRange* outRange) { + return gfx_push_stream_impl(context, GfxStreamBuffer::Verts, data, size, alignment, outRange); +} + +ModResult gfx_push_indices_impl( + ModContext* context, const void* data, size_t size, size_t alignment, GfxRange* outRange) { + return gfx_push_stream_impl(context, GfxStreamBuffer::Indices, data, size, alignment, outRange); +} + +ModResult gfx_push_uniform_impl( + ModContext* context, const void* data, size_t size, GfxRange* outRange) { + return gfx_push_stream_impl(context, GfxStreamBuffer::Uniform, data, size, 0, outRange); +} + +ModResult gfx_push_storage_impl( + ModContext* context, const void* data, size_t size, GfxRange* outRange) { + return gfx_push_stream_impl(context, GfxStreamBuffer::Storage, data, size, 0, outRange); +} + +bool valid_stage(GfxStage stage) { + return stage == GFX_STAGE_SCENE_AFTER_TERRAIN || stage == GFX_STAGE_FRAME_BEFORE_HUD || + stage == GFX_STAGE_FRAME_AFTER_HUD || stage == GFX_STAGE_SCENE_BEGIN || + stage == GFX_STAGE_SCENE_AFTER_OPAQUE; +} + +ModResult gfx_register_stage_hook_impl(ModContext* context, GfxStage stage, + const GfxStageHookDesc* desc, GfxStageHookHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(GfxStageHookDesc) || + desc->callback == nullptr || outHandle == nullptr || !valid_stage(stage)) + { + return MOD_INVALID_ARGUMENT; + } + uint64_t handle = 0; + const auto result = + gfx_register_stage_hook(*mod, stage, desc->callback, desc->user_data, handle); + if (result != MOD_OK) { + return result; + } + *outHandle = handle; + return MOD_OK; +} + +ModResult gfx_unregister_stage_hook_impl(ModContext* context, GfxStageHookHandle handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return MOD_INVALID_ARGUMENT; + } + return gfx_unregister_stage_hook(*mod, handle); +} + +ModResult gfx_resolve_pass_impl( + ModContext* context, const GfxResolveDesc* desc, GfxResolvedTargets* outTargets) { + if (outTargets != nullptr && outTargets->struct_size >= sizeof(GfxResolvedTargets)) { + *outTargets = GfxResolvedTargets{.struct_size = sizeof(GfxResolvedTargets)}; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(GfxResolveDesc) || + outTargets == nullptr || outTargets->struct_size < sizeof(GfxResolvedTargets) || + (!desc->color && !desc->depth)) + { + return MOD_INVALID_ARGUMENT; + } + return gfx_resolve_pass(*mod, *desc, *outTargets); +} + +ModResult gfx_create_pass_impl(ModContext* context, uint32_t width, uint32_t height) { + auto* mod = mod_from_context(context); + if (mod == nullptr || width == 0 || height == 0) { + return MOD_INVALID_ARGUMENT; + } + return gfx_create_pass(*mod, width, height); +} + +ModResult gfx_register_compute_type_impl( + ModContext* context, const GfxComputeTypeDesc* desc, GfxComputeTypeHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(GfxComputeTypeDesc) || + desc->callback == nullptr || outHandle == nullptr) + { + return MOD_INVALID_ARGUMENT; + } + uint64_t handle = 0; + const auto result = + gfx_register_compute_type(*mod, desc->label, desc->callback, desc->user_data, handle); + if (result != MOD_OK) { + return result; + } + *outHandle = handle; + return MOD_OK; +} + +ModResult gfx_unregister_compute_type_impl(ModContext* context, GfxComputeTypeHandle handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return MOD_INVALID_ARGUMENT; + } + return gfx_unregister_compute_type(*mod, handle); +} + +ModResult gfx_push_compute_impl( + ModContext* context, GfxComputeTypeHandle handle, const void* payload, size_t payloadSize) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0 || payloadSize > GFX_INLINE_DRAW_PAYLOAD_SIZE || + (payloadSize > 0 && payload == nullptr)) + { + return MOD_INVALID_ARGUMENT; + } + return gfx_push_compute(*mod, handle, payload, payloadSize); +} + +constexpr GfxService s_gfxService{ + .header = SERVICE_HEADER(GfxService, GFX_SERVICE_MAJOR, GFX_SERVICE_MINOR), + .get_device_info = gfx_get_device_info, + .get_proc_address = gfx_get_proc_address, + .register_draw_type = gfx_register_draw_type_impl, + .unregister_draw_type = gfx_unregister_draw_type_impl, + .push_draw = gfx_push_draw_impl, + .register_compute_type = gfx_register_compute_type_impl, + .unregister_compute_type = gfx_unregister_compute_type_impl, + .push_compute = gfx_push_compute_impl, + .push_verts = gfx_push_verts_impl, + .push_indices = gfx_push_indices_impl, + .push_uniform = gfx_push_uniform_impl, + .push_storage = gfx_push_storage_impl, + .register_stage_hook = gfx_register_stage_hook_impl, + .unregister_stage_hook = gfx_unregister_stage_hook_impl, + .resolve_pass = gfx_resolve_pass_impl, + .create_pass = gfx_create_pass_impl, +}; + +} // namespace + +constinit const ServiceModule g_gfxModule{ + .id = GFX_SERVICE_ID, + .majorVersion = GFX_SERVICE_MAJOR, + .minorVersion = GFX_SERVICE_MINOR, + .service = &s_gfxService, + .modDetached = gfx_remove_mod, + .frameBegin = gfx_drain_worker_failures, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/hook.cpp b/src/dusk/mods/svc/hook.cpp new file mode 100644 index 0000000000..34d7d54aa7 --- /dev/null +++ b/src/dusk/mods/svc/hook.cpp @@ -0,0 +1,807 @@ +#include "registry.hpp" + +#include "dusk/mods/loader/loader.hpp" +#include "dusk/mods/manifest.hpp" +#include "mods/svc/hook.h" + +#if DUSK_CODE_MODS +#include "dusk/logging.h" +#include "dusk/mods/log_buffer.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +namespace dusk::mods::svc { +namespace { + +#if DUSK_CODE_MODS + +struct PreHookFn { + ModContext* context = nullptr; + HookPreFn callback = nullptr; + HookOptions options = HOOK_OPTIONS_INIT; + uint64_t order = 0; +}; + +struct VoidHookFn { + ModContext* context = nullptr; + HookReplaceFn replaceCallback = nullptr; + HookPostFn postCallback = nullptr; + HookOptions options = HOOK_OPTIONS_INIT; + uint64_t order = 0; +}; + +struct HookSlot { + std::vector pre; + VoidHookFn replace{}; + std::vector post; +}; + +// One per mod that requested a hook on a target: its template-generated trampoline and the +// address of its Hook::g_orig, both living in the mod's dylib. Any candidate's trampoline +// is interchangeable (dispatch walks the shared HookSlot), so when the active installer's mod +// unloads, the funchook detour is handed off to a surviving candidate and every candidate's +// *orig_store is rewritten to the new original pointer. +struct HookCandidate { + ModContext* context = nullptr; + void* trampoline = nullptr; + void** origStore = nullptr; + uint64_t order = 0; +}; + +struct InstalledHook { + funchook_t* handle = nullptr; + void* original = nullptr; + ModContext* active = nullptr; + std::vector candidates; +}; + +std::unordered_map s_registry; +std::unordered_map s_installed; +std::unordered_map> s_declaredTargets; +uint64_t s_nextOrder = 0; + +bool declared_target(const ModContext* context, void* fnAddr) { + if (context == nullptr) { + return false; + } + const auto it = s_declaredTargets.find(context); + if (it == s_declaredTargets.end()) { + return false; + } + const auto addr = reinterpret_cast(fnAddr); + return std::ranges::find(it->second, addr) != it->second.end(); +} + +ModResult reject_undeclared(ModContext* context, void* fnAddr) { + log::write(mod_id_from_context(context), LOG_LEVEL_ERROR, + "tried to hook undeclared target {:p}; hook targets must be declared with " + "DEFINE_HOOK/DEFINE_HOOK_SYMBOL", + fnAddr); + return MOD_INVALID_ARGUMENT; +} + +HookOptions normalize_options(const HookOptions* options) { + if (options == nullptr || options->struct_size < sizeof(HookOptions)) { + return HOOK_OPTIONS_INIT; + } + return *options; +} + +void fail_hook_callback(ModContext* context, const char* kind, const std::exception& e) { + if (auto* mod = mod_from_context(context)) { + fail_mod(*mod, MOD_ERROR, fmt::format("Exception in {} hook callback: {}", kind, e.what())); + } +} + +void fail_unknown_hook_callback(ModContext* context, const char* kind) { + if (auto* mod = mod_from_context(context)) { + fail_mod(*mod, MOD_ERROR, fmt::format("Unknown exception in {} hook callback", kind)); + } +} + +template +void sort_hooks(std::vector& hooks) { + std::ranges::stable_sort(hooks, [](const T& a, const T& b) { + if (a.options.priority != b.options.priority) { + return a.options.priority > b.options.priority; + } + return a.order < b.order; + }); +} + +// Once a hook is installed, funchook has patched the target's entry: its bytes lead to the +// detour, not the function, so canonicalization must stop there. +[[maybe_unused]] bool installed_target(void* addr) { + return s_installed.contains(reinterpret_cast(addr)); +} + +// Follow E9/FF25 chains to skip MSVC incremental-link and import stubs. +void* resolve_import_thunk(void* addr) { +#if defined(_WIN32) && (defined(_M_X64) || defined(__x86_64__)) + for (int i = 0; i < 8; ++i) { + if (installed_target(addr)) { + break; + } + const auto* p = static_cast(addr); + if (p[0] == 0x48 && p[1] == 0xFF && p[2] == 0x25) { // lld emits a REX.W prefix + ++p; + } + if (p[0] == 0xFF && p[1] == 0x25) { + int32_t offset; + std::memcpy(&offset, p + 2, 4); + addr = const_cast(*reinterpret_cast(p + 6 + offset)); + break; + } + if (p[0] == 0xE9) { + int32_t offset; + std::memcpy(&offset, p + 1, 4); + addr = const_cast(p) + 5 + offset; + } else { + break; + } + } +#elif defined(_WIN32) && (defined(_M_ARM64) || defined(__aarch64__)) + // Import thunks are `adrp x16; ldr x16, [x16, #off]; br x16` (deref the IAT slot); + // incremental-link stubs are a plain `b`, or `adrp x16; add x16, x16, #off; br x16` + // range-extension thunks when the target is out of B range. + for (int i = 0; i < 8; ++i) { + if (installed_target(addr)) { + break; + } + const auto* p = static_cast(addr); + uint32_t insn0, insn1, insn2; + std::memcpy(&insn0, p, 4); + if ((insn0 & 0xFC000000u) == 0x14000000u) { // b imm26 + auto imm26 = static_cast(insn0 << 6) >> 6; + addr = const_cast(p) + static_cast(imm26) * 4; + continue; + } + if ((insn0 & 0x9F00001Fu) != 0x90000010u) { // adrp x16, page + break; + } + std::memcpy(&insn1, p + 4, 4); + std::memcpy(&insn2, p + 8, 4); + if (insn2 != 0xD61F0200u) { // br x16 + break; + } + auto immhi = static_cast(static_cast(insn0 << 8) >> 13); // bits 23:5 + auto immlo = static_cast((insn0 >> 29) & 3); + auto page = (reinterpret_cast(p) & ~uintptr_t{0xFFF}) + + (static_cast((immhi << 2) | immlo) << 12); + if ((insn1 & 0xFFC003FFu) == 0xF9400210u) { // ldr x16, [x16, #imm12*8] + auto slot = page + ((insn1 >> 10) & 0xFFF) * 8; + addr = *reinterpret_cast(slot); + break; + } + if ((insn1 & 0xFF8003FFu) == 0x91000210u) { // add x16, x16, #imm12{, lsl #12} + auto imm = static_cast((insn1 >> 10) & 0xFFF); + addr = reinterpret_cast(page + (((insn1 >> 22) & 1) != 0 ? imm << 12 : imm)); + continue; + } + break; + } +#endif + return addr; +} + +// Resolve thunks recursively (max of 8 steps) until we find our target. +void* resolve_target(void* addr) { + for (int i = 0; i < 8; ++i) { + void* next = resolve_import_thunk(addr); + if (next == addr) { + break; + } + addr = next; + } + return addr; +} + +funchook_t* install_trampoline(void* fnAddr, void* trampoline, void** outOriginal) { + funchook_t* fh = funchook_create(); + if (fh == nullptr) { + DuskLog.warn("HookSystem: funchook_create failed for {:p}", fnAddr); + return nullptr; + } + + void* fn = fnAddr; + const int prep = funchook_prepare(fh, &fn, trampoline); + const int inst = prep == 0 ? funchook_install(fh, 0) : -1; + if (prep != 0 || inst != 0) { + const char* message = funchook_error_message(fh); + DuskLog.warn("HookSystem: funchook failed for {:p} (prepare={} install={}): {}", fnAddr, + prep, inst, message != nullptr && message[0] != '\0' ? message : "no details"); + funchook_destroy(fh); + return nullptr; + } + + *outOriginal = fn; + return fh; +} + +ModResult hook_install(ModContext* context, void* fnAddr, void* trampolineFn, void** outOriginal) { + if (fnAddr == nullptr || trampolineFn == nullptr || outOriginal == nullptr) { + return MOD_INVALID_ARGUMENT; + } + // Try to detect an invalid function pointer (possibly a vtable slot offset or Itanium mfp + // value) and provide a helpful warning instead of faulting + const auto raw = reinterpret_cast(fnAddr); + if (raw < 0x10000 +#if defined(__aarch64__) || defined(_M_ARM64) + || (raw & 3) != 0 // code is 4-aligned +#endif + ) + { + DuskLog.warn("HookSystem: {:p} from {} is not a code address (virtual member function " + "pointer? hook via dusk::mods::Hook or resolve())", + fnAddr, mod_id_from_context(context)); + return MOD_INVALID_ARGUMENT; + } + + fnAddr = resolve_target(fnAddr); + if (!declared_target(context, fnAddr)) { + return reject_undeclared(context, fnAddr); + } + const auto key = reinterpret_cast(fnAddr); + if (const auto it = s_installed.find(key); it != s_installed.end()) { + auto& entry = it->second; + // hook_add_pre + hook_add_post on the same target share one g_orig per mod. + const bool known = std::ranges::any_of(entry.candidates, [&](const HookCandidate& cand) { + return cand.context == context && cand.origStore == outOriginal; + }); + if (!known) { + entry.candidates.push_back({context, trampolineFn, outOriginal, s_nextOrder++}); + } + *outOriginal = entry.original; + return MOD_OK; + } + + // Inlining can't be intercepted by an entry patch: warn once per target when this + // build inlined the function into callers. + if (const char* name = nullptr; manifest::has_inline_sites(fnAddr, &name)) { + DuskLog.warn("HookSystem: '{}' ({:p}) for {} was inlined into callers in this build; " + "the hook only covers the calls that were not inlined", + name != nullptr ? name : "?", fnAddr, mod_id_from_context(context)); + } + + void* original = nullptr; + funchook_t* fh = install_trampoline(fnAddr, trampolineFn, &original); + if (fh == nullptr) { + return MOD_ERROR; + } + + auto& entry = s_installed[key]; + entry.handle = fh; + entry.original = original; + entry.active = context; + entry.candidates.push_back({context, trampolineFn, outOriginal, s_nextOrder++}); + *outOriginal = original; + return MOD_OK; +} + +ModResult hook_add_pre( + ModContext* context, void* fnAddr, HookPreFn callback, const HookOptions* options) { + if (fnAddr == nullptr || context == nullptr || callback == nullptr) { + return MOD_INVALID_ARGUMENT; + } + fnAddr = resolve_target(fnAddr); + if (!declared_target(context, fnAddr)) { + return reject_undeclared(context, fnAddr); + } + auto& hooks = s_registry[reinterpret_cast(fnAddr)].pre; + hooks.push_back({context, callback, normalize_options(options), s_nextOrder++}); + sort_hooks(hooks); + return MOD_OK; +} + +ModResult hook_add_post( + ModContext* context, void* fnAddr, HookPostFn callback, const HookOptions* options) { + if (fnAddr == nullptr || context == nullptr || callback == nullptr) { + return MOD_INVALID_ARGUMENT; + } + fnAddr = resolve_target(fnAddr); + if (!declared_target(context, fnAddr)) { + return reject_undeclared(context, fnAddr); + } + auto& hooks = s_registry[reinterpret_cast(fnAddr)].post; + hooks.push_back({context, nullptr, callback, normalize_options(options), s_nextOrder++}); + sort_hooks(hooks); + return MOD_OK; +} + +ModResult hook_replace( + ModContext* context, void* fnAddr, HookReplaceFn callback, const HookOptions* options) { + if (fnAddr == nullptr || context == nullptr || callback == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + const HookOptions normalized = normalize_options(options); + fnAddr = resolve_target(fnAddr); + if (!declared_target(context, fnAddr)) { + return reject_undeclared(context, fnAddr); + } + auto& slot = s_registry[reinterpret_cast(fnAddr)]; + if (slot.replace.replaceCallback == nullptr) { + slot.replace = {context, callback, nullptr, normalized, s_nextOrder++}; + return MOD_OK; + } + + switch (normalized.replace_policy) { + case HOOK_REPLACE_CONFLICT: + DuskLog.error("HookSystem: '{}' conflicts with '{}', both replace the same function", + mod_id_from_context(context), mod_id_from_context(slot.replace.context)); + return MOD_CONFLICT; + case HOOK_REPLACE_PRIORITY: + if (normalized.priority <= slot.replace.options.priority) { + return MOD_CONFLICT; + } + slot.replace = {context, callback, nullptr, normalized, s_nextOrder++}; + return MOD_OK; + case HOOK_REPLACE_OVERRIDE: + slot.replace = {context, callback, nullptr, normalized, s_nextOrder++}; + return MOD_OK; + } + return MOD_INVALID_ARGUMENT; +} + +ModResult hook_dispatch_pre( + ModContext*, void* fnAddr, void* args, void* retval, int* outSkipOriginal) { + if (outSkipOriginal != nullptr) { + *outSkipOriginal = 0; + } + if (fnAddr == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + fnAddr = resolve_target(fnAddr); + const auto it = s_registry.find(reinterpret_cast(fnAddr)); + if (it == s_registry.end()) { + return MOD_OK; + } + auto& slot = it->second; + for (auto& hook : slot.pre) { + if (hook.callback == nullptr) { + continue; + } + HookAction action = HOOK_CONTINUE; + try { + action = hook.callback(hook.context, args, retval, hook.options.userdata); + } catch (const std::exception& e) { + fail_hook_callback(hook.context, "pre", e); + continue; + } catch (...) { + fail_unknown_hook_callback(hook.context, "pre"); + continue; + } + if (action == HOOK_SKIP_ORIGINAL) { + if (outSkipOriginal != nullptr) { + *outSkipOriginal = 1; + } + return MOD_OK; + } + } + if (slot.replace.replaceCallback != nullptr) { + try { + slot.replace.replaceCallback( + slot.replace.context, args, retval, slot.replace.options.userdata); + } catch (const std::exception& e) { + fail_hook_callback(slot.replace.context, "replace", e); + return MOD_ERROR; + } catch (...) { + fail_unknown_hook_callback(slot.replace.context, "replace"); + return MOD_ERROR; + } + if (outSkipOriginal != nullptr) { + *outSkipOriginal = 1; + } + } + return MOD_OK; +} + +ModResult hook_dispatch_post(ModContext*, void* fnAddr, void* args, void* retval) { + if (fnAddr == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + fnAddr = resolve_target(fnAddr); + const auto it = s_registry.find(reinterpret_cast(fnAddr)); + if (it == s_registry.end()) { + return MOD_OK; + } + for (auto& hook : it->second.post) { + if (hook.postCallback != nullptr) { + try { + hook.postCallback(hook.context, args, retval, hook.options.userdata); + } catch (const std::exception& e) { + fail_hook_callback(hook.context, "post", e); + } catch (...) { + fail_unknown_hook_callback(hook.context, "post"); + } + } + } + return MOD_OK; +} + +#if defined(_WIN32) +/* Follow jump stubs, then match the MSVC vcall thunk a virtual mfp points at. + * Returns the vtable slot's byte offset, or npos when fn is not a vcall thunk. */ +size_t vcall_slot_offset(const void*& fn) noexcept { + constexpr size_t npos = static_cast(-1); +#if defined(_M_X64) || defined(__x86_64__) + const auto* p = static_cast(fn); + for (int i = 0; i < 8 && p[0] == 0xE9; ++i) { // incremental-link stubs + int32_t rel; + std::memcpy(&rel, p + 1, 4); + p += 5 + rel; + } + fn = p; + // The vptr load. Unoptimized clang-cl thunks spill/reload rcx first + // (push rax; mov [rsp], rcx; mov rcx, [rsp]), so scan a short window. + const uint8_t* q = nullptr; + for (int i = 0; i <= 12; ++i) { + if (p[i] == 0x48 && p[i + 1] == 0x8B && p[i + 2] == 0x01) { // mov rax, [rcx] + q = p + i + 3; + break; + } + } + if (q == nullptr) { + return npos; + } + if (q[0] == 0xFF && q[1] == 0x20) { // jmp [rax] (MSVC) + return 0; + } + if (q[0] == 0xFF && q[1] == 0x60) { // jmp [rax + imm8] + return static_cast(q[2]); + } + if (q[0] == 0xFF && q[1] == 0xA0) { // jmp [rax + imm32] + int32_t off; + std::memcpy(&off, q + 2, 4); + return off; + } + // clang-cl: mov rax, [rax + off]; (pop r10;) jmp rax. Requiring the jmp rax + // distinguishes the thunk from an ordinary getter that begins the same way. + if (q[0] == 0x48 && q[1] == 0x8B && (q[2] == 0x00 || q[2] == 0x40 || q[2] == 0x80)) { + size_t off = 0; + const uint8_t* r = q + 3; + if (q[2] == 0x40) { + off = static_cast(q[3]); + r = q + 4; + } else if (q[2] == 0x80) { + int32_t off32; + std::memcpy(&off32, q + 3, 4); + off = off32; + r = q + 7; + } + for (int i = 0; i <= 8; ++i) { + if (r[i] == 0xFF && r[i + 1] == 0xE0) { // jmp rax (48 REX optional) + return off; + } + } + } + return npos; +#elif defined(_M_ARM64) || defined(__aarch64__) + const auto* p = static_cast(fn); + uint32_t insn[3]; + for (int i = 0; i < 8; ++i) { // incremental-link `b` stubs + std::memcpy(insn, p, 4); + if ((insn[0] & 0xFC000000u) != 0x14000000u) { + break; + } + const auto imm26 = static_cast(insn[0] << 6) >> 6; + p += static_cast(imm26) * 4; + } + fn = p; + std::memcpy(insn, p, 12); + // ldr Xt, [x0]; ldr Xs, [Xt, #imm12*8]; br Xs + if ((insn[0] & 0xFFFFFFE0u) != 0xF9400000u) { + return npos; + } + const uint32_t t = insn[0] & 0x1Fu; + if ((insn[1] & 0xFFC003E0u) != (0xF9400000u | (t << 5))) { + return npos; + } + const uint32_t s = insn[1] & 0x1Fu; + if (insn[2] != (0xD61F0000u | (s << 5))) { + return npos; + } + return ((insn[1] >> 10) & 0xFFFu) * 8; +#else + (void)fn; + return npos; +#endif +} +#endif // _WIN32 + +bool resolve_symbol_checked(const char* symbol, bool requireCode, void** out, std::string& why) { + HookSymbolFlags flags{}; + switch (manifest::resolve(symbol, out, &flags)) { + case manifest::ResolveStatus::Ok: + if (requireCode && (flags & HOOK_SYMBOL_CODE) == 0) { + why = fmt::format("'{}' is not a code symbol", symbol); + return false; + } + return true; + case manifest::ResolveStatus::Unavailable: + why = "no symbol manifest for this build"; + return false; + case manifest::ResolveStatus::NotFound: + why = fmt::format("symbol '{}' not found", symbol); + return false; + case manifest::ResolveStatus::Ambiguous: + why = fmt::format("'{}' maps to more than one address; use the mangled name", symbol); + return false; + } + why = "unexpected resolve failure"; + return false; +} + +/* Decode a HOOK_MEM record's pointer-to-member representation into the target code address, + * mirroring what calling through the mfp would invoke. Virtual members hook the class's own + * overrider, read from its vtable (resolved from the symbol manifest). */ +void* resolve_member_record( + const ModMetaHookMem& record, const char* vtableSymbol, std::string& why) { + uintptr_t words[2]; + std::memcpy(words, record.pmf, sizeof(words)); + +#if defined(_WIN32) + const void* fn = reinterpret_cast(words[0]); + const size_t slot = vcall_slot_offset(fn); + if (slot == static_cast(-1)) { // not a vcall thunk: direct address + return const_cast(fn); + } + if (vtableSymbol[0] == '\0') { + why = "class name is not representable as a vtable symbol"; + return nullptr; + } + void* vtable = nullptr; + if (!resolve_symbol_checked(vtableSymbol, false, &vtable, why)) { + return nullptr; + } + // ??_7 points at the first slot. + return *reinterpret_cast(static_cast(vtable) + slot); +#else +#if defined(__aarch64__) || defined(__arm__) + // AAPCS C++ ABI: the virtual flag is bit 0 of the adjustment word (function + // addresses can't spare their low bit), and ptr holds the slot offset directly. + const bool isVirtual = (words[1] & 1) != 0; + const uintptr_t thisAdjust = words[1] >> 1; + const uintptr_t slotOffset = words[0]; +#else + // Itanium C++ ABI: virtual mfps set bit 0 of ptr; the slot offset is ptr - 1. + const bool isVirtual = (words[0] & 1) != 0; + const uintptr_t thisAdjust = words[1]; + const uintptr_t slotOffset = words[0] - 1; +#endif + if (!isVirtual) { // non-virtual: the address itself + return reinterpret_cast(words[0]); + } + if (thisAdjust != 0) { + // this-adjusting mfp (member of a secondary base): the slot offset is relative to a + // vtable we can't locate. Hook the overrider by name instead. + why = "virtual member of a secondary base; hook the overrider by name"; + return nullptr; + } + if (vtableSymbol[0] == '\0') { + why = "class name is not representable as a vtable symbol"; + return nullptr; + } + void* vtable = nullptr; + if (!resolve_symbol_checked(vtableSymbol, false, &vtable, why)) { + return nullptr; + } + // _ZTV points at the offset-to-top slot; the address point mfps index from is + // two pointers in (past offset-to-top and the typeinfo pointer). + void* target = + *reinterpret_cast(static_cast(vtable) + 2 * sizeof(void*) + slotOffset); + if (target == nullptr) { + why = "vtable slot is empty"; + } + return target; +#endif +} + +void hook_remove_mod(LoadedMod& mod) { + ModContext* context = mod.context.get(); + s_declaredTargets.erase(context); + + for (auto it = s_registry.begin(); it != s_registry.end();) { + auto& slot = it->second; + std::erase_if(slot.pre, [&](const PreHookFn& hook) { return hook.context == context; }); + std::erase_if(slot.post, [&](const VoidHookFn& hook) { return hook.context == context; }); + if (slot.replace.context == context) { + slot.replace = {}; + } + if (slot.pre.empty() && slot.post.empty() && slot.replace.replaceCallback == nullptr) { + it = s_registry.erase(it); + } else { + ++it; + } + } + + for (auto it = s_installed.begin(); it != s_installed.end();) { + auto& entry = it->second; + // The departing mod's g_orig slots are about to be unmapped; drop its candidates before + // any orig_store rewrites below. + std::erase_if(entry.candidates, + [context](const HookCandidate& cand) { return cand.context == context; }); + if (entry.active != context) { + ++it; + continue; + } + + auto* target = reinterpret_cast(it->first); + const int uninst = funchook_uninstall(entry.handle, 0); + const int destr = funchook_destroy(entry.handle); + if (uninst != 0 || destr != 0) { + DuskLog.warn("HookSystem: funchook uninstall/destroy for {:p} returned {}/{}", target, + uninst, destr); + } + entry.handle = nullptr; + entry.active = nullptr; + + if (entry.candidates.empty()) { + it = s_installed.erase(it); + continue; + } + + // Hand the detour off to a surviving candidate (lowest registration order first; the + // vector is append-ordered). A candidate whose install fails stays in the list: its + // g_orig must still track the current original pointer. + for (auto& cand : entry.candidates) { + void* original = nullptr; + funchook_t* fh = install_trampoline(target, cand.trampoline, &original); + if (fh == nullptr) { + continue; + } + entry.handle = fh; + entry.original = original; + entry.active = cand.context; + DuskLog.info("HookSystem: reinstalled trampoline for {:p}: {} -> {} (tramp={:p})", + target, mod_id_from_context(context), mod_id_from_context(cand.context), + cand.trampoline); + break; + } + + if (entry.active == nullptr) { + DuskLog.warn("HookSystem: no reinstallable trampoline for {:p}; hooks there are " + "disabled until a mod reinstalls one", + target); + for (auto& cand : entry.candidates) { + *cand.origStore = target; + } + it = s_installed.erase(it); + continue; + } + + for (auto& cand : entry.candidates) { + *cand.origStore = entry.original; + } + ++it; + } +} + +#else // DUSK_CODE_MODS + +ModResult hook_install(ModContext*, void*, void*, void**) { + return MOD_UNSUPPORTED; +} +ModResult hook_add_pre(ModContext*, void*, HookPreFn, const HookOptions*) { + return MOD_UNSUPPORTED; +} +ModResult hook_add_post(ModContext*, void*, HookPostFn, const HookOptions*) { + return MOD_UNSUPPORTED; +} +ModResult hook_replace(ModContext*, void*, HookReplaceFn, const HookOptions*) { + return MOD_UNSUPPORTED; +} +ModResult hook_dispatch_pre(ModContext*, void*, void*, void*, int* outSkipOriginal) { + if (outSkipOriginal != nullptr) { + *outSkipOriginal = 0; + } + return MOD_UNSUPPORTED; +} +ModResult hook_dispatch_post(ModContext*, void*, void*, void*) { + return MOD_UNSUPPORTED; +} +void hook_remove_mod(LoadedMod&) {} + +#endif // DUSK_CODE_MODS + +// By-name resolution reads the symbol manifest, which is independent of the hook engine. +ModResult hook_resolve(ModContext*, const char* symbol, void** outAddr, HookSymbolFlags* outFlags) { + if (symbol == nullptr || outAddr == nullptr) { + return MOD_INVALID_ARGUMENT; + } + switch (manifest::resolve(symbol, outAddr, outFlags)) { + case manifest::ResolveStatus::Ok: + return MOD_OK; + case manifest::ResolveStatus::Unavailable: + return MOD_UNSUPPORTED; + case manifest::ResolveStatus::NotFound: + return MOD_UNAVAILABLE; + case manifest::ResolveStatus::Ambiguous: + return MOD_CONFLICT; + } + return MOD_ERROR; +} + +constexpr HookService s_hookService{ + .header = SERVICE_HEADER(HookService, HOOK_SERVICE_MAJOR, HOOK_SERVICE_MINOR), + .install = hook_install, + .add_pre = hook_add_pre, + .add_post = hook_add_post, + .replace = hook_replace, + .dispatch_pre = hook_dispatch_pre, + .dispatch_post = hook_dispatch_post, + .resolve = hook_resolve, +}; + +} // namespace + +#if DUSK_CODE_MODS +void hook_resolve_mod_records(LoadedMod& mod) { + auto& declared = s_declaredTargets[mod.context.get()]; + declared.clear(); + if (!mod.native) { + return; + } + + const auto resolved = [&](void* target, void** slot) { + target = resolve_target(target); + *slot = target; + declared.push_back(reinterpret_cast(target)); + }; + const auto unresolved = [&](const char* what, std::string_view why, void** slot) { + *slot = nullptr; + log::write(mod.metadata.id, LOG_LEVEL_WARN, + "hook target '{}' did not resolve ({}); installing this hook will fail", what, why); + }; + + for (auto* record : mod.native->parsed.hookFns) { + if (record->target != nullptr) { + resolved(record->target, &record->resolved); + } else { + unresolved("", "null link-time target", &record->resolved); + } + } + for (auto* record : mod.native->parsed.hookMems) { + std::string why; + void* target = resolve_member_record(*record, hook_mem_vtable_symbol(*record), why); + if (target != nullptr) { + resolved(target, &record->resolved); + } else { + unresolved(hook_mem_display_name(*record), why, &record->resolved); + } + } + for (auto* record : mod.native->parsed.hookNames) { + const char* name = hook_name_symbol(*record); + std::string why; + void* target = nullptr; + if (resolve_symbol_checked(name, true, &target, why)) { + resolved(target, &record->resolved); + } else { + unresolved(name, why, &record->resolved); + } + } +} +#else +void hook_resolve_mod_records(LoadedMod&) {} +#endif // DUSK_CODE_MODS + +constinit const ServiceModule g_hookModule{ + .id = HOOK_SERVICE_ID, + .majorVersion = HOOK_SERVICE_MAJOR, + .minorVersion = HOOK_SERVICE_MINOR, + .service = &s_hookService, + .modDetached = hook_remove_mod, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/hook.hpp b/src/dusk/mods/svc/hook.hpp new file mode 100644 index 0000000000..d712a8054a --- /dev/null +++ b/src/dusk/mods/svc/hook.hpp @@ -0,0 +1,11 @@ +#pragma once + +namespace dusk::mods { +struct LoadedMod; +} + +namespace dusk::mods::svc { + +void hook_resolve_mod_records(LoadedMod& mod); + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/host.cpp b/src/dusk/mods/svc/host.cpp new file mode 100644 index 0000000000..5deccc7c9e --- /dev/null +++ b/src/dusk/mods/svc/host.cpp @@ -0,0 +1,169 @@ +#include "registry.hpp" +#include "slot_map.hpp" + +#include "dusk/mods/loader/loader.hpp" +#include "dusk/mods/manifest.hpp" +#include "fmt/format.h" + +#include +#include +#include + +namespace dusk::mods::svc { +namespace { + +ModResult host_get_service(ModContext*, const char* serviceId, const uint16_t majorVersion, + const uint16_t minMinorVersion, const void** outService) { + if (outService == nullptr) { + return MOD_INVALID_ARGUMENT; + } + *outService = nullptr; + const auto* service = find_service(serviceId, majorVersion, minMinorVersion); + if (service == nullptr) { + return MOD_UNAVAILABLE; + } + *outService = service->service; + return MOD_OK; +} + +ModResult host_publish_service( + ModContext* context, const char* serviceId, const uint16_t majorVersion, const void* service) { + auto* mod = mod_from_context(context); + if (mod == nullptr || !valid_service_id(serviceId) || service == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + return publish_deferred_service(*mod, serviceId, majorVersion, service); +} + +void host_fail(ModContext* context, const ModResult code, const char* message) { + auto* mod = mod_from_context(context); + if (mod != nullptr) { + fail_mod(*mod, code, message != nullptr ? message : "Mod reported an unknown failure"); + } +} + +const char* host_mod_id(ModContext* context) { + const auto* mod = mod_from_context(context); + return mod != nullptr ? mod->metadata.id.c_str() : ""; +} + +const char* host_mod_name(ModContext* context) { + const auto* mod = mod_from_context(context); + return mod != nullptr ? mod->metadata.name.c_str() : ""; +} + +const char* host_mod_version(ModContext* context) { + const auto* mod = mod_from_context(context); + return mod != nullptr ? mod->metadata.version.c_str() : ""; +} + +const char* host_mod_dir(ModContext* context) { + const auto* mod = mod_from_context(context); + return mod != nullptr ? mod->dirUtf8.c_str() : ""; +} + +const char* host_native_dir(ModContext* context) { + const auto* mod = mod_from_context(context); + return mod != nullptr ? mod->nativeDirUtf8.c_str() : ""; +} + +struct LifecycleWatcher { + ModLifecycleFn fn = nullptr; + void* userData = nullptr; + uint64_t order = 0; +}; + +SlotMap s_watchers; +uint64_t s_nextWatchOrder = 0; + +ModResult host_watch_mod_lifecycle( + ModContext* context, ModLifecycleFn fn, void* userData, uint64_t* outHandle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || fn == nullptr || outHandle == nullptr) { + return MOD_INVALID_ARGUMENT; + } + const auto handle = s_watchers.emplace( + *mod, LifecycleWatcher{.fn = fn, .userData = userData, .order = s_nextWatchOrder++}); + *outHandle = handle; + return MOD_OK; +} + +ModResult host_unwatch_mod_lifecycle(ModContext* context, const uint64_t handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return s_watchers.erase_owned(handle, *mod) ? MOD_OK : MOD_INVALID_ARGUMENT; +} + +void host_mod_detached(LoadedMod& mod) { + // The subject's own watches go first: a mod is never notified about its own teardown. + s_watchers.erase_all(mod); + + // Iterate a snapshot in registration order: callbacks may watch/unwatch, and a failing + // callback erases the failing mod's services. + struct PendingNotify { + uint64_t order; + uint64_t handle; + }; + std::vector snapshot; + s_watchers.for_each([&](const uint64_t handle, const auto& entry) { + snapshot.push_back({.order = entry.value.order, .handle = handle}); + }); + std::ranges::sort(snapshot, {}, &PendingNotify::order); + + for (const auto& pending : snapshot) { + const auto* entry = s_watchers.find(pending.handle); + if (entry == nullptr) { + continue; + } + // Do not retain pointers into SlotMap across a callback that may mutate it. + auto* owner = entry->owner; + const auto watcher = entry->value; + try { + watcher.fn(owner->context.get(), mod.context.get(), mod.metadata.id.c_str(), + MOD_LIFECYCLE_DETACHED, watcher.userData); + } catch (const std::exception& e) { + fail_mod(*owner, MOD_ERROR, + fmt::format("Exception in mod lifecycle callback: {}", e.what())); + } catch (...) { + fail_mod(*owner, MOD_ERROR, "Unknown exception in mod lifecycle callback"); + } + } +} + +constinit HostService s_hostService{ + .header = SERVICE_HEADER(HostService, HOST_SERVICE_MAJOR, HOST_SERVICE_MINOR), + .version = DUSK_VERSION_STRING, + .build_id = nullptr, + .build_id_len = 0, + .get_service = host_get_service, + .publish_service = host_publish_service, + .fail = host_fail, + .mod_id = host_mod_id, + .mod_name = host_mod_name, + .mod_version = host_mod_version, + .mod_dir = host_mod_dir, + .watch_mod_lifecycle = host_watch_mod_lifecycle, + .unwatch_mod_lifecycle = host_unwatch_mod_lifecycle, + .native_dir = host_native_dir, +}; + +} // namespace + +constinit const ServiceModule g_hostModule{ + .id = HOST_SERVICE_ID, + .majorVersion = HOST_SERVICE_MAJOR, + .minorVersion = HOST_SERVICE_MINOR, + .service = &s_hostService, + .initialize = + [] { + const auto& buildId = manifest::image_build_id(); + s_hostService.build_id = buildId.empty() ? nullptr : buildId.data(); + s_hostService.build_id_len = static_cast(buildId.size()); + }, + .modDetached = host_mod_detached, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/log.cpp b/src/dusk/mods/svc/log.cpp new file mode 100644 index 0000000000..498a20aeaf --- /dev/null +++ b/src/dusk/mods/svc/log.cpp @@ -0,0 +1,53 @@ +#include "registry.hpp" + +#include "dusk/mods/loader/loader.hpp" +#include "dusk/mods/log_buffer.hpp" + +namespace dusk::mods::svc { +namespace { + +void log_write(ModContext* context, const LogLevel level, const char* message) { + const char* text = message != nullptr ? message : ""; + log::emit(log::Source::Mod, mod_id_from_context(context), level, text); +} + +void log_trace(ModContext* context, const char* message) { + log_write(context, LOG_LEVEL_TRACE, message); +} + +void log_debug(ModContext* context, const char* message) { + log_write(context, LOG_LEVEL_DEBUG, message); +} + +void log_info(ModContext* context, const char* message) { + log_write(context, LOG_LEVEL_INFO, message); +} + +void log_warn(ModContext* context, const char* message) { + log_write(context, LOG_LEVEL_WARN, message); +} + +void log_error(ModContext* context, const char* message) { + log_write(context, LOG_LEVEL_ERROR, message); +} + +constexpr LogService s_logService{ + .header = SERVICE_HEADER(LogService, LOG_SERVICE_MAJOR, LOG_SERVICE_MINOR), + .write = log_write, + .trace = log_trace, + .debug = log_debug, + .info = log_info, + .warn = log_warn, + .error = log_error, +}; + +} // namespace + +constinit const ServiceModule g_logModule{ + .id = LOG_SERVICE_ID, + .majorVersion = LOG_SERVICE_MAJOR, + .minorVersion = LOG_SERVICE_MINOR, + .service = &s_logService, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/overlay.cpp b/src/dusk/mods/svc/overlay.cpp new file mode 100644 index 0000000000..44eef6ab17 --- /dev/null +++ b/src/dusk/mods/svc/overlay.cpp @@ -0,0 +1,350 @@ +#include "registry.hpp" +#include "slot_map.hpp" + +#include "aurora/dvd.h" +#include "aurora/lib/logging.hpp" +#include "dusk/mods/loader/loader.hpp" +#include "mods/svc/overlay.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace std::string_literals; + +namespace dusk::mods::svc { +namespace { + +aurora::Module Log("dusk::mods::overlay"); + +struct OverlayFileData { + std::string bundlePath; + std::shared_ptr bundle; + std::shared_ptr > buffer; +}; + +// Keyed by the id passed to Aurora as per-file userdata. Guarded by s_overlayMutex: Aurora may +// call cbOpen from a DVD thread while the game thread replaces the set in overlay_sync_files. +// The shared bundle/buffer pointer keeps a disabled/reloaded mod's data readable until the last +// open completes. +std::unordered_map s_overlayFiles; +uintptr_t s_nextOverlayId = 1; +std::mutex s_overlayMutex; + +struct RuntimeOverlaySlot { + std::string discPath; + std::string bundlePath; // bundle-backed if non-empty + std::shared_ptr> buffer; // buffer-backed otherwise + size_t size = 0; + uint64_t order = 0; +}; +SlotMap s_runtimeOverlays; +uint64_t s_nextRuntimeOrder = 0; +bool s_overlaysDirty = false; + +// Aurora matches overlay paths against the disc case-insensitively and later entries win, so +// claims are tracked by lowercased path and re-claims by a different mod warn. +void claim_overlay_path(std::unordered_map& claims, + const std::string& discPath, const LoadedMod& mod) { + std::string key = discPath; + for (auto& ch : key) { + if (ch >= 'A' && ch <= 'Z') { + ch += 'a' - 'A'; + } + } + const auto [it, inserted] = claims.try_emplace(std::move(key), &mod); + if (!inserted && it->second != &mod) { + Log.warn("Overlay conflict: '{}' is provided by both '{}' and '{}'; '{}' wins.", discPath, + it->second->metadata.id, mod.metadata.id, mod.metadata.id); + it->second = &mod; + } +} + +void find_overlay_files(std::vector& files, LoadedMod& mod, + std::unordered_map& claims) { + for (const auto& file : mod.bundle->getFileNames()) { + if (!file.starts_with("overlay/")) { + continue; + } + + auto overlayPath = file.substr("overlay/"s.size()); + assert(!overlayPath.starts_with('/')); + overlayPath.insert(0, "/"); + + const auto size = mod.bundle->getFileSize(file); + + const auto id = s_nextOverlayId++; + s_overlayFiles.emplace(id, OverlayFileData{file, mod.bundle, nullptr}); + claim_overlay_path(claims, overlayPath, mod); + files.emplace_back(strdup(overlayPath.c_str()), reinterpret_cast(id), size); + } +} + +void append_runtime_overlays(std::vector& files, LoadedMod& mod, + std::unordered_map& claims) { + // Aurora resolves duplicate paths later-entry-wins, so emit in registration order (SlotMap + // iteration is index order, and freed indices are reused). + std::vector slots; + s_runtimeOverlays.for_each([&](uint64_t, const auto& entry) { + if (entry.owner == &mod) { + slots.push_back(&entry.value); + } + }); + std::ranges::sort(slots, {}, &RuntimeOverlaySlot::order); + + for (const auto* slot : slots) { + const auto id = s_nextOverlayId++; + if (slot->buffer != nullptr) { + s_overlayFiles.emplace(id, OverlayFileData{{}, nullptr, slot->buffer}); + } else { + s_overlayFiles.emplace(id, OverlayFileData{slot->bundlePath, mod.bundle, nullptr}); + } + claim_overlay_path(claims, slot->discPath, mod); + files.emplace_back(strdup(slot->discPath.c_str()), reinterpret_cast(id), slot->size); + } +} + +struct OpenOverlayFile { + std::vector ownedData; + std::shared_ptr > shared; + size_t pos = 0; + + [[nodiscard]] const std::vector& data() const { + return shared != nullptr ? *shared : ownedData; + } +}; + +void* cbOpen(void* userdata) { + const auto id = reinterpret_cast(userdata); + OverlayFileData fileData; + { + std::lock_guard lock{s_overlayMutex}; + const auto it = s_overlayFiles.find(id); + if (it == s_overlayFiles.end()) { + // The overlay set was re-pushed between the FST lookup and this call. + return nullptr; + } + fileData = it->second; + } + + if (fileData.buffer != nullptr) { + return new OpenOverlayFile{.shared = std::move(fileData.buffer)}; + } + + try { + auto fileContents = fileData.bundle->readFile(fileData.bundlePath); + return new OpenOverlayFile{.ownedData = std::move(fileContents)}; + } catch (const std::runtime_error& e) { + Log.error("Failed to read overlay file {}: {}", fileData.bundlePath, e.what()); + return nullptr; + } +} + +void cbClose(void* handle) { + const auto openFile = static_cast(handle); + delete openFile; +} + +int64_t cbRead(void* handle, uint8_t* buf, const size_t len) { + auto& openFile = *static_cast(handle); + + const auto remainingSpace = openFile.data().size() - openFile.pos; + const auto toRead = std::min(remainingSpace, len); + std::memcpy(buf, openFile.data().data() + openFile.pos, toRead); + openFile.pos += toRead; + return static_cast(toRead); +} + +int64_t cbSeek(void* handle, int64_t offset, int32_t whence) { + if (whence != 0) { + Log.fatal("Invalid seek mode from aurora: {}", whence); + } + + auto& openFile = *static_cast(handle); + const auto posSigned = + std::clamp(offset, static_cast(0), static_cast(openFile.data().size())); + openFile.pos = static_cast(posSigned); + return posSigned; +} + +constexpr AuroraOverlayCallbacks s_overlayCallbacks = { + .open = cbOpen, + .close = cbClose, + .read = cbRead, + .seek = cbSeek, +}; + +void overlay_sync_files() { + static bool callbacksRegistered = false; + if (!callbacksRegistered) { + aurora_dvd_overlay_callbacks(&s_overlayCallbacks); + callbacksRegistered = true; + } + + s_overlaysDirty = false; + + std::vector files; + std::unordered_map claims; + { + std::lock_guard lock{s_overlayMutex}; + s_overlayFiles.clear(); + for (auto& mod : ModLoader::instance().active_mods()) { + find_overlay_files(files, mod, claims); + append_runtime_overlays(files, mod, claims); + } + } + + Log.debug("Registering {} overlay file(s).", files.size()); + aurora_dvd_overlay_files(files.data(), files.size(), nullptr); + + for (const auto& file : files) { + std::free(const_cast(file.fileName)); + } +} + +uint64_t overlay_add_file( + LoadedMod& mod, std::string discPath, std::string bundlePath, size_t size) { + const auto handle = s_runtimeOverlays.emplace(mod, RuntimeOverlaySlot{ + .discPath = std::move(discPath), + .bundlePath = std::move(bundlePath), + .size = size, + .order = s_nextRuntimeOrder++, + }); + s_overlaysDirty = true; + return handle; +} + +uint64_t overlay_add_buffer(LoadedMod& mod, std::string discPath, std::vector data) { + const auto size = data.size(); + const auto handle = s_runtimeOverlays.emplace(mod, + RuntimeOverlaySlot{ + .discPath = std::move(discPath), + .buffer = std::make_shared>(std::move(data)), + .size = size, + .order = s_nextRuntimeOrder++, + }); + s_overlaysDirty = true; + return handle; +} + +bool overlay_remove(LoadedMod& mod, uint64_t handle) { + if (!s_runtimeOverlays.erase_owned(handle, mod)) { + return false; + } + s_overlaysDirty = true; + return true; +} + +void overlay_remove_mod(LoadedMod& mod) { + if (s_runtimeOverlays.erase_all(mod) != 0) { + s_overlaysDirty = true; + } +} + +bool consume_overlays_dirty() { + return std::exchange(s_overlaysDirty, false); +} + +constexpr size_t kMaxOverlayFileSize = UINT32_MAX; + +bool is_valid_disc_path(const char* discPath) { + if (discPath == nullptr) { + return false; + } + const std::string_view path{discPath}; + return path.starts_with('/') && is_safe_resource_path(path.substr(1)); +} + +ModResult overlay_add_file( + ModContext* context, const char* discPath, const char* bundlePath, OverlayHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || !is_valid_disc_path(discPath) || bundlePath == nullptr || + !is_safe_resource_path(bundlePath)) + { + return MOD_INVALID_ARGUMENT; + } + + size_t size = 0; + try { + size = mod->bundle->getFileSize(bundlePath); + } catch (const std::exception& e) { + Log.error( + "[{}] overlay add_file '{}' failed: {}", mod->metadata.id, bundlePath, e.what()); + return MOD_UNAVAILABLE; + } + if (size > kMaxOverlayFileSize) { + Log.error("[{}] overlay add_file '{}' failed: file too large ({} bytes)", + mod->metadata.id, bundlePath, size); + return MOD_INVALID_ARGUMENT; + } + + const auto handle = overlay_add_file(*mod, discPath, bundlePath, size); + if (outHandle != nullptr) { + *outHandle = handle; + } + return MOD_OK; +} + +ModResult overlay_add_buffer(ModContext* context, const char* discPath, const void* data, + size_t size, OverlayHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || !is_valid_disc_path(discPath) || (data == nullptr && size != 0) || + size > kMaxOverlayFileSize) + { + return MOD_INVALID_ARGUMENT; + } + + const auto* bytes = static_cast(data); + const auto handle = overlay_add_buffer(*mod, discPath, std::vector{bytes, bytes + size}); + if (outHandle != nullptr) { + *outHandle = handle; + } + return MOD_OK; +} + +ModResult overlay_remove(ModContext* context, OverlayHandle handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return MOD_INVALID_ARGUMENT; + } + if (!overlay_remove(*mod, handle)) { + Log.error("[{}] overlay remove failed: unknown handle {}", mod->metadata.id, handle); + return MOD_INVALID_ARGUMENT; + } + return MOD_OK; +} + +constexpr OverlayService s_overlayService{ + .header = SERVICE_HEADER(OverlayService, OVERLAY_SERVICE_MAJOR, OVERLAY_SERVICE_MINOR), + .add_file = overlay_add_file, + .add_buffer = overlay_add_buffer, + .remove = overlay_remove, +}; + +} // namespace + +constinit const ServiceModule g_overlayModule{ + .id = OVERLAY_SERVICE_ID, + .majorVersion = OVERLAY_SERVICE_MAJOR, + .minorVersion = OVERLAY_SERVICE_MINOR, + .service = &s_overlayService, + .modDetached = overlay_remove_mod, + .lifecycleApplied = overlay_sync_files, + .frameEnd = + [] { + if (consume_overlays_dirty()) { + overlay_sync_files(); + } + }, +}; +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/registry.cpp b/src/dusk/mods/svc/registry.cpp new file mode 100644 index 0000000000..2033d47475 --- /dev/null +++ b/src/dusk/mods/svc/registry.cpp @@ -0,0 +1,312 @@ +#include "registry.hpp" + +#include "dusk/app_info.hpp" +#include "dusk/logging.h" +#include "dusk/mods/loader/loader.hpp" + +#include +#include +#include +#include + +namespace dusk::mods::svc { +namespace { + +std::unordered_map s_services; +std::vector s_modules; + +std::string service_key(std::string_view id, const uint16_t majorVersion) { + std::string key{id}; + key.push_back('\x1f'); + key += std::to_string(majorVersion); + return key; +} + +const char* mod_id(const LoadedMod* mod) { + return mod != nullptr ? mod->metadata.id.c_str() : AppName; +} + +bool validate_service_header(const ServiceHeader* header, const char* serviceId, + const uint16_t majorVersion, const uint16_t minorVersion, LoadedMod* provider) { + if (header == nullptr) { + DuskLog.error("[{}] service '{}' has null header", mod_id(provider), serviceId); + return false; + } + if (header->struct_size < sizeof(ServiceHeader)) { + DuskLog.error("[{}] service '{}' has invalid header size {}", mod_id(provider), serviceId, + header->struct_size); + return false; + } + if (header->major_version != majorVersion || header->minor_version != minorVersion) { + DuskLog.error("[{}] service '{}' header version {}.{} does not match export {}.{}", + mod_id(provider), serviceId, header->major_version, header->minor_version, majorVersion, + minorVersion); + return false; + } + return true; +} + +void clear_services() { + s_services.clear(); + s_modules.clear(); +} + +} // namespace + +bool valid_service_id(const char* serviceId) { + return serviceId != nullptr && serviceId[0] != '\0'; +} + +ModResult register_service(const char* serviceId, const uint16_t majorVersion, + const uint16_t minorVersion, const void* service, LoadedMod* provider, const bool deferred) { + if (!valid_service_id(serviceId)) { + DuskLog.error("[{}] attempted to register a service with no id", mod_id(provider)); + return MOD_INVALID_ARGUMENT; + } + + if (!deferred && !validate_service_header(static_cast(service), serviceId, + majorVersion, minorVersion, provider)) + { + return MOD_INVALID_ARGUMENT; + } + + const auto key = service_key(serviceId, majorVersion); + if (s_services.contains(key)) { + DuskLog.error("[{}] duplicate service '{}@{}'", mod_id(provider), serviceId, majorVersion); + return MOD_CONFLICT; + } + + s_services.emplace(key, ServiceRecord{ + serviceId, + majorVersion, + minorVersion, + service, + provider, + deferred, + }); + return MOD_OK; +} + +ModResult publish_deferred_service( + LoadedMod& provider, const char* serviceId, const uint16_t majorVersion, const void* service) { + if (!valid_service_id(serviceId) || service == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + const auto it = s_services.find(service_key(serviceId, majorVersion)); + if (it == s_services.end() || !it->second.deferred || it->second.provider != &provider) { + DuskLog.error("[{}] tried to publish undeclared service '{}@{}'", provider.metadata.id, + serviceId, majorVersion); + return MOD_UNSUPPORTED; + } + auto& record = it->second; + if (record.service != nullptr) { + return MOD_CONFLICT; + } + + const auto* header = static_cast(service); + if (!validate_service_header(header, serviceId, majorVersion, record.minorVersion, &provider)) { + return MOD_INVALID_ARGUMENT; + } + + record.service = service; + record.minorVersion = header->minor_version; + return MOD_OK; +} + +void remove_services_for_provider(const LoadedMod& provider) { + std::erase_if( + s_services, [&](const auto& entry) { return entry.second.provider == &provider; }); +} + +const ServiceRecord* find_service( + const char* serviceId, const uint16_t majorVersion, const uint16_t minMinorVersion) { + const auto* record = find_service_record(serviceId, majorVersion); + if (record == nullptr || record->service == nullptr || record->minorVersion < minMinorVersion) { + return nullptr; + } + return record; +} + +const ServiceRecord* find_service_record(const char* serviceId, const uint16_t majorVersion) { + if (!valid_service_id(serviceId)) { + return nullptr; + } + + const auto it = s_services.find(service_key(serviceId, majorVersion)); + return it != s_services.end() ? &it->second : nullptr; +} + +ModResult register_module(const ServiceModule& module) { + const auto result = register_service( + module.id, module.majorVersion, module.minorVersion, module.service, nullptr, false); + if (result != MOD_OK) { + return result; + } + s_modules.push_back(&module); + if (module.initialize != nullptr) { + module.initialize(); + } + return MOD_OK; +} + +void modules_mod_detached(LoadedMod& mod) { + for (const auto* module : s_modules | std::views::reverse) { + if (module->modDetached != nullptr) { + module->modDetached(mod); + } + } +} + +void modules_lifecycle_applied() { + for (const auto* module : s_modules) { + if (module->lifecycleApplied != nullptr) { + module->lifecycleApplied(); + } + } +} + +void modules_frame_begin() { + for (const auto* module : s_modules) { + if (module->frameBegin != nullptr) { + module->frameBegin(); + } + } +} + +void modules_frame_end() { + for (const auto* module : s_modules) { + if (module->frameEnd != nullptr) { + module->frameEnd(); + } + } +} + +void modules_shutdown() { + for (const auto* module : s_modules | std::views::reverse) { + if (module->shutdown != nullptr) { + module->shutdown(); + } + } + clear_services(); +} + +} // namespace dusk::mods::svc + +namespace dusk::mods { + +void ModLoader::init_services() { + svc::clear_services(); + for (const auto* module : + { + &svc::g_hostModule, + &svc::g_logModule, + &svc::g_resourceModule, + &svc::g_hookModule, + &svc::g_overlayModule, + &svc::g_textureModule, + &svc::g_configModule, + &svc::g_uiModule, + &svc::g_gameModule, + &svc::g_cameraModule, + &svc::g_gfxModule, + }) + { + svc::register_module(*module); + } +} + +bool ModLoader::register_static_service_exports(LoadedMod& mod) { + if (!mod.native) { + return true; + } + + for (const auto* serviceExport : mod.native->parsed.exports) { + if (!svc::valid_service_id(serviceExport->service_id.chars)) { + fail_mod(mod, MOD_INVALID_ARGUMENT, "Invalid service export descriptor"); + return false; + } + + const bool deferred = (serviceExport->rec.flags & SERVICE_EXPORT_DEFERRED) != 0; + if (!deferred && serviceExport->service == nullptr) { + fail_mod(mod, MOD_INVALID_ARGUMENT, "Static service export has null service pointer"); + return false; + } + + const auto result = + svc::register_service(serviceExport->service_id.chars, serviceExport->major_version, + serviceExport->minor_version, serviceExport->service, &mod, deferred); + if (result != MOD_OK) { + fail_mod(mod, result, "Service export registration failed"); + return false; + } + } + + return true; +} + +std::string ModLoader::describe_missing_import( + const char* serviceId, const uint16_t majorVersion, const uint16_t minMinorVersion) const { + if (const auto* record = svc::find_service_record(serviceId, majorVersion)) { + if (record->service == nullptr) { + return fmt::format("Required service {}@{} was never published by provider '{}'", + serviceId, majorVersion, svc::mod_id(record->provider)); + } + return fmt::format("Required service {}@{} only provides minor version {} (need >= {})", + serviceId, majorVersion, record->minorVersion, minMinorVersion); + } + + // No record can also mean the provider failed or is disabled and its services were removed. + for (const auto& other : mods()) { + if ((other.active && !other.loadFailed) || !other.native) { + continue; + } + for (const auto* serviceExport : other.native->parsed.exports) { + if (svc::valid_service_id(serviceExport->service_id.chars) && + std::string_view{serviceExport->service_id.chars} == serviceId && + serviceExport->major_version == majorVersion) + { + return fmt::format("Required service {}@{} unavailable: provider '{}' {}", + serviceId, majorVersion, other.metadata.id, + other.loadFailed ? "failed to load" : "is disabled"); + } + } + } + + return fmt::format("Required service unavailable: {}@{}", serviceId, majorVersion); +} + +bool ModLoader::resolve_service_imports(LoadedMod& mod) { + if (!mod.native) { + return true; + } + + for (const auto* serviceImport : mod.native->parsed.imports) { + if (!svc::valid_service_id(serviceImport->service_id.chars) || + serviceImport->slot == nullptr) + { + fail_mod(mod, MOD_INVALID_ARGUMENT, "Invalid service import descriptor"); + return false; + } + + const auto* service = svc::find_service(serviceImport->service_id.chars, + serviceImport->major_version, serviceImport->min_minor_version); + if (service == nullptr) { + *static_cast(serviceImport->slot) = nullptr; + if ((serviceImport->rec.flags & SERVICE_IMPORT_OPTIONAL) != 0) { + continue; + } + + fail_mod(mod, MOD_UNAVAILABLE, + describe_missing_import(serviceImport->service_id.chars, + serviceImport->major_version, serviceImport->min_minor_version)); + return false; + } + + *static_cast(serviceImport->slot) = service->service; + } + + return true; +} + +} // namespace dusk::mods diff --git a/src/dusk/mods/svc/registry.hpp b/src/dusk/mods/svc/registry.hpp new file mode 100644 index 0000000000..191626e0ef --- /dev/null +++ b/src/dusk/mods/svc/registry.hpp @@ -0,0 +1,76 @@ +#pragma once + +#include "dusk/mod_loader.hpp" +#include "mods/svc/host.h" +#include "mods/svc/log.h" + +#include +#include + +namespace dusk::mods::svc { + +struct ServiceRecord { + std::string id; + uint16_t majorVersion = 0; + uint16_t minorVersion = 0; + const void* service = nullptr; + LoadedMod* provider = nullptr; + bool deferred = false; +}; + +// A host service and its lifecycle hooks. Every hook is optional. Frame and lifecycle hooks run in +// registration order, modDetached in reverse registration order. +struct ServiceModule { + const char* id = nullptr; + uint16_t majorVersion = 0; + uint16_t minorVersion = 0; + const void* service = nullptr; + + // One-time setup, at registration (ModLoader::init_services). + void (*initialize)() = nullptr; + // A mod is going away (deactivation or failed activation): drop all state held for it. + // Runs after the mod's mod_shutdown and before its library unloads, so pointers into + // the mod are still valid but must not be called. + void (*modDetached)(LoadedMod& mod) = nullptr; + // A batch of (de)activations finished applying: startup, and runtime enable/disable/ + // reload requests. The set of active mods is stable when this runs. + void (*lifecycleApplied)() = nullptr; + // Top of ModLoader::tick, before pending lifecycle requests apply. + void (*frameBegin)() = nullptr; + // End of ModLoader::tick, after every mod_update. + void (*frameEnd)() = nullptr; + // ModLoader::shutdown, after every mod has deactivated. + void (*shutdown)() = nullptr; +}; + +bool valid_service_id(const char* serviceId); +ModResult register_service(const char* serviceId, uint16_t majorVersion, uint16_t minorVersion, + const void* service, LoadedMod* provider, bool deferred); +ModResult publish_deferred_service( + LoadedMod& provider, const char* serviceId, uint16_t majorVersion, const void* service); +void remove_services_for_provider(const LoadedMod& provider); +const ServiceRecord* find_service( + const char* serviceId, uint16_t majorVersion, uint16_t minMinorVersion); +// Unlike find_service, also returns deferred records that have not been published yet. +const ServiceRecord* find_service_record(const char* serviceId, uint16_t majorVersion); + +ModResult register_module(const ServiceModule& module); +void modules_mod_detached(LoadedMod& mod); +void modules_lifecycle_applied(); +void modules_frame_begin(); +void modules_frame_end(); +void modules_shutdown(); + +extern const ServiceModule g_hostModule; +extern const ServiceModule g_logModule; +extern const ServiceModule g_resourceModule; +extern const ServiceModule g_hookModule; +extern const ServiceModule g_overlayModule; +extern const ServiceModule g_textureModule; +extern const ServiceModule g_configModule; +extern const ServiceModule g_uiModule; +extern const ServiceModule g_gameModule; +extern const ServiceModule g_cameraModule; +extern const ServiceModule g_gfxModule; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/resource.cpp b/src/dusk/mods/svc/resource.cpp new file mode 100644 index 0000000000..b03934560f --- /dev/null +++ b/src/dusk/mods/svc/resource.cpp @@ -0,0 +1,110 @@ +#include "registry.hpp" + +#include "aurora/lib/logging.hpp" +#include "dusk/mods/loader/loader.hpp" +#include "mods/svc/resource.h" + +#include + +#include +#include +#include +#include + +namespace dusk::mods::svc { +namespace { + +aurora::Module Log("dusk::mods::resource"); + +// Allocations by owning mod, so buffers still live when a mod detaches can be freed. +std::unordered_map s_buffers; + +void resource_remove_mod(LoadedMod& mod) { + size_t reclaimed = 0; + std::erase_if(s_buffers, [&](const auto& entry) { + if (entry.second != &mod) { + return false; + } + std::free(entry.first); + ++reclaimed; + return true; + }); + if (reclaimed != 0) { + Log.warn("[{}] reclaimed {} resource buffer(s) that were never freed", mod.metadata.id, + reclaimed); + } +} + +ModResult resource_load(ModContext* context, const char* relativePath, ResourceBuffer* outBuffer) { + if (outBuffer == nullptr || outBuffer->struct_size < sizeof(ResourceBuffer)) { + return MOD_INVALID_ARGUMENT; + } + outBuffer->data = nullptr; + outBuffer->size = 0; + auto* mod = mod_from_context(context); + if (mod == nullptr || relativePath == nullptr || !is_safe_resource_path(relativePath)) { + return MOD_INVALID_ARGUMENT; + } + + const auto entry = fmt::format("res/{}", relativePath); + std::vector data; + try { + data = mod->bundle->readFile(entry); + } catch (const std::runtime_error& e) { + Log.error("[{}] resource load '{}' failed: {}", mod->metadata.id, entry, e.what()); + return MOD_UNAVAILABLE; + } + + if (!data.empty()) { + void* copy = std::malloc(data.size()); + if (copy == nullptr) { + return MOD_ERROR; + } + std::memcpy(copy, data.data(), data.size()); + s_buffers.emplace(copy, mod); + outBuffer->data = copy; + outBuffer->size = data.size(); + } + return MOD_OK; +} + +void resource_free(ModContext* context, ResourceBuffer* buffer) { + if (buffer == nullptr || buffer->struct_size < sizeof(ResourceBuffer) || + buffer->data == nullptr) + { + return; + } + auto* mod = mod_from_context(context); + const auto it = s_buffers.find(buffer->data); + if (it == s_buffers.end()) { + Log.error("[{}] resource free: not a live loaded buffer", mod_id_from_context(context)); + return; + } + if (mod == nullptr || it->second != mod) { + Log.error("[{}] resource free: buffer is owned by '{}'", mod_id_from_context(context), + it->second != nullptr ? it->second->metadata.id : "unknown"); + return; + } + s_buffers.erase(it); + std::free(buffer->data); + buffer->data = nullptr; + buffer->size = 0; +} + +constexpr ResourceService s_resourceService{ + .header = SERVICE_HEADER(ResourceService, RESOURCE_SERVICE_MAJOR, RESOURCE_SERVICE_MINOR), + .load = resource_load, + .free = resource_free, +}; + +} // namespace + +constinit const ServiceModule g_resourceModule{ + .id = RESOURCE_SERVICE_ID, + .majorVersion = RESOURCE_SERVICE_MAJOR, + .minorVersion = RESOURCE_SERVICE_MINOR, + .service = &s_resourceService, + .modDetached = resource_remove_mod, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/slot_map.hpp b/src/dusk/mods/svc/slot_map.hpp new file mode 100644 index 0000000000..3e45635d79 --- /dev/null +++ b/src/dusk/mods/svc/slot_map.hpp @@ -0,0 +1,188 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace dusk::mods { + +struct LoadedMod; + +namespace svc { + +template +class SlotMap { +public: + static_assert(std::is_nothrow_move_constructible_v); + + using Handle = uint64_t; + static constexpr Handle InvalidHandle = 0; + + struct Entry { + LoadedMod* owner = nullptr; + T value; + }; + + template + Handle emplace(LoadedMod& owner, Args&&... args) { + T value{std::forward(args)...}; + const auto index = allocate_index(); + auto& slot = m_slots[index]; + slot.entry.emplace(Entry{.owner = &owner, .value = std::move(value)}); + return make_handle(index, slot.generation); + } + + // Returned pointers remain valid only until the next mutating operation. + Entry* find(Handle handle) { + auto* slot = find_slot(handle); + return slot != nullptr ? &*slot->entry : nullptr; + } + + const Entry* find(Handle handle) const { + const auto* slot = find_slot(handle); + return slot != nullptr ? &*slot->entry : nullptr; + } + + Entry* find_owned(Handle handle, const LoadedMod& owner) { + auto* entry = find(handle); + return entry != nullptr && entry->owner == &owner ? entry : nullptr; + } + + const Entry* find_owned(Handle handle, const LoadedMod& owner) const { + const auto* entry = find(handle); + return entry != nullptr && entry->owner == &owner ? entry : nullptr; + } + + std::optional take(Handle handle) { + const auto index = handle_index(handle); + auto* slot = find_slot(handle); + if (slot == nullptr) { + return std::nullopt; + } + std::optional entry{std::move(slot->entry)}; + release_slot(index); + return entry; + } + + std::optional take_owned(Handle handle, const LoadedMod& owner) { + if (find_owned(handle, owner) == nullptr) { + return std::nullopt; + } + return take(handle); + } + + std::vector take_all(const LoadedMod& owner) { + std::vector entries; + for (size_t slotIndex = 0; slotIndex < m_slots.size(); ++slotIndex) { + const auto index = static_cast(slotIndex); + auto& slot = m_slots[index]; + if (!slot.entry.has_value() || slot.entry->owner != &owner) { + continue; + } + entries.push_back(std::move(*slot.entry)); + release_slot(index); + } + return entries; + } + + bool erase(Handle handle) { + const auto index = handle_index(handle); + if (find_slot(handle) == nullptr) { + return false; + } + release_slot(index); + return true; + } + + bool erase_owned(Handle handle, const LoadedMod& owner) { + if (find_owned(handle, owner) == nullptr) { + return false; + } + return erase(handle); + } + + size_t erase_all(const LoadedMod& owner) { + return take_all(owner).size(); + } + + template + void for_each(Fn&& fn) const { + // The visitor may inspect entries but must not mutate this SlotMap. + for (size_t slotIndex = 0; slotIndex < m_slots.size(); ++slotIndex) { + const auto index = static_cast(slotIndex); + const auto& slot = m_slots[index]; + if (slot.entry.has_value()) { + fn(make_handle(index, slot.generation), *slot.entry); + } + } + } + +private: + struct Slot { + uint32_t generation = 1; + std::optional entry; + }; + + static constexpr Handle make_handle(uint32_t index, uint32_t generation) { + return static_cast(generation) << 32 | index; + } + + static constexpr uint32_t handle_index(Handle handle) { + return static_cast(handle & std::numeric_limits::max()); + } + + static constexpr uint32_t handle_generation(Handle handle) { + return static_cast(handle >> 32); + } + + Slot* find_slot(Handle handle) { + return const_cast(std::as_const(*this).find_slot(handle)); + } + + const Slot* find_slot(Handle handle) const { + const auto index = handle_index(handle); + if (handle == InvalidHandle || index >= m_slots.size()) { + return nullptr; + } + const auto& slot = m_slots[index]; + if (!slot.entry.has_value() || slot.generation != handle_generation(handle)) { + return nullptr; + } + return &slot; + } + + uint32_t allocate_index() { + if (!m_freeSlots.empty()) { + const auto index = m_freeSlots.back(); + m_freeSlots.pop_back(); + return index; + } + if (m_slots.size() > std::numeric_limits::max()) { + throw std::length_error{"SlotMap handle space exhausted"}; + } + const auto index = static_cast(m_slots.size()); + m_slots.emplace_back(); + return index; + } + + void release_slot(uint32_t index) { + auto& slot = m_slots[index]; + slot.entry.reset(); + if (slot.generation == std::numeric_limits::max()) { + return; + } + ++slot.generation; + m_freeSlots.push_back(index); + } + + std::vector m_slots; + std::vector m_freeSlots; +}; + +} // namespace svc +} // namespace dusk::mods diff --git a/src/dusk/mods/svc/texture.cpp b/src/dusk/mods/svc/texture.cpp new file mode 100644 index 0000000000..63c8ba822b --- /dev/null +++ b/src/dusk/mods/svc/texture.cpp @@ -0,0 +1,463 @@ +#include "registry.hpp" + +#include "aurora/lib/logging.hpp" +#include "dusk/mods/loader/loader.hpp" +#include "mods/svc/texture.h" + +#include +#include + +#include +#include +#include +#include +#include + +using namespace std::string_literals; + +static_assert(TEXTURE_HASH_WILDCARD == aurora::texture::kWildcardTextureHash); +static_assert(TEXTURE_TLUT_WILDCARD == aurora::texture::kWildcardTlutHash); + +namespace dusk::mods::svc { +namespace { + +struct TextureRawData { + std::vector data; + uint32_t width = 0; + uint32_t height = 0; + uint32_t mipCount = 1; + uint32_t gxFormat = 0; +}; + +aurora::Module Log("dusk::mods::textures"); + +// Referenced by Aurora's lazy virtual-file reads (from arbitrary threads, under Aurora's registry +// lock) and by raw-entry spans. Immutable after construction; freed only after the corresponding +// unregister_replacement returns, at which point Aurora guarantees no further reads. +struct TextureKeepalive { + std::shared_ptr bundle; + std::string bundlePath; + std::vector ownedData; +}; + +// Called with Aurora's registry lock held: must not take any Dusk lock or re-enter +// aurora::texture. ModBundle reads are documented thread-safe. +bool texture_read_cb(void* userData, const char* path, std::vector& outBytes) { + auto* keepalive = static_cast(userData); + try { + outBytes = keepalive->bundle->readFile(path); + return true; + } catch (...) { + return false; + } +} + +struct RuntimeTextureEntry { + uint64_t handle = 0; + aurora::texture::ReplacementRegistration registration; + std::shared_ptr keepalive; + // Original inputs, kept for re-registration when the mod's priority changes. + bool isVirtual = false; + aurora::texture::ReplacementKey key; // raw entries only + uint32_t width = 0; + uint32_t height = 0; + uint32_t mipCount = 1; + uint32_t gxFormat = 0; + std::string label; +}; + +struct ModTextureRecord { + int32_t appliedPriority = 0; + bool staticRegistered = false; + aurora::texture::ReplacementGroup staticGroup; + std::vector> staticKeepalives; + std::vector runtime; +}; + +// Game thread only: all mutations happen in service calls made from mod code (init/update/hooks +// run inside ModLoader::tick), in the loader's sync/deactivate paths, or at shutdown. +std::unordered_map s_modTextures; +uint64_t s_nextTextureHandle = 1; + +// Position in m_mods (dependency-sorted load order) + 1; later-loaded mods win. The user +// texture_replacements directory uses kUserTextureReplacementPriority, below any mod. +int32_t compute_mod_priority(const LoadedMod& mod) { + int32_t index = 0; + for (const auto& other : ModLoader::instance().mods()) { + ++index; + if (&other == &mod) { + return index; + } + } + return index + 1; +} + +bool is_sidecar_mip(std::string_view stem) { + constexpr std::string_view tag = "_mip"; + size_t i = stem.size(); + while (i > 0 && stem[i - 1] >= '0' && stem[i - 1] <= '9') { + --i; + } + if (i == stem.size() || i < tag.size()) { + return false; + } + return stem.substr(i - tag.size(), tag.size()) == tag; +} + +bool has_replacement_extension(std::string_view filename) { + const auto dot = filename.rfind('.'); + if (dot == std::string_view::npos) { + return false; + } + std::string ext{filename.substr(dot)}; + std::ranges::transform(ext, ext.begin(), + [](char ch) { return ch >= 'A' && ch <= 'Z' ? static_cast(ch + 'a' - 'A') : ch; }); + return ext == ".dds" || ext == ".png"; +} + +std::string_view final_path_component(std::string_view path) { + const auto slash = path.rfind('/'); + return slash == std::string_view::npos ? path : path.substr(slash + 1); +} + +const LoadedMod* find_static_conflict( + const aurora::texture::ReplacementKey& key, const LoadedMod* exclude) { + for (const auto& [mod, record] : s_modTextures) { + if (mod == exclude) { + continue; + } + for (const auto& registration : record.staticGroup.registrations) { + if (registration.key == key) { + return mod; + } + } + } + return nullptr; +} + +void register_static_textures(LoadedMod& mod, ModTextureRecord& record) { + std::vector candidates; + for (const auto& file : mod.bundle->getFileNames()) { + if (!file.starts_with("textures/") || !has_replacement_extension(file)) { + continue; + } + auto filename = final_path_component(file); + if (is_sidecar_mip(filename.substr(0, filename.rfind('.')))) { + continue; + } + candidates.push_back(file); + } + // Deterministic order; with the first parse of a key winning, this mirrors Aurora's + // load_replacement_directory dedupe semantics. + std::ranges::sort(candidates); + + std::vector seenKeys; + for (const auto& path : candidates) { + const auto parsed = aurora::texture::parse_replacement_filename(final_path_component(path)); + if (!parsed.has_value()) { + Log.warn( + "[{}] '{}' does not follow the texture replacement naming convention; skipped.", + mod.metadata.id, path); + continue; + } + const aurora::texture::ReplacementKey key{*parsed}; + if (std::ranges::find(seenKeys, key) != seenKeys.end()) { + continue; + } + seenKeys.push_back(key); + + if (const auto* other = find_static_conflict(key, &mod); other != nullptr) { + const auto& winner = + s_modTextures.find(other)->second.appliedPriority > record.appliedPriority ? + *other : + mod; + Log.warn( + "Texture replacement conflict: '{}' is replaced by both '{}' and '{}'; '{}' wins.", + path, other->metadata.id, mod.metadata.id, winner.metadata.id); + } + + auto keepalive = std::make_shared(mod.bundle, path); + const auto registration = aurora::texture::register_virtual_replacement(path, + {.read = texture_read_cb, .userData = keepalive.get()}, + {.priority = record.appliedPriority}); + if (registration.id == 0) { + continue; + } + record.staticGroup.registrations.push_back(registration); + record.staticKeepalives.push_back(std::move(keepalive)); + } + + record.staticRegistered = true; + if (!record.staticGroup.registrations.empty()) { + Log.info("[{}] registered {} texture replacement(s).", mod.metadata.id, + record.staticGroup.registrations.size()); + } +} + +void register_runtime_entry(RuntimeTextureEntry& entry, int32_t priority) { + if (entry.isVirtual) { + entry.registration = aurora::texture::register_virtual_replacement( + entry.keepalive->bundlePath, + {.read = texture_read_cb, .userData = entry.keepalive.get()}, {.priority = priority}); + } else { + entry.registration = aurora::texture::register_replacement(entry.key, + { + .bytes = {entry.keepalive->ownedData.data(), entry.keepalive->ownedData.size()}, + .width = entry.width, + .height = entry.height, + .mipCount = entry.mipCount, + .gxFormat = entry.gxFormat, + .label = entry.label, + }, + {.priority = priority}); + } +} + +void unregister_record(ModTextureRecord& record) { + aurora::texture::unregister_replacements(record.staticGroup); + record.staticGroup.registrations.clear(); + record.staticKeepalives.clear(); + record.staticRegistered = false; + for (auto& entry : record.runtime) { + aurora::texture::unregister_replacement(entry.registration); + entry.registration = {}; + } +} + +void textures_sync_replacements() { + // Module detach removes records eagerly, but a record whose mod is no + // longer active must not linger with stale priority. + std::erase_if(s_modTextures, [&](auto& item) { + if (item.first->active) { + return false; + } + unregister_record(item.second); + return true; + }); + + for (auto& mod : ModLoader::instance().active_mods()) { + const auto priority = compute_mod_priority(mod); + auto& record = s_modTextures[&mod]; + + if (record.staticRegistered && record.appliedPriority == priority) { + continue; + } + + if (record.staticRegistered) { + // A reload re-sorted m_mods and changed this mod's priority: re-register everything + // at the new priority. Cheap, since file-backed entries decode lazily. + aurora::texture::unregister_replacements(record.staticGroup); + record.staticGroup.registrations.clear(); + record.staticKeepalives.clear(); + record.appliedPriority = priority; + register_static_textures(mod, record); + for (auto& entry : record.runtime) { + aurora::texture::unregister_replacement(entry.registration); + register_runtime_entry(entry, priority); + } + } else { + record.appliedPriority = priority; + register_static_textures(mod, record); + } + } +} + +uint64_t texture_register_raw( + LoadedMod& mod, const aurora::texture::ReplacementKey& key, TextureRawData data) { + auto& record = s_modTextures[&mod]; + if (record.appliedPriority == 0) { + record.appliedPriority = compute_mod_priority(mod); + } + + auto& entry = record.runtime.emplace_back(); + entry.handle = s_nextTextureHandle++; + entry.keepalive = std::make_shared(); + entry.keepalive->ownedData = std::move(data.data); + entry.isVirtual = false; + entry.key = key; + entry.width = data.width; + entry.height = data.height; + entry.mipCount = data.mipCount; + entry.gxFormat = data.gxFormat; + entry.label = fmt::format("mod {} texture {}", mod.metadata.id, entry.handle); + register_runtime_entry(entry, record.appliedPriority); + if (entry.registration.id == 0) { + Log.error("[{}] texture register_data failed: replacement was rejected", mod.metadata.id); + record.runtime.pop_back(); + return 0; + } + return entry.handle; +} + +uint64_t texture_register_file(LoadedMod& mod, std::string bundlePath) { + auto& record = s_modTextures[&mod]; + if (record.appliedPriority == 0) { + record.appliedPriority = compute_mod_priority(mod); + } + + auto& entry = record.runtime.emplace_back(); + entry.handle = s_nextTextureHandle++; + entry.keepalive = std::make_shared(mod.bundle, std::move(bundlePath)); + entry.isVirtual = true; + register_runtime_entry(entry, record.appliedPriority); + if (entry.registration.id == 0) { + record.runtime.pop_back(); + return 0; + } + return entry.handle; +} + +bool texture_unregister(LoadedMod& mod, uint64_t handle) { + const auto it = s_modTextures.find(&mod); + if (it == s_modTextures.end()) { + return false; + } + auto& runtime = it->second.runtime; + const auto entry = + std::ranges::find_if(runtime, [&](const auto& e) { return e.handle == handle; }); + if (entry == runtime.end()) { + return false; + } + aurora::texture::unregister_replacement(entry->registration); + runtime.erase(entry); + return true; +} + +void textures_remove_mod(LoadedMod& mod) { + const auto it = s_modTextures.find(&mod); + if (it == s_modTextures.end()) { + return; + } + unregister_record(it->second); + s_modTextures.erase(it); +} + +std::optional translate_key(const TextureKey* key) { + if (key == nullptr || key->struct_size < sizeof(TextureKey)) { + return std::nullopt; + } + switch (key->kind) { + case TEXTURE_KEY_POINTER: + if (key->pointer == nullptr) { + return std::nullopt; + } + return aurora::texture::ReplacementKey{aurora::texture::TexturePointerKey{key->pointer}}; + case TEXTURE_KEY_SOURCE: + if (key->width == 0 || key->height == 0) { + return std::nullopt; + } + return aurora::texture::ReplacementKey{aurora::texture::TextureSourceKey{ + .textureHash = key->texture_hash, + .tlutHash = key->tlut_hash, + .width = key->width, + .height = key->height, + .format = key->gx_format, + .hasTlut = key->has_tlut, + }}; + default: + return std::nullopt; + } +} + +ModResult texture_register_data(ModContext* context, const TextureKey* key, const TextureData* data, + TextureReplacementHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + const auto translatedKey = translate_key(key); + if (mod == nullptr || !translatedKey.has_value() || data == nullptr || + data->struct_size < sizeof(TextureData) || data->data == nullptr || data->size == 0 || + data->width == 0 || data->height == 0 || data->mip_count == 0) + { + return MOD_INVALID_ARGUMENT; + } + + const auto* bytes = static_cast(data->data); + const auto handle = texture_register_raw(*mod, *translatedKey, + { + .data = std::vector{bytes, bytes + data->size}, + .width = data->width, + .height = data->height, + .mipCount = data->mip_count, + .gxFormat = data->gx_format, + }); + if (handle == 0) { + return MOD_INVALID_ARGUMENT; + } + if (outHandle != nullptr) { + *outHandle = handle; + } + return MOD_OK; +} + +ModResult texture_register_file( + ModContext* context, const char* bundlePath, TextureReplacementHandle* outHandle) { + if (outHandle != nullptr) { + *outHandle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || bundlePath == nullptr || !is_safe_resource_path(bundlePath)) { + return MOD_INVALID_ARGUMENT; + } + + const std::string_view path{bundlePath}; + const auto slash = path.rfind('/'); + const auto filename = slash == std::string_view::npos ? path : path.substr(slash + 1); + if (!aurora::texture::parse_replacement_filename(filename).has_value()) { + Log.error("[{}] texture register_file '{}' failed: " + "filename does not follow the replacement naming convention", + mod->metadata.id, bundlePath); + return MOD_INVALID_ARGUMENT; + } + + try { + mod->bundle->getFileSize(bundlePath); + } catch (const std::exception& e) { + Log.error( + "[{}] texture register_file '{}' failed: {}", mod->metadata.id, bundlePath, e.what()); + return MOD_UNAVAILABLE; + } + + const auto handle = texture_register_file(*mod, bundlePath); + if (handle == 0) { + return MOD_INVALID_ARGUMENT; + } + if (outHandle != nullptr) { + *outHandle = handle; + } + return MOD_OK; +} + +ModResult texture_unregister(ModContext* context, TextureReplacementHandle handle) { + auto* mod = mod_from_context(context); + if (mod == nullptr || handle == 0) { + return MOD_INVALID_ARGUMENT; + } + if (!texture_unregister(*mod, handle)) { + Log.error( + "[{}] texture unregister failed: unknown handle {}", mod->metadata.id, handle); + return MOD_INVALID_ARGUMENT; + } + return MOD_OK; +} + +constexpr TextureService s_textureService{ + .header = SERVICE_HEADER(TextureService, TEXTURE_SERVICE_MAJOR, TEXTURE_SERVICE_MINOR), + .register_data = texture_register_data, + .register_file = texture_register_file, + .unregister = texture_unregister, +}; + +} // namespace + +constinit const ServiceModule g_textureModule{ + .id = TEXTURE_SERVICE_ID, + .majorVersion = TEXTURE_SERVICE_MAJOR, + .minorVersion = TEXTURE_SERVICE_MINOR, + .service = &s_textureService, + .modDetached = textures_remove_mod, + .lifecycleApplied = textures_sync_replacements, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/ui.cpp b/src/dusk/mods/svc/ui.cpp new file mode 100644 index 0000000000..cf4ea86808 --- /dev/null +++ b/src/dusk/mods/svc/ui.cpp @@ -0,0 +1,1399 @@ +#include "ui.hpp" + +#include "config.hpp" +#include "registry.hpp" +#include "slot_map.hpp" + +#include "aurora/lib/logging.hpp" +#include "dusk/mod_loader.hpp" +#include "dusk/mods/loader/loader.hpp" +#include "dusk/ui/menu_bar.hpp" +#include "dusk/ui/mod_window.hpp" +#include "dusk/ui/modal.hpp" +#include "dusk/ui/ui.hpp" +#include "mods/svc/ui.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace dusk::mods::svc::ui_impl { +namespace { + +aurora::Module Log("dusk::mods::ui"); + +enum class UiSlotKind : u8 { + Window, + Dialog, + Pane, + Text, + Progress, + Control, + Style, + MenuTab, +}; + +const char* slot_kind_name(UiSlotKind kind) { + switch (kind) { + case UiSlotKind::Window: + return "window"; + case UiSlotKind::Dialog: + return "dialog"; + case UiSlotKind::Pane: + return "pane"; + case UiSlotKind::Text: + return "text"; + case UiSlotKind::Progress: + return "progress"; + case UiSlotKind::Control: + return "control"; + case UiSlotKind::Style: + return "style"; + case UiSlotKind::MenuTab: + return "menu tab"; + default: + return "unknown"; + } +} + +// Game thread only: all mutations happen in service calls made from mod code, in UI callbacks +// (ui::update), or in the loader's deactivate paths. +struct UiSlot { + UiSlotKind kind = UiSlotKind::Window; + // Pane/Text/Progress/Control: freed automatically when the element is destroyed + Rml::Element* element = nullptr; + // Pane payload + ui::Pane* pane = nullptr; + ui::Pane* helpPane = nullptr; + // Window/Dialog payload (non-owning; the document stack owns the document) + ui::Document* document = nullptr; + UiWindowClosedFn onClosed = nullptr; + void* onClosedUserData = nullptr; + // Style payload + ui::DocumentScope styleScope = ui::DocumentScope::None; + std::string styleId; + // Cached rendered values for element setters. These make the natural "set every update" + // style cheap when the displayed value has not changed. + std::string elementRml; + float elementFloat = 0.0f; + bool hasElementValue = false; +}; + +SlotMap s_slots; + +struct ModUiPanel { + UiPanelBuildFn build = nullptr; + UiPanelUpdateFn update = nullptr; + void* userData = nullptr; +}; +std::unordered_map s_modPanels; + +struct ModMenuTab { + uint64_t handle = 0; + std::string label; + UiPressedFn onSelected = nullptr; + void* userData = nullptr; +}; +std::unordered_map> s_modMenuTabs; +bool s_menuTabsDirty = false; + +UiSlot* slot_from_handle(uint64_t handle) { + auto* entry = s_slots.find(handle); + return entry != nullptr ? &entry->value : nullptr; +} + +// Note: s_slots may reallocate on any later allocation, so callers must not hold the returned +// slot reference across calls that can allocate (e.g. mod build callbacks); re-resolve instead. +UiSlot& alloc_slot(LoadedMod& mod, UiSlotKind kind, uint64_t& outHandle) { + outHandle = s_slots.emplace(mod, UiSlot{.kind = kind}); + return s_slots.find(outHandle)->value; +} + +UiSlot* resolve(LoadedMod& mod, uint64_t handle, UiSlotKind kind, const char* what) { + auto* entry = s_slots.find_owned(handle, mod); + if (entry == nullptr || entry->value.kind != kind) { + Log.error("[{}] {}: stale or invalid {} handle {:#x}", mod.metadata.id, what, + slot_kind_name(kind), handle); + return nullptr; + } + return &entry->value; +} + +// Whether the registration a callback was created under is still live. Callbacks captured by +// host-owned UI must check this before calling into the mod: `mod->active` alone is true again +// once a reload completes, but captured fn pointers still target the unloaded image. Teardown +// frees the slots (ui_remove_mod), which invalidates every callback built under them. +bool slot_live(uint64_t handle) { + return s_slots.find(handle) != nullptr; +} + +bool dialog_open(uint64_t handle) { + auto* slot = slot_from_handle(handle); + return slot != nullptr && slot->kind == UiSlotKind::Dialog && slot->document != nullptr && + slot->document->active(); +} + +// Frees the slot when the tracked element is destroyed (tab rebuilds, window teardown, ...). +// The generation check makes a late detach of an already-recycled slot a no-op. +class SlotDetachListener final : public Rml::EventListener { +public: + explicit SlotDetachListener(uint64_t handle) : m_handle{handle} {} + + void ProcessEvent(Rml::Event&) override {} + + void OnDetach(Rml::Element*) override { + s_slots.erase(m_handle); + delete this; + } + +private: + uint64_t m_handle; +}; + +void track_element(uint64_t handle, UiSlot& slot, Rml::Element& element) { + slot.element = &element; + element.AddEventListener(Rml::EventId::Click, new SlotDetachListener{handle}); +} + +template +T guarded_call(LoadedMod& mod, const char* what, T fallback, Fn&& fn) { + if (!mod.active) { + return fallback; + } + try { + return fn(); + } catch (const std::exception& e) { + fail_mod(mod, MOD_ERROR, fmt::format("exception in {}: {}", what, e.what())); + } catch (...) { + fail_mod(mod, MOD_ERROR, fmt::format("unknown exception in {}", what)); + } + return fallback; +} + +template +void guarded_call(LoadedMod& mod, const char* what, Fn&& fn) { + if (!mod.active) { + return; + } + try { + fn(); + } catch (const std::exception& e) { + fail_mod(mod, MOD_ERROR, fmt::format("exception in {}: {}", what, e.what())); + } catch (...) { + fail_mod(mod, MOD_ERROR, fmt::format("unknown exception in {}", what)); + } +} + +// Shared by panel/tab build and update callbacks: translates a non-OK result or an escaped +// exception into fail_mod, mirroring mod_update handling. +template +void invoke_mod_ui_callback(LoadedMod& mod, const char* what, Fn&& fn) { + ModError error = MOD_ERROR_INIT; + const ModResult result = guarded_call(mod, what, MOD_OK, [&] { return fn(&error); }); + if (result != MOD_OK && mod.active) { + fail_mod( + mod, result, error.message[0] != '\0' ? error.message : fmt::format("{} failed", what)); + } +} + +uint64_t wrap_pane(LoadedMod& mod, ui::Pane& pane, ui::Pane* helpPane) { + uint64_t handle = 0; + auto& slot = alloc_slot(mod, UiSlotKind::Pane, handle); + slot.pane = &pane; + slot.helpPane = helpPane; + track_element(handle, slot, *pane.root()); + return handle; +} + +int clamp_to_int(int64_t value) { + return static_cast(std::clamp(value, INT_MIN, INT_MAX)); +} + +std::function wrap_predicate( + LoadedMod& mod, UiPredicateFn fn, void* userData, uint64_t guardHandle) { + if (fn == nullptr) { + return {}; + } + return [modPtr = &mod, fn, userData, guardHandle] { + if (!slot_live(guardHandle)) { + return false; + } + return guarded_call(*modPtr, "control predicate", false, + [&] { return fn(modPtr->context.get(), userData); }); + }; +} + +void wire_callback_binding( + LoadedMod& mod, const UiControlDesc& desc, ui::ModControlSpec& spec, uint64_t guardHandle) { + auto* modPtr = &mod; + const auto get = desc.get; + const auto set = desc.set; + auto* userData = desc.user_data; + const auto getValue = [modPtr, get, userData, guardHandle] { + UiControlValue value = UI_CONTROL_VALUE_INIT; + if (!slot_live(guardHandle)) { + return value; + } + guarded_call(*modPtr, "control getter", [&] { + get(modPtr->context.get(), userData, &value); + }); + return value; + }; + const auto setValue = [modPtr, set, userData, guardHandle](const UiControlValue& value) { + if (!slot_live(guardHandle)) { + return; + } + guarded_call(*modPtr, "control setter", [&] { + set(modPtr->context.get(), userData, &value); + }); + }; + switch (desc.kind) { + case UI_CONTROL_TOGGLE: + spec.getBool = [getValue] { return getValue().bool_value; }; + spec.setBool = [setValue](bool value) { + UiControlValue raw = UI_CONTROL_VALUE_INIT; + raw.bool_value = value; + setValue(raw); + }; + break; + case UI_CONTROL_NUMBER: + case UI_CONTROL_SELECT: + spec.getInt = [getValue] { return clamp_to_int(getValue().int_value); }; + spec.setInt = [setValue](int value) { + UiControlValue raw = UI_CONTROL_VALUE_INIT; + raw.int_value = value; + setValue(raw); + }; + break; + case UI_CONTROL_STRING: + spec.getString = [getValue]() -> Rml::String { + const UiControlValue value = getValue(); + return value.string_value != nullptr ? value.string_value : ""; + }; + spec.setString = [setValue](Rml::String value) { + UiControlValue raw = UI_CONTROL_VALUE_INIT; + raw.string_value = value.c_str(); + setValue(raw); + }; + break; + default: + break; + } +} + +// The lambdas re-resolve the var on every call, so a control whose var was unregistered +// mid-flight degrades to a no-op instead of a dangling read. +bool wire_config_var_binding(LoadedMod& mod, const UiControlDesc& desc, ui::ModControlSpec& spec) { + auto* modPtr = &mod; + const uint64_t varHandle = desc.config_var; + switch (desc.kind) { + case UI_CONTROL_TOGGLE: { + const auto find = [modPtr, varHandle] { + return static_cast*>( + config_find_var(*modPtr, varHandle, CONFIG_VAR_BOOL)); + }; + if (find() == nullptr) { + return false; + } + spec.getBool = [find] { + const auto* var = find(); + return var != nullptr && var->getValue(); + }; + spec.setBool = [find](bool value) { + auto* var = find(); + if (var == nullptr || var->getValue() == value) { + return; + } + var->setValue(value); + config_mark_dirty(); + }; + if (!spec.isModified) { + spec.isModified = [find] { + const auto* var = find(); + return var != nullptr && var->getValue() != var->getDefaultValue(); + }; + } + return true; + } + case UI_CONTROL_NUMBER: + case UI_CONTROL_SELECT: { + const auto find = [modPtr, varHandle] { + return static_cast*>( + config_find_var(*modPtr, varHandle, CONFIG_VAR_INT)); + }; + if (find() == nullptr) { + return false; + } + spec.getInt = [find] { + const auto* var = find(); + return var != nullptr ? clamp_to_int(var->getValue()) : 0; + }; + spec.setInt = [find](int value) { + auto* var = find(); + if (var == nullptr || var->getValue() == value) { + return; + } + var->setValue(value); + config_mark_dirty(); + }; + if (!spec.isModified) { + spec.isModified = [find] { + const auto* var = find(); + return var != nullptr && var->getValue() != var->getDefaultValue(); + }; + } + return true; + } + case UI_CONTROL_STRING: { + const auto find = [modPtr, varHandle] { + return static_cast*>( + config_find_var(*modPtr, varHandle, CONFIG_VAR_STRING)); + }; + if (find() == nullptr) { + return false; + } + spec.getString = [find]() -> Rml::String { + const auto* var = find(); + return var != nullptr ? var->getValue() : ""; + }; + spec.setString = [find](Rml::String value) { + auto* var = find(); + if (var == nullptr || var->getValue() == value) { + return; + } + var->setValue(std::move(value)); + config_mark_dirty(); + }; + if (!spec.isModified) { + spec.isModified = [find] { + const auto* var = find(); + return var != nullptr && var->getValue() != var->getDefaultValue(); + }; + } + return true; + } + default: + return false; + } +} + +void on_mod_window_destroyed(uint64_t handle) { + const auto* entry = s_slots.find(handle); + if (entry == nullptr || entry->value.kind != UiSlotKind::Window) { + return; + } + auto released = s_slots.take(handle); + auto* mod = released->owner; + const UiWindowClosedFn onClosed = released->value.onClosed; + void* userData = released->value.onClosedUserData; + if (mod != nullptr && onClosed != nullptr) { + guarded_call(*mod, "window on_closed callback", [&] { + onClosed(mod->context.get(), handle, userData); + }); + } +} + +void on_mod_dialog_destroyed(uint64_t handle) { + auto* slot = slot_from_handle(handle); + if (slot != nullptr && slot->kind == UiSlotKind::Dialog) { + s_slots.erase(handle); + } +} + +class ModDialog final : public ui::Modal { +public: + ModDialog(Props props, std::function onDestroyed) + : Modal{std::move(props)}, m_onDestroyed{std::move(onDestroyed)} {} + + ~ModDialog() override { + if (m_onDestroyed) { + m_onDestroyed(); + } + } + + void close() { pop(); } + void force_close() { Document::hide(true); } + +private: + std::function m_onDestroyed; +}; + +void push_stacked_document(std::unique_ptr document) { + if (auto* previousTop = ui::top_document()) { + previousTop->push(std::move(document)); + } else { + ui::push_document(std::move(document)); + } +} + +// Shared by dialog_push and dialog_add_action; the guard handle keeps a +// pressed callback from calling into a torn-down mod. +ui::ModalAction make_dialog_action(LoadedMod& mod, uint64_t handle, const UiDialogAction& action) { + return { + .label = action.label, + .onPressed = + [modPtr = &mod, handle, fn = action.on_pressed, userData = action.user_data, + keepOpen = action.keep_open != 0](ui::Modal& modal) { + if (!dialog_open(handle)) { + return; // already being torn down + } + if (fn != nullptr) { + guarded_call(*modPtr, "dialog action callback", [&] { + fn(modPtr->context.get(), handle, userData); + }); + } + // The callback may have closed the dialog already + if (!keepOpen && dialog_open(handle)) { + static_cast(modal).close(); + } + }, + }; +} + +} // namespace + +ModResult ui_register_mods_panel(LoadedMod& mod, const UiModsPanelDesc& desc) { + s_modPanels[&mod] = {desc.build, desc.update, desc.user_data}; + return MOD_OK; +} + +void ui_build_mods_panels(LoadedMod& mod, ui::Pane& pane) { + const auto it = s_modPanels.find(&mod); + if (it == s_modPanels.end()) { + return; + } + const uint64_t paneHandle = wrap_pane(mod, pane, nullptr); + const auto& panel = it->second; + if (!mod.active || panel.build == nullptr) { + return; + } + invoke_mod_ui_callback(mod, "mod UI panel build", [&](ModError* error) { + return panel.build(mod.context.get(), paneHandle, panel.userData, error); + }); +} + +void ui_update_mods_panels(LoadedMod& mod) { + const auto it = s_modPanels.find(&mod); + if (it == s_modPanels.end()) { + return; + } + const auto& panel = it->second; + if (!mod.active || panel.update == nullptr) { + return; + } + invoke_mod_ui_callback(mod, "mod UI panel update", [&](ModError* error) { + return panel.update(mod.context.get(), panel.userData, error); + }); +} + +ModResult ui_pane_add_section(LoadedMod& mod, uint64_t pane, const char* title) { + auto* slot = resolve(mod, pane, UiSlotKind::Pane, "pane_add_section"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + slot->pane->add_section(title); + return MOD_OK; +} + +ModResult ui_pane_add_text(LoadedMod& mod, uint64_t pane, const char* text, uint64_t* outElem) { + auto* slot = resolve(mod, pane, UiSlotKind::Pane, "pane_add_text"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auto* elem = slot->pane->add_text(text); + if (outElem != nullptr) { + auto& elemSlot = alloc_slot(mod, UiSlotKind::Text, *outElem); + elemSlot.elementRml = ui::escape(text); + elemSlot.hasElementValue = true; + track_element(*outElem, elemSlot, *elem); + } + return MOD_OK; +} + +ModResult ui_pane_add_rml(LoadedMod& mod, uint64_t pane, const char* rml, uint64_t* outElem) { + auto* slot = resolve(mod, pane, UiSlotKind::Pane, "pane_add_rml"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auto* elem = slot->pane->add_rml(rml); + if (outElem != nullptr) { + auto& elemSlot = alloc_slot(mod, UiSlotKind::Text, *outElem); + elemSlot.elementRml = rml; + elemSlot.hasElementValue = true; + track_element(*outElem, elemSlot, *elem); + } + return MOD_OK; +} + +ModResult ui_pane_add_progress(LoadedMod& mod, uint64_t pane, float value, uint64_t* outElem) { + auto* slot = resolve(mod, pane, UiSlotKind::Pane, "pane_add_progress"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auto* elem = ui::append(slot->element, "progress"); + elem->SetAttribute("value", value); + if (outElem != nullptr) { + auto& elemSlot = alloc_slot(mod, UiSlotKind::Progress, *outElem); + elemSlot.elementFloat = value; + elemSlot.hasElementValue = true; + track_element(*outElem, elemSlot, *elem); + } + return MOD_OK; +} + +ModResult ui_pane_add_control( + LoadedMod& mod, uint64_t pane, const UiControlDesc& desc, uint64_t* outElem) { + auto* slot = resolve(mod, pane, UiSlotKind::Pane, "pane_add_control"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + + ui::ModControlSpec spec; + spec.label = desc.label; + spec.helpRml = desc.help_rml != nullptr ? desc.help_rml : ""; + spec.isDisabled = wrap_predicate(mod, desc.is_disabled, desc.user_data, pane); + spec.isModified = wrap_predicate(mod, desc.is_modified, desc.user_data, pane); + switch (desc.kind) { + case UI_CONTROL_BUTTON: + spec.kind = ui::ModControlSpec::Kind::Button; + spec.onPressed = [modPtr = &mod, fn = desc.on_pressed, userData = desc.user_data, + guardHandle = pane] { + if (!slot_live(guardHandle)) { + return; + } + guarded_call(*modPtr, "control on_pressed callback", [&] { + fn(modPtr->context.get(), userData); + }); + }; + break; + case UI_CONTROL_TOGGLE: + spec.kind = ui::ModControlSpec::Kind::Toggle; + break; + case UI_CONTROL_NUMBER: + spec.kind = ui::ModControlSpec::Kind::Number; + if (desc.min != desc.max) { + spec.min = clamp_to_int(desc.min); + spec.max = clamp_to_int(desc.max); + if (spec.max < spec.min) { + std::swap(spec.min, spec.max); + } + } + spec.step = desc.step < 1 ? 1 : clamp_to_int(desc.step); + spec.prefix = desc.prefix != nullptr ? desc.prefix : ""; + spec.suffix = desc.suffix != nullptr ? desc.suffix : ""; + break; + case UI_CONTROL_STRING: + spec.kind = ui::ModControlSpec::Kind::String; + spec.maxLength = desc.max_length < 1 ? -1 : desc.max_length; + break; + case UI_CONTROL_SELECT: + spec.kind = ui::ModControlSpec::Kind::Select; + if (slot->helpPane == nullptr) { + Log.error("[{}] pane_add_control: SELECT controls need a help pane (mod window tabs)", + mod.metadata.id); + return MOD_UNSUPPORTED; + } + for (size_t i = 0; i < desc.option_count; ++i) { + spec.options.emplace_back(desc.options[i]); + } + break; + default: + return MOD_INVALID_ARGUMENT; + } + + if (desc.kind != UI_CONTROL_BUTTON) { + if (desc.binding == UI_BINDING_CONFIG_VAR) { + if (!wire_config_var_binding(mod, desc, spec)) { + Log.error("[{}] pane_add_control: config var handle {:#x} is unknown or its type " + "does not match the control kind", + mod.metadata.id, desc.config_var); + return MOD_INVALID_ARGUMENT; + } + } else { + wire_callback_binding(mod, desc, spec, pane); + } + } + + // Copy the pane pointers out: allocating the control's slot below may reallocate s_slots + auto* paneComponent = slot->pane; + auto* helpPane = slot->helpPane; + auto* control = ui::build_mod_control(*paneComponent, helpPane, std::move(spec)); + if (control == nullptr) { + return MOD_UNSUPPORTED; + } + if (outElem != nullptr) { + auto& elemSlot = alloc_slot(mod, UiSlotKind::Control, *outElem); + track_element(*outElem, elemSlot, *control->root()); + } + return MOD_OK; +} + +ModResult ui_elem_set_text(LoadedMod& mod, uint64_t elem, const char* text) { + auto* slot = resolve(mod, elem, UiSlotKind::Text, "elem_set_text"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + const std::string rml = ui::escape(text); + if (slot->hasElementValue && slot->elementRml == rml) { + return MOD_OK; + } + slot->elementRml = rml; + slot->hasElementValue = true; + slot->element->SetInnerRML(slot->elementRml); + return MOD_OK; +} + +ModResult ui_elem_set_rml(LoadedMod& mod, uint64_t elem, const char* rml) { + auto* slot = resolve(mod, elem, UiSlotKind::Text, "elem_set_rml"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + if (slot->hasElementValue && slot->elementRml == rml) { + return MOD_OK; + } + slot->elementRml = rml; + slot->hasElementValue = true; + slot->element->SetInnerRML(rml); + return MOD_OK; +} + +ModResult ui_elem_set_progress(LoadedMod& mod, uint64_t elem, float value) { + auto* slot = resolve(mod, elem, UiSlotKind::Progress, "elem_set_progress"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + if (slot->hasElementValue && slot->elementFloat == value) { + return MOD_OK; + } + slot->elementFloat = value; + slot->hasElementValue = true; + slot->element->SetAttribute("value", value); + return MOD_OK; +} + +ModResult ui_elem_set_class(LoadedMod& mod, uint64_t elem, const char* name, bool active) { + auto* entry = s_slots.find_owned(elem, mod); + if (entry == nullptr || entry->value.element == nullptr) { + Log.error( + "[{}] elem_set_class: stale or invalid element handle {:#x}", mod.metadata.id, elem); + return MOD_INVALID_ARGUMENT; + } + entry->value.element->SetClass(name, active); + return MOD_OK; +} + +ModResult ui_window_push(LoadedMod& mod, const UiWindowDesc& desc, uint64_t& outHandle) { + outHandle = 0; + if (!aurora::rmlui::is_initialized()) { + return MOD_UNAVAILABLE; + } + if (desc.rcss != nullptr && desc.rcss[0] != '\0' && + Rml::Factory::InstanceStyleSheetString(desc.rcss) == nullptr) + { + Log.error("[{}] window_push: failed to parse window RCSS", mod.metadata.id); + return MOD_INVALID_ARGUMENT; + } + + uint64_t handle = 0; + { + auto& slot = alloc_slot(mod, UiSlotKind::Window, handle); + slot.onClosed = desc.on_closed; + slot.onClosedUserData = desc.user_data; + } + + ui::ModWindow::Desc windowDesc; + windowDesc.modId = mod.metadata.id; + windowDesc.rcss = desc.rcss != nullptr ? desc.rcss : ""; + windowDesc.onDestroyed = [handle] { on_mod_window_destroyed(handle); }; + for (size_t i = 0; i < desc.tab_count; ++i) { + const UiTabDesc& tab = desc.tabs[i]; + ui::ModWindow::Tab hostTab; + hostTab.title = tab.title; + hostTab.build = [modPtr = &mod, handle, build = tab.build, userData = tab.user_data]( + ui::ModWindow&, ui::Pane& left, ui::Pane& right) { + if (build == nullptr || !slot_live(handle) || !modPtr->active) { + return; + } + const uint64_t leftHandle = wrap_pane(*modPtr, left, &right); + const uint64_t rightHandle = wrap_pane(*modPtr, right, nullptr); + invoke_mod_ui_callback(*modPtr, "mod UI tab build", [&](ModError* error) { + return build( + modPtr->context.get(), handle, leftHandle, rightHandle, userData, error); + }); + }; + if (tab.update != nullptr) { + hostTab.update = [modPtr = &mod, handle, update = tab.update, + userData = tab.user_data] { + if (!slot_live(handle) || !modPtr->active) { + return; + } + invoke_mod_ui_callback(*modPtr, "mod UI tab update", [&](ModError* error) { + return update(modPtr->context.get(), userData, error); + }); + }; + } + windowDesc.tabs.push_back(std::move(hostTab)); + } + + // The first tab builds during construction, which can allocate slots; only + // re-resolve the window slot afterwards. + auto window = std::make_unique(std::move(windowDesc)); + if (auto* slot = slot_from_handle(handle)) { + slot->document = window.get(); + } + push_stacked_document(std::move(window)); + outHandle = handle; + return MOD_OK; +} + +ModResult ui_window_close(LoadedMod& mod, uint64_t handle) { + auto* slot = resolve(mod, handle, UiSlotKind::Window, "window_close"); + if (slot == nullptr || slot->document == nullptr) { + return MOD_INVALID_ARGUMENT; + } + slot->document->hide(true); + return MOD_OK; +} + +ModResult ui_dialog_push(LoadedMod& mod, const UiDialogDesc& desc, uint64_t& outHandle) { + outHandle = 0; + if (!aurora::rmlui::is_initialized()) { + return MOD_UNAVAILABLE; + } + uint64_t handle = 0; + alloc_slot(mod, UiSlotKind::Dialog, handle); + + const char* defaultIcon = ""; + ui::Modal::Props props; + switch (desc.variant) { + case UI_DIALOG_WARNING: + defaultIcon = "warning"; + break; + case UI_DIALOG_DANGER: + props.variant = "danger"; + defaultIcon = "error"; + break; + default: + break; + } + props.title = ui::escape(desc.title); + props.bodyRml = desc.body_rml; + props.icon = desc.icon != nullptr ? desc.icon : defaultIcon; + props.onDismiss = [modPtr = &mod, handle, fn = desc.on_dismiss, userData = desc.user_data]( + ui::Modal& modal) { + if (!dialog_open(handle)) { + return; // already being torn down + } + if (fn != nullptr) { + guarded_call(*modPtr, "dialog on_dismiss callback", [&] { + fn(modPtr->context.get(), handle, userData); + }); + } + if (dialog_open(handle)) { + static_cast(modal).close(); + } + }; + for (size_t i = 0; i < desc.action_count; ++i) { + props.actions.push_back(make_dialog_action(mod, handle, desc.actions[i])); + } + + auto dialog = + std::make_unique(std::move(props), [handle] { on_mod_dialog_destroyed(handle); }); + if (auto* slot = slot_from_handle(handle)) { + slot->document = dialog.get(); + } + push_stacked_document(std::move(dialog)); + outHandle = handle; + return MOD_OK; +} + +ModResult ui_dialog_close(LoadedMod& mod, uint64_t handle) { + auto* slot = resolve(mod, handle, UiSlotKind::Dialog, "dialog_close"); + if (slot == nullptr || slot->document == nullptr) { + return MOD_INVALID_ARGUMENT; + } + // Programmatic close: no dismiss notification, no sound + static_cast(slot->document)->close(); + return MOD_OK; +} + +ModResult ui_dialog_set_body(LoadedMod& mod, uint64_t handle, const char* rml) { + auto* slot = resolve(mod, handle, UiSlotKind::Dialog, "dialog_set_body"); + if (slot == nullptr || slot->document == nullptr) { + return MOD_INVALID_ARGUMENT; + } + static_cast(slot->document)->set_body(rml); + return MOD_OK; +} + +ModResult ui_dialog_set_icon(LoadedMod& mod, uint64_t handle, const char* icon) { + auto* slot = resolve(mod, handle, UiSlotKind::Dialog, "dialog_set_icon"); + if (slot == nullptr || slot->document == nullptr) { + return MOD_INVALID_ARGUMENT; + } + static_cast(slot->document)->set_icon(icon); + return MOD_OK; +} + +ModResult ui_dialog_add_action(LoadedMod& mod, uint64_t handle, const UiDialogAction& action) { + auto* slot = resolve(mod, handle, UiSlotKind::Dialog, "dialog_add_action"); + if (slot == nullptr || slot->document == nullptr) { + return MOD_INVALID_ARGUMENT; + } + static_cast(slot->document)->add_action(make_dialog_action(mod, handle, action)); + return MOD_OK; +} + +ModResult ui_register_menu_tab(LoadedMod& mod, const UiMenuTabDesc& desc, uint64_t& outHandle) { + outHandle = 0; + for (const auto& [owner, tabs] : s_modMenuTabs) { + for (const auto& tab : tabs) { + if (owner != &mod && tab.label == desc.label) { + Log.warn("[{}] register_menu_tab: label '{}' is already used by [{}]", + mod.metadata.id, desc.label, owner->metadata.id); + } + } + } + uint64_t handle = 0; + alloc_slot(mod, UiSlotKind::MenuTab, handle); + s_modMenuTabs[&mod].push_back({.handle = handle, + .label = desc.label, + .onSelected = desc.on_selected, + .userData = desc.user_data}); + s_menuTabsDirty = true; + outHandle = handle; + return MOD_OK; +} + +ModResult ui_unregister_menu_tab(LoadedMod& mod, uint64_t handle) { + auto* slot = resolve(mod, handle, UiSlotKind::MenuTab, "unregister_menu_tab"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + const auto it = s_modMenuTabs.find(&mod); + if (it != s_modMenuTabs.end()) { + std::erase_if(it->second, [&](const auto& tab) { return tab.handle == handle; }); + if (it->second.empty()) { + s_modMenuTabs.erase(it); + } + } + s_slots.erase_owned(handle, mod); + s_menuTabsDirty = true; + return MOD_OK; +} + +std::vector ui_mod_menu_tabs() { + // The consumer (a MenuBar being constructed) now reflects the current tab + // set, so a pending rebuild for earlier mutations is moot. + s_menuTabsDirty = false; + std::vector entries; + for (auto& mod : ModLoader::instance().mods()) { + if (!mod.active) { + continue; + } + const auto it = s_modMenuTabs.find(&mod); + if (it == s_modMenuTabs.end()) { + continue; + } + for (const auto& tab : it->second) { + entries.push_back({.label = tab.label, + .onSelected = [modPtr = &mod, handle = tab.handle, fn = tab.onSelected, + userData = tab.userData] { + if (!slot_live(handle) || !modPtr->active) { + return; // registered by a since-unloaded mod image + } + guarded_call(*modPtr, "menu tab on_selected callback", [&] { + fn(modPtr->context.get(), userData); + }); + }}); + } + } + return entries; +} + +void ui_sync_menu_tabs() { + if (!s_menuTabsDirty) { + return; + } + s_menuTabsDirty = false; + if (aurora::rmlui::is_initialized()) { + ui::MenuBar::rebuild(); + } +} + +bool ui_any_document_visible() { + return ui::any_document_visible(); +} + +ModResult ui_register_styles( + LoadedMod& mod, uint32_t scope, const char* rcss, uint64_t& outHandle) { + outHandle = 0; + ui::DocumentScope docScope; + switch (scope) { + case UI_SCOPE_PRELAUNCH: + docScope = ui::DocumentScope::Prelaunch; + break; + case UI_SCOPE_WINDOW: + docScope = ui::DocumentScope::Window; + break; + case UI_SCOPE_MENU_BAR: + docScope = ui::DocumentScope::MenuBar; + break; + case UI_SCOPE_OVERLAY: + docScope = ui::DocumentScope::Overlay; + break; + case UI_SCOPE_TOUCH_CONTROLS: + docScope = ui::DocumentScope::TouchControls; + break; + case UI_SCOPE_GRAPHICS_TUNER: + docScope = ui::DocumentScope::GraphicsTuner; + break; + default: + return MOD_INVALID_ARGUMENT; + } + + uint64_t handle = 0; + auto& slot = alloc_slot(mod, UiSlotKind::Style, handle); + slot.styleScope = docScope; + slot.styleId = fmt::format("{}:{:x}", mod.metadata.id, handle); + if (!ui::register_scoped_styles(docScope, slot.styleId, rcss)) { + Log.error("[{}] register_styles: failed to parse RCSS", mod.metadata.id); + s_slots.erase(handle); + return MOD_INVALID_ARGUMENT; + } + outHandle = handle; + return MOD_OK; +} + +ModResult ui_register_styles_file( + LoadedMod& mod, uint32_t scope, const char* path, uint64_t& outHandle) { + outHandle = 0; + if (mod.bundle == nullptr) { + return MOD_UNAVAILABLE; + } + std::vector data; + const std::string entry = std::string{"res/"} + path; + try { + data = mod.bundle->readFile(entry); + } catch (const std::runtime_error& e) { + Log.error("[{}] register_styles_file '{}' failed: {}", mod.metadata.id, entry, e.what()); + return MOD_UNAVAILABLE; + } + const std::string rcss{data.begin(), data.end()}; + return ui_register_styles(mod, scope, rcss.c_str(), outHandle); +} + +ModResult ui_unregister_styles(LoadedMod& mod, uint64_t handle) { + auto* slot = resolve(mod, handle, UiSlotKind::Style, "unregister_styles"); + if (slot == nullptr) { + return MOD_INVALID_ARGUMENT; + } + auto released = s_slots.take_owned(handle, mod); + ui::unregister_scoped_styles(released->value.styleScope, released->value.styleId); + return MOD_OK; +} + +void ui_remove_mod(LoadedMod& mod) { + s_modPanels.erase(&mod); + if (s_modMenuTabs.erase(&mod) != 0) { + s_menuTabsDirty = true; + } + auto entries = s_slots.take_all(mod); + for (auto& entry : entries) { + auto& slot = entry.value; + switch (slot.kind) { + case UiSlotKind::Window: { + auto* window = static_cast(slot.document); + if (window != nullptr) { + window->force_close(); + } + break; + } + case UiSlotKind::Dialog: { + auto* dialog = static_cast(slot.document); + if (dialog != nullptr) { + dialog->force_close(); + } + break; + } + case UiSlotKind::Style: + ui::unregister_scoped_styles(slot.styleScope, slot.styleId); + break; + default: + break; + } + } +} + +} // namespace dusk::mods::svc::ui_impl + +namespace dusk::mods::svc { +namespace { + +// Validation of the tagged control descriptor: required fields per kind/binding. Value +// translation and cvar wiring live in loader/ui.cpp. +bool valid_control_desc(const UiControlDesc& desc) { + if (desc.struct_size < sizeof(UiControlDesc) || desc.label == nullptr) { + return false; + } + switch (desc.kind) { + case UI_CONTROL_BUTTON: + return desc.on_pressed != nullptr; + case UI_CONTROL_TOGGLE: + case UI_CONTROL_NUMBER: + case UI_CONTROL_STRING: + case UI_CONTROL_SELECT: + break; + default: + return false; + } + if (desc.kind == UI_CONTROL_SELECT) { + if (desc.options == nullptr || desc.option_count == 0) { + return false; + } + for (size_t i = 0; i < desc.option_count; ++i) { + if (desc.options[i] == nullptr) { + return false; + } + } + } + switch (desc.binding) { + case UI_BINDING_CALLBACKS: + return desc.get != nullptr && desc.set != nullptr; + case UI_BINDING_CONFIG_VAR: + return desc.config_var != 0; + default: + return false; + } +} + +ModResult ui_register_mods_panel(ModContext* context, const UiModsPanelDesc* desc) { + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(UiModsPanelDesc) || + desc->build == nullptr) + { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_register_mods_panel(*mod, *desc); +} + +ModResult ui_pane_add_section(ModContext* context, UiElementHandle pane, const char* title) { + auto* mod = mod_from_context(context); + if (mod == nullptr || pane == 0 || title == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_pane_add_section(*mod, pane, title); +} + +ModResult ui_pane_add_text( + ModContext* context, UiElementHandle pane, const char* text, UiElementHandle* outElem) { + if (outElem != nullptr) { + *outElem = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || pane == 0 || text == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_pane_add_text(*mod, pane, text, outElem); +} + +ModResult ui_pane_add_rml( + ModContext* context, UiElementHandle pane, const char* rml, UiElementHandle* outElem) { + if (outElem != nullptr) { + *outElem = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || pane == 0 || rml == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_pane_add_rml(*mod, pane, rml, outElem); +} + +ModResult ui_pane_add_progress( + ModContext* context, UiElementHandle pane, float value, UiElementHandle* outElem) { + if (outElem != nullptr) { + *outElem = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || pane == 0) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_pane_add_progress(*mod, pane, value, outElem); +} + +ModResult ui_pane_add_control(ModContext* context, UiElementHandle pane, const UiControlDesc* desc, + UiElementHandle* outElem) { + if (outElem != nullptr) { + *outElem = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || pane == 0 || desc == nullptr || !valid_control_desc(*desc)) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_pane_add_control(*mod, pane, *desc, outElem); +} + +ModResult ui_elem_set_text(ModContext* context, UiElementHandle elem, const char* text) { + auto* mod = mod_from_context(context); + if (mod == nullptr || elem == 0 || text == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_elem_set_text(*mod, elem, text); +} + +ModResult ui_elem_set_rml(ModContext* context, UiElementHandle elem, const char* rml) { + auto* mod = mod_from_context(context); + if (mod == nullptr || elem == 0 || rml == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_elem_set_rml(*mod, elem, rml); +} + +ModResult ui_elem_set_progress(ModContext* context, UiElementHandle elem, float value) { + auto* mod = mod_from_context(context); + if (mod == nullptr || elem == 0) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_elem_set_progress(*mod, elem, value); +} + +ModResult ui_elem_set_class( + ModContext* context, UiElementHandle elem, const char* name, bool active) { + auto* mod = mod_from_context(context); + if (mod == nullptr || elem == 0 || name == nullptr || name[0] == '\0') { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_elem_set_class(*mod, elem, name, active); +} + +ModResult ui_window_push(ModContext* context, const UiWindowDesc* desc, UiWindowHandle* outWindow) { + if (outWindow != nullptr) { + *outWindow = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(UiWindowDesc) || + desc->tabs == nullptr || desc->tab_count == 0) + { + return MOD_INVALID_ARGUMENT; + } + for (size_t i = 0; i < desc->tab_count; ++i) { + const UiTabDesc& tab = desc->tabs[i]; + if (tab.struct_size < sizeof(UiTabDesc) || tab.title == nullptr || tab.build == nullptr) { + return MOD_INVALID_ARGUMENT; + } + } + uint64_t handle = 0; + const auto result = ui_impl::ui_window_push(*mod, *desc, handle); + if (result == MOD_OK && outWindow != nullptr) { + *outWindow = handle; + } + return result; +} + +ModResult ui_window_close(ModContext* context, UiWindowHandle window) { + auto* mod = mod_from_context(context); + if (mod == nullptr || window == 0) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_window_close(*mod, window); +} + +ModResult ui_dialog_push(ModContext* context, const UiDialogDesc* desc, UiDialogHandle* outDialog) { + if (outDialog != nullptr) { + *outDialog = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(UiDialogDesc) || + desc->title == nullptr || desc->body_rml == nullptr || desc->actions == nullptr || + desc->action_count == 0 || desc->variant > UI_DIALOG_DANGER) + { + return MOD_INVALID_ARGUMENT; + } + for (size_t i = 0; i < desc->action_count; ++i) { + if (desc->actions[i].label == nullptr) { + return MOD_INVALID_ARGUMENT; + } + } + uint64_t handle = 0; + const auto result = ui_impl::ui_dialog_push(*mod, *desc, handle); + if (result == MOD_OK && outDialog != nullptr) { + *outDialog = handle; + } + return result; +} + +ModResult ui_dialog_close(ModContext* context, UiDialogHandle dialog) { + auto* mod = mod_from_context(context); + if (mod == nullptr || dialog == 0) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_dialog_close(*mod, dialog); +} + +ModResult ui_is_any_document_visible(ModContext* context, bool* outVisible) { + auto* mod = mod_from_context(context); + if (mod == nullptr || outVisible == nullptr) { + return MOD_INVALID_ARGUMENT; + } + *outVisible = ui_impl::ui_any_document_visible(); + return MOD_OK; +} + +ModResult ui_register_styles( + ModContext* context, UiStyleScope scope, const char* rcss, UiStyleHandle* outStyle) { + if (outStyle != nullptr) { + *outStyle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || rcss == nullptr || scope > UI_SCOPE_GRAPHICS_TUNER) { + return MOD_INVALID_ARGUMENT; + } + uint64_t handle = 0; + const auto result = ui_impl::ui_register_styles(*mod, scope, rcss, handle); + if (result == MOD_OK && outStyle != nullptr) { + *outStyle = handle; + } + return result; +} + +ModResult ui_register_styles_file( + ModContext* context, UiStyleScope scope, const char* path, UiStyleHandle* outStyle) { + if (outStyle != nullptr) { + *outStyle = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || path == nullptr || !is_safe_resource_path(path) || + scope > UI_SCOPE_GRAPHICS_TUNER) + { + return MOD_INVALID_ARGUMENT; + } + uint64_t handle = 0; + const auto result = ui_impl::ui_register_styles_file(*mod, scope, path, handle); + if (result == MOD_OK && outStyle != nullptr) { + *outStyle = handle; + } + return result; +} + +ModResult ui_unregister_styles(ModContext* context, UiStyleHandle style) { + auto* mod = mod_from_context(context); + if (mod == nullptr || style == 0) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_unregister_styles(*mod, style); +} + +ModResult ui_register_menu_tab( + ModContext* context, const UiMenuTabDesc* desc, UiMenuTabHandle* outTab) { + if (outTab != nullptr) { + *outTab = 0; + } + auto* mod = mod_from_context(context); + if (mod == nullptr || desc == nullptr || desc->struct_size < sizeof(UiMenuTabDesc) || + desc->label == nullptr || desc->label[0] == '\0' || desc->on_selected == nullptr) + { + return MOD_INVALID_ARGUMENT; + } + uint64_t handle = 0; + const auto result = ui_impl::ui_register_menu_tab(*mod, *desc, handle); + if (result == MOD_OK && outTab != nullptr) { + *outTab = handle; + } + return result; +} + +ModResult ui_unregister_menu_tab(ModContext* context, UiMenuTabHandle tab) { + auto* mod = mod_from_context(context); + if (mod == nullptr || tab == 0) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_unregister_menu_tab(*mod, tab); +} + +ModResult ui_dialog_set_body(ModContext* context, UiDialogHandle dialog, const char* bodyRml) { + auto* mod = mod_from_context(context); + if (mod == nullptr || dialog == 0 || bodyRml == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_dialog_set_body(*mod, dialog, bodyRml); +} + +ModResult ui_dialog_set_icon(ModContext* context, UiDialogHandle dialog, const char* icon) { + auto* mod = mod_from_context(context); + if (mod == nullptr || dialog == 0 || icon == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_dialog_set_icon(*mod, dialog, icon); +} + +ModResult ui_dialog_add_action( + ModContext* context, UiDialogHandle dialog, const UiDialogAction* action) { + auto* mod = mod_from_context(context); + if (mod == nullptr || dialog == 0 || action == nullptr || action->label == nullptr) { + return MOD_INVALID_ARGUMENT; + } + return ui_impl::ui_dialog_add_action(*mod, dialog, *action); +} + +constexpr UiService s_uiService{ + .header = SERVICE_HEADER(UiService, UI_SERVICE_MAJOR, UI_SERVICE_MINOR), + .register_mods_panel = ui_register_mods_panel, + .pane_add_section = ui_pane_add_section, + .pane_add_text = ui_pane_add_text, + .pane_add_rml = ui_pane_add_rml, + .pane_add_progress = ui_pane_add_progress, + .pane_add_control = ui_pane_add_control, + .elem_set_text = ui_elem_set_text, + .elem_set_rml = ui_elem_set_rml, + .elem_set_progress = ui_elem_set_progress, + .elem_set_class = ui_elem_set_class, + .window_push = ui_window_push, + .window_close = ui_window_close, + .dialog_push = ui_dialog_push, + .dialog_close = ui_dialog_close, + .dialog_set_body = ui_dialog_set_body, + .dialog_set_icon = ui_dialog_set_icon, + .dialog_add_action = ui_dialog_add_action, + .is_any_document_visible = ui_is_any_document_visible, + .register_styles = ui_register_styles, + .register_styles_file = ui_register_styles_file, + .unregister_styles = ui_unregister_styles, + .register_menu_tab = ui_register_menu_tab, + .unregister_menu_tab = ui_unregister_menu_tab, +}; + +} // namespace + +void ui_build_mods_panels(LoadedMod& mod, ui::Pane& pane) { + ui_impl::ui_build_mods_panels(mod, pane); +} + +void ui_update_mods_panels(LoadedMod& mod) { + ui_impl::ui_update_mods_panels(mod); +} + +std::vector ui_mod_menu_tabs() { + return ui_impl::ui_mod_menu_tabs(); +} + +constinit const ServiceModule g_uiModule{ + .id = UI_SERVICE_ID, + .majorVersion = UI_SERVICE_MAJOR, + .minorVersion = UI_SERVICE_MINOR, + .service = &s_uiService, + .modDetached = ui_impl::ui_remove_mod, + .frameEnd = ui_impl::ui_sync_menu_tabs, +}; + +} // namespace dusk::mods::svc diff --git a/src/dusk/mods/svc/ui.hpp b/src/dusk/mods/svc/ui.hpp new file mode 100644 index 0000000000..0f0efc7c9d --- /dev/null +++ b/src/dusk/mods/svc/ui.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include "dusk/mod_loader.hpp" + +#include +#include +#include + +namespace dusk::ui { +class Pane; +} // namespace dusk::ui + +namespace dusk::mods::svc { + +void ui_build_mods_panels(LoadedMod& mod, ui::Pane& pane); +void ui_update_mods_panels(LoadedMod& mod); + +struct ModMenuTabEntry { + std::string label; + std::function onSelected; +}; + +std::vector ui_mod_menu_tabs(); + +} // namespace dusk::mods::svc diff --git a/src/dusk/mouse.cpp b/src/dusk/mouse.cpp new file mode 100644 index 0000000000..a1fd4efda8 --- /dev/null +++ b/src/dusk/mouse.cpp @@ -0,0 +1,225 @@ +#include "dusk/mouse.h" +#include "d/actor/d_a_alink.h" +#include "d/d_com_inf_game.h" +#include "dusk/menu_pointer.h" +#include "dusk/settings.h" +#include "dusk/ui/ui.hpp" + +#include +#include +#include +#include + +#include + +namespace dusk::mouse { +namespace { +using Clock = std::chrono::steady_clock; + +constexpr float kMousePixelToRad = 0.0025f; +constexpr auto kCursorIdleDuration = std::chrono::seconds(1); + +float s_aim_yaw_rad = 0.0f; +float s_aim_pitch_rad = 0.0f; +float s_camera_yaw_rad = 0.0f; +float s_camera_pitch_rad = 0.0f; +Clock::time_point s_last_cursor_motion = Clock::now(); + +void reset_deltas() { + s_aim_yaw_rad = s_aim_pitch_rad = 0.0f; + s_camera_yaw_rad = s_camera_pitch_rad = 0.0f; +} + +bool query_mouse_aim_context() { + return getSettings().game.enableMouseAim.getValue() && dCamera_c::isAimActive(); +} + +bool want_mouse_capture() { + return getSettings().game.enableMouseCamera.getValue() || query_mouse_aim_context(); +} + +bool mouse_input_enabled() { + const auto& game = getSettings().game; + return game.enableMouseAim.getValue() || game.enableMouseCamera.getValue(); +} + +bool is_window_focused(SDL_Window* window) { + if (window == nullptr) { + return false; + } + return (SDL_GetWindowFlags(window) & SDL_WINDOW_INPUT_FOCUS) != 0; +} + +bool imgui_windows_visible() { + return ImGui::GetIO().MetricsRenderWindows > 0; +} + +bool should_capture_mouse(SDL_Window* window) { + if (window == nullptr || ui::any_document_visible() || imgui_windows_visible() || + menu_pointer::active()) + { + return false; + } + return want_mouse_capture() && is_window_focused(window); +} + +bool sync_capture_state(SDL_Window* window, bool should_capture) { + if (window == nullptr) { + reset_deltas(); + return false; + } + + const bool was_captured = SDL_GetWindowRelativeMouseMode(window); + if (was_captured != should_capture) { + SDL_SetWindowMouseGrab(window, should_capture); + SDL_SetWindowRelativeMouseMode(window, should_capture); + } + + const bool is_captured = SDL_GetWindowRelativeMouseMode(window); + if (is_captured && !was_captured) { + const AuroraWindowSize sz = aurora::window::get_window_size(); + const float cx = static_cast(sz.width) * 0.5f; + const float cy = static_cast(sz.height) * 0.5f; + SDL_WarpMouseInWindow(window, cx, cy); + float discard_x = 0.0f; + float discard_y = 0.0f; + SDL_GetRelativeMouseState(&discard_x, &discard_y); + } + + if (!is_captured) { + reset_deltas(); + } + + return is_captured; +} + +void accumulate_deltas(float mx_rel, float my_rel, bool camera_active, bool aim_active) { + const auto& game = getSettings().game; + const bool mirror_mode = game.enableMirrorMode.getValue(); + const bool invert_y = game.invertMouseY.getValue(); + + if (aim_active) { + const float aimSens = game.mouseAimSensitivity.getValue(); + s_aim_yaw_rad = -mx_rel * kMousePixelToRad * aimSens; + s_aim_pitch_rad = my_rel * kMousePixelToRad * aimSens; + s_aim_yaw_rad = mirror_mode ? -s_aim_yaw_rad : s_aim_yaw_rad; + s_aim_pitch_rad = invert_y ? -s_aim_pitch_rad : s_aim_pitch_rad; + } else { + s_aim_yaw_rad = s_aim_pitch_rad = 0.0f; + } + + if (camera_active) { + const float camSens = game.mouseCameraSensitivity.getValue(); + s_camera_yaw_rad = -mx_rel * kMousePixelToRad * camSens; + s_camera_pitch_rad = -my_rel * kMousePixelToRad * camSens; + s_camera_yaw_rad = mirror_mode ? -s_camera_yaw_rad : s_camera_yaw_rad; + s_camera_pitch_rad = invert_y ? -s_camera_pitch_rad : s_camera_pitch_rad; + } else { + s_camera_yaw_rad = s_camera_pitch_rad = 0.0f; + } +} + +void set_cursor_visible(bool visible) { + if (visible) { + ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouseCursorChange; + SDL_ShowCursor(); + } else { + ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange; + SDL_HideCursor(); + } +} + +bool cursor_idle() { + return Clock::now() - s_last_cursor_motion >= kCursorIdleDuration; +} + +bool should_show_cursor(bool captured) { + if (captured) { + return false; + } + if (ui::any_document_visible()) { + return true; + } + if (imgui_windows_visible()) { + return true; + } + if (menu_pointer::enabled() && menu_pointer::active()) { + return true; + } + if (mouse_input_enabled()) { + return false; + } + return !cursor_idle(); +} + +void update_cursor_visibility(SDL_Window* window, bool captured) { + if (window == nullptr || !is_window_focused(window)) { + return; + } + + set_cursor_visible(should_show_cursor(captured)); +} +} // namespace + +void read() { + SDL_Window* window = aurora::window::get_sdl_window(); + const bool capture_active = sync_capture_state(window, should_capture_mouse(window)); + update_cursor_visibility(window, capture_active); + + if (!capture_active) { + return; + } + + const bool aim_active = capture_active && query_mouse_aim_context(); + const bool camera_active = capture_active && getSettings().game.enableMouseCamera; + + float mx_rel = 0.0f; + float my_rel = 0.0f; + SDL_GetRelativeMouseState(&mx_rel, &my_rel); + accumulate_deltas(mx_rel, my_rel, camera_active, aim_active); +} + +void get_aim_deltas(float& out_yaw, float& out_pitch) { + out_yaw = s_aim_yaw_rad; + out_pitch = s_aim_pitch_rad; +} + +void get_camera_deltas(float& out_yaw, float& out_pitch) { + out_yaw = 0.0f; + out_pitch = 0.0f; + + if (!getSettings().game.enableMouseCamera) { + return; + } + + out_yaw = s_camera_yaw_rad; + out_pitch = s_camera_pitch_rad; +} + +void handle_event(const SDL_Event& event) noexcept { + switch (event.type) { + case SDL_EVENT_MOUSE_MOTION: + s_last_cursor_motion = Clock::now(); + break; + case SDL_EVENT_WINDOW_FOCUS_LOST: + on_focus_lost(); + break; + case SDL_EVENT_WINDOW_FOCUS_GAINED: + on_focus_gained(); + break; + } +} + +void on_focus_lost() { + SDL_Window* window = aurora::window::get_sdl_window(); + if (window != nullptr) { + sync_capture_state(window, false); + } + set_cursor_visible(true); +} + +void on_focus_gained() { + SDL_Window* window = aurora::window::get_sdl_window(); + sync_capture_state(window, should_capture_mouse(window)); +} +} // namespace dusk::mouse diff --git a/src/dusk/mouse.h b/src/dusk/mouse.h new file mode 100644 index 0000000000..c98d53c18f --- /dev/null +++ b/src/dusk/mouse.h @@ -0,0 +1,12 @@ +#pragma once + +#include + +namespace dusk::mouse { +void read(); +void get_aim_deltas(float& out_yaw, float& out_pitch); +void get_camera_deltas(float& out_yaw, float& out_pitch); +void handle_event(const SDL_Event& event) noexcept; +void on_focus_lost(); +void on_focus_gained(); +} // namespace dusk::mouse diff --git a/include/dusk/os.h b/src/dusk/os.h similarity index 62% rename from include/dusk/os.h rename to src/dusk/os.h index 180bdb9b1a..46529d1e61 100644 --- a/include/dusk/os.h +++ b/src/dusk/os.h @@ -1,5 +1,4 @@ -#ifndef DUSK_OS_H -#define DUSK_OS_H +#pragma once #ifdef __cplusplus extern "C" { @@ -9,6 +8,8 @@ void OSSetCurrentThreadName(const char* name); #ifdef __cplusplus } -#endif -#endif // DUSK_OS_H \ No newline at end of file +namespace dusk { +extern bool OSReportReallyForceEnable; +} +#endif diff --git a/include/dusk/scope_guard.hpp b/src/dusk/scope_guard.hpp similarity index 79% rename from include/dusk/scope_guard.hpp rename to src/dusk/scope_guard.hpp index 281d23434d..ac35334d5d 100644 --- a/include/dusk/scope_guard.hpp +++ b/src/dusk/scope_guard.hpp @@ -1,5 +1,4 @@ -#ifndef DUSK_SCOPE_GUARD_HPP -#define DUSK_SCOPE_GUARD_HPP +#pragma once #include @@ -16,5 +15,3 @@ public: private: std::function m_func; }; - -#endif //DUSK_SCOPE_GUARD_HPP diff --git a/src/dusk/settings.cpp b/src/dusk/settings.cpp index dbe27db8aa..e2a2169485 100644 --- a/src/dusk/settings.cpp +++ b/src/dusk/settings.cpp @@ -1,5 +1,6 @@ #include "dusk/settings.h" #include "dusk/config.hpp" +#include namespace dusk { @@ -10,6 +11,10 @@ UserSettings g_userSettings = { .lockAspectRatio {"video.lockAspectRatio", false}, .enableFpsOverlay {"game.enableFpsOverlay", false}, .fpsOverlayCorner {"game.fpsOverlayCorner", 0}, + .maxFrameRate {"video.maxFrameRate", 240}, + .rememberWindowSize {"video.rememberWindowSize", false}, + .lastWindowWidth {"video.lastWindowWidth", 0}, + .lastWindowHeight {"video.lastWindowHeight", 0}, }, .audio = { @@ -40,28 +45,34 @@ UserSettings g_userSettings = { .noMissClimbing {"game.noMissClimbing", false}, .fastTears {"game.fastTears", false}, .no2ndFishForCat {"game.no2ndFishForCat", false}, + .buttonFishing {"game.buttonFishing", false}, .instantSaves {"game.instantSaves", false}, .instantText {"game.instantText", false}, .sunsSong {"game.sunsSong", false}, .autoSave {"game.autoSave", false}, + .enhancedMapMenus {"game.enhancedMapMenus", false}, // Preferences .enableMirrorMode {"game.enableMirrorMode", false}, .minimalHUD {"game.minimalHUD", false}, + .hudScale {"game.hudScale", 1.0f}, .pauseOnFocusLost {"game.pauseOnFocusLost", false}, .enableLinkDollRotation {"game.enableLinkDollRotation", false}, .enableAchievementToasts {"game.enableAchievementToasts", true}, .enableControllerToasts {"game.enableControllerToasts", true}, .enableDiscordPresence {"game.enableDiscordPresence", true}, + .menuScalingMode {"game.menuScalingMode", MenuScaling::Wii}, // Graphics .bloomMode {"game.bloomMode", BloomMode::Dusk}, .bloomMultiplier {"game.bloomMultiplier", 1.0f}, + .depthOfFieldMode{"game.depthOfFieldMode", DepthOfFieldMode::Dusk}, .disableWaterRefraction {"game.disableWaterRefraction", false}, - .enableFrameInterpolation {"game.enableFrameInterpolation", false}, + .enableTextureReplacements {"game.enableTextureReplacements", true}, + .enableFrameInterpolation {"game.enableFrameInterpolation", FrameInterpMode::Off}, .internalResolutionScale {"game.internalResolutionScale", 0}, .shadowResolutionMultiplier {"game.shadowResolutionMultiplier", 1}, - .enableDepthOfField {"game.enableDepthOfField", true}, + .resampler {"game.resampler", Resampler::Bilinear}, .enableMapBackground {"game.enableMapBackground", true}, .disableCutscenePillarboxing {"game.disableCutscenePillarboxing", false}, @@ -70,7 +81,6 @@ UserSettings g_userSettings = { .midnasLamentNonStop {"game.midnasLamentNonStop", false}, // Input - .gyroMode {"game.gyroMode", GyroMode::Sensor}, .enableGyroAim {"game.enableGyroAim", false}, .enableGyroRollgoal {"game.enableGyroRollgoal", false}, .gyroSensitivityX {"game.gyroSensitivityX", 1.0f}, @@ -80,15 +90,36 @@ UserSettings g_userSettings = { .gyroDeadband {"game.gyroDeadband", 0.04f}, .gyroInvertPitch {"game.gyroInvertPitch", false}, .gyroInvertYaw {"game.gyroInvertYaw", false}, + .enableMouseCamera {"game.enableMouseCamera", false}, + .enableMouseAim {"game.enableMouseAim", false}, + .mouseAimSensitivity {"game.mouseAimSensitivity", 1.0f}, + .mouseCameraSensitivity {"game.mouseCameraSensitivity", 1.0f}, + .invertMouseY {"game.invertMouseY", false}, .freeCamera {"game.freeCamera", false}, + .enableTouchControls {"game.enableTouchControls", false}, + .touchTargeting {"game.touchTargeting", TouchTargeting::Hybrid}, + .enableMenuPointer {"game.enableMenuPointer", true}, + .touchControlsLayout {"game.touchControlsLayout", ui::ControlLayout{}}, .invertCameraXAxis {"game.invertCameraXAxis", false}, .invertCameraYAxis {"game.invertCameraYAxis", false}, .invertFirstPersonXAxis {"game.invertFirstPersonXAxis", false}, .invertFirstPersonYAxis {"game.invertFirstPersonYAxis", false}, - .freeCameraSensitivity {"game.freeCameraSensitivity", 1.0f}, + .invertAirSwimX {"game.invertAirSwimX", false}, + .invertAirSwimY {"game.invertAirSwimY", false}, + .freeCameraXSensitivity {"game.freeCameraXSensitivity", 1.0f}, + .freeCameraYSensitivity {"game.freeCameraYSensitivity", 1.0f}, + .touchCameraXSensitivity {"game.touchCameraXSensitivity", 1.0f}, + .touchCameraYSensitivity {"game.touchCameraYSensitivity", 1.0f}, .debugFlyCam {"game.debugFlyCam", false}, .debugFlyCamLockEvents {"game.debugFlyCamLockEvents", true}, .allowBackgroundInput {"game.allowBackgroundInput", true}, + .enableLED { + ConfigVar{"game.enableLED_port0", true}, + ConfigVar{"game.enableLED_port1", true}, + ConfigVar{"game.enableLED_port2", true}, + ConfigVar{"game.enableLED_port3", true}, + }, + .swapDirectSelect {"game.swapDirectSelect", false}, // Cheats .infiniteHearts {"game.infiniteHearts", false}, @@ -106,7 +137,7 @@ UserSettings g_userSettings = { .canTransformAnywhere {"game.canTransformAnywhere", false}, .fastRoll {"game.fastRoll", false}, .fastSpinner {"game.fastSpinner", false}, - .freeMagicArmor {"game.freeMagicArmor", false}, + .armorRupeeDrain {"game.armorRupeeDrain", MagicArmorMode::NORMAL}, .invincibleEnemies {"game.invincibleEnemies", false}, // Technical @@ -121,6 +152,7 @@ UserSettings g_userSettings = { .liveSplitEnabled {"game.liveSplitEnabled", false}, .showSpeedrunRTATimer {"game.showSpeedrunRTATimer", true}, .recordingMode {"game.recordingMode", false}, + .removeQuestMapMarkers {"game.removeQuestMapMarkers", false}, .showInputViewer {"game.showInputViewer", false}, .showInputViewerGyro {"game.showInputViewerGyro", false} }, @@ -130,7 +162,6 @@ UserSettings g_userSettings = { .isoVerification {"backend.isoVerification", DiscVerificationState::Unknown}, .graphicsBackend {"backend.graphicsBackend", "auto"}, .skipPreLaunchUI {"backend.skipPreLaunchUI", false}, - .showPipelineCompilation {"backend.showPipelineCompilation", false}, .wasPresetChosen {"backend.wasPresetChosen", false}, .checkForUpdates {"backend.checkForUpdates", true}, .cardFileType {"backend.cardFileType", static_cast(CARD_GCIFOLDER)}, @@ -151,6 +182,18 @@ UserSettings g_userSettings = { ActionBindConfigVar{"actionBindings.callMidna_port2", PAD_NATIVE_BUTTON_INVALID}, ActionBindConfigVar{"actionBindings.callMidna_port3", PAD_NATIVE_BUTTON_INVALID}, }, + .openMapScreen { + ActionBindConfigVar{"actionBindings.openMapScreen_port0", PAD_NATIVE_BUTTON_INVALID}, + ActionBindConfigVar{"actionBindings.openMapScreen_port1", PAD_NATIVE_BUTTON_INVALID}, + ActionBindConfigVar{"actionBindings.openMapScreen_port2", PAD_NATIVE_BUTTON_INVALID}, + ActionBindConfigVar{"actionBindings.openMapScreen_port3", PAD_NATIVE_BUTTON_INVALID}, + }, + .toggleMinimap { + ActionBindConfigVar{"actionBindings.toggleMinimap_port0", PAD_NATIVE_BUTTON_INVALID}, + ActionBindConfigVar{"actionBindings.toggleMinimap_port1", PAD_NATIVE_BUTTON_INVALID}, + ActionBindConfigVar{"actionBindings.toggleMinimap_port2", PAD_NATIVE_BUTTON_INVALID}, + ActionBindConfigVar{"actionBindings.toggleMinimap_port3", PAD_NATIVE_BUTTON_INVALID}, + }, .openDusklightMenu { ActionBindConfigVar{"actionBindings.openDusklightMenu_port0", PAD_NATIVE_BUTTON_INVALID}, ActionBindConfigVar{"actionBindings.openDusklightMenu_port1", PAD_NATIVE_BUTTON_INVALID}, @@ -177,6 +220,10 @@ void registerSettings() { Register(g_userSettings.video.lockAspectRatio); Register(g_userSettings.video.enableFpsOverlay); Register(g_userSettings.video.fpsOverlayCorner); + Register(g_userSettings.video.maxFrameRate); + Register(g_userSettings.video.rememberWindowSize); + Register(g_userSettings.video.lastWindowWidth); + Register(g_userSettings.video.lastWindowHeight); // Audio Register(g_userSettings.audio.masterVolume); @@ -202,31 +249,42 @@ void registerSettings() { Register(g_userSettings.game.fastClimbing); Register(g_userSettings.game.fastTears); Register(g_userSettings.game.no2ndFishForCat); + Register(g_userSettings.game.buttonFishing); Register(g_userSettings.game.instantSaves); Register(g_userSettings.game.instantText); Register(g_userSettings.game.sunsSong); Register(g_userSettings.game.autoSave); + Register(g_userSettings.game.enhancedMapMenus); Register(g_userSettings.game.enableMirrorMode); Register(g_userSettings.game.invertCameraXAxis); Register(g_userSettings.game.invertCameraYAxis); Register(g_userSettings.game.invertFirstPersonXAxis); Register(g_userSettings.game.invertFirstPersonYAxis); - Register(g_userSettings.game.freeCameraSensitivity); + Register(g_userSettings.game.invertAirSwimX); + Register(g_userSettings.game.invertAirSwimY); + Register(g_userSettings.game.freeCameraXSensitivity); + Register(g_userSettings.game.freeCameraYSensitivity); + Register(g_userSettings.game.touchCameraXSensitivity); + Register(g_userSettings.game.touchCameraYSensitivity); Register(g_userSettings.game.minimalHUD); - Register(g_userSettings.game.pauseOnFocusLost); + Register(g_userSettings.game.hudScale); + Register(g_userSettings.game.pauseOnFocusLost, + [](const bool& value, const bool&) { aurora_set_pause_on_focus_lost(value); }); Register(g_userSettings.game.enableDiscordPresence); Register(g_userSettings.game.bloomMode); Register(g_userSettings.game.bloomMultiplier); + Register(g_userSettings.game.depthOfFieldMode); Register(g_userSettings.game.disableWaterRefraction); + Register(g_userSettings.game.enableTextureReplacements); Register(g_userSettings.game.internalResolutionScale); + Register(g_userSettings.game.resampler); Register(g_userSettings.game.shadowResolutionMultiplier); - Register(g_userSettings.game.enableDepthOfField); Register(g_userSettings.game.enableMapBackground); Register(g_userSettings.game.disableCutscenePillarboxing); Register(g_userSettings.game.enableFastIronBoots); Register(g_userSettings.game.canTransformAnywhere); Register(g_userSettings.game.fastRoll); - Register(g_userSettings.game.freeMagicArmor); + Register(g_userSettings.game.armorRupeeDrain); Register(g_userSettings.game.restoreWiiGlitches); Register(g_userSettings.game.enableLinkDollRotation); Register(g_userSettings.game.enableAchievementToasts); @@ -240,6 +298,8 @@ void registerSettings() { Register(g_userSettings.game.liveSplitEnabled); Register(g_userSettings.game.showSpeedrunRTATimer); Register(g_userSettings.game.recordingMode); + Register(g_userSettings.game.menuScalingMode); + Register(g_userSettings.game.removeQuestMapMarkers); Register(g_userSettings.game.showInputViewer); Register(g_userSettings.game.showInputViewerGyro); Register(g_userSettings.game.fastSpinner); @@ -256,7 +316,6 @@ void registerSettings() { Register(g_userSettings.game.alwaysGreatspin); Register(g_userSettings.game.invincibleEnemies); Register(g_userSettings.game.enableFrameInterpolation); - Register(g_userSettings.game.gyroMode); Register(g_userSettings.game.enableGyroAim); Register(g_userSettings.game.enableGyroRollgoal); Register(g_userSettings.game.gyroSensitivityX); @@ -266,16 +325,29 @@ void registerSettings() { Register(g_userSettings.game.gyroSmoothing); Register(g_userSettings.game.gyroInvertPitch); Register(g_userSettings.game.gyroInvertYaw); + Register(g_userSettings.game.enableMouseCamera); + Register(g_userSettings.game.enableMouseAim); + Register(g_userSettings.game.mouseAimSensitivity); + Register(g_userSettings.game.mouseCameraSensitivity); + Register(g_userSettings.game.invertMouseY); Register(g_userSettings.game.freeCamera); + Register(g_userSettings.game.enableTouchControls); + Register(g_userSettings.game.touchTargeting); + Register(g_userSettings.game.enableMenuPointer); + Register(g_userSettings.game.touchControlsLayout); Register(g_userSettings.game.debugFlyCam); Register(g_userSettings.game.debugFlyCamLockEvents); Register(g_userSettings.game.allowBackgroundInput); + Register(g_userSettings.game.enableLED[0]); + Register(g_userSettings.game.enableLED[1]); + Register(g_userSettings.game.enableLED[2]); + Register(g_userSettings.game.enableLED[3]); + Register(g_userSettings.game.swapDirectSelect); Register(g_userSettings.backend.isoPath); Register(g_userSettings.backend.isoVerification); Register(g_userSettings.backend.graphicsBackend); Register(g_userSettings.backend.skipPreLaunchUI); - Register(g_userSettings.backend.showPipelineCompilation); Register(g_userSettings.backend.wasPresetChosen); Register(g_userSettings.backend.checkForUpdates); Register(g_userSettings.backend.cardFileType); @@ -289,6 +361,14 @@ void registerSettings() { Register(g_userSettings.actionBindings.callMidna[1]); Register(g_userSettings.actionBindings.callMidna[2]); Register(g_userSettings.actionBindings.callMidna[3]); + Register(g_userSettings.actionBindings.openMapScreen[0]); + Register(g_userSettings.actionBindings.openMapScreen[1]); + Register(g_userSettings.actionBindings.openMapScreen[2]); + Register(g_userSettings.actionBindings.openMapScreen[3]); + Register(g_userSettings.actionBindings.toggleMinimap[0]); + Register(g_userSettings.actionBindings.toggleMinimap[1]); + Register(g_userSettings.actionBindings.toggleMinimap[2]); + Register(g_userSettings.actionBindings.toggleMinimap[3]); Register(g_userSettings.actionBindings.openDusklightMenu[0]); Register(g_userSettings.actionBindings.openDusklightMenu[1]); Register(g_userSettings.actionBindings.openDusklightMenu[2]); diff --git a/include/dusk/settings.h b/src/dusk/settings.h similarity index 65% rename from include/dusk/settings.h rename to src/dusk/settings.h index 43e565ed5e..326f7f321c 100644 --- a/include/dusk/settings.h +++ b/src/dusk/settings.h @@ -1,13 +1,14 @@ -#ifndef DUSK_CONFIG_H -#define DUSK_CONFIG_H +#pragma once #include #include "dusk/config_var.hpp" +#include "dusk/ui/controls.hpp" namespace dusk { -using namespace config; +using config::ConfigVar; +using config::ActionBindConfigVar; enum class BloomMode : int { Off = 0, @@ -15,6 +16,17 @@ enum class BloomMode : int { Dusk = 2, }; +enum class DepthOfFieldMode : int { + Off = 0, + Classic = 1, + Dusk = 2, +}; + +enum class Resampler : int { + Bilinear = 0, + Area = 1, +}; + enum class GameLanguage : u8 { English = OS_LANGUAGE_ENGLISH, German = OS_LANGUAGE_GERMAN, @@ -29,9 +41,30 @@ enum class DiscVerificationState : u8 { HashMismatch, }; -enum class GyroMode : u8 { - Sensor = 0, - Mouse = 1, +enum class FrameInterpMode : u8 { + Off = 0, + Capped = 1, + Unlimited = 2, +}; + +enum class TouchTargeting : u8 { + Hybrid = 0, + Hold = 1, + Switch = 2, +}; + +enum class MenuScaling : u8 { + GameCube = 0, + Wii = 1, + Dusklight = 2, +}; + +enum class MagicArmorMode : u8 { + NORMAL = 0, + ON_DAMAGE = 1, + DOUBLE_DEFENSE = 2, + INVINCIBLE = 3, + COSMETIC = 4, }; namespace config { @@ -41,6 +74,18 @@ struct ConfigEnumRange { static constexpr auto max = BloomMode::Dusk; }; +template <> +struct ConfigEnumRange { + static constexpr auto min = DepthOfFieldMode::Off; + static constexpr auto max = DepthOfFieldMode::Dusk; +}; + +template <> +struct ConfigEnumRange { + static constexpr auto min = Resampler::Bilinear; + static constexpr auto max = Resampler::Area; +}; + template <> struct ConfigEnumRange { static constexpr auto min = GameLanguage::English; @@ -54,11 +99,34 @@ struct ConfigEnumRange { }; template <> -struct ConfigEnumRange { - static constexpr auto min = GyroMode::Sensor; - static constexpr auto max = GyroMode::Mouse; +struct ConfigEnumRange { + static constexpr auto min = FrameInterpMode::Off; + static constexpr auto max = FrameInterpMode::Unlimited; }; -} + +template <> +struct ConfigEnumRange { + static constexpr auto min = TouchTargeting::Hybrid; + static constexpr auto max = TouchTargeting::Switch; +}; + +template <> +struct ConfigEnumRange { + static constexpr auto min = MenuScaling::GameCube; + static constexpr auto max = MenuScaling::Dusklight; +}; + +template <> +struct ConfigEnumRange { + static constexpr auto min = MagicArmorMode::NORMAL; + static constexpr auto max = MagicArmorMode::COSMETIC; +}; + +template <> +struct ConfigValueTraits { + static constexpr bool enabled = true; +}; +} // namespace config // Persistent user settings @@ -72,6 +140,10 @@ struct UserSettings { ConfigVar lockAspectRatio; ConfigVar enableFpsOverlay; ConfigVar fpsOverlayCorner; + ConfigVar maxFrameRate; + ConfigVar rememberWindowSize; + ConfigVar lastWindowWidth; + ConfigVar lastWindowHeight; } video; struct { @@ -105,28 +177,34 @@ struct UserSettings { ConfigVar noMissClimbing; ConfigVar fastTears; ConfigVar no2ndFishForCat; + ConfigVar buttonFishing; ConfigVar instantSaves; ConfigVar instantText; ConfigVar sunsSong; ConfigVar autoSave; + ConfigVar enhancedMapMenus; // Preferences ConfigVar enableMirrorMode; ConfigVar minimalHUD; + ConfigVar hudScale; ConfigVar pauseOnFocusLost; ConfigVar enableLinkDollRotation; ConfigVar enableAchievementToasts; ConfigVar enableControllerToasts; ConfigVar enableDiscordPresence; + ConfigVar menuScalingMode; // Graphics ConfigVar bloomMode; ConfigVar bloomMultiplier; + ConfigVar depthOfFieldMode; ConfigVar disableWaterRefraction; - ConfigVar enableFrameInterpolation; + ConfigVar enableTextureReplacements; + ConfigVar enableFrameInterpolation; ConfigVar internalResolutionScale; ConfigVar shadowResolutionMultiplier; - ConfigVar enableDepthOfField; + ConfigVar resampler; ConfigVar enableMapBackground; ConfigVar disableCutscenePillarboxing; @@ -135,7 +213,6 @@ struct UserSettings { ConfigVar midnasLamentNonStop; // Input - ConfigVar gyroMode; ConfigVar enableGyroAim; ConfigVar enableGyroRollgoal; ConfigVar gyroSensitivityX; @@ -145,15 +222,31 @@ struct UserSettings { ConfigVar gyroDeadband; ConfigVar gyroInvertPitch; ConfigVar gyroInvertYaw; + ConfigVar enableMouseCamera; + ConfigVar enableMouseAim; + ConfigVar mouseAimSensitivity; + ConfigVar mouseCameraSensitivity; + ConfigVar invertMouseY; ConfigVar freeCamera; + ConfigVar enableTouchControls; + ConfigVar touchTargeting; + ConfigVar enableMenuPointer; + ConfigVar touchControlsLayout; ConfigVar invertCameraXAxis; ConfigVar invertCameraYAxis; ConfigVar invertFirstPersonXAxis; ConfigVar invertFirstPersonYAxis; - ConfigVar freeCameraSensitivity; + ConfigVar invertAirSwimX; + ConfigVar invertAirSwimY; + ConfigVar freeCameraXSensitivity; + ConfigVar freeCameraYSensitivity; + ConfigVar touchCameraXSensitivity; + ConfigVar touchCameraYSensitivity; ConfigVar debugFlyCam; ConfigVar debugFlyCamLockEvents; ConfigVar allowBackgroundInput; + std::array, 4> enableLED; + ConfigVar swapDirectSelect; // Cheats ConfigVar infiniteHearts; @@ -171,7 +264,7 @@ struct UserSettings { ConfigVar canTransformAnywhere; ConfigVar fastRoll; ConfigVar fastSpinner; - ConfigVar freeMagicArmor; + ConfigVar armorRupeeDrain; ConfigVar invincibleEnemies; // Technical @@ -186,6 +279,7 @@ struct UserSettings { ConfigVar liveSplitEnabled; ConfigVar showSpeedrunRTATimer; ConfigVar recordingMode; + ConfigVar removeQuestMapMarkers; ConfigVar showInputViewer; ConfigVar showInputViewerGyro; } game; @@ -195,7 +289,6 @@ struct UserSettings { ConfigVar isoVerification; ConfigVar graphicsBackend; ConfigVar skipPreLaunchUI; - ConfigVar showPipelineCompilation; ConfigVar wasPresetChosen; ConfigVar checkForUpdates; ConfigVar cardFileType; @@ -206,6 +299,8 @@ struct UserSettings { struct { std::array firstPersonCamera; std::array callMidna; + std::array openMapScreen; + std::array toggleMinimap; std::array openDusklightMenu; std::array turboSpeedButton; } actionBindings; @@ -237,6 +332,4 @@ struct TransientSettings { TransientSettings& getTransientSettings(); -} - -#endif // DUSK_CONFIG_H +} // namespace dusk diff --git a/src/dusk/speedrun.cpp b/src/dusk/speedrun.cpp index feb2178c41..275a8de900 100644 --- a/src/dusk/speedrun.cpp +++ b/src/dusk/speedrun.cpp @@ -1,5 +1,6 @@ #include "dusk/speedrun.h" #include "dusk/settings.h" +#include "dusk/config.hpp" #include "m_Do/m_Do_main.h" #include @@ -33,14 +34,25 @@ void resetForSpeedrunMode() { getSettings().game.canTransformAnywhere.setSpeedrunValue(false); getSettings().game.fastRoll.setSpeedrunValue(false); getSettings().game.fastSpinner.setSpeedrunValue(false); - getSettings().game.freeMagicArmor.setSpeedrunValue(false); + getSettings().game.armorRupeeDrain.setSpeedrunValue(MagicArmorMode::NORMAL); + getSettings().game.invincibleEnemies.setSpeedrunValue(false); getSettings().game.pauseOnFocusLost.setSpeedrunValue(false); - aurora_set_pause_on_focus_lost(false); getSettings().backend.enableAdvancedSettings.setSpeedrunValue(false); getSettings().game.recordingMode.setSpeedrunValue(false); getSettings().game.debugFlyCam.setSpeedrunValue(false); } +static void clearSpeedrunOverrides() { + config::EnumerateRegistered([](config::ConfigVarBase& cvar) { + cvar.clearSpeedrunOverride(); + }); +} + +void restoreFromSpeedrunMode() { + clearSpeedrunOverrides(); + aurora_set_pause_on_focus_lost(getSettings().game.pauseOnFocusLost.getValue()); +} + } // namespace dusk diff --git a/include/dusk/speedrun.h b/src/dusk/speedrun.h similarity index 96% rename from include/dusk/speedrun.h rename to src/dusk/speedrun.h index c1a92e4a50..d9e43c3ed7 100644 --- a/include/dusk/speedrun.h +++ b/src/dusk/speedrun.h @@ -37,5 +37,6 @@ struct SpeedrunInfo { extern SpeedrunInfo m_speedrunInfo; void resetForSpeedrunMode(); +void restoreFromSpeedrunMode(); } // namespace dusk diff --git a/src/dusk/stubs.cpp b/src/dusk/stubs.cpp index c6832d2cac..b283eb43bf 100644 --- a/src/dusk/stubs.cpp +++ b/src/dusk/stubs.cpp @@ -179,14 +179,6 @@ int OSJamMessage(OSMessageQueue* mq, void* msg, s32 flags) { return 1; } -// ========================================================================== -// Arena Functions -// ========================================================================== - -void* OSInitAlloc(void* arenaStart, void* arenaEnd, int maxHeaps) { - return arenaStart; -} - // ========================================================================== // Remaining OS Stubs // ========================================================================== diff --git a/src/dusk/texture_replacements.cpp b/src/dusk/texture_replacements.cpp new file mode 100644 index 0000000000..2866af855f --- /dev/null +++ b/src/dusk/texture_replacements.cpp @@ -0,0 +1,39 @@ +#include "dusk/texture_replacements.hpp" + +#include + +#include "dusk/logging.h" +#include "dusk/main.h" +#include "dusk/settings.h" + +namespace dusk::texture_replacements { +namespace { +aurora::texture::ReplacementGroup s_directoryGroup; +} + +void reload() { + aurora::texture::unregister_replacements(s_directoryGroup); + s_directoryGroup.registrations.clear(); + + if (!getSettings().game.enableTextureReplacements) { + return; + } + + const auto root = ConfigPath / "texture_replacements"; + s_directoryGroup = aurora::texture::load_replacement_directory( + root, {.priority = kUserTextureReplacementPriority}); + DuskLog.info("Texture replacement directory loaded: {} registration(s)", + s_directoryGroup.registrations.size()); +} + +void set_enabled(bool enabled) { + getSettings().game.enableTextureReplacements.setValue(enabled); + reload(); +} + +void shutdown() { + aurora::texture::unregister_replacements(s_directoryGroup); + s_directoryGroup.registrations.clear(); +} + +} diff --git a/src/dusk/texture_replacements.hpp b/src/dusk/texture_replacements.hpp new file mode 100644 index 0000000000..1a633d424d --- /dev/null +++ b/src/dusk/texture_replacements.hpp @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace dusk::texture_replacements { + +// Mod replacements are prioritized *over* user replacements (/texture_replacements/) +inline constexpr int32_t kUserTextureReplacementPriority = -1'000'000; + +void reload(); +void set_enabled(bool enabled); +void shutdown(); + +} diff --git a/include/dusk/time.h b/src/dusk/time.h similarity index 69% rename from include/dusk/time.h rename to src/dusk/time.h index c43437f639..fad3186042 100644 --- a/include/dusk/time.h +++ b/src/dusk/time.h @@ -1,5 +1,4 @@ -#ifndef DUSK_TIME_H -#define DUSK_TIME_H +#pragma once #include #include @@ -17,16 +16,24 @@ #include #include #endif +#ifdef __APPLE__ +#include +#if defined(__x86_64__) || defined(__i386__) +#include +#endif +#endif class Limiter { public: using duration_t = Uint64; - void Reset() { m_oldTime = SDL_GetTicksNS(); } + void Reset() { + m_oldTime = SDL_GetTicksNS(); + } - void Sleep(duration_t targetFrameTime) { + duration_t Sleep(duration_t targetFrameTime) { if (targetFrameTime == 0) { - return; + return 0; } const Uint64 start = SDL_GetTicksNS(); @@ -41,6 +48,8 @@ public: } } Reset(); + + return adjustedSleepTime; } duration_t SleepTime(duration_t targetFrameTime) { @@ -74,7 +83,6 @@ private: if (!initialized || numSleeps++ % 1000 == 0) { LARGE_INTEGER freq; if (QueryPerformanceFrequency(&freq) == 0) { - DuskLog.warn("QueryPerformanceFrequency failed: {}", GetLastError()); return; } countPerNs = static_cast(freq.QuadPart) / 1e9; @@ -98,9 +106,34 @@ private: #endif } while (current.QuadPart - start.QuadPart < ticksToWait); } +#elif defined (__APPLE__) + void NanoSleep(const duration_t duration) { + // Hybrid approach using Apple Mach + uint64_t start_mach = mach_absolute_time(); + + mach_timebase_info_data_t timebase_info; + mach_timebase_info(&timebase_info); + + uint64_t total_mach_ticks = (duration * timebase_info.denom) / timebase_info.numer; + uint64_t target_mach = start_mach + total_mach_ticks; + + uint64_t buffer_ns = 2'000'000ULL; + uint64_t buffer_mach_ticks = (buffer_ns * timebase_info.denom) / timebase_info.numer; + + if (total_mach_ticks > buffer_mach_ticks) { + uint64_t sleep_until_mach = target_mach - buffer_mach_ticks; + mach_wait_until(sleep_until_mach); + } + + while (mach_absolute_time() < target_mach) { +#if defined(__aarch64__) || defined(__arm__) + asm volatile("yield" ::: "memory"); // Hardware hint, not a scheduler hint. +#else + _mm_pause(); +#endif + } + } #else void NanoSleep(const duration_t duration) { SDL_DelayPrecise(duration); } #endif }; - -#endif diff --git a/src/dusk/touch_camera.cpp b/src/dusk/touch_camera.cpp new file mode 100644 index 0000000000..a0f8ca99dc --- /dev/null +++ b/src/dusk/touch_camera.cpp @@ -0,0 +1,29 @@ +#include "dusk/touch_camera.h" + +namespace dusk::touch_camera { +namespace { +float s_yaw_dp = 0.0f; +float s_pitch_dp = 0.0f; +} // namespace + +void add_delta(float yaw_dp, float pitch_dp) noexcept { + if (getSettings().game.enableMirrorMode) { + yaw_dp *= -1.0; + } + s_yaw_dp += yaw_dp; + s_pitch_dp += pitch_dp; +} + +bool consume_delta(float& yaw_dp, float& pitch_dp) noexcept { + yaw_dp = s_yaw_dp; + pitch_dp = s_pitch_dp; + clear(); + return yaw_dp != 0.0f || pitch_dp != 0.0f; +} + +void clear() noexcept { + s_yaw_dp = 0.0f; + s_pitch_dp = 0.0f; +} + +} // namespace dusk::touch_camera diff --git a/src/dusk/touch_camera.h b/src/dusk/touch_camera.h new file mode 100644 index 0000000000..d1680afed1 --- /dev/null +++ b/src/dusk/touch_camera.h @@ -0,0 +1,12 @@ +#pragma once + +namespace dusk::touch_camera { + +constexpr float YAW_DEGREES_PER_DP = 0.34f; +constexpr float PITCH_DEGREES_PER_DP = 0.22f; + +void add_delta(float yaw_dp, float pitch_dp) noexcept; +bool consume_delta(float& yaw_dp, float& pitch_dp) noexcept; +void clear() noexcept; + +} // namespace dusk::touch_camera diff --git a/src/dusk/ui/achievements.cpp b/src/dusk/ui/achievements.cpp index b631d444f5..9d25f1d82a 100644 --- a/src/dusk/ui/achievements.cpp +++ b/src/dusk/ui/achievements.cpp @@ -217,7 +217,7 @@ void AchievementsWindow::updateTotal() { return; } const auto all = AchievementSystem::get().getAchievements(); - int total = static_cast(all.size()); + const int total = std::count_if(all.begin(), all.end(), [](const Achievement& achievement){ return achievement.category != AchievementCategory::Glitched;}); int unlocked = 0; for (const auto& a : all) { if (a.unlocked) { diff --git a/src/dusk/ui/bool_button.cpp b/src/dusk/ui/bool_button.cpp index 2ed088542a..564818b85b 100644 --- a/src/dusk/ui/bool_button.cpp +++ b/src/dusk/ui/bool_button.cpp @@ -12,7 +12,8 @@ BoolButton::BoolButton(Rml::Element* parent, Props props) .icon = std::move(props.icon), }), mGetValue(std::move(props.getValue)), mSetValue(std::move(props.setValue)), - mIsDisabled(std::move(props.isDisabled)), mIsModified(std::move(props.isModified)) {} + mIsDisabled(std::move(props.isDisabled)), mIsModified(std::move(props.isModified)), + mValueOverride(std::move(props.valueOverride)) {} bool BoolButton::modified() const { if (mIsModified) { @@ -29,6 +30,12 @@ bool BoolButton::disabled() const { } Rml::String BoolButton::format_value() { + if (mValueOverride) { + if (std::string value = mValueOverride(); !value.empty()) { + return value; + } + } + return mGetValue() ? "On" : "Off"; } diff --git a/src/dusk/ui/bool_button.hpp b/src/dusk/ui/bool_button.hpp index a6bd133c44..96b0743a16 100644 --- a/src/dusk/ui/bool_button.hpp +++ b/src/dusk/ui/bool_button.hpp @@ -12,6 +12,7 @@ public: std::function setValue; std::function isDisabled; std::function isModified; + std::function valueOverride; }; BoolButton(Rml::Element* parent, Props props); @@ -28,6 +29,7 @@ private: std::function mSetValue; std::function mIsDisabled; std::function mIsModified; + std::function mValueOverride; }; } // namespace dusk::ui diff --git a/src/dusk/ui/button.hpp b/src/dusk/ui/button.hpp index bf97a66e6e..f2c9756c98 100644 --- a/src/dusk/ui/button.hpp +++ b/src/dusk/ui/button.hpp @@ -19,8 +19,6 @@ public: void set_text(const Rml::String& text); Button& on_pressed(ButtonCallback callback); - const Rml::String& get_text() const { return mProps.text; } - private: void update_props(Props props); diff --git a/src/dusk/ui/controller_config.cpp b/src/dusk/ui/controller_config.cpp index aef911f996..b57b16eba5 100644 --- a/src/dusk/ui/controller_config.cpp +++ b/src/dusk/ui/controller_config.cpp @@ -17,6 +17,7 @@ #include "dusk/action_bindings.h" #include "dusk/config.hpp" +#include "dusk/gamepad_color.h" namespace dusk::ui { namespace { @@ -37,7 +38,7 @@ Rml::String current_controller_name(int port) { Rml::String controller_index_name(u32 index) { const char* name = PADGetNameForControllerIndex(index); if (name == nullptr) { - return fmt::format("Controller {}", index + 1); + return fmt::format("Device {}", index + 1); } return name; } @@ -124,7 +125,7 @@ Rml::String native_axis_name(const PADAxisMapping& mapping, SDL_Gamepad* gamepad return native_button_name(gamepad, static_cast(mapping.nativeButton)); } - return "Not bound"; + return "Not Bound"; } bool is_dpad_button(PADButton button) { @@ -162,7 +163,7 @@ bool keyboard_escape_pressed() { Rml::String keyboard_key_name(s32 scancode) { if (scancode == PAD_KEY_INVALID) { - return "Not bound"; + return "Not Bound"; } switch (scancode) { case PAD_KEY_MOUSE_LEFT: @@ -242,11 +243,7 @@ int rumble_raw_to_percent(u16 raw) { } // namespace -ControllerConfigWindow::ControllerConfigWindow(bool prelaunch) { - if (prelaunch) { - mSuppressNavFallback = true; - } - +ControllerConfigWindow::ControllerConfigWindow() { listen( Rml::EventId::Keydown, [this](Rml::Event& event) { @@ -254,7 +251,9 @@ ControllerConfigWindow::ControllerConfigWindow(bool prelaunch) { event.StopPropagation(); } }, - true); + true + ); + if (auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr) { if (auto* root = context->GetRootElement()) { mListeners.emplace_back(std::make_unique( @@ -275,6 +274,7 @@ ControllerConfigWindow::ControllerConfigWindow(bool prelaunch) { void ControllerConfigWindow::hide(bool close) { stop_rumble_test(); cancel_pending_binding(); + config::save(); Window::hide(close); } @@ -303,7 +303,7 @@ void ControllerConfigWindow::build_port_tab(Rml::Element* content, int port) { }); }; - addPageButton(Page::Controller, "Controller", [port] { return current_controller_name(port); }, [] { return false; }); + addPageButton(Page::Controller, "Device", [port] { return current_controller_name(port); }, [] { return false; }); addPageButton(Page::Buttons, "Buttons", [] { return Rml::String(">"); }, [] { return false; }); addPageButton(Page::Triggers, "Triggers", [] { return Rml::String(">"); }, [] { return false; }); addPageButton(Page::Sticks, "Sticks", [] { return Rml::String(">"); }, [] { return false; }); @@ -311,6 +311,28 @@ void ControllerConfigWindow::build_port_tab(Rml::Element* content, int port) { addPageButton(Page::Actions, "Custom Action Bindings", [] {return Rml::String(">"); }, [] { return false; }); leftPane.add_section("Options"); + leftPane.register_control(leftPane.add_child(BoolButton::Props{ + .key = "Enable LED Status", + .getValue = + [port] { + return getSettings().game.enableLED[port].getValue(); + }, + .setValue = + [port](const bool value) { + getSettings().game.enableLED[port].setValue(value); + }, + .isDisabled = [port] { + return !input::pad_has_led(port); + }, + .valueOverride = [port] { + if (!input::pad_has_led(port)) + return "Not Supported"; + + return ""; + }}), + rightPane, [](Pane& pane) { + pane.add_text("Sets the controller's lighting color based on the game's state."); + }); leftPane.register_control(leftPane.add_child(BoolButton::Props{ .key = "Enable Dead Zones", .getValue = @@ -349,7 +371,14 @@ void ControllerConfigWindow::build_port_tab(Rml::Element* content, int port) { rightPane, [](Pane& pane) { pane.add_text("Treat analog trigger movement as digital L and R button input."); }); - + leftPane.register_control(leftPane.add_button("Restore Default Controls").on_pressed([this, port] { + mDoAud_seStartMenu(kSoundClick); + PADRestoreDefaultMapping(port); + }), + rightPane, [](Pane& pane) { + pane.clear(); + pane.add_text("Restores all binding configurations for the currently selected device to their defaults."); + }); render_page(rightPane, port, mPage); } @@ -365,12 +394,13 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { [port] { return PADGetIndexForPort(port) < 0 && !keyboard_active(port); }, }) .on_pressed([this, port] { - mDoAud_seStartMenu(kSoundItemChange); + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); PADClearPort(port); PADSetKeyboardActive(static_cast(port), FALSE); PADSerializeMappings(); - ClearAllActionBindings(port); + config::ClearAllActionBindings(port); + refresh_controller_page(); }); pane.add_button({ @@ -378,17 +408,17 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { .isSelected = [port] { return keyboard_active(port); }, }) .on_pressed([this, port] { - mDoAud_seStartMenu(kSoundItemChange); + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); PADClearPort(port); PADSetKeyboardActive(static_cast(port), TRUE); PADSerializeMappings(); - ClearAllActionBindings(port); + config::ClearAllActionBindings(port); }); const u32 controllerCount = PADCount(); if (controllerCount == 0) { - pane.add_text("No controllers detected"); + pane.add_text("No Device Detected"); break; } @@ -400,12 +430,12 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { [port, i] { return PADGetIndexForPort(port) == static_cast(i); }, }) .on_pressed([this, port, i] { - mDoAud_seStartMenu(kSoundItemChange); + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); PADSetKeyboardActive(static_cast(port), FALSE); PADSetPortForIndex(i, port); PADSerializeMappings(); - ClearAllActionBindings(port); + config::ClearAllActionBindings(port); }); } break; @@ -425,17 +455,18 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { PADKeyButtonBinding* bindings = PADGetKeyButtonBindings(static_cast(port), &count); if (bindings == nullptr) { - return Rml::String("Not bound"); + return Rml::String("Not Bound"); } for (u32 i = 0; i < PAD_BUTTON_COUNT; ++i) { if (bindings[i].padButton == button) { return keyboard_key_name(bindings[i].scancode); } } - return Rml::String("Not bound"); + return Rml::String("Not Bound"); }, }) .on_pressed([this, port, button] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -462,7 +493,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { u32 buttonCount = 0; PADButtonMapping* mappings = PADGetButtonMappings(port, &buttonCount); if (mappings == nullptr) { - pane.add_text("No controller selected"); + pane.add_text("No Device Selected"); break; } @@ -486,6 +517,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { }, }) .on_pressed([this, port, &mapping] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -512,6 +544,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { }, }) .on_pressed([this, port, &mapping] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -535,17 +568,18 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { PADKeyButtonBinding* bindings = PADGetKeyButtonBindings(static_cast(port), &count); if (bindings == nullptr) { - return Rml::String("Not bound"); + return Rml::String("Not Bound"); } for (u32 i = 0; i < PAD_BUTTON_COUNT; ++i) { if (bindings[i].padButton == button) { return keyboard_key_name(bindings[i].scancode); } } - return Rml::String("Not bound"); + return Rml::String("Not Bound"); }, }) .on_pressed([this, port, button] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -566,17 +600,18 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { PADKeyAxisBinding* bindings = PADGetKeyAxisBindings(static_cast(port), &count); if (bindings == nullptr) { - return Rml::String("Not bound"); + return Rml::String("Not Bound"); } for (u32 i = 0; i < PAD_AXIS_COUNT; ++i) { if (bindings[i].padAxis == axis) { return keyboard_key_name(bindings[i].scancode); } } - return Rml::String("Not bound"); + return Rml::String("Not Bound"); }, }) .on_pressed([this, port, axis] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -599,7 +634,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { u32 buttonCount = 0; PADButtonMapping* buttons = PADGetButtonMappings(port, &buttonCount); if (axes == nullptr && buttons == nullptr) { - pane.add_text("No controller selected"); + pane.add_text("No Device Selected"); break; } @@ -623,6 +658,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { }, }) .on_pressed([this, port, &mapping] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -631,30 +667,33 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { } } - pane.add_section("Digital"); - if (buttons != nullptr) { - for (u32 i = 0; i < buttonCount; ++i) { - PADButtonMapping& mapping = buttons[i]; - if (mapping.padButton != PAD_TRIGGER_L && mapping.padButton != PAD_TRIGGER_R) { - continue; + if (getSettings().backend.enableAdvancedSettings) { + pane.add_section("Digital"); + if (buttons != nullptr) { + for (u32 i = 0; i < buttonCount; ++i) { + PADButtonMapping& mapping = buttons[i]; + if (mapping.padButton != PAD_TRIGGER_L && mapping.padButton != PAD_TRIGGER_R) { + continue; + } + pane.add_select_button({ + .key = PADGetButtonName(mapping.padButton), + .getValue = + [this, &mapping, gamepad] { + if (mPendingButtonMapping == &mapping) { + return pending_button_label(); + } + return native_button_name( + gamepad, mapping.nativeButton); + }, + }) + .on_pressed([this, port, &mapping] { + mDoAud_seStartMenu(kSoundClick); + cancel_pending_binding(); + mPendingPort = port; + mPendingBindingArmed = false; + mPendingButtonMapping = &mapping; + }); } - pane.add_select_button({ - .key = PADGetButtonName(mapping.padButton), - .getValue = - [this, &mapping, gamepad] { - if (mPendingButtonMapping == &mapping) { - return pending_button_label(); - } - return native_button_name( - gamepad, mapping.nativeButton); - }, - }) - .on_pressed([this, port, &mapping] { - cancel_pending_binding(); - mPendingPort = port; - mPendingBindingArmed = false; - mPendingButtonMapping = &mapping; - }); } } @@ -706,17 +745,18 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { PADKeyAxisBinding* bindings = PADGetKeyAxisBindings(static_cast(port), &count); if (bindings == nullptr) { - return Rml::String("Not bound"); + return Rml::String("Not Bound"); } for (u32 i = 0; i < PAD_AXIS_COUNT; ++i) { if (bindings[i].padAxis == axis) { return keyboard_key_name(bindings[i].scancode); } } - return Rml::String("Not bound"); + return Rml::String("Not Bound"); }, }) .on_pressed([this, port, axis] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -741,7 +781,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { u32 axisCount = 0; PADAxisMapping* axes = PADGetAxisMappings(port, &axisCount); if (axes == nullptr) { - pane.add_text("No controller selected"); + pane.add_text("No Device Selected"); break; } @@ -762,6 +802,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { }, }) .on_pressed([this, port, &mapping] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -816,6 +857,20 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { break; } case Page::Rumble: { + if (PADCanForceDeviceRumble(static_cast(port))) { + pane.add_child(BoolButton::Props{ + .key = "Use Device Haptics", + .getValue = [port] { return PADGetForceDeviceRumble(static_cast(port)); }, + .setValue = + [port](bool value) { + PADSetForceDeviceRumble(static_cast(port), value ? TRUE : FALSE); + PADSerializeMappings(); + }, + .isDisabled = [this] { return mRumbleTestActive; }, + }); + pane.add_text("Use native device haptics instead of controller rumble. " + "Useful for devices with built-in gamepads."); + } auto& rumbleTest = pane.add_select_button({ .key = "Test Rumble", .getValue = @@ -907,6 +962,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { }, }) .on_pressed([this, port, actionBind] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -926,7 +982,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { u32 buttonCount = 0; PADButtonMapping* mappings = PADGetButtonMappings(port, &buttonCount); if (mappings == nullptr) { - pane.add_text("No controller selected"); + pane.add_text("No Device Selected"); break; } @@ -950,6 +1006,7 @@ void ControllerConfigWindow::render_page(Pane& pane, int port, Page page) { }, }) .on_pressed([this, port, actionBind] { + mDoAud_seStartMenu(kSoundClick); cancel_pending_binding(); mPendingPort = port; mPendingBindingArmed = false; @@ -1013,6 +1070,12 @@ void ControllerConfigWindow::poll_pending_binding() { const s32 nativeButton = PADGetNativeButtonPressed(mPendingPort); if (nativeButton != -1) { const int completedPort = mPendingPort; + if (mPendingButtonMapping->nativeButton == static_cast(nativeButton) && + (mPendingButtonMapping->padButton != PAD_BUTTON_A && + mPendingButtonMapping->padButton != PAD_BUTTON_B)) { + unmap_pending_binding(); + return; + } mPendingButtonMapping->nativeButton = static_cast(nativeButton); finish_pending_binding(completedPort); } @@ -1023,6 +1086,10 @@ void ControllerConfigWindow::poll_pending_binding() { const PADSignedNativeAxis nativeAxis = PADGetNativeAxisPulled(mPendingPort); if (nativeAxis.nativeAxis != -1) { const int completedPort = mPendingPort; + if (mPendingAxisMapping->nativeAxis.nativeAxis == nativeAxis.nativeAxis) { + unmap_pending_binding(); + return; + } mPendingAxisMapping->nativeAxis = nativeAxis; mPendingAxisMapping->nativeButton = -1; finish_pending_binding(completedPort); @@ -1049,8 +1116,12 @@ void ControllerConfigWindow::poll_pending_binding() { if (button != -1) { const int completedPort = mPendingPort; + if (mPendingActionBinding->getValue() == button) { + unmap_pending_binding(); + return; + } mPendingActionBinding->setValue(button); - config::Save(); + config::save(); finish_pending_binding(completedPort); } return; @@ -1058,6 +1129,7 @@ void ControllerConfigWindow::poll_pending_binding() { } void ControllerConfigWindow::finish_pending_binding(int completedPort) { + mDoAud_seStartMenu(kSoundBindingChanged); mPendingButtonMapping = nullptr; mPendingAxisMapping = nullptr; mPendingActionBinding = nullptr; @@ -1110,11 +1182,11 @@ bool ControllerConfigWindow::pending_input_neutral() const { } Rml::String ControllerConfigWindow::pending_button_label() const { - return mPendingBindingArmed ? "Press a button..." : "Waiting..."; + return mPendingBindingArmed ? "Press a Key or Button..." : "Waiting..."; } Rml::String ControllerConfigWindow::pending_axis_label() const { - return mPendingBindingArmed ? "Move axis or press a button..." : "Waiting..."; + return mPendingBindingArmed ? "Move Axis or press a Key or Button..." : "Waiting..."; } void ControllerConfigWindow::cancel_pending_binding() { @@ -1143,7 +1215,7 @@ void ControllerConfigWindow::finish_pending_key_binding() { } Rml::String ControllerConfigWindow::pending_key_label() const { - return mPendingBindingArmed ? "Press a key or mouse button..." : "Waiting..."; + return mPendingBindingArmed ? "Press a Key or Mouse Button..." : "Waiting..."; } void ControllerConfigWindow::stop_rumble_test() { @@ -1159,7 +1231,7 @@ void ControllerConfigWindow::stop_rumble_test() { Rml::String native_button_name(SDL_Gamepad* gamepad, u32 buttonUntyped) { if (buttonUntyped == PAD_NATIVE_BUTTON_INVALID) { - return "Not bound"; + return "Not Bound"; } auto button = static_cast(buttonUntyped); diff --git a/src/dusk/ui/controller_config.hpp b/src/dusk/ui/controller_config.hpp index b5a50ad8b1..e5e5f20cfc 100644 --- a/src/dusk/ui/controller_config.hpp +++ b/src/dusk/ui/controller_config.hpp @@ -9,7 +9,7 @@ namespace dusk::ui { class ControllerConfigWindow : public Window { public: - ControllerConfigWindow(bool prelaunch); + ControllerConfigWindow(); void update() override; void hide(bool close) override; diff --git a/src/dusk/ui/controls.hpp b/src/dusk/ui/controls.hpp new file mode 100644 index 0000000000..5b03bf179a --- /dev/null +++ b/src/dusk/ui/controls.hpp @@ -0,0 +1,196 @@ +#pragma once + +#include + +namespace dusk::ui { + +struct EquipTarget { + float left = 0.0f; + float top = 0.0f; + float width = 0.0f; + float height = 0.0f; + bool valid = false; +}; + +enum class Control { + A, + B, + X, + Y, + Z, + L, + R, + FIRST_PERSON, + ITEMS, + COLLECTIONS, + MAP, + SKIP, + DPAD_UP, + DPAD_DOWN, + DPAD_LEFT, + DPAD_RIGHT, + COUNT, +}; + +enum class ControlAnchor : u8 { + None, + Top, + Left, + Bottom, + Right, + TopLeft, + TopRight, + BottomLeft, + BottomRight, +}; + +struct ControlProps { + float x = 0.0f; + float y = 0.0f; + float w = 0.0f; + float h = 0.0f; + float scale = 1.0f; + ControlAnchor anchor = ControlAnchor::None; + + bool operator==(const ControlProps&) const = default; +}; + +struct ControlRect { + float l = 0.0f; + float t = 0.0f; + float w = 0.0f; + float h = 0.0f; +}; + +struct ResolvedControlLayout { + ControlRect visual; + ControlRect box; + float scale = 1.0f; +}; + +struct ControlLayoutSize { + float w = 0.0f; + float h = 0.0f; +}; + +struct ControlLayout { + static constexpr int Version = 1; + + int version = Version; + std::map > controls; + + bool operator==(const ControlLayout&) const = default; +}; + +constexpr std::array kControlLayoutIds = { + "actionBar", + "buttonA", + "buttonB", + "buttonX", + "buttonY", + "buttonZ", + "skip", + "triggerL", + "triggerR", +}; + +constexpr bool is_control_layout_id(std::string_view id) noexcept { + for (const auto knownId : kControlLayoutIds) { + if (id == knownId) { + return true; + } + } + return false; +} + +constexpr ControlRect resolve_anchored_rect( + ControlAnchor anchor, float x, float y, float w, float h, ControlLayoutSize docSize) noexcept { + switch (anchor) { + case ControlAnchor::None: + return {x * docSize.w - w * 0.5f, y * docSize.h - h * 0.5f, w, h}; + case ControlAnchor::Top: + return {x * docSize.w - w * 0.5f, y, w, h}; + case ControlAnchor::Bottom: + return {x * docSize.w - w * 0.5f, docSize.h - y - h, w, h}; + case ControlAnchor::Left: + return {x, y * docSize.h - h * 0.5f, w, h}; + case ControlAnchor::Right: + return {docSize.w - x - w, y * docSize.h - h * 0.5f, w, h}; + case ControlAnchor::TopLeft: + return {x, y, w, h}; + case ControlAnchor::TopRight: + return {docSize.w - x - w, y, w, h}; + case ControlAnchor::BottomLeft: + return {x, docSize.h - y - h, w, h}; + case ControlAnchor::BottomRight: + return {docSize.w - x - w, docSize.h - y - h, w, h}; + } + return {}; +} + +constexpr ResolvedControlLayout resolve_control_layout( + ControlProps props, ControlLayoutSize docSize) noexcept { + const float visualW = props.w * props.scale; + const float visualH = props.h * props.scale; + const ControlRect visual = + resolve_anchored_rect(props.anchor, props.x, props.y, visualW, visualH, docSize); + const ControlRect box = { + visual.l + (visual.w - props.w) * 0.5f, + visual.t + (visual.h - props.h) * 0.5f, + props.w, + props.h, + }; + return { + .visual = visual, + .box = box, + .scale = props.scale, + }; +} + +constexpr ControlProps encode_control_props(ControlRect visual, ControlLayoutSize docSize, + ControlProps props, ControlAnchor anchor) noexcept { + props.anchor = anchor; + + switch (anchor) { + case ControlAnchor::None: + props.x = (visual.l + visual.w * 0.5f) / docSize.w; + props.y = (visual.t + visual.h * 0.5f) / docSize.h; + break; + case ControlAnchor::Top: + props.x = (visual.l + visual.w * 0.5f) / docSize.w; + props.y = visual.t; + break; + case ControlAnchor::Bottom: + props.x = (visual.l + visual.w * 0.5f) / docSize.w; + props.y = docSize.h - visual.t - visual.h; + break; + case ControlAnchor::Left: + props.x = visual.l; + props.y = (visual.t + visual.h * 0.5f) / docSize.h; + break; + case ControlAnchor::Right: + props.x = docSize.w - visual.l - visual.w; + props.y = (visual.t + visual.h * 0.5f) / docSize.h; + break; + case ControlAnchor::TopLeft: + props.x = visual.l; + props.y = visual.t; + break; + case ControlAnchor::TopRight: + props.x = docSize.w - visual.l - visual.w; + props.y = visual.t; + break; + case ControlAnchor::BottomLeft: + props.x = visual.l; + props.y = docSize.h - visual.t - visual.h; + break; + case ControlAnchor::BottomRight: + props.x = docSize.w - visual.l - visual.w; + props.y = docSize.h - visual.t - visual.h; + break; + } + + return props; +} + +} // namespace dusk::ui diff --git a/src/dusk/ui/document.cpp b/src/dusk/ui/document.cpp index 4296ac27d9..2b387f3fe9 100644 --- a/src/dusk/ui/document.cpp +++ b/src/dusk/ui/document.cpp @@ -3,9 +3,9 @@ #include "aurora/rmlui.hpp" #include "ui.hpp" -#include "Z2AudioLib/Z2SeMgr.h" #include "m_Do/m_Do_audio.h" -#include + +#include namespace dusk::ui { namespace { @@ -20,32 +20,47 @@ Rml::ElementDocument* load_document(const Rml::String& source) { } // namespace -Document::Document(const Rml::String& source) : mDocument(load_document(source)) { +Document::Document(const Rml::String& source, bool passive, DocumentScope scope) + : mDocument(load_document(source)), mScope(scope), mPassive(passive) { + if (mDocument != nullptr) { + if (const auto* base = mDocument->GetStyleSheetContainer()) { + // Clone a pristine snapshot to rebuild from on every restyle + mBaseStyleSheets = base->CombineStyleSheetContainer(Rml::StyleSheetContainer{}); + } + apply_scoped_styles(*this); + } + // Block events while hidden (except for Menu command); play nav sounds when visible listen( Rml::EventId::Keydown, [this](Rml::Event& event) { + if (mPassive) { + return; + } const auto cmd = map_nav_event(event); - if (cmd != NavCommand::Menu && !visible()) { + if (cmd != NavCommand::Menu && (!visible() || !active())) { event.StopImmediatePropagation(); } }, true); - const auto blockUnlessVisible = [this](Rml::Event& event) { - if (!visible()) { + const auto blockUnlessActive = [this](Rml::Event& event) { + if (!visible() || !active()) { event.StopImmediatePropagation(); } }; - listen(Rml::EventId::Mouseover, blockUnlessVisible, true); - listen(Rml::EventId::Click, blockUnlessVisible, true); - listen(Rml::EventId::Scroll, blockUnlessVisible, true); + listen(Rml::EventId::Mouseover, blockUnlessActive, true); + listen(Rml::EventId::Click, blockUnlessActive, true); + listen(Rml::EventId::Scroll, blockUnlessActive, true); listen(Rml::EventId::Keydown, [this](Rml::Event& event) { - const auto cmd = map_nav_event(event); - if (cmd == NavCommand::None) { + if (mPassive) { + auto* doc = top_document(); + if (doc != nullptr && doc->handle_nav_event(event)) { + event.StopPropagation(); + } return; } - if (handle_nav_command(event, cmd)) { + if (handle_nav_event(event)) { event.StopPropagation(); } }); @@ -86,6 +101,51 @@ bool Document::focus() { return false; } +bool Document::set_document_styles(const Rml::String& rcss) { + if (rcss.empty()) { + mDocumentStyleSheets = nullptr; + } else { + auto sheet = Rml::Factory::InstanceStyleSheetString(rcss); + if (sheet == nullptr) { + return false; + } + mDocumentStyleSheets = std::move(sheet); + } + apply_scoped_styles(*this); + return true; +} + +void Document::restyle(std::span sheets) { + if (mDocument == nullptr) { + return; + } + const bool wantsExtra = + mDocumentStyleSheets != nullptr || + std::ranges::any_of(sheets, [](const auto* sheet) { return sheet != nullptr; }); + // Nothing to add + if (!wantsExtra && !mRestyled) { + return; + } + auto combined = mBaseStyleSheets; + const auto combine = [&combined](const Rml::StyleSheetContainer& sheet) { + if (combined != nullptr) { + combined = combined->CombineStyleSheetContainer(sheet); + } else { + combined = sheet.CombineStyleSheetContainer(Rml::StyleSheetContainer{}); + } + }; + for (const auto* sheet : sheets) { + if (sheet != nullptr) { + combine(*sheet); + } + } + if (mDocumentStyleSheets != nullptr) { + combine(*mDocumentStyleSheets); + } + mDocument->SetStyleSheetContainer(std::move(combined)); + mRestyled = wantsExtra; +} + void Document::listen(Rml::Element* element, Rml::EventId event, ScopedEventListener::Callback callback, bool capture) { if (element == nullptr) { @@ -98,6 +158,18 @@ void Document::listen(Rml::Element* element, Rml::EventId event, std::make_unique(element, event, std::move(callback), capture)); } +void Document::listen(Rml::Element* element, const Rml::String& event, + ScopedEventListener::Callback callback, bool capture) { + if (element == nullptr) { + element = mDocument; + } + if (element == nullptr || event.empty() || !callback) { + return; + } + mListeners.emplace_back( + std::make_unique(element, event, std::move(callback), capture)); +} + bool Document::visible() const { if (mDocument == nullptr) { return false; @@ -105,9 +177,26 @@ bool Document::visible() const { return *mDocument->GetProperty(Rml::PropertyId::Visibility) == Rml::Style::Visibility::Visible; } +bool Document::active() const { + return !mClosed && !mPendingClose; +} + +bool Document::handle_nav_event(Rml::Event& event) { + if (!active()) { + return false; + } + const auto cmd = map_nav_event(event); + if (cmd == NavCommand::None || (cmd != NavCommand::Menu && !visible())) { + return false; + } + return handle_nav_command(event, cmd); +} + bool Document::handle_nav_command(Rml::Event& event, NavCommand cmd) { if (cmd == NavCommand::Menu) { - toggle_cursor_if_gyro(!visible()); + if (game_obscured_below(*this)) { + return true; + } mDoAud_seStartMenu(visible() ? kSoundMenuClose : kSoundMenuOpen); toggle(); return true; @@ -115,17 +204,4 @@ bool Document::handle_nav_command(Rml::Event& event, NavCommand cmd) { return false; } -void Document::toggle_cursor_if_gyro(bool cursor_enabled) { - if (dusk::getSettings().game.gyroMode.getValue() == GyroMode::Mouse) - { - if (cursor_enabled) { - ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouseCursorChange; - SDL_ShowCursor(); - } else { - ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange; - SDL_HideCursor(); - } - } -} - } // namespace dusk::ui diff --git a/src/dusk/ui/document.hpp b/src/dusk/ui/document.hpp index eed489beb3..e7bd35947d 100644 --- a/src/dusk/ui/document.hpp +++ b/src/dusk/ui/document.hpp @@ -3,11 +3,14 @@ #include "component.hpp" #include "ui.hpp" +#include + namespace dusk::ui { class Document { public: - Document(const Rml::String& source); + explicit Document( + const Rml::String& source, bool passive = false, DocumentScope scope = DocumentScope::None); virtual ~Document(); Document(const Document&) = delete; @@ -18,12 +21,34 @@ public: virtual void update(); virtual bool focus(); virtual bool visible() const; + virtual bool active() const; + virtual bool obscures_game() const { return false; } + virtual void cover() { + mWasVisible = visible(); + hide(false); + } + virtual void uncover() { + if (mWasVisible) { + show(); + } else { + focus(); + } + } + DocumentScope scope() const { return mScope; } + bool set_document_styles(const Rml::String& rcss); + void restyle(std::span sheets); void listen(Rml::Element* element, Rml::EventId event, ScopedEventListener::Callback callback, bool capture = false); + void listen(Rml::Element* element, const Rml::String& event, + ScopedEventListener::Callback callback, bool capture = false); void listen(Rml::EventId event, ScopedEventListener::Callback callback, bool capture = false) { listen(mDocument, event, std::move(callback), capture); } + void listen( + const Rml::String& event, ScopedEventListener::Callback callback, bool capture = false) { + listen(mDocument, event, std::move(callback), capture); + } void toggle() { if (visible()) { hide(false); @@ -33,25 +58,30 @@ public: } void push(std::unique_ptr document) { push_document(std::move(document)); - hide(false); + cover(); } void pop() { hide(true); - show_top_document(); + uncover_top_document(); } - bool pending_close() const { return mPendingClose; } bool closed() const { return mClosed; } - void toggle_cursor_if_gyro(bool); + bool handle_nav_event(Rml::Event& event); protected: virtual bool handle_nav_command(Rml::Event& event, NavCommand cmd); Rml::ElementDocument* mDocument; - std::vector > mListeners; + std::vector> mListeners; + Rml::SharedPtr mBaseStyleSheets; + Rml::SharedPtr mDocumentStyleSheets; + DocumentScope mScope = DocumentScope::None; bool mPendingClose = false; bool mClosed = false; + bool mPassive = false; + bool mRestyled = false; + bool mWasVisible = false; }; } // namespace dusk::ui diff --git a/src/dusk/ui/editor.cpp b/src/dusk/ui/editor.cpp index bd6dc3e067..8aa3c3894d 100644 --- a/src/dusk/ui/editor.cpp +++ b/src/dusk/ui/editor.cpp @@ -196,7 +196,7 @@ Rml::String get_player_name() { if (!has_save_data()) { return ""; } - return dComIfGs_getPlayerName(); + return dComIfGs_getPlayerName().buffer; } void set_player_name(Rml::String name) { @@ -207,7 +207,7 @@ Rml::String get_horse_name() { if (!has_save_data()) { return ""; } - return dComIfGs_getHorseName(); + return dComIfGs_getHorseName().buffer; } void set_horse_name(Rml::String name) { @@ -1501,14 +1501,14 @@ EditorWindow::EditorWindow() { .getValue = [] { return std::popcount(static_cast( - get_player_status_b()->mTransformLevelFlag & 0x7)); + get_player_status_b()->mTransformLevelFlag & 0xF)); }, .setValue = [](int value) { get_player_status_b()->mTransformLevelFlag = static_cast((1u << value) - 1u); }, - .max = 3, + .max = 4, }), rightPane, {}); leftPane.register_control( diff --git a/src/dusk/ui/graphics_tuner.cpp b/src/dusk/ui/graphics_tuner.cpp index 440d9f312a..cddcf06330 100644 --- a/src/dusk/ui/graphics_tuner.cpp +++ b/src/dusk/ui/graphics_tuner.cpp @@ -3,12 +3,15 @@ #include "Z2AudioLib/Z2SeMgr.h" #include "m_Do/m_Do_audio.h" +#include +#include #include #include #include #include "dusk/config.hpp" #include "dusk/settings.h" +#include "dusk/texture_replacements.hpp" #include #include @@ -43,12 +46,18 @@ int get_value(GraphicsOption option) { return getSettings().game.internalResolutionScale.getValue(); case GraphicsOption::ShadowResolution: return getSettings().game.shadowResolutionMultiplier.getValue(); + case GraphicsOption::Resampler: + return static_cast(getSettings().game.resampler.getValue()); case GraphicsOption::BloomMode: return static_cast(getSettings().game.bloomMode.getValue()); case GraphicsOption::BloomMultiplier: return std::clamp( static_cast(getSettings().game.bloomMultiplier.getValue() * 100.0f + 0.5f), 0, 100); + case GraphicsOption::DepthOfFieldMode: + return static_cast(getSettings().game.depthOfFieldMode.getValue()); + case GraphicsOption::TextureReplacements: + return getSettings().game.enableTextureReplacements.getValue(); } return 0; } @@ -62,15 +71,37 @@ void set_value(GraphicsOption option, int value) { case GraphicsOption::ShadowResolution: getSettings().game.shadowResolutionMultiplier.setValue(value); break; + case GraphicsOption::Resampler: { + const auto sampler = static_cast(std::clamp(value, + static_cast(Resampler::Bilinear), + static_cast(Resampler::Area))); + getSettings().game.resampler.setValue(sampler); + switch (sampler) { + case Resampler::Area: + aurora_set_resampler(SAMPLER_AREA); + break; + case Resampler::Bilinear: + default: + aurora_set_resampler(SAMPLER_BILINEAR); + break; + } + break; + } case GraphicsOption::BloomMode: getSettings().game.bloomMode.setValue(static_cast(std::clamp( value, static_cast(BloomMode::Off), static_cast(BloomMode::Dusk)))); break; + case GraphicsOption::DepthOfFieldMode: + getSettings().game.depthOfFieldMode.setValue(static_cast(std::clamp( + value, static_cast(DepthOfFieldMode::Off), static_cast(DepthOfFieldMode::Dusk)))); + break; case GraphicsOption::BloomMultiplier: getSettings().game.bloomMultiplier.setValue(std::clamp(value, 0, 100) / 100.0f); break; + case GraphicsOption::TextureReplacements: + texture_replacements::set_enabled(static_cast(value)); + break; } - config::Save(); } Rml::Element* create_stepped_carousel_root(Rml::Element* parent) { @@ -177,6 +208,14 @@ Rml::String format_graphics_setting_value(GraphicsOption option, int value) { } case GraphicsOption::ShadowResolution: return fmt::format("{}×", value); + case GraphicsOption::Resampler: + switch (static_cast(value)) { + case Resampler::Bilinear: + return "Bilinear"; + case Resampler::Area: + return "Area"; + } + break; case GraphicsOption::BloomMode: switch (static_cast(value)) { case BloomMode::Off: @@ -187,15 +226,27 @@ Rml::String format_graphics_setting_value(GraphicsOption option, int value) { return "Dusklight"; } break; + case GraphicsOption::DepthOfFieldMode: + switch (static_cast(value)) { + case DepthOfFieldMode::Off: + return "Off"; + case DepthOfFieldMode::Classic: + return "Classic"; + case DepthOfFieldMode::Dusk: + return "Dusklight"; + } + break; case GraphicsOption::BloomMultiplier: return fmt::format("{}%", value); + case GraphicsOption::TextureReplacements: + return static_cast(value) ? "On" : "Off"; } return ""; } -GraphicsTuner::GraphicsTuner(GraphicsTunerProps props, bool prelaunch) - : Document(kDocumentSource), mOption(props.option), mValueMin(props.valueMin), - mValueMax(props.valueMax), mDefaultValue(props.defaultValue), mPrelaunch(prelaunch) { +GraphicsTuner::GraphicsTuner(GraphicsTunerProps props) + : Document(kDocumentSource, false, DocumentScope::GraphicsTuner), mOption(props.option), + mValueMin(props.valueMin), mValueMax(props.valueMax), mDefaultValue(props.defaultValue) { if (mDocument == nullptr) { return; } @@ -211,7 +262,7 @@ GraphicsTuner::GraphicsTuner(GraphicsTunerProps props, bool prelaunch) SteppedCarousel::Props{ .min = mValueMin, .max = mValueMax, - .step = 1, + .step = props.step, .getValue = [this] { return get_value(mOption); }, .onChange = [this](int value) { set_value(mOption, value); }, .formatValue = @@ -249,6 +300,7 @@ void GraphicsTuner::show() { } void GraphicsTuner::hide(bool close) { + config::save(); mRoot->RemoveAttribute("open"); if (close) { mPendingClose = true; @@ -286,7 +338,7 @@ bool GraphicsTuner::handle_nav_command(Rml::Event& event, NavCommand cmd) { return true; } - return mPrelaunch ? false : Document::handle_nav_command(event, cmd); + return Document::handle_nav_command(event, cmd); } void GraphicsTuner::reset_default() { diff --git a/src/dusk/ui/graphics_tuner.hpp b/src/dusk/ui/graphics_tuner.hpp index 254aada22b..d778583b29 100644 --- a/src/dusk/ui/graphics_tuner.hpp +++ b/src/dusk/ui/graphics_tuner.hpp @@ -42,8 +42,11 @@ private: enum class GraphicsOption { InternalResolution, ShadowResolution, + Resampler, BloomMode, BloomMultiplier, + DepthOfFieldMode, + TextureReplacements, }; Rml::String format_graphics_setting_value(GraphicsOption option, int value); @@ -55,11 +58,12 @@ struct GraphicsTunerProps { int valueMin = 0; int valueMax = 0; int defaultValue = 0; + int step = 1; }; class GraphicsTuner : public Document { public: - explicit GraphicsTuner(GraphicsTunerProps props, bool prelaunch); + explicit GraphicsTuner(GraphicsTunerProps props); void show() override; void hide(bool close) override; @@ -88,7 +92,6 @@ private: std::vector > mComponents; SteppedCarousel* mCarousel; Rml::Element* mRoot; - bool mPrelaunch; }; } // namespace dusk::ui diff --git a/src/dusk/ui/icon_provider.cpp b/src/dusk/ui/icon_provider.cpp new file mode 100644 index 0000000000..b8307b92f7 --- /dev/null +++ b/src/dusk/ui/icon_provider.cpp @@ -0,0 +1,899 @@ +#include "icon_provider.hpp" + +#include "d/dolzel.h" // IWYU pragma: keep + +#ifdef AURORA_ENABLE_RMLUI + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "JSystem/J2DGraph/J2DPicture.h" +#include "JSystem/JUtility/JUTTexture.h" +#include "d/actor/d_a_alink.h" +#include "d/d_com_inf_game.h" +#include "d/d_item_data.h" +#include "d/d_meter2_info.h" +#include "d/d_pane_class.h" + +namespace dusk::ui { +namespace { + +constexpr std::string_view kScheme = "item"; +constexpr std::string_view kSourcePrefix = "item://"; +constexpr std::string_view kMeterScheme = "meter"; +constexpr std::string_view kMeterSourcePrefix = "meter://"; +constexpr size_t kItemTextureBufferSize = 0xC00; +constexpr size_t kMaxCachedIcons = 128; +constexpr uint64_t kMeterTextureSourceSlots = 8; +constexpr uint32_t kMinRenderedPaneIconSize = 128; +constexpr uint32_t kMaxRenderedPaneIconSize = 1024; + +struct alignas(32) ItemTextureBuffer { + std::array bytes{}; + + std::byte* data() noexcept { return bytes.data(); } + const std::byte* data() const noexcept { return bytes.data(); } +}; + +struct CachedIcon { + std::vector pixels; + uint32_t width = 0; + uint32_t height = 0; +}; + +struct RuntimeIconState { + CachedIcon icon; + uint64_t revision = 0; + bool valid = false; +}; + +struct LayerColors { + JUtility::TColor black; + JUtility::TColor white; + std::array corner; +}; + +struct RectF { + float left = std::numeric_limits::max(); + float top = std::numeric_limits::max(); + float right = std::numeric_limits::lowest(); + float bottom = std::numeric_limits::lowest(); + + bool valid() const noexcept { return left < right && top < bottom; } + float width() const noexcept { return right - left; } + float height() const noexcept { return bottom - top; } + + void include(float x, float y) noexcept { + if (!std::isfinite(x) || !std::isfinite(y)) { + return; + } + left = std::min(left, x); + top = std::min(top, y); + right = std::max(right, x); + bottom = std::max(bottom, y); + } + + void include(const RectF& rect) noexcept { + if (!rect.valid()) { + return; + } + include(rect.left, rect.top); + include(rect.right, rect.bottom); + } +}; + +struct PictureLayer { + J2DPicture* picture = nullptr; + RectF rect; + uint8_t alpha = 0; +}; + +struct SurfaceDeleter { + void operator()(SDL_Surface* surface) const noexcept { SDL_DestroySurface(surface); } +}; + +using SurfacePtr = std::unique_ptr; + +std::unordered_map& icon_cache() { + static auto* cache = new std::unordered_map(); + return *cache; +} + +RuntimeIconState& midna_icon_state() { + static auto* state = new RuntimeIconState(); + return *state; +} + +std::string_view strip_query(std::string_view path) noexcept { + const auto queryPos = path.find_first_of("?#"); + if (queryPos != std::string_view::npos) { + path = path.substr(0, queryPos); + } + return path; +} + +std::optional parse_item_no(std::string_view text) noexcept { + if (text.starts_with("0x") || text.starts_with("0X")) { + text.remove_prefix(2); + } + unsigned value = 0; + const auto* first = text.data(); + const auto* last = text.data() + text.size(); + const auto [ptr, ec] = std::from_chars(first, last, value, 16); + if (ec != std::errc() || ptr != last || value > 0xFF) { + return std::nullopt; + } + return static_cast(value); +} + +bool is_valid_icon_item(u8 itemNo) noexcept { + return itemNo != 0 && itemNo != dItemNo_NONE_e; +} + +u8 item_icon_texture_item(u8 itemNo) noexcept { + if (itemNo == dItemNo_LIGHT_ARROW_e) { + return dItemNo_BOW_e; + } + return itemNo; +} + +std::optional selected_slot_item(int slot) noexcept { + const u8 itemNo = dComIfGp_getSelectItem(slot); + if (!is_valid_icon_item(itemNo)) { + return std::nullopt; + } + return item_icon_texture_item(itemNo); +} + +bool is_sword_item(u8 itemNo) noexcept { + switch (itemNo) { + case dItemNo_WOOD_STICK_e: + case dItemNo_SWORD_e: + case dItemNo_MASTER_SWORD_e: + case dItemNo_LIGHT_SWORD_e: + return true; + default: + return false; + } +} + +std::optional b_button_item() noexcept { + const u8 action = dComIfGp_getAStatus(); + if (action == 0x26 || action == 0x2E) { + const u8 sword = dComIfGs_getSelectEquipSword(); + if (is_sword_item(sword)) { + return sword; + } + return std::nullopt; + } + if (action == 0x4F) { + return dItemNo_LURE_ROD_e; + } + return std::nullopt; +} + +std::optional item_for_source(std::string_view source) noexcept { + if (!source.starts_with(kSourcePrefix)) { + return std::nullopt; + } + + std::string_view path = strip_query(source.substr(kSourcePrefix.size())); + if (path.starts_with("item/")) { + path.remove_prefix(5); + const auto itemNo = parse_item_no(path); + if (itemNo && is_valid_icon_item(*itemNo)) { + return item_icon_texture_item(*itemNo); + } + return std::nullopt; + } + if (path == "slot/x") { + return selected_slot_item(0); + } + if (path == "slot/y") { + return selected_slot_item(1); + } + if (path == "button/b") { + return b_button_item(); + } + return std::nullopt; +} + +uint32_t item_revision(u8 itemNo) noexcept { + uint32_t revision = itemNo; + revision = revision * 131u + g_meter2_info.getItemType(itemNo); + + if (itemNo == dItemNo_KANTERA_e || itemNo == dItemNo_KANTERA2_e) { + revision = revision * 131u + (dComIfGs_getOil() == 0 ? 0u : 1u); + } + if (itemNo == dItemNo_COPY_ROD_e) { + auto* player = daPy_getPlayerActorClass(); + revision = revision * 131u + (player != nullptr && player->checkCopyRodTopUse() ? 1u : 0u); + } + return revision; +} + +std::string item_source_for_item(u8 itemNo) { + itemNo = item_icon_texture_item(itemNo); + return fmt::format("{}://item/{:02x}?rev={:08x}", kScheme, itemNo, item_revision(itemNo)); +} + +std::optional selected_slot_count(int slot) noexcept { + const u8 itemNo = dComIfGp_getSelectItem(slot); + if (!is_valid_icon_item(itemNo)) { + return std::nullopt; + } + if (item_icon_texture_item(itemNo) == dItemNo_KANTERA_e || + item_icon_texture_item(itemNo) == dItemNo_KANTERA2_e) + { + return std::nullopt; + } + + int count = 0; + int max = 0; + switch (itemNo) { + case dItemNo_BOW_e: + case dItemNo_LIGHT_ARROW_e: + case dItemNo_ARROW_LV1_e: + case dItemNo_ARROW_LV2_e: + case dItemNo_ARROW_LV3_e: + case dItemNo_HAWK_ARROW_e: + count = dComIfGs_getArrowNum(); + max = dComIfGs_getArrowMax(); + break; + case dItemNo_BOMB_ARROW_e: + count = std::min(dComIfGp_getSelectItemNum(slot), dComIfGs_getArrowNum()); + max = std::max(dComIfGp_getSelectItemMaxNum(slot), dComIfGs_getArrowMax()); + break; + default: + count = dComIfGp_getSelectItemNum(slot); + max = dComIfGp_getSelectItemMaxNum(slot); + break; + } + if (max <= 0) { + return std::nullopt; + } + return std::clamp(count, 0, max); +} + +aurora::gfx::ConvertedTexture decode_timg(const ResTIMG* image) { + if (image == nullptr || image->width.host() == 0 || image->height.host() == 0) { + return {}; + } + + const auto* base = reinterpret_cast(image); + const auto width = image->width.host(); + const auto height = image->height.host(); + const uint32_t textureSize = GXGetTexBufferSize(width, height, image->format, GX_FALSE, 0); + const auto* textureData = base + static_cast(image->imageOffset); + + if (image->indexTexture != 0) { + const auto* paletteData = base + static_cast(image->paletteOffset); + return aurora::gfx::convert_texture_palette(image->format, width, height, 1, + aurora::ArrayRef{textureData, textureSize}, static_cast(image->colorFormat), + image->numColors, + aurora::ArrayRef{paletteData, static_cast(image->numColors) * 2}); + } + + return aurora::gfx::convert_texture( + image->format, width, height, 1, aurora::ArrayRef{textureData, textureSize}); +} + +uint8_t lerp_u8(uint8_t a, uint8_t b, uint32_t t) noexcept { + return static_cast( + (static_cast(a) * (255u - t) + static_cast(b) * t) / 255u); +} + +JUtility::TColor lerp_color( + const JUtility::TColor& a, const JUtility::TColor& b, uint32_t t) noexcept { + return { + lerp_u8(a.r, b.r, t), + lerp_u8(a.g, b.g, t), + lerp_u8(a.b, b.b, t), + lerp_u8(a.a, b.a, t), + }; +} + +JUtility::TColor bilerp_corner( + const LayerColors& colors, uint32_t x, uint32_t y, uint32_t width, uint32_t height) noexcept { + const uint32_t u = width > 1 ? (x * 255u) / (width - 1u) : 0u; + const uint32_t v = height > 1 ? (y * 255u) / (height - 1u) : 0u; + const JUtility::TColor top = lerp_color(colors.corner[0], colors.corner[1], u); + const JUtility::TColor bottom = lerp_color(colors.corner[2], colors.corner[3], u); + return lerp_color(top, bottom, v); +} + +std::array apply_layer_colors(std::span src, + const LayerColors& colors, uint32_t x, uint32_t y, uint32_t width, uint32_t height) noexcept { + std::array out{ + lerp_u8(colors.black.r, colors.white.r, src[0]), + lerp_u8(colors.black.g, colors.white.g, src[1]), + lerp_u8(colors.black.b, colors.white.b, src[2]), + src[3], + }; + + const auto corner = bilerp_corner(colors, x, y, width, height); + out[0] = static_cast((static_cast(out[0]) * corner.r) / 255u); + out[1] = static_cast((static_cast(out[1]) * corner.g) / 255u); + out[2] = static_cast((static_cast(out[2]) * corner.b) / 255u); + out[3] = static_cast((static_cast(out[3]) * corner.a) / 255u); + return out; +} + +void blend_premultiplied(uint8_t* dst, const std::array& src) noexcept { + const uint32_t srcAlpha = src[3]; + const uint32_t invAlpha = 255u - srcAlpha; + const uint32_t srcR = (static_cast(src[0]) * srcAlpha) / 255u; + const uint32_t srcG = (static_cast(src[1]) * srcAlpha) / 255u; + const uint32_t srcB = (static_cast(src[2]) * srcAlpha) / 255u; + + dst[0] = static_cast( + std::min(255u, srcR + (static_cast(dst[0]) * invAlpha) / 255u)); + dst[1] = static_cast( + std::min(255u, srcG + (static_cast(dst[1]) * invAlpha) / 255u)); + dst[2] = static_cast( + std::min(255u, srcB + (static_cast(dst[2]) * invAlpha) / 255u)); + dst[3] = static_cast( + std::min(255u, srcAlpha + (static_cast(dst[3]) * invAlpha) / 255u)); +} + +LayerColors layer_colors(const J2DPicture& picture) noexcept { + return { + .black = picture.getBlack(), + .white = picture.getWhite(), + .corner = {picture.corner(0), picture.corner(1), picture.corner(2), picture.corner(3)}, + }; +} + +LayerColors layer_colors(J2DPicture& picture, uint8_t alpha) noexcept { + std::array corners{}; + picture.getNewColor(corners.data()); + for (auto& corner : corners) { + corner.a = static_cast((static_cast(corner.a) * alpha) / 255u); + } + return { + .black = picture.getBlack(), + .white = picture.getWhite(), + .corner = corners, + }; +} + +std::optional render_item_icon(u8 itemNo) { + std::array buffers{}; + std::array pictures{}; + + const int textureCount = + dMeter2Info_readItemTexture(itemNo, buffers[0].data(), &pictures[0], buffers[1].data(), + &pictures[1], buffers[2].data(), &pictures[2], buffers[3].data(), &pictures[3], -1); + if (textureCount <= 0) { + return std::nullopt; + } + + std::array decodedLayers{}; + std::array colors{}; + int decodedCount = 0; + for (int i = 0; i < textureCount && i < static_cast(decodedLayers.size()); ++i) { + auto decoded = decode_timg(reinterpret_cast(buffers[i].data())); + if (decoded.data.empty()) { + continue; + } + colors[decodedCount] = layer_colors(pictures[i]); + decodedLayers[decodedCount] = std::move(decoded); + ++decodedCount; + } + if (decodedCount == 0) { + return std::nullopt; + } + + CachedIcon icon{ + .width = decodedLayers[0].width, + .height = decodedLayers[0].height, + }; + icon.pixels.assign(static_cast(icon.width) * static_cast(icon.height) * 4, 0); + + for (int layer = 0; layer < decodedCount; ++layer) { + const auto& decoded = decodedLayers[layer]; + for (uint32_t y = 0; y < icon.height; ++y) { + const uint32_t sourceY = decoded.height > 0 ? (y * decoded.height) / icon.height : 0; + for (uint32_t x = 0; x < icon.width; ++x) { + const uint32_t sourceX = decoded.width > 0 ? (x * decoded.width) / icon.width : 0; + const size_t sourceOffset = + (static_cast(sourceY) * decoded.width + static_cast(sourceX)) * + 4; + if (sourceOffset + 3 >= decoded.data.size()) { + continue; + } + + const std::span sourcePixel( + decoded.data.data() + sourceOffset, 4); + const auto pixel = + apply_layer_colors(sourcePixel, colors[layer], x, y, icon.width, icon.height); + uint8_t* destination = + icon.pixels.data() + + (static_cast(y) * icon.width + static_cast(x)) * 4; + blend_premultiplied(destination, pixel); + } + } + } + + return icon; +} + +SurfacePtr create_rgba_surface(uint32_t width, uint32_t height) { + if (width == 0 || height == 0 || + width > static_cast(std::numeric_limits::max()) || + height > static_cast(std::numeric_limits::max())) + { + return {}; + } + + return SurfacePtr{SDL_CreateSurface( + static_cast(width), static_cast(height), SDL_PIXELFORMAT_RGBA32)}; +} + +bool lock_surface(SDL_Surface* surface) noexcept { + return surface != nullptr && (!SDL_MUSTLOCK(surface) || SDL_LockSurface(surface)); +} + +void unlock_surface(SDL_Surface* surface) noexcept { + if (surface != nullptr && SDL_MUSTLOCK(surface)) { + SDL_UnlockSurface(surface); + } +} + +SurfacePtr create_layer_surface( + const aurora::gfx::ConvertedTexture& decoded, const LayerColors& colors) { + if (decoded.width == 0 || decoded.height == 0 || decoded.data.empty()) { + return {}; + } + + auto surface = create_rgba_surface(decoded.width, decoded.height); + if (!surface || !lock_surface(surface.get())) { + return {}; + } + + for (uint32_t y = 0; y < decoded.height; ++y) { + auto* destination = static_cast(surface->pixels) + + static_cast(y) * static_cast(surface->pitch); + for (uint32_t x = 0; x < decoded.width; ++x) { + const size_t sourceOffset = + (static_cast(y) * decoded.width + static_cast(x)) * 4; + if (sourceOffset + 3 >= decoded.data.size()) { + continue; + } + + const std::span sourcePixel(decoded.data.data() + sourceOffset, 4); + const auto pixel = + apply_layer_colors(sourcePixel, colors, x, y, decoded.width, decoded.height); + std::memcpy(destination + static_cast(x) * 4, pixel.data(), pixel.size()); + } + } + + unlock_surface(surface.get()); + SDL_SetSurfaceBlendMode(surface.get(), SDL_BLENDMODE_BLEND); + return surface; +} + +std::optional icon_from_surface(SDL_Surface* surface) { + if (surface == nullptr || surface->w <= 0 || surface->h <= 0) { + return std::nullopt; + } + + CachedIcon icon{ + .width = static_cast(surface->w), + .height = static_cast(surface->h), + }; + const size_t rowSize = static_cast(icon.width) * 4u; + icon.pixels.resize(rowSize * static_cast(icon.height)); + + if (!lock_surface(surface)) { + return std::nullopt; + } + + for (uint32_t y = 0; y < icon.height; ++y) { + const auto* source = static_cast(surface->pixels) + + static_cast(y) * static_cast(surface->pitch); + auto* destination = icon.pixels.data() + static_cast(y) * rowSize; + std::memcpy(destination, source, rowSize); + } + + unlock_surface(surface); + return icon; +} + +RectF pane_global_rect(J2DPane* pane) noexcept { + RectF rect; + CPaneMgr paneMgr; + Mtx m; + for (u8 i = 0; i < 4; ++i) { + const Vec vertex = paneMgr.getGlobalVtx(pane, &m, i, false, 0); + rect.include(vertex.x, vertex.y); + } + return rect; +} + +uint8_t effective_pane_alpha(J2DPane& pane, uint8_t parentAlpha) noexcept { + uint32_t alpha = pane.getAlpha(); + if (pane.isInfluencedAlpha()) { + alpha = alpha * parentAlpha / 255u; + } + return static_cast(alpha); +} + +void collect_picture_layers( + J2DPane* pane, std::vector& layers, uint8_t parentAlpha = 255) noexcept { + if (pane == nullptr || !pane->isVisible()) { + return; + } + + const uint8_t paneAlpha = effective_pane_alpha(*pane, parentAlpha); + if (paneAlpha == 0) { + return; + } + + if (pane->getKind() == MULTI_CHAR('PIC1') || pane->getKind() == MULTI_CHAR('PIC2')) { + auto* picture = static_cast(pane); + if (picture->getTexture(0) != nullptr) { + RectF rect = pane_global_rect(pane); + if (rect.valid()) { + layers.push_back({ + .picture = picture, + .rect = rect, + .alpha = paneAlpha, + }); + } + } + } + + for (J2DPane* child = pane->getFirstChildPane(); child != nullptr; + child = child->getNextChildPane()) + { + collect_picture_layers(child, layers, paneAlpha); + } +} + +std::optional icon_dimension(float value) noexcept { + if (!std::isfinite(value) || value <= 0.0f) { + return std::nullopt; + } + + const auto dimension = static_cast(std::ceil(value)); + if (dimension == 0 || dimension > kMaxRenderedPaneIconSize) { + return std::nullopt; + } + return dimension; +} + +float pane_icon_render_scale(const std::vector& layers, const RectF& canvas) { + float scale = 1.0f; + for (const auto& layer : layers) { + if (layer.picture == nullptr || !layer.rect.valid() || layer.rect.width() <= 0.0f || + layer.rect.height() <= 0.0f) + { + continue; + } + + auto* texture = layer.picture->getTexture(0); + const ResTIMG* image = texture != nullptr ? texture->getTexInfo() : nullptr; + if (image == nullptr || image->width.host() == 0 || image->height.host() == 0) { + continue; + } + + scale = std::max(scale, static_cast(image->width) / layer.rect.width()); + scale = std::max(scale, static_cast(image->height) / layer.rect.height()); + } + + const float canvasMax = std::max(canvas.width(), canvas.height()); + if (canvasMax <= 0.0f) { + return scale; + } + + const float minScale = static_cast(kMinRenderedPaneIconSize) / canvasMax; + const float maxScale = static_cast(kMaxRenderedPaneIconSize) / canvasMax; + return std::clamp(std::max(scale, minScale), 1.0f, maxScale); +} + +void composite_picture_layer( + SDL_Surface& icon, const RectF& canvas, const PictureLayer& layer, float renderScale) { + if (layer.picture == nullptr || !layer.rect.valid()) { + return; + } + + auto* texture = layer.picture->getTexture(0); + if (texture == nullptr) { + return; + } + + auto decoded = decode_timg(texture->getTexInfo()); + if (decoded.data.empty() || decoded.width == 0 || decoded.height == 0) { + return; + } + + const auto colors = layer_colors(*layer.picture, layer.alpha); + auto layerSurface = create_layer_surface(decoded, colors); + if (!layerSurface) { + return; + } + + const float dstLeft = (layer.rect.left - canvas.left) * renderScale; + const float dstTop = (layer.rect.top - canvas.top) * renderScale; + const float dstRight = (layer.rect.right - canvas.left) * renderScale; + const float dstBottom = (layer.rect.bottom - canvas.top) * renderScale; + const float dstWidth = dstRight - dstLeft; + const float dstHeight = dstBottom - dstTop; + if (dstWidth <= 0.0f || dstHeight <= 0.0f) { + return; + } + + const int x0 = std::clamp(static_cast(std::floor(dstLeft)), 0, icon.w); + const int y0 = std::clamp(static_cast(std::floor(dstTop)), 0, icon.h); + const int x1 = std::clamp(static_cast(std::ceil(dstRight)), 0, icon.w); + const int y1 = std::clamp(static_cast(std::ceil(dstBottom)), 0, icon.h); + if (x0 >= x1 || y0 >= y1) { + return; + } + + SDL_Rect destinationRect{ + .x = x0, + .y = y0, + .w = x1 - x0, + .h = y1 - y0, + }; + SDL_BlitSurfaceScaled( + layerSurface.get(), nullptr, &icon, &destinationRect, SDL_SCALEMODE_LINEAR); +} + +std::optional render_j2d_pane_icon(J2DPane* pane) { + std::vector layers; + collect_picture_layers(pane, layers); + if (layers.empty()) { + return std::nullopt; + } + + RectF canvas; + for (const auto& layer : layers) { + canvas.include(layer.rect); + } + if (!canvas.valid()) { + return std::nullopt; + } + + const float renderScale = pane_icon_render_scale(layers, canvas); + auto width = icon_dimension(canvas.width() * renderScale); + auto height = icon_dimension(canvas.height() * renderScale); + if (!width || !height) { + return std::nullopt; + } + + auto surface = create_rgba_surface(*width, *height); + if (!surface) { + return std::nullopt; + } + + for (const auto& layer : layers) { + composite_picture_layer(*surface, canvas, layer, renderScale); + } + + return icon_from_surface(surface.get()); +} + +std::optional icon_provider(std::string_view source) { + const auto itemNo = item_for_source(source); + if (!itemNo) { + return std::nullopt; + } + + auto& cache = icon_cache(); + const std::string key(source); + auto it = cache.find(key); + if (it == cache.end()) { + auto icon = render_item_icon(*itemNo); + if (!icon) { + return std::nullopt; + } + if (cache.size() >= kMaxCachedIcons) { + cache.erase(cache.begin()); + } + it = cache.emplace(key, std::move(*icon)).first; + } + + const auto& icon = it->second; + return aurora::rmlui::RuntimeTexture{ + .width = icon.width, + .height = icon.height, + .rgba8 = + std::span(reinterpret_cast(icon.pixels.data()), icon.pixels.size()), + .premultipliedAlpha = true, + }; +} + +std::optional meter_texture_provider(std::string_view source) { + if (!source.starts_with(kMeterSourcePrefix)) { + return std::nullopt; + } + + const std::string name(strip_query(source.substr(kMeterSourcePrefix.size()))); + if (name != "midna") { + return std::nullopt; + } + + const auto& state = midna_icon_state(); + if (!state.valid) { + return std::nullopt; + } + + return aurora::rmlui::RuntimeTexture{ + .width = state.icon.width, + .height = state.icon.height, + .rgba8 = std::span( + reinterpret_cast(state.icon.pixels.data()), state.icon.pixels.size()), + .premultipliedAlpha = true, + }; +} + +} // namespace + +void register_icon_texture_provider() noexcept { + aurora::rmlui::register_texture_provider(std::string(kScheme), icon_provider); + aurora::rmlui::register_texture_provider(std::string(kMeterScheme), meter_texture_provider); +} + +void unregister_icon_texture_provider() noexcept { + aurora::rmlui::unregister_texture_provider(kScheme); + aurora::rmlui::unregister_texture_provider(kMeterScheme); + icon_cache().clear(); + midna_icon_state() = {}; +} + +void update_midna_icon_texture(J2DPane* pane) noexcept { + auto& state = midna_icon_state(); + if (pane == nullptr || !pane->isVisible()) { + if (state.valid) { + state.valid = false; + state.icon = {}; + state.revision++; + } + return; + } + + auto icon = render_j2d_pane_icon(pane); + if (!icon) { + if (state.valid) { + state.valid = false; + state.icon = {}; + state.revision++; + } + return; + } + + if (!state.valid || state.icon.width != icon->width || state.icon.height != icon->height || + state.icon.pixels != icon->pixels) + { + state.icon = std::move(*icon); + state.valid = true; + state.revision++; + } +} + +std::string midna_icon_source() { + const auto& state = midna_icon_state(); + if (!state.valid) { + return ""; + } + return fmt::format( + "{}://midna?slot={}", kMeterScheme, state.revision % kMeterTextureSourceSlots); +} + +uint64_t midna_icon_revision() noexcept { + const auto& state = midna_icon_state(); + return state.valid ? state.revision : 0; +} + +std::string item_icon_source_for_button(Control control) { + std::optional itemNo; + switch (control) { + case Control::X: + itemNo = selected_slot_item(0); + break; + case Control::Y: + itemNo = selected_slot_item(1); + break; + case Control::B: + itemNo = b_button_item(); + break; + default: + break; + } + if (!itemNo) { + return {}; + } + return item_source_for_item(*itemNo); +} + +std::string item_count_label_for_button(Control control) { + std::optional count; + switch (control) { + case Control::X: + count = selected_slot_count(0); + break; + case Control::Y: + count = selected_slot_count(1); + break; + default: + break; + } + if (!count) { + return {}; + } + return fmt::format("{}", *count); +} + +std::optional item_oil_fill_for_button(Control control) noexcept { + std::optional itemNo; + switch (control) { + case Control::X: + itemNo = selected_slot_item(0); + break; + case Control::Y: + itemNo = selected_slot_item(1); + break; + default: + break; + } + if (!itemNo || (*itemNo != dItemNo_KANTERA_e && *itemNo != dItemNo_KANTERA2_e)) { + return std::nullopt; + } + + const int maxOil = dComIfGs_getMaxOil(); + if (maxOil <= 0) { + return std::nullopt; + } + return std::clamp( + static_cast(dComIfGs_getOil()) / static_cast(maxOil), 0.0f, 1.0f); +} + +} // namespace dusk::ui + +#else + +namespace dusk::ui { + +void register_icon_texture_provider() noexcept {} +void unregister_icon_texture_provider() noexcept {} +void update_midna_icon_texture(J2DPane*) noexcept {} +std::string midna_icon_source() { + return {}; +} +uint64_t midna_icon_revision() noexcept { + return 0; +} +std::string item_icon_source_for_button(Control) { + return {}; +} +std::string item_count_label_for_button(Control) { + return {}; +} +std::optional item_oil_fill_for_button(Control) noexcept { + return std::nullopt; +} + +} // namespace dusk::ui + +#endif diff --git a/src/dusk/ui/icon_provider.hpp b/src/dusk/ui/icon_provider.hpp new file mode 100644 index 0000000000..a77c518992 --- /dev/null +++ b/src/dusk/ui/icon_provider.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include "controls.hpp" + +#include +#include +#include + +class J2DPane; + +namespace dusk::ui { + +void register_icon_texture_provider() noexcept; +void unregister_icon_texture_provider() noexcept; + +void update_midna_icon_texture(J2DPane* pane) noexcept; +std::string midna_icon_source(); +uint64_t midna_icon_revision() noexcept; +std::string item_icon_source_for_button(Control control); +std::string item_count_label_for_button(Control control); +std::optional item_oil_fill_for_button(Control control) noexcept; + +} // namespace dusk::ui diff --git a/src/dusk/ui/input.cpp b/src/dusk/ui/input.cpp index 02a15e9a0f..2628aeb682 100644 --- a/src/dusk/ui/input.cpp +++ b/src/dusk/ui/input.cpp @@ -454,10 +454,18 @@ bool touch_moved_too_far( return delta.SquaredMagnitude() > threshold * threshold; } -void dispatch_menu_key(Rml::Context& context) noexcept { +void emit_key_press(Rml::Context& context, Rml::Input::KeyIdentifier key) noexcept { context.ProcessMouseLeave(); - context.ProcessKeyDown(Rml::Input::KI_F1, 0); - context.ProcessKeyUp(Rml::Input::KI_F1, 0); + context.ProcessKeyDown(key, 0); +} + +void emit_key_tap(Rml::Context& context, Rml::Input::KeyIdentifier key) noexcept { + emit_key_press(context, key); + context.ProcessKeyUp(key, 0); +} + +void dispatch_menu_key(Rml::Context& context) noexcept { + emit_key_tap(context, Rml::Input::KI_F1); } bool handle_touch_menu_tap(Rml::Context& context, const SDL_Event& event) noexcept { @@ -627,7 +635,9 @@ void process_axis_direction( if (repeat->held) { if (released) { - if (!repeat->pending) { + if (repeat->pending) { + emit_key_tap(context, repeat->key); + } else { context.ProcessKeyUp(repeat->key, 0); } set_pad_button_held(port, heldPadButton, false); @@ -658,8 +668,7 @@ void process_axis_direction( } begin_gamepad_key(*repeat, key); - context.ProcessMouseLeave(); - context.ProcessKeyDown(key, 0); + emit_key_press(context, key); } } // namespace @@ -747,8 +756,7 @@ void handle_event(const SDL_Event& event) noexcept { } } if (!deferred) { - context->ProcessMouseLeave(); - context->ProcessKeyDown(key, 0); + emit_key_press(*context, key); } } } else { @@ -760,7 +768,9 @@ void handle_event(const SDL_Event& event) noexcept { if (repeat != nullptr) { *repeat = {}; } - if (!wasPending) { + if (wasPending) { + emit_key_tap(*context, key); + } else { context->ProcessKeyUp(key, 0); } } @@ -787,8 +797,7 @@ void update_input() noexcept { repeat.pressedAt = now; repeat.nextRepeatAt = repeat.repeatable ? now + kGamepadRepeatInitialDelay : 0.0; - context->ProcessMouseLeave(); - context->ProcessKeyDown(repeat.key, 0); + emit_key_press(*context, repeat.key); continue; } diff --git a/src/dusk/ui/logs_window.cpp b/src/dusk/ui/logs_window.cpp new file mode 100644 index 0000000000..0a6fc2402d --- /dev/null +++ b/src/dusk/ui/logs_window.cpp @@ -0,0 +1,296 @@ +#include "logs_window.hpp" + +#include +#include + +#include +#include + +#include "pane.hpp" + +namespace dusk::ui { +namespace { + +const char* level_name(LogLevel level) { + switch (level) { + case LOG_LEVEL_TRACE: + return "Trace"; + case LOG_LEVEL_DEBUG: + return "Debug"; + case LOG_LEVEL_INFO: + return "Info"; + case LOG_LEVEL_WARN: + return "Warn"; + case LOG_LEVEL_ERROR: + return "Error"; + } + return "?"; +} + +const char* level_logger_name(LogLevel level) { + switch (level) { + case LOG_LEVEL_TRACE: + return "TRACE"; + case LOG_LEVEL_DEBUG: + return "DEBUG"; + case LOG_LEVEL_INFO: + return "INFO"; + case LOG_LEVEL_WARN: + return "WARNING"; + case LOG_LEVEL_ERROR: + return "ERROR"; + } + return "?"; +} + +const char* level_class(LogLevel level) { + switch (level) { + case LOG_LEVEL_TRACE: + return "lvl-trace"; + case LOG_LEVEL_DEBUG: + return "lvl-debug"; + case LOG_LEVEL_INFO: + return "lvl-info"; + case LOG_LEVEL_WARN: + return "lvl-warn"; + case LOG_LEVEL_ERROR: + return "lvl-error"; + } + return "lvl-info"; +} + +std::string format_time(int64_t timeMs) { + const auto seconds = static_cast(timeMs / 1000); + std::tm localTime{}; +#if _WIN32 + localtime_s(&localTime, &seconds); +#else + localtime_r(&seconds, &localTime); +#endif + std::array buffer{}; + std::strftime(buffer.data(), buffer.size(), "%H:%M:%S", &localTime); + return fmt::format("{}.{:03}", buffer.data(), timeMs % 1000); +} + +Rml::Element* append_span(Rml::Element* parent, const char* className, const Rml::String& text) { + auto* span = append(parent, "span"); + span->SetClass(className, true); + append_text(span, text); + return span; +} + +} // namespace + +LogsWindow::LogsWindow(std::string modFilter) + : Window{Props{.tabBar = false, .styleSheets = {"res/rml/logs.rcss"}}}, + mModFilter{std::move(modFilter)} { + mRoot->SetClass("logs", true); + set_content([this](Rml::Element* content) { build_content(content); }); +} + +void LogsWindow::build_content(Rml::Element* content) { + auto* toolbar = append(content, "div"); + toolbar->SetClass("log-toolbar", true); + + auto* title = append(toolbar, "div"); + title->SetClass("log-title", true); + title->SetInnerRML("Logs"); + + auto* modLabel = append(toolbar, "div"); + modLabel->SetClass("log-title-mod", true); + modLabel->SetInnerRML(mModFilter.empty() ? "All mods" : fmt::format("{}", escape(mModFilter))); + + append(toolbar, "div")->SetClass("log-toolbar-spacer", true); + + for (const LogLevel level : + {LOG_LEVEL_TRACE, LOG_LEVEL_DEBUG, LOG_LEVEL_INFO, LOG_LEVEL_WARN, LOG_LEVEL_ERROR}) + { + add_child(toolbar, + ControlledButton::Props{ + .text = level_name(level), + .isSelected = [this, level] { return mMinLevel <= level; }, + }) + .on_pressed([this, level] { + mMinLevel = level; + rebuild_lines(); + }); + } + + append(toolbar, "div")->SetClass("log-toolbar-spacer", true); + + add_child + + + + + + + + + + + + + + + + + + +)RML"; + +} // namespace + +std::string_view touch_controls_rml_fragment() noexcept { + return kTouchControlsRmlFragment; +} + +std::span touch_layout_controls() noexcept { + return kLayoutControls; +} + +const TouchLayoutControlInfo* find_touch_layout_control(std::string_view layoutId) noexcept { + for (const auto& info : kLayoutControls) { + if (info.layoutId == layoutId) { + return &info; + } + } + return nullptr; +} + +const TouchLayoutControlInfo* find_touch_layout_control(Control control) noexcept { + for (const auto& info : kLayoutControls) { + if (info.hasControl && info.control == control) { + return &info; + } + } + return nullptr; +} + +SDL_FingerID touch_event_id(const Rml::Event& event) noexcept { + return event.GetParameter("finger_id", 0); +} + +Rml::Vector2f touch_event_position(const Rml::Event& event) noexcept { + return { + event.GetParameter("x", 0.f), + event.GetParameter("y", 0.f), + }; +} + +Rml::Vector2f mouse_event_position(const Rml::Event& event) noexcept { + return { + event.GetParameter("mouse_x", 0.f), + event.GetParameter("mouse_y", 0.f), + }; +} + +float touch_dp_scale(Rml::Context* context) noexcept { + if (context == nullptr) { + context = aurora::rmlui::get_context(); + } + if (context == nullptr) { + return 1.f; + } + return std::max(context->GetDensityIndependentPixelRatio(), 1.f); +} + +ControlLayoutSize touch_document_size_dp(Rml::Context* context) noexcept { + if (context == nullptr) { + return {}; + } + + const auto dimensions = context->GetDimensions(); + const float scale = touch_dp_scale(context); + return { + .w = static_cast(dimensions.x) / scale, + .h = static_cast(dimensions.y) / scale, + }; +} + +ControlAnchor touch_control_dock_anchor(ControlRect visual, ControlLayoutSize docSize) noexcept { + if (docSize.w <= 0.f || docSize.h <= 0.f || visual.w <= 0.f || visual.h <= 0.f) { + return ControlAnchor::None; + } + + const bool top = control_float_near(visual.t, 0.f); + const bool bottom = control_float_near(visual.t + visual.h, docSize.h); + const bool left = control_float_near(visual.l, 0.f); + const bool right = control_float_near(visual.l + visual.w, docSize.w); + + if (top && left && !right) { + return ControlAnchor::TopLeft; + } + if (top && right && !left) { + return ControlAnchor::TopRight; + } + if (bottom && left && !right) { + return ControlAnchor::BottomLeft; + } + if (bottom && right && !left) { + return ControlAnchor::BottomRight; + } + if (top) { + return ControlAnchor::Top; + } + if (bottom) { + return ControlAnchor::Bottom; + } + if (left) { + return ControlAnchor::Left; + } + if (right) { + return ControlAnchor::Right; + } + return ControlAnchor::None; +} + +bool control_float_near(float a, float b) noexcept { + return std::abs(a - b) <= 0.01f; +} + +bool control_rect_near(ControlRect a, ControlRect b) noexcept { + return control_float_near(a.l, b.l) && control_float_near(a.t, b.t) && + control_float_near(a.w, b.w) && control_float_near(a.h, b.h); +} + +void apply_control_box_if_changed( + Rml::Element* element, std::optional& appliedBox, ControlRect box) noexcept { + if (element == nullptr || (appliedBox && control_rect_near(*appliedBox, box))) { + return; + } + + element->SetProperty(Rml::PropertyId::Left, Rml::Property(box.l, Rml::Unit::DP)); + element->SetProperty(Rml::PropertyId::Top, Rml::Property(box.t, Rml::Unit::DP)); + element->SetProperty(Rml::PropertyId::Width, Rml::Property(box.w, Rml::Unit::DP)); + element->SetProperty(Rml::PropertyId::Height, Rml::Property(box.h, Rml::Unit::DP)); + appliedBox = box; +} + +void apply_control_transform_if_changed( + Rml::Element* element, std::optional& appliedTransform, float scale) noexcept { + if (element == nullptr || (appliedTransform && control_float_near(*appliedTransform, scale))) { + return; + } + + element->SetProperty(Rml::PropertyId::Transform, + Rml::Transform::MakeProperty({Rml::Transforms::Scale2D{scale}})); + appliedTransform = scale; +} + +void apply_control_dock_classes(Rml::Element* element, ControlAnchor anchor) noexcept { + if (element == nullptr) { + return; + } + + bool top = false; + bool bottom = false; + bool left = false; + bool right = false; + + switch (anchor) { + case ControlAnchor::Top: + top = true; + break; + case ControlAnchor::Bottom: + bottom = true; + break; + case ControlAnchor::Left: + left = true; + break; + case ControlAnchor::Right: + right = true; + break; + case ControlAnchor::TopLeft: + top = true; + left = true; + break; + case ControlAnchor::TopRight: + top = true; + right = true; + break; + case ControlAnchor::BottomLeft: + bottom = true; + left = true; + break; + case ControlAnchor::BottomRight: + bottom = true; + right = true; + break; + case ControlAnchor::None: + break; + } + + element->SetClass("docked", top || bottom || left || right); + element->SetClass("docked-top", top); + element->SetClass("docked-bottom", bottom); + element->SetClass("docked-left", left); + element->SetClass("docked-right", right); +} + +} // namespace dusk::ui diff --git a/src/dusk/ui/touch_controls_common.hpp b/src/dusk/ui/touch_controls_common.hpp new file mode 100644 index 0000000000..30445479ff --- /dev/null +++ b/src/dusk/ui/touch_controls_common.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "controls.hpp" + +#include +#include + +#include +#include +#include +#include + +namespace dusk::ui { + +constexpr std::size_t kTouchLayoutControlCount = 9; + +struct TouchLayoutControlInfo { + std::string_view layoutId; + const char* elementId = nullptr; + ControlProps props; + Control control = Control::COUNT; + bool hasControl = false; +}; + +std::string_view touch_controls_rml_fragment() noexcept; +std::span touch_layout_controls() noexcept; +const TouchLayoutControlInfo* find_touch_layout_control(std::string_view layoutId) noexcept; +const TouchLayoutControlInfo* find_touch_layout_control(Control control) noexcept; + +SDL_FingerID touch_event_id(const Rml::Event& event) noexcept; +Rml::Vector2f touch_event_position(const Rml::Event& event) noexcept; +Rml::Vector2f mouse_event_position(const Rml::Event& event) noexcept; +float touch_dp_scale(Rml::Context* context = nullptr) noexcept; +ControlLayoutSize touch_document_size_dp(Rml::Context* context) noexcept; +ControlAnchor touch_control_dock_anchor(ControlRect visual, ControlLayoutSize docSize) noexcept; + +bool control_float_near(float a, float b) noexcept; +bool control_rect_near(ControlRect a, ControlRect b) noexcept; +void apply_control_box_if_changed( + Rml::Element* element, std::optional& appliedBox, ControlRect box) noexcept; +void apply_control_transform_if_changed( + Rml::Element* element, std::optional& appliedTransform, float scale) noexcept; +void apply_control_dock_classes(Rml::Element* element, ControlAnchor anchor) noexcept; + +} // namespace dusk::ui diff --git a/src/dusk/ui/touch_controls_editor.cpp b/src/dusk/ui/touch_controls_editor.cpp new file mode 100644 index 0000000000..6f4f70de21 --- /dev/null +++ b/src/dusk/ui/touch_controls_editor.cpp @@ -0,0 +1,630 @@ +#include "touch_controls_editor.hpp" + +#include "modal.hpp" + +#include "Z2AudioLib/Z2SeMgr.h" +#include "dusk/config.hpp" +#include "dusk/settings.h" +#include "m_Do/m_Do_audio.h" + +#include + +#include +#include +#include +#include + +namespace dusk::ui { +namespace { + +constexpr float kDragThresholdDp = 6.f; +constexpr float kMinControlDp = 36.f; +constexpr float kMinTriggerWidthDp = 44.f; +constexpr float kMinTriggerHeightDp = 32.f; +constexpr float kMinActionBarWidthDp = 112.f; +constexpr float kMinActionBarHeightDp = 36.f; +constexpr float kMinScale = 0.25f; + +struct HandleBinding { + const char* id = nullptr; + TouchControlsEditor::EditHandle handle = TouchControlsEditor::EditHandle::Move; +}; + +constexpr std::array kHandleBindings = { + HandleBinding{"editor-handle-left", TouchControlsEditor::EditHandle::Left}, + HandleBinding{"editor-handle-right", TouchControlsEditor::EditHandle::Right}, + HandleBinding{"editor-handle-top", TouchControlsEditor::EditHandle::Top}, + HandleBinding{"editor-handle-bottom", TouchControlsEditor::EditHandle::Bottom}, + HandleBinding{"editor-handle-top-left", TouchControlsEditor::EditHandle::TopLeft}, + HandleBinding{"editor-handle-top-right", TouchControlsEditor::EditHandle::TopRight}, + HandleBinding{"editor-handle-bottom-left", TouchControlsEditor::EditHandle::BottomLeft}, + HandleBinding{"editor-handle-bottom-right", TouchControlsEditor::EditHandle::BottomRight}, +}; + +Rml::String touch_controls_editor_document_source() { + const auto fragment = touch_controls_rml_fragment(); + return Rml::String{R"RML( + + + + + + +)RML"} + Rml::String{fragment.data(), fragment.size()} + Rml::String{R"RML( + + + + + + + + + + + + + + + + + +)RML"}; +} + +bool is_corner(TouchControlsEditor::EditHandle handle) noexcept { + using EditHandle = TouchControlsEditor::EditHandle; + return handle == EditHandle::TopLeft || handle == EditHandle::TopRight || + handle == EditHandle::BottomLeft || handle == EditHandle::BottomRight; +} + +bool is_horizontal_edge(TouchControlsEditor::EditHandle handle) noexcept { + using EditHandle = TouchControlsEditor::EditHandle; + return handle == EditHandle::Left || handle == EditHandle::Right; +} + +bool is_vertical_edge(TouchControlsEditor::EditHandle handle) noexcept { + using EditHandle = TouchControlsEditor::EditHandle; + return handle == EditHandle::Top || handle == EditHandle::Bottom; +} + +bool control_valid(std::size_t index) noexcept { + return index < touch_layout_controls().size(); +} + +float squared_distance(Rml::Vector2f a, Rml::Vector2f b) noexcept { + const auto delta = a - b; + return delta.x * delta.x + delta.y * delta.y; +} + +} // namespace + +TouchControlsEditor::TouchControlsEditor() + : Document(touch_controls_editor_document_source(), false, DocumentScope::TouchControls), + mRoot(mDocument != nullptr ? mDocument->GetElementById("root") : nullptr), + mSelectionFrame( + mDocument != nullptr ? mDocument->GetElementById("editor-selection-frame") : nullptr), + mSaveButton(mDocument != nullptr ? mDocument->GetElementById("editor-save") : nullptr), + mResetButton(mDocument != nullptr ? mDocument->GetElementById("editor-reset") : nullptr), + mCancelButton(mDocument != nullptr ? mDocument->GetElementById("editor-cancel") : nullptr), + mWorkingLayout(getSettings().game.touchControlsLayout.getValue()) { + mWorkingLayout.version = ControlLayout::Version; + + const auto controls = touch_layout_controls(); + for (std::size_t i = 0; i < controls.size() && i < mElements.size(); ++i) { + mElements[i].root = + mDocument != nullptr ? mDocument->GetElementById(controls[i].elementId) : nullptr; + } + + bind_control_events(); + bind_handle_events(); + bind_toolbar_events(); + + listen(mRoot, aurora::rmlui::TouchStartEvent, [this](Rml::Event& event) { + if (event.GetTargetElement() != mRoot) { + return; + } + clear_selected_control(); + event.StopPropagation(); + }); + listen(mRoot, Rml::EventId::Mousedown, [this](Rml::Event& event) { + const s32 button = event.GetParameter("button", -1); + if (button != 0 || event.GetTargetElement() != mRoot) { + return; + } + clear_selected_control(); + event.StopPropagation(); + }); + listen(mRoot, aurora::rmlui::TouchMoveEvent, [this](Rml::Event& event) { + if (continue_edit(touch_event_position(event))) { + event.StopPropagation(); + } + }); + listen(mRoot, aurora::rmlui::TouchEndEvent, [this](Rml::Event& event) { + if (end_edit(true, touch_event_id(event), false)) { + event.StopPropagation(); + } + }); + listen(mRoot, aurora::rmlui::TouchCancelEvent, [this](Rml::Event& event) { + if (end_edit(true, touch_event_id(event), true)) { + event.StopPropagation(); + } + }); + listen(mRoot, Rml::EventId::Mousemove, [this](Rml::Event& event) { + if (continue_edit(mouse_event_position(event))) { + event.StopPropagation(); + } + }); + listen(mRoot, Rml::EventId::Mouseup, [this](Rml::Event& event) { + if (end_edit(false, 0, false)) { + event.StopPropagation(); + } + }); + listen(mRoot, Rml::EventId::Transitionend, [this](Rml::Event& event) { + if (event.GetTargetElement() == mRoot && !mRoot->HasAttribute("open") && + Document::visible()) + { + Document::hide(mPendingClose); + } + }); +} + +void TouchControlsEditor::show() { + Document::show(); + if (mRoot != nullptr) { + mRoot->SetAttribute("open", ""); + } +} + +void TouchControlsEditor::hide(bool close) { + if (mRoot != nullptr) { + mRoot->RemoveAttribute("open"); + mPendingClose = close; + } else { + Document::hide(close); + } +} + +void TouchControlsEditor::update() { + sync_control_layouts(); + sync_selection_frame(); + Document::update(); +} + +bool TouchControlsEditor::focus() { + return mSaveButton != nullptr && mSaveButton->Focus(true); +} + +void TouchControlsEditor::bind_control_events() noexcept { + const auto controls = touch_layout_controls(); + for (std::size_t i = 0; i < controls.size() && i < mElements.size(); ++i) { + auto* element = mElements[i].root; + if (element == nullptr) { + continue; + } + + listen(element, aurora::rmlui::TouchStartEvent, [this, i](Rml::Event& event) { + if (begin_edit(i, EditHandle::Move, touch_event_position(event), true, + touch_event_id(event))) + { + event.StopPropagation(); + } + }); + listen(element, Rml::EventId::Mousedown, [this, i](Rml::Event& event) { + const s32 button = event.GetParameter("button", -1); + if (button != 0) { + return; + } + if (begin_edit(i, EditHandle::Move, mouse_event_position(event), false)) { + event.StopPropagation(); + } + }); + } +} + +void TouchControlsEditor::bind_handle_events() noexcept { + for (const auto& binding : kHandleBindings) { + auto* element = mDocument != nullptr ? mDocument->GetElementById(binding.id) : nullptr; + if (element == nullptr) { + continue; + } + + listen(element, aurora::rmlui::TouchStartEvent, [this, handle = binding.handle]( + Rml::Event& event) { + if (!control_valid(mSelectedIndex)) { + return; + } + if (begin_edit(mSelectedIndex, handle, touch_event_position(event), true, + touch_event_id(event))) + { + event.StopPropagation(); + } + }); + listen(element, Rml::EventId::Mousedown, [this, handle = binding.handle](Rml::Event& event) { + const s32 button = event.GetParameter("button", -1); + if (button != 0 || !control_valid(mSelectedIndex)) { + return; + } + if (begin_edit(mSelectedIndex, handle, mouse_event_position(event), false)) { + event.StopPropagation(); + } + }); + } +} + +void TouchControlsEditor::bind_toolbar_events() noexcept { + bind_button_command(mSaveButton, &TouchControlsEditor::save_layout); + bind_button_command(mResetButton, &TouchControlsEditor::request_reset); + bind_button_command(mCancelButton, &TouchControlsEditor::cancel_edit); +} + +void TouchControlsEditor::bind_button_command( + Rml::Element* element, void (TouchControlsEditor::*callback)()) noexcept { + if (element == nullptr) { + return; + } + + listen(element, Rml::EventId::Click, [this, callback](Rml::Event& event) { + (this->*callback)(); + event.StopPropagation(); + }); + listen(element, Rml::EventId::Keydown, [this, callback](Rml::Event& event) { + if (map_nav_event(event) != NavCommand::Confirm) { + return; + } + (this->*callback)(); + event.StopPropagation(); + }); +} + +void TouchControlsEditor::sync_control_layouts() noexcept { + auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr; + const auto docSize = touch_document_size_dp(context); + if (docSize.w <= 0.f || docSize.h <= 0.f || context == nullptr) { + return; + } + + const auto controls = touch_layout_controls(); + for (std::size_t i = 0; i < controls.size() && i < mElements.size(); ++i) { + const auto layout = resolve_control_layout(props_for(i), docSize); + auto& element = mElements[i]; + element.layout.visualRect = layout.visual; + element.layout.layoutScale = layout.scale; + if (element.root != nullptr) { + element.root->SetPseudoClass("hidden", false); + } + apply_control_box_if_changed(element.root, element.layout.appliedBox, layout.box); + apply_control_dock_classes( + element.root, touch_control_dock_anchor(layout.visual, docSize)); + apply_control_transform_if_changed( + element.root, element.layout.appliedTransform, element.layout.layoutScale); + } +} + +void TouchControlsEditor::sync_selection_frame() noexcept { + const bool hasSelection = + control_valid(mSelectedIndex) && mElements[mSelectedIndex].layout.visualRect; + if (mSelectionFrame == nullptr) { + return; + } + + mSelectionFrame->SetClass("visible", hasSelection); + for (std::size_t i = 0; i < mElements.size(); ++i) { + if (mElements[i].root != nullptr) { + mElements[i].root->SetClass("editor-selected", hasSelection && i == mSelectedIndex); + } + } + if (!hasSelection) { + mAppliedSelectionFrame = std::nullopt; + return; + } + + apply_control_box_if_changed( + mSelectionFrame, mAppliedSelectionFrame, *mElements[mSelectedIndex].layout.visualRect); +} + +void TouchControlsEditor::set_selected_control(std::size_t index) noexcept { + if (!control_valid(index)) { + clear_selected_control(); + return; + } + mSelectedIndex = index; + sync_selection_frame(); +} + +void TouchControlsEditor::clear_selected_control() noexcept { + mSelectedIndex = kTouchLayoutControlCount; + sync_selection_frame(); +} + +ControlProps TouchControlsEditor::props_for(std::size_t index) const { + const auto controls = touch_layout_controls(); + if (!control_valid(index)) { + return {}; + } + + const auto& info = controls[index]; + if (const auto iter = mWorkingLayout.controls.find(info.layoutId); + iter != mWorkingLayout.controls.end()) + { + return iter->second; + } + return info.props; +} + +void TouchControlsEditor::store_props( + std::size_t index, ControlRect visual, ControlProps props) noexcept { + if (!control_valid(index)) { + return; + } + + auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr; + const auto docSize = touch_document_size_dp(context); + if (docSize.w <= 0.f || docSize.h <= 0.f) { + return; + } + + props.w = std::max(props.w, 1.f); + props.h = std::max(props.h, 1.f); + props.scale = std::max(props.scale, kMinScale); + props = encode_control_props(visual, docSize, props, touch_control_dock_anchor(visual, docSize)); + mWorkingLayout.version = ControlLayout::Version; + mWorkingLayout.controls[std::string{touch_layout_controls()[index].layoutId}] = props; + sync_control_layouts(); + sync_selection_frame(); +} + +void TouchControlsEditor::restore_active_control() noexcept { + if (!control_valid(mPointerEdit.index)) { + return; + } + + auto& controls = mWorkingLayout.controls; + const auto key = std::string{touch_layout_controls()[mPointerEdit.index].layoutId}; + if (mPointerEdit.storedProps) { + controls[key] = *mPointerEdit.storedProps; + } else { + controls.erase(key); + } + sync_control_layouts(); + sync_selection_frame(); +} + +bool TouchControlsEditor::begin_edit( + std::size_t index, EditHandle handle, Rml::Vector2f positionPx, bool touch, + SDL_FingerID touchId) noexcept { + if (!control_valid(index) || mPointerEdit.active) { + return false; + } + + auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr; + const auto docSize = touch_document_size_dp(context); + if (docSize.w <= 0.f || docSize.h <= 0.f) { + return false; + } + + const auto props = props_for(index); + const auto layout = resolve_control_layout(props, docSize); + std::optional storedProps; + if (const auto iter = mWorkingLayout.controls.find(touch_layout_controls()[index].layoutId); + iter != mWorkingLayout.controls.end()) + { + storedProps = iter->second; + } + + mPointerEdit = { + .index = index, + .touchId = touchId, + .startPointerDp = pointer_position_dp(positionPx), + .startVisual = layout.visual, + .startProps = props, + .storedProps = storedProps, + .handle = handle, + .active = true, + .touch = touch, + }; + set_selected_control(index); + return true; +} + +bool TouchControlsEditor::continue_edit(Rml::Vector2f positionPx) noexcept { + if (!mPointerEdit.active) { + return false; + } + + const auto pointerDp = pointer_position_dp(positionPx); + if (!mPointerEdit.dragging) { + if (squared_distance(pointerDp, mPointerEdit.startPointerDp) < + kDragThresholdDp * kDragThresholdDp) + { + return true; + } + mPointerEdit.dragging = true; + } + + auto props = mPointerEdit.startProps; + auto rect = rect_for_edit(pointerDp, props); + rect = clamp_visual_rect(mPointerEdit.index, rect); + if (is_corner(mPointerEdit.handle)) { + props.scale = std::max(rect.w / std::max(mPointerEdit.startProps.w, 1.f), kMinScale); + } else if (is_horizontal_edge(mPointerEdit.handle)) { + props.w = rect.w / std::max(props.scale, kMinScale); + } else if (is_vertical_edge(mPointerEdit.handle)) { + props.h = rect.h / std::max(props.scale, kMinScale); + } + store_props(mPointerEdit.index, rect, props); + return true; +} + +bool TouchControlsEditor::end_edit(bool touch, SDL_FingerID touchId, bool cancelled) noexcept { + if (!mPointerEdit.active || mPointerEdit.touch != touch || + (touch && mPointerEdit.touchId != touchId)) + { + return false; + } + + if (cancelled && mPointerEdit.dragging) { + restore_active_control(); + } + mPointerEdit = {}; + return true; +} + +Rml::Vector2f TouchControlsEditor::pointer_position_dp(Rml::Vector2f positionPx) const noexcept { + auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr; + return positionPx / touch_dp_scale(context); +} + +ControlRect TouchControlsEditor::rect_for_edit( + Rml::Vector2f pointerDp, ControlProps& props) const noexcept { + const auto& edit = mPointerEdit; + auto rect = edit.startVisual; + const auto delta = pointerDp - edit.startPointerDp; + + switch (edit.handle) { + case EditHandle::Move: + rect.l += delta.x; + rect.t += delta.y; + return rect; + case EditHandle::Left: { + const float right = edit.startVisual.l + edit.startVisual.w; + rect.l = pointerDp.x; + rect.w = right - rect.l; + return rect; + } + case EditHandle::Right: + rect.w = pointerDp.x - edit.startVisual.l; + return rect; + case EditHandle::Top: { + const float bottom = edit.startVisual.t + edit.startVisual.h; + rect.t = pointerDp.y; + rect.h = bottom - rect.t; + return rect; + } + case EditHandle::Bottom: + rect.h = pointerDp.y - edit.startVisual.t; + return rect; + case EditHandle::TopLeft: + case EditHandle::TopRight: + case EditHandle::BottomLeft: + case EditHandle::BottomRight: + break; + } + + auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr; + const auto docSize = touch_document_size_dp(context); + const bool left = edit.handle == EditHandle::TopLeft || edit.handle == EditHandle::BottomLeft; + const bool top = edit.handle == EditHandle::TopLeft || edit.handle == EditHandle::TopRight; + const Rml::Vector2f fixed{ + left ? edit.startVisual.l + edit.startVisual.w : edit.startVisual.l, + top ? edit.startVisual.t + edit.startVisual.h : edit.startVisual.t, + }; + const float desiredW = left ? fixed.x - pointerDp.x : pointerDp.x - fixed.x; + const float desiredH = top ? fixed.y - pointerDp.y : pointerDp.y - fixed.y; + const auto minSize = min_visual_size(edit.index); + const float minRatio = + std::max(minSize.x / std::max(edit.startVisual.w, 1.f), + minSize.y / std::max(edit.startVisual.h, 1.f)); + const float maxW = left ? fixed.x : docSize.w - fixed.x; + const float maxH = top ? fixed.y : docSize.h - fixed.y; + const float maxRatio = + std::max(minRatio, std::min(maxW / std::max(edit.startVisual.w, 1.f), + maxH / std::max(edit.startVisual.h, 1.f))); + const float ratio = + std::clamp(std::max(desiredW / std::max(edit.startVisual.w, 1.f), + desiredH / std::max(edit.startVisual.h, 1.f)), + minRatio, maxRatio); + + rect.w = edit.startVisual.w * ratio; + rect.h = edit.startVisual.h * ratio; + rect.l = left ? fixed.x - rect.w : fixed.x; + rect.t = top ? fixed.y - rect.h : fixed.y; + props.scale = std::max(edit.startProps.scale * ratio, kMinScale); + return rect; +} + +ControlRect TouchControlsEditor::clamp_visual_rect(std::size_t index, ControlRect rect) const noexcept { + auto* context = mDocument != nullptr ? mDocument->GetContext() : nullptr; + const auto docSize = touch_document_size_dp(context); + if (docSize.w <= 0.f || docSize.h <= 0.f || !control_valid(index)) { + return rect; + } + + const auto minSize = min_visual_size(index); + const float minW = std::min(minSize.x, docSize.w); + const float minH = std::min(minSize.y, docSize.h); + rect.w = std::clamp(rect.w, minW, docSize.w); + rect.h = std::clamp(rect.h, minH, docSize.h); + rect.l = std::clamp(rect.l, 0.f, std::max(0.f, docSize.w - rect.w)); + rect.t = std::clamp(rect.t, 0.f, std::max(0.f, docSize.h - rect.h)); + return rect; +} + +Rml::Vector2f TouchControlsEditor::min_visual_size(std::size_t index) const noexcept { + if (!control_valid(index)) { + return {kMinControlDp, kMinControlDp}; + } + + const auto id = touch_layout_controls()[index].layoutId; + if (id == "actionBar") { + return {kMinActionBarWidthDp, kMinActionBarHeightDp}; + } + if (id == "triggerL" || id == "triggerR" || id == "buttonZ" || id == "skip") { + return {kMinTriggerWidthDp, kMinTriggerHeightDp}; + } + return {kMinControlDp, kMinControlDp}; +} + +bool TouchControlsEditor::handle_nav_command(Rml::Event& event, NavCommand cmd) { + if (cmd == NavCommand::Cancel || cmd == NavCommand::Menu) { + cancel_edit(); + return true; + } + return Document::handle_nav_command(event, cmd); +} + +void TouchControlsEditor::save_layout() { + mWorkingLayout.version = ControlLayout::Version; + getSettings().game.touchControlsLayout.setValue(mWorkingLayout); + config::save(); + mDoAud_seStartMenu(kSoundItemChange); + pop(); +} + +void TouchControlsEditor::request_reset() { + auto dismiss = [](Modal& modal) { modal.pop(); }; + push(std::make_unique(Modal::Props{ + .title = "Reset Touch Layout?", + .bodyRml = "Reset controls to their default layout. This will not be saved until you press Save.", + .actions = + { + ModalAction{ + .label = "Reset", + .onPressed = + [this, dismiss](Modal& modal) { + reset_working_layout(); + mDoAud_seStartMenu(kSoundItemChange); + dismiss(modal); + }, + }, + ModalAction{ + .label = "Cancel", + .onPressed = dismiss, + }, + }, + })); +} + +void TouchControlsEditor::reset_working_layout() noexcept { + mWorkingLayout = ControlLayout{}; + mWorkingLayout.version = ControlLayout::Version; + mPointerEdit = {}; + sync_control_layouts(); + sync_selection_frame(); +} + +void TouchControlsEditor::cancel_edit() { + mDoAud_seStartMenu(kSoundWindowClose); + pop(); +} + +} // namespace dusk::ui diff --git a/src/dusk/ui/touch_controls_editor.hpp b/src/dusk/ui/touch_controls_editor.hpp new file mode 100644 index 0000000000..4af33d8fbc --- /dev/null +++ b/src/dusk/ui/touch_controls_editor.hpp @@ -0,0 +1,98 @@ +#pragma once + +#include "controls.hpp" +#include "document.hpp" +#include "touch_controls_common.hpp" + +#include +#include +#include + +namespace dusk::ui { + +class TouchControlsEditor final : public Document { +public: + TouchControlsEditor(); + + void show() override; + void hide(bool close) override; + void update() override; + bool focus() override; + + enum class EditHandle { + Move, + Left, + Right, + Top, + Bottom, + TopLeft, + TopRight, + BottomLeft, + BottomRight, + }; + +private: + struct LayoutState { + std::optional visualRect; + std::optional appliedBox; + float layoutScale = 1.0f; + std::optional appliedTransform; + }; + + struct EditElement { + Rml::Element* root = nullptr; + LayoutState layout; + }; + + struct PointerEdit { + std::size_t index = kTouchLayoutControlCount; + SDL_FingerID touchId = 0; + Rml::Vector2f startPointerDp; + ControlRect startVisual; + ControlProps startProps; + std::optional storedProps; + EditHandle handle = EditHandle::Move; + bool active = false; + bool touch = false; + bool dragging = false; + }; + + void bind_control_events() noexcept; + void bind_handle_events() noexcept; + void bind_toolbar_events() noexcept; + void bind_button_command( + Rml::Element* element, void (TouchControlsEditor::*callback)()) noexcept; + void sync_control_layouts() noexcept; + void sync_selection_frame() noexcept; + void set_selected_control(std::size_t index) noexcept; + void clear_selected_control() noexcept; + ControlProps props_for(std::size_t index) const; + void store_props(std::size_t index, ControlRect visual, ControlProps props) noexcept; + void restore_active_control() noexcept; + bool begin_edit(std::size_t index, EditHandle handle, Rml::Vector2f positionPx, bool touch, + SDL_FingerID touchId = 0) noexcept; + bool continue_edit(Rml::Vector2f positionPx) noexcept; + bool end_edit(bool touch, SDL_FingerID touchId, bool cancelled) noexcept; + Rml::Vector2f pointer_position_dp(Rml::Vector2f positionPx) const noexcept; + ControlRect rect_for_edit(Rml::Vector2f pointerDp, ControlProps& props) const noexcept; + ControlRect clamp_visual_rect(std::size_t index, ControlRect rect) const noexcept; + Rml::Vector2f min_visual_size(std::size_t index) const noexcept; + bool handle_nav_command(Rml::Event& event, NavCommand cmd) override; + void save_layout(); + void request_reset(); + void reset_working_layout() noexcept; + void cancel_edit(); + + Rml::Element* mRoot = nullptr; + Rml::Element* mSelectionFrame = nullptr; + Rml::Element* mSaveButton = nullptr; + Rml::Element* mResetButton = nullptr; + Rml::Element* mCancelButton = nullptr; + std::array mElements{}; + ControlLayout mWorkingLayout; + PointerEdit mPointerEdit; + std::optional mAppliedSelectionFrame; + std::size_t mSelectedIndex = kTouchLayoutControlCount; +}; + +} // namespace dusk::ui diff --git a/src/dusk/ui/ui.cpp b/src/dusk/ui/ui.cpp index fc2d5d6691..0777553681 100644 --- a/src/dusk/ui/ui.cpp +++ b/src/dusk/ui/ui.cpp @@ -1,7 +1,11 @@ #include "ui.hpp" #include -#include +#include +#include +#include +#include +#include #include #include #include @@ -11,8 +15,11 @@ #include #include "aurora/lib/window.hpp" +#include "dusk/config.hpp" #include "dusk/io.hpp" +#include "icon_provider.hpp" #include "input.hpp" +#include "mod_texture_provider.hpp" #include "prelaunch.hpp" #include "window.hpp" @@ -24,9 +31,40 @@ void load_font(const char* filename, bool fallback = false) { } bool sInitialized = false; -std::vector > sDocumentStack; +std::vector> sDocumentStack; // Documents that don't participate in the focus stack -std::vector > sPassiveDocuments; +std::vector> sPassiveDocuments; + +struct ScopedStyles { + DocumentScope scope; + std::string id; + Rml::SharedPtr sheet; +}; +std::vector sScopedStyles; + +std::vector scoped_sheets(DocumentScope scope) { + std::vector sheets; + for (const auto& entry : sScopedStyles) { + if (entry.scope == scope) { + sheets.push_back(entry.sheet.get()); + } + } + return sheets; +} + +void restyle_scope(DocumentScope scope) { + const auto sheets = scoped_sheets(scope); + const auto restyle_documents = [&sheets, scope](auto& documents) { + for (auto& doc : documents) { + if (doc != nullptr && doc->scope() == scope && !doc->closed()) { + doc->restyle(sheets); + } + } + }; + restyle_documents(sDocumentStack); + restyle_documents(sPassiveDocuments); +} + std::deque sToasts; bool sMenuNotificationRequested = false; @@ -55,11 +93,15 @@ bool initialize() noexcept { load_font("MaterialSymbolsRounded-Regular.ttf"); load_font("NotoMono-Regular.ttf"); + register_icon_texture_provider(); + register_mod_texture_provider(); sInitialized = true; return true; } void shutdown() noexcept { + unregister_mod_texture_provider(); + unregister_icon_texture_provider(); sDocumentStack.clear(); sPassiveDocuments.clear(); sConnectedGamepads.clear(); @@ -130,11 +172,13 @@ void handle_event(const SDL_Event& event) noexcept { if (getSettings().game.enableControllerToasts) { const char* name = SDL_GetGamepadName(gamepad); Rml::String content = fmt::format("{}", name ? name : "[Unknown]"); - Rml::String title = "Controller connected"; - if (const char* icon = connection_state_icon(SDL_GetGamepadConnectionState(gamepad))) { + Rml::String title = "Device Connected"; + if (const char* icon = + connection_state_icon(SDL_GetGamepadConnectionState(gamepad))) + { title = fmt::format( - "{} &#x{};", title, - icon); + "{} &#x{};", + title, icon); } int batteryLevel = -1; const auto powerState = SDL_GetGamepadPowerInfo(gamepad, &batteryLevel); @@ -163,7 +207,7 @@ void handle_event(const SDL_Event& event) noexcept { const char* name = SDL_GetGamepadNameForID(event.gdevice.which); push_toast({ .type = "controller", - .title = "Controller disconnected", + .title = "Device Disconnected", .content = name ? name : "[Unknown]", .duration = std::chrono::seconds(4), }); @@ -173,6 +217,34 @@ void handle_event(const SDL_Event& event) noexcept { input::handle_event(event); } +bool register_scoped_styles(DocumentScope scope, std::string id, const std::string& rcss) noexcept { + auto sheet = Rml::Factory::InstanceStyleSheetString(rcss); + if (sheet == nullptr) { + return false; + } + const auto it = std::ranges::find_if(sScopedStyles, + [scope, &id](const ScopedStyles& entry) { return entry.scope == scope && entry.id == id; }); + if (it != sScopedStyles.end()) { + it->sheet = std::move(sheet); + } else { + sScopedStyles.push_back({scope, std::move(id), std::move(sheet)}); + } + restyle_scope(scope); + return true; +} + +void unregister_scoped_styles(DocumentScope scope, std::string_view id) noexcept { + const auto erased = std::erase_if(sScopedStyles, + [scope, id](const ScopedStyles& entry) { return entry.scope == scope && entry.id == id; }); + if (erased != 0) { + restyle_scope(scope); + } +} + +void apply_scoped_styles(Document& doc) noexcept { + doc.restyle(scoped_sheets(doc.scope())); +} + Document& push_document(std::unique_ptr doc, bool show, bool passive) noexcept { Document& ret = *doc; if (passive) { @@ -187,9 +259,9 @@ Document& push_document(std::unique_ptr doc, bool show, bool passive) return ret; } -void show_top_document() noexcept { +void uncover_top_document() noexcept { if (auto* doc = top_document()) { - doc->show(); + doc->uncover(); } input::sync_input_block(); } @@ -202,13 +274,25 @@ bool any_document_visible() noexcept { bool is_prelaunch_open() noexcept { return std::any_of(sDocumentStack.begin(), sDocumentStack.end(), [](const auto& doc) { const auto* prelaunch = dynamic_cast(doc.get()); - return prelaunch != nullptr && !prelaunch->pending_close() && !prelaunch->closed(); + return prelaunch != nullptr && prelaunch->active(); }); } +bool game_obscured_below(const Document& doc) noexcept { + for (const auto& entry : sDocumentStack) { + if (entry.get() == &doc) { + break; + } + if (entry->active() && entry->obscures_game()) { + return true; + } + } + return false; +} + Document* top_document() noexcept { for (auto& doc : std::views::reverse(sDocumentStack)) { - if (!doc->closed() && !doc->pending_close()) { + if (doc->active()) { return doc.get(); } } @@ -251,7 +335,7 @@ void update() noexcept { context->GetFocusElement() == context->GetRootElement())) { for (auto& doc : std::views::reverse(sDocumentStack)) { - if (!doc->closed() && !doc->pending_close() && doc->focus()) { + if (doc->active() && doc->focus()) { break; } } @@ -300,6 +384,17 @@ Rml::Element* append(Rml::Element* parent, const Rml::String& tag) noexcept { return parent->AppendChild(doc->CreateElement(tag)); } +Rml::Element* append_text(Rml::Element* parent, const Rml::String& text) noexcept { + if (parent == nullptr) { + return nullptr; + } + auto* doc = parent->GetOwnerDocument(); + if (doc == nullptr) { + return nullptr; + } + return parent->AppendChild(doc->CreateTextNode(text)); +} + NavCommand map_nav_event(const Rml::Event& event) noexcept { const auto key = static_cast( event.GetParameter("key_identifier", Rml::Input::KI_UNKNOWN)); @@ -315,6 +410,7 @@ NavCommand map_nav_event(const Rml::Event& event) noexcept { case Rml::Input::KeyIdentifier::KI_ESCAPE: return NavCommand::Cancel; case Rml::Input::KeyIdentifier::KI_RETURN: + case Rml::Input::KeyIdentifier::KI_NUMPADENTER: return NavCommand::Confirm; case Rml::Input::KeyIdentifier::KI_F1: return event.GetParameter("shift_key", 0) ? NavCommand::None : NavCommand::Menu; @@ -365,7 +461,7 @@ void push_toast(Toast toast) noexcept { sToasts.push_back(std::move(toast)); } -std::vector >& get_document_stack() noexcept { +std::vector>& get_document_stack() noexcept { return sDocumentStack; } diff --git a/src/dusk/ui/ui.hpp b/src/dusk/ui/ui.hpp index 4a27ac7aac..bd993ea34d 100644 --- a/src/dusk/ui/ui.hpp +++ b/src/dusk/ui/ui.hpp @@ -15,6 +15,16 @@ class Document; using clock = std::chrono::steady_clock; +enum class DocumentScope : u8 { + None, + Prelaunch, + Window, + MenuBar, + Overlay, + TouchControls, + GraphicsTuner, +}; + struct Toast { Rml::String type; Rml::String title; @@ -26,6 +36,8 @@ struct Toast { constexpr u32 kSoundClick = Z2SE_SY_CURSOR_OK; // "Play" button clicked/pressed constexpr u32 kSoundPlay = Z2SE_SY_ITEM_COMBINE_ON; +// Input binding changed +constexpr u32 kSoundBindingChanged = Z2SE_SY_ITEM_SET_X; // Menu button pressed (open/close menu bar or hide/show the active window) constexpr u32 kSoundMenuOpen = Z2SE_SY_MENU_SUB_IN; @@ -49,6 +61,8 @@ constexpr u32 kSoundItemDisable = Z2SE_SUBJ_VIEW_OUT; // Achievement unlocked constexpr u32 kSoundAchievementUnlock = Z2SE_NAVI_FLY; +// Warning prompt +constexpr u32 kSoundWarning = Z2SE_SY_COW_GET_IN; struct Insets { float top = 0.0f; @@ -70,19 +84,24 @@ void update() noexcept; Document& push_document( std::unique_ptr doc, bool show = true, bool passive = false) noexcept; -void show_top_document() noexcept; +bool register_scoped_styles(DocumentScope scope, std::string id, const std::string& rcss) noexcept; +void unregister_scoped_styles(DocumentScope scope, std::string_view id) noexcept; +void apply_scoped_styles(Document& doc) noexcept; +void uncover_top_document() noexcept; bool any_document_visible() noexcept; bool is_prelaunch_open() noexcept; +bool game_obscured_below(const Document& doc) noexcept; Document* top_document() noexcept; std::filesystem::path resource_path(const std::filesystem::path& filename) noexcept; std::string escape(std::string_view str) noexcept; Rml::Element* append(Rml::Element* parent, const Rml::String& tag) noexcept; +Rml::Element* append_text(Rml::Element* parent, const Rml::String& text) noexcept; NavCommand map_nav_event(const Rml::Event& event) noexcept; Insets safe_area_insets(Rml::Context* context) noexcept; -std::vector >& get_document_stack() noexcept; +std::vector>& get_document_stack() noexcept; void push_toast(Toast toast) noexcept; std::deque& get_toasts() noexcept; diff --git a/src/dusk/ui/window.cpp b/src/dusk/ui/window.cpp index 41080ff287..f1162a09b6 100644 --- a/src/dusk/ui/window.cpp +++ b/src/dusk/ui/window.cpp @@ -2,6 +2,7 @@ #include "aurora/lib/window.hpp" #include "aurora/rmlui.hpp" +#include "fmt/format.h" #include "magic_enum.hpp" #include "pane.hpp" #include "ui.hpp" @@ -24,17 +25,24 @@ float base_body_padding(Rml::Context* context) noexcept { return 64.0f * dpRatio; } -const Rml::String kDocumentSource = R"RML( +Rml::String window_document_source(const std::vector& styleSheets) { + Rml::String links; + for (const auto& sheet : styleSheets) { + links += fmt::format(" \n", sheet); + } + return fmt::format(R"RML( - +{} -)RML"; +)RML", + links); +} const Rml::String kDocumentSourceSmall = R"RML( @@ -51,12 +59,25 @@ const Rml::String kDocumentSourceSmall = R"RML( } // namespace -Window::Window() : Document(kDocumentSource), mRoot(mDocument->GetElementById("window")) { - mTabBar = std::make_unique(mRoot, TabBar::Props{ - .onClose = [this] { request_close(); }, - .selectedTabIndex = 0, - .autoSelect = true, - }); +Window::Window(Props props) + : Document(window_document_source(props.styleSheets), false, DocumentScope::Window), + mRoot(mDocument->GetElementById("window")) { + if (props.tabBar) { + mTabBar = std::make_unique(mRoot, TabBar::Props{ + .onClose = [this] { request_close(); }, + .selectedTabIndex = 0, + .autoSelect = true, + }); + } else { + mCloseButton = std::make_unique