diff --git a/.gitmodules b/.gitmodules index f05842fa7b..881f8f524b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,9 @@ [submodule "extern/borealis"] path = extern/borealis url = https://github.com/encounter/borealis.git +[submodule "mods/randomizer"] + path = mods/randomizer + url = https://github.com/TwilitRealm/dusklight-randomizer.git +[submodule "mods/cosmetics"] + path = mods/cosmetics + url = https://github.com/TwilitRealm/dusklight-cosmetics diff --git a/CMakeLists.txt b/CMakeLists.txt index f3bb07a27a..834713ed00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL Linux) endif () set(AURORA_ENABLE_DVD ON CACHE BOOL "Enable DVD API support" FORCE) set(AURORA_ENABLE_CARD ON CACHE BOOL "Enable CARD API support" FORCE) +set(AURORA_ENABLE_THP ON CACHE BOOL "Enable THP decoder" FORCE) set(AURORA_ENABLE_RMLUI ON CACHE BOOL "Enable RmlUi UI support" FORCE) add_subdirectory(extern/aurora EXCLUDE_FROM_ALL) target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1) @@ -88,10 +89,9 @@ 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_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) +option(DUSK_ENABLE_CODE_MODS "Enable code mods" ON) set(DUSK_HAS_FUNCHOOK OFF) if (DUSK_ENABLE_CODE_MODS AND (NOT APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")) @@ -133,69 +133,6 @@ if (MSVC) endif () endif () -if (DUSK_MOVIE_SUPPORT) - find_package(libjpeg-turbo 3.0 CONFIG QUIET) - if (libjpeg-turbo_FOUND) - message(STATUS "dusklight: Using system libjpeg-turbo") - else () - message(STATUS "dusklight: Fetching libjpeg-turbo") - include(ExternalProject) - set(_jpeg_install_dir ${CMAKE_BINARY_DIR}/libjpeg-turbo-install) - if (WIN32) - set(_jpeg_lib ${_jpeg_install_dir}/lib/turbojpeg-static.lib) - else () - set(_jpeg_lib ${_jpeg_install_dir}/lib/libturbojpeg.a) - 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 - -DCMAKE_INSTALL_LIBDIR=lib - ) - if (CMAKE_TOOLCHAIN_FILE) - get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}") - list(APPEND _jpeg_cmake_args -DCMAKE_TOOLCHAIN_FILE=${_jpeg_toolchain_file}) - endif () - set(_jpeg_passthrough_vars - ANDROID_ABI - ANDROID_PLATFORM - CMAKE_BUILD_TYPE - CMAKE_C_COMPILER - CMAKE_C_COMPILER_LAUNCHER - CMAKE_MAKE_PROGRAM - 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 - PLATFORM - ) - foreach(_var IN LISTS _jpeg_passthrough_vars) - if (DEFINED ${_var}) - list(APPEND _jpeg_cmake_args -D${_var}=${${_var}}) - endif () - endforeach () - ExternalProject_Add(libjpeg-turbo-ext - URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.1.0.tar.gz - URL_HASH SHA256=35fec2e1ddfb05ecf6d93e50bc57c1e54bc81c16d611ddf6eff73fff266d8285 - CMAKE_ARGS ${_jpeg_cmake_args} - BUILD_BYPRODUCTS ${_jpeg_lib} - ) - file(MAKE_DIRECTORY ${_jpeg_install_dir}/include) - add_library(libjpeg-turbo::turbojpeg-static STATIC IMPORTED GLOBAL) - set_target_properties(libjpeg-turbo::turbojpeg-static PROPERTIES - IMPORTED_LOCATION ${_jpeg_lib} - INTERFACE_INCLUDE_DIRECTORIES ${_jpeg_install_dir}/include - ) - add_dependencies(libjpeg-turbo::turbojpeg-static libjpeg-turbo-ext) - endif () -endif () - if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") # -Wno-multichar: Multi-character constants ('ABCD') are implementation-defined but all compilers # (CW, GCC, Clang, MSVC) encode them identically in big-endian order. @@ -303,8 +240,8 @@ 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 borealis::cli borealis::crash borealis::data borealis::disc borealis::discord borealis::file_select borealis::log borealis::presentation borealis::sentry borealis::update freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt +set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd aurora::thp + aurora::card borealis::cli borealis::crash borealis::data borealis::disc borealis::discord borealis::file_select borealis::io borealis::log borealis::net borealis::presentation borealis::sentry borealis::update borealis::ws freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt Threads::Threads zstd::libzstd dusklight_game_headers) if (DUSK_HAS_FUNCHOOK) list(APPEND GAME_LIBS funchook-static) @@ -314,15 +251,6 @@ if (WIN32) list(APPEND GAME_LIBS Ws2_32) endif () -if (DUSK_MOVIE_SUPPORT) - if (TARGET libjpeg-turbo::turbojpeg-static) - list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static) - else () - list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg) - endif () - list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1) -endif () - if (DUSK_ENABLE_CODE_MODS) list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1) endif () @@ -384,20 +312,31 @@ 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} ${miniz_SOURCE_DIR}/miniz.c) +set(_dusklight_all_files src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES}) +set(DUSK_INTERNAL_FILES ${_dusklight_all_files}) +list(FILTER DUSK_INTERNAL_FILES INCLUDE REGEX "^src/dusk/") +set(GAME_FILES ${_dusklight_all_files}) +list(FILTER GAME_FILES EXCLUDE REGEX "^src/dusk/") + +add_library(dusk_internal OBJECT ${DUSK_INTERNAL_FILES}) +if (ENABLE_ASAN) + target_sources(dusk_internal PRIVATE src/dusk/asan_options.c) +endif () +target_compile_definitions(dusk_internal PRIVATE ${GAME_COMPILE_DEFS}) +target_include_directories(dusk_internal PRIVATE ${miniz_SOURCE_DIR}) +target_link_libraries(dusk_internal PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LIBRARIES}) +target_precompile_headers(dusk_internal PRIVATE "$<$:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") + if(ANDROID) - add_library(dusklight SHARED ${DUSK_FILES}) + add_library(dusklight SHARED ${GAME_FILES} ${miniz_SOURCE_DIR}/miniz.c) else () - add_executable(dusklight ${DUSK_FILES}) + add_executable(dusklight ${GAME_FILES} ${miniz_SOURCE_DIR}/miniz.c) endif () borealis_configure_android_application(dusklight) -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 ${miniz_SOURCE_DIR}) -target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES}) +target_link_libraries(dusklight PRIVATE dusk_internal aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES}) target_precompile_headers(dusklight PRIVATE "$<$:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") if (DUSK_ENABLE_CODE_MODS) @@ -411,38 +350,77 @@ if (DUSK_ENABLE_CODE_MODS) 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 MATCHES "^(AppleClang|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,4>) - 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() - foreach(_sdk_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx - aurora_os aurora_pad aurora_si aurora_vi) - if (TARGET ${_sdk_lib}) - get_target_property(_sdk_lib_imported ${_sdk_lib} IMPORTED) - if (NOT _sdk_lib_imported) - target_compile_options(${_sdk_lib} PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG}) - endif () +# Hook reliability: prevent auto-inlining, guarantee patchable function entries, +# and disable identical-code folding for game functions. +if (DUSK_ENABLE_CODE_MODS) + set(DUSK_GAME_ABI_INLINE_OPTIONS) + if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + list(APPEND DUSK_GAME_ABI_INLINE_OPTIONS + $<$:-finline-hint-functions>) + elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + list(APPEND DUSK_GAME_ABI_INLINE_OPTIONS + $<$:-flive-patching=inline-clone> + $<$:-fno-inline-functions> + $<$:-fno-inline-small-functions> + $<$:-fno-inline-functions-called-once> + $<$:-fno-early-inlining> + $<$:-fno-ipa-cp> + $<$:-fno-ipa-cp-clone> + $<$:-fno-ipa-sra> + $<$:-fno-partial-inlining>) endif () - endforeach () + endif () + + if (DUSK_GAME_ABI_INLINE_OPTIONS) + target_compile_options(dusklight PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS}) + + foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES) + target_compile_options(${jsystem_lib} PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS}) + endforeach() + foreach(_sdk_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx + aurora_os aurora_pad aurora_si aurora_vi) + if (TARGET ${_sdk_lib}) + get_target_property(_sdk_lib_imported ${_sdk_lib} IMPORTED) + if (NOT _sdk_lib_imported) + target_compile_options(${_sdk_lib} PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS}) + endif () + endif () + endforeach () + endif () + + 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 MATCHES "^(AppleClang|Clang|GNU)$") + if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$" 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,4>) + 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() + foreach(_sdk_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx + aurora_os aurora_pad aurora_si aurora_vi) + if (TARGET ${_sdk_lib}) + get_target_property(_sdk_lib_imported ${_sdk_lib} IMPORTED) + if (NOT _sdk_lib_imported) + target_compile_options(${_sdk_lib} PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG}) + endif () + endif () + endforeach () + endif () endif () if (WIN32) @@ -515,12 +493,15 @@ 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/luau_runtime) add_subdirectory(mods/template_mod) add_subdirectory(mods/ao_mod) add_subdirectory(mods/shadow_mod) add_subdirectory(mods/window_demo) add_subdirectory(mods/flow_demo) - add_subdirectory(mods/basic_cosmetics_mod) + add_subdirectory(mods/custom_actor_demo) + add_subdirectory(mods/cosmetics) + add_subdirectory(mods/randomizer) endif () if (APPLE) diff --git a/CMakePresets.json b/CMakePresets.json index 45a6522625..849e4161cd 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -60,11 +60,7 @@ "type": "BOOL", "value": false }, - "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", - "DUSK_ENABLE_CODE_MODS": { - "type": "BOOL", - "value": true - } + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install" }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -151,10 +147,6 @@ "CMAKE_C_COMPILER": "cl", "CMAKE_CXX_COMPILER": "cl", "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", - "DUSK_ENABLE_CODE_MODS": { - "type": "BOOL", - "value": true - }, "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "type": "BOOL", "value": true @@ -254,11 +246,7 @@ "type": "BOOL", "value": false }, - "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", - "DUSK_ENABLE_CODE_MODS": { - "type": "BOOL", - "value": true - } + "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install" }, "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { @@ -323,10 +311,6 @@ "type": "BOOL", "value": false }, - "DUSK_ENABLE_CODE_MODS": { - "type": "BOOL", - "value": true - }, "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "type": "BOOL", "value": true @@ -372,10 +356,6 @@ "type": "BOOL", "value": false }, - "DUSK_ENABLE_CODE_MODS": { - "type": "BOOL", - "value": true - }, "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "type": "BOOL", "value": true @@ -406,10 +386,6 @@ "type": "BOOL", "value": false }, - "DUSK_ENABLE_CODE_MODS": { - "type": "BOOL", - "value": true - }, "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "type": "BOOL", "value": true diff --git a/cmake/AndroidExports.cmake b/cmake/AndroidExports.cmake index 66e80d3f4a..a71c18a02b 100644 --- a/cmake/AndroidExports.cmake +++ b/cmake/AndroidExports.cmake @@ -39,8 +39,6 @@ function(setup_android_exports target) --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 diff --git a/cmake/AppleExports.cmake b/cmake/AppleExports.cmake index 2c78939811..6397e353a5 100644 --- a/cmake/AppleExports.cmake +++ b/cmake/AppleExports.cmake @@ -46,8 +46,6 @@ function(setup_apple_exports target) --out "${_exp}" --exclude cmake_pch --exclude miniz - --exclude asan_options - --exclude src/dusk ${_sdk_args} COMMENT "Generating dusklight exports" VERBATIM) diff --git a/cmake/ModExports.exp b/cmake/ModExports.exp new file mode 100644 index 0000000000..3a9ec12942 --- /dev/null +++ b/cmake/ModExports.exp @@ -0,0 +1,5 @@ +_mod_ctx +_mod_initialize +_mod_meta +_mod_shutdown +_mod_update diff --git a/cmake/ModExports.ver b/cmake/ModExports.ver new file mode 100644 index 0000000000..9ddff1866c --- /dev/null +++ b/cmake/ModExports.ver @@ -0,0 +1,10 @@ +{ + global: + mod_ctx; + mod_initialize; + mod_meta; + mod_shutdown; + mod_update; + local: + *; +}; diff --git a/cmake/ModSDK.cmake b/cmake/ModSDK.cmake index da9aa51f38..db3ca231d0 100644 --- a/cmake/ModSDK.cmake +++ b/cmake/ModSDK.cmake @@ -185,6 +185,20 @@ function(add_mod target_name) WINDOWS_EXPORT_ALL_SYMBOLS OFF) target_compile_features(${target_name} PRIVATE cxx_std_20) target_link_libraries(${target_name} PRIVATE dusklight_mod_api) + + if (APPLE) + set(_mod_exports "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/ModExports.exp") + target_link_options(${target_name} PRIVATE + -Xlinker -exported_symbols_list -Xlinker "${_mod_exports}") + set_property(TARGET ${target_name} APPEND PROPERTY LINK_DEPENDS "${_mod_exports}") + elseif (UNIX) + set(_mod_exports "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/ModExports.ver") + target_link_options(${target_name} PRIVATE + "-Wl,--version-script=${_mod_exports}" + -Wl,--no-undefined-version) + set_property(TARGET ${target_name} APPEND PROPERTY LINK_DEPENDS "${_mod_exports}") + endif () + foreach (_feature IN LISTS _features) target_link_libraries(${target_name} PRIVATE dusklight_mod_feature_${_feature}) if (_feature STREQUAL "webgpu") @@ -282,8 +296,6 @@ function(add_mod target_name) 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) @@ -302,6 +314,7 @@ function(add_mod target_name) set(_package_inputs "${_mod_json}") set(_extra_cmds "") set(_lib_copy_cmd "") + set(_lib_strip_cmd "") set(_target_depend "") if (_has_lib) list(APPEND _zip_args lib) @@ -309,6 +322,10 @@ function(add_mod target_name) COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}/lib/${_lib_platform}" COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${_stage}/lib/${_lib_platform}/${_lib_name}") + if (UNIX AND NOT APPLE) + set(_lib_strip_cmd COMMAND "${CMAKE_STRIP}" --strip-unneeded + "${_stage}/lib/${_lib_platform}/${_lib_name}") + endif () set(_target_depend ${target_name}) endif () string(TOLOWER "${_lib_name}" _lib_name_key) @@ -385,6 +402,7 @@ function(add_mod target_name) COMMAND ${CMAKE_COMMAND} -E rm -rf "${_stage}" COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}" "${_output_dir}" ${_lib_copy_cmd} + ${_lib_strip_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} diff --git a/cmake/SymbolManifest.cmake b/cmake/SymbolManifest.cmake index 7ef57f7ced..7c7e09eaa1 100644 --- a/cmake/SymbolManifest.cmake +++ b/cmake/SymbolManifest.cmake @@ -2,7 +2,7 @@ include_guard(GLOBAL) get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) -set(_SYMGEN_VERSION "1.3.2") +set(_SYMGEN_VERSION "1.3.4") 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) @@ -15,32 +15,32 @@ function(symgen_host_asset out_name out_hash) if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") if (_host_processor MATCHES "^(arm64|aarch64)$") set(_asset "symgen-macos-arm64") - set(_asset_hash "SHA256=0344838d1674df09c17c3eeddcf26eb89c333fdb85dfd78f68adc436070eccbe") + set(_asset_hash "SHA256=983ef6278d30bee38f240f451ca736fd294da0e5705ee15029accac5c7a33829") elseif (_host_processor MATCHES "^(x86_64|amd64)$") set(_asset "symgen-macos-x86_64") - set(_asset_hash "SHA256=ae0674f4a1e9d0dedfa02d35939ac28cdd229276b331c1f507df5df809cbec7e") + set(_asset_hash "SHA256=b6ab1720a4f04fadcf291f42d133e2ee68ef2e9a75d143e51584929e808af8a2") endif () elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") if (_host_processor MATCHES "^(aarch64|arm64)$") set(_asset "symgen-linux-aarch64") - set(_asset_hash "SHA256=af766de2bfaeb0a06f6d7bc17bb2510b4a9c40f44a56e49bc4a4b798a6223042") + set(_asset_hash "SHA256=ba84486ff1ceb753973e6213c9bc5f195b5ff6f220f5d3322fd861966cdc791c") elseif (_host_processor MATCHES "^(x86_64|amd64)$") set(_asset "symgen-linux-x86_64") - set(_asset_hash "SHA256=ebd62fb9623acc942b6295609e2306f85a73043b0a8a117f2072b761dd08e68f") + set(_asset_hash "SHA256=8b81a00a2ef8f5dd4b59adba1badfaca57e472bf272516bc12c4625cefb37718") elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") set(_asset "symgen-linux-i686") - set(_asset_hash "SHA256=07780a4513fd29726578efc4ff2d88736b22f407ed821b32a68e35ff1e9af5f4") + set(_asset_hash "SHA256=01aa85d84148a6806fdf69839dea7e962e6ac46956aed63b9ecb7d596f179f93") endif () elseif (CMAKE_HOST_WIN32) if (_host_processor MATCHES "^(arm64|aarch64)$") set(_asset "symgen-windows-arm64.exe") - set(_asset_hash "SHA256=5bb22b4a4a9b5ad45646af411bfb09b8321a732ff3a077eb4c9de1feaef27d2b") + set(_asset_hash "SHA256=e116099f859177d7e29fc3444d67083596330e5c4fb3a0461b21402c89249d96") elseif (_host_processor MATCHES "^(x86_64|amd64)$") set(_asset "symgen-windows-x86_64.exe") - set(_asset_hash "SHA256=1d1ac087f991a96932d108969e15998becfec643e88f3e7d182ca97ebfc6a46f") + set(_asset_hash "SHA256=57ef1c2f563e33fa4915c40194c4ced540f985c48d9cf081047c6bbcb585fa37") elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") set(_asset "symgen-windows-x86.exe") - set(_asset_hash "SHA256=c113f4cd05f813efe2b1878dbfcf44d6302aee3974271736e0036430b0cced78") + set(_asset_hash "SHA256=cc0ba337c798d3f63d8acbb2d16d531d0c2da878fbdd2b6307702334ec880528") endif () endif () diff --git a/cmake/WindowsExports.cmake b/cmake/WindowsExports.cmake index 4596ac7b69..dae7f067c0 100644 --- a/cmake/WindowsExports.cmake +++ b/cmake/WindowsExports.cmake @@ -62,8 +62,6 @@ function(setup_windows_exports target) --out "${_def}" --exclude cmake_pch --exclude miniz - --exclude asan_options - --exclude src/dusk --max-exports 58000 ${_sdk_args} ${_forward_args} diff --git a/docs/modding.md b/docs/modding.md index e98abe0026..7d7fa142a0 100644 --- a/docs/modding.md +++ b/docs/modding.md @@ -1,88 +1,36 @@ # Dusklight Mod API -Mods are `.dusk` bundles: zip archives that can contain code (in the form of native libraries), resources, DVD overlay +Mods are `.dusk` bundles: zip archives that can contain code (native libraries or scripts), 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. +There are three types of mods: -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. +- **Asset-only mods**: Mods that contain no code, and may replace files on the game disc ("overlays") and provide + replacement textures (texture packs). +- **Native mods (C++)**: Fully-featured, with the ability to interop with game code and hook functions. Must be compiled + for every supported platform. (See [mod-template](https://github.com/TwilitRealm/mod-template)) +- **Script mods (Luau)**: Simple, widely-compatible, but can only access provided services. ## 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 fmt # remove game for service-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: - -- `fmt`: Provides the header-only `{fmt}` library and the formatted logging helpers in `mods/svc/log.hpp`. -- `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. +1. [mod.json](#modjson) +2. [Asset-only Mods](#asset-only-mods) +3. [Native Mods (C++)](#native-mods) +4. [Script Mods (Luau)](#script-mods) +5. [Services](#services) +6. [Built-in Services](#built-in-services) +7. [Hooking Game Functions](#hooking-game-functions) +8. [Asset Overlays](#asset-overlays) +9. [Runtime Lifecycle](#runtime-lifecycle) +10. [Error Handling](#error-handling) +11. [Advanced](#advanced) --- ## mod.json +Every mod starts with a single file, a `mod.json`: + ```json { "id": "com.example.my_mod", @@ -90,20 +38,60 @@ Passing `--mods ` on the command line replaces the user directory with one "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" + "icon": "res/icon.png", + "banner": "res/banner.png" } ``` -`id` is required: a unique, stable identifier (reverse-DNS style; periods, underscores, and alphanumerics). Everything -else is optional but recommended. +`id` is required: a unique, stable identifier (reverse-DNS style; periods, underscores, and lowercase 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. +`icon` and `banner` are bundle paths to PNG images that display in the in-game mod manager and mod website. A square +icon (1:1), and a banner (~3.5:1, minimum 800px width). If omitted, `res/icon.png` and `res/banner.png` are used +automatically when present. + +Simply create a zip file with a `mod.json`, and rename it to `.dusk`. That's it! --- -## Anatomy of a Code Mod +## Asset-only Mods + +``` +my_mod.dusk +├── mod.json +├── res/ (optional bundled resources) +├── overlay/ (optional game file overrides) +└── textures/ (optional texture replacements) +``` + +Place files in `overlay/` to replace the disc version of that file. Examples: + +- `overlay/Movie/demo_movie98_00.thp`: Replaces `Movie/demo_movie98_00.thp` on disc. +- `overlay/res/Object/Kmdl/archive/bmwr/al.bmd`: Replaces `archive/bmwr/al.bmd` _within_ `res/Object/Kmdl.arc` without + overwriting the entire `.arc`. + +Place textures in `textures/` to automatically register them as texture replacements when active. These follow the same +[Dolphin-compatible naming scheme](#textureservice-modssvctextureh) as the user `/texture_replacements/` +directory. Directories are scanned recursively. Examples: + +- `textures/tex1_256x128_e6a4c7be9bf48305_14.dds`: Replaces the Hero's Clothes texture. + +Simply zip the `mod.json` and adjacent folders, then rename to `.dusk`. Then, 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` + +--- + +## Native Mods + +Mods built with [mod-template](https://github.com/TwilitRealm/mod-template) are native C++ mods. Native mods are very +powerful and can interact with and [hook](#hooking-game-functions) game code directly. All features are available to +native mods. + +Example C++ mod: ```cpp #include "mods/service.hpp" @@ -126,18 +114,172 @@ MOD_EXPORT ModResult mod_update(ModError* error) { // called every frame 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. +When native 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, native 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. + +### Quick Start (Native Mods) + +Create a repository from +the [mod-template](https://github.com/new?template_name=mod-template&template_owner=TwilitRealm), +a self-contained CMake project that uses the Dusklight mod SDK. It includes a GitHub Actions CI workflow that builds the +mod for every supported platform. + +``` +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 fmt # remove game for service-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: + +- `fmt`: Provides the header-only `{fmt}` library and the formatted logging helpers in + [`mods/svc/log.hpp`](../sdk/include/mods/svc/log.hpp). +- `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`](https://github.com/webgpu-native/webgpu-headers/blob/main/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. + +--- + +## Script Mods + +For simpler use cases where direct game code access and hooks aren't necessary, Luau mods are also supported. +Luau mods do not need to be compiled, and are always supported on all platforms. However, they can only use services +that are provided as Luau modules. + +Mods can utilize Luau to add UI elements to their mod panel, use configuration variables, and dynamically swap out +models/textures at runtime (e.g. to switch model variants or disable certain replacements) while remaining widely +compatible. + +Example mod structure: + +``` +my_luau_mod.dusk +├── mod.json +└── res/ + ├── main.luau + └── lib/util.luau +``` + +Set the `runtime` to `dev.twilitrealm.luau@1.0` in `mod.json`: + +```json +{ + "id": "com.example.my_luau_mod", + "name": "My Script Mod", + "version": "1.0.0", + "runtime": "dev.twilitrealm.luau@1.0" +} +``` + +`res/main.luau` runs once when the mod activates. Register optional update and shutdown callbacks through +`dusklight.host`: + +```lua +local host = require("dusklight.host") +host.on_update(function() + -- Runs every frame +end) +host.on_shutdown(function() + -- Runs on mod deactivation +end) +``` + +Require script modules with `./` or `../` paths relative to the requiring file. The runtime appends `.luau` and rejects +paths that escape `res/`. + +The runtime provides these modules: + +- `dusklight.log`: `write`, `trace`, `debug`, `info`, `warn`, and `error`. +- `dusklight.host`: host `version`, mod metadata and directories, lifecycle callbacks, and `fail`. +- `dusklight.config`: bool, integer, float, and string variables with `get`, `set`, and subscriptions. +- `dusklight.resource`: binary-safe reads from the mod's `res/` tree. +- `dusklight.overlay`: file and copied-buffer overlays with removable handles. +- `dusklight.texture`: encoded-file and raw-data replacements with unregisterable handles. +- `dusklight.ui`: Mods panels, controls, lists, windows, dialogs, styles, menu tabs, toasts, and clipboard access. + +For completion and type checking, add `sdk/luau/dusklight.d.luau` to the `luau-lsp.types.definitionFiles` setting. + +Configurable overlay example: + +```lua +local config = require("dusklight.config") +local overlay = require("dusklight.overlay") + +local hood = config.register({ name = "hood", type = "bool", default = true }) +local current + +local function apply(enabled) + if current then current:remove() end + current = overlay.add_file("/res/Object/Alink.arc", + enabled and "res/alink_hood.arc" or "res/alink_nohood.arc") +end + +hood:subscribe(apply) +apply(hood:get()) +``` + +To create a script mod, copy `sdk/luau/template`, edit its manifest and source, then zip the `mod.json` and adjacent +folders and rename to `.dusk`. 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` + +**Restrictions:** The Luau VM has no raw filesystem, network, or game-code access. Each script mod has a 64 MiB memory +limit. Calls are interrupted after 250 ms for updates and UI callbacks or 5 seconds for lifecycle calls. An uncaught +error, timeout, or memory exhaustion fails and disables the mod. --- ## 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: +A service is a struct of C function pointers with a version header. Import services at file scope, and the loader +resolves them before initializing the mod: ```cpp IMPORT_SERVICE(LogService, svc_log); // required, latest minor version @@ -145,7 +287,7 @@ IMPORT_SERVICE_VERSION(LogService, svc_log, 0); // required, minimum minor ver IMPORT_OPTIONAL_SERVICE(SomeService, svc_maybe); // may be null ``` -A service must be imported in only **one** file (usually your `mod.cpp`). Other files may simply use `svc_log` or +A service should be imported in only **one** file (usually your `mod.cpp`). Other files may simply use `svc_log` or `mods::log::` after including the appropriate header. Each service is individually versioned, and there may be multiple major versions of a service provided at once, @@ -153,26 +295,19 @@ allowing backwards compatibility with older mods while still changing services f 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. +`IMPORT_SERVICE` and `IMPORT_OPTIONAL_SERVICE` require the latest minor version compiled against, guaranteeing that +every function is present. If a mod doesn't use (or may operate without) functions added in later minor versions, and +wants to remain compatible with older Dusklight versions, it may use `IMPORT_SERVICE_VERSION` or +`IMPORT_OPTIONAL_SERVICE_VERSION` to require an older minor version. It can then check `SERVICE_HAS` at runtime to see +if a newer function is present (i.e. running on a new enough Dusklight version). --- ## Built-in Services -### LogService (`mods/svc/log.h`) +### LogService ([`mods/svc/log.h`](../sdk/include/mods/svc/log.h)) + +**C++** ```cpp IMPORT_SERVICE(LogService, svc_log); @@ -183,9 +318,16 @@ svc_log->error(mod_ctx, "very bad"); svc_log->write(mod_ctx, LOG_LEVEL_DEBUG, "verbose details"); ``` +**Luau** + +```lua +local log = require("dusklight.log") +log.info("spawned the thing") +``` + Messages appear in the console prefixed with your mod ID. Messages are plain UTF-8 strings and are copied before the call returns. C++ mods can enable `add_mod(... FEATURES fmt)` and use the formatted logging helpers in -`mods/svc/log.hpp`: +[`mods/svc/log.hpp`](../sdk/include/mods/svc/log.hpp): ```cpp #include @@ -194,11 +336,13 @@ mods::log::info("spawned actor {} at ({}, {})", actorName, x, y); mods::log::warn("health is down to {:.1f}%", healthPercent); ``` -### ResourceService (`mods/svc/resource.h`) +### ResourceService ([`mods/svc/resource.h`](../sdk/include/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. +**C++** + ```cpp IMPORT_SERVICE(ResourceService, svc_resource); @@ -209,12 +353,185 @@ if (svc_resource->load(mod_ctx, "config.txt", &buf) == MOD_OK) { } ``` +**Luau** + +```lua +local resource = require("dusklight.resource") +local contents = resource.load("config.txt") +``` + Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. The bundle is read-only; use `HostService::data_dir` for persistent storage. -### HostService (`mods/svc/host.h`) +### FileService ([`mods/svc/file.h`](../sdk/include/mods/svc/file.h)) -Mod metadata and runtime interaction with the loader: +Provides file and folder pickers, file I/O, exports and folder enumeration. + +A location is an opaque UTF-8 string returned by `pick_*`, `export_file`, `join`, or `create_child`. +Save it and pass it back to the service. Never parse it or manually append path segments. + +```cpp +#include "mods/svc/file.hpp" + +IMPORT_SERVICE(FileService, svc_file); + +mods::file::PickOptions options; +options.filters.push_back({"Audio", "wav;ogg"}); +mods::file::pick_file(options, [](mods::file::PickResult result) { + if (result.status == MOD_OK && !result.locations.empty()) { + save_location(result.locations.front()); + } +}); +``` + +Use `check` before reopening a saved location because removable storage or an access grant may no longer be available. +`open` provides seekable streaming I/O. `read_all` allocates the entire file and should only be used when the file is +small. Folder locations support `list` and child resolution through `join`. Only one picker can be open at a time. + +`create_child` never replaces an existing file and returns `MOD_CONFLICT` if one exists. Use the returned location; +document providers may adjust the requested name. `write_all` is a convenience function over +`open`/`write`/`flush`/`close`. + +```cpp +std::string location; +if (mods::file::create_child(folder, "report.txt", location) == MOD_OK) { + mods::file::write_all(location, report); +} + +mods::file::export_file(location, "report.txt", [](mods::file::PickResult result) { + if (result.status == MOD_OK) { + remember_export_destination(result.locations.front()); + } +}); +``` + +`export_file` copies an existing file to a user-selected destination and returns the destination location in its +callback. Mod-owned persistent files belong in `HostService::data_dir`. + +### HttpService ([`mods/svc/http.h`](../sdk/include/mods/svc/http.h)) + +Asynchronous HTTPS requests supporting HTTP/2 and TLS 1.2+. C++ mods should use the helpers in +[`mods/svc/http.hpp`](../sdk/include/mods/svc/http.hpp): + +```cpp +#include "mods/svc/http.hpp" + +IMPORT_SERVICE(HttpService, svc_http); + +mods::http::Pending pendingRequest; + +void fetch_manifest() { + mods::http::Request request{ + .url = "https://example.com/manifest.json", + .maxBodyBytes = 256 * 1024, + }; + pendingRequest = mods::http::request(request, [](mods::http::Response response) { + if (!response.ok()) { + handle_fetch_error(response.error, response.statusCode); + return; + } + + std::string manifest{response.body.begin(), response.body.end()}; + use_manifest(manifest); + }); + if (!pendingRequest) { + handle_start_error(pendingRequest.result()); + } +} +``` + +Keep the returned `Pending` alive until completion. Dropping it or calling `cancel` requests cancellation. Callbacks run +on the game thread. + +`Response::ok()` requires a 2xx status. Other HTTP statuses are valid responses, not transport errors, so always check +`statusCode`. In-memory responses default to a 1 MiB limit; set `maxBodyBytes` to increase it if needed. + +For large responses, set `downloadPath` to an absolute path in the calling mod's `HostService::data_dir` or +`HostService::mod_dir`. The response is streamed to disk instead of loaded in memory. On success, the callback receives +an empty `body` and the final path in `downloadPath`. Check `Response::ok()` before using the file. +`Pending::progress()` reports download progress when the server provides a total size. + +### WebSocketService ([`mods/svc/websocket.h`](../sdk/include/mods/svc/websocket.h)) + +WebSocket client connections with text or binary messages. Secure `wss://` URLs are supported everywhere. Insecure +`ws://` is limited to `localhost`, `127.0.0.1`, and `[::1]`. + +```cpp +#include "mods/svc/websocket.hpp" + +IMPORT_SERVICE(WebSocketService, svc_websocket); + +mods::ws::Connection connection; + +MOD_EXPORT ModResult mod_initialize(ModError*) { + connection = mods::ws::connect({.url = "wss://example.com/events"}); + return connection ? MOD_OK : connection.result(); +} + +MOD_EXPORT ModResult mod_update(ModError*) { + mods::ws::Event event; + while (mods::ws::poll(event)) { + if (event.type == WEBSOCKET_EVENT_MESSAGE) { + consume(event.data); + } else if (event.type == WEBSOCKET_EVENT_CLOSED) { + schedule_reconnect(event.error); + } + } + return MOD_OK; +} +``` + +Keep the `Connection` alive and drain `mods::ws::poll()` regularly, usually on every `mod_update` tick. A connection +emits an (optional) `OPEN` event, zero to many `MESSAGE` events, and exactly one `CLOSED` event. + +**Restrictions:** A mod may only open four connections at once. Messages have a 1 MiB limit by default, and may request +up to 16 MiB. Unread data is limited to 16 MiB and the outbound queue to 4 MiB. `send` returns `MOD_CONFLICT` when the +outbound queue is full. Dropping the `Connection` or deactivating the mod attempts to gracefully close with code 1001, +until the close deadline expires. + +### NetService ([`mods/svc/net.h`](../sdk/include/mods/svc/net.h)) + +Asynchronous raw TCP and UDP networking. Endpoints can be `tcp://host:port` or `udp://host:port`. TCP connections and +`resolve` accept hostnames. Listeners and UDP endpoints require IP literals. + +```cpp +#include "mods/svc/net.hpp" + +IMPORT_SERVICE(NetService, svc_net); + +mods::net::BindOutcome bound; +mods::net::Socket listener; +mods::net::Socket client; + +MOD_EXPORT ModResult mod_initialize(ModError*) { + listener = mods::net::listen("tcp://127.0.0.1:0", &bound); + client = mods::net::connect(bound.local); + return listener && client ? MOD_OK : MOD_ERROR; +} + +MOD_EXPORT ModResult mod_update(ModError*) { + mods::net::Event event; + while (mods::net::poll(event)) { + if (event.type == NET_EVENT_ACCEPTED) { + remember_client(mods::net::adopt(event.accepted)); + } else if (event.type == NET_EVENT_STREAM_DATA) { + consume(event.data); + } + } + return MOD_OK; +} +``` + +`send` and `send_to` copy the payload and return `MOD_CONFLICT` when the socket's outbound queue is full. `stats` +reports queued bytes, traffic, dropped inbound datagrams, and asynchronous UDP send failures. + +**Restrictions:** A mod may only have 32 streams, 4 listeners, 4 UDP sockets, and 8 DNS resolutions active at once. + +### HostService ([`mods/svc/host.h`](../sdk/include/mods/svc/host.h)) + +Mod metadata and runtime interaction with the loader. + +**C++** ```cpp IMPORT_SERVICE(HostService, svc_host); @@ -232,6 +549,20 @@ if (svc_host->data_dir(mod_ctx, &dataDir) == MOD_OK) { svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened"); ``` +**Luau** + +```lua +local host = require("dusklight.host") +local dataDir = host.data_dir() +host.on_update(function() + -- Runs every frame +end) +host.on_shutdown(function() + -- Runs on mod deactivation +end) +host.fail("something unrecoverable happened") +``` + `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, @@ -254,17 +585,19 @@ 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`) +### HookService ([`mods/svc/hook.h`](../sdk/include/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/svc/hook.hpp` described in [Hooking Game Functions](#hooking-game-functions). +[`mods/svc/hook.hpp`](../sdk/include/mods/svc/hook.hpp) described in +[Hooking Game Functions](#hooking-game-functions). -### OverlayService (`mods/svc/overlay.h`) +### OverlayService ([`mods/svc/overlay.h`](../sdk/include/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, a file within an archive, -or with a caller-owned buffer -(copied on registration): +or with a caller-owned buffer (copied on registration). + +**C++** ```cpp IMPORT_SERVICE(OverlayService, svc_overlay); @@ -276,6 +609,14 @@ svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr); svc_overlay->remove(mod_ctx, handle); ``` +**Luau** + +```lua +local overlay = require("dusklight.overlay") +local replacement = overlay.add_file("/Movie/demo_movie98_00.thp", "res/replacement.thp") +replacement:remove() +``` + `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. @@ -285,11 +626,13 @@ data get refreshed without a full restart. See [Asset Overlays](#asset-overlays) for priority and conflict handling. -### TextureService (`mods/svc/texture.h`) +### TextureService ([`mods/svc/texture.h`](../sdk/include/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: +your bundle whose filename encodes the key. + +**C++** ```cpp IMPORT_SERVICE(TextureService, svc_texture); @@ -310,6 +653,14 @@ svc_texture->register_data(mod_ctx, &key, &data, nullptr); svc_texture->unregister(mod_ctx, handle); ``` +**Luau** + +```lua +local texture = require("dusklight.texture") +local replacement = texture.register_file("res/tex1_32x32_$_6.png") +replacement:unregister() +``` + 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 @@ -317,11 +668,13 @@ at registration. Registrations follow your mod's lifecycle. See [Asset Overlays](#asset-overlays) for priority and conflict handling. -### ConfigService (`mods/svc/config.h`) +### ConfigService ([`mods/svc/config.h`](../sdk/include/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: +next to the host's own settings. + +**C++** ```cpp IMPORT_SERVICE(ConfigService, svc_config); @@ -345,6 +698,17 @@ void on_speed_changed(ModContext* ctx, ConfigVarHandle var, const ConfigVarValue svc_config->subscribe(mod_ctx, var, on_speed_changed, nullptr, nullptr); ``` +**Luau** + +```lua +local config = require("dusklight.config") +local speed = config.register({ name = "speedMultiplier", type = "float", default = 1.0 }) +speed:subscribe(function(value, previous) + -- React to the new value. +end) +speed:set(2.0) +``` + 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. @@ -353,7 +717,7 @@ Change callbacks fire on the game thread whenever the value changes at runtime ( 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. -### SaveService (`mods/svc/save.h`) +### SaveService ([`mods/svc/save.h`](../sdk/include/mods/svc/save.h)) Stores named binary blobs for each save slot. Blob names are scoped to the calling mod, and each mod may store up to `SAVE_BLOB_BUDGET_BYTES` per slot. The service copies data passed to `set_blob`. @@ -386,7 +750,7 @@ buffer contract as `get_blob`. Pass a `NULL` buffer to either read function to q are cleared. Observers are removed automatically when the mod is detached, so the output handle is only needed for manual unregistration. Save callbacks run on the game thread. -### StageService (`mods/svc/stage.h`) +### StageService ([`mods/svc/stage.h`](../sdk/include/mods/svc/stage.h)) Allows making changes to a stage's "stage info" (contents of .dzs/.dzr files). (Currently only supports editing actor nodes.) @@ -435,7 +799,7 @@ Stage names may contain up to 8 characters. For patches and deletions, room `0xf layer; additions require a specific room. Edits are removed when the mod is detached. If multiple mods edit the same record, the later-loaded mod wins. -### UiService (`mods/svc/ui.h`) +### UiService ([`mods/svc/ui.h`](../sdk/include/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. @@ -445,6 +809,8 @@ content is rebuilt, and `update` runs every frame while that mod is selected. Wh 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"]`). +**C++** + ```cpp IMPORT_SERVICE(UiService, svc_ui); @@ -468,6 +834,18 @@ panel.update = update; svc_ui->register_mods_panel(mod_ctx, &panel); ``` +**Luau** + +```lua +local ui = require("dusklight.ui") +ui.register_mods_panel({ + build = function(panel) + panel:add_section("Status") + panel:add_text("running") + end, +}) +``` + 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 @@ -496,6 +874,49 @@ controls are only available inside window tabs. and calls the group's build callback with that pane, which is useful for organizing related controls without adding more tabs. +**Lists:** `pane_add_list` adds a scrollable virtualized list of items that can be efficiently updated and filtered. +Keys must be unique and remain stable across replacements. + +```cpp +UiListHandle locationList = 0; + +void replace_locations(std::string_view query) { + std::vector items; + for (uint64_t i = 0; i < locations.size(); ++i) { + if (matches(locations[i], query)) { + UiListItem item = UI_LIST_ITEM_INIT; + item.key = i; + item.label = locations[i].c_str(); + items.push_back(item); + } + } + svc_ui->list_set_items(mod_ctx, locationList, items.data(), items.size()); +} + +void set_filter(ModContext*, void*, const UiControlValue* value) { + replace_locations(value->string_value); +} + +bool location_selected(ModContext*, UiListHandle, uint64_t key, void*) { + return selected_locations.contains(key); +} + +UiControlDesc filter = UI_CONTROL_DESC_INIT; +filter.kind = UI_CONTROL_STRING; +filter.label = "Filter"; +filter.get = get_filter; +filter.set = set_filter; +filter.string_set_mode = UI_STRING_SET_ON_CHANGE; /* invoke `set` while typing */ +svc_ui->pane_add_control(mod_ctx, pane, &filter, nullptr); + +UiListDesc list = UI_LIST_DESC_INIT; +/* items may be passed as a part of list creation, or set afterwards */ +list.on_pressed = location_pressed; +list.is_selected = location_selected; +svc_ui->pane_add_list(mod_ctx, pane, &list, &locationList); +replace_locations(""); /* calls `list_set_items` */ +``` + **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 @@ -529,7 +950,11 @@ ModResult build_dialog(ModContext*, UiElementHandle pane, void*, ModError*) { return svc_ui->pane_add_control(mod_ctx, pane, &input, nullptr); } -UiDialogAction action = {"Save", save, nullptr, false}; +UiDialogAction action = UI_DIALOG_ACTION_INIT; +action.label = "Save"; +action.on_pressed = save; +action.is_disabled = is_save_disabled; + UiDialogDesc dialog = UI_DIALOG_DESC_INIT; dialog.title = "New Preset"; dialog.body_rml = "Choose a name for the preset."; @@ -540,8 +965,8 @@ svc_ui->dialog_push(mod_ctx, &dialog, nullptr); ``` After an action's `on_pressed`, the dialog closes unless the action sets `keep_open`. It can then be closed later -(or immediately) with `dialog_close`. Cancel fires `on_dismiss` and always closes. `dialog_set_body`, `dialog_set_icon`, -and `dialog_add_action` mutate a live dialog. +(or immediately) with `dialog_close`. Cancel fires `on_dismiss` and always closes. `dialog_set_body` and +`dialog_set_icon` mutate a live dialog. **Toasts:** `push_toast` enqueues a notification. Titles and bodies accept RML. The optional `type` is applied as an RCSS class; `warning` uses the built-in warning appearance, and mods can define their own types. A duration of 0 uses @@ -570,7 +995,7 @@ existing documents restyle immediately, and future ones pick it up when created. host styles and may override them. Scope selectors tightly (use `[mod-id="..."]`!), especially for `UI_SCOPE_WINDOW`, unless changing host UI is intentional. -### WindowService (`mods/svc/window.h`) +### WindowService ([`mods/svc/window.h`](../sdk/include/mods/svc/window.h)) Allows creating new windows that can be rendered to via `GfxService`. @@ -590,12 +1015,13 @@ one present target may be attached to a WindowService window at a time. New windows are hidden by default so a mod can finish attaching graphics before calling `show_window`. -### GfxService (`mods/svc/gfx.h`) +### GfxService ([`mods/svc/gfx.h`](../sdk/include/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. +Direct WebGPU access at various stages of the rendering pipeline. Mods use the `wgpu*` C API (via +[`webgpu/webgpu.h`](https://github.com/webgpu-native/webgpu-headers/blob/main/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); @@ -645,7 +1071,7 @@ To create a `WGPUSurface` manually, `GfxDeviceInfo` holds the `WGPUInstance` and `push_present` must be called every frame from a GfxService stage callback. If surface was lost, `push_present` returns `MOD_ERROR`. Unregister and re-register the target before trying again. -### CameraService (`mods/svc/camera.h`) +### CameraService ([`mods/svc/camera.h`](../sdk/include/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), @@ -667,7 +1093,7 @@ first in-game frame. Projection matrices match the renderer's WebGPU clip conven Camera operators allow overriding the main camera. When an operator callback returns true, its values replace the camera state for the current frame. Register and unregister using `register_camera_operator` / `unregister_camera_operator`. -### GameModeService (`mods/svc/game_mode.h`) +### GameModeService ([`mods/svc/game_mode.h`](../sdk/include/mods/svc/game_mode.h)) Allows a mod to register a game mode with callbacks for key gameplay and save lifecycle events. Registered game modes appear in the prelaunch menu. Game modes may use a unique set of saves by configuring `save_name`; leave it empty to use @@ -786,6 +1212,82 @@ svc_game_mode->register_game_mode(mod_ctx, &gameModeDesc); ``` +### ActorService (`mods/svc/actor.h`) + +A service that manages registering and creating custom actors. These actors will be run by the game as if they are part of the engine. These actors can be created by the game either by its 16-bit actor name, or a 7-character long name that can +be loaded by a stage. + +```cpp +#include "mods/svc/actor.h" +IMPORT_SERVICE(ActorService, svc_actor); + +class myActor_c : public fopAc_ac_c {}; + +int myActor_Create(void* i_this) { + // Ran several times, until it returns cPhs_COMPLEATE_e to allow for async loading + return cPhs_COMPLEATE_e; +} + +int myActor_Delete(void* i_this) { + // Free resources here + return 1; +} + +int myActor_Execute(void* i_this) { + // Ran once per game tick + return 1; +} + +int myActor_IsDelete(void* i_this) { + // Returns 1 when the actor can be deleted + return 1; +} + +int myActor_Draw(void* i_this) { + // Code to draw the actor + return 1; +} + +s16 actor_name; // The process name that can be used by the game to load the actor +ActorHandle actor_handle; +ActorProfileDesc profDesc = { + .name = "AUnique", // The name used by the stage loader to load the actor with. + // It has a character limit of 7 and must be unique among active + // mod actors. Matching a game actor name overrides stage lookup. + .priority_group = 7, // When, relative to other actors _Execute should run + // See: mods/svc/actor.h + .process_size = sizeof(myActor_c), + .draw_priority = fpcDwPi_OBJ_LBOX_e, // Defines when the actor should be drawn relative + // to other actors (see f_pc_draw_priority.h) + .status = fopAcStts_CULL_e | fopAcStts_UNK_0x4000_e | fopAcStts_UNK_0x40000_e, + .group = fopAc_ACTOR_e, // Can be fopAc_ACTOR_e, fopAc_PLAYER_e, fopAc_ENEMY_e, or fopAc_NPC_e + .cull_type = fopAc_CULLBOX_CUSTOM_e, + .create_function = myActor_Create, + .delete_function = myActor_Delete, + .execute_function = myActor_Execute, + .is_delete_function = myActor_IsDelete, + .draw_function = myActor_Draw, +}; +svc_actor->register_actor(mod_ctx, &profDesc, &actor_name, &actor_handle); + +// Spawn the actor at the player's position +fopAc_ac_c* plr = dComIfGp_getPlayer(0); +if (plr) { + ActorSpawnParams spawnParams = { + .parameters = 0, + .argument = 0, + .room_num = fopAcM_GetRoomNo(plr), + .position = {plr->current.pos.x, plr->current.pos.y, plr->current.pos.z}, + .angle = {plr->current.angle.x, plr->current.angle.y, plr->current.angle.z}, + .scale = {1.0f, 1.0f, 1.0f} + }; + ActorId created_actor_id; + svc_actor->create_actor(mod_ctx, actor_name, &spawnParams, &created_actor_id); +} +``` + +See `mods/custom_actor_demo` for a more complete example. + --- ## Hooking Game Functions @@ -793,7 +1295,7 @@ svc_game_mode->register_game_mode(mod_ctx, &gameModeDesc); **Requires `add_mod(... FEATURES game)`** Mods may hook the vast majority of game functions, including file-local static, private and virtual functions. -`mods/svc/hook.hpp` provides typed helpers over the hook service: +[`mods/svc/hook.hpp`](../sdk/include/mods/svc/hook.hpp) provides typed helpers over the hook service: ```cpp #include "mods/svc/hook.hpp" diff --git a/extern/aurora b/extern/aurora index 0f15fb65d1..749d6ee7a2 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit 0f15fb65d13e4a7145667934e0291bad09806bfd +Subproject commit 749d6ee7a22bdfab78c8ece9047bca5d79aa72ca diff --git a/extern/borealis b/extern/borealis index 6fd955e7e6..f55910bd79 160000 --- a/extern/borealis +++ b/extern/borealis @@ -1 +1 @@ -Subproject commit 6fd955e7e6a2d2d47c5a4eaf363fb49847e490ba +Subproject commit f55910bd79248db250ebd9debb6624d78538c21c diff --git a/files.cmake b/files.cmake index 86fe5c5eab..bb5bebeaf1 100644 --- a/files.cmake +++ b/files.cmake @@ -244,7 +244,7 @@ set(DOLZEL_FILES src/CaptureScreen.cpp ) if(DEBUG) - list(APPEND DOLZEL_FILES src/d/d_event_debug.cpp) + list(APPEND DOLZEL_FILES src/d/d_event_debug.cpp) endif(DEBUG) set(Z2AUDIOLIB_FILES @@ -1404,10 +1404,10 @@ set(REL_FILES ) set(DOLPHIN_FILES - libs/dolphin/src/gf/GFGeometry.cpp - libs/dolphin/src/gf/GFLight.cpp - libs/dolphin/src/gf/GFPixel.cpp - libs/dolphin/src/gf/GFTev.cpp + libs/dolphin/src/gf/GFGeometry.cpp + libs/dolphin/src/gf/GFLight.cpp + libs/dolphin/src/gf/GFPixel.cpp + libs/dolphin/src/gf/GFTev.cpp ) set(DUSK_FILES @@ -1433,11 +1433,16 @@ set(DUSK_FILES src/dusk/dvd_asset.hpp src/dusk/extras.c src/dusk/frame_interpolation.cpp + src/dusk/commands.cpp + src/dusk/commands.hpp src/dusk/game_clock.cpp src/dusk/game_mode.cpp src/dusk/gamepad_color.cpp src/dusk/globals.cpp src/dusk/gyro.cpp + src/dusk/game_combos.cpp + src/dusk/trigger_viewer.cpp + #src/dusk/m_Do_ext_dusk.cpp src/dusk/hq_minimap.cpp src/dusk/imgui/ImGuiActorSpawner.cpp src/dusk/imgui/ImGuiBloomWindow.cpp @@ -1478,20 +1483,27 @@ set(DUSK_FILES src/dusk/mods/loader/prepatch.cpp src/dusk/mods/loader/prepatch.hpp src/dusk/mods/item.hpp + src/dusk/mods/item_actor.cpp src/dusk/mods/item_checks.cpp src/dusk/mods/item_gives.cpp 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/actor.cpp src/dusk/mods/svc/camera.cpp src/dusk/mods/svc/config.cpp src/dusk/mods/svc/config.hpp + src/dusk/mods/svc/file.cpp src/dusk/mods/svc/game.cpp src/dusk/mods/svc/gfx.cpp src/dusk/mods/svc/flow.cpp src/dusk/mods/svc/hook.cpp src/dusk/mods/svc/host.cpp + src/dusk/mods/svc/http.cpp + src/dusk/mods/svc/net.cpp + src/dusk/mods/svc/net.hpp + src/dusk/mods/svc/websocket.cpp src/dusk/mods/svc/item.cpp src/dusk/mods/svc/item.hpp src/dusk/mods/svc/log.cpp @@ -1521,6 +1533,8 @@ set(DUSK_FILES src/dusk/touch_camera.cpp src/dusk/ui/achievements.cpp src/dusk/ui/achievements.hpp + src/dusk/ui/command_console.cpp + src/dusk/ui/command_console.hpp src/dusk/ui/bool_button.cpp src/dusk/ui/bool_button.hpp src/dusk/ui/button.cpp @@ -1542,12 +1556,16 @@ set(DUSK_FILES src/dusk/ui/graphics_tuner.hpp src/dusk/ui/group_button.cpp src/dusk/ui/group_button.hpp + src/dusk/ui/file_button.cpp + src/dusk/ui/file_button.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/list.cpp + src/dusk/ui/list.hpp src/dusk/ui/menu_bar.cpp src/dusk/ui/menu_bar.hpp src/dusk/ui/mod_texture_provider.cpp diff --git a/include/Z2AudioCS/SpkMixingBuffer.h b/include/Z2AudioCS/SpkMixingBuffer.h index ccdb8902b0..5cdfcd74bb 100644 --- a/include/Z2AudioCS/SpkMixingBuffer.h +++ b/include/Z2AudioCS/SpkMixingBuffer.h @@ -13,7 +13,6 @@ public: bool update(s32 chan); void bzeroBuffer(s32 chan); -private: /* 0x00 */ s16* mBuffer[4]; }; diff --git a/include/Z2AudioCS/SpkSpeakerCtrl.h b/include/Z2AudioCS/SpkSpeakerCtrl.h index 7216eed07d..372d5b1835 100644 --- a/include/Z2AudioCS/SpkSpeakerCtrl.h +++ b/include/Z2AudioCS/SpkSpeakerCtrl.h @@ -41,7 +41,6 @@ public: static bool checkRadioSensitivity(s32 chan); static bool isSubmitPlayByRadioSensitivity(s32 chan); -private: }; #endif /* Z2AUDIOCS_SPKSPEAKERCTRL_H */ diff --git a/include/Z2AudioCS/SpkSystem.h b/include/Z2AudioCS/SpkSystem.h index 05541c72e5..03b30cda6e 100644 --- a/include/Z2AudioCS/SpkSystem.h +++ b/include/Z2AudioCS/SpkSystem.h @@ -28,7 +28,6 @@ public: inline SpkData* getData(void) const { return mData; } inline SpkMixingBuffer* getMixingBuffer(void) const { return mMixingBuffer; } -private: /* 0x00 */ JKRHeap* mHeap; /* 0x04 */ SpkData* mData; /* 0x08 */ SpkMixingBuffer* mMixingBuffer; diff --git a/include/Z2AudioCS/SpkTable.h b/include/Z2AudioCS/SpkTable.h index 862fdba3c1..f2234f5a06 100644 --- a/include/Z2AudioCS/SpkTable.h +++ b/include/Z2AudioCS/SpkTable.h @@ -31,7 +31,6 @@ public: return (SpkTableParams*)mEntryOffset + num; } - // private: /* 0x00 */ bool mIsInitialized; /* 0x04 */ s32 mNumOfSound; /* 0x08 */ u32 mEntryOffset; diff --git a/include/Z2AudioCS/SpkWave.h b/include/Z2AudioCS/SpkWave.h index 6a604d8a50..72cde1c0a0 100644 --- a/include/Z2AudioCS/SpkWave.h +++ b/include/Z2AudioCS/SpkWave.h @@ -25,7 +25,6 @@ public: inline const void* getResource(void) const { return mWaveData; } inline void* getResource(void) { return mWaveData; } -private: /* 0x00 */ void* mWaveData; }; diff --git a/include/Z2AudioLib/Z2Creature.h b/include/Z2AudioLib/Z2Creature.h index c4f96ca742..c17394b75f 100644 --- a/include/Z2AudioLib/Z2Creature.h +++ b/include/Z2AudioLib/Z2Creature.h @@ -67,7 +67,6 @@ public: void playVoice(int); virtual Z2SoundHandlePool* startCreatureVoice(JAISoundID soundID, s8 reverb); -private: /* 0xA0 */ s8 mCitizenID; /* 0xA1 */ s8 field_0xa1; /* 0xA2 */ bool mLinkSearch; diff --git a/include/Z2AudioLib/Z2LinkMgr.h b/include/Z2AudioLib/Z2LinkMgr.h index 705394df5e..e64c1729eb 100644 --- a/include/Z2AudioLib/Z2LinkMgr.h +++ b/include/Z2AudioLib/Z2LinkMgr.h @@ -63,7 +63,6 @@ public: friend class Z2LinkSoundStarter; friend struct Z2RideSoundStarter; -private: /* 0x90 Z2LinkSoundStarter */ /* 0x94 */ Z2SoundObjSimple mKantera; /* 0xB4 */ Vec field_0xb4; @@ -123,7 +122,6 @@ public: virtual void deleteObject(); -private: /* 0x90 */ // Z2RideSoundStarter mSoundStarter; /* 0x98 */ bool mLinkRiding; }; // Size: 0x9C @@ -136,7 +134,6 @@ public: Z2SoundHandlePool* startFireSound(u16); Z2SoundHandlePool* startSound(JAISoundID soundID, u32 mapinfo, s8 reverb); -private: /* 0x20 */ f32 field_0x20; }; diff --git a/include/Z2AudioLib/Z2SceneMgr.h b/include/Z2AudioLib/Z2SceneMgr.h index 1b3ef2cc0b..739c53bb10 100644 --- a/include/Z2AudioLib/Z2SceneMgr.h +++ b/include/Z2AudioLib/Z2SceneMgr.h @@ -47,7 +47,6 @@ public: s32 getBgmLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 1); } u8 getDemoSeWaveNum() { return loadedDemoWave; } -private: /* 0x00 */ JAISoundID BGM_ID; /* 0x04 */ int sceneNum; /* 0x08 */ int timer; diff --git a/include/Z2AudioLib/Z2SeMgr.h b/include/Z2AudioLib/Z2SeMgr.h index 3f8ca03eb3..7075308ef7 100644 --- a/include/Z2AudioLib/Z2SeMgr.h +++ b/include/Z2AudioLib/Z2SeMgr.h @@ -84,7 +84,6 @@ public: void homeMenuSeCallback(s32); #endif -private: /* 0x000 */ JAISoundHandle mSoundHandle[24]; /* 0x060 */ JAISoundHandles mSoundHandles; #if VERSION >= VERSION_WII_USA_R0 diff --git a/include/Z2AudioLib/Z2SoundHandles.h b/include/Z2AudioLib/Z2SoundHandles.h index 5915e5967b..1ad344c796 100644 --- a/include/Z2AudioLib/Z2SoundHandles.h +++ b/include/Z2AudioLib/Z2SoundHandles.h @@ -44,7 +44,6 @@ public: return (Z2SoundHandlePool*)getNth(index); } -private: /* 0xC */ u8 handleNum_; }; diff --git a/include/Z2AudioLib/Z2SoundMgr.h b/include/Z2AudioLib/Z2SoundMgr.h index cd6341b2cb..eabf9d2614 100644 --- a/include/Z2AudioLib/Z2SoundMgr.h +++ b/include/Z2AudioLib/Z2SoundMgr.h @@ -38,7 +38,6 @@ public: const JAISeqMgr* getSeqMgr() const { return &seqMgr_; } JAIStreamMgr* getStreamMgr() { return &streamMgr_; } -private: /* 0x004 */ JAISeMgr seMgr_; /* 0x728 */ JAISeqMgr seqMgr_; /* 0x79C */ JAIStreamMgr streamMgr_; diff --git a/include/Z2AudioLib/Z2SoundObjMgr.h b/include/Z2AudioLib/Z2SoundObjMgr.h index 687f9eaf0a..64bf058ba1 100644 --- a/include/Z2AudioLib/Z2SoundObjMgr.h +++ b/include/Z2AudioLib/Z2SoundObjMgr.h @@ -104,7 +104,6 @@ public: JSUList* getAllList() { return &allList_; } #endif -private: /* 0x00 */ JSUList field_0x0; #if PARTIAL_DEBUG || DEBUG /* 0x0C */ JSUList allList_; diff --git a/include/Z2AudioLib/Z2WolfHowlMgr.h b/include/Z2AudioLib/Z2WolfHowlMgr.h index 10b746a4c1..5376499715 100644 --- a/include/Z2AudioLib/Z2WolfHowlMgr.h +++ b/include/Z2AudioLib/Z2WolfHowlMgr.h @@ -70,7 +70,6 @@ public: u8 getReleaseTimer() { return mReleaseTimer; } u8 getCorrectCurveID() { return mCorrectCurveID; } -private: /* 0x00 */ JAISoundHandle mWolfHowlHandle; /* 0x04 */ JAISoundHandle mWindStoneHandle; /* 0x08 */ JAISoundHandle mGuideHandle; diff --git a/include/d/actor/d_a_alink.h b/include/d/actor/d_a_alink.h index 8728bc16a8..75ac1aac2b 100644 --- a/include/d/actor/d_a_alink.h +++ b/include/d/actor/d_a_alink.h @@ -77,7 +77,6 @@ public: virtual void draw(); virtual ~daAlink_blur_c() {} - // private: /* 0x010 */ ResTIMG* m_blurTex; /* 0x014 */ int field_0x14; /* 0x018 */ u8 field_0x18[4]; @@ -113,7 +112,6 @@ public: void onAppearFlg() { mAppearFlg = true; } -private: /* 0x04 */ s16 mHitFlg; /* 0x06 */ s16 mAppearFlg; /* 0x08 */ f32 mKeepMinY; @@ -4582,6 +4580,7 @@ public: bool mHsChainInterpCurrValid; bool mIsRollstab = false; + void* mAnmBuffers[3] = {}; #endif }; // Size: 0x385C @@ -8449,8 +8448,10 @@ struct daAlink_cutHorseParamTbl { /* 0xA */ u8 m_cutType; }; // Size: 0xC +#if !TARGET_PC inline BOOL dComIfGs_isTransformLV(int i_no); inline BOOL dComIfGs_isEventBit(const u16); +#endif static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* i_actor, void* i_data); static fopAc_ac_c* daAlink_searchCanoe(fopAc_ac_c* i_actor, void* i_data); diff --git a/include/d/actor/d_a_arrow.h b/include/d/actor/d_a_arrow.h index 47f86eeb50..f15cf1aca8 100644 --- a/include/d/actor/d_a_arrow.h +++ b/include/d/actor/d_a_arrow.h @@ -110,7 +110,6 @@ public: void setModelMatrix(MtxP mtx) { mpModel->setBaseTRMtx(mtx); } -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ dBgS_ArrowLinChk field_0x56c; /* 0x5DC */ dBgS_ObjLinChk field_0x5dc; diff --git a/include/d/actor/d_a_b_dr.h b/include/d/actor/d_a_b_dr.h index e15a6e7ca5..d9f72089f4 100644 --- a/include/d/actor/d_a_b_dr.h +++ b/include/d/actor/d_a_b_dr.h @@ -82,7 +82,6 @@ public: u8 onTarget() { return mTarget = true; } u8 isBack() { return arg0; } -private: /* 0x05AC */ request_of_phase_process_class mPhase; /* 0x05B4 */ mDoExt_McaMorfSO* mpModelMorf; /* 0x05B8 */ J3DModel* mpPartModel; diff --git a/include/d/actor/d_a_b_ds.h b/include/d/actor/d_a_b_ds.h index ee737a955a..7013465e93 100644 --- a/include/d/actor/d_a_b_ds.h +++ b/include/d/actor/d_a_b_ds.h @@ -189,7 +189,6 @@ public: void onDemo() { mIsDemo = true; } void offDemo() { mIsDemo = false; } -private: /* 0x05AC */ request_of_phase_process_class mPhase; /* 0x05B4 */ mDoExt_McaMorfSO* mpMorf; /* 0x05B8 */ mDoExt_McaMorfSO* mpSwordMorf; diff --git a/include/d/actor/d_a_b_mgn.h b/include/d/actor/d_a_b_mgn.h index 272d02b1ef..1ad1dd5cf7 100644 --- a/include/d/actor/d_a_b_mgn.h +++ b/include/d/actor/d_a_b_mgn.h @@ -92,7 +92,6 @@ public: bool isDown() { return mDownFlag != 0; } bool isAppear() { return mAppearFlag != 0; } -private: /* 0x05AC */ request_of_phase_process_class mMgnPhase; /* 0x05B4 */ request_of_phase_process_class mMgnePhase; /* 0x05BC */ mDoExt_McaMorfSO* mpMgnModelMorf; diff --git a/include/d/actor/d_a_b_tn.h b/include/d/actor/d_a_b_tn.h index 7de1007d28..87b9cd2fae 100644 --- a/include/d/actor/d_a_b_tn.h +++ b/include/d/actor/d_a_b_tn.h @@ -131,7 +131,6 @@ public: int CreateHeap(); int create(); -private: /* 0x05AC */ request_of_phase_process_class mPhaseReq1; /* 0x05B4 */ request_of_phase_process_class mPhaseReq2; /* 0x05BC */ J3DModel* mpPartModels[16]; diff --git a/include/d/actor/d_a_b_yo.h b/include/d/actor/d_a_b_yo.h index a133d364d6..3550b95a1c 100644 --- a/include/d/actor/d_a_b_yo.h +++ b/include/d/actor/d_a_b_yo.h @@ -80,7 +80,6 @@ public: void setDrawOff() { mIsInactive = 1; } bool isEnemyDemoEnd() { return (u8)mIsEnemyDemoEnd != 0; } -private: /* 0x05AC */ request_of_phase_process_class mPhase1; /* 0x05B4 */ request_of_phase_process_class mPhase2; /* 0x05BC */ request_of_phase_process_class mPhase3; diff --git a/include/d/actor/d_a_b_yo_ice.h b/include/d/actor/d_a_b_yo_ice.h index 2ad2e5388d..e0f064fa9d 100644 --- a/include/d/actor/d_a_b_yo_ice.h +++ b/include/d/actor/d_a_b_yo_ice.h @@ -51,7 +51,6 @@ public: void setSubNumber(int i_subNumber) { mSubNumber = i_subNumber; } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ J3DModel* mpModel; /* 0x5B8 */ Z2Creature mCreatureSound; diff --git a/include/d/actor/d_a_b_zant_magic.h b/include/d/actor/d_a_b_zant_magic.h index 0d05f9bd41..e37b055bfd 100644 --- a/include/d/actor/d_a_b_zant_magic.h +++ b/include/d/actor/d_a_b_zant_magic.h @@ -24,7 +24,6 @@ public: int _delete(); int create(); -private: /* 0x5AC */ Mtx field_0x5ac; /* 0x5DC */ cXyz field_0x5dc; /* 0x5E8 */ f32 field_0x5e8; diff --git a/include/d/actor/d_a_b_zant_mobile.h b/include/d/actor/d_a_b_zant_mobile.h index 3af85c56b1..18dcdbabc1 100644 --- a/include/d/actor/d_a_b_zant_mobile.h +++ b/include/d/actor/d_a_b_zant_mobile.h @@ -33,7 +33,6 @@ public: bool isSearchContinue() { return mSearchContinue != false; } void offSearchContinue() { mSearchContinue = false; } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; /* 0x5B8 */ mDoExt_brkAnm* mpBrk; diff --git a/include/d/actor/d_a_bg.h b/include/d/actor/d_a_bg.h index 0a9859198b..51407a06c8 100644 --- a/include/d/actor/d_a_bg.h +++ b/include/d/actor/d_a_bg.h @@ -57,7 +57,6 @@ public: inline int execute(); inline int isDelete(); -private: /* 0x568 */ u8 field_0x568[0x570 - 0x568]; /* 0x570 */ daBg_Part mBgParts[6]; /* 0x5E8 */ dBgW* mpBgW; diff --git a/include/d/actor/d_a_boomerang.h b/include/d/actor/d_a_boomerang.h index fe39f226b7..2b527afe45 100644 --- a/include/d/actor/d_a_boomerang.h +++ b/include/d/actor/d_a_boomerang.h @@ -25,7 +25,6 @@ public: void onReserve() { mReserve = 1; } void offReserve() { mReserve = 0; } -private: /* 0x04 */ J2DScreen* m_cursorYellowScrn; /* 0x08 */ J2DPane* m_cursorYellowAllPane; /* 0x0C */ J2DPane* m_cursorYellow0Pane; @@ -126,7 +125,6 @@ public: bool getLockCntMax() { return m_lockCnt >= BOOMERANG_LOCK_MAX; } void onLockDistanceCancel() { onStateFlg0(FLG0_LOCK_DIST_CANCEL); } -private: /* 0x568 */ J3DModel* mp_boomModel; /* 0x56C */ J3DModel* mp_shippuModel; /* 0x570 */ J3DAnmTextureSRTKey* m_windBtk; diff --git a/include/d/actor/d_a_canoe.h b/include/d/actor/d_a_canoe.h index bf34a5eee7..bcd7615e18 100644 --- a/include/d/actor/d_a_canoe.h +++ b/include/d/actor/d_a_canoe.h @@ -65,7 +65,6 @@ public: field_0x1456 = 15; } -private: /* 0x0568 */ request_of_phase_process_class mPhaseReq; /* 0x0570 */ J3DModel* mpModel; /* 0x0574 */ J3DModel* mpPaddleModel; diff --git a/include/d/actor/d_a_coach_fire.h b/include/d/actor/d_a_coach_fire.h index f669525e9c..1e8aa2d661 100644 --- a/include/d/actor/d_a_coach_fire.h +++ b/include/d/actor/d_a_coach_fire.h @@ -42,7 +42,6 @@ public: void setNoHitTimer() { noHitTimer = 20; } inline int execute(); -private: /* 0x568 */ LIGHT_INFLUENCE mLightInfluence; /* 0x588 */ dCcD_Stts mStts; /* 0x5C4 */ dCcD_Sph mSph; diff --git a/include/d/actor/d_a_cow.h b/include/d/actor/d_a_cow.h index 403dc2aef6..e215256b91 100644 --- a/include/d/actor/d_a_cow.h +++ b/include/d/actor/d_a_cow.h @@ -208,7 +208,6 @@ public: u8 getCowIn() { return mCowIn; } u8 getNoNearCheckTimer() { return mNoNearCheckTimer; } -private: /* 0x568 */ u16 mFlags; /* 0x56c */ request_of_phase_process_class mPhase; /* 0x574 */ mDoExt_McaMorfSO* mpMorf; diff --git a/include/d/actor/d_a_crod.h b/include/d/actor/d_a_crod.h index 84938d454a..02311fbeb5 100644 --- a/include/d/actor/d_a_crod.h +++ b/include/d/actor/d_a_crod.h @@ -48,7 +48,6 @@ public: static f32 getFlyInitY() { return 40.0f; } static f32 getFlyInitZ() { return 50.0f; } -private: /* 0x568 */ J3DModel* mpBallModel; /* 0x56C */ mDoExt_bckAnm mBck; /* 0x588 */ J3DAnmTevRegKey* mpBallBrk; diff --git a/include/d/actor/d_a_cstaF.h b/include/d/actor/d_a_cstaF.h index 9cb9e06ff7..982aa061a8 100644 --- a/include/d/actor/d_a_cstaF.h +++ b/include/d/actor/d_a_cstaF.h @@ -40,7 +40,6 @@ public: }; static DUSK_GAME_DATA const BckTbl m_bckIdxTable[]; -private: /* 0x5A0 */ const char* m_arcName; /* 0x5A4 */ request_of_phase_process_class m_phase; /* 0x5AC */ J3DModel* mp_model; diff --git a/include/d/actor/d_a_cstatue.h b/include/d/actor/d_a_cstatue.h index ca0b3ca616..2b74240fb2 100644 --- a/include/d/actor/d_a_cstatue.h +++ b/include/d/actor/d_a_cstatue.h @@ -101,7 +101,6 @@ public: static DUSK_GAME_DATA u16 const m_bckIdxTable[daCstatueType_N][7]; -private: /* 0x568 */ const char* mResName; /* 0x56C */ request_of_phase_process_class mPhaseReq; /* 0x574 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_demo_item.h b/include/d/actor/d_a_demo_item.h index ed6d195f5e..62780f572f 100644 --- a/include/d/actor/d_a_demo_item.h +++ b/include/d/actor/d_a_demo_item.h @@ -55,7 +55,6 @@ public: void setOffsetPos(cXyz i_pos) { mOffsetPos = i_pos; } void setMaxScale(f32 i_scale) { mMaxScale = i_scale; } -private: /* 0x92C */ cXyz mOffsetPos; /* 0x938 */ f32 mMaxScale; /* 0x93C */ u8 field_0x93c; diff --git a/include/d/actor/d_a_door_boss.h b/include/d/actor/d_a_door_boss.h index afd7984bf1..722afc0a84 100644 --- a/include/d/actor/d_a_door_boss.h +++ b/include/d/actor/d_a_door_boss.h @@ -50,7 +50,6 @@ public: void setAction(u8 i_action) { mAction = i_action; } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpDoorModel; /* 0x574 */ J3DModel* mpLockModel; diff --git a/include/d/actor/d_a_door_bossL1.h b/include/d/actor/d_a_door_bossL1.h index 7e14025cd2..c0b8f2b44a 100644 --- a/include/d/actor/d_a_door_bossL1.h +++ b/include/d/actor/d_a_door_bossL1.h @@ -76,7 +76,6 @@ public: void setAction(u8 action) { mAction = action; } -private: /* 0x568 */ request_of_phase_process_class mPhase1; /* 0x570 */ request_of_phase_process_class mPhase2; /* 0x578 */ request_of_phase_process_class mPhase3; diff --git a/include/d/actor/d_a_door_bossL5.h b/include/d/actor/d_a_door_bossL5.h index 832f575ac1..d876bab9c8 100644 --- a/include/d/actor/d_a_door_bossL5.h +++ b/include/d/actor/d_a_door_bossL5.h @@ -72,7 +72,6 @@ public: return 1; } -private: /* 0x568 */ request_of_phase_process_class mPhase1; /* 0x570 */ request_of_phase_process_class mPhase2; /* 0x578 */ request_of_phase_process_class mPhase3; diff --git a/include/d/actor/d_a_door_dbdoor00.h b/include/d/actor/d_a_door_dbdoor00.h index 9b2f65e756..ec976c7f6b 100644 --- a/include/d/actor/d_a_door_dbdoor00.h +++ b/include/d/actor/d_a_door_dbdoor00.h @@ -41,7 +41,6 @@ public: void setAction(u8 i_action) { mAction = i_action; } -// private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ request_of_phase_process_class mPhaseReq2; /* 0x578 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_door_knob00.h b/include/d/actor/d_a_door_knob00.h index 577b26b58e..742b8921c9 100644 --- a/include/d/actor/d_a_door_knob00.h +++ b/include/d/actor/d_a_door_knob00.h @@ -73,7 +73,6 @@ public: void onFlag(u16 flag) { field_0x60c |= flag; } int checkFlag(u16 flag) { return field_0x60c & flag; } -private: /* 0x568 */ request_of_phase_process_class mPhase1; /* 0x570 */ request_of_phase_process_class mPhase2; /* 0x578 */ J3DModel* mModel1; diff --git a/include/d/actor/d_a_door_mbossL1.h b/include/d/actor/d_a_door_mbossL1.h index 2bd95d920b..7b76f903bc 100644 --- a/include/d/actor/d_a_door_mbossL1.h +++ b/include/d/actor/d_a_door_mbossL1.h @@ -121,7 +121,6 @@ public: mAction = action; } -private: /* 0x568 */ request_of_phase_process_class mPhase1; /* 0x570 */ request_of_phase_process_class mPhase2; /* 0x578 */ request_of_phase_process_class mPhase3; diff --git a/include/d/actor/d_a_door_push.h b/include/d/actor/d_a_door_push.h index 5beb3aa564..f648ef208b 100644 --- a/include/d/actor/d_a_door_push.h +++ b/include/d/actor/d_a_door_push.h @@ -49,7 +49,6 @@ public: void setAction(u8 i_action) { mAction = i_action; } u32 getSceneNo() { return fopAcM_GetParamBit(this, 4, 6); } -// private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel[2]; /* 0x5B0 */ dBgW* mpDoorBgW; diff --git a/include/d/actor/d_a_door_shutter.h b/include/d/actor/d_a_door_shutter.h index a8e99f1295..c3b134ddb8 100644 --- a/include/d/actor/d_a_door_shutter.h +++ b/include/d/actor/d_a_door_shutter.h @@ -123,7 +123,6 @@ public: bool checkFlag(u16 flag) { return field_0x68e & flag; } void setAction(u8 action) { mAction = action; } -private: /* 0x56C */ request_of_phase_process_class mPhase1; /* 0x574 */ request_of_phase_process_class mPhase2; /* 0x57C */ J3DModel* mModel1; diff --git a/include/d/actor/d_a_e_ai.h b/include/d/actor/d_a_e_ai.h index d2f1b6ec06..78c4174338 100644 --- a/include/d/actor/d_a_e_ai.h +++ b/include/d/actor/d_a_e_ai.h @@ -48,7 +48,6 @@ public: int CreateHeap(); int Create(); -private: /* 0x5AC */ JPABaseEmitter* mpEmitter; /* 0x5B0 */ request_of_phase_process_class m_phase; /* 0x5B8 */ u8 field_0x5b8; diff --git a/include/d/actor/d_a_e_bg.h b/include/d/actor/d_a_e_bg.h index c14b0cf533..b3b0e1d8bf 100644 --- a/include/d/actor/d_a_e_bg.h +++ b/include/d/actor/d_a_e_bg.h @@ -45,7 +45,6 @@ public: void setBgId(unsigned int i_bgId) { mBgId = i_bgId; } bool isBomb() { return mIsBomb; } -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorfSO; /* 0x5B8 */ mDoExt_brkAnm* mpBrkAnm; diff --git a/include/d/actor/d_a_e_dk.h b/include/d/actor/d_a_e_dk.h index 381f8e1a62..2c7d46b84f 100644 --- a/include/d/actor/d_a_e_dk.h +++ b/include/d/actor/d_a_e_dk.h @@ -45,7 +45,6 @@ public: int create(); daE_DK_c(); -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorfSO; /* 0x5B8 */ mDoExt_McaMorfSO* mpCoreMorfSO; diff --git a/include/d/actor/d_a_e_dt.h b/include/d/actor/d_a_e_dt.h index c5c83c76e0..0fdb13f4e5 100644 --- a/include/d/actor/d_a_e_dt.h +++ b/include/d/actor/d_a_e_dt.h @@ -83,7 +83,6 @@ public: MtxP getBackMtx() { return mpMorf->getModel()->getAnmMtx(1); } fpc_ProcID getDemoId() { return mDemoID; } -private: /* 0x05AC */ request_of_phase_process_class mPhase[3]; /* 0x05C4 */ J3DModel* mpChestModel; /* 0x05C8 */ J3DModel* mpSpitModel; diff --git a/include/d/actor/d_a_e_fb.h b/include/d/actor/d_a_e_fb.h index a4494c5e7a..ae48f77ea6 100644 --- a/include/d/actor/d_a_e_fb.h +++ b/include/d/actor/d_a_e_fb.h @@ -40,7 +40,6 @@ public: cPhs_Step create(); daE_FB_c(); -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; /* 0x5B8 */ mDoExt_invisibleModel mInvisibleModel; diff --git a/include/d/actor/d_a_e_fk.h b/include/d/actor/d_a_e_fk.h index 390e4e3420..fb18f74792 100644 --- a/include/d/actor/d_a_e_fk.h +++ b/include/d/actor/d_a_e_fk.h @@ -52,7 +52,6 @@ public: void CreateChk(); int Create(); -private: /* 0x5AC */ u8 field_0x5AC[0x5B1 - 0x5AC]; /* 0x5B1 */ u8 mUpDownMode; /* 0x5B2 */ u8 field_0x5B2[0x5B6 - 0x5B2]; diff --git a/include/d/actor/d_a_e_fz.h b/include/d/actor/d_a_e_fz.h index e0b838aa51..e40232b74f 100644 --- a/include/d/actor/d_a_e_fz.h +++ b/include/d/actor/d_a_e_fz.h @@ -63,7 +63,6 @@ public: s32 CreateHeap(); s32 create(); -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /**< Phase request used when creating the actor. */ /* 0x5B4 */ J3DModel* mpModel; /**< Pointer to the Mini Freezard's model. */ /* 0x5B8 */ mDoExt_invisibleModel mInvisibleModel; /**< Invisible model used for the Mini Freezard. */ diff --git a/include/d/actor/d_a_e_ge.h b/include/d/actor/d_a_e_ge.h index 527e5bb5fa..3c4d4ffbee 100644 --- a/include/d/actor/d_a_e_ge.h +++ b/include/d/actor/d_a_e_ge.h @@ -61,7 +61,6 @@ public: u8 getGroupNo() { return mGroupNo; } -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorfSO; /* 0x5B8 */ Z2CreatureEnemy mSound; diff --git a/include/d/actor/d_a_e_gi.h b/include/d/actor/d_a_e_gi.h index adadfd03b8..a731797f32 100644 --- a/include/d/actor/d_a_e_gi.h +++ b/include/d/actor/d_a_e_gi.h @@ -47,7 +47,6 @@ public: bool isBattleOn() { return mIsBattleOn; } bool isAttackStart() { return mIsAttackStart; } -private: /* 0x05AC */ request_of_phase_process_class mPhase; /* 0x05B4 */ mDoExt_McaMorfSO* mpModelMorf; /* 0x05B8 */ J3DModel* mpSwordModel; diff --git a/include/d/actor/d_a_e_gm.h b/include/d/actor/d_a_e_gm.h index 370dea9150..de8c0d6acc 100644 --- a/include/d/actor/d_a_e_gm.h +++ b/include/d/actor/d_a_e_gm.h @@ -62,7 +62,6 @@ public: BOOL checkAction(actionFunc action) { return mAction == action; } BOOL checkOldAction(actionFunc action) { return mOldAction == action; } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ dBgS_AcchCir mAcchCir; /* 0x5F4 */ dBgS_ObjAcch mObjAcch; diff --git a/include/d/actor/d_a_e_hm.h b/include/d/actor/d_a_e_hm.h index 85f6e5422c..9be48a53f3 100644 --- a/include/d/actor/d_a_e_hm.h +++ b/include/d/actor/d_a_e_hm.h @@ -65,7 +65,6 @@ public: void CheckWall(); void CreateStyle(); int Create(); -private: /* 0x5AC */ u8 field_0x5ac; /* 0x5AD */ u8 field_0x5ad; /* 0x5AE */ u8 field_0x5ae; diff --git a/include/d/actor/d_a_e_hz.h b/include/d/actor/d_a_e_hz.h index 539d808cf5..e48a72ee69 100644 --- a/include/d/actor/d_a_e_hz.h +++ b/include/d/actor/d_a_e_hz.h @@ -64,7 +64,6 @@ public: void setInitPos(); int create(); -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /* 0x5B4 */ request_of_phase_process_class mPhaseReq2; /* 0x5BC */ mDoExt_McaMorfSO* mpMorfSO; diff --git a/include/d/actor/d_a_e_kk.h b/include/d/actor/d_a_e_kk.h index 890da0eba2..a249cafc74 100644 --- a/include/d/actor/d_a_e_kk.h +++ b/include/d/actor/d_a_e_kk.h @@ -49,7 +49,6 @@ public: int CreateHeap(); int create(); -private: /* 0x05AC */ request_of_phase_process_class mPhaseReq; /* 0x05B4 */ mDoExt_McaMorfSO* mpMorfSO; /* 0x05B8 */ mDoExt_McaMorfSO* mpWeaponMorfSO; diff --git a/include/d/actor/d_a_e_oc.h b/include/d/actor/d_a_e_oc.h index 7f60afa878..2d40d9bcbc 100644 --- a/include/d/actor/d_a_e_oc.h +++ b/include/d/actor/d_a_e_oc.h @@ -87,7 +87,6 @@ public: daE_OC_c* getTalkOc() { return mpTalk; } J3DModel* getOcModel() { return mpMorf->getModel(); } -private: /* 0x5a0 */ request_of_phase_process_class mPhaseReqs[2]; /* 0x5bc */ mDoExt_McaMorfSO* mpMorf; /* 0x5c0 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_e_oct_bg.h b/include/d/actor/d_a_e_oct_bg.h index cd5b6b27cd..9033e03736 100644 --- a/include/d/actor/d_a_e_oct_bg.h +++ b/include/d/actor/d_a_e_oct_bg.h @@ -54,7 +54,6 @@ public: u32 checkAction(actionFunc func) { return field_0xb58 == func; } bool checkNormalAttk() { return checkAction(&daE_OctBg_c::normal_attack); } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ mDoExt_McaMorfSO* field_0x5b4; /* 0x5B8 */ mDoExt_brkAnm* field_0x5b8; diff --git a/include/d/actor/d_a_e_ot.h b/include/d/actor/d_a_e_ot.h index 54e8399b7b..3505062e3c 100644 --- a/include/d/actor/d_a_e_ot.h +++ b/include/d/actor/d_a_e_ot.h @@ -54,7 +54,6 @@ public: /* 0x4 */ ACT_DAMAGE, }; -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; /* 0x5B8 */ J3DModel* mpEggModel; diff --git a/include/d/actor/d_a_e_pm.h b/include/d/actor/d_a_e_pm.h index edec93c6a2..35368eff61 100644 --- a/include/d/actor/d_a_e_pm.h +++ b/include/d/actor/d_a_e_pm.h @@ -84,7 +84,6 @@ public: u8 SwitchChk() { return mStage; } u8 DoorChk() { return mDoorAction; } -private: /* 0x5AC */ fpc_ProcID mPuppetID[4]; /* 0x5BC */ u8 field_0x5bc[0x5DC - 0x5BC]; /* 0x5DC */ u8 mDoorAction; diff --git a/include/d/actor/d_a_e_sb.h b/include/d/actor/d_a_e_sb.h index e015ecc5bc..bd7d8c9bdc 100644 --- a/include/d/actor/d_a_e_sb.h +++ b/include/d/actor/d_a_e_sb.h @@ -57,7 +57,6 @@ public: int Delete(); void setBaseMtx(); cPhs_Step Create(); -private: /* 0x5AC */ int field_0x5ac; /* 0x5B0 */ int field_0x5b0; /* 0x5B4 */ int field_0x5b4; @@ -78,7 +77,6 @@ private: public: /* 0x5EC */ cXyz* field_0x5ec; /* 0x5F0 */ f32 field_0x5f0; -private: /* 0x5F4 */ cXyz field_0x5f4; /* 0x600 */ s16 field_0x600; /* 0x602 */ u8 field_0x602; diff --git a/include/d/actor/d_a_e_sw.h b/include/d/actor/d_a_e_sw.h index b073dae952..6f6a71f16d 100644 --- a/include/d/actor/d_a_e_sw.h +++ b/include/d/actor/d_a_e_sw.h @@ -82,7 +82,6 @@ public: bool d_checkOldAction(void (daE_SW_c::*action)()) { return field_0xb0c == action; } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ mDoExt_McaMorfSO* mpModelMorf; /* 0x5B8 */ Z2CreatureEnemy mSound; diff --git a/include/d/actor/d_a_e_tt.h b/include/d/actor/d_a_e_tt.h index f3b79a69b3..38dc53ac3f 100644 --- a/include/d/actor/d_a_e_tt.h +++ b/include/d/actor/d_a_e_tt.h @@ -47,7 +47,6 @@ public: int CreateHeap(); int create(); -private: /* 0x5AC */ request_of_phase_process_class mPhaseReq; /* 0x5B4 */ request_of_phase_process_class mPhaseReq2; /* 0x5BC */ mDoExt_McaMorfSO* mpMorfSO; diff --git a/include/d/actor/d_a_e_vt.h b/include/d/actor/d_a_e_vt.h index 4b6082adae..b55bb4891a 100644 --- a/include/d/actor/d_a_e_vt.h +++ b/include/d/actor/d_a_e_vt.h @@ -146,7 +146,6 @@ public: int create(); daE_VA_c(); -private: /* 0x005AC */ request_of_phase_process_class mPhase; /* 0x005B4 */ mDoExt_McaMorfSO* mpMorf; /* 0x005B8 */ mDoExt_McaMorfSO* mpEndEfMorf; diff --git a/include/d/actor/d_a_e_ww.h b/include/d/actor/d_a_e_ww.h index fc1083c34e..f1ebac248a 100644 --- a/include/d/actor/d_a_e_ww.h +++ b/include/d/actor/d_a_e_ww.h @@ -59,7 +59,6 @@ public: void setAttack() { mActionMode = 10; } f32 const getSpeedF() { return speedF; } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ mDoExt_McaMorfSO* mpModelMorf; /* 0x5B8 */ Z2CreatureEnemy mSound; diff --git a/include/d/actor/d_a_e_ym.h b/include/d/actor/d_a_e_ym.h index 9638736b46..699d14d98f 100644 --- a/include/d/actor/d_a_e_ym.h +++ b/include/d/actor/d_a_e_ym.h @@ -122,7 +122,6 @@ public: u8 getSwitchBit() { return mSwitchBit; } u8 isHide() { return mIsHide; } -private: /* 0x5AC */ request_of_phase_process_class mPhase; /* 0x5B4 */ mDoExt_McaMorfSO* mpMorf; /* 0x5B8 */ mDoExt_brkAnm* mpBrk; diff --git a/include/d/actor/d_a_e_zs.h b/include/d/actor/d_a_e_zs.h index d15b384650..93dbd82d89 100644 --- a/include/d/actor/d_a_e_zs.h +++ b/include/d/actor/d_a_e_zs.h @@ -39,7 +39,6 @@ public: int CreateHeap(); int create(); -private: /* 0x5ac */ request_of_phase_process_class mPhase; /* 0x5b4 */ mDoExt_McaMorfSO* mpMorf; /* 0x5b8 */ Z2CreatureEnemy mSound; diff --git a/include/d/actor/d_a_itembase.h b/include/d/actor/d_a_itembase.h index da1f541cd7..374e4b7df2 100644 --- a/include/d/actor/d_a_itembase.h +++ b/include/d/actor/d_a_itembase.h @@ -32,6 +32,12 @@ struct daItemBase_data { class daItemBase_c : public fopAc_ac_c { public: u8 getItemNo(); +#if TARGET_PC + u8 getDisplayItemNo() const { + return mDisplayItemNo != 0xFF ? mDisplayItemNo : m_itemNo; + } + void setDisplayItemNo(u8 itemNo) { mDisplayItemNo = itemNo; } +#endif void hide(); void show(); void changeDraw(); @@ -79,6 +85,9 @@ public: /* 0x928 */ s16 m_get_timer; /* 0x92A */ u8 m_itemNo; /* 0x92B */ u8 field_0x92b; +#if TARGET_PC + u8 mDisplayItemNo = 0xFF; +#endif }; #endif /* D_A_D_A_ITEMBASE_H */ diff --git a/include/d/actor/d_a_kago.h b/include/d/actor/d_a_kago.h index 33ec51672f..ba0e77a37c 100644 --- a/include/d/actor/d_a_kago.h +++ b/include/d/actor/d_a_kago.h @@ -140,7 +140,6 @@ public: void setEatYm() { field_0x6d8 |= (u8) 4; } MtxP getMouthMtx() { return mAnm_p->getModel()->getAnmMtx(7); } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ mDoExt_McaMorfSO* mAnm_p; /* 0x574 */ Z2CreatureEnemy mSound; diff --git a/include/d/actor/d_a_midna.h b/include/d/actor/d_a_midna.h index 2b07386ca7..1371dce12c 100644 --- a/include/d/actor/d_a_midna.h +++ b/include/d/actor/d_a_midna.h @@ -423,7 +423,6 @@ public: 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; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ J3DModel* mpShadowModel; diff --git a/include/d/actor/d_a_movie_player.h b/include/d/actor/d_a_movie_player.h index fbd8784d40..785f9458ab 100644 --- a/include/d/actor/d_a_movie_player.h +++ b/include/d/actor/d_a_movie_player.h @@ -4,6 +4,7 @@ #if !TARGET_PC #include #else +#include #include #include #endif @@ -17,29 +18,6 @@ struct daMP_THPReadBuffer { }; #if TARGET_PC -// Copying here because thp.h is probably erroneous in the dolphin lib, -// and it's kind of a problem being there (Aurora owns the headers). -// TODO: Move this stuff in decomp? -typedef struct THPAudioRecordHeader { - BE(u32) offsetNextChannel; - BE(u32) sampleSize; - BE(s16) lCoef[8][2]; - BE(s16) rCoef[8][2]; - BE(s16) lYn1; - BE(s16) lYn2; - BE(s16) rYn1; - BE(s16) rYn2; -} THPAudioRecordHeader; - -typedef struct THPAudioDecodeInfo { - u8* encodeData; - u32 offsetNibbles; - u8 predictor; - u8 scale; - s16 yn1; - s16 yn2; -} THPAudioDecodeInfo; - typedef struct THPTextureSet { u8* ytexture; u8* utexture; @@ -86,10 +64,6 @@ typedef struct THPHeader { /* 0x2C */ BE(u32) finalFrameDataOffsets; } THPHeader; -static u32 THPAudioDecode(s16* audioBuffer, u8* audioFrame, s32 flag); -static s32 __THPAudioGetNewSample(THPAudioDecodeInfo* info); -static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr); - #define THP_AUDIO_BUFFER_COUNT 3 #define THP_READ_BUFFER_COUNT 10 #define THP_TEXTURE_SET_COUNT 3 @@ -166,7 +140,6 @@ public: static DUSK_GAME_DATA daMP_c* m_myObj; -private: /* 0x568 */ u32 (*mpGetMovieRestFrame)(void); /* 0x56C */ void (*mpSetPercentMovieVol)(f32); /* 0x570 */ u32 (*mpTHPGetTotalFrame)(void); diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 7b99f1e2fe..51425bb912 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -29,7 +29,7 @@ struct daNpc_GetParam3 { // name unknown }; class daNpcT_ActorMngr_c { -private: +public: /* 0x0 */ fpc_ProcID mActorID; public: @@ -44,7 +44,7 @@ public: }; class daNpcT_MatAnm_c : public J3DMaterialAnm { -private: +public: /* 0x0F4 */ mutable f32 field_0xF4; /* 0x0F8 */ mutable f32 field_0xF8; /* 0x0FC */ f32 mNowOffsetX; @@ -102,7 +102,6 @@ public: } void setOffset(int i_offset) { mOffset = i_offset; } -private: /* 0x00 */ sequenceStepData_c const* mpSeqData; /* 0x04 */ int mStepNum; /* 0x08 */ int mNo; @@ -217,7 +216,7 @@ public: }; class daNpcT_JntAnm_c { -private: +public: /* 0x000 */ daNpcT_ActorMngr_c mActrMngr; /* 0x008 */ cXyz mPos; /* 0x014 */ cXyz mAttnPos; diff --git a/include/d/actor/d_a_npc2.h b/include/d/actor/d_a_npc2.h index 0f8ab6ba20..2453ba1f30 100644 --- a/include/d/actor/d_a_npc2.h +++ b/include/d/actor/d_a_npc2.h @@ -15,7 +15,6 @@ public: fopAc_ac_c* getActor(); virtual ~daBaseNpc_acMngr_c() {} -private: /* 0x04 */ fpc_ProcID mActorId; }; diff --git a/include/d/actor/d_a_npc4.h b/include/d/actor/d_a_npc4.h index d195eb9669..1bf39f54ec 100644 --- a/include/d/actor/d_a_npc4.h +++ b/include/d/actor/d_a_npc4.h @@ -12,7 +12,7 @@ #include "JSystem/J3DGraphAnimator/J3DMaterialAnm.h" class daNpcF_ActorMngr_c { -private: +public: /* 0x0 */ fpc_ProcID mActorID; public: @@ -52,7 +52,7 @@ BOOL daNpcF_chkPassed(cXyz i_pos, dPnt* i_points, u16 i_idx, u16 i_num, BOOL i_i BOOL daNpcF_chkDoBtnEqSpeak(fopAc_ac_c* i_actor_p); class daNpcF_SPCurve_c { -private: +public: /* 0x00 */ u16 mNurbs; /* 0x02 */ u16 field_0x02; /* 0x04 */ u8 mIsReversed; @@ -119,7 +119,7 @@ public: }; // Size: 0x630 class daNpcF_MatAnm_c : public J3DMaterialAnm { -private: +public: /* 0x0F4 */ mutable f32 field_0xF4; /* 0x0F8 */ mutable f32 field_0xF8; /* 0x0FC */ f32 mNowOffsetX; @@ -138,7 +138,7 @@ public: }; class daNpcF_Lookat_c { -private: +public: /* 0x00 */ cXyz mJointPos[4]; /* 0x30 */ cXyz* mAttnPos_p; /* 0x34 */ csXyz mAngularMoveDis[4]; @@ -406,7 +406,6 @@ public: STATIC_ASSERT(sizeof(daNpcF_c) == 0xB48); class daNpcF_MoveBgActor_c : public daNpcF_c { -private: public: // these functions are inferred based on daBaseNpc_moveBgActor_c - // defining them in this order fixes weak function order for this class in d_a_npc diff --git a/include/d/actor/d_a_npc_aru.h b/include/d/actor/d_a_npc_aru.h index e822850a7e..a41e45acba 100644 --- a/include/d/actor/d_a_npc_aru.h +++ b/include/d/actor/d_a_npc_aru.h @@ -174,7 +174,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_ash.h b/include/d/actor/d_a_npc_ash.h index 46c850a372..e9f6e3427a 100644 --- a/include/d/actor/d_a_npc_ash.h +++ b/include/d/actor/d_a_npc_ash.h @@ -145,7 +145,6 @@ public: static DUSK_GAME_DATA EventFn mEvtSeqList[6]; -private: /* 0xB48 */ Z2Creature mCreatureSound; /* 0xBD8 */ J3DModel* mModelBow; /* 0xBDC */ J3DModel* mModelQuiver; diff --git a/include/d/actor/d_a_npc_ashB.h b/include/d/actor/d_a_npc_ashB.h index e257db2402..9b158acf2d 100644 --- a/include/d/actor/d_a_npc_ashB.h +++ b/include/d/actor/d_a_npc_ashB.h @@ -137,7 +137,6 @@ public: static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[2]; -private: /* 0xB48 */ Z2Creature mCreatureSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_npc_besu.h b/include/d/actor/d_a_npc_besu.h index 646c4860bd..04579f595b 100644 --- a/include/d/actor/d_a_npc_besu.h +++ b/include/d/actor/d_a_npc_besu.h @@ -143,7 +143,6 @@ public: 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; /* 0x0E44 */ NPC_BESU_HIO_CLASS* mpHIO; /* 0x0E48 */ J3DModel* mpClothModel[1]; diff --git a/include/d/actor/d_a_npc_bou.h b/include/d/actor/d_a_npc_bou.h index d2c1c0ef2f..d0379b9a1b 100644 --- a/include/d/actor/d_a_npc_bou.h +++ b/include/d/actor/d_a_npc_bou.h @@ -168,7 +168,6 @@ public: return 0; } -private: /* 0xE40 */ NPC_BOU_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl mCyl1; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_bouS.h b/include/d/actor/d_a_npc_bouS.h index a3431cfec7..7d6f48fb53 100644 --- a/include/d/actor/d_a_npc_bouS.h +++ b/include/d/actor/d_a_npc_bouS.h @@ -130,7 +130,6 @@ public: static DUSK_GAME_DATA eventFunc mEvtSeqList[4]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_chat.h b/include/d/actor/d_a_npc_chat.h index 5bdbee8869..88ddc9a8b3 100644 --- a/include/d/actor/d_a_npc_chat.h +++ b/include/d/actor/d_a_npc_chat.h @@ -104,7 +104,6 @@ public: static DUSK_GAME_DATA eventFunc DUSK_CONST mEvtSeqList[1]; -private: /* 0xB48 */ Z2CreatureCitizen mSound; /* 0xBEC */ u8 field_0xbec[0xbf0 - 0xbec]; /* 0xBF0 */ J3DModel* mObjModel; diff --git a/include/d/actor/d_a_npc_clerka.h b/include/d/actor/d_a_npc_clerka.h index 12ef5a3b97..6479bae503 100644 --- a/include/d/actor/d_a_npc_clerka.h +++ b/include/d/actor/d_a_npc_clerka.h @@ -127,7 +127,6 @@ public: 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; /* 0x0F80 */ dCcD_Cyl mCyl; /* 0x10BC */ u8 mType; diff --git a/include/d/actor/d_a_npc_clerkb.h b/include/d/actor/d_a_npc_clerkb.h index c6c2ef83fb..9bc2a39a3a 100644 --- a/include/d/actor/d_a_npc_clerkb.h +++ b/include/d/actor/d_a_npc_clerkb.h @@ -140,7 +140,6 @@ public: 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; /* 0x0F7C */ NPC_CLERKB_HIO_CLASS* mpHIO; /* 0x0F98 */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_clerkt.h b/include/d/actor/d_a_npc_clerkt.h index 6acfb8970f..a476f83449 100644 --- a/include/d/actor/d_a_npc_clerkt.h +++ b/include/d/actor/d_a_npc_clerkt.h @@ -128,7 +128,6 @@ public: 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; /* 0x0F80 */ dCcD_Cyl mCyl; /* 0x10BC */ u8 mType; diff --git a/include/d/actor/d_a_npc_coach.h b/include/d/actor/d_a_npc_coach.h index f50cbd87a5..e0ecd63fc2 100644 --- a/include/d/actor/d_a_npc_coach.h +++ b/include/d/actor/d_a_npc_coach.h @@ -297,7 +297,6 @@ public: static DUSK_GAME_DATA daNpcCoach_Attr_c const M_attr; static u16 const ParticleName[10]; -private: /* 0x0568 */ daNpcChHorse_c mChHorse; /* 0x0E7C */ daNpcChHarness_c mChHarness; /* 0x15D0 */ daNpcChCoach_c mChCoach; diff --git a/include/d/actor/d_a_npc_doc.h b/include/d/actor/d_a_npc_doc.h index 417251e10b..191a2e5bf2 100644 --- a/include/d/actor/d_a_npc_doc.h +++ b/include/d/actor/d_a_npc_doc.h @@ -136,7 +136,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_doorboy.h b/include/d/actor/d_a_npc_doorboy.h index 31568dd2f6..3fd6ef1ce8 100644 --- a/include/d/actor/d_a_npc_doorboy.h +++ b/include/d/actor/d_a_npc_doorboy.h @@ -80,7 +80,6 @@ public: static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[1]; -private: /* 0xB48 */ Z2CreatureCitizen mSound; /* 0xBEC */ u8 field_0xbec[0xbf0 - 0xbec]; /* 0xBF0 */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_fairy.h b/include/d/actor/d_a_npc_fairy.h index efa9d760c1..ff2df4260b 100644 --- a/include/d/actor/d_a_npc_fairy.h +++ b/include/d/actor/d_a_npc_fairy.h @@ -296,7 +296,6 @@ public: 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; /* 0x0F80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_fairy_seirei.h b/include/d/actor/d_a_npc_fairy_seirei.h index a0ad9342ed..d47b2a17eb 100644 --- a/include/d/actor/d_a_npc_fairy_seirei.h +++ b/include/d/actor/d_a_npc_fairy_seirei.h @@ -93,7 +93,6 @@ public: 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; /* 0xE44 */ u8 mType; /* 0xE48 */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_gnd.h b/include/d/actor/d_a_npc_gnd.h index f61d7e0214..cb0289055e 100644 --- a/include/d/actor/d_a_npc_gnd.h +++ b/include/d/actor/d_a_npc_gnd.h @@ -99,7 +99,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl1; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_gra.h b/include/d/actor/d_a_npc_gra.h index 333cf5d299..f16b445195 100644 --- a/include/d/actor/d_a_npc_gra.h +++ b/include/d/actor/d_a_npc_gra.h @@ -142,7 +142,6 @@ public: typedef BOOL (daNpc_grA_c::*cut_type)(int); static DUSK_GAME_DATA cut_type DUSK_CONST mEvtCutList[]; -private: typedef BOOL (daNpc_grA_c::*daNpc_grA_c_Action)(void*); /* 0x0B48 */ Z2Creature mCreature; diff --git a/include/d/actor/d_a_npc_grc.h b/include/d/actor/d_a_npc_grc.h index ac7dfa9869..53a483b51d 100644 --- a/include/d/actor/d_a_npc_grc.h +++ b/include/d/actor/d_a_npc_grc.h @@ -92,7 +92,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList; static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[1]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ int field_0xbd8; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_grd.h b/include/d/actor/d_a_npc_grd.h index 24871ab24c..64afa3ef2c 100644 --- a/include/d/actor/d_a_npc_grd.h +++ b/include/d/actor/d_a_npc_grd.h @@ -84,7 +84,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[2]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_grm.h b/include/d/actor/d_a_npc_grm.h index d7c30ba90f..c820eabbc3 100644 --- a/include/d/actor/d_a_npc_grm.h +++ b/include/d/actor/d_a_npc_grm.h @@ -134,7 +134,6 @@ public: 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; /* 0x0F80 */ dCcD_Cyl mCyl; /* 0x10BC */ u8 mType; diff --git a/include/d/actor/d_a_npc_grmc.h b/include/d/actor/d_a_npc_grmc.h index 1761c82869..1d87c39a4d 100644 --- a/include/d/actor/d_a_npc_grmc.h +++ b/include/d/actor/d_a_npc_grmc.h @@ -127,7 +127,6 @@ public: 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; /* 0x0F80 */ dCcD_Cyl mCyl; /* 0x10BC */ u8 mType; diff --git a/include/d/actor/d_a_npc_gro.h b/include/d/actor/d_a_npc_gro.h index b2a5595bd9..8bc6c8c93e 100644 --- a/include/d/actor/d_a_npc_gro.h +++ b/include/d/actor/d_a_npc_gro.h @@ -88,7 +88,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[3]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[3]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ J3DModel* mpOtherModel[1]; /* 0xBDC */ daNpcF_MatAnm_c* mpMatAnm; diff --git a/include/d/actor/d_a_npc_grr.h b/include/d/actor/d_a_npc_grr.h index 6dfa8512bc..4caf927d75 100644 --- a/include/d/actor/d_a_npc_grr.h +++ b/include/d/actor/d_a_npc_grr.h @@ -86,7 +86,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[1]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_grs.h b/include/d/actor/d_a_npc_grs.h index 5ec4354dd1..9c1ac788dc 100644 --- a/include/d/actor/d_a_npc_grs.h +++ b/include/d/actor/d_a_npc_grs.h @@ -87,7 +87,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[2]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_npc_grz.h b/include/d/actor/d_a_npc_grz.h index f49c878ff7..249720276f 100644 --- a/include/d/actor/d_a_npc_grz.h +++ b/include/d/actor/d_a_npc_grz.h @@ -119,7 +119,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[7]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[7]; -private: /* 0x0B48 */ Z2Creature mSound; /* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0x0BDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_guard.h b/include/d/actor/d_a_npc_guard.h index bceab108e5..59a6719c9d 100644 --- a/include/d/actor/d_a_npc_guard.h +++ b/include/d/actor/d_a_npc_guard.h @@ -62,7 +62,6 @@ public: static DUSK_GAME_DATA actionFunc ActionTable[7][2]; -private: /* 0xAC8 */ J3DModel* mpModel; /* 0xACC */ J3DModel* mpModel2; /* 0xAD0 */ J3DAnmTransformKey* mpAnmKey; diff --git a/include/d/actor/d_a_npc_gwolf.h b/include/d/actor/d_a_npc_gwolf.h index bd577e18e7..f7f4bc5a8e 100644 --- a/include/d/actor/d_a_npc_gwolf.h +++ b/include/d/actor/d_a_npc_gwolf.h @@ -107,7 +107,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[5]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[5]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_hanjo.h b/include/d/actor/d_a_npc_hanjo.h index e9daf3bb0e..76d354b743 100644 --- a/include/d/actor/d_a_npc_hanjo.h +++ b/include/d/actor/d_a_npc_hanjo.h @@ -221,7 +221,6 @@ public: 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; /* 0x0E48 */ J3DModel* mModel2; diff --git a/include/d/actor/d_a_npc_henna0.h b/include/d/actor/d_a_npc_henna0.h index 112904d144..63da974cde 100644 --- a/include/d/actor/d_a_npc_henna0.h +++ b/include/d/actor/d_a_npc_henna0.h @@ -12,7 +12,7 @@ * */ class d_a_npc_henna0 : public fopAc_ac_c { - private: + public: /* 0x568 */ u8 field_0x568[0x828 - 0x568]; }; diff --git a/include/d/actor/d_a_npc_hoz.h b/include/d/actor/d_a_npc_hoz.h index aec84cf761..57a2169c78 100644 --- a/include/d/actor/d_a_npc_hoz.h +++ b/include/d/actor/d_a_npc_hoz.h @@ -128,7 +128,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_impal.h b/include/d/actor/d_a_npc_impal.h index f0102ab698..f6753be0e2 100644 --- a/include/d/actor/d_a_npc_impal.h +++ b/include/d/actor/d_a_npc_impal.h @@ -123,7 +123,6 @@ public: static DUSK_GAME_DATA EventFn mEvtSeqList[4]; -private: /* 0xB48 */ Z2Creature mCreatureSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_ins.h b/include/d/actor/d_a_npc_ins.h index 620358a297..fd133a7a79 100644 --- a/include/d/actor/d_a_npc_ins.h +++ b/include/d/actor/d_a_npc_ins.h @@ -121,7 +121,6 @@ public: static DUSK_GAME_DATA eventFunc mEvtSeqList[1]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ J3DModel* mpUmbrellaModel; /* 0xBDC */ J3DModel* mpKagoModel; diff --git a/include/d/actor/d_a_npc_jagar.h b/include/d/actor/d_a_npc_jagar.h index 13147762dd..e933d28bf4 100644 --- a/include/d/actor/d_a_npc_jagar.h +++ b/include/d/actor/d_a_npc_jagar.h @@ -225,7 +225,6 @@ public: 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; /* 0x0F80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_kakashi.h b/include/d/actor/d_a_npc_kakashi.h index c3f57b383a..a21117376d 100644 --- a/include/d/actor/d_a_npc_kakashi.h +++ b/include/d/actor/d_a_npc_kakashi.h @@ -116,7 +116,6 @@ public: 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; /* 0x0E44 */ Z2SoundObjSimple mSound; /* 0x0E64 */ dCcD_Cyl mCcCyl; diff --git a/include/d/actor/d_a_npc_kasi_hana.h b/include/d/actor/d_a_npc_kasi_hana.h index 625cb31845..302c3d84ab 100644 --- a/include/d/actor/d_a_npc_kasi_hana.h +++ b/include/d/actor/d_a_npc_kasi_hana.h @@ -206,7 +206,6 @@ public: static DUSK_GAME_DATA f32 mTargetTagDist; static DUSK_GAME_DATA s16 mWolfAngle; -private: /* 0x0B48 */ Z2CreatureCitizen mSound; /* 0x0BEC */ u8 field_0xbec[0xbf0 - 0xbec]; /* 0x0BF0 */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_kasi_kyu.h b/include/d/actor/d_a_npc_kasi_kyu.h index 962a2e04cc..8ba34391c7 100644 --- a/include/d/actor/d_a_npc_kasi_kyu.h +++ b/include/d/actor/d_a_npc_kasi_kyu.h @@ -125,7 +125,6 @@ public: static DUSK_GAME_DATA f32 mTargetTagDist; static DUSK_GAME_DATA s16 mWolfAngle; -private: /* 0x0B48 */ Z2CreatureCitizen mSound; /* 0x0BEC */ u8 field_0xbec[0xbf0 - 0xbec]; /* 0x0BF0 */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_kasi_mich.h b/include/d/actor/d_a_npc_kasi_mich.h index efa1a221c6..08361fe134 100644 --- a/include/d/actor/d_a_npc_kasi_mich.h +++ b/include/d/actor/d_a_npc_kasi_mich.h @@ -126,7 +126,6 @@ public: static DUSK_GAME_DATA f32 mTargetTagDist; static DUSK_GAME_DATA s16 mWolfAngle; -private: /* 0x0B48 */ Z2CreatureCitizen mSound; /* 0x0BEC */ u8 field_0xbec[0xbf0 - 0xbec]; /* 0x0BF0 */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_kdk.h b/include/d/actor/d_a_npc_kdk.h index 6f701e33af..a647cc706d 100644 --- a/include/d/actor/d_a_npc_kdk.h +++ b/include/d/actor/d_a_npc_kdk.h @@ -12,7 +12,7 @@ * */ class daNpcKdk_c : public fopAc_ac_c { -private: +public: /* 0x568 */ u8 field_0x568[0xFA0 - 0x568]; }; diff --git a/include/d/actor/d_a_npc_kkri.h b/include/d/actor/d_a_npc_kkri.h index c6e173480d..1265f6e27f 100644 --- a/include/d/actor/d_a_npc_kkri.h +++ b/include/d/actor/d_a_npc_kkri.h @@ -121,7 +121,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCcCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_kn.h b/include/d/actor/d_a_npc_kn.h index 9e1794db97..7df2cfa247 100644 --- a/include/d/actor/d_a_npc_kn.h +++ b/include/d/actor/d_a_npc_kn.h @@ -421,7 +421,6 @@ public: static DUSK_GAME_DATA fopAc_ac_c* mFindActorPtrs[50]; static DUSK_GAME_DATA int mFindCount; -private: /* 0x0E44 */ J3DModel* mpPodModel; /* 0x0E48 */ mDoExt_invisibleModel mInvisModel; /* 0x0E50 */ dKy_tevstr_c mTevStr; diff --git a/include/d/actor/d_a_npc_knj.h b/include/d/actor/d_a_npc_knj.h index f8db1cdedb..7738d231b2 100644 --- a/include/d/actor/d_a_npc_knj.h +++ b/include/d/actor/d_a_npc_knj.h @@ -83,7 +83,6 @@ public: 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; /* 0xE44 */ u8 mType; /* 0xE48 */ actionFunc mNextAction; diff --git a/include/d/actor/d_a_npc_kolin.h b/include/d/actor/d_a_npc_kolin.h index 28f455be35..860ae1b942 100644 --- a/include/d/actor/d_a_npc_kolin.h +++ b/include/d/actor/d_a_npc_kolin.h @@ -161,7 +161,6 @@ public: return 0; } -private: /* 0x0E40 */ NPC_KOLIN_HIO_CLASS* mpHIO; /* 0x0E44 */ J3DModel* mpClothModel; /* 0x0E48 */ dCcD_Cyl field_0xe48; diff --git a/include/d/actor/d_a_npc_kolinb.h b/include/d/actor/d_a_npc_kolinb.h index bf4392a697..4655234347 100644 --- a/include/d/actor/d_a_npc_kolinb.h +++ b/include/d/actor/d_a_npc_kolinb.h @@ -166,7 +166,6 @@ public: u32 getModelType() { return fopAcM_GetParam(this) >> 28; } -private: /* 0xE40 */ NPC_KOLINB_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl field_0xe44; /* 0xF80 */ Mtx mMtx; diff --git a/include/d/actor/d_a_npc_kyury.h b/include/d/actor/d_a_npc_kyury.h index 8469dd3528..7322dfd905 100644 --- a/include/d/actor/d_a_npc_kyury.h +++ b/include/d/actor/d_a_npc_kyury.h @@ -126,7 +126,6 @@ public: 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; /* 0xE44 */ J3DModel* mpModel[2]; /* 0xE4C */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_len.h b/include/d/actor/d_a_npc_len.h index 13b959c3b7..b22a0059e0 100644 --- a/include/d/actor/d_a_npc_len.h +++ b/include/d/actor/d_a_npc_len.h @@ -113,7 +113,6 @@ public: u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } u8 getBitSW() { return (fopAcM_GetParam(this) & 0xff0000) >> 16; } -private: /* 0xE40 */ NPC_LEN_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_lud.h b/include/d/actor/d_a_npc_lud.h index afecfdc0c7..a2be5fa65d 100644 --- a/include/d/actor/d_a_npc_lud.h +++ b/include/d/actor/d_a_npc_lud.h @@ -114,7 +114,6 @@ public: 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; /* 0xE44 */ NPC_LUD_HIO_CLASS* mpHIO; /* 0xE48 */ J3DModel* mpModel[2]; diff --git a/include/d/actor/d_a_npc_maro.h b/include/d/actor/d_a_npc_maro.h index 1c51a63b44..8acd11e43c 100644 --- a/include/d/actor/d_a_npc_maro.h +++ b/include/d/actor/d_a_npc_maro.h @@ -187,7 +187,6 @@ public: return (fopAcM_GetParam(this) & 0xF000000) >> 24; } -private: /* 0x0F7C */ NPC_MARO_HIO_CLASS* mpHIO; /* 0x0F80 */ dCcD_Cyl mCyl1; /* 0x10BC */ int field_0x10bc; diff --git a/include/d/actor/d_a_npc_midp.h b/include/d/actor/d_a_npc_midp.h index 60efbbac80..3021051d77 100644 --- a/include/d/actor/d_a_npc_midp.h +++ b/include/d/actor/d_a_npc_midp.h @@ -151,7 +151,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_moi.h b/include/d/actor/d_a_npc_moi.h index 547c3a1dcd..94e1ef8861 100644 --- a/include/d/actor/d_a_npc_moi.h +++ b/include/d/actor/d_a_npc_moi.h @@ -161,7 +161,6 @@ public: 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; /* 0x0E44 */ J3DModel* mpModel[6]; /* 0x0E5C */ dCcD_Cyl mCyl[4]; diff --git a/include/d/actor/d_a_npc_moir.h b/include/d/actor/d_a_npc_moir.h index f9aa841a60..f217ab7698 100644 --- a/include/d/actor/d_a_npc_moir.h +++ b/include/d/actor/d_a_npc_moir.h @@ -214,7 +214,6 @@ public: static DUSK_GAME_DATA EventFn mEvtSeqList[4]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ J3DModel* mpHeadgearModel; /* 0xBDC */ daNpcF_MatAnm_c* mpMatAnm; diff --git a/include/d/actor/d_a_npc_pachi_besu.h b/include/d/actor/d_a_npc_pachi_besu.h index 7fa17d8b2d..2cc79d2364 100644 --- a/include/d/actor/d_a_npc_pachi_besu.h +++ b/include/d/actor/d_a_npc_pachi_besu.h @@ -147,7 +147,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_pachi_maro.h b/include/d/actor/d_a_npc_pachi_maro.h index 379c2c204b..be398f85e0 100644 --- a/include/d/actor/d_a_npc_pachi_maro.h +++ b/include/d/actor/d_a_npc_pachi_maro.h @@ -187,7 +187,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_pachi_taro.h b/include/d/actor/d_a_npc_pachi_taro.h index 12de6aedf4..e424292f6c 100644 --- a/include/d/actor/d_a_npc_pachi_taro.h +++ b/include/d/actor/d_a_npc_pachi_taro.h @@ -199,7 +199,6 @@ public: 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; /* 0x0E44 */ J3DModel* mpModels[2]; /* 0x0E4C */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_passer.h b/include/d/actor/d_a_npc_passer.h index d2f6f0b764..e166e635b9 100644 --- a/include/d/actor/d_a_npc_passer.h +++ b/include/d/actor/d_a_npc_passer.h @@ -123,7 +123,6 @@ public: static DUSK_GAME_DATA seqFunc m_seq26_funcTbl[3]; static DUSK_GAME_DATA seqFunc m_seq27_funcTbl[1]; -private: /* 0xAC8 */ J3DModel* mpModel; /* 0xACC */ PathTrace_c m_path; /* 0xAF4 */ daNpcPasser_c::actionFunc* mAction; diff --git a/include/d/actor/d_a_npc_passer2.h b/include/d/actor/d_a_npc_passer2.h index 792bbfd329..148a3b2981 100644 --- a/include/d/actor/d_a_npc_passer2.h +++ b/include/d/actor/d_a_npc_passer2.h @@ -53,7 +53,6 @@ public: static DUSK_GAME_DATA actionFunc ActionTable[1][2]; -private: /* 0x9EC */ J3DModel* mpModel; /* 0x9F0 */ PathTrace_c m_path; /* 0xA18 */ actionFunc* mAction; diff --git a/include/d/actor/d_a_npc_post.h b/include/d/actor/d_a_npc_post.h index 7b31506513..ef44f7ee1e 100644 --- a/include/d/actor/d_a_npc_post.h +++ b/include/d/actor/d_a_npc_post.h @@ -156,7 +156,6 @@ public: 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; /* 0x0E44 */ NPC_POST_HIO_CLASS* mHIO; /* 0x0E48 */ J3DModel* mpLetterModels[2]; diff --git a/include/d/actor/d_a_npc_pouya.h b/include/d/actor/d_a_npc_pouya.h index c30b0e0199..4af1d1ce68 100644 --- a/include/d/actor/d_a_npc_pouya.h +++ b/include/d/actor/d_a_npc_pouya.h @@ -149,7 +149,6 @@ public: 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; /* 0xE44 */ J3DModel* mpModel[1]; /* 0xE48 */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_prayer.h b/include/d/actor/d_a_npc_prayer.h index bc2735a43f..438bc784f9 100644 --- a/include/d/actor/d_a_npc_prayer.h +++ b/include/d/actor/d_a_npc_prayer.h @@ -79,7 +79,6 @@ public: static DUSK_GAME_DATA EvtSeq DUSK_CONST mEvtSeqList[]; -private: /* 0xB48 */ Z2CreatureCitizen mSound; /* 0xBEC */ u8 field_0xBEC[0xBF0 - 0xBEC]; /* 0xBF0 */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_raca.h b/include/d/actor/d_a_npc_raca.h index 9cd1849880..187ca700c7 100644 --- a/include/d/actor/d_a_npc_raca.h +++ b/include/d/actor/d_a_npc_raca.h @@ -148,7 +148,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_rafrel.h b/include/d/actor/d_a_npc_rafrel.h index 3b3ac191bd..0bb9e76194 100644 --- a/include/d/actor/d_a_npc_rafrel.h +++ b/include/d/actor/d_a_npc_rafrel.h @@ -107,7 +107,6 @@ public: static DUSK_GAME_DATA int (daNpcRafrel_c::*mEvtSeqList[])(int); -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ J3DModel* mpItemModel; /* 0xBDC */ daNpcF_MatAnm_c* mpMatAnm; diff --git a/include/d/actor/d_a_npc_saru.h b/include/d/actor/d_a_npc_saru.h index 7f04c509e2..dce1d7b4a3 100644 --- a/include/d/actor/d_a_npc_saru.h +++ b/include/d/actor/d_a_npc_saru.h @@ -135,7 +135,6 @@ public: 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]; /* 0xE4C */ dCcD_Cyl field_0xe4c; diff --git a/include/d/actor/d_a_npc_seib.h b/include/d/actor/d_a_npc_seib.h index f2d0e04820..855be4ac41 100644 --- a/include/d/actor/d_a_npc_seib.h +++ b/include/d/actor/d_a_npc_seib.h @@ -87,7 +87,6 @@ public: 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; /* 0xE44 */ u8 mType; /* 0xE48 */ actionFunc mActionFunc1; diff --git a/include/d/actor/d_a_npc_seic.h b/include/d/actor/d_a_npc_seic.h index 526331f05e..609d38588b 100644 --- a/include/d/actor/d_a_npc_seic.h +++ b/include/d/actor/d_a_npc_seic.h @@ -90,7 +90,6 @@ public: 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; /* 0xE44 */ u8 mType; /* 0xE45 */ u8 field_0xe45[0xe48 - 0xe45]; diff --git a/include/d/actor/d_a_npc_seid.h b/include/d/actor/d_a_npc_seid.h index 37cc6302d6..91a1920598 100644 --- a/include/d/actor/d_a_npc_seid.h +++ b/include/d/actor/d_a_npc_seid.h @@ -89,7 +89,6 @@ public: 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; /* 0xE44 */ u8 mType; /* 0xE48 */ actionFunc mAction; diff --git a/include/d/actor/d_a_npc_seira.h b/include/d/actor/d_a_npc_seira.h index d750c70711..c4f2ef1a96 100644 --- a/include/d/actor/d_a_npc_seira.h +++ b/include/d/actor/d_a_npc_seira.h @@ -117,7 +117,6 @@ public: 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; /* 0x0F80 */ NPC_SEIRA_HIO_CLASS* mpHIO; /* 0x0F80 */ dCcD_Cyl mCyl1; diff --git a/include/d/actor/d_a_npc_seira2.h b/include/d/actor/d_a_npc_seira2.h index 496357af4e..13aeb71e65 100644 --- a/include/d/actor/d_a_npc_seira2.h +++ b/include/d/actor/d_a_npc_seira2.h @@ -109,7 +109,6 @@ public: 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; /* 0x0F80 */ NPC_SEIRA2_HIO_CLASS* mpHIO; /* 0x0F84 */ dCcD_Cyl mCyl1; diff --git a/include/d/actor/d_a_npc_seirei.h b/include/d/actor/d_a_npc_seirei.h index a25c9671ae..b27f6084fc 100644 --- a/include/d/actor/d_a_npc_seirei.h +++ b/include/d/actor/d_a_npc_seirei.h @@ -102,7 +102,6 @@ public: 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; /* 0xE44 */ u8 mType; /* 0xE45 */ u8 arg0; diff --git a/include/d/actor/d_a_npc_shad.h b/include/d/actor/d_a_npc_shad.h index 7f4490c183..59f1901059 100644 --- a/include/d/actor/d_a_npc_shad.h +++ b/include/d/actor/d_a_npc_shad.h @@ -237,7 +237,6 @@ public: } } -private: /* 0xB48 */ J3DModel* mBookKnifeModel; /* 0xB4C */ J3DModel* mKomonshoModel; /* 0xB50 */ Z2Creature mSound; diff --git a/include/d/actor/d_a_npc_shaman.h b/include/d/actor/d_a_npc_shaman.h index cdb7f7d7e9..1a462a7d00 100644 --- a/include/d/actor/d_a_npc_shaman.h +++ b/include/d/actor/d_a_npc_shaman.h @@ -117,7 +117,6 @@ public: static DUSK_GAME_DATA const int mSceneChangeNoTable[48]; static DUSK_GAME_DATA queryFunc mQueries[48]; -private: /* 0xE40 */ NPC_SHA_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_shoe.h b/include/d/actor/d_a_npc_shoe.h index f9bee53132..b93259b60f 100644 --- a/include/d/actor/d_a_npc_shoe.h +++ b/include/d/actor/d_a_npc_shoe.h @@ -112,7 +112,6 @@ public: static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[1]; -private: /* 0xB48 */ J3DModel* mpModel1; /* 0xB4C */ J3DModel* mpModel2; /* 0xB50 */ Z2CreatureCitizen mCreature; diff --git a/include/d/actor/d_a_npc_sola.h b/include/d/actor/d_a_npc_sola.h index bfeb993cc7..b7fff5b57b 100644 --- a/include/d/actor/d_a_npc_sola.h +++ b/include/d/actor/d_a_npc_sola.h @@ -114,7 +114,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 field_0xf80; diff --git a/include/d/actor/d_a_npc_soldierA.h b/include/d/actor/d_a_npc_soldierA.h index dfc114d97e..aaca72ec8b 100644 --- a/include/d/actor/d_a_npc_soldierA.h +++ b/include/d/actor/d_a_npc_soldierA.h @@ -82,7 +82,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[3]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[3]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ J3DModel* mSpearModel; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_soldierB.h b/include/d/actor/d_a_npc_soldierB.h index 66813628f9..d39f54edc5 100644 --- a/include/d/actor/d_a_npc_soldierB.h +++ b/include/d/actor/d_a_npc_soldierB.h @@ -78,7 +78,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; static DUSK_GAME_DATA cutFunc DUSK_CONST mEvtCutList[2]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ J3DModel* mSpearModel; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_taro.h b/include/d/actor/d_a_npc_taro.h index 1d0fa6274b..83ff47fc07 100644 --- a/include/d/actor/d_a_npc_taro.h +++ b/include/d/actor/d_a_npc_taro.h @@ -159,7 +159,6 @@ public: 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; /* 0x0E44 */ J3DModel* mModels[2]; /* 0x0E4C */ dCcD_Cyl mCyl1; diff --git a/include/d/actor/d_a_npc_the.h b/include/d/actor/d_a_npc_the.h index fba5678e01..2a230afb8e 100644 --- a/include/d/actor/d_a_npc_the.h +++ b/include/d/actor/d_a_npc_the.h @@ -208,7 +208,6 @@ public: } } -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_theB.h b/include/d/actor/d_a_npc_theB.h index 92e0b0b3f0..e2bc9d410d 100644 --- a/include/d/actor/d_a_npc_theB.h +++ b/include/d/actor/d_a_npc_theB.h @@ -151,7 +151,6 @@ public: static DUSK_GAME_DATA cutFunc mEvtSeqList[6]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_tkc.h b/include/d/actor/d_a_npc_tkc.h index 3148354b36..6ec0150e5c 100644 --- a/include/d/actor/d_a_npc_tkc.h +++ b/include/d/actor/d_a_npc_tkc.h @@ -108,7 +108,6 @@ public: static DUSK_GAME_DATA evtFunc mEvtSeqList[4]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_ActorMngr_c mActorMngr[1]; diff --git a/include/d/actor/d_a_npc_tkj.h b/include/d/actor/d_a_npc_tkj.h index 8e7e2567b1..3191f1ee3b 100644 --- a/include/d/actor/d_a_npc_tkj.h +++ b/include/d/actor/d_a_npc_tkj.h @@ -97,7 +97,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCcCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_tks.h b/include/d/actor/d_a_npc_tks.h index 0342a378fe..837a0c89ec 100644 --- a/include/d/actor/d_a_npc_tks.h +++ b/include/d/actor/d_a_npc_tks.h @@ -134,7 +134,6 @@ public: inline void playTsuboAnm(); inline int getPlayerArea(); -private: /* 0x0B48 */ Z2Creature mSound; /* 0x0BD8 */ daNpcTksTsubo_c mTksTsubo; /* 0x1160 */ daNpcF_MatAnm_c* mpMatAnm; diff --git a/include/d/actor/d_a_npc_toby.h b/include/d/actor/d_a_npc_toby.h index 4f53117112..9abb7c032f 100644 --- a/include/d/actor/d_a_npc_toby.h +++ b/include/d/actor/d_a_npc_toby.h @@ -132,7 +132,6 @@ public: 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; /* 0x0E44 */ J3DModel* mpTobyModels[1]; /* 0x0E48 */ dCcD_Cyl mCyl1; diff --git a/include/d/actor/d_a_npc_uri.h b/include/d/actor/d_a_npc_uri.h index 78a327592a..2650de4d64 100644 --- a/include/d/actor/d_a_npc_uri.h +++ b/include/d/actor/d_a_npc_uri.h @@ -139,7 +139,6 @@ public: static DUSK_GAME_DATA const char* mCutNameList[7]; static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; -private: /* 0x0E40 */ NPC_URI_HIO_CLASS* mpHIO; /* 0x0E44 */ J3DModel* mpModel[1]; /* 0x0E48 */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_npc_wrestler.h b/include/d/actor/d_a_npc_wrestler.h index b910ed50f9..c840259074 100644 --- a/include/d/actor/d_a_npc_wrestler.h +++ b/include/d/actor/d_a_npc_wrestler.h @@ -232,7 +232,6 @@ public: static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[7]; -private: /* 0xB48 */ Z2Creature mSound; /* 0xBD8 */ daNpcWrestler_HIOParam* field_0xbd8; /* 0xBDC */ daNpcWrestler_HIOParamSub* field_0xbdc; diff --git a/include/d/actor/d_a_npc_yamid.h b/include/d/actor/d_a_npc_yamid.h index b175aa7a53..b9bb6bb288 100644 --- a/include/d/actor/d_a_npc_yamid.h +++ b/include/d/actor/d_a_npc_yamid.h @@ -132,7 +132,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl field_0xe44; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_yamis.h b/include/d/actor/d_a_npc_yamis.h index 4c23311c5e..272b0d5b72 100644 --- a/include/d/actor/d_a_npc_yamis.h +++ b/include/d/actor/d_a_npc_yamis.h @@ -127,7 +127,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl field_0xe44; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_yamit.h b/include/d/actor/d_a_npc_yamit.h index a59b6a841f..0a12c2875d 100644 --- a/include/d/actor/d_a_npc_yamit.h +++ b/include/d/actor/d_a_npc_yamit.h @@ -126,7 +126,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl field_0xe44; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_yelia.h b/include/d/actor/d_a_npc_yelia.h index 737a3b4e28..c86d8e6ac6 100644 --- a/include/d/actor/d_a_npc_yelia.h +++ b/include/d/actor/d_a_npc_yelia.h @@ -104,7 +104,6 @@ public: 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; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_ykm.h b/include/d/actor/d_a_npc_ykm.h index d486d6fe6a..5bbb5077f6 100644 --- a/include/d/actor/d_a_npc_ykm.h +++ b/include/d/actor/d_a_npc_ykm.h @@ -287,7 +287,6 @@ public: 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; /* 0x0E48 */ NPC_YKM_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_npc_zanb.h b/include/d/actor/d_a_npc_zanb.h index 51d99c8253..78c37f6c76 100644 --- a/include/d/actor/d_a_npc_zanb.h +++ b/include/d/actor/d_a_npc_zanb.h @@ -102,7 +102,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_zant.h b/include/d/actor/d_a_npc_zant.h index cbd33863d2..f9cd1c5b9b 100644 --- a/include/d/actor/d_a_npc_zant.h +++ b/include/d/actor/d_a_npc_zant.h @@ -86,7 +86,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_zelR.h b/include/d/actor/d_a_npc_zelR.h index e7810c850c..bfe7d963a0 100644 --- a/include/d/actor/d_a_npc_zelR.h +++ b/include/d/actor/d_a_npc_zelR.h @@ -96,7 +96,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList; static DUSK_GAME_DATA EventFn mCutList[1]; -private: /* 0xE40 */ NPC_ZELR_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_zelRo.h b/include/d/actor/d_a_npc_zelRo.h index b3e2533999..a57235bff9 100644 --- a/include/d/actor/d_a_npc_zelRo.h +++ b/include/d/actor/d_a_npc_zelRo.h @@ -150,7 +150,6 @@ public: 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; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 mType; diff --git a/include/d/actor/d_a_npc_zelda.h b/include/d/actor/d_a_npc_zelda.h index 6c3da5a2b3..e4be31296e 100644 --- a/include/d/actor/d_a_npc_zelda.h +++ b/include/d/actor/d_a_npc_zelda.h @@ -103,7 +103,6 @@ public: static DUSK_GAME_DATA const char* mCutNameList; static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[1]; -private: /* 0xE40 */ NPC_ZELDA_HIO_CLASS* mpHIO; /* 0xE44 */ dCcD_Cyl mCyl; /* 0xF80 */ u8 field_0xf80; diff --git a/include/d/actor/d_a_npc_zrc.h b/include/d/actor/d_a_npc_zrc.h index f4aeee6ac9..e9992ae157 100644 --- a/include/d/actor/d_a_npc_zrc.h +++ b/include/d/actor/d_a_npc_zrc.h @@ -96,7 +96,6 @@ public: static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[2]; -private: /* 0xB48 */ Z2Creature mCreatureSound; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBDC */ daNpcF_Lookat_c mLookat; diff --git a/include/d/actor/d_a_npc_zrz.h b/include/d/actor/d_a_npc_zrz.h index 76c782b7d3..a02ebb8227 100644 --- a/include/d/actor/d_a_npc_zrz.h +++ b/include/d/actor/d_a_npc_zrz.h @@ -114,7 +114,6 @@ public: void himoCalc(); void adjustShapeAngle() {} -private: /* 0x0B48 */ Z2Creature mCreatureSound; /* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0x0BDC */ mDoExt_invisibleModel mInvisibleModel; diff --git a/include/d/actor/d_a_obj_Lv5Key.h b/include/d/actor/d_a_obj_Lv5Key.h index 6e0251b151..11e2bd3019 100644 --- a/include/d/actor/d_a_obj_Lv5Key.h +++ b/include/d/actor/d_a_obj_Lv5Key.h @@ -65,7 +65,6 @@ public: cXyz& getLocalOffset() { return mLocalOffset; } -private: /* 0x568 */ u8 field_0x568[0x56C - 0x568]; /* 0x56C */ Z2SoundObjSimple mSound; /* 0x58C */ u8 field_0x58C[0x590 - 0x58C]; diff --git a/include/d/actor/d_a_obj_Turara.h b/include/d/actor/d_a_obj_Turara.h index 99d5a3a245..16f27d8550 100644 --- a/include/d/actor/d_a_obj_Turara.h +++ b/include/d/actor/d_a_obj_Turara.h @@ -56,7 +56,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5b8 */ request_of_phase_process_class mPhaseReq; /* 0x5c0 */ J3DModel* mpModel[2]; /* 0x5c8 */ u8 mMode; diff --git a/include/d/actor/d_a_obj_TvCdlst.h b/include/d/actor/d_a_obj_TvCdlst.h index afe204bc03..5329727f6a 100644 --- a/include/d/actor/d_a_obj_TvCdlst.h +++ b/include/d/actor/d_a_obj_TvCdlst.h @@ -33,7 +33,6 @@ public: u8 getOnSw() { return fopAcM_GetParamBit(this,0,8); } u8 getOffSw() { return fopAcM_GetParamBit(this,0x10,8); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_Y_taihou.h b/include/d/actor/d_a_obj_Y_taihou.h index 0e96cf62ed..002b85d853 100644 --- a/include/d/actor/d_a_obj_Y_taihou.h +++ b/include/d/actor/d_a_obj_Y_taihou.h @@ -37,7 +37,6 @@ public: s32 getIronBallId() { return mIronBallId; } void startBomb() { mStartBomb = 0xffff; } -private: /* 0x5b8 */ Mtx mMtx; /* 0x5e8 */ J3DModel* mpModel; /* 0x5ec */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_amiShutter.h b/include/d/actor/d_a_obj_amiShutter.h index b0e881c4c0..9fabc75220 100644 --- a/include/d/actor/d_a_obj_amiShutter.h +++ b/include/d/actor/d_a_obj_amiShutter.h @@ -62,7 +62,6 @@ public: bool isShutterOpen() { return mOpen; } -private: /* 0x5b8 */ request_of_phase_process_class mPhaseReq; /* 0x5c0 */ J3DModel* mpModel; /* 0x5c4 */ u8 mMode; diff --git a/include/d/actor/d_a_obj_ari.h b/include/d/actor/d_a_obj_ari.h index a771b054f1..03b80016bd 100644 --- a/include/d/actor/d_a_obj_ari.h +++ b/include/d/actor/d_a_obj_ari.h @@ -40,7 +40,6 @@ public: bool CreateChk(); cPhs_Step create(); -private: /* 0x590 */ dBgS_GndChk mGndChk; /* 0x5E4 */ u8 field_0x5e4[4]; /* 0x5E8 */ u8 mAction; diff --git a/include/d/actor/d_a_obj_automata.h b/include/d/actor/d_a_obj_automata.h index 95fec65cff..17e470af99 100644 --- a/include/d/actor/d_a_obj_automata.h +++ b/include/d/actor/d_a_obj_automata.h @@ -44,7 +44,7 @@ public: * */ class daObj_AutoMata_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_AUTOMATA_HIO_CLASS* mpHIO; /* 0x56C */ mDoExt_McaMorfSO* mpMorf; /* 0x570 */ Z2Creature mCreature; diff --git a/include/d/actor/d_a_obj_avalanche.h b/include/d/actor/d_a_obj_avalanche.h index 89de60d2e8..ef72babdef 100644 --- a/include/d/actor/d_a_obj_avalanche.h +++ b/include/d/actor/d_a_obj_avalanche.h @@ -46,7 +46,6 @@ public: u8 getEvId() { return fopAcM_GetParamBit(this, 8, 8); } void setAction(u8 action) { mAction = action; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ mDoExt_bckAnm* mBckAnm; diff --git a/include/d/actor/d_a_obj_batta.h b/include/d/actor/d_a_obj_batta.h index fca663390b..a1eaefc45e 100644 --- a/include/d/actor/d_a_obj_batta.h +++ b/include/d/actor/d_a_obj_batta.h @@ -43,7 +43,6 @@ public: return mActionFunc == i_func; } -private: /* 0x590 */ Z2Creature mCreature; /* 0x620 */ mDoExt_McaMorfSO* mpMorf; /* 0x624 */ mDoExt_brkAnm* mBrk; diff --git a/include/d/actor/d_a_obj_bbox.h b/include/d/actor/d_a_obj_bbox.h index 7ee461b557..1f7c2eef60 100644 --- a/include/d/actor/d_a_obj_bbox.h +++ b/include/d/actor/d_a_obj_bbox.h @@ -26,7 +26,6 @@ public: u32 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_bemos.h b/include/d/actor/d_a_obj_bemos.h index 38501b708b..3d0c10790d 100644 --- a/include/d/actor/d_a_obj_bemos.h +++ b/include/d/actor/d_a_obj_bemos.h @@ -131,7 +131,6 @@ public: int Delete(); static DUSK_GAME_DATA s16 const M_dir_base[4]; - // private: /* 0x05A0 */ request_of_phase_process_class mPhase; /* 0x05A8 */ J3DModel* mpModel; /* 0x05AC */ mDoExt_brkAnm* mSerchBrk; diff --git a/include/d/actor/d_a_obj_bhashi.h b/include/d/actor/d_a_obj_bhashi.h index 7600d73f67..7ce2cd1c23 100644 --- a/include/d/actor/d_a_obj_bhashi.h +++ b/include/d/actor/d_a_obj_bhashi.h @@ -50,7 +50,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x05A0 */ u8 field_0x5A0[0x05A4 - 0x05A0]; /* 0x05A4 */ int mMode; /* 0x05A8 */ s16 field_0x5a8; diff --git a/include/d/actor/d_a_obj_bkdoor.h b/include/d/actor/d_a_obj_bkdoor.h index 69d3191028..793d86f09c 100644 --- a/include/d/actor/d_a_obj_bkdoor.h +++ b/include/d/actor/d_a_obj_bkdoor.h @@ -26,7 +26,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ csXyz mRotation; diff --git a/include/d/actor/d_a_obj_bky_rock.h b/include/d/actor/d_a_obj_bky_rock.h index 1f5952c35e..1214a610c9 100644 --- a/include/d/actor/d_a_obj_bky_rock.h +++ b/include/d/actor/d_a_obj_bky_rock.h @@ -63,7 +63,6 @@ public: static DUSK_GAME_DATA dCcD_SrcCyl const s_CcDCyl; static DUSK_GAME_DATA exeProc s_exeProc[3]; -private: /* 0x568 */ int mVibrationTimer; /* 0x578 */ u8 mMode; /* 0x579 */ bool field_0x579; diff --git a/include/d/actor/d_a_obj_bmWindow.h b/include/d/actor/d_a_obj_bmWindow.h index 161f4768a9..a3d71fa9c2 100644 --- a/include/d/actor/d_a_obj_bmWindow.h +++ b/include/d/actor/d_a_obj_bmWindow.h @@ -39,7 +39,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_bmshutter.h b/include/d/actor/d_a_obj_bmshutter.h index c114421fe8..6ca4c05fe9 100644 --- a/include/d/actor/d_a_obj_bmshutter.h +++ b/include/d/actor/d_a_obj_bmshutter.h @@ -46,7 +46,6 @@ public: void setAction(u8 action) { mAction = action; } void setMoveMode(u8 mode) { mMoveMode = mode; } -private: /* 0x5a0 */ request_of_phase_process_class mPhase; /* 0x5a8 */ J3DModel* mModel; /* 0x5ac */ s16 mEventIdx; diff --git a/include/d/actor/d_a_obj_bombf.h b/include/d/actor/d_a_obj_bombf.h index 1d175caa94..661450e397 100644 --- a/include/d/actor/d_a_obj_bombf.h +++ b/include/d/actor/d_a_obj_bombf.h @@ -21,7 +21,6 @@ public: int execute(); int draw(); -private: /* 0x568 */ request_of_phase_process_class field_0x568; /* 0x570 */ J3DModel* field_0x570; /* 0x574 */ u32 field_0x574; diff --git a/include/d/actor/d_a_obj_bosswarp.h b/include/d/actor/d_a_obj_bosswarp.h index 9b62f1a0f6..4f6c6e4282 100644 --- a/include/d/actor/d_a_obj_bosswarp.h +++ b/include/d/actor/d_a_obj_bosswarp.h @@ -60,7 +60,6 @@ public: bool isFirst() { return fopAcM_GetParamBit(this, 0x1b, 1); } void setAction(u8 action) { mAction = action; } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ mDoExt_btkAnm* mpBtkAnm[2]; diff --git a/include/d/actor/d_a_obj_boumato.h b/include/d/actor/d_a_obj_boumato.h index 4852aee6f9..6a0266e548 100644 --- a/include/d/actor/d_a_obj_boumato.h +++ b/include/d/actor/d_a_obj_boumato.h @@ -50,7 +50,7 @@ public: * */ class daObj_BouMato_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_BOUMATO_HIO_CLASS* mpHIO; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_bsGate.h b/include/d/actor/d_a_obj_bsGate.h index b40c5dcf6d..0c9730d63d 100644 --- a/include/d/actor/d_a_obj_bsGate.h +++ b/include/d/actor/d_a_obj_bsGate.h @@ -35,7 +35,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_bubblePilar.h b/include/d/actor/d_a_obj_bubblePilar.h index 7fb8009564..e19cbbae2f 100644 --- a/include/d/actor/d_a_obj_bubblePilar.h +++ b/include/d/actor/d_a_obj_bubblePilar.h @@ -39,7 +39,6 @@ public: static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModels[2]; /* 0x5B0 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_burnbox.h b/include/d/actor/d_a_obj_burnbox.h index f87678dccc..dc4634ea85 100644 --- a/include/d/actor/d_a_obj_burnbox.h +++ b/include/d/actor/d_a_obj_burnbox.h @@ -28,7 +28,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpBoxModel; /* 0x5AC */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_carry.h b/include/d/actor/d_a_obj_carry.h index 8147cbfb60..54c8c73043 100644 --- a/include/d/actor/d_a_obj_carry.h +++ b/include/d/actor/d_a_obj_carry.h @@ -407,7 +407,6 @@ public: /* 0xE26 */ u8 field_0xe26; /* 0xE27 */ u8 field_0xe27; -private: u16 getType_private() { return field_0xd18 >> 1 & 0x1f; } }; diff --git a/include/d/actor/d_a_obj_catdoor.h b/include/d/actor/d_a_obj_catdoor.h index b7ed95bd14..c352c25806 100644 --- a/include/d/actor/d_a_obj_catdoor.h +++ b/include/d/actor/d_a_obj_catdoor.h @@ -80,7 +80,6 @@ public: Z2GetAudioMgr()->seStart(Z2SE_OBJ_GZ_NE_DOOR_OP, ¤t.pos, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ daObjCatDoor_Door_c mDoor1; /* 0x660 */ daObjCatDoor_Door_c mDoor2; diff --git a/include/d/actor/d_a_obj_cblock.h b/include/d/actor/d_a_obj_cblock.h index 04881776ec..75454ebb5d 100644 --- a/include/d/actor/d_a_obj_cblock.h +++ b/include/d/actor/d_a_obj_cblock.h @@ -49,7 +49,6 @@ public: u8 getSwNo() { return fopAcM_GetParamBit(this, 16, 8); } u8 getPathID() { return fopAcM_GetParamBit(this, 24, 8); } -private: /* 0x5A0 */ request_of_phase_process_class phase; /* 0x5A8 */ J3DModel* model1; /* 0x5AC */ J3DModel* model2; diff --git a/include/d/actor/d_a_obj_cboard.h b/include/d/actor/d_a_obj_cboard.h index 52a5f753e4..9bcdb51ed5 100644 --- a/include/d/actor/d_a_obj_cboard.h +++ b/include/d/actor/d_a_obj_cboard.h @@ -28,7 +28,6 @@ public: u8 getArg0() { return fopAcM_GetParamBit(this, 4, 4); } u8 getSwNo() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ Mtx field_0x5a8; }; diff --git a/include/d/actor/d_a_obj_cdoor.h b/include/d/actor/d_a_obj_cdoor.h index ee06fd790c..60d54539e9 100644 --- a/include/d/actor/d_a_obj_cdoor.h +++ b/include/d/actor/d_a_obj_cdoor.h @@ -51,7 +51,6 @@ public: int getSwitchNum() { return mSw; } void setChainID(u32 i_id) { mChainID = i_id; } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ bool mEnd; diff --git a/include/d/actor/d_a_obj_chandelier.h b/include/d/actor/d_a_obj_chandelier.h index 45158dea34..a0592f4374 100644 --- a/include/d/actor/d_a_obj_chandelier.h +++ b/include/d/actor/d_a_obj_chandelier.h @@ -49,7 +49,6 @@ public: void moveHookOn() { field_0x60a = 1; } -private: /* 0x5A8 */ cXyz field_0x5a8; /* 0x5B4 */ Mtx mMtx; /* 0x5E4 */ u8 field_0x5e4[4]; diff --git a/include/d/actor/d_a_obj_chest.h b/include/d/actor/d_a_obj_chest.h index a5caedae86..e225c4a254 100644 --- a/include/d/actor/d_a_obj_chest.h +++ b/include/d/actor/d_a_obj_chest.h @@ -39,7 +39,6 @@ public: u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } u32 getArg0() { return fopAcM_GetParamBit(this, 8, 4); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dBgS_ObjAcch mObjAcch; diff --git a/include/d/actor/d_a_obj_cho.h b/include/d/actor/d_a_obj_cho.h index 49dd5332b1..adb3faef58 100644 --- a/include/d/actor/d_a_obj_cho.h +++ b/include/d/actor/d_a_obj_cho.h @@ -46,7 +46,6 @@ public: cPhs_Step create(); inline int Draw(); -private: /* 0x590 */ dBgS_AcchCir mAcchCir; /* 0x5D0 */ dBgS_ObjAcch mAcch; /* 0x7A8 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_cowdoor.h b/include/d/actor/d_a_obj_cowdoor.h index 1ed34370d8..a084ca0188 100644 --- a/include/d/actor/d_a_obj_cowdoor.h +++ b/include/d/actor/d_a_obj_cowdoor.h @@ -22,7 +22,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class field_0x5a0; /* 0x5A8 */ J3DModel* field_0x5a8; }; diff --git a/include/d/actor/d_a_obj_crope.h b/include/d/actor/d_a_obj_crope.h index bde25e379c..e0f0220000 100644 --- a/include/d/actor/d_a_obj_crope.h +++ b/include/d/actor/d_a_obj_crope.h @@ -52,7 +52,6 @@ public: mCoCancelTimer = 30; } -private: /* 0x0568 */ request_of_phase_process_class mPhase; /* 0x0570 */ dCcD_Stts mCcStts; /* 0x05AC */ dCcD_Sph mCollider; diff --git a/include/d/actor/d_a_obj_crvfence.h b/include/d/actor/d_a_obj_crvfence.h index dd760bb43f..9b6298553f 100644 --- a/include/d/actor/d_a_obj_crvfence.h +++ b/include/d/actor/d_a_obj_crvfence.h @@ -34,7 +34,6 @@ public: int Draw(); int Delete(); -private: /* 0x05A0 */ int field_0x5a0; /* 0x05A4 */ int mAction; /* 0x05A8 */ u8 field_0x5a8; diff --git a/include/d/actor/d_a_obj_crvgate.h b/include/d/actor/d_a_obj_crvgate.h index 1fb4d1a12b..fed7868085 100644 --- a/include/d/actor/d_a_obj_crvgate.h +++ b/include/d/actor/d_a_obj_crvgate.h @@ -50,7 +50,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ s32 mEventID; /* 0x5A4 */ bool mFlagGateClosed; /* 0x5A5 */ bool field_0x5a5; diff --git a/include/d/actor/d_a_obj_crvlh_down.h b/include/d/actor/d_a_obj_crvlh_down.h index ce1c31bfa8..06ad6c89f0 100644 --- a/include/d/actor/d_a_obj_crvlh_down.h +++ b/include/d/actor/d_a_obj_crvlh_down.h @@ -28,7 +28,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x5A0 */ fpc_ProcID field_0x5a0; /* 0x5A4 */ fpc_ProcID field_0x5a4; /* 0x5A8 */ cXyz field_0x5a8; diff --git a/include/d/actor/d_a_obj_crvlh_up.h b/include/d/actor/d_a_obj_crvlh_up.h index 7f24ba03a6..950018311a 100644 --- a/include/d/actor/d_a_obj_crvlh_up.h +++ b/include/d/actor/d_a_obj_crvlh_up.h @@ -26,7 +26,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x568 */ u8 field_0x568[0x5a4 - 0x5a0]; /* 0x5A4 */ fpc_ProcID field_0x5a4; /* 0x5A8 */ fpc_ProcID field_0x5a8; diff --git a/include/d/actor/d_a_obj_crvsteel.h b/include/d/actor/d_a_obj_crvsteel.h index a8d6305495..09ddc5be2a 100644 --- a/include/d/actor/d_a_obj_crvsteel.h +++ b/include/d/actor/d_a_obj_crvsteel.h @@ -29,7 +29,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ u32 mSmokeParticle1; /* 0x5A4 */ u32 mSmokeParticle2; /* 0x5A8 */ s16 mAction; diff --git a/include/d/actor/d_a_obj_crystal.h b/include/d/actor/d_a_obj_crystal.h index 0d6fcc1fc6..3c2fbfb110 100644 --- a/include/d/actor/d_a_obj_crystal.h +++ b/include/d/actor/d_a_obj_crystal.h @@ -22,7 +22,6 @@ public: int draw(); int _delete(); -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel[2]; /* 0x578 */ JPABaseEmitter* mpEmitter; diff --git a/include/d/actor/d_a_obj_cwall.h b/include/d/actor/d_a_obj_cwall.h index 396729be80..66d760a337 100644 --- a/include/d/actor/d_a_obj_cwall.h +++ b/include/d/actor/d_a_obj_cwall.h @@ -61,7 +61,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 4, 4); } u8 getSwbit() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mWallModel; /* 0x5AC */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_damCps.h b/include/d/actor/d_a_obj_damCps.h index 1ce75cc663..d92a38184c 100644 --- a/include/d/actor/d_a_obj_damCps.h +++ b/include/d/actor/d_a_obj_damCps.h @@ -26,7 +26,6 @@ public: int _delete(); u8 getSwNo(); -private: /* 0x0570 */ dCcD_Stts mStts; /* 0x05AC */ dCcD_Cps mCps; /* 0x06F0 */ cM3dGCpsS mCapsule; diff --git a/include/d/actor/d_a_obj_dan.h b/include/d/actor/d_a_obj_dan.h index 15caef361a..3e3b62fc9b 100644 --- a/include/d/actor/d_a_obj_dan.h +++ b/include/d/actor/d_a_obj_dan.h @@ -39,7 +39,6 @@ public: bool CreateChk(); cPhs_Step create(); -private: /* 0x590 */ dCcD_Stts mCcStts; /* 0x5CC */ dCcD_Sph mCcSph; /* 0x704 */ daPy_boomerangMove_c mBoomerangMove; diff --git a/include/d/actor/d_a_obj_digholl.h b/include/d/actor/d_a_obj_digholl.h index 33f078a1ea..f985bbe165 100644 --- a/include/d/actor/d_a_obj_digholl.h +++ b/include/d/actor/d_a_obj_digholl.h @@ -21,7 +21,6 @@ public: void onDigStart() { field_0x568 = 1; } s16 getSceneNum() const { return field_0x56c; } -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 field_0x569; /* 0x56A */ u8 field_0x56a; diff --git a/include/d/actor/d_a_obj_digplace.h b/include/d/actor/d_a_obj_digplace.h index 404b35aff4..0b29ff11f6 100644 --- a/include/d/actor/d_a_obj_digplace.h +++ b/include/d/actor/d_a_obj_digplace.h @@ -17,7 +17,6 @@ public: int create(); int execute(); -private: /* 0x568 */ u8 mType; /* 0x569 */ u8 mSwitch; /* 0x56A */ u8 mDigFlg; diff --git a/include/d/actor/d_a_obj_digsnow.h b/include/d/actor/d_a_obj_digsnow.h index 09af66d091..4ef3de5958 100644 --- a/include/d/actor/d_a_obj_digsnow.h +++ b/include/d/actor/d_a_obj_digsnow.h @@ -50,7 +50,6 @@ public: void startDig() { mMode = ACTION_DIG_e; } void endDig() { mMode = ACTION_END_e; } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_enemy_create.h b/include/d/actor/d_a_obj_enemy_create.h index 3b29caddab..64da7b5203 100644 --- a/include/d/actor/d_a_obj_enemy_create.h +++ b/include/d/actor/d_a_obj_enemy_create.h @@ -22,7 +22,6 @@ public: void NameChk(); int create(); -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 mEnemyNum; /* 0x56A */ u8 mActivateSw; diff --git a/include/d/actor/d_a_obj_fallobj.h b/include/d/actor/d_a_obj_fallobj.h index 0c4efed3f3..f59a58991a 100644 --- a/include/d/actor/d_a_obj_fallobj.h +++ b/include/d/actor/d_a_obj_fallobj.h @@ -50,7 +50,6 @@ public: return this->speed.y != 0.0f; }; -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ Mtx mMtx; /* 0x5D8 */ u8 field_0x5d8; diff --git a/include/d/actor/d_a_obj_fan.h b/include/d/actor/d_a_obj_fan.h index 1ababac7a6..a4907c01a1 100644 --- a/include/d/actor/d_a_obj_fan.h +++ b/include/d/actor/d_a_obj_fan.h @@ -29,7 +29,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this,0,4); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ dBgW* field_0x5ac; diff --git a/include/d/actor/d_a_obj_fchain.h b/include/d/actor/d_a_obj_fchain.h index 7c4ae74faf..80e96f097b 100644 --- a/include/d/actor/d_a_obj_fchain.h +++ b/include/d/actor/d_a_obj_fchain.h @@ -35,7 +35,6 @@ public: void onInterpCallback(); #endif -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModelData* mModelData; /* 0x574 */ daObjFchain_shape_c mShape; diff --git a/include/d/actor/d_a_obj_fireWood.h b/include/d/actor/d_a_obj_fireWood.h index 07a5d5334b..5ce85234de 100644 --- a/include/d/actor/d_a_obj_fireWood.h +++ b/include/d/actor/d_a_obj_fireWood.h @@ -27,7 +27,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x568 */ u8 field_0x568[0x574 - 0x568]; /* 0x574 */ dCcD_Stts mCcStts; /* 0x5B0 */ dCcD_Cyl mCcCyl; diff --git a/include/d/actor/d_a_obj_fireWood2.h b/include/d/actor/d_a_obj_fireWood2.h index bcb1bee95d..209ccf8ffd 100644 --- a/include/d/actor/d_a_obj_fireWood2.h +++ b/include/d/actor/d_a_obj_fireWood2.h @@ -28,7 +28,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x568 */ u8 field_0x568[0x574 - 0x568]; /* 0x574 */ dCcD_Stts mCcStts; /* 0x5B0 */ dCcD_Cyl mCcCyl; diff --git a/include/d/actor/d_a_obj_firepillar.h b/include/d/actor/d_a_obj_firepillar.h index 620373422a..8490a1c488 100644 --- a/include/d/actor/d_a_obj_firepillar.h +++ b/include/d/actor/d_a_obj_firepillar.h @@ -47,7 +47,6 @@ public: int draw(); int _delete(); -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ int field_0x570; /* 0x574 */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_firepillar2.h b/include/d/actor/d_a_obj_firepillar2.h index 359cbf6bb3..579342b8dc 100644 --- a/include/d/actor/d_a_obj_firepillar2.h +++ b/include/d/actor/d_a_obj_firepillar2.h @@ -51,7 +51,6 @@ public: u8 getArg0() { return fopAcM_GetParamBit(this,8,8); } u8 getSwNo() { return fopAcM_GetParamBit(this,0,8); } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mModel; /* 0x574 */ mDoExt_bckAnm* mBck; diff --git a/include/d/actor/d_a_obj_flag.h b/include/d/actor/d_a_obj_flag.h index 8187fe33b2..8ac8662fb9 100644 --- a/include/d/actor/d_a_obj_flag.h +++ b/include/d/actor/d_a_obj_flag.h @@ -28,7 +28,7 @@ public: * */ class daObjFlag_c : public fopAc_ac_c { -private: +public: /* 0x568 */ J3DModel* mpModel1; /* 0x56c */ J3DModel* mpModel2; /* 0x570 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_flag2.h b/include/d/actor/d_a_obj_flag2.h index c9ef033190..676da2141d 100644 --- a/include/d/actor/d_a_obj_flag2.h +++ b/include/d/actor/d_a_obj_flag2.h @@ -83,7 +83,6 @@ public: static DUSK_GAME_DATA daObjFlag2_Attr_c const M_attr; -private: /* 0x0568 */ J3DModel* mModel; /* 0x056C */ request_of_phase_process_class mFlagPhase; /* 0x0574 */ request_of_phase_process_class mArcPhase; diff --git a/include/d/actor/d_a_obj_flag3.h b/include/d/actor/d_a_obj_flag3.h index b93394ce15..26bfd5b506 100644 --- a/include/d/actor/d_a_obj_flag3.h +++ b/include/d/actor/d_a_obj_flag3.h @@ -96,7 +96,6 @@ public: static DUSK_GAME_DATA daObjFlag3_Attr_c const M_attr; const daObjFlag3_Attr_c& attr() const { return M_attr; } -private: /* 0x0568 */ J3DModel* mModel; /* 0x056C */ request_of_phase_process_class mFlagPhase; /* 0x0574 */ request_of_phase_process_class mArcPhase; diff --git a/include/d/actor/d_a_obj_gadget.h b/include/d/actor/d_a_obj_gadget.h index cb2c99af97..a52f9ab27b 100644 --- a/include/d/actor/d_a_obj_gadget.h +++ b/include/d/actor/d_a_obj_gadget.h @@ -17,7 +17,7 @@ class daObj_Gadget_HIO_c; * */ class daObj_Gadget_c : public fopAc_ac_c { -private: +public: /* 0x568 */ daObj_Gadget_HIO_c* field_0x568; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_ganonwall.h b/include/d/actor/d_a_obj_ganonwall.h index 02d0cd1d99..c5e6f7d06a 100644 --- a/include/d/actor/d_a_obj_ganonwall.h +++ b/include/d/actor/d_a_obj_ganonwall.h @@ -26,7 +26,6 @@ public: u32 getEventBit1() { return fopAcM_GetParamBit(this, 0, 10); } u32 getEventBit2() { return fopAcM_GetParamBit(this, 10, 10); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ mDoExt_btkAnm* mpBtkAnm; diff --git a/include/d/actor/d_a_obj_ganonwall2.h b/include/d/actor/d_a_obj_ganonwall2.h index a938a32141..0026094a8d 100644 --- a/include/d/actor/d_a_obj_ganonwall2.h +++ b/include/d/actor/d_a_obj_ganonwall2.h @@ -25,7 +25,6 @@ public: u32 getEventBit1() { return fopAcM_GetParamBit(this, 0, 10); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ mDoExt_btkAnm* mpBtkAnm; diff --git a/include/d/actor/d_a_obj_geyser.h b/include/d/actor/d_a_obj_geyser.h index 54a7f3bcb8..244d3b1fcf 100644 --- a/include/d/actor/d_a_obj_geyser.h +++ b/include/d/actor/d_a_obj_geyser.h @@ -62,7 +62,6 @@ public: u8 getArg3() { return fopAcM_GetParamBit(this, 24, 8); } u8 getSwNo() { return 0xFF; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_glowSphere.h b/include/d/actor/d_a_obj_glowSphere.h index c6c2ee220e..062a9ce7d5 100644 --- a/include/d/actor/d_a_obj_glowSphere.h +++ b/include/d/actor/d_a_obj_glowSphere.h @@ -30,7 +30,6 @@ public: bool isSet() { return mIsSet; } daGlwSph_c* getpSph() { return mpSph; } -private: /* 0x0 */ daGlwSph_c* mpSph; /* 0x4 */ s8 mIsSet; }; diff --git a/include/d/actor/d_a_obj_goGate.h b/include/d/actor/d_a_obj_goGate.h index a0a66c7f32..8ed98a43e6 100644 --- a/include/d/actor/d_a_obj_goGate.h +++ b/include/d/actor/d_a_obj_goGate.h @@ -40,7 +40,6 @@ public: u32 getLR() { return fopAcM_GetParamBit(this, 8, 8); } u32 getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_gomikabe.h b/include/d/actor/d_a_obj_gomikabe.h index 441fff371f..a0a01c4e20 100644 --- a/include/d/actor/d_a_obj_gomikabe.h +++ b/include/d/actor/d_a_obj_gomikabe.h @@ -41,7 +41,6 @@ public: int Draw(); int Delete(); -private: /* 0x05A0 */ u8 mSwBit; /* 0x05A1 */ u8 mAction; /* 0x05A2 */ u8 field_0x5a2; diff --git a/include/d/actor/d_a_obj_gpTaru.h b/include/d/actor/d_a_obj_gpTaru.h index b3b31a5c9d..1ab93b2586 100644 --- a/include/d/actor/d_a_obj_gpTaru.h +++ b/include/d/actor/d_a_obj_gpTaru.h @@ -46,7 +46,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mpModel; /* 0x578 */ u8 mMode; diff --git a/include/d/actor/d_a_obj_gra2.h b/include/d/actor/d_a_obj_gra2.h index 3cf17e090c..4add220bcd 100644 --- a/include/d/actor/d_a_obj_gra2.h +++ b/include/d/actor/d_a_obj_gra2.h @@ -243,7 +243,6 @@ public: void setDemoMode(s16 mDemoMode) { mDemoCamMode = mDemoMode; } s16 getDemoMode() { return mDemoCamMode; } -private: /* 0x0A48 */ u16 field_0xa48; /* 0x0A4C */ OBJ_GRA_HIO_CLASS* mpHIO; /* 0x0A50 */ Process field_0xa50; diff --git a/include/d/actor/d_a_obj_graWall.h b/include/d/actor/d_a_obj_graWall.h index ebcd1cdb58..037767547a 100644 --- a/include/d/actor/d_a_obj_graWall.h +++ b/include/d/actor/d_a_obj_graWall.h @@ -20,7 +20,6 @@ public: void col_init(); void col_set(); -private: /* 0x568 */ dCcD_Stts mStts; /* 0x5A4 */ dCcD_Cyl mCyl; /* 0x6E0 */ u8 field_0x6e0; diff --git a/include/d/actor/d_a_obj_gra_rock.h b/include/d/actor/d_a_obj_gra_rock.h index 24e816a829..21ec800563 100644 --- a/include/d/actor/d_a_obj_gra_rock.h +++ b/include/d/actor/d_a_obj_gra_rock.h @@ -33,7 +33,6 @@ public: static DUSK_GAME_DATA dCcD_SrcCyl const mCcDCyl; -private: /* 0x5A0 */ request_of_phase_process_class mPhases[5]; /* 0x5C8 */ J3DModel* mModel; /* 0x5CC */ mDoExt_btpAnm mBtp; diff --git a/include/d/actor/d_a_obj_grave_stone.h b/include/d/actor/d_a_obj_grave_stone.h index d41d58348a..9155a2f54c 100644 --- a/include/d/actor/d_a_obj_grave_stone.h +++ b/include/d/actor/d_a_obj_grave_stone.h @@ -36,7 +36,6 @@ public: int Draw(); int Delete(); -private: friend class daNpc_zrZ_c; /* 0x5A0 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_groundwater.h b/include/d/actor/d_a_obj_groundwater.h index 5e9061d89c..1fc0f0ef37 100644 --- a/include/d/actor/d_a_obj_groundwater.h +++ b/include/d/actor/d_a_obj_groundwater.h @@ -47,7 +47,6 @@ public: u8 getSw() { return fopAcM_GetParamBit(this, 8, 8); } u8 getSw2() { return fopAcM_GetParamBit(this, 16, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel1; /* 0x5AC */ J3DModel* mModel2; diff --git a/include/d/actor/d_a_obj_grz_rock.h b/include/d/actor/d_a_obj_grz_rock.h index cd65d2e906..4c8f382071 100644 --- a/include/d/actor/d_a_obj_grz_rock.h +++ b/include/d/actor/d_a_obj_grz_rock.h @@ -28,7 +28,6 @@ public: void setSmashFlag(u8 i_smashFlag) { mSmashFlag = i_smashFlag; } -private: /* 0x568 */ request_of_phase_process_class mPhase[1]; /* 0x5A0 */ J3DModel* mpModel; /* 0x5AC */ dBgS_ObjAcch mBgc; diff --git a/include/d/actor/d_a_obj_hakai_brl.h b/include/d/actor/d_a_obj_hakai_brl.h index dba4b3cd3f..9bd109da7c 100644 --- a/include/d/actor/d_a_obj_hakai_brl.h +++ b/include/d/actor/d_a_obj_hakai_brl.h @@ -34,7 +34,6 @@ public: static DUSK_GAME_DATA dCcD_SrcCyl const s_CcDCyl; -private: /* 0x574 */ J3DModel* mpModel; /* 0x578 */ dCcD_Stts mStts; /* 0x5B4 */ dCcD_Cyl mCyl; diff --git a/include/d/actor/d_a_obj_hakai_ftr.h b/include/d/actor/d_a_obj_hakai_ftr.h index 45c815c5f9..ac7f749860 100644 --- a/include/d/actor/d_a_obj_hakai_ftr.h +++ b/include/d/actor/d_a_obj_hakai_ftr.h @@ -31,7 +31,6 @@ public: static DUSK_GAME_DATA dCcD_SrcCyl const s_CcDCyl; -private: /* 0x574 */ Mtx mMtx; /* 0x5A4 */ dBgW* field_0x5a4; /* 0x5A8 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_hasu2.h b/include/d/actor/d_a_obj_hasu2.h index 9c36c0d180..203b4ff159 100644 --- a/include/d/actor/d_a_obj_hasu2.h +++ b/include/d/actor/d_a_obj_hasu2.h @@ -29,7 +29,6 @@ public: virtual ~daObjMHasu_c() {}; void setRideFlag(bool i_ride) { mRideFlag = i_ride; } -private: /* 0x5A8 */ Mtx mMtx; /* 0x5D8 */ Mtx mMtx2; /* 0x608 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_hbombkoya.h b/include/d/actor/d_a_obj_hbombkoya.h index 9f9c0a5149..b1d76f819b 100644 --- a/include/d/actor/d_a_obj_hbombkoya.h +++ b/include/d/actor/d_a_obj_hbombkoya.h @@ -39,7 +39,6 @@ public: int getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } int getSw2No() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x5A8 */ // dEvLib_callback_c /* 0x5B8 */ Mtx mBgMtx; /* 0x5E8 */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_hfuta.h b/include/d/actor/d_a_obj_hfuta.h index 77015715d0..4f4ee44eeb 100644 --- a/include/d/actor/d_a_obj_hfuta.h +++ b/include/d/actor/d_a_obj_hfuta.h @@ -37,7 +37,6 @@ public: void setMode(u8 mode) { mMode = mode; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ cXyz mTransM; diff --git a/include/d/actor/d_a_obj_hsTarget.h b/include/d/actor/d_a_obj_hsTarget.h index 1e0e775e12..50a497eb8e 100644 --- a/include/d/actor/d_a_obj_hsTarget.h +++ b/include/d/actor/d_a_obj_hsTarget.h @@ -23,7 +23,6 @@ public: u8 getModelType() { return fopAcM_GetParamBit(this, 0, 4); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mIndex; diff --git a/include/d/actor/d_a_obj_iceleaf.h b/include/d/actor/d_a_obj_iceleaf.h index da79be5bc5..42ad6237e7 100644 --- a/include/d/actor/d_a_obj_iceleaf.h +++ b/include/d/actor/d_a_obj_iceleaf.h @@ -61,7 +61,6 @@ public: u8 checkRideStatus() { return fopAcM_GetParamBit(this, 0x10, 8); } u8 getSwbit() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_itamato.h b/include/d/actor/d_a_obj_itamato.h index 10c6459887..b9080f7db7 100644 --- a/include/d/actor/d_a_obj_itamato.h +++ b/include/d/actor/d_a_obj_itamato.h @@ -46,7 +46,7 @@ public: #endif class daObj_ItaMato_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_ITAMATO_HIO_CLASS* mHIO; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mpModels[2]; diff --git a/include/d/actor/d_a_obj_kabuto.h b/include/d/actor/d_a_obj_kabuto.h index 9738147885..2b9d6255ee 100644 --- a/include/d/actor/d_a_obj_kabuto.h +++ b/include/d/actor/d_a_obj_kabuto.h @@ -47,7 +47,6 @@ public: cPhs_Step create(); inline int Draw(); -private: /* 0x590 */ dCcD_Stts mCcStts; /* 0x5CC */ dCcD_Sph mCcSph; /* 0x704 */ daPy_boomerangMove_c mBoomerangMove; diff --git a/include/d/actor/d_a_obj_kag.h b/include/d/actor/d_a_obj_kag.h index 58692d7a8c..09c9a088a0 100644 --- a/include/d/actor/d_a_obj_kag.h +++ b/include/d/actor/d_a_obj_kag.h @@ -39,7 +39,6 @@ public: void kag_setParticle(); inline int CreateHeap(); inline int draw(); -private: /* 0x590 */ request_of_phase_process_class mPhase; /* 0x598 */ Z2Creature mSound; /* 0x628 */ mDoExt_McaMorfSO* mpModelMorf; diff --git a/include/d/actor/d_a_obj_kago.h b/include/d/actor/d_a_obj_kago.h index 265db41c57..4a6ed74730 100644 --- a/include/d/actor/d_a_obj_kago.h +++ b/include/d/actor/d_a_obj_kago.h @@ -125,7 +125,6 @@ public: field_0xb68 = 0.0f; } -private: /* 0x568 */ OBJ_KAGO_HIO_CLASS* mpHIO; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* field_0x574; diff --git a/include/d/actor/d_a_obj_kaisou.h b/include/d/actor/d_a_obj_kaisou.h index 3398c24884..36d6f568df 100644 --- a/include/d/actor/d_a_obj_kaisou.h +++ b/include/d/actor/d_a_obj_kaisou.h @@ -28,7 +28,6 @@ public: inline int CreateHeap(); inline int Draw(); -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 field_0x569; /* 0x56A */ u8 field_0x56a[0x56e - 0x56a]; diff --git a/include/d/actor/d_a_obj_kamakiri.h b/include/d/actor/d_a_obj_kamakiri.h index 3b2d56e533..52b648ea48 100644 --- a/include/d/actor/d_a_obj_kamakiri.h +++ b/include/d/actor/d_a_obj_kamakiri.h @@ -56,7 +56,6 @@ public: u8 CreateChk(); int create(); -private: /* 0x590 */ dCcD_Stts mStts; /* 0x5CC */ dCcD_Sph mSphere; /* 0x704 */ daPy_boomerangMove_c mBoomerangMove; diff --git a/include/d/actor/d_a_obj_kantera.h b/include/d/actor/d_a_obj_kantera.h index 0228b51fd5..fbe230ed16 100644 --- a/include/d/actor/d_a_obj_kantera.h +++ b/include/d/actor/d_a_obj_kantera.h @@ -33,7 +33,6 @@ public: void setStatus(u8 i_status) { mStatus = i_status; } -private: /* 0x92C */ u32 field_0x92c; /* 0x930 */ s32 field_0x930; /* 0x934 */ u8 mStatus; diff --git a/include/d/actor/d_a_obj_katatsumuri.h b/include/d/actor/d_a_obj_katatsumuri.h index e481d3eb3a..93b9368fb5 100644 --- a/include/d/actor/d_a_obj_katatsumuri.h +++ b/include/d/actor/d_a_obj_katatsumuri.h @@ -55,7 +55,6 @@ public: bool CreateChk(); int create(); -private: /* 0x590 */ dBgS_ObjAcch mAcch; /* 0x768 */ dBgS_GndChk mGndChk; /* 0x7BC */ u8 field_0x7bc[0x7c0 - 0x7bc]; diff --git a/include/d/actor/d_a_obj_kazeneko.h b/include/d/actor/d_a_obj_kazeneko.h index 73147b6fbe..164612ecfc 100644 --- a/include/d/actor/d_a_obj_kazeneko.h +++ b/include/d/actor/d_a_obj_kazeneko.h @@ -46,7 +46,6 @@ public: const KazoNekoAttr& attr() { return M_attr; } static DUSK_GAME_DATA KazoNekoAttr const M_attr; -private: /* 0x568 */ J3DModel* mModel; /* 0x56C */ J3DModel* mArmModels[4]; /* 0x57C */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_kgate.h b/include/d/actor/d_a_obj_kgate.h index 96798028b2..f7fe72767c 100644 --- a/include/d/actor/d_a_obj_kgate.h +++ b/include/d/actor/d_a_obj_kgate.h @@ -46,7 +46,6 @@ public: u8 getEventID() { return fopAcM_GetParamBit(this, 0x14, 8); } u8 getNameArg() { return fopAcM_GetParamBit(this, 0x10, 4); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpGateModel; /* 0x5AC */ J3DModel* mpGateModel2; diff --git a/include/d/actor/d_a_obj_kiPot.h b/include/d/actor/d_a_obj_kiPot.h index 01d7cf76c0..248daa2d46 100644 --- a/include/d/actor/d_a_obj_kiPot.h +++ b/include/d/actor/d_a_obj_kiPot.h @@ -23,7 +23,6 @@ public: int Draw(); int Delete(); -private: /* 0x568 */ u8 field_0x568[0x574 - 0x568]; /* 0x574 */ u8 mMode; /* 0x575 */ u8 field_0x575; diff --git a/include/d/actor/d_a_obj_kjgjs.h b/include/d/actor/d_a_obj_kjgjs.h index 495750bd89..189c672c7d 100644 --- a/include/d/actor/d_a_obj_kjgjs.h +++ b/include/d/actor/d_a_obj_kjgjs.h @@ -25,7 +25,6 @@ public: u32 getType() { return fopAcM_GetParamBit(this, 0, 4); } -private: /* 0x5A8 */ Mtx mMtx[2]; /* 0x608 */ J3DModel* mpModel; /* 0x60C */ s32 field_0x60c; diff --git a/include/d/actor/d_a_obj_klift00.h b/include/d/actor/d_a_obj_klift00.h index ab5403d51b..d87c2d4459 100644 --- a/include/d/actor/d_a_obj_klift00.h +++ b/include/d/actor/d_a_obj_klift00.h @@ -33,7 +33,6 @@ public: LOCK_e = (1 << 6), NO_BASE_DISP = (1 << 7) }; -private: struct ChainPos { cXyz mDeltaPosVector; cXyz mCurrentPos; diff --git a/include/d/actor/d_a_obj_knBullet.h b/include/d/actor/d_a_obj_knBullet.h index e8056fbb25..fa2d5397a2 100644 --- a/include/d/actor/d_a_obj_knBullet.h +++ b/include/d/actor/d_a_obj_knBullet.h @@ -26,7 +26,6 @@ public: u8 getActionMode() { return mActionMode; } void setActionMode(u8 i_action) { mActionMode = i_action; } -private: /* 0x568 */ Mtx mMtx; /* 0x598 */ dCcD_Stts mCcStts; /* 0x5D4 */ dCcD_Sph mCcSph; diff --git a/include/d/actor/d_a_obj_kshutter.h b/include/d/actor/d_a_obj_kshutter.h index b217adef2d..a0a2204c0d 100644 --- a/include/d/actor/d_a_obj_kshutter.h +++ b/include/d/actor/d_a_obj_kshutter.h @@ -64,7 +64,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 8, 8); } u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } void setAction(u8 action) { mAction = action; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase1; /* 0x5A8 */ request_of_phase_process_class mPhase2; /* 0x5B0 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_ktOnFire.h b/include/d/actor/d_a_obj_ktOnFire.h index 39875e122e..7d292bf286 100644 --- a/include/d/actor/d_a_obj_ktOnFire.h +++ b/include/d/actor/d_a_obj_ktOnFire.h @@ -26,7 +26,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x568 */ dCcD_Stts mCcStts; /* 0x5A4 */ dCcD_Cyl mCcCyl; /* 0x6E0 */ u8 mWaitTime; diff --git a/include/d/actor/d_a_obj_kuwagata.h b/include/d/actor/d_a_obj_kuwagata.h index 9df3f0bc35..a14b0544bc 100644 --- a/include/d/actor/d_a_obj_kuwagata.h +++ b/include/d/actor/d_a_obj_kuwagata.h @@ -47,7 +47,6 @@ public: int create(); inline int Draw(); -private: /* 0x590 */ dCcD_Stts mStts; /* 0x5CC */ dCcD_Sph mSph; /* 0x704 */ daPy_boomerangMove_c mBoomerangMove; diff --git a/include/d/actor/d_a_obj_kwheel00.h b/include/d/actor/d_a_obj_kwheel00.h index ceaf132fd6..2d58cb32f1 100644 --- a/include/d/actor/d_a_obj_kwheel00.h +++ b/include/d/actor/d_a_obj_kwheel00.h @@ -41,7 +41,6 @@ public: enum Type_e { TYPE_LARGE_GOLD, TYPE_SMALL_PLATINUM }; -private: enum QuadrantalAngle_e { DEG_INVALID = -1, DEG_0, DEG_90, DEG_180, DEG_270, DEG_MAX}; /* 0x5B8 */ Mtx mNewBgMtx; diff --git a/include/d/actor/d_a_obj_kwheel01.h b/include/d/actor/d_a_obj_kwheel01.h index 40bc025db4..9c6fa31075 100644 --- a/include/d/actor/d_a_obj_kwheel01.h +++ b/include/d/actor/d_a_obj_kwheel01.h @@ -27,7 +27,6 @@ public: int Delete(); bool eventStart(); -private: /* 0x5B8 */ Mtx mNewBgMtx; /* 0x5E8 */ Mtx mTransformMtx; /* 0x618 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_kznkarm.h b/include/d/actor/d_a_obj_kznkarm.h index c70908fcb8..3838d1f9ff 100644 --- a/include/d/actor/d_a_obj_kznkarm.h +++ b/include/d/actor/d_a_obj_kznkarm.h @@ -63,7 +63,6 @@ public: static DUSK_GAME_DATA daObjKznkarm_Attr_c const M_attr; static DUSK_GAME_DATA actionFunc ActionTable[4][2]; -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ dBgS_AcchCir mAcchCir; diff --git a/include/d/actor/d_a_obj_ladder.h b/include/d/actor/d_a_obj_ladder.h index 72f6fce4d2..b46bf99603 100644 --- a/include/d/actor/d_a_obj_ladder.h +++ b/include/d/actor/d_a_obj_ladder.h @@ -76,7 +76,6 @@ namespace daObjLadder { 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; /* 0x5AC */ Type_e mType; diff --git a/include/d/actor/d_a_obj_laundry.h b/include/d/actor/d_a_obj_laundry.h index cc79bc4e05..3dd76c6a39 100644 --- a/include/d/actor/d_a_obj_laundry.h +++ b/include/d/actor/d_a_obj_laundry.h @@ -56,7 +56,6 @@ public: inline int daObjLdy_Draw(); inline int daObjLdy_Execute(); -private: static DUSK_GAME_DATA const daObjLdy_Attr_c mAttr; /* 0x568 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_laundry_rope.h b/include/d/actor/d_a_obj_laundry_rope.h index 3ecab164b2..85d76cbe8d 100644 --- a/include/d/actor/d_a_obj_laundry_rope.h +++ b/include/d/actor/d_a_obj_laundry_rope.h @@ -58,7 +58,6 @@ public: static DUSK_GAME_DATA const daObjLndRope_Attr_c mAttr; static const daObjLndRope_Hio_c M_Hio; -private: /* 0x0568 */ mDoExt_3DlineMat1_c mRopeMat; /* 0x05a4 */ request_of_phase_process_class mPhase; /* 0x05ac */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_life_container.h b/include/d/actor/d_a_obj_life_container.h index 1b98c1afe8..a7b209cb94 100644 --- a/include/d/actor/d_a_obj_life_container.h +++ b/include/d/actor/d_a_obj_life_container.h @@ -64,7 +64,6 @@ public: current.pos = new_pos; } -private: /* 0x92C */ fpc_ProcID mItemId; /* 0x930 */ int mCounter; /* 0x934 */ u8 mStatus; @@ -92,6 +91,7 @@ private: u8 mOriginalItemNo; bool mItemOverridden; bool mOverrideHover; + bool mGoldenWolfItem; #endif }; diff --git a/include/d/actor/d_a_obj_lv1Candle00.h b/include/d/actor/d_a_obj_lv1Candle00.h index e9e62da388..c70d484930 100644 --- a/include/d/actor/d_a_obj_lv1Candle00.h +++ b/include/d/actor/d_a_obj_lv1Candle00.h @@ -30,7 +30,6 @@ public: int Draw(); int Delete(); -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_lv1Candle01.h b/include/d/actor/d_a_obj_lv1Candle01.h index 632c117f10..1f1dbe4ee4 100644 --- a/include/d/actor/d_a_obj_lv1Candle01.h +++ b/include/d/actor/d_a_obj_lv1Candle01.h @@ -27,7 +27,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_lv2Candle.h b/include/d/actor/d_a_obj_lv2Candle.h index 19be29a16e..424dd844fd 100644 --- a/include/d/actor/d_a_obj_lv2Candle.h +++ b/include/d/actor/d_a_obj_lv2Candle.h @@ -37,7 +37,6 @@ public: u8 getSwType() { return fopAcM_GetParamBit(this, 8, 4); } u8 getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_lv3Candle.h b/include/d/actor/d_a_obj_lv3Candle.h index 7b9765136d..76edaaac77 100644 --- a/include/d/actor/d_a_obj_lv3Candle.h +++ b/include/d/actor/d_a_obj_lv3Candle.h @@ -29,7 +29,6 @@ public: int getSwBit() { return fopAcM_GetParamBit(this, 0, 8); } int getType() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ u8 mType; diff --git a/include/d/actor/d_a_obj_lv3Water.h b/include/d/actor/d_a_obj_lv3Water.h index de4ff03356..82f5be1661 100644 --- a/include/d/actor/d_a_obj_lv3Water.h +++ b/include/d/actor/d_a_obj_lv3Water.h @@ -45,7 +45,6 @@ public: int getParamType() { return (shape_angle.x & 0xFF00) >> 8; } u8 getType() { return mType; } -private: /* 0x5B8 */ request_of_phase_process_class mPhase; /* 0x5C0 */ J3DModel* mpModel1; /* 0x5C4 */ J3DModel* mpModel2; diff --git a/include/d/actor/d_a_obj_lv3Water2.h b/include/d/actor/d_a_obj_lv3Water2.h index be13ef4819..4227e8bcb0 100644 --- a/include/d/actor/d_a_obj_lv3Water2.h +++ b/include/d/actor/d_a_obj_lv3Water2.h @@ -29,7 +29,6 @@ public: int Delete(); bool eventStart(); -private: /* 0x5B8 */ request_of_phase_process_class mPhase; /* 0x5C0 */ J3DModel* mpModel; /* 0x5C4 */ mDoExt_btkAnm mRefractionAnm; // Applied to water surface diff --git a/include/d/actor/d_a_obj_lv3saka00.h b/include/d/actor/d_a_obj_lv3saka00.h index f08f4a5d19..5207e74de8 100644 --- a/include/d/actor/d_a_obj_lv3saka00.h +++ b/include/d/actor/d_a_obj_lv3saka00.h @@ -28,7 +28,6 @@ public: u8 getSwbit() { return fopAcM_GetParamBit(this, 0, 8) & 0xFF; } u8 getType() { return fopAcM_GetParamBit(this, 28, 4) & 0xFF; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ dBgW* mpBgW2; }; diff --git a/include/d/actor/d_a_obj_lv3waterEff.h b/include/d/actor/d_a_obj_lv3waterEff.h index fdf7b204dc..a612168fac 100644 --- a/include/d/actor/d_a_obj_lv3waterEff.h +++ b/include/d/actor/d_a_obj_lv3waterEff.h @@ -18,7 +18,6 @@ public: int execute(); int _delete(); -private: /* 0x568 */ cXyz mSePositions[2]; /* 0x580 */ JPABaseEmitter* mParticles[4]; /* 0x590 */ u8 unused_0x590[0x594 - 0x590]; diff --git a/include/d/actor/d_a_obj_lv4CandleDemoTag.h b/include/d/actor/d_a_obj_lv4CandleDemoTag.h index 58378ecd4e..4ac8618776 100644 --- a/include/d/actor/d_a_obj_lv4CandleDemoTag.h +++ b/include/d/actor/d_a_obj_lv4CandleDemoTag.h @@ -43,7 +43,6 @@ public: virtual ~dalv4CandleDemoTag_c() {} virtual bool eventStart(); -private: /* 0x584 */ u8 mMode; /* 0x585 */ u8 mPathID; /* 0x586 */ u8 mSwNG; diff --git a/include/d/actor/d_a_obj_lv4EdShutter.h b/include/d/actor/d_a_obj_lv4EdShutter.h index a19de47873..992431c64d 100644 --- a/include/d/actor/d_a_obj_lv4EdShutter.h +++ b/include/d/actor/d_a_obj_lv4EdShutter.h @@ -45,7 +45,6 @@ public: u8 getZenmetuSw() { return shape_angle.z & 0xFF; } u8 getStatus() { return mStatus; } -private: /* 0x5B8 */ request_of_phase_process_class mPhase; /* 0x5C0 */ J3DModel* mpModel; /* 0x5C4 */ u8 mMode; diff --git a/include/d/actor/d_a_obj_lv4HsTarget.h b/include/d/actor/d_a_obj_lv4HsTarget.h index fbb1c8862a..c618aec40e 100644 --- a/include/d/actor/d_a_obj_lv4HsTarget.h +++ b/include/d/actor/d_a_obj_lv4HsTarget.h @@ -23,7 +23,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; }; diff --git a/include/d/actor/d_a_obj_lv4PoGate.h b/include/d/actor/d_a_obj_lv4PoGate.h index 480885fa0a..bd46dd30c4 100644 --- a/include/d/actor/d_a_obj_lv4PoGate.h +++ b/include/d/actor/d_a_obj_lv4PoGate.h @@ -52,7 +52,6 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_lv4RailWall.h b/include/d/actor/d_a_obj_lv4RailWall.h index 7cffceedc0..39858be708 100644 --- a/include/d/actor/d_a_obj_lv4RailWall.h +++ b/include/d/actor/d_a_obj_lv4RailWall.h @@ -50,7 +50,6 @@ public: u8 getSwbit() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5B0 */ request_of_phase_process_class mPhase; /* 0x5B8 */ J3DModel* mpModel; /* 0x5BC */ dBgS_ObjAcch field_0x5bc; diff --git a/include/d/actor/d_a_obj_lv4SlideWall.h b/include/d/actor/d_a_obj_lv4SlideWall.h index fcafa19dfc..1e08e68206 100644 --- a/include/d/actor/d_a_obj_lv4SlideWall.h +++ b/include/d/actor/d_a_obj_lv4SlideWall.h @@ -32,7 +32,6 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_lv4chandelier.h b/include/d/actor/d_a_obj_lv4chandelier.h index d0e7c53515..2b965d5831 100644 --- a/include/d/actor/d_a_obj_lv4chandelier.h +++ b/include/d/actor/d_a_obj_lv4chandelier.h @@ -43,7 +43,6 @@ public: int getAddChain2() { return fopAcM_GetParamBit(this, 12, 4); } int getSw() { return fopAcM_GetParamBit(this, 16, 8); } -private: /* 0x05A8 */ Mtx field_0x5a8; /* 0x05D8 */ Mtx field_0x5d8; /* 0x0608 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_lv4floor.h b/include/d/actor/d_a_obj_lv4floor.h index 7b6681419d..704ccece93 100644 --- a/include/d/actor/d_a_obj_lv4floor.h +++ b/include/d/actor/d_a_obj_lv4floor.h @@ -38,7 +38,6 @@ public: u8 getSwbit() { return fopAcM_GetParamBit(this, 0, 8) & 0xFF; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ f32 mMoveYPos; diff --git a/include/d/actor/d_a_obj_lv4gear.h b/include/d/actor/d_a_obj_lv4gear.h index 5e649c0722..9c3d4920c1 100644 --- a/include/d/actor/d_a_obj_lv4gear.h +++ b/include/d/actor/d_a_obj_lv4gear.h @@ -31,7 +31,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 8, 4); } u8 checkSE() { return fopAcM_GetParamBit(this, 12, 4); } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ s16 mTarget; diff --git a/include/d/actor/d_a_obj_lv4prelvtr.h b/include/d/actor/d_a_obj_lv4prelvtr.h index 2fd50068ac..9e4846671c 100644 --- a/include/d/actor/d_a_obj_lv4prelvtr.h +++ b/include/d/actor/d_a_obj_lv4prelvtr.h @@ -26,7 +26,6 @@ public: int getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A8 */ Mtx mMtx1; /* 0x5D8 */ Mtx mMtx2; /* 0x608 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_lv4sand.h b/include/d/actor/d_a_obj_lv4sand.h index 0ff6420e27..1b6272440b 100644 --- a/include/d/actor/d_a_obj_lv4sand.h +++ b/include/d/actor/d_a_obj_lv4sand.h @@ -46,7 +46,6 @@ public: u8 getSwbit() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5B0 */ request_of_phase_process_class mPhase; /* 0x5B8 */ J3DModel* mpModel; /* 0x5BC */ mDoExt_btkAnm* mpBtk; diff --git a/include/d/actor/d_a_obj_lv5FloorBoard.h b/include/d/actor/d_a_obj_lv5FloorBoard.h index 1dcba0ade2..e8ae0d18b2 100644 --- a/include/d/actor/d_a_obj_lv5FloorBoard.h +++ b/include/d/actor/d_a_obj_lv5FloorBoard.h @@ -38,7 +38,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5A0 */ dCcD_Stts mCcStts; /* 0x5DC */ dCcD_Cyl mCcCyl; /* 0x718 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv5IceWall.h b/include/d/actor/d_a_obj_lv5IceWall.h index c9f459e75d..e04d413249 100644 --- a/include/d/actor/d_a_obj_lv5IceWall.h +++ b/include/d/actor/d_a_obj_lv5IceWall.h @@ -42,7 +42,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5A0 */ dCcD_Stts mCcStts; /* 0x5DC */ dCcD_Cyl mCcCyl[2]; /* 0x854 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv5SwIce.h b/include/d/actor/d_a_obj_lv5SwIce.h index 8adc14f2af..9e990e3da7 100644 --- a/include/d/actor/d_a_obj_lv5SwIce.h +++ b/include/d/actor/d_a_obj_lv5SwIce.h @@ -38,7 +38,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5A0 */ dCcD_Stts mCcStts; /* 0x5DC */ dCcD_Cyl mCcCyl; /* 0x718 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv5ychndlr.h b/include/d/actor/d_a_obj_lv5ychndlr.h index 8db78c0afa..dc3a8f1ce2 100644 --- a/include/d/actor/d_a_obj_lv5ychndlr.h +++ b/include/d/actor/d_a_obj_lv5ychndlr.h @@ -26,7 +26,6 @@ public: virtual int Delete(); virtual ~daObjYchndlr_c() {} -private: /* 0x5A8 */ Mtx field_0x5a8; /* 0x5D8 */ Mtx field_0x5d8; /* 0x608 */ J3DModel* mpChandlierModel; diff --git a/include/d/actor/d_a_obj_lv6FurikoTrap.h b/include/d/actor/d_a_obj_lv6FurikoTrap.h index 8a5f17336d..5257bc540a 100644 --- a/include/d/actor/d_a_obj_lv6FurikoTrap.h +++ b/include/d/actor/d_a_obj_lv6FurikoTrap.h @@ -28,7 +28,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_lv6Lblock.h b/include/d/actor/d_a_obj_lv6Lblock.h index 0dbe6a330a..80080c702b 100644 --- a/include/d/actor/d_a_obj_lv6Lblock.h +++ b/include/d/actor/d_a_obj_lv6Lblock.h @@ -34,7 +34,6 @@ public: int getUpMax() { return fopAcM_GetParamBit(this, 8, 4); } int getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_lv6SwGate.h b/include/d/actor/d_a_obj_lv6SwGate.h index 331e7ae07d..e2844e06ee 100644 --- a/include/d/actor/d_a_obj_lv6SwGate.h +++ b/include/d/actor/d_a_obj_lv6SwGate.h @@ -38,7 +38,6 @@ public: 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]; /* 0x14AC */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_lv6SzGate.h b/include/d/actor/d_a_obj_lv6SzGate.h index 80601341ec..db3ec0ccce 100644 --- a/include/d/actor/d_a_obj_lv6SzGate.h +++ b/include/d/actor/d_a_obj_lv6SzGate.h @@ -45,7 +45,6 @@ public: u32 getWaitTime() { return fopAcM_GetParamBit(this, 8, 8); } u32 getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* field_0x5a8; /* 0x5AC */ J3DModel* field_0x5ac; diff --git a/include/d/actor/d_a_obj_lv6Tenbin.h b/include/d/actor/d_a_obj_lv6Tenbin.h index 6cdd8e3538..429ecb58be 100644 --- a/include/d/actor/d_a_obj_lv6Tenbin.h +++ b/include/d/actor/d_a_obj_lv6Tenbin.h @@ -27,7 +27,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel1; /* 0x5AC */ J3DModel* mModel2; diff --git a/include/d/actor/d_a_obj_lv6TogeRoll.h b/include/d/actor/d_a_obj_lv6TogeRoll.h index 9fedcd5932..4fc557b8b4 100644 --- a/include/d/actor/d_a_obj_lv6TogeRoll.h +++ b/include/d/actor/d_a_obj_lv6TogeRoll.h @@ -66,7 +66,6 @@ public: static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; static DUSK_GAME_DATA dCcD_SrcCps mCcDCps; -private: /* 0x05A0 */ request_of_phase_process_class mPhase; /* 0x05A8 */ J3DModel* mpModel; /* 0x05AC */ u8 mPathID; diff --git a/include/d/actor/d_a_obj_lv6elevta.h b/include/d/actor/d_a_obj_lv6elevta.h index b98ff06f58..192c568552 100644 --- a/include/d/actor/d_a_obj_lv6elevta.h +++ b/include/d/actor/d_a_obj_lv6elevta.h @@ -33,7 +33,6 @@ public: int getSw2No() { return fopAcM_GetParamBit(this, 8, 8); }; int getEvent() { return fopAcM_GetParamBit(this, 0x10, 8); }; -private: /* 0x5B8 */ Mtx mMtx1; /* 0x5E8 */ Mtx mMtx2; /* 0x618 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_lv7bridge.h b/include/d/actor/d_a_obj_lv7bridge.h index 938b87e08f..f53b24e708 100644 --- a/include/d/actor/d_a_obj_lv7bridge.h +++ b/include/d/actor/d_a_obj_lv7bridge.h @@ -45,7 +45,6 @@ public: void setDestroyAnmA() { field_0xa94 = 0; } void setDestroyAnmB() { field_0xa94 = 1; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_lv8KekkaiTrap.h b/include/d/actor/d_a_obj_lv8KekkaiTrap.h index aa68df0114..423e59a500 100644 --- a/include/d/actor/d_a_obj_lv8KekkaiTrap.h +++ b/include/d/actor/d_a_obj_lv8KekkaiTrap.h @@ -32,7 +32,6 @@ public: int getType() { return fopAcM_GetParamBit(this, 0, 4); } int getSwBit() { return fopAcM_GetParamBit(this, 4, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mIsSwitch; diff --git a/include/d/actor/d_a_obj_lv8Lift.h b/include/d/actor/d_a_obj_lv8Lift.h index 0b39e25e89..5c2ab58219 100644 --- a/include/d/actor/d_a_obj_lv8Lift.h +++ b/include/d/actor/d_a_obj_lv8Lift.h @@ -68,7 +68,6 @@ public: static DUSK_GAME_DATA f32 const mSpeed[16]; -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ mDoExt_btkAnm mBtk; diff --git a/include/d/actor/d_a_obj_lv9SwShutter.h b/include/d/actor/d_a_obj_lv9SwShutter.h index 06607f5c1c..44e0eef556 100644 --- a/include/d/actor/d_a_obj_lv9SwShutter.h +++ b/include/d/actor/d_a_obj_lv9SwShutter.h @@ -31,7 +31,6 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_magLift.h b/include/d/actor/d_a_obj_magLift.h index a8f597bfef..7c15edb05e 100644 --- a/include/d/actor/d_a_obj_magLift.h +++ b/include/d/actor/d_a_obj_magLift.h @@ -49,7 +49,6 @@ public: static DUSK_GAME_DATA f32 const mSpeed[16]; -private: /* 0x5a0 */ request_of_phase_process_class mPhaseReq; /* 0x5a8 */ J3DModel* mpModel; /* 0x5ac */ u8 field_0x5ac [0x5ae - 0x5ac]; diff --git a/include/d/actor/d_a_obj_magLiftRot.h b/include/d/actor/d_a_obj_magLiftRot.h index 647fcee80a..04621f7ddc 100644 --- a/include/d/actor/d_a_obj_magLiftRot.h +++ b/include/d/actor/d_a_obj_magLiftRot.h @@ -29,7 +29,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ mDoExt_btkAnm mBtk; diff --git a/include/d/actor/d_a_obj_master_sword.h b/include/d/actor/d_a_obj_master_sword.h index a971aa335c..e462e61481 100644 --- a/include/d/actor/d_a_obj_master_sword.h +++ b/include/d/actor/d_a_obj_master_sword.h @@ -51,7 +51,6 @@ public: static DUSK_GAME_DATA daObjMasterSword_Attr_c const mAttr; static DUSK_GAME_DATA actionFunc ActionTable[]; -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ mDoExt_btkAnm mBtk; diff --git a/include/d/actor/d_a_obj_metalbox.h b/include/d/actor/d_a_obj_metalbox.h index b7f2fb10cd..10c6462547 100644 --- a/include/d/actor/d_a_obj_metalbox.h +++ b/include/d/actor/d_a_obj_metalbox.h @@ -15,7 +15,7 @@ * */ class daObjMBox_c : public dBgS_MoveBgActor { -private: +public: /* 0x5a0 */ request_of_phase_process_class mPhase; /* 0x5a8 */ J3DModel* mpModel; /* 0x5ac */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_mgate.h b/include/d/actor/d_a_obj_mgate.h index 5b86c8aa17..9dc0d63114 100644 --- a/include/d/actor/d_a_obj_mgate.h +++ b/include/d/actor/d_a_obj_mgate.h @@ -39,7 +39,6 @@ public: bool checkLock() { return fopAcM_GetParamBit(this, 5, 1); } u8 checkOpen() { return fopAcM_GetParamBit(this, 8, 4); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ request_of_phase_process_class mKeyPhase; /* 0x5B0 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_mhole.h b/include/d/actor/d_a_obj_mhole.h index aa692338d2..c9818708fd 100644 --- a/include/d/actor/d_a_obj_mhole.h +++ b/include/d/actor/d_a_obj_mhole.h @@ -36,7 +36,6 @@ public: u8 getKind() { return fopAcM_GetParamBit(this, 12, 4); } u8 getSwbit() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ mDoExt_brkAnm* mpBrkAnm; diff --git a/include/d/actor/d_a_obj_mie.h b/include/d/actor/d_a_obj_mie.h index 6c95ed7f84..faa413e204 100644 --- a/include/d/actor/d_a_obj_mie.h +++ b/include/d/actor/d_a_obj_mie.h @@ -54,7 +54,7 @@ public: * */ class daObj_Mie_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_MIE_HIO_CLASS* mpHIO; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_mirror_6pole.h b/include/d/actor/d_a_obj_mirror_6pole.h index 17cf211be3..1a53d23399 100644 --- a/include/d/actor/d_a_obj_mirror_6pole.h +++ b/include/d/actor/d_a_obj_mirror_6pole.h @@ -56,7 +56,6 @@ public: static DUSK_GAME_DATA const actionFunc ActionTable[][2]; -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ mDoExt_bckAnm* mpBck; /* 0x570 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_mirror_chain.h b/include/d/actor/d_a_obj_mirror_chain.h index 106272f116..e04ab228d5 100644 --- a/include/d/actor/d_a_obj_mirror_chain.h +++ b/include/d/actor/d_a_obj_mirror_chain.h @@ -47,7 +47,6 @@ public: u8 getSwitchNo() { return (fopAcM_GetParam(this) >> 8) & 0xff; } void setAnmSpeed(f32 speed) { mpBckAnm->setPlaySpeed(speed); } -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ J3DModel* mpPortalModel; /* 0x570 */ mDoExt_bckAnm* mpBckAnm; diff --git a/include/d/actor/d_a_obj_mirror_sand.h b/include/d/actor/d_a_obj_mirror_sand.h index db27ccfaeb..ea7a8a6f30 100644 --- a/include/d/actor/d_a_obj_mirror_sand.h +++ b/include/d/actor/d_a_obj_mirror_sand.h @@ -37,7 +37,6 @@ public: dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[354]); } -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ mDoExt_bckAnm* mpBck; /* 0x570 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_mirror_screw.h b/include/d/actor/d_a_obj_mirror_screw.h index 482506ffc0..7cdf294f9b 100644 --- a/include/d/actor/d_a_obj_mirror_screw.h +++ b/include/d/actor/d_a_obj_mirror_screw.h @@ -65,7 +65,6 @@ public: (this->*mpActionFunc[1])(); } -private: /* 0x5A0 */ J3DModel* mpModel; /* 0x5A4 */ request_of_phase_process_class mPhaseReq; /* 0x5AC */ daObjMirrorScrew_actionFunc* mpActionFunc; diff --git a/include/d/actor/d_a_obj_nameplate.h b/include/d/actor/d_a_obj_nameplate.h index d6aa6356bb..7d5140838a 100644 --- a/include/d/actor/d_a_obj_nameplate.h +++ b/include/d/actor/d_a_obj_nameplate.h @@ -51,7 +51,6 @@ public: inline int draw(); inline int createHeap(); -private: /* 0x568 */ J3DModel* model; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_nan.h b/include/d/actor/d_a_obj_nan.h index 708d75199e..f1c9881764 100644 --- a/include/d/actor/d_a_obj_nan.h +++ b/include/d/actor/d_a_obj_nan.h @@ -42,7 +42,6 @@ public: inline int CreateHeap(); inline int draw(); -private: /* 0x590 */ request_of_phase_process_class mPhase; /* 0x598 */ Z2Creature mCreatureSound; /* 0x628 */ mDoExt_McaMorfSO* mMorf; diff --git a/include/d/actor/d_a_obj_octhashi.h b/include/d/actor/d_a_obj_octhashi.h index 4b5ef5459a..9bb21ce9a4 100644 --- a/include/d/actor/d_a_obj_octhashi.h +++ b/include/d/actor/d_a_obj_octhashi.h @@ -33,7 +33,6 @@ public: int Draw(); int Delete(); -private: /* 0x5a0 */ cXyz field_0x5a0[8]; /* 0x600 */ cXyz field_0x600[8]; /* 0x660 */ csXyz field_0x660[8]; @@ -53,7 +52,6 @@ private: public: /* 0x6e8 */ s16 field_0x6e8; /* 0x6ec */ Z2Creature mSound; -private: /* 0x077c */ u8 field_0x77c[4]; /* 0x0780 */ J3DModel* mpModel[8]; /* 0x07a0 */ u8 field_0x7a0[0x7a4 - 0x7a0]; diff --git a/include/d/actor/d_a_obj_oiltubo.h b/include/d/actor/d_a_obj_oiltubo.h index b4ee8612bc..58aeba161d 100644 --- a/include/d/actor/d_a_obj_oiltubo.h +++ b/include/d/actor/d_a_obj_oiltubo.h @@ -36,7 +36,6 @@ public: 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; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ J3DModel* mpBModel; diff --git a/include/d/actor/d_a_obj_onsen.h b/include/d/actor/d_a_obj_onsen.h index 64af56f1d5..43ba02bc25 100644 --- a/include/d/actor/d_a_obj_onsen.h +++ b/include/d/actor/d_a_obj_onsen.h @@ -25,7 +25,6 @@ public: u32 getType() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel[2]; /* 0x5B0 */ mDoExt_btkAnm* mpBtk; diff --git a/include/d/actor/d_a_obj_pdtile.h b/include/d/actor/d_a_obj_pdtile.h index 1dcb327acc..05e04063aa 100644 --- a/include/d/actor/d_a_obj_pdtile.h +++ b/include/d/actor/d_a_obj_pdtile.h @@ -35,7 +35,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 0, 4); } -private: /* 0x5A8 */ Mtx mBgMtx; /* 0x5D8 */ Mtx field_0x5d8; /* 0x608 */ J3DModel* mModel; diff --git a/include/d/actor/d_a_obj_pdwall.h b/include/d/actor/d_a_obj_pdwall.h index 45e8213f39..698ac6a6bb 100644 --- a/include/d/actor/d_a_obj_pdwall.h +++ b/include/d/actor/d_a_obj_pdwall.h @@ -26,7 +26,6 @@ public: int getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A8 */ Mtx field_0x5a8; /* 0x5D8 */ J3DModel* mpModels[10]; /* 0x600 */ Mtx field_0x600[10]; diff --git a/include/d/actor/d_a_obj_picture.h b/include/d/actor/d_a_obj_picture.h index 50d44d808b..af175f93e9 100644 --- a/include/d/actor/d_a_obj_picture.h +++ b/include/d/actor/d_a_obj_picture.h @@ -45,7 +45,6 @@ public: #endif static DUSK_GAME_DATA dCcD_SrcCyl s_CcDCyl_pic_at; -private: /* 0x574 */ dCcD_Stts field_0x574; /* 0x5B0 */ dCcD_Stts field_0x5b0; /* 0x5EC */ dCcD_Stts field_0x5ec; diff --git a/include/d/actor/d_a_obj_pleaf.h b/include/d/actor/d_a_obj_pleaf.h index 5e7a5cde1c..12f14a2bad 100644 --- a/include/d/actor/d_a_obj_pleaf.h +++ b/include/d/actor/d_a_obj_pleaf.h @@ -44,7 +44,7 @@ public: * */ class daObj_Pleaf_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_PLEAF_HIO_CLASS* mpHIO; /* 0x56C */ request_of_phase_process_class mPhaseReq; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_poCandle.h b/include/d/actor/d_a_obj_poCandle.h index defcdb7858..c76356d2df 100644 --- a/include/d/actor/d_a_obj_poCandle.h +++ b/include/d/actor/d_a_obj_poCandle.h @@ -48,7 +48,6 @@ public: u8 getIDNum() { return mIDNum; } void setFireFlag(u8 flag) { mFireFlag = flag; } -private: /* 0x5B8 */ request_of_phase_process_class mPhase; /* 0x5C0 */ J3DModel* mpModel; /* 0x5C4 */ cXyz mFirePos; diff --git a/include/d/actor/d_a_obj_poFire.h b/include/d/actor/d_a_obj_poFire.h index b8c9198b7c..10a91cbf34 100644 --- a/include/d/actor/d_a_obj_poFire.h +++ b/include/d/actor/d_a_obj_poFire.h @@ -68,7 +68,6 @@ public: u8 getMoveEnd() { return mMoveEnd; } u32 getID() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x584 */ request_of_phase_process_class mPhase; /* 0x58C */ int mStaffID; /* 0x590 */ s16 unk590; diff --git a/include/d/actor/d_a_obj_poTbox.h b/include/d/actor/d_a_obj_poTbox.h index 714f7338d3..44b18117e6 100644 --- a/include/d/actor/d_a_obj_poTbox.h +++ b/include/d/actor/d_a_obj_poTbox.h @@ -33,7 +33,6 @@ public: int getSw() { return fopAcM_GetParamBit(this, 0, 8); } int getStat() { return fopAcM_GetParamBit(this, 8, 4); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpBoxModel; /* 0x5AC */ J3DModel* mpAnimModel; diff --git a/include/d/actor/d_a_obj_prop.h b/include/d/actor/d_a_obj_prop.h index d61025630b..157f8dde6b 100644 --- a/include/d/actor/d_a_obj_prop.h +++ b/include/d/actor/d_a_obj_prop.h @@ -26,7 +26,6 @@ public: u32 getNameArg_0() { return fopAcM_GetParamBit(this, 0, 4); } u32 getArg_0() { return fopAcM_GetParamBit(this, 4, 4); } -private: /* 0x574 */ J3DModel* mpModel; /* 0x578 */ u8 mArg; }; diff --git a/include/d/actor/d_a_obj_pumpkin.h b/include/d/actor/d_a_obj_pumpkin.h index 9dd015c00e..74ba8f3026 100644 --- a/include/d/actor/d_a_obj_pumpkin.h +++ b/include/d/actor/d_a_obj_pumpkin.h @@ -56,7 +56,7 @@ public: * */ class daObj_Pumpkin_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_PUMPKIN_HIO_CLASS* mpHIO; /* 0x56C */ request_of_phase_process_class mPhaseReq; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_rcircle.h b/include/d/actor/d_a_obj_rcircle.h index 43811a0702..5ef1324f2c 100644 --- a/include/d/actor/d_a_obj_rcircle.h +++ b/include/d/actor/d_a_obj_rcircle.h @@ -25,7 +25,6 @@ public: int getSwBit() { return fopAcM_GetParamBit(this, 0, 8) & 0xFF; } -private: /* 0x574 */ mDoExt_brkAnm mBrk; /* 0x58C */ mDoExt_btkAnm mBtk; /* 0x5A4 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_rfHole.h b/include/d/actor/d_a_obj_rfHole.h index d053d6800c..00a873229c 100644 --- a/include/d/actor/d_a_obj_rfHole.h +++ b/include/d/actor/d_a_obj_rfHole.h @@ -42,7 +42,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_rope_bridge.h b/include/d/actor/d_a_obj_rope_bridge.h index 90532c9ba7..8eababd778 100644 --- a/include/d/actor/d_a_obj_rope_bridge.h +++ b/include/d/actor/d_a_obj_rope_bridge.h @@ -44,7 +44,6 @@ public: u8 getSwbit2() { return fopAcM_GetParamBit(this, 24, 8); } u8 getType() { return fopAcM_GetParamBit(this, 16, 2); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ request_of_phase_process_class mRopePhase; /* 0x5B0 */ J3DModel* mpBrgModel; diff --git a/include/d/actor/d_a_obj_rotTrap.h b/include/d/actor/d_a_obj_rotTrap.h index 9534358f4a..069bfe285c 100644 --- a/include/d/actor/d_a_obj_rotTrap.h +++ b/include/d/actor/d_a_obj_rotTrap.h @@ -37,7 +37,6 @@ public: static DUSK_GAME_DATA const dCcD_SrcGObjInf mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x05A0 */ request_of_phase_process_class mPhase; /* 0x05A8 */ J3DModel* mpModel; /* 0x05AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_roten.h b/include/d/actor/d_a_obj_roten.h index 9b4b17a19d..ea78731b77 100644 --- a/include/d/actor/d_a_obj_roten.h +++ b/include/d/actor/d_a_obj_roten.h @@ -25,7 +25,6 @@ public: char DUSK_CONST* getResName(); virtual ~daObj_Roten_c(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ JPABaseEmitter* mEmitters[2]; diff --git a/include/d/actor/d_a_obj_rstair.h b/include/d/actor/d_a_obj_rstair.h index 053692ba9e..6c31ff4648 100644 --- a/include/d/actor/d_a_obj_rstair.h +++ b/include/d/actor/d_a_obj_rstair.h @@ -58,7 +58,6 @@ public: u8 getEventID() { return fopAcM_GetParamBit(this, 0, 8); } void setAction(u8 action) { mAction = action; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ J3DModel* mWaterModels[2]; diff --git a/include/d/actor/d_a_obj_saidan.h b/include/d/actor/d_a_obj_saidan.h index ef38588f00..f421cf55ad 100644 --- a/include/d/actor/d_a_obj_saidan.h +++ b/include/d/actor/d_a_obj_saidan.h @@ -35,7 +35,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_sakuita.h b/include/d/actor/d_a_obj_sakuita.h index e9e4e82120..621084a592 100644 --- a/include/d/actor/d_a_obj_sakuita.h +++ b/include/d/actor/d_a_obj_sakuita.h @@ -45,7 +45,6 @@ public: static DUSK_GAME_DATA daObjSakuita_Attr_c const M_attr; -private: /* 0x568 */ J3DModel* mModel; /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_sakuita_rope.h b/include/d/actor/d_a_obj_sakuita_rope.h index dfbed5af0e..37df115ea9 100644 --- a/include/d/actor/d_a_obj_sakuita_rope.h +++ b/include/d/actor/d_a_obj_sakuita_rope.h @@ -82,7 +82,6 @@ public: static DUSK_GAME_DATA daObjItaRope_Attr_c const M_attr; -private: /* 0x570 */ mDoExt_3DlineMat1_c mLineMat; /* 0x5A4 */ request_of_phase_process_class mPhase; /* 0x5AC */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_scannon.h b/include/d/actor/d_a_obj_scannon.h index 0b1a79e18f..e376f55d40 100644 --- a/include/d/actor/d_a_obj_scannon.h +++ b/include/d/actor/d_a_obj_scannon.h @@ -83,7 +83,6 @@ public: 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; /* 0x57C */ request_of_phase_process_class mPtlPhase; /* 0x584 */ mDoExt_bckAnm mBck; diff --git a/include/d/actor/d_a_obj_scannon_crs.h b/include/d/actor/d_a_obj_scannon_crs.h index d7eb7c8121..12369f58fd 100644 --- a/include/d/actor/d_a_obj_scannon_crs.h +++ b/include/d/actor/d_a_obj_scannon_crs.h @@ -51,7 +51,6 @@ public: static DUSK_GAME_DATA void (daSCannonCrs_c::*s_exeProc[])(daMidna_c*); -private: /* 0x574 */ cXyz mPortalWaitPos; /* 0x580 */ dMsgFlow_c mMsgFlow; /* 0x5CC */ mDoExt_bckAnm mBck; diff --git a/include/d/actor/d_a_obj_scannon_ten.h b/include/d/actor/d_a_obj_scannon_ten.h index 7bc5b24ed8..ce6c840cfe 100644 --- a/include/d/actor/d_a_obj_scannon_ten.h +++ b/include/d/actor/d_a_obj_scannon_ten.h @@ -60,7 +60,6 @@ public: static DUSK_GAME_DATA const ExeProc s_exeProc[]; static DUSK_GAME_DATA const ExeProc s_demoExeProc[][2]; -private: /* 0x574 */ J3DModel* mpModel; /* 0x578 */ mDoExt_bckAnm mBck; /* 0x594 */ dBgW* mpBgW; diff --git a/include/d/actor/d_a_obj_sekidoor.h b/include/d/actor/d_a_obj_sekidoor.h index 46da5cb8a9..8f2791a673 100644 --- a/include/d/actor/d_a_obj_sekidoor.h +++ b/include/d/actor/d_a_obj_sekidoor.h @@ -59,7 +59,6 @@ public: void open() { mOpening = true; } bool chkDestroy() { return (mDestroyed == true); } -private: /* 0x5A0 */ OBJ_SEKIDOOR_HIO_CLASS* mpHIO; /* 0x5A4 */ request_of_phase_process_class mPhaseReq; /* 0x5AC */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_sekizo.h b/include/d/actor/d_a_obj_sekizo.h index 0f0847dc24..2011417a96 100644 --- a/include/d/actor/d_a_obj_sekizo.h +++ b/include/d/actor/d_a_obj_sekizo.h @@ -50,7 +50,6 @@ public: void initBaseMtx(); void setBaseMtx(); -private: /* 0x5A0 */ OBJ_SEKIZO_HIO_CLASS* mpHIO; /* 0x5A4 */ request_of_phase_process_class mPhaseReq; /* 0x5AC */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_shield.h b/include/d/actor/d_a_obj_shield.h index 11b4a2668d..248c26be5b 100644 --- a/include/d/actor/d_a_obj_shield.h +++ b/include/d/actor/d_a_obj_shield.h @@ -59,7 +59,6 @@ public: void setStatus(u8 status) { mStatus = status; } void setAction(u8 action) { mAction = action; } -private: /* 0x92C */ fpc_ProcID mItemId; /* 0x930 */ int mRotAngleCoeff; /* 0x934 */ u8 mStatus; diff --git a/include/d/actor/d_a_obj_sm_door.h b/include/d/actor/d_a_obj_sm_door.h index bec15a0ae8..7622ee0fa3 100644 --- a/include/d/actor/d_a_obj_sm_door.h +++ b/include/d/actor/d_a_obj_sm_door.h @@ -31,7 +31,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ bool mUseAlphaModel; /* 0x5A1 */ u8 field_0x5a1[0x5AC - 0x5A1]; /* 0x5AC */ s16 mMode; diff --git a/include/d/actor/d_a_obj_smallkey.h b/include/d/actor/d_a_obj_smallkey.h index 2becc9bae2..7bf38de4af 100644 --- a/include/d/actor/d_a_obj_smallkey.h +++ b/include/d/actor/d_a_obj_smallkey.h @@ -14,7 +14,7 @@ * */ class daKey_c : public daItemBase_c { -private: +public: void seStartTwinkle_private(u32); public: diff --git a/include/d/actor/d_a_obj_smgdoor.h b/include/d/actor/d_a_obj_smgdoor.h index aad2800ece..b22734b3e3 100644 --- a/include/d/actor/d_a_obj_smgdoor.h +++ b/include/d/actor/d_a_obj_smgdoor.h @@ -53,7 +53,6 @@ public: virtual int Draw(); virtual int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel[2]; /* 0x5B0 */ s16 field_0x5b0; diff --git a/include/d/actor/d_a_obj_smoke.h b/include/d/actor/d_a_obj_smoke.h index 61a3b56a51..abd172afbe 100644 --- a/include/d/actor/d_a_obj_smoke.h +++ b/include/d/actor/d_a_obj_smoke.h @@ -24,7 +24,6 @@ public: int execute(); int _delete(); -private: /* 0x568 */ JPABaseEmitter* mParticle; }; diff --git a/include/d/actor/d_a_obj_smtile.h b/include/d/actor/d_a_obj_smtile.h index 735914f0a0..c85000e7b8 100644 --- a/include/d/actor/d_a_obj_smtile.h +++ b/include/d/actor/d_a_obj_smtile.h @@ -41,7 +41,7 @@ public: * */ class daObj_SMTile_c : public fopAc_ac_c { -private: +public: /* 0x568 */ mDoExt_brkAnm mBrk; /* 0x580 */ OBJ_SMTILE_HIO_CLASS* mpHIO; /* 0x584 */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_smw_stone.h b/include/d/actor/d_a_obj_smw_stone.h index 02f58284ff..05913cd339 100644 --- a/include/d/actor/d_a_obj_smw_stone.h +++ b/include/d/actor/d_a_obj_smw_stone.h @@ -29,7 +29,6 @@ public: u8 getSwBit0() { return fopAcM_GetParamBit(this, 0, 8); } void deleteStone() { mDelete = true; } -private: /* 0x574 */ cBgS_PolyInfo mPolyInfo; /* 0x584 */ J3DModel* mpModel; /* 0x588 */ dBgW* mpBgW; diff --git a/include/d/actor/d_a_obj_snowEffTag.h b/include/d/actor/d_a_obj_snowEffTag.h index 748106cc81..bc995c749c 100644 --- a/include/d/actor/d_a_obj_snowEffTag.h +++ b/include/d/actor/d_a_obj_snowEffTag.h @@ -23,7 +23,6 @@ public: int getArg0() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ bool mPlayedSound; /* 0x56C */ f32 mMaxSize; diff --git a/include/d/actor/d_a_obj_snow_soup.h b/include/d/actor/d_a_obj_snow_soup.h index 91c23c8f85..3b96cd566f 100644 --- a/include/d/actor/d_a_obj_snow_soup.h +++ b/include/d/actor/d_a_obj_snow_soup.h @@ -28,7 +28,6 @@ public: void createSmkEmtChange(int); void deleteSmkEmtChange(int); -private: /* 0x574 */ cXyz mFirewoodPos; /* 0x580 */ cXyz mBubblePos; /* 0x58C */ JPABaseEmitter* mpSmkEmtCommon[4]; diff --git a/include/d/actor/d_a_obj_spinLift.h b/include/d/actor/d_a_obj_spinLift.h index 548df3f910..d2f0a50b03 100644 --- a/include/d/actor/d_a_obj_spinLift.h +++ b/include/d/actor/d_a_obj_spinLift.h @@ -40,7 +40,6 @@ public: u8 getTimer() { return (current.angle.x & 0xff00) >> 8; } int getEndSw() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 field_0x5ac; diff --git a/include/d/actor/d_a_obj_ss_base.h b/include/d/actor/d_a_obj_ss_base.h index 4d275a43cd..2101dd3237 100644 --- a/include/d/actor/d_a_obj_ss_base.h +++ b/include/d/actor/d_a_obj_ss_base.h @@ -18,7 +18,6 @@ public: u16 getValueNumber() { return mValueNum; } void setValueNumber(u16 valueNum) { mValueNum = valueNum; } -private: /* 0x56C */ void* mpParentPtr; /* 0x570 */ u16 field_0x570; /* 0x572 */ u16 mFlowNodeNum; diff --git a/include/d/actor/d_a_obj_ss_drink.h b/include/d/actor/d_a_obj_ss_drink.h index e49644f6b6..c4c0a1a72b 100644 --- a/include/d/actor/d_a_obj_ss_drink.h +++ b/include/d/actor/d_a_obj_ss_drink.h @@ -50,7 +50,6 @@ public: static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl DUSK_CONST mCcDCyl; -private: /* 0x578 */ mDoExt_btpAnm* mpBtpAnm; /* 0x57C */ mDoExt_brkAnm* mpBrkAnm; /* 0x580 */ u8 field_0x580; diff --git a/include/d/actor/d_a_obj_ss_item.h b/include/d/actor/d_a_obj_ss_item.h index cd219a1832..59f8f56407 100644 --- a/include/d/actor/d_a_obj_ss_item.h +++ b/include/d/actor/d_a_obj_ss_item.h @@ -49,7 +49,6 @@ public: 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; /* 0x580 */ J3DModel* mpModel; /* 0x584 */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_stairBlock.h b/include/d/actor/d_a_obj_stairBlock.h index 3d3b8d5283..1b04d0bcc1 100644 --- a/include/d/actor/d_a_obj_stairBlock.h +++ b/include/d/actor/d_a_obj_stairBlock.h @@ -26,7 +26,6 @@ public: static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; -private: /* 0x056C */ request_of_phase_process_class mPhaseReq; /* 0x0574 */ J3DModel* mpModel[10]; /* 0x059C */ mDoExt_bckAnm mBckAnm[10]; diff --git a/include/d/actor/d_a_obj_stick.h b/include/d/actor/d_a_obj_stick.h index ebc08e08b8..ce72273254 100644 --- a/include/d/actor/d_a_obj_stick.h +++ b/include/d/actor/d_a_obj_stick.h @@ -45,7 +45,7 @@ public: * */ class daObj_Stick_c : public fopAc_ac_c { -private: +public: /* 0x568 */ OBJ_STICK_HIO_CLASS* mpHIO; /* 0x56c */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_stone.h b/include/d/actor/d_a_obj_stone.h index b5f4da8c39..dfeb11f539 100644 --- a/include/d/actor/d_a_obj_stone.h +++ b/include/d/actor/d_a_obj_stone.h @@ -56,7 +56,6 @@ public: int draw(); int _delete(); -private: /* 0x0568 */ request_of_phase_process_class mPhase; /* 0x0570 */ J3DModel* mpModel; /* 0x0574 */ dBgS_ObjAcch mChkObj; diff --git a/include/d/actor/d_a_obj_stoneMark.h b/include/d/actor/d_a_obj_stoneMark.h index fbe56ce31d..04540fd9c7 100644 --- a/include/d/actor/d_a_obj_stoneMark.h +++ b/include/d/actor/d_a_obj_stoneMark.h @@ -23,7 +23,6 @@ public: int draw(); int _delete(); -private: /* 0x0568 */ request_of_phase_process_class mpPhase; /* 0x0570 */ TGXTexObj mTexObj; /* 0x0590 */ dBgS_ObjAcch mObjAcch; diff --git a/include/d/actor/d_a_obj_stopper.h b/include/d/actor/d_a_obj_stopper.h index 9a100c754b..62eda0ae39 100644 --- a/include/d/actor/d_a_obj_stopper.h +++ b/include/d/actor/d_a_obj_stopper.h @@ -59,7 +59,6 @@ public: u8 getSwNo() { return fopAcM_GetParamBit(this, 0, 8); } u8 getSwNo2() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x5A0 */ u8 field_0x5a0[8]; // unused /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_stopper2.h b/include/d/actor/d_a_obj_stopper2.h index 7ec86cb818..ccae3af298 100644 --- a/include/d/actor/d_a_obj_stopper2.h +++ b/include/d/actor/d_a_obj_stopper2.h @@ -35,7 +35,6 @@ public: u32 getSwbit() { return fopAcM_GetParamBit(this, 0, 8); } void setAction(u8 i_action) { mAction = i_action; } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ f32 mOffsetY; diff --git a/include/d/actor/d_a_obj_suisya.h b/include/d/actor/d_a_obj_suisya.h index c92146f5af..59067d84a4 100644 --- a/include/d/actor/d_a_obj_suisya.h +++ b/include/d/actor/d_a_obj_suisya.h @@ -20,7 +20,6 @@ public: int CreateHeap(); int create(); -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ u32 mShadowKey; diff --git a/include/d/actor/d_a_obj_swBallA.h b/include/d/actor/d_a_obj_swBallA.h index 1785565a4e..910c031050 100644 --- a/include/d/actor/d_a_obj_swBallA.h +++ b/include/d/actor/d_a_obj_swBallA.h @@ -41,7 +41,6 @@ public: void onFlag(u8 idx, u8 val) { field_0x5af[idx] |= val; } u8 checkFlag(u8 idx, u8 val) { return field_0x5af[idx] & val; } -private: /* 0x57C */ request_of_phase_process_class field_0x57c; /* 0x584 */ J3DModel* mModel; /* 0x588 */ mDoExt_btkAnm* field_0x588; diff --git a/include/d/actor/d_a_obj_swBallB.h b/include/d/actor/d_a_obj_swBallB.h index 31a7971232..31a8f4210e 100644 --- a/include/d/actor/d_a_obj_swBallB.h +++ b/include/d/actor/d_a_obj_swBallB.h @@ -44,7 +44,6 @@ public: void setLightOn() { field_0x5ac = 1; } void setLightOff() { field_0x5ad = 1; } -private: /* 0x57C */ request_of_phase_process_class field_0x57c; /* 0x584 */ J3DModel* mModel; /* 0x588 */ mDoExt_btkAnm* field_0x588; diff --git a/include/d/actor/d_a_obj_swLight.h b/include/d/actor/d_a_obj_swLight.h index 1a9fc50cca..9d84030e96 100644 --- a/include/d/actor/d_a_obj_swLight.h +++ b/include/d/actor/d_a_obj_swLight.h @@ -47,7 +47,6 @@ public: u8 getOnTime() { return fopAcM_GetParamBit(this, 16, 8); } u8 getEvent() { return (u8)field_0xb22; } -private: /* 0x5B0 */ request_of_phase_process_class mPhase; /* 0x5B8 */ J3DModel* mpModel; /* 0x6F4 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_swchain.h b/include/d/actor/d_a_obj_swchain.h index 270fb8f5ab..8bd68b4478 100644 --- a/include/d/actor/d_a_obj_swchain.h +++ b/include/d/actor/d_a_obj_swchain.h @@ -80,7 +80,6 @@ public: return FALSE; } -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ J3DModelData* mChainModelData; diff --git a/include/d/actor/d_a_obj_swhang.h b/include/d/actor/d_a_obj_swhang.h index 097da890b3..37ddbb3ea2 100644 --- a/include/d/actor/d_a_obj_swhang.h +++ b/include/d/actor/d_a_obj_swhang.h @@ -78,7 +78,6 @@ public: u16 checkFlag(u16 flag) { return mFlags & flag; } s16 getAngleY() { return shape_angle.y; } -private: /* 0x5B0 */ request_of_phase_process_class mPhase; /* 0x5B8 */ J3DModel* mpModel; /* 0x5BC */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_sword.h b/include/d/actor/d_a_obj_sword.h index 163175ddec..63bc7d576a 100644 --- a/include/d/actor/d_a_obj_sword.h +++ b/include/d/actor/d_a_obj_sword.h @@ -31,7 +31,6 @@ public: u8 getSwbit() { return fopAcM_GetParamBit(this, 8, 8); } void setStatus(u8 status) { mStatus = status; } -private: /* 0x92c */ u32 field_0x92c; /* 0x930 */ fpc_ProcID mProcID; /* 0x934 */ u8 mStatus; diff --git a/include/d/actor/d_a_obj_syRock.h b/include/d/actor/d_a_obj_syRock.h index 2c881585ed..3fa10456f8 100644 --- a/include/d/actor/d_a_obj_syRock.h +++ b/include/d/actor/d_a_obj_syRock.h @@ -46,7 +46,6 @@ public: static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5B8 */ request_of_phase_process_class mPhase; /* 0x5C0 */ J3DModel* mpModels[2]; /* 0x5C8 */ u8 mMode; diff --git a/include/d/actor/d_a_obj_szbridge.h b/include/d/actor/d_a_obj_szbridge.h index eff6a17a9c..8702506280 100644 --- a/include/d/actor/d_a_obj_szbridge.h +++ b/include/d/actor/d_a_obj_szbridge.h @@ -25,7 +25,6 @@ public: int Delete(); virtual ~daObjSZbridge_c() {} -private: /* 0x5A8 */ Mtx mBgMtx; /* 0x5D8 */ Mtx field_0x5d8; /* 0x608 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_obj_table.h b/include/d/actor/d_a_obj_table.h index cea036783c..44de1d1a47 100644 --- a/include/d/actor/d_a_obj_table.h +++ b/include/d/actor/d_a_obj_table.h @@ -27,7 +27,6 @@ public: s16 getMessageNo() { return fopAcM_GetParam(this) & 0xFFFF; } -private: /* 0x5A0 */ J3DModel* mpModel; /* 0x5A4 */ request_of_phase_process_class mPhaseReq; /* 0x5AC */ dMsgFlow_c mMsgFlow; diff --git a/include/d/actor/d_a_obj_takaraDai.h b/include/d/actor/d_a_obj_takaraDai.h index b745683dd6..657e032bcc 100644 --- a/include/d/actor/d_a_obj_takaraDai.h +++ b/include/d/actor/d_a_obj_takaraDai.h @@ -26,7 +26,6 @@ public: u32 getSwBit() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpBaseModel; /* 0x5AC */ J3DModel* mpTopModel; diff --git a/include/d/actor/d_a_obj_tgake.h b/include/d/actor/d_a_obj_tgake.h index 1871794df9..6862ad4979 100644 --- a/include/d/actor/d_a_obj_tgake.h +++ b/include/d/actor/d_a_obj_tgake.h @@ -28,7 +28,6 @@ public: u16 getEventBit2() { return fopAcM_GetParamBit(this, 10, 10); } u8 getType() { return fopAcM_GetParamBit(this, 0x14, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u16 mEventBit1; diff --git a/include/d/actor/d_a_obj_thashi.h b/include/d/actor/d_a_obj_thashi.h index 3796ee0629..1934b57c56 100644 --- a/include/d/actor/d_a_obj_thashi.h +++ b/include/d/actor/d_a_obj_thashi.h @@ -25,8 +25,6 @@ public: int Draw(); int Delete(); -// private: - /* 0x5A0 */ dBgW* unk5A0; /* 0x5A4 */ u32 unk5A4; /* 0x5A8 */ u32 unk5A8; diff --git a/include/d/actor/d_a_obj_timeFire.h b/include/d/actor/d_a_obj_timeFire.h index 62fb3460d9..0b7a5ab5ec 100644 --- a/include/d/actor/d_a_obj_timeFire.h +++ b/include/d/actor/d_a_obj_timeFire.h @@ -28,7 +28,6 @@ public: u8 getEndTime() { return fopAcM_GetParamBit(this, 16, 8); } u8 getScale() { return fopAcM_GetParamBit(this, 24, 8); } -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 field_0x569; /* 0x56A */ u8 mStartTime; diff --git a/include/d/actor/d_a_obj_timer.h b/include/d/actor/d_a_obj_timer.h index 120a23b3a9..5778bf5ca1 100644 --- a/include/d/actor/d_a_obj_timer.h +++ b/include/d/actor/d_a_obj_timer.h @@ -54,7 +54,6 @@ class Act_c : public fopAc_ac_c { return daObj::PrmAbstract(this, PRM_2, PRM_24); } - private: /* 0x568 */ int field_0x568; /* 0x56C */ int field_0x56c; /* 0x570 */ u8 field_0x570; diff --git a/include/d/actor/d_a_obj_tmoon.h b/include/d/actor/d_a_obj_tmoon.h index 4bf3c3620c..2992316782 100644 --- a/include/d/actor/d_a_obj_tmoon.h +++ b/include/d/actor/d_a_obj_tmoon.h @@ -25,7 +25,6 @@ public: u32 getEventBit1() { return fopAcM_GetParamBit(this, 0, 10); } u32 getEventBit2() { return fopAcM_GetParamBit(this, 10, 10); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ u16 field_0x574; diff --git a/include/d/actor/d_a_obj_toaru_maki.h b/include/d/actor/d_a_obj_toaru_maki.h index 4f7e8d2645..d980f9410f 100644 --- a/include/d/actor/d_a_obj_toaru_maki.h +++ b/include/d/actor/d_a_obj_toaru_maki.h @@ -25,7 +25,6 @@ public: u32 getNameArg_0() { return fopAcM_GetParamBit(this, 0, 4); } -private: /* 0x574 */ J3DModel* mpModel; /* 0x578 */ dBgW* mpBgW; /* 0x57C */ Mtx mMtx; diff --git a/include/d/actor/d_a_obj_togeTrap.h b/include/d/actor/d_a_obj_togeTrap.h index 4055d6a42e..a67451ea0a 100644 --- a/include/d/actor/d_a_obj_togeTrap.h +++ b/include/d/actor/d_a_obj_togeTrap.h @@ -47,7 +47,6 @@ public: static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; -private: /* 0x5A0 */ dCcD_Stts mStts; /* 0x5DC */ dCcD_Cyl mCyls[4]; /* 0xACC */ request_of_phase_process_class mPhase; diff --git a/include/d/actor/d_a_obj_tombo.h b/include/d/actor/d_a_obj_tombo.h index 5dfdcb6451..288d35611e 100644 --- a/include/d/actor/d_a_obj_tombo.h +++ b/include/d/actor/d_a_obj_tombo.h @@ -48,7 +48,6 @@ public: inline int Draw(); -private: /* 0x590 */ dCcD_Stts mStts; /* 0x5CC */ dCcD_Sph mSph; /* 0x704 */ daPy_boomerangMove_c mBoomerangMove; diff --git a/include/d/actor/d_a_obj_tornado.h b/include/d/actor/d_a_obj_tornado.h index 30e8e2c1e3..c3330d73f9 100644 --- a/include/d/actor/d_a_obj_tornado.h +++ b/include/d/actor/d_a_obj_tornado.h @@ -30,7 +30,6 @@ public: u8 getTimer() { return fopAcM_GetParamBit(this, 0, 8); } u8 getSwbit() { return fopAcM_GetParamBit(this, 0x18, 8); } -private: /* 0x568 */ dCcD_Stts mStts; /* 0x5A4 */ dCcD_Cps mCps; /* 0x6E8 */ cM3dGCpsS mWindCps; diff --git a/include/d/actor/d_a_obj_twGate.h b/include/d/actor/d_a_obj_twGate.h index 683a7f18fb..0a00c2b834 100644 --- a/include/d/actor/d_a_obj_twGate.h +++ b/include/d/actor/d_a_obj_twGate.h @@ -23,7 +23,6 @@ public: int getGateType() { return fopAcM_GetParamBit(this, 4, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel; /* 0x5AC */ mDoExt_btkAnm mBtk; diff --git a/include/d/actor/d_a_obj_vground.h b/include/d/actor/d_a_obj_vground.h index fed893aef1..bd9e266ebf 100644 --- a/include/d/actor/d_a_obj_vground.h +++ b/include/d/actor/d_a_obj_vground.h @@ -24,7 +24,6 @@ public: u32 getSwbit() { return (u8) fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ mDoExt_btkAnm* mpBtk; diff --git a/include/d/actor/d_a_obj_volcball.h b/include/d/actor/d_a_obj_volcball.h index ddd299a26e..cb1e895e8f 100644 --- a/include/d/actor/d_a_obj_volcball.h +++ b/include/d/actor/d_a_obj_volcball.h @@ -113,7 +113,6 @@ public: void setAction(u8 i_action) { mMode = i_action; } -private: /* 0x057C */ request_of_phase_process_class mPhase; /* 0x0584 */ dBgS_AcchCir mAcchCir; /* 0x05C4 */ dCcD_Stts mCcStts; diff --git a/include/d/actor/d_a_obj_volcbom.h b/include/d/actor/d_a_obj_volcbom.h index 17f9db911d..60401dca2d 100644 --- a/include/d/actor/d_a_obj_volcbom.h +++ b/include/d/actor/d_a_obj_volcbom.h @@ -84,7 +84,6 @@ public: u8 getArg0() { return fopAcM_GetParamBit(this, 16, 8); } u16 getMsgID() { return mMsgID; } -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mModel1; /* 0x5AC */ mDoExt_btkAnm* mBtk1; diff --git a/include/d/actor/d_a_obj_waterGate.h b/include/d/actor/d_a_obj_waterGate.h index 66a076be78..ae81773aec 100644 --- a/include/d/actor/d_a_obj_waterGate.h +++ b/include/d/actor/d_a_obj_waterGate.h @@ -33,7 +33,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 mMode; diff --git a/include/d/actor/d_a_obj_waterPillar.h b/include/d/actor/d_a_obj_waterPillar.h index 19b55971e8..987abc3923 100644 --- a/include/d/actor/d_a_obj_waterPillar.h +++ b/include/d/actor/d_a_obj_waterPillar.h @@ -76,7 +76,6 @@ public: mStartStalactiteShake = false; } -private: /* 0x584 */ request_of_phase_process_class mPhase; /* 0x58C */ J3DModel* mpModel; /* 0x590 */ mDoExt_btkAnm mVTexScrollAnm; diff --git a/include/d/actor/d_a_obj_waterfall.h b/include/d/actor/d_a_obj_waterfall.h index e7c143910d..7a69938455 100644 --- a/include/d/actor/d_a_obj_waterfall.h +++ b/include/d/actor/d_a_obj_waterfall.h @@ -24,7 +24,6 @@ public: void push_player(); int draw(); int _delete(); -private: /* 0x568 */ request_of_phase_process_class mPhase; /* 0x570 */ u8 pad[4]; /* 0x574 */ dCcD_Stts mCylColliderStts; diff --git a/include/d/actor/d_a_obj_wchain.h b/include/d/actor/d_a_obj_wchain.h index b9f791d058..d9377d327a 100644 --- a/include/d/actor/d_a_obj_wchain.h +++ b/include/d/actor/d_a_obj_wchain.h @@ -57,7 +57,6 @@ public: mDown = true; } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpHandleModel; /* 0x574 */ J3DModelData* mpChainModelData; diff --git a/include/d/actor/d_a_obj_wdStick.h b/include/d/actor/d_a_obj_wdStick.h index 08bc2a1faf..e68f5a4a8e 100644 --- a/include/d/actor/d_a_obj_wdStick.h +++ b/include/d/actor/d_a_obj_wdStick.h @@ -53,7 +53,6 @@ public: static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; -private: /* 0x56C */ request_of_phase_process_class mPhase; /* 0x574 */ J3DModel* mModel; /* 0x578 */ u8 mMode; diff --git a/include/d/actor/d_a_obj_well_cover.h b/include/d/actor/d_a_obj_well_cover.h index b25ad59abe..f4fb2250d0 100644 --- a/include/d/actor/d_a_obj_well_cover.h +++ b/include/d/actor/d_a_obj_well_cover.h @@ -29,7 +29,6 @@ public: u8 getSwNo() { return fopAcM_GetParam(this); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ u8 field_0x5AC[0x5B0 - 0x5AC]; diff --git a/include/d/actor/d_a_obj_wind_stone.h b/include/d/actor/d_a_obj_wind_stone.h index f5e52dfc94..107cecc92c 100644 --- a/include/d/actor/d_a_obj_wind_stone.h +++ b/include/d/actor/d_a_obj_wind_stone.h @@ -36,7 +36,6 @@ public: u32 getSwBit2() { return fopAcM_GetParamBit(this, 8, 8); } u32 getDelEveFlgId() { return fopAcM_GetParamBit(this, 0x10, 0x10); } -private: /* 0x574 */ cBgS_PolyInfo mPolyInfo; /* 0x584 */ J3DModel* mpModel; /* 0x588 */ dBgW* mpBgW; diff --git a/include/d/actor/d_a_obj_window.h b/include/d/actor/d_a_obj_window.h index 83b62740a4..8d1b0412d7 100644 --- a/include/d/actor/d_a_obj_window.h +++ b/include/d/actor/d_a_obj_window.h @@ -27,7 +27,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 0, 8); } u8 getLightInf() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x5A0 */ request_of_phase_process_class mPhaseReq; /* 0x5A8 */ J3DModel* mpModel; /* 0x5AC */ mDoExt_bckAnm* mpBckAnm; diff --git a/include/d/actor/d_a_obj_wood_pendulum.h b/include/d/actor/d_a_obj_wood_pendulum.h index 1a1ee024b3..9ee5126ad8 100644 --- a/include/d/actor/d_a_obj_wood_pendulum.h +++ b/include/d/actor/d_a_obj_wood_pendulum.h @@ -26,7 +26,6 @@ public: u32 getArg0() { return fopAcM_GetParamBit(this, 0, 8); } u32 getArg1() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ dCcD_Stts mStts; diff --git a/include/d/actor/d_a_obj_wood_statue.h b/include/d/actor/d_a_obj_wood_statue.h index c0214679db..3ddd94bc62 100644 --- a/include/d/actor/d_a_obj_wood_statue.h +++ b/include/d/actor/d_a_obj_wood_statue.h @@ -52,7 +52,6 @@ public: void setStatus(u8 status) { mStatus = status; } u8 getSwbit2() { return fopAcM_GetParamBit(this, 8, 8); } -private: /* 0x92C */ fpc_ProcID mItemId; /* 0x930 */ int field_0x930; /* 0x934 */ int mStaffIdx; diff --git a/include/d/actor/d_a_obj_wsword.h b/include/d/actor/d_a_obj_wsword.h index aa611af336..2860313c19 100644 --- a/include/d/actor/d_a_obj_wsword.h +++ b/include/d/actor/d_a_obj_wsword.h @@ -25,7 +25,6 @@ public: int draw(); int _delete(); -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ J3DModel* mpModel; /* 0x574 */ dBgS_ObjAcch mAcch; diff --git a/include/d/actor/d_a_obj_yel_bag.h b/include/d/actor/d_a_obj_yel_bag.h index caeba24ae5..9c3f452a11 100644 --- a/include/d/actor/d_a_obj_yel_bag.h +++ b/include/d/actor/d_a_obj_yel_bag.h @@ -53,7 +53,7 @@ public: * */ class daObj_YBag_c : public fopAc_ac_c { -private: +public: /* 0x568 */ request_of_phase_process_class mPhases[3]; /* 0x580 */ J3DModel* mModel; /* 0x584 */ OBJ_YBAG_HIO_CLASS* mpHIO; diff --git a/include/d/actor/d_a_obj_yobikusa.h b/include/d/actor/d_a_obj_yobikusa.h index a3dfa944fa..ed1019c7ad 100644 --- a/include/d/actor/d_a_obj_yobikusa.h +++ b/include/d/actor/d_a_obj_yobikusa.h @@ -87,7 +87,6 @@ public: return var_r31 > 0; } -private: /* 0x568 */ J3DModel* mpActiveModel; /* 0x56C */ J3DModel* mpModelTypeA; /* 0x570 */ J3DModel* mpModelTypeB; diff --git a/include/d/actor/d_a_obj_zrTurara.h b/include/d/actor/d_a_obj_zrTurara.h index 679ae20635..c52a21f2cc 100644 --- a/include/d/actor/d_a_obj_zrTurara.h +++ b/include/d/actor/d_a_obj_zrTurara.h @@ -29,7 +29,6 @@ public: int Draw(); int Delete(); -private: /* 0x5A0 */ dCcD_Stts mCcStatus; /* 0x5DC */ dCcD_Cyl mCcCyl; /* 0x718 */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_zrTuraraRock.h b/include/d/actor/d_a_obj_zrTuraraRock.h index 1f92de6e82..922948ee9c 100644 --- a/include/d/actor/d_a_obj_zrTuraraRock.h +++ b/include/d/actor/d_a_obj_zrTuraraRock.h @@ -30,7 +30,6 @@ public: int Draw(); int Delete(); -private: /* 0x568 */ dCcD_Stts mCcStatus; /* 0x5A4 */ dCcD_Sph mCcSph; /* 0x6DC */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_obj_zra_rock.h b/include/d/actor/d_a_obj_zra_rock.h index 586fc176c5..925c49a5ee 100644 --- a/include/d/actor/d_a_obj_zra_rock.h +++ b/include/d/actor/d_a_obj_zra_rock.h @@ -28,7 +28,6 @@ public: void setDemoStart() { mDemoStart = 1; } -private: friend class daNpc_zrZ_c; /* 0x5A0 */ request_of_phase_process_class mPhaseReq; diff --git a/include/d/actor/d_a_passer_mng.h b/include/d/actor/d_a_passer_mng.h index ced02d9d1d..a3aa50db35 100644 --- a/include/d/actor/d_a_passer_mng.h +++ b/include/d/actor/d_a_passer_mng.h @@ -259,7 +259,6 @@ public: static DUSK_GAME_DATA const Group* mGroupTbl[4]; -private: /* 0x568 */ fpc_ProcID* childProcIds; /* 0x56C */ dPath* mPath; /* 0x570 */ int startTime; diff --git a/include/d/actor/d_a_peru.h b/include/d/actor/d_a_peru.h index 771e879b10..8a997b7a85 100644 --- a/include/d/actor/d_a_peru.h +++ b/include/d/actor/d_a_peru.h @@ -189,7 +189,6 @@ public: static DUSK_GAME_DATA const char* mCutNameList[3]; static DUSK_GAME_DATA cutAppearFunc mCutList[3]; -private: /* 0x0E40 */ daNpcT_ActorMngr_c mActors[3]; /* 0x0E58 */ int field_0xe58; /* 0x0E5C */ actionFunc mActionFunc; diff --git a/include/d/actor/d_a_player.h b/include/d/actor/d_a_player.h index 66139b54cf..ff8a165ef8 100644 --- a/include/d/actor/d_a_player.h +++ b/include/d/actor/d_a_player.h @@ -25,7 +25,6 @@ public: mNowSetFlg = 0; } -private: /* 0x14 */ u16 mEndFlg; /* 0x16 */ u16 mNowSetFlg; }; @@ -70,7 +69,6 @@ public: static DUSK_GAME_DATA s16 m_dropAngleY; static DUSK_GAME_DATA s16 m_eventKeepFlg; -private: /* 0x0 */ u8 field_0x0; /* 0x2 */ s16 field_0x2; /* 0x4 */ f32 m_offsetY; @@ -91,6 +89,14 @@ private: #define PLAYER_CREATE_ANM_HEAP(heap, type, name) (heap).createHeap(type) #endif +#if TARGET_PC +inline u32 daPy_getAnmResourceSize(u16 i_resId, u32 i_minSize) { + JKRArchive* archive = dComIfGp_getAnmArchive(); + u32 size = archive->getFileSize(archive->findIdxResource(i_resId)); + return size > i_minSize ? size : i_minSize; +} +#endif + class daPy_anmHeap_c { public: enum daAlinkHEAP_TYPE { @@ -107,6 +113,9 @@ public: void* mallocBuffer(); #if TARGET_PC void createHeap(daAlinkHEAP_TYPE i_heapType, const char* name); + void reserveBuffer(u16 i_resId); + void* allocTempBuffer(u16 i_resId, u32* io_size); + void freeTempBuffers(); #else void createHeap(daAlinkHEAP_TYPE i_heapType); #endif @@ -136,6 +145,10 @@ public: /* 0x08 */ u32 mBufferSize; /* 0x0C */ u8* mBuffer; /* 0x10 */ JKRSolidHeap* mAnimeHeap; +#if TARGET_PC + u8* mOwnedBuffer = NULL; + void** mTempBuffers = NULL; +#endif }; // Size = 0x14 class daPy_actorKeep_c { @@ -151,7 +164,6 @@ public: fopAc_ac_c* getActor() const { return mActor; } fopAc_ac_c* getActorConst() const { return mActor; } -private: /* 0x0 */ fpc_ProcID mID; /* 0x4 */ fopAc_ac_c* mActor; }; // Size: 0x8 @@ -296,7 +308,6 @@ public: void resetDemoType() { setDemoType(0); } void setStartDemoType() { setDemoType(DEMO_TYPE_START_e); } -private: /* 0x00 */ u16 mDemoType; /* 0x02 */ s16 mDemoMoveAngle; /* 0x04 */ s16 mTimer; @@ -311,9 +322,11 @@ private: class daMidna_c; class daSpinner_c; class daPy_py_c; +#if !TARGET_PC inline daPy_py_c* dComIfGp_getLinkPlayer(); inline BOOL dComIfGs_isEventBit(const u16); inline u32 dComIfGs_getLastSceneMode(); +#endif class daPy_py_c : public fopAc_ac_c { public: diff --git a/include/d/actor/d_a_ppolamp.h b/include/d/actor/d_a_ppolamp.h index f1e1a9f26d..d55754d97b 100644 --- a/include/d/actor/d_a_ppolamp.h +++ b/include/d/actor/d_a_ppolamp.h @@ -25,7 +25,6 @@ public: void moveSwing(); void initParam(); -private: /* 0x574 */ J3DModel* mModel1; /* 0x578 */ J3DModel* mModel2; /* 0x57C */ mDoExt_bckAnm mBck; diff --git a/include/d/actor/d_a_spinner.h b/include/d/actor/d_a_spinner.h index 1dac4594a3..0ef81f3947 100644 --- a/include/d/actor/d_a_spinner.h +++ b/include/d/actor/d_a_spinner.h @@ -99,7 +99,6 @@ public: void forceDelete() { mDeleteFlg = true; } -private: /* 0x568 */ J3DModel* mpModel; /* 0x56C */ mDoExt_bckAnm mBck; /* 0x588 */ J3DAnmTransform* mpSpoutBck; diff --git a/include/d/actor/d_a_swBall.h b/include/d/actor/d_a_swBall.h index 74bfa90593..df4877e04b 100644 --- a/include/d/actor/d_a_swBall.h +++ b/include/d/actor/d_a_swBall.h @@ -30,7 +30,6 @@ public: u8 getType() { return fopAcM_GetParamBit(this, 24, 4); } bool checkPullLBall() { return fopAcM_GetParamBit(this, 28, 2) == 0; } -private: /* 0x568 */ fpc_ProcID mBallIDs[8]; /* 0x588 */ u8 mTimer; /* 0x589 */ u8 mAction; diff --git a/include/d/actor/d_a_swLBall.h b/include/d/actor/d_a_swLBall.h index 0a633fcb5b..c3d132a40f 100644 --- a/include/d/actor/d_a_swLBall.h +++ b/include/d/actor/d_a_swLBall.h @@ -42,7 +42,6 @@ public: return fopAcM_GetParamBit(this,28,2) == 0; } -private: /* 0x568 */ fpc_ProcID mProcIds[2]; /* 0x570 */ u8 mRunTimer; /* 0x571 */ u8 mAction; diff --git a/include/d/actor/d_a_swTime.h b/include/d/actor/d_a_swTime.h index b3b96fa104..f61d5a5e7f 100644 --- a/include/d/actor/d_a_swTime.h +++ b/include/d/actor/d_a_swTime.h @@ -30,7 +30,6 @@ public: int execute(); int _delete(); -private: /* 0x568 */ u8 mTime; /* 0x569 */ u8 mSwbit; /* 0x56A */ u8 mSwbit2; diff --git a/include/d/actor/d_a_tag_CstaSw.h b/include/d/actor/d_a_tag_CstaSw.h index b40a9d178e..e73fd18662 100644 --- a/include/d/actor/d_a_tag_CstaSw.h +++ b/include/d/actor/d_a_tag_CstaSw.h @@ -16,7 +16,6 @@ public: u32 getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x568 */ u8 mSwitch; /* 0x569 */ u8 unused[0x570 - 0x569]; diff --git a/include/d/actor/d_a_tag_TWgate.h b/include/d/actor/d_a_tag_TWgate.h index 1886690db2..683d01449b 100644 --- a/include/d/actor/d_a_tag_TWgate.h +++ b/include/d/actor/d_a_tag_TWgate.h @@ -118,7 +118,6 @@ public: #endif static DUSK_GAME_DATA const actionFunc ActionTable[][2]; -private: /* 0x568 */ mDoExt_McaMorfSO* mpMorf; /* 0x56C */ request_of_phase_process_class mPhaseZevArc; /* 0x574 */ request_of_phase_process_class mPhaseMdRes; diff --git a/include/d/actor/d_a_tag_bottle_item.h b/include/d/actor/d_a_tag_bottle_item.h index cd122c8cad..3cc2a274d4 100644 --- a/include/d/actor/d_a_tag_bottle_item.h +++ b/include/d/actor/d_a_tag_bottle_item.h @@ -8,7 +8,7 @@ class daTag_BottleItem_c; typedef int (daTag_BottleItem_c::*ProcessFunc)(void*); class daTag_BottleItem_c : public fopAc_ac_c { -private: +public: /* 0x0568 */ ProcessFunc mProcessFunc; /* 0x056C */ u16 mEventType; /* 0x0576 */ u8 mBottleItemType; diff --git a/include/d/actor/d_a_tag_chkpoint.h b/include/d/actor/d_a_tag_chkpoint.h index 4871ec3946..51fa95e17d 100644 --- a/include/d/actor/d_a_tag_chkpoint.h +++ b/include/d/actor/d_a_tag_chkpoint.h @@ -45,7 +45,6 @@ public: return cPhs_COMPLEATE_e; } -private: /* 0x568 */ u8 field_0x568[8]; /* 0x570 */ cXyz mVtxA; /* 0x57C */ cXyz mVtxB; diff --git a/include/d/actor/d_a_tag_evtarea.h b/include/d/actor/d_a_tag_evtarea.h index 4bf0ec404e..f83e034aa1 100644 --- a/include/d/actor/d_a_tag_evtarea.h +++ b/include/d/actor/d_a_tag_evtarea.h @@ -45,7 +45,6 @@ public: void noEffect() { field_0x56c = 1; } -private: /* 0x568 vtable */ /* 0x56C */ u8 field_0x56c; }; diff --git a/include/d/actor/d_a_tag_lv6CstaSw.h b/include/d/actor/d_a_tag_lv6CstaSw.h index 17b58e4b28..384d9bd6d9 100644 --- a/include/d/actor/d_a_tag_lv6CstaSw.h +++ b/include/d/actor/d_a_tag_lv6CstaSw.h @@ -16,7 +16,6 @@ public: u32 getSw() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x568 */ u8 mSwitch; /* 0x569 */ u8 unused[0x570 - 0x569]; }; diff --git a/include/d/actor/d_a_tag_mhint.h b/include/d/actor/d_a_tag_mhint.h index e4c5260079..c573467ae0 100644 --- a/include/d/actor/d_a_tag_mhint.h +++ b/include/d/actor/d_a_tag_mhint.h @@ -26,7 +26,6 @@ public: NULL); } -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 mSwitch; /* 0x56A */ u8 field_0x56a; diff --git a/include/d/actor/d_a_tag_mmsg.h b/include/d/actor/d_a_tag_mmsg.h index 9fdd0b3c66..bcafa0c37d 100644 --- a/include/d/actor/d_a_tag_mmsg.h +++ b/include/d/actor/d_a_tag_mmsg.h @@ -14,7 +14,6 @@ public: void onUseFlg() { mUseFlg = true; } bool checkNoAttention() const { return mAttention == 0xFF; } -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 field_0x569; /* 0x56A */ u8 mAttention; diff --git a/include/d/actor/d_a_tag_mstop.h b/include/d/actor/d_a_tag_mstop.h index dd27dbb005..774af17007 100644 --- a/include/d/actor/d_a_tag_mstop.h +++ b/include/d/actor/d_a_tag_mstop.h @@ -17,7 +17,6 @@ public: int execute(); bool checkNoAttention() const { return field_0x56b == 0xFF; } -private: /* 0x568 */ u8 field_0x568; /* 0x569 */ u8 mSwitch; /* 0x56A */ u8 field_0x56a; diff --git a/include/d/actor/d_a_tag_myna2.h b/include/d/actor/d_a_tag_myna2.h index 7eecb0c1d7..70605612e3 100644 --- a/include/d/actor/d_a_tag_myna2.h +++ b/include/d/actor/d_a_tag_myna2.h @@ -12,7 +12,6 @@ public: int getMode() { return fopAcM_GetParam(this) & 0xFF; } f32 getExtent() { return scale.x * 100.0f;} -private: /* 0x568 */ u32 mSwitchNo; /* 0x56C */ u32 mMode; /* 0x570 */ s16 mTimer; diff --git a/include/d/actor/d_a_tag_setBall.h b/include/d/actor/d_a_tag_setBall.h index 6e75928c6b..0619e2a677 100644 --- a/include/d/actor/d_a_tag_setBall.h +++ b/include/d/actor/d_a_tag_setBall.h @@ -16,7 +16,6 @@ public: s32 getType() { return mType; } -private: u8 getType_private() { return fopAcM_GetParamBit(this, 8, 4); } /* 0x568 */ u8 mType; diff --git a/include/d/actor/d_a_tag_statue_evt.h b/include/d/actor/d_a_tag_statue_evt.h index 1bdc0d4f52..59237c09eb 100644 --- a/include/d/actor/d_a_tag_statue_evt.h +++ b/include/d/actor/d_a_tag_statue_evt.h @@ -25,7 +25,6 @@ public: int draw(); int _delete(); -private: /* 0x568 */ request_of_phase_process_class mArcPhase; /* 0x570 */ request_of_phase_process_class mEvArcPhase; /* 0x578 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_tag_telop.h b/include/d/actor/d_a_tag_telop.h index 6e28231138..0d6fbeb7a1 100644 --- a/include/d/actor/d_a_tag_telop.h +++ b/include/d/actor/d_a_tag_telop.h @@ -13,7 +13,6 @@ public: u16 getMessageNo() { return home.angle.z; } -private: /* 0x568 */ u16 mMessageNo; /* 0x56C */ int mMessageStatus; }; diff --git a/include/d/actor/d_a_tag_waterfall.h b/include/d/actor/d_a_tag_waterfall.h index 80ffe7bec2..6076e53042 100644 --- a/include/d/actor/d_a_tag_waterfall.h +++ b/include/d/actor/d_a_tag_waterfall.h @@ -22,7 +22,6 @@ public: int _delete(); cPhs_Step create(); -private: /* 0x568 */ f32 mCylinderRadiusA; /* 0x56C */ f32 mCylinderRadiusB; /* 0x570 */ f32 mCylinderHeight; diff --git a/include/d/actor/d_a_tag_yami.h b/include/d/actor/d_a_tag_yami.h index 8410899186..fc17586688 100644 --- a/include/d/actor/d_a_tag_yami.h +++ b/include/d/actor/d_a_tag_yami.h @@ -36,7 +36,6 @@ public: void setCoR(f32 i_value) { mCoR = i_value; } void setCoH(f32 i_value) { mCoH = i_value; } -private: /* 0x568 */ dCcD_Cyl mCyl; /* 0x6A4 */ dCcD_Stts mStts; /* 0x6E0 */ u8 mCoHitValid; diff --git a/include/d/actor/d_a_talk.h b/include/d/actor/d_a_talk.h index 9c86f88610..b7715d88cd 100644 --- a/include/d/actor/d_a_talk.h +++ b/include/d/actor/d_a_talk.h @@ -22,7 +22,6 @@ public: u16 getStatus(); u32 messageSet(); -private: /* 0x568 */ dMsgFlow_c mMsgFlow; /* 0x5B4 */ u32 mMessageID; }; diff --git a/include/d/actor/d_a_tbox.h b/include/d/actor/d_a_tbox.h index 6d0528d29d..6b07594577 100644 --- a/include/d/actor/d_a_tbox.h +++ b/include/d/actor/d_a_tbox.h @@ -148,7 +148,6 @@ public: field_0x9fc = 1; } -private: /* 0x718 */ u8 field_0x718; /* 0x71C */ request_of_phase_process_class mPhase; /* 0x724 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_tbox2.h b/include/d/actor/d_a_tbox2.h index 9b06e685a3..29df2d8389 100644 --- a/include/d/actor/d_a_tbox2.h +++ b/include/d/actor/d_a_tbox2.h @@ -67,7 +67,6 @@ public: u8 getModelType() { return fopAcM_GetParamBit(this, 8, 4); } u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); } -private: /* 0x718 */ u8 mReturnRupee; /* 0x71C */ request_of_phase_process_class mPhase; /* 0x724 */ J3DModel* mpModel; diff --git a/include/d/actor/d_a_title.h b/include/d/actor/d_a_title.h index 465fe689c1..691e2df3e3 100644 --- a/include/d/actor/d_a_title.h +++ b/include/d/actor/d_a_title.h @@ -50,7 +50,6 @@ public: void KeyWaitPosMove(); #endif -private: /* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x570 */ JKRHeap* mpHeap; /* 0x574 */ J3DModel* mpModel; diff --git a/include/d/d_a_shop_item_static.h b/include/d/d_a_shop_item_static.h index 7126578092..e79973fc65 100644 --- a/include/d/d_a_shop_item_static.h +++ b/include/d/d_a_shop_item_static.h @@ -107,7 +107,6 @@ public: SHOP_ITEMNO_MAX, }; -private: /* 0x92C */ Mtx mMtx; /* 0x95C */ int field_0x95c; /* 0x960 */ s16 mAngleX; diff --git a/include/d/d_attention.h b/include/d/d_attention.h index 8e3b8be1f5..b1c269651f 100644 --- a/include/d/d_attention.h +++ b/include/d/d_attention.h @@ -18,7 +18,6 @@ public: fopAc_ac_c* getZHintTarget() { return convPId(field_0x8); } -private: /* 0x0 */ fpc_ProcID mHintActorID; /* 0x4 */ int mPriority; /* 0x8 */ fpc_ProcID field_0x8; @@ -34,7 +33,6 @@ public: fopAc_ac_c* getCatghTarget() { return convPId(mCatghTargetID); } u8 getChangeItem() { return mChangeItem; } -private: /* 0x00 */ fpc_ProcID mRequestActorID; /* 0x04 */ int field_0x4; /* 0x08 */ f32 mDistance; @@ -120,7 +118,6 @@ public: fopAc_ac_c* getLookTarget() { return convPId(mLookTargetID); } -private: fpc_ProcID mRequestActorID; int field_0x4; f32 mDistance; diff --git a/include/d/d_bg_plc.h b/include/d/d_bg_plc.h index da360fd0e4..f5361ff883 100644 --- a/include/d/d_bg_plc.h +++ b/include/d/d_bg_plc.h @@ -20,7 +20,6 @@ public: static const int ZELDA_CODE_SIZE = sizeof(sBgPc); -private: /* 0x00 */ sBgPlc* m_base; }; diff --git a/include/d/d_bg_s_acch.h b/include/d/d_bg_s_acch.h index 04a388c61b..a1a1517cc4 100644 --- a/include/d/d_bg_s_acch.h +++ b/include/d/d_bg_s_acch.h @@ -13,7 +13,7 @@ class fopAc_ac_c; class dBgS_AcchCir : public cBgS_PolyInfo { -private: +public: /* 0x10 */ u32 m_flags; /* 0x14 */ cM3dGCir m_cir; /* 0x28 */ f32 m_wall_rr; @@ -197,7 +197,6 @@ public: f32 GetCx() const { return pm_pos->x; } f32 GetCz() const { return pm_pos->z; } -private: /* 0x02C */ u32 m_flags; /* 0x030 */ cXyz* pm_pos; /* 0x034 */ cXyz* pm_old_pos; @@ -237,7 +236,6 @@ public: /* 0x0DC */ dBgS_GndChk m_gnd; /* 0x130 */ dBgS_RoofChk m_roof; /* 0x180 */ dBgS_WtrChk m_wtr; -private: /* 0x1D4 */ u8 m_wtr_mode; }; // Size: 0x1D8 diff --git a/include/d/d_bg_s_grp_pass_chk.h b/include/d/d_bg_s_grp_pass_chk.h index eea3414b98..6253f67f18 100644 --- a/include/d/d_bg_s_grp_pass_chk.h +++ b/include/d/d_bg_s_grp_pass_chk.h @@ -25,7 +25,6 @@ public: void OnAll() { mGrp |= FULL_GRP; } u32 MaskNormalGrp() { return mGrp & NORMAL_GRP; } u32 MaskWaterGrp() { return mGrp & WATER_GRP; } -private: /* 0x4 */ u32 mGrp; }; diff --git a/include/d/d_bg_s_poly_pass_chk.h b/include/d/d_bg_s_poly_pass_chk.h index 6f7778189a..759321c6da 100644 --- a/include/d/d_bg_s_poly_pass_chk.h +++ b/include/d/d_bg_s_poly_pass_chk.h @@ -42,7 +42,6 @@ public: void SetStatue(); void SetUnderwaterRoof(); -private: /* 0x4 */ bool mObject; /* 0x5 */ bool mCamera; /* 0x6 */ bool mLink; diff --git a/include/d/d_bg_s_roof_chk.h b/include/d/d_bg_s_roof_chk.h index 387c05fff2..e404eef0c4 100644 --- a/include/d/d_bg_s_roof_chk.h +++ b/include/d/d_bg_s_roof_chk.h @@ -17,7 +17,6 @@ public: f32 GetNowY() { return mNowY; } cXyz* GetPosP() { return &m_pos; } -private: /* 0x3C */ cXyz m_pos; /* 0x48 */ int field_0x48; /* 0x4C */ f32 mNowY; diff --git a/include/d/d_bg_s_spl_grp_chk.h b/include/d/d_bg_s_spl_grp_chk.h index 447bbf4d73..46df7df35a 100644 --- a/include/d/d_bg_s_spl_grp_chk.h +++ b/include/d/d_bg_s_spl_grp_chk.h @@ -30,7 +30,6 @@ public: cXyz& GetPosP() { return m_ground; } f32 GetRoof() { return m_roof; } -private: /* 0x3C */ cXyz m_ground; /* 0x48 */ f32 m_roof; /* 0x4C */ f32 m_height; diff --git a/include/d/d_bg_w.h b/include/d/d_bg_w.h index ae37d1c6d9..a9d61822b8 100644 --- a/include/d/d_bg_w.h +++ b/include/d/d_bg_w.h @@ -346,7 +346,6 @@ public: void SetArrowStickCallback(dBgW_ArrowStickCallback func) { m_arrow_stick_callback = func; } void OnMoveFlag() { m_flags |= (u8)1; } -private: /* 0xB0 */ dBgW_CrrFunc m_crr_func; /* 0xB4 */ dBgW_RideCallback m_ride_callback; /* 0xB8 */ dBgW_ArrowStickCallback m_arrow_stick_callback; diff --git a/include/d/d_bg_w_base.h b/include/d/d_bg_w_base.h index 6940df06fa..f30604d2d3 100644 --- a/include/d/d_bg_w_base.h +++ b/include/d/d_bg_w_base.h @@ -124,7 +124,6 @@ public: void OnPushPullOk() { m_pushPull_Ok = true; } void OffPushPullOk() { m_pushPull_Ok = false; } -private: /* 0x08 */ u8 m_priority; /* 0x09 */ u8 m_roomId; /* 0x0A */ u8 field_0xa; diff --git a/include/d/d_bg_w_kcol.h b/include/d/d_bg_w_kcol.h index 84b0da03f2..42a33b197e 100644 --- a/include/d/d_bg_w_kcol.h +++ b/include/d/d_bg_w_kcol.h @@ -117,7 +117,6 @@ public: void getTri1Pos(KC_PrismData* pd, Vec** nrm) const { *nrm = &m_pkc_head->m_pos_data[pd->pos_i]; } -private: /* 0x18 */ KC_Header* m_pkc_head; /* 0x1C */ dBgPlc m_code; /* 0x20 */ cM3dGAab m_bnd; diff --git a/include/d/d_cc_d.h b/include/d/d_cc_d.h index 40ffae33da..739abdcaa4 100644 --- a/include/d/d_cc_d.h +++ b/include/d/d_cc_d.h @@ -179,7 +179,6 @@ public: cXyz* GetHitPosP() { return &mHitPos; } void ClrHit() { dCcD_GAtTgCoCommonBase::ClrActorInfo(); } - // private: /* 0x1C */ u8 mSe; /* 0x1D */ u8 mMtrl; /* 0x1E */ u8 mHitMark; @@ -215,7 +214,6 @@ public: u8 GetSe() { return mSe; } void ClrHit() { dCcD_GAtTgCoCommonBase::ClrActorInfo(); } -private: /* 0x1C */ u8 mSe; /* 0x1D */ u8 mMtrl; /* 0x1E */ u8 mHitMark; @@ -258,7 +256,6 @@ public: void SetTgSpl(dCcG_Tg_Spl spl) { mTg = spl; } void OnNoActor() { field_0x1C |= 1; } - // private: /* 0x04 */ u8 mAt; /* 0x05 */ u8 mTg; /* 0x06 */ u8 mRoomId; diff --git a/include/d/d_cc_mass_s.h b/include/d/d_cc_mass_s.h index 672adb913a..291cb4552c 100644 --- a/include/d/d_cc_mass_s.h +++ b/include/d/d_cc_mass_s.h @@ -6,7 +6,7 @@ typedef void (*dCcMassS_ObjCallback)(fopAc_ac_c*, cXyz*, u32); class dCcMassS_Obj { -private: +public: /* 0x00 */ cCcD_Obj* mpObj; /* 0x04 */ u8 mPriority; /* 0x08 */ dCcMassS_ObjCallback mpAreaCheckFunc; @@ -28,7 +28,7 @@ public: STATIC_ASSERT(0x20 == sizeof(dCcMassS_Obj)); class dCcMassS_HitInf { -private: +public: /* 0x00 */ cCcD_Obj* mpArea; /* 0x04 */ cCcD_Obj* mpAtObj; /* 0x08 */ cCcD_Obj* mpCoObj; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index a598cbcc10..dcf681162f 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -20,11 +20,6 @@ #if defined(DUSK_BUILDING_GAME) #include #include "dusk/settings.h" -#else -#ifndef ZoneScoped -#define ZoneScoped -#define ZoneScopedN(name) -#endif #endif enum dComIfG_ButtonStatus { @@ -254,7 +249,6 @@ public: ~dComIfG_resLoader_c(); int load(char const**, JKRHeap*); -private: /* 0x0 */ const char** mResNameTable; /* 0x4 */ request_of_phase_process_class mPhase; /* 0xC */ u8 mLoadIndex; @@ -1276,6 +1270,938 @@ int dComIfGd_setShadow(u32 param_0, s8 param_1, J3DModel* param_2, cXyz* param_3 f32 param_5, f32 param_6, f32 param_7, cBgS_PolyInfo& param_8, dKy_tevstr_c* param_9, s16 param_10, f32 param_11, TGXTexObj* param_12); +#if TARGET_PC +DUSK_NOINLINE dSv_info_c* dComIfGs_getSaveInfo(); +DUSK_NOINLINE dSv_save_c* dComIfGs_getSaveData(); +DUSK_NOINLINE u16 dComIfGs_getMaxLife(); +DUSK_NOINLINE void dComIfGs_setMaxLife(u8 i_maxLife); +DUSK_NOINLINE u16 dComIfGs_getLife(); +DUSK_NOINLINE void dComIfGs_setLife(u16 i_life); +DUSK_NOINLINE u16 dComIfGs_getRupee(); +DUSK_NOINLINE void dComIfGs_setRupee(u16 i_rupees); +DUSK_NOINLINE u16 dComIfGs_getMaxOil(); +DUSK_NOINLINE void dComIfGs_setMaxOil(u16 i_maxOil); +DUSK_NOINLINE u16 dComIfGs_getOil(); +DUSK_NOINLINE void dComIfGs_setOil(u16 i_oil); +DUSK_NOINLINE u8 dComIfGs_getSelectEquipClothes(); +DUSK_NOINLINE u8 dComIfGs_getSelectEquipSword(); +DUSK_NOINLINE u8 dComIfGs_getSelectEquipShield(); +DUSK_NOINLINE u8 dComIfGs_getCollectSmell(); +DUSK_NOINLINE void dComIfGs_setCollectSmell(u8 smell); +DUSK_NOINLINE u8 dComIfGs_getBButtonItemKey(); +DUSK_NOINLINE void dComIfGs_setBButtonItemKey(u8 i_itemNo); +DUSK_NOINLINE u8 dComIfGs_getWalletSize(); +DUSK_NOINLINE void dComIfGs_setWalletSize(u8 i_size); +DUSK_NOINLINE u8 dComIfGs_getMaxMagic(); +DUSK_NOINLINE void dComIfGs_setMaxMagic(u8 i_maxMagic); +DUSK_NOINLINE u8 dComIfGs_getMagic(); +DUSK_NOINLINE void dComIfGs_setMagic(u8 i_magic); +DUSK_NOINLINE u8 dComIfGs_getTransformStatus(); +DUSK_NOINLINE void dComIfGs_setTransformStatus(u8 i_status); +DUSK_NOINLINE u8 dComIfGs_getSelectItemIndex(int i_no); +DUSK_NOINLINE u16 dComIfGs_getRupeeMax(); +DUSK_NOINLINE void dComIfGs_offGetMagicUseFlag(); +DUSK_NOINLINE s32 dComIfGs_isGetMagicUseFlag(); +DUSK_NOINLINE f32 dComIfGs_getTime(); +DUSK_NOINLINE void dComIfGs_setTime(f32 i_time); +DUSK_NOINLINE u16 dComIfGs_getDate(); +DUSK_NOINLINE void dComIfGs_setDate(u16 i_date); +DUSK_NOINLINE void dComIfGs_onDarkClearLV(int i_no); +DUSK_NOINLINE void dComIfGs_offDarkClearLV(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isDarkClearLV(int i_no); +DUSK_NOINLINE void dComIfGs_onTransformLV(int i_no); +DUSK_NOINLINE void dComIfGs_offTransformLV(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isTransformLV(int i_no); +DUSK_NOINLINE cXyz dComIfGs_getHorseRestartPos(); +DUSK_NOINLINE s16 dComIfGs_getHorseRestartAngleY(); +DUSK_NOINLINE const char* dComIfGs_getHorseRestartStageName(); +DUSK_NOINLINE s8 dComIfGs_getHorseRestartRoomNo(); +DUSK_NOINLINE void dComIfGs_setHorseRestart( + const char* i_stageName, cXyz& i_pos, s16 i_angle, s8 i_roomNo); +DUSK_NOINLINE cXyz dComIfGs_getPlayerFieldLastStayPos(); +DUSK_NOINLINE s16 dComIfGs_getPlayerFieldLastStayAngleY(); +DUSK_NOINLINE char* dComIfGs_getPlayerFieldLastStayName(); +DUSK_NOINLINE u8 dComIfGs_getPlayerFieldLastStayRegionNo(); +DUSK_NOINLINE bool dComIfGs_isPlayerFieldLastStayFieldDataExistFlag(); +DUSK_NOINLINE void dComIfGs_offPlayerFieldLastStayFieldDataExistFlag(); +DUSK_NOINLINE void dComIfGs_onPlayerFieldLastStayFieldDataExistFlag(); +DUSK_NOINLINE BOOL dComIfGs_isRegionBit(int i_region); +DUSK_NOINLINE void dComIfGs_onRegionBit(int i_region); +DUSK_NOINLINE void dComIfGs_setPlayerFieldLastStayInfo( + const char* i_stage, cXyz& i_pos, s16 i_angle, s8 i_point, u8 i_region); +DUSK_NOINLINE cXyz dComIfGs_getLastWarpMarkPlayerPos(); +DUSK_NOINLINE s16 dComIfGs_getLastWarpMarkPlayerAngleY(); +DUSK_NOINLINE const char* dComIfGs_getLastWarpMarkStageName(); +DUSK_NOINLINE u8 dComIfGs_getLastWarpMarkRoomNo(); +DUSK_NOINLINE s8 dComIfGs_getLastWarpAcceptStage(); +DUSK_NOINLINE void dComIfGs_setLastWarpAcceptStage(s8 param_0); +DUSK_NOINLINE void dComIfGs_resetLastWarpAcceptStage(); +DUSK_NOINLINE void dComIfGs_setItem(int i_slotNo, u8 i_itemNo); +DUSK_NOINLINE u8 dComIfGs_getItem(int i_slotNo, bool i_checkCombo); +DUSK_NOINLINE void dComIfGs_setLineUpItem(); +DUSK_NOINLINE u8 dComIfGs_getLineUpItem(int i_slotNo); +DUSK_NOINLINE void dComIfGs_setBottleItemIn(u8 curItem, u8 newItem); +DUSK_NOINLINE void dComIfGs_setEmptyBottleItemIn(u8 i_itemNo); +DUSK_NOINLINE void dComIfGs_setEmptyBottle(); +DUSK_NOINLINE void dComIfGs_setEmptyBottle(u8 i_itemNo); +DUSK_NOINLINE void dComIfGs_setEquipBottleItemIn(u8 i_curItem, u8 i_newItem); +DUSK_NOINLINE void dComIfGs_setEquipBottleItemEmpty(u8 i_curItem); +DUSK_NOINLINE u8 dComIfGs_checkBottle(u8 i_itemNo); +DUSK_NOINLINE u8 dComIfGs_checkInsectBottle(); +DUSK_NOINLINE u8 dComIfGs_checkEmptyBottle(); +DUSK_NOINLINE void dComIfGs_setEmptyBombBagItemIn(u8 i_newBomb, bool i_setNum); +DUSK_NOINLINE void dComIfGs_setEmptyBombBagItemIn(u8 i_newBomb, u8 i_bombNum, bool i_setNum); +DUSK_NOINLINE void dComIfGs_setEmptyBombBag(); +DUSK_NOINLINE void dComIfGs_setEmptyBombBag(u8 i_newBomb, u8 i_bombNum); +DUSK_NOINLINE u8 dComIfGs_checkBombBag(u8 i_itemNo); +DUSK_NOINLINE void dComIfGs_setWarashibeItem(u8 i_itemNo); +DUSK_NOINLINE void dComIfGs_setRodTypeLevelUp(); +DUSK_NOINLINE void dComIfGs_setBaitItem(u8 i_item); +DUSK_NOINLINE void dComIfGs_onItemFirstBit(u8 i_itemNo); +DUSK_NOINLINE void dComIfGs_offItemFirstBit(u8 i_itemNo); +DUSK_NOINLINE int dComIfGs_isItemFirstBit(u8 i_no); +DUSK_NOINLINE u8 dComIfGs_getArrowNum(); +DUSK_NOINLINE void dComIfGs_setArrowNum(u8 i_arrowNum); +DUSK_NOINLINE u8 dComIfGs_getPachinkoNum(); +DUSK_NOINLINE void dComIfGs_setPachinkoNum(u8 i_num); +DUSK_NOINLINE u8 dComIfGs_getPachinkoMax(); +DUSK_NOINLINE void dComIfGs_setBombNum(u8 i_num); +DUSK_NOINLINE void dComIfGs_setBombNum(u8 i_bagIdx, u8 i_bombNum); +DUSK_NOINLINE u8 dComIfGs_getBombNum(u8 i_bagIdx); +DUSK_NOINLINE void dComIfGs_setBottleNum(u8 i_bottleIdx, u8 i_bottleNum); +DUSK_NOINLINE void dComIfGs_addBottleNum(u8 i_bottleIdx, s16 i_num); +DUSK_NOINLINE u8 dComIfGs_getBottleNum(u8 i_bottleIdx); +DUSK_NOINLINE u8 dComIfGs_getArrowMax(); +DUSK_NOINLINE void dComIfGs_setArrowMax(u8 i_arrowMax); +DUSK_NOINLINE void dComIfGs_setBombMax(u8 i_max); +DUSK_NOINLINE void dComIfGs_setBombMax(u8 i_type, u8 i_max); +DUSK_NOINLINE u8 dComIfGs_getBombMax(); +DUSK_NOINLINE u8 dComIfGs_getBombMax(u8 i_bombType); +DUSK_NOINLINE void dComIfGs_setPohSpiritNum(u8 i_num); +DUSK_NOINLINE u8 dComIfGs_getPohSpiritNum(); +DUSK_NOINLINE void dComIfGs_addPohSpiritNum(); +DUSK_NOINLINE BOOL dComIfGs_isCollectClothes(u8 i_clothesNo); +DUSK_NOINLINE void dComIfGs_setCollectClothes(u8 i_clothesNo); +DUSK_NOINLINE void dComIfGs_setCollectSword(u8 i_swordNo); +DUSK_NOINLINE void dComIfGs_setCollectShield(u8 i_shieldNo); +DUSK_NOINLINE BOOL dComIfGs_isCollectClothing(u8 i_clothesNo); +DUSK_NOINLINE void dComIfGs_offCollectClothes(u8 i_clothesNo); +DUSK_NOINLINE BOOL dComIfGs_isCollectSword(u8 i_swordNo); +DUSK_NOINLINE void dComIfGs_offCollectSword(u8 i_swordNo); +DUSK_NOINLINE BOOL dComIfGs_isCollectShield(u8 i_item); +DUSK_NOINLINE void dComIfGs_offCollectShield(u8 i_shieldNo); +DUSK_NOINLINE void dComIfGs_onCollectCrystal(u8 i_item); +DUSK_NOINLINE void dComIfGs_offCollectCrystal(u8 i_item); +DUSK_NOINLINE bool dComIfGs_isCollectCrystal(u8 i_item); +DUSK_NOINLINE void dComIfGs_onCollectMirror(u8 i_item); +DUSK_NOINLINE void dComIfGs_offCollectMirror(u8 i_item); +DUSK_NOINLINE bool dComIfGs_isCollectMirror(u8 i_item); +DUSK_NOINLINE void dComIfGs_setLightDropNum(u8 i_level, u8 i_num); +DUSK_NOINLINE u8 dComIfGs_getLightDropNum(u8 i_nowLevel); +DUSK_NOINLINE void dComIfGs_onLightDropGetFlag(u8 i_nowLevel); +DUSK_NOINLINE void dComIfGs_offLightDropGetFlag(u8 i_level); +DUSK_NOINLINE BOOL dComIfGs_isLightDropGetFlag(u8 i_nowLevel); +DUSK_NOINLINE void dComIfGs_onLetterGetFlag(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isLetterGetFlag(int i_no); +DUSK_NOINLINE void dComIfGs_onLetterReadFlag(int i_no); +DUSK_NOINLINE int dComIfGs_isLetterReadFlag(int i_no); +DUSK_NOINLINE u8 dComIfGs_getGetNumber(int i_no); +DUSK_NOINLINE void dComIfGs_setGetNumber(int i_no, u8 i_value); +DUSK_NOINLINE void dComIfGs_addFishNum(u8 param_0); +DUSK_NOINLINE u16 dComIfGs_getFishNum(u8 param_0); +DUSK_NOINLINE u8 dComIfGs_getFishSize(u8 param_0); +DUSK_NOINLINE void dComIfGs_setFishSize(u8 param_0, u8 param_1); +DUSK_NOINLINE OSTime dComIfGs_getTotalTime(); +DUSK_NOINLINE void dComIfGs_addDeathCount(); +DUSK_NOINLINE u16 dComIfGs_getDeathCount(); +DUSK_NOINLINE TEXT_SPAN dComIfGs_getPlayerName(); +DUSK_NOINLINE void dComIfGs_setPlayerName(const char* i_name); +DUSK_NOINLINE TEXT_SPAN dComIfGs_getHorseName(); +DUSK_NOINLINE void dComIfGs_setHorseName(const char* i_name); +DUSK_NOINLINE u8 dComIfGs_getClearCount(); + +// Ruby inline names are from TWW debug. +DUSK_NOINLINE u8 dComIfGs_getOptRuby(); +DUSK_NOINLINE void dComIfGs_setOptRuby(u8 i_ruby); +DUSK_NOINLINE u8 dComIfGs_getOptAttentionType(); +DUSK_NOINLINE void dComIfGs_setOptAttentionType(u8 i_attentionType); +DUSK_NOINLINE void dComIfGs_setOptCalibrateDist(u16 i_calibrateDist); +DUSK_NOINLINE void dComIfGs_setOptCalValue(s8 i_calValue); +DUSK_NOINLINE u8 dComIfGs_getOptCameraControl(); +DUSK_NOINLINE void dComIfGs_setOptCameraControl(u8 i_cameraControl); +DUSK_NOINLINE u8 dComIfGs_getOptPointer(); +DUSK_NOINLINE void dComIfGs_setOptPointer(u8 i_pointer); +DUSK_NOINLINE u8 dComIfGs_checkOptVibration(); +DUSK_NOINLINE u8 dComIfGs_getOptSound(); +DUSK_NOINLINE void dComIfGs_setOptSound(u8 i_mode); +DUSK_NOINLINE u8 dComIfGs_getOptVibration(); +DUSK_NOINLINE void dComIfGs_setOptVibration(u8 i_status); +DUSK_NOINLINE u8 dComIfGs_getPalLanguage(); +DUSK_NOINLINE BOOL dComIfGs_isSaveTbox(int i_stageNo, int i_no); +DUSK_NOINLINE void dComIfGs_onSaveSwitch(int i_stageNo, int i_no); +DUSK_NOINLINE void dComIfGs_offSaveSwitch(int i_stageNo, int i_no); +DUSK_NOINLINE BOOL dComIfGs_isSaveSwitch(int i_stageNo, int i_no); +DUSK_NOINLINE void dComIfGs_onSaveVisitedRoom(int param_0, int i_roomNo); +DUSK_NOINLINE void dComIfGs_offSaveVisitedRoom(int param_0, int i_roomNo); +DUSK_NOINLINE BOOL dComIfGs_isSaveVisitedRoom(int param_0, int i_roomNo); +DUSK_NOINLINE void* dComIfGs_getPEventBit(); +DUSK_NOINLINE void dComIfGs_onEventBit(const u16 i_flag); +DUSK_NOINLINE void dComIfGs_offEventBit(const u16 i_flag); +DUSK_NOINLINE BOOL dComIfGs_isEventBit(const u16 i_flag); +DUSK_NOINLINE void dComIfGs_setEventReg(u16 reg, u8 value); +DUSK_NOINLINE u8 dComIfGs_getEventReg(u16 reg); +DUSK_NOINLINE int dComIfGs_getHookGameTime(); +DUSK_NOINLINE void dComIfGs_setHookGameTime(u32 i_time); +DUSK_NOINLINE u32 dComIfGs_getBalloonScore(); +DUSK_NOINLINE void dComIfGs_setBalloonScore(u32 i_score); +DUSK_NOINLINE int dComIfGs_getRaceGameTime(); +DUSK_NOINLINE void dComIfGs_setRaceGameTime(int i_time); +DUSK_NOINLINE u8 dComIfGs_getKeyNum(); +DUSK_NOINLINE void dComIfGs_setKeyNum(u8 i_keyNum); +DUSK_NOINLINE void dComIfGs_onDungeonItemMap(); +DUSK_NOINLINE void dComIfGs_offDungeonItemMap(); +DUSK_NOINLINE s32 dComIfGs_isDungeonItemMap(); +DUSK_NOINLINE void dComIfGs_onDungeonItemCompass(); +DUSK_NOINLINE void dComIfGs_offDungeonItemCompass(); +DUSK_NOINLINE s32 dComIfGs_isDungeonItemCompass(); +DUSK_NOINLINE void dComIfGs_onDungeonItemBossKey(); +DUSK_NOINLINE void dComIfGs_offDungeonItemBossKey(); +DUSK_NOINLINE s32 dComIfGs_isDungeonItemBossKey(); +DUSK_NOINLINE void dComIfGs_onStageBossEnemy(); +DUSK_NOINLINE void dComIfGs_offStageBossEnemy(); +DUSK_NOINLINE s32 dComIfGs_isStageBossEnemy(); +DUSK_NOINLINE void dComIfGs_onStageLife(); +DUSK_NOINLINE void dComIfGs_offStageLife(); +DUSK_NOINLINE s32 dComIfGs_isStageLife(); +DUSK_NOINLINE void dComIfGs_onStageBossDemo(); +DUSK_NOINLINE void dComIfGs_offStageBossDemo(); +DUSK_NOINLINE s32 dComIfGs_isStageBossDemo(); +DUSK_NOINLINE void dComIfGs_onDungeonItemWarp(); +DUSK_NOINLINE void dComIfGs_offDungeonItemWarp(); +DUSK_NOINLINE s32 dComIfGs_isDungeonItemWarp(); +DUSK_NOINLINE void dComIfGs_onStageMiddleBoss(); +DUSK_NOINLINE void dComIfGs_offStageMiddleBoss(); +DUSK_NOINLINE BOOL dComIfGs_isStageMiddleBoss(); +DUSK_NOINLINE void dComIfGs_onTbox(int i_no); +DUSK_NOINLINE void dComIfGs_offTbox(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isTbox(int i_no); +DUSK_NOINLINE void dComIfGs_onSaveSwitch(int i_no); +DUSK_NOINLINE void dComIfGs_offSaveSwitch(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isSaveSwitch(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isSaveItem(int i_no); +DUSK_NOINLINE void dComIfGs_onSaveDunSwitch(int i_swNo); +DUSK_NOINLINE void dComIfGs_offSaveDunSwitch(int i_swNo); +DUSK_NOINLINE BOOL dComIfGs_isSaveDunSwitch(int i_no); +DUSK_NOINLINE BOOL dComIfGs_isSaveDunItem(int i_no); +DUSK_NOINLINE void dComIfGs_resetDan(); +DUSK_NOINLINE void dComIfGs_initDan(s8 i_stageNo); +DUSK_NOINLINE void dComIfGs_clearRoomSwitch(int i_zoneNo); +DUSK_NOINLINE void dComIfGs_clearRoomItem(int i_zoneNo); +DUSK_NOINLINE void dComIfGs_onSvZoneSwitch(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_offSvZoneSwitch(int i_zoneNo, int i_swBit); +DUSK_NOINLINE BOOL dComIfGs_isSvZoneSwitch(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_onSvOneZoneSwitch(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_offSvOneZoneSwitch(int i_zoneNo, int i_swBit); +DUSK_NOINLINE BOOL dComIfGs_isSvOneZoneSwitch(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_onSvZoneItem(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_offSvZoneItem(int i_zoneNo, int i_swBit); +DUSK_NOINLINE BOOL dComIfGs_isSvZoneItem(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_onSvOneZoneItem(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_offSvOneZoneItem(int i_zoneNo, int i_swBit); +DUSK_NOINLINE BOOL dComIfGs_isSvOneZoneItem(int i_zoneNo, int i_swBit); +DUSK_NOINLINE void dComIfGs_removeZone(int i_zoneNo); +DUSK_NOINLINE s8 dComIfGs_getRestartRoomNo(); +DUSK_NOINLINE s16 dComIfGs_getStartPoint(); +DUSK_NOINLINE void dComIfGs_setStartPoint(s16 i_point); +DUSK_NOINLINE s16 dComIfGs_getRestartRoomAngleY(); +DUSK_NOINLINE const cXyz& dComIfGs_getRestartRoomPos(); +DUSK_NOINLINE u32 dComIfGs_getRestartRoomParam(); +DUSK_NOINLINE void dComIfGs_setRestartRoomParam(u32 i_param); +DUSK_NOINLINE f32 dComIfGs_getLastSceneSpeedF(); +DUSK_NOINLINE u32 dComIfGs_getLastSceneMode(); +DUSK_NOINLINE s16 dComIfGs_getLastSceneAngleY(); +DUSK_NOINLINE void dComIfGs_setRestartRoom(const cXyz& i_position, s16 i_angle, s8 i_roomNo); +DUSK_NOINLINE void dComIfGs_onTmpBit(const u16 i_flag); +DUSK_NOINLINE void dComIfGs_offTmpBit(const u16 i_flag); +DUSK_NOINLINE BOOL dComIfGs_isTmpBit(const u16 i_flag); +DUSK_NOINLINE void dComIfGs_setTmpReg(u16 i_reg, u8 i_no); +DUSK_NOINLINE u8 dComIfGs_getTmpReg(const u16 i_reg); +DUSK_NOINLINE dSv_turnRestart_c& dComIfGs_getTurnRestart(); +DUSK_NOINLINE const cXyz& dComIfGs_getTurnRestartPos(); +DUSK_NOINLINE u32 dComIfGs_getTurnRestartParam(); +DUSK_NOINLINE s16 dComIfGs_getTurnRestartAngleY(); +DUSK_NOINLINE s8 dComIfGs_getTurnRestartRoomNo(); +DUSK_NOINLINE void dComIfGs_setTurnRestart( + const cXyz& i_position, s16 i_angle, s8 param_2, u32 i_param); +DUSK_NOINLINE u8 dComIfGs_getDataNum(); +DUSK_NOINLINE void dComIfGs_setDataNum(u8 i_num); +DUSK_NOINLINE u8 dComIfGs_getNewFile(); +DUSK_NOINLINE void dComIfGs_setNewFile(u8 i_fileNo); +DUSK_NOINLINE u8 dComIfGs_getNoFile(); +DUSK_NOINLINE void dComIfGs_setNoFile(u8 i_file); +DUSK_NOINLINE s64 dComIfGs_getSaveStartTime(); +DUSK_NOINLINE void dComIfGs_setSaveStartTime(s64 i_time); +DUSK_NOINLINE s64 dComIfGs_getSaveTotalTime(); +DUSK_NOINLINE void dComIfGs_setSaveTotalTime(s64 i_time); +DUSK_NOINLINE void dComIfGs_init(); +DUSK_NOINLINE void dComIfGs_getSave(int i_stageNo); +DUSK_NOINLINE void dComIfGs_putSave(int i_stageNo); +DUSK_NOINLINE void dComIfGs_initZone(); +DUSK_NOINLINE int dComIfGs_createZone(int roomNo); +DUSK_NOINLINE void dComIfGs_onSwitch(int i_no, int i_roomNo); +DUSK_NOINLINE void dComIfGs_offSwitch(int i_no, int i_roomNo); +DUSK_NOINLINE BOOL dComIfGs_isSwitch(int i_no, int i_roomNo); +DUSK_NOINLINE void dComIfGs_revSwitch(int i_no, int i_roomNo); +DUSK_NOINLINE void dComIfGs_onItem(int i_bitNo, int i_roomNo); +DUSK_NOINLINE bool dComIfGs_isItem(int i_bitNo, int i_roomNo); +DUSK_NOINLINE void dComIfGs_onActor(int i_bitNo, int i_roomNo); +DUSK_NOINLINE void dComIfGs_offActor(int i_no, int i_roomNo); +DUSK_NOINLINE BOOL dComIfGs_isActor(int i_no, int i_roomNo); +DUSK_NOINLINE void dComIfGs_setMemoryToCard(u8* i_saveData, int i_dataNum); +DUSK_NOINLINE void dComIfGs_setCardToMemory(u8* card_ptr, int dataNum); +DUSK_NOINLINE void dComIfGs_setInitDataToCard(u8* i_saveData, int i_dataNum); +DUSK_NOINLINE u8 dComIfGs_getWolfAbility(int i_idx); +DUSK_NOINLINE s8 dComIfGs_Grass_hide_Check(); +DUSK_NOINLINE dStage_startStage_c* dComIfGp_getStartStage(); +DUSK_NOINLINE void dComIfGp_setStartStage(dStage_startStage_c* p_startStage); +DUSK_NOINLINE const char* dComIfGp_getStartStageName(); +DUSK_NOINLINE s16 dComIfGp_getStartStagePoint(); +DUSK_NOINLINE s8 dComIfGp_getStartStageRoomNo(); +DUSK_NOINLINE s8 dComIfGp_getStartStageLayer(); +DUSK_NOINLINE void dComIfGp_setStartStageLayer(s8 layer); +DUSK_NOINLINE s8 dComIfGp_getStartStageDarkArea(); +DUSK_NOINLINE void dComIfGp_setStartStageDarkArea(s8 darkArea); +DUSK_NOINLINE dStage_startStage_c* dComIfGp_getNextStartStage(); +DUSK_NOINLINE const char* dComIfGp_getNextStageName(); +DUSK_NOINLINE s16 dComIfGp_getNextStagePoint(); +DUSK_NOINLINE s16 dComIfGp_getNextStageRoomNo(); +DUSK_NOINLINE s16 dComIfGp_getNextStageLayer(); +DUSK_NOINLINE BOOL dComIfGp_isEnableNextStage(); +DUSK_NOINLINE void dComIfGp_offEnableNextStage(); +DUSK_NOINLINE s8 dComIfGp_getNextStageWipe(); +DUSK_NOINLINE u8 dComIfGp_getNextStageWipeSpeed(); +DUSK_NOINLINE dStage_stageDt_c* dComIfGp_getStage(); +DUSK_NOINLINE roomRead_class* dComIfGp_getStageRoom(); +DUSK_NOINLINE stage_palette_info_class* dComIfGp_getStagePaletteInfo(); +DUSK_NOINLINE stage_pselect_info_class* dComIfGp_getStagePselectInfo(); +DUSK_NOINLINE stage_envr_info_class* dComIfGp_getStageEnvrInfo(); +DUSK_NOINLINE stage_vrboxcol_info_class* dComIfGp_getStageVrboxcolInfo(); +DUSK_NOINLINE stage_plight_info_class* dComIfGp_getStagePlightInfo(); +DUSK_NOINLINE int dComIfGp_getStagePaletteNumInfo(); +DUSK_NOINLINE int dComIfGp_getStagePselectNumInfo(); +DUSK_NOINLINE int dComIfGp_getStageEnvrNumInfo(); +DUSK_NOINLINE int dComIfGp_getStageVrboxcolNumInfo(); +DUSK_NOINLINE int dComIfGp_getStagePlightNumInfo(); +DUSK_NOINLINE stage_stag_info_class* dComIfGp_getStageStagInfo(); +DUSK_NOINLINE stage_scls_info_dummy_class* dComIfGp_getStageSclsInfo(); +DUSK_NOINLINE dStage_Multi_c* dComIfGp_getMulti(); +DUSK_NOINLINE void dComIfGp_setOldMulti(); +DUSK_NOINLINE void dComIfGp_resetOldMulti(); +DUSK_NOINLINE s16 dComIfGp_getStageWorldRollAngleX(); +DUSK_NOINLINE s16 dComIfGp_getStageWorldRollDirAngleY(); +DUSK_NOINLINE int dComIfGp_roomControl_getStayNo(); +DUSK_NOINLINE BOOL dComIfGp_roomControl_getTimePass(); +DUSK_NOINLINE void dComIfGp_roomControl_setTimePass(int isPassing); +DUSK_NOINLINE dKy_tevstr_c* dComIfGp_roomControl_getTevStr(int i_roomNo); +DUSK_NOINLINE void dComIfGp_roomControl_setStatusFlag(int i_roomNo, u8 flag); +DUSK_NOINLINE void dComIfGp_roomControl_onStatusFlag(int i_roomNo, u8 flag); +DUSK_NOINLINE void dComIfGp_roomControl_offStatusFlag(int i_roomNo, u8 flag); +DUSK_NOINLINE u8 dComIfGp_roomControl_checkStatusFlag(int i_roomNo, u8 flag); +DUSK_NOINLINE s32 dComIfGp_roomControl_getZoneNo(int i_roomNo); +DUSK_NOINLINE void dComIfGp_roomControl_setZoneNo(int roomNo, int zoneNo); +DUSK_NOINLINE void dComIfGp_roomControl_init(); +DUSK_NOINLINE void dComIfGp_roomControl_initZone(); +DUSK_NOINLINE dStage_roomDt_c* dComIfGp_roomControl_getStatusRoomDt(int room_no); +DUSK_NOINLINE void dComIfGp_roomControl_setStayNo(int stayNo); +DUSK_NOINLINE BOOL dComIfGp_roomControl_checkRoomDisp(int i_roomNo); +DUSK_NOINLINE int dComIfGp_roomControl_loadRoom(int param_0, u8* param_1, bool param_2); +DUSK_NOINLINE void dComIfGp_roomControl_zoneCountCheck(int i_roomNo); +DUSK_NOINLINE dEvt_control_c* dComIfGp_getEvent(); +DUSK_NOINLINE u16 dComIfGp_event_chkEventFlag(u16 i_flag); +DUSK_NOINLINE void dComIfGp_event_onEventFlag(u16 i_flag); +DUSK_NOINLINE void dComIfGp_event_onHindFlag(u16 i_flag); +DUSK_NOINLINE void dComIfGp_event_offHindFlag(u16 i_flag); +DUSK_NOINLINE u8 dComIfGp_event_getMode(); +DUSK_NOINLINE BOOL dComIfGp_event_runCheck(); +DUSK_NOINLINE u16 dComIfGp_event_checkHind(u16 i_hindFlag); +DUSK_NOINLINE BOOL dComIfGp_event_chkTalkXY(); +DUSK_NOINLINE u8 dComIfGp_event_getPreItemNo(); +DUSK_NOINLINE f32 dComIfGp_event_getCullRate(); +DUSK_NOINLINE void dComIfGp_event_setCullRate(f32 i_rate); +DUSK_NOINLINE int dComIfGp_event_order(u16 i_type, u16 i_prio, u16 i_flags, u16 i_hindFlags, + void* i_requestActor, void* i_targetActor, s16 i_eventID, u8 i_mapToolId); +DUSK_NOINLINE void dComIfGp_event_reset(); +DUSK_NOINLINE int dComIfGp_event_moveApproval(void* i_actor); +DUSK_NOINLINE BOOL dComIfGp_event_compulsory( + void* i_actor, const char* i_eventname, u16 i_hindFlag); +DUSK_NOINLINE void dComIfGp_event_remove(); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_event_getPt1(); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_event_getPt2(); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_event_getTalkPartner(); +DUSK_NOINLINE void dComIfGp_event_setTalkPartner(void* i_actor); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_event_getItemPartner(); +DUSK_NOINLINE void dComIfGp_event_setItemPartner(void* i_actor); +DUSK_NOINLINE void dComIfGp_event_setItemPartnerId(fpc_ProcID i_id); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_event_getDoorPartner(); +DUSK_NOINLINE void dComIfGp_event_setDoorPartner(void* i_partner); +DUSK_NOINLINE u8 dComIfGp_event_getGtItm(); +DUSK_NOINLINE void dComIfGp_event_setGtItm(u8 i_itemNo); +DUSK_NOINLINE dEvent_manager_c& dComIfGp_getEventManager(); +DUSK_NOINLINE dEvent_manager_c* dComIfGp_getPEvtManager(); +DUSK_NOINLINE int dComIfGp_evmng_cameraPlay(); +DUSK_NOINLINE int dComIfGp_evmng_startDemo(int i_mapToolId); +DUSK_NOINLINE void dComIfGp_evmng_create(); +DUSK_NOINLINE void dComIfGp_evmng_remove(); +DUSK_NOINLINE bool dComIfGp_evmng_existence(s16 eventId); +DUSK_NOINLINE s16 dComIfGp_evmng_getEventIdx(const char* eventName, u8 mapToolID); +DUSK_NOINLINE bool dComIfGp_evmng_existence(const char* eventname); +DUSK_NOINLINE BOOL dComIfGp_evmng_isMapToolCamera(u8 mapToolID); +DUSK_NOINLINE BOOL dComIfGp_evmng_startCheck(s16 i_eventId); +DUSK_NOINLINE BOOL dComIfGp_evmng_startCheck(char const* i_eventname); +DUSK_NOINLINE BOOL dComIfGp_evmng_endCheck(s16 i_eventID); +DUSK_NOINLINE BOOL dComIfGp_evmng_endCheck(const char* i_eventname); +DUSK_NOINLINE int dComIfGp_evmng_getMyStaffId( + const char* i_staffname, fopAc_ac_c* i_actor, int i_tagId); +DUSK_NOINLINE int dComIfGp_evmng_getIsAddvance(int i_staffId); +DUSK_NOINLINE int dComIfGp_evmng_getMyActIdx(int i_staffId, DUSK_CONST char* DUSK_CONST* i_actions, + int i_actionNum, BOOL param_3, BOOL param_4); +DUSK_NOINLINE f32* dComIfGp_evmng_getMyFloatP(int i_staffId, DUSK_CONST char* i_dataname); +DUSK_NOINLINE cXyz* dComIfGp_evmng_getMyXyzP(int i_staffId, DUSK_CONST char* i_dataname); +DUSK_NOINLINE int* dComIfGp_evmng_getMyIntegerP(int i_staffId, DUSK_CONST char* i_dataname); +DUSK_NOINLINE char* dComIfGp_evmng_getMyStringP(int i_staffId, DUSK_CONST char* i_dataname); +DUSK_NOINLINE int dComIfGp_evmng_getMySubstanceNum(int i_staffId, DUSK_CONST char* i_dataname); +DUSK_NOINLINE void dComIfGp_evmng_cutEnd(int i_staffId); +DUSK_NOINLINE void dComIfGp_evmng_setGoal(cXyz* i_pos); +DUSK_NOINLINE cXyz* dComIfGp_evmng_getGoal(); +DUSK_NOINLINE BOOL dComIfGp_evmng_ChkPresentEnd(); +DUSK_NOINLINE int dComIfGp_evmng_checkStartDemo(); +DUSK_NOINLINE dAttention_c* dComIfGp_getAttention(); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_att_getZHint(); +DUSK_NOINLINE int dComIfGp_att_ZHintRequest(fopAc_ac_c* param_1, int param_2); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_att_getCatghTarget(); +DUSK_NOINLINE u8 dComIfGp_att_getCatchChgItem(); +DUSK_NOINLINE int dComIfGp_att_CatchRequest(fopAc_ac_c* param_0, u8 param_1, f32 i_horizontalDist, + f32 i_upDist, f32 i_downDist, s16 i_angle, int param_5); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_att_getLookTarget(); +DUSK_NOINLINE void dComIfGp_att_LookRequest(fopAc_ac_c* param_0, f32 i_horizontalDist, f32 i_upDist, + f32 i_downDist, s16 i_angle, int param_5); +DUSK_NOINLINE dVibration_c& dComIfGp_getVibration(); +DUSK_NOINLINE JKRAramArchive* dComIfGp_getFieldMapArchive2(); +DUSK_NOINLINE void dComIfGp_setFieldMapArchive2(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getMsgArchive(int idx); +DUSK_NOINLINE void dComIfGp_setMsgArchive(int i, JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getDemoMsgArchive(); +DUSK_NOINLINE void dComIfGp_setDemoMsgArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getMeterButtonArchive(); +DUSK_NOINLINE void dComIfGp_setMeterButtonArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getFontArchive(); +DUSK_NOINLINE void dComIfGp_setFontArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getRubyArchive(); +DUSK_NOINLINE void dComIfGp_setRubyArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getAnmArchive(); +DUSK_NOINLINE void dComIfGp_setAnmArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getCollectResArchive(); +DUSK_NOINLINE void dComIfGp_setCollectResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getFmapResArchive(); +DUSK_NOINLINE void dComIfGp_setFmapResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getDmapResArchive(); +DUSK_NOINLINE void dComIfGp_setDmapResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getOptionResArchive(); +DUSK_NOINLINE void dComIfGp_setOptionResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getItemIconArchive(); +DUSK_NOINLINE void dComIfGp_setItemIconArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getNameResArchive(); +DUSK_NOINLINE void dComIfGp_setNameResArchive(JKRArchive* arc); +DUSK_NOINLINE void dComIfGp_setErrorResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getAllMapArchive(); +DUSK_NOINLINE void dComIfGp_setAllMapArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getMsgCommonArchive(); +DUSK_NOINLINE void dComIfGp_setMsgCommonArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getRingResArchive(); +DUSK_NOINLINE void dComIfGp_setRingResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getCardIconResArchive(); +DUSK_NOINLINE void dComIfGp_setCardIconResArchive(JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getMsgDtArchive(); +DUSK_NOINLINE JKRArchive* dComIfGp_getMsgDtArchive(int idx); +DUSK_NOINLINE void dComIfGp_setMsgDtArchive(int i, JKRArchive* arc); +DUSK_NOINLINE JKRArchive* dComIfGp_getMain2DArchive(); +DUSK_NOINLINE void dComIfGp_setMain2DArchive(JKRArchive* arc); +DUSK_NOINLINE JKRExpHeap* dComIfGp_particle_getResHeap(); +DUSK_NOINLINE void dComIfGp_particle_levelExecute(u32 param_0); +DUSK_NOINLINE void dComIfGp_particle_createCommon(const void* data); +DUSK_NOINLINE void dComIfGp_particle_readScene(u8 particle_no, mDoDvdThd_toMainRam_c** param_1); +DUSK_NOINLINE void dComIfGp_particle_createScene(const void* param_0); +DUSK_NOINLINE void dComIfGp_particle_removeScene(bool param_0); +DUSK_NOINLINE void dComIfGp_particle_cleanup(); +DUSK_NOINLINE void dComIfGp_particle_calc3D(); +DUSK_NOINLINE void dComIfGp_particle_calc2D(); +DUSK_NOINLINE void dComIfGp_particle_calcMenu(); +DUSK_NOINLINE void dComIfGp_particle_draw(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFog(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawP1(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawProjection(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawNormalPri0_A(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawNormalPri0_B(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFogPri0_A(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFogPri0_B(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFogPri1(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFogPri2(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFogPri3(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawFogPri4(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawDarkworld(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_drawScreen(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_draw2Dgame(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_draw2Dfore(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_draw2Dback(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_draw2DmenuFore(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_particle_draw2DmenuBack(JPADrawInfo* i_drawInfo); +DUSK_NOINLINE void dComIfGp_setHitMark(u16 i_hitmark, fopAc_ac_c* param_1, const cXyz* param_2, + const csXyz* param_3, const cXyz* param_4, u32 i_atType); +DUSK_NOINLINE void dComIfGp_particle_setWaterRipple(u32* param_0, cBgS_PolyInfo& param_1, + const cXyz* param_2, f32 param_3, const dKy_tevstr_c* param_4, const cXyz* param_5, s8 param_6); +DUSK_NOINLINE u32 dComIfGp_particle_setPolyColor(u32 param_0, u16 param_1, cBgS_PolyInfo& param_2, + const cXyz* param_3, const dKy_tevstr_c* param_4, const csXyz* param_5, const cXyz* param_6, + int param_7, dPa_levelEcallBack* param_8, s8 param_9, const cXyz* param_10); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_setPolyColor(u16 param_1, cBgS_PolyInfo& param_2, + const cXyz* param_3, const dKy_tevstr_c* param_4, const csXyz* param_5, const cXyz* param_6, + int param_7, dPa_levelEcallBack* param_8, s8 param_9, const cXyz* param_10); +DUSK_NOINLINE void dComIfGp_particle_setSimple(u16 param_0, cXyz* i_pos, u8 param_2, + GXColor& param_3, GXColor& param_4, int param_5, float param_6); +DUSK_NOINLINE u32 dComIfGp_particle_setStopContinue(u32 param_0); +DUSK_NOINLINE u32 dComIfGp_particle_setSimpleFoot(u32 param_0, u32* param_1, cBgS_PolyInfo& param_2, + cXyz const* param_3, dKy_tevstr_c const* param_4, int param_5, csXyz const* param_6, + cXyz const* param_7, dPa_levelEcallBack* param_8, s8 param_9, cXyz const* param_10); +DUSK_NOINLINE u16 dComIfGp_particle_setCommonPoly(u32* param_0, cBgS_PolyInfo* param_1, + const cXyz* param_2, const cXyz* param_3, const dKy_tevstr_c* param_4, u32 param_5, u32 param_6, + const csXyz* param_7, const cXyz* param_8, s8 param_9); +DUSK_NOINLINE void dComIfGp_particle_levelEmitterOnEventMove(u32 param_0); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_getEmitter(u32 param_0); +DUSK_NOINLINE u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, + const dKy_tevstr_c* param_3, const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, + dPa_levelEcallBack* param_7, s8 param_8, const GXColor* param_9, const GXColor* param_10, + const cXyz* param_11); +DUSK_NOINLINE u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, + const csXyz* i_rotation, const cXyz* i_scale, u8 param_5, dPa_levelEcallBack* param_6, + s8 param_7, const GXColor* param_8, const GXColor* param_9, const cXyz* param_10); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, + const dKy_tevstr_c* param_3, const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, + dPa_levelEcallBack* i_callback, s8 param_8, const GXColor* i_prmColor, + const GXColor* i_envColor, const cXyz* i_particleScale); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, + const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* i_callback, + s8 param_7, const GXColor* i_prmColor, const GXColor* i_envColor, const cXyz* i_particleScale); +DUSK_NOINLINE u32 dComIfGp_particle_set( + u32 param_0, u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_set( + u16 i_resID, const cXyz* i_pos, const csXyz* i_rotation, const cXyz* i_scale); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, + const dKy_tevstr_c* param_2, const csXyz* i_rotation, const cXyz* i_scale); +DUSK_NOINLINE u32 dComIfGp_particle_set( + u32 param_0, u16 param_1, const cXyz* i_pos, const csXyz* param_3, const cXyz* param_4); +DUSK_NOINLINE u32 dComIfGp_particle_setColor(u32 param_0, u16 param_1, const cXyz* i_pos, + const dKy_tevstr_c* param_3, const GXColor* param_4, const GXColor* param_5, f32 param_6, + u8 param_7, const csXyz* param_8, const cXyz* param_9, dPa_levelEcallBack* param_10, + s8 param_11, const cXyz* param_12); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* i_pos, + const dKy_tevstr_c* param_2, const GXColor* param_3, const GXColor* param_4, f32 param_5, + u8 param_6, const csXyz* param_7, const cXyz* param_8, dPa_levelEcallBack* param_9, s8 param_10, + const cXyz* param_11); +DUSK_NOINLINE JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* i_pos, + const dKy_tevstr_c* param_2, const GXColor* param_3, const GXColor* param_4, f32 param_5, + u8 param_6); +DUSK_NOINLINE u32 dComIfGp_particle_getHeapSize(); +DUSK_NOINLINE u32 dComIfGp_particle_getSceneHeapSize(); +DUSK_NOINLINE int dComIfGp_particle_getEmitterNum(); +DUSK_NOINLINE int dComIfGp_particle_getParticleNum(); +DUSK_NOINLINE dSmplMdl_draw_c* dComIfGp_getSimpleModel(); +DUSK_NOINLINE int dComIfGp_getWindowNum(); +DUSK_NOINLINE void dComIfGp_setWindowNum(int num); +DUSK_NOINLINE s8 dComIfGp_getLayerOld(); +DUSK_NOINLINE s32 dComIfGp_checkStatus(u16 flags); +DUSK_NOINLINE void dComIfGp_setStatus(u16 status); +DUSK_NOINLINE void dComIfGp_onStatus(u16 i_status); +DUSK_NOINLINE dDlst_window_c* dComIfGp_getWindow(int i); +DUSK_NOINLINE void dComIfGp_setWindow(u8 i, f32 param_1, f32 param_2, f32 param_3, f32 param_4, + f32 param_5, f32 param_6, int camID, int mode); +DUSK_NOINLINE camera_process_class* dComIfGp_getCamera(int idx); +DUSK_NOINLINE void dComIfGp_setCamera(int i, camera_class* cam); +DUSK_NOINLINE int dComIfGp_getCameraWinID(int idx); +DUSK_NOINLINE int dComIfGp_getCameraPlayer1ID(int idx); +DUSK_NOINLINE int dComIfGp_getCameraPlayer2ID(int idx); +DUSK_NOINLINE u32 dComIfGp_getCameraAttentionStatus(int i_no); +DUSK_NOINLINE BOOL dComIfGp_checkCameraAttentionStatus(int i, u32 flag); +DUSK_NOINLINE void dComIfGp_onCameraAttentionStatus(int i, u32 flag); +DUSK_NOINLINE void dComIfGp_offCameraAttentionStatus(int i, u32 flag); +DUSK_NOINLINE void dComIfGp_setCameraInfo( + int camIdx, camera_class* p_cam, int param_2, int param_3, int param_4); +DUSK_NOINLINE f32 dComIfGp_getCameraZoomScale(int i_no); +DUSK_NOINLINE void dComIfGp_setCameraZoomScale(int i_no, f32 i_scale); +DUSK_NOINLINE f32 dComIfGp_getCameraZoomForcus(int i_no); +DUSK_NOINLINE void dComIfGp_setCameraZoomForcus(int i_no, f32 i_focus); +DUSK_NOINLINE const char* dComIfGp_getCameraParamFileName(int i); +DUSK_NOINLINE void dComIfGp_setCameraParamFileName(int i, char* name); +DUSK_NOINLINE void dComIfGp_saveCameraPosition( + int i, cXyz* i_pos, cXyz* i_target, f32 i_fovy, s16 i_bank); +DUSK_NOINLINE void dComIfGp_loadCameraPosition( + int i, cXyz* o_pos, cXyz* o_target, f32* o_fovy, s16* o_bank); +DUSK_NOINLINE fopAc_ac_c* dComIfGp_getPlayer(int idx); +DUSK_NOINLINE void dComIfGp_setPlayer(int i, fopAc_ac_c* player); +DUSK_NOINLINE int dComIfGp_getPlayerCameraID(int idx); +DUSK_NOINLINE void dComIfGp_setPlayerInfo(int plyrIdx, fopAc_ac_c* ptr, int camIdx); +DUSK_NOINLINE daPy_py_c* dComIfGp_getLinkPlayer(); +DUSK_NOINLINE daHorse_c* dComIfGp_getHorseActor(); +DUSK_NOINLINE void dComIfGp_setLinkPlayer(fopAc_ac_c* ptr); +DUSK_NOINLINE void dComIfGp_setHorseActor(fopAc_ac_c* i_horse); +DUSK_NOINLINE void dComIfGp_setPlayerPtr(int i, fopAc_ac_c* ptr); +DUSK_NOINLINE dMsgObject_c* dComIfGp_getMsgObjectClass(); +DUSK_NOINLINE void dComIfGp_setMsgObjectClass(dMsgObject_c* obj); +DUSK_NOINLINE f32 dComIfGp_getItemLifeCount(); +DUSK_NOINLINE u8 dComIfGp_getItemLifeCountType(); +DUSK_NOINLINE void dComIfGp_setItemLifeCount(f32 amount, u8 type); +DUSK_NOINLINE void dComIfGp_clearItemLifeCount(); +DUSK_NOINLINE s32 dComIfGp_getItemRupeeCount(); +DUSK_NOINLINE void dComIfGp_setItemRupeeCount(s32 amount); +DUSK_NOINLINE void dComIfGp_clearItemRupeeCount(); +DUSK_NOINLINE s16 dComIfGp_getItemKeyNumCount(); +DUSK_NOINLINE void dComIfGp_setItemKeyNumCount(s16 count); +DUSK_NOINLINE void dComIfGp_clearItemKeyNumCount(); +DUSK_NOINLINE s16 dComIfGp_getItemMaxLifeCount(); +DUSK_NOINLINE void dComIfGp_setItemMaxLifeCount(s16 count); +DUSK_NOINLINE void dComIfGp_clearItemMaxLifeCount(); +DUSK_NOINLINE void dComIfGp_setItemMagicCount(s16 count); +DUSK_NOINLINE void dComIfGp_setItemNowMagic(s16 magic); +DUSK_NOINLINE void dComIfGp_setItemMaxMagicCount(s16 count); +DUSK_NOINLINE s32 dComIfGp_getItemOilCount(); +DUSK_NOINLINE void dComIfGp_setItemOilCount(s32 oil); +DUSK_NOINLINE void dComIfGp_setItemMaxOilCount(s32 oil); +DUSK_NOINLINE void dComIfGp_clearItemOilCount(); +DUSK_NOINLINE s32 dComIfGp_getItemNowOil(); +DUSK_NOINLINE void dComIfGp_setItemNowOil(s32 oil); +DUSK_NOINLINE s32 dComIfGp_getItemMaxOilCount(); +DUSK_NOINLINE void dComIfGp_clearItemMaxOilCount(); +DUSK_NOINLINE int dComIfGp_getOxygen(); +DUSK_NOINLINE void dComIfGp_setOxygen(s32 oxygen); +DUSK_NOINLINE int dComIfGp_getNowOxygen(); +DUSK_NOINLINE void dComIfGp_setNowOxygen(s32 oxygen); +DUSK_NOINLINE s32 dComIfGp_getMaxOxygen(); +DUSK_NOINLINE void dComIfGp_setMaxOxygen(s32 i_oxygen); +DUSK_NOINLINE s32 dComIfGp_getOxygenCount(); +DUSK_NOINLINE void dComIfGp_setOxygenCount(s32 oxygen); +DUSK_NOINLINE void dComIfGp_clearOxygenCount(); +DUSK_NOINLINE void dComIfGp_setMaxOxygenCount(s32 oxygen); +DUSK_NOINLINE s32 dComIfGp_getMaxOxygenCount(); +DUSK_NOINLINE void dComIfGp_clearMaxOxygenCount(); +DUSK_NOINLINE s16 dComIfGp_getItemArrowNumCount(); +DUSK_NOINLINE void dComIfGp_setItemArrowNumCount(s16 count); +DUSK_NOINLINE void dComIfGp_clearItemArrowNumCount(); +DUSK_NOINLINE s16 dComIfGp_getItemPachinkoNumCount(); +DUSK_NOINLINE void dComIfGp_setItemPachinkoNumCount(s16 count); +DUSK_NOINLINE void dComIfGp_clearItemPachinkoNumCount(); +DUSK_NOINLINE s16 dComIfGp_getItemMaxArrowNumCount(); +DUSK_NOINLINE int dComIfGp_getMessageCountNumber(); +DUSK_NOINLINE void dComIfGp_setMessageCountNumber(s32 number); +DUSK_NOINLINE u16 dComIfGp_getItemNowLife(); +DUSK_NOINLINE void dComIfGp_setItemNowLife(u16 life); +DUSK_NOINLINE u8 dComIfGp_getMesgStatus(); +DUSK_NOINLINE u8 dComIfGp_getRStatus(); +DUSK_NOINLINE bool dComIfGp_isRSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setRStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getRStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getRSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setRStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getAStatus(); +DUSK_NOINLINE bool dComIfGp_isASetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setAStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getAStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getASetFlagForce(); +DUSK_NOINLINE void dComIfGp_setAStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getNunStatus(); +DUSK_NOINLINE bool dComIfGp_isNunSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setNunStatus(u8 status, u8 param_1, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getBottleStatus(); +DUSK_NOINLINE bool dComIfGp_isBottleSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setBottleStatus(u8 param_0, u8 param_1); +DUSK_NOINLINE u8 dComIfGp_getBottleStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getBottleSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setBottleStatusForce(u8 param_0, u8 param_1); +DUSK_NOINLINE u8 dComIfGp_getRemoConStatus(); +DUSK_NOINLINE bool dComIfGp_isRemoConSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setRemoConStatus(u8 status, u8 param_1, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getDoStatus(); +DUSK_NOINLINE bool dComIfGp_isDoSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setDoStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getDoStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getDoSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setDoStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_get3DStatus(); +DUSK_NOINLINE u8 dComIfGp_get3DDirection(); +DUSK_NOINLINE bool dComIfGp_is3DSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_set3DStatus(u8 status, u8 direction, u8 flag); +DUSK_NOINLINE u8 dComIfGp_get3DStatusForce(); +DUSK_NOINLINE u8 dComIfGp_get3DDirectionForce(); +DUSK_NOINLINE u8 dComIfGp_get3DSetFlagForce(); +DUSK_NOINLINE void dComIfGp_set3DStatusForce(u8 status, u8 direction, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getCStickStatus(); +DUSK_NOINLINE u8 dComIfGp_getCStickDirection(); +DUSK_NOINLINE bool dComIfGp_isCStickSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setCStickStatus(u8 status, u8 param_1, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getCStickStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getCStickDirectionForce(); +DUSK_NOINLINE u8 dComIfGp_getCStickSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setCStickStatusForce(u8 status, u8 param_1, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getSButtonStatus(); +DUSK_NOINLINE bool dComIfGp_isSButtonSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setSButtonStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getSButtonStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getSButtonSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setSButtonStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getZStatus(); +DUSK_NOINLINE bool dComIfGp_isZSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setZStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getZStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getZSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setZStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getXStatus(); +DUSK_NOINLINE bool dComIfGp_isXSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setXStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getXStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getXSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setXStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getYStatus(); +DUSK_NOINLINE bool dComIfGp_isYSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setYStatus(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getYStatusForce(); +DUSK_NOINLINE u8 dComIfGp_getYSetFlagForce(); +DUSK_NOINLINE void dComIfGp_setYStatusForce(u8 status, u8 flag); +DUSK_NOINLINE u8 dComIfGp_getNunZStatus(); +DUSK_NOINLINE bool dComIfGp_isNunZSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setNunZStatus(u8 param_0, u8 param_1); +DUSK_NOINLINE u8 dComIfGp_getNunCStatus(); +DUSK_NOINLINE bool dComIfGp_isNunCSetFlag(u8 flag); +DUSK_NOINLINE void dComIfGp_setNunCStatus(u8 param_0, u8 param_1); +DUSK_NOINLINE void dComIfGp_setSelectEquipClothes(u8 i_clothNo); +DUSK_NOINLINE void dComIfGp_setSelectEquipSword(u8 i_swordNo); +DUSK_NOINLINE void dComIfGp_setSelectEquipShield(u8 i_shieldNo); +DUSK_NOINLINE u8 dComIfGp_getMesgAnimeAttrInfo(); +DUSK_NOINLINE void dComIfGp_setMesgAnimeAttrInfo(u8 param_1); +DUSK_NOINLINE void dComIfGp_clearMesgAnimeAttrInfo(); +DUSK_NOINLINE u8 dComIfGp_getMesgFaceAnimeAttrInfo(); +DUSK_NOINLINE void dComIfGp_setMesgFaceAnimeAttrInfo(u8 id); +DUSK_NOINLINE void dComIfGp_clearMesgFaceAnimeAttrInfo(); +DUSK_NOINLINE void dComIfGp_clearMesgAnimeTagInfo(); +DUSK_NOINLINE void dComIfGp_setItem(u8 slot, u8 i_no); +DUSK_NOINLINE u8 dComIfGp_getAdvanceDirection(); +DUSK_NOINLINE void dComIfGp_setAdvanceDirection(u8 i_dir); +DUSK_NOINLINE u8 dComIfGp_checkMesgCancelButton(); +DUSK_NOINLINE void dComIfGp_setMesgCancelButton(u8 button); +DUSK_NOINLINE u8 dComIfGp_getGameoverStatus(); +DUSK_NOINLINE void dComIfGp_setGameoverStatus(u8 i_status); +DUSK_NOINLINE u8 dComIfGp_isHeapLockFlag(); +DUSK_NOINLINE u8 dComIfGp_getSubHeapLockFlag(int idx); +DUSK_NOINLINE void dComIfGp_setSubHeapLockFlag(int idx, u8 status); +DUSK_NOINLINE u8 dComIfGp_getNeedLightDropNum(); +DUSK_NOINLINE void dComIfGp_setNeedLightDropNum(u8 i_num); +DUSK_NOINLINE u8 dComIfGp_checkMesgBgm(); +DUSK_NOINLINE void dComIfGp_setMesgBgmOff(); +DUSK_NOINLINE void dComIfGp_setMesgBgmOn(); +DUSK_NOINLINE u8 dComIfGp_isPauseFlag(); +DUSK_NOINLINE void dComIfGp_offPauseFlag(); +DUSK_NOINLINE void dComIfGp_onPauseFlag(); +DUSK_NOINLINE u8 dComIfGp_getOxygenShowFlag(); +DUSK_NOINLINE void dComIfGp_offOxygenShowFlag(); +DUSK_NOINLINE void dComIfGp_onOxygenShowFlag(); +DUSK_NOINLINE u8 dComIfGp_2dShowCheck(); +DUSK_NOINLINE void dComIfGp_2dShowOn(); +DUSK_NOINLINE void dComIfGp_2dShowOff(); +DUSK_NOINLINE JKRExpHeap* dComIfGp_getExpHeap2D(); +DUSK_NOINLINE void dComIfGp_setExpHeap2D(void* heap); +DUSK_NOINLINE JKRExpHeap* dComIfGp_getSubExpHeap2D(int idx); +DUSK_NOINLINE void dComIfGp_setSubExpHeap2D(int idx, void* heap); +DUSK_NOINLINE JKRExpHeap* dComIfGp_getMsgExpHeap(); +DUSK_NOINLINE void dComIfGp_setMsgExpHeap(void* heap); +DUSK_NOINLINE dComIfG_MesgCamInfo_c* dComIfGp_getMesgCameraInfo(); +DUSK_NOINLINE void dComIfGp_setMesgCameraTagInfo(int id); +DUSK_NOINLINE void dComIfGp_clearMesgCameraTagInfo(); +DUSK_NOINLINE void dComIfGp_setMesgCameraAttrInfo(int param_1); +DUSK_NOINLINE void dComIfGp_clearMesgCameraAttrInfo(); +DUSK_NOINLINE void dComIfGp_setMesgCameraInfoActor(fopAc_ac_c* param_1, fopAc_ac_c* param_2, + fopAc_ac_c* param_3, fopAc_ac_c* param_4, fopAc_ac_c* param_5, fopAc_ac_c* param_6, + fopAc_ac_c* param_7, fopAc_ac_c* param_8, fopAc_ac_c* param_9, fopAc_ac_c* param_10); +DUSK_NOINLINE u32 dComIfGp_checkPlayerStatus0(int param_0, u32 flag); +DUSK_NOINLINE u32 dComIfGp_checkPlayerStatus1(int param_0, u32 flag); +DUSK_NOINLINE void dComIfGp_setPlayerStatus0(int param_0, u32 flag); +DUSK_NOINLINE void dComIfGp_setPlayerStatus1(int param_0, u32 flag); +DUSK_NOINLINE void dComIfGp_clearPlayerStatus0(int param_0, u32 flag); +DUSK_NOINLINE void dComIfGp_clearPlayerStatus1(int param_0, u32 flag); +DUSK_NOINLINE void dComIfGp_setCurrentWindow(dDlst_window_c* i_window); +DUSK_NOINLINE void dComIfGp_setCurrentView(view_class* i_view); +DUSK_NOINLINE void dComIfGp_setCurrentViewport(view_port_class* i_viewport); +DUSK_NOINLINE J2DGrafContext* dComIfGp_getCurrentGrafPort(); +DUSK_NOINLINE void dComIfGp_setCurrentGrafPort(J2DOrthoGraph* i_graf); +DUSK_NOINLINE void* dComIfGp_getItemTable(); +DUSK_NOINLINE void dComIfGp_setItemTable(void* data); +DUSK_NOINLINE char* dComIfGp_getLastPlayStageName(); +DUSK_NOINLINE void dComIfGp_setLastPlayStageName(char* name); +DUSK_NOINLINE void dComIfGp_init(); +DUSK_NOINLINE void dComIfGp_itemDataInit(); +DUSK_NOINLINE void dComIfGp_setItemBombNumCount(u8 i_item, s16 count); +DUSK_NOINLINE s16 dComIfGp_getItemBombNumCount(u8 i_no); +DUSK_NOINLINE void dComIfGp_clearItemBombNumCount(u8 i_no); +DUSK_NOINLINE s16 dComIfGp_getItemMaxBombNumCount(); +DUSK_NOINLINE void dComIfGp_setNowVibration(u8 status); +DUSK_NOINLINE u32 dComIfGp_getNowVibration(); +DUSK_NOINLINE void dComIfGp_particle_create(); +DUSK_NOINLINE void dComIfGp_createSimpleModel(); +DUSK_NOINLINE void dComIfGp_deleteSimpleModel(); +DUSK_NOINLINE void dComIfGp_drawSimpleModel(); +DUSK_NOINLINE int dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG); +DUSK_NOINLINE void dComIfGp_removeSimpleModel(J3DModelData* i_modelData, int roomNo); +DUSK_NOINLINE void dComIfGp_entrySimpleModel(J3DModel* model, int roomNo); +DUSK_NOINLINE void dComIfG_ct(); +DUSK_NOINLINE dBgS& dComIfG_Bgsp(); +DUSK_NOINLINE dCcS* dComIfG_Ccsp(); +DUSK_NOINLINE dCcS& dComIfG_Ccsp2(); +DUSK_NOINLINE void dComIfG_setTimerNowTimeMs(int time); +DUSK_NOINLINE int dComIfG_getTimerNowTimeMs(); +DUSK_NOINLINE void dComIfG_setTimerLimitTimeMs(int i_time); +DUSK_NOINLINE int dComIfG_getTimerLimitTimeMs(); +DUSK_NOINLINE void dComIfG_setTimerMode(int mode); +DUSK_NOINLINE int dComIfG_getTimerMode(); +DUSK_NOINLINE void dComIfG_setTimerType(u8 i_type); +DUSK_NOINLINE u8 dComIfG_getTimerType(); +DUSK_NOINLINE void dComIfG_setTimerPtr(dTimer_c* i_ptr); +DUSK_NOINLINE dTimer_c* dComIfG_getTimerPtr(); + +/** + * Attempts to add a new Object Resource Archive (*.arc) into the Resource Control. + * @param i_arcName Name of archive to be added + * @param i_mountDirection The direction to mount the archive. mDoDvd_MOUNT_DIRECTION_HEAD or + * mDoDvd_MOUNT_DIRECTION_TAIL + * @param i_heap Pointer to heap to load resources into + * @return TRUE if successful, FALSE otherwise + */ +DUSK_NOINLINE int dComIfG_setObjectRes(const char* i_arcName, u8 i_mountDirection, JKRHeap* i_heap); +DUSK_NOINLINE int dComIfG_setObjectRes( + const char* i_arcName, void* i_archiveRes, u32 i_bufferSize, JKRHeap* i_heap); + +/** + * Attempts to add a new Stage Resource Archive (*.arc) into the Resource Control. + * @param i_arcName Name of archive to be added + * @param i_heap Pointer to heap to load resources into + * @return TRUE if successful, FALSE otherwise + */ +DUSK_NOINLINE int dComIfG_setStageRes(const char* i_arcName, JKRHeap* i_heap); +DUSK_NOINLINE int dComIfG_syncObjectRes(const char* i_arcName); +DUSK_NOINLINE int dComIfG_syncStageRes(const char* i_arcName); +DUSK_NOINLINE int dComIfG_deleteObjectResMain(const char* i_arcName); +DUSK_NOINLINE int dComIfG_deleteStageRes(const char* i_arcName); +DUSK_NOINLINE void* dComIfG_getStageRes(const char* i_arcName, const char* i_resName); +DUSK_NOINLINE void* dComIfG_getObjectRes(const char* i_arcName, const char* i_resName); +DUSK_NOINLINE void* dComIfG_getObjectRes(const char* i_arcName, int i_index); +DUSK_NOINLINE void dComIfG_dumpResControl(); +DUSK_NOINLINE dRes_info_c* dComIfG_getObjectResInfo(const char* i_arcName); +DUSK_NOINLINE dRes_info_c* dComIfG_getStageResInfo(const char* i_arcName); +DUSK_NOINLINE int dComIfG_syncAllObjectRes(); +DUSK_NOINLINE void* dComIfG_getObjectIDRes(const char* i_arcName, u16 i_resID); +DUSK_NOINLINE int dComIfG_getObjctResName2Index(const char* i_arcName, const char* i_resName); +DUSK_NOINLINE u8 dComIfG_getBrightness(); +DUSK_NOINLINE void dComIfG_setBrightness(u8 brightness); +DUSK_NOINLINE BOOL dComIfG_isDebugMode(); +DUSK_NOINLINE u32 dComIfG_getTrigB(u32 i_padNo); +#if DEBUG +DUSK_NOINLINE u32 dComIfG_getObjectAllSize(); +DUSK_NOINLINE u32 dComIfG_getStageAllSize(); +DUSK_NOINLINE u32 dComIfG_getObjectSize(const char* i_arcName); +DUSK_NOINLINE u32 dComIfG_getStageSize(const char* i_arcName); +DUSK_NOINLINE void dComIfG_initStopwatch(); +#endif + +DUSK_NOINLINE int dComIfGd_setRealShadow(u32 param_0, s8 param_1, J3DModel* param_2, cXyz* param_3, + f32 param_4, f32 param_5, dKy_tevstr_c* param_6); +DUSK_NOINLINE int dComIfGd_setSimpleShadow( + cXyz* pos, f32 param_1, f32 param_2, cXyz* param_3, s16 angle, f32 param_5, TGXTexObj* tex); +DUSK_NOINLINE bool dComIfGd_addRealShadow(u32 key, J3DModel* model); +DUSK_NOINLINE void dComIfGd_drawListItem3d(); + +#if VERSION > VERSION_GCN_JPN +DUSK_NOINLINE void dComIfGd_drawListCursor(); +#endif + +DUSK_NOINLINE void dComIfGd_reset(); +DUSK_NOINLINE void dComIfGd_set2DOpa(dDlst_base_c* dlst); +DUSK_NOINLINE void dComIfGd_set2DXlu(dDlst_base_c* dlst); +DUSK_NOINLINE void dComIfGd_set2DOpaTop(dDlst_base_c* dlst); +DUSK_NOINLINE void dComIfGd_setCopy2D(dDlst_base_c* dlst); +DUSK_NOINLINE view_class* dComIfGd_getView(); +DUSK_NOINLINE Mtx44* dComIfGd_getProjViewMtx(); +DUSK_NOINLINE MtxP dComIfGd_getInvViewMtx(); +DUSK_NOINLINE view_port_class* dComIfGd_getViewport(); +DUSK_NOINLINE MtxP dComIfGd_getViewRotMtx(); +DUSK_NOINLINE MtxP dComIfGd_getViewMtx(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getListFilter(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getOpaListIndScreen(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getListPacket(); +DUSK_NOINLINE void dComIfGd_setListSky(); +DUSK_NOINLINE void dComIfGd_setListDark(); +DUSK_NOINLINE void dComIfGd_setListInvisisble(); +DUSK_NOINLINE void dComIfGd_setListDarkBG(); +DUSK_NOINLINE void dComIfGd_setXluListDarkBG(); +DUSK_NOINLINE void dComIfGd_setList(); +DUSK_NOINLINE void dComIfGd_setListItem3D(); +DUSK_NOINLINE void dComIfGd_setList3Dlast(); +DUSK_NOINLINE void dComIfGd_setXluList2DScreen(); +DUSK_NOINLINE void dComIfGd_setXluListBG(); +DUSK_NOINLINE void dComIfGd_setListBG(); +DUSK_NOINLINE void dComIfGd_setListIndScreen(); +DUSK_NOINLINE void dComIfGd_setListMiddle(); +DUSK_NOINLINE void dComIfGd_setListZxlu(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getOpaList(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getOpaListBG(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getOpaListDark(); +DUSK_NOINLINE J3DDrawBuffer* dComIfGd_getXluListBG(); +DUSK_NOINLINE void dComIfGd_setListFilter(); +DUSK_NOINLINE void dComIfGd_init(); +DUSK_NOINLINE void dComIfGd_peekZ(s16 param_0, s16 param_1, u32* param_2); +DUSK_NOINLINE void dComIfGd_peekZdata(); +DUSK_NOINLINE void dComIfGd_setView(view_class* view); +DUSK_NOINLINE void dComIfGd_setWindow(dDlst_window_c* window); +DUSK_NOINLINE void dComIfGd_setViewport(view_port_class* port); +DUSK_NOINLINE void dComIfGd_entryZSortListZxlu(J3DPacket* i_packet, cXyz& param_1); +DUSK_NOINLINE void dComIfGd_entryZSortXluList(J3DPacket* i_packet, cXyz& param_1); +DUSK_NOINLINE void dComIfGd_drawCopy2D(); +DUSK_NOINLINE void dComIfGd_drawOpaListSky(); +DUSK_NOINLINE void dComIfGd_drawXluListSky(); +DUSK_NOINLINE void dComIfGd_drawOpaListBG(); +DUSK_NOINLINE void dComIfGd_drawOpaListDarkBG(); +DUSK_NOINLINE void dComIfGd_drawOpaListMiddle(); +DUSK_NOINLINE void dComIfGd_drawOpaList(); +DUSK_NOINLINE void dComIfGd_drawOpaListDark(); +DUSK_NOINLINE void dComIfGd_drawOpaListPacket(); +DUSK_NOINLINE void dComIfGd_drawXluListBG(); +DUSK_NOINLINE void dComIfGd_drawXluListDarkBG(); +DUSK_NOINLINE void dComIfGd_drawXluList(); +DUSK_NOINLINE void dComIfGd_drawXluListDark(); +DUSK_NOINLINE void dComIfGd_drawXluListInvisible(); +DUSK_NOINLINE void dComIfGd_drawOpaListInvisible(); +DUSK_NOINLINE void dComIfGd_drawXluListZxlu(); +DUSK_NOINLINE void dComIfGd_drawXluList2DScreen(); +DUSK_NOINLINE void dComIfGd_drawOpaList3Dlast(); +DUSK_NOINLINE void dComIfGd_draw2DOpa(); +DUSK_NOINLINE void dComIfGd_draw2DOpaTop(); +DUSK_NOINLINE void dComIfGd_draw2DXlu(); +DUSK_NOINLINE void dComIfGd_drawOpaListFilter(); +DUSK_NOINLINE void dComIfGd_drawIndScreen(); +DUSK_NOINLINE void dComIfGd_drawListZxlu(); +DUSK_NOINLINE void dComIfGd_drawShadow(Mtx param_0); +DUSK_NOINLINE void dComIfGd_imageDrawShadow(Mtx param_0); +DUSK_NOINLINE void dComIfGd_set3DlineMat(mDoExt_3DlineMat_c* param_0); +DUSK_NOINLINE void dComIfGd_set3DlineMatDark(mDoExt_3DlineMat_c* param_0); + +#if PLATFORM_WII || VERSION == VERSION_SHIELD_DEBUG +DUSK_NOINLINE void dComIfGd_setListCursor(); +#endif + +#else inline dSv_info_c* dComIfGs_getSaveInfo() { return &g_dComIfG_gameInfo.info; } @@ -1440,11 +2366,7 @@ inline BOOL dComIfGs_isTransformLV(int i_no) { return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isTransformLV(i_no); } -#if TARGET_PC -inline cXyz dComIfGs_getHorseRestartPos() { -#else inline cXyz& dComIfGs_getHorseRestartPos() { -#endif return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getPos(); } @@ -1465,11 +2387,7 @@ inline void dComIfGs_setHorseRestart(const char* i_stageName, cXyz& i_pos, s16 i g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().set(i_stageName, i_pos, i_angle, i_roomNo); } -#if TARGET_PC -inline cXyz dComIfGs_getPlayerFieldLastStayPos() { -#else inline cXyz& dComIfGs_getPlayerFieldLastStayPos() { -#endif return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getPos(); } @@ -1511,11 +2429,7 @@ inline void dComIfGs_setPlayerFieldLastStayInfo(const char* i_stage, cXyz& i_pos i_point, i_region); } -#if TARGET_PC -inline cXyz dComIfGs_getLastWarpMarkPlayerPos() { -#else inline cXyz& dComIfGs_getLastWarpMarkPlayerPos() { -#endif return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getPos(); } @@ -1853,12 +2767,6 @@ inline void dComIfGs_addDeathCount() { g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().addDeathCount(); } -#if TARGET_PC -inline u16 dComIfGs_getDeathCount() { - return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getDeathCount(); -} -#endif - inline TEXT_SPAN dComIfGs_getPlayerName() { return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getPlayerName(); } @@ -3125,133 +4033,114 @@ inline void dComIfGp_particle_calcMenu() { } inline void dComIfGp_particle_draw(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawNormal(i_drawInfo); } } inline void dComIfGp_particle_drawFog(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawNormalFog(i_drawInfo); } } inline void dComIfGp_particle_drawP1(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawNormalP1(i_drawInfo); } } inline void dComIfGp_particle_drawProjection(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawProjection(i_drawInfo); } } inline void dComIfGp_particle_drawNormalPri0_A(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawNormalPri0_A(i_drawInfo); } } inline void dComIfGp_particle_drawNormalPri0_B(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawNormalPri0_B(i_drawInfo); } } inline void dComIfGp_particle_drawFogPri0_A(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogPri0_A(i_drawInfo); } } inline void dComIfGp_particle_drawFogPri0_B(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogPri0_B(i_drawInfo); } } inline void dComIfGp_particle_drawFogPri1(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogPri1(i_drawInfo); } } inline void dComIfGp_particle_drawFogPri2(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogPri2(i_drawInfo); } } inline void dComIfGp_particle_drawFogPri3(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogPri3(i_drawInfo); } } inline void dComIfGp_particle_drawFogPri4(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogPri4(i_drawInfo); } } inline void dComIfGp_particle_drawDarkworld(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawDarkworld(i_drawInfo); } } inline void dComIfGp_particle_drawScreen(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->drawFogScreen(i_drawInfo); } } inline void dComIfGp_particle_draw2Dgame(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->draw2Dgame(i_drawInfo); } } inline void dComIfGp_particle_draw2Dfore(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->draw2Dfore(i_drawInfo); } } inline void dComIfGp_particle_draw2Dback(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->draw2Dback(i_drawInfo); } } inline void dComIfGp_particle_draw2DmenuFore(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->draw2DmenuFore(i_drawInfo); } } inline void dComIfGp_particle_draw2DmenuBack(JPADrawInfo* i_drawInfo) { - ZoneScoped; if (g_dComIfG_gameInfo.play.getParticle() != NULL) { g_dComIfG_gameInfo.play.getParticle()->draw2DmenuBack(i_drawInfo); } @@ -4771,150 +5660,114 @@ inline void dComIfGd_setViewport(view_port_class* port) { } inline void dComIfGd_entryZSortListZxlu(J3DPacket* i_packet, cXyz& param_1) { - ZoneScoped; g_dComIfG_gameInfo.drawlist.entryZSortListZxlu(i_packet, param_1); } inline void dComIfGd_entryZSortXluList(J3DPacket* i_packet, cXyz& param_1) { - ZoneScoped; g_dComIfG_gameInfo.drawlist.entryZSortXluList(i_packet, param_1); } inline void dComIfGd_drawCopy2D() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawCopy2D(); } inline void dComIfGd_drawOpaListSky() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListSky(); } inline void dComIfGd_drawXluListSky() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListSky(); } inline void dComIfGd_drawOpaListBG() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListBG(); } inline void dComIfGd_drawOpaListDarkBG() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListDarkBG(); } inline void dComIfGd_drawOpaListMiddle() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListMiddle(); } inline void dComIfGd_drawOpaList() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaList(); } inline void dComIfGd_drawOpaListDark() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListDark(); } inline void dComIfGd_drawOpaListPacket() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListPacket(); } inline void dComIfGd_drawXluListBG() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListBG(); } inline void dComIfGd_drawXluListDarkBG() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListDarkBG(); } inline void dComIfGd_drawXluList() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluList(); } inline void dComIfGd_drawXluListDark() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListDark(); } -#if TARGET_PC -void dComIfGd_drawXluListInvisible(); -#else inline void dComIfGd_drawXluListInvisible() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListInvisible(); } -#endif -#if TARGET_PC -void dComIfGd_drawOpaListInvisible(); -#else inline void dComIfGd_drawOpaListInvisible() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListInvisible(); } -#endif inline void dComIfGd_drawXluListZxlu() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListZxlu(); } inline void dComIfGd_drawXluList2DScreen() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluList2DScreen(); } inline void dComIfGd_drawOpaList3Dlast() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaList3Dlast(); } inline void dComIfGd_draw2DOpa() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.draw2DOpa(); } inline void dComIfGd_draw2DOpaTop() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.draw2DOpaTop(); } inline void dComIfGd_draw2DXlu() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.draw2DXlu(); } inline void dComIfGd_drawOpaListFilter() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListFilter(); } inline void dComIfGd_drawIndScreen() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawOpaListP0(); } inline void dComIfGd_drawListZxlu() { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawXluListZxlu(); } inline void dComIfGd_drawShadow(Mtx param_0) { - ZoneScoped; g_dComIfG_gameInfo.drawlist.drawShadow(param_0); } inline void dComIfGd_imageDrawShadow(Mtx param_0) { - ZoneScoped; g_dComIfG_gameInfo.drawlist.imageDrawShadow(param_0); } @@ -4933,4 +5786,6 @@ inline void dComIfGd_setListCursor() { } #endif +#endif + #endif /* D_COM_D_COM_INF_GAME_H */ diff --git a/include/d/d_cursor_mng.h b/include/d/d_cursor_mng.h index 38ba03f214..9837e6f1cb 100644 --- a/include/d/d_cursor_mng.h +++ b/include/d/d_cursor_mng.h @@ -95,7 +95,7 @@ class dCsr_mng_c { BOOL set(mDoGph_gInf_c::csr_c* i_csr, u16, u8, u8); }; -private: +public: dCsr_mng_c() : is_csr_on(true) { } @@ -116,7 +116,6 @@ public: static dCsr_mng_c* m_myObj; -private: /* 0x00 */ list_c m_csr_list; /* 0x08 */ list_c m_obj_list; /* 0x10 */ bool is_csr_on; diff --git a/include/d/d_demo.h b/include/d/d_demo.h index 8eef24d7e3..a35c44e0ed 100644 --- a/include/d/d_demo.h +++ b/include/d/d_demo.h @@ -155,7 +155,6 @@ public: f32 getAnmTransition() { return mAnmTransition; } u32 getShapeId() { return mShape; } -private: /* 0x04 */ u16 mFlags; /* 0x08 */ cXyz mTrans; /* 0x14 */ cXyz mScale; @@ -220,7 +219,6 @@ public: f32 getFovy() { return mProjFovy; } f32 getRoll() { return mViewRoll; } -private: /* 0x04 */ u8 mFlags; /* 0x08 */ f32 mProjNear; /* 0x0C */ f32 mProjFar; @@ -247,7 +245,6 @@ public: void onEnable(u8 flag) { mFlags |= flag; } -private: /* 0x04 */ u8 mFlags; /* 0x05 */ GXColor mColor; }; @@ -275,7 +272,6 @@ public: void onEnable(u8 flag) { mFlags |= flag; } -private: /* 0x04 */ u8 mFlags; /* 0x08 */ JStage::TELight mLightType; /* 0x0C */ GXDistAttnFn mDistAttenFn; @@ -309,7 +305,6 @@ public: void onEnable(u8 flag) { mFlags |= flag; } -private: /* 0x04 */ u8 mFlags; /* 0x05 */ s8 mFogType; /* 0x08 */ f32 mStartZ; @@ -327,7 +322,6 @@ public: void setObject(dDemo_object_c* i_object) { mpObject = i_object; } -private: /* 0x4 */ dDemo_object_c* mpObject; }; diff --git a/include/d/d_drawlist.h b/include/d/d_drawlist.h index 25d92aff54..7965793dcf 100644 --- a/include/d/d_drawlist.h +++ b/include/d/d_drawlist.h @@ -107,7 +107,6 @@ public: mRnd.init(r0, r1, r2); } -private: /* 0x04 */ cM_rnd_c mRnd; /* 0x10 */ cXyz field_0x10; /* 0x1C */ GXColor mLineColor; @@ -129,7 +128,6 @@ public: void setAlpha(u8 alpha) { mAlpha = alpha; } J2DPicture* getPicture() { return &mpPicture; } -private: /* 0x004 */ u8 field_0x4; /* 0x008 */ J2DPicture mpPicture; /* 0x158 */ s16 mPosX; @@ -271,7 +269,6 @@ public: void setZsortNext(dDlst_shadowReal_c* next) { mZsortNext = next; } void setZsortPre(dDlst_shadowReal_c* pre) { mZsortPre = pre; } -private: /* 0x0000 */ u8 mState; /* 0x0001 */ u8 field_0x1; /* 0x0002 */ u8 mModelNum; @@ -303,7 +300,6 @@ public: static DUSK_GAME_DATA TGXTexObj mSimpleTexObj; -private: /* 0x00000 */ u8 field_0x0; /* 0x00001 */ u8 mRealNum; /* 0x00002 */ u8 mSimpleNum; @@ -332,7 +328,6 @@ public: view_port_class* getViewPort() { return &mViewport; } scissor_class* getScissor() { return &mViewport.scissor; } -private: /* 0x00 */ view_port_class mViewport; /* 0x28 */ s8 mCameraID; /* 0x29 */ u8 mMode; @@ -518,7 +513,6 @@ public: static DUSK_GAME_DATA f32 mWipeSpeed; static DUSK_GAME_DATA u8 mWipe; -private: /* 0x00000 */ J3DDrawBuffer* mDrawBuffers[DB_LIST_MAX]; /* 0x00054 */ dDlst_base_c* mpCopy2DDrawLists[4]; /* 0x00064 */ dDlst_base_c** mpCopy2DStart; diff --git a/include/d/d_event_data.h b/include/d/d_event_data.h index eef55b1164..809ab93eef 100644 --- a/include/d/d_event_data.h +++ b/include/d/d_event_data.h @@ -190,7 +190,6 @@ public: int getCurrentCut() { return mCurrentCut; } int getStartCut() { return mStartCut; } - // private: /* 0x00 */ char mName[8]; /* 0x08 */ u8 mWork[0x18]; // PROBLEM: this buffer is now too small for StaffWork to fit in /* 0x20 */ BE(s32) mTagID; @@ -293,7 +292,6 @@ public: static const int FlagMax = 0x2800; -private: u32 mFlags[320]; }; // Size = 0x500 @@ -346,7 +344,6 @@ public: void setIDataP(int* p_idata) { mIDataP = p_idata; } void setSDataP(char* p_sdata) { mSDataP = p_sdata; } - // private: /* 0x00 */ event_binary_data_header* mHeaderP; /* 0x04 */ dEvDtEvent_c* mEventP; /* 0x08 */ dEvDtStaff_c* mStaffP; diff --git a/include/d/d_event_manager.h b/include/d/d_event_manager.h index de046797ff..75aa5a4a03 100644 --- a/include/d/d_event_manager.h +++ b/include/d/d_event_manager.h @@ -112,7 +112,6 @@ public: dEvM_HIO_c& getEventHIO(); #endif -private: /* 0x000 */ dEvDtBase_c mEventList[BASE_MAX]; /* 0x18C */ int mCameraPlay; /* 0x190 */ dEvent_exception_c mException; diff --git a/include/d/d_file_sel_info.h b/include/d/d_file_sel_info.h index 37dadbeb1b..89c4272b22 100644 --- a/include/d/d_file_sel_info.h +++ b/include/d/d_file_sel_info.h @@ -37,7 +37,6 @@ public: CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; } void draw() { _draw(); } -// private: /* 0x04 */ JKRArchive* mArchive; /* 0x08 */ dDlst_FileInfo_c mFileInfo; /* 0x1C */ u8 field_0x1c[4]; diff --git a/include/d/d_kantera_icon_meter.h b/include/d/d_kantera_icon_meter.h index 67e2dff278..cf1464e82f 100644 --- a/include/d/d_kantera_icon_meter.h +++ b/include/d/d_kantera_icon_meter.h @@ -13,7 +13,6 @@ public: void setScreen(J2DScreen* screen) { mp_scrn = screen; } J2DScreen* getScreen() { return mp_scrn; } -private: /* 0x04 */ J2DScreen* mp_scrn; }; @@ -30,7 +29,6 @@ public: void drawSelf() { mpKanteraIcon->draw(); } -// private: /* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon; /* 0x08 */ CPaneMgr* mpParent; /* 0x0C */ CPaneMgr* mpGauge; diff --git a/include/d/d_ky_thunder.h b/include/d/d_ky_thunder.h index 1e174ad6f8..5a72252a9a 100644 --- a/include/d/d_ky_thunder.h +++ b/include/d/d_ky_thunder.h @@ -25,7 +25,6 @@ public: ~dThunder_c() { mDoExt_destroySolidHeap(mpHeap); } -private: /* 0x0F8 */ JKRSolidHeap* mpHeap; /* 0x0FC */ dThunder_modelInfo_c mModelInfo; /* 0x138 */ cXyz field_0x138; diff --git a/include/d/d_map.h b/include/d/d_map.h index b42def27c7..b70238cc46 100644 --- a/include/d/d_map.h +++ b/include/d/d_map.h @@ -134,7 +134,6 @@ public: static const int PALETTE_NUMBER = 50; #endif -private: /* 0x34 */ s32 m_outSideBlackLineCnt; /* 0x38 */ s32 field_0x38; /* 0x3C */ s32 field_0x3c; @@ -199,7 +198,6 @@ public: static dMap_c* m_mySelfPointer; -private: /* 0x40 */ dMap_prm_res_s* m_res_src; /* 0x44 */ dMap_prm_res_s* m_res; /* 0x48 */ ResTIMG* mResTIMG; diff --git a/include/d/d_menu_collect.h b/include/d/d_menu_collect.h index 0811fb00a6..d2a4028b2e 100644 --- a/include/d/d_menu_collect.h +++ b/include/d/d_menu_collect.h @@ -129,7 +129,6 @@ public: J2DPicture* getBlackTex() { return mpBlackTex; } u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; } -// private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ JKRExpHeap* mpSubHeap; /* 0x00C */ void* field_0xc; @@ -225,7 +224,6 @@ public: static DUSK_GAME_DATA f32 mViewOffsetY; -private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ JKRSolidHeap* mpSolidHeap; /* 0x00C */ dMenu_Collect2D_c* mpCollect2D; @@ -260,7 +258,6 @@ public: bool isKeyCheck() { return mpCollect2D->isKeyCheck(); } bool isOutCheck() { return mpCollect2D->isOutCheck(); } -private: /* 0x4 */ dMenu_Collect2D_c* mpCollect2D; /* 0x8 */ dMenu_Collect3D_c* mpCollect3D; }; diff --git a/include/d/d_menu_dmap.h b/include/d/d_menu_dmap.h index 4d1341cc67..039b42aab2 100644 --- a/include/d/d_menu_dmap.h +++ b/include/d/d_menu_dmap.h @@ -255,7 +255,6 @@ public: static DUSK_GAME_DATA dMenu_Dmap_c* myclass; -private: /* 0x004 */ dMenu_DmapMapCtrl_c* mMapCtrl; /* 0x008 */ dMenu_DmapBg_c* mpDrawBg; /* 0x00C */ u8 field_0xc[0x10 - 0xC]; diff --git a/include/d/d_menu_fishing.h b/include/d/d_menu_fishing.h index f2e9419ce3..b3b451c968 100644 --- a/include/d/d_menu_fishing.h +++ b/include/d/d_menu_fishing.h @@ -43,7 +43,6 @@ public: u8 getStatus() { return mStatus; } -// private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ JKRArchive* mpArchive; /* 0x00C */ STControl* mpStick; diff --git a/include/d/d_menu_fmap.h b/include/d/d_menu_fmap.h index 2e5ee95772..3104d7e76b 100644 --- a/include/d/d_menu_fmap.h +++ b/include/d/d_menu_fmap.h @@ -270,7 +270,6 @@ public: static DUSK_GAME_DATA dMenu_Fmap_c* MyClass; -// private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ JKRExpHeap* mpTalkHeap; /* 0x00C */ STControl* mpStick; diff --git a/include/d/d_menu_insect.h b/include/d/d_menu_insect.h index 5e0b453949..43f4af0602 100644 --- a/include/d/d_menu_insect.h +++ b/include/d/d_menu_insect.h @@ -60,7 +60,6 @@ public: u8 getStatus() { return mStatus; } -// private: /* 0x04 */ JKRExpHeap* mpHeap; /* 0x08 */ JKRArchive* mpArchive; /* 0x0C */ STControl* mpStick; diff --git a/include/d/d_menu_item_explain.h b/include/d/d_menu_item_explain.h index 7b79ebbad5..59d212e53f 100644 --- a/include/d/d_menu_item_explain.h +++ b/include/d/d_menu_item_explain.h @@ -51,7 +51,6 @@ public: field_0xd8 = y; } -private: /* 0x04 */ JKRExpHeap* mpHeap; /* 0x08 */ JKRArchive* mpArchive; /* 0x0C */ dMsgString_c* mpInfoString; diff --git a/include/d/d_menu_letter.h b/include/d/d_menu_letter.h index 21747c7e78..8e112f04d2 100644 --- a/include/d/d_menu_letter.h +++ b/include/d/d_menu_letter.h @@ -64,7 +64,6 @@ public: u8 getStatus() { return mStatus; } -// private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ JKRArchive* mpArchive; /* 0x00C */ STControl* mpStick; diff --git a/include/d/d_menu_option.h b/include/d/d_menu_option.h index f158498dd7..ff4b84f5e3 100644 --- a/include/d/d_menu_option.h +++ b/include/d/d_menu_option.h @@ -117,7 +117,6 @@ public: return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false; } -// private: /* 0x004 */ J2DScreen* mpBackScreen; /* 0x008 */ J2DScreen* mpScreen; /* 0x00C */ J2DScreen* mpClipScreen; diff --git a/include/d/d_menu_ring.h b/include/d/d_menu_ring.h index d0f021339e..fa4f97496f 100644 --- a/include/d/d_menu_ring.h +++ b/include/d/d_menu_ring.h @@ -84,7 +84,6 @@ public: void drawFlag0() { mDrawFlag = 0; } void setStatus(u8 i_status) { mStatus = i_status; } -// private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ STControl* mpStick; /* 0x00C */ CSTControl* mpCStick; diff --git a/include/d/d_menu_save.h b/include/d/d_menu_save.h index 7e94d1d1c9..a237bbb849 100644 --- a/include/d/d_menu_save.h +++ b/include/d/d_menu_save.h @@ -27,7 +27,6 @@ public: void setScrnExplain(dMsgScrnExplain_c* p_scrn) { mpScrn = p_scrn; } -private: /* 0x4 */ dMsgScrnExplain_c* mpScrn; }; @@ -278,7 +277,6 @@ public: u8 getEndStatus() { return mEndStatus; } void setUseType(u8 type) { mUseType = type; } -// private: /* 0x0004 */ JKRArchive* mpArchive; /* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount; /* 0x000C */ STControl* stick; diff --git a/include/d/d_menu_skill.h b/include/d/d_menu_skill.h index d21332c341..2c2dc445d1 100644 --- a/include/d/d_menu_skill.h +++ b/include/d/d_menu_skill.h @@ -58,7 +58,6 @@ public: u8 getStatus() { return mStatus; } -// private: /* 0x004 */ JKRExpHeap* mpHeap; /* 0x008 */ JKRArchive* mpArchive; /* 0x00C */ STControl* mpStick; diff --git a/include/d/d_menu_window.h b/include/d/d_menu_window.h index 65e415077d..1c5aeadbe5 100644 --- a/include/d/d_menu_window.h +++ b/include/d/d_menu_window.h @@ -193,7 +193,6 @@ public: bool isShowFlag() { return (mShowFlag & 1) != 0; } bool isFadeNowCheck() { return mDoGph_gInf_c::getFader()->getStatus() == 1; } -private: /* 0x0FC */ int field_0xfc; /* 0x100 */ JKRExpHeap* mpHeap; /* 0x104 */ STControl* mpStick; diff --git a/include/d/d_meter2.h b/include/d/d_meter2.h index c8dc17bca8..4246d9249d 100644 --- a/include/d/d_meter2.h +++ b/include/d/d_meter2.h @@ -100,7 +100,6 @@ public: bool isShowFlag(int i_no) { return field_0x1e6 & (1 << i_no); } void onShowFlag(int i_no) { field_0x1e6 |= (1 << i_no); } -private: /* 0x0FC */ int field_0xfc; /* 0x100 */ JKRExpHeap* mpHeap; /* 0x104 */ JKRExpHeap* mpSubHeap; diff --git a/include/d/d_meter2_draw.h b/include/d/d_meter2_draw.h index aaad9dec70..c9dc8217e9 100644 --- a/include/d/d_meter2_draw.h +++ b/include/d/d_meter2_draw.h @@ -154,7 +154,6 @@ public: } #endif -// private: /* 0x004 */ item_params mItemParams[4]; /* 0x074 */ JKRExpHeap* heap; /* 0x078 */ J2DScreen* mpScreen; diff --git a/include/d/d_meter2_info.h b/include/d/d_meter2_info.h index 410cf642b1..377f51c34b 100644 --- a/include/d/d_meter2_info.h +++ b/include/d/d_meter2_info.h @@ -328,6 +328,150 @@ void dMeter2Info_onWide2D(); void dMeter2Info_offWide2D(); #endif +#if TARGET_PC +DUSK_NOINLINE void dMeter2Info_Initialize(); +DUSK_NOINLINE dMeterMap_c* dMeter2Info_getMeterMapClass(); +DUSK_NOINLINE dMw_c* dMeter2Info_getMenuWindowClass(); +DUSK_NOINLINE void dMeter2Info_setWindowStatus(u8 i_status); +DUSK_NOINLINE CPaneMgr* dMeter2Info_getMeterItemPanePtr(s32 i_idx); +DUSK_NOINLINE void dMeter2Info_getString( + u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry); +DUSK_NOINLINE void dMeter2Info_getStringKanji( + u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry); +DUSK_NOINLINE void dMeter2Info_getStringKana( + u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry); +DUSK_NOINLINE f32 dMeter2Info_getStringLength( + JUTFont* i_font, f32 param_2, f32 param_3, char* i_string); +DUSK_NOINLINE f32 dMeter2Info_getStringLength(J2DTextBox* i_textbox, char* i_string); +DUSK_NOINLINE void dMeter2Info_setHotSpringTimer(u8 i_slotNo); +DUSK_NOINLINE u16 dMeter2Info_getOilGaugeBackUp(); +DUSK_NOINLINE void dMeter2Info_setOilGaugeBackUp(u16 param_1); +DUSK_NOINLINE void dMeter2Info_setSaveStageName(const char* i_stageName); +DUSK_NOINLINE u8 dMeter2Info_getInsectSelectType(); +DUSK_NOINLINE void dMeter2Info_setInsectSelectType(u8 i_type); +DUSK_NOINLINE u8 dMeter2Info_getWarpStatus(); +DUSK_NOINLINE void dMeter2Info_setWarpStatus(u8 i_status); +DUSK_NOINLINE int dMeter2Info_readItemTexture(u8 i_itemNo, void* i_texBuf1, J2DPicture* i_pic1, + void* i_texBuf2, J2DPicture* i_pic2, void* i_texBuf3, J2DPicture* i_pic3, void* i_texBuf4, + J2DPicture* i_pic4, int param_9); +DUSK_NOINLINE void dMeter2Info_setItemColor( + u8 i_itemNo, J2DPicture* i_pic1, J2DPicture* i_pic2, J2DPicture* i_pic3, J2DPicture* i_pic4); +DUSK_NOINLINE u8 dMeter2Info_getWarpRoomNo(); +DUSK_NOINLINE u8 dMeter2Info_getWarpPlayerNo(); +DUSK_NOINLINE cXyz& dMeter2Info_getWarpPos(); +DUSK_NOINLINE const char* dMeter2Info_getWarpStageName(); +DUSK_NOINLINE void dMeter2Info_setNowCount(u8 i_count); +DUSK_NOINLINE void dMeter2Info_setMaxCount(u8 i_count); +DUSK_NOINLINE BOOL dMeter2Info_isDirectUseItem(int param_0); +DUSK_NOINLINE bool dMeter2Info_isUseButton(int i_buttonBit); +DUSK_NOINLINE void dMeter2Info_setMeterMapClass(dMeterMap_c* i_map); +DUSK_NOINLINE void dMeter2Info_decHotSpringTimer(); +DUSK_NOINLINE void dMeter2Info_allUseButton(); +DUSK_NOINLINE void dMeter2Info_offUseButton(int i_buttonBit); +DUSK_NOINLINE void dMeter2Info_resetGameStatus(); +DUSK_NOINLINE void dMeter2Info_onGameStatus(int i_status); +DUSK_NOINLINE void dMeter2Info_setMapStatus(u8 i_status); +DUSK_NOINLINE u8 dMeter2Info_getMapStatus(); +DUSK_NOINLINE void dMeter2Info_setPauseStatus(u8 i_status); +DUSK_NOINLINE void dMeter2Info_resetPauseStatus(); +DUSK_NOINLINE u8 dMeter2Info_getPauseStatus(); +DUSK_NOINLINE bool dMeter2Info_isGameStatus(int i_status); +DUSK_NOINLINE bool dMeter2Info_isTouchKeyCheck(int i_status); +DUSK_NOINLINE void dMeter2Info_setMapKeyDirection(u16 i_direction); +DUSK_NOINLINE bool dMeter2Info_isSub2DStatus(int i_flag); +DUSK_NOINLINE void dMeter2Info_offMenuInForce(int i_flag); +DUSK_NOINLINE bool dMeter2Info_isMenuInForce(int i_flag); +DUSK_NOINLINE void dMeter2Info_setMenuWindowClass(dMw_c* i_menu); +DUSK_NOINLINE void dMeter2Info_resetWarpStatus(); +DUSK_NOINLINE u16 dMeter2Info_getMapKeyDirection(); +DUSK_NOINLINE u8 dMeter2Info_getWindowStatus(); +DUSK_NOINLINE void dMeter2Info_setMsgResource(void* i_res); +DUSK_NOINLINE void dMeter2Info_setStageMsgResource(void* i_res); +DUSK_NOINLINE void dMeter2Info_setMsgUnitResource(void* i_res); +DUSK_NOINLINE void* dMeter2Info_getMsgResource(); +DUSK_NOINLINE void* dMeter2Info_getStageMsgResource(); +DUSK_NOINLINE void* dMeter2Info_getMsgUnitResource(); +DUSK_NOINLINE u8 dMeter2Info_getLightDropGetFlag(int i_no); +DUSK_NOINLINE s32 dMeter2Info_getMeterStringType(); +DUSK_NOINLINE void dMeter2Info_setMeterClass(dMeter2_c* i_meter); +DUSK_NOINLINE void dMeter2Info_onLifeGaugeSE(); +DUSK_NOINLINE void dMeter2Info_offLifeGaugeSE(); +DUSK_NOINLINE u8 dMeter2Info_getLifeGaugeSE(); +DUSK_NOINLINE const char* dMeter2Info_getSaveStageName(); +DUSK_NOINLINE void dMeter2Info_onShopTalkFlag(); +DUSK_NOINLINE void dMeter2Info_setLightDropGetFlag(int i_no, u8 i_flag); +DUSK_NOINLINE u8 dMeter2Info_getRentalBombBag(); +DUSK_NOINLINE u8 dMeter2Info_getMiniGameItemSetFlag(); +DUSK_NOINLINE void dMeter2Info_setMiniGameItem(u8 i_minigameFlag); +DUSK_NOINLINE void dMeter2Info_resetMiniGameItem(bool i_saveItem); +DUSK_NOINLINE void dMeter2Info_setTableMapRegionNo(u8 i_regionNo); +DUSK_NOINLINE void dMeter2Info_setGoldWolfMapType(u8 i_mapType); +DUSK_NOINLINE void dMeter2Info_changeWater(u8 i_slotNo); +DUSK_NOINLINE void dMeter2Info_warpInProc(); +DUSK_NOINLINE void dMeter2Info_warpOutProc(); +DUSK_NOINLINE dMeter2_c* dMeter2Info_getMeterClass(); +DUSK_NOINLINE s16 dMeter2Info_getMsgKeyWaitTimer(); +DUSK_NOINLINE void dMeter2Info_onDirectUseItem(int param_0); +DUSK_NOINLINE void dMeter2Info_setFloatingFlow(u16 i_flowID, s16 i_msgTimer, bool i_wakuVisible); +DUSK_NOINLINE u8 dMeter2Info_getGameOverType(); +DUSK_NOINLINE void dMeter2Info_setGameOverType(u8 i_gameoverType); +DUSK_NOINLINE void dMeter2Info_setMsgKeyWaitTimer(s16 i_waitTimer); +DUSK_NOINLINE s32 dMeter2Info_getMsgTimeMs(); +DUSK_NOINLINE s32 dMeter2Info_getTimeMs(); +DUSK_NOINLINE void dMeter2Info_setMsgTimeMs(s32 i_msgTime); +DUSK_NOINLINE void dMeter2Info_setTimeMs(s32 i_time); +DUSK_NOINLINE u8 dMeter2Info_getNowCount(); +DUSK_NOINLINE u8 dMeter2Info_getMaxCount(); +DUSK_NOINLINE void dMeter2Info_setScopeZoomPointer(u8 param_0); +DUSK_NOINLINE void dMeter2Info_decMsgKeyWaitTimer(); +DUSK_NOINLINE bool dMeter2Info_isFloatingMessageVisible(); +DUSK_NOINLINE u8 dMeter2Info_getItemExplainWindowStatus(); +DUSK_NOINLINE void dMeter2Info_setItemExplainWindowStatus(u8 i_value); +DUSK_NOINLINE void dMeter2Info_resetDirectUseItem(); +DUSK_NOINLINE u16 dMeter2Info_getFloatingFlowID(); +DUSK_NOINLINE u8 dMeter2Info_getCollectCursorPosX(); +DUSK_NOINLINE u8 dMeter2Info_getCollectCursorPosY(); +DUSK_NOINLINE void dMeter2Info_setCollectCursorPosXY(u8 x, u8 y); +DUSK_NOINLINE void dMeter2Info_onBlinkButton(int i_flag); +DUSK_NOINLINE bool dMeter2Info_isFloatingMessageWakuVisible(); +DUSK_NOINLINE bool dMeter2Info_isBlinkButton(int i_flag); +DUSK_NOINLINE void dMeter2Info_resetBlinkButton(); +DUSK_NOINLINE void dMeter2Info_resetFloatingMessage(); +DUSK_NOINLINE s16 dMeter2Info_decFloatingMessageTimer(); +DUSK_NOINLINE s16 dMeter2Info_getFloatingMessageTimer(); +DUSK_NOINLINE u16 dMeter2Info_getFloatingMessageID(); +DUSK_NOINLINE s16 dMeter2Info_getHorseLifeCount(); +DUSK_NOINLINE void dMeter2Info_setMeterString(s32 i_string); +DUSK_NOINLINE void dMeter2Info_resetMeterString(); +DUSK_NOINLINE void dMeter2Info_setMeterItemPanePtr(int i_no, CPaneMgr* i_pane); +DUSK_NOINLINE bool dMeter2Info_isShopTalkFlag(); +DUSK_NOINLINE void dMeter2Info_setMapDrugFlag(bool i_flag); +DUSK_NOINLINE bool dMeter2Info_isTempBit(int i_bit); +DUSK_NOINLINE void dMeter2Info_offSub2DStatus(int i_bit); +DUSK_NOINLINE void dMeter2Info_onSub2DStatus(int i_bit); +DUSK_NOINLINE void dMeter2Info_set2DWidth(f32 i_width); +DUSK_NOINLINE void dMeter2Info_set2DHeight(f32 i_height); +DUSK_NOINLINE void dMeter2Info_set2DPosH(f32 i_posH); +DUSK_NOINLINE void dMeter2Info_set2DPosV(f32 i_posV); +DUSK_NOINLINE void dMeter2Info_offShopTalkFlag(); +DUSK_NOINLINE void dMeter2Info_onUseButton(int i_button); +DUSK_NOINLINE f32 dMeter2Info_get2DWidth(); +DUSK_NOINLINE f32 dMeter2Info_get2DHeight(); +DUSK_NOINLINE void dMeter2Info_setWarpInfo(const char* i_stageName, const cXyz& i_position, + s16 i_angle, u8 i_roomNo, u8 param_4, u8 i_warpPlayerNo); +DUSK_NOINLINE u8 dMeter2Info_getTableMapRegionNo(); +DUSK_NOINLINE u8 dMeter2Info_getGoldWolfMapType(); +DUSK_NOINLINE bool dMeter2Info_isWindowAccept(int param_0); +DUSK_NOINLINE void dMeter2Info_setHorseLifeCount(s16 i_count); +DUSK_NOINLINE void dMeter2Info_offTempBit(int i_bit); +DUSK_NOINLINE void dMeter2Info_onTempBit(int i_bit); +DUSK_NOINLINE void dMeter2Info_setFloatingMessage(u16 i_msgID, s16 i_msgTimer, bool i_wakuVisible); +DUSK_NOINLINE void dMeter2Info_setMiniGameCount(s8 i_count); +DUSK_NOINLINE void dMeter2Info_onWindowAccept(int param_0); +DUSK_NOINLINE void dMeter2Info_offWindowAccept(int param_0); +DUSK_NOINLINE void dMeter2Info_onMenuInForce(int param_0); + +#else inline void dMeter2Info_Initialize() { g_meter2_info.init(); } @@ -865,4 +1009,6 @@ inline void dMeter2Info_onMenuInForce(int param_0) { g_meter2_info.onMenuInForce(param_0); } +#endif + #endif /* D_METER_D_METER2_INFO_H */ diff --git a/include/d/d_meter_map.h b/include/d/d_meter_map.h index b17f51846e..648fb5aef5 100644 --- a/include/d/d_meter_map.h +++ b/include/d/d_meter_map.h @@ -102,7 +102,6 @@ public: /* 0x04 */ u8 field_0x4_debug; /* 0x08 */ int field_0x8_debug; #endif -private: /* 0x04 */ J2DPicture* mMapJ2DPicture; /* 0x08 */ dMap_c* mMap; /* 0x0C */ s32 mIsCompass; diff --git a/include/d/d_model.h b/include/d/d_model.h index 72949f5f03..466592d89c 100644 --- a/include/d/d_model.h +++ b/include/d/d_model.h @@ -33,7 +33,6 @@ public: u16 getMaterialId() { return mMaterialId; } dKy_tevstr_c* getTevstr() { return mpTevstr; } -private: /* 0x10 */ J3DModelData* mpModelData; /* 0x14 */ dKy_tevstr_c* mpTevstr; /* 0x18 */ u16 mMaterialId; @@ -55,7 +54,6 @@ public: static DUSK_GAME_DATA dMdl_mng_c* m_myObj; -private: /* 0x00 */ dMdl_c field_0x0[4]; /* 0x80 */ u8 field_0x80; }; diff --git a/include/d/d_msg_class.h b/include/d/d_msg_class.h index 2735561c05..c70345ca92 100644 --- a/include/d/d_msg_class.h +++ b/include/d/d_msg_class.h @@ -121,6 +121,25 @@ struct jmessage_tReference : public JMessage::TReference { void setDemoFrame(u32 i_frame) { mDemoFrame = i_frame; } void setTopColorType(u8 i_colorType) { mTopColorType = i_colorType; } void setNowColorType(u8 i_colorType) { mNowColorType = i_colorType; } +#if TARGET_PC + void resetColors() { + mNowCCColor = 0xFFFFFFFF; + mNowGCColor = 0xFFFFFFFF; + mTopCCColor = 0xFFFFFFFF; + mTopGCColor = 0xFFFFFFFF; + mNowFullColor = false; + mTopFullColor = false; + } + void setFullColor(u32 ccColor, u32 gcColor) { + mNowCCColor = ccColor; + mNowGCColor = gcColor; + mNowFullColor = true; + } + void clearNowFullColor() { mNowFullColor = false; } + bool hasTopFullColor() { return mTopFullColor; } + u32 getTopCCColor() { return mTopCCColor; } + u32 getTopGCColor() { return mTopGCColor; } +#endif void setTopTagScale(u16 i_tagScale) { mTopTagScale = i_tagScale; } void setNowTagScale(u16 i_tagScale) { mNowTagScale = i_tagScale; } void setRevoMessageID(u32 i_msgID) { mRevoMessageID = i_msgID; } @@ -365,6 +384,14 @@ struct jmessage_tReference : public JMessage::TReference { /* 0x1274 */ bool mSelectSetCancelFlag; /* 0x1275 */ bool mBombNameUseFlag; /* 0x1276 */ u8 mBatchColorFlag; +#if TARGET_PC + u32 mNowCCColor; + u32 mNowGCColor; + u32 mTopCCColor; + u32 mTopGCColor; + bool mNowFullColor; + bool mTopFullColor; +#endif }; // Size: 0x1278 struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor { @@ -462,6 +489,9 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor { void do_selwidthcenter(int); void do_heightcenter(); void do_color(u8); +#if TARGET_PC + void do_fullcolor(u32 ccColor, u32 gcColor); +#endif void do_scale(f32); void do_linedown(s16); void do_transY(s16, bool); @@ -640,6 +670,9 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso void do_rubystrcat(char*); void do_outfont(u8); void do_color(u8); +#if TARGET_PC + void do_fullcolor(u32 ccColor, u32 gcColor); +#endif void do_scale(f32); void do_linedown(s16); void do_numset(s16); diff --git a/include/d/d_msg_flow.h b/include/d/d_msg_flow.h index cff5857cb7..eeece6f4fa 100644 --- a/include/d/d_msg_flow.h +++ b/include/d/d_msg_flow.h @@ -188,7 +188,6 @@ public: static DUSK_GAME_DATA queryFunc mQueryList[53]; static DUSK_GAME_DATA eventFunc mEventList[43]; -private: /* 0x04 */ u8* mFlow_p; /* 0x08 */ u8* mLabelInfo_p; /* 0x0C */ union mesg_flow { diff --git a/include/d/d_msg_out_font.h b/include/d/d_msg_out_font.h index c6715757eb..3bd41ca825 100644 --- a/include/d/d_msg_out_font.h +++ b/include/d/d_msg_out_font.h @@ -25,7 +25,6 @@ public: void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; } void resetType() { mType = 0x47; } -// private: /* 0x04 */ J2DTextBox* mpTextBoxPtr; /* 0x08 */ f32 mPosX; /* 0x0C */ f32 mPosY; @@ -53,7 +52,6 @@ public: void setRupeeColor(u8 color) { mRupeeColor = color; } -// private: /* 0x004 */ COutFontSet_c* mpOfs[35]; /* 0x090 */ J2DPicture* mpPane[70]; /* 0x1A8 */ f32 mAlphaRatio; diff --git a/include/d/d_msg_scrn_3select.h b/include/d/d_msg_scrn_3select.h index 1cb92e5be6..35c831d3c5 100644 --- a/include/d/d_msg_scrn_3select.h +++ b/include/d/d_msg_scrn_3select.h @@ -60,7 +60,6 @@ public: void offAnimeUpdate(int param_0) { field_0x114 &= ~(u8)(1 << param_0); } u8 getDPDPoint() { return mDPDPoint; } -private: /* 0x004 */ J2DScreen* mpScreen; /* 0x008 */ J2DAnmTransform* mpAnmBck; /* 0x00C */ J2DAnmColorKey* mpAnmBpk; diff --git a/include/d/d_msg_scrn_boss.h b/include/d/d_msg_scrn_boss.h index d72c992b39..3adcc57289 100644 --- a/include/d/d_msg_scrn_boss.h +++ b/include/d/d_msg_scrn_boss.h @@ -15,7 +15,6 @@ public: virtual void fontAlpha(f32); virtual void fukiAlpha(f32); -private: /* 0xC4 */ CPaneMgr* mpBaseParent; /* 0xC8 */ CPaneMgr* mpFontParent; }; diff --git a/include/d/d_msg_scrn_explain.h b/include/d/d_msg_scrn_explain.h index 20931ec9ac..1b638f9b83 100644 --- a/include/d/d_msg_scrn_explain.h +++ b/include/d/d_msg_scrn_explain.h @@ -49,7 +49,6 @@ public: void onForceSelect() { mForceSelect = 1; } void setKeyWaitTimer(s16 timer) { mKeyWaitTimer = timer; } -private: /* 0x04 */ dMsgString_c* mpString_c; /* 0x08 */ CPaneMgr* mpTm_c[2]; /* 0x10 */ CPaneMgr* mpTmr_c[2]; diff --git a/include/d/d_msg_string.h b/include/d/d_msg_string.h index 45a148b401..2d92939141 100644 --- a/include/d/d_msg_string.h +++ b/include/d/d_msg_string.h @@ -39,7 +39,6 @@ public: drawOutFontLocal(param_0, param_1); } -private: /* 0x24 */ COutFont_c* mpOutFont; /* 0x28 */ u8 field_0x28; }; diff --git a/include/d/d_msg_string_base.h b/include/d/d_msg_string_base.h index 4624393f06..020c557f85 100644 --- a/include/d/d_msg_string_base.h +++ b/include/d/d_msg_string_base.h @@ -30,7 +30,6 @@ public: virtual void drawOutFontLocal(J2DTextBox*, f32); virtual void drawFontLocal(J2DTextBox*, u8, f32, f32, f32, f32, u32, u8); -private: /* 0x04 */ JMessage::TResourceContainer* mpResCont; /* 0x08 */ jmessage_string_tControl* mpCtrl; /* 0x0C */ jmessage_string_tReference* mpRefer; diff --git a/include/d/d_name.h b/include/d/d_name.h index ddd99127c6..de084defb3 100644 --- a/include/d/d_name.h +++ b/include/d/d_name.h @@ -130,7 +130,6 @@ public: void setNextNameStr(char* i_name) { SAFE_STRCPY(mNextNameStr,i_name); } void draw() { _draw(); } -private: /* 0x004 */ STControl* stick; /* 0x008 */ JKRArchive* archive; /* 0x00C */ dDlst_NameIN_c nameIn; diff --git a/include/d/d_pane_class.h b/include/d/d_pane_class.h index 345cae1274..ffc067e411 100644 --- a/include/d/d_pane_class.h +++ b/include/d/d_pane_class.h @@ -93,7 +93,6 @@ public: JUtility::TColor getInitBlack() { return mInitBlack; } JUtility::TColor getInitWhite() { return mInitWhite; } -private: /* 0x1C */ void* mpFirstStackSize; /* 0x20 */ s16* field_0x20; /* 0x24 */ JGeometry::TVec2 mInitPos; diff --git a/include/d/d_pane_class_alpha.h b/include/d/d_pane_class_alpha.h index 82590e5f02..cf38229b97 100644 --- a/include/d/d_pane_class_alpha.h +++ b/include/d/d_pane_class_alpha.h @@ -54,7 +54,6 @@ public: virtual ~CPaneMgrAlphaMorf(); -private: /* 0x1C */ void* mpFirstSaveAlpha; /* 0x20 */ u8* field_0x20; /* 0x24 */ void* mpFirstGetAlpha; diff --git a/include/d/d_particle.h b/include/d/d_particle.h index 7ae4d12c07..a5849288f3 100644 --- a/include/d/d_particle.h +++ b/include/d/d_particle.h @@ -261,7 +261,6 @@ public: void setRate(f32 rate) { mRate = rate; } void setMaxCnt(int i_maxCnt) { mMaxCnt = i_maxCnt; } -private: /* 0x04 */ f32 mRate; /* 0x08 */ int mMaxCnt; /* 0x0C */ cXyz const* field_0xc; @@ -313,7 +312,6 @@ public: u16 getNameId() { return mNameId; } dPa_levelEcallBack* getCallback() { return mCallback; } - private: /* 0x00 */ u32 mId; /* 0x04 */ u16 mNameId; /* 0x06 */ u8 mStatus; @@ -510,7 +508,6 @@ public: static DUSK_GAME_DATA dPa_particleTracePcallBack_c mParticleTracePCB; static DUSK_GAME_DATA u8 mStatus; -private: /* 0x000 */ JKRSolidHeap* mHeap; /* 0x004 */ JPAResourceManager* mCommonResMng; /* 0x008 */ JKRExpHeap* m_resHeap; diff --git a/include/d/d_resorce.h b/include/d/d_resorce.h index b70d2d5452..3330ff5b3d 100644 --- a/include/d/d_resorce.h +++ b/include/d/d_resorce.h @@ -51,7 +51,6 @@ public: static const int NAME_MAX = 9; #endif -private: /* 0x00 */ char mArchiveName[11]; /* 0x0C */ u16 mCount; /* 0x10 */ mDoDvdThd_mountArchive_c* mDMCommand; diff --git a/include/d/d_s_name.h b/include/d/d_s_name.h index 72a44c02de..c32b4b903c 100644 --- a/include/d/d_s_name.h +++ b/include/d/d_s_name.h @@ -56,7 +56,6 @@ public: void tex_data_set(); #endif -private: #if VERSION == VERSION_GCN_PAL u8 field_0x1c4_pal[0x28]; #endif diff --git a/include/d/d_save.h b/include/d/d_save.h index 06458890e4..7fdbccf1df 100644 --- a/include/d/d_save.h +++ b/include/d/d_save.h @@ -594,7 +594,6 @@ public: dSv_player_info_c& getPlayerInfo() { return mPlayerInfo; } dSv_player_config_c& getConfig() { return mConfig; } -private: /* 0x000 */ dSv_player_status_a_c mPlayerStatusA; /* 0x028 */ dSv_player_status_b_c mPlayerStatusB; /* 0x040 */ dSv_horse_place_c mHorsePlace; @@ -892,7 +891,6 @@ public: class dSv_reserve_c { public: -private: u8 unk[80]; }; diff --git a/include/d/d_save_HIO.h b/include/d/d_save_HIO.h index 2ee6e4570b..f7d4770e08 100644 --- a/include/d/d_save_HIO.h +++ b/include/d/d_save_HIO.h @@ -10,7 +10,6 @@ public: virtual ~dSvBit_childTransformHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 WF[4]; /* 0x09 */ u8 field_0x9[4]; @@ -23,7 +22,6 @@ public: virtual ~dSvBit_childDarknessHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 TW[6]; /* 0x0B */ u8 field_0xB[6]; @@ -36,7 +34,6 @@ public: virtual ~dSvBit_childOtherHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 mDropNum; /* 0x06 */ u8 field_0x6; @@ -51,7 +48,6 @@ public: virtual ~dSvBit_childTbPerfectionHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x40]; /* 0x45 */ u8 field_0x45[0x40]; @@ -64,7 +60,6 @@ public: mPerfectSave.init(); } -private: /* 0x04 */ u8 field_0x4; /* 0x08 */ dSvBit_childTbPerfectionHIO_c mPerfectSave; }; @@ -76,7 +71,6 @@ public: virtual ~dSvBit_childSwZoneHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ bool field_0x5[0x20]; /* 0x25 */ bool field_0x25[0x20]; @@ -89,7 +83,6 @@ public: virtual ~dSvBit_childSwPerfectionHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x80]; /* 0x85 */ u8 field_0x85[0x80]; @@ -102,7 +95,6 @@ public: virtual ~dSvBit_childSwOneZoneHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ bool field_0x5[0x10]; /* 0x15 */ bool field_0x15[0x10]; @@ -115,7 +107,6 @@ public: virtual ~dSvBit_childSwDungeonHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x40]; /* 0x45 */ u8 field_0x45[0x40]; @@ -131,7 +122,6 @@ public: field_0x1e0.init(); } -private: /* 0x004 */ u8 field_0x4; /* 0x008 */ dSvBit_childSwPerfectionHIO_c field_0x8; /* 0x110 */ dSvBit_childSwDungeonHIO_c field_0x110; @@ -146,7 +136,6 @@ public: virtual ~dSvBit_childItZoneHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x20]; /* 0x25 */ u8 field_0x25[0x20]; @@ -159,7 +148,6 @@ public: virtual ~dSvBit_childItPerfectionHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x20]; /* 0x25 */ u8 field_0x25[0x20]; @@ -172,7 +160,6 @@ public: virtual ~dSvBit_childItOneZoneHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x10]; /* 0x15 */ u8 field_0x15[0x10]; @@ -185,7 +172,6 @@ public: virtual ~dSvBit_childItDungeonHIO_c() {} -private: /* 0x04 */ u8 field_0x4; /* 0x05 */ u8 field_0x5[0x80]; /* 0x85 */ u8 field_0x85[0x80]; @@ -201,7 +187,6 @@ public: mOneZoneSave.init(); } -private: /* 0x004 */ u8 field_0x4; /* 0x008 */ dSvBit_childItPerfectionHIO_c mFullSave; /* 0x050 */ dSvBit_childItDungeonHIO_c mDungeonSave; diff --git a/include/d/d_select_cursor.h b/include/d/d_select_cursor.h index e98db19731..766463b5b3 100644 --- a/include/d/d_select_cursor.h +++ b/include/d/d_select_cursor.h @@ -66,7 +66,6 @@ public: void onPlayAllAnime() { field_0xb4 = 0xff; } void offPlayAllAnime() { field_0xb4 = 0; } -private: /* 0x04 */ J2DScreen* mpScreen; /* 0x08 */ J2DPane* mpPane; /* 0x0C */ dSelect_icon_c* mpSelectIcon; diff --git a/include/d/d_shop_item_ctrl.h b/include/d/d_shop_item_ctrl.h index 9016be18ea..61ed325241 100644 --- a/include/d/d_shop_item_ctrl.h +++ b/include/d/d_shop_item_ctrl.h @@ -18,7 +18,6 @@ public: void setMessageIndex(int i, u16 messageIndex) { mMessageIndex[i] = messageIndex; } u16 getMessageIndex(int i) { return mMessageIndex[i]; } -private: /* 0x04 */ u32 mItemIndex[7]; /* 0x20 */ u16 mMessageIndex[7]; }; diff --git a/include/d/d_simple_model.h b/include/d/d_simple_model.h index 25b9e6e2d1..e87462c318 100644 --- a/include/d/d_simple_model.h +++ b/include/d/d_simple_model.h @@ -36,7 +36,6 @@ public: void setIdx(u8 idx) { this->idx = idx; } #endif -private: /* 0x00 */ JKRSolidHeap* mpHeap; /* 0x04 */ J3DModel* mpModel; /* 0x08 */ int mCreateNum; @@ -59,7 +58,6 @@ public: virtual ~dSmplMdl_draw_c(); -private: /* 0x04 */ diff_model_c mModel[8]; /* 0xA4 */ int mListCount; /* 0xA8 */ modelList_c mList[500]; diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 53fbbac0d9..cb2ed0b513 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -547,7 +547,6 @@ public: /* vt[91] */ virtual void setElst(dStage_Elst_c*) = 0; /* vt[92] */ virtual dStage_Elst_c* getElst(void) = 0; -private: /* 0x04 */ s8 mRoomNo; }; @@ -1261,7 +1260,6 @@ public: static u8 mNoArcBank; #endif -private: /* 0x0 */ u8 field_0x0[4]; }; @@ -1276,7 +1274,6 @@ public: s8 getDarkArea() const { return mDarkArea; } void setDarkArea(s8 darkArea) { mDarkArea = darkArea; } -private: /* 0x0 */ char mName[8]; /* 0x8 */ s16 mPoint; /* 0xA */ s8 mRoomNo; @@ -1291,12 +1288,12 @@ public: } void set(const char*, s8, s16, s8, s8, u8); void offEnable() { enabled = 0; } + void onEnable() { enabled = 1; } BOOL isEnable() const { return enabled; } s8 getWipe() const { return wipe; } u8 getWipeSpeed() const { return wipe_speed; } dStage_startStage_c* getStartStage() { return this; } -private: s8 enabled; s8 wipe; u8 wipe_speed; @@ -1351,6 +1348,9 @@ enum dStage_SaveTbl { const char* dStage_getName2(s16, s8); dStage_objectNameInf* dStage_searchName(const char*); +#if TARGET_PC +dStage_objectNameInf* dStage_searchNameCI(const char*); +#endif static int dStage_stageKeepTresureInit(dStage_dt_c*, void*, int, void*); static int dStage_filiInfo2Init(dStage_dt_c*, void*, int, void*); static int dStage_mapPathInitCommonLayer(dStage_dt_c*, void*, int, void*); diff --git a/include/d/d_timer.h b/include/d/d_timer.h index 104a4cae9e..de145650ac 100644 --- a/include/d/d_timer.h +++ b/include/d/d_timer.h @@ -77,7 +77,6 @@ public: mTimerTransY = y; } -private: /* 0x004 */ J2DScreen* mpScreen; /* 0x008 */ J2DScreen* mpGetInScreen; /* 0x00C */ J2DAnmTransform* mpGetInBck; @@ -145,7 +144,6 @@ public: u8 isReadyFlag() { return m_is_ready; } -private: /* 0x0FC */ dDlst_TimerScrnDraw_c* mp_tm_scrn; /* 0x100 */ JKRExpHeap* mp_heap; /* 0x104 */ u8 field_0x104[4]; diff --git a/include/d/d_vibration.h b/include/d/d_vibration.h index b61d0099b4..6e886a314b 100644 --- a/include/d/d_vibration.h +++ b/include/d/d_vibration.h @@ -94,7 +94,6 @@ public: 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 diff --git a/include/f_op/f_op_actor_mng.h b/include/f_op/f_op_actor_mng.h index b23fc40383..5cf357b778 100644 --- a/include/f_op/f_op_actor_mng.h +++ b/include/f_op/f_op_actor_mng.h @@ -23,12 +23,10 @@ #endif #define fopAcM_ct(ptr, ClassName) \ - if ((ptr)->layer_tag.layer == NULL) { OSPanic(__FILE__, __LINE__, "UH OH"); } \ if (!fopAcM_CheckCondition(ptr, fopAcCnd_INIT_e)) { \ fopAcM_ct_placement(ptr, ClassName); \ fopAcM_OnCondition(ptr, fopAcCnd_INIT_e); \ - } \ - if ((ptr)->layer_tag.layer == NULL) { OSPanic(__FILE__, __LINE__, "Oh come on"); } + } #define fopAcM_RegisterDeleteID(i_this, actor_name_str) \ @@ -532,10 +530,12 @@ s32 fopAcM_delete(fpc_ProcID i_actorID); fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cXyz* i_pos, int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, - createFunc i_createFunc IF_DUSK_ARG(u32 i_itemGiveTag = 0)); + createFunc i_createFunc IF_DUSK_ARG(u32 i_itemGiveTag = 0) + IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF)); fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo, - const csXyz* i_angle, const cXyz* i_scale, s8 i_argument IF_DUSK_ARG(u32 i_itemGiveTag = 0)); + const csXyz* i_angle, const cXyz* i_scale, s8 i_argument IF_DUSK_ARG(u32 i_itemGiveTag = 0) + IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF)); inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* params) { return fpcM_Create(i_procName, i_createFunc,params); diff --git a/include/f_pc/f_pc_deletor.h b/include/f_pc/f_pc_deletor.h index c0b7da0fc2..1667303fc4 100644 --- a/include/f_pc/f_pc_deletor.h +++ b/include/f_pc/f_pc_deletor.h @@ -7,6 +7,7 @@ typedef struct base_process_class base_process_class; BOOL fpcDt_IsComplete(); +int fpcDt_deleteMethod(base_process_class* i_proc); int fpcDt_ToDeleteQ(base_process_class* i_proc); int fpcDt_ToQueue(base_process_class* i_proc); void fpcDt_Handler(); diff --git a/include/global.h b/include/global.h index 725fd03874..c559435fa5 100644 --- a/include/global.h +++ b/include/global.h @@ -83,11 +83,15 @@ extern void __dcbf(void*, int); extern void __dcbz(void*, int); extern void __sync(); extern int __abs(int); +#if defined(_MSVC_LANG) && !defined(__clang__) +#define __memcpy memcpy +#else #if defined(__has_builtin) && __has_builtin(__builtin_memcpy) #define __memcpy __builtin_memcpy #else #define __memcpy memcpy #endif +#endif #ifdef __cplusplus } #endif @@ -123,6 +127,14 @@ inline int __builtin_clz(unsigned int v) { #endif #define DUSK_GAME_EXTERN extern DUSK_GAME_DATA +#if defined(_MSC_VER) +#define DUSK_NOINLINE __declspec(noinline) +#elif defined(__GNUC__) +#define DUSK_NOINLINE __attribute__((noinline)) +#else +#define DUSK_NOINLINE +#endif + #define FAST_DIV(x, n) (x >> (n / 2)) #define SQUARE(x) ((x) * (x)) diff --git a/include/m_Do/m_Do_dvd_thread.h b/include/m_Do/m_Do_dvd_thread.h index ebb4253838..dcb3f2fc65 100644 --- a/include/m_Do/m_Do_dvd_thread.h +++ b/include/m_Do/m_Do_dvd_thread.h @@ -68,7 +68,7 @@ public: JKRMemArchive* getArchive() const { return mArchive; } JKRHeap* getHeap() const { return mHeap; } -// private: +private: /* 0x14 */ u8 mMountDirection; /* 0x18 */ s32 mEntryNumber; /* 0x1C */ JKRMemArchive* mArchive; diff --git a/libs/JSystem/include/JSystem/JKernel/JKRHeap.h b/libs/JSystem/include/JSystem/JKernel/JKRHeap.h index ace28de6e3..e23dca3c02 100644 --- a/libs/JSystem/include/JSystem/JKernel/JKRHeap.h +++ b/libs/JSystem/include/JSystem/JKernel/JKRHeap.h @@ -7,6 +7,7 @@ #include #include #include +#include class JKRHeap; typedef void (*JKRErrorHandler)(void*, u32, int); diff --git a/libs/JSystem/src/JKernel/JKRArchivePri.cpp b/libs/JSystem/src/JKernel/JKRArchivePri.cpp index eed317a357..f81082cc2f 100644 --- a/libs/JSystem/src/JKernel/JKRArchivePri.cpp +++ b/libs/JSystem/src/JKernel/JKRArchivePri.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "JSystem/JKernel/JKRDvdRipper.h" #if _WIN32 #include @@ -21,6 +22,8 @@ std::atomic JKRArchive::sArcOverlayGeneration{0}; namespace { +inline constexpr borealis::Log Log{"JKRArchivePri"}; + void* alloc_overlay_buffer(u32 size) { #if _WIN32 return _aligned_malloc(size, alignof(std::max_align_t)); @@ -452,12 +455,18 @@ bool JKRArchive::copyOverlayData(void* buffer, u32 bufferSize, SDIFileEntry* ent return false; } - const u32 copySize = overlaySize < bufferSize ? overlaySize : bufferSize; - if (copySize != 0) { - memcpy(buffer, overlayData, copySize); + if (overlaySize > bufferSize) { + std::string path; + getOverlayPath(entry, path); + Log.error("Overlay %s is %u bytes but the game reserved %u\n", path.c_str(), overlaySize, + bufferSize); + return false; + } + if (overlaySize != 0) { + memcpy(buffer, overlayData, overlaySize); } if (outSize != nullptr) { - *outSize = copySize; + *outSize = overlaySize; } return true; } diff --git a/mods/ao_mod/CMakeLists.txt b/mods/ao_mod/CMakeLists.txt index 723ed55006..7304654d0c 100644 --- a/mods/ao_mod/CMakeLists.txt +++ b/mods/ao_mod/CMakeLists.txt @@ -17,5 +17,4 @@ add_mod(ao_mod SOURCES src/mod.cpp MOD_JSON mod.json RES_DIR res - BUNDLE ) diff --git a/mods/basic_cosmetics_mod/mod.json b/mods/basic_cosmetics_mod/mod.json deleted file mode 100644 index d6c258bfe9..0000000000 --- a/mods/basic_cosmetics_mod/mod.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "dev.twilitrealm.basic_cosmetics", - "name": "Basic Cosmetics", - "version": "1.0.0", - "author": "Twilit Realm", - "description": "Change Basic Cosmetic Colors" -} diff --git a/mods/basic_cosmetics_mod/src/color_utils.cpp b/mods/basic_cosmetics_mod/src/color_utils.cpp deleted file mode 100644 index d1dc2eb096..0000000000 --- a/mods/basic_cosmetics_mod/src/color_utils.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "color_utils.hpp" - -uint8_t desaturate_rgb_565(uint16_t rgb565Val) { - const uint32_t r = (rgb565Val & 0xf800) >> 11; - const uint32_t g = (rgb565Val & 0x7e0) >> 5; - const uint32_t b = rgb565Val & 0x1f; - - // Here we are doing a quicker (0.22 * r + 0.72 * g + 0.06 * b) which - // uses multiplies and shifts rather than division. - const uint32_t combined = 30480413 * r + 49085341 * g + 8312839 * b; - uint8_t shifted = (combined >> 24) & 0xff; - - // Check if should round up shifted value. - if (shifted < 0xff && combined & 0x00800000) { - shifted += 1; - } - - return shifted; -} - -uint16_t blend_overlay_rgb_565(uint8_t grayVal, GXColor color) { - uint32_t rTimes255, gTimes255, bTimes255; - - if (grayVal <= 0x7f) { - const uint32_t grayTimesTwo = 2 * grayVal; - - rTimes255 = grayTimesTwo * color.r; - gTimes255 = grayTimesTwo * color.g; - bTimes255 = grayTimesTwo * color.b; - } else { - const uint32_t multiplier = 2 * (255 - grayVal); - - rTimes255 = 255 * 255 - multiplier * (255 - color.r); - gTimes255 = 255 * 255 - multiplier * (255 - color.g); - bTimes255 = 255 * 255 - multiplier * (255 - color.b); - } - - // Divide each by 255 - const uint32_t r = (rTimes255 + 1 + (rTimes255 >> 8)) >> 8; - const uint32_t g = (gTimes255 + 1 + (gTimes255 >> 8)) >> 8; - const uint32_t b = (bTimes255 + 1 + (bTimes255 >> 8)) >> 8; - - return ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | ((b & 0xf8) >> 3); -} - -// Helper function to perform overlay blending on a single 8-bit color channel -uint8_t blend_overlay_channel(uint8_t base, uint8_t blend) { - if (base < 128) { - return static_cast((2 * base * blend) / 255); - } - - return static_cast(255 - (2 * (255 - base) * (255 - blend)) / 255); -} - -bool is_valid_hex_color_str(std::string_view hexStr) { - return hexStr.find_first_not_of("0123456789ABCDEFabcdef") == std::string_view::npos && - hexStr.length() == 6; -} - -GXColor hex_color_str_to_gx_color(const std::string& hexColorStr) { - u8 r = std::stoi(hexColorStr.substr(0, 2), nullptr, 16); - u8 g = std::stoi(hexColorStr.substr(2, 2), nullptr, 16); - u8 b = std::stoi(hexColorStr.substr(4, 2), nullptr, 16); - return GXColor{r, g, b}; -} - -static f32 rainbowPhaseAngle = 0.f; - -GXColor get_rainbow_rgb(f32 amplitude) { - f32 phase_rad = rainbowPhaseAngle * M_PI / 180.0f; - - u8 r_val = (u8)(amplitude * (sinf(phase_rad) + 1.0f) + 0.5f); - u8 g_val = (u8)(amplitude * (sinf(phase_rad + 2.0f * M_PI / 3.0f) + 1.0f) + 0.5f); - u8 b_val = (u8)(amplitude * (sinf(phase_rad + 4.0f * M_PI / 3.0f) + 1.0f)); - GXColor rgbColor; - rgbColor.r = r_val; - rgbColor.g = g_val; - rgbColor.b = b_val; - rgbColor.a = 0xff; - return rgbColor; -} - -void update_rainbow_rgb(f32 increment) { - rainbowPhaseAngle += increment; - if (rainbowPhaseAngle >= 360.0f) { - rainbowPhaseAngle -= 360.0f; - } -} \ No newline at end of file diff --git a/mods/basic_cosmetics_mod/src/color_utils.hpp b/mods/basic_cosmetics_mod/src/color_utils.hpp deleted file mode 100644 index 94e1ce62a8..0000000000 --- a/mods/basic_cosmetics_mod/src/color_utils.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -/** - * File originally copied from console TPR with permission from isaac - * https://github.com/zsrtp/libtp_rel/blob/master/include/util/color_utils.h - */ - -#include - -#include -#include - -// Desaturates an RGB565 color to a u8 gray value (0xFF being white and 0x00 -// being black). -uint8_t desaturate_rgb_565(uint16_t rgb565Val); - -// Performs an "Overlay" blend of a u8 gray value and a pointer to a u8 -// array of {r,g,b}. Returns the result as an RGB565. -uint16_t blend_overlay_rgb_565(uint8_t grayVal, GXColor color); - -// Perform overlay blending on a single 8-bit color channel -uint8_t blend_overlay_channel(uint8_t base, uint8_t blend); - -bool is_valid_hex_color_str(std::string_view hexStr); - -GXColor hex_color_str_to_gx_color(const std::string& hexColorStr); - -GXColor get_rainbow_rgb(f32 amplitude); - -void update_rainbow_rgb(f32 increment); diff --git a/mods/basic_cosmetics_mod/src/hooks.cpp b/mods/basic_cosmetics_mod/src/hooks.cpp deleted file mode 100644 index e90e76d8b3..0000000000 --- a/mods/basic_cosmetics_mod/src/hooks.cpp +++ /dev/null @@ -1,731 +0,0 @@ -#include "hooks.hpp" - -#include "color_utils.hpp" -#include "midna_hair_color.hpp" -#include "mod.hpp" -#include "types.h" - -#include "mods/svc/hook.hpp" -#include "mods/svc/log.hpp" - -#include "SSystem/SComponent/c_phase.h" -#include "d/actor/d_a_alink.h" -#include "d/actor/d_a_midna.h" -#include "d/d_a_item_static.h" -#include "d/d_bright_check.h" -#include "d/d_file_sel_info.h" -#include "d/d_file_select.h" -#include "d/d_kankyo.h" -#include "d/d_kantera_icon_meter.h" -#include "d/d_menu_collect.h" -#include "d/d_menu_fishing.h" -#include "d/d_menu_fmap2D.h" -#include "d/d_menu_insect.h" -#include "d/d_menu_letter.h" -#include "d/d_menu_option.h" -#include "d/d_menu_ring.h" -#include "d/d_menu_save.h" -#include "d/d_menu_skill.h" -#include "d/d_meter2.h" -#include "d/d_meter2_draw.h" -#include "d/d_meter2_info.h" -#include "d/d_meter_button.h" -#include "d/d_meter_hakusha.h" -#include "d/d_msg_object.h" -#include "d/d_msg_out_font.h" -#include "d/d_msg_scrn_base.h" -#include "d/d_pane_class.h" - -// Lantern ambience color -DEFINE_HOOK(&dKy_WolfEyeLight_set, WolfEyeLightSet); -void wolf_eye_light_set_post(ModContext*, void*, void*, void*) { - auto maybeLanternColor = get_config_var_color(get_cvars().lanternGlowColor, true); - if (maybeLanternColor.has_value()) { - auto lanternColor = maybeLanternColor.value(); - - dScnKy_env_light_c* kankyo = dKy_getEnvlight(); - kankyo->field_0x0c18[0].mColor.r = lanternColor.r; - kankyo->field_0x0c18[0].mColor.g = lanternColor.g; - kankyo->field_0x0c18[0].mColor.b = lanternColor.b; - } -} - -// Lantern Sphere color -DEFINE_HOOK(&daAlink_c::preKandelaarDraw, PreKandelaarDraw); -void pre_kandelaar_draw_post(ModContext*, void*, void*, void*) { - auto maybeLanternColor = get_config_var_color(get_cvars().lanternGlowColor, true); - if (maybeLanternColor.has_value()) { - auto lanternColor = maybeLanternColor.value(); - - J3DMaterial* mat_p = daAlink_getAlinkActorClass() - ->mpKanteraGlowModel->getModelData() - ->getMaterialNodePointer(0); - - J3DGXColorS10 color; - color.r = lanternColor.r; - color.g = lanternColor.g; - color.b = lanternColor.b; - color.a = 255; - mat_p->setTevColor(1, &color); - - color.r = lanternColor.r; - color.g = lanternColor.g; - color.b = lanternColor.b; - mat_p->setTevColor(2, &color); - } -} - -// Main Lantern Meter Color -DEFINE_HOOK(&CPaneMgr::setBlackWhite, CPaneMgrSetBlackWhite); -HookAction cpane_mgr_set_black_white_pre(ModContext*, void* args, void*, void*) { - // Check for magic meter - auto pane = mods::arg(args, 0); - if (dMeter2Info_getMeterClass() == NULL || - pane != dMeter2Info_getMeterClass()->getMeterDrawPtr()->mpMagicMeter) - { - return HOOK_CONTINUE; - } - - // If magic meter, check to see we're setting lantern colors - auto& black = mods::arg_ref(args, 1); - auto& white = mods::arg_ref(args, 2); - if (black != JUtility::TColor(255, 255, 140, 255) && - white != JUtility::TColor(230, 170, 0, 255)) - { - return HOOK_CONTINUE; - } - - auto maybeLanternColor = get_config_var_color(get_cvars().lanternGlowColor, true); - if (maybeLanternColor.has_value()) { - auto lanternColor = maybeLanternColor.value(); - black = JUtility::TColor(lanternColor.r, lanternColor.g, lanternColor.b, 255); - white = JUtility::TColor(lanternColor.r, lanternColor.g, lanternColor.b, 255); - } - - return HOOK_CONTINUE; -} - -// Lantern Icon Meter Color -DEFINE_HOOK(&dKantera_icon_c::setNowGauge, KanteraIconSetNowGauge); -void kantera_icon_set_now_gauge_post(ModContext*, void* args, void*, void*) { - auto maybeLanternColor = get_config_var_color(get_cvars().lanternGlowColor, true); - if (maybeLanternColor.has_value()) { - auto lanternColor = maybeLanternColor.value(); - - auto kanteraIcon = mods::arg(args, 0); - kanteraIcon->mpGauge->setBlackWhite( - JUtility::TColor(lanternColor.r, lanternColor.g, lanternColor.b, 255), - JUtility::TColor(lanternColor.r, lanternColor.g, lanternColor.b, 255)); - } -} - -// Light Sword Effect Color -DEFINE_HOOK(&daAlink_c::setLightningSwordEffect, SetLightningSwordEffect); -void set_lightning_sword_effect_post(ModContext*, void* args, void*, void*) { - auto maybeGlowColor = get_config_var_color(get_cvars().lightSwordGlowColor, true); - if (maybeGlowColor.has_value()) { - auto glowColor = maybeGlowColor.value(); - - auto link = mods::arg(args, 0); - // Check copied from inside the hooked function - if (link->mEquipItem == 0x103 && link->checkNoResetFlg3(daPy_py_c::FLG3_UNK_100000)) { - for (size_t i = 0; i < 3; i++) { - auto emitter = dComIfGp_particle_getEmitter(link->field_0x327c[i]); - if (emitter != NULL) { - emitter->setGlobalEnvColor(glowColor.r, glowColor.g, glowColor.b); - emitter->setGlobalPrmColor(glowColor.r, glowColor.g, glowColor.b); - } - } - } - } -} - -void recolor_ui_button(ConfigVarHandle option, u64 tag, J2DScreen* screen) { - auto buttonColorStr = get_str_option(option, ""); - if (is_valid_hex_color_str(buttonColorStr)) { - auto color = hex_color_str_to_gx_color(buttonColorStr); - auto element = static_cast(screen->search(tag)); - if (element != nullptr) { - element->setBlackWhite( - JUtility::TColor(0, 0, 0, 0), JUtility::TColor(color.r, color.g, color.b, 0xFF)); - } - } -} - -// Main gameplay UI. Top left hearts and top right buttons -DEFINE_HOOK(&dMeter2Draw_c::init, dMeter2Init); -void d_meter_2_init_post(ModContext*, void* args, void*, void*) { - auto dMeter2Draw = mods::arg(args, 0); - auto screen = dMeter2Draw->getMainScreenPtr(); - - // Heart tags on main UI - static constexpr std::array kHeartTags = {MULTI_CHAR('hear_00'), MULTI_CHAR('hear_01'), - MULTI_CHAR('hear_02'), MULTI_CHAR('hear_03'), MULTI_CHAR('hear_04'), MULTI_CHAR('hear_05'), - MULTI_CHAR('hear_06'), MULTI_CHAR('hear_07'), MULTI_CHAR('hear_08'), MULTI_CHAR('hear_09'), - MULTI_CHAR('hear_10'), MULTI_CHAR('hear_11'), MULTI_CHAR('hear_12'), MULTI_CHAR('hear_13'), - MULTI_CHAR('hear_14'), MULTI_CHAR('hear_15'), MULTI_CHAR('hear_16'), MULTI_CHAR('hear_17'), - MULTI_CHAR('hear_18'), MULTI_CHAR('hear_19'), MULTI_CHAR('bigh_00'), MULTI_CHAR('bigh_01'), - MULTI_CHAR('bigh_02'), MULTI_CHAR('bigh_03')}; - - auto maybeHeartColor = get_config_var_color(get_cvars().heartColor); - if (maybeHeartColor.has_value()) { - auto heartColor = maybeHeartColor.value(); - for (auto tag : kHeartTags) { - auto element = static_cast(screen->search(tag)); - if (element != nullptr) { - element->setBlackWhite(heartColor, JUtility::TColor(200, 200, 200, 255)); - } - } - } - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); - recolor_ui_button(get_cvars().xButtonColor, MULTI_CHAR('x_btn'), screen); - recolor_ui_button(get_cvars().yButtonColor, MULTI_CHAR('y_btn'), screen); - recolor_ui_button(get_cvars().zButtonColor, MULTI_CHAR('zbtn'), screen); -} - -// Hearts on the file select screen -DEFINE_HOOK(&dFile_info_c::setHeartCnt, FileInfoSetHeartCount); -void file_info_set_heart_count_post(ModContext*, void* args, void*, void*) { - auto fileInfo = mods::arg(args, 0); - - // Heart tags on file select - static constexpr std::array kFileSelectHeartTags{ - MULTI_CHAR('hear_20'), - MULTI_CHAR('hear_21'), - MULTI_CHAR('hear_22'), - MULTI_CHAR('hear_23'), - MULTI_CHAR('hear_24'), - MULTI_CHAR('hear_25'), - MULTI_CHAR('hear_26'), - MULTI_CHAR('hear_27'), - MULTI_CHAR('hear_28'), - MULTI_CHAR('hear_29'), - MULTI_CHAR('hear_30'), - MULTI_CHAR('hear_31'), - MULTI_CHAR('hear_32'), - MULTI_CHAR('hear_33'), - MULTI_CHAR('hear_34'), - MULTI_CHAR('hear_35'), - MULTI_CHAR('hear_36'), - MULTI_CHAR('hear_37'), - MULTI_CHAR('hear_38'), - MULTI_CHAR('hear_39'), - }; - - auto maybeHeartColor = get_config_var_color(get_cvars().heartColor); - if (maybeHeartColor.has_value()) { - auto heartColor = maybeHeartColor.value(); - for (auto tag : kFileSelectHeartTags) { - auto element = static_cast(fileInfo->mFileInfo.Scr->search(tag)); - if (element != nullptr) { - element->setBlackWhite(heartColor, JUtility::TColor(200, 200, 200, 255)); - } - } - } -} - -// Buttons that appear contextually at the bottom of the screen during gameplay -// (Are X, Y ever used there?) -DEFINE_HOOK(&dMeterButton_c::screenInitButton, ScreenInitButton); -void screen_init_button_post(ModContext*, void* args, void*, void*) { - auto meterButton = mods::arg(args, 0); - auto screen = meterButton->mpButtonScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn1'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); - recolor_ui_button(get_cvars().xButtonColor, MULTI_CHAR('x_btn'), screen); - recolor_ui_button(get_cvars().yButtonColor, MULTI_CHAR('y_btn'), screen); - recolor_ui_button(get_cvars().zButtonColor, MULTI_CHAR('zbtn'), screen); -} - -// A and B buttons when saving a file -DEFINE_HOOK(&dMenu_save_c::screenSet, MenuSaveScreenSet); -void menu_save_screen_set_post(ModContext*, void* args, void*, void*) { - auto menuSave = mods::arg(args, 0); - auto screen = menuSave->mSaveSel.Scr; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('wabtn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('wbbtn'), screen); -} - -// A and B buttons when selecting a file -DEFINE_HOOK(&dFile_select_c::screenSet, FileSelectScreenSet); -void file_select_screen_set_post(ModContext*, void* args, void*, void*) { - auto fileSelect = mods::arg(args, 0); - auto screen = fileSelect->fileSel.Scr; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('wabtn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('wbbtn'), screen); -} - -// A button on brightness check screen -DEFINE_HOOK(&dBrightCheck_c::screenSet, BrightCheckScreenSet); -void bright_check_screen_set_post(ModContext*, void* args, void*, void*) { - auto brightCheck = mods::arg(args, 0); - auto screen = brightCheck->mBrightCheck.Scr; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn1'), screen); -} - -// X and Y buttons on the item wheel screen -DEFINE_HOOK(&dMenu_Ring_c::_create, MenuRingCreate); -void menu_ring_create_post(ModContext*, void* args, void*, void*) { - auto menuRing = mods::arg(args, 0); - auto screen = menuRing->mpScreen; - - recolor_ui_button(get_cvars().xButtonColor, MULTI_CHAR('xbtn'), screen); - recolor_ui_button(get_cvars().yButtonColor, MULTI_CHAR('ybtn'), screen); -} - -// A and B buttons on the main pause screen -DEFINE_HOOK(&dMenu_Collect2D_c::_create, MenuCollect2DCreate); -void menu_collect_2D_create_post(ModContext*, void* args, void*, void*) { - auto menuCollect2D = mods::arg(args, 0); - auto screen = menuCollect2D->mpScreenIcon; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); -} - -// A and B buttons on the fishing journal screen -DEFINE_HOOK(&dMenu_Fishing_c::screenSetDoIcon, MenuFishingScreenSetDoIcon); -void menu_fishing_screen_set_do_icon_post(ModContext*, void* args, void*, void*) { - auto menuFishing = mods::arg(args, 0); - auto screen = menuFishing->mpIconScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); -} - -// A and B buttons on the insect collection screen -DEFINE_HOOK(&dMenu_Insect_c::screenSetDoIcon, MenuInsectScreenSetDoIcon); -void menu_insect_screen_set_do_icon_post(ModContext*, void* args, void*, void*) { - auto menuInsect = mods::arg(args, 0); - auto screen = menuInsect->mpIconScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); -} - -// A and B buttons on the letters screen -DEFINE_HOOK(&dMenu_Letter_c::screenSetDoIcon, MenuLetterScreenSetDoIcon); -void menu_letter_screen_set_do_icon_post(ModContext*, void* args, void*, void*) { - auto menuLetter = mods::arg(args, 0); - auto screen = menuLetter->mpIconScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); -} - -// A, B, and Z buttons on option screen -DEFINE_HOOK(&dMenu_Option_c::_create, MenuOptionCreate); -void menu_option_create_post(ModContext*, void* args, void*, void*) { - auto menuOption = mods::arg(args, 0); - auto screen = menuOption->mpScreenIcon; - auto backScreen = menuOption->mpBackScreen; - auto tvScreen = menuOption->mpTVScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); - recolor_ui_button(get_cvars().zButtonColor, MULTI_CHAR('g_zbtn'), backScreen); - - // A Button on option's brightness check screen - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn1'), tvScreen); -} - -// A and B buttons on the hidden skills screen -DEFINE_HOOK(&dMenu_Skill_c::screenSetDoIcon, MenuSkillScreenSetDoIcon); -void menu_skill_screen_set_do_icon_post(ModContext*, void* args, void*, void*) { - auto menuSkill = mods::arg(args, 0); - auto screen = menuSkill->mpIconScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn'), screen); -} - -// A, B, and Z buttons on the map screen -DEFINE_HOOK(&dMenu_Fmap_c::_create, MenuFMapCreate); -void menu_fmap_create_post(ModContext*, void* args, void*, void*) { - auto menuFMap = mods::arg(args, 0); - auto screen = menuFMap->mpDraw2DTop->mpTitleScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn'), screen); - recolor_ui_button(get_cvars().bButtonColor, MULTI_CHAR('b_btn1'), screen); - recolor_ui_button(get_cvars().zButtonColor, MULTI_CHAR('zbtn'), screen); -} - -// A button on the howling screen -DEFINE_HOOK(&dMsgObject_c::talkStartInit, MsgObjectTalkStartInit); -void msg_object_talk_start_init_post(ModContext*, void* args, void*, void*) { - auto msgObject = mods::arg(args, 0); - - // If textbox kind is howling - if (msgObject->mFukiKind == 17) { - auto screen = msgObject->mpScrnDraw->mpScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('abtn'), screen); - } -} - -// A button when on Epona -DEFINE_HOOK(&dMeterHakusha_c::_create, MeterHakushaCreate); -void meter_hakusha_create_post(ModContext*, void* args, void*, void*) { - auto meterHakusha = mods::arg(args, 0); - auto screen = meterHakusha->mpButtonScreen; - - recolor_ui_button(get_cvars().aButtonColor, MULTI_CHAR('a_btn1'), screen); -} - -// A, B, X, and Y button icons in text -DEFINE_HOOK(&COutFont_c::createPane, OutFontCreatePane); -void out_font_create_pane_post(ModContext*, void* args, void*, void*) { - auto outFont = mods::arg(args, 0); - auto paneArr = outFont->mpPane; - - auto maybeAButtonColor = get_config_var_color(get_cvars().aButtonColor); - if (maybeAButtonColor.has_value()) { - auto aButtonColor = maybeAButtonColor.value(); - paneArr[0]->setBlackWhite(JUtility::TColor(255, 255, 255, 0), - JUtility::TColor(aButtonColor.r, aButtonColor.g, aButtonColor.b, 255)); - } - - auto maybeBButtonColor = get_config_var_color(get_cvars().bButtonColor); - if (maybeBButtonColor.has_value()) { - auto bButtonColor = maybeBButtonColor.value(); - paneArr[1]->setBlackWhite(JUtility::TColor(255, 255, 255, 0), - JUtility::TColor(bButtonColor.r, bButtonColor.g, bButtonColor.b, 255)); - } - - // Condition copied from hooked function - auto xyBlack = JUtility::TColor(255, 255, 255, 0); - if (outFont->field_0x242 == 1) { - xyBlack = JUtility::TColor(0, 0, 0, 0); - } - - auto maybeXButtonColor = get_config_var_color(get_cvars().xButtonColor); - if (maybeXButtonColor.has_value()) { - auto xButtonColor = maybeXButtonColor.value(); - paneArr[5]->setBlackWhite( - xyBlack, JUtility::TColor(xButtonColor.r, xButtonColor.g, xButtonColor.b, 255)); - } - - auto maybeYButtonColor = get_config_var_color(get_cvars().yButtonColor); - if (maybeYButtonColor.has_value()) { - auto yButtonColor = maybeYButtonColor.value(); - paneArr[6]->setBlackWhite( - xyBlack, JUtility::TColor(yButtonColor.r, yButtonColor.g, yButtonColor.b, 255)); - } -} - -// Heart icon in text -DEFINE_HOOK(&COutFontSet_c::drawFont, OutFontSetDrawFont); -void out_font_set_draw_font_post(ModContext*, void* args, void*, void*) { - auto outFontSet = mods::arg(args, 0); - - auto maybeHeartColor = get_config_var_color(get_cvars().heartColor); - if (maybeHeartColor.has_value()) { - auto heartColor = maybeHeartColor.value(); - u32 heartColor_u32 = heartColor.r << 24 | heartColor.g << 16 | heartColor.b << 8 | 0xFF; - if (outFontSet->getType() == 0x1B) { // Heart icon type - outFontSet->mColor = heartColor_u32; - } - } -} - -// Heart Drop/Piece of Heart/Heart Container model color -DEFINE_HOOK(&daItemBase_c::CreateItemHeap, ItemBaseCreateItemHeap); -void item_base_create_item_heap_post(ModContext*, void* args, void*, void*) { - auto itemBase = mods::arg(args, 0); - if (itemBase == NULL) { - return; - } - auto itemNo = itemBase->m_itemNo; - if (itemNo == dItemNo_HEART_e || itemNo == dItemNo_UTAWA_HEART_e || - itemNo == dItemNo_KAKERA_HEART_e) - { - auto maybeHeartColor = get_config_var_color(get_cvars().heartColor); - if (maybeHeartColor.has_value()) { - auto heartColor = maybeHeartColor.value(); - auto heartColorS10 = GXColorS10(heartColor.r, heartColor.g, heartColor.b, heartColor.a); - - // Edit inner heart material color for Piece of Heart / Heart Container - if (itemNo == dItemNo_UTAWA_HEART_e || itemNo == dItemNo_KAKERA_HEART_e) { - *itemBase->mpModel->getModelData()->getMaterialNodePointer(3)->getTevKColor(1) = - heartColor; - *itemBase->mpModel->getModelData()->getMaterialNodePointer(3)->getTevColor(1) = - heartColorS10; - } - - const u8 heartColorRGB[3] = {heartColor.r, heartColor.g, heartColor.b}; - u8** cRegTable = - reinterpret_cast(&itemBase->mpBrkAnm->getBrkAnm()->mAnmCRegDataR); - u8** kRegTable = - reinterpret_cast(&itemBase->mpBrkAnm->getBrkAnm()->mAnmKRegDataR); - - for (int i = 0; i < 3; i++) { - u8* cReg = cRegTable[i]; - u8* kReg = kRegTable[i]; - - auto curColor = heartColorRGB[i]; - - // Set heart drop inner heart color - cReg[0x3] = curColor; - cReg[0xB] = curColor; - - // Set heart drop outer heart color - kReg[0x3] = curColor; - kReg[0xB] = curColor; - - if (itemNo == dItemNo_KAKERA_HEART_e) { - cReg[0x13] = curColor; - cReg[0x1B] = curColor; - kReg[0x13] = curColor; - kReg[0x1B] = curColor; - } - if (itemNo == dItemNo_UTAWA_HEART_e) { - cReg[0x13] = curColor; - kReg[0x13] = curColor; - kReg[0x1B] = curColor; - kReg[0x23] = curColor; - kReg[0x2B] = curColor; - } - } - } - } -} - -// Midna Hair Color -DEFINE_HOOK(&daMidna_c::create, MidnaCreate); -void midna_create_post(ModContext*, void* args, void* retval, void*) { - auto step = reinterpret_cast(retval); - // Don't set colors if midna isn't done loading - if (*step != cPhs_COMPLEATE_e) { - return; - } - - auto midna = mods::arg(args, 0); - midna->field_0x6e0 = g_currentMidnaHairColors.normalColor; - if (dKy_darkworld_check()) { - midna->field_0x6e8 = g_currentMidnaHairColors.normalKColor; - midna->field_0x6ec = g_currentMidnaHairColors.normalKColor2; - } else { - midna->field_0x6e8 = g_currentMidnaHairColors.lNormalKColor; - midna->field_0x6ec = g_currentMidnaHairColors.lNormalKColor2; - } -} - -// Override Midna Hair Color Part 2 -DEFINE_HOOK(&daMidna_c::setBodyPartMatrix, MidnaSetBodyPartMatrix); - -static GXColorS10 midnaField0x6e0{}; -static GXColor midnaField0x6e8{}; -static GXColor midnaField0x6ec{}; - -// Copy the original values before setBodyPartMatrix runs -HookAction midna_set_body_part_matrix_pre(ModContext*, void* args, void* retval, void* userdata) { - auto midna = mods::arg(args, 0); - - midnaField0x6e0 = midna->field_0x6e0; - midnaField0x6e8 = midna->field_0x6e8; - midnaField0x6ec = midna->field_0x6ec; - - return HOOK_CONTINUE; -} - -void midna_set_body_part_matrix_post(ModContext*, void* args, void* retval, void* userdata) { - auto midna = mods::arg(args, 0); - if (midna->mpHairhandBmd != NULL) { - // Restore the original values from before setBodyPartMatrix ran (this undoes the chase) - midna->field_0x6e0 = midnaField0x6e0; - midna->field_0x6e8 = midnaField0x6e8; - midna->field_0x6ec = midnaField0x6ec; - - // Statement copied from inside function to determine colors - bool bigColors = - midna->checkStateFlg0(daMidna_c::FLG0_UNK_10000000) || - midna->mBckHeap[2].getIdx() == daMidna_c::m_anmDataTable[daMidna_c::ANM_HAIR].mResID || - midna->mBckHeap[2].getIdx() == - daMidna_c::m_anmDataTable[daMidna_c::ANM_S_TAKES].mResID || - midna->mBckHeap[2].getIdx() == - daMidna_c::m_anmDataTable[daMidna_c::ANM_S_WAITS].mResID || - midna->mBckHeap[2].getIdx() == - daMidna_c::m_anmDataTable[daMidna_c::ANM_S_PACKAWAY].mResID || - midna->mBckHeap[2].getIdx() == - daMidna_c::m_anmDataTable[daMidna_c::ANM_GRABST].mResID || - midna->checkEndResetStateFlg0(daMidna_c::ERFLG0_UNK_40) || - dComIfGp_checkPlayerStatus1(0, 0x800000); - - GXColorS10 color{}; - GXColor kcolor1{}; - GXColor kcolor2{}; - - // Set our own colors - if (bigColors) { - kcolor1 = g_currentMidnaHairColors.bigKColor; - if (dKy_darkworld_check()) { - color = g_currentMidnaHairColors.bigColor; - kcolor2 = g_currentMidnaHairColors.normalKColor2; - } else { - color = g_currentMidnaHairColors.lBigColor; - kcolor2 = g_currentMidnaHairColors.lBigKColor2; - } - } else { - color = g_currentMidnaHairColors.normalColor; - if (dKy_darkworld_check()) { - kcolor1 = g_currentMidnaHairColors.normalKColor; - kcolor2 = g_currentMidnaHairColors.normalKColor2; - } else { - kcolor1 = g_currentMidnaHairColors.lNormalKColor; - kcolor2 = g_currentMidnaHairColors.lNormalKColor2; - } - } - - // Reapply the chase that happens in the function - cLib_chaseS(&midna->field_0x6e0.r, color.r, 10); - cLib_chaseS(&midna->field_0x6e0.g, color.g, 10); - cLib_chaseS(&midna->field_0x6e0.b, color.b, 10); - cLib_chaseUC(&midna->field_0x6e8.r, kcolor1.r, 10); - cLib_chaseUC(&midna->field_0x6e8.g, kcolor1.g, 10); - cLib_chaseUC(&midna->field_0x6e8.b, kcolor1.b, 10); - cLib_chaseUC(&midna->field_0x6ec.r, kcolor2.r, 10); - cLib_chaseUC(&midna->field_0x6ec.g, kcolor2.g, 10); - cLib_chaseUC(&midna->field_0x6ec.b, kcolor2.b, 10); - } -} - -// Midna Charge Ring Color -DEFINE_HOOK(&daAlink_c::setWolfLockDomeModel, SetWolfLockDomeModel); -void wolf_lock_dome_model_post(ModContext*, void*, void*, void*) { - auto domeRingColorStr = get_str_option(get_cvars().midnaChargeRingColor, ""); - if (is_valid_hex_color_str(domeRingColorStr)) { - auto domeRingColor = hex_color_str_to_gx_color(domeRingColorStr); - const u8 domeWave1RGBA[3] = {domeRingColor.r, domeRingColor.g, domeRingColor.b}; - const u8 domeWave2RGBA[3] = {domeRingColor.r, domeRingColor.g, domeRingColor.b}; - u8** chromaRegisterTable = - reinterpret_cast(&daAlink_getAlinkActorClass()->field_0x0724->mAnmCRegDataR); - - for (int i = 0; i < 3; i++) { - u8* currentTable = chromaRegisterTable[i]; - const u8 currentWave1Color = domeWave1RGBA[i]; - const u8 currentWave2Color = domeWave2RGBA[i]; - const u8 currentBaseColor = (currentWave1Color + currentWave2Color) / 2; - - currentTable[0x3] = currentBaseColor; // Set Alpha for the ring base - currentTable[0x13] = currentWave1Color; // Set Alpha for ring wave 1 - currentTable[0x23] = currentWave2Color; // Set Alpha for ring wave 2 - currentTable[0xB] = currentBaseColor; // Set Alpha for darkworld ring base - currentTable[0x1B] = currentWave1Color; // Set Alpha for darkworld ring wave 1 - currentTable[0x2B] = currentWave2Color; // Set Alpha for darkworld ring wave 2 - } - } -} - -#define ADD_POST_HOOK(defined_hook, function, original) \ - result = mods::hook::add_post(function); \ - if (result != MOD_OK) { \ - mods::log::debug( \ - "failed to add post hook to" #original ", Result {}", static_cast(result)); \ - return result; \ - } - -#define ADD_PRE_HOOK(defined_hook, function, original) \ - result = mods::hook::add_pre(function); \ - if (result != MOD_OK) { \ - mods::log::debug( \ - "failed to add pre hook to" #original ", Result {}", static_cast(result)); \ - return result; \ - } - -ModResult add_all_hooks() { - ModResult result{}; - - // Hooks for lantern glow - ADD_POST_HOOK(WolfEyeLightSet, wolf_eye_light_set_post, dKy_WolfEyeLight_set) - ADD_POST_HOOK(PreKandelaarDraw, pre_kandelaar_draw_post, daAlink_c::preKandelaarDraw) - - // Hooks for lantern meter color - ADD_PRE_HOOK(CPaneMgrSetBlackWhite, cpane_mgr_set_black_white_pre, CPaneMgr::setBlackWhite) - ADD_POST_HOOK( - KanteraIconSetNowGauge, kantera_icon_set_now_gauge_post, dKantera_icon_c::setNowGauge) - - // Hook for midna charge ring - ADD_POST_HOOK(SetWolfLockDomeModel, wolf_lock_dome_model_post, daAlink_c::setWolfLockDomeModel) - - // Hook for light sword glow - ADD_POST_HOOK(SetLightningSwordEffect, set_lightning_sword_effect_post, - daAlink_c::setLightningSwordEffect) - - // Hooks for Midna Hair Color - ADD_POST_HOOK(MidnaCreate, midna_create_post, daMidna_c::create) - ADD_PRE_HOOK( - MidnaSetBodyPartMatrix, midna_set_body_part_matrix_pre, daMidna_c::setBodyPartMatrix) - ADD_POST_HOOK( - MidnaSetBodyPartMatrix, midna_set_body_part_matrix_post, daMidna_c::setBodyPartMatrix) - - // Hooks for UI colors - ADD_POST_HOOK(dMeter2Init, d_meter_2_init_post, dMeter2Draw_c::init) - ADD_POST_HOOK(FileInfoSetHeartCount, file_info_set_heart_count_post, dFile_info_c::setHeartCnt) - ADD_POST_HOOK(ScreenInitButton, screen_init_button_post, dMeterButton_c::screenInitButton) - ADD_POST_HOOK(MenuSaveScreenSet, menu_save_screen_set_post, dMenu_save_c::screenSet) - ADD_POST_HOOK(FileSelectScreenSet, file_select_screen_set_post, dFile_select_c::screenSet) - ADD_POST_HOOK(BrightCheckScreenSet, bright_check_screen_set_post, dBrightCheck_c::screenSet) - ADD_POST_HOOK(MenuRingCreate, menu_ring_create_post, dMenu_Ring_c::_create) - ADD_POST_HOOK(MenuCollect2DCreate, menu_collect_2D_create_post, dMenu_Collect2D_c::_create) - ADD_POST_HOOK(MenuFishingScreenSetDoIcon, menu_fishing_screen_set_do_icon_post, - dMenu_Fishing_c::screenSetDoIcon) - ADD_POST_HOOK(MenuInsectScreenSetDoIcon, menu_insect_screen_set_do_icon_post, - dMenu_Insect_c::screenSetDoIcon) - ADD_POST_HOOK(MenuLetterScreenSetDoIcon, menu_letter_screen_set_do_icon_post, - dMenu_Letter_c::screenSetDoIcon) - ADD_POST_HOOK(MenuOptionCreate, menu_option_create_post, dMenu_Option_c::_create) - ADD_POST_HOOK(MenuSkillScreenSetDoIcon, menu_skill_screen_set_do_icon_post, - dMenu_Skill_c::screenSetDoIcon) - ADD_POST_HOOK(OutFontCreatePane, out_font_create_pane_post, COutFont_c::createPane) - ADD_POST_HOOK(OutFontSetDrawFont, out_font_set_draw_font_post, COutFontSet_c::drawFont) - ADD_POST_HOOK(MenuFMapCreate, menu_fmap_create_post, dMenu_Fmap_c::_create) - ADD_POST_HOOK( - MsgObjectTalkStartInit, msg_object_talk_start_init_post, dMsgObject_c::talkStartInit) - ADD_POST_HOOK(MeterHakushaCreate, meter_hakusha_create_post, dMeterHakusha_c::_create) - - // Heart Model Color - ADD_POST_HOOK( - ItemBaseCreateItemHeap, item_base_create_item_heap_post, daItemBase_c::CreateItemHeap) - - return MOD_OK; -} - -#define UNINSTALL_HOOK(defined_hook) mods::hook::uninstall(svc_hook); - -ModResult remove_all_hooks() { - UNINSTALL_HOOK(WolfEyeLightSet) - UNINSTALL_HOOK(PreKandelaarDraw) - UNINSTALL_HOOK(CPaneMgrSetBlackWhite) - UNINSTALL_HOOK(KanteraIconSetNowGauge) - UNINSTALL_HOOK(SetWolfLockDomeModel) - UNINSTALL_HOOK(SetLightningSwordEffect) - UNINSTALL_HOOK(MidnaCreate) - UNINSTALL_HOOK(MidnaSetBodyPartMatrix) - UNINSTALL_HOOK(MidnaSetBodyPartMatrix) - UNINSTALL_HOOK(dMeter2Init) - UNINSTALL_HOOK(FileInfoSetHeartCount) - UNINSTALL_HOOK(ScreenInitButton) - UNINSTALL_HOOK(MenuSaveScreenSet) - UNINSTALL_HOOK(FileSelectScreenSet) - UNINSTALL_HOOK(BrightCheckScreenSet) - UNINSTALL_HOOK(MenuRingCreate) - UNINSTALL_HOOK(MenuCollect2DCreate) - UNINSTALL_HOOK(MenuFishingScreenSetDoIcon) - UNINSTALL_HOOK(MenuInsectScreenSetDoIcon) - UNINSTALL_HOOK(MenuLetterScreenSetDoIcon) - UNINSTALL_HOOK(MenuOptionCreate) - UNINSTALL_HOOK(MenuSkillScreenSetDoIcon) - UNINSTALL_HOOK(OutFontCreatePane) - UNINSTALL_HOOK(OutFontSetDrawFont) - UNINSTALL_HOOK(MenuFMapCreate) - UNINSTALL_HOOK(MsgObjectTalkStartInit) - UNINSTALL_HOOK(MeterHakushaCreate) - UNINSTALL_HOOK(ItemBaseCreateItemHeap) - return MOD_OK; -} diff --git a/mods/basic_cosmetics_mod/src/hooks.hpp b/mods/basic_cosmetics_mod/src/hooks.hpp deleted file mode 100644 index 62bb77cde9..0000000000 --- a/mods/basic_cosmetics_mod/src/hooks.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "mods/service.hpp" - -ModResult add_all_hooks(); - -ModResult remove_all_hooks(); \ No newline at end of file diff --git a/mods/basic_cosmetics_mod/src/midna_hair_color.cpp b/mods/basic_cosmetics_mod/src/midna_hair_color.cpp deleted file mode 100644 index 905a4345ff..0000000000 --- a/mods/basic_cosmetics_mod/src/midna_hair_color.cpp +++ /dev/null @@ -1,115 +0,0 @@ -#include "midna_hair_color.hpp" -#include "mod.hpp" - -#include "mods/svc/log.hpp" - -#include - -namespace { -constexpr std::array, 10> kMidnaHairColors = {{ - // Default - {{ - /*l_lNormalKColor*/ /*l_normalKColor*/ /*l_normalColor*/ - {0xFF, 0xDC, 0x00}, {0xB4, 0x87, 0x00}, {0x50, 0x00, 0x00}, - /*l_bigKColor*/ /*l_lBigColor*/ /*l_bigColor*/ - {0x1E, 0x00, 0x00}, {0xFF, 0x78, 0x00}, {0xFF, 0x64, 0x78}, - /*l_lNormalKColor2*//*l_normalKColor2*/ /*l_lBigKColor2*/ - {0x00, 0xC3, 0xEB}, {0x00, 0xC3, 0xC3}, {0xAA, 0xFF, 0xC3} - }}, - // Pink - {{ - {0xF5, 0xCF, 0xF3}, {0xAD, 0x7F, 0x7F}, {0x1B, 0x00, 0x20}, - {0x3C, 0x02, 0x58}, {0xE3, 0x72, 0xF2}, {0xE3, 0x5F, 0xF8}, - {0xDD, 0x00, 0xEB}, {0xDD, 0x00, 0xC3}, {0xF6, 0x4C, 0xFF} - }}, - // Red - {{ - {0xE4, 0x65, 0x41}, {0xA1, 0x3E, 0x22}, {0x21, 0x00, 0x00}, - {0x4F, 0x02, 0x01}, {0xF0, 0x3A, 0x25}, {0xF0, 0x30, 0x8C}, - {0xEB, 0x00, 0x00}, {0xEB, 0x00, 0x00}, {0xFF, 0x4F, 0x3A} - }}, - // Yellow - {{ - {0x91, 0x83, 0x0E}, {0x66, 0x50, 0x07}, {0x0E, 0x0B, 0x00}, - {0x24, 0x25, 0x02}, {0xCB, 0xB7, 0x00}, {0xCB, 0x99, 0x78}, - {0xEB, 0xDE, 0x00}, {0xEB, 0xDE, 0x00}, {0xFF, 0xF8, 0xBF} - }}, - // Green - {{ - {0x35, 0x79, 0x53}, {0x25, 0x4A, 0x2B}, {0x00, 0x0E, 0x05}, - {0x0A, 0x29, 0x10}, {0x00, 0xB6, 0x6F}, {0x00, 0x98, 0xB3}, - {0x1F, 0xEB, 0x00}, {0x1F, 0xEB, 0x00}, {0x9A, 0xFF, 0x81} - }}, - // Blue - {{ - {0x00, 0x72, 0xFF}, {0x00, 0x46, 0x85}, {0x00, 0x08, 0x28}, - {0x16, 0x1B, 0x5D}, {0x00, 0x60, 0xFF}, {0x00, 0x50, 0xFF}, - {0x00, 0x48, 0xEB}, {0x00, 0x48, 0xC3}, {0x3A, 0x66, 0xFF} - }}, - // Purple - {{ - {0x6F, 0x34, 0xFF}, {0x4E, 0x20, 0x85}, {0x0D, 0x00, 0x34}, - {0x15, 0x08, 0x79}, {0x62, 0x00, 0xFF}, {0x62, 0x00, 0xFF}, - {0x7B, 0x00, 0xEB}, {0x7B, 0x00, 0xC3}, {0x94, 0x3E, 0xFF} - }}, - // Brown - {{ - {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x1A, 0x05, 0x00}, - {0x3C, 0x19, 0x0E}, {0x3F, 0x1D, 0x0B}, {0x3F, 0x18, 0x7E}, - {0x3F, 0x1D, 0x0B}, {0x3F, 0x1D, 0x09}, {0x59, 0x32, 0x1E} - }}, - // White - {{ - {0xF0, 0xF1, 0xF1}, {0xA9, 0x94, 0x7E}, {0x09, 0x0B, 0x0C}, - {0x22, 0x24, 0x24}, {0xFF, 0xFF, 0xFF}, {0xFF, 0xD5, 0xFF}, - {0xEA, 0xEA, 0xEA}, {0xEA, 0xEA, 0xC2}, {0xF3, 0xF3, 0xF3} - }}, - // Black - {{ - {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x0B, 0x0B, 0x0B}, - {0x23, 0x23, 0x23}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x78}, - {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00}, {0x00, 0x00, 0x00} - }} -}}; - -size_t get_midna_hair_color_index(ConfigVarHandle handle) { - const auto optionIndex = get_int_option(handle, 0); - if (optionIndex < 0 || optionIndex >= static_cast(kMidnaHairColors.size())) { - return 0; - } - return static_cast(optionIndex); -} -} - -MidnaHairColors g_currentMidnaHairColors = { - .normalColor = {0x50, 0x00, 0x00, 0x00}, - .normalKColor = {0xB4, 0x87, 0x00, 0x00}, - .normalKColor2 = {0x00, 0xC3, 0xC3, 0x00}, - .bigColor = {0xFF, 0x64, 0x78, 0x00}, - .bigKColor = {0x1E, 0x00, 0x00, 0x00}, - .lNormalKColor = {0xFF, 0xDC, 0x00, 0x00}, - .lNormalKColor2 = {0x00, 0xC3, 0xEB, 0x00}, - .lBigColor = {0xFF, 0x78, 0x00, 0x00}, - .lBigKColor2 = {0xAA, 0xFF, 0xC3, 0x00}, -}; - -void set_all_midna_hair_colors() { - auto& g_cvars = get_cvars(); - auto hairBaseColor = get_midna_hair_color_index(g_cvars.midnaHairBaseColor); - auto hairTipsColor = get_midna_hair_color_index(g_cvars.midnaHairTipsColor); - - // Colors we have to convert to GXColorS10 - auto& normalColor = kMidnaHairColors.at(hairBaseColor)[2]; - auto& bigColor = kMidnaHairColors.at(hairBaseColor)[5]; - auto& lBigColor = kMidnaHairColors.at(hairBaseColor)[4]; - - g_currentMidnaHairColors.normalColor = GXColorS10{normalColor.r, normalColor.g, normalColor.b}; - g_currentMidnaHairColors.normalKColor = kMidnaHairColors.at(hairBaseColor)[1]; - g_currentMidnaHairColors.normalKColor2 = kMidnaHairColors.at(hairTipsColor)[7]; - g_currentMidnaHairColors.bigColor = GXColorS10{bigColor.r, bigColor.g, bigColor.b}; - g_currentMidnaHairColors.bigKColor = kMidnaHairColors.at(hairBaseColor)[3]; - g_currentMidnaHairColors.lNormalKColor = kMidnaHairColors.at(hairBaseColor)[0]; - g_currentMidnaHairColors.lNormalKColor2 = kMidnaHairColors.at(hairTipsColor)[6]; - g_currentMidnaHairColors.lBigColor = GXColorS10{lBigColor.r, lBigColor.g, lBigColor.b}; - g_currentMidnaHairColors.lBigKColor2 = kMidnaHairColors.at(hairTipsColor)[8]; -} diff --git a/mods/basic_cosmetics_mod/src/midna_hair_color.hpp b/mods/basic_cosmetics_mod/src/midna_hair_color.hpp deleted file mode 100644 index ad08f7c8c6..0000000000 --- a/mods/basic_cosmetics_mod/src/midna_hair_color.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include - -struct MidnaHairColors { - GXColorS10 normalColor; - GXColor normalKColor; - GXColor normalKColor2; - GXColorS10 bigColor; - GXColor bigKColor; - GXColor lNormalKColor; - GXColor lNormalKColor2; - GXColorS10 lBigColor; - GXColor lBigKColor2; -}; - -extern MidnaHairColors g_currentMidnaHairColors; - -void set_all_midna_hair_colors(); diff --git a/mods/basic_cosmetics_mod/src/mod.cpp b/mods/basic_cosmetics_mod/src/mod.cpp deleted file mode 100644 index 89a321da9c..0000000000 --- a/mods/basic_cosmetics_mod/src/mod.cpp +++ /dev/null @@ -1,653 +0,0 @@ -#include "mod.hpp" -#include "color_utils.hpp" -#include "hooks.hpp" -#include "midna_hair_color.hpp" -#include "texture_utils.hpp" - -#include "mods/service.hpp" -#include "mods/svc/config.h" -#include "mods/svc/hook.hpp" -#include "mods/svc/log.h" -#include "mods/svc/log.hpp" -#include "mods/svc/ui.h" - -#include "d/d_com_inf_game.h" - -#include - -#include -#include -#include - -DEFINE_MOD(); -IMPORT_SERVICE(LogService, svc_log); -IMPORT_SERVICE(ConfigService, svc_config); -IMPORT_SERVICE(HookService, svc_hook); -IMPORT_SERVICE(TextureService, svc_texture); -IMPORT_SERVICE(UiService, svc_ui); - -static cvars g_cvars; - -cvars& get_cvars() { - return g_cvars; -} - -std::string get_str_option(ConfigVarHandle handle, const std::string& fallback) { - std::string value{}; - size_t outLength{}; - svc_config->get_string(mod_ctx, handle, NULL, 0, &outLength); - value.resize(outLength); - if (handle == 0 || svc_config->get_string( - mod_ctx, handle, value.data(), value.size() + 1, &outLength) != MOD_OK) - { - return fallback; - } - return value; -} - -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; -} - -// Helper for getting configVar color -std::optional get_config_var_color(ConfigVarHandle handle, bool allowRainbow) { - auto colorStr = get_str_option(handle, ""); - // Convert to lowercase - for (auto& c : colorStr) { - c = static_cast(std::tolower(static_cast(c))); - } - if (colorStr == "rainbow" && allowRainbow) { - auto color = get_rainbow_rgb(127.5f); - color.r /= 2; - color.g /= 2; - color.b /= 2; - return color; - } - if (is_valid_hex_color_str(colorStr)) { - return hex_color_str_to_gx_color(colorStr); - } - return std::nullopt; -} - -namespace { -UiWindowHandle g_cosmeticsWindow = 0; -bool g_loadedAllBaseTextures = false; -constexpr uint32_t kTextureLoadRetryFrames = 30; -uint32_t g_textureLoadRetryCountdown = 0; - -constexpr const char* kOverlayPresets[] = { - "ab706e", - "6382a0", - "94749a", - "ec8644", - "b9ab00", - "ec9fc8", - "505154", - "f8f7f4", - "91723e", -}; - -constexpr const char* kLightPresets[] = { - "ff0000", - "f68821", - "f6f321", - "00ff00", - "0000ff", - "8000ff", - "a0a0a0", - "30d0d0", -}; - -constexpr const char* kRainbowLightPresets[] = { - "rainbow", - "ff0000", - "f68821", - "f6f321", - "00ff00", - "0000ff", - "8000ff", - "a0a0a0", -}; - -constexpr const char* kAButtonPresets[] = { - "ff0000", - "ff5000", - "ffaf00", - "0080ff", - "0000ff", - "8000ff", - "5555ff", - "ff20ff", -}; - -constexpr const char* kBButtonPresets[] = { - "ffff40", - "ffa0ff", - "00e87b", - "00aaff", - "6078ff", - "000000", - "00f3ff", -}; - -constexpr const char* kXyButtonPresets[] = { - "ff0000", - "ff8200", - "f7df00", - "70ff00", - "00bd11", - "0000ff", - "800088", - "000000", - "ff00aa", - "00ffff", -}; - -constexpr const char* kZButtonPresets[] = { - "ff0000", - "ff8200", - "f7df00", - "70ff00", - "00bd11", - "800088", - "000000", - "00ffff", -}; - -constexpr const char* kChargeRingPresets[] = { - "ff9f9f", - "ff0000", - "ffff00", - "00ff00", - "0000ff", - "ff00ff", - "331900", - "feffff", - "000000", -}; - -ModResult register_str_option( - const char* name, const char* defaultValue, ConfigVarHandle& outHandle, ModError* error) { - ConfigVarDesc cvarDesc = CONFIG_VAR_DESC_INIT; - cvarDesc.name = name; - cvarDesc.type = CONFIG_VAR_STRING; - cvarDesc.default_string = defaultValue; - if (svc_config->register_var(mod_ctx, &cvarDesc, &outHandle) != MOD_OK) { - return mods::set_error(error, MOD_ERROR, "failed to register cosmetics 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 cosmetics option"); - } - return MOD_OK; -} - -void add_control(UiElementHandle pane, const UiControlDesc& desc) { - auto result = svc_ui->pane_add_control(mod_ctx, pane, &desc, nullptr); - if (result != MOD_OK) { - mods::log::debug("pane_add_control failed {}", static_cast(result)); - } -} - -template -void add_cosmetic_option( - UiElementHandle pane, ConfigVarHandle cvar, const char* name, const char* const (&presets)[N]) { - UiControlDesc control = UI_CONTROL_DESC_INIT; - control.kind = UI_CONTROL_COLOR; - control.label = name; - control.binding = UI_BINDING_CONFIG_VAR; - control.config_var = cvar; - control.color_presets = presets; - control.color_preset_count = N; - add_control(pane, control); -} - -void add_midna_hair_option(UiElementHandle left, ConfigVarHandle cvar, const std::string& name) { - static const char* kMidnaHairOptions[] = { - "Default", "Pink", "Red", "Yellow", "Green", "Blue", "Purple", "Brown", "White", "Black"}; - UiControlDesc control = UI_CONTROL_DESC_INIT; - control.kind = UI_CONTROL_SELECT; - control.label = name.c_str(); - control.help_rml = "Choose Midna's hair color."; - control.binding = UI_BINDING_CONFIG_VAR; - control.config_var = cvar; - control.options = kMidnaHairOptions; - control.option_count = 10; - add_control(left, control); -} - -void add_group( - UiElementHandle groups, UiElementHandle colors, const char* label, UiGroupBuildFn build) { - UiGroupDesc group = UI_GROUP_DESC_INIT; - group.label = label; - group.build = build; - const auto result = svc_ui->pane_add_group(mod_ctx, groups, colors, &group, nullptr); - if (result != MOD_OK) { - mods::log::debug("pane_add_group failed {}", static_cast(result)); - } -} - -ModResult build_hero_tunic_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Hero's Tunic"); - add_cosmetic_option(pane, g_cvars.herosTunicCapColor, "Cap", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.herosTunicTorsoColor, "Body", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.herosTunicSkirtColor, "Skirt", kOverlayPresets); - return MOD_OK; -} - -ModResult build_zora_armor_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Zora Armor"); - add_cosmetic_option(pane, g_cvars.zoraArmorCapColor, "Cap", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.zoraArmorHelmetColor, "Helmet", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.zoraArmorTorsoColor, "Torso", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.zoraArmorScalesColor, "Scales", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.zoraArmorFlippersColor, "Flippers", kOverlayPresets); - return MOD_OK; -} - -ModResult build_sword_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Swords"); - add_cosmetic_option(pane, g_cvars.woodenSwordColor, "Wooden Sword", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.ordonSwordBladeColor, "Ordon Blade", kLightPresets); - add_cosmetic_option(pane, g_cvars.ordonSwordHandleColor, "Ordon Handle", kLightPresets); - add_cosmetic_option(pane, g_cvars.msBladeColor, "Master Sword Blade", kLightPresets); - add_cosmetic_option(pane, g_cvars.msHandleColor, "Master Sword Handle", kLightPresets); - add_cosmetic_option( - pane, g_cvars.lightSwordGlowColor, "Light Sword Glow", kRainbowLightPresets); - return MOD_OK; -} - -ModResult build_equipment_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Equipment"); - add_cosmetic_option(pane, g_cvars.lanternGlowColor, "Lantern Glow", kRainbowLightPresets); - add_cosmetic_option(pane, g_cvars.boomerangColor, "Gale Boomerang", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.ironBootsColor, "Iron Boots", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.spinnerColor, "Spinner", kOverlayPresets); - return MOD_OK; -} - -ModResult build_button_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Buttons"); - add_cosmetic_option(pane, g_cvars.aButtonColor, "A Button", kAButtonPresets); - add_cosmetic_option(pane, g_cvars.bButtonColor, "B Button", kBButtonPresets); - add_cosmetic_option(pane, g_cvars.xButtonColor, "X Button", kXyButtonPresets); - add_cosmetic_option(pane, g_cvars.yButtonColor, "Y Button", kXyButtonPresets); - add_cosmetic_option(pane, g_cvars.zButtonColor, "Z Button", kZButtonPresets); - return MOD_OK; -} - -ModResult build_hud_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "HUD"); - add_cosmetic_option(pane, g_cvars.heartColor, "Hearts", kBButtonPresets); - return MOD_OK; -} - -ModResult build_link_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Link"); - add_cosmetic_option(pane, g_cvars.linkHairColor, "Hair", kOverlayPresets); - return MOD_OK; -} - -ModResult build_midna_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Midna"); - add_cosmetic_option(pane, g_cvars.midnaChargeRingColor, "Charge Ring", kChargeRingPresets); - return MOD_OK; -} - -ModResult build_companion_colors(ModContext*, UiElementHandle pane, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, pane, "Companions"); - add_cosmetic_option(pane, g_cvars.wolfLinkColor, "Wolf Link", kOverlayPresets); - add_cosmetic_option(pane, g_cvars.eponaColor, "Epona", kOverlayPresets); - return MOD_OK; -} - -ModResult build_equipment_colors_tab( - ModContext*, UiWindowHandle, UiElementHandle left, UiElementHandle right, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, left, "Color Groups"); - add_group(left, right, "Hero's Tunic", build_hero_tunic_colors); - add_group(left, right, "Zora Armor", build_zora_armor_colors); - add_group(left, right, "Swords", build_sword_colors); - add_group(left, right, "Equipment", build_equipment_colors); - - return MOD_OK; -} - -ModResult build_ui_colors_tab( - ModContext*, UiWindowHandle, UiElementHandle left, UiElementHandle right, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, left, "Color Groups"); - add_group(left, right, "Buttons", build_button_colors); - add_group(left, right, "HUD", build_hud_colors); - - return MOD_OK; -} - -ModResult build_misc_colors_tab( - ModContext*, UiWindowHandle, UiElementHandle left, UiElementHandle right, void*, ModError*) { - svc_ui->pane_add_section(mod_ctx, left, "Hair Presets"); - add_midna_hair_option(left, g_cvars.midnaHairBaseColor, "Midna's Hair Base Color"); - add_midna_hair_option(left, g_cvars.midnaHairTipsColor, "Midna's Hair Tips Color"); - svc_ui->pane_add_section(mod_ctx, left, "Color Groups"); - add_group(left, right, "Link", build_link_colors); - add_group(left, right, "Midna", build_midna_colors); - add_group(left, right, "Companions", build_companion_colors); - - return MOD_OK; -} - -void on_cosmetics_menu_window_closed(ModContext*, UiWindowHandle, void*) { - g_cosmeticsWindow = 0; -} - -void on_open_cosmetics_menu(ModContext*, void*) { - if (g_cosmeticsWindow != 0) { - return; - } - UiTabDesc tabs[] = {UI_TAB_DESC_INIT, UI_TAB_DESC_INIT, UI_TAB_DESC_INIT}; - tabs[0].title = "Equipment"; - tabs[0].build = build_equipment_colors_tab; - tabs[1].title = "Interface"; - tabs[1].build = build_ui_colors_tab; - tabs[2].title = "Characters"; - tabs[2].build = build_misc_colors_tab; - UiWindowDesc desc = UI_WINDOW_DESC_INIT; - desc.tabs = tabs; - desc.tab_count = ARRAY_SIZE(tabs); - desc.on_closed = on_cosmetics_menu_window_closed; - if (svc_ui->window_push(mod_ctx, &desc, &g_cosmeticsWindow) != MOD_OK) { - svc_log->error(mod_ctx, "failed to open basic cosmetics window"); - } -} - -ModResult build_panel(ModContext*, UiElementHandle panel, void*, ModError*) { - UiControlDesc control = UI_CONTROL_DESC_INIT; - control.kind = UI_CONTROL_GROUP; - control.label = "Open Cosmetics Menu"; - control.on_pressed = on_open_cosmetics_menu; - add_control(panel, control); - return MOD_OK; -} -} // namespace - -void load_base_texture_data() { - // Go through each texture we can recolor and attempt to load and store - // the texture data for future recoloring - for (auto& replacements : get_texture_replacements() | std::views::values) { - for (auto& replacement : replacements) { - // If we've already loaded the texture data, don't load it again - if (replacement.loadedTextureData) { - continue; - } - - // Avoid noisy resource lookups until the archive has finished loading. - auto* resInfo = dComIfG_getObjectResInfo(replacement.arc); - if (resInfo == nullptr || resInfo->getArchive() == nullptr) { - continue; - } - - // Try to get the model this texture is part of. If we can't get it, try again later - auto model = static_cast( - dComIfG_getObjectRes(replacement.arc, replacement.modelFileName)); - if (model == nullptr) { - continue; - } - - J3DTexture* tex = model->getTexture(); - JUTNameTab* nametable = model->getTextureName(); - if (tex != nullptr && nametable != nullptr) { - for (u16 i = 0; i < tex->getNum(); i++) { - const char* texName = nametable->getName(i); - if (texName != nullptr && std::strcmp(texName, replacement.textureName) == 0) { - // Once we've found the texture, set all our TextureKey and TextureData - // fields that we can set right now. - auto imageHeader = tex->getResTIMG(i); - auto& key = replacement.key; - auto& data = replacement.data; - key.kind = TEXTURE_KEY_SOURCE; - key.has_tlut = imageHeader->numColors > 0; - key.width = imageHeader->width; - key.height = imageHeader->height; - key.gx_format = imageHeader->format; - - // Currently, no replaced textures have a tlut - key.tlut_hash = replacement.tlutHash; - - // Calculate the size of the image data - const uint32_t mipCount = - imageHeader->mipmapEnabled ? - std::max(imageHeader->mipmapCount, 1) : - 1; - auto size = get_image_data_size( - imageHeader->format, imageHeader->width, imageHeader->height, mipCount); - replacement.baseTextureData.resize(size); - std::memcpy( - replacement.baseTextureData.data(), tex->getImgDataPtr(i), size); - - // Source texture keys hash only the base mip level. - const auto baseMipSize = get_image_data_size( - imageHeader->format, imageHeader->width, imageHeader->height, 1); - auto textureHash = - XXH64(replacement.baseTextureData.data(), baseMipSize, 0); - replacement.key.texture_hash = textureHash; - - mods::log::debug("Loaded base texture data for {}. size: {:X} hash: {:X}", - replacement.textureName, size, textureHash); - replacement.loadedTextureData = true; - - data.width = imageHeader->width; - data.height = imageHeader->height; - data.mip_count = mipCount; - data.size = size; - data.gx_format = imageHeader->format; - - break; - } - } - } - } - } - - // If we've loaded all base textures for recoloring, then we don't need to call this function - // again - g_loadedAllBaseTextures = std::ranges::all_of( - get_texture_replacements() | std::views::values, [](auto& replacementList) { - return std::ranges::all_of( - replacementList, [](const TextureReplacementData& replacement) { - return replacement.loadedTextureData; - }); - }); -} - -ModResult check_and_set_recolored_textures() { - for (auto& [configVar, replacements] : get_texture_replacements()) { - // If the configvar hasn't been set, don't continue - if (configVar == 0) { - continue; - } - - auto maybeColor = get_config_var_color(configVar); - if (!maybeColor.has_value()) { - // An empty or invalid option means the original texture should be restored. - for (auto& replacement : replacements) { - if (replacement.handle != 0) { - auto result = svc_texture->unregister(mod_ctx, replacement.handle); - if (result != MOD_OK) { - mods::log::debug("Could not unregister replacement for {}. Result: {}", - replacement.textureName, static_cast(result)); - } - replacement.handle = 0; - } - replacement.curColor.reset(); - } - continue; - } - - auto color = maybeColor.value(); - for (auto& replacement : replacements) { - // If we haven't loaded the base texture yet, don't try to recolor it - if (!replacement.loadedTextureData) { - continue; - } - - // If our color hasn't changed, don't try to recolor - auto& curColor = replacement.curColor; - if (curColor == std::nullopt || curColor.value().r != color.r || - curColor.value().g != color.g || curColor.value().b != color.b) - { - // Make a copy of the base texture data to recolor - auto newTexture = replacement.baseTextureData; - recolor_texture(replacement, color, newTexture); - - TextureData newTextureData = replacement.data; - newTextureData.data = newTexture.data(); - newTextureData.size = newTexture.size(); - - // Keep the current replacement active if registering the new one fails. - TextureReplacementHandle newHandle{}; - auto result = svc_texture->register_data( - mod_ctx, &replacement.key, &newTextureData, &newHandle); - if (result != MOD_OK) { - mods::log::debug("Could not register_data for {}. Result: {}", - replacement.textureName, static_cast(result)); - } else { - mods::log::debug("Registered replacement for {}.", replacement.textureName, - static_cast(result)); - auto oldHandle = replacement.handle; - replacement.handle = newHandle; - curColor = color; - - if (oldHandle != 0) { - result = svc_texture->unregister(mod_ctx, oldHandle); - if (result != MOD_OK) { - mods::log::debug( - "Could not unregister previous replacement for {}. Result: {}", - replacement.textureName, static_cast(result)); - } - } - } - } - } - } - - return MOD_OK; -} - -void unregister_all_texture_handles() { - for (auto& replacements : get_texture_replacements() | std::views::values) { - for (auto& replacement : replacements) { - if (replacement.handle != 0) { - svc_texture->unregister(mod_ctx, replacement.handle); - replacement.handle = 0; - } - replacement.curColor.reset(); - } - } -} - -#define REGISTER_COSMETIC_OPTION(option) \ - result = register_str_option(#option, NULL, g_cvars.option, error); \ - if (result != MOD_OK) { \ - return result; \ - } - -extern "C" { -MOD_EXPORT ModResult mod_initialize(ModError* error) { - svc_log->info(mod_ctx, "basic_cosmetics_mod initialized"); - - ModResult result{}; - - REGISTER_COSMETIC_OPTION(herosTunicCapColor) - REGISTER_COSMETIC_OPTION(herosTunicTorsoColor) - REGISTER_COSMETIC_OPTION(herosTunicSkirtColor) - REGISTER_COSMETIC_OPTION(zoraArmorCapColor) - REGISTER_COSMETIC_OPTION(zoraArmorHelmetColor) - REGISTER_COSMETIC_OPTION(zoraArmorTorsoColor) - REGISTER_COSMETIC_OPTION(zoraArmorScalesColor) - REGISTER_COSMETIC_OPTION(zoraArmorFlippersColor) - REGISTER_COSMETIC_OPTION(lanternGlowColor) - REGISTER_COSMETIC_OPTION(woodenSwordColor) - REGISTER_COSMETIC_OPTION(ordonSwordBladeColor) - REGISTER_COSMETIC_OPTION(ordonSwordHandleColor) - REGISTER_COSMETIC_OPTION(msBladeColor) - REGISTER_COSMETIC_OPTION(msHandleColor) - REGISTER_COSMETIC_OPTION(lightSwordGlowColor) - REGISTER_COSMETIC_OPTION(boomerangColor) - REGISTER_COSMETIC_OPTION(ironBootsColor) - REGISTER_COSMETIC_OPTION(spinnerColor) - REGISTER_COSMETIC_OPTION(aButtonColor) - REGISTER_COSMETIC_OPTION(bButtonColor) - REGISTER_COSMETIC_OPTION(xButtonColor) - REGISTER_COSMETIC_OPTION(yButtonColor) - REGISTER_COSMETIC_OPTION(zButtonColor) - REGISTER_COSMETIC_OPTION(heartColor) - - result = register_int_option("midnaHairBaseColor", 0, g_cvars.midnaHairBaseColor, error); - if (result != MOD_OK) { - return result; - } - - result = register_int_option("midnaHairTipsColor", 0, g_cvars.midnaHairTipsColor, error); - if (result != MOD_OK) { - return result; - } - - REGISTER_COSMETIC_OPTION(midnaChargeRingColor) - REGISTER_COSMETIC_OPTION(linkHairColor) - REGISTER_COSMETIC_OPTION(wolfLinkColor) - REGISTER_COSMETIC_OPTION(eponaColor) - - UiModsPanelDesc panelDesc = UI_MODS_PANEL_DESC_INIT; - panelDesc.build = build_panel; - svc_ui->register_mods_panel(mod_ctx, &panelDesc); - - // Add all our hooks - result = add_all_hooks(); - if (result != MOD_OK) { - return result; - } - - g_loadedAllBaseTextures = false; - g_textureLoadRetryCountdown = 0; - return MOD_OK; -} - -MOD_EXPORT ModResult mod_update(ModError*) { - update_rainbow_rgb(1.0f); - set_all_midna_hair_colors(); - - if (!g_loadedAllBaseTextures) { - if (g_textureLoadRetryCountdown == 0) { - load_base_texture_data(); - g_textureLoadRetryCountdown = kTextureLoadRetryFrames; - } else { - --g_textureLoadRetryCountdown; - } - } - - check_and_set_recolored_textures(); - - return MOD_OK; -} - -MOD_EXPORT ModResult mod_shutdown(ModError*) { - svc_log->info(mod_ctx, "basic_cosmetics_mod unloaded"); - g_cosmeticsWindow = 0; - remove_all_hooks(); - unregister_all_texture_handles(); - get_texture_replacements().clear(); - g_loadedAllBaseTextures = false; - g_textureLoadRetryCountdown = 0; - return MOD_OK; -} -} diff --git a/mods/basic_cosmetics_mod/src/mod.hpp b/mods/basic_cosmetics_mod/src/mod.hpp deleted file mode 100644 index 6d77949b03..0000000000 --- a/mods/basic_cosmetics_mod/src/mod.hpp +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -#include "mods/svc/config.h" -#include "mods/svc/texture.h" - -#include - -#include -#include -#include - -struct cvars { - ConfigVarHandle herosTunicCapColor = 0; - ConfigVarHandle herosTunicTorsoColor = 0; - ConfigVarHandle herosTunicSkirtColor = 0; - ConfigVarHandle zoraArmorCapColor = 0; - ConfigVarHandle zoraArmorHelmetColor = 0; - ConfigVarHandle zoraArmorTorsoColor = 0; - ConfigVarHandle zoraArmorScalesColor = 0; - ConfigVarHandle zoraArmorFlippersColor = 0; - ConfigVarHandle lanternGlowColor = 0; - ConfigVarHandle woodenSwordColor = 0; - ConfigVarHandle ordonSwordBladeColor = 0; - ConfigVarHandle ordonSwordHandleColor = 0; - ConfigVarHandle msBladeColor = 0; - ConfigVarHandle msHandleColor = 0; - ConfigVarHandle lightSwordGlowColor = 0; - ConfigVarHandle boomerangColor = 0; - ConfigVarHandle ironBootsColor = 0; - ConfigVarHandle spinnerColor = 0; - ConfigVarHandle heartColor = 0; - ConfigVarHandle aButtonColor = 0; - ConfigVarHandle bButtonColor = 0; - ConfigVarHandle xButtonColor = 0; - ConfigVarHandle yButtonColor = 0; - ConfigVarHandle zButtonColor = 0; - ConfigVarHandle midnaHairBaseColor = 0; - ConfigVarHandle midnaHairTipsColor = 0; - ConfigVarHandle midnaChargeRingColor = 0; - ConfigVarHandle linkHairColor = 0; - ConfigVarHandle wolfLinkColor = 0; - ConfigVarHandle eponaColor = 0; -}; - -struct TextureReplacementData { - const char* arc{}; - const char* modelFileName{}; - const char* textureName{}; - uint64_t textureHash{}; - uint64_t tlutHash{}; - TextureKey key = TEXTURE_KEY_INIT; - TextureData data = TEXTURE_DATA_INIT; - TextureReplacementHandle handle{}; - std::vector baseTextureData{}; - bool loadedTextureData = false; - std::optional curColor{}; -}; - -cvars& get_cvars(); - -std::string get_str_option(ConfigVarHandle handle, const std::string& fallback); - -int64_t get_int_option(ConfigVarHandle handle, int64_t fallback); - -std::optional get_config_var_color(ConfigVarHandle handle, bool allowRainbow = false); \ No newline at end of file diff --git a/mods/basic_cosmetics_mod/src/texture_utils.cpp b/mods/basic_cosmetics_mod/src/texture_utils.cpp deleted file mode 100644 index 98c60dbad3..0000000000 --- a/mods/basic_cosmetics_mod/src/texture_utils.cpp +++ /dev/null @@ -1,682 +0,0 @@ -#include "texture_utils.hpp" -#include "color_utils.hpp" -#include "mod.hpp" - -#include "mods/svc/config.h" -#include "mods/svc/log.hpp" - -#include "JSystem/J3DGraphLoader/J3DModelLoader.h" -#include "JSystem/JSupport/JSupport.h" -#include "JSystem/JUtility/JUTNameTab.h" -#include "d/actor/d_a_alink.h" - -static void get_gx_tile_info(uint8_t format, uint32_t& tileWidth, uint32_t& tileHeight, uint32_t& tileSize) { - switch (format) { - case GX_TF_I8: - case GX_TF_IA4: - case GX_TF_C8: - tileWidth = 8; tileHeight = 4; tileSize = 32; - break; - case GX_TF_IA8: - case GX_TF_RGB565: - case GX_TF_RGB5A3: - case GX_TF_C14X2: - tileWidth = 4; tileHeight = 4; tileSize = 32; - break; - case GX_TF_RGBA8: - tileWidth = 4; tileHeight = 4; tileSize = 64; - break; - case GX_TF_I4: - case GX_TF_C4: - case GX_TF_CMPR: - default: - tileWidth = 8; tileHeight = 8; tileSize = 32; - break; - } -} - -uint32_t get_image_data_size(uint32_t format, uint32_t width, uint32_t height, uint32_t mipmapCount) { - - uint32_t tileWidth, tileHeight, tileSize; - get_gx_tile_info(format, tileWidth, tileHeight, tileSize); - - uint32_t totalSize = 0; - - for (uint8_t i = 0; i < mipmapCount; ++i) { - // Round dimensions up to nearest tile boundary - uint32_t paddedWidth = (width + tileWidth - 1) & ~(tileWidth - 1); - uint32_t paddedHeight = (height + tileHeight - 1) & ~(tileHeight - 1); - - uint32_t tilesX = paddedWidth / tileWidth; - uint32_t tilesY = paddedHeight / tileHeight; - - totalSize += tilesX * tilesY * tileSize; - - // Downscale dimensions for next mipmap level - width = std::max(1u, width >> 1); - height = std::max(1u, height >> 1); - } - - return totalSize; -} - -// When left is greater than right -// 0b00 points to the left color -// 0b01 points to the right color -// 0b10 is closer to left color -// 0b11 is closer to right color - -// When left is not greater than right -// 0b00 points to the left color -// 0b01 points to the right color -// 0b10 is midway between the colors -// 0b11 is transparent - -// That means when maintaining the relative order, if we have to swap the colors: - -// in the case of left being greater than right: -// 0b00 will swap to 0b01 -// 0b01 will swap to 0b00 -// 0b10 will swap to 0b11 -// 0b11 will swap to 0b10 -// So the left bit stays the same, and the right bit changes -// Can do xor (^) like 0b01010101 or 0x55 for each u16 - -// in the case of left not being greater than right: -// 0b00 will swap to 0b01 -// 0b01 will swap to 0b00 -// 0b10 will stay the same -// 0b11 will stay the same -// so if the left bit is a 0, the right bit will change -uint32_t swap_index_bits(bool leftIsGreater, uint32_t bits) { - if (leftIsGreater) { - return bits ^ 0x55555555; - } - - const uint32_t mask = ((bits >> 1) & 0x55555555) ^ 0x55555555; - return bits ^ mask; -} - -void recolor_cmpr_texture(const TextureReplacementData& replacementData, const GXColor color, std::vector& newTextureDataOut) -{ - uint16_t recolors[0x100]; - for (int32_t i = 0; i < 0x100; i++) { - recolors[i] = blend_overlay_rgb_565(i, color); - } - - const uint8_t mipCount = (replacementData.data.mip_count > 0) ? replacementData.data.mip_count : 1; - uint32_t mipWidth = replacementData.key.width; - uint32_t mipHeight = replacementData.key.height; - - uint8_t* currentAddr = newTextureDataOut.data(); - - for (uint8_t mip = 0; mip < mipCount; ++mip) { - // Round dimensions up to the nearest 8x8 tile boundary - const uint32_t roundedWidth = (mipWidth + 7) & ~7; - const uint32_t roundedHeight = (mipHeight + 7) & ~7; - - const uint32_t numBlocks = (roundedWidth / 8) * (roundedHeight / 8); - const uint32_t iterations = numBlocks * 4; // 4 CMPR sub-blocks per 8x8 tile - - for (uint32_t i = 0; i < iterations; i++) { - auto* rgb565Ptr = reinterpret_cast*>(currentAddr); - - auto leftRgb565 = rgb565Ptr[0]; - auto rightRgb565 = rgb565Ptr[1]; - const bool leftIsGreater = leftRgb565 > rightRgb565; - - const uint32_t leftGrayVal = desaturate_rgb_565(leftRgb565); - const uint32_t rightGrayVal = desaturate_rgb_565(rightRgb565); - - uint16_t leftNewRgb565 = recolors[leftGrayVal]; - uint16_t rightNewRgb565 = recolors[rightGrayVal]; - - bool needsBitSwap = false; - - if (leftIsGreater) { - if (leftNewRgb565 == rightNewRgb565) { - // Need to make sure that subtracting 1 does not mess - // everything up. For example, 0x1000 - 1 => 0x0fff which is - // a completely different color. - if ((leftNewRgb565 & 0x1f) == 0) { - // If left value has 0 blue, we change its blue to 1. - leftNewRgb565 += 1; - } - rightNewRgb565 = leftNewRgb565 - 1; - } - else if (leftNewRgb565 < rightNewRgb565) { - needsBitSwap = true; - } - } - else if (leftNewRgb565 > rightNewRgb565) { - needsBitSwap = true; - } - - if (needsBitSwap) { - // The left and right colors are swapping so that their values - // are relative in the same way. We need to update the bits - // referencing the palette entries to handle the swap. - const uint16_t temp = leftNewRgb565; - leftNewRgb565 = rightNewRgb565; - rightNewRgb565 = temp; - - auto wordPtr = reinterpret_cast*>(currentAddr); - const uint32_t bits = wordPtr[1]; - - const uint32_t newBits = swap_index_bits(leftIsGreater, bits); - wordPtr[1] = newBits; - } - - rgb565Ptr[0] = leftNewRgb565; - rgb565Ptr[1] = rightNewRgb565; - - currentAddr += 8; - } - - // Halve dimensions for the next mipmap level - mipWidth = std::max(1u, mipWidth >> 1); - mipHeight = std::max(1u, mipHeight >> 1); - } -} - -void recolor_rgb5a3_texture(const TextureReplacementData& replacementData, const GXColor color, std::vector& newTextureDataOut) -{ - // Precompute lookup tables for both RGB555 (opaque) and RGB444 (translucent) modes - uint16_t recolors_rgb555[0x100]; - uint16_t recolors_rgb444[0x100]; - - for (int32_t i = 0; i < 0x100; i++) { - const uint8_t r = blend_overlay_channel(i, color.r); - const uint8_t g = blend_overlay_channel(i, color.g); - const uint8_t b = blend_overlay_channel(i, color.b); - - // Pack as RGB555: Bit 15 set to 1 + 5 bits R, G, B - recolors_rgb555[i] = 0x8000 | ((r >> 3) << 10) | ((g >> 3) << 5) | (b >> 3); - - // Pack as RGB444: 4 bits R, G, B (Bit 15 remains 0) - recolors_rgb444[i] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); - } - - const uint8_t mipCount = - replacementData.data.mip_count > 0 ? replacementData.data.mip_count : 1; - uint32_t mipWidth = replacementData.key.width; - uint32_t mipHeight = replacementData.key.height; - auto* pixelPtr = reinterpret_cast*>(newTextureDataOut.data()); - - for (uint8_t mip = 0; mip < mipCount; ++mip) { - const uint32_t roundedWidth = (mipWidth + 3) & ~3; - const uint32_t roundedHeight = (mipHeight + 3) & ~3; - const uint32_t totalPixels = roundedWidth * roundedHeight; - - for (uint32_t i = 0; i < totalPixels; i++) { - const uint16_t rawPixel = pixelPtr[i]; - - // MSB determines if pixel is opaque or translucent - if (rawPixel & 0x8000) { - // Pixel is opaque - const uint8_t r5 = (rawPixel >> 10) & 0x1F; - const uint8_t g5 = (rawPixel >> 5) & 0x1F; - const uint8_t b5 = rawPixel & 0x1F; - - // Expand 5-bit to 8-bit - const uint8_t r8 = (r5 << 3) | (r5 >> 2); - const uint8_t g8 = (g5 << 3) | (g5 >> 2); - const uint8_t b8 = (b5 << 3) | (b5 >> 2); - - const uint8_t grayVal = static_cast((r8 * 77 + g8 * 150 + b8 * 29) >> 8); - - pixelPtr[i] = recolors_rgb555[grayVal]; - } else { - // Pixel is translucent - const uint16_t alpha3 = rawPixel & 0x7000; - - const uint8_t r4 = (rawPixel >> 8) & 0x0F; - const uint8_t g4 = (rawPixel >> 4) & 0x0F; - const uint8_t b4 = rawPixel & 0x0F; - - // Expand 4-bit to 8-bit - const uint8_t r8 = (r4 << 4) | r4; - const uint8_t g8 = (g4 << 4) | g4; - const uint8_t b8 = (b4 << 4) | b4; - - const uint8_t grayVal = static_cast((r8 * 77 + g8 * 150 + b8 * 29) >> 8); - - // Combine original alpha with recolored RGB444 - pixelPtr[i] = alpha3 | recolors_rgb444[grayVal]; - } - } - - pixelPtr += totalPixels; - mipWidth = std::max(1u, mipWidth >> 1); - mipHeight = std::max(1u, mipHeight >> 1); - } -} - -// Function to encode a single 4x4 sub-block (16 pixels) into an 8-byte CMPR block -static void encode_cmpr_sub_block(uint8_t* dst, const uint8_t pixels[16]) { - uint8_t min_val = 255; - uint8_t max_val = 0; - - for (int i = 0; i < 16; ++i) { - if (pixels[i] < min_val) min_val = pixels[i]; - if (pixels[i] > max_val) max_val = pixels[i]; - } - - auto intensity_to_rgb565 = [](uint8_t val) -> uint16_t { - uint16_t r5 = val >> 3; - uint16_t g6 = val >> 2; - uint16_t b5 = val >> 3; - return static_cast((r5 << 11) | (g6 << 5) | b5); - }; - - uint16_t c0_565 = intensity_to_rgb565(max_val); - uint16_t c1_565 = intensity_to_rgb565(min_val); - uint32_t indices = 0; - - if (max_val > min_val) { - // Enforce c0_565 > c1_565 in unsigned 16-bit representation to use 4-color mode - if (c0_565 == c1_565) { - if ((c0_565 & 0x001F) < 0x001F) { - c0_565 += 1; - } else { - c1_565 -= 1; - } - } - - // Interpolated 8-bit intensity values for quantization - const int c0 = max_val; - const int c1 = min_val; - const int c2 = (2 * max_val + min_val) / 3; - const int c3 = (max_val + 2 * min_val) / 3; - - // Map each pixel to the nearest palette entry - for (int i = 0; i < 16; ++i) { - const int p = pixels[i]; - const int d0 = std::abs(p - c0); - const int d1 = std::abs(p - c1); - const int d2 = std::abs(p - c2); - const int d3 = std::abs(p - c3); - - uint32_t best_idx = 0; - int min_d = d0; - - if (d1 < min_d) { min_d = d1; best_idx = 1; } - if (d2 < min_d) { min_d = d2; best_idx = 2; } - if (d3 < min_d) { min_d = d3; best_idx = 3; } - - indices |= (best_idx << (30 - (2 * i))); - } - } - - // Account for big endian data expectation - dst[0] = static_cast(c0_565 >> 8); - dst[1] = static_cast(c0_565 & 0xFF); - dst[2] = static_cast(c1_565 >> 8); - dst[3] = static_cast(c1_565 & 0xFF); - dst[4] = static_cast(indices >> 24); - dst[5] = static_cast((indices >> 16) & 0xFF); - dst[6] = static_cast((indices >> 8) & 0xFF); - dst[7] = static_cast(indices & 0xFF); -} - -bool convert_i8_to_cmpr(TextureReplacementData& replacementData, std::vector& cmprOut) { - if (cmprOut.empty()) { - return false; - } - - const uint8_t mipCount = (replacementData.data.mip_count > 0) ? replacementData.data.mip_count : 1; - const auto expectedInputSize = get_image_data_size( - GX_TF_I8, replacementData.key.width, replacementData.key.height, mipCount); - if (cmprOut.size() < expectedInputSize) { - return false; - } - - const auto sourceData = cmprOut; - std::vector convertedData(get_image_data_size( - GX_TF_CMPR, replacementData.key.width, replacementData.key.height, mipCount)); - uint32_t mipWidth = replacementData.key.width; - uint32_t mipHeight = replacementData.key.height; - - const uint8_t* readPtr = sourceData.data(); - uint8_t* writePtr = convertedData.data(); - - for (uint8_t mip = 0; mip < mipCount; ++mip) { - const uint32_t paddedWidthI8 = (mipWidth + 7) & ~7; - const uint32_t paddedHeightI8 = (mipHeight + 3) & ~3; - const uint32_t tilesX_I8 = paddedWidthI8 / 8; - - const uint32_t paddedWidthCMPR = (mipWidth + 7) & ~7; - const uint32_t paddedHeightCMPR = (mipHeight + 7) & ~7; - const uint32_t blocksX_CMPR = paddedWidthCMPR / 8; - const uint32_t blocksY_CMPR = paddedHeightCMPR / 8; - - for (uint32_t by = 0; by < blocksY_CMPR; ++by) { - for (uint32_t bx = 0; bx < blocksX_CMPR; ++bx) { - uint8_t subBlockPixels[4][16]{}; - - for (uint32_t subBlockY = 0; subBlockY < 2; ++subBlockY) { - for (uint32_t subBlockX = 0; subBlockX < 2; ++subBlockX) { - const uint32_t subBlock = subBlockY * 2 + subBlockX; - for (uint32_t row = 0; row < 4; ++row) { - for (uint32_t col = 0; col < 4; ++col) { - const uint32_t x = bx * 8 + subBlockX * 4 + col; - const uint32_t y = by * 8 + subBlockY * 4 + row; - if (x >= mipWidth || y >= mipHeight) { - continue; - } - - const uint32_t tile = (y / 4) * tilesX_I8 + (x / 8); - const uint32_t tileOffset = (y % 4) * 8 + (x % 8); - subBlockPixels[subBlock][row * 4 + col] = - readPtr[tile * 32 + tileOffset]; - } - } - } - } - - for (const auto& subBlockPixel : subBlockPixels) { - encode_cmpr_sub_block(writePtr, subBlockPixel); - writePtr += 8; - } - } - } - - const uint32_t tilesY_I8 = paddedHeightI8 / 4; - readPtr += tilesX_I8 * tilesY_I8 * 32; - - mipWidth = std::max(1u, mipWidth >> 1); - mipHeight = std::max(1u, mipHeight >> 1); - } - - cmprOut.swap(convertedData); - - // Update format - replacementData.data.gx_format = GX_TF_CMPR; - - return true; -} - -void recolor_texture(TextureReplacementData& replacementData, GXColor color, std::vector& newTextureDataOut) { - - switch (replacementData.key.gx_format) { - case GX_TF_CMPR: - recolor_cmpr_texture(replacementData, color, newTextureDataOut); - break; - case GX_TF_RGB5A3: - recolor_rgb5a3_texture(replacementData, color, newTextureDataOut); - break; - case GX_TF_I8: - if (convert_i8_to_cmpr(replacementData, newTextureDataOut)) { - recolor_cmpr_texture(replacementData, color, newTextureDataOut); - } else { - mods::log::debug("Could not convert {} from i8 to cmpr", replacementData.textureName); - } - break; - default: - break; - } -} - -std::unordered_map>& get_texture_replacements() { - static std::unordered_map> replacements{}; - - if (replacements.empty()) { - replacements = { - {get_cvars().herosTunicCapColor, { - { - .arc = "Kmdl", - .modelFileName = "al_head.bmd", - .textureName = "al_cap", - } - }}, - {get_cvars().herosTunicTorsoColor, { - { - .arc = "Kmdl", - .modelFileName = "al.bmd", - .textureName = "al_upbody", - } - }}, - {get_cvars().herosTunicSkirtColor, { - { - .arc = "Kmdl", - .modelFileName = "al.bmd", - .textureName = "al_lowbody", - } - }}, - {get_cvars().zoraArmorCapColor, { - { - .arc = "Zmdl", - .modelFileName = "zl_head.bmd", - .textureName = "zl_cap", - } - }}, - {get_cvars().zoraArmorHelmetColor, { - { - .arc = "Zmdl", - .modelFileName = "zl_head.bmd", - .textureName = "zl_helmet", - } - }}, - {get_cvars().zoraArmorTorsoColor, { - { - .arc = "Zmdl", - .modelFileName = "zl.bmd", - .textureName = "zl_armor", - }, - { - .arc = "Zmdl", - .modelFileName = "zl.bmd", - .textureName = "zl_armL", - } - }}, - {get_cvars().zoraArmorScalesColor, { - { - .arc = "Zmdl", - .modelFileName = "zl.bmd", - .textureName = "zl_body", - } - }}, - {get_cvars().zoraArmorFlippersColor, { - { - .arc = "Zmdl", - .modelFileName = "zl.bmd", - .textureName = "zl_boots", - } - }}, - {get_cvars().woodenSwordColor, { - { - .arc = "Bmdl", // Ordon Clothes Model - .modelFileName = "al_swb.bmd", - .textureName = "al_SWB", - }, - { - .arc = "Kmdl", // Hero's Tunic Model - .modelFileName = "al_swb.bmd", - .textureName = "al_SWB", - }, - { - .arc = "Zmdl", // Zora Armor Model - .modelFileName = "al_swb.bmd", - .textureName = "al_SWB", - }, - { - .arc = "Mmdl", // Magic Armor Model - .modelFileName = "al_swb.bmd", - .textureName = "al_SWB", - }, - { - .arc = "O_gD_SWB", // Get Item Model - .modelFileName = "o_gd_al_swb.bmd", - .textureName = "al_SWB", - } - }}, - {get_cvars().ordonSwordHandleColor, { - { - .arc = "Alink", - .modelFileName = "al_swa.bmd", - .textureName = "al_SWgripA", - }, - { - .arc = "O_gD_SWA", // Get Item Model - .modelFileName = "o_gd_al_swa.bmd", - .textureName = "al_SWgripA", - } - }}, - {get_cvars().ordonSwordBladeColor, { - { - .arc = "Alink", - .modelFileName = "al_swa.bmd", - .textureName = "al_SWA", - } - }}, - {get_cvars().msHandleColor, { - { - .arc = "Alink", - .modelFileName = "al_swm.bmd", - .textureName = "al_SWgripM", - } - }}, - {get_cvars().msBladeColor, { - { - .arc = "Alink", - .modelFileName = "al_swm.bmd", - .textureName = "al_SWM", - } - }}, - {get_cvars().boomerangColor, { - { - .arc = "Alink", // Boomerang in Link's hand - .modelFileName = "al_boom.bmd", - .textureName = "L_al_boom00", - }, - { - .arc = "E_mk", // Boomerang in Ook's hand - .modelFileName = "bm.bmd", - .textureName = "L_al_boom00", - }, - { - .arc = "E_mk", // Boomerang in Ook's hand - .modelFileName = "bm.bmd", - .textureName = "bm_boom", - }, - { - .arc = "O_gD_boom", // Get Item Model - .modelFileName = "o_gd_boom.bmd", - .textureName = "L_al_boom00", - } - }}, - {get_cvars().ironBootsColor, { - { - .arc = "Bmdl", // Ordon Clothes Model - .modelFileName = "al_bootsh.bmd", - .textureName = "al_bootsH", - }, - { - .arc = "Kmdl", // Hero's Tunic Model - .modelFileName = "al_bootsh.bmd", - .textureName = "al_bootsH", - }, - { - .arc = "Zmdl", // Zora Armor Model - .modelFileName = "al_bootsh.bmd", - .textureName = "al_bootsH", - }, - { - .arc = "Mmdl", // Magic Armor Model - .modelFileName = "al_bootsh.bmd", - .textureName = "al_bootsH", - }, - { - .arc = "O_gD_boot", // Get Item Model - .modelFileName = "o_gd_al_bootsh.bmd", - .textureName = "al_bootsH", - } - }}, - {get_cvars().spinnerColor, { - { - .arc = "Alink", // Spinner used by Link - .modelFileName = "al_sp.bmd", - .textureName = "al_SP", - }, - { - .arc = "O_gD_SP", // Get Item Model - .modelFileName = "o_gd_al_sp.bmd", - .textureName = "al_SP", - } - }}, - {get_cvars().linkHairColor, { - { - .arc = "Bmdl", // Ordon Clothes Model - .modelFileName = "bl_head.bmd", - .textureName = "bl_hair", - }, - { - .arc = "Kmdl", // Hero's Tunic Model - .modelFileName = "al_head.bmd", - .textureName = "al_hair", - }, - { - .arc = "Mmdl", // Magic Armor Model - .modelFileName = "ml_head.bmd", - .textureName = "al_hair", - } - }}, - {get_cvars().wolfLinkColor, { - { - .arc = "Wmdl", - .modelFileName = "wl.bmd", - .textureName = "wl_body", - }, - { - .arc = "Wmdl", - .modelFileName = "wl.bmd", - .textureName = "wl_eye.1", - }, - { - .arc = "Wmdl", - .modelFileName = "wl.bmd", - .textureName = "wl_eye.2", - }, - { - .arc = "Wmdl", - .modelFileName = "wl.bmd", - .textureName = "wl_eye.3", - }, - { - .arc = "Wmdl", - .modelFileName = "wl.bmd", - .textureName = "wl_eye.4", - }, - { - .arc = "Wmdl", - .modelFileName = "wl.bmd", - .textureName = "wl_eye.5", - } - }}, - {get_cvars().eponaColor, { - { - .arc = "Horse", - .modelFileName = "hs.bmd", - .textureName = "hs_body", - }, - { - .arc = "Horse", - .modelFileName = "hs.bmd", - .textureName = "hs_eye.1", - }, - { - .arc = "Horse", - .modelFileName = "hs.bmd", - .textureName = "hs_eye.2", - }, - { - .arc = "Horse", - .modelFileName = "hs.bmd", - .textureName = "hs_eye.3", - }, - }}, - }; - } - - return replacements; -} diff --git a/mods/basic_cosmetics_mod/src/texture_utils.hpp b/mods/basic_cosmetics_mod/src/texture_utils.hpp deleted file mode 100644 index 49dd0df81a..0000000000 --- a/mods/basic_cosmetics_mod/src/texture_utils.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -/** - * File originally copied from console TPR with permission from isaac - * https://github.com/zsrtp/libtp_rel/blob/master/include/util/texture_utils.h - */ - -#include "mod.hpp" - -#include - -#include -#include - -uint32_t get_image_data_size( - uint32_t format, uint32_t width, uint32_t height, uint32_t mipmapCount); - -void recolor_texture( - TextureReplacementData& replacementData, GXColor color, std::vector& newTextureDataOut); - -std::unordered_map>& get_texture_replacements(); diff --git a/mods/cosmetics b/mods/cosmetics new file mode 160000 index 0000000000..93971c38aa --- /dev/null +++ b/mods/cosmetics @@ -0,0 +1 @@ +Subproject commit 93971c38aa7286c59be7c3874a95e12d1a37036a diff --git a/mods/basic_cosmetics_mod/CMakeLists.txt b/mods/custom_actor_demo/CMakeLists.txt similarity index 52% rename from mods/basic_cosmetics_mod/CMakeLists.txt rename to mods/custom_actor_demo/CMakeLists.txt index f00540864b..d7e55536d4 100644 --- a/mods/basic_cosmetics_mod/CMakeLists.txt +++ b/mods/custom_actor_demo/CMakeLists.txt @@ -1,5 +1,6 @@ cmake_minimum_required(VERSION 3.25) -project(basic_cosmetics_mod CXX) +project(custom_actor_demo CXX) +set(CMAKE_CXX_STANDARD 20) if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) set(DUSK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." CACHE PATH "Path to dusk source root") @@ -12,24 +13,9 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) endif () endif () -include(FetchContent) - -message(STATUS "basic_cosmetics_mod: Fetching xxhash") -FetchContent_Declare( - xxhash - GIT_REPOSITORY https://github.com/Cyan4973/xxHash.git - GIT_TAG v0.8.3 -) -FetchContent_MakeAvailable(xxhash) - -set(COSMETIC_SOURCES src/color_utils.cpp src/midna_hair_color.cpp src/texture_utils.cpp src/hooks.cpp) - -add_mod(basic_cosmetics_mod +add_mod(custom_actor_demo FEATURES game fmt - SOURCES src/mod.cpp ${COSMETIC_SOURCES} + SOURCES src/mod.cpp src/m_a_obj_wrock.cpp src/m_a_mine.cpp MOD_JSON mod.json RES_DIR res - BUNDLE ) - -target_link_libraries(basic_cosmetics_mod PRIVATE xxHash::xxhash) diff --git a/mods/custom_actor_demo/mod.json b/mods/custom_actor_demo/mod.json new file mode 100644 index 0000000000..55f57c264d --- /dev/null +++ b/mods/custom_actor_demo/mod.json @@ -0,0 +1,7 @@ +{ + "id": "dev.twilitrealm.custom_actor_demo", + "name": "[Demo] Custom Actor", + "version": "1.0.0", + "author": "Twilit Realm", + "description": "A mod to demonstrate how to create and use custom actors. Spawns a \"wrock\" in South Faron Woods." +} diff --git a/mods/basic_cosmetics_mod/res/.gitkeep b/mods/custom_actor_demo/res/.gitkeep similarity index 100% rename from mods/basic_cosmetics_mod/res/.gitkeep rename to mods/custom_actor_demo/res/.gitkeep diff --git a/mods/custom_actor_demo/src/m_a_mine.cpp b/mods/custom_actor_demo/src/m_a_mine.cpp new file mode 100644 index 0000000000..fd7fa77b65 --- /dev/null +++ b/mods/custom_actor_demo/src/m_a_mine.cpp @@ -0,0 +1,227 @@ +#include "m_a_mine.hpp" +#include "d/d_com_inf_game.h" +#include "res/Object/O_mD_jira.h" + +// The name of the archive in /res/Object/ +static const char* l_resName = "O_mD_jira"; + +// The actor's heap (for resources) should be enough to hold the data for the model and collision +static constexpr u32 heap_size = ALIGN_NEXT(16832, 0x20); + +ma_Mine_c::~ma_Mine_c() { + // Called every time the actor is deleted + + // Delete the sound object + mSound.deleteObject(); + + // Request to unload the archive (the data acts as a shared pointer, and only gets deleted when + // the reference counter goes to zero) + dComIfG_resDelete(&mPhase, l_resName); +} + +cPhs_Step ma_Mine_c::create() { + // Because of how the actor system works, an actor's constructor doesn't get called when an + // actor is created. We need to manually do it here with the following ma: + fopAcM_ct(this, ma_Mine_c); + + // The create function gets called until we return cPhs_COMPLEATE_e while an actor is loading. + // We request to load the archive here, and wait until the dvd completes loading it + cPhs_Step step = dComIfG_resLoad(&mPhase, l_resName); + if (step == cPhs_COMPLEATE_e) { + // Initialize the solid heap for the actor's resources, if needed + if (!fopAcM_entrySolidHeap(this, createHeapCallBack, heap_size)) { + return cPhs_ERROR_e; + } + + // Setup our collision sphere and register it to the world + // Set a circle "wall" of 30 units around the actor + mAcchCir.SetWall(30.0f, 30.0f); + mAcch.Set(this, 1, &mAcchCir); + mAcch.ClrWaterNone(); + mAcch.SetRoofCrrHeight(60.0f); + mAcch.SetWaterCheckOffset(10000.0f); + mAcch.SetWtrChkMode(2); + mAcch.OnLineCheck(); + + mCcStts.Init(30, 0xFF, this); + + // Collision Sphere for the actor (copied from Bomb Actor) + static const dCcD_SrcSph + l_sphSrc = {.mObjInf = + { + .mObj = {.mFlags = 0x0, + .mSrcObjHitInf = {.mObjAt = {.mType = AT_TYPE_BOMB, + .mAtp = 0x4, + .mBase = {.mSPrm = 0x1e}}, + .mObjTg = {.mType = 0xd8fbffef, .mBase = {.mSPrm = 0x11}}, + .mObjCo = {.mBase = {.mSPrm = 0x79}}}}, + .mGObjAt{.mSe = dCcD_SE_NONE, + .mHitMark = 0x0, + .mSpl = 0x1, + .mMtrl = 0x0, + .mBase = {.mGFlag = 0x0}}, + .mGObjTg{.mSe = dCcD_SE_NONE, + .mHitMark = 0x0, + .mSpl = 0x0, + .mMtrl = 0x0, + .mBase = {.mGFlag = 0x4}}, + .mGObjCo{.mBase = {.mGFlag = 0x0}}, + }, + .mSphAttr = {.mSph = {.mCenter = {0.0f, 0.0f, 0.0f}, .mRadius = 80.0f}}}; + + mCollisionSphere.Set(l_sphSrc); + mCollisionSphere.SetStts(&mCcStts); + + // We register a callback anytime the actor is hit (both attacks and is hit) + mCollisionSphere.SetAtHitCallback(atHitCallback); + mCollisionSphere.SetTgHitCallback(atHitCallback); + mCollisionSphere.OffTgSetBit(); + mCollisionSphere.OffCoSetBit(); + mCollisionSphere.OnAtSetBit(); // Enable the attack sphere + + // Set the initial matrix and cull box for the actor + fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); + fopAcM_SetMin(this, -36.0f, 0.0f, -36.0f); + fopAcM_SetMax(this, 36.0f, 66.0f, 36.0f); + + // Call execute so the actor's information in the world can be updated + Execute(); + } + return step; +} + +// Initializes the heap that all instances of this actor will use for resources +// Gets called from the callback in fopAcM_entrySolidHeap +int ma_Mine_c::CreateHeap() { + // Get the bmd data from the archive and initialize it + J3DModelData* model_data = + (J3DModelData*)dComIfG_getObjectRes(l_resName, dRes_INDEX_O_MD_JIRA_BMD_O_MD_JIRAI_e); + if (model_data == NULL) { + return 0; + } + mpModel = mDoExt_J3DModel__create(model_data, 0x80000, 0x11000084); + if (mpModel == NULL) { + return 0; + } + + // Create the sound object the actor will use + mSound.init(¤t.pos, 1); + + return 1; +} + +int ma_Mine_c::createHeapCallBack(fopAc_ac_c* i_this) { + return static_cast(i_this)->CreateHeap(); +} + +int ma_Mine_c::Delete() { + // Call the destructor anytime we delete the actor + this->~ma_Mine_c(); + return 1; +} + +int ma_Mine_c::Execute() { + // Update collision with the world + mAcch.CrrPos(dComIfG_Bgsp()); + mCollisionSphere.SetC(attention_info.position); + dComIfG_Ccsp()->Set(&mCollisionSphere); + + // Get the collision below the actor + cBgS_GndChk groundChunk = mAcch.m_gnd; + f32 groundH = mAcch.GetGroundH(); + if (groundH != -G_CM3D_F_INF) { + // Set the actor's environment colors to match the room's current ones + int roomNo = dComIfG_Bgsp().GetRoomId(groundChunk); + tevStr.YukaCol = dComIfG_Bgsp().GetPolyColor(groundChunk); + tevStr.room_no = roomNo; + + // Set the actor's room to be where it is sitting + mCcStts.SetRoomId(roomNo); + fopAcM_SetRoomNo(this, roomNo); + + // Get the reverb info here that the actor can use when exploding + mReverb = dComIfGp_getReverb(roomNo); + } + + // Update the model's transformation matrix to match the actor's transform + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::ZXYrotM(shape_angle); + mDoMtx_stack_c::scaleM(scale); + mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); + + // Set any attention flags (if needed) + eyePos = attention_info.position = current.pos; + attention_info.flags = 0; + return 1; +} + +int ma_Mine_c::Draw() { + // Update the model's lighting with the scene + g_env_light.settingTevStruct(0x20, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr); + + // Set the bmd model to be drawn when the display list is executed + mDoExt_modelUpdateDL(mpModel); + + return 1; +} + +void ma_Mine_c::atHit(dCcD_GObjInf* i_atObjInf) { + // Create particles with these IDs at the actor's position + static const u16 normalNameID[] = { + 0x161, 0x162, 0x163, 0x164, 0x165, 0x166, 0x167, 0x168, 0x1EC}; + for (int i = 0; i < ARRAY_SIZE(normalNameID); i++) { + dComIfGp_particle_setColor(normalNameID[i], ¤t.pos, &tevStr, NULL, NULL, 0.0f, 0xFF, + &shape_angle, &scale, NULL, -1, NULL); + } + + // Create an explosion sound + mSound.startSound(Z2SE_OBJ_BOMB_EXPLODE, 0, mReverb); + + // Vibrate the controller + dComIfGp_getVibration().StartShock(4, 31, cXyz(0.0f, 1.0f, 0.0f)); + + // Request to delete the actor so it disappears + fopAcM_delete(this); +} + +void ma_Mine_c::atHitCallback(fopAc_ac_c* i_tgActor, dCcD_GObjInf* i_tgObjInf, + fopAc_ac_c* i_atActor, dCcD_GObjInf* i_atObjInf) { + // This callback gets triggered anytime an intersection happens with the object's collision sphere + ((ma_Mine_c*)i_tgActor)->atHit(i_atObjInf); +} + +static cPhs_Step ma_Mine_create(void* i_this) { + return static_cast(i_this)->create(); +} + +static int maMine_Delete(void* i_this) { + return static_cast(i_this)->Delete(); +} + +static int maMine_Execute(void* i_this) { + return static_cast(i_this)->Execute(); +} + +static int maMine_Draw(void* i_this) { + return static_cast(i_this)->Draw(); +} + +static int maMine_IsDelete(void*) { + return 1; +} + +s16 ma_Mine_c::sProcName = -1; +ActorHandle ma_Mine_c::sActorHandle = -1; +const ActorProfileDesc ma_Mine_c::sProfile = {.name = MA_MINE_NAME, + .priority_group = 7, + .process_size = sizeof(ma_Mine_c), + .draw_priority = fpcDwPi_OBJ_LBOX_e, // An unused draw priority + .status = fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e | fopAcStts_CULL_e, + .group = fopAc_ACTOR_e, + .cull_type = fopAc_CULLBOX_CUSTOM_e, + .create_function = ma_Mine_create, + .delete_function = maMine_Delete, + .execute_function = maMine_Execute, + .is_delete_function = maMine_IsDelete, + .draw_function = maMine_Draw}; diff --git a/mods/custom_actor_demo/src/m_a_mine.hpp b/mods/custom_actor_demo/src/m_a_mine.hpp new file mode 100644 index 0000000000..147938473f --- /dev/null +++ b/mods/custom_actor_demo/src/m_a_mine.hpp @@ -0,0 +1,43 @@ +#pragma once +#include "mods/svc/actor.h" + +// Base actor class definitions +#include "f_op/f_op_actor.h" + +// Definitions for request_of_phase_process_class and cPhs_Step +#include "SSystem/SComponent/c_phase.h" + +// Definitions for collision +#include "d/d_bg_s_acch.h" +#include "d/d_bg_w.h" +#include "d/d_cc_d.h" + +#define MA_MINE_NAME "m_mine" + +class ma_Mine_c : public fopAc_ac_c { +public: + request_of_phase_process_class mPhase; + J3DModel* mpModel; + dBgS_ObjAcch mAcch; + dBgS_AcchCir mAcchCir; + Mtx mColliderMtx; + dCcD_Stts mCcStts; + dCcD_Sph mCollisionSphere; + Z2SoundObjSimple mSound; + s8 mReverb; + + virtual ~ma_Mine_c(); + cPhs_Step create(); + int CreateHeap(); + int Delete(); + int Execute(); + int Draw(); + void atHit(dCcD_GObjInf* i_atObjInf); + static int createHeapCallBack(fopAc_ac_c*); + static void atHitCallback(fopAc_ac_c* i_tgActor, dCcD_GObjInf* i_tgObjInf, + fopAc_ac_c* i_atActor, dCcD_GObjInf* i_atObjInf); + + static s16 sProcName; + static ActorHandle sActorHandle; + static const ActorProfileDesc sProfile; +}; diff --git a/mods/custom_actor_demo/src/m_a_obj_wrock.cpp b/mods/custom_actor_demo/src/m_a_obj_wrock.cpp new file mode 100644 index 0000000000..bb40d10cf3 --- /dev/null +++ b/mods/custom_actor_demo/src/m_a_obj_wrock.cpp @@ -0,0 +1,195 @@ +/* + * m_a_obj_wrock.cpp + * An example actor for a rock that can be placed in the world. + */ + +#include "m_a_obj_wrock.hpp" +#include "d/d_com_inf_game.h" +#include "res/Object/WRock.h" + +// The name of the archive in /res/Object/ +static const char* l_resName = "Wrock"; + +// The actor's heap (for resources) should be enough to hold the data for the model and collision +static constexpr u32 heap_size = ALIGN_NEXT(13952, 0x20) + ALIGN_NEXT(1920, 0x20); + +maObj_Wrock_c::~maObj_Wrock_c() { + // Called every time the actor is deleted + + // Remove the collider from the world's collision + if (mpCollider != NULL) { + dComIfG_Bgsp().Release(mpCollider); + } + + // Request to unload the archive (the data acts as a shared pointer, and only gets deleted when + // the reference counter goes to zero) + dComIfG_resDelete(&mPhase, l_resName); +} + +cPhs_Step maObj_Wrock_c::create() { + // Because of how the actor system works, an actor's constructor doesn't get called when an + // actor is created. We need to manually do it here with the following macro: + fopAcM_ct(this, maObj_Wrock_c); + + // The create function gets called until we return cPhs_COMPLEATE_e while an actor is loading. + // We request to load the archive here, and wait until the dvd completes loading it + cPhs_Step step = dComIfG_resLoad(&mPhase, l_resName); + if (step == cPhs_COMPLEATE_e) { + // Initialize the solid heap for the actor's resources, if needed + if (!fopAcM_entrySolidHeap(this, createHeapCallBack, heap_size)) { + return cPhs_ERROR_e; + } + + // Register the actor's collider to the current world's collision + if (mpCollider != NULL) { + if (dComIfG_Bgsp().Regist(mpCollider, this) == true) { + return cPhs_ERROR_e; + } + } + + // Set the initial matrix and cull box for the actor + fopAcM_SetMtx(this, mpModel->getBaseTRMtx()); + fopAcM_setCullSizeBox(this, -400.0f, -400.0f, -400.0f, 400.0f, 400.0f, 400.0f); + + // Setup collision info (will be used in execute) + mAcch.Set(¤t.pos, &old.pos, this, 1, &mAcchCir, &speed, ¤t.angle, &shape_angle); + + // Call execute so the actor's information in the world can be updated + Execute(); + } + return step; +} + +// Initializes the heap that all instances of this actor will use for resources +// Gets called from the callback in fopAcM_entrySolidHeap +int maObj_Wrock_c::CreateHeap() { + // Get the bmd data from the archive and initialize it + J3DModelData* model_data = + (J3DModelData*)dComIfG_getObjectRes(l_resName, dRes_INDEX_WROCK_BMD_WROCK_e); + if (model_data == NULL) { + return 0; + } + mpModel = mDoExt_J3DModel__create(model_data, 0x80000, 0x11000084); + if (mpModel == NULL) { + return 0; + } + + // Get the dzb collision data from the archive and initialize it + mpCollider = JKR_NEW dBgW(); + if (mpCollider == NULL) { + return 0; + } + cBgD_t* dzb = (cBgD_t*)dComIfG_getObjectRes(l_resName, dRes_INDEX_WROCK_DZB_WROCK_e); + if (mpCollider->Set(dzb, 1, &mColliderMtx) == true) { + return 0; + } + mpCollider->SetCrrFunc(dBgS_MoveBGProc_Typical); + return 1; +} + +int maObj_Wrock_c::createHeapCallBack(fopAc_ac_c* i_this) { + return static_cast(i_this)->CreateHeap(); +} + +int maObj_Wrock_c::Delete() { + // Call the destructor anytime we delete the actor + this->~maObj_Wrock_c(); + return 1; +} + +int maObj_Wrock_c::Execute() { + // Update collision with the world + mAcch.CrrPos(dComIfG_Bgsp()); + + // Get the collision below the actor + mGndChk = mAcch.m_gnd; + mGroundH = mAcch.GetGroundH(); + if (mGroundH != -G_CM3D_F_INF) { + // Set the actor's environment colors to match the room's current ones + tevStr.YukaCol = dComIfG_Bgsp().GetPolyColor(mGndChk); + tevStr.room_no = dComIfG_Bgsp().GetRoomId(mGndChk); + + // Set the actor's room to be where it is sitting + fopAcM_SetRoomNo(this, dComIfG_Bgsp().GetRoomId(mGndChk)); + } + + // Update the model's transformation matrix to match the actor's transform + mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z); + mDoMtx_stack_c::ZXYrotM(shape_angle); + mDoMtx_stack_c::scaleM(scale); + mpModel->setBaseTRMtx(mDoMtx_stack_c::get()); + + // Copy the model's transformation matrix to the collider's transformation matrix and update the + // collider + if (mpCollider != NULL) { + PSMTXCopy(mpModel->getBaseTRMtx(), mColliderMtx); + mpCollider->Move(); + } + + // Set any attention flags (if needed) + eyePos = attention_info.position = current.pos; + attention_info.flags = 0; + return 1; +} + +int maObj_Wrock_c::Draw() { + // Update the model's lighting with the scene + g_env_light.settingTevStruct(0x20, ¤t.pos, &tevStr); + g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr); + + // Set the current dlist to BG Which means that shadows can be cast on it + // Because of the messy collider, the shadows don't look great, but this is here as an example + dComIfGd_setListBG(); + + // Set the bmd model to be drawn when the display list is executed + mDoExt_modelUpdateDL(mpModel); + + // Cast a shadow for the actor onto the ground. + // We can only do this if we are drawing to the normal dlist, not the BG dlist + // if (mGroundH != -G_CM3D_F_INF) { + // mShadow = dComIfGd_setShadow(mShadow, 1, mpModel, ¤t.pos, + // 2000.0f, 0.0f, + // current.pos.y, mGroundH, mGndChk, &tevStr, 0, + // 1.0f, &dDlst_shadowControl_c::mSimpleTexObj); + // } + + // Reset the active dlist + dComIfGd_setList(); + + return 1; +} + +static cPhs_Step maObj_Wrock_Create(void* i_this) { + return static_cast(i_this)->create(); +} + +static int maObj_Wrock_Delete(void* i_this) { + return static_cast(i_this)->Delete(); +} + +static int maObj_Wrock_Execute(void* i_this) { + return static_cast(i_this)->Execute(); +} + +static int maObj_Wrock_Draw(void* i_this) { + return static_cast(i_this)->Draw(); +} + +static int maObj_Wrock_IsDelete(void*) { + return 1; +} + +s16 maObj_Wrock_c::sProcName = -1; +ActorHandle maObj_Wrock_c::sActorHandle = -1; +const ActorProfileDesc maObj_Wrock_c::sProfile = {.name = MAOBJ_WROCK_NAME, + .priority_group = 7, + .process_size = sizeof(maObj_Wrock_c), + .draw_priority = fpcDwPi_OBJ_LBOX_e, // An unused draw priority + .status = fopAcStts_UNK_0x40000_e | fopAcStts_UNK_0x4000_e | fopAcStts_CULL_e, + .group = fopAc_ACTOR_e, + .cull_type = fopAc_CULLBOX_CUSTOM_e, + .create_function = maObj_Wrock_Create, + .delete_function = maObj_Wrock_Delete, + .execute_function = maObj_Wrock_Execute, + .is_delete_function = maObj_Wrock_IsDelete, + .draw_function = maObj_Wrock_Draw}; diff --git a/mods/custom_actor_demo/src/m_a_obj_wrock.hpp b/mods/custom_actor_demo/src/m_a_obj_wrock.hpp new file mode 100644 index 0000000000..1e18d36f5f --- /dev/null +++ b/mods/custom_actor_demo/src/m_a_obj_wrock.hpp @@ -0,0 +1,39 @@ +#pragma once +#include "mods/svc/actor.h" + +// Base actor class definitions +#include "f_op/f_op_actor.h" + +// Definitions for request_of_phase_process_class and cPhs_Step +#include "SSystem/SComponent/c_phase.h" + +// Definitions for collision +#include "d/d_bg_s_acch.h" +#include "d/d_bg_w.h" + +#define MAOBJ_WROCK_NAME "wrock" + +class maObj_Wrock_c : public fopAc_ac_c { +public: + request_of_phase_process_class mPhase; + J3DModel* mpModel; + dBgS_ObjAcch mAcch; + cBgS_GndChk mGndChk; + dBgS_AcchCir mAcchCir; + Mtx mColliderMtx; + dBgW* mpCollider; + f32 mGroundH; + int mShadow; + + virtual ~maObj_Wrock_c(); + cPhs_Step create(); + int CreateHeap(); + int Delete(); + int Execute(); + int Draw(); + static int createHeapCallBack(fopAc_ac_c*); + + static s16 sProcName; + static ActorHandle sActorHandle; + static const ActorProfileDesc sProfile; +}; diff --git a/mods/custom_actor_demo/src/mod.cpp b/mods/custom_actor_demo/src/mod.cpp new file mode 100644 index 0000000000..971ad6e4f0 --- /dev/null +++ b/mods/custom_actor_demo/src/mod.cpp @@ -0,0 +1,85 @@ +#include "mods/service.hpp" +#include "mods/svc/actor.h" +#include "mods/svc/log.hpp" +#include "mods/svc/stage.h" + +#include "d/d_com_inf_game.h" + +#include "m_a_mine.hpp" +#include "m_a_obj_wrock.hpp" + +#include + +DEFINE_MOD(); +IMPORT_SERVICE(LogService, svc_log); +IMPORT_SERVICE(ActorService, svc_actor); +IMPORT_SERVICE(StageService, svc_stage); + +extern "C" { +MOD_EXPORT ModResult mod_initialize(ModError*) { + if (svc_actor->register_actor(mod_ctx, &maObj_Wrock_c::sProfile, &maObj_Wrock_c::sProcName, + &maObj_Wrock_c::sActorHandle) != MOD_OK) + { + mods::log::error("Failed to register actor wrock!"); + return MOD_ERROR; + } + + const stage_actor_data_class wrockParams{ + .name = MAOBJ_WROCK_NAME, + .base = + { + .parameters = 0, + .position = {-14324.0f, 0.0f, 341.0f}, + .angle = {0, -16595, 0}, + .setID = 0xFFFF, + }, + }; + if (svc_stage->add_actor( + mod_ctx, "F_SP108", 0, -1, &wrockParams, sizeof(wrockParams), nullptr) != MOD_OK) + { + mods::log::error("Adding wrock to F_SP108 Failed!"); + return MOD_ERROR; + } + + if (svc_actor->register_actor(mod_ctx, &ma_Mine_c::sProfile, &ma_Mine_c::sProcName, + &ma_Mine_c::sActorHandle) != MOD_OK) + { + mods::log::error("Failed to register actor " MA_MINE_NAME); + return MOD_ERROR; + } + + static const std::array minePositions = { + {{-14445.0f, 11.0f, 1304.0f}, {-14557.0f, 7.0f, 990.0f}, {-14790.0f, 7.0f, 634.0f}, + {-14829.0f, 0.0f, 144.0f}, {-14615.0f, 0.0f, -170.0f}, {-14283.0f, 10.0f, -420.0f}}}; + for (const auto& pos : minePositions) { + const stage_actor_data_class mineParams{ + .name = MA_MINE_NAME, + .base = + { + .parameters = 0, + .position = {pos.x, pos.y, pos.z}, + .angle = {0x2000, (s16)(pos.x*100000), 0}, // Adjusted and seemingly random angle + .setID = 0xFFFF, + }, + }; + if (svc_stage->add_actor( + mod_ctx, "F_SP108", 0, -1, &mineParams, sizeof(mineParams), nullptr) != MOD_OK) + { + mods::log::error("Adding mine to F_SP108 Failed!"); + return MOD_ERROR; + } + } + + mods::log::info("custom_actor_demo initialized"); + return MOD_OK; +} + +MOD_EXPORT ModResult mod_update(ModError*) { + return MOD_OK; +} + +MOD_EXPORT ModResult mod_shutdown(ModError*) { + mods::log::info("custom_actor_demo shutdown"); + return MOD_OK; +} +} diff --git a/mods/flow_demo/src/mod.cpp b/mods/flow_demo/src/mod.cpp index e4d18a90f0..a05150458b 100644 --- a/mods/flow_demo/src/mod.cpp +++ b/mods/flow_demo/src/mod.cpp @@ -177,18 +177,20 @@ MOD_EXPORT ModResult mod_initialize(ModError* outError) { if (result == MOD_OK) { result = add_message(mods::flow::MessageBuilder{kResponseStyle} .text_color(MESSAGE_COLOR_DEFAULT) - .text("Hello from ") - .text_color(MESSAGE_COLOR_RED) - .text("FlowService") + .text("Custom ") + .text_color(0xFF0000FF) + .text("colors") + .text_color(MESSAGE_COLOR_DEFAULT) + .text(" and even ") + .text_color(0x00FF00FF, 0x00FFFFFF) + .text("gradients") .text_color(MESSAGE_COLOR_DEFAULT) - .text(", ") - .player_name() .text("!\n") .character_delay(3) .text("This text is slow. ") .character_delay(0) .pause(12) - .text_scale(125) + .text_scale(150) .text("Big") .text_scale(100) .text(" text too.") diff --git a/mods/luau_runtime/CMakeLists.txt b/mods/luau_runtime/CMakeLists.txt new file mode 100644 index 0000000000..fa38b64b8a --- /dev/null +++ b/mods/luau_runtime/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.25) +project(luau_runtime 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 () + +include(FetchContent) + +set(LUAU_BUILD_CLI OFF CACHE BOOL "" FORCE) +set(LUAU_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(LUAU_BUILD_WEB OFF CACHE BOOL "" FORCE) +set(LUAU_WERROR OFF CACHE BOOL "" FORCE) +FetchContent_Declare(luau + URL https://github.com/luau-lang/luau/archive/refs/tags/0.734.tar.gz + URL_HASH SHA256=cb55a891226d8c70284e22eb9281cc2b4496c709a4050f52aaa18a355fe7b1a3 + DOWNLOAD_EXTRACT_TIMESTAMP FALSE + EXCLUDE_FROM_ALL +) +FetchContent_MakeAvailable(luau) + +add_mod(luau_runtime + SOURCES + src/bindings.cpp + src/config.cpp + src/runtime.cpp + src/ui.cpp + MOD_JSON mod.json + RES_DIR res + BUNDLE +) + +target_link_libraries(luau_runtime PRIVATE Luau.VM Luau.Compiler) diff --git a/mods/luau_runtime/mod.json b/mods/luau_runtime/mod.json new file mode 100644 index 0000000000..788a57f554 --- /dev/null +++ b/mods/luau_runtime/mod.json @@ -0,0 +1,7 @@ +{ + "id": "dev.twilitrealm.luau", + "name": "Luau Support", + "version": "1.0.0", + "author": "Twilit Realm", + "description": "Luau script runtime for mods" +} diff --git a/mods/luau_runtime/res/licenses/LUAU-MIT.txt b/mods/luau_runtime/res/licenses/LUAU-MIT.txt new file mode 100644 index 0000000000..2f2aa17066 --- /dev/null +++ b/mods/luau_runtime/res/licenses/LUAU-MIT.txt @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019-2025 Roblox Corporation +Copyright (c) 1994-2019 Lua.org, PUC-Rio. + +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/luau_runtime/src/bindings.cpp b/mods/luau_runtime/src/bindings.cpp new file mode 100644 index 0000000000..27f4218a83 --- /dev/null +++ b/mods/luau_runtime/src/bindings.cpp @@ -0,0 +1,340 @@ +#include "runtime.hpp" + +#include +#include +#include + +namespace luau_runtime { +namespace { + +constexpr char kOverlayMetatable[] = "dusklight.overlay_handle"; +constexpr char kTextureMetatable[] = "dusklight.texture_handle"; + +uint64_t get_hash_field(lua_State* state, int table, const char* field, bool required) { + lua_getfield(state, table, field); + if (lua_isnil(state, -1)) { + lua_pop(state, 1); + if (required) { + luaL_error(state, "field '%s' is required", field); + } + return 0; + } + if (!lua_isinteger64(state, -1)) { + luaL_error(state, "field '%s' must be an integer", field); + } + const uint64_t value = static_cast(lua_tointeger64(state, -1, nullptr)); + lua_pop(state, 1); + return value; +} + +int log_write(lua_State* state, LogLevel level, int messageIndex) { + Vm& vm = vm_from_upvalue(state); + if (svc_log == nullptr) { + service_unavailable(state, "LogService"); + } + size_t length = 0; + const char* message = luaL_checklstring(state, messageIndex, &length); + const std::string copy{message, length}; + svc_log->write(vm.subject, level, copy.c_str()); + return 0; +} + +int log_trace(lua_State* state) { + return log_write(state, LOG_LEVEL_TRACE, 1); +} + +int log_debug(lua_State* state) { + return log_write(state, LOG_LEVEL_DEBUG, 1); +} + +int log_info(lua_State* state) { + return log_write(state, LOG_LEVEL_INFO, 1); +} + +int log_warn(lua_State* state) { + return log_write(state, LOG_LEVEL_WARN, 1); +} + +int log_error(lua_State* state) { + return log_write(state, LOG_LEVEL_ERROR, 1); +} + +int log_write_level(lua_State* state) { + static constexpr const char* kLevels[] = {"trace", "debug", "info", "warn", "error", nullptr}; + const int level = luaL_checkoption(state, 1, nullptr, kLevels); + return log_write(state, static_cast(level), 2); +} + +int host_mod_id(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr) { + service_unavailable(state, "HostService"); + } + lua_pushstring(state, svc_host->mod_id(vm.subject)); + return 1; +} + +int host_mod_name(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr) { + service_unavailable(state, "HostService"); + } + lua_pushstring(state, svc_host->mod_name(vm.subject)); + return 1; +} + +int host_mod_version(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr) { + service_unavailable(state, "HostService"); + } + lua_pushstring(state, svc_host->mod_version(vm.subject)); + return 1; +} + +int host_mod_dir(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr) { + service_unavailable(state, "HostService"); + } + lua_pushstring(state, svc_host->mod_dir(vm.subject)); + return 1; +} + +int host_data_dir(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr || !SERVICE_HAS(svc_host, HostService, data_dir) || + svc_host->data_dir == nullptr) + { + service_unavailable(state, "HostService::data_dir"); + } + const char* path = nullptr; + check_result(state, svc_host->data_dir(vm.subject, &path), "host.data_dir"); + lua_pushstring(state, path != nullptr ? path : ""); + return 1; +} + +int host_fail(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr) { + service_unavailable(state, "HostService"); + } + const char* message = luaL_checkstring(state, 1); + svc_host->fail(vm.subject, MOD_ERROR, message); + luaL_error(state, "%s", message); +} + +int register_host_callback(lua_State* state, std::vector& callbacks) { + luaL_checktype(state, 1, LUA_TFUNCTION); + lua_pushvalue(state, 1); + callbacks.push_back(lua_ref(state, -1)); + lua_pop(state, 1); + return 0; +} + +int host_on_update(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + return register_host_callback(state, vm.updateRefs); +} + +int host_on_shutdown(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + return register_host_callback(state, vm.shutdownRefs); +} + +int resource_load(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_resource == nullptr) { + service_unavailable(state, "ResourceService"); + } + const char* path = luaL_checkstring(state, 1); + ResourceBuffer buffer = RESOURCE_BUFFER_INIT; + check_result(state, svc_resource->load(vm.subject, path, &buffer), "resource.load"); + const auto* data = buffer.data != nullptr ? static_cast(buffer.data) : ""; + const std::string copy{data, buffer.size}; + svc_resource->free(vm.subject, &buffer); + lua_pushlstring(state, copy.data(), copy.size()); + return 1; +} + +int overlay_remove(lua_State* state) { + auto& handle = check_handle(state, 1, kOverlayMetatable, HandleKind::Overlay); + if (svc_overlay == nullptr) { + service_unavailable(state, "OverlayService"); + } + check_result(state, svc_overlay->remove(handle.vm->subject, handle.value), "overlay.remove"); + handle.value = 0; + return 0; +} + +int overlay_add_file(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_overlay == nullptr) { + service_unavailable(state, "OverlayService"); + } + const char* discPath = luaL_checkstring(state, 1); + const char* bundlePath = luaL_checkstring(state, 2); + OverlayHandle handle = 0; + check_result(state, svc_overlay->add_file(vm.subject, discPath, bundlePath, &handle), + "overlay.add_file"); + push_handle(state, vm, handle, HandleKind::Overlay, kOverlayMetatable); + return 1; +} + +int overlay_add_buffer(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_overlay == nullptr) { + service_unavailable(state, "OverlayService"); + } + const char* discPath = luaL_checkstring(state, 1); + size_t size = 0; + const char* data = luaL_checklstring(state, 2, &size); + OverlayHandle handle = 0; + check_result(state, svc_overlay->add_buffer(vm.subject, discPath, data, size, &handle), + "overlay.add_buffer"); + push_handle(state, vm, handle, HandleKind::Overlay, kOverlayMetatable); + return 1; +} + +int texture_unregister(lua_State* state) { + auto& handle = check_handle(state, 1, kTextureMetatable, HandleKind::Texture); + if (svc_texture == nullptr) { + service_unavailable(state, "TextureService"); + } + check_result( + state, svc_texture->unregister(handle.vm->subject, handle.value), "texture.unregister"); + handle.value = 0; + return 0; +} + +int texture_register_file(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_texture == nullptr) { + service_unavailable(state, "TextureService"); + } + const char* path = luaL_checkstring(state, 1); + TextureReplacementHandle handle = 0; + check_result( + state, svc_texture->register_file(vm.subject, path, &handle), "texture.register_file"); + push_handle(state, vm, handle, HandleKind::Texture, kTextureMetatable); + return 1; +} + +int texture_register_data(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_texture == nullptr) { + service_unavailable(state, "TextureService"); + } + luaL_checktype(state, 1, LUA_TTABLE); + luaL_checktype(state, 2, LUA_TTABLE); + + TextureKey key = TEXTURE_KEY_INIT; + key.kind = TEXTURE_KEY_SOURCE; + key.texture_hash = get_hash_field(state, 1, "texture_hash", true); + key.tlut_hash = get_hash_field(state, 1, "tlut_hash", false); + key.width = static_cast(get_optional_int(state, 1, "width", 0)); + key.height = static_cast(get_optional_int(state, 1, "height", 0)); + key.gx_format = static_cast(get_optional_int(state, 1, "gx_format", 0)); + key.has_tlut = get_optional_bool(state, 1, "has_tlut", false); + + lua_getfield(state, 2, "data"); + size_t size = 0; + const char* bytes = luaL_checklstring(state, -1, &size); + TextureData data = TEXTURE_DATA_INIT; + data.data = bytes; + data.size = size; + data.width = static_cast(get_optional_int(state, 2, "width", key.width)); + data.height = static_cast(get_optional_int(state, 2, "height", key.height)); + data.mip_count = static_cast(get_optional_int(state, 2, "mip_count", 1)); + data.gx_format = static_cast(get_optional_int(state, 2, "gx_format", key.gx_format)); + + TextureReplacementHandle handle = 0; + const ModResult result = svc_texture->register_data(vm.subject, &key, &data, &handle); + lua_pop(state, 1); + check_result(state, result, "texture.register_data"); + push_handle(state, vm, handle, HandleKind::Texture, kTextureMetatable); + return 1; +} + +} // namespace + +int open_log(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_log == nullptr) { + service_unavailable(state, "LogService"); + } + lua_newtable(state); + set_function(state, vm, "write", log_write_level); + set_function(state, vm, "trace", log_trace); + set_function(state, vm, "debug", log_debug); + set_function(state, vm, "info", log_info); + set_function(state, vm, "warn", log_warn); + set_function(state, vm, "error", log_error); + lua_setreadonly(state, -1, true); + return 1; +} + +int open_host(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_host == nullptr) { + service_unavailable(state, "HostService"); + } + lua_newtable(state); + lua_pushstring(state, svc_host->version != nullptr ? svc_host->version : ""); + lua_setfield(state, -2, "version"); + set_function(state, vm, "mod_id", host_mod_id); + set_function(state, vm, "mod_name", host_mod_name); + set_function(state, vm, "mod_version", host_mod_version); + set_function(state, vm, "mod_dir", host_mod_dir); + set_function(state, vm, "data_dir", host_data_dir); + set_function(state, vm, "on_update", host_on_update); + set_function(state, vm, "on_shutdown", host_on_shutdown); + set_function(state, vm, "fail", host_fail); + lua_setreadonly(state, -1, true); + return 1; +} + +int open_resource(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_resource == nullptr) { + service_unavailable(state, "ResourceService"); + } + lua_newtable(state); + set_function(state, vm, "load", resource_load); + lua_setreadonly(state, -1, true); + return 1; +} + +int open_overlay(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_overlay == nullptr) { + service_unavailable(state, "OverlayService"); + } + static const luaL_Reg kMethods[] = {{"remove", overlay_remove}, {nullptr, nullptr}}; + create_handle_metatable(state, kOverlayMetatable, kMethods, "OverlayHandle"); + lua_newtable(state); + set_function(state, vm, "add_file", overlay_add_file); + set_function(state, vm, "add_buffer", overlay_add_buffer); + lua_setreadonly(state, -1, true); + return 1; +} + +int open_texture(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_texture == nullptr) { + service_unavailable(state, "TextureService"); + } + static const luaL_Reg kMethods[] = {{"unregister", texture_unregister}, {nullptr, nullptr}}; + create_handle_metatable(state, kTextureMetatable, kMethods, "TextureHandle"); + lua_newtable(state); + set_function(state, vm, "register_file", texture_register_file); + set_function(state, vm, "register_data", texture_register_data); + lua_pushinteger64(state, static_cast(TEXTURE_HASH_WILDCARD)); + lua_setfield(state, -2, "hash_wildcard"); + lua_pushinteger64(state, static_cast(TEXTURE_TLUT_WILDCARD)); + lua_setfield(state, -2, "tlut_wildcard"); + lua_setreadonly(state, -1, true); + return 1; +} + +} // namespace luau_runtime diff --git a/mods/luau_runtime/src/config.cpp b/mods/luau_runtime/src/config.cpp new file mode 100644 index 0000000000..b198bdb6e7 --- /dev/null +++ b/mods/luau_runtime/src/config.cpp @@ -0,0 +1,243 @@ +#include "runtime.hpp" + +#include +#include + +namespace luau_runtime { +namespace { + +constexpr char kConfigVarMetatable[] = "dusklight.config_var"; +constexpr char kConfigSubscriptionMetatable[] = "dusklight.config_subscription"; + +void config_changed(ModContext*, ConfigVarHandle, const ConfigVarValue* value, + const ConfigVarValue* previous, void* userData) { + auto& callback = *static_cast(userData); + if (value == nullptr || previous == nullptr) { + return; + } + push_config_value(callback.vm->state, *value); + push_config_value(callback.vm->state, *previous); + std::string error; + if (!call_ref(*callback.vm, callback.refs[0], 2, 0, kCallbackBudget, error)) { + fail_callback(*callback.vm, "config change callback", error); + } +} + +int config_get(lua_State* state) { + auto& handle = check_handle(state, 1, kConfigVarMetatable, HandleKind::ConfigVar); + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + switch (handle.configType) { + case CONFIG_VAR_BOOL: { + bool value = false; + check_result( + state, svc_config->get_bool(handle.vm->subject, handle.value, &value), "config get"); + lua_pushboolean(state, value); + break; + } + case CONFIG_VAR_INT: { + int64_t value = 0; + check_result( + state, svc_config->get_int(handle.vm->subject, handle.value, &value), "config get"); + lua_pushinteger64(state, value); + break; + } + case CONFIG_VAR_FLOAT: { + double value = 0; + check_result( + state, svc_config->get_float(handle.vm->subject, handle.value, &value), "config get"); + lua_pushnumber(state, value); + break; + } + case CONFIG_VAR_STRING: { + size_t size = 0; + check_result(state, + svc_config->get_string(handle.vm->subject, handle.value, nullptr, 0, &size), + "config get"); + std::vector value(size + 1); + check_result(state, + svc_config->get_string( + handle.vm->subject, handle.value, value.data(), value.size(), nullptr), + "config get"); + lua_pushlstring(state, value.data(), size); + break; + } + default: + luaL_error(state, "unknown config value type"); + } + return 1; +} + +int config_set(lua_State* state) { + auto& handle = check_handle(state, 1, kConfigVarMetatable, HandleKind::ConfigVar); + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + ModResult result = MOD_INVALID_ARGUMENT; + switch (handle.configType) { + case CONFIG_VAR_BOOL: + result = svc_config->set_bool( + handle.vm->subject, handle.value, luaL_checkboolean(state, 2) != 0); + break; + case CONFIG_VAR_INT: + result = svc_config->set_int(handle.vm->subject, handle.value, check_int64(state, 2)); + break; + case CONFIG_VAR_FLOAT: + result = + svc_config->set_float(handle.vm->subject, handle.value, luaL_checknumber(state, 2)); + break; + case CONFIG_VAR_STRING: + result = + svc_config->set_string(handle.vm->subject, handle.value, luaL_checkstring(state, 2)); + break; + default: + break; + } + check_result(state, result, "config set"); + return 0; +} + +int config_unregister(lua_State* state) { + auto& handle = check_handle(state, 1, kConfigVarMetatable, HandleKind::ConfigVar); + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + check_result( + state, svc_config->unregister_var(handle.vm->subject, handle.value), "config unregister"); + handle.value = 0; + return 0; +} + +int config_unsubscribe(lua_State* state) { + auto& handle = + check_handle(state, 1, kConfigSubscriptionMetatable, HandleKind::ConfigSubscription); + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + check_result( + state, svc_config->unsubscribe(handle.vm->subject, handle.value), "config unsubscribe"); + handle.value = 0; + return 0; +} + +int subscribe(lua_State* state, ScriptHandle& variable, int functionIndex) { + luaL_checktype(state, functionIndex, LUA_TFUNCTION); + Callback& callback = retain_callback(*variable.vm); + callback.refs[0] = lua_ref(state, functionIndex); + + ConfigSubscriptionHandle subscription = 0; + check_result(state, + svc_config->subscribe( + variable.vm->subject, variable.value, config_changed, &callback, &subscription), + "config.subscribe"); + push_handle(state, *variable.vm, subscription, HandleKind::ConfigSubscription, + kConfigSubscriptionMetatable); + return 1; +} + +int config_subscribe(lua_State* state) { + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + auto& variable = check_handle(state, 1, kConfigVarMetatable, HandleKind::ConfigVar); + return subscribe(state, variable, 2); +} + +int config_var_subscribe(lua_State* state) { + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + auto& variable = check_handle(state, 1, kConfigVarMetatable, HandleKind::ConfigVar); + return subscribe(state, variable, 2); +} + +int config_register(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + luaL_checktype(state, 1, LUA_TTABLE); + + const std::string name = get_optional_string(state, 1, "name"); + const std::string type = get_optional_string(state, 1, "type"); + ConfigVarDesc desc = CONFIG_VAR_DESC_INIT; + desc.name = name.c_str(); + if (type == "bool") { + desc.type = CONFIG_VAR_BOOL; + desc.default_bool = get_optional_bool(state, 1, "default", false); + } else if (type == "int") { + desc.type = CONFIG_VAR_INT; + desc.default_int = get_optional_int(state, 1, "default", 0); + } else if (type == "float") { + desc.type = CONFIG_VAR_FLOAT; + desc.default_float = get_optional_number(state, 1, "default", 0); + } else if (type == "string") { + desc.type = CONFIG_VAR_STRING; + } else { + luaL_error(state, "config type must be 'bool', 'int', 'float', or 'string'"); + } + + std::string defaultString; + if (desc.type == CONFIG_VAR_STRING) { + defaultString = get_optional_string(state, 1, "default"); + desc.default_string = defaultString.c_str(); + } + + ConfigVarHandle handle = 0; + check_result(state, svc_config->register_var(vm.subject, &desc, &handle), "config.register"); + push_handle(state, vm, handle, HandleKind::ConfigVar, kConfigVarMetatable, desc.type); + return 1; +} + +} // namespace + +void push_config_value(lua_State* state, const ConfigVarValue& value) { + switch (value.type) { + case CONFIG_VAR_BOOL: + lua_pushboolean(state, value.bool_value); + break; + case CONFIG_VAR_INT: + lua_pushinteger64(state, value.int_value); + break; + case CONFIG_VAR_FLOAT: + lua_pushnumber(state, value.float_value); + break; + case CONFIG_VAR_STRING: + lua_pushlstring(state, value.string_value != nullptr ? value.string_value : "", + value.string_value != nullptr ? value.string_length : 0); + break; + default: + lua_pushnil(state); + break; + } +} + +int open_config(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_config == nullptr) { + service_unavailable(state, "ConfigService"); + } + static const luaL_Reg kVarMethods[] = { + {"get", config_get}, + {"set", config_set}, + {"subscribe", config_var_subscribe}, + {"unregister", config_unregister}, + {nullptr, nullptr}, + }; + static const luaL_Reg kSubscriptionMethods[] = { + {"unsubscribe", config_unsubscribe}, + {nullptr, nullptr}, + }; + create_handle_metatable(state, kConfigVarMetatable, kVarMethods, "ConfigVar"); + create_handle_metatable( + state, kConfigSubscriptionMetatable, kSubscriptionMethods, "ConfigSubscription"); + + lua_newtable(state); + set_function(state, vm, "register", config_register); + set_function(state, vm, "subscribe", config_subscribe); + lua_setreadonly(state, -1, true); + return 1; +} + +} // namespace luau_runtime diff --git a/mods/luau_runtime/src/runtime.cpp b/mods/luau_runtime/src/runtime.cpp new file mode 100644 index 0000000000..5dc1ce9fef --- /dev/null +++ b/mods/luau_runtime/src/runtime.cpp @@ -0,0 +1,611 @@ +#include "runtime.hpp" + +#include "Luau/Common.h" +#include "luacode.h" +#include "mods/runtime.h" +#include "mods/service.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +LUAU_FASTFLAG(LuauIntegerLibrary) +LUAU_FASTFLAG(LuauIntegerType2) + +DEFINE_MOD(); +IMPORT_OPTIONAL_SERVICE(LogService, svc_log); +IMPORT_OPTIONAL_SERVICE(HostService, svc_host); +IMPORT_OPTIONAL_SERVICE(ConfigService, svc_config); +IMPORT_OPTIONAL_SERVICE(ResourceService, svc_resource); +IMPORT_OPTIONAL_SERVICE(OverlayService, svc_overlay); +IMPORT_OPTIONAL_SERVICE(TextureService, svc_texture); +IMPORT_OPTIONAL_SERVICE(UiService, svc_ui); + +namespace luau_runtime { +namespace { + +std::unordered_map> s_vms; + +void* limited_realloc(void* userData, void* pointer, size_t oldSize, size_t newSize) { + auto& budget = *static_cast(userData); + if (newSize == 0) { + std::free(pointer); + budget.used -= std::min(budget.used, oldSize); + return nullptr; + } + + const size_t growth = newSize > oldSize ? newSize - oldSize : 0; + if (growth > budget.limit - std::min(budget.used, budget.limit)) { + return nullptr; + } + void* result = std::realloc(pointer, newSize); + if (result != nullptr) { + budget.used -= std::min(budget.used, oldSize); + budget.used += newSize; + } + return result; +} + +int traceback_handler(lua_State* state) { + const char* message = lua_tostring(state, 1); + luaL_traceback(state, state, message != nullptr ? message : "Luau error", 1); + return 1; +} + +class DeadlineScope { +public: + DeadlineScope(Vm& vm, std::chrono::steady_clock::duration budget) + : m_vm{vm}, m_previousDeadline{vm.deadline}, m_previousActive{vm.deadlineActive} { + const auto requested = std::chrono::steady_clock::now() + budget; + if (!vm.deadlineActive || requested < vm.deadline) { + vm.deadline = requested; + } + vm.deadlineActive = true; + ++vm.callDepth; + } + + ~DeadlineScope() { + --m_vm.callDepth; + m_vm.deadline = m_previousDeadline; + m_vm.deadlineActive = m_previousActive; + } + +private: + Vm& m_vm; + std::chrono::steady_clock::time_point m_previousDeadline; + bool m_previousActive; +}; + +bool protected_call(lua_State* state, Vm& vm, int argumentCount, int resultCount, + std::chrono::steady_clock::duration budget, std::string& outError) { + const int functionIndex = lua_gettop(state) - argumentCount; + lua_pushcfunction(state, traceback_handler, "dusklight traceback"); + lua_insert(state, functionIndex); + + DeadlineScope deadline{vm, budget}; + const int status = lua_pcall(state, argumentCount, resultCount, functionIndex); + if (status != LUA_OK) { + const char* message = lua_tostring(state, -1); + outError = message != nullptr ? message : "unknown Luau error"; + lua_pop(state, 1); + lua_remove(state, functionIndex); + return false; + } + lua_remove(state, functionIndex); + return true; +} + +std::optional normalize_module_path( + std::string_view currentPath, std::string_view requested) { + if ((!requested.starts_with("./") && !requested.starts_with("../")) || + requested.find('\\') != std::string_view::npos) + { + return std::nullopt; + } + + std::vector parts; + const auto parentEnd = currentPath.rfind('/'); + std::string combined; + if (parentEnd != std::string_view::npos) { + combined.assign(currentPath.substr(0, parentEnd + 1)); + } + combined.append(requested); + + size_t begin = 0; + while (begin <= combined.size()) { + const size_t end = combined.find('/', begin); + const auto part = std::string_view{combined}.substr( + begin, end == std::string::npos ? combined.size() - begin : end - begin); + if (part.empty() || part == ".") { + } else if (part == "..") { + if (parts.empty()) { + return std::nullopt; + } + parts.pop_back(); + } else { + parts.push_back(part); + } + if (end == std::string::npos) { + break; + } + begin = end + 1; + } + if (parts.empty()) { + return std::nullopt; + } + + std::string normalized; + for (const auto part : parts) { + if (!normalized.empty()) { + normalized.push_back('/'); + } + normalized.append(part); + } + if (!normalized.ends_with(".luau")) { + normalized += ".luau"; + } + return normalized; +} + +ModuleOpenFn module_factory(std::string_view name) { + if (name == "dusklight.log") { + return open_log; + } + if (name == "dusklight.host") { + return open_host; + } + if (name == "dusklight.resource") { + return open_resource; + } + if (name == "dusklight.overlay") { + return open_overlay; + } + if (name == "dusklight.texture") { + return open_texture; + } + if (name == "dusklight.config") { + return open_config; + } + if (name == "dusklight.ui") { + return open_ui; + } + return nullptr; +} + +int module_require(lua_State* state); + +void install_module_require(lua_State* state, Vm& vm, std::string_view currentPath) { + lua_pushlightuserdata(state, &vm); + lua_pushlstring(state, currentPath.data(), currentPath.size()); + lua_pushcclosure(state, module_require, "require", 2); + lua_setglobal(state, "require"); +} + +bool load_source_module( + lua_State* caller, Vm& vm, const std::string& path, bool keepResult, std::string& outError) { + if (svc_resource == nullptr) { + outError = "ResourceService is not available in this Dusklight build"; + return false; + } + + ResourceBuffer buffer = RESOURCE_BUFFER_INIT; + const ModResult loadResult = svc_resource->load(vm.subject, path.c_str(), &buffer); + if (loadResult != MOD_OK) { + outError = loadResult == MOD_UNAVAILABLE ? "module not found: res/" + path : + "failed to load module: res/" + path; + return false; + } + std::string source; + if (buffer.data != nullptr) { + source.assign(static_cast(buffer.data), buffer.size); + } + svc_resource->free(vm.subject, &buffer); + + size_t bytecodeSize = 0; + lua_CompileOptions options{}; + options.optimizationLevel = 1; + options.debugLevel = 1; + char* bytecode = luau_compile(source.data(), source.size(), &options, &bytecodeSize); + if (bytecode == nullptr) { + outError = "Luau compiler ran out of memory"; + return false; + } + + lua_State* moduleState = lua_newthread(caller); + if (moduleState == nullptr) { + std::free(bytecode); + outError = "Luau VM ran out of memory"; + return false; + } + luaL_sandboxthread(moduleState); + install_module_require(moduleState, vm, path); + + const std::string chunkName = "@res/" + path; + const int loadStatus = luau_load(moduleState, chunkName.c_str(), bytecode, bytecodeSize, 0); + std::free(bytecode); + if (loadStatus != LUA_OK) { + const char* message = lua_tostring(moduleState, -1); + outError = message != nullptr ? message : "failed to load Luau bytecode"; + lua_pop(caller, 1); + return false; + } + if (!protected_call(moduleState, vm, 0, keepResult ? 1 : 0, kLifecycleBudget, outError)) { + lua_pop(caller, 1); + return false; + } + if (!keepResult) { + lua_pop(caller, 1); + return true; + } + if (lua_isnil(moduleState, -1)) { + outError = "module res/" + path + " must return a value"; + lua_pop(caller, 1); + return false; + } + + lua_xmove(moduleState, caller, 1); + lua_remove(caller, -2); + return true; +} + +int module_require(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + const std::string requested = luaL_checkstring(state, 1); + + std::string moduleName; + ModuleOpenFn factory = nullptr; + if (requested.starts_with("dusklight.")) { + moduleName = requested; + factory = module_factory(moduleName); + if (factory == nullptr) { + luaL_error(state, "unknown module '%s'", moduleName.c_str()); + } + } else { + const char* currentPath = lua_tostring(state, lua_upvalueindex(2)); + const auto normalized = + normalize_module_path(currentPath != nullptr ? currentPath : "main.luau", requested); + if (!normalized.has_value()) { + luaL_error( + state, "module paths must be relative and remain inside the mod's res directory"); + } + moduleName = *normalized; + } + + if (const auto found = vm.moduleRefs.find(moduleName); found != vm.moduleRefs.end()) { + lua_getref(state, found->second); + return 1; + } + if (!vm.loadingModules.insert(moduleName).second) { + luaL_error(state, "cyclic require of '%s'", moduleName.c_str()); + } + + std::string error; + if (factory != nullptr) { + factory(state); + } else if (!load_source_module(state, vm, moduleName, true, error)) { + vm.loadingModules.erase(moduleName); + luaL_error(state, "%s", error.c_str()); + } + vm.loadingModules.erase(moduleName); + + const int ref = lua_ref(state, -1); + vm.moduleRefs.emplace(moduleName, ref); + return 1; +} + +ModResult runtime_activate(ModContext*, ModContext* subject, ModError* outError) { + if (subject == nullptr) { + return set_error(outError, MOD_INVALID_ARGUMENT, "Delegated mod context is null"); + } + if (s_vms.contains(subject)) { + return set_error(outError, MOD_CONFLICT, "Delegated mod is already active"); + } + + auto vm = std::make_unique(); + vm->subject = subject; + vm->state = lua_newstate(limited_realloc, &vm->memory); + if (vm->state == nullptr) { + return set_error(outError, MOD_ERROR, "Failed to create Luau VM"); + } + lua_callbacks(vm->state)->userdata = vm.get(); + lua_callbacks(vm->state)->interrupt = [](lua_State* state, int gc) { + auto* current = static_cast(lua_callbacks(state)->userdata); + if (gc < 0 && current != nullptr && current->deadlineActive && + std::chrono::steady_clock::now() > current->deadline) + { + luaL_error(state, "script execution exceeded its time budget"); + } + }; + luaL_openlibs(vm->state); + luaL_sandbox(vm->state); + + std::string error; + vm->loadingModules.insert("main.luau"); + const bool loadedMain = load_source_module(vm->state, *vm, "main.luau", false, error); + vm->loadingModules.erase("main.luau"); + if (!loadedMain) { + return set_error(outError, MOD_ERROR, error); + } + + s_vms.emplace(subject, std::move(vm)); + return MOD_OK; +} + +ModResult runtime_update(ModContext*, ModContext* subject, ModError* outError) { + const auto found = s_vms.find(subject); + if (found == s_vms.end()) { + return set_error(outError, MOD_INVALID_ARGUMENT, "Delegated mod is not active"); + } + Vm& vm = *found->second; + const size_t callbackCount = vm.updateRefs.size(); + if (callbackCount == 0) { + return MOD_OK; + } + + DeadlineScope deadline{vm, kUpdateBudget}; + std::string error; + for (size_t i = 0; i < callbackCount; ++i) { + const int ref = vm.updateRefs[i]; + if (!call_ref(vm, ref, 0, 0, kUpdateBudget, error)) { + return set_error(outError, MOD_ERROR, error); + } + } + return MOD_OK; +} + +ModResult runtime_deactivate(ModContext*, ModContext* subject, ModError*) { + const auto found = s_vms.find(subject); + if (found == s_vms.end()) { + return MOD_OK; + } + + Vm& vm = *found->second; + DeadlineScope deadline{vm, kLifecycleBudget}; + const size_t callbackCount = vm.shutdownRefs.size(); + for (size_t i = callbackCount; i > 0; --i) { + std::string error; + const int ref = vm.shutdownRefs[i - 1]; + if (!call_ref(vm, ref, 0, 0, kLifecycleBudget, error) && svc_log != nullptr) { + svc_log->write(subject, LOG_LEVEL_ERROR, error.c_str()); + } + } + s_vms.erase(found); + return MOD_OK; +} + +constexpr ModRuntimeService s_runtimeService{ + .header = SERVICE_HEADER(ModRuntimeService, 1, 0), + .activate = runtime_activate, + .update = runtime_update, + .deactivate = runtime_deactivate, +}; +EXPORT_SERVICE_AS(s_runtimeService, "dev.twilitrealm.luau"); + +} // namespace + +Vm::~Vm() { + if (state != nullptr) { + lua_close(state); + } +} + +Vm& vm_from_upvalue(lua_State* state) { + auto* vm = static_cast(lua_tolightuserdata(state, lua_upvalueindex(1))); + if (vm == nullptr) { + luaL_error(state, "missing Luau runtime context"); + } + return *vm; +} + +void push_vm_closure(lua_State* state, Vm& vm, lua_CFunction function, const char* name) { + lua_pushlightuserdata(state, &vm); + lua_pushcclosure(state, function, name, 1); +} + +void set_function(lua_State* state, Vm& vm, const char* name, lua_CFunction function) { + push_vm_closure(state, vm, function, name); + lua_setfield(state, -2, name); +} + +[[noreturn]] void service_unavailable(lua_State* state, const char* name) { + luaL_error(state, "%s is not available in this Dusklight build", name); +} + +void check_result(lua_State* state, ModResult result, const char* operation) { + if (result == MOD_OK) { + return; + } + const char* resultName = "error"; + switch (result) { + case MOD_UNAVAILABLE: + resultName = "unavailable"; + break; + case MOD_UNSUPPORTED: + resultName = "unsupported"; + break; + case MOD_CONFLICT: + resultName = "conflict"; + break; + case MOD_INVALID_ARGUMENT: + resultName = "invalid argument"; + break; + default: + break; + } + luaL_error(state, "%s failed: %s", operation, resultName); +} + +bool get_optional_bool(lua_State* state, int table, const char* field, bool fallback) { + lua_getfield(state, table, field); + const bool value = lua_isnil(state, -1) ? fallback : luaL_checkboolean(state, -1) != 0; + lua_pop(state, 1); + return value; +} + +bool to_int64(lua_State* state, int index, int64_t& outValue) { + if (lua_isinteger64(state, index)) { + outValue = lua_tointeger64(state, index, nullptr); + return true; + } + if (!lua_isnumber(state, index)) { + return false; + } + const double value = lua_tonumber(state, index); + constexpr double kMaxSafeInteger = 9007199254740991.0; + if (!std::isfinite(value) || value < -kMaxSafeInteger || value > kMaxSafeInteger || + std::trunc(value) != value) + { + return false; + } + outValue = static_cast(value); + return true; +} + +int64_t check_int64(lua_State* state, int index) { + int64_t value = 0; + if (!to_int64(state, index, value)) { + luaL_argerror(state, index, "integer value expected"); + } + return value; +} + +int64_t get_optional_int(lua_State* state, int table, const char* field, int64_t fallback) { + lua_getfield(state, table, field); + const int64_t value = lua_isnil(state, -1) ? fallback : check_int64(state, -1); + lua_pop(state, 1); + return value; +} + +double get_optional_number(lua_State* state, int table, const char* field, double fallback) { + lua_getfield(state, table, field); + const double value = lua_isnil(state, -1) ? fallback : luaL_checknumber(state, -1); + lua_pop(state, 1); + return value; +} + +std::string get_optional_string( + lua_State* state, int table, const char* field, std::string fallback) { + lua_getfield(state, table, field); + if (!lua_isnil(state, -1)) { + size_t length = 0; + const char* value = luaL_checklstring(state, -1, &length); + fallback.assign(value, length); + } + lua_pop(state, 1); + return fallback; +} + +int ref_optional_function(lua_State* state, int table, const char* field) { + lua_getfield(state, table, field); + if (lua_isnil(state, -1)) { + lua_pop(state, 1); + return LUA_NOREF; + } + luaL_argexpected(state, lua_isfunction(state, -1), table, "function field"); + const int ref = lua_ref(state, -1); + lua_pop(state, 1); + return ref; +} + +int ref_required_function(lua_State* state, int table, const char* field) { + const int ref = ref_optional_function(state, table, field); + if (ref == LUA_NOREF) { + luaL_error(state, "field '%s' is required", field); + } + return ref; +} + +Callback& retain_callback(Vm& vm) { + auto callback = std::make_unique(); + callback->vm = &vm; + callback->refs.fill(LUA_NOREF); + vm.callbacks.push_back(std::move(callback)); + return *vm.callbacks.back(); +} + +bool call_ref(Vm& vm, int ref, int argumentCount, int resultCount, + std::chrono::steady_clock::duration budget, std::string& outError) { + lua_State* state = vm.state; + lua_getref(state, ref); + if (!lua_isfunction(state, -1)) { + lua_pop(state, 1); + outError = "callback is no longer a function"; + return false; + } + if (argumentCount != 0) { + lua_insert(state, -argumentCount - 1); + } + return protected_call(state, vm, argumentCount, resultCount, budget, outError); +} + +void fail_callback(Vm& vm, std::string_view callbackName, std::string_view error) { + const std::string message = std::string{callbackName} + ": " + std::string{error}; + if (svc_host != nullptr) { + svc_host->fail(vm.subject, MOD_ERROR, message.c_str()); + } else if (svc_log != nullptr) { + svc_log->write(vm.subject, LOG_LEVEL_ERROR, message.c_str()); + } +} + +ModResult set_error(ModError* outError, ModResult result, std::string_view message) { + if (outError != nullptr && outError->struct_size >= sizeof(ModError)) { + outError->code = result; + const size_t size = std::min(message.size(), sizeof(outError->message) - 1); + std::memcpy(outError->message, message.data(), size); + outError->message[size] = '\0'; + } + return result; +} + +void create_handle_metatable( + lua_State* state, const char* name, const luaL_Reg* methods, const char* typeName) { + luaL_newmetatable(state, name); + luaL_register(state, nullptr, methods); + lua_pushvalue(state, -1); + lua_setfield(state, -2, "__index"); + lua_pushstring(state, typeName); + lua_setfield(state, -2, "__type"); + lua_setreadonly(state, -1, true); + lua_pop(state, 1); +} + +ScriptHandle& check_handle(lua_State* state, int index, const char* metatable, HandleKind kind) { + auto* handle = static_cast(luaL_checkudata(state, index, metatable)); + if (handle == nullptr || handle->kind != kind || handle->vm == nullptr || handle->value == 0) { + luaL_argerror(state, index, "stale handle"); + } + return *handle; +} + +void push_handle(lua_State* state, Vm& vm, uint64_t value, HandleKind kind, const char* metatable, + ConfigVarType configType) { + auto* handle = static_cast(lua_newuserdata(state, sizeof(ScriptHandle))); + *handle = ScriptHandle{.vm = &vm, .value = value, .kind = kind, .configType = configType}; + luaL_getmetatable(state, metatable); + lua_setmetatable(state, -2); +} + +} // namespace luau_runtime + +extern "C" { +MOD_EXPORT ModResult mod_initialize(ModError*) { + FFlag::LuauIntegerType2.value = true; + FFlag::LuauIntegerLibrary.value = true; + return MOD_OK; +} + +MOD_EXPORT ModResult mod_update(ModError*) { + return MOD_OK; +} + +MOD_EXPORT ModResult mod_shutdown(ModError*) { + luau_runtime::s_vms.clear(); + return MOD_OK; +} +} diff --git a/mods/luau_runtime/src/runtime.hpp b/mods/luau_runtime/src/runtime.hpp new file mode 100644 index 0000000000..2916a817e5 --- /dev/null +++ b/mods/luau_runtime/src/runtime.hpp @@ -0,0 +1,124 @@ +#pragma once + +#include "lua.h" +#include "lualib.h" + +#include "mods/api.h" +#include "mods/svc/config.h" +#include "mods/svc/host.h" +#include "mods/svc/log.h" +#include "mods/svc/overlay.h" +#include "mods/svc/resource.h" +#include "mods/svc/texture.h" +#include "mods/svc/ui.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace luau_runtime { + +constexpr size_t kMemoryLimit = 64u * 1024u * 1024u; +constexpr auto kUpdateBudget = std::chrono::milliseconds{250}; +constexpr auto kLifecycleBudget = std::chrono::seconds{5}; +constexpr auto kCallbackBudget = std::chrono::milliseconds{250}; + +struct MemoryBudget { + size_t used = 0; + size_t limit = kMemoryLimit; +}; + +struct Vm; + +struct Callback { + Vm* vm = nullptr; + std::array refs{}; + std::string returnedString; + int tag = 0; +}; + +struct Vm { + MemoryBudget memory; + lua_State* state = nullptr; + ModContext* subject = nullptr; + std::vector updateRefs; + std::vector shutdownRefs; + std::unordered_map moduleRefs; + std::unordered_set loadingModules; + std::vector> callbacks; + std::chrono::steady_clock::time_point deadline{}; + unsigned callDepth = 0; + bool deadlineActive = false; + + ~Vm(); +}; + +enum class HandleKind : uint8_t { + ConfigVar, + ConfigSubscription, + Overlay, + Texture, + UiWindow, + UiDialog, + UiElement, + UiStyle, + UiMenuTab, + UiList, +}; + +struct ScriptHandle { + Vm* vm = nullptr; + uint64_t value = 0; + HandleKind kind = HandleKind::ConfigVar; + ConfigVarType configType = CONFIG_VAR_BOOL; +}; + +using ModuleOpenFn = int (*)(lua_State* state); + +Vm& vm_from_upvalue(lua_State* state); +void push_vm_closure(lua_State* state, Vm& vm, lua_CFunction function, const char* name); +void set_function(lua_State* state, Vm& vm, const char* name, lua_CFunction function); + +[[noreturn]] void service_unavailable(lua_State* state, const char* name); +void check_result(lua_State* state, ModResult result, const char* operation); + +bool get_optional_bool(lua_State* state, int table, const char* field, bool fallback); +bool to_int64(lua_State* state, int index, int64_t& outValue); +int64_t check_int64(lua_State* state, int index); +int64_t get_optional_int(lua_State* state, int table, const char* field, int64_t fallback); +double get_optional_number(lua_State* state, int table, const char* field, double fallback); +std::string get_optional_string( + lua_State* state, int table, const char* field, std::string fallback = {}); +int ref_optional_function(lua_State* state, int table, const char* field); +int ref_required_function(lua_State* state, int table, const char* field); + +Callback& retain_callback(Vm& vm); +bool call_ref(Vm& vm, int ref, int argumentCount, int resultCount, + std::chrono::steady_clock::duration budget, std::string& outError); +void fail_callback(Vm& vm, std::string_view callbackName, std::string_view error); +ModResult set_error(ModError* outError, ModResult result, std::string_view message); + +void create_handle_metatable( + lua_State* state, const char* name, const luaL_Reg* methods, const char* typeName); +ScriptHandle& check_handle(lua_State* state, int index, const char* metatable, HandleKind kind); +void push_handle(lua_State* state, Vm& vm, uint64_t value, HandleKind kind, const char* metatable, + ConfigVarType configType = CONFIG_VAR_BOOL); + +void push_config_value(lua_State* state, const ConfigVarValue& value); +void push_ui_handle(lua_State* state, Vm& vm, uint64_t value, HandleKind kind); + +int open_log(lua_State* state); +int open_host(lua_State* state); +int open_resource(lua_State* state); +int open_overlay(lua_State* state); +int open_texture(lua_State* state); +int open_config(lua_State* state); +int open_ui(lua_State* state); + +} // namespace luau_runtime diff --git a/mods/luau_runtime/src/ui.cpp b/mods/luau_runtime/src/ui.cpp new file mode 100644 index 0000000000..7c3acc1296 --- /dev/null +++ b/mods/luau_runtime/src/ui.cpp @@ -0,0 +1,856 @@ +#include "runtime.hpp" + +#include +#include +#include +#include + +namespace luau_runtime { +namespace { + +constexpr char kUiWindowMetatable[] = "dusklight.ui_window"; +constexpr char kUiDialogMetatable[] = "dusklight.ui_dialog"; +constexpr char kUiElementMetatable[] = "dusklight.ui_element"; +constexpr char kUiStyleMetatable[] = "dusklight.ui_style"; +constexpr char kUiMenuTabMetatable[] = "dusklight.ui_menu_tab"; +constexpr char kUiListMetatable[] = "dusklight.ui_list"; + +const char* ui_metatable(HandleKind kind) { + switch (kind) { + case HandleKind::UiWindow: + return kUiWindowMetatable; + case HandleKind::UiDialog: + return kUiDialogMetatable; + case HandleKind::UiStyle: + return kUiStyleMetatable; + case HandleKind::UiMenuTab: + return kUiMenuTabMetatable; + case HandleKind::UiList: + return kUiListMetatable; + default: + return kUiElementMetatable; + } +} + +ScriptHandle& check_ui_handle(lua_State* state, int index, HandleKind kind) { + return check_handle(state, index, ui_metatable(kind), kind); +} + +ScriptHandle& check_config_var(lua_State* state, int index) { + luaL_checktype(state, index, LUA_TUSERDATA); + auto* handle = static_cast(lua_touserdata(state, index)); + if (handle == nullptr || handle->kind != HandleKind::ConfigVar || handle->value == 0 || + handle->vm == nullptr) + { + luaL_argerror(state, index, "expected a live ConfigVar"); + } + return *handle; +} + +bool call_callback(Callback& callback, int ref, int argumentCount, int resultCount, + const char* name, std::string* outError = nullptr) { + std::string error; + if (call_ref(*callback.vm, ref, argumentCount, resultCount, kCallbackBudget, error)) { + return true; + } + if (outError != nullptr) { + *outError = std::move(error); + } else { + fail_callback(*callback.vm, name, error); + } + return false; +} + +ModResult call_build( + Callback& callback, int ref, int argumentCount, const char* name, ModError* outError) { + std::string error; + if (call_callback(callback, ref, argumentCount, 0, name, &error)) { + return MOD_OK; + } + return set_error(outError, MOD_ERROR, error); +} + +bool call_predicate(Callback& callback, int ref, int argumentCount, const char* name) { + if (!call_callback(callback, ref, argumentCount, 1, name)) { + return false; + } + lua_State* state = callback.vm->state; + const bool result = lua_toboolean(state, -1) != 0; + lua_pop(state, 1); + return result; +} + +void control_get(ModContext*, void* userData, UiControlValue* outValue) { + auto& callback = *static_cast(userData); + if (outValue == nullptr || !call_callback(callback, callback.refs[0], 0, 1, "control get")) { + return; + } + lua_State* state = callback.vm->state; + switch (static_cast(callback.tag)) { + case UI_CONTROL_TOGGLE: + outValue->bool_value = lua_toboolean(state, -1) != 0; + break; + case UI_CONTROL_NUMBER: + case UI_CONTROL_SELECT: { + int64_t value = 0; + if (!to_int64(state, -1, value)) { + fail_callback(*callback.vm, "control get", "callback must return an integer"); + } else { + outValue->int_value = value; + } + break; + } + case UI_CONTROL_STRING: + case UI_CONTROL_COLOR: + case UI_CONTROL_FILE_PICKER: { + size_t length = 0; + const char* value = lua_tolstring(state, -1, &length); + if (value == nullptr) { + fail_callback(*callback.vm, "control get", "callback must return a string"); + } else { + callback.returnedString.assign(value, length); + outValue->string_value = callback.returnedString.c_str(); + } + break; + } + default: + break; + } + lua_pop(state, 1); +} + +void control_set(ModContext*, void* userData, const UiControlValue* value) { + auto& callback = *static_cast(userData); + if (value == nullptr) { + return; + } + lua_State* state = callback.vm->state; + switch (static_cast(callback.tag)) { + case UI_CONTROL_TOGGLE: + lua_pushboolean(state, value->bool_value); + break; + case UI_CONTROL_NUMBER: + case UI_CONTROL_SELECT: + lua_pushinteger64(state, value->int_value); + break; + case UI_CONTROL_STRING: + case UI_CONTROL_COLOR: + case UI_CONTROL_FILE_PICKER: + lua_pushstring(state, value->string_value != nullptr ? value->string_value : ""); + break; + default: + return; + } + call_callback(callback, callback.refs[1], 1, 0, "control set"); +} + +bool control_disabled(ModContext*, void* userData) { + auto& callback = *static_cast(userData); + return call_predicate(callback, callback.refs[3], 0, "control is_disabled"); +} + +bool control_modified(ModContext*, void* userData) { + auto& callback = *static_cast(userData); + return call_predicate(callback, callback.refs[4], 0, "control is_modified"); +} + +bool control_selected(ModContext*, void* userData) { + auto& callback = *static_cast(userData); + return call_predicate(callback, callback.refs[5], 0, "control is_selected"); +} + +void control_pressed(ModContext*, void* userData) { + auto& callback = *static_cast(userData); + call_callback(callback, callback.refs[2], 0, 0, "control on_pressed"); +} + +ModResult panel_build(ModContext*, UiElementHandle pane, void* userData, ModError* outError) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, pane, HandleKind::UiElement); + return call_build(callback, callback.refs[0], 1, "panel build", outError); +} + +ModResult panel_update(ModContext*, void* userData, ModError* outError) { + auto& callback = *static_cast(userData); + return call_build(callback, callback.refs[1], 0, "panel update", outError); +} + +ModResult group_build(ModContext*, UiElementHandle pane, void* userData, ModError* outError) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, pane, HandleKind::UiElement); + return call_build(callback, callback.refs[0], 1, "group build", outError); +} + +ModResult tab_build(ModContext*, UiWindowHandle window, UiElementHandle left, UiElementHandle right, + void* userData, ModError* outError) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, window, HandleKind::UiWindow); + push_ui_handle(callback.vm->state, *callback.vm, left, HandleKind::UiElement); + push_ui_handle(callback.vm->state, *callback.vm, right, HandleKind::UiElement); + return call_build(callback, callback.refs[0], 3, "window tab build", outError); +} + +void window_closed(ModContext*, UiWindowHandle window, void* userData) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, window, HandleKind::UiWindow); + call_callback(callback, callback.refs[0], 1, 0, "window on_closed"); +} + +void dialog_action(ModContext*, UiDialogHandle dialog, void* userData) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, dialog, HandleKind::UiDialog); + call_callback(callback, callback.refs[0], 1, 0, "dialog action"); +} + +bool dialog_action_disabled(ModContext*, void* userData) { + auto& callback = *static_cast(userData); + return call_predicate(callback, callback.refs[1], 0, "dialog action is_disabled"); +} + +void dialog_dismissed(ModContext*, UiDialogHandle dialog, void* userData) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, dialog, HandleKind::UiDialog); + call_callback(callback, callback.refs[0], 1, 0, "dialog on_dismiss"); +} + +ModResult dialog_build(ModContext*, UiElementHandle pane, void* userData, ModError* outError) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, pane, HandleKind::UiElement); + return call_build(callback, callback.refs[1], 1, "dialog build", outError); +} + +void menu_selected(ModContext*, void* userData) { + auto& callback = *static_cast(userData); + call_callback(callback, callback.refs[0], 0, 0, "menu tab on_selected"); +} + +void list_pressed(ModContext*, UiListHandle list, uint64_t key, void* userData) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, list, HandleKind::UiList); + lua_pushinteger64(callback.vm->state, static_cast(key)); + call_callback(callback, callback.refs[0], 2, 0, "list on_pressed"); +} + +bool list_selected(ModContext*, UiListHandle list, uint64_t key, void* userData) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, list, HandleKind::UiList); + lua_pushinteger64(callback.vm->state, static_cast(key)); + return call_predicate(callback, callback.refs[1], 2, "list is_selected"); +} + +bool list_disabled(ModContext*, UiListHandle list, uint64_t key, void* userData) { + auto& callback = *static_cast(userData); + push_ui_handle(callback.vm->state, *callback.vm, list, HandleKind::UiList); + lua_pushinteger64(callback.vm->state, static_cast(key)); + return call_predicate(callback, callback.refs[2], 2, "list is_disabled"); +} + +std::vector string_array(lua_State* state, int table, const char* field) { + std::vector result; + lua_getfield(state, table, field); + if (lua_isnil(state, -1)) { + lua_pop(state, 1); + return result; + } + luaL_checktype(state, -1, LUA_TTABLE); + const int count = lua_objlen(state, -1); + result.reserve(count); + for (int i = 1; i <= count; ++i) { + lua_rawgeti(state, -1, i); + result.emplace_back(luaL_checkstring(state, -1)); + lua_pop(state, 1); + } + lua_pop(state, 1); + return result; +} + +std::vector list_items(lua_State* state, int table, std::vector& labels) { + luaL_checktype(state, table, LUA_TTABLE); + const int count = lua_objlen(state, table); + labels.reserve(count); + std::vector items; + items.reserve(count); + for (int i = 1; i <= count; ++i) { + lua_rawgeti(state, table, i); + luaL_checktype(state, -1, LUA_TTABLE); + labels.push_back(get_optional_string(state, -1, "label")); + UiListItem item = UI_LIST_ITEM_INIT; + item.key = static_cast(get_optional_int(state, -1, "key", 0)); + items.push_back(item); + lua_pop(state, 1); + } + for (size_t i = 0; i < items.size(); ++i) { + items[i].label = labels[i].c_str(); + } + return items; +} + +UiControlKind control_kind(lua_State* state, const std::string& kind) { + if (kind == "button") + return UI_CONTROL_BUTTON; + if (kind == "toggle") + return UI_CONTROL_TOGGLE; + if (kind == "number") + return UI_CONTROL_NUMBER; + if (kind == "string") + return UI_CONTROL_STRING; + if (kind == "select") + return UI_CONTROL_SELECT; + if (kind == "color") + return UI_CONTROL_COLOR; + if (kind == "group") + return UI_CONTROL_GROUP; + if (kind == "file_picker") + return UI_CONTROL_FILE_PICKER; + luaL_error(state, "unknown UI control kind '%s'", kind.c_str()); +} + +UiStyleScope style_scope(lua_State* state, const std::string& scope) { + if (scope == "prelaunch") + return UI_SCOPE_PRELAUNCH; + if (scope == "window") + return UI_SCOPE_WINDOW; + if (scope == "menu_bar") + return UI_SCOPE_MENU_BAR; + if (scope == "overlay") + return UI_SCOPE_OVERLAY; + if (scope == "touch_controls") + return UI_SCOPE_TOUCH_CONTROLS; + if (scope == "graphics_tuner") + return UI_SCOPE_GRAPHICS_TUNER; + luaL_error(state, "unknown UI style scope '%s'", scope.c_str()); +} + +int pane_add_section(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + check_result(state, + svc_ui->pane_add_section(pane.vm->subject, pane.value, luaL_checkstring(state, 2)), + "ui pane_add_section"); + return 0; +} + +int pane_add_text(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + UiElementHandle element = 0; + check_result(state, + svc_ui->pane_add_text(pane.vm->subject, pane.value, luaL_checkstring(state, 2), &element), + "ui pane_add_text"); + push_ui_handle(state, *pane.vm, element, HandleKind::UiElement); + return 1; +} + +int pane_add_rml(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + UiElementHandle element = 0; + check_result(state, + svc_ui->pane_add_rml(pane.vm->subject, pane.value, luaL_checkstring(state, 2), &element), + "ui pane_add_rml"); + push_ui_handle(state, *pane.vm, element, HandleKind::UiElement); + return 1; +} + +int pane_add_progress(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + UiElementHandle element = 0; + check_result(state, + svc_ui->pane_add_progress( + pane.vm->subject, pane.value, static_cast(luaL_checknumber(state, 2)), &element), + "ui pane_add_progress"); + push_ui_handle(state, *pane.vm, element, HandleKind::UiElement); + return 1; +} + +int pane_add_control(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + luaL_checktype(state, 2, LUA_TTABLE); + + UiControlDesc desc = UI_CONTROL_DESC_INIT; + const std::string kind = get_optional_string(state, 2, "kind"); + const std::string label = get_optional_string(state, 2, "label"); + const std::string help = get_optional_string(state, 2, "help_rml"); + const std::string prefix = get_optional_string(state, 2, "prefix"); + const std::string suffix = get_optional_string(state, 2, "suffix"); + desc.kind = control_kind(state, kind); + desc.label = label.c_str(); + desc.help_rml = help.empty() ? nullptr : help.c_str(); + desc.min = get_optional_int(state, 2, "min", 0); + desc.max = get_optional_int(state, 2, "max", 0); + desc.step = get_optional_int(state, 2, "step", 1); + desc.prefix = prefix.empty() ? nullptr : prefix.c_str(); + desc.suffix = suffix.empty() ? nullptr : suffix.c_str(); + desc.max_length = static_cast(get_optional_int(state, 2, "max_length", 0)); + desc.color_alpha = get_optional_bool(state, 2, "color_alpha", false); + desc.directory_mode = get_optional_bool(state, 2, "directory_mode", false); + desc.string_set_mode = get_optional_string(state, 2, "string_set_mode") == "change" ? + UI_STRING_SET_ON_CHANGE : + UI_STRING_SET_ON_COMMIT; + + std::vector options = string_array(state, 2, "options"); + std::vector optionPointers; + optionPointers.reserve(options.size()); + for (const auto& option : options) + optionPointers.push_back(option.c_str()); + desc.options = optionPointers.data(); + desc.option_count = optionPointers.size(); + + std::vector presets = string_array(state, 2, "color_presets"); + std::vector presetPointers; + presetPointers.reserve(presets.size()); + for (const auto& preset : presets) + presetPointers.push_back(preset.c_str()); + desc.color_presets = presetPointers.data(); + desc.color_preset_count = presetPointers.size(); + + std::vector filterNames; + std::vector filterPatterns; + std::vector filters; + lua_getfield(state, 2, "file_filters"); + if (!lua_isnil(state, -1)) { + luaL_checktype(state, -1, LUA_TTABLE); + const int count = lua_objlen(state, -1); + filterNames.reserve(count); + filterPatterns.reserve(count); + filters.resize(count); + for (int i = 1; i <= count; ++i) { + lua_rawgeti(state, -1, i); + filterNames.push_back(get_optional_string(state, -1, "name")); + filterPatterns.push_back(get_optional_string(state, -1, "pattern")); + lua_pop(state, 1); + } + for (int i = 0; i < count; ++i) { + filters[i] = {filterNames[i].c_str(), filterPatterns[i].c_str()}; + } + } + lua_pop(state, 1); + desc.file_filters = filters.data(); + desc.file_filter_count = filters.size(); + + Callback& callback = retain_callback(*pane.vm); + callback.tag = desc.kind; + callback.refs[2] = ref_optional_function(state, 2, "on_pressed"); + callback.refs[3] = ref_optional_function(state, 2, "is_disabled"); + callback.refs[4] = ref_optional_function(state, 2, "is_modified"); + callback.refs[5] = ref_optional_function(state, 2, "is_selected"); + desc.user_data = &callback; + desc.on_pressed = callback.refs[2] != LUA_NOREF ? control_pressed : nullptr; + desc.is_disabled = callback.refs[3] != LUA_NOREF ? control_disabled : nullptr; + desc.is_modified = callback.refs[4] != LUA_NOREF ? control_modified : nullptr; + desc.is_selected = callback.refs[5] != LUA_NOREF ? control_selected : nullptr; + + lua_getfield(state, 2, "config_var"); + if (!lua_isnil(state, -1)) { + auto& variable = check_config_var(state, -1); + desc.binding = UI_BINDING_CONFIG_VAR; + desc.config_var = variable.value; + } else if (desc.kind != UI_CONTROL_BUTTON && desc.kind != UI_CONTROL_GROUP) { + desc.binding = UI_BINDING_CALLBACKS; + callback.refs[0] = ref_required_function(state, 2, "get"); + callback.refs[1] = ref_required_function(state, 2, "set"); + desc.get = control_get; + desc.set = control_set; + } + lua_pop(state, 1); + + UiElementHandle element = 0; + check_result(state, svc_ui->pane_add_control(pane.vm->subject, pane.value, &desc, &element), + "ui pane_add_control"); + push_ui_handle(state, *pane.vm, element, HandleKind::UiElement); + return 1; +} + +int pane_add_group(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + auto& target = check_ui_handle(state, 2, HandleKind::UiElement); + luaL_checktype(state, 3, LUA_TTABLE); + const std::string label = get_optional_string(state, 3, "label"); + Callback& callback = retain_callback(*pane.vm); + callback.refs[0] = ref_required_function(state, 3, "build"); + UiGroupDesc desc = UI_GROUP_DESC_INIT; + desc.label = label.c_str(); + desc.build = group_build; + desc.user_data = &callback; + UiElementHandle element = 0; + check_result(state, + svc_ui->pane_add_group(pane.vm->subject, pane.value, target.value, &desc, &element), + "ui pane_add_group"); + push_ui_handle(state, *pane.vm, element, HandleKind::UiElement); + return 1; +} + +int pane_add_list(lua_State* state) { + auto& pane = check_ui_handle(state, 1, HandleKind::UiElement); + luaL_checktype(state, 2, LUA_TTABLE); + Callback& callback = retain_callback(*pane.vm); + callback.refs[0] = ref_required_function(state, 2, "on_pressed"); + callback.refs[1] = ref_optional_function(state, 2, "is_selected"); + callback.refs[2] = ref_optional_function(state, 2, "is_disabled"); + + std::vector labels; + std::vector items; + lua_getfield(state, 2, "items"); + if (!lua_isnil(state, -1)) + items = list_items(state, -1, labels); + lua_pop(state, 1); + + UiListDesc desc = UI_LIST_DESC_INIT; + desc.items = items.data(); + desc.item_count = items.size(); + desc.on_pressed = list_pressed; + desc.is_selected = callback.refs[1] != LUA_NOREF ? list_selected : nullptr; + desc.is_disabled = callback.refs[2] != LUA_NOREF ? list_disabled : nullptr; + desc.user_data = &callback; + UiListHandle list = 0; + check_result(state, svc_ui->pane_add_list(pane.vm->subject, pane.value, &desc, &list), + "ui pane_add_list"); + push_ui_handle(state, *pane.vm, list, HandleKind::UiList); + return 1; +} + +int element_set_text(lua_State* state) { + auto& element = check_ui_handle(state, 1, HandleKind::UiElement); + check_result(state, + svc_ui->elem_set_text(element.vm->subject, element.value, luaL_checkstring(state, 2)), + "ui elem_set_text"); + return 0; +} + +int element_set_rml(lua_State* state) { + auto& element = check_ui_handle(state, 1, HandleKind::UiElement); + check_result(state, + svc_ui->elem_set_rml(element.vm->subject, element.value, luaL_checkstring(state, 2)), + "ui elem_set_rml"); + return 0; +} + +int element_set_progress(lua_State* state) { + auto& element = check_ui_handle(state, 1, HandleKind::UiElement); + check_result(state, + svc_ui->elem_set_progress( + element.vm->subject, element.value, static_cast(luaL_checknumber(state, 2))), + "ui elem_set_progress"); + return 0; +} + +int element_set_class(lua_State* state) { + auto& element = check_ui_handle(state, 1, HandleKind::UiElement); + check_result(state, + svc_ui->elem_set_class(element.vm->subject, element.value, luaL_checkstring(state, 2), + luaL_checkboolean(state, 3) != 0), + "ui elem_set_class"); + return 0; +} + +int list_set_items(lua_State* state) { + auto& list = check_ui_handle(state, 1, HandleKind::UiList); + std::vector labels; + auto items = list_items(state, 2, labels); + check_result(state, + svc_ui->list_set_items(list.vm->subject, list.value, items.data(), items.size()), + "ui list_set_items"); + return 0; +} + +int window_close(lua_State* state) { + auto& window = check_ui_handle(state, 1, HandleKind::UiWindow); + check_result(state, svc_ui->window_close(window.vm->subject, window.value), "ui window_close"); + window.value = 0; + return 0; +} + +int dialog_close(lua_State* state) { + auto& dialog = check_ui_handle(state, 1, HandleKind::UiDialog); + check_result(state, svc_ui->dialog_close(dialog.vm->subject, dialog.value), "ui dialog_close"); + dialog.value = 0; + return 0; +} + +int dialog_set_body(lua_State* state) { + auto& dialog = check_ui_handle(state, 1, HandleKind::UiDialog); + check_result(state, + svc_ui->dialog_set_body(dialog.vm->subject, dialog.value, luaL_checkstring(state, 2)), + "ui dialog_set_body"); + return 0; +} + +int dialog_set_icon(lua_State* state) { + auto& dialog = check_ui_handle(state, 1, HandleKind::UiDialog); + check_result(state, + svc_ui->dialog_set_icon(dialog.vm->subject, dialog.value, luaL_checkstring(state, 2)), + "ui dialog_set_icon"); + return 0; +} + +int style_unregister(lua_State* state) { + auto& style = check_ui_handle(state, 1, HandleKind::UiStyle); + check_result( + state, svc_ui->unregister_styles(style.vm->subject, style.value), "ui unregister_styles"); + style.value = 0; + return 0; +} + +int menu_tab_unregister(lua_State* state) { + auto& tab = check_ui_handle(state, 1, HandleKind::UiMenuTab); + check_result( + state, svc_ui->unregister_menu_tab(tab.vm->subject, tab.value), "ui unregister_menu_tab"); + tab.value = 0; + return 0; +} + +int register_mods_panel(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + luaL_checktype(state, 1, LUA_TTABLE); + Callback& callback = retain_callback(vm); + callback.refs[0] = ref_required_function(state, 1, "build"); + callback.refs[1] = ref_optional_function(state, 1, "update"); + UiModsPanelDesc desc = UI_MODS_PANEL_DESC_INIT; + desc.build = panel_build; + desc.update = callback.refs[1] != LUA_NOREF ? panel_update : nullptr; + desc.user_data = &callback; + check_result(state, svc_ui->register_mods_panel(vm.subject, &desc), "ui register_mods_panel"); + return 0; +} + +int window_push(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + luaL_checktype(state, 1, LUA_TTABLE); + std::vector tabs; + std::vector titles; + lua_getfield(state, 1, "tabs"); + luaL_checktype(state, -1, LUA_TTABLE); + const int tabCount = lua_objlen(state, -1); + tabs.reserve(tabCount); + titles.reserve(tabCount); + for (int i = 1; i <= tabCount; ++i) { + lua_rawgeti(state, -1, i); + titles.push_back(get_optional_string(state, -1, "title")); + Callback& callback = retain_callback(vm); + callback.refs[0] = ref_required_function(state, -1, "build"); + callback.refs[1] = ref_optional_function(state, -1, "update"); + UiTabDesc tab = UI_TAB_DESC_INIT; + tab.build = tab_build; + tab.update = callback.refs[1] != LUA_NOREF ? panel_update : nullptr; + tab.user_data = &callback; + tabs.push_back(tab); + lua_pop(state, 1); + } + lua_pop(state, 1); + for (size_t i = 0; i < tabs.size(); ++i) + tabs[i].title = titles[i].c_str(); + + const std::string rcss = get_optional_string(state, 1, "rcss"); + Callback& closed = retain_callback(vm); + closed.refs[0] = ref_optional_function(state, 1, "on_closed"); + UiWindowDesc desc = UI_WINDOW_DESC_INIT; + desc.tabs = tabs.data(); + desc.tab_count = tabs.size(); + desc.rcss = rcss.empty() ? nullptr : rcss.c_str(); + desc.on_closed = closed.refs[0] != LUA_NOREF ? window_closed : nullptr; + desc.user_data = &closed; + UiWindowHandle window = 0; + check_result(state, svc_ui->window_push(vm.subject, &desc, &window), "ui window_push"); + push_ui_handle(state, vm, window, HandleKind::UiWindow); + return 1; +} + +UiDialogVariant dialog_variant(lua_State* state, const std::string& variant) { + if (variant.empty() || variant == "normal") + return UI_DIALOG_NORMAL; + if (variant == "warning") + return UI_DIALOG_WARNING; + if (variant == "danger") + return UI_DIALOG_DANGER; + luaL_error(state, "unknown dialog variant '%s'", variant.c_str()); +} + +int dialog_push(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + luaL_checktype(state, 1, LUA_TTABLE); + const std::string title = get_optional_string(state, 1, "title"); + const std::string body = get_optional_string(state, 1, "body_rml"); + const std::string icon = get_optional_string(state, 1, "icon"); + const std::string variant = get_optional_string(state, 1, "variant"); + + std::vector actions; + std::vector labels; + lua_getfield(state, 1, "actions"); + luaL_checktype(state, -1, LUA_TTABLE); + const int actionCount = lua_objlen(state, -1); + actions.reserve(actionCount); + labels.reserve(actionCount); + for (int i = 1; i <= actionCount; ++i) { + lua_rawgeti(state, -1, i); + labels.push_back(get_optional_string(state, -1, "label")); + Callback& callback = retain_callback(vm); + callback.refs[0] = ref_optional_function(state, -1, "on_pressed"); + callback.refs[1] = ref_optional_function(state, -1, "is_disabled"); + UiDialogAction action = UI_DIALOG_ACTION_INIT; + action.on_pressed = callback.refs[0] != LUA_NOREF ? dialog_action : nullptr; + action.is_disabled = callback.refs[1] != LUA_NOREF ? dialog_action_disabled : nullptr; + action.user_data = &callback; + action.keep_open = get_optional_bool(state, -1, "keep_open", false); + actions.push_back(action); + lua_pop(state, 1); + } + lua_pop(state, 1); + for (size_t i = 0; i < actions.size(); ++i) + actions[i].label = labels[i].c_str(); + + Callback& callback = retain_callback(vm); + callback.refs[0] = ref_optional_function(state, 1, "on_dismiss"); + callback.refs[1] = ref_optional_function(state, 1, "build"); + UiDialogDesc desc = UI_DIALOG_DESC_INIT; + desc.title = title.c_str(); + desc.body_rml = body.c_str(); + desc.icon = icon.empty() ? nullptr : icon.c_str(); + desc.variant = dialog_variant(state, variant); + desc.actions = actions.data(); + desc.action_count = actions.size(); + desc.on_dismiss = callback.refs[0] != LUA_NOREF ? dialog_dismissed : nullptr; + desc.build = callback.refs[1] != LUA_NOREF ? dialog_build : nullptr; + desc.user_data = &callback; + UiDialogHandle dialog = 0; + check_result(state, svc_ui->dialog_push(vm.subject, &desc, &dialog), "ui dialog_push"); + push_ui_handle(state, vm, dialog, HandleKind::UiDialog); + return 1; +} + +int is_any_document_visible(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + bool visible = false; + check_result( + state, svc_ui->is_any_document_visible(vm.subject, &visible), "ui is_any_document_visible"); + lua_pushboolean(state, visible); + return 1; +} + +int register_styles(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + const auto scope = style_scope(state, luaL_checkstring(state, 1)); + UiStyleHandle style = 0; + check_result(state, + svc_ui->register_styles(vm.subject, scope, luaL_checkstring(state, 2), &style), + "ui register_styles"); + push_ui_handle(state, vm, style, HandleKind::UiStyle); + return 1; +} + +int register_styles_file(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + const auto scope = style_scope(state, luaL_checkstring(state, 1)); + UiStyleHandle style = 0; + check_result(state, + svc_ui->register_styles_file(vm.subject, scope, luaL_checkstring(state, 2), &style), + "ui register_styles_file"); + push_ui_handle(state, vm, style, HandleKind::UiStyle); + return 1; +} + +int register_menu_tab(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + luaL_checktype(state, 1, LUA_TTABLE); + const std::string label = get_optional_string(state, 1, "label"); + Callback& callback = retain_callback(vm); + callback.refs[0] = ref_required_function(state, 1, "on_selected"); + UiMenuTabDesc desc = UI_MENU_TAB_DESC_INIT; + desc.label = label.c_str(); + desc.on_selected = menu_selected; + desc.user_data = &callback; + UiMenuTabHandle tab = 0; + check_result(state, svc_ui->register_menu_tab(vm.subject, &desc, &tab), "ui register_menu_tab"); + push_ui_handle(state, vm, tab, HandleKind::UiMenuTab); + return 1; +} + +int push_toast(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + luaL_checktype(state, 1, LUA_TTABLE); + const std::string type = get_optional_string(state, 1, "type"); + const std::string title = get_optional_string(state, 1, "title_rml"); + const std::string body = get_optional_string(state, 1, "body_rml"); + UiToastDesc desc = UI_TOAST_DESC_INIT; + desc.type = type.empty() ? nullptr : type.c_str(); + desc.title_rml = title.empty() ? nullptr : title.c_str(); + desc.body_rml = body.empty() ? nullptr : body.c_str(); + desc.duration_ms = static_cast(get_optional_int(state, 1, "duration_ms", 0)); + check_result(state, svc_ui->push_toast(vm.subject, &desc), "ui push_toast"); + return 0; +} + +int get_clipboard_text(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + size_t size = 0; + check_result( + state, svc_ui->get_clipboard_text(vm.subject, nullptr, 0, &size), "ui get_clipboard_text"); + std::vector text(size + 1); + check_result(state, svc_ui->get_clipboard_text(vm.subject, text.data(), text.size(), nullptr), + "ui get_clipboard_text"); + lua_pushlstring(state, text.data(), size); + return 1; +} + +int set_clipboard_text(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + check_result(state, svc_ui->set_clipboard_text(vm.subject, luaL_checkstring(state, 1)), + "ui set_clipboard_text"); + return 0; +} + +} // namespace + +void push_ui_handle(lua_State* state, Vm& vm, uint64_t value, HandleKind kind) { + push_handle(state, vm, value, kind, ui_metatable(kind)); +} + +int open_ui(lua_State* state) { + Vm& vm = vm_from_upvalue(state); + if (svc_ui == nullptr) { + service_unavailable(state, "UiService"); + } + static const luaL_Reg kElementMethods[] = { + {"add_section", pane_add_section}, + {"add_text", pane_add_text}, + {"add_rml", pane_add_rml}, + {"add_progress", pane_add_progress}, + {"add_control", pane_add_control}, + {"add_group", pane_add_group}, + {"add_list", pane_add_list}, + {"set_text", element_set_text}, + {"set_rml", element_set_rml}, + {"set_progress", element_set_progress}, + {"set_class", element_set_class}, + {nullptr, nullptr}, + }; + static const luaL_Reg kWindowMethods[] = {{"close", window_close}, {nullptr, nullptr}}; + static const luaL_Reg kDialogMethods[] = { + {"close", dialog_close}, + {"set_body", dialog_set_body}, + {"set_icon", dialog_set_icon}, + {nullptr, nullptr}, + }; + static const luaL_Reg kStyleMethods[] = {{"unregister", style_unregister}, {nullptr, nullptr}}; + static const luaL_Reg kMenuMethods[] = { + {"unregister", menu_tab_unregister}, {nullptr, nullptr}}; + static const luaL_Reg kListMethods[] = {{"set_items", list_set_items}, {nullptr, nullptr}}; + create_handle_metatable(state, kUiElementMetatable, kElementMethods, "UiElement"); + create_handle_metatable(state, kUiWindowMetatable, kWindowMethods, "UiWindow"); + create_handle_metatable(state, kUiDialogMetatable, kDialogMethods, "UiDialog"); + create_handle_metatable(state, kUiStyleMetatable, kStyleMethods, "UiStyle"); + create_handle_metatable(state, kUiMenuTabMetatable, kMenuMethods, "UiMenuTab"); + create_handle_metatable(state, kUiListMetatable, kListMethods, "UiList"); + + lua_newtable(state); + set_function(state, vm, "register_mods_panel", register_mods_panel); + set_function(state, vm, "window_push", window_push); + set_function(state, vm, "dialog_push", dialog_push); + set_function(state, vm, "is_any_document_visible", is_any_document_visible); + set_function(state, vm, "register_styles", register_styles); + set_function(state, vm, "register_styles_file", register_styles_file); + set_function(state, vm, "register_menu_tab", register_menu_tab); + set_function(state, vm, "push_toast", push_toast); + set_function(state, vm, "get_clipboard_text", get_clipboard_text); + set_function(state, vm, "set_clipboard_text", set_clipboard_text); + lua_setreadonly(state, -1, true); + return 1; +} + +} // namespace luau_runtime diff --git a/mods/randomizer b/mods/randomizer new file mode 160000 index 0000000000..641c9c9e0b --- /dev/null +++ b/mods/randomizer @@ -0,0 +1 @@ +Subproject commit 641c9c9e0bd04d51f9cb32e08daf7d134c65dcb1 diff --git a/platforms/android/README.md b/platforms/android/README.md index 6ebcac23cd..c4f8a688df 100644 --- a/platforms/android/README.md +++ b/platforms/android/README.md @@ -4,7 +4,7 @@ This directory contains Dusklight's Android shell built on top of Borealis. ## Prerequisites -- Android SDK installed (`ANDROID_HOME`) +- Android SDK with Platform 37 installed (`ANDROID_HOME`) - Android NDK version used by CMake presets (`ANDROID_NDK_VERSION`) - JDK 17+ diff --git a/platforms/android/app/src/main/AndroidManifest.xml b/platforms/android/app/src/main/AndroidManifest.xml index b7270ee433..8dc7bf3236 100644 --- a/platforms/android/app/src/main/AndroidManifest.xml +++ b/platforms/android/app/src/main/AndroidManifest.xml @@ -19,6 +19,7 @@ android:appCategory="game" android:icon="@mipmap/icon" android:label="@string/app_name" + android:networkSecurityConfig="@xml/network_security_config" android:theme="@android:style/Theme.NoTitleBar" android:enableOnBackInvokedCallback="false"> diff --git a/platforms/android/app/src/main/res/xml/network_security_config.xml b/platforms/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 0000000000..aa9543fd1f --- /dev/null +++ b/platforms/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,9 @@ + + + + + localhost + 127.0.0.1 + ::1 + + diff --git a/platforms/android/build.gradle b/platforms/android/build.gradle index eba031aa1b..4b1f3fb3f2 100644 --- a/platforms/android/build.gradle +++ b/platforms/android/build.gradle @@ -1,3 +1,3 @@ plugins { - id 'com.android.application' version '8.13.2' apply false + id 'com.android.application' version '9.1.1' apply false } diff --git a/platforms/android/gradle/wrapper/gradle-wrapper.jar b/platforms/android/gradle/wrapper/gradle-wrapper.jar index 2b338a935b..61285a659d 100644 Binary files a/platforms/android/gradle/wrapper/gradle-wrapper.jar and b/platforms/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/platforms/android/gradle/wrapper/gradle-wrapper.properties b/platforms/android/gradle/wrapper/gradle-wrapper.properties index ec50cfcb6e..37f78a6af8 100644 --- a/platforms/android/gradle/wrapper/gradle-wrapper.properties +++ b/platforms/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ -#Thu Nov 11 18:20:34 PST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/platforms/android/gradlew b/platforms/android/gradlew index 3427607f42..adff685a03 100755 --- a/platforms/android/gradlew +++ b/platforms/android/gradlew @@ -1,74 +1,128 @@ -#!/usr/bin/env bash +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum -warn ( ) { +warn () { echo "$*" -} +} >&2 -die ( ) { +die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -77,84 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|grep -E -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|grep -E -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/platforms/android/gradlew.bat b/platforms/android/gradlew.bat index 8a0b282aa6..c4bdd3ab8e 100644 --- a/platforms/android/gradlew.bat +++ b/platforms/android/gradlew.bat @@ -1,4 +1,22 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -8,26 +26,30 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -35,54 +57,35 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/platforms/ios/Info.plist.in b/platforms/ios/Info.plist.in index 395b29b7d7..9a9025b9f7 100644 --- a/platforms/ios/Info.plist.in +++ b/platforms/ios/Info.plist.in @@ -85,5 +85,12 @@ LSSupportsGameMode + NSAppTransportSecurity + + NSAllowsLocalNetworking + + + NSLocalNetworkUsageDescription + Dusklight allows network-enabled mods to connect to devices on your local network. diff --git a/platforms/macos/Info.plist.in b/platforms/macos/Info.plist.in index 7f29358033..3f564d88f7 100644 --- a/platforms/macos/Info.plist.in +++ b/platforms/macos/Info.plist.in @@ -32,5 +32,12 @@ public.app-category.adventure-games LSSupportsGameMode + NSAppTransportSecurity + + NSAllowsLocalNetworking + + + NSLocalNetworkUsageDescription + Dusklight allows network-enabled mods to connect to devices on your local network. diff --git a/platforms/tvos/Info.plist.in b/platforms/tvos/Info.plist.in index 49ed85edd7..7f32e2d207 100644 --- a/platforms/tvos/Info.plist.in +++ b/platforms/tvos/Info.plist.in @@ -47,5 +47,12 @@ Automatic LSSupportsGameMode + NSAppTransportSecurity + + NSAllowsLocalNetworking + + + NSLocalNetworkUsageDescription + Dusklight allows network-enabled mods to connect to devices on your local network. diff --git a/res/rml/command_console.rcss b/res/rml/command_console.rcss new file mode 100644 index 0000000000..b5378b5d7a --- /dev/null +++ b/res/rml/command_console.rcss @@ -0,0 +1,95 @@ +*, *:before, *:after { + box-sizing: border-box; +} + +body { + display: block; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + overflow: visible; + pointer-events: none; +} + +console { + position: absolute; + bottom: 10dp; + left: 10dp; + width: 50%; + display: flex; + flex-direction: column; + background-color: rgba(0, 0, 0, 60%); + pointer-events: auto; + font-family: "Noto Mono"; + font-size: 14dp; + color: #FFFFFF; + transition: background-color 0.8s linear-in-out; +} + +output { + display: block; + overflow: hidden; + max-height: 480dp; + padding: 4dp 8dp; + line-height: 1.4em; +} + +output[open] { + height: 480dp; + max-height: 480dp; + overflow-y: auto; +} + +console:not([open]) { + pointer-events: none; +} + +console:not([open])[fading] { + background-color: rgba(0, 0, 0, 0%); +} + +console[open] { + background-color: rgba(0, 0, 0, 60%); + transition: none; +} + +line { + display: block; + white-space: nowrap; + opacity: 1; + transition: opacity 0.8s linear-in-out; +} + +output:not([open]) line[fading] { + opacity: 0; +} + +output:not([open]) line[expired] { + display: none; +} + +output[open] line { + opacity: 1; + transition: none; +} + +line.cmd { + color: #FFD966; +} + +console input { + display: none; + width: 100%; + background-color: rgba(0, 0, 0, 40%); + border: 0dp; + border-top: 1dp rgba(255, 255, 255, 20%); + color: #FFFFFF; + font-family: "Noto Mono"; + font-size: 14dp; + padding: 4dp 8dp; +} + +console[open] input { + display: block; +} diff --git a/res/rml/mods.rcss b/res/rml/mods.rcss index 6042e35c0f..34e86f485b 100644 --- a/res/rml/mods.rcss +++ b/res/rml/mods.rcss @@ -115,6 +115,14 @@ mod-entry .mod-entry-status.failed { color: #cc4444; } +mod-entry .mod-entry-network { + margin-left: 6dp; + padding: 1dp 5dp; + border-radius: 5dp; + background-color: rgba(67, 151, 219, 20%); + color: #6fb7ef; +} + mod-entry .mod-entry-desc { font-size: 14dp; line-height: 1.3; @@ -216,4 +224,9 @@ window.mods .mod-description { .mod-info-label.failed { color: #cc4444; opacity: 1; -} \ No newline at end of file +} + +.status-badge.network { + color: #6fb7ef; + opacity: 1; +} diff --git a/res/rml/window.rcss b/res/rml/window.rcss index 364d047c1d..98b63dfcd9 100644 --- a/res/rml/window.rcss +++ b/res/rml/window.rcss @@ -107,7 +107,6 @@ window content pane { min-width: 0; min-height: 0; padding: 24dp; - padding-bottom: 0dp; gap: 8dp; overflow: hidden auto; font-size: 20dp; @@ -121,6 +120,76 @@ window content pane > * { flex: 0 0 auto; } +ui-list { + display: flex; + flex-flow: column; + flex: 1 1 0; + min-width: 0; + min-height: 0; +} + +window content pane > ui-list, +.modal-content pane > ui-list { + flex: 1 1 0; + min-width: 0; + min-height: 0; +} + +ui-list-viewport { + display: block; + flex: 1 1 0; + min-width: 0; + min-height: 0; + overflow: hidden auto; +} + +ui-list-content { + display: flex; + flex-flow: column; + gap: 8dp; + min-width: 0; +} + +ui-list-content > button.ui-list-row { + flex: 0 0 auto; +} + +ui-list-empty { + display: block; + padding: 16dp; + text-align: center; + opacity: 0.45; +} + +window content pane > ui-list { + margin-left: -24dp; + margin-right: -24dp; +} + +window content pane > ui-list:first-child { + margin-top: -24dp; +} + +window content pane > ui-list:last-child { + margin-bottom: -24dp; +} + +window content pane > ui-list ui-list-content, +window content pane > ui-list ui-list-empty { + padding-left: 24dp; + padding-right: 24dp; +} + +window content pane > ui-list:first-child ui-list-content, +window content pane > ui-list:first-child ui-list-empty { + padding-top: 24dp; +} + +window content pane > ui-list:last-child ui-list-content, +window content pane > ui-list:last-child ui-list-empty { + padding-bottom: 24dp; +} + window content pane:last-of-type > div { line-height: 1.625; } @@ -131,14 +200,6 @@ window content pane:last-of-type > div { color: rgba(224, 219, 200, 65%); } -window content pane > spacer { - display: block; - /* Completes the 24dp bottom inset after the pane's 8dp gap. */ - flex: 0 0 16dp; - height: 16dp; - pointer-events: none; -} - scrollbarvertical { width: 8dp; margin: 4dp 4dp 4dp 0; @@ -567,10 +628,6 @@ window.modal.danger .modal-header icon { flex: 0 0 auto; } -.modal-content pane > spacer { - display: none; -} - .verification-progress { display: flex; flex-direction: column; diff --git a/sdk/include/mods/items.h b/sdk/include/mods/items.h index e10b6df639..ceee2a0efc 100644 --- a/sdk/include/mods/items.h +++ b/sdk/include/mods/items.h @@ -8,8 +8,9 @@ #define ITEM_CHECK_BUG_PREFIX "bug:" /* */ #define ITEM_CHECK_CHEST_PREFIX "chest:" /* : */ #define ITEM_CHECK_FREESTANDING_PREFIX "freestanding:" /* : */ +#define ITEM_CHECK_GOLDEN_WOLF_PREFIX "golden_wolf:" /* */ #define ITEM_CHECK_POE_PREFIX "poe:" /* : */ -#define ITEM_CHECK_SHOP_PREFIX "shop:" /* : */ +#define ITEM_CHECK_SHOP_PREFIX "shop:" /* :: */ #define ITEM_CHECK_SKY_PREFIX "sky:" /* : */ #define ITEM_CHECK_DUNGEON_REWARD_PREFIX "dungeon_reward:" /* */ @@ -20,12 +21,15 @@ #define ITEM_CHECK_BULBLIN_KEY "bulblin_key:D_MN09" #define ITEM_CHECK_CORAL_EARRING "coral_earring" #define ITEM_CHECK_CORO_BOTTLE "coro_bottle" +#define ITEM_CHECK_CORO_GATE_KEY "coro_gate_key" +#define ITEM_CHECK_CORO_LANTERN "coro_lantern" #define ITEM_CHECK_DUNGEON_MAP_SNOWPEAK "dungeon_map:D_MN11" #define ITEM_CHECK_FAIRY_REWARD "fairy_reward:D_SB01" #define ITEM_CHECK_FISHING_BOTTLE "fishing_bottle" #define ITEM_CHECK_FISHING_HEART_PIECE "fishing_heart_piece" #define ITEM_CHECK_GOATS_REWARD "goats_reward" #define ITEM_CHECK_GORON_REWARD "goron_reward:F_SP113" +#define ITEM_CHECK_GORON_SPRINGWATER_RUSH "goron_springwater_rush" #define ITEM_CHECK_ILIA_CHARM "ilia_charm" #define ITEM_CHECK_ILIA_MEMORY "ilia_memory" #define ITEM_CHECK_IZA_REWARD_1 "iza_reward_1" @@ -41,6 +45,7 @@ #define ITEM_CHECK_PRAYER_REWARD "prayer_reward" #define ITEM_CHECK_RENADO_LETTER "renado_letter" #define ITEM_CHECK_SERA_REWARD "sera_reward" +#define ITEM_CHECK_SHAD_DOMINION_ROD "shad_dominion_rod" #define ITEM_CHECK_SKYBOOK "skybook" #define ITEM_CHECK_SNOWBOARD_REWARD "snowboard_race_reward" #define ITEM_CHECK_STAR_REWARD_1 "star_reward_1" diff --git a/sdk/include/mods/meta.hpp b/sdk/include/mods/meta.hpp index 6b1de96ad8..ef85d827c2 100644 --- a/sdk/include/mods/meta.hpp +++ b/sdk/include/mods/meta.hpp @@ -46,8 +46,8 @@ extern "C" const unsigned char mod_meta_bounds_end[] __asm("section$end$__DATA$_ #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[]; +extern "C" __attribute__((visibility("hidden"))) const unsigned char __start_modmeta[]; +extern "C" __attribute__((visibility("hidden"))) const unsigned char __stop_modmeta[]; #define MOD_META_BOUNDS_DEFN #define MOD_META_BOUNDS_BEGIN (__start_modmeta) #define MOD_META_BOUNDS_END (__stop_modmeta) diff --git a/sdk/include/mods/runtime.h b/sdk/include/mods/runtime.h new file mode 100644 index 0000000000..25719e2eb9 --- /dev/null +++ b/sdk/include/mods/runtime.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +/* + * Lifecycle service for mods delegated to a runtime named by mod.json. The host passes the + * runtime's context as ctx and the delegated mod's context as subject. + */ +typedef struct ModRuntimeService { + ServiceHeader header; + + ModResult (*activate)(ModContext* ctx, ModContext* subject, ModError* out_error); + ModResult (*update)(ModContext* ctx, ModContext* subject, ModError* out_error); + ModResult (*deactivate)(ModContext* ctx, ModContext* subject, ModError* out_error); +} ModRuntimeService; diff --git a/sdk/include/mods/svc/actor.h b/sdk/include/mods/svc/actor.h new file mode 100644 index 0000000000..5876ddcaf2 --- /dev/null +++ b/sdk/include/mods/svc/actor.h @@ -0,0 +1,102 @@ +#pragma once + +#include +#include + +#define ACTOR_SERVICE_ID "dev.twilitrealm.dusklight.actor" +#define ACTOR_SERVICE_MAJOR 1u +#define ACTOR_SERVICE_MINOR 0u + +typedef int16_t ProfileName; +typedef uint32_t ActorId; +typedef uint64_t ActorHandle; + +typedef struct { + const char name[8]; // Canonical stage name. Must be unique among active mod actors. Matching a + // game actor name intentionally overrides stage lookup for that actor. + + uint16_t priority_group; /* priorityGroup is the priority for when execute will be called on the + actor. Here are the main groups: + 0: The room manager actor + 1: Game scenes + 2: Various room change actors + 3: Most objects to be executed before Link + 4: Some bosses, canoe, epona, spinner, chests + 5: Link's actor + 6: Boomerang, midna + 7: Most objects, actors, bosses, triggers to be executed after link (most actors go here) + 8: Various objects and enemies + 9: Various actors + 10: Timer, Scene Exit actor + 11: Grass, Suspend Actors + */ + + size_t process_size; // Size of the actor class (use sizeof(my_actor_class)) + int16_t draw_priority; // an enum value that is prefixed with fpcDwPi. Select an existing value + // from the fpcDwPi to pick a draw priority matching the actor you wish + // to match priorities with. + uint32_t status; // Flags from fopAc_Status_e enum (all have fopAcStts_UNK_0x40000_e, a lot + // have fopAcStts_UNK_0x4000_e, add fopAcStts_CULL_e to enable culling) + uint8_t group; // The actor type. An enum value from fopAc_Group_e (fopAc_ACTOR_e, + // fopAc_ENEMY_e, fopAc_NPC_e) + uint8_t cull_type; // Enum value from fopAc_Cull_e + int (*create_function)( + void*); // Called after the actor is spawned, return type is a enum value of cPhs_Step + int (*delete_function)(void*); // Releases resources; returns 1 when deletion is complete + int (*execute_function)(void*); // Called once per game tick, the actor's priorityGroup + // determines when it will run relative to other actors + int (*is_delete_function)(void*); // Returns 1 when normal deletion may begin + int (*draw_function)(void*); // Called to draw the actor +} ActorProfileDesc; + +typedef struct { + uint32_t parameters; // The parameters to be passed to the actor + int8_t argument; // The argument to be passed to the actor (acts as an extra byte for a parameter) + int8_t room_num; // The room to spawn the actor in + struct { + float x; + float y; + float z; + } position; + struct { + int16_t x; + int16_t y; + int16_t z; + } angle; + struct { + float x; + float y; + float z; + } scale; + int (*create_function)(void*); // Optional: A custom function to run when the actor is created. +} ActorSpawnParams; + +typedef struct ActorService { + ServiceHeader header; + ModResult (*register_actor)(ModContext* ctx, const ActorProfileDesc* desc, + ProfileName* outProfileName, ActorHandle* outActorHandle); + ModResult (*unregister_actor)(ModContext* ctx, ActorHandle handle); + ModResult (*create_actor_from_name)( + ModContext* ctx, const char* name, const ActorSpawnParams* params, ActorId* outId); + ModResult (*create_actor)( + ModContext* ctx, ProfileName name, const ActorSpawnParams* params, ActorId* outId); + ModResult (*create_child_actor_from_name)(ModContext* ctx, const char* name, ActorId parentID, + const ActorSpawnParams* params, ActorId* outId); + ModResult (*create_child_actor)(ModContext* ctx, ProfileName name, ActorId parentID, + const ActorSpawnParams* params, ActorId* outId); + ModResult (*get_actor_id)(ModContext* ctx, ProfileName name, ActorId* outId); + ModResult (*get_actor_room_num)(ModContext* ctx, ActorId actorId, int8_t* outRoomNum); + /* Returns MOD_UNAVAILABLE if the actor cannot be queued for deletion immediately. */ + ModResult (*delete_actor)(ModContext* ctx, ActorId actorId); +} ActorService; + +#ifdef __cplusplus +#include "mods/service.hpp" + +template <> +struct mods::ServiceTraits { + static constexpr const char* id = ACTOR_SERVICE_ID; + static constexpr uint16_t major_version = ACTOR_SERVICE_MAJOR; + static constexpr uint16_t minor_version = ACTOR_SERVICE_MINOR; +}; +#endif diff --git a/sdk/include/mods/svc/file.h b/sdk/include/mods/svc/file.h new file mode 100644 index 0000000000..4d5c82b5a1 --- /dev/null +++ b/sdk/include/mods/svc/file.h @@ -0,0 +1,118 @@ +#pragma once + +#include + +#ifdef __cplusplus +#include +#endif + +#define FILE_SERVICE_ID "dev.twilitrealm.dusklight.file" +#define FILE_SERVICE_MAJOR 1u +#define FILE_SERVICE_MINOR 0u + +typedef uint64_t FileStreamHandle; + +typedef enum FileOpenMode { + FILE_OPEN_READ = 0, + FILE_OPEN_TRUNCATE = 1, + FILE_OPEN_APPEND = 2, +} FileOpenMode; + +typedef struct FileFilter { + const char* name; + /* Semicolon-separated extensions or "*". */ + const char* pattern; +} FileFilter; + +typedef struct FilePickOptions { + uint32_t struct_size; + const FileFilter* filters; + uint32_t filter_count; + /* Optional previously returned location. */ + const char* default_location; +} FilePickOptions; + +#define FILE_PICK_OPTIONS_INIT {sizeof(FilePickOptions), NULL, 0u, NULL} + +/* Locations and error are valid only for the duration of the callback. Canceled picks report + * MOD_UNAVAILABLE. The callback runs on the game thread. */ +typedef void (*FilePickFn)(ModContext* ctx, ModResult status, const char* const* locations, + uint32_t location_count, const char* error, void* user_data); + +typedef struct FileBuffer { + uint32_t struct_size; + void* data; + size_t size; +} FileBuffer; + +#define FILE_BUFFER_INIT {sizeof(FileBuffer), NULL, 0u} + +typedef struct FileEntry { + const char* name; + const char* location; + bool is_directory; +} FileEntry; + +/* Called once per entry, then once with entry == NULL. Entries are valid only for the duration of + * the callback. */ +typedef void (*FileListFn)(ModContext* ctx, const FileEntry* entry, void* user_data); + +/* + * Access to user-selected files and folders. + * + * A location is an opaque UTF-8 string returned by `pick_*`, `export_file`, `join`, `create_child`. + * Save it and pass it back to the service. Never parse it or manually append path segments. + * + * Android: Security grants are restored across launches. Only 512 (or 128 before API 30) grants are + * allowed at a time. If a grant cannot be retained or was revoked, `check`/`open` returns + * MOD_UNAVAILABLE so the user can select the location again. + * + * Calls other than picker completion are synchronous and must run on the game thread. Avoid file + * reads and folder traversal in per-frame callbacks. + */ +typedef struct FileService { + ServiceHeader header; + + /* One native dialog is allowed at a time. Returns MOD_CONFLICT while one is outstanding. */ + ModResult (*pick_file)( + ModContext* ctx, const FilePickOptions* options, FilePickFn fn, void* user_data); + ModResult (*pick_folder)( + ModContext* ctx, const FilePickOptions* options, FilePickFn fn, void* user_data); + /* Exports an existing file to a user-chosen destination. fn receives its final location. */ + ModResult (*export_file)(ModContext* ctx, const char* source_location, + const char* suggested_name, FilePickFn fn, void* user_data); + + ModResult (*display_name)( + ModContext* ctx, const char* location, char* buffer, uint32_t buffer_size); + /* MOD_OK, MOD_UNAVAILABLE when gone or inaccessible, or MOD_UNSUPPORTED. */ + ModResult (*check)(ModContext* ctx, const char* location); + + /* Write modes require an existing writable location and return MOD_UNSUPPORTED otherwise. */ + ModResult (*open)( + ModContext* ctx, const char* location, FileOpenMode mode, FileStreamHandle* out_handle); + ModResult (*size)(ModContext* ctx, FileStreamHandle handle, uint64_t* out_size); + ModResult (*read)(ModContext* ctx, FileStreamHandle handle, void* buffer, uint64_t length, + uint64_t* out_read); + ModResult (*write)( + ModContext* ctx, FileStreamHandle handle, const void* buffer, uint64_t length); + ModResult (*seek)(ModContext* ctx, FileStreamHandle handle, uint64_t offset); + ModResult (*flush)(ModContext* ctx, FileStreamHandle handle); + /* Reports flush and close failures; writers must check the result. */ + ModResult (*close)(ModContext* ctx, FileStreamHandle handle); + + ModResult (*read_all)(ModContext* ctx, const char* location, FileBuffer* out_buffer); + /* Truncates and writes an existing location. This operation is not atomic. */ + ModResult (*write_all)(ModContext* ctx, const char* location, const void* data, size_t size); + void (*free)(ModContext* ctx, FileBuffer* buffer); + + ModResult (*list)(ModContext* ctx, const char* folder_location, FileListFn fn, void* user_data); + /* out_location remains valid until this mod's next `join` or `create_child` call. */ + ModResult (*join)(ModContext* ctx, const char* folder_location, const char* relative_path, + const char** out_location); + + /* Creates one file without replacing an existing child. */ + ModResult (*create_child)( + ModContext* ctx, const char* folder_location, const char* name, const char** out_location); +} FileService; + +MOD_DECLARE_SERVICE(FileService, svc_file, FILE_SERVICE_ID, FILE_SERVICE_MAJOR, FILE_SERVICE_MINOR); diff --git a/sdk/include/mods/svc/file.hpp b/sdk/include/mods/svc/file.hpp new file mode 100644 index 0000000000..e297000c2e --- /dev/null +++ b/sdk/include/mods/svc/file.hpp @@ -0,0 +1,321 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace mods::file { + +class File { +public: + File() = default; + File(FileStreamHandle handle, ModResult result) : mHandle{handle}, mResult{result} {} + ~File() { reset(); } + File(const File&) = delete; + File& operator=(const File&) = delete; + File(File&& other) noexcept { *this = std::move(other); } + File& operator=(File&& other) noexcept { + if (this != &other) { + reset(); + mHandle = std::exchange(other.mHandle, 0); + mResult = other.mResult; + } + return *this; + } + + explicit operator bool() const { return mResult == MOD_OK && mHandle != 0; } + ModResult result() const { return mResult; } + FileStreamHandle handle() const { return mHandle; } + + uint64_t size() const { + uint64_t value = 0; + if (mHandle != 0 && svc_file != nullptr) { + svc_file->size(mod_ctx, mHandle, &value); + } + return value; + } + + uint64_t read(void* buffer, uint64_t length) { + uint64_t value = 0; + if (mHandle == 0 || svc_file == nullptr) { + mResult = MOD_UNAVAILABLE; + } else { + mResult = svc_file->read(mod_ctx, mHandle, buffer, length, &value); + } + return value; + } + + bool seek(uint64_t offset) { + mResult = mHandle != 0 && svc_file != nullptr ? svc_file->seek(mod_ctx, mHandle, offset) : + MOD_UNAVAILABLE; + return mResult == MOD_OK; + } + + bool write(const void* buffer, uint64_t length) { + if (mHandle == 0 || svc_file == nullptr) { + mResult = MOD_UNAVAILABLE; + } else { + mResult = svc_file->write(mod_ctx, mHandle, buffer, length); + } + return mResult == MOD_OK; + } + + bool write(std::span bytes) { return write(bytes.data(), bytes.size()); } + + bool flush() { + if (mHandle == 0 || svc_file == nullptr) { + mResult = MOD_UNAVAILABLE; + } else { + mResult = svc_file->flush(mod_ctx, mHandle); + } + return mResult == MOD_OK; + } + + bool close() { + if (mHandle == 0) { + return mResult == MOD_OK; + } + mResult = svc_file != nullptr ? svc_file->close(mod_ctx, mHandle) : MOD_UNAVAILABLE; + mHandle = 0; + return mResult == MOD_OK; + } + + void reset() { (void)close(); } + +private: + FileStreamHandle mHandle = 0; + ModResult mResult = MOD_UNAVAILABLE; +}; + +inline File open(const std::string& location, FileOpenMode mode = FILE_OPEN_READ) { + if (svc_file == nullptr) { + return {0, MOD_UNAVAILABLE}; + } + FileStreamHandle handle = 0; + const auto result = svc_file->open(mod_ctx, location.c_str(), mode, &handle); + return {handle, result}; +} + +class Buffer { +public: + Buffer() = default; + Buffer(FileBuffer buffer, ModResult result) : mBuffer{buffer}, mResult{result} {} + ~Buffer() { reset(); } + Buffer(const Buffer&) = delete; + Buffer& operator=(const Buffer&) = delete; + Buffer(Buffer&& other) noexcept { *this = std::move(other); } + Buffer& operator=(Buffer&& other) noexcept { + if (this != &other) { + reset(); + mBuffer = other.mBuffer; + mResult = other.mResult; + other.mBuffer = FILE_BUFFER_INIT; + } + return *this; + } + + explicit operator bool() const { return mResult == MOD_OK; } + ModResult result() const { return mResult; } + std::span bytes() const { + return {static_cast(mBuffer.data), mBuffer.size}; + } + void reset() { + if (mBuffer.data != nullptr && svc_file != nullptr) { + svc_file->free(mod_ctx, &mBuffer); + } + mBuffer.data = nullptr; + mBuffer.size = 0; + } + +private: + FileBuffer mBuffer = FILE_BUFFER_INIT; + ModResult mResult = MOD_UNAVAILABLE; +}; + +inline Buffer read_all(const std::string& location) { + FileBuffer buffer = FILE_BUFFER_INIT; + const auto result = svc_file != nullptr ? + svc_file->read_all(mod_ctx, location.c_str(), &buffer) : + MOD_UNAVAILABLE; + return {buffer, result}; +} + +inline ModResult check(const std::string& location) { + return svc_file != nullptr ? svc_file->check(mod_ctx, location.c_str()) : MOD_UNAVAILABLE; +} + +inline std::string display_name(const std::string& location) { + if (svc_file == nullptr) { + return {}; + } + std::array buffer{}; + return svc_file->display_name(mod_ctx, location.c_str(), buffer.data(), + static_cast(buffer.size())) == MOD_OK ? + std::string{buffer.data()} : + std::string{}; +} + +inline ModResult join( + const std::string& folder, const std::string& relativePath, std::string& outLocation) { + outLocation.clear(); + if (svc_file == nullptr) { + return MOD_UNAVAILABLE; + } + const char* location = nullptr; + const auto result = svc_file->join(mod_ctx, folder.c_str(), relativePath.c_str(), &location); + if (result == MOD_OK && location != nullptr) { + outLocation = location; + } + return result; +} + +inline ModResult create_child( + const std::string& folder, const std::string& name, std::string& outLocation) { + outLocation.clear(); + if (svc_file == nullptr) { + return MOD_UNAVAILABLE; + } + const char* location = nullptr; + const auto result = svc_file->create_child(mod_ctx, folder.c_str(), name.c_str(), &location); + if (result == MOD_OK && location != nullptr) { + outLocation = location; + } + return result; +} + +inline ModResult write_all(const std::string& location, std::span bytes) { + if (svc_file == nullptr) { + return MOD_UNAVAILABLE; + } + return svc_file->write_all(mod_ctx, location.c_str(), bytes.data(), bytes.size()); +} + +struct Entry { + std::string name; + std::string location; + bool isDirectory = false; +}; + +inline ModResult list(const std::string& folder, std::vector& outEntries) { + outEntries.clear(); + if (svc_file == nullptr) { + return MOD_UNAVAILABLE; + } + return svc_file->list( + mod_ctx, folder.c_str(), + [](ModContext*, const FileEntry* entry, void* userData) { + if (entry == nullptr) { + return; + } + static_cast*>(userData)->push_back({ + .name = entry->name != nullptr ? entry->name : "", + .location = entry->location != nullptr ? entry->location : "", + .isDirectory = entry->is_directory, + }); + }, + &outEntries); +} + +struct Filter { + std::string name; + std::string pattern; +}; + +struct PickOptions { + std::vector filters; + std::string defaultLocation; +}; + +struct PickResult { + ModResult status = MOD_ERROR; + std::vector locations; + std::string error; +}; + +namespace detail { + +inline std::function pickCallback; + +inline void pick_trampoline(ModContext*, ModResult status, const char* const* locations, + uint32_t locationCount, const char* error, void*) { + PickResult result{.status = status, .error = error != nullptr ? error : ""}; + result.locations.reserve(locationCount); + for (uint32_t i = 0; i < locationCount; ++i) { + if (locations[i] != nullptr) { + result.locations.emplace_back(locations[i]); + } + } + auto callback = std::move(pickCallback); + pickCallback = {}; + if (callback) { + callback(std::move(result)); + } +} + +inline ModResult pick( + const PickOptions& options, std::function callback, bool folder) { + if (svc_file == nullptr) { + return MOD_UNAVAILABLE; + } + if (!callback) { + return MOD_INVALID_ARGUMENT; + } + if (pickCallback) { + return MOD_CONFLICT; + } + std::vector filters; + filters.reserve(options.filters.size()); + for (const auto& filter : options.filters) { + filters.push_back({filter.name.c_str(), filter.pattern.c_str()}); + } + FilePickOptions raw = FILE_PICK_OPTIONS_INIT; + raw.filters = filters.empty() ? nullptr : filters.data(); + raw.filter_count = static_cast(filters.size()); + raw.default_location = + options.defaultLocation.empty() ? nullptr : options.defaultLocation.c_str(); + pickCallback = std::move(callback); + const auto result = folder ? svc_file->pick_folder(mod_ctx, &raw, pick_trampoline, nullptr) : + svc_file->pick_file(mod_ctx, &raw, pick_trampoline, nullptr); + if (result != MOD_OK) { + pickCallback = {}; + } + return result; +} + +} // namespace detail + +inline ModResult pick_file(const PickOptions& options, std::function callback) { + return detail::pick(options, std::move(callback), false); +} + +inline ModResult pick_folder(const PickOptions& options, std::function callback) { + return detail::pick(options, std::move(callback), true); +} + +inline ModResult export_file(const std::string& sourceLocation, const std::string& suggestedName, + std::function callback) { + if (svc_file == nullptr) { + return MOD_UNAVAILABLE; + } + if (!callback) { + return MOD_INVALID_ARGUMENT; + } + if (detail::pickCallback) { + return MOD_CONFLICT; + } + detail::pickCallback = std::move(callback); + const auto result = svc_file->export_file( + mod_ctx, sourceLocation.c_str(), suggestedName.c_str(), detail::pick_trampoline, nullptr); + if (result != MOD_OK) { + detail::pickCallback = {}; + } + return result; +} + +} // namespace mods::file diff --git a/sdk/include/mods/svc/flow.hpp b/sdk/include/mods/svc/flow.hpp index 2b1cb1b594..c7671f69a6 100644 --- a/sdk/include/mods/svc/flow.hpp +++ b/sdk/include/mods/svc/flow.hpp @@ -100,6 +100,7 @@ public: NodeRef next(uint16_t target) const; /* Set a branch node's result targets */ NodeRef results(std::initializer_list targets) const; + NodeRef results(std::span targets) const; uint16_t id() const { return mId; } operator uint16_t() const { return mId; } @@ -153,6 +154,35 @@ public: } return *this; } + GraphBuilder& patch_branch(uint16_t nodeIndex, FlowQueryId query, uint16_t parameter, + std::span targets) { + if (mResult != MOD_OK || targets.empty() || targets.size() > 0xff) { + if (mResult == MOD_OK) { + mResult = MOD_INVALID_ARGUMENT; + } + return *this; + } + uint16_t first = 0; + mResult = svc_flow->add_edges( + mod_ctx, mHandle, targets.data(), static_cast(targets.size()), &first); + if (mResult == MOD_OK) { + patch_node(nodeIndex, + branch(static_cast(targets.size()), query, parameter, first)); + } + return *this; + } + GraphBuilder& patch_event(uint16_t nodeIndex, FlowEventId eventId, + std::array params, uint16_t target) { + if (mResult != MOD_OK) { + return *this; + } + uint16_t edge = 0; + mResult = svc_flow->add_edges(mod_ctx, mHandle, &target, 1, &edge); + if (mResult == MOD_OK) { + patch_node(nodeIndex, event(eventId, edge, params)); + } + return *this; + } Graph commit() { for (const auto& node : mNodes) { @@ -232,7 +262,7 @@ private: } } - void set_results(uint16_t id, std::initializer_list targets) { + void set_results(uint16_t id, std::span targets) { if (mResult != MOD_OK) { return; } @@ -246,7 +276,7 @@ private: node->wired = true; uint16_t first = 0; mResult = svc_flow->add_edges( - mod_ctx, mHandle, targets.begin(), static_cast(targets.size()), &first); + mod_ctx, mHandle, targets.data(), static_cast(targets.size()), &first); if (mResult == MOD_OK) { node->data.bytes[1] = static_cast(targets.size()); write_bits(node->data.bytes + 6, first); @@ -266,6 +296,10 @@ inline NodeRef NodeRef::next(uint16_t target) const { } inline NodeRef NodeRef::results(std::initializer_list targets) const { + return results(std::span{targets.begin(), targets.size()}); +} + +inline NodeRef NodeRef::results(std::span targets) const { if (mBuilder != nullptr) { mBuilder->set_results(mId, targets); } @@ -368,6 +402,10 @@ public: [[nodiscard]] constexpr MessageStyle face_anim(uint8_t value) const { return set_u8(17, value); } + /* INF1 bytes 18-19, normally 0x0400. */ + [[nodiscard]] constexpr MessageStyle trailing_data(uint16_t value) const { + return set_u16(18, value); + } [[nodiscard]] constexpr const MessageEntryData& data() const { return mData; } private: @@ -432,6 +470,9 @@ public: MessageBuilder& camera_attr(uint8_t value) { return style(&MessageStyle::camera_attr, value); } MessageBuilder& talk_anim(uint8_t value) { return style(&MessageStyle::talk_anim, value); } MessageBuilder& face_anim(uint8_t value) { return style(&MessageStyle::face_anim, value); } + MessageBuilder& trailing_data(uint16_t value) { + return style(&MessageStyle::trailing_data, value); + } /* Content builder functions */ MessageBuilder& text(std::string_view value) { @@ -459,7 +500,20 @@ public: } MessageBuilder& text_color(MessageTextColor color) { const auto index = static_cast(color); - return raw_tag(255, 0, {&index, 1}); + return raw_tag(0xFF, 0, {&index, 1}); + } + /* Full 32-bit text color (Dusklight extension) */ + MessageBuilder& text_color(uint32_t rgba) { + std::array arguments{}; + write_bits(arguments.data(), rgba); + return raw_tag(0xFF, 0, arguments); + } + /* Full 32-bit text vertical gradient colors (Dusklight extension) */ + MessageBuilder& text_color(uint32_t upperRgba, uint32_t lowerRgba) { + std::array arguments{}; + write_bits(arguments.data(), upperRgba); + write_bits(arguments.data() + sizeof(upperRgba), lowerRgba); + return raw_tag(0xFF, 0, arguments); } MessageBuilder& text_scale(uint16_t percent) { return timed_tag(255, 1, percent); } MessageBuilder& character_delay(uint16_t frames) { return timed_tag(0, 6, frames); } diff --git a/sdk/include/mods/svc/http.h b/sdk/include/mods/svc/http.h new file mode 100644 index 0000000000..fd4d9a98db --- /dev/null +++ b/sdk/include/mods/svc/http.h @@ -0,0 +1,98 @@ +#pragma once + +#include + +#ifdef __cplusplus +#include +#endif + +#define HTTP_SERVICE_ID "dev.twilitrealm.dusklight.http" +#define HTTP_SERVICE_MAJOR 1u +#define HTTP_SERVICE_MINOR 0u + +/* Handle for an in-flight request. 0 is never a valid handle. */ +typedef uint64_t HttpRequestHandle; + +typedef enum HttpMethod { + HTTP_METHOD_GET = 0, + HTTP_METHOD_POST = 1, + HTTP_METHOD_HEAD = 2, +} HttpMethod; + +/* Transport-level outcome. HTTP status errors are reported through status_code. */ +typedef enum HttpError { + HTTP_ERROR_NONE = 0, + HTTP_ERROR_INVALID_URL = 1, + HTTP_ERROR_UNSUPPORTED_SCHEME = 2, + HTTP_ERROR_TIMEOUT = 3, + HTTP_ERROR_TOO_LARGE = 4, + HTTP_ERROR_CANCELED = 5, + HTTP_ERROR_IO = 6, + HTTP_ERROR_NETWORK = 7, +} HttpError; + +typedef struct HttpHeader { + const char* name; + const char* value; +} HttpHeader; + +typedef struct HttpRequestDesc { + uint32_t struct_size; + HttpMethod method; + const char* url; + const HttpHeader* headers; + uint32_t header_count; + /* Request body; POST only. */ + const void* body; + size_t body_size; + /* Absolute destination under this mod's data_dir or mod_dir, or NULL for an in-memory body. + * GET and POST only. */ + const char* download_path; + uint32_t connect_timeout_ms; /* 0 = 10 seconds */ + uint32_t idle_timeout_ms; /* 0 = 10 seconds without network progress */ + uint32_t total_timeout_ms; /* 0 = no total timeout */ + size_t max_body_bytes; /* 0 = 1 MiB; ignored for downloads */ +} HttpRequestDesc; + +#define HTTP_REQUEST_DESC_INIT \ + {sizeof(HttpRequestDesc), HTTP_METHOD_GET, NULL, NULL, 0u, NULL, 0u, NULL, 0u, 0u, 0u, 0u} + +/* Snapshot valid only for the duration of the completion callback. */ +typedef struct HttpResult { + uint32_t struct_size; + HttpError error; + const char* error_message; + int32_t status_code; + const HttpHeader* headers; + uint32_t header_count; + const void* body; + size_t body_size; + /* Published absolute destination, or NULL unless a download succeeded. */ + const char* download_path; +} HttpResult; + +/* Runs on the game thread exactly once, unless the calling mod begins deactivation first. */ +typedef void (*HttpCompleteFn)( + ModContext* ctx, HttpRequestHandle request, const HttpResult* result, void* user_data); + +typedef struct HttpProgress { + uint32_t struct_size; + uint64_t completed_bytes; + uint64_t total_bytes; + bool total_known; +} HttpProgress; + +#define HTTP_PROGRESS_INIT {sizeof(HttpProgress), 0u, 0u, false} + +typedef struct HttpService { + ServiceHeader header; + + /* Starts an asynchronous HTTPS request. */ + ModResult (*request)(ModContext* ctx, const HttpRequestDesc* desc, HttpCompleteFn fn, + void* user_data, HttpRequestHandle* out_handle); + ModResult (*progress)(ModContext* ctx, HttpRequestHandle request, HttpProgress* out_progress); + /* Requests cancellation. The completion callback still runs if the mod remains active. */ + ModResult (*cancel)(ModContext* ctx, HttpRequestHandle request); +} HttpService; + +MOD_DECLARE_SERVICE(HttpService, svc_http, HTTP_SERVICE_ID, HTTP_SERVICE_MAJOR, HTTP_SERVICE_MINOR); diff --git a/sdk/include/mods/svc/http.hpp b/sdk/include/mods/svc/http.hpp new file mode 100644 index 0000000000..906bf3d0d2 --- /dev/null +++ b/sdk/include/mods/svc/http.hpp @@ -0,0 +1,204 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mods::http { + +struct Header { + std::string name; + std::string value; +}; + +struct Request { + HttpMethod method = HTTP_METHOD_GET; + std::string url; + std::vector
headers; + std::string body; + std::string downloadPath; + uint32_t connectTimeoutMs = 0; + uint32_t idleTimeoutMs = 0; + uint32_t totalTimeoutMs = 0; + size_t maxBodyBytes = 0; +}; + +struct Response { + HttpError error = HTTP_ERROR_NETWORK; + std::string errorMessage; + int statusCode = 0; + std::vector
headers; + std::vector body; + std::string downloadPath; + + bool ok() const { return error == HTTP_ERROR_NONE && statusCode >= 200 && statusCode < 300; } + + const std::string* header(std::string_view name) const { + const auto equal = [](std::string_view left, std::string_view right) { + return left.size() == right.size() && + std::equal(left.begin(), left.end(), right.begin(), [](char a, char b) { + return std::tolower(static_cast(a)) == + std::tolower(static_cast(b)); + }); + }; + const auto iter = std::find_if(headers.begin(), headers.end(), + [&](const Header& value) { return equal(value.name, name); }); + return iter != headers.end() ? &iter->value : nullptr; + } +}; + +namespace detail { + +struct Completion { + HttpRequestHandle handle = 0; + std::function callback; +}; + +inline std::unordered_map> completions; + +inline void complete(ModContext*, HttpRequestHandle handle, const HttpResult* raw, void* userData) { + const auto iter = completions.find(handle); + if (iter == completions.end() || iter->second.get() != userData) { + return; + } + auto completion = std::move(iter->second); + completions.erase(iter); + + Response response; + if (raw != nullptr) { + response.error = raw->error; + response.errorMessage = raw->error_message != nullptr ? raw->error_message : ""; + response.statusCode = raw->status_code; + response.headers.reserve(raw->header_count); + for (uint32_t i = 0; i < raw->header_count; ++i) { + response.headers.push_back({ + .name = raw->headers[i].name != nullptr ? raw->headers[i].name : "", + .value = raw->headers[i].value != nullptr ? raw->headers[i].value : "", + }); + } + if (raw->body != nullptr && raw->body_size != 0) { + const auto* begin = static_cast(raw->body); + response.body.assign(begin, begin + raw->body_size); + } + response.downloadPath = raw->download_path != nullptr ? raw->download_path : ""; + } + if (completion->callback) { + completion->callback(std::move(response)); + } +} + +} // namespace detail + +class Pending { +public: + Pending() = default; + Pending(HttpRequestHandle handle, ModResult result) : mHandle{handle}, mResult{result} {} + ~Pending() { reset(); } + Pending(const Pending&) = delete; + Pending& operator=(const Pending&) = delete; + Pending(Pending&& other) noexcept { *this = std::move(other); } + Pending& operator=(Pending&& other) noexcept { + if (this != &other) { + reset(); + mHandle = std::exchange(other.mHandle, 0); + mResult = other.mResult; + } + return *this; + } + + explicit operator bool() const { + if (mResult != MOD_OK || mHandle == 0 || svc_http == nullptr || + !detail::completions.contains(mHandle)) + { + return false; + } + HttpProgress value = HTTP_PROGRESS_INIT; + return svc_http->progress(mod_ctx, mHandle, &value) == MOD_OK; + } + ModResult result() const { return mResult; } + HttpRequestHandle handle() const { return mHandle; } + + HttpProgress progress() const { + HttpProgress value = HTTP_PROGRESS_INIT; + if (mHandle != 0 && svc_http != nullptr) { + svc_http->progress(mod_ctx, mHandle, &value); + } + return value; + } + + void cancel() { + if (mHandle != 0 && svc_http != nullptr) { + if (svc_http->cancel(mod_ctx, mHandle) != MOD_OK) { + detail::completions.erase(mHandle); + } + } + } + + void detach() { mHandle = 0; } + +private: + void reset() { + cancel(); + mHandle = 0; + } + + HttpRequestHandle mHandle = 0; + ModResult mResult = MOD_UNAVAILABLE; +}; + +inline Pending request(const Request& request, std::function callback) { + if (svc_http == nullptr) { + return {0, MOD_UNAVAILABLE}; + } + if (!callback) { + return {0, MOD_INVALID_ARGUMENT}; + } + + if (request.headers.size() > std::numeric_limits::max()) { + return {0, MOD_INVALID_ARGUMENT}; + } + std::vector headers; + headers.reserve(request.headers.size()); + for (const auto& header : request.headers) { + headers.push_back({ + .name = header.name.c_str(), + .value = header.value.c_str(), + }); + } + HttpRequestDesc desc = HTTP_REQUEST_DESC_INIT; + desc.method = request.method; + desc.url = request.url.c_str(); + desc.headers = headers.empty() ? nullptr : headers.data(); + desc.header_count = static_cast(headers.size()); + desc.body = request.body.empty() ? nullptr : request.body.data(); + desc.body_size = request.body.size(); + desc.download_path = request.downloadPath.empty() ? nullptr : request.downloadPath.c_str(); + desc.connect_timeout_ms = request.connectTimeoutMs; + desc.idle_timeout_ms = request.idleTimeoutMs; + desc.total_timeout_ms = request.totalTimeoutMs; + desc.max_body_bytes = request.maxBodyBytes; + + auto completion = std::make_unique(); + auto* userData = completion.get(); + completion->callback = std::move(callback); + HttpRequestHandle handle = 0; + const auto result = svc_http->request(mod_ctx, &desc, detail::complete, userData, &handle); + if (result != MOD_OK) { + return {0, result}; + } + completion->handle = handle; + detail::completions.emplace(handle, std::move(completion)); + return {handle, result}; +} + +} // namespace mods::http diff --git a/sdk/include/mods/svc/item.h b/sdk/include/mods/svc/item.h index 1f2c3d3b43..ff4f31b547 100644 --- a/sdk/include/mods/svc/item.h +++ b/sdk/include/mods/svc/item.h @@ -8,7 +8,7 @@ #define ITEM_SERVICE_ID "dev.twilitrealm.dusklight.item" #define ITEM_SERVICE_MAJOR 2u -#define ITEM_SERVICE_MINOR 0u +#define ITEM_SERVICE_MINOR 3u /* 0 is never a valid handle. */ typedef uint64_t ItemCheckHandle; @@ -31,11 +31,19 @@ typedef struct ItemCheckInfo { const void* giver_actor; /* fopAc_ac_c*, or NULL when unavailable */ uint8_t vanilla_item; uint8_t current_item; + uint8_t current_display_item; + bool was_resolved; } ItemCheckInfo; -/* Return true and write out_item to replace current_item, or false to leave it unchanged. */ +typedef struct ItemCheckResolution { + uint8_t item; + uint8_t display_item; /* leave unset (0xFF/NONE) to use the item */ + bool was_resolved; +} ItemCheckResolution; + +/* Return true and write out_result to replace the result, or false to leave it unchanged. */ typedef bool (*ItemCheckResolveFn)( - ModContext* ctx, const ItemCheckInfo* info, uint8_t* out_item, void* user_data); + ModContext* ctx, const ItemCheckInfo* info, ItemCheckResolution* out_result, void* user_data); typedef enum ItemGiveOrigin { ITEM_GIVE_ORIGIN_GAME = 0, @@ -91,6 +99,13 @@ typedef struct ItemService { ModContext* ctx, ItemGiveObserveFn fn, void* user_data, ItemGiveHandle* out_handle); ModResult (*unobserve_gives)(ModContext* ctx, ItemGiveHandle handle); + + /* Minor version 2 */ + + /* Resolve a live preview (item + display item) without granting an item or notifying give + * observers. */ + ModResult (*resolve_check_full)(ModContext* ctx, const char* name, uint8_t vanilla_item, + ItemCheckResolution* out_resolution); } ItemService; MOD_DECLARE_SERVICE(ItemService, svc_item, ITEM_SERVICE_ID, ITEM_SERVICE_MAJOR, ITEM_SERVICE_MINOR); diff --git a/sdk/include/mods/svc/message.h b/sdk/include/mods/svc/message.h index 172dce4895..b170e6f09b 100644 --- a/sdk/include/mods/svc/message.h +++ b/sdk/include/mods/svc/message.h @@ -8,7 +8,7 @@ #define MESSAGE_SERVICE_ID "dev.twilitrealm.dusklight.message" #define MESSAGE_SERVICE_MAJOR 1u -#define MESSAGE_SERVICE_MINOR 0u +#define MESSAGE_SERVICE_MINOR 1u typedef uint16_t MessageId; typedef uint64_t MessageHandle; diff --git a/sdk/include/mods/svc/net.h b/sdk/include/mods/svc/net.h new file mode 100644 index 0000000000..2c5e9a531a --- /dev/null +++ b/sdk/include/mods/svc/net.h @@ -0,0 +1,145 @@ +#pragma once + +#include + +#ifdef __cplusplus +#include +#endif + +#define NET_SERVICE_ID "dev.twilitrealm.dusklight.net" +#define NET_SERVICE_MAJOR 1u +#define NET_SERVICE_MINOR 0u + +/** 0 is never a valid handle. */ +typedef uint64_t NetHandle; + +typedef enum NetError { + NET_ERROR_NONE = 0, + NET_ERROR_INVALID_ENDPOINT = 1, + NET_ERROR_RESOLVE = 2, + NET_ERROR_TIMEOUT = 3, + NET_ERROR_REFUSED = 4, + NET_ERROR_UNREACHABLE = 5, + NET_ERROR_RESET = 6, + NET_ERROR_ADDRESS_IN_USE = 7, + NET_ERROR_PERMISSION = 8, + NET_ERROR_TOO_LARGE = 9, + NET_ERROR_CANCELED = 10, + NET_ERROR_NETWORK = 11, +} NetError; + +#define NET_ENDPOINT_MAX 80 +/** NUL-terminated tcp://host:port or udp://host:port endpoint. */ +typedef struct NetEndpoint { + char text[NET_ENDPOINT_MAX]; +} NetEndpoint; + +typedef struct NetConnectDesc { + uint32_t struct_size; + /** TCP endpoint. Hostnames and IP literals are accepted. */ + const char* endpoint; + /** 0 defaults to 10 seconds. Resolution is included. */ + uint32_t connect_timeout_ms; + /** 0 defaults to 5 seconds for flush and peer EOF. */ + uint32_t close_timeout_ms; + /** 0 defaults to 1 MiB. Maximum of 8 MiB. */ + size_t max_send_queue_bytes; + bool no_delay; + /** Sampled when each event is polled. */ + void* user_data; +} NetConnectDesc; + +#define NET_CONNECT_DESC_INIT {sizeof(NetConnectDesc), NULL, 0u, 0u, 0u, true, NULL} + +typedef struct NetListenDesc { + uint32_t struct_size; + /** TCP endpoint with an IP literal. Port 0 requests an ephemeral port. */ + const char* bind; + uint32_t close_timeout_ms; + size_t max_send_queue_bytes; + bool no_delay; + void* user_data; +} NetListenDesc; + +#define NET_LISTEN_DESC_INIT {sizeof(NetListenDesc), NULL, 0u, 0u, true, NULL} + +typedef struct NetDatagramDesc { + uint32_t struct_size; + /** UDP endpoint with an IP literal. Port 0 requests an ephemeral port. */ + const char* bind; + size_t max_send_queue_bytes; + void* user_data; +} NetDatagramDesc; + +#define NET_DATAGRAM_DESC_INIT {sizeof(NetDatagramDesc), NULL, 0u, NULL} + +typedef enum NetEventType { + NET_EVENT_NONE = 0, + NET_EVENT_CONNECTED = 1, + NET_EVENT_ACCEPTED = 2, + NET_EVENT_STREAM_DATA = 3, + NET_EVENT_DATAGRAM = 4, + NET_EVENT_DROPPED = 5, + NET_EVENT_RESOLVED = 6, + NET_EVENT_CLOSED = 7, +} NetEventType; + +typedef struct NetEvent { + uint32_t struct_size; + NetEventType type; + /** Source handle. A CLOSED or RESOLVED handle is invalid after poll_event returns it. */ + NetHandle handle; + void* user_data; + NetHandle accepted; + /** Peer, datagram source, or resolved endpoint as applicable. */ + NetEndpoint endpoint; + /** Valid until this mod's next poll_event call or deactivation. */ + const void* data; + size_t size; + uint32_t dropped; + NetError error; + /** Never NULL. Valid until this mod's next poll_event call or deactivation. */ + const char* error_message; +} NetEvent; + +#define NET_EVENT_INIT \ + {sizeof(NetEvent), NET_EVENT_NONE, 0u, NULL, 0u, {{0}}, NULL, 0u, 0u, NET_ERROR_NONE, ""} + +typedef struct NetStats { + uint32_t struct_size; + size_t queued_send_bytes; + uint64_t inbound_dropped; + uint64_t send_failures; + uint64_t bytes_sent; + uint64_t bytes_received; +} NetStats; + +#define NET_STATS_INIT {sizeof(NetStats), 0u, 0u, 0u, 0u, 0u} + +typedef struct NetService { + ServiceHeader header; + + /** Starts an asynchronous TCP connection. */ + ModResult (*connect)(ModContext* ctx, const NetConnectDesc* desc, NetHandle* out_handle); + /** Opens a TCP listener and returns its local endpoint. */ + ModResult (*listen)(ModContext* ctx, const NetListenDesc* desc, NetHandle* out_handle, + NetEndpoint* out_local, NetError* out_error); + /** Opens a UDP socket and returns its local endpoint. */ + ModResult (*open_datagram)(ModContext* ctx, const NetDatagramDesc* desc, NetHandle* out_handle, + NetEndpoint* out_local, NetError* out_error); + /** Resolves a TCP or UDP endpoint asynchronously. */ + ModResult (*resolve)( + ModContext* ctx, const char* endpoint, void* user_data, NetHandle* out_handle); + /** Returns MOD_OK and NET_EVENT_NONE when the queue is empty. */ + ModResult (*poll_event)(ModContext* ctx, NetEvent* out_event); + /** Copies bytes to a connected stream's outbound queue. */ + ModResult (*send)(ModContext* ctx, NetHandle stream, const void* data, size_t size); + /** Copies one datagram for a literal UDP destination. The maximum size is 65,507 bytes. */ + ModResult (*send_to)( + ModContext* ctx, NetHandle socket, const char* endpoint, const void* data, size_t size); + ModResult (*set_user_data)(ModContext* ctx, NetHandle handle, void* user_data); + ModResult (*stats)(ModContext* ctx, NetHandle handle, NetStats* out_stats); + ModResult (*close)(ModContext* ctx, NetHandle handle); +} NetService; + +MOD_DECLARE_SERVICE(NetService, svc_net, NET_SERVICE_ID, NET_SERVICE_MAJOR, NET_SERVICE_MINOR); diff --git a/sdk/include/mods/svc/net.hpp b/sdk/include/mods/svc/net.hpp new file mode 100644 index 0000000000..44edf4001b --- /dev/null +++ b/sdk/include/mods/svc/net.hpp @@ -0,0 +1,189 @@ +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace mods::net { + +class Socket { +public: + Socket() = default; + Socket(NetHandle handle, ModResult result) : mHandle{handle}, mResult{result} {} + ~Socket() { reset(); } + + Socket(const Socket&) = delete; + Socket& operator=(const Socket&) = delete; + Socket(Socket&& other) noexcept { *this = std::move(other); } + Socket& operator=(Socket&& other) noexcept { + if (this != &other) { + reset(); + mHandle = std::exchange(other.mHandle, 0); + mResult = other.mResult; + } + return *this; + } + + explicit operator bool() const { return mResult == MOD_OK && mHandle != 0; } + + ModResult result() const { return mResult; } + NetHandle handle() const { return mHandle; } + + ModResult send(std::span bytes) const { + return svc_net != nullptr && mHandle != 0 ? + svc_net->send(mod_ctx, mHandle, bytes.data(), bytes.size()) : + MOD_UNAVAILABLE; + } + + ModResult send_to(std::string_view endpoint, std::span bytes) const { + if (svc_net == nullptr || mHandle == 0) { + return MOD_UNAVAILABLE; + } + const std::string endpointText{endpoint}; + return svc_net->send_to(mod_ctx, mHandle, endpointText.c_str(), bytes.data(), bytes.size()); + } + + std::optional stats() const { + if (svc_net == nullptr || mHandle == 0) { + return std::nullopt; + } + NetStats value = NET_STATS_INIT; + if (svc_net->stats(mod_ctx, mHandle, &value) != MOD_OK) { + return std::nullopt; + } + return value; + } + + ModResult set_user_data(void* userData) const { + return svc_net != nullptr && mHandle != 0 ? + svc_net->set_user_data(mod_ctx, mHandle, userData) : + MOD_UNAVAILABLE; + } + + ModResult close() { + if (mHandle == 0) { + return mResult == MOD_OK ? MOD_OK : MOD_UNAVAILABLE; + } + mResult = svc_net != nullptr ? svc_net->close(mod_ctx, mHandle) : MOD_UNAVAILABLE; + mHandle = 0; + return mResult; + } + + void detach() { mHandle = 0; } + +private: + void reset() { (void)close(); } + + NetHandle mHandle = 0; + ModResult mResult = MOD_UNAVAILABLE; +}; + +struct BindOutcome { + std::string local; + NetError error = NET_ERROR_NONE; +}; + +inline Socket connect(std::string_view endpoint, NetConnectDesc options = NET_CONNECT_DESC_INIT) { + if (svc_net == nullptr) { + return {0, MOD_UNAVAILABLE}; + } + const std::string endpointText{endpoint}; + options.struct_size = sizeof(options); + options.endpoint = endpointText.c_str(); + NetHandle handle = 0; + const ModResult result = svc_net->connect(mod_ctx, &options, &handle); + return {handle, result}; +} + +inline Socket listen(std::string_view bind, BindOutcome* out = nullptr, + NetListenDesc options = NET_LISTEN_DESC_INIT) { + if (svc_net == nullptr) { + return {0, MOD_UNAVAILABLE}; + } + const std::string bindText{bind}; + options.struct_size = sizeof(options); + options.bind = bindText.c_str(); + NetHandle handle = 0; + NetEndpoint local{}; + NetError error = NET_ERROR_NONE; + const ModResult result = svc_net->listen(mod_ctx, &options, &handle, &local, &error); + if (out != nullptr) { + *out = {.local = local.text, .error = error}; + } + return {handle, result}; +} + +inline Socket open_datagram(std::string_view bind, BindOutcome* out = nullptr, + NetDatagramDesc options = NET_DATAGRAM_DESC_INIT) { + if (svc_net == nullptr) { + return {0, MOD_UNAVAILABLE}; + } + const std::string bindText{bind}; + options.struct_size = sizeof(options); + options.bind = bindText.c_str(); + NetHandle handle = 0; + NetEndpoint local{}; + NetError error = NET_ERROR_NONE; + const ModResult result = svc_net->open_datagram(mod_ctx, &options, &handle, &local, &error); + if (out != nullptr) { + *out = {.local = local.text, .error = error}; + } + return {handle, result}; +} + +inline Socket resolve(std::string_view endpoint, void* userData = nullptr) { + if (svc_net == nullptr) { + return {0, MOD_UNAVAILABLE}; + } + const std::string endpointText{endpoint}; + NetHandle handle = 0; + const ModResult result = svc_net->resolve(mod_ctx, endpointText.c_str(), userData, &handle); + return {handle, result}; +} + +inline Socket adopt(NetHandle accepted) { + return {accepted, accepted != 0 ? MOD_OK : MOD_INVALID_ARGUMENT}; +} + +struct Event { + NetEventType type = NET_EVENT_NONE; + NetHandle handle = 0; + void* userData = nullptr; + NetHandle accepted = 0; + std::string_view endpoint; + std::span data; + uint32_t dropped = 0; + NetError error = NET_ERROR_NONE; + std::string_view message; +}; + +inline bool poll(Event& out) { + out = {}; + if (svc_net == nullptr) { + return false; + } + NetEvent raw = NET_EVENT_INIT; + if (svc_net->poll_event(mod_ctx, &raw) != MOD_OK || raw.type == NET_EVENT_NONE) { + return false; + } + out.type = raw.type; + out.handle = raw.handle; + out.userData = raw.user_data; + out.accepted = raw.accepted; + out.endpoint = raw.endpoint.text; + if (raw.data != nullptr && raw.size != 0) { + out.data = {static_cast(raw.data), raw.size}; + } + out.dropped = raw.dropped; + out.error = raw.error; + out.message = raw.error_message != nullptr ? raw.error_message : ""; + return true; +} + +} // namespace mods::net diff --git a/sdk/include/mods/svc/ui.h b/sdk/include/mods/svc/ui.h index 38d67e3192..d0badfda05 100644 --- a/sdk/include/mods/svc/ui.h +++ b/sdk/include/mods/svc/ui.h @@ -2,14 +2,15 @@ #include #include +#include #ifdef __cplusplus #include #endif #define UI_SERVICE_ID "dev.twilitrealm.dusklight.ui" -#define UI_SERVICE_MAJOR 1u -#define UI_SERVICE_MINOR 4u +#define UI_SERVICE_MAJOR 2u +#define UI_SERVICE_MINOR 2u /* * UI primitives: a panel inside the host Mods window, mod-owned windows, dialogs, toasts, @@ -18,9 +19,9 @@ * 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. + * destroys the previous build's elements, so re-acquire handles in each build callback and use them + * only until the next rebuild. Strings are UTF-8 and, in both directions, only valid for the + * duration of the call. */ /* 0 is never a valid handle. */ @@ -53,6 +54,7 @@ typedef enum UiControlKind { UI_CONTROL_SELECT = 4, /* one of `options`; the value is the option index */ UI_CONTROL_COLOR = 5, /* RGB/RGBA color string with a picker */ UI_CONTROL_GROUP = 6, /* navigation row (on_pressed) */ + UI_CONTROL_FILE_PICKER = 7, /* file/folder picker with an opaque string location */ } UiControlKind; typedef enum UiControlBinding { @@ -62,14 +64,20 @@ typedef enum UiControlBinding { /* 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 and COLOR = string. Float vars are not bindable; use callbacks. */ + * SELECT = int, STRING, COLOR and FILE_PICKER = 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 - * and COLOR read 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 enum UiStringSetMode { + UI_STRING_SET_ON_COMMIT = 0, /* invokes `set` when input is committed */ + UI_STRING_SET_ON_CHANGE = 1, /* invokes `set` on every text change (e.g. while typing) */ +} UiStringSetMode; + +/* Tagged by the control's kind: TOGGLE reads bool_value, NUMBER and SELECT read int_value, STRING, + * COLOR and FILE_PICKER read 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; @@ -102,7 +110,7 @@ typedef struct UiControlDesc { /* 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. */ + /* Passed to every callback. */ void* user_data; /* NUMBER: inclusive clamp range and step. min == max means the defaults (0 .. INT32_MAX); step * < 1 means 1. */ @@ -120,12 +128,48 @@ typedef struct UiControlDesc { /* COLOR: optional RRGGBB/RRGGBBAA values for presets. "rainbow" is a special value. */ const char* const* color_presets; size_t color_preset_count; - bool color_alpha; /* COLOR: use RRGGBBAA values instead of RRGGBB */ + bool color_alpha; /* COLOR: use RRGGBBAA values instead of RRGGBB */ + UiPredicateFn is_selected; /* BUTTON/GROUP: optional selected state */ + UiStringSetMode string_set_mode; /* STRING: when to invoke the setter */ + /* FILE_PICKER: optional file filters and folder selection mode. */ + const FileFilter* file_filters; + size_t file_filter_count; + bool directory_mode; } 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, NULL, 0u, false} + NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL, 0u, 0, NULL, 0u, false, NULL, \ + UI_STRING_SET_ON_COMMIT, NULL, 0u, false} + +typedef uint64_t UiListHandle; + +/* Must be initialized with UI_LIST_ITEM_INIT */ +typedef struct UiListItem { + uint32_t struct_size; + uint64_t key; /* required; unique, stable item key */ + const char* label; /* required; visible item text */ +} UiListItem; + +#define UI_LIST_ITEM_INIT {sizeof(UiListItem), 0u, NULL} + +typedef void (*UiListPressedFn)( + ModContext* ctx, UiListHandle list, uint64_t item_key, void* user_data); +typedef bool (*UiListPredicateFn)( + ModContext* ctx, UiListHandle list, uint64_t item_key, void* user_data); + +/* Must be initialized with UI_LIST_DESC_INIT */ +typedef struct UiListDesc { + uint32_t struct_size; + const UiListItem* items; /* optional; initial set of items */ + size_t item_count; + UiListPressedFn on_pressed; /* required */ + UiListPredicateFn is_selected; /* optional; polled only for render-visible rows */ + UiListPredicateFn is_disabled; /* optional; polled only for render-visible rows */ + void* user_data; +} UiListDesc; + +#define UI_LIST_DESC_INIT {sizeof(UiListDesc), NULL, 0u, NULL, NULL, NULL, NULL} /* Build pane contents. A non-MOD_OK result fails the mod. */ typedef ModResult (*UiPaneBuildFn)( @@ -196,15 +240,17 @@ typedef struct UiWindowDesc { 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 { + uint32_t struct_size; const char* label; /* required */ UiDialogActionFn on_pressed; void* user_data; - bool keep_open; /* false = the dialog closes after on_pressed returns */ + bool keep_open; /* false = the dialog closes after on_pressed returns */ + UiPredicateFn is_disabled; /* optional; polled every frame while the dialog is visible */ } UiDialogAction; +#define UI_DIALOG_ACTION_INIT {sizeof(UiDialogAction), NULL, NULL, NULL, false, NULL} + typedef struct UiDialogDesc { uint32_t struct_size; const char* title; /* plain text; required */ @@ -220,8 +266,7 @@ typedef struct UiDialogDesc { UiDialogActionFn on_dismiss; void* user_data; /* passed to build and on_dismiss */ /* Optional content builder. The pane is rendered below body_rml and above the actions. Its - * handle and all child element handles remain valid until the dialog closes. - * Added in UiService minor version 4. */ + * handle and all child element handles remain valid until the dialog closes. */ UiPaneBuildFn build; } UiDialogDesc; @@ -268,6 +313,10 @@ typedef struct UiService { ModContext* ctx, UiElementHandle pane, float value, UiElementHandle* out_elem); ModResult (*pane_add_control)(ModContext* ctx, UiElementHandle pane, const UiControlDesc* desc, UiElementHandle* out_elem); + /* Add a group button to one pane that builds controls in its paired pane. + * The panes must be the left and right handles from the same UiTabBuildFn call. */ + ModResult (*pane_add_group)(ModContext* ctx, UiElementHandle group_pane, + UiElementHandle target_pane, const UiGroupDesc* desc, UiElementHandle* out_elem); /* Element updates. The handle kind must match the setter (text/rml on text * rows, progress on progress bars). */ @@ -289,9 +338,6 @@ typedef struct UiService { 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). */ @@ -318,18 +364,16 @@ typedef struct UiService { /* Enqueue a toast notification. */ ModResult (*push_toast)(ModContext* ctx, const UiToastDesc* desc); - /* Minor version 2 */ - ModResult (*get_clipboard_text)( ModContext* ctx, char* buffer, size_t bufferSize, size_t* outLength); ModResult (*set_clipboard_text)(ModContext* ctx, const char* text); - /* Minor version 3 */ - - /* Add a group button to one pane that builds controls in its paired pane. - * The panes must be the left and right handles from the same UiTabBuildFn call. */ - ModResult (*pane_add_group)(ModContext* ctx, UiElementHandle group_pane, - UiElementHandle target_pane, const UiGroupDesc* desc, UiElementHandle* out_elem); + /* A scrollable virtualized list of items. */ + ModResult (*pane_add_list)( + ModContext* ctx, UiElementHandle pane, const UiListDesc* desc, UiListHandle* out_list); + /* Replace all items in a list with a new set. */ + ModResult (*list_set_items)( + ModContext* ctx, UiListHandle list, const UiListItem* items, size_t item_count); } UiService; MOD_DECLARE_SERVICE(UiService, svc_ui, UI_SERVICE_ID, UI_SERVICE_MAJOR, UI_SERVICE_MINOR); diff --git a/sdk/include/mods/svc/websocket.h b/sdk/include/mods/svc/websocket.h new file mode 100644 index 0000000000..bfc12d8fca --- /dev/null +++ b/sdk/include/mods/svc/websocket.h @@ -0,0 +1,107 @@ +#pragma once + +#include +#include + +#ifdef __cplusplus +#include +#endif + +#define WEBSOCKET_SERVICE_ID "dev.twilitrealm.dusklight.websocket" +#define WEBSOCKET_SERVICE_MAJOR 1u +#define WEBSOCKET_SERVICE_MINOR 0u + +/** Generational connection handle. Zero is never valid. */ +typedef uint64_t WebSocketHandle; + +/** Connection outcome. Callers must tolerate values added by later service minors. */ +typedef enum WebSocketError { + WEBSOCKET_ERROR_NONE = 0, + WEBSOCKET_ERROR_INVALID_URL = 1, + WEBSOCKET_ERROR_UNSUPPORTED_SCHEME = 2, + WEBSOCKET_ERROR_TIMEOUT = 3, + WEBSOCKET_ERROR_TOO_LARGE = 4, + WEBSOCKET_ERROR_CANCELED = 5, + WEBSOCKET_ERROR_NETWORK = 6, + WEBSOCKET_ERROR_PROTOCOL = 7, + WEBSOCKET_ERROR_HANDSHAKE = 8, +} WebSocketError; + +typedef enum WebSocketMessageKind { + WEBSOCKET_MESSAGE_TEXT = 0, + WEBSOCKET_MESSAGE_BINARY = 1, +} WebSocketMessageKind; + +typedef struct WebSocketConnectDesc { + uint32_t struct_size; + /** wss:// URL, or ws:// for localhost, 127.0.0.1, or [::1]. */ + const char* url; + /** Request headers. WebSocket handshake headers and User-Agent are reserved. */ + const HttpHeader* headers; + uint32_t header_count; + const char* const* protocols; + uint32_t protocol_count; + uint32_t connect_timeout_ms; + uint32_t close_timeout_ms; + uint32_t keepalive_interval_ms; + /** 0 defaults to 1 MiB. Maximum of 16 MiB. */ + size_t max_message_bytes; + /** Passed in every event. */ + void* user_data; +} WebSocketConnectDesc; + +#define WEBSOCKET_CONNECT_DESC_INIT \ + {sizeof(WebSocketConnectDesc), NULL, NULL, 0u, NULL, 0u, 0u, 0u, 0u, 0u, NULL} + +typedef enum WebSocketEventType { + WEBSOCKET_EVENT_NONE = 0, + WEBSOCKET_EVENT_OPEN = 1, + WEBSOCKET_EVENT_MESSAGE = 2, + WEBSOCKET_EVENT_CLOSED = 3, +} WebSocketEventType; + +typedef struct WebSocketEvent { + uint32_t struct_size; + WebSocketEventType type; + WebSocketHandle ws; + void* user_data; + + const char* protocol; + /** Handshake response headers for OPEN or a handshake-rejected CLOSED event. */ + const HttpHeader* headers; + uint32_t header_count; + + WebSocketMessageKind message_kind; + /** Valid until this mod's next poll_event call or deactivation. */ + const void* data; + size_t size; + + WebSocketError error; + /** Never NULL. Valid until this mod's next poll_event call or deactivation. */ + const char* error_message; + int32_t handshake_status; + uint16_t close_code; + const char* close_reason; +} WebSocketEvent; + +#define WEBSOCKET_EVENT_INIT \ + {sizeof(WebSocketEvent), WEBSOCKET_EVENT_NONE, 0u, NULL, "", NULL, 0u, WEBSOCKET_MESSAGE_TEXT, \ + NULL, 0u, WEBSOCKET_ERROR_NONE, "", 0, 0u, ""} + +typedef struct WebSocketService { + ServiceHeader header; + + /** Starts a connection. */ + ModResult (*connect)( + ModContext* ctx, const WebSocketConnectDesc* desc, WebSocketHandle* out_handle); + /** Returns MOD_OK and WEBSOCKET_EVENT_NONE when the queue is empty. */ + ModResult (*poll_event)(ModContext* ctx, WebSocketEvent* out_event); + /** Copies a message into the outbound queue. */ + ModResult (*send)(ModContext* ctx, WebSocketHandle ws, WebSocketMessageKind kind, + const void* data, size_t size); + /** Code 0 defaults to 1000; accepted: 1000, 1001, and 3000-4999. */ + ModResult (*close)(ModContext* ctx, WebSocketHandle ws, uint16_t code, const char* reason); +} WebSocketService; + +MOD_DECLARE_SERVICE(WebSocketService, svc_websocket, WEBSOCKET_SERVICE_ID, WEBSOCKET_SERVICE_MAJOR, + WEBSOCKET_SERVICE_MINOR); diff --git a/sdk/include/mods/svc/websocket.hpp b/sdk/include/mods/svc/websocket.hpp new file mode 100644 index 0000000000..57d8b37005 --- /dev/null +++ b/sdk/include/mods/svc/websocket.hpp @@ -0,0 +1,172 @@ +#pragma once + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace mods::ws { + +struct Options { + std::string url; + std::vector headers; + std::vector protocols; + uint32_t connectTimeoutMs = 0; + uint32_t closeTimeoutMs = 0; + uint32_t keepaliveIntervalMs = 0; + size_t maxMessageBytes = 0; + void* userData = nullptr; +}; + +class Connection { +public: + Connection() = default; + Connection(WebSocketHandle handle, ModResult result) : mHandle{handle}, mResult{result} {} + ~Connection() { reset(); } + + Connection(const Connection&) = delete; + Connection& operator=(const Connection&) = delete; + Connection(Connection&& other) noexcept { *this = std::move(other); } + Connection& operator=(Connection&& other) noexcept { + if (this != &other) { + reset(); + mHandle = std::exchange(other.mHandle, 0); + mResult = other.mResult; + } + return *this; + } + + explicit operator bool() const { return mResult == MOD_OK && mHandle != 0; } + + ModResult result() const { return mResult; } + WebSocketHandle handle() const { return mHandle; } + + ModResult send(WebSocketMessageKind kind, std::span bytes) const { + return svc_websocket != nullptr && mHandle != 0 ? + svc_websocket->send(mod_ctx, mHandle, kind, bytes.data(), bytes.size()) : + MOD_UNAVAILABLE; + } + + ModResult send_text(std::string_view text) const { + return svc_websocket != nullptr && mHandle != 0 ? + svc_websocket->send( + mod_ctx, mHandle, WEBSOCKET_MESSAGE_TEXT, text.data(), text.size()) : + MOD_UNAVAILABLE; + } + + ModResult send_binary(std::span bytes) const { + return send(WEBSOCKET_MESSAGE_BINARY, bytes); + } + + ModResult close(uint16_t code = 1000, std::string_view reason = {}) { + if (svc_websocket == nullptr || mHandle == 0) { + return MOD_UNAVAILABLE; + } + const std::string reasonText{reason}; + mResult = svc_websocket->close(mod_ctx, mHandle, code, reasonText.c_str()); + if (mResult == MOD_OK) { + mHandle = 0; + } + return mResult; + } + + void detach() { mHandle = 0; } + +private: + void reset() { + if (mHandle != 0) { + (void)close(1001, "Connection owner released"); + mHandle = 0; + } + } + + WebSocketHandle mHandle = 0; + ModResult mResult = MOD_UNAVAILABLE; +}; + +inline Connection connect(const Options& options) { + if (svc_websocket == nullptr || options.headers.size() > std::numeric_limits::max() || + options.protocols.size() > std::numeric_limits::max()) + { + return {0, svc_websocket == nullptr ? MOD_UNAVAILABLE : MOD_INVALID_ARGUMENT}; + } + + std::vector headers; + headers.reserve(options.headers.size()); + for (const auto& header : options.headers) { + headers.push_back({.name = header.name.c_str(), .value = header.value.c_str()}); + } + std::vector protocols; + protocols.reserve(options.protocols.size()); + for (const auto& protocol : options.protocols) { + protocols.push_back(protocol.c_str()); + } + + WebSocketConnectDesc desc = WEBSOCKET_CONNECT_DESC_INIT; + desc.url = options.url.c_str(); + desc.headers = headers.empty() ? nullptr : headers.data(); + desc.header_count = static_cast(headers.size()); + desc.protocols = protocols.empty() ? nullptr : protocols.data(); + desc.protocol_count = static_cast(protocols.size()); + desc.connect_timeout_ms = options.connectTimeoutMs; + desc.close_timeout_ms = options.closeTimeoutMs; + desc.keepalive_interval_ms = options.keepaliveIntervalMs; + desc.max_message_bytes = options.maxMessageBytes; + desc.user_data = options.userData; + + WebSocketHandle handle = 0; + const ModResult result = svc_websocket->connect(mod_ctx, &desc, &handle); + return {handle, result}; +} + +struct Event { + WebSocketEventType type = WEBSOCKET_EVENT_NONE; + WebSocketHandle handle = 0; + void* userData = nullptr; + std::string_view protocol; + std::span headers; + WebSocketMessageKind messageKind = WEBSOCKET_MESSAGE_TEXT; + std::span data; + WebSocketError error = WEBSOCKET_ERROR_NONE; + std::string_view message; + int handshakeStatus = 0; + uint16_t closeCode = 0; + std::string_view closeReason; +}; + +inline bool poll(Event& out) { + out = {}; + if (svc_websocket == nullptr) { + return false; + } + WebSocketEvent raw = WEBSOCKET_EVENT_INIT; + if (svc_websocket->poll_event(mod_ctx, &raw) != MOD_OK || raw.type == WEBSOCKET_EVENT_NONE) { + return false; + } + out.type = raw.type; + out.handle = raw.ws; + out.userData = raw.user_data; + out.protocol = raw.protocol != nullptr ? raw.protocol : ""; + if (raw.headers != nullptr && raw.header_count != 0) { + out.headers = {raw.headers, raw.header_count}; + } + out.messageKind = raw.message_kind; + if (raw.data != nullptr && raw.size != 0) { + out.data = {static_cast(raw.data), raw.size}; + } + out.error = raw.error; + out.message = raw.error_message != nullptr ? raw.error_message : ""; + out.handshakeStatus = raw.handshake_status; + out.closeCode = raw.close_code; + out.closeReason = raw.close_reason != nullptr ? raw.close_reason : ""; + return true; +} + +} // namespace mods::ws diff --git a/sdk/luau/dusklight.d.luau b/sdk/luau/dusklight.d.luau new file mode 100644 index 0000000000..619e2f4124 --- /dev/null +++ b/sdk/luau/dusklight.d.luau @@ -0,0 +1,160 @@ +--!strict + +export type IntegerInput = integer | number +export type ConfigValue = boolean | integer | number | string +export type ConfigVar = { + get: (self: ConfigVar) -> T, + set: (self: ConfigVar, value: T) -> (), + subscribe: (self: ConfigVar, callback: (value: T, previous: T) -> ()) -> ConfigSubscription, + unregister: (self: ConfigVar) -> (), +} +export type ConfigSubscription = { + unsubscribe: (self: ConfigSubscription) -> (), +} +export type ConfigDesc = { + name: string, + type: "bool" | "int" | "float" | "string", + default: ConfigValue?, +} +export type ConfigModule = { + register: (desc: ConfigDesc) -> ConfigVar, + subscribe: (variable: ConfigVar, callback: (value: T, previous: T) -> ()) -> ConfigSubscription, +} + +export type OverlayHandle = { remove: (self: OverlayHandle) -> () } +export type OverlayModule = { + add_file: (discPath: string, bundlePath: string) -> OverlayHandle, + add_buffer: (discPath: string, data: string) -> OverlayHandle, +} +export type TextureHandle = { unregister: (self: TextureHandle) -> () } +export type TextureKey = { + texture_hash: integer, + tlut_hash: integer?, + width: IntegerInput, + height: IntegerInput, + gx_format: IntegerInput, + has_tlut: boolean?, +} +export type TextureData = { + data: string, + width: IntegerInput?, + height: IntegerInput?, + mip_count: IntegerInput?, + gx_format: IntegerInput?, +} +export type TextureModule = { + hash_wildcard: integer, + tlut_wildcard: integer, + register_file: (bundlePath: string) -> TextureHandle, + register_data: (key: TextureKey, data: TextureData) -> TextureHandle, +} + +export type UiElement = { + add_section: (self: UiElement, title: string) -> (), + add_text: (self: UiElement, text: string) -> UiElement, + add_rml: (self: UiElement, rml: string) -> UiElement, + add_progress: (self: UiElement, value: number) -> UiElement, + add_control: (self: UiElement, desc: UiControlDesc) -> UiElement, + add_group: (self: UiElement, target: UiElement, desc: UiGroupDesc) -> UiElement, + add_list: (self: UiElement, desc: UiListDesc) -> UiList, + set_text: (self: UiElement, text: string) -> (), + set_rml: (self: UiElement, rml: string) -> (), + set_progress: (self: UiElement, value: number) -> (), + set_class: (self: UiElement, name: string, active: boolean) -> (), +} +export type UiControlDesc = { + kind: "button" | "toggle" | "number" | "string" | "select" | "color" | "group" | "file_picker", + label: string, + help_rml: string?, + config_var: ConfigVar?, + get: (() -> ConfigValue)?, + set: ((value: ConfigValue) -> ())?, + on_pressed: (() -> ())?, + is_disabled: (() -> boolean)?, + is_modified: (() -> boolean)?, + is_selected: (() -> boolean)?, + min: IntegerInput?, + max: IntegerInput?, + step: IntegerInput?, + prefix: string?, + suffix: string?, + options: {string}?, + max_length: IntegerInput?, + color_presets: {string}?, + color_alpha: boolean?, + string_set_mode: ("commit" | "change")?, + file_filters: {{name: string, pattern: string}}?, + directory_mode: boolean?, +} +export type UiGroupDesc = { label: string, build: (pane: UiElement) -> () } +export type UiListItem = { key: IntegerInput, label: string } +export type UiListDesc = { + items: {UiListItem}?, + on_pressed: (list: UiList, key: integer) -> (), + is_selected: ((list: UiList, key: integer) -> boolean)?, + is_disabled: ((list: UiList, key: integer) -> boolean)?, +} +export type UiList = { set_items: (self: UiList, items: {UiListItem}) -> () } +export type UiWindow = { close: (self: UiWindow) -> () } +export type UiDialog = { + close: (self: UiDialog) -> (), + set_body: (self: UiDialog, rml: string) -> (), + set_icon: (self: UiDialog, icon: string) -> (), +} +export type UiStyle = { unregister: (self: UiStyle) -> () } +export type UiMenuTab = { unregister: (self: UiMenuTab) -> () } +export type UiTabDesc = { + title: string, + build: (window: UiWindow, left: UiElement, right: UiElement) -> (), + update: (() -> ())?, +} +export type UiModule = { + register_mods_panel: (desc: {build: (panel: UiElement) -> (), update: (() -> ())?}) -> (), + window_push: (desc: {tabs: {UiTabDesc}, rcss: string?, on_closed: ((window: UiWindow) -> ())?}) -> UiWindow, + dialog_push: (desc: { + title: string, + body_rml: string, + variant: ("normal" | "warning" | "danger")?, + icon: string?, + actions: {{label: string, on_pressed: ((dialog: UiDialog) -> ())?, keep_open: boolean?, is_disabled: (() -> boolean)?}}, + on_dismiss: ((dialog: UiDialog) -> ())?, + build: ((pane: UiElement) -> ())?, + }) -> UiDialog, + is_any_document_visible: () -> boolean, + register_styles: (scope: string, rcss: string) -> UiStyle, + register_styles_file: (scope: string, path: string) -> UiStyle, + register_menu_tab: (desc: {label: string, on_selected: () -> ()}) -> UiMenuTab, + push_toast: (desc: {type: string?, title_rml: string?, body_rml: string?, duration_ms: IntegerInput?}) -> (), + get_clipboard_text: () -> string, + set_clipboard_text: (text: string) -> (), +} + +export type LogModule = { + write: (level: "trace" | "debug" | "info" | "warn" | "error", message: string) -> (), + trace: (message: string) -> (), + debug: (message: string) -> (), + info: (message: string) -> (), + warn: (message: string) -> (), + error: (message: string) -> (), +} +export type HostModule = { + version: string, + mod_id: () -> string, + mod_name: () -> string, + mod_version: () -> string, + mod_dir: () -> string, + data_dir: () -> string, + on_update: (callback: () -> ()) -> (), + on_shutdown: (callback: () -> ()) -> (), + fail: (message: string) -> never, +} +export type ResourceModule = { load: (relativePath: string) -> string } + +declare function require(path: "dusklight.log"): LogModule +declare function require(path: "dusklight.host"): HostModule +declare function require(path: "dusklight.config"): ConfigModule +declare function require(path: "dusklight.resource"): ResourceModule +declare function require(path: "dusklight.overlay"): OverlayModule +declare function require(path: "dusklight.texture"): TextureModule +declare function require(path: "dusklight.ui"): UiModule +declare function require(path: string): any diff --git a/sdk/luau/template/mod.json b/sdk/luau/template/mod.json new file mode 100644 index 0000000000..85a13a6459 --- /dev/null +++ b/sdk/luau/template/mod.json @@ -0,0 +1,8 @@ +{ + "id": "com.example.my_script_mod", + "name": "My Script Mod", + "version": "1.0.0", + "author": "Your Name", + "description": "A Luau script mod", + "runtime": "dev.twilitrealm.luau@1.0" +} diff --git a/sdk/luau/template/res/main.luau b/sdk/luau/template/res/main.luau new file mode 100644 index 0000000000..102988c164 --- /dev/null +++ b/sdk/luau/template/res/main.luau @@ -0,0 +1,8 @@ +local log = require("dusklight.log") +local host = require("dusklight.host") + +log.info("My Script Mod initialized") + +host.on_shutdown(function() + log.info("My Script Mod shutting down") +end) diff --git a/src/d/actor/d_a_alink.cpp b/src/d/actor/d_a_alink.cpp index 45829188db..4d1bf182db 100644 --- a/src/d/actor/d_a_alink.cpp +++ b/src/d/actor/d_a_alink.cpp @@ -4313,7 +4313,9 @@ int daAlink_c::createHeap() { return 0; } - JKRReadIdxResource(mFaceBckHeap.getBuffer(), 0xC00, dRes_ID_ALANM_BCK_FAT_e, dComIfGp_getAnmArchive()); + IF_DUSK(mFaceBckHeap.reserveBuffer(dRes_ID_ALANM_BCK_FAT_e);) + JKRReadIdxResource(mFaceBckHeap.getBuffer(), DUSK_IF_ELSE(mFaceBckHeap.getBufferSize(), 0xC00), + dRes_ID_ALANM_BCK_FAT_e, dComIfGp_getAnmArchive()); J3DAnmTransform* bck = (J3DAnmTransform*)J3DAnmLoaderDataBase::load(mFaceBckHeap.getBuffer()); if (!mFaceBck.init(bck, FALSE, J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, false)) { return 0; @@ -14307,7 +14309,11 @@ BOOL daAlink_c::checkMagicArmorWearAbility() const { J3DModelData* daAlink_c::loadAramBmd(u16 i_resIdx, u32 i_bufSize) { JKRArchive* anmArchive = dComIfGp_getAnmArchive(); +#if TARGET_PC + u8* tmpBuffer = (u8*)mItemHeap[field_0x2fa0].allocTempBuffer(i_resIdx, &i_bufSize); +#else u8* tmpBuffer = JKR_NEW_ARRAY_ARGS(u8, i_bufSize, 0x20); +#endif JKRReadIdxResource(tmpBuffer, i_bufSize, i_resIdx, anmArchive); #if DEBUG @@ -14328,7 +14334,11 @@ J3DModelData* daAlink_c::loadAramBmd(u16 i_resIdx, u32 i_bufSize) { } void* daAlink_c::loadAram(u16 i_resIdx, u32 i_bufSize) { +#if TARGET_PC + u8* tmpBuffer = (u8*)mItemHeap[field_0x2fa0].allocTempBuffer(i_resIdx, &i_bufSize); +#else u8* tmpBuffer = JKR_NEW_ARRAY_ARGS(u8, i_bufSize, 0x20); +#endif JKRReadIdxResource(tmpBuffer, i_bufSize, i_resIdx, dComIfGp_getAnmArchive()); #if DEBUG daPy_aramBufferCheck(tmpBuffer, i_bufSize); diff --git a/src/d/actor/d_a_alink_damage.inc b/src/d/actor/d_a_alink_damage.inc index a57e71bcee..34701229c3 100644 --- a/src/d/actor/d_a_alink_damage.inc +++ b/src/d/actor/d_a_alink_damage.inc @@ -157,10 +157,11 @@ f32 daAlink_c::damageMagnification(BOOL i_checkZoraMag, int param_1) { } #if TARGET_PC - base_mag *= dusk::getSettings().game.damageMultiplier; if (dusk::getSettings().game.instantDeath) { - base_mag = 9999.0f; + return 9999.0f; // don't need to multiply this further, 9999 is plenty } + + base_mag *= dusk::getSettings().game.damageMultiplier; #endif if (checkWolf() && !checkCargoCarry() && param_1 == 0) { diff --git a/src/d/actor/d_a_alink_dusk.cpp b/src/d/actor/d_a_alink_dusk.cpp index 8a2bc0025b..4351f807aa 100644 --- a/src/d/actor/d_a_alink_dusk.cpp +++ b/src/d/actor/d_a_alink_dusk.cpp @@ -113,6 +113,12 @@ void daAlink_c::handleQuickTransform() { return; } + // Ensure Link is not underwater + if (!checkNoResetFlg0(FLG0_SWIM_UP)) { + Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); + return; + } + // Use the game's default checks for if the player can currently transform if (!m_midnaActor->checkMetamorphoseEnableBase()) { Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0); diff --git a/src/d/actor/d_a_alink_swindow.inc b/src/d/actor/d_a_alink_swindow.inc index 33f1fee37b..0359bc99bb 100644 --- a/src/d/actor/d_a_alink_swindow.inc +++ b/src/d/actor/d_a_alink_swindow.inc @@ -11,6 +11,16 @@ static int daAlink_modelCallBack(J3DJoint* i_joint, int param_1); static int daAlink_headModelCallBack(J3DJoint* i_joint, int param_1); static int daAlink_wolfModelCallBack(J3DJoint* i_joint, int param_1); +#if TARGET_PC +static void* read_anm_resource(void** o_buffer, u16 i_resIdx, u32 i_fixedSize) { + u32 size = daPy_getAnmResourceSize(i_resIdx, i_fixedSize); + *o_buffer = JKRAllocFromSysHeap(size, 0x20); + JUT_ASSERT(__LINE__, *o_buffer); + JKRReadIdxResource(*o_buffer, size, i_resIdx, dComIfGp_getAnmArchive()); + return *o_buffer; +} +#endif + void daAlink_c::setArcName(BOOL i_isWolf) { if (i_isWolf) { mArcName = l_wArcName; @@ -247,8 +257,10 @@ void daAlink_c::changeModelDataDirectWolf(int param_0) { void daAlink_c::initStatusWindow() { onNoResetFlg2(FLG2_STATUS_WINDOW_DRAW); +#if !TARGET_PC void* tmpBuffer = JKR_NEW_ARRAY_ARGS(void*, 0x500, 0x20); JUT_ASSERT(394, tmpBuffer); +#endif u16 bckResIdx, btpResIdx, btkResIdx; if (checkWolf()) { @@ -268,7 +280,11 @@ void daAlink_c::initStatusWindow() { changeModelDataDirect(0); } +#if TARGET_PC + void* tmpBuffer = read_anm_resource(&mAnmBuffers[0], bckResIdx, 0x1400); +#else JKRReadIdxResource(tmpBuffer, 0x1400, bckResIdx, dComIfGp_getAnmArchive()); +#endif m_sWindowBck = JKR_NEW mDoExt_bckAnm(); JUT_ASSERT(428, m_sWindowBck); @@ -276,20 +292,28 @@ void daAlink_c::initStatusWindow() { JUT_ASSERT(433, FALSE); } +#if TARGET_PC + tmpBuffer = read_anm_resource(&mAnmBuffers[1], btpResIdx, 0x400); +#else tmpBuffer = JKR_NEW_ARRAY_ARGS(void*, 0x100, 0x20); JUT_ASSERT(437, tmpBuffer); JKRReadIdxResource(tmpBuffer, 0x400, btpResIdx, dComIfGp_getAnmArchive()); +#endif // this should call J3DAnmLoaderDataBase::load(const void*) but it breaks retail J3DAnmTexPattern* btp = (J3DAnmTexPattern*)J3DAnmLoaderDataBase::load(tmpBuffer, J3DLOADER_UNK_FLAG0); btp->setFrame(0.0f); btp->searchUpdateMaterialID(field_0x06c0); field_0x06c0->entryTexNoAnimator(btp); +#if TARGET_PC + tmpBuffer = read_anm_resource(&mAnmBuffers[2], btkResIdx, 0x400); +#else tmpBuffer = JKR_NEW_ARRAY_ARGS(void*, 0x100, 0x20); JUT_ASSERT(449, tmpBuffer); JKRReadIdxResource(tmpBuffer, 0x400, btkResIdx, dComIfGp_getAnmArchive()); +#endif // this should call J3DAnmLoaderDataBase::load(const void*) but it breaks retail J3DAnmTextureSRTKey* btk = (J3DAnmTextureSRTKey*)J3DAnmLoaderDataBase::load(tmpBuffer, J3DLOADER_UNK_FLAG0); btk->setFrame(0.0f); @@ -387,4 +411,12 @@ void daAlink_c::resetStatusWindow() { offNoResetFlg2(FLG2_STATUS_WINDOW_DRAW); m_sWindowBck = NULL; +#if TARGET_PC + for (int i = 0; i < 3; i++) { + if (mAnmBuffers[i] != NULL) { + JKRFreeToSysHeap(mAnmBuffers[i]); + mAnmBuffers[i] = NULL; + } + } +#endif } diff --git a/src/d/actor/d_a_demo00.cpp b/src/d/actor/d_a_demo00.cpp index 60a99d4d54..b89965a8ce 100644 --- a/src/d/actor/d_a_demo00.cpp +++ b/src/d/actor/d_a_demo00.cpp @@ -1103,14 +1103,8 @@ inline int daDemo00_c::execute() { case 2: { u16 sp0A = sp0E & 0x3FFF; if ((sp0E & 0xC000) == 0) { -#if !MOVIE_SUPPORT - // If movie support isn't available, automatically reset. - // TPHD-esque. Maybe not the best solution, but it works. - dComIfGp_event_reset(); -#else fopAcM_create(fpcNm_MOVIE_PLAYER_e, sp0A, NULL, fopAcM_GetRoomNo(this), NULL, NULL, 0xFF); mDoGph_gInf_c::fadeOut(1.0f); -#endif } else { switch (sp0A) { case 0: diff --git a/src/d/actor/d_a_demo_item.cpp b/src/d/actor/d_a_demo_item.cpp index 5876c26718..0c092cf59b 100644 --- a/src/d/actor/d_a_demo_item.cpp +++ b/src/d/actor/d_a_demo_item.cpp @@ -449,7 +449,7 @@ int daDitem_c::Delete() { endInsectEffect(); mSound.deleteObject(); - return DeleteBase(dItem_data::getArcName(m_itemNo)); + return DeleteBase(dItem_data::getArcName(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo))); } static int daDitem_Delete(daDitem_c* i_this) { @@ -461,8 +461,16 @@ int daDitem_c::create() { m_itemNo = daDitem_prm::getNo(this); +#if TARGET_PC + const auto [item, displayItem, _] = dusk::mods::item_check_resolve(mItemGiveTag, m_itemNo, this); + m_itemNo = item; + setDisplayItemNo(displayItem); + const char* arc_name = dItem_data::getArcName(displayItem); + s16 bmd_name = dItem_data::getBmdName(displayItem); +#else const char* arc_name = dItem_data::getArcName(m_itemNo); s16 bmd_name = dItem_data::getBmdName(m_itemNo); +#endif if (bmd_name < 0 || arc_name == NULL) { if (bmd_name == 0) { @@ -476,9 +484,13 @@ int daDitem_c::create() { } m_itemNo = dItemNo_GREEN_RUPEE_e; +#if TARGET_PC + setDisplayItemNo(dItemNo_NONE_e); +#endif } - int phase_state = dComIfG_resLoad(&mPhase, dItem_data::getArcName(m_itemNo)); + int phase_state = dComIfG_resLoad( + &mPhase, dItem_data::getArcName(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo))); if (phase_state == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap(this, CheckItemCreateHeap, 0x80003390)) { return cPhs_ERROR_e; @@ -538,7 +550,7 @@ static int daDitem_Execute(daDitem_c* i_this) { } int daDitem_c::draw() { - switch (m_itemNo) { + switch (DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo)) { case dItemNo_WOOD_STICK_e: draw_WOOD_STICK(); break; diff --git a/src/d/actor/d_a_e_hp.cpp b/src/d/actor/d_a_e_hp.cpp index a7729d81f6..29ae9d43f5 100644 --- a/src/d/actor/d_a_e_hp.cpp +++ b/src/d/actor/d_a_e_hp.cpp @@ -733,6 +733,7 @@ void daE_HP_c::executeDead() { if (itemCheck.itemNo == dItemNo_NONE_e) { dusk::mods::item_check_complete(itemCheck, this); } else { + daAlink_getAlinkActorClass()->procWolfAtnActorMoveInit(); dusk::mods::item_check_enqueue(itemCheck, dusk::mods::ItemGiveMode::ForcedDemo); } #else diff --git a/src/d/actor/d_a_e_po.cpp b/src/d/actor/d_a_e_po.cpp index 3e1bcb8073..112ad2d56f 100644 --- a/src/d/actor/d_a_e_po.cpp +++ b/src/d/actor/d_a_e_po.cpp @@ -7,6 +7,9 @@ #include "d/actor/d_a_e_po.h" #include "d/actor/d_a_obj_poFire.h" +#if TARGET_PC +#include "d/actor/d_a_alink.h" +#endif #include "d/d_cc_d.h" #include "d/d_cc_uty.h" #include "f_op/f_op_actor_enemy.h" @@ -1132,16 +1135,7 @@ static void e_po_dead(e_po_class* i_this) { camera_player->mCamera.Start(); camera_player->mCamera.SetTrimSize(0); dComIfGp_event_reset(); -#if TARGET_PC - const auto itemCheck = dusk::mods::item_check_commit( - dusk::mods::item_give_tag_poe(i_this->BitSW), dItemNo_POU_SPIRIT_e, a_this); - daPy_getPlayerActorClass()->cancelOriginalDemo(); - if (itemCheck.itemNo == dItemNo_NONE_e) { - dusk::mods::item_check_complete(itemCheck, a_this); - } else { - dusk::mods::item_check_enqueue(itemCheck, dusk::mods::ItemGiveMode::ForcedDemo); - } -#else +#if !TARGET_PC dComIfGs_addPohSpiritNum(); #if !PLATFORM_SHIELD if (dComIfGs_getPohSpiritNum() == 0x14) { @@ -1149,8 +1143,8 @@ static void e_po_dead(e_po_class* i_this) { dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[457]); } #endif - daPy_getPlayerActorClass()->cancelOriginalDemo(); #endif + daPy_getPlayerActorClass()->cancelOriginalDemo(); } else if (mArg0Check(i_this, 0) != 0) { if (!fopAcM_isSwitch(a_this, 0x22)) { if (fopAcM_SearchByID(i_this->field_0x5B8, &local_1b0_actor) != 0 && diff --git a/src/d/actor/d_a_itembase.cpp b/src/d/actor/d_a_itembase.cpp index 084fb5221f..474b03c784 100644 --- a/src/d/actor/d_a_itembase.cpp +++ b/src/d/actor/d_a_itembase.cpp @@ -242,21 +242,21 @@ BOOL daItemBase_c::chkFlag(int i_flag) { } s8 daItemBase_c::getTevFrm() { - return dItem_data::getTevFrm(m_itemNo); + return dItem_data::getTevFrm(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo)); } s8 daItemBase_c::getBtpFrm() { - return dItem_data::getBtpFrm(m_itemNo); + return dItem_data::getBtpFrm(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo)); } u8 daItemBase_c::getShadowSize() { - return dItem_data::getShadowSize(m_itemNo); + return dItem_data::getShadowSize(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo)); } u8 daItemBase_c::getCollisionH() { - return dItem_data::getH(m_itemNo); + return dItem_data::getH(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo)); } u8 daItemBase_c::getCollisionR() { - return dItem_data::getR(m_itemNo); + return dItem_data::getR(DUSK_IF_ELSE(getDisplayItemNo(), m_itemNo)); } diff --git a/src/d/actor/d_a_midna.cpp b/src/d/actor/d_a_midna.cpp index 1b96147957..0be48b3794 100644 --- a/src/d/actor/d_a_midna.cpp +++ b/src/d/actor/d_a_midna.cpp @@ -496,6 +496,7 @@ int daMidna_c::createHeap() { } } + IF_DUSK(mBckHeap[0].reserveBuffer(0x1DC);) JKRReadIdxResource(mBckHeap[0].getBuffer(), mBckHeap[0].getBufferSize(), 0x1DC, dComIfGp_getAnmArchive()); J3DAnmTransform* md_anm = (J3DAnmTransform*)J3DAnmLoaderDataBase::load(mBckHeap[0].getBuffer()); modelData = (J3DModelData*)dComIfG_getObjectRes(l_arcName, 14); @@ -3300,7 +3301,7 @@ int daMidna_c::execute() { if (!checkStateFlg0(FLG0_UNK_8000)) { offStateFlg0((daMidna_FLG0)(FLG0_NPC_NEAR | FLG0_NPC_FAR)); BOOL far_; - if (fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &far_)) { + if (fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &far_) IF_DUSK(&& !dusk::getSettings().game.canTransformAnywhere)) { if (!far_) { onStateFlg0(FLG0_NPC_NEAR); } else { diff --git a/src/d/actor/d_a_movie_player.cpp b/src/d/actor/d_a_movie_player.cpp index 5f4290611f..5d076b759e 100644 --- a/src/d/actor/d_a_movie_player.cpp +++ b/src/d/actor/d_a_movie_player.cpp @@ -15,15 +15,12 @@ #pragma optimize_for_size off #include -#include #include "JSystem/JAudio2/JASAiCtrl.h" #include "JSystem/JAudio2/JASDriverIF.h" #include "JSystem/JKernel/JKRExpHeap.h" #include "Z2AudioLib/Z2Instances.h" #include "d/actor/d_a_movie_player.h" -#include - #include "f_op/f_op_overlap_mng.h" #include "JSystem/JAudio2/JASCriticalSection.h" @@ -32,9 +29,6 @@ #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) { @@ -49,7 +43,8 @@ inline s32 daMP_NEXT_READ_SIZE(daMP_THPReadBuffer* readBuf) { #define OS_THREAD_ATTR OS_THREAD_ATTR_DETACH #endif -#if defined(__cplusplus) && !TARGET_PC +#if !TARGET_PC +#if defined(__cplusplus) extern "C" { #endif @@ -217,7 +212,6 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr) { info->encodeData++; } -#if !TARGET_PC ATTRIBUTE_ALIGN(32) static u8 THPStatistics[1120]; ATTRIBUTE_ALIGN(32) static THPHuffmanTab* Ydchuff; @@ -2587,104 +2581,9 @@ static void __THPHuffDecodeDCTCompV(__REGISTER THPFileInfo* info, THPCoeff* bloc #else // !TARGET_PC static daMP_THPPlayer daMP_ActivePlayer; - -#if MOVIE_SUPPORT -static std::vector FixedJpegData; -static tjhandle JpegDecompressHandle; - -static const std::vector& FixJpeg(const std::span data) { - FixedJpegData.resize(0); - FixedJpegData.reserve(data.size()); - - size_t startOfScanLocation = 0; - for (; startOfScanLocation < data.size() - 1; startOfScanLocation++) { - if (data[startOfScanLocation] == 0xFF && data[startOfScanLocation + 1] == 0xDA) { - goto sosFound; - } - } - - CRASH("Unable to find SOS marker!"); - - sosFound: - - startOfScanLocation += 2; // TODO: Skip entire SOS header? - - size_t endOfImage = data.size() - 1; - for (; endOfImage > startOfScanLocation; endOfImage--) { - if (data[endOfImage] == 0xFF && data[endOfImage + 1] == 0xD9) { - goto eoiFound; - } - } - - CRASH("Unable to find EOI marker!"); - eoiFound: - - // Copy data before SOS - for (size_t i = 0; i < startOfScanLocation; i++) { - FixedJpegData.push_back(data[i]); - } - - // Copy data inside SOS, fixing up lacking of "byte shuffling" - for (size_t i = startOfScanLocation; i < endOfImage; i++) { - u8 value = data[i]; - FixedJpegData.push_back(value); - if (value == 0xFF) { - FixedJpegData.push_back(0x00); - } - } - - // Copy data after SOS. - for (size_t i = endOfImage; i < data.size(); i++) { - FixedJpegData.push_back(data[i]); - } - - return FixedJpegData; -} - -static s32 THPVideoDecode(void* file, size_t fileSize, void* tileY, void* tileU, void* tileV, void*) { - assert(JpegDecompressHandle); - - const auto handle = JpegDecompressHandle; - const auto fixedData = FixJpeg(std::span(static_cast(file), fileSize)); - - auto ret = tj3DecompressHeader(handle, fixedData.data(), fixedData.size()); - if (ret == -1) { - OSReport_Error("Parsing JPEG header failed: %s", tj3GetErrorStr(handle)); - return 1; - } - - if (tj3Get(handle, TJPARAM_JPEGWIDTH) != daMP_ActivePlayer.videoInfo.xSize) { - OSReport_Error("Invalid width in video frame!"); - return 1; - } - - if (tj3Get(handle, TJPARAM_JPEGHEIGHT) != daMP_ActivePlayer.videoInfo.ySize) { - OSReport_Error("Invalid height in video frame!"); - return 1; - } - - ret = tj3Set(handle, TJPARAM_SUBSAMP, TJSAMP_420); - if (ret != 0) { - OSReport_Error("Failed to set subsampling mode: %s", tj3GetErrorStr(handle)); - return 1; - } - - u8* planes[3] = {static_cast(tileY), static_cast(tileU), static_cast(tileV)}; - ret = tj3DecompressToYUVPlanes8(handle, fixedData.data(), fixedData.size(), planes, nullptr); - if (ret != 0) { - OSReport_Error("Image decompression failed: %s", tj3GetErrorStr(handle)); - return 1; - } - - return 0; -} -#else // MOVIE_SUPPORT -static s32 THPVideoDecode(void*, size_t, void*, void*, void*, void*) { - return 1; // Immediate error. -} -#endif #endif +#if !TARGET_PC static BOOL THPInit() { #if !TARGET_PC u8* base; @@ -2712,9 +2611,10 @@ static BOOL THPInit() { return TRUE; } -#if defined(__cplusplus) && !TARGET_PC +#if defined(__cplusplus) } #endif +#endif // !TARGET_PC #if !TARGET_PC // Defined earlier in file. static daMP_THPPlayer daMP_ActivePlayer; @@ -2937,9 +2837,6 @@ static void daMP_VideoDecode(daMP_THPReadBuffer* readBuffer) { case 0: { if ((daMP_ActivePlayer.videoError = THPVideoDecode( tile, -#if TARGET_PC - *tileOffsets, -#endif textureSet->ytexture, textureSet->utexture, textureSet->vtexture, daMP_ActivePlayer.thpWork))) { @@ -3434,26 +3331,19 @@ static void daMP_THPGXYuv2RgbDraw(u8* y_data, u8* u_data, u8* v_data, s16 x, TGXTexObj tobj0; TGXTexObj tobj1; TGXTexObj tobj2; -#if TARGET_PC -#define FMT (GXTexFmt)GX_TF_R8_PC -#else -#define FMT GX_TF_I8 -#endif - GXInitTexObj(&tobj0, y_data, textureWidth, textureHeight, FMT, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObj(&tobj0, y_data, textureWidth, textureHeight, GX_TF_I8, GX_CLAMP, GX_CLAMP, GX_FALSE); GXInitTexObjLOD(&tobj0, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1); GXLoadTexObj(&tobj0, GX_TEXMAP0); - GXInitTexObj(&tobj1, u_data, textureWidth >> 1, textureHeight >> 1, FMT, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObj(&tobj1, u_data, textureWidth >> 1, textureHeight >> 1, GX_TF_I8, GX_CLAMP, GX_CLAMP, GX_FALSE); GXInitTexObjLOD(&tobj1, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1); GXLoadTexObj(&tobj1, GX_TEXMAP1); - GXInitTexObj(&tobj2, v_data, textureWidth >> 1, textureHeight >> 1, FMT, GX_CLAMP, GX_CLAMP, GX_FALSE); + GXInitTexObj(&tobj2, v_data, textureWidth >> 1, textureHeight >> 1, GX_TF_I8, GX_CLAMP, GX_CLAMP, GX_FALSE); GXInitTexObjLOD(&tobj2, GX_NEAR, GX_NEAR, 0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1); GXLoadTexObj(&tobj2, GX_TEXMAP2); -#undef FMT - GXBegin(GX_QUADS, GX_VTXFMT7, 4); GXPosition3s16(x, y, 0); GXTexCoord2u16(0, 0); @@ -3774,13 +3664,6 @@ static BOOL daMP_THPPlayerOpen(char const* filename, BOOL onMemory) { } static BOOL daMP_THPPlayerClose() { -#if TARGET_PC && MOVIE_SUPPORT - tj3Destroy(JpegDecompressHandle); - JpegDecompressHandle = nullptr; - - FixedJpegData.clear(); -#endif - if (daMP_ActivePlayer.open && daMP_ActivePlayer.state == 0) { daMP_ActivePlayer.open = 0; DVDClose(&daMP_ActivePlayer.fileInfo); @@ -3832,11 +3715,6 @@ static BOOL daMP_THPPlayerSetBuffer(u8* buffer) { ysize = ALIGN_NEXT(daMP_ActivePlayer.videoInfo.xSize * daMP_ActivePlayer.videoInfo.ySize, 32); uvsize = ALIGN_NEXT(daMP_ActivePlayer.videoInfo.xSize * daMP_ActivePlayer.videoInfo.ySize / 4, 32); -#if TARGET_PC - assert(ysize >= tj3YUVPlaneSize(0, daMP_ActivePlayer.videoInfo.xSize, 0, daMP_ActivePlayer.videoInfo.ySize, TJSAMP_420)); - assert(uvsize >= tj3YUVPlaneSize(1, daMP_ActivePlayer.videoInfo.xSize, 0, daMP_ActivePlayer.videoInfo.ySize, TJSAMP_420)); - assert(uvsize >= tj3YUVPlaneSize(2, daMP_ActivePlayer.videoInfo.xSize, 0, daMP_ActivePlayer.videoInfo.ySize, TJSAMP_420)); -#endif for (i = 0; i < ARRAY_SIZE(daMP_ActivePlayer.textureSet); i++) { daMP_ActivePlayer.textureSet[i].ytexture = ptr; @@ -4329,15 +4207,6 @@ static BOOL daMP_ActivePlayer_Init(char const* moviePath) { daMP_THPPlayerSetBuffer((u8*)daMP_buffer); -#if TARGET_PC && MOVIE_SUPPORT - assert(JpegDecompressHandle == nullptr); - JpegDecompressHandle = tj3Init(TJINIT_DECOMPRESS); - if (JpegDecompressHandle == nullptr) { - OSReport_Error("Failed to create turbojpeg handle: %s", tj3GetErrorStr(nullptr)); - return 0; - } -#endif - if (!daMP_THPPlayerPrepare(0, 0, daMP_audioInfo.sndNumTracks != 1 ? OSGetTick() % daMP_audioInfo.sndNumTracks : 0)) { OSReport("Fail to prepare\n"); #if DEBUG diff --git a/src/d/actor/d_a_npc_gra.cpp b/src/d/actor/d_a_npc_gra.cpp index 13f3215fae..d57ce3ab2b 100644 --- a/src/d/actor/d_a_npc_gra.cpp +++ b/src/d/actor/d_a_npc_gra.cpp @@ -12,6 +12,9 @@ #include "d/actor/d_a_npc_gra.h" #include "d/actor/d_a_tag_gra.h" #include "Z2AudioLib/Z2Instances.h" +#if TARGET_PC +#include "mods/items.h" +#endif #include DUSK_GAME_DATA const daNpc_grA_HIOParam daNpc_grA_Param_c::m = { @@ -1323,7 +1326,7 @@ BOOL daNpc_grA_c::isDelete() { return FALSE; } fopAcM_createItemForBoss(¤t.pos, 0x21, fopAcM_GetRoomNo(this), NULL, NULL, 0.0f, 0.0f, - 0x80); + 0x80 IF_DUSK_ARG(ITEM_CHECK_GORON_SPRINGWATER_RUSH)); return TRUE; } return TRUE; @@ -2812,7 +2815,7 @@ BOOL daNpc_grA_c::ECut_carrySpaWater(int i_staffID) { c.y += 200.0f; csXyz c2(0, fopAcM_searchPlayerAngleY(this), 0); fopAcM_createItemForBoss(&c, 0x21, fopAcM_GetRoomNo(this), &c2, NULL, 0.0f, 20.0f, - 0x80); + 0x80 IF_DUSK_ARG(ITEM_CHECK_GORON_SPRINGWATER_RUSH)); } break; } } @@ -4019,16 +4022,53 @@ BOOL daNpc_grA_c::talk(void*) { if (r26 && talkProc(NULL, TRUE, NULL)) { if (mFlow.getEventId(&sp8) == 1) { #if TARGET_PC + const u8 originalItem = sp8; u32 itemGiveTag = 0; - if (sp8 == dItemNo_BOMB_IN_BAG_e) { + bool isItemCheck = false; + if (originalItem == dItemNo_BOMB_IN_BAG_e) { const auto itemCheck = - dusk::mods::item_check_commit("goron_reward:F_SP113", sp8, this); + dusk::mods::item_check_commit("goron_reward:F_SP113", originalItem, this); sp8 = itemCheck.itemNo; itemGiveTag = itemCheck.tag; + isItemCheck = true; + } else { + const char* stage = dComIfGp_getStartStageName(); + const bool isAdultGoronShop = (strcmp(stage, "R_SP160") == 0 && originalItem == dItemNo_HYLIA_SHIELD_e) || + (strcmp(stage, "F_SP116") == 0 && originalItem == dItemNo_ARROW_30_e); + if (isAdultGoronShop) { + const auto itemCheck = dusk::mods::item_check_commit( + dusk::mods::item_give_tag_shop(originalItem), originalItem, this); + sp8 = itemCheck.itemNo; + itemGiveTag = itemCheck.tag; + isItemCheck = true; + } } -#endif + + if (isItemCheck && sp8 == dItemNo_NONE_e) { + dusk::mods::item_check_complete({itemGiveTag, dItemNo_NONE_e}, this); + r29 = 1; + if (mType == 0xb) { + field_0x1691 = 1; + } + } else { + field_0x1480 = fopAcM_createItemForPresentDemo( + ¤t.pos, sp8, 0, -1, -1, NULL, NULL, itemGiveTag); + if (field_0x1480 != fpcM_ERROR_PROCESS_ID_e) { + s16 r25 = + dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xff); + dComIfGp_getEvent()->reset(this); + fopAcM_orderChangeEventId(this, r25, 1, -1); + field_0x9ec = 1; + r29 = 1; + mOrderNewEvt = 1; + if (mType == 0xb) { + field_0x1691 = 1; + } + } + } +#else field_0x1480 = fopAcM_createItemForPresentDemo(¤t.pos, sp8, 0, -1, -1, NULL, - NULL IF_DUSK_ARG(itemGiveTag)); + NULL); if (field_0x1480 != fpcM_ERROR_PROCESS_ID_e) { s16 r25 = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xff); dComIfGp_getEvent()->reset(this); @@ -4040,6 +4080,7 @@ BOOL daNpc_grA_c::talk(void*) { field_0x1691 = 1; } } +#endif } else { if (mType == 0xa && field_0x1486 == 0 && daNpcF_chkEvtBit(0x187)) { dComIfGp_getEvent()->reset(this); diff --git a/src/d/actor/d_a_npc_grc.cpp b/src/d/actor/d_a_npc_grc.cpp index 2435f13c77..47ea7490c0 100644 --- a/src/d/actor/d_a_npc_grc.cpp +++ b/src/d/actor/d_a_npc_grc.cpp @@ -8,6 +8,9 @@ #include "d/actor/d_a_npc_grc.h" #include "d/actor/d_a_npc.h" #include "Z2AudioLib/Z2Instances.h" +#if TARGET_PC +#include "mods/items.h" +#endif #include enum grC_RES_File_ID { @@ -1476,8 +1479,27 @@ BOOL daNpc_grC_c::talk(void* param_1) { rv = TRUE; if (mFlow.getEventId(&i_itemNo) == 1) { - mItemID = fopAcM_createItemForPresentDemo(¤t.pos, i_itemNo, 0, -1, -1, NULL, NULL); +#if TARGET_PC + const bool isCastleTownShop = + strcmp(dComIfGp_getStartStageName(), "R_SP160") == 0 && + (i_itemNo == dItemNo_RED_BOTTLE_e || i_itemNo == dItemNo_OIL_BOTTLE_e); + u32 itemGiveTag = 0; + if (isCastleTownShop) { + const auto itemCheck = dusk::mods::item_check_commit( + dusk::mods::item_give_tag_shop(i_itemNo), i_itemNo, this); + i_itemNo = itemCheck.itemNo; + itemGiveTag = itemCheck.tag; + } + if (isCastleTownShop && i_itemNo == dItemNo_NONE_e) { + dusk::mods::item_check_complete({itemGiveTag, dItemNo_NONE_e}, this); + } else { + mItemID = fopAcM_createItemForPresentDemo( + ¤t.pos, i_itemNo, 0, -1, -1, NULL, NULL, itemGiveTag); + } +#else + mItemID = fopAcM_createItemForPresentDemo(¤t.pos, i_itemNo, 0, -1, -1, NULL, NULL); +#endif if (mItemID != fpcM_ERROR_PROCESS_ID_e) { s16 i_eventID = dComIfGp_getEventManager().getEventIdx(this, "DEFAULT_GETITEM", 0xFF); dComIfGp_getEvent()->reset(this); diff --git a/src/d/actor/d_a_npc_kkri.cpp b/src/d/actor/d_a_npc_kkri.cpp index 755257bff7..97e375e4ec 100644 --- a/src/d/actor/d_a_npc_kkri.cpp +++ b/src/d/actor/d_a_npc_kkri.cpp @@ -7,6 +7,9 @@ #include "d/actor/d_a_npc_kkri.h" #include "d/actor/d_a_e_ym.h" +#if TARGET_PC +#include "mods/items.h" +#endif #include static DUSK_CONSTEXPR int l_bmdData[2][2] = { @@ -1183,16 +1186,39 @@ int daNpc_Kkri_c::talk(void*) { if (mItemPartnerId == fpcM_ERROR_PROCESS_ID_e) { #if TARGET_PC u32 itemGiveTag = 0; - if (item_no == dItemNo_OIL_BOTTLE3_e) { - const auto itemCheck = - dusk::mods::item_check_commit("coro_bottle", item_no, this); + const char* itemCheckName = nullptr; + switch (item_no) { + case dItemNo_OIL_BOTTLE3_e: + itemCheckName = ITEM_CHECK_CORO_BOTTLE; + break; + case dItemNo_KANTERA_e: + itemCheckName = ITEM_CHECK_CORO_LANTERN; + break; + case dItemNo_KEY_OF_FILONE_e: + itemCheckName = ITEM_CHECK_CORO_GATE_KEY; + break; + } + + if (itemCheckName != nullptr) { + const auto itemCheck = dusk::mods::item_check_commit( + itemCheckName, item_no, this); item_no = itemCheck.itemNo; itemGiveTag = itemCheck.tag; } + + if (item_no == dItemNo_NONE_e && itemCheckName != nullptr) { + dusk::mods::item_check_complete({itemGiveTag, dItemNo_NONE_e}, this); + field_0xfd5 = 1; + mEvtNo = 1; + evtChange(); + } else { + mItemPartnerId = fopAcM_createItemForPresentDemo( + ¤t.pos, item_no, 0, -1, -1, NULL, NULL, itemGiveTag); + } +#else + mItemPartnerId = fopAcM_createItemForPresentDemo( + ¤t.pos, item_no, 0, -1, -1, NULL, NULL); #endif - mItemPartnerId = fopAcM_createItemForPresentDemo(¤t.pos, item_no, - 0, -1, -1, NULL, - NULL IF_DUSK_ARG(itemGiveTag)); } if (fopAcM_IsExecuting(mItemPartnerId)) { diff --git a/src/d/actor/d_a_obj_item.cpp b/src/d/actor/d_a_obj_item.cpp index a67e780286..e06eb37e50 100644 --- a/src/d/actor/d_a_obj_item.cpp +++ b/src/d/actor/d_a_obj_item.cpp @@ -158,8 +158,8 @@ void daItem_c::CreateInit() { mCcCyl.SetCoHitCallback(itemGetCoCallBack); mCcCyl.SetTgHitCallback(itemGetTgCallBack); - f32 cylHeight = dItem_data::getH(m_itemNo); - f32 cylRadius = dItem_data::getR(m_itemNo); + f32 cylHeight = DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo)); + f32 cylRadius = DUSK_IF_ELSE(getCollisionR(), dItem_data::getR(m_itemNo)); if (scale.x > 1.0f) { cylHeight *= scale.x; @@ -267,12 +267,13 @@ int daItem_c::_daItem_create() { #if TARGET_PC const u32 params = fopAcM_GetParam(this); mOriginalItemNo = params & 0xFF; - const u8 resolvedItem = dusk::mods::item_check_freestanding( - daItem_prm::getItemBitNo(this), mOriginalItemNo, this); - mItemOverridden = resolvedItem != mOriginalItemNo; mItemGiveTag = dusk::mods::item_give_tag_freestanding(daItem_prm::getItemBitNo(this)); + const auto [item, displayItem, _] = + dusk::mods::item_check_resolve(mItemGiveTag, mOriginalItemNo, this); + mItemOverridden = item != mOriginalItemNo; + setDisplayItemNo(displayItem); if (mItemOverridden) { - fopAcM_SetParam(this, (params & 0xFFFFFF00) | resolvedItem); + fopAcM_SetParam(this, (params & 0xFFFFFF00) | item); } #endif field_0x95d = true; @@ -288,7 +289,7 @@ int daItem_c::_daItem_create() { #if DEBUG #if TARGET_PC - if (dItem_fieldModelArc(m_itemNo) == NULL) { + if (dItem_fieldModelArc(getDisplayItemNo()) == NULL) { #else if (dItem_data::getFieldArc(m_itemNo) == NULL) { #endif @@ -324,23 +325,21 @@ int daItem_c::_daItem_create() { CreateInit(); } else { #if TARGET_PC - // Resolved items may have no field model; display their get-demo model instead. - if (dItem_data::getFieldArc(m_itemNo) == NULL) { - phase_state = dComIfG_resLoad(&mPhase, dItem_data::getArcName(m_itemNo)); - if (phase_state == cPhs_COMPLEATE_e) { - if (!fopAcM_entrySolidHeap(this, CheckItemCreateHeap, 0x4000)) { - return cPhs_ERROR_e; - } - - CreateInit(); - } - return phase_state; - } -#endif + const u8 displayItemNo = getDisplayItemNo(); + phase_state = dComIfG_resLoad(&mPhase, dItem_fieldModelArc(displayItemNo)); +#else phase_state = dComIfG_resLoad(&mPhase, dItem_data::getFieldArc(m_itemNo)); +#endif if (phase_state == cPhs_COMPLEATE_e) { +#if TARGET_PC + const bool useModelFallback = dItem_data::getFieldArc(displayItemNo) == NULL; + if (!fopAcM_entrySolidHeap(this, + useModelFallback ? CheckItemCreateHeap : CheckFieldItemCreateHeap, + useModelFallback ? 0x4000 : dItem_data::getFieldHeapSize(displayItemNo))) +#else if (!fopAcM_entrySolidHeap(this, CheckFieldItemCreateHeap, dItem_data::getFieldHeapSize(m_itemNo))) +#endif { return cPhs_ERROR_e; } @@ -357,7 +356,7 @@ int daItem_c::_daItem_execute() { CountTimer(); eyePos = current.pos; - eyePos.y += (f32)dItem_data::getH(m_itemNo) / 2; + eyePos.y += (f32)DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo)) / 2; attention_info.position = current.pos; @@ -431,7 +430,7 @@ int daItem_c::_daItem_delete() { } #if TARGET_PC - DeleteBase(dItem_fieldModelArc(m_itemNo)); + DeleteBase(dItem_fieldModelArc(getDisplayItemNo())); #else DeleteBase(dItem_data::getFieldArc(m_itemNo)); #endif @@ -604,8 +603,8 @@ void daItem_c::procInitBoomerangCarry() { scale = mItemScale; mBoomerangMove.initOffset(¤t.pos); - u8 height = dItem_data::getH(m_itemNo); - u8 radius = dItem_data::getR(m_itemNo); + u8 height = DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo)); + u8 radius = DUSK_IF_ELSE(getCollisionR(), dItem_data::getR(m_itemNo)); mCcCyl.SetR((f32)radius * 2.0f); mCcCyl.SetH((f32)height * 2.0f); mCcCyl.OnCoSPrmBit(1); @@ -936,10 +935,6 @@ void daItem_c::itemGet() { mItemOverridden = m_itemNo != mOriginalItemNo; #endif switch (m_itemNo) { -#if TARGET_PC - case dItemNo_UTAWA_HEART_e: - case dItemNo_KAKERA_HEART_e: -#endif case dItemNo_HEART_e: mDoAud_seStart(Z2SE_HEART_PIECE_GET, NULL, 0, 0); execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this)); @@ -981,9 +976,6 @@ void daItem_c::itemGet() { case dItemNo_PACHINKO_SHOT_e: mDoAud_seStart(Z2SE_CONSUMP_ITEM_GET, NULL, 0, 0); execItemGet(m_itemNo IF_DUSK_ARG(mItemGiveTag) IF_DUSK_ARG(this)); -#if TARGET_PC - break; -#endif default: #if TARGET_PC if (mItemOverridden) { diff --git a/src/d/actor/d_a_obj_life_container.cpp b/src/d/actor/d_a_obj_life_container.cpp index cd58c828dc..85553cda28 100644 --- a/src/d/actor/d_a_obj_life_container.cpp +++ b/src/d/actor/d_a_obj_life_container.cpp @@ -88,8 +88,8 @@ int daObjLife_c::Create() { mCcCyl.SetStts(&mCcStts); mCcCyl.SetCoHitCallback(lifeGetCoCallBack); mCcCyl.SetTgHitCallback(lifeGetTgCallBack); - mCcCyl.SetR(dItem_data::getR(m_itemNo)); - mCcCyl.SetH(dItem_data::getH(m_itemNo)); + mCcCyl.SetR(DUSK_IF_ELSE(getCollisionR(), dItem_data::getR(m_itemNo))); + mCcCyl.SetH(DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo))); fopAcM_SetCullSize(this, fopAc_CULLSPHERE_0_e); fopAcM_SetGravity(this, -3.2f); @@ -99,6 +99,15 @@ int daObjLife_c::Create() { mRotateSpeed = 7000; #if TARGET_PC + // Restore speeds that were skipped if created from a boss with create instead of fastCreate + auto bossItemSpeeds = dusk::mods::get_boss_item_actor_speeds(); + if (bossItemSpeeds.f != 0.f || bossItemSpeeds.y != 0.f) { + mOverrideHover = false; + speedF = bossItemSpeeds.f; + speed.y = bossItemSpeeds.y; + dusk::mods::set_boss_item_actor_speeds(0.f, 0.f); + } + if (mOverrideHover) { fopAcM_SetGravity(this, 0.0f); mRotateSpeed = 550; @@ -152,16 +161,30 @@ int daObjLife_c::create() { const u8 parameterItemNo = params & 0xFF; if (mItemGiveOriginalNo == dItemNo_NONE_e) { mOriginalItemNo = parameterItemNo; - const u8 resolvedItem = - dusk::mods::item_check_freestanding(getSaveBitNo(), mOriginalItemNo, this); mItemGiveTag = dusk::mods::item_give_tag_freestanding(getSaveBitNo()); - mItemOverridden = resolvedItem != mOriginalItemNo; + const auto [item, displayItem, was_resolved] = + dusk::mods::item_check_resolve(mItemGiveTag, mOriginalItemNo, this); + setDisplayItemNo(displayItem); + mItemOverridden = was_resolved; if (mItemOverridden) { - fopAcM_SetParam(this, (params & 0xFFFFFF00) | resolvedItem); + fopAcM_SetParam(this, (params & 0xFFFFFF00) | item); + } + } else if (mGoldenWolfItem) { + mOriginalItemNo = mItemGiveOriginalNo; + mItemGiveTag = dusk::mods::item_give_tag_golden_wolf(static_cast(field_0x938)); + const auto [item, displayItem, was_resolved] = + dusk::mods::item_check_resolve(mItemGiveTag, mOriginalItemNo, this); + setDisplayItemNo(displayItem); + mItemOverridden = was_resolved; + if (item != parameterItemNo) { + fopAcM_SetParam(this, (params & 0xFFFFFF00) | item); } } else { mOriginalItemNo = mItemGiveOriginalNo; - mItemOverridden = parameterItemNo != mItemGiveOriginalNo; + setDisplayItemNo( + dusk::mods::item_check_resolve(mItemGiveTag, parameterItemNo, this) + .display_item); + mItemOverridden = parameterItemNo != mOriginalItemNo; } mOverrideHover = mItemOverridden && @@ -187,8 +210,9 @@ int daObjLife_c::create() { #if TARGET_PC // Resolved items may have no field model; display their get-demo model instead. - const bool useGetModel = dItem_data::getFieldArc(m_itemNo) == NULL; - int phase_state = dComIfG_resLoad(&mPhase, dItem_fieldModelArc(m_itemNo)); + const u8 displayItemNo = getDisplayItemNo(); + const bool useGetModel = dItem_data::getFieldArc(displayItemNo) == NULL; + int phase_state = dComIfG_resLoad(&mPhase, dItem_fieldModelArc(displayItemNo)); if (phase_state == cPhs_COMPLEATE_e) { if (!fopAcM_entrySolidHeap( this, useGetModel ? CheckItemCreateHeap : CheckFieldItemCreateHeap, 0x4000)) @@ -411,8 +435,8 @@ int daObjLife_c::actionInitBoomerangCarry() { mCcCyl.OnTgSPrmBit(1); mCcCyl.OnCoSPrmBit(1); - f32 height = dItem_data::getH(m_itemNo) * 4.0f; - f32 radius = dItem_data::getR(m_itemNo) * 4.0f; + f32 height = DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo)) * 4.0f; + f32 radius = DUSK_IF_ELSE(getCollisionR(), dItem_data::getR(m_itemNo)) * 4.0f; mCcCyl.SetR(radius); mCcCyl.SetH(height); @@ -534,7 +558,7 @@ int daObjLife_c::_delete() { endEffect02(); #if TARGET_PC - DeleteBase(dItem_fieldModelArc(m_itemNo)); + DeleteBase(dItem_fieldModelArc(getDisplayItemNo())); #else DeleteBase(dItem_data::getFieldArc(m_itemNo)); #endif diff --git a/src/d/actor/d_a_obj_master_sword.cpp b/src/d/actor/d_a_obj_master_sword.cpp index 36fa786808..a1ef6b1709 100644 --- a/src/d/actor/d_a_obj_master_sword.cpp +++ b/src/d/actor/d_a_obj_master_sword.cpp @@ -151,11 +151,7 @@ void daObjMasterSword_c::create_init() { int daObjMasterSword_c::create() { fopAcM_ct(this, daObjMasterSword_c); -#if TARGET_PC - if (dComIfGs_isEventBit(dSv_event_flag_c::F_0264)) { -#else if (dComIfGs_isEventBit(dSv_event_flag_c::saveBitLabels[getFlagNo()])) { -#endif return cPhs_ERROR_e; } @@ -199,7 +195,7 @@ int daObjMasterSword_c::execute() { #if TARGET_PC const auto masterSword = dusk::mods::item_check_commit( ITEM_CHECK_MASTER_SWORD, dItemNo_MASTER_SWORD_e, this); - if (masterSword.itemNo == dItemNo_MASTER_SWORD_e) { + if (!masterSword.was_resolved) { dComIfGs_onItemFirstBit(dItemNo_MASTER_SWORD_e); dMeter2Info_setSword(dItemNo_MASTER_SWORD_e, false); dComIfGs_setSelectEquipSword(dItemNo_MASTER_SWORD_e); @@ -214,7 +210,7 @@ int daObjMasterSword_c::execute() { const auto shadowCrystal = dusk::mods::item_check_commit( ITEM_CHECK_SHADOW_CRYSTAL, dItemNo_SHADOW_CRYSTAL_e, this); - if (shadowCrystal.itemNo == dItemNo_SHADOW_CRYSTAL_e) { + if (!shadowCrystal.was_resolved) { execItemGet(shadowCrystal.itemNo, shadowCrystal.tag, this); } else if (shadowCrystal.itemNo == dItemNo_NONE_e) { dusk::mods::item_check_complete(shadowCrystal, this); @@ -222,15 +218,14 @@ int daObjMasterSword_c::execute() { dusk::mods::item_check_enqueue(shadowCrystal, dusk::mods::ItemGiveMode::Demo); } - dComIfGs_onEventBit(dSv_event_flag_c::F_0264); #else dComIfGs_onItemFirstBit(dItemNo_MASTER_SWORD_e); dMeter2Info_setSword(dItemNo_MASTER_SWORD_e, false); dComIfGs_setSelectEquipSword(dItemNo_MASTER_SWORD_e); dComIfGp_setItemLifeCount(dComIfGs_getMaxLife(), 0); - dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[getFlagNo()]); #endif + dComIfGs_onEventBit(dSv_event_flag_c::saveBitLabels[getFlagNo()]); fopAcM_delete(this); } diff --git a/src/d/actor/d_a_obj_smallkey.cpp b/src/d/actor/d_a_obj_smallkey.cpp index 9bf8face57..1fd6025ce6 100644 --- a/src/d/actor/d_a_obj_smallkey.cpp +++ b/src/d/actor/d_a_obj_smallkey.cpp @@ -1,6 +1,6 @@ /** * @file d_a_obj_smallkey.cpp - * + * */ #include "d/dolzel_rel.h" // IWYU pragma: keep @@ -119,9 +119,9 @@ int daKey_c::Create() { mCcCyl.SetStts(&mCcStts); mCcCyl.SetCoHitCallback(keyGetCoCallBack); mCcCyl.SetTgHitCallback(keyGetTgCallBack); - mCcCyl.SetR(dItem_data::getR(m_itemNo)); - mCcCyl.SetH(dItem_data::getH(m_itemNo)); - + mCcCyl.SetR(DUSK_IF_ELSE(getCollisionR(), dItem_data::getR(m_itemNo))); + mCcCyl.SetH(DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo))); + fopAcM_SetCullSize(this, fopAc_CULLSPHERE_0_e); if (getSwNo() == 0xFF) { @@ -155,7 +155,21 @@ int daKey_c::create() { mIsPrmInit = TRUE; } +#if TARGET_PC + mItemGiveTag = dusk::mods::item_give_tag_freestanding(getSaveBitNo()); + const auto [item, displayItem, _] = + dusk::mods::item_check_resolve(mItemGiveTag, dItemNo_SMALL_KEY_e, this); + m_itemNo = item; + if (m_itemNo == dItemNo_NONE_e) { + // Keep the pickup visible until the empty check is collected. + m_itemNo = dItemNo_SMALL_KEY_e; + setDisplayItemNo(dItemNo_NONE_e); + } else { + setDisplayItemNo(displayItem); + } +#else m_itemNo = dItemNo_SMALL_KEY_e; +#endif if (strcmp(dComIfGp_getStartStageName(), "F_SP118") == 0) { OS_REPORT(" SMKEY 0\n"); @@ -170,9 +184,21 @@ int daKey_c::create() { return cPhs_ERROR_e; } +#if TARGET_PC + const u8 displayItemNo = getDisplayItemNo(); + int phase_state = dComIfG_resLoad(&mPhase, dItem_fieldModelArc(displayItemNo)); +#else int phase_state = dComIfG_resLoad(&mPhase, dItem_data::getFieldArc(m_itemNo)); +#endif if (phase_state == cPhs_COMPLEATE_e) { +#if TARGET_PC + const bool useModelFallback = dItem_data::getFieldArc(displayItemNo) == NULL; + if (!fopAcM_entrySolidHeap( + this, useModelFallback ? CheckItemCreateHeap : CheckFieldItemCreateHeap, 0x4000)) + { +#else if (!fopAcM_entrySolidHeap(this, CheckFieldItemCreateHeap, 0x840)) { +#endif return cPhs_ERROR_e; } @@ -317,10 +343,26 @@ int daKey_c::initActionOrderGetDemo() { hide(); effectStop(); +#if TARGET_PC + const auto itemCheck = + dusk::mods::item_check_commit(mItemGiveTag, dItemNo_SMALL_KEY_e, this); + m_itemNo = itemCheck.itemNo; + if (m_itemNo == dItemNo_NONE_e) { + dusk::mods::item_check_complete(itemCheck, this); + dComIfGs_onTbox(getSaveBitNo()); + dTres_c::offStatus(getSaveBitNo(), 1); + dComIfGp_event_reset(); + fopAcM_delete(this); + return 1; + } +#endif + fopAcM_orderItemEvent(this, 0, 0); eventInfo.onCondition(8); - mItemId = fopAcM_createItemForTrBoxDemo(¤t.pos, m_itemNo, -1, fopAcM_GetRoomNo(this), NULL, NULL); + mItemId = fopAcM_createItemForTrBoxDemo( + ¤t.pos, m_itemNo, -1, fopAcM_GetRoomNo(this), NULL, + NULL IF_DUSK_ARG(itemCheck.tag)); JUT_ASSERT(699, mItemId != fpcM_ERROR_PROCESS_ID_e); setStatus(STATUS_ORDER_GET_DEMO_e); @@ -387,8 +429,8 @@ int daKey_c::actionInitBoomerangCarry() { mCcCyl.OnTgSPrmBit(1); mCcCyl.OnCoSPrmBit(1); - u8 height = dItem_data::getH(m_itemNo); - u8 radius = dItem_data::getR(m_itemNo); + u8 height = DUSK_IF_ELSE(getCollisionH(), dItem_data::getH(m_itemNo)); + u8 radius = DUSK_IF_ELSE(getCollisionR(), dItem_data::getR(m_itemNo)); mCcCyl.SetR(4.0f * radius); mCcCyl.SetH(4.0f * height); @@ -527,7 +569,11 @@ int daKey_c::draw() { int daKey_c::_delete() { effectStop(); +#if TARGET_PC + DeleteBase(dItem_fieldModelArc(getDisplayItemNo())); +#else DeleteBase(dItem_data::getFieldArc(m_itemNo)); +#endif return 1; } diff --git a/src/d/actor/d_a_player.cpp b/src/d/actor/d_a_player.cpp index 48ad37e2ec..e10f7e490c 100644 --- a/src/d/actor/d_a_player.cpp +++ b/src/d/actor/d_a_player.cpp @@ -224,6 +224,12 @@ daPy_anmHeap_c::~daPy_anmHeap_c() { if (mAnimeHeap != NULL) { mDoExt_destroySolidHeap(mAnimeHeap); } +#if TARGET_PC + freeTempBuffers(); + if (mOwnedBuffer != NULL) { + JKRFreeToSysHeap(mOwnedBuffer); + } +#endif } void daPy_anmHeap_c::initData() { @@ -237,6 +243,56 @@ void* daPy_anmHeap_c::mallocBuffer() { return mBuffer; } +#if TARGET_PC +constexpr u32 kAlignment = 0x20; + +void daPy_anmHeap_c::reserveBuffer(u16 i_resId) { + // Ensure mBuffer is large enough to hold the resource + u32 size = daPy_getAnmResourceSize(i_resId, mBufferSize); + if (size <= mBufferSize) { + return; + } + + // If not, replace it with a new buffer allocated from the system heap. Callers still copy + // archive data in on every load: setAnmTransform bswaps key tables in place, so we can't point + // it at the archive's cached copy directly. + u8* buffer = static_cast(JKRAllocFromSysHeap(size, kAlignment)); + JUT_ASSERT(__LINE__, buffer != NULL); + if (mOwnedBuffer != NULL) { + JKRFreeToSysHeap(mOwnedBuffer); + } + mOwnedBuffer = buffer; // Mark it as owned so we release it later + mBuffer = buffer; + mBufferSize = size; +} + +void* daPy_anmHeap_c::allocTempBuffer(u16 i_resId, u32* io_size) { + // Check if the resource can fit in io_size + u32 size = daPy_getAnmResourceSize(i_resId, *io_size); + if (size <= *io_size) { + return JKR_NEW_ARRAY_ARGS(u8, *io_size, kAlignment); + } + + // If not, allocate a new temp buffer from the system heap, plus kAlignment extra bytes. + // We stash a pointer to the next buffer at the beginning, forming a chain so we can free + // them all later. + void** temp = static_cast(JKRAllocFromSysHeap(kAlignment + size, kAlignment)); + JUT_ASSERT(__LINE__, temp != NULL); + *temp = mTempBuffers; + mTempBuffers = temp; + *io_size = size; + return reinterpret_cast(temp) + kAlignment; +} + +void daPy_anmHeap_c::freeTempBuffers() { + while (mTempBuffers != NULL) { + void** temp = mTempBuffers; + mTempBuffers = static_cast(*temp); + JKRFreeToSysHeap(temp); + } +} +#endif + void daPy_anmHeap_c::createHeap(daPy_anmHeap_c::daAlinkHEAP_TYPE i_heapType, const char* name) { u32 size; @@ -310,6 +366,7 @@ void* daPy_anmHeap_c::loadData(u16 i_resId) { }; if (mArcNo == 0xFFFF) { + IF_DUSK(reserveBuffer(i_resId);) JKRReadIdxResource(mBuffer, mBufferSize, i_resId, dComIfGp_getAnmArchive()); #if DEBUG daPy_aramBufferCheck(mBuffer, mBufferSize); @@ -363,35 +420,12 @@ void* daPy_anmHeap_c::loadDataDemoRID(u16 i_resID, u16 i_arcNo) { JKRHeap* daPy_anmHeap_c::setAnimeHeap() { mAnimeHeap->freeAll(); + IF_DUSK(freeTempBuffers();) return mDoExt_setCurrentHeap(mAnimeHeap); } #if !PLATFORM_WII -#if TARGET_PC -#include "dusk/dvd_asset.hpp" -using GameVersion = dusk::version::GameVersion; -static const u8* l_sightDL_get() { - static u8 buf[0x89]; - static bool _ = ( - dusk::LoadDolAsset( - buf, - { - {GameVersion::GcnUsa, 0x803BA0C0}, - {GameVersion::GcnPal, 0x803BBDA0}, - {GameVersion::GcnJpn, 0x803B4220}, - {GameVersion::WiiUsaRev0, 0x803F63C0}, - {GameVersion::WiiUsa, 0x803E1640}, - {GameVersion::WiiPal, 0x803E23A0}, - {GameVersion::WiiJpn, 0x803DF600} - }, - 0x89 - ), - true - ); - return buf; -} -#define l_sightDL (l_sightDL_get()) -#else +#if !TARGET_PC #include "assets/l_sightDL__d_a_player.h" #endif @@ -435,7 +469,33 @@ void daPy_sightPacket_c::draw() { GXLoadPosMtxImm(mProjMtx, GX_PNMTX0); GXSetCurrentMtx(0); GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); +#if TARGET_PC + GXSetNumTexGens(1); + GXSetNumTevStages(1); + GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, GX_IDENTITY); + GXSetCullMode(GX_CULL_NONE); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, 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); + 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_INVSRCALPHA, GX_LO_CLEAR); + GXSetZMode(GX_FALSE, GX_LEQUAL, GX_FALSE); + GXSetColorUpdate(GX_TRUE); + GXSetAlphaUpdate(GX_FALSE); + GXSetDither(GX_TRUE); + GXBegin(GX_TRIANGLESTRIP, GX_VTXFMT0, 4); + GXPosition3u8(1, 1, 0); + GXTexCoord2u8(1, 1); + GXPosition3u8(255, 1, 0); + GXTexCoord2u8(0, 1); + GXPosition3u8(1, 255, 0); + GXTexCoord2u8(1, 0); + GXPosition3u8(255, 255, 0); + GXTexCoord2u8(0, 0); + GXEnd(); +#else GXCallDisplayList(l_sightDL, 0x80); +#endif J3DShape::resetVcdVatCache(); } diff --git a/src/d/actor/d_a_shop_item.cpp b/src/d/actor/d_a_shop_item.cpp index 3e768a1684..edd16b9ecf 100644 --- a/src/d/actor/d_a_shop_item.cpp +++ b/src/d/actor/d_a_shop_item.cpp @@ -105,17 +105,20 @@ const char* daShopItem_c::getShopArcname() { #if TARGET_PC if (m_itemNo != dItemNo_NONE_e && mItemGiveOriginalNo == dItemNo_NONE_e) { mItemGiveOriginalNo = m_itemNo; - const u8 resolvedItem = dusk::mods::item_check_shop(mItemGiveOriginalNo, this); - mItemOverridden = resolvedItem != mItemGiveOriginalNo; + mItemGiveTag = dusk::mods::item_give_tag_shop(mItemGiveOriginalNo); + const auto [_, displayItem, was_resolved] = + dusk::mods::item_check_resolve(mItemGiveTag, mItemGiveOriginalNo, this); + setDisplayItemNo(displayItem); + mItemOverridden = displayItem != mItemGiveOriginalNo; if (mItemOverridden) { mOverrideData = mData[mShopItemID]; - mOverrideData.mArcName = dItem_data::getArcName(resolvedItem); - mOverrideData.mBmdName = dItem_data::getBmdName(resolvedItem); - mOverrideData.mBtkName = dItem_data::getBtkName(resolvedItem); - mOverrideData.mBckName = dItem_data::getBckName(resolvedItem); - mOverrideData.mBrkName = dItem_data::getBrkName(resolvedItem); - mOverrideData.mBtpName = dItem_data::getBtpName(resolvedItem); - mOverrideData.mTevFrm = dItem_data::getTevFrm(resolvedItem); + mOverrideData.mArcName = dItem_data::getArcName(displayItem); + mOverrideData.mBmdName = dItem_data::getBmdName(displayItem); + mOverrideData.mBtkName = dItem_data::getBtkName(displayItem); + mOverrideData.mBckName = dItem_data::getBckName(displayItem); + mOverrideData.mBrkName = dItem_data::getBrkName(displayItem); + mOverrideData.mBtpName = dItem_data::getBtpName(displayItem); + mOverrideData.mTevFrm = dItem_data::getTevFrm(displayItem); mOverrideData.mBtpFrm = -1; mOverrideData.mFlag = static_cast(-1); mOverrideData.mOffsetY = mShopItemID == SHOP_ITEMNO_ARMOR ? 60.0f : 15.0f; diff --git a/src/d/d_a_itembase_static.cpp b/src/d/d_a_itembase_static.cpp index 9bdd933f5f..ec3610a787 100644 --- a/src/d/d_a_itembase_static.cpp +++ b/src/d/d_a_itembase_static.cpp @@ -50,7 +50,7 @@ bool daItemBase_c::chkDead() { int CheckItemCreateHeap(fopAc_ac_c* i_this) { daItemBase_c* a_this = static_cast(i_this); - u8 item_no = a_this->getItemNo(); + u8 item_no = DUSK_IF_ELSE(a_this->getDisplayItemNo(), a_this->getItemNo()); return a_this->CreateItemHeap(dItem_data::getArcName(item_no), dItem_data::getBmdName(item_no), dItem_data::getBtkName(item_no), dItem_data::getBpkName(item_no), dItem_data::getBckName(item_no), dItem_data::getBxaName(item_no), @@ -67,7 +67,7 @@ const char* dItem_fieldModelArc(u8 itemNo) { int CheckFieldItemCreateHeap(fopAc_ac_c* i_this) { daItemBase_c* a_this = static_cast(i_this); - u8 item_no = a_this->getItemNo(); + u8 item_no = DUSK_IF_ELSE(a_this->getDisplayItemNo(), a_this->getItemNo()); return a_this->CreateItemHeap( dItem_data::getFieldArc(item_no), dItem_data::getItemBmdName(item_no), dItem_data::getItemBtkName(item_no), dItem_data::getItemBpkName(item_no), diff --git a/src/d/d_bright_check.cpp b/src/d/d_bright_check.cpp index 7ec4f09b10..b9ea46e58e 100644 --- a/src/d/d_bright_check.cpp +++ b/src/d/d_bright_check.cpp @@ -191,6 +191,14 @@ void dBrightCheck_c::modeMove() { mDoAud_seStart(Z2SE_ENTER_GAME, NULL, 0, 0); #ifdef TARGET_PC toggleAutoSave(true); + + if (!dusk::getSettings().game.hideTvSettingsScreen) { + const dusk::gamemode::GameMode* gameMode = + dusk::gamemode::getGameModeManager().getCurrentGameMode(); + if (gameMode) { + gameMode->invokeOnSaveLoadedFunction(); + } + } #endif mCompleteCheck = true; mMode = MODE_WAIT_e; diff --git a/src/d/d_camera.cpp b/src/d/d_camera.cpp index 7842c9fa9b..14eb9a487e 100644 --- a/src/d/d_camera.cpp +++ b/src/d/d_camera.cpp @@ -30,6 +30,7 @@ #if TARGET_PC #include "dusk/camera_operators.hpp" +#include "dusk/commands.hpp" #include "dusk/frame_interpolation.h" #include "dusk/logging.h" #include "dusk/action_bindings.h" @@ -1054,6 +1055,11 @@ void dCamera_c::debugDrawInit() { bool dCamera_c::Run() { #if TARGET_PC ResetView(); + if (dusk::isCameraDetached()) { + mFrameCounter++; + mTicks++; + return true; + } if (executeDebugFlyCam() || dusk::mods::camera_run_operators(this)) { mFrameCounter++; mTicks++; @@ -7601,7 +7607,7 @@ bool dCamera_c::executeDebugFlyCam() { if (ImGui::IsKeyDown(ImGuiKey_Q)) rollInput -= 1.0f; if (ImGui::IsKeyDown(ImGuiKey_E)) rollInput += 1.0f; } - bool mouseValid = !io.WantCaptureMouse && io.MousePos.x >= 0.0f && io.MousePos.y >= 0.0f; + bool mouseValid = !io.WantCaptureMouse && io.MousePos.x >= 0.0f && io.MousePos.y >= 0.0f && ImGui::IsMouseDown(ImGuiMouseButton_Right); if (mouseValid && sFlyCamLastMousePos.x >= 0.0f) { cStickX -= (io.MousePos.x - sFlyCamLastMousePos.x) * 2.0f; cStickY -= (io.MousePos.y - sFlyCamLastMousePos.y) * 2.0f; @@ -11129,6 +11135,9 @@ camera_class* dCam_getCamera() { dCamera_c* dCam_getBody() { camera_process_class* camera = (camera_process_class*)dCam_getCamera(); +#if TARGET_PC + if (camera == nullptr) { return nullptr; } +#endif return &camera->mCamera; } diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 61aa0dc179..ecd0b796a0 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -1503,7 +1503,11 @@ static void dummy1() { } BOOL dComIfGs_isStageTbox(int i_stageNo, int i_no) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif return dComIfGs_isTbox(i_no); } else { return dComIfGs_isSaveTbox(i_stageNo, i_no); @@ -1511,7 +1515,11 @@ BOOL dComIfGs_isStageTbox(int i_stageNo, int i_no) { } void dComIfGs_onStageSwitch(int i_stageNo, int i_no) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif dComIfGs_onSwitch(i_no, -1); } @@ -1527,7 +1535,11 @@ void dComIfGs_offStageSwitch(int i_stageNo, int i_no) { } BOOL dComIfGs_isStageSwitch(int i_stageNo, int i_no) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif return dComIfGs_isSwitch(i_no, -1); } else { return dComIfGs_isSaveSwitch(i_stageNo, i_no); @@ -1535,7 +1547,11 @@ BOOL dComIfGs_isStageSwitch(int i_stageNo, int i_no) { } void dComIfGs_onDungeonItemMap(int i_stageNo) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif dComIfGs_onDungeonItemMap(); } @@ -1551,7 +1567,11 @@ void dComIfGs_offDungeonItemMap(int i_stageNo) { } s32 dComIfGs_isDungeonItemMap(int i_stageNo) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif return dComIfGs_isDungeonItemMap(); } @@ -1559,7 +1579,11 @@ s32 dComIfGs_isDungeonItemMap(int i_stageNo) { } void dComIfGs_onDungeonItemCompass(int i_stageNo) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif dComIfGs_onDungeonItemCompass(); } @@ -1575,7 +1599,11 @@ void dComIfGs_offDungeonItemCompass(int i_stageNo) { } s32 dComIfGs_isDungeonItemCompass(int i_stageNo) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif return dComIfGs_isDungeonItemCompass(); } @@ -1583,7 +1611,11 @@ s32 dComIfGs_isDungeonItemCompass(int i_stageNo) { } void dComIfGs_onDungeonItemBossKey(int i_stageNo) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif dComIfGs_onDungeonItemBossKey(); } @@ -1599,7 +1631,11 @@ void dComIfGs_offDungeonItemBossKey(int i_stageNo) { } s32 dComIfGs_isDungeonItemBossKey(int i_stageNo) { +#if TARGET_PC + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif return dComIfGs_isDungeonItemBossKey(); } @@ -2996,6 +3032,3602 @@ DUSK_GAME_DATA GXColor g_whiteColor = {255, 255, 255, 255}; DUSK_GAME_DATA GXColor g_saftyWhiteColor = {160, 160, 160, 255}; #if TARGET_PC +dSv_info_c* dComIfGs_getSaveInfo() { + return &g_dComIfG_gameInfo.info; +} + +dSv_save_c* dComIfGs_getSaveData() { + return &g_dComIfG_gameInfo.info.getSavedata(); +} + +u16 dComIfGs_getMaxLife() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getMaxLife(); +} + +void dComIfGs_setMaxLife(u8 i_maxLife) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setMaxLife(i_maxLife); +} + +u16 dComIfGs_getLife() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getLife(); +} + +void dComIfGs_setLife(u16 i_life) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setLife(i_life); +} + +u16 dComIfGs_getRupee() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getRupee(); +} + +void dComIfGs_setRupee(u16 i_rupees) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setRupee(i_rupees); +} + +u16 dComIfGs_getMaxOil() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getMaxOil(); +} + +void dComIfGs_setMaxOil(u16 i_maxOil) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setMaxOil(i_maxOil); +} + +u16 dComIfGs_getOil() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getOil(); +} + +void dComIfGs_setOil(u16 i_oil) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setOil(i_oil); +} + +u8 dComIfGs_getSelectEquipClothes() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_CLOTHING); +} + +u8 dComIfGs_getSelectEquipSword() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SWORD); +} + +u8 dComIfGs_getSelectEquipShield() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SHIELD); +} + +u8 dComIfGs_getCollectSmell() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SMELL); +} + +void dComIfGs_setCollectSmell(u8 smell) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setSelectEquip(COLLECT_SMELL, smell); +} + +u8 dComIfGs_getBButtonItemKey() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(B_BUTTON_ITEM); +} + +void dComIfGs_setBButtonItemKey(u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setSelectEquip(B_BUTTON_ITEM, i_itemNo); +} + +u8 dComIfGs_getWalletSize() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getWalletSize(); +} + +void dComIfGs_setWalletSize(u8 i_size) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setWalletSize(i_size); +} + +u8 dComIfGs_getMaxMagic() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getMaxMagic(); +} + +void dComIfGs_setMaxMagic(u8 i_maxMagic) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setMaxMagic(i_maxMagic); +} + +u8 dComIfGs_getMagic() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getMagic(); +} + +void dComIfGs_setMagic(u8 i_magic) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setMagic(i_magic); +} + +u8 dComIfGs_getTransformStatus() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getTransformStatus(); +} + +void dComIfGs_setTransformStatus(u8 i_status) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setTransformStatus(i_status); +} + +u8 dComIfGs_getSelectItemIndex(int i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectItemIndex(i_no); +} + +u16 dComIfGs_getRupeeMax() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getRupeeMax(); +} + +void dComIfGs_offGetMagicUseFlag() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().offMagicFlag(0); +} + +s32 dComIfGs_isGetMagicUseFlag() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().isMagicFlag(0); +} + +f32 dComIfGs_getTime() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().getTime(); +} + +void dComIfGs_setTime(f32 i_time) { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().setTime(i_time); +} + +u16 dComIfGs_getDate() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().getDate(); +} + +void dComIfGs_setDate(u16 i_date) { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().setDate(i_date); +} + +void dComIfGs_onDarkClearLV(int i_no) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().onDarkClearLV(i_no); +} + +void dComIfGs_offDarkClearLV(int i_no) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().offDarkClearLV(i_no); +} + +BOOL dComIfGs_isDarkClearLV(int i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isDarkClearLV(i_no); +} + +void dComIfGs_onTransformLV(int i_no) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().onTransformLV(i_no); +} + +void dComIfGs_offTransformLV(int i_no) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().offTransformLV(i_no); +} + +BOOL dComIfGs_isTransformLV(int i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isTransformLV(i_no); +} + +cXyz dComIfGs_getHorseRestartPos() { + return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getPos(); +} + +s16 dComIfGs_getHorseRestartAngleY() { + return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getAngleY(); +} + +const char* dComIfGs_getHorseRestartStageName() { + return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getStageName(); +} + +s8 dComIfGs_getHorseRestartRoomNo() { + return g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().getRoomNo(); +} + +void dComIfGs_setHorseRestart(const char* i_stageName, cXyz& i_pos, s16 i_angle, s8 i_roomNo) { + g_dComIfG_gameInfo.info.getPlayer().getHorsePlace().set(i_stageName, i_pos, i_angle, i_roomNo); +} + +cXyz dComIfGs_getPlayerFieldLastStayPos() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getPos(); +} + +s16 dComIfGs_getPlayerFieldLastStayAngleY() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getAngleY(); +} + +char* dComIfGs_getPlayerFieldLastStayName() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getName(); +} + +u8 dComIfGs_getPlayerFieldLastStayRegionNo() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().getRegionNo(); +} + +bool dComIfGs_isPlayerFieldLastStayFieldDataExistFlag() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().isFieldDataExistFlag(); +} + +void dComIfGs_offPlayerFieldLastStayFieldDataExistFlag() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().offFieldDataExistFlag(); +} + +void dComIfGs_onPlayerFieldLastStayFieldDataExistFlag() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().onFieldDataExistFlag(); +} + +BOOL dComIfGs_isRegionBit(int i_region) { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().isRegionBit(i_region); +} + +void dComIfGs_onRegionBit(int i_region) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().onRegionBit(i_region); +} + +void dComIfGs_setPlayerFieldLastStayInfo( + const char* i_stage, cXyz& i_pos, s16 i_angle, s8 i_point, u8 i_region) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().set( + i_stage, i_pos, i_angle, i_point, i_region); +} + +cXyz dComIfGs_getLastWarpMarkPlayerPos() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getPos(); +} + +s16 dComIfGs_getLastWarpMarkPlayerAngleY() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getAngleY(); +} + +const char* dComIfGs_getLastWarpMarkStageName() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getName(); +} + +u8 dComIfGs_getLastWarpMarkRoomNo() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getRoomNo(); +} + +s8 dComIfGs_getLastWarpAcceptStage() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().getWarpAcceptStage(); +} + +void dComIfGs_setLastWarpAcceptStage(s8 param_0) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().setWarpAcceptStage(param_0); +} + +void dComIfGs_resetLastWarpAcceptStage() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerLastMarkInfo().resetWarpAcceptStage(); +} + +void dComIfGs_setItem(int i_slotNo, u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setItem(i_slotNo, i_itemNo); +} + +u8 dComIfGs_getItem(int i_slotNo, bool i_checkCombo) { + return g_dComIfG_gameInfo.info.getPlayer().getItem().getItem(i_slotNo, i_checkCombo); +} + +void dComIfGs_setLineUpItem() { + g_dComIfG_gameInfo.info.getPlayer().getItem().setLineUpItem(); +} + +u8 dComIfGs_getLineUpItem(int i_slotNo) { + return g_dComIfG_gameInfo.info.getPlayer().getItem().getLineUpItem(i_slotNo); +} + +void dComIfGs_setBottleItemIn(u8 curItem, u8 newItem) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setBottleItemIn(curItem, newItem); +} + +void dComIfGs_setEmptyBottleItemIn(u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBottleItemIn(i_itemNo); +} + +void dComIfGs_setEmptyBottle() { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBottle(); +} + +void dComIfGs_setEmptyBottle(u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBottle(i_itemNo); +} + +void dComIfGs_setEquipBottleItemIn(u8 i_curItem, u8 i_newItem) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEquipBottleItemIn(i_curItem, i_newItem); +} + +void dComIfGs_setEquipBottleItemEmpty(u8 i_curItem) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEquipBottleItemEmpty(i_curItem); +} + +u8 dComIfGs_checkBottle(u8 i_itemNo) { + return g_dComIfG_gameInfo.info.getPlayer().getItem().checkBottle(i_itemNo); +} + +u8 dComIfGs_checkInsectBottle() { + return g_dComIfG_gameInfo.info.getPlayer().getItem().checkInsectBottle(); +} + +u8 dComIfGs_checkEmptyBottle() { + return g_dComIfG_gameInfo.info.getPlayer().getItem().checkEmptyBottle(); +} + +void dComIfGs_setEmptyBombBagItemIn(u8 i_newBomb, bool i_setNum) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBombBagItemIn(i_newBomb, i_setNum); +} + +void dComIfGs_setEmptyBombBagItemIn(u8 i_newBomb, u8 i_bombNum, bool i_setNum) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBombBagItemIn( + i_newBomb, i_bombNum, i_setNum); +} + +void dComIfGs_setEmptyBombBag() { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBombBag(); +} + +void dComIfGs_setEmptyBombBag(u8 i_newBomb, u8 i_bombNum) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setEmptyBombBag(i_newBomb, i_bombNum); +} + +u8 dComIfGs_checkBombBag(u8 i_itemNo) { + return g_dComIfG_gameInfo.info.getPlayer().getItem().checkBombBag(i_itemNo); +} + +void dComIfGs_setWarashibeItem(u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setWarashibeItem(i_itemNo); +} + +void dComIfGs_setRodTypeLevelUp() { + g_dComIfG_gameInfo.info.getPlayer().getItem().setRodTypeLevelUp(); +} + +void dComIfGs_setBaitItem(u8 i_item) { + g_dComIfG_gameInfo.info.getPlayer().getItem().setBaitItem(i_item); +} + +void dComIfGs_onItemFirstBit(u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getGetItem().onFirstBit(i_itemNo); +} + +void dComIfGs_offItemFirstBit(u8 i_itemNo) { + g_dComIfG_gameInfo.info.getPlayer().getGetItem().offFirstBit(i_itemNo); +} + +int dComIfGs_isItemFirstBit(u8 i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getGetItem().isFirstBit(i_no); +} + +u8 dComIfGs_getArrowNum() { + return g_dComIfG_gameInfo.info.getPlayer().getItemRecord().getArrowNum(); +} + +void dComIfGs_setArrowNum(u8 i_arrowNum) { + g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setArrowNum(i_arrowNum); +} + +u8 dComIfGs_getPachinkoNum() { + return g_dComIfG_gameInfo.info.getPlayer().getItemRecord().getPachinkoNum(); +} + +void dComIfGs_setPachinkoNum(u8 i_num) { + g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setPachinkoNum(i_num); +} + +u8 dComIfGs_getPachinkoMax() { + return 50; +} + +void dComIfGs_setBombNum(u8 i_num) { + g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setBombNum(0, i_num); +} + +void dComIfGs_setBombNum(u8 i_bagIdx, u8 i_bombNum) { + g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setBombNum(i_bagIdx, i_bombNum); +} + +u8 dComIfGs_getBombNum(u8 i_bagIdx) { + return g_dComIfG_gameInfo.info.getPlayer().getItemRecord().getBombNum(i_bagIdx); +} + +void dComIfGs_setBottleNum(u8 i_bottleIdx, u8 i_bottleNum) { + g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setBottleNum(i_bottleIdx, i_bottleNum); +} + +void dComIfGs_addBottleNum(u8 i_bottleIdx, s16 i_num) { + g_dComIfG_gameInfo.info.getPlayer().getItemRecord().addBottleNum(i_bottleIdx, i_num); +} + +u8 dComIfGs_getBottleNum(u8 i_bottleIdx) { + return g_dComIfG_gameInfo.info.getPlayer().getItemRecord().getBottleNum(i_bottleIdx); +} + +u8 dComIfGs_getArrowMax() { + return g_dComIfG_gameInfo.info.getPlayer().getItemMax().getArrowNum(); +} + +void dComIfGs_setArrowMax(u8 i_arrowMax) { + g_dComIfG_gameInfo.info.getPlayer().getItemMax().setArrowNum(i_arrowMax); +} + +void dComIfGs_setBombMax(u8 i_max) { + g_dComIfG_gameInfo.info.getPlayer().getItemMax().setBombNum(0, i_max); +} + +void dComIfGs_setBombMax(u8 i_type, u8 i_max) { + g_dComIfG_gameInfo.info.getPlayer().getItemMax().setBombNum(i_type, i_max); +} + +u8 dComIfGs_getBombMax() { + return g_dComIfG_gameInfo.info.getPlayer().getItemMax().getBombNum(0); +} + +u8 dComIfGs_getBombMax(u8 i_bombType) { + return g_dComIfG_gameInfo.info.getPlayer().getItemMax().getBombNum(i_bombType); +} + +void dComIfGs_setPohSpiritNum(u8 i_num) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().setPohNum(i_num); +} + +u8 dComIfGs_getPohSpiritNum() { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().getPohNum(); +} + +void dComIfGs_addPohSpiritNum() { + g_dComIfG_gameInfo.info.getPlayer().getCollect().addPohNum(); +} + +BOOL dComIfGs_isCollectClothes(u8 i_clothesNo) { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect( + COLLECT_CLOTHING, i_clothesNo); +} + +void dComIfGs_setCollectClothes(u8 i_clothesNo) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().setCollect(COLLECT_CLOTHING, i_clothesNo); +} + +void dComIfGs_setCollectSword(u8 i_swordNo) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().setCollect(COLLECT_SWORD, i_swordNo); +} + +void dComIfGs_setCollectShield(u8 i_shieldNo) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().setCollect(COLLECT_SHIELD, i_shieldNo); +} + +BOOL dComIfGs_isCollectClothing(u8 i_clothesNo) { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect( + COLLECT_CLOTHING, i_clothesNo); +} + +void dComIfGs_offCollectClothes(u8 i_clothesNo) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollect(COLLECT_CLOTHING, i_clothesNo); +} + +BOOL dComIfGs_isCollectSword(u8 i_swordNo) { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect(COLLECT_SWORD, i_swordNo); +} + +void dComIfGs_offCollectSword(u8 i_swordNo) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollect(COLLECT_SWORD, i_swordNo); +} + +BOOL dComIfGs_isCollectShield(u8 i_item) { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollect(COLLECT_SHIELD, i_item); +} + +void dComIfGs_offCollectShield(u8 i_shieldNo) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollect(COLLECT_SHIELD, i_shieldNo); +} + +void dComIfGs_onCollectCrystal(u8 i_item) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().onCollectCrystal(i_item); +} + +void dComIfGs_offCollectCrystal(u8 i_item) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollectCrystal(i_item); +} + +bool dComIfGs_isCollectCrystal(u8 i_item) { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollectCrystal(i_item); +} + +void dComIfGs_onCollectMirror(u8 i_item) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().onCollectMirror(i_item); +} + +void dComIfGs_offCollectMirror(u8 i_item) { + g_dComIfG_gameInfo.info.getPlayer().getCollect().offCollectMirror(i_item); +} + +bool dComIfGs_isCollectMirror(u8 i_item) { + return g_dComIfG_gameInfo.info.getPlayer().getCollect().isCollectMirror(i_item); +} + +void dComIfGs_setLightDropNum(u8 i_level, u8 i_num) { + g_dComIfG_gameInfo.info.getPlayer().getLightDrop().setLightDropNum(i_level, i_num); +} + +u8 dComIfGs_getLightDropNum(u8 i_nowLevel) { + return g_dComIfG_gameInfo.info.getPlayer().getLightDrop().getLightDropNum(i_nowLevel); +} + +void dComIfGs_onLightDropGetFlag(u8 i_nowLevel) { + g_dComIfG_gameInfo.info.getPlayer().getLightDrop().onLightDropGetFlag(i_nowLevel); +} + +void dComIfGs_offLightDropGetFlag(u8 i_level) { + g_dComIfG_gameInfo.info.getPlayer().getLightDrop().offLightDropGetFlag(i_level); +} + +BOOL dComIfGs_isLightDropGetFlag(u8 i_nowLevel) { + return g_dComIfG_gameInfo.info.getPlayer().getLightDrop().isLightDropGetFlag(i_nowLevel); +} + +void dComIfGs_onLetterGetFlag(int i_no) { + g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().onLetterGetFlag(i_no); +} + +BOOL dComIfGs_isLetterGetFlag(int i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().isLetterGetFlag(i_no); +} + +void dComIfGs_onLetterReadFlag(int i_no) { + g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().onLetterReadFlag(i_no); +} + +int dComIfGs_isLetterReadFlag(int i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().isLetterReadFlag(i_no); +} + +u8 dComIfGs_getGetNumber(int i_no) { + return g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().getGetNumber(i_no); +} + +void dComIfGs_setGetNumber(int i_no, u8 i_value) { + g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setGetNumber(i_no, i_value); +} + +void dComIfGs_addFishNum(u8 param_0) { + g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().addFishCount(param_0); +} + +u16 dComIfGs_getFishNum(u8 param_0) { + return g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().getFishCount(param_0); +} + +u8 dComIfGs_getFishSize(u8 param_0) { + return g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().getMaxSize(param_0); +} + +void dComIfGs_setFishSize(u8 param_0, u8 param_1) { + g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().setMaxSize(param_0, param_1); +} + +OSTime dComIfGs_getTotalTime() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getTotalTime(); +} + +void dComIfGs_addDeathCount() { + g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().addDeathCount(); +} + +u16 dComIfGs_getDeathCount() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getDeathCount(); +} + +TEXT_SPAN dComIfGs_getPlayerName() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getPlayerName(); +} + +void dComIfGs_setPlayerName(const char* i_name) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setPlayerName(i_name); +} + +TEXT_SPAN dComIfGs_getHorseName() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getHorseName(); +} + +void dComIfGs_setHorseName(const char* i_name) { + g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setHorseName(i_name); +} + +u8 dComIfGs_getClearCount() { + return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getClearCount(); +} + +// Ruby inline names are from TWW debug. +u8 dComIfGs_getOptRuby() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getRuby(); +} + +void dComIfGs_setOptRuby(u8 i_ruby) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setRuby(i_ruby); +} + +u8 dComIfGs_getOptAttentionType() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getAttentionType(); +} + +void dComIfGs_setOptAttentionType(u8 i_attentionType) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setAttentionType(i_attentionType); +} + +void dComIfGs_setOptCalibrateDist(u16 i_calibrateDist) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalibrateDist(i_calibrateDist); +} + +void dComIfGs_setOptCalValue(s8 i_calValue) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setCalValue(i_calValue); +} + +u8 dComIfGs_getOptCameraControl() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getCameraControl(); +} + +void dComIfGs_setOptCameraControl(u8 i_cameraControl) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setCameraControl(i_cameraControl); +} + +u8 dComIfGs_getOptPointer() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPointer(); +} + +void dComIfGs_setOptPointer(u8 i_pointer) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setPointer(i_pointer); +} + +u8 dComIfGs_checkOptVibration() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().checkVibration(); +} + +u8 dComIfGs_getOptSound() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getSound(); +} + +void dComIfGs_setOptSound(u8 i_mode) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setSound(i_mode); +} + +u8 dComIfGs_getOptVibration() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getVibration(); +} + +void dComIfGs_setOptVibration(u8 i_status) { + g_dComIfG_gameInfo.info.getPlayer().getConfig().setVibration(i_status); +} + +u8 dComIfGs_getPalLanguage() { + return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPalLanguage(); +} + +BOOL dComIfGs_isSaveTbox(int i_stageNo, int i_no) { + return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isTbox(i_no); +} + +void dComIfGs_onSaveSwitch(int i_stageNo, int i_no) { + g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().onSwitch(i_no); +} + +void dComIfGs_offSaveSwitch(int i_stageNo, int i_no) { + g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().offSwitch(i_no); +} + +BOOL dComIfGs_isSaveSwitch(int i_stageNo, int i_no) { + return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isSwitch(i_no); +} + +void dComIfGs_onSaveVisitedRoom(int param_0, int i_roomNo) { + return g_dComIfG_gameInfo.info.getSavedata().getSave2(param_0)->onVisitedRoom(i_roomNo); +} + +void dComIfGs_offSaveVisitedRoom(int param_0, int i_roomNo) { + return g_dComIfG_gameInfo.info.getSavedata().getSave2(param_0)->offVisitedRoom(i_roomNo); +} + +BOOL dComIfGs_isSaveVisitedRoom(int param_0, int i_roomNo) { + return g_dComIfG_gameInfo.info.getSavedata().getSave2(param_0)->isVisitedRoom(i_roomNo); +} + +void* dComIfGs_getPEventBit() { + return g_dComIfG_gameInfo.info.getEvent().getPEventBit(); +} + +void dComIfGs_onEventBit(const u16 i_flag) { + g_dComIfG_gameInfo.info.getEvent().onEventBit(i_flag); +} + +void dComIfGs_offEventBit(const u16 i_flag) { + g_dComIfG_gameInfo.info.getEvent().offEventBit(i_flag); +} + +BOOL dComIfGs_isEventBit(const u16 i_flag) { + return g_dComIfG_gameInfo.info.getEvent().isEventBit(i_flag); +} + +void dComIfGs_setEventReg(u16 reg, u8 value) { + g_dComIfG_gameInfo.info.getEvent().setEventReg(reg, value); +} + +u8 dComIfGs_getEventReg(u16 reg) { + return g_dComIfG_gameInfo.info.getEvent().getEventReg(reg); +} + +int dComIfGs_getHookGameTime() { + return g_dComIfG_gameInfo.info.getMiniGame().getHookGameTime(); +} + +void dComIfGs_setHookGameTime(u32 i_time) { + g_dComIfG_gameInfo.info.getMiniGame().setHookGameTime(i_time); +} + +u32 dComIfGs_getBalloonScore() { + return g_dComIfG_gameInfo.info.getMiniGame().getBalloonScore(); +} + +void dComIfGs_setBalloonScore(u32 i_score) { + g_dComIfG_gameInfo.info.getMiniGame().setBalloonScore(i_score); +} + +int dComIfGs_getRaceGameTime() { + return g_dComIfG_gameInfo.info.getMiniGame().getRaceGameTime(); +} + +void dComIfGs_setRaceGameTime(int i_time) { + g_dComIfG_gameInfo.info.getMiniGame().setRaceGameTime(i_time); +} + +u8 dComIfGs_getKeyNum() { + return g_dComIfG_gameInfo.info.getMemory().getBit().getKeyNum(); +} + +void dComIfGs_setKeyNum(u8 i_keyNum) { + g_dComIfG_gameInfo.info.getMemory().getBit().setKeyNum(i_keyNum); +} + +void dComIfGs_onDungeonItemMap() { + g_dComIfG_gameInfo.info.getMemory().getBit().onDungeonItemMap(); +} + +void dComIfGs_offDungeonItemMap() { + g_dComIfG_gameInfo.info.getMemory().getBit().offDungeonItemMap(); +} + +s32 dComIfGs_isDungeonItemMap() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isDungeonItemMap(); +} + +void dComIfGs_onDungeonItemCompass() { + g_dComIfG_gameInfo.info.getMemory().getBit().onDungeonItemCompass(); +} + +void dComIfGs_offDungeonItemCompass() { + g_dComIfG_gameInfo.info.getMemory().getBit().offDungeonItemCompass(); +} + +s32 dComIfGs_isDungeonItemCompass() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isDungeonItemCompass(); +} + +void dComIfGs_onDungeonItemBossKey() { + g_dComIfG_gameInfo.info.getMemory().getBit().onDungeonItemBossKey(); +} + +void dComIfGs_offDungeonItemBossKey() { + g_dComIfG_gameInfo.info.getMemory().getBit().offDungeonItemBossKey(); +} + +s32 dComIfGs_isDungeonItemBossKey() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isDungeonItemBossKey(); +} + +void dComIfGs_onStageBossEnemy() { + g_dComIfG_gameInfo.info.getMemory().getBit().onStageBossEnemy(); +} + +void dComIfGs_offStageBossEnemy() { + g_dComIfG_gameInfo.info.getMemory().getBit().offStageBossEnemy(); +} + +s32 dComIfGs_isStageBossEnemy() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isStageBossEnemy(); +} + +void dComIfGs_onStageLife() { + g_dComIfG_gameInfo.info.getMemory().getBit().onStageLife(); +} + +void dComIfGs_offStageLife() { + g_dComIfG_gameInfo.info.getMemory().getBit().offStageLife(); +} + +s32 dComIfGs_isStageLife() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isStageLife(); +} + +void dComIfGs_onStageBossDemo() { + g_dComIfG_gameInfo.info.getMemory().getBit().onStageBossDemo(); +} + +void dComIfGs_offStageBossDemo() { + g_dComIfG_gameInfo.info.getMemory().getBit().offStageBossDemo(); +} + +s32 dComIfGs_isStageBossDemo() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isStageBossDemo(); +} + +void dComIfGs_onDungeonItemWarp() { + g_dComIfG_gameInfo.info.getMemory().getBit().onDungeonItemWarp(); +} + +void dComIfGs_offDungeonItemWarp() { + g_dComIfG_gameInfo.info.getMemory().getBit().offDungeonItemWarp(); +} + +s32 dComIfGs_isDungeonItemWarp() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isDungeonItemWarp(); +} + +void dComIfGs_onStageMiddleBoss() { + g_dComIfG_gameInfo.info.getMemory().getBit().onStageBossEnemy2(); +} + +void dComIfGs_offStageMiddleBoss() { + g_dComIfG_gameInfo.info.getMemory().getBit().offStageBossEnemy2(); +} + +BOOL dComIfGs_isStageMiddleBoss() { + return g_dComIfG_gameInfo.info.getMemory().getBit().isStageBossEnemy2(); +} + +void dComIfGs_onTbox(int i_no) { + g_dComIfG_gameInfo.info.getMemory().getBit().onTbox(i_no); +} + +void dComIfGs_offTbox(int i_no) { + g_dComIfG_gameInfo.info.getMemory().getBit().offTbox(i_no); +} + +BOOL dComIfGs_isTbox(int i_no) { + return g_dComIfG_gameInfo.info.getMemory().getBit().isTbox(i_no); +} + +void dComIfGs_onSaveSwitch(int i_no) { + g_dComIfG_gameInfo.info.getMemory().getBit().onSwitch(i_no); +} + +void dComIfGs_offSaveSwitch(int i_no) { + g_dComIfG_gameInfo.info.getMemory().getBit().offSwitch(i_no); +} + +BOOL dComIfGs_isSaveSwitch(int i_no) { + return g_dComIfG_gameInfo.info.getMemory().getBit().isSwitch(i_no); +} + +BOOL dComIfGs_isSaveItem(int i_no) { + return g_dComIfG_gameInfo.info.getMemory().getBit().isItem(i_no); +} + +void dComIfGs_onSaveDunSwitch(int i_swNo) { + g_dComIfG_gameInfo.info.getDan().onSwitch(i_swNo); +} + +void dComIfGs_offSaveDunSwitch(int i_swNo) { + g_dComIfG_gameInfo.info.getDan().offSwitch(i_swNo); +} + +BOOL dComIfGs_isSaveDunSwitch(int i_no) { + return g_dComIfG_gameInfo.info.getDan().isSwitch(i_no); +} + +BOOL dComIfGs_isSaveDunItem(int i_no) { + return g_dComIfG_gameInfo.info.getDan().isItem(i_no); +} + +void dComIfGs_resetDan() { + g_dComIfG_gameInfo.info.resetDan(); +} + +void dComIfGs_initDan(s8 i_stageNo) { + g_dComIfG_gameInfo.info.initDan(i_stageNo); +} + +void dComIfGs_clearRoomSwitch(int i_zoneNo) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().clearRoomSwitch(); +} + +void dComIfGs_clearRoomItem(int i_zoneNo) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().clearRoomItem(); +} + +void dComIfGs_onSvZoneSwitch(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().onSwitch(i_swBit); +} + +void dComIfGs_offSvZoneSwitch(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().offSwitch(i_swBit); +} + +BOOL dComIfGs_isSvZoneSwitch(int i_zoneNo, int i_swBit) { + return g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().isSwitch(i_swBit); +} + +void dComIfGs_onSvOneZoneSwitch(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().onOneSwitch(i_swBit); +} + +void dComIfGs_offSvOneZoneSwitch(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().offOneSwitch(i_swBit); +} + +BOOL dComIfGs_isSvOneZoneSwitch(int i_zoneNo, int i_swBit) { + return g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().isOneSwitch(i_swBit); +} + +void dComIfGs_onSvZoneItem(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().onItem(i_swBit); +} + +void dComIfGs_offSvZoneItem(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().offItem(i_swBit); +} + +BOOL dComIfGs_isSvZoneItem(int i_zoneNo, int i_swBit) { + return g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().isItem(i_swBit); +} + +void dComIfGs_onSvOneZoneItem(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().onOneItem(i_swBit); +} + +void dComIfGs_offSvOneZoneItem(int i_zoneNo, int i_swBit) { + g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().offOneItem(i_swBit); +} + +BOOL dComIfGs_isSvOneZoneItem(int i_zoneNo, int i_swBit) { + return g_dComIfG_gameInfo.info.getZone(i_zoneNo).getBit().isOneItem(i_swBit); +} + +void dComIfGs_removeZone(int i_zoneNo) { + g_dComIfG_gameInfo.info.removeZone(i_zoneNo); +} + +s8 dComIfGs_getRestartRoomNo() { + return g_dComIfG_gameInfo.info.getRestart().getRoomNo(); +} + +s16 dComIfGs_getStartPoint() { + return g_dComIfG_gameInfo.info.getRestart().getStartPoint(); +} + +void dComIfGs_setStartPoint(s16 i_point) { + g_dComIfG_gameInfo.info.getRestart().setStartPoint(i_point); +} + +s16 dComIfGs_getRestartRoomAngleY() { + return g_dComIfG_gameInfo.info.getRestart().getRoomAngleY(); +} + +const cXyz& dComIfGs_getRestartRoomPos() { + return g_dComIfG_gameInfo.info.getRestart().getRoomPos(); +} + +u32 dComIfGs_getRestartRoomParam() { + return g_dComIfG_gameInfo.info.getRestart().getRoomParam(); +} + +void dComIfGs_setRestartRoomParam(u32 i_param) { + g_dComIfG_gameInfo.info.getRestart().setRoomParam(i_param); +} + +f32 dComIfGs_getLastSceneSpeedF() { + return g_dComIfG_gameInfo.info.getRestart().getLastSpeedF(); +} + +u32 dComIfGs_getLastSceneMode() { + return g_dComIfG_gameInfo.info.getRestart().getLastMode(); +} + +s16 dComIfGs_getLastSceneAngleY() { + return g_dComIfG_gameInfo.info.getRestart().getLastAngleY(); +} + +void dComIfGs_setRestartRoom(const cXyz& i_position, s16 i_angle, s8 i_roomNo) { + g_dComIfG_gameInfo.info.getRestart().setRoom(i_position, i_angle, i_roomNo); +} + +void dComIfGs_onTmpBit(const u16 i_flag) { + g_dComIfG_gameInfo.info.getTmp().onEventBit(i_flag); +} + +void dComIfGs_offTmpBit(const u16 i_flag) { + g_dComIfG_gameInfo.info.getTmp().offEventBit(i_flag); +} + +BOOL dComIfGs_isTmpBit(const u16 i_flag) { + return g_dComIfG_gameInfo.info.getTmp().isEventBit(i_flag); +} + +void dComIfGs_setTmpReg(u16 i_reg, u8 i_no) { + g_dComIfG_gameInfo.info.getTmp().setEventReg(i_reg, i_no); +} + +u8 dComIfGs_getTmpReg(const u16 i_reg) { + return g_dComIfG_gameInfo.info.getTmp().getEventReg(i_reg); +} + +dSv_turnRestart_c& dComIfGs_getTurnRestart() { + return g_dComIfG_gameInfo.info.getTurnRestart(); +} + +const cXyz& dComIfGs_getTurnRestartPos() { + return g_dComIfG_gameInfo.info.getTurnRestart().getPos(); +} + +u32 dComIfGs_getTurnRestartParam() { + return g_dComIfG_gameInfo.info.getTurnRestart().getParam(); +} + +s16 dComIfGs_getTurnRestartAngleY() { + return g_dComIfG_gameInfo.info.getTurnRestart().getAngleY(); +} + +s8 dComIfGs_getTurnRestartRoomNo() { + return g_dComIfG_gameInfo.info.getTurnRestart().getRoomNo(); +} + +void dComIfGs_setTurnRestart(const cXyz& i_position, s16 i_angle, s8 param_2, u32 i_param) { + g_dComIfG_gameInfo.info.getTurnRestart().set(i_position, i_angle, param_2, i_param); +} + +u8 dComIfGs_getDataNum() { + return g_dComIfG_gameInfo.info.getDataNum(); +} + +void dComIfGs_setDataNum(u8 i_num) { + return g_dComIfG_gameInfo.info.setDataNum(i_num); +} + +u8 dComIfGs_getNewFile() { + return g_dComIfG_gameInfo.info.getNewFile(); +} + +void dComIfGs_setNewFile(u8 i_fileNo) { + return g_dComIfG_gameInfo.info.setNewFile(i_fileNo); +} + +u8 dComIfGs_getNoFile() { + return g_dComIfG_gameInfo.info.getNoFile(); +} + +void dComIfGs_setNoFile(u8 i_file) { + g_dComIfG_gameInfo.info.setNoFile(i_file); +} + +s64 dComIfGs_getSaveStartTime() { + return g_dComIfG_gameInfo.info.getStartTime(); +} + +void dComIfGs_setSaveStartTime(s64 i_time) { + g_dComIfG_gameInfo.info.setStartTime(i_time); +} + +s64 dComIfGs_getSaveTotalTime() { + return g_dComIfG_gameInfo.info.getSaveTotalTime(); +} + +void dComIfGs_setSaveTotalTime(s64 i_time) { + g_dComIfG_gameInfo.info.setSaveTotalTime(i_time); +} + +void dComIfGs_init() { + g_dComIfG_gameInfo.info.init(); +} + +void dComIfGs_getSave(int i_stageNo) { + g_dComIfG_gameInfo.info.getSave(i_stageNo); +} + +void dComIfGs_putSave(int i_stageNo) { + g_dComIfG_gameInfo.info.putSave(i_stageNo); +} + +void dComIfGs_initZone() { + g_dComIfG_gameInfo.info.initZone(); +} + +int dComIfGs_createZone(int roomNo) { + return g_dComIfG_gameInfo.info.createZone(roomNo); +} + +void dComIfGs_onSwitch(int i_no, int i_roomNo) { + g_dComIfG_gameInfo.info.onSwitch(i_no, i_roomNo); +} + +void dComIfGs_offSwitch(int i_no, int i_roomNo) { + g_dComIfG_gameInfo.info.offSwitch(i_no, i_roomNo); +} + +BOOL dComIfGs_isSwitch(int i_no, int i_roomNo) { + return g_dComIfG_gameInfo.info.isSwitch(i_no, i_roomNo); +} + +void dComIfGs_revSwitch(int i_no, int i_roomNo) { + g_dComIfG_gameInfo.info.revSwitch(i_no, i_roomNo); +} + +void dComIfGs_onItem(int i_bitNo, int i_roomNo) { + g_dComIfG_gameInfo.info.onItem(i_bitNo, i_roomNo); +} + +bool dComIfGs_isItem(int i_bitNo, int i_roomNo) { + return g_dComIfG_gameInfo.info.isItem(i_bitNo, i_roomNo); +} + +void dComIfGs_onActor(int i_bitNo, int i_roomNo) { + g_dComIfG_gameInfo.info.onActor(i_bitNo, i_roomNo); +} + +void dComIfGs_offActor(int i_no, int i_roomNo) { + g_dComIfG_gameInfo.info.offActor(i_no, i_roomNo); +} + +BOOL dComIfGs_isActor(int i_no, int i_roomNo) { + return g_dComIfG_gameInfo.info.isActor(i_no, i_roomNo); +} + +void dComIfGs_setMemoryToCard(u8* i_saveData, int i_dataNum) { + g_dComIfG_gameInfo.info.memory_to_card((char*)i_saveData, i_dataNum); +} + +void dComIfGs_setCardToMemory(u8* card_ptr, int dataNum) { + g_dComIfG_gameInfo.info.card_to_memory((char*)card_ptr, dataNum); +} + +void dComIfGs_setInitDataToCard(u8* i_saveData, int i_dataNum) { + g_dComIfG_gameInfo.info.initdata_to_card((char*)i_saveData, i_dataNum); +} + +u8 dComIfGs_getWolfAbility(int i_idx) { + return g_dComIfG_gameInfo.play.getWolfAbility(i_idx); +} + +s8 dComIfGs_Grass_hide_Check() { + return g_dComIfG_gameInfo.field_0x1ddfc; +} + +dStage_startStage_c* dComIfGp_getStartStage() { + return g_dComIfG_gameInfo.play.getStartStage(); +} + +void dComIfGp_setStartStage(dStage_startStage_c* p_startStage) { + g_dComIfG_gameInfo.play.setStartStage(p_startStage); +} + +const char* dComIfGp_getStartStageName() { + return g_dComIfG_gameInfo.play.getStartStageName(); +} + +s16 dComIfGp_getStartStagePoint() { + return g_dComIfG_gameInfo.play.getStartStagePoint(); +} + +s8 dComIfGp_getStartStageRoomNo() { + return g_dComIfG_gameInfo.play.getStartStageRoomNo(); +} + +s8 dComIfGp_getStartStageLayer() { + return g_dComIfG_gameInfo.play.getStartStageLayer(); +} + +void dComIfGp_setStartStageLayer(s8 layer) { + g_dComIfG_gameInfo.play.setStartStageLayer(layer); +} + +s8 dComIfGp_getStartStageDarkArea() { + return g_dComIfG_gameInfo.play.getStartStageDarkArea(); +} + +void dComIfGp_setStartStageDarkArea(s8 darkArea) { + g_dComIfG_gameInfo.play.setStartStageDarkArea(darkArea); +} + +dStage_startStage_c* dComIfGp_getNextStartStage() { + return g_dComIfG_gameInfo.play.getNextStartStage(); +} + +const char* dComIfGp_getNextStageName() { + return g_dComIfG_gameInfo.play.getNextStageName(); +} + +s16 dComIfGp_getNextStagePoint() { + return g_dComIfG_gameInfo.play.getNextStagePoint(); +} + +s16 dComIfGp_getNextStageRoomNo() { + return g_dComIfG_gameInfo.play.getNextStageRoomNo(); +} + +s16 dComIfGp_getNextStageLayer() { + return g_dComIfG_gameInfo.play.getNextStageLayer(); +} + +BOOL dComIfGp_isEnableNextStage() { + return g_dComIfG_gameInfo.play.isEnableNextStage(); +} + +void dComIfGp_offEnableNextStage() { + g_dComIfG_gameInfo.play.offEnableNextStage(); +} + +s8 dComIfGp_getNextStageWipe() { + return g_dComIfG_gameInfo.play.getNextStageWipe(); +} + +u8 dComIfGp_getNextStageWipeSpeed() { + return g_dComIfG_gameInfo.play.getNextStageWipeSpeed(); +} + +dStage_stageDt_c* dComIfGp_getStage() { + return &g_dComIfG_gameInfo.play.getStage(); +} + +roomRead_class* dComIfGp_getStageRoom() { + return g_dComIfG_gameInfo.play.getStage().getRoom(); +} + +stage_palette_info_class* dComIfGp_getStagePaletteInfo() { + return g_dComIfG_gameInfo.play.getStage().getPaletteInfo(); +} + +stage_pselect_info_class* dComIfGp_getStagePselectInfo() { + return g_dComIfG_gameInfo.play.getStage().getPselectInfo(); +} + +stage_envr_info_class* dComIfGp_getStageEnvrInfo() { + return g_dComIfG_gameInfo.play.getStage().getEnvrInfo(); +} + +stage_vrboxcol_info_class* dComIfGp_getStageVrboxcolInfo() { + return g_dComIfG_gameInfo.play.getStage().getVrboxcolInfo(); +} + +stage_plight_info_class* dComIfGp_getStagePlightInfo() { + return g_dComIfG_gameInfo.play.getStage().getPlightInfo(); +} + +int dComIfGp_getStagePaletteNumInfo() { + return g_dComIfG_gameInfo.play.getStage().getPaletteNumInfo(); +} + +int dComIfGp_getStagePselectNumInfo() { + return g_dComIfG_gameInfo.play.getStage().getPselectNumInfo(); +} + +int dComIfGp_getStageEnvrNumInfo() { + return g_dComIfG_gameInfo.play.getStage().getEnvrNumInfo(); +} + +int dComIfGp_getStageVrboxcolNumInfo() { + return g_dComIfG_gameInfo.play.getStage().getVrboxcolNumInfo(); +} + +int dComIfGp_getStagePlightNumInfo() { + return g_dComIfG_gameInfo.play.getStage().getPlightNumInfo(); +} + +stage_stag_info_class* dComIfGp_getStageStagInfo() { + return g_dComIfG_gameInfo.play.getStage().getStagInfo(); +} + +stage_scls_info_dummy_class* dComIfGp_getStageSclsInfo() { + return g_dComIfG_gameInfo.play.getStage().getSclsInfo(); +} + +dStage_Multi_c* dComIfGp_getMulti() { + return g_dComIfG_gameInfo.play.getStage().getMulti(); +} + +void dComIfGp_setOldMulti() { + g_dComIfG_gameInfo.play.getStage().setOldMulti(); +} + +void dComIfGp_resetOldMulti() { + g_dComIfG_gameInfo.play.getStage().resetOldMulti(); +} + +s16 dComIfGp_getStageWorldRollAngleX() { + return g_dComIfG_gameInfo.play.getStage().getWorldRollAngleX(); +} + +s16 dComIfGp_getStageWorldRollDirAngleY() { + return g_dComIfG_gameInfo.play.getStage().getWorldRollDirAngleY(); +} + +int dComIfGp_roomControl_getStayNo() { + return dStage_roomControl_c::getStayNo(); +} + +BOOL dComIfGp_roomControl_getTimePass() { + return g_dComIfG_gameInfo.play.getRoomControl()->GetTimePass(); +} + +void dComIfGp_roomControl_setTimePass(int isPassing) { + g_dComIfG_gameInfo.play.getRoomControl()->SetTimePass(isPassing); +} + +dKy_tevstr_c* dComIfGp_roomControl_getTevStr(int i_roomNo) { + return g_dComIfG_gameInfo.play.getRoomControl()->getTevStr(i_roomNo); +} + +void dComIfGp_roomControl_setStatusFlag(int i_roomNo, u8 flag) { + return g_dComIfG_gameInfo.play.getRoomControl()->setStatusFlag(i_roomNo, flag); +} + +void dComIfGp_roomControl_onStatusFlag(int i_roomNo, u8 flag) { + return g_dComIfG_gameInfo.play.getRoomControl()->onStatusFlag(i_roomNo, flag); +} + +void dComIfGp_roomControl_offStatusFlag(int i_roomNo, u8 flag) { + return g_dComIfG_gameInfo.play.getRoomControl()->offStatusFlag(i_roomNo, flag); +} + +u8 dComIfGp_roomControl_checkStatusFlag(int i_roomNo, u8 flag) { + return g_dComIfG_gameInfo.play.getRoomControl()->checkStatusFlag(i_roomNo, flag); +} + +s32 dComIfGp_roomControl_getZoneNo(int i_roomNo) { + return g_dComIfG_gameInfo.play.getRoomControl()->getZoneNo(i_roomNo); +} + +void dComIfGp_roomControl_setZoneNo(int roomNo, int zoneNo) { + g_dComIfG_gameInfo.play.getRoomControl()->setZoneNo(roomNo, zoneNo); +} + +void dComIfGp_roomControl_init() { + g_dComIfG_gameInfo.play.getRoomControl()->init(); +} + +void dComIfGp_roomControl_initZone() { + g_dComIfG_gameInfo.play.getRoomControl()->initZone(); +} + +dStage_roomDt_c* dComIfGp_roomControl_getStatusRoomDt(int room_no) { + return g_dComIfG_gameInfo.play.getRoomControl()->getStatusRoomDt(room_no); +} + +void dComIfGp_roomControl_setStayNo(int stayNo) { + g_dComIfG_gameInfo.play.mRoomControl.setStayNo(stayNo); +} + +BOOL dComIfGp_roomControl_checkRoomDisp(int i_roomNo) { + return g_dComIfG_gameInfo.play.getRoomControl()->checkRoomDisp(i_roomNo); +} + +int dComIfGp_roomControl_loadRoom(int param_0, u8* param_1, bool param_2) { + return g_dComIfG_gameInfo.play.getRoomControl()->loadRoom(param_0, param_1, param_2); +} + +void dComIfGp_roomControl_zoneCountCheck(int i_roomNo) { + g_dComIfG_gameInfo.play.getRoomControl()->zoneCountCheck(i_roomNo); +} + +dEvt_control_c* dComIfGp_getEvent() { + return g_dComIfG_gameInfo.play.getEvent(); +} + +u16 dComIfGp_event_chkEventFlag(u16 i_flag) { + return g_dComIfG_gameInfo.play.getEvent()->chkEventFlag(i_flag); +} + +void dComIfGp_event_onEventFlag(u16 i_flag) { + g_dComIfG_gameInfo.play.getEvent()->onEventFlag(i_flag); +} + +void dComIfGp_event_onHindFlag(u16 i_flag) { + g_dComIfG_gameInfo.play.getEvent()->onHindFlag(i_flag); +} + +void dComIfGp_event_offHindFlag(u16 i_flag) { + g_dComIfG_gameInfo.play.getEvent()->offHindFlag(i_flag); +} + +u8 dComIfGp_event_getMode() { + return g_dComIfG_gameInfo.play.getEvent()->getMode(); +} + +BOOL dComIfGp_event_runCheck() { + return g_dComIfG_gameInfo.play.getEvent()->runCheck(); +} + +u16 dComIfGp_event_checkHind(u16 i_hindFlag) { + if (!dComIfGp_event_runCheck()) { + return false; + } + return g_dComIfG_gameInfo.play.getEvent()->checkHind(i_hindFlag); +} + +BOOL dComIfGp_event_chkTalkXY() { + return g_dComIfG_gameInfo.play.getEvent()->chkTalkXY(); +} + +u8 dComIfGp_event_getPreItemNo() { + return g_dComIfG_gameInfo.play.getEvent()->getPreItemNo(); +} + +f32 dComIfGp_event_getCullRate() { + return g_dComIfG_gameInfo.play.getEvent()->getCullRate(); +} + +void dComIfGp_event_setCullRate(f32 i_rate) { + g_dComIfG_gameInfo.play.getEvent()->setCullRate(i_rate); +} + +int dComIfGp_event_order(u16 i_type, u16 i_prio, u16 i_flags, u16 i_hindFlags, void* i_requestActor, + void* i_targetActor, s16 i_eventID, u8 i_mapToolId) { + return g_dComIfG_gameInfo.play.getEvent()->order(i_type, i_prio, i_flags, i_hindFlags, + i_requestActor, i_targetActor, i_eventID, i_mapToolId); +} + +void dComIfGp_event_reset() { + g_dComIfG_gameInfo.play.getEvent()->reset(); +} + +int dComIfGp_event_moveApproval(void* i_actor) { + return g_dComIfG_gameInfo.play.getEvent()->moveApproval(i_actor); +} + +BOOL dComIfGp_event_compulsory(void* i_actor, const char* i_eventname, u16 i_hindFlag) { + return g_dComIfG_gameInfo.play.getEvent()->compulsory(i_actor, i_eventname, i_hindFlag); +} + +void dComIfGp_event_remove() { + g_dComIfG_gameInfo.play.getEvent()->remove(); +} + +fopAc_ac_c* dComIfGp_event_getPt1() { + return g_dComIfG_gameInfo.play.getEvent()->getPt1(); +} + +fopAc_ac_c* dComIfGp_event_getPt2() { + return g_dComIfG_gameInfo.play.getEvent()->getPt2(); +} + +fopAc_ac_c* dComIfGp_event_getTalkPartner() { + return g_dComIfG_gameInfo.play.getEvent()->getPtT(); +} + +void dComIfGp_event_setTalkPartner(void* i_actor) { + g_dComIfG_gameInfo.play.getEvent()->setPtT(i_actor); +} + +fopAc_ac_c* dComIfGp_event_getItemPartner() { + return g_dComIfG_gameInfo.play.getEvent()->getPtI(); +} + +void dComIfGp_event_setItemPartner(void* i_actor) { + g_dComIfG_gameInfo.play.getEvent()->setPtI(i_actor); +} + +void dComIfGp_event_setItemPartnerId(fpc_ProcID i_id) { + g_dComIfG_gameInfo.play.getEvent()->setPtI_Id(i_id); +} + +fopAc_ac_c* dComIfGp_event_getDoorPartner() { + return g_dComIfG_gameInfo.play.getEvent()->getPtD(); +} + +void dComIfGp_event_setDoorPartner(void* i_partner) { + g_dComIfG_gameInfo.play.getEvent()->setPtD(i_partner); +} + +u8 dComIfGp_event_getGtItm() { + return g_dComIfG_gameInfo.play.getEvent()->getGtItm(); +} + +void dComIfGp_event_setGtItm(u8 i_itemNo) { + g_dComIfG_gameInfo.play.getEvent()->setGtItm(i_itemNo); +} + +dEvent_manager_c& dComIfGp_getEventManager() { + return g_dComIfG_gameInfo.play.getEvtManager(); +} + +dEvent_manager_c* dComIfGp_getPEvtManager() { + return &g_dComIfG_gameInfo.play.getEvtManager(); +} + +int dComIfGp_evmng_cameraPlay() { + return dComIfGp_getPEvtManager()->cameraPlay(); +} + +int dComIfGp_evmng_startDemo(int i_mapToolId) { + return dComIfGp_getPEvtManager()->setStartDemo(i_mapToolId); +} + +void dComIfGp_evmng_create() { + g_dComIfG_gameInfo.play.getEvtManager().create(); +} + +void dComIfGp_evmng_remove() { + g_dComIfG_gameInfo.play.getEvtManager().remove(); +} + +bool dComIfGp_evmng_existence(s16 eventId) { + return g_dComIfG_gameInfo.play.getEvtManager().getEventData(eventId) != NULL; +} + +s16 dComIfGp_evmng_getEventIdx(const char* eventName, u8 mapToolID) { + return g_dComIfG_gameInfo.play.getEvtManager().getEventIdx(eventName, mapToolID, -1); +} + +bool dComIfGp_evmng_existence(const char* eventname) { + return g_dComIfG_gameInfo.play.getEvtManager().getEventData( + dComIfGp_evmng_getEventIdx(eventname, 0xFF)) != NULL; +} + +BOOL dComIfGp_evmng_isMapToolCamera(u8 mapToolID) { + return g_dComIfG_gameInfo.play.getEvtManager().isMapToolCamera(mapToolID, -1); +} + +BOOL dComIfGp_evmng_startCheck(s16 i_eventId) { + return g_dComIfG_gameInfo.play.getEvtManager().startCheck(i_eventId); +} + +BOOL dComIfGp_evmng_startCheck(char const* i_eventname) { + return g_dComIfG_gameInfo.play.getEvtManager().startCheckOld(i_eventname); +} + +BOOL dComIfGp_evmng_endCheck(s16 i_eventID) { + return g_dComIfG_gameInfo.play.getEvtManager().endCheck(i_eventID); +} + +BOOL dComIfGp_evmng_endCheck(const char* i_eventname) { + return g_dComIfG_gameInfo.play.getEvtManager().endCheckOld(i_eventname); +} + +int dComIfGp_evmng_getMyStaffId(const char* i_staffname, fopAc_ac_c* i_actor, int i_tagId) { + return dComIfGp_getPEvtManager()->getMyStaffId(i_staffname, i_actor, i_tagId); +} + +int dComIfGp_evmng_getIsAddvance(int i_staffId) { + return dComIfGp_getPEvtManager()->getIsAddvance(i_staffId); +} + +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); +} + +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); +} + +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); +} + +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); +} + +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); +} + +int dComIfGp_evmng_getMySubstanceNum(int i_staffId, DUSK_CONST char* i_dataname) { + return dComIfGp_getPEvtManager()->getMySubstanceNum(i_staffId, i_dataname); +} + +void dComIfGp_evmng_cutEnd(int i_staffId) { + dComIfGp_getPEvtManager()->cutEnd(i_staffId); +} + +void dComIfGp_evmng_setGoal(cXyz* i_pos) { + dComIfGp_getPEvtManager()->setGoal(i_pos); +} + +cXyz* dComIfGp_evmng_getGoal() { + return dComIfGp_getPEvtManager()->getGoal(); +} + +BOOL dComIfGp_evmng_ChkPresentEnd() { + return dComIfGp_getPEvtManager()->ChkPresentEnd(); +} + +int dComIfGp_evmng_checkStartDemo() { + return dComIfGp_getPEvtManager()->checkStartDemo(); +} + +dAttention_c* dComIfGp_getAttention() { + return g_dComIfG_gameInfo.play.getAttention(); +} + +fopAc_ac_c* dComIfGp_att_getZHint() { + return dComIfGp_getAttention()->getZHintTarget(); +} + +int dComIfGp_att_ZHintRequest(fopAc_ac_c* param_1, int param_2) { + return dComIfGp_getAttention()->ZHintRequest(param_1, param_2); +} + +fopAc_ac_c* dComIfGp_att_getCatghTarget() { + return dComIfGp_getAttention()->getCatghTarget(); +} + +u8 dComIfGp_att_getCatchChgItem() { + return dComIfGp_getAttention()->getCatchChgItem(); +} + +int dComIfGp_att_CatchRequest(fopAc_ac_c* param_0, u8 param_1, f32 i_horizontalDist, f32 i_upDist, + f32 i_downDist, s16 i_angle, int param_5) { + return dComIfGp_getAttention()->CatchRequest( + param_0, param_1, i_horizontalDist, i_upDist, i_downDist, i_angle, param_5); +} + +fopAc_ac_c* dComIfGp_att_getLookTarget() { + return dComIfGp_getAttention()->getLookTarget(); +} + +void dComIfGp_att_LookRequest(fopAc_ac_c* param_0, f32 i_horizontalDist, f32 i_upDist, + f32 i_downDist, s16 i_angle, int param_5) { + dComIfGp_getAttention()->LookRequest( + param_0, i_horizontalDist, i_upDist, i_downDist, i_angle, param_5); +} + +dVibration_c& dComIfGp_getVibration() { + return g_dComIfG_gameInfo.play.getVibration(); +} + +JKRAramArchive* dComIfGp_getFieldMapArchive2() { + return g_dComIfG_gameInfo.play.getFieldMapArchive2(); +} + +void dComIfGp_setFieldMapArchive2(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setFieldMapArchive2(arc); +} + +JKRArchive* dComIfGp_getMsgArchive(int idx) { + return g_dComIfG_gameInfo.play.getMsgArchive(idx); +} + +void dComIfGp_setMsgArchive(int i, JKRArchive* arc) { + g_dComIfG_gameInfo.play.setMsgArchive(i, arc); +} + +JKRArchive* dComIfGp_getDemoMsgArchive() { + return g_dComIfG_gameInfo.play.getDemoMsgArchive(); +} + +void dComIfGp_setDemoMsgArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setDemoMsgArchive(arc); +} + +JKRArchive* dComIfGp_getMeterButtonArchive() { + return g_dComIfG_gameInfo.play.getMeterButtonArchive(); +} + +void dComIfGp_setMeterButtonArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setMeterButtonArchive(arc); +} + +JKRArchive* dComIfGp_getFontArchive() { + return g_dComIfG_gameInfo.play.getFontArchive(); +} + +void dComIfGp_setFontArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setFontArchive(arc); +} + +JKRArchive* dComIfGp_getRubyArchive() { + return g_dComIfG_gameInfo.play.getRubyArchive(); +} + +void dComIfGp_setRubyArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setRubyArchive(arc); +} + +JKRArchive* dComIfGp_getAnmArchive() { + return g_dComIfG_gameInfo.play.getAnmArchive(); +} + +void dComIfGp_setAnmArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setAnmArchive(arc); +} + +JKRArchive* dComIfGp_getCollectResArchive() { + return g_dComIfG_gameInfo.play.getCollectResArchive(); +} + +void dComIfGp_setCollectResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setCollectResArchive(arc); +} + +JKRArchive* dComIfGp_getFmapResArchive() { + return g_dComIfG_gameInfo.play.getFmapResArchive(); +} + +void dComIfGp_setFmapResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setFmapResArchive(arc); +} + +JKRArchive* dComIfGp_getDmapResArchive() { + return g_dComIfG_gameInfo.play.getDmapResArchive(); +} + +void dComIfGp_setDmapResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setDmapResArchive(arc); +} + +JKRArchive* dComIfGp_getOptionResArchive() { + return g_dComIfG_gameInfo.play.getOptionResArchive(); +} + +void dComIfGp_setOptionResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setOptionResArchive(arc); +} + +JKRArchive* dComIfGp_getItemIconArchive() { + return g_dComIfG_gameInfo.play.getItemIconArchive(); +} + +void dComIfGp_setItemIconArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setItemIconArchive(arc); +} + +JKRArchive* dComIfGp_getNameResArchive() { + return g_dComIfG_gameInfo.play.getNameResArchive(); +} + +void dComIfGp_setNameResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setNameResArchive(arc); +} + +void dComIfGp_setErrorResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setErrorResArchive(arc); +} + +JKRArchive* dComIfGp_getAllMapArchive() { + return g_dComIfG_gameInfo.play.getAllMapArchive(); +} + +void dComIfGp_setAllMapArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setAllMapArchive(arc); +} + +JKRArchive* dComIfGp_getMsgCommonArchive() { + return g_dComIfG_gameInfo.play.getMsgCommonArchive(); +} + +void dComIfGp_setMsgCommonArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setMsgCommonArchive(arc); +} + +JKRArchive* dComIfGp_getRingResArchive() { + return g_dComIfG_gameInfo.play.getRingResArchive(); +} + +void dComIfGp_setRingResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setRingResArchive(arc); +} + +JKRArchive* dComIfGp_getCardIconResArchive() { + return g_dComIfG_gameInfo.play.getCardIconResArchive(); +} + +void dComIfGp_setCardIconResArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setCardIconResArchive(arc); +} + +JKRArchive* dComIfGp_getMsgDtArchive() { + return g_dComIfG_gameInfo.play.getMsgDtArchive(); +} + +JKRArchive* dComIfGp_getMsgDtArchive(int idx) { + return g_dComIfG_gameInfo.play.getMsgDtArchive(idx); +} + +void dComIfGp_setMsgDtArchive(int i, JKRArchive* arc) { + g_dComIfG_gameInfo.play.setMsgDtArchive(i, arc); +} + +JKRArchive* dComIfGp_getMain2DArchive() { + return g_dComIfG_gameInfo.play.getMain2DArchive(); +} + +void dComIfGp_setMain2DArchive(JKRArchive* arc) { + g_dComIfG_gameInfo.play.setMain2DArchive(arc); +} + +JKRExpHeap* dComIfGp_particle_getResHeap() { + return g_dComIfG_gameInfo.play.getParticle()->getResHeap(); +} + +void dComIfGp_particle_levelExecute(u32 param_0) { + g_dComIfG_gameInfo.play.getParticle()->levelExecute(param_0); +} + +void dComIfGp_particle_createCommon(const void* data) { + g_dComIfG_gameInfo.play.getParticle()->createCommon(data); +} + +void dComIfGp_particle_readScene(u8 particle_no, mDoDvdThd_toMainRam_c** param_1) { + g_dComIfG_gameInfo.play.getParticle()->readScene(particle_no, param_1); +} + +void dComIfGp_particle_createScene(const void* param_0) { + g_dComIfG_gameInfo.play.getParticle()->createScene(param_0); +} + +void dComIfGp_particle_removeScene(bool param_0) { + g_dComIfG_gameInfo.play.getParticle()->removeScene(param_0); +} + +void dComIfGp_particle_cleanup() { + g_dComIfG_gameInfo.play.getParticle()->cleanup(); +} + +void dComIfGp_particle_calc3D() { + g_dComIfG_gameInfo.play.getParticle()->calc3D(); +} + +void dComIfGp_particle_calc2D() { + g_dComIfG_gameInfo.play.getParticle()->calc2D(); +} + +void dComIfGp_particle_calcMenu() { + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->calcMenu(); + } +} + +void dComIfGp_particle_draw(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawNormal(i_drawInfo); + } +} + +void dComIfGp_particle_drawFog(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawNormalFog(i_drawInfo); + } +} + +void dComIfGp_particle_drawP1(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawNormalP1(i_drawInfo); + } +} + +void dComIfGp_particle_drawProjection(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawProjection(i_drawInfo); + } +} + +void dComIfGp_particle_drawNormalPri0_A(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawNormalPri0_A(i_drawInfo); + } +} + +void dComIfGp_particle_drawNormalPri0_B(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawNormalPri0_B(i_drawInfo); + } +} + +void dComIfGp_particle_drawFogPri0_A(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogPri0_A(i_drawInfo); + } +} + +void dComIfGp_particle_drawFogPri0_B(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogPri0_B(i_drawInfo); + } +} + +void dComIfGp_particle_drawFogPri1(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogPri1(i_drawInfo); + } +} + +void dComIfGp_particle_drawFogPri2(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogPri2(i_drawInfo); + } +} + +void dComIfGp_particle_drawFogPri3(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogPri3(i_drawInfo); + } +} + +void dComIfGp_particle_drawFogPri4(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogPri4(i_drawInfo); + } +} + +void dComIfGp_particle_drawDarkworld(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawDarkworld(i_drawInfo); + } +} + +void dComIfGp_particle_drawScreen(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->drawFogScreen(i_drawInfo); + } +} + +void dComIfGp_particle_draw2Dgame(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->draw2Dgame(i_drawInfo); + } +} + +void dComIfGp_particle_draw2Dfore(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->draw2Dfore(i_drawInfo); + } +} + +void dComIfGp_particle_draw2Dback(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->draw2Dback(i_drawInfo); + } +} + +void dComIfGp_particle_draw2DmenuFore(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->draw2DmenuFore(i_drawInfo); + } +} + +void dComIfGp_particle_draw2DmenuBack(JPADrawInfo* i_drawInfo) { + ZoneScoped; + if (g_dComIfG_gameInfo.play.getParticle() != NULL) { + g_dComIfG_gameInfo.play.getParticle()->draw2DmenuBack(i_drawInfo); + } +} + +void dComIfGp_setHitMark(u16 i_hitmark, fopAc_ac_c* param_1, const cXyz* param_2, + const csXyz* param_3, const cXyz* param_4, u32 i_atType) { + g_dComIfG_gameInfo.play.getParticle()->setHitMark( + i_hitmark, param_1, param_2, param_3, param_4, i_atType); +} + +void dComIfGp_particle_setWaterRipple(u32* param_0, cBgS_PolyInfo& param_1, const cXyz* param_2, + f32 param_3, const dKy_tevstr_c* param_4, const cXyz* param_5, s8 param_6) { + g_dComIfG_gameInfo.play.getParticle()->setWaterRipple( + param_0, param_1, param_2, param_3, param_4, param_5, param_6); +} + +u32 dComIfGp_particle_setPolyColor(u32 param_0, u16 param_1, cBgS_PolyInfo& param_2, + const cXyz* param_3, const dKy_tevstr_c* param_4, const csXyz* param_5, const cXyz* param_6, + int param_7, dPa_levelEcallBack* param_8, s8 param_9, const cXyz* param_10) { + return g_dComIfG_gameInfo.play.getParticle()->setPoly(param_0, param_1, param_2, param_3, + param_4, param_5, param_6, param_7, param_8, param_9, param_10); +} + +JPABaseEmitter* dComIfGp_particle_setPolyColor(u16 param_1, cBgS_PolyInfo& param_2, + const cXyz* param_3, const dKy_tevstr_c* param_4, const csXyz* param_5, const cXyz* param_6, + int param_7, dPa_levelEcallBack* param_8, s8 param_9, const cXyz* param_10) { + return g_dComIfG_gameInfo.play.getParticle()->setPoly( + param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); +} + +void dComIfGp_particle_setSimple(u16 param_0, cXyz* i_pos, u8 param_2, GXColor& param_3, + GXColor& param_4, int param_5, float param_6) { + g_dComIfG_gameInfo.play.getParticle()->setSimple( + param_0, i_pos, 0, param_2, param_3, param_4, param_5, param_6); +} + +u32 dComIfGp_particle_setStopContinue(u32 param_0) { + return g_dComIfG_gameInfo.play.getParticle()->setStopContinue(param_0); +} + +u32 dComIfGp_particle_setSimpleFoot(u32 param_0, u32* param_1, cBgS_PolyInfo& param_2, + cXyz const* param_3, dKy_tevstr_c const* param_4, int param_5, csXyz const* param_6, + cXyz const* param_7, dPa_levelEcallBack* param_8, s8 param_9, cXyz const* param_10) { + return g_dComIfG_gameInfo.play.getParticle()->setSimpleFoot(param_0, param_1, param_2, param_3, + param_4, param_5, param_6, param_7, param_8, param_9, param_10); +} + +u16 dComIfGp_particle_setCommonPoly(u32* param_0, cBgS_PolyInfo* param_1, const cXyz* param_2, + const cXyz* param_3, const dKy_tevstr_c* param_4, u32 param_5, u32 param_6, + const csXyz* param_7, const cXyz* param_8, s8 param_9) { + return g_dComIfG_gameInfo.play.getParticle()->setCommonPoly( + param_0, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9); +} + +void dComIfGp_particle_levelEmitterOnEventMove(u32 param_0) { + g_dComIfG_gameInfo.play.getParticle()->forceOnEventMove(param_0); +} + +JPABaseEmitter* dComIfGp_particle_getEmitter(u32 param_0) { + return g_dComIfG_gameInfo.play.getParticle()->getEmitter(param_0); +} + +u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3, + const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* param_7, + s8 param_8, const GXColor* param_9, const GXColor* param_10, const cXyz* param_11) { + return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_0, param_1, i_pos, param_3, + i_rotation, i_scale, i_alpha, param_7, param_8, param_9, param_10, param_11, 1.0f); +} + +u32 dComIfGp_particle_set(u32 param_0, u16 param_1, const cXyz* i_pos, const csXyz* i_rotation, + const cXyz* i_scale, u8 param_5, dPa_levelEcallBack* param_6, s8 param_7, + const GXColor* param_8, const GXColor* param_9, const cXyz* param_10) { + return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_0, param_1, i_pos, NULL, + i_rotation, i_scale, param_5, param_6, param_7, param_8, param_9, param_10, 1.0f); +} + +JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, const dKy_tevstr_c* param_3, + const csXyz* i_rotation, const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* i_callback, + s8 param_8, const GXColor* i_prmColor, const GXColor* i_envColor, const cXyz* i_particleScale) { + return g_dComIfG_gameInfo.play.getParticle()->setNormal(i_resID, i_pos, param_3, i_rotation, + i_scale, i_alpha, i_callback, param_8, i_prmColor, i_envColor, i_particleScale, 1.0f); +} + +JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, const csXyz* i_rotation, + const cXyz* i_scale, u8 i_alpha, dPa_levelEcallBack* i_callback, s8 param_7, + const GXColor* i_prmColor, const GXColor* i_envColor, const cXyz* i_particleScale) { + return g_dComIfG_gameInfo.play.getParticle()->setNormal(i_resID, i_pos, NULL, i_rotation, + i_scale, i_alpha, i_callback, param_7, i_prmColor, i_envColor, i_particleScale, 1.0f); +} + +u32 dComIfGp_particle_set( + u32 param_0, u16 param_1, const cXyz* i_pos, const dKy_tevstr_c* param_3) { + return dComIfGp_particle_set( + param_0, param_1, i_pos, param_3, NULL, NULL, 0xFF, NULL, -1, NULL, NULL, NULL); +} + +JPABaseEmitter* dComIfGp_particle_set( + u16 i_resID, const cXyz* i_pos, const csXyz* i_rotation, const cXyz* i_scale) { + return dComIfGp_particle_set( + i_resID, i_pos, NULL, i_rotation, i_scale, 255, NULL, -1, NULL, NULL, NULL); +} + +JPABaseEmitter* dComIfGp_particle_set(u16 i_resID, const cXyz* i_pos, const dKy_tevstr_c* param_2, + const csXyz* i_rotation, const cXyz* i_scale) { + return dComIfGp_particle_set( + i_resID, i_pos, param_2, i_rotation, i_scale, 255, NULL, -1, NULL, NULL, NULL); +} + +u32 dComIfGp_particle_set( + u32 param_0, u16 param_1, const cXyz* i_pos, const csXyz* param_3, const cXyz* param_4) { + return dComIfGp_particle_set( + param_0, param_1, i_pos, param_3, param_4, 0xFF, NULL, -1, NULL, NULL, NULL); +} + +u32 dComIfGp_particle_setColor(u32 param_0, u16 param_1, const cXyz* i_pos, + const dKy_tevstr_c* param_3, const GXColor* param_4, const GXColor* param_5, f32 param_6, + u8 param_7, const csXyz* param_8, const cXyz* param_9, dPa_levelEcallBack* param_10, + s8 param_11, const cXyz* param_12) { + return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_0, param_1, i_pos, param_3, + param_8, param_9, param_7, param_10, param_11, param_4, param_5, param_12, param_6); +} + +JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* i_pos, + const dKy_tevstr_c* param_2, const GXColor* param_3, const GXColor* param_4, f32 param_5, + u8 param_6, const csXyz* param_7, const cXyz* param_8, dPa_levelEcallBack* param_9, s8 param_10, + const cXyz* param_11) { + return g_dComIfG_gameInfo.play.getParticle()->setNormal(param_0, i_pos, param_2, param_7, + param_8, param_6, param_9, param_10, param_3, param_4, param_11, param_5); +} + +JPABaseEmitter* dComIfGp_particle_setColor(u16 param_0, const cXyz* i_pos, + const dKy_tevstr_c* param_2, const GXColor* param_3, const GXColor* param_4, f32 param_5, + u8 param_6) { + return dComIfGp_particle_setColor( + param_0, i_pos, param_2, param_3, param_4, param_5, param_6, NULL, NULL, NULL, -1, NULL); +} + +u32 dComIfGp_particle_getHeapSize() { + return g_dComIfG_gameInfo.play.getParticle()->getHeapSize(); +} + +u32 dComIfGp_particle_getSceneHeapSize() { + return g_dComIfG_gameInfo.play.getParticle()->getSceneHeapSize(); +} + +int dComIfGp_particle_getEmitterNum() { + return g_dComIfG_gameInfo.play.getParticle()->getEmitterNum(); +} + +int dComIfGp_particle_getParticleNum() { + return g_dComIfG_gameInfo.play.getParticle()->getParticleNum(); +} + +dSmplMdl_draw_c* dComIfGp_getSimpleModel() { + return g_dComIfG_gameInfo.play.getSimpleModel(); +} + +int dComIfGp_getWindowNum() { + return g_dComIfG_gameInfo.play.getWindowNum(); +} + +void dComIfGp_setWindowNum(int num) { + g_dComIfG_gameInfo.play.setWindowNum(num); +} + +s8 dComIfGp_getLayerOld() { + return g_dComIfG_gameInfo.play.getLayerOld(); +} + +s32 dComIfGp_checkStatus(u16 flags) { + return g_dComIfG_gameInfo.play.checkStatus(flags); +} + +void dComIfGp_setStatus(u16 status) { + g_dComIfG_gameInfo.play.setStatus(status); +} + +void dComIfGp_onStatus(u16 i_status) { + g_dComIfG_gameInfo.play.onStatus(i_status); +} + +dDlst_window_c* dComIfGp_getWindow(int i) { + return g_dComIfG_gameInfo.play.getWindow(i); +} + +void dComIfGp_setWindow(u8 i, f32 param_1, f32 param_2, f32 param_3, f32 param_4, f32 param_5, + f32 param_6, int camID, int mode) { + g_dComIfG_gameInfo.play.setWindow( + i, param_1, param_2, param_3, param_4, param_5, param_6, camID, mode); +} + +camera_process_class* dComIfGp_getCamera(int idx) { + return (camera_process_class*)g_dComIfG_gameInfo.play.getCamera(idx); +} + +void dComIfGp_setCamera(int i, camera_class* cam) { + g_dComIfG_gameInfo.play.setCamera(i, cam); +} + +int dComIfGp_getCameraWinID(int idx) { + return g_dComIfG_gameInfo.play.getCameraWinID(idx); +} + +int dComIfGp_getCameraPlayer1ID(int idx) { + return g_dComIfG_gameInfo.play.getCameraPlayer1ID(idx); +} + +int dComIfGp_getCameraPlayer2ID(int idx) { + return g_dComIfG_gameInfo.play.getCameraPlayer2ID(idx); +} + +u32 dComIfGp_getCameraAttentionStatus(int i_no) { + return g_dComIfG_gameInfo.play.getCameraAttentionStatus(i_no); +} + +BOOL dComIfGp_checkCameraAttentionStatus(int i, u32 flag) { + return g_dComIfG_gameInfo.play.checkCameraAttentionStatus(i, flag); +} + +void dComIfGp_onCameraAttentionStatus(int i, u32 flag) { + g_dComIfG_gameInfo.play.onCameraAttentionStatus(i, flag); +} + +void dComIfGp_offCameraAttentionStatus(int i, u32 flag) { + g_dComIfG_gameInfo.play.offCameraAttentionStatus(i, flag); +} + +void dComIfGp_setCameraInfo( + int camIdx, camera_class* p_cam, int param_2, int param_3, int param_4) { + g_dComIfG_gameInfo.play.setCameraInfo(camIdx, p_cam, param_2, param_3, param_4); +} + +f32 dComIfGp_getCameraZoomScale(int i_no) { + return g_dComIfG_gameInfo.play.getCameraZoomScale(i_no); +} + +void dComIfGp_setCameraZoomScale(int i_no, f32 i_scale) { + g_dComIfG_gameInfo.play.setCameraZoomScale(i_no, i_scale); +} + +f32 dComIfGp_getCameraZoomForcus(int i_no) { + return g_dComIfG_gameInfo.play.getCameraZoomForcus(i_no); +} + +void dComIfGp_setCameraZoomForcus(int i_no, f32 i_focus) { + g_dComIfG_gameInfo.play.setCameraZoomForcus(i_no, i_focus); +} + +const char* dComIfGp_getCameraParamFileName(int i) { + return g_dComIfG_gameInfo.play.getCameraParamFileName(i); +} + +void dComIfGp_setCameraParamFileName(int i, char* name) { + g_dComIfG_gameInfo.play.setCameraParamFileName(i, name); +} + +void dComIfGp_saveCameraPosition(int i, cXyz* i_pos, cXyz* i_target, f32 i_fovy, s16 i_bank) { + g_dComIfG_gameInfo.play.saveCameraPosition(i, i_pos, i_target, i_fovy, i_bank); +} + +void dComIfGp_loadCameraPosition(int i, cXyz* o_pos, cXyz* o_target, f32* o_fovy, s16* o_bank) { + g_dComIfG_gameInfo.play.loadCameraPosition(i, o_pos, o_target, o_fovy, o_bank); +} + +fopAc_ac_c* dComIfGp_getPlayer(int idx) { + return g_dComIfG_gameInfo.play.getPlayer(idx); +} + +void dComIfGp_setPlayer(int i, fopAc_ac_c* player) { + g_dComIfG_gameInfo.play.setPlayer(i, player); +} + +int dComIfGp_getPlayerCameraID(int idx) { + return g_dComIfG_gameInfo.play.getPlayerCameraID(idx); +} + +void dComIfGp_setPlayerInfo(int plyrIdx, fopAc_ac_c* ptr, int camIdx) { + g_dComIfG_gameInfo.play.setPlayerInfo(plyrIdx, ptr, camIdx); +} + +daPy_py_c* dComIfGp_getLinkPlayer() { + return (daPy_py_c*)g_dComIfG_gameInfo.play.getPlayerPtr(LINK_PTR); +} + +daHorse_c* dComIfGp_getHorseActor() { + return (daHorse_c*)g_dComIfG_gameInfo.play.getPlayerPtr(HORSE_PTR); +} + +void dComIfGp_setLinkPlayer(fopAc_ac_c* ptr) { + g_dComIfG_gameInfo.play.setPlayerPtr(0, ptr); +} + +void dComIfGp_setHorseActor(fopAc_ac_c* i_horse) { + g_dComIfG_gameInfo.play.setPlayerPtr(1, i_horse); +} + +void dComIfGp_setPlayerPtr(int i, fopAc_ac_c* ptr) { + g_dComIfG_gameInfo.play.setPlayerPtr(i, ptr); +} + +dMsgObject_c* dComIfGp_getMsgObjectClass() { + return g_dComIfG_gameInfo.play.getMsgObjectClass(); +} + +void dComIfGp_setMsgObjectClass(dMsgObject_c* obj) { + return g_dComIfG_gameInfo.play.setMsgObjectClass(obj); +} + +f32 dComIfGp_getItemLifeCount() { + return g_dComIfG_gameInfo.play.getItemLifeCount(); +} + +u8 dComIfGp_getItemLifeCountType() { + return g_dComIfG_gameInfo.play.getItemLifeCountType(); +} + +void dComIfGp_setItemLifeCount(f32 amount, u8 type) { + g_dComIfG_gameInfo.play.setItemLifeCount(amount, type); +} + +void dComIfGp_clearItemLifeCount() { + g_dComIfG_gameInfo.play.clearItemLifeCount(); +} + +s32 dComIfGp_getItemRupeeCount() { + return g_dComIfG_gameInfo.play.getItemRupeeCount(); +} + +void dComIfGp_setItemRupeeCount(s32 amount) { + g_dComIfG_gameInfo.play.setItemRupeeCount(amount); +} + +void dComIfGp_clearItemRupeeCount() { + g_dComIfG_gameInfo.play.clearItemRupeeCount(); +} + +s16 dComIfGp_getItemKeyNumCount() { + return g_dComIfG_gameInfo.play.getItemKeyNumCount(); +} + +void dComIfGp_setItemKeyNumCount(s16 count) { + g_dComIfG_gameInfo.play.setItemKeyNumCount(count); +} + +void dComIfGp_clearItemKeyNumCount() { + g_dComIfG_gameInfo.play.clearItemKeyNumCount(); +} + +s16 dComIfGp_getItemMaxLifeCount() { + return g_dComIfG_gameInfo.play.getItemMaxLifeCount(); +} + +void dComIfGp_setItemMaxLifeCount(s16 count) { + g_dComIfG_gameInfo.play.setItemMaxLifeCount(count); +} + +void dComIfGp_clearItemMaxLifeCount() { + g_dComIfG_gameInfo.play.clearItemMaxLifeCount(); +} + +void dComIfGp_setItemMagicCount(s16 count) { + g_dComIfG_gameInfo.play.setItemMagicCount(count); +} + +void dComIfGp_setItemNowMagic(s16 magic) { + g_dComIfG_gameInfo.play.setItemNowMagic(magic); +} + +void dComIfGp_setItemMaxMagicCount(s16 count) { + g_dComIfG_gameInfo.play.setItemMaxMagicCount(count); +} + +s32 dComIfGp_getItemOilCount() { + return g_dComIfG_gameInfo.play.getItemOilCount(); +} + +void dComIfGp_setItemOilCount(s32 oil) { + g_dComIfG_gameInfo.play.setItemOilCount(oil); +} + +void dComIfGp_setItemMaxOilCount(s32 oil) { + g_dComIfG_gameInfo.play.setItemMaxOilCount(oil); +} + +void dComIfGp_clearItemOilCount() { + g_dComIfG_gameInfo.play.clearItemOilCount(); +} + +s32 dComIfGp_getItemNowOil() { + return g_dComIfG_gameInfo.play.getItemNowOil(); +} + +void dComIfGp_setItemNowOil(s32 oil) { + g_dComIfG_gameInfo.play.setItemNowOil(oil); +} + +s32 dComIfGp_getItemMaxOilCount() { + return g_dComIfG_gameInfo.play.getItemMaxOilCount(); +} + +void dComIfGp_clearItemMaxOilCount() { + g_dComIfG_gameInfo.play.clearItemMaxOilCount(); +} + +int dComIfGp_getOxygen() { + return g_dComIfG_gameInfo.play.getOxygen(); +} + +void dComIfGp_setOxygen(s32 oxygen) { + g_dComIfG_gameInfo.play.setOxygen(oxygen); +} + +int dComIfGp_getNowOxygen() { + return g_dComIfG_gameInfo.play.getNowOxygen(); +} + +void dComIfGp_setNowOxygen(s32 oxygen) { + g_dComIfG_gameInfo.play.setNowOxygen(oxygen); +} + +s32 dComIfGp_getMaxOxygen() { + return g_dComIfG_gameInfo.play.getMaxOxygen(); +} + +void dComIfGp_setMaxOxygen(s32 i_oxygen) { + g_dComIfG_gameInfo.play.setMaxOxygen(i_oxygen); +} + +s32 dComIfGp_getOxygenCount() { + return g_dComIfG_gameInfo.play.getOxygenCount(); +} + +void dComIfGp_setOxygenCount(s32 oxygen) { + g_dComIfG_gameInfo.play.setOxygenCount(oxygen); +} + +void dComIfGp_clearOxygenCount() { + g_dComIfG_gameInfo.play.clearOxygenCount(); +} + +void dComIfGp_setMaxOxygenCount(s32 oxygen) { + g_dComIfG_gameInfo.play.setMaxOxygenCount(oxygen); +} + +s32 dComIfGp_getMaxOxygenCount() { + return g_dComIfG_gameInfo.play.getMaxOxygenCount(); +} + +void dComIfGp_clearMaxOxygenCount() { + g_dComIfG_gameInfo.play.clearMaxOxygenCount(); +} + +s16 dComIfGp_getItemArrowNumCount() { + return g_dComIfG_gameInfo.play.getItemArrowNumCount(); +} + +void dComIfGp_setItemArrowNumCount(s16 count) { + g_dComIfG_gameInfo.play.setItemArrowNumCount(count); +} + +void dComIfGp_clearItemArrowNumCount() { + g_dComIfG_gameInfo.play.clearItemArrowNumCount(); +} + +s16 dComIfGp_getItemPachinkoNumCount() { + return g_dComIfG_gameInfo.play.getItemPachinkoNumCount(); +} + +void dComIfGp_setItemPachinkoNumCount(s16 count) { + g_dComIfG_gameInfo.play.setItemPachinkoNumCount(count); +} + +void dComIfGp_clearItemPachinkoNumCount() { + g_dComIfG_gameInfo.play.clearItemPachinkoNumCount(); +} + +s16 dComIfGp_getItemMaxArrowNumCount() { + return g_dComIfG_gameInfo.play.getItemMaxArrowNumCount(); +} + +int dComIfGp_getMessageCountNumber() { + return g_dComIfG_gameInfo.play.getMessageCountNumber(); +} + +void dComIfGp_setMessageCountNumber(s32 number) { + g_dComIfG_gameInfo.play.setMessageCountNumber(number); +} + +u16 dComIfGp_getItemNowLife() { + return g_dComIfG_gameInfo.play.getItemNowLife(); +} + +void dComIfGp_setItemNowLife(u16 life) { + g_dComIfG_gameInfo.play.setItemNowLife(life); +} + +u8 dComIfGp_getMesgStatus() { + return g_dComIfG_gameInfo.play.getMesgStatus(); +} + +u8 dComIfGp_getRStatus() { + return g_dComIfG_gameInfo.play.getRStatus(); +} + +bool dComIfGp_isRSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isRSetFlag(flag); +} + +void dComIfGp_setRStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setRStatus(status, flag); +} + +u8 dComIfGp_getRStatusForce() { + return g_dComIfG_gameInfo.play.getRStatusForce(); +} + +u8 dComIfGp_getRSetFlagForce() { + return g_dComIfG_gameInfo.play.getRSetFlagForce(); +} + +void dComIfGp_setRStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setRStatusForce(status, flag); +} + +u8 dComIfGp_getAStatus() { + return g_dComIfG_gameInfo.play.getAStatus(); +} + +bool dComIfGp_isASetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isASetFlag(flag); +} + +void dComIfGp_setAStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setAStatus(status, flag); +} + +u8 dComIfGp_getAStatusForce() { + return g_dComIfG_gameInfo.play.getAStatusForce(); +} + +u8 dComIfGp_getASetFlagForce() { + return g_dComIfG_gameInfo.play.getASetFlagForce(); +} + +void dComIfGp_setAStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setAStatusForce(status, flag); +} + +u8 dComIfGp_getNunStatus() { + return g_dComIfG_gameInfo.play.getNunStatus(); +} + +bool dComIfGp_isNunSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isNunSetFlag(flag); +} + +void dComIfGp_setNunStatus(u8 status, u8 param_1, u8 flag) { + g_dComIfG_gameInfo.play.setNunStatus(status, param_1, flag); +} + +u8 dComIfGp_getBottleStatus() { + return g_dComIfG_gameInfo.play.getBottleStatus(); +} + +bool dComIfGp_isBottleSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isBottleSetFlag(flag); +} + +void dComIfGp_setBottleStatus(u8 param_0, u8 param_1) { + g_dComIfG_gameInfo.play.setBottleStatus(param_0, param_1); +} + +u8 dComIfGp_getBottleStatusForce() { + return g_dComIfG_gameInfo.play.getBottleStatusForce(); +} + +u8 dComIfGp_getBottleSetFlagForce() { + return g_dComIfG_gameInfo.play.getBottleSetFlagForce(); +} + +void dComIfGp_setBottleStatusForce(u8 param_0, u8 param_1) { + g_dComIfG_gameInfo.play.setBottleStatusForce(param_0, param_1); +} + +u8 dComIfGp_getRemoConStatus() { + return g_dComIfG_gameInfo.play.getRemoConStatus(); +} + +bool dComIfGp_isRemoConSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isRemoConSetFlag(flag); +} + +void dComIfGp_setRemoConStatus(u8 status, u8 param_1, u8 flag) { + g_dComIfG_gameInfo.play.setRemoConStatus(status, param_1, flag); +} + +u8 dComIfGp_getDoStatus() { + return g_dComIfG_gameInfo.play.getDoStatus(); +} + +bool dComIfGp_isDoSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isDoSetFlag(flag); +} + +void dComIfGp_setDoStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setDoStatus(status, flag); +} + +u8 dComIfGp_getDoStatusForce() { + return g_dComIfG_gameInfo.play.getDoStatusForce(); +} + +u8 dComIfGp_getDoSetFlagForce() { + return g_dComIfG_gameInfo.play.getDoSetFlagForce(); +} + +void dComIfGp_setDoStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setDoStatusForce(status, flag); +} + +u8 dComIfGp_get3DStatus() { + return g_dComIfG_gameInfo.play.get3DStatus(); +} + +u8 dComIfGp_get3DDirection() { + return g_dComIfG_gameInfo.play.get3DDirection(); +} + +bool dComIfGp_is3DSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.is3DSetFlag(flag); +} + +void dComIfGp_set3DStatus(u8 status, u8 direction, u8 flag) { + g_dComIfG_gameInfo.play.set3DStatus(status, direction, flag); +} + +u8 dComIfGp_get3DStatusForce() { + return g_dComIfG_gameInfo.play.get3DStatusForce(); +} + +u8 dComIfGp_get3DDirectionForce() { + return g_dComIfG_gameInfo.play.get3DDirectionForce(); +} + +u8 dComIfGp_get3DSetFlagForce() { + return g_dComIfG_gameInfo.play.get3DSetFlagForce(); +} + +void dComIfGp_set3DStatusForce(u8 status, u8 direction, u8 flag) { + g_dComIfG_gameInfo.play.set3DStatusForce(status, direction, flag); +} + +u8 dComIfGp_getCStickStatus() { + return g_dComIfG_gameInfo.play.getCStickStatus(); +} + +u8 dComIfGp_getCStickDirection() { + return g_dComIfG_gameInfo.play.getCStickDirection(); +} + +bool dComIfGp_isCStickSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isCStickSetFlag(flag); +} + +void dComIfGp_setCStickStatus(u8 status, u8 param_1, u8 flag) { + g_dComIfG_gameInfo.play.setCStickStatus(status, param_1, flag); +} + +u8 dComIfGp_getCStickStatusForce() { + return g_dComIfG_gameInfo.play.getCStickStatusForce(); +} + +u8 dComIfGp_getCStickDirectionForce() { + return g_dComIfG_gameInfo.play.getCStickDirectionForce(); +} + +u8 dComIfGp_getCStickSetFlagForce() { + return g_dComIfG_gameInfo.play.getCStickSetFlagForce(); +} + +void dComIfGp_setCStickStatusForce(u8 status, u8 param_1, u8 flag) { + g_dComIfG_gameInfo.play.setCStickStatusForce(status, param_1, flag); +} + +u8 dComIfGp_getSButtonStatus() { + return g_dComIfG_gameInfo.play.getSButtonStatus(); +} + +bool dComIfGp_isSButtonSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isSButtonSetFlag(flag); +} + +void dComIfGp_setSButtonStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setSButtonStatus(status, flag); +} + +u8 dComIfGp_getSButtonStatusForce() { + return g_dComIfG_gameInfo.play.getSButtonStatusForce(); +} + +u8 dComIfGp_getSButtonSetFlagForce() { + return g_dComIfG_gameInfo.play.getSButtonSetFlagForce(); +} + +void dComIfGp_setSButtonStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setSButtonStatusForce(status, flag); +} + +u8 dComIfGp_getZStatus() { + return g_dComIfG_gameInfo.play.getZStatus(); +} + +bool dComIfGp_isZSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isZSetFlag(flag); +} + +void dComIfGp_setZStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setZStatus(status, flag); +} + +u8 dComIfGp_getZStatusForce() { + return g_dComIfG_gameInfo.play.getZStatusForce(); +} + +u8 dComIfGp_getZSetFlagForce() { + return g_dComIfG_gameInfo.play.getZSetFlagForce(); +} + +void dComIfGp_setZStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setZStatusForce(status, flag); +} + +u8 dComIfGp_getXStatus() { + return g_dComIfG_gameInfo.play.getXStatus(); +} + +bool dComIfGp_isXSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isXSetFlag(flag); +} + +void dComIfGp_setXStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setXStatus(status, flag); +} + +u8 dComIfGp_getXStatusForce() { + return g_dComIfG_gameInfo.play.getXStatusForce(); +} + +u8 dComIfGp_getXSetFlagForce() { + return g_dComIfG_gameInfo.play.getXSetFlagForce(); +} + +void dComIfGp_setXStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setXStatusForce(status, flag); +} + +u8 dComIfGp_getYStatus() { + return g_dComIfG_gameInfo.play.getYStatus(); +} + +bool dComIfGp_isYSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isYSetFlag(flag); +} + +void dComIfGp_setYStatus(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setYStatus(status, flag); +} + +u8 dComIfGp_getYStatusForce() { + return g_dComIfG_gameInfo.play.getYStatusForce(); +} + +u8 dComIfGp_getYSetFlagForce() { + return g_dComIfG_gameInfo.play.getYSetFlagForce(); +} + +void dComIfGp_setYStatusForce(u8 status, u8 flag) { + g_dComIfG_gameInfo.play.setYStatusForce(status, flag); +} + +u8 dComIfGp_getNunZStatus() { + return g_dComIfG_gameInfo.play.getNunZStatus(); +} + +bool dComIfGp_isNunZSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isNunZSetFlag(flag); +} + +void dComIfGp_setNunZStatus(u8 param_0, u8 param_1) { + g_dComIfG_gameInfo.play.setNunZStatus(param_0, param_1); +} + +u8 dComIfGp_getNunCStatus() { + return g_dComIfG_gameInfo.play.getNunCStatus(); +} + +bool dComIfGp_isNunCSetFlag(u8 flag) { + return g_dComIfG_gameInfo.play.isNunCSetFlag(flag); +} + +void dComIfGp_setNunCStatus(u8 param_0, u8 param_1) { + g_dComIfG_gameInfo.play.setNunCStatus(param_0, param_1); +} + +void dComIfGp_setSelectEquipClothes(u8 i_clothNo) { + g_dComIfG_gameInfo.play.setSelectEquip(COLLECT_CLOTHING, i_clothNo); +} + +void dComIfGp_setSelectEquipSword(u8 i_swordNo) { + g_dComIfG_gameInfo.play.setSelectEquip(COLLECT_SWORD, i_swordNo); +} + +void dComIfGp_setSelectEquipShield(u8 i_shieldNo) { + g_dComIfG_gameInfo.play.setSelectEquip(COLLECT_SHIELD, i_shieldNo); +} + +u8 dComIfGp_getMesgAnimeAttrInfo() { + return g_dComIfG_gameInfo.play.getBaseAnimeID(); +} + +void dComIfGp_setMesgAnimeAttrInfo(u8 param_1) { + g_dComIfG_gameInfo.play.setBaseAnimeID(param_1); +} + +void dComIfGp_clearMesgAnimeAttrInfo() { + g_dComIfG_gameInfo.play.clearBaseAnimeID(); +} + +u8 dComIfGp_getMesgFaceAnimeAttrInfo() { + return g_dComIfG_gameInfo.play.getFaceAnimeID(); +} + +void dComIfGp_setMesgFaceAnimeAttrInfo(u8 id) { + g_dComIfG_gameInfo.play.setFaceAnimeID(id); +} + +void dComIfGp_clearMesgFaceAnimeAttrInfo() { + g_dComIfG_gameInfo.play.clearFaceAnimeID(); +} + +void dComIfGp_clearMesgAnimeTagInfo() { + g_dComIfG_gameInfo.play.clearNowAnimeID(); +} + +void dComIfGp_setItem(u8 slot, u8 i_no) { + g_dComIfG_gameInfo.play.setItem(slot, i_no); +} + +u8 dComIfGp_getAdvanceDirection() { + return g_dComIfG_gameInfo.play.getDirection(); +} + +void dComIfGp_setAdvanceDirection(u8 i_dir) { + g_dComIfG_gameInfo.play.setDirection(i_dir); +} + +u8 dComIfGp_checkMesgCancelButton() { + return g_dComIfG_gameInfo.play.checkMesgCancelButton(); +} + +void dComIfGp_setMesgCancelButton(u8 button) { + g_dComIfG_gameInfo.play.setMesgCancelButton(button); +} + +u8 dComIfGp_getGameoverStatus() { + return g_dComIfG_gameInfo.play.getGameoverStatus(); +} + +void dComIfGp_setGameoverStatus(u8 i_status) { + return g_dComIfG_gameInfo.play.setGameoverStatus(i_status); +} + +u8 dComIfGp_isHeapLockFlag() { + return g_dComIfG_gameInfo.play.isHeapLockFlag(); +} + +u8 dComIfGp_getSubHeapLockFlag(int idx) { + return g_dComIfG_gameInfo.play.getSubHeapLockFlag(idx); +} + +void dComIfGp_setSubHeapLockFlag(int idx, u8 status) { + g_dComIfG_gameInfo.play.setSubHeapLockFlag(idx, status); +} + +u8 dComIfGp_getNeedLightDropNum() { + return g_dComIfG_gameInfo.play.getNeedLightDropNum(); +} + +void dComIfGp_setNeedLightDropNum(u8 i_num) { + g_dComIfG_gameInfo.play.setNeedLightDropNum(i_num); +} + +u8 dComIfGp_checkMesgBgm() { + return g_dComIfG_gameInfo.play.checkMesgBgm(); +} + +void dComIfGp_setMesgBgmOff() { + g_dComIfG_gameInfo.play.setMesgBgm(0); +} + +void dComIfGp_setMesgBgmOn() { + g_dComIfG_gameInfo.play.setMesgBgm(1); +} + +u8 dComIfGp_isPauseFlag() { + return g_dComIfG_gameInfo.play.isPauseFlag(); +} + +void dComIfGp_offPauseFlag() { + g_dComIfG_gameInfo.play.offPauseFlag(); +} + +void dComIfGp_onPauseFlag() { + g_dComIfG_gameInfo.play.onPauseFlag(); +} + +u8 dComIfGp_getOxygenShowFlag() { + return g_dComIfG_gameInfo.play.getOxygenShowFlag(); +} + +void dComIfGp_offOxygenShowFlag() { + g_dComIfG_gameInfo.play.setOxygenShowFlag(0); +} + +void dComIfGp_onOxygenShowFlag() { + g_dComIfG_gameInfo.play.setOxygenShowFlag(1); +} + +u8 dComIfGp_2dShowCheck() { + return g_dComIfG_gameInfo.play.show2dCheck(); +} + +void dComIfGp_2dShowOn() { + g_dComIfG_gameInfo.play.show2dOn(); +} + +void dComIfGp_2dShowOff() { + g_dComIfG_gameInfo.play.show2dOff(); +} + +JKRExpHeap* dComIfGp_getExpHeap2D() { + return g_dComIfG_gameInfo.play.getExpHeap2D(); +} + +void dComIfGp_setExpHeap2D(void* heap) { + g_dComIfG_gameInfo.play.setExpHeap2D(heap); +} + +JKRExpHeap* dComIfGp_getSubExpHeap2D(int idx) { + return g_dComIfG_gameInfo.play.getSubExpHeap2D(idx); +} + +void dComIfGp_setSubExpHeap2D(int idx, void* heap) { + g_dComIfG_gameInfo.play.setSubExpHeap2D(idx, heap); +} + +JKRExpHeap* dComIfGp_getMsgExpHeap() { + return g_dComIfG_gameInfo.play.getMsgExpHeap(); +} + +void dComIfGp_setMsgExpHeap(void* heap) { + g_dComIfG_gameInfo.play.setMsgExpHeap(heap); +} + +dComIfG_MesgCamInfo_c* dComIfGp_getMesgCameraInfo() { + return g_dComIfG_gameInfo.play.getMesgCamInfo(); +} + +void dComIfGp_setMesgCameraTagInfo(int id) { + g_dComIfG_gameInfo.play.setMesgCamInfoID(id); +} + +void dComIfGp_clearMesgCameraTagInfo() { + g_dComIfG_gameInfo.play.clearMesgCamInfoID(); +} + +void dComIfGp_setMesgCameraAttrInfo(int param_1) { + g_dComIfG_gameInfo.play.setMesgCamInfoBasicID(param_1); +} + +void dComIfGp_clearMesgCameraAttrInfo() { + g_dComIfG_gameInfo.play.clearMesgCamInfoBasicID(); +} + +void dComIfGp_setMesgCameraInfoActor(fopAc_ac_c* param_1, fopAc_ac_c* param_2, fopAc_ac_c* param_3, + fopAc_ac_c* param_4, fopAc_ac_c* param_5, fopAc_ac_c* param_6, fopAc_ac_c* param_7, + fopAc_ac_c* param_8, fopAc_ac_c* param_9, fopAc_ac_c* param_10) + +{ + g_dComIfG_gameInfo.play.setMesgCamInfoActor( + param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); +} + +u32 dComIfGp_checkPlayerStatus0(int param_0, u32 flag) { + return g_dComIfG_gameInfo.play.checkPlayerStatus(param_0, 0, flag); +} + +u32 dComIfGp_checkPlayerStatus1(int param_0, u32 flag) { + return g_dComIfG_gameInfo.play.checkPlayerStatus(param_0, 1, flag); +} + +void dComIfGp_setPlayerStatus0(int param_0, u32 flag) { + g_dComIfG_gameInfo.play.setPlayerStatus(param_0, 0, flag); +} + +void dComIfGp_setPlayerStatus1(int param_0, u32 flag) { + g_dComIfG_gameInfo.play.setPlayerStatus(param_0, 1, flag); +} + +void dComIfGp_clearPlayerStatus0(int param_0, u32 flag) { + g_dComIfG_gameInfo.play.clearPlayerStatus(param_0, 0, flag); +} + +void dComIfGp_clearPlayerStatus1(int param_0, u32 flag) { + g_dComIfG_gameInfo.play.clearPlayerStatus(param_0, 1, flag); +} + +void dComIfGp_setCurrentWindow(dDlst_window_c* i_window) { + g_dComIfG_gameInfo.play.setCurrentWindow(i_window); +} + +void dComIfGp_setCurrentView(view_class* i_view) { + g_dComIfG_gameInfo.play.setCurrentView(i_view); +} + +void dComIfGp_setCurrentViewport(view_port_class* i_viewport) { + g_dComIfG_gameInfo.play.setCurrentViewport(i_viewport); +} + +J2DGrafContext* dComIfGp_getCurrentGrafPort() { + return g_dComIfG_gameInfo.play.getCurrentGrafPort(); +} + +void dComIfGp_setCurrentGrafPort(J2DOrthoGraph* i_graf) { + g_dComIfG_gameInfo.play.setCurrentGrafPort(i_graf); +} + +void* dComIfGp_getItemTable() { + return g_dComIfG_gameInfo.play.getItemTable(); +} + +void dComIfGp_setItemTable(void* data) { + g_dComIfG_gameInfo.play.setItemTable(data); +} + +char* dComIfGp_getLastPlayStageName() { + return g_dComIfG_gameInfo.play.getLastPlayStageName(); +} + +void dComIfGp_setLastPlayStageName(char* name) { + g_dComIfG_gameInfo.play.setLastPlayStageName(name); +} + +void dComIfGp_init() { + g_dComIfG_gameInfo.play.init(); +} + +void dComIfGp_itemDataInit() { + g_dComIfG_gameInfo.play.itemInit(); +} + +void dComIfGp_setItemBombNumCount(u8 i_item, s16 count) { + g_dComIfG_gameInfo.play.setItemBombNumCount(i_item, count); +} + +s16 dComIfGp_getItemBombNumCount(u8 i_no) { + return g_dComIfG_gameInfo.play.getItemBombNumCount(i_no); +} + +void dComIfGp_clearItemBombNumCount(u8 i_no) { + g_dComIfG_gameInfo.play.clearItemBombNumCount(i_no); +} + +s16 dComIfGp_getItemMaxBombNumCount() { + return g_dComIfG_gameInfo.play.getItemMaxBombNumCount(dItemNo_NORMAL_BOMB_e); +} + +void dComIfGp_setNowVibration(u8 status) { + g_dComIfG_gameInfo.play.setNowVibration(status); +} + +u32 dComIfGp_getNowVibration() { + return g_dComIfG_gameInfo.play.getNowVibration(); +} + +void dComIfGp_particle_create() { + g_dComIfG_gameInfo.play.createParticle(); +} + +void dComIfGp_createSimpleModel() { + g_dComIfG_gameInfo.play.createSimpleModel(); +} + +void dComIfGp_deleteSimpleModel() { + g_dComIfG_gameInfo.play.deleteSimpleModel(); +} + +void dComIfGp_drawSimpleModel() { + g_dComIfG_gameInfo.play.drawSimpleModel(); +} + +int dComIfGp_addSimpleModel(J3DModelData* i_modelData, int roomNo, u8 i_drawBG) { + return g_dComIfG_gameInfo.play.addSimpleModel(i_modelData, roomNo, i_drawBG); +} + +void dComIfGp_removeSimpleModel(J3DModelData* i_modelData, int roomNo) { + g_dComIfG_gameInfo.play.removeSimpleModel(i_modelData, roomNo); +} + +void dComIfGp_entrySimpleModel(J3DModel* model, int roomNo) { + g_dComIfG_gameInfo.play.entrySimpleModel(model, roomNo); +} + +void dComIfG_ct() { + g_dComIfG_gameInfo.ct(); +} + +dBgS& dComIfG_Bgsp() { + return g_dComIfG_gameInfo.play.mBgs; +} + +dCcS* dComIfG_Ccsp() { + return &g_dComIfG_gameInfo.play.mCcs; +} + +dCcS& dComIfG_Ccsp2() { + return g_dComIfG_gameInfo.play.mCcs; +} + +void dComIfG_setTimerNowTimeMs(int time) { + g_dComIfG_gameInfo.play.setTimerNowTimeMs(time); +} + +int dComIfG_getTimerNowTimeMs() { + return g_dComIfG_gameInfo.play.getTimerNowTimeMs(); +} + +void dComIfG_setTimerLimitTimeMs(int i_time) { + g_dComIfG_gameInfo.play.setTimerLimitTimeMs(i_time); +} + +int dComIfG_getTimerLimitTimeMs() { + return g_dComIfG_gameInfo.play.getTimerLimitTimeMs(); +} + +void dComIfG_setTimerMode(int mode) { + return g_dComIfG_gameInfo.play.setTimerMode(mode); +} + +int dComIfG_getTimerMode() { + return g_dComIfG_gameInfo.play.getTimerMode(); +} + +void dComIfG_setTimerType(u8 i_type) { + g_dComIfG_gameInfo.play.setTimerType(i_type); +} + +u8 dComIfG_getTimerType() { + return g_dComIfG_gameInfo.play.getTimerType(); +} + +void dComIfG_setTimerPtr(dTimer_c* i_ptr) { + g_dComIfG_gameInfo.play.setTimerPtr(i_ptr); +} + +dTimer_c* dComIfG_getTimerPtr() { + return g_dComIfG_gameInfo.play.getTimerPtr(); +} + +/** + * Attempts to add a new Object Resource Archive (*.arc) into the Resource Control. + * @param i_arcName Name of archive to be added + * @param i_mountDirection The direction to mount the archive. mDoDvd_MOUNT_DIRECTION_HEAD or + * mDoDvd_MOUNT_DIRECTION_TAIL + * @param i_heap Pointer to heap to load resources into + * @return TRUE if successful, FALSE otherwise + */ +int dComIfG_setObjectRes(const char* i_arcName, u8 i_mountDirection, JKRHeap* i_heap) { + return g_dComIfG_gameInfo.mResControl.setObjectRes(i_arcName, i_mountDirection, i_heap); +} + +int dComIfG_setObjectRes( + const char* i_arcName, void* i_archiveRes, u32 i_bufferSize, JKRHeap* i_heap) { + UNUSED(i_heap); + return g_dComIfG_gameInfo.mResControl.setObjectRes(i_arcName, i_archiveRes, i_bufferSize, NULL); +} + +/** + * Attempts to add a new Stage Resource Archive (*.arc) into the Resource Control. + * @param i_arcName Name of archive to be added + * @param i_heap Pointer to heap to load resources into + * @return TRUE if successful, FALSE otherwise + */ +int dComIfG_setStageRes(const char* i_arcName, JKRHeap* i_heap) { + return g_dComIfG_gameInfo.mResControl.setStageRes(i_arcName, i_heap); +} + +int dComIfG_syncObjectRes(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.syncObjectRes(i_arcName); +} + +int dComIfG_syncStageRes(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.syncStageRes(i_arcName); +} + +int dComIfG_deleteObjectResMain(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.deleteObjectRes(i_arcName); +} + +int dComIfG_deleteStageRes(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.deleteStageRes(i_arcName); +} + +void* dComIfG_getStageRes(const char* i_arcName, const char* i_resName) { + return g_dComIfG_gameInfo.mResControl.getStageRes(i_arcName, i_resName); +} + +void* dComIfG_getObjectRes(const char* i_arcName, const char* i_resName) { + return g_dComIfG_gameInfo.mResControl.getObjectRes(i_arcName, i_resName); +} + +void* dComIfG_getObjectRes(const char* i_arcName, int i_index) { + return g_dComIfG_gameInfo.mResControl.getObjectRes(i_arcName, i_index); +} + +void dComIfG_dumpResControl() { + g_dComIfG_gameInfo.mResControl.dump(); +} + +dRes_info_c* dComIfG_getObjectResInfo(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.getObjectResInfo(i_arcName); +} + +dRes_info_c* dComIfG_getStageResInfo(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.getStageResInfo(i_arcName); +} + +int dComIfG_syncAllObjectRes() { + return g_dComIfG_gameInfo.mResControl.syncAllObjectRes(); +} + +void* dComIfG_getObjectIDRes(const char* i_arcName, u16 i_resID) { + return g_dComIfG_gameInfo.mResControl.getObjectIDRes(i_arcName, i_resID); +} + +int dComIfG_getObjctResName2Index(const char* i_arcName, const char* i_resName) { + return g_dComIfG_gameInfo.mResControl.getObjectResName2Index(i_arcName, i_resName); +} + +u8 dComIfG_getBrightness() { + return g_dComIfG_gameInfo.mFadeBrightness; +} + +void dComIfG_setBrightness(u8 brightness) { + g_dComIfG_gameInfo.mFadeBrightness = brightness; +} + +BOOL dComIfG_isDebugMode() { + return g_dComIfG_gameInfo.mIsDebugMode; +} + +u32 dComIfG_getTrigB(u32 i_padNo) { + return mDoCPd_c::getTrig(i_padNo) & PAD_BUTTON_B; +} + +#if DEBUG +u32 dComIfG_getObjectAllSize() { + return g_dComIfG_gameInfo.mResControl.getObjectAllSize(); +} + +u32 dComIfG_getStageAllSize() { + return g_dComIfG_gameInfo.mResControl.getStageAllSize(); +} + +u32 dComIfG_getObjectSize(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.getObjectSize(i_arcName); +} + +u32 dComIfG_getStageSize(const char* i_arcName) { + return g_dComIfG_gameInfo.mResControl.getStageSize(i_arcName); +} + +void dComIfG_initStopwatch() { + OSInitStopwatch(&g_dComIfG_gameInfo.mStopwatch, "dComIfG"); +} +#endif + +int dComIfGd_setRealShadow(u32 param_0, s8 param_1, J3DModel* param_2, cXyz* param_3, f32 param_4, + f32 param_5, dKy_tevstr_c* param_6) { + return g_dComIfG_gameInfo.drawlist.setRealShadow( + param_0, param_1, param_2, param_3, param_4, param_5, param_6); +} + +int dComIfGd_setSimpleShadow( + cXyz* pos, f32 param_1, f32 param_2, cXyz* param_3, s16 angle, f32 param_5, TGXTexObj* tex) { + return g_dComIfG_gameInfo.drawlist.setSimpleShadow( + pos, param_1, param_2, param_3, angle, param_5, tex); +} + +bool dComIfGd_addRealShadow(u32 key, J3DModel* model) { + return g_dComIfG_gameInfo.drawlist.addRealShadow(key, model); +} + +void dComIfGd_drawListItem3d() { + g_dComIfG_gameInfo.drawlist.drawOpaListItem3d(); + g_dComIfG_gameInfo.drawlist.drawXluListItem3d(); +} + +#if VERSION > VERSION_GCN_JPN +void dComIfGd_drawListCursor() { + g_dComIfG_gameInfo.drawlist.drawOpaListCursor(); + g_dComIfG_gameInfo.drawlist.drawXluListCursor(); +} +#endif + +void dComIfGd_reset() { + g_dComIfG_gameInfo.drawlist.reset(); +} + +void dComIfGd_set2DOpa(dDlst_base_c* dlst) { + g_dComIfG_gameInfo.drawlist.set2DOpa(dlst); +} + +void dComIfGd_set2DXlu(dDlst_base_c* dlst) { + g_dComIfG_gameInfo.drawlist.set2DXlu(dlst); +} + +void dComIfGd_set2DOpaTop(dDlst_base_c* dlst) { + g_dComIfG_gameInfo.drawlist.set2DOpaTop(dlst); +} + +void dComIfGd_setCopy2D(dDlst_base_c* dlst) { + g_dComIfG_gameInfo.drawlist.setCopy2D(dlst); +} + +view_class* dComIfGd_getView() { + return g_dComIfG_gameInfo.drawlist.getView(); +} + +Mtx44* dComIfGd_getProjViewMtx() { + return &(g_dComIfG_gameInfo.drawlist.getView()->projViewMtx); +} + +MtxP dComIfGd_getInvViewMtx() { + return g_dComIfG_gameInfo.drawlist.getView()->invViewMtx; +} + +view_port_class* dComIfGd_getViewport() { + return g_dComIfG_gameInfo.drawlist.getViewport(); +} + +MtxP dComIfGd_getViewRotMtx() { + return g_dComIfG_gameInfo.drawlist.getView()->viewMtxNoTrans; +} +MtxP dComIfGd_getViewMtx() { + return g_dComIfG_gameInfo.drawlist.getView()->viewMtx; +} + +J3DDrawBuffer* dComIfGd_getListFilter() { + return g_dComIfG_gameInfo.drawlist.getOpaListFilter(); +} + +J3DDrawBuffer* dComIfGd_getOpaListIndScreen() { + return g_dComIfG_gameInfo.drawlist.getOpaListP0(); +} + +J3DDrawBuffer* dComIfGd_getListPacket() { + return g_dComIfG_gameInfo.drawlist.getOpaListPacket(); +} + +void dComIfGd_setListSky() { + g_dComIfG_gameInfo.drawlist.setOpaListSky(); + g_dComIfG_gameInfo.drawlist.setXluListSky(); +} + +void dComIfGd_setListDark() { + g_dComIfG_gameInfo.drawlist.setOpaListDark(); + g_dComIfG_gameInfo.drawlist.setXluListDark(); +} + +void dComIfGd_setListInvisisble() { + g_dComIfG_gameInfo.drawlist.setOpaListInvisible(); + g_dComIfG_gameInfo.drawlist.setXluListInvisible(); +} + +void dComIfGd_setListDarkBG() { + g_dComIfG_gameInfo.drawlist.setOpaListDarkBG(); + g_dComIfG_gameInfo.drawlist.setXluListDarkBG(); +} + +void dComIfGd_setXluListDarkBG() { + g_dComIfG_gameInfo.drawlist.setXluListDarkBG(); +} + +void dComIfGd_setList() { + g_dComIfG_gameInfo.drawlist.setOpaList(); + g_dComIfG_gameInfo.drawlist.setXluList(); +} + +void dComIfGd_setListItem3D() { + g_dComIfG_gameInfo.drawlist.setOpaListItem3D(); + g_dComIfG_gameInfo.drawlist.setXluListItem3D(); +} + +void dComIfGd_setList3Dlast() { + g_dComIfG_gameInfo.drawlist.setOpaList3Dlast(); + g_dComIfG_gameInfo.drawlist.setXluList3Dlast(); +} + +void dComIfGd_setXluList2DScreen() { + g_dComIfG_gameInfo.drawlist.setXluList2DScreen(); +} + +void dComIfGd_setXluListBG() { + g_dComIfG_gameInfo.drawlist.setXluListBG(); +} + +void dComIfGd_setListBG() { + g_dComIfG_gameInfo.drawlist.setOpaListBG(); + g_dComIfG_gameInfo.drawlist.setXluListBG(); +} + +void dComIfGd_setListIndScreen() { + g_dComIfG_gameInfo.drawlist.setOpaListP0(); + g_dComIfG_gameInfo.drawlist.setXluListP0(); +} + +void dComIfGd_setListMiddle() { + g_dComIfG_gameInfo.drawlist.setOpaListMiddle(); + g_dComIfG_gameInfo.drawlist.setXluListMiddle(); +} + +void dComIfGd_setListZxlu() { + g_dComIfG_gameInfo.drawlist.setOpaListZxlu(); + g_dComIfG_gameInfo.drawlist.setXluListZxlu(); +} + +J3DDrawBuffer* dComIfGd_getOpaList() { + return g_dComIfG_gameInfo.drawlist.getOpaList(); +} + +J3DDrawBuffer* dComIfGd_getOpaListBG() { + return g_dComIfG_gameInfo.drawlist.getOpaListBG(); +} + +J3DDrawBuffer* dComIfGd_getOpaListDark() { + return g_dComIfG_gameInfo.drawlist.getOpaListDark(); +} + +J3DDrawBuffer* dComIfGd_getXluListBG() { + return g_dComIfG_gameInfo.drawlist.getXluListBG(); +} + +void dComIfGd_setListFilter() { + g_dComIfG_gameInfo.drawlist.setOpaListFilter(); + g_dComIfG_gameInfo.drawlist.setXluListFilter(); +} + +void dComIfGd_init() { + g_dComIfG_gameInfo.drawlist.init(); +} + +void dComIfGd_peekZ(s16 param_0, s16 param_1, u32* param_2) { + g_dComIfG_gameInfo.drawlist.newPeekZdata(param_0, param_1, param_2); +} + +void dComIfGd_peekZdata() { + g_dComIfG_gameInfo.drawlist.peekZdata(); +} + +void dComIfGd_setView(view_class* view) { + g_dComIfG_gameInfo.drawlist.setView(view); +} + +void dComIfGd_setWindow(dDlst_window_c* window) { + g_dComIfG_gameInfo.drawlist.setWindow(window); +} + +void dComIfGd_setViewport(view_port_class* port) { + g_dComIfG_gameInfo.drawlist.setViewport(port); +} + +void dComIfGd_entryZSortListZxlu(J3DPacket* i_packet, cXyz& param_1) { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.entryZSortListZxlu(i_packet, param_1); +} + +void dComIfGd_entryZSortXluList(J3DPacket* i_packet, cXyz& param_1) { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.entryZSortXluList(i_packet, param_1); +} + +void dComIfGd_drawCopy2D() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawCopy2D(); +} + +void dComIfGd_drawOpaListSky() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListSky(); +} + +void dComIfGd_drawXluListSky() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluListSky(); +} + +void dComIfGd_drawOpaListBG() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListBG(); +} + +void dComIfGd_drawOpaListDarkBG() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListDarkBG(); +} + +void dComIfGd_drawOpaListMiddle() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListMiddle(); +} + +void dComIfGd_drawOpaList() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaList(); +} + +void dComIfGd_drawOpaListDark() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListDark(); +} + +void dComIfGd_drawOpaListPacket() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListPacket(); +} + +void dComIfGd_drawXluListBG() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluListBG(); +} + +void dComIfGd_drawXluListDarkBG() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluListDarkBG(); +} + +void dComIfGd_drawXluList() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluList(); +} + +void dComIfGd_drawXluListDark() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluListDark(); +} + +void dComIfGd_drawXluListZxlu() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluListZxlu(); +} + +void dComIfGd_drawXluList2DScreen() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluList2DScreen(); +} + +void dComIfGd_drawOpaList3Dlast() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaList3Dlast(); +} + +void dComIfGd_draw2DOpa() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.draw2DOpa(); +} + +void dComIfGd_draw2DOpaTop() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.draw2DOpaTop(); +} + +void dComIfGd_draw2DXlu() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.draw2DXlu(); +} + +void dComIfGd_drawOpaListFilter() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListFilter(); +} + +void dComIfGd_drawIndScreen() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawOpaListP0(); +} + +void dComIfGd_drawListZxlu() { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawXluListZxlu(); +} + +void dComIfGd_drawShadow(Mtx param_0) { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.drawShadow(param_0); +} + +void dComIfGd_imageDrawShadow(Mtx param_0) { + ZoneScoped; + g_dComIfG_gameInfo.drawlist.imageDrawShadow(param_0); +} + +void dComIfGd_set3DlineMat(mDoExt_3DlineMat_c* param_0) { + g_dComIfG_gameInfo.drawlist.set3DlineMat(param_0); +} + +void dComIfGd_set3DlineMatDark(mDoExt_3DlineMat_c* param_0) { + g_dComIfG_gameInfo.drawlist.set3DlineMatDark(param_0); +} + +#if PLATFORM_WII || VERSION == VERSION_SHIELD_DEBUG +void dComIfGd_setListCursor() { + g_dComIfG_gameInfo.drawlist.setOpaListCursor(); + g_dComIfG_gameInfo.drawlist.setXluListCursor(); +} +#endif + void dComIfGd_drawXluListInvisible() { ZoneScoped; if (!dusk::getSettings().game.disableWaterRefraction) { diff --git a/src/d/d_drawlist.cpp b/src/d/d_drawlist.cpp index e8b4464dee..cf4a830799 100644 --- a/src/d/d_drawlist.cpp +++ b/src/d/d_drawlist.cpp @@ -18,7 +18,7 @@ #include #include "JSystem/JKernel/JKRHeap.h" #include "absl/container/flat_hash_map.h" -#include "client/TracyScoped.hpp" +#include "tracy/Tracy.hpp" #include "dusk/frame_interpolation.h" #include "helpers/gx_helper.h" #include "dusk/logging.h" diff --git a/src/d/d_file_select.cpp b/src/d/d_file_select.cpp index 4b23d3ded9..3f64b8b239 100644 --- a/src/d/d_file_select.cpp +++ b/src/d/d_file_select.cpp @@ -1789,10 +1789,16 @@ void dFile_select_c::nameInput2() { #if TARGET_PC dusk::mods::svc::save_slot_new(mSelectNum); const dusk::gamemode::GameMode* gameMode = - dusk::gamemode::getGameModeManager().getCurrentGameMode(); + dusk::gamemode::getGameModeManager().getCurrentGameMode(); if (gameMode) { gameMode->invokeOnNewSaveFunction(); - gameMode->invokeOnSaveLoadedFunction(); + } + + // only do OnSaveLoaded callback here if hiding the brightness check screen + if (dusk::getSettings().game.hideTvSettingsScreen) { + if (gameMode) { + gameMode->invokeOnSaveLoadedFunction(); + } } #endif mDataSelProc = DATASELPROC_NEXT_MODE_WAIT; diff --git a/src/d/d_item.cpp b/src/d/d_item.cpp index a388ef155c..f89d4f37e8 100644 --- a/src/d/d_item.cpp +++ b/src/d/d_item.cpp @@ -269,7 +269,10 @@ static void (*item_func_ptr[256])() = { item_func_noentry, }; -inline void getItemFunc(u8 i_itemNo) { +#if !TARGET_PC +inline +#endif +void getItemFunc(u8 i_itemNo) { dComIfGs_onItemFirstBit(i_itemNo); item_func_ptr[i_itemNo](); } diff --git a/src/d/d_menu_save.cpp b/src/d/d_menu_save.cpp index 48f3f953ea..a9c4e8f908 100644 --- a/src/d/d_menu_save.cpp +++ b/src/d/d_menu_save.cpp @@ -1452,6 +1452,12 @@ void dMenu_save_c::memCardDataSaveWait() { mCmdState = g_mDoMemCd_control.SaveSync(); if (mCmdState != 0) { +#if TARGET_PC + if (mCmdState == 1) { + dusk::mods::svc::save_slot_written( + mSelectedFile, mSaveBuffer + mSelectedFile * QUEST_LOG_SIZE); + } +#endif printf("save cmdState %d\n", mCmdState); mMenuProc = PROC_MEMCARD_DATA_SAVE_WAIT2; } @@ -1469,10 +1475,6 @@ void dMenu_save_c::memCardDataSaveWait2() { dComIfGs_setDataNum(mSelectedFile); dComIfGs_setNoFile(0); -#if TARGET_PC - dusk::mods::svc::save_slot_written(mSelectedFile, mSaveBuffer + mSelectedFile * QUEST_LOG_SIZE); -#endif - if (mUseType == TYPE_WHITE_EVENT || mUseType == TYPE_BLACK_EVENT) { headerTxtSet(0x530); // Saved. mWarning->closeInit(); diff --git a/src/d/d_meter2.cpp b/src/d/d_meter2.cpp index 8d396e0185..a90124ebb6 100644 --- a/src/d/d_meter2.cpp +++ b/src/d/d_meter2.cpp @@ -606,7 +606,8 @@ void dMeter2_c::moveLife() { life_count = (dComIfGs_getMaxLife() / 5) * 4; } - s16 new_life = dComIfGs_getLife() + dComIfGp_getItemLifeCount(); + DUSK_IF_ELSE(int, s16) new_life = dComIfGs_getLife() + dComIfGp_getItemLifeCount(); // prevent an overflow with really large damage values + if (new_life > life_count) { new_life = life_count; } else if (new_life < 0) { diff --git a/src/d/d_meter2_draw.cpp b/src/d/d_meter2_draw.cpp index 865b57be59..a1425355ab 100644 --- a/src/d/d_meter2_draw.cpp +++ b/src/d/d_meter2_draw.cpp @@ -198,6 +198,20 @@ dMeter2Draw_c::dMeter2Draw_c(JKRExpHeap* mp_heap) { IF_DUSK_BLOCK_END #endif +#if TARGET_PC + if (dusk::version::isLessThanWiiJpn()) { + if (J2DPicture* b_btn = static_cast(mpScreen->search(MULTI_CHAR('b_btn')))) { + b_btn->setAlpha(255); + b_btn->setWhite(JUtility::TColor(195, 63, 63, 255)); + } + + for (int i = 0; i < 5; i++) { + static_cast(mpXYText[i][0]->getPanePtr())->setCharSpace(0.0f); + static_cast(mpXYText[i][1]->getPanePtr())->setCharSpace(0.0f); + } + } +#endif + init(); field_0xa8 = 0; field_0x1e4 = 0; @@ -2460,7 +2474,7 @@ void dMeter2Draw_c::drawButtonA(u8 i_action, f32 i_posX, f32 i_posY, f32 i_textP mpButtonA->paneTrans(i_posX, i_posY); mpTextA->scale(var_f30 * i_scale, var_f30 * i_scale); mpTextA->paneTrans(g_drawHIO.mButtonATextPosX + i_textPosX, - g_drawHIO.mButtonATextPosY + i_textPosY); + g_drawHIO.mButtonATextPosY + i_textPosY IF_DUSK(+ (dusk::version::isLessThanWiiJpn() ? 6.0f : 0.0f))); } void dMeter2Draw_c::drawButtonB(u8 i_action, bool param_1, f32 i_posX, f32 i_posY, f32 i_textPosX, @@ -2658,6 +2672,11 @@ void dMeter2Draw_c::drawButtonXY(int i_no, u8 i_itemNo, u8 i_action, bool param_ static u64 const tag[] = {MULTI_CHAR('item_x_n'), MULTI_CHAR('item_y_n')}; +#if TARGET_PC + const float btnXOffsetX = dusk::version::isLessThanWiiJpn() ? 2.0f : 0.0f; + const float btnXOffsetY = dusk::version::isLessThanWiiJpn() ? 38.0f : 0.0f; +#endif + if (!param_3) { mpScreen->search(tag[i_no])->hide(); @@ -2704,7 +2723,8 @@ void dMeter2Draw_c::drawButtonXY(int i_no, u8 i_itemNo, u8 i_action, bool param_ if (i_no == SELECT_X_e) { mpTextXY[i_no]->scale(g_drawHIO.mButtonXYTextScale, g_drawHIO.mButtonXYTextScale); - mpTextXY[i_no]->paneTrans(g_drawHIO.mButtonXYTextPosX, g_drawHIO.mButtonXYTextPosY); + mpTextXY[i_no]->paneTrans(g_drawHIO.mButtonXYTextPosX IF_DUSK(- btnXOffsetX), + g_drawHIO.mButtonXYTextPosY IF_DUSK(+ btnXOffsetY)); } else if (i_no == SELECT_Y_e) { mpTextXY[i_no]->scale(g_drawHIO.mButtonXYTextScale, g_drawHIO.mButtonXYTextScale); mpTextXY[i_no]->paneTrans(g_drawHIO.mButtonXYTextPosX, g_drawHIO.mButtonXYTextPosY); @@ -2766,7 +2786,8 @@ void dMeter2Draw_c::drawButtonXY(int i_no, u8 i_itemNo, u8 i_action, bool param_ mpLightXY[0]->setAlphaRate(mButtonXItemBaseAlpha[var_r29] * field_0x7f0); mpTextXY[i_no]->scale(g_drawHIO.mButtonXYTextScale, g_drawHIO.mButtonXYTextScale); - mpTextXY[i_no]->paneTrans(g_drawHIO.mButtonXYTextPosX, g_drawHIO.mButtonXYTextPosY); + mpTextXY[i_no]->paneTrans(g_drawHIO.mButtonXYTextPosX IF_DUSK(- btnXOffsetX), + g_drawHIO.mButtonXYTextPosY IF_DUSK(+ btnXOffsetY)); } else if (i_no == SELECT_Y_e) { mpButtonXY[1]->scale(g_drawHIO.mButtonYScale, g_drawHIO.mButtonYScale); mpButtonXY[1]->paneTrans(g_drawHIO.mButtonYPosX, g_drawHIO.mButtonYPosY); diff --git a/src/d/d_meter2_info.cpp b/src/d/d_meter2_info.cpp index 4e55a330f9..15569a72d8 100644 --- a/src/d/d_meter2_info.cpp +++ b/src/d/d_meter2_info.cpp @@ -1900,3 +1900,542 @@ void dMeter2Info_set2DVibrationT() {} void dMeter2Info_set2DVibration() {} void dMeter2Info_set2DVibrationM() {} + +#if TARGET_PC +void dMeter2Info_Initialize() { + g_meter2_info.init(); +} + +dMeterMap_c* dMeter2Info_getMeterMapClass() { + return g_meter2_info.getMeterMapClass(); +} + +dMw_c* dMeter2Info_getMenuWindowClass() { + return g_meter2_info.getMenuWindowClass(); +} + +void dMeter2Info_setWindowStatus(u8 i_status) { + g_meter2_info.setWindowStatus(i_status); +} + +CPaneMgr* dMeter2Info_getMeterItemPanePtr(s32 i_idx) { + return g_meter2_info.getMeterItemPanePtr(i_idx); +} + +void dMeter2Info_getString(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { + g_meter2_info.getString(i_stringID, o_string, i_msgEntry); +} + +void dMeter2Info_getStringKanji(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { + g_meter2_info.getStringKanji(i_stringID, o_string, i_msgEntry); +} + +void dMeter2Info_getStringKana(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) { + g_meter2_info.getStringKana(i_stringID, o_string, i_msgEntry); +} + +f32 dMeter2Info_getStringLength(JUTFont* i_font, f32 param_2, f32 param_3, char* i_string) { + return g_meter2_info.getStringLength(i_font, param_2, param_3, i_string); +} + +f32 dMeter2Info_getStringLength(J2DTextBox* i_textbox, char* i_string) { + return g_meter2_info.getStringLength(i_textbox, i_string); +} + +void dMeter2Info_setHotSpringTimer(u8 i_slotNo) { + g_meter2_info.setHotSpringTimer(i_slotNo); +} + +u16 dMeter2Info_getOilGaugeBackUp() { + return g_meter2_info.getOilGaugeBackUp(); +} + +void dMeter2Info_setOilGaugeBackUp(u16 param_1) { + g_meter2_info.setOilGaugeBackUp(param_1); +} + +void dMeter2Info_setSaveStageName(const char* i_stageName) { + g_meter2_info.setSaveStageName(i_stageName); +} + +u8 dMeter2Info_getInsectSelectType() { + return g_meter2_info.getInsectSelectType(); +} + +void dMeter2Info_setInsectSelectType(u8 i_type) { + g_meter2_info.setInsectSelectType(i_type); +} + +u8 dMeter2Info_getWarpStatus() { + return g_meter2_info.getWarpStatus(); +} + +void dMeter2Info_setWarpStatus(u8 i_status) { + return g_meter2_info.setWarpStatus(i_status); +} + +int dMeter2Info_readItemTexture(u8 i_itemNo, void* i_texBuf1, J2DPicture* i_pic1, void* i_texBuf2, + J2DPicture* i_pic2, void* i_texBuf3, J2DPicture* i_pic3, void* i_texBuf4, J2DPicture* i_pic4, + int param_9) { + return g_meter2_info.readItemTexture(i_itemNo, i_texBuf1, i_pic1, i_texBuf2, i_pic2, i_texBuf3, + i_pic3, i_texBuf4, i_pic4, param_9); +} + +void dMeter2Info_setItemColor( + u8 i_itemNo, J2DPicture* i_pic1, J2DPicture* i_pic2, J2DPicture* i_pic3, J2DPicture* i_pic4) { + g_meter2_info.setItemColor(i_itemNo, i_pic1, i_pic2, i_pic3, i_pic4); +} + +u8 dMeter2Info_getWarpRoomNo() { + return g_meter2_info.getWarpRoomNo(); +} + +u8 dMeter2Info_getWarpPlayerNo() { + return g_meter2_info.getWarpPlayerNo(); +} + +cXyz& dMeter2Info_getWarpPos() { + return g_meter2_info.getWarpPos(); +} + +const char* dMeter2Info_getWarpStageName() { + return g_meter2_info.getWarpStageName(); +} + +void dMeter2Info_setNowCount(u8 i_count) { + g_meter2_info.setNowCount(i_count); +} + +void dMeter2Info_setMaxCount(u8 i_count) { + g_meter2_info.setMaxCount(i_count); +} + +BOOL dMeter2Info_isDirectUseItem(int param_0) { + return g_meter2_info.isDirectUseItem(param_0); +} + +bool dMeter2Info_isUseButton(int i_buttonBit) { + return g_meter2_info.isUseButton(i_buttonBit); +} + +void dMeter2Info_setMeterMapClass(dMeterMap_c* i_map) { + g_meter2_info.setMeterMapClass(i_map); +} + +void dMeter2Info_decHotSpringTimer() { + g_meter2_info.decHotSpringTimer(); +} + +void dMeter2Info_allUseButton() { + g_meter2_info.allUseButton(); +} + +void dMeter2Info_offUseButton(int i_buttonBit) { + g_meter2_info.offUseButton(i_buttonBit); +} + +void dMeter2Info_resetGameStatus() { + g_meter2_info.resetGameStatus(); +} + +void dMeter2Info_onGameStatus(int i_status) { + g_meter2_info.onGameStatus(i_status); +} + +void dMeter2Info_setMapStatus(u8 i_status) { + g_meter2_info.setMapStatus(i_status); +} + +u8 dMeter2Info_getMapStatus() { + return g_meter2_info.getMapStatus(); +} + +void dMeter2Info_setPauseStatus(u8 i_status) { + g_meter2_info.setPauseStatus(i_status); +} + +void dMeter2Info_resetPauseStatus() { + g_meter2_info.resetPauseStatus(); +} + +u8 dMeter2Info_getPauseStatus() { + return g_meter2_info.getPauseStatus(); +} + +bool dMeter2Info_isGameStatus(int i_status) { + return g_meter2_info.isGameStatus(i_status); +} + +bool dMeter2Info_isTouchKeyCheck(int i_status) { + return g_meter2_info.isTouchKeyCheck(i_status); +} + +void dMeter2Info_setMapKeyDirection(u16 i_direction) { + g_meter2_info.setMapKeyDirection(i_direction); +} + +bool dMeter2Info_isSub2DStatus(int i_flag) { + return g_meter2_info.isSub2DStatus(i_flag); +} + +void dMeter2Info_offMenuInForce(int i_flag) { + g_meter2_info.offMenuInForce(i_flag); +} + +bool dMeter2Info_isMenuInForce(int i_flag) { + return g_meter2_info.isMenuInForce(i_flag); +} + +void dMeter2Info_setMenuWindowClass(dMw_c* i_menu) { + g_meter2_info.setMenuWindowClass(i_menu); +} + +void dMeter2Info_resetWarpStatus() { + g_meter2_info.resetWarpStatus(); +} + +u16 dMeter2Info_getMapKeyDirection() { + return g_meter2_info.getMapKeyDirection(); +} + +u8 dMeter2Info_getWindowStatus() { + return g_meter2_info.getWindowStatus(); +} + +void dMeter2Info_setMsgResource(void* i_res) { + g_meter2_info.setMsgResource(i_res); +} + +void dMeter2Info_setStageMsgResource(void* i_res) { + g_meter2_info.setStageMsgResource(i_res); +} + +void dMeter2Info_setMsgUnitResource(void* i_res) { + g_meter2_info.setMsgUnitResource(i_res); +} + +void* dMeter2Info_getMsgResource() { + return g_meter2_info.getMsgResource(); +} + +void* dMeter2Info_getStageMsgResource() { + return g_meter2_info.getStageMsgResource(); +} + +void* dMeter2Info_getMsgUnitResource() { + return g_meter2_info.getMsgUnitResource(); +} + +u8 dMeter2Info_getLightDropGetFlag(int i_no) { + return g_meter2_info.getLightDropGetFlag(i_no); +} + +s32 dMeter2Info_getMeterStringType() { + return g_meter2_info.getMeterStringType(); +} + +void dMeter2Info_setMeterClass(dMeter2_c* i_meter) { + g_meter2_info.setMeterClass(i_meter); +} + +void dMeter2Info_onLifeGaugeSE() { + g_meter2_info.onLifeGaugeSE(); +} + +void dMeter2Info_offLifeGaugeSE() { + g_meter2_info.offLifeGaugeSE(); +} + +u8 dMeter2Info_getLifeGaugeSE() { + return g_meter2_info.getLifeGaugeSE(); +} + +const char* dMeter2Info_getSaveStageName() { + return g_meter2_info.getSaveStageName(); +} + +void dMeter2Info_onShopTalkFlag() { + g_meter2_info.onShopTalkFlag(); +} + +void dMeter2Info_setLightDropGetFlag(int i_no, u8 i_flag) { + g_meter2_info.setLightDropGetFlag(i_no, i_flag); +} + +u8 dMeter2Info_getRentalBombBag() { + return g_meter2_info.getRentalBombBag(); +} + +u8 dMeter2Info_getMiniGameItemSetFlag() { + return g_meter2_info.getMiniGameItemSetFlag(); +} + +void dMeter2Info_setMiniGameItem(u8 i_minigameFlag) { + g_meter2_info.setMiniGameItem(i_minigameFlag); +} + +void dMeter2Info_resetMiniGameItem(bool i_saveItem) { + g_meter2_info.resetMiniGameItem(i_saveItem); +} + +void dMeter2Info_setTableMapRegionNo(u8 i_regionNo) { + g_meter2_info.setTableMapRegionNo(i_regionNo); +} + +void dMeter2Info_setGoldWolfMapType(u8 i_mapType) { + g_meter2_info.setGoldWolfMapType(i_mapType); +} + +void dMeter2Info_changeWater(u8 i_slotNo) { + g_meter2_info.changeWater(i_slotNo); +} + +void dMeter2Info_warpInProc() { + g_meter2_info.warpInProc(); +} + +void dMeter2Info_warpOutProc() { + g_meter2_info.warpOutProc(); +} + +dMeter2_c* dMeter2Info_getMeterClass() { + return g_meter2_info.getMeterClass(); +} + +s16 dMeter2Info_getMsgKeyWaitTimer() { + return g_meter2_info.getMsgKeyWaitTimer(); +} + +void dMeter2Info_onDirectUseItem(int param_0) { + g_meter2_info.onDirectUseItem(param_0); +} + +void dMeter2Info_setFloatingFlow(u16 i_flowID, s16 i_msgTimer, bool i_wakuVisible) { + g_meter2_info.setFloatingFlow(i_flowID, i_msgTimer, i_wakuVisible); +} + +u8 dMeter2Info_getGameOverType() { + return g_meter2_info.getGameOverType(); +} + +void dMeter2Info_setGameOverType(u8 i_gameoverType) { + g_meter2_info.setGameOverType(i_gameoverType); +} + +void dMeter2Info_setMsgKeyWaitTimer(s16 i_waitTimer) { + g_meter2_info.setMsgKeyWaitTimer(i_waitTimer); +} + +s32 dMeter2Info_getMsgTimeMs() { + return g_meter2_info.getMsgTimeMs(); +} + +s32 dMeter2Info_getTimeMs() { + return g_meter2_info.getTimeMs(); +} + +void dMeter2Info_setMsgTimeMs(s32 i_msgTime) { + g_meter2_info.setMsgTimeMs(i_msgTime); +} + +void dMeter2Info_setTimeMs(s32 i_time) { + g_meter2_info.setTimeMs(i_time); +} + +u8 dMeter2Info_getNowCount() { + return g_meter2_info.getNowCount(); +} + +u8 dMeter2Info_getMaxCount() { + return g_meter2_info.getMaxCount(); +} + +void dMeter2Info_setScopeZoomPointer(u8 param_0) { + g_meter2_info.setScopeZoomPointer(param_0); +} + +void dMeter2Info_decMsgKeyWaitTimer() { + g_meter2_info.decMsgKeyWaitTimer(); +} + +bool dMeter2Info_isFloatingMessageVisible() { + return g_meter2_info.isFloatingMessageVisible(); +} + +u8 dMeter2Info_getItemExplainWindowStatus() { + return g_meter2_info.getItemExplainWindowStatus(); +} + +void dMeter2Info_setItemExplainWindowStatus(u8 i_value) { + g_meter2_info.setItemExplainWindowStatus(i_value); +} + +void dMeter2Info_resetDirectUseItem() { + g_meter2_info.resetDirectUseItem(); +} + +u16 dMeter2Info_getFloatingFlowID() { + return g_meter2_info.getFloatingFlowID(); +} + +u8 dMeter2Info_getCollectCursorPosX() { + return g_meter2_info.getCollectCursorPosX(); +} + +u8 dMeter2Info_getCollectCursorPosY() { + return g_meter2_info.getCollectCursorPosY(); +} + +void dMeter2Info_setCollectCursorPosXY(u8 x, u8 y) { + g_meter2_info.setCollectCursorPosXY(x, y); +} + +void dMeter2Info_onBlinkButton(int i_flag) { + g_meter2_info.onBlinkButton(i_flag); +} + +bool dMeter2Info_isFloatingMessageWakuVisible() { + return g_meter2_info.isFloatingMessageWakuVisible(); +} + +bool dMeter2Info_isBlinkButton(int i_flag) { + return g_meter2_info.isBlinkButton(i_flag); +} + +void dMeter2Info_resetBlinkButton() { + g_meter2_info.resetBlinkButton(); +} + +void dMeter2Info_resetFloatingMessage() { + g_meter2_info.resetFloatingMessage(); +} + +s16 dMeter2Info_decFloatingMessageTimer() { + return g_meter2_info.decFloatingMessageTimer(); +} + +s16 dMeter2Info_getFloatingMessageTimer() { + return g_meter2_info.getFloatingMessageTimer(); +} + +u16 dMeter2Info_getFloatingMessageID() { + return g_meter2_info.getFloatingMessageID(); +} + +s16 dMeter2Info_getHorseLifeCount() { + return g_meter2_info.getHorseLifeCount(); +} + +void dMeter2Info_setMeterString(s32 i_string) { + g_meter2_info.setMeterString(i_string); +} + +void dMeter2Info_resetMeterString() { + g_meter2_info.resetMeterString(); +} + +void dMeter2Info_setMeterItemPanePtr(int i_no, CPaneMgr* i_pane) { + g_meter2_info.setMeterItemPanePtr(i_no, i_pane); +} + +bool dMeter2Info_isShopTalkFlag() { + return g_meter2_info.isShopTalkFlag(); +} + +void dMeter2Info_setMapDrugFlag(bool i_flag) { + g_meter2_info.setMapDrugFlag(i_flag); +} + +bool dMeter2Info_isTempBit(int i_bit) { + return g_meter2_info.isTempBit(i_bit); +} + +void dMeter2Info_offSub2DStatus(int i_bit) { + g_meter2_info.offSub2DStatus(i_bit); +} + +void dMeter2Info_onSub2DStatus(int i_bit) { + g_meter2_info.onSub2DStatus(i_bit); +} + +void dMeter2Info_set2DWidth(f32 i_width) { + g_meter2_info.set2DWidth(i_width); +} + +void dMeter2Info_set2DHeight(f32 i_height) { + g_meter2_info.set2DHeight(i_height); +} + +void dMeter2Info_set2DPosH(f32 i_posH) { + g_meter2_info.set2DPosH(i_posH); +} + +void dMeter2Info_set2DPosV(f32 i_posV) { + g_meter2_info.set2DPosV(i_posV); +} + +void dMeter2Info_offShopTalkFlag() { + g_meter2_info.offShopTalkFlag(); +} + +void dMeter2Info_onUseButton(int i_button) { + g_meter2_info.onUseButton(i_button); +} + +f32 dMeter2Info_get2DWidth() { + return g_meter2_info.get2DWidth(); +} + +f32 dMeter2Info_get2DHeight() { + return g_meter2_info.get2DHeight(); +} + +void dMeter2Info_setWarpInfo(const char* i_stageName, const cXyz& i_position, s16 i_angle, + u8 i_roomNo, u8 param_4, u8 i_warpPlayerNo) { + g_meter2_info.setWarpInfo(i_stageName, i_position, i_angle, i_roomNo, param_4, i_warpPlayerNo); +} + +u8 dMeter2Info_getTableMapRegionNo() { + return g_meter2_info.getTableMapRegionNo(); +} + +u8 dMeter2Info_getGoldWolfMapType() { + return g_meter2_info.getGoldWolfMapType(); +} + +bool dMeter2Info_isWindowAccept(int param_0) { + return g_meter2_info.isWindowAccept(param_0); +} + +void dMeter2Info_setHorseLifeCount(s16 i_count) { + g_meter2_info.setHorseLifeCount(i_count); +} + +void dMeter2Info_offTempBit(int i_bit) { + g_meter2_info.offTempBit(i_bit); +} + +void dMeter2Info_onTempBit(int i_bit) { + g_meter2_info.onTempBit(i_bit); +} + +void dMeter2Info_setFloatingMessage(u16 i_msgID, s16 i_msgTimer, bool i_wakuVisible) { + g_meter2_info.setFloatingMessage(i_msgID, i_msgTimer, i_wakuVisible); +} + +void dMeter2Info_setMiniGameCount(s8 i_count) { + g_meter2_info.setMiniGameCount(i_count); +} + +void dMeter2Info_onWindowAccept(int param_0) { + g_meter2_info.onWindowAccept(param_0); +} + +void dMeter2Info_offWindowAccept(int param_0) { + g_meter2_info.offWindowAccept(param_0); +} + +void dMeter2Info_onMenuInForce(int param_0) { + g_meter2_info.onMenuInForce(param_0); +} +#endif diff --git a/src/d/d_msg_class.cpp b/src/d/d_msg_class.cpp index 46b246264a..4358d6d5d2 100644 --- a/src/d/d_msg_class.cpp +++ b/src/d/d_msg_class.cpp @@ -16,6 +16,21 @@ #if TARGET_PC #include "dusk/menu_pointer.h" #include "dusk/scope_guard.hpp" +#include "helpers/bits.hpp" + +static bool read_full_color(const void* data, u32 size, u32& ccColor, u32& gcColor) { + if (size == 4) { + ccColor = dusk::read_bits(data); + gcColor = ccColor; + return true; + } + if (size == 8) { + ccColor = dusk::read_bits(data); + gcColor = dusk::read_bits(static_cast(data) + sizeof(ccColor)); + return true; + } + return false; +} #endif #if TARGET_PC @@ -400,6 +415,9 @@ jmessage_tReference::jmessage_tReference() { resetCharCountBuffer(); mNowColorType = 0; mTopColorType = 0; +#if TARGET_PC + resetColors(); +#endif mButtonTagStopFlag = 0; mPageEndCount = 0; mSelectNum = 0; @@ -594,6 +612,13 @@ void jmessage_tReference::pageSend() { if (mNowColorType != mTopColorType) { mTopColorType = mNowColorType; } +#if TARGET_PC + mTopFullColor = mNowFullColor; + if (mNowFullColor) { + mTopCCColor = mNowCCColor; + mTopGCColor = mNowGCColor; + } +#endif mTopWordCount = mNowWordCount; mCharAlpha = 0.0f; @@ -1917,6 +1942,9 @@ void jmessage_tSequenceProcessor::do_begin(void const* pEntry, char const* pszTe pReference->resetCharCnt(); pReference->setNowColorType(0); pReference->setTopColorType(0); +#if TARGET_PC + pReference->resetColors(); +#endif pReference->setNowWordCount(0); pReference->setTopWordCount(0); pReference->setBatchColorFlag(0); @@ -2280,9 +2308,21 @@ bool jmessage_tSequenceProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_si return true; case MSGTAG_GROUP(255): switch (i_tag) { - case MSGTAG_COLOR: + case MSGTAG_COLOR: { +#if TARGET_PC + u32 ccColor; + u32 gcColor; + if (read_full_color(i_data, i_size, ccColor, gcColor)) { + pReference->setFullColor(ccColor, gcColor); + } else if (i_size == 1) { + pReference->clearNowFullColor(); + pReference->setNowColorType(*(u8*)i_data & 0xFF); + } +#else pReference->setNowColorType(*(u8*)i_data & 0xFF); +#endif return true; + } case MSGTAG_SCALE: pReference->setNowTagScale(*(BE(u16)*)i_data & 0xFFFF); return true; @@ -2863,7 +2903,15 @@ void jmessage_tRenderingProcessor::do_begin(void const* pEntry, char const* pszT do_scale(field_0x44); } +#if TARGET_PC + if (pReference->hasTopFullColor()) { + do_fullcolor(pReference->getTopCCColor(), pReference->getTopGCColor()); + } else { + do_color(pReference->getTopColorType()); + } +#else do_color(pReference->getTopColorType()); +#endif pReference->resetDrawLightCount(); do_widthcenter(); @@ -3017,9 +3065,20 @@ bool jmessage_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data, u32 i_s return 1; case MSGTAG_GROUP(255): switch (i_tag) { - case MSGTAG_COLOR: + case MSGTAG_COLOR: { +#if TARGET_PC + u32 ccColor; + u32 gcColor; + if (read_full_color(i_data, i_size, ccColor, gcColor)) { + do_fullcolor(ccColor, gcColor); + } else if (i_size == 1) { + do_color(*(u8*)i_data & 0xFF); + } +#else do_color(*(u8*)i_data & 0xFF); +#endif return 1; + } case MSGTAG_SCALE: field_0x13c = *(BE(u16)*)i_data & 0xFFFF; do_scale(field_0x13c / 100.0f); @@ -3630,6 +3689,18 @@ void jmessage_tRenderingProcessor::do_color(u8 i_colorNo) { do_strcat(buffer, false, false, false); } +#if TARGET_PC +void jmessage_tRenderingProcessor::do_fullcolor(u32 ccColor, u32 gcColor) { + mColorNo = 0xFF; + mCCColor = ccColor; + mGCColor = gcColor; + + char buffer[40]; + SAFE_SPRINTF(buffer, "\x1B" "CC[%08x]" "\x1B" "GC[%08x]", mCCColor, mGCColor); + do_strcat(buffer, false, false, false); +} +#endif + void jmessage_tRenderingProcessor::do_scale(f32 param_1) { jmessage_tReference* pReference = (jmessage_tReference*)getReference(); @@ -4684,9 +4755,20 @@ bool jmessage_string_tRenderingProcessor::do_tag(u32 i_tag, void const* i_data, switch(i_tag & 0xFF0000) { case MSGTAG_GROUP(255): switch(i_tag) { - case MSGTAG_COLOR: + case MSGTAG_COLOR: { +#if TARGET_PC + u32 ccColor; + u32 gcColor; + if (read_full_color(i_data, i_size, ccColor, gcColor)) { + do_fullcolor(ccColor, gcColor); + } else if (i_size == 1) { + do_color(*(u8*)i_data & 0xFF); + } +#else do_color(*(u8*)i_data & 0xFF); +#endif break; + } case MSGTAG_SCALE: do_scale(*(BE(u16)*)i_data / 100.0f); break; @@ -5336,6 +5418,14 @@ void jmessage_string_tRenderingProcessor::do_color(u8 i_colorNo) { do_strcat(buffer); } +#if TARGET_PC +void jmessage_string_tRenderingProcessor::do_fullcolor(u32 ccColor, u32 gcColor) { + char buffer[32]; + SAFE_SPRINTF(buffer, "\x1b" "CC[%08x]" "\x1b" "GC[%08x]", ccColor, gcColor); + do_strcat(buffer); +} +#endif + void jmessage_string_tRenderingProcessor::do_scale(f32 i_scale) { J2DTextBox::TFontSize fontSize; mpReference->getPanePtr()->getFontSize(fontSize); diff --git a/src/d/d_msg_flow.cpp b/src/d/d_msg_flow.cpp index 9b4ea2164c..222e323e78 100644 --- a/src/d/d_msg_flow.cpp +++ b/src/d/d_msg_flow.cpp @@ -43,6 +43,11 @@ u16 message_id(const MessageEntryData& entry) { return static_cast(static_cast(entry.bytes[4]) << 8 | entry.bytes[5]); } +u16 flow_group(int flowId) { + const bool isCommonFlow = flowId >= 3000 && flowId < dusk::flow::kCustomNodeMin; + return isCommonFlow ? 0 : static_cast(dMsgObject_getGroupID()); +} + } // namespace #endif @@ -70,8 +75,7 @@ void dMsgFlow_c::init(fopAc_ac_c* i_partner, int i_flowID, int param_2, fopAc_ac dMsgObject_changeFlowGroup(i_flowID); #if TARGET_PC - dusk::flow::bind_resource(dMsgObject_getMsgDtPtr(), - i_flowID >= 3000 ? 0 : static_cast(dMsgObject_getGroupID())); + dusk::flow::bind_resource(dMsgObject_getMsgDtPtr(), flow_group(i_flowID)); #endif if (param_2 == 0) { @@ -399,8 +403,7 @@ void dMsgFlow_c::setInitValueGroupChange(int i_msgNo, fopAc_ac_c** i_talkPartner dMsgObject_changeFlowGroup(i_msgNo); #if TARGET_PC - dusk::flow::bind_resource(dMsgObject_getMsgDtPtr(), - i_msgNo >= 3000 ? 0 : static_cast(dMsgObject_getGroupID())); + dusk::flow::bind_resource(dMsgObject_getMsgDtPtr(), flow_group(i_msgNo)); #endif setInitValue(0); @@ -446,6 +449,12 @@ u8* dMsgFlow_c::getMsgDataBlock(char const* block_tag) { } u16 dMsgFlow_c::getInitNodeIndex(u16 param_1) { +#if TARGET_PC + if (param_1 >= dusk::flow::kCustomNodeMin) { + return param_1; + } +#endif + u8* var_r30 = NULL; u16 var_r27 = -1; @@ -1753,7 +1762,7 @@ u16 dMsgFlow_c::query042(mesg_flow_node_branch* i_flowNode_p, fopAc_ac_c* i_spea daMidna_c* midna_p = daPy_py_c::getMidnaActor(); u8 ret = 0; - if (strcmp("F_SP116", dComIfGp_getStartStageName()) == 0 && dComIfGs_isSaveDunSwitch(60)) { + if (strcmp("F_SP116", dComIfGp_getStartStageName()) == 0 && dComIfGs_isSaveDunSwitch(60) IF_DUSK(&& !dusk::getSettings().game.canTransformAnywhere)) { ret = 4; } else if (midna_p->checkNpcNear()) { ret = 1; diff --git a/src/d/d_msg_object.cpp b/src/d/d_msg_object.cpp index e9e62ce635..072bd5039b 100644 --- a/src/d/d_msg_object.cpp +++ b/src/d/d_msg_object.cpp @@ -1865,7 +1865,11 @@ void dMsgObject_c::readMessageGroupLocal(mDoDvdThd_mountXArchive_c** p_arcMount) void dMsgObject_c::changeFlowGroupLocal(s32 param_0) { mFlowChk = 1; +#if TARGET_PC + changeGroup(param_0 >= 3000 && param_0 < dusk::flow::kCustomNodeMin ? (s16)0 : s_groupID); +#else changeGroup(param_0 >= 3000 ? (s16)0 : s_groupID); +#endif } void dMsgObject_c::demoMessageGroupLocal() { diff --git a/src/d/d_s_play.cpp b/src/d/d_s_play.cpp index 433e9065b1..ab342d6654 100644 --- a/src/d/d_s_play.cpp +++ b/src/d/d_s_play.cpp @@ -43,6 +43,7 @@ #include "dusk/autosave.h" #include "dusk/memory.h" #include "dusk/mods/item.hpp" +#include "dusk/trigger_viewer.h" #include "dusk/ui/ui.hpp" #include "mods/items.h" #endif @@ -677,6 +678,10 @@ static int dScnPly_Draw(dScnPly_c* i_this) { dComIfG_Ccsp()->Draw(); dComIfG_Bgsp().Draw(); + #if TARGET_PC + dusk::TriggerView::execute(); + #endif + #if DEBUG dPath_Draw(); #endif diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index c92ce7493b..0de9a13f75 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -28,6 +28,7 @@ #include "dusk/mods/svc/stage.hpp" #include #include +#include "dusk/mods/svc/actor.hpp" #endif void dStage_nextStage_c::set(const char* i_stage, s8 i_roomId, s16 i_point, s8 i_layer, s8 i_wipe, @@ -1524,6 +1525,14 @@ static void dummy0() { } dStage_objectNameInf* dStage_searchName(char const* objName) { +#if TARGET_PC + dStage_objectNameInf* info = + dusk::mods::svc::actor_impl::get_stageinfo_from_full_name(objName); + if (info != nullptr) { + return info; + } +#endif + dStage_objectNameInf* obj = l_objectName; for (u32 i = 0; i < ARRAY_SIZEU(l_objectName); i++) { @@ -1537,9 +1546,39 @@ dStage_objectNameInf* dStage_searchName(char const* objName) { return NULL; } +#if TARGET_PC +dStage_objectNameInf* dStage_searchNameCI(char const* objName) { + dStage_objectNameInf* obj = l_objectName; + + for (u32 i = 0; i < ARRAY_SIZEU(l_objectName); i++) { + const char* a = obj->name; + const char* b = objName; + while (*a && *b && tolower((unsigned char)*a) == tolower((unsigned char)*b)) { + ++a; + ++b; + } + if (*a == '\0' && *b == '\0') { + return obj; + } + obj++; + } + + return NULL; +} +#endif + const char* dStage_getName(s16 procName, s8 argument) { static char tmp_name[dStage_NAME_LENGTH]; +#if TARGET_PC + const char* name = dusk::mods::svc::actor_impl::get_full_name_from_proc_name(procName); + if (name[0] != '\0') { + strncpy(tmp_name, name, sizeof(tmp_name) - 1); + tmp_name[sizeof(tmp_name) - 1] = '\0'; + return tmp_name; + } +#endif + dStage_objectNameInf* obj = l_objectName; char* tmp = NULL; @@ -1593,17 +1632,15 @@ DUSK_GAME_DATA dStage_roomControl_c::roomDzs_c dStage_roomControl_c::m_roomDzs; u8 dStage_roomControl_c::mNoArcBank; #endif +static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_class* i_actorPrm + IF_DUSK_ARG(size_t recordSize = sizeof(stage_actor_data_class))) { #if TARGET_PC -static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_class* i_actorPrm, - size_t recordSize = sizeof(stage_actor_data_class)) { if (!dusk::mods::svc::stage_apply_actor_edits(i_actorData, i_actorPrm, recordSize, i_actorPrm->room_no)) { JKRFree(i_actorPrm); return; } -#else -static void dStage_actorCreate(stage_actor_data_class* i_actorData, fopAcM_prm_class* i_actorPrm) { #endif dStage_objectNameInf* actorInf = dStage_searchName(i_actorData->name); @@ -1666,6 +1703,8 @@ static int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* fopAcM_prm_class* appen = fopAcM_CreateAppend(); JUT_ASSERT(1586, appen != NULL); + IF_DUSK(stage_actor_data_class newPoint{};) // data stored on the stack for any newly registered spawn points + int point = dComIfGp_getStartStagePoint(); u32 roomParam = dComIfGs_getRestartRoomParam(); if (point == -2 || point == -3) { @@ -1686,6 +1725,13 @@ static int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* int i; for (i = 0; i < num; i++) { +#ifdef TARGET_PC + // If, for whatever reason, we want to patch the point ID, we need to do it here. + if (!dusk::mods::svc::stage_apply_actor_edits(player_data, nullptr, sizeof(*player_data), i_stage->getRoomNo())) { + player_data++; + continue; // If the spawn is deleted, check the next one + } +#endif if ((u8)player_data->base.angle.z == unk) { break; } @@ -1693,16 +1739,43 @@ static int dStage_playerInit(dStage_dt_c* i_stage, void* i_data, int num, void* } if (i == num) { #if TARGET_PC - std::vector valid_points; - valid_points.reserve(num); - player_data = player->m_entries; - for (i = 0; i < num; i++) { - valid_points.push_back(player_data->base.angle.z); - player_data++; + // Search through all new actor edits and return the point data via userdata + struct newActors_userData { + stage_actor_data_class* out_point; + bool out_pointSet; + int16_t pointNo; + }; + newActors_userData params = { + &newPoint, false, (int16_t)unk + }; + dusk::mods::svc::stage_create_new_actors(i_stage->getRoomNo(), + [](void* user, const void* record, size_t size) { + const stage_actor_data_class* i_record = static_cast(record); + auto* params = static_cast(user); + + // We don't cast i_record->base.angle.z to a u8 here so we can register any spawn point within the s16 range + if (i_record->base.angle.z == params->pointNo && size == sizeof(stage_actor_data_class) && strncmp(i_record->name,"Link",7) == 0) { + std::memcpy(params->out_point, i_record, size); + params->out_pointSet = true; + } + }, + ¶ms); + + if (params.out_pointSet) { + player_data = &newPoint; + } else { + // If the requested spawn point isn't found, print all valid points within the log + std::vector valid_points; + valid_points.reserve(num); + player_data = player->m_entries; + for (i = 0; i < num; i++) { + valid_points.push_back(player_data->base.angle.z); + player_data++; + } + std::ranges::sort(valid_points); + DuskLog.fatal("Failed to find player start point for next stage! Requested point: {}, Valid points: [{}]", + point, fmt::join(valid_points, ", ")); } - std::ranges::sort(valid_points); - DuskLog.fatal("Failed to find player start point for next stage! Requested point: {}, Valid points: [{}]", - point, fmt::join(valid_points, ", ")); #else OS_REPORT_ERROR("プレイヤーが発見できません。[No.%d]\n切り替えの情報や処理の確認をお願いします。\n", point); #endif @@ -2108,12 +2181,8 @@ static int dStage_doorInfoInit(dStage_dt_c* i_stage, void* i_data, int entryNum, appen->base = actor_data->base; appen->room_no = (int)i_stage->getRoomNo(); appen->scale = tgsc_data->scale; -#if TARGET_PC - dStage_actorCreate(actor_data, appen, - sizeof(stage_actor_data_class) + sizeof(fopAcM_prmScale_class)); -#else - dStage_actorCreate(actor_data, appen); -#endif + dStage_actorCreate(actor_data, appen IF_DUSK_ARG( + sizeof(stage_actor_data_class) + sizeof(fopAcM_prmScale_class))); } tgsc_data++; } @@ -2546,6 +2615,11 @@ static void dusk_stage_svc_new_actor_create(dStage_dt_c* i_stage) { stage_tgsc_data_class object{}; std::memcpy(&object, record, size); + if (strncmp(object.name,"Link",7) == 0) { + // We create new spawns for Link during dStage_playerInit. Ignore them here so we don't get duplicates. + return; + } + fopAcM_prm_class* appen = fopAcM_CreateAppend(); if (appen != nullptr) { appen->base = object.base; @@ -2757,9 +2831,7 @@ void dStage_dt_c_roomReLoader(void* i_data, dStage_dt_c* i_stage, int param_2) { }; dStage_dt_c_decode(i_data, i_stage, l_funcTable, ARRAY_SIZEU(l_funcTable)); -#if TARGET_PC - dusk_stage_svc_new_actor_create(i_stage); -#endif + IF_DUSK(dusk_stage_svc_new_actor_create(i_stage)); layerActorLoader(i_data, i_stage, param_2); } diff --git a/src/dusk/commands.cpp b/src/dusk/commands.cpp new file mode 100644 index 0000000000..b953095936 --- /dev/null +++ b/src/dusk/commands.cpp @@ -0,0 +1,880 @@ +#include "commands.hpp" + +#include "JSystem/JUtility/JUTGamePad.h" +#include "SSystem/SComponent/c_math.h" +#include "SSystem/SComponent/c_sxyz.h" +#include "SSystem/SComponent/c_xyz.h" +#include "c/c_damagereaction.h" +#include "d/actor/d_a_alink.h" +#include "d/d_com_inf_actor.h" +#include "d/d_com_inf_game.h" +#include "d/d_camera.h" +#include "d/d_kankyo.h" +#include "d/d_stage.h" +#include "dusk/game_clock.h" +#include "f_op/f_op_actor_mng.h" +#include "f_pc/f_pc_layer.h" +#include "f_pc/f_pc_layer_iter.h" +#include "f_pc/f_pc_manager.h" +#include "f_pc/f_pc_node.h" + +#include +#include +#include +#include +#include + +#include "fmt/format.h" + +namespace dusk { +namespace { + +static constexpr int kMaxHistory = 64; + +static std::vector SplitArgs(std::string_view input) { + std::vector args; + std::string cur; + for (char c : input) { + if (c == ' ' || c == '\t') { + if (!cur.empty()) { + args.push_back(std::move(cur)); + cur.clear(); + } + } else { + cur += c; + } + } + if (!cur.empty()) { + args.push_back(std::move(cur)); + } + return args; +} + +static std::optional ParseLong(const std::string& s) { + if (s.empty()) { + return std::nullopt; + } + char* end = nullptr; + const long v = std::strtol(s.c_str(), &end, 0); + return (end != s.c_str() && *end == '\0') ? std::optional{v} : std::nullopt; +} + +static std::optional ParseFloat(const std::string& s) { + if (s.empty()) { + return std::nullopt; + } + char* end = nullptr; + const float v = std::strtof(s.c_str(), &end); + return (end != s.c_str() && *end == '\0') ? std::optional{v} : std::nullopt; +} + +static const char* ActorShortName(s16 profname) { + const char* n = dStage_getName(profname, -1); + return n ? n : "?"; +} + +// Resolves @found / @link / @ to a process pointer, outputting an error on failure +static base_process_class* ParseProcArg( + const std::string& s, unsigned int foundProcId, const CommandOutput& output) { + if (s.empty() || s[0] != '@') { + output("Error: proc reference must start with @"); + return nullptr; + } + const std::string inner = s.substr(1); + unsigned int id; + if (inner == "found") { + if (foundProcId == 0) { + output("Error: @found is not set"); + return nullptr; + } + id = foundProcId; + } else if (inner == "link") { + auto* player = dComIfGp_getPlayer(0); + if (player == nullptr) { + output("Error: player not available"); + return nullptr; + } + id = (unsigned int)fpcM_GetID(player); + } else { + const auto v = ParseLong(inner); + if (!v) { + output("Error: invalid proc ID"); + return nullptr; + } + id = (unsigned int)*v; + } + auto* proc = fpcM_SearchByID(id); + if (proc == nullptr) { + output(fmt::format(FMT_STRING("Error: proc {} not found"), id)); + return nullptr; + } + return proc; +} + +// Like ParseProcArg but ensures the proc is an actor +static fopAc_ac_c* ParseActorArg( + const std::string& s, unsigned int foundProcId, const CommandOutput& output) { + auto* proc = ParseProcArg(s, foundProcId, output); + if (proc == nullptr) { + return nullptr; + } + if (!fopAcM_IsActor(proc)) { + output("Error: proc is not an actor"); + return nullptr; + } + return static_cast(proc); +} + +static std::optional ParseActorId(const std::string& s) { + if (const auto v = ParseLong(s)) { + return (s16)*v; + } + const auto* entry = dStage_searchNameCI(s.c_str()); + return entry ? std::optional{entry->procname} : std::nullopt; +} + +static std::optional ParseXYZ(const std::vector& args, size_t i) { + const auto x = ParseFloat(args[i]), y = ParseFloat(args[i + 1]), z = ParseFloat(args[i + 2]); + return (x && y && z) ? std::optional{cXyz(*x, *y, *z)} : std::nullopt; +} + +static bool TryAngle( + s16& out, const std::vector& args, size_t i, const CommandOutput& output) { + if (args.size() <= i) { + return true; + } + const auto a = ParseLong(args[i]); + if (!a) { + output("Error: invalid angle"); + return false; + } + out = (s16)*a; + return true; +} + +static std::string actorLine(const base_process_class* proc) { + const auto* ac = static_cast(proc); + return fmt::format(FMT_STRING("procId={} 0x{:04X} ({}) @ ({:.2f}, {:.2f}, {:.2f}) room={}"), + (unsigned int)proc->id, (unsigned int)(u16)proc->profname, ActorShortName(proc->profname), + ac->current.pos.x, ac->current.pos.y, ac->current.pos.z, (int)ac->current.roomNo); +} + +static void recurseLayer(void* p, int (*callback)(void*, void*), void* ctx) { + auto* proc = static_cast(p); + if (fpcBs_Is_JustOfType(g_fpcNd_type, proc->subtype)) { + fpcLyIt_OnlyHere(&static_cast(p)->layer, callback, ctx); + } +} + +struct ListContext { + s16 targetId; + std::vector* output; +}; +struct FindContext { + s16 targetId; + std::vector matches; +}; + +static int ListActorCallback(void* p, void* ctx) { + auto* proc = static_cast(p); + auto* context = static_cast(ctx); + if (fopAcM_IsActor(proc) && (context->targetId < 0 || proc->profname == context->targetId)) { + context->output->push_back(" " + actorLine(proc)); + } + recurseLayer(p, ListActorCallback, ctx); + return 1; +} + +static int FindActorCallback(void* p, void* ctx) { + auto* proc = static_cast(p); + auto* context = static_cast(ctx); + if (fopAcM_IsActor(proc) && proc->profname == context->targetId) { + context->matches.push_back(proc); + } + recurseLayer(p, FindActorCallback, ctx); + return 1; +} + +struct CameraFlyState { + bool active = false; + cXyz startEye; + cXyz startCenter; + cXyz endEye; + cXyz endCenter; + float duration = 0.0f; + float elapsed = 0.0f; +}; +CameraFlyState s_cameraFly; + +static dCamera_c* getCamera() { return dCam_getBody(); } + +static cXyz anglesToDir(s16 h, s16 v) { + return cXyz(cM_scos(v) * cM_ssin(h), cM_ssin(v), cM_scos(v) * cM_scos(h)); +} + +static void cameraToAngles(dCamera_c* cam, s16& h, s16& v) { + const cXyz eye = cam->iEye(); + const cXyz ctr = cam->iCenter(); + const float dx = ctr.x - eye.x; + const float dy = ctr.y - eye.y; + const float dz = ctr.z - eye.z; + const float hDist = sqrtf(dx * dx + dz * dz); + h = cM_atan2s(dx, dz); + v = cM_atan2s(dy, hDist); +} + +static float smoothstep(float t) { + t = std::clamp(t, 0.0f, 1.0f); + return t * t * (3.0f - 2.0f * t); +} + +static constexpr float kCamTargetDist = 100.0f; + +} // namespace + +bool isCameraDetached() { return s_cameraFly.active; } + +void processCameraCommands() { + if (!s_cameraFly.active) { return; } + dCamera_c* cam = getCamera(); + if (cam == nullptr) { s_cameraFly.active = false; return; } + + cXyz eye, center; + + if (s_cameraFly.duration <= 0.0f) { + eye = s_cameraFly.endEye; + center = s_cameraFly.endCenter; + } else { + s_cameraFly.elapsed += dusk::game_clock::kSimPeriod; + const float t = smoothstep(s_cameraFly.elapsed / s_cameraFly.duration); + eye = s_cameraFly.startEye + (s_cameraFly.endEye - s_cameraFly.startEye) * t; + center = s_cameraFly.startCenter + (s_cameraFly.endCenter - s_cameraFly.startCenter) * t; + + if (s_cameraFly.elapsed >= s_cameraFly.duration) { + eye = s_cameraFly.endEye; + center = s_cameraFly.endCenter; + s_cameraFly.startEye = s_cameraFly.endEye; + s_cameraFly.startCenter = s_cameraFly.endCenter; + s_cameraFly.duration = 0.0f; + } + } + + cam->Reset(center, eye); + cam->mDebugFlyCam.initialized = false; +} + +void runCommand(std::string_view cmdLine, CommandState& state, const CommandOutput& output) { + if (state.echoEnabled) { + output(fmt::format(FMT_STRING("> {}"), cmdLine)); + } + + if (!cmdLine.empty()) { + if (state.history.empty() || state.history.back() != cmdLine) { + state.history.push_back(std::string(cmdLine)); + if ((int)state.history.size() > kMaxHistory) { + state.history.erase(state.history.begin()); + } + } + } + + auto args = SplitArgs(cmdLine); + if (args.empty()) { + return; + } + const auto& cmd = args[0]; + + auto requirePlayer = [&]() -> daAlink_c* { + auto* p = (daAlink_c*)dComIfGp_getPlayer(0); + if (p == nullptr) { + output("Error: player not available"); + } + return p; + }; + + if (cmd == "tp") { + auto* player = requirePlayer(); + if (player == nullptr) { + return; + } + + if (args.size() >= 2 && args[1].starts_with('@')) { + auto* ac = ParseActorArg(args[1], state.foundProcId, output); + if (ac == nullptr) { + return; + } + + if (args.size() >= 3 && args[2].starts_with('@')) { + auto* destAc = ParseActorArg(args[2], state.foundProcId, output); + if (destAc == nullptr) { + return; + } + const cXyz destPos = destAc->current.pos; + ac->current.pos = destPos; + output(fmt::format(FMT_STRING("Moved actor {} to ({:.2f}, {:.2f}, {:.2f})"), ac->id, + destPos.x, destPos.y, destPos.z)); + return; + } + + if (args.size() >= 5) { + const auto pos = ParseXYZ(args, 2); + if (!pos) { + output("Error: invalid coordinates"); + return; + } + ac->current.pos = *pos; + if (!TryAngle(ac->shape_angle.y, args, 5, output)) { + return; + } + output(fmt::format(FMT_STRING("Moved actor {} to ({:.2f}, {:.2f}, {:.2f})"), ac->id, + pos->x, pos->y, pos->z)); + return; + } + + player->current.pos = ac->current.pos; + output(fmt::format(FMT_STRING("Teleported to actor {} ({:.2f}, {:.2f}, {:.2f})"), + ac->id, ac->current.pos.x, ac->current.pos.y, ac->current.pos.z)); + return; + } + + if (args.size() < 4) { + output("Usage: tp [angle] | tp @ [ [angle] | @link]"); + return; + } + const auto pos = ParseXYZ(args, 1); + if (!pos) { + output("Error: invalid coordinates"); + return; + } + player->current.pos = *pos; + if (!TryAngle(player->shape_angle.y, args, 4, output)) { + return; + } + output(fmt::format( + FMT_STRING("Teleported to ({:.2f}, {:.2f}, {:.2f})"), pos->x, pos->y, pos->z)); + return; + } + + if (cmd == "spawn") { + if (args.size() < 2) { + output("Usage: spawn [params] [x y z] [angle]"); + return; + } + auto* player = requirePlayer(); + if (player == nullptr) { + return; + } + + const auto actorId = ParseActorId(args[1]); + if (!actorId) { + output("Error: unknown actor ID or name"); + return; + } + + long paramsL = -1; + if (args.size() >= 3) { + const auto p = ParseLong(args[2]); + if (!p) { + output("Error: invalid params"); + return; + } + paramsL = *p; + } + + cXyz pos = player->current.pos; + if (args.size() >= 6) { + const auto spawnPos = ParseXYZ(args, 3); + if (!spawnPos) { + output("Error: invalid spawn coordinates"); + return; + } + pos = *spawnPos; + } + + s16 angleY = 0; + if (!TryAngle(angleY, args, 6, output)) { + return; + } + csXyz angle; + angle.set(0, angleY, 0); + cXyz scale(1.0f, 1.0f, 1.0f); + + layer_class* savedLayer = fpcLy_CurrentLayer(); + base_process_class* playScene = fpcM_SearchByName(fpcNm_PLAY_SCENE_e); + if (playScene != nullptr) { + fpcLy_SetCurrentLayer(&((process_node_class*)playScene)->layer); + } + unsigned int result = fopAcM_create( + *actorId, (u32)paramsL, &pos, player->current.roomNo, &angle, &scale, (s8)-1); + fpcLy_SetCurrentLayer(savedLayer); + + output(result != 0 ? fmt::format(FMT_STRING("Spawned actorId=0x{:04X} procId={}"), + (unsigned int)(u16)*actorId, result) : + fmt::format(FMT_STRING("Failed to spawn actorId=0x{:04X}"), + (unsigned int)(u16)*actorId)); + return; + } + + if (cmd == "reset") { + JUTGamePad::C3ButtonReset::sResetSwitchPushing = true; + output("Soft reset triggered"); + return; + } + + if (cmd == "warp") { + if (args.size() < 4) { + output("Usage: warp [layer=-1]"); + output(" e.g. warp F_SP121 0 0"); + return; + } + const auto pointL = ParseLong(args[2]), roomL = ParseLong(args[3]); + if (!pointL || !roomL) { + output("Error: invalid point or room number"); + return; + } + long layerL = -1; + if (args.size() >= 5) { + const auto l = ParseLong(args[4]); + if (!l) { + output("Error: invalid layer"); + return; + } + layerL = *l; + } + state.lastWarpStage = args[1]; + dComIfGp_setNextStage(state.lastWarpStage.c_str(), (s16)*pointL, (s8)*roomL, (s8)layerL); + output(fmt::format(FMT_STRING("Warping to {} point={} room={} layer={}"), args[1], + (int)(s16)*pointL, (int)(s8)*roomL, (int)(s8)layerL)); + return; + } + + if (cmd == "list") { + s16 targetId = -1; + if (args.size() >= 2) { + const auto id = ParseActorId(args[1]); + if (!id) { + output("Error: unknown actor ID or name"); + return; + } + targetId = *id; + } + std::vector results; + ListContext ctx{targetId, &results}; + fpcLyIt_OnlyHere(fpcLy_RootLayer(), ListActorCallback, &ctx); + output(results.empty() ? "No matching actors found" : + fmt::format(FMT_STRING("Found {} actor(s):"), results.size())); + for (const auto& r : results) { + output(r); + } + return; + } + + if (cmd == "killall") { + if (args.size() < 2) { + output("Usage: killall "); + return; + } + const auto targetId = ParseActorId(args[1]); + if (!targetId) { + output("Error: unknown actor ID or name"); + return; + } + FindContext ctx{*targetId, {}}; + fpcLyIt_OnlyHere(fpcLy_RootLayer(), FindActorCallback, &ctx); + for (auto* proc : ctx.matches) { + fpcM_Delete(proc); + } + output(fmt::format(FMT_STRING("Deleted {} actor(s) of type {} ({})"), + (int)ctx.matches.size(), (unsigned int)(u16)*targetId, ActorShortName(*targetId))); + return; + } + + if (cmd == "heal") { + auto* player = requirePlayer(); + if (player == nullptr) { + return; + } + const u16 maxLife = dComIfGs_getMaxLife() / 5 * 4; + u16 newLife = maxLife; + if (args.size() >= 2) { + const auto amount = ParseLong(args[1]); + if (!amount) { + output("Error: invalid amount"); + return; + } + newLife = + (u16)std::max(0L, std::min((long)maxLife, (long)dComIfGs_getLife() + *amount)); + } + dComIfGs_setLife(newLife); + output(fmt::format(FMT_STRING("Health: {}/{}"), (int)newLife, (int)maxLife)); + return; + } + + if (cmd == "kill") { + if (args.size() >= 2) { + auto* proc = ParseProcArg(args[1], state.foundProcId, output); + if (proc == nullptr) { + return; + } + fpcM_Delete(proc); + output(fmt::format(FMT_STRING("Deleted proc {}"), proc->id)); + } else { + auto* player = requirePlayer(); + if (player == nullptr) { + return; + } + dComIfGs_setLife(0); + output("Set Link's health to 0"); + } + return; + } + + if (cmd == "freeze" || cmd == "unfreeze") { + const bool doFreeze = (cmd == "freeze"); + if (args.size() < 2) { + g_dComIfAc_gameInfo.mPause = doFreeze; + output(doFreeze ? "Global freeze on" : "Global freeze off"); + return; + } + auto* ac = ParseActorArg(args[1], state.foundProcId, output); + if (ac == nullptr) { + return; + } + if (doFreeze) { + fpcM_PauseEnable(ac, 1); + output(fmt::format(FMT_STRING("Froze actor {}"), (unsigned int)ac->id)); + } else { + fpcM_PauseDisable(ac, 1); + output(fmt::format(FMT_STRING("Unfroze actor {}"), (unsigned int)ac->id)); + } + return; + } + + if (cmd == "rate") { + if (args.size() >= 2) { + const auto hz = ParseLong(args[1]); + if (!hz || *hz <= 0) { + output("Error: rate must be a positive integer"); + return; + } + dusk::game_clock::set_sim_rate((float)*hz); + } + output(fmt::format(FMT_STRING("Sim rate: {:.0f} hz"), dusk::game_clock::get_sim_rate())); + return; + } + + if (cmd == "ebf") { + if (args.size() >= 2) { + const auto val = ParseLong(args[1]); + if (!val || *val < 0 || *val > 255) { + output("Error: value must be 0-255"); + return; + } + cDmr_SkipInfo = (u8)*val; + } + output(fmt::format(FMT_STRING("EBF = {}"), (int)cDmr_SkipInfo)); + return; + } + + if (cmd == "time") { + if (args.size() >= 2) { + const auto t = ParseFloat(args[1]); + if (!t || *t < 0.0f || *t > 360.0f) { + output("Error: time must be a float between 0 and 360"); + return; + } + dKy_instant_timechg(*t); + } + output(fmt::format(FMT_STRING("Time: {:.2f} ({}:{:02d})"), dComIfGs_getTime(), + dKy_getdaytime_hour(), dKy_getdaytime_minute())); + return; + } + + if (cmd == "rupees") { + const u16 maxRupees = dComIfGs_getRupeeMax(); + if (args.size() >= 2) { + const auto amount = ParseLong(args[1]); + if (!amount) { + output("Error: invalid amount"); + return; + } + dComIfGs_setRupee((u16)std::max(0L, std::min((long)maxRupees, *amount))); + } + output(fmt::format(FMT_STRING("Rupees: {}/{}"), (int)dComIfGs_getRupee(), (int)maxRupees)); + return; + } + + if (cmd == "find") { + if (args.size() < 2) { + if (state.foundProcId == 0) { + output("@found is not set"); + return; + } + auto* proc = fpcM_SearchByID(state.foundProcId); + output(proc != nullptr && fopAcM_IsActor(proc) ? + "@found = " + actorLine(proc) : + fmt::format(FMT_STRING("@found = {} (no longer exists)"), + (unsigned int)state.foundProcId)); + return; + } + + const auto targetId = ParseActorId(args[1]); + if (!targetId) { + output("Error: unknown actor ID or name"); + return; + } + + int targetN = 1; + if (args.size() >= 3) { + const auto n = ParseLong(args[2]); + if (!n || *n < 1) { + output("Error: index must be >= 1"); + return; + } + targetN = (int)*n; + } + + FindContext ctx{*targetId, {}}; + fpcLyIt_OnlyHere(fpcLy_RootLayer(), FindActorCallback, &ctx); + + if (ctx.matches.empty()) { + output(fmt::format(FMT_STRING("No actors found for '{}'"), args[1])); + return; + } + + std::sort(ctx.matches.begin(), ctx.matches.end(), + [](const base_process_class* a, const base_process_class* b) { return a->id < b->id; }); + + if (targetN > (int)ctx.matches.size()) { + output(fmt::format( + FMT_STRING("Error: only {} actor(s) of that type exist"), (int)ctx.matches.size())); + return; + } + + auto* picked = ctx.matches[(size_t)(targetN - 1)]; + state.foundProcId = picked->id; + output(fmt::format( + FMT_STRING("@found [{}/{}] {}"), targetN, (int)ctx.matches.size(), actorLine(picked))); + return; + } + + if (cmd == "camera") { + const std::string sub = args.size() >= 2 ? args[1] : ""; + + if (sub == "attach") { + s_cameraFly.active = false; + output("Camera attached"); + return; + } + + auto* cam = getCamera(); + if (cam == nullptr) { output("Error: camera not available"); return; } + + if (sub == "detach") { + s_cameraFly.active = true; + s_cameraFly.duration = 0.0f; + s_cameraFly.startEye = s_cameraFly.endEye = cam->iEye(); + s_cameraFly.startCenter = s_cameraFly.endCenter = cam->iCenter(); + output("Camera detached"); + return; + } + + if (sub == "tp") { + // camera tp @ + if (args.size() >= 3 && !args[2].empty() && args[2][0] == '@') { + auto* ac = ParseActorArg(args[2], state.foundProcId, output); + if (ac == nullptr) { return; } + const cXyz actorPos = ac->current.pos; + const cXyz dir = anglesToDir(ac->shape_angle.y, 0); + const cXyz newEye = cXyz(actorPos.x - dir.x * kCamTargetDist, + actorPos.y - dir.y * kCamTargetDist + 50.0f, + actorPos.z - dir.z * kCamTargetDist); + s_cameraFly.active = true; s_cameraFly.duration = 0.0f; + s_cameraFly.startEye = s_cameraFly.endEye = newEye; + s_cameraFly.startCenter = s_cameraFly.endCenter = actorPos; + output(fmt::format(FMT_STRING("Camera moved to actor {}"), ac->id)); + return; + } + // camera tp x y z [h] [v] + if (args.size() < 5) { + output("Usage: camera tp [h_angle] [v_angle] | camera tp @"); + return; + } + const auto pos = ParseXYZ(args, 2); + if (!pos) { output("Error: invalid coordinates"); return; } + s16 h = 0, v = 0; + cameraToAngles(cam, h, v); + if (args.size() >= 6) { + const auto hv = ParseLong(args[5]); + if (!hv) { output("Error: invalid h_angle"); return; } + h = (s16)*hv; + } + if (args.size() >= 7) { + const auto vv = ParseLong(args[6]); + if (!vv) { output("Error: invalid v_angle"); return; } + v = (s16)*vv; + } + const cXyz dir = anglesToDir(h, v); + const cXyz center = cXyz(pos->x + dir.x * kCamTargetDist, + pos->y + dir.y * kCamTargetDist, + pos->z + dir.z * kCamTargetDist); + s_cameraFly.active = true; s_cameraFly.duration = 0.0f; + s_cameraFly.startEye = s_cameraFly.endEye = *pos; + s_cameraFly.startCenter = s_cameraFly.endCenter = center; + output(fmt::format(FMT_STRING("Camera teleported to ({:.2f}, {:.2f}, {:.2f})"), + pos->x, pos->y, pos->z)); + return; + } + + if (sub == "pos") { + s16 h = 0, v = 0; + cameraToAngles(cam, h, v); + const cXyz eye = cam->iEye(); + output(fmt::format(FMT_STRING("Camera: ({:.2f}, {:.2f}, {:.2f}) h={} v={}"), + eye.x, eye.y, eye.z, (int)h, (int)v)); + return; + } + + if (sub == "fly") { + // camera fly