mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-12 19:24:55 -04:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2fca463139 | |||
| 756f8d5fb9 | |||
| d4ca7b696b | |||
| cb09860e1f | |||
| c43ed69b6d | |||
| 6d7269b654 | |||
| 4bcecb3926 | |||
| bafa6d17df | |||
| 67eea1599a | |||
| 9b0af0bf5c | |||
| 5cf52b8240 | |||
| 92906a3269 | |||
| 4e46c04c91 | |||
| f6e05eb04f | |||
| 63d4ce2e8f | |||
| de44bbaa26 | |||
| 98b203fd26 | |||
| 0c0bc7c9e2 | |||
| ad80933ccf | |||
| 30c36df76b | |||
| 6ded3ac467 | |||
| a6c4419da6 | |||
| 226a1fc482 | |||
| 079c969bb4 |
@@ -76,7 +76,7 @@ jobs:
|
|||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusklight-${{env.APP_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
name: dusklight-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
||||||
path: |
|
path: |
|
||||||
build/install/Dusklight-*.AppImage
|
build/install/Dusklight-*.AppImage
|
||||||
build/install/debug.tar.*
|
build/install/debug.tar.*
|
||||||
@@ -145,7 +145,7 @@ jobs:
|
|||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusklight-${{env.APP_VERSION}}-${{matrix.artifact_name}}
|
name: dusklight-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
|
||||||
path: |
|
path: |
|
||||||
build/install/Dusklight.app
|
build/install/Dusklight.app
|
||||||
build/install/debug.tar.*
|
build/install/debug.tar.*
|
||||||
@@ -221,7 +221,7 @@ jobs:
|
|||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusklight-${{env.APP_VERSION}}-android-${{matrix.artifact_arch}}
|
name: dusklight-${{env.DUSK_VERSION}}-android-${{matrix.artifact_arch}}
|
||||||
path: upload/
|
path: upload/
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
@@ -283,7 +283,7 @@ jobs:
|
|||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: dusklight-${{env.APP_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
name: dusklight-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
||||||
path: |
|
path: |
|
||||||
build/install/*.exe
|
build/install/*.exe
|
||||||
build/install/*.dll
|
build/install/*.dll
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
[submodule "extern/aurora"]
|
[submodule "extern/aurora"]
|
||||||
path = extern/aurora
|
path = extern/aurora
|
||||||
url = https://github.com/encounter/aurora.git
|
url = https://github.com/encounter/aurora.git
|
||||||
[submodule "extern/borealis"]
|
|
||||||
path = extern/borealis
|
|
||||||
url = https://github.com/encounter/borealis.git
|
|
||||||
|
|||||||
+152
-15
@@ -5,11 +5,10 @@ if (NOT CMAKE_BUILD_TYPE)
|
|||||||
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
|
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include(extern/borealis/cmake/DetectVersion.cmake)
|
include(cmake/DetectVersion.cmake)
|
||||||
borealis_detect_version()
|
detect_version()
|
||||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||||
project(dusklight LANGUAGES C CXX VERSION ${BOREALIS_APP_VERSION})
|
project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
enable_language(OBJC OBJCXX)
|
enable_language(OBJC OBJCXX)
|
||||||
endif ()
|
endif ()
|
||||||
@@ -33,7 +32,6 @@ set(CMAKE_CXX_STANDARD 20)
|
|||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
set(CMAKE_COLOR_DIAGNOSTICS ON)
|
|
||||||
|
|
||||||
# Folder-based instead of target-based organization
|
# Folder-based instead of target-based organization
|
||||||
# in Visual Studio and Xcode generators
|
# in Visual Studio and Xcode generators
|
||||||
@@ -76,8 +74,6 @@ set(AURORA_ENABLE_RMLUI ON CACHE BOOL "Enable RmlUi UI support" FORCE)
|
|||||||
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
|
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
|
||||||
target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1)
|
target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1)
|
||||||
|
|
||||||
add_subdirectory(extern/borealis EXCLUDE_FROM_ALL)
|
|
||||||
|
|
||||||
add_subdirectory(libs/freeverb)
|
add_subdirectory(libs/freeverb)
|
||||||
|
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
@@ -89,9 +85,12 @@ endif ()
|
|||||||
option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)")
|
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_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_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON)
|
||||||
|
option(DUSK_ENABLE_UPDATE_CHECKER "Enable update checking support" ON)
|
||||||
|
option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF)
|
||||||
option(DUSK_PACKAGE_INSTALL "Install Dusklight with a Linux-native file structure" OFF)
|
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_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" OFF)
|
||||||
|
option(DUSK_ENABLE_OPUS "Enable loading Opus audio files for mods" ON)
|
||||||
|
|
||||||
set(DUSK_HAS_FUNCHOOK OFF)
|
set(DUSK_HAS_FUNCHOOK OFF)
|
||||||
if (DUSK_ENABLE_CODE_MODS AND (NOT APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
|
if (DUSK_ENABLE_CODE_MODS AND (NOT APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
|
||||||
@@ -152,7 +151,6 @@ if (DUSK_MOVIE_SUPPORT)
|
|||||||
-DENABLE_SHARED=OFF
|
-DENABLE_SHARED=OFF
|
||||||
-DWITH_TURBOJPEG=ON
|
-DWITH_TURBOJPEG=ON
|
||||||
-DWITH_JAVA=OFF
|
-DWITH_JAVA=OFF
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib
|
|
||||||
)
|
)
|
||||||
if (CMAKE_TOOLCHAIN_FILE)
|
if (CMAKE_TOOLCHAIN_FILE)
|
||||||
get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
|
get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
@@ -237,6 +235,18 @@ endif ()
|
|||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
# Declare all dependencies first so CMake can download them in parallel
|
# Declare all dependencies first so CMake can download them in parallel
|
||||||
|
message(STATUS "dusklight: Fetching cxxopts")
|
||||||
|
FetchContent_Declare(cxxopts
|
||||||
|
URL https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.3.1.tar.gz
|
||||||
|
URL_HASH SHA256=3bfc70542c521d4b55a46429d808178916a579b28d048bd8c727ee76c39e2072
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
|
||||||
|
)
|
||||||
|
message(STATUS "dusklight: Fetching nlohmann/json")
|
||||||
|
FetchContent_Declare(json
|
||||||
|
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
|
||||||
|
URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
|
||||||
|
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
|
||||||
|
)
|
||||||
message(STATUS "dusklight: Fetching miniz")
|
message(STATUS "dusklight: Fetching miniz")
|
||||||
FetchContent_Declare(miniz
|
FetchContent_Declare(miniz
|
||||||
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip
|
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip
|
||||||
@@ -244,7 +254,26 @@ FetchContent_Declare(miniz
|
|||||||
EXCLUDE_FROM_ALL
|
EXCLUDE_FROM_ALL
|
||||||
)
|
)
|
||||||
|
|
||||||
set(_fetch_content_deps miniz)
|
set(_fetch_content_deps cxxopts json miniz)
|
||||||
|
|
||||||
|
if (DUSK_ENABLE_OPUS)
|
||||||
|
message(STATUS "dusklight: Fetching opusfile")
|
||||||
|
|
||||||
|
# Opusfile options
|
||||||
|
SET(OP_DISABLE_HTTP ON CACHE BOOL "" FORCE)
|
||||||
|
SET(OP_DISABLE_DOCS ON CACHE BOOL "" FORCE)
|
||||||
|
SET(OP_DISABLE_EXAMPLES ON CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
|
message(STATUS "dusklight: Fetching opusfile")
|
||||||
|
FetchContent_Declare(
|
||||||
|
opusfile
|
||||||
|
GIT_REPOSITORY https://github.com/xiph/opusfile.git
|
||||||
|
GIT_TAG 6dfd29e7adb87f2e193575fc3fa88cbf1a0b27df
|
||||||
|
)
|
||||||
|
|
||||||
|
list(APPEND _fetch_content_deps opusfile)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (DUSK_HAS_FUNCHOOK)
|
if (DUSK_HAS_FUNCHOOK)
|
||||||
message(STATUS "dusklight: Fetching funchook")
|
message(STATUS "dusklight: Fetching funchook")
|
||||||
# cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a
|
# cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a
|
||||||
@@ -279,12 +308,40 @@ if (DUSK_HAS_FUNCHOOK)
|
|||||||
endif ()
|
endif ()
|
||||||
FetchContent_MakeAvailable(${_fetch_content_deps})
|
FetchContent_MakeAvailable(${_fetch_content_deps})
|
||||||
|
|
||||||
|
if (DUSK_ENABLE_SENTRY_NATIVE)
|
||||||
|
message(STATUS "dusklight: Fetching sentry-native")
|
||||||
|
set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(SENTRY_BACKEND crashpad CACHE STRING "" FORCE)
|
||||||
|
if (WIN32)
|
||||||
|
set(SENTRY_TRANSPORT winhttp CACHE STRING "" FORCE)
|
||||||
|
endif ()
|
||||||
|
set(SENTRY_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
set(SENTRY_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
|
||||||
|
FetchContent_Declare(sentry_native
|
||||||
|
GIT_REPOSITORY https://github.com/getsentry/sentry-native.git
|
||||||
|
GIT_TAG 0.13.6
|
||||||
|
GIT_SHALLOW TRUE
|
||||||
|
GIT_PROGRESS TRUE
|
||||||
|
GIT_SUBMODULES_RECURSE TRUE
|
||||||
|
)
|
||||||
|
if (NOT sentry_native_POPULATED)
|
||||||
|
FetchContent_Populate(sentry_native)
|
||||||
|
set(_skip_install_rules ${CMAKE_SKIP_INSTALL_RULES})
|
||||||
|
set(CMAKE_SKIP_INSTALL_RULES ON)
|
||||||
|
add_subdirectory(${sentry_native_SOURCE_DIR} ${sentry_native_BINARY_DIR} EXCLUDE_FROM_ALL)
|
||||||
|
set(CMAKE_SKIP_INSTALL_RULES ${_skip_install_rules})
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Use signed char on ARM to match the original game (and x86)
|
# Use signed char on ARM to match the original game (and x86)
|
||||||
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch)
|
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch)
|
||||||
if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
|
if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
|
||||||
add_compile_options(-fsigned-char)
|
add_compile_options(-fsigned-char)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
configure_version_header()
|
||||||
|
|
||||||
include(files.cmake)
|
include(files.cmake)
|
||||||
|
|
||||||
# TODO: version handling for res includes
|
# TODO: version handling for res includes
|
||||||
@@ -297,23 +354,71 @@ set(DUSK_PRODUCT_NAME "Dusklight")
|
|||||||
set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors")
|
set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors")
|
||||||
|
|
||||||
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES})
|
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES})
|
||||||
source_group("dusklight" FILES ${DUSK_FILES})
|
source_group("dusklight" FILES ${DUSK_FILES} ${DUSK_HTTP_BACKEND_FILES})
|
||||||
|
|
||||||
include(cmake/GameABIConfig.cmake)
|
include(cmake/GameABIConfig.cmake)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
set(GAME_COMPILE_DEFS DUSK_BUILDING_GAME=1)
|
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
|
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
|
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt
|
||||||
Threads::Threads zstd::libzstd dusklight_game_headers)
|
Threads::Threads zstd::libzstd dusklight_game_headers)
|
||||||
if (DUSK_HAS_FUNCHOOK)
|
if (DUSK_HAS_FUNCHOOK)
|
||||||
list(APPEND GAME_LIBS funchook-static)
|
list(APPEND GAME_LIBS funchook-static)
|
||||||
endif ()
|
endif ()
|
||||||
|
if (DUSK_ENABLE_OPUS)
|
||||||
|
list(APPEND GAME_LIBS OpusFile::opusfile)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_OPUS=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (DUSK_ENABLE_SENTRY_NATIVE)
|
||||||
|
list(APPEND GAME_LIBS sentry)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_SENTRY_NATIVE=1 SENTRY_BUILD_STATIC=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
list(APPEND GAME_LIBS Ws2_32)
|
list(APPEND GAME_LIBS Ws2_32)
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||||
|
list(APPEND GAME_LIBS dbghelp)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_CRASH_DBGHELP=1)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/no_backend.cpp)
|
||||||
|
if (DUSK_ENABLE_UPDATE_CHECKER)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_UPDATE_CHECKER=1)
|
||||||
|
if (WIN32)
|
||||||
|
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/winhttp.cpp)
|
||||||
|
list(APPEND GAME_LIBS winhttp)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_WINHTTP=1)
|
||||||
|
message(STATUS "dusklight: Enabled update checker (WinHTTP)")
|
||||||
|
elseif (ANDROID)
|
||||||
|
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/android.cpp)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_ANDROID=1)
|
||||||
|
message(STATUS "dusklight: Enabled update checker (Android)")
|
||||||
|
elseif (APPLE)
|
||||||
|
find_library(FOUNDATION_FRAMEWORK Foundation REQUIRED)
|
||||||
|
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/url_session.mm)
|
||||||
|
set_source_files_properties(src/dusk/http/url_session.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||||
|
list(APPEND GAME_LIBS ${FOUNDATION_FRAMEWORK})
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_URLSESSION=1)
|
||||||
|
message(STATUS "dusklight: Enabled update checker (NSURLSession)")
|
||||||
|
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||||
|
find_package(CURL QUIET OPTIONAL_COMPONENTS HTTPS SSL)
|
||||||
|
if (CURL_FOUND AND CURL_HTTPS_FOUND AND CURL_SSL_FOUND)
|
||||||
|
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/curl.cpp)
|
||||||
|
list(APPEND GAME_LIBS CURL::libcurl)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_LIBCURL=1)
|
||||||
|
message(STATUS "dusklight: Enabled update checker (libcurl)")
|
||||||
|
else ()
|
||||||
|
message(STATUS "dusklight: Disabled update checker (libcurl + HTTPS/SSL not found)")
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
message(STATUS "dusklight: Disabled update checker (unsupported platform)")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
list(APPEND DUSK_FILES ${DUSK_HTTP_BACKEND_SOURCE})
|
||||||
|
|
||||||
if (DUSK_MOVIE_SUPPORT)
|
if (DUSK_MOVIE_SUPPORT)
|
||||||
if (TARGET libjpeg-turbo::turbojpeg-static)
|
if (TARGET libjpeg-turbo::turbojpeg-static)
|
||||||
list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static)
|
list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static)
|
||||||
@@ -323,6 +428,15 @@ if (DUSK_MOVIE_SUPPORT)
|
|||||||
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
|
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
set(DUSK_ENABLE_DISCORD_DEFAULT ON)
|
||||||
|
if (DEFINED DUSK_ENABLE_DISCORD_RPC AND NOT DEFINED DUSK_ENABLE_DISCORD)
|
||||||
|
set(DUSK_ENABLE_DISCORD_DEFAULT ${DUSK_ENABLE_DISCORD_RPC})
|
||||||
|
endif ()
|
||||||
|
option(DUSK_ENABLE_DISCORD "Enable Discord Rich Presence support" ${DUSK_ENABLE_DISCORD_DEFAULT})
|
||||||
|
if (DUSK_ENABLE_DISCORD AND NOT ANDROID AND NOT IOS AND NOT TVOS)
|
||||||
|
list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (DUSK_ENABLE_CODE_MODS)
|
if (DUSK_ENABLE_CODE_MODS)
|
||||||
list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1)
|
list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1)
|
||||||
endif ()
|
endif ()
|
||||||
@@ -387,10 +501,10 @@ endif ()
|
|||||||
set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c)
|
set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c)
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
add_library(dusklight SHARED ${DUSK_FILES})
|
add_library(dusklight SHARED ${DUSK_FILES})
|
||||||
|
set_target_properties(dusklight PROPERTIES OUTPUT_NAME main)
|
||||||
else ()
|
else ()
|
||||||
add_executable(dusklight ${DUSK_FILES})
|
add_executable(dusklight ${DUSK_FILES})
|
||||||
endif ()
|
endif ()
|
||||||
borealis_configure_android_application(dusklight)
|
|
||||||
if (ENABLE_ASAN)
|
if (ENABLE_ASAN)
|
||||||
target_sources(dusklight PRIVATE src/dusk/asan_options.c)
|
target_sources(dusklight PRIVATE src/dusk/asan_options.c)
|
||||||
endif ()
|
endif ()
|
||||||
@@ -468,9 +582,17 @@ if (TARGET crashpad_handler)
|
|||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
# SDLActivity loads SDL_main via dlsym on Android. Since aurora::main is a static
|
||||||
|
# archive, force an undefined reference so the linker keeps the SDL_main object.
|
||||||
|
target_link_options(dusklight PRIVATE "-Wl,-u,SDL_main")
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||||
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
|
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
|
||||||
target_link_libraries(dusklight PRIVATE dl)
|
target_link_libraries(dusklight PRIVATE dl)
|
||||||
|
elseif (ANDROID)
|
||||||
|
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT APPLE)
|
if (NOT APPLE)
|
||||||
@@ -519,7 +641,7 @@ if (DUSK_ENABLE_CODE_MODS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR
|
|||||||
add_subdirectory(mods/ao_mod)
|
add_subdirectory(mods/ao_mod)
|
||||||
add_subdirectory(mods/shadow_mod)
|
add_subdirectory(mods/shadow_mod)
|
||||||
add_subdirectory(mods/window_demo)
|
add_subdirectory(mods/window_demo)
|
||||||
add_subdirectory(mods/basic_cosmetics_mod)
|
add_subdirectory(mods/audio_mod)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
@@ -553,8 +675,8 @@ if (APPLE)
|
|||||||
MACOSX_BUNDLE TRUE
|
MACOSX_BUNDLE TRUE
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
|
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
|
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
|
||||||
MACOSX_BUNDLE_BUNDLE_VERSION ${BOREALIS_APP_VERSION}
|
MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING}
|
||||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${BOREALIS_APP_SHORT_VERSION}
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING}
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST}
|
MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST}
|
||||||
OUTPUT_NAME Dusklight
|
OUTPUT_NAME Dusklight
|
||||||
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||||
@@ -587,6 +709,21 @@ if (APPLE)
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
|
find_library(APPKIT_FRAMEWORK AppKit REQUIRED)
|
||||||
|
target_sources(dusklight PRIVATE src/dusk/file_select_macos.mm)
|
||||||
|
set_source_files_properties(src/dusk/file_select_macos.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||||
|
target_link_libraries(dusklight PRIVATE ${APPKIT_FRAMEWORK})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (IOS)
|
||||||
|
find_library(UIKIT_FRAMEWORK UIKit REQUIRED)
|
||||||
|
find_library(UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK UniformTypeIdentifiers REQUIRED)
|
||||||
|
target_sources(dusklight PRIVATE src/dusk/ios/FileSelectDialog.m)
|
||||||
|
set_source_files_properties(src/dusk/ios/FileSelectDialog.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||||
|
target_link_libraries(dusklight PRIVATE ${UIKIT_FRAMEWORK} ${UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK})
|
||||||
|
endif ()
|
||||||
|
|
||||||
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
|
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
|
||||||
aurora_copy_runtime_dlls(dusklight)
|
aurora_copy_runtime_dlls(dusklight)
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -28,12 +28,12 @@
|
|||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||||
"BOREALIS_ENABLE_SENTRY": {
|
"DUSK_ENABLE_SENTRY_NATIVE": {
|
||||||
"type": "BOOL",
|
"type": "BOOL",
|
||||||
"value": true
|
"value": true
|
||||||
},
|
},
|
||||||
"BOREALIS_SENTRY_DSN": "$env{SENTRY_DSN}",
|
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
|
||||||
"BOREALIS_SENTRY_ENVIRONMENT": "production",
|
"DUSK_SENTRY_ENVIRONMENT": "production",
|
||||||
"Rust_RUSTUP_INSTALL_MISSING_TARGET": {
|
"Rust_RUSTUP_INSTALL_MISSING_TARGET": {
|
||||||
"type": "BOOL",
|
"type": "BOOL",
|
||||||
"value": true
|
"value": true
|
||||||
@@ -448,7 +448,7 @@
|
|||||||
"ci"
|
"ci"
|
||||||
],
|
],
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"BOREALIS_ENABLE_SENTRY": {
|
"DUSK_ENABLE_SENTRY_NATIVE": {
|
||||||
"type": "BOOL",
|
"type": "BOOL",
|
||||||
"value": false
|
"value": false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,5 +23,5 @@ cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,102
|
|||||||
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
|
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
|
||||||
|
|
||||||
cd build/install
|
cd build/install
|
||||||
VERSION="$APP_VERSION" NO_STRIP=1 "$linuxdeploy" \
|
VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \
|
||||||
-l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage
|
-l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
# Version detection shared by the main build and the mod SDK (sdk/CMakeLists.txt)
|
||||||
|
include_guard(GLOBAL)
|
||||||
|
|
||||||
|
get_filename_component(_DUSK_VERSION_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
|
||||||
|
|
||||||
|
set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
|
||||||
|
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
|
||||||
|
|
||||||
|
set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)")
|
||||||
|
|
||||||
|
macro(detect_version)
|
||||||
|
if (DUSK_VERSION_OVERRIDE)
|
||||||
|
set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}")
|
||||||
|
set(DUSK_VERSION_STRING "0.0.0.0")
|
||||||
|
set(DUSK_SHORT_VERSION_STRING "0.0.0")
|
||||||
|
set(DUSK_VERSION_CODE "1")
|
||||||
|
set(DUSK_WC_REVISION "")
|
||||||
|
set(DUSK_WC_BRANCH "")
|
||||||
|
set(DUSK_WC_DATE "")
|
||||||
|
message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}")
|
||||||
|
else ()
|
||||||
|
# obtain revision info from git
|
||||||
|
find_package(Git)
|
||||||
|
if (GIT_FOUND)
|
||||||
|
# make sure version information gets re-run when the current Git HEAD changes
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
|
||||||
|
OUTPUT_VARIABLE dusk_git_head_filename
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
get_filename_component(dusk_git_head_filename "${dusk_git_head_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
|
||||||
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
|
||||||
|
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
|
||||||
|
OUTPUT_VARIABLE dusk_git_head_symbolic
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT}
|
||||||
|
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
|
||||||
|
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
get_filename_component(dusk_git_head_symbolic_filename "${dusk_git_head_symbolic_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
|
||||||
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
|
||||||
|
|
||||||
|
# defines DUSK_WC_REVISION
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||||
|
OUTPUT_VARIABLE DUSK_WC_REVISION
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
# defines DUSK_WC_DESCRIBE
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
|
||||||
|
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
# remove the git hash, then collapse a clean "-0" suffix only
|
||||||
|
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
|
||||||
|
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
|
||||||
|
|
||||||
|
# defines DUSK_WC_BRANCH
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
|
||||||
|
OUTPUT_VARIABLE DUSK_WC_BRANCH
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
# defines DUSK_WC_DATE
|
||||||
|
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
|
||||||
|
OUTPUT_VARIABLE DUSK_WC_DATE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
else ()
|
||||||
|
message(STATUS "Unable to find git, commit information will not be available")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
|
||||||
|
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
|
||||||
|
set(_ver_major ${CMAKE_MATCH_1})
|
||||||
|
set(_ver_minor ${CMAKE_MATCH_2})
|
||||||
|
set(_ver_patch ${CMAKE_MATCH_3})
|
||||||
|
set(DUSK_VERSION_TWEAK "0")
|
||||||
|
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
|
||||||
|
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
|
||||||
|
elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$")
|
||||||
|
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
|
||||||
|
endif ()
|
||||||
|
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
|
||||||
|
if (DUSK_VERSION_TWEAK GREATER 999)
|
||||||
|
set(_tweak 999)
|
||||||
|
else ()
|
||||||
|
set(_tweak ${DUSK_VERSION_TWEAK})
|
||||||
|
endif ()
|
||||||
|
# encoding: major*1e7 + minor*1e5 + patch*1e3 + tweak; collision-free for major<210, minor<100, patch<100, tweak<=999
|
||||||
|
math(EXPR DUSK_VERSION_CODE
|
||||||
|
"${_ver_major} * 10000000 + ${_ver_minor} * 100000 + ${_ver_patch} * 1000 + ${_tweak}")
|
||||||
|
else ()
|
||||||
|
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
|
||||||
|
set(DUSK_VERSION_STRING "0.0.0.0")
|
||||||
|
set(DUSK_SHORT_VERSION_STRING "0.0.0")
|
||||||
|
set(DUSK_VERSION_CODE "1")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Add version information to CI environment variables
|
||||||
|
if (DEFINED ENV{GITHUB_ENV})
|
||||||
|
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
|
||||||
|
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION_CODE=${DUSK_VERSION_CODE}\n")
|
||||||
|
endif ()
|
||||||
|
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# Sets PLATFORM_NAME and configures version.h into the caller's binary dir.
|
||||||
|
macro(configure_version_header)
|
||||||
|
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||||
|
set(PLATFORM_NAME win32)
|
||||||
|
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||||
|
if (IOS)
|
||||||
|
set(PLATFORM_NAME ios)
|
||||||
|
elseif (TVOS)
|
||||||
|
set(PLATFORM_NAME tvos)
|
||||||
|
else ()
|
||||||
|
set(PLATFORM_NAME macos)
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
configure_file(${_DUSK_VERSION_ROOT}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||||
|
endmacro()
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#pragma endian big
|
||||||
|
|
||||||
|
#include "std/sys.pat"
|
||||||
|
#include "type/magic.pat"
|
||||||
|
#include "std/array.pat"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for a file-global pointer that allows it to be stored in an array.
|
||||||
|
*/
|
||||||
|
struct Offset<T> {
|
||||||
|
T* offset : u32 [[inline]];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct JAUSeqCollectionTable {
|
||||||
|
u32 mEntryCount;
|
||||||
|
u32 mBmsOffset[mEntryCount];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct JAUSeqCollectionData {
|
||||||
|
type::Magic<"SC"> mMagic;
|
||||||
|
u16 mNumSoundCategories;
|
||||||
|
u32 mSectionSize;
|
||||||
|
Offset<JAUSeqCollectionTable> mTableOffsets[mNumSoundCategories];
|
||||||
|
};
|
||||||
|
|
||||||
|
JAUSeqCollectionData data @ 0x0;
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#pragma endian big
|
||||||
|
|
||||||
|
#include "std/sys.pat"
|
||||||
|
#include "type/magic.pat"
|
||||||
|
#include "std/array.pat"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for a file-global pointer that allows it to be stored in an array.
|
||||||
|
*/
|
||||||
|
struct Offset<T> {
|
||||||
|
T* offset : u32 [[inline]];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ItemSoundEffect {
|
||||||
|
u8 mPriority;
|
||||||
|
u8 mVolume;
|
||||||
|
padding[2];
|
||||||
|
u32 mSwBit;
|
||||||
|
float mPitch;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ItemSequence {
|
||||||
|
u8 mPriority;
|
||||||
|
u8 mVolume;
|
||||||
|
u16 mResourceId;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ItemStream {
|
||||||
|
u8 mPriority;
|
||||||
|
u8 mVolume;
|
||||||
|
u16 mStreamPanParameters;
|
||||||
|
char* mStreamFilePath[] : u32;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SoundTableGroupEntry {
|
||||||
|
u8 mTypeId;
|
||||||
|
if (mTypeId == 0x51) {
|
||||||
|
ItemSoundEffect* mOffset : u24 [[inline]];
|
||||||
|
} else if (mTypeId == 0x60) {
|
||||||
|
ItemSequence* mOffset : u24 [[inline]];
|
||||||
|
} else if (mTypeId == 0x70 || mTypeId == 0x71) {
|
||||||
|
ItemStream* mOffset : u24 [[inline]];
|
||||||
|
} else {
|
||||||
|
u24 mOffset;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TGroup {
|
||||||
|
u32 mNumItems;
|
||||||
|
padding[4];
|
||||||
|
SoundTableGroupEntry mEntries[mNumItems];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TSection {
|
||||||
|
u32 mNumGroups;
|
||||||
|
Offset<TGroup> mGroupOffsets[mNumGroups];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Root {
|
||||||
|
u32 mSectionNumber;
|
||||||
|
Offset<TSection> mSectionOffsets[mSectionNumber];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct THeader {
|
||||||
|
type::Magic<"BST "> mMagic;
|
||||||
|
|
||||||
|
padding[8];
|
||||||
|
Root* mRoot : u32;
|
||||||
|
};
|
||||||
|
|
||||||
|
THeader header @ 0x0;
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
#pragma endian big
|
||||||
|
|
||||||
|
#include "std/sys.pat"
|
||||||
|
#include "type/magic.pat"
|
||||||
|
#include "std/array.pat"
|
||||||
|
|
||||||
|
/*
|
||||||
|
WSYS file
|
||||||
|
The WSYS file contains roughly two sections: WBCT and WINF.
|
||||||
|
WBCT contains the mapping of Wave ID -> wave archives.
|
||||||
|
WINF are the wave archives themselves and their metadata.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper for a file-global pointer that allows it to be stored in an array.
|
||||||
|
*/
|
||||||
|
struct Offset<T> {
|
||||||
|
T* offset : u32 [[inline]];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format that audio data is in..
|
||||||
|
*/
|
||||||
|
enum WaveFormat : u8 {
|
||||||
|
/**
|
||||||
|
* 16-samples-per-9-bytes custom Nintendo ADPCM.
|
||||||
|
*/
|
||||||
|
ADPCM4 = 0,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16-samples-per-5-bytes custom Nintendo ADPCM.
|
||||||
|
*/
|
||||||
|
ADPCM2 = 1,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8-bit-per-sample PCM.
|
||||||
|
*/
|
||||||
|
PCM8 = 2,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16-bit-per-sample PCM.
|
||||||
|
*/
|
||||||
|
PCM16 = 3,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines playback info for a single audio "wave".
|
||||||
|
* This data is stored per archive, making it duplicated (except for mAWOffsetStart)
|
||||||
|
*/
|
||||||
|
struct TWave {
|
||||||
|
padding[1]; // unknown
|
||||||
|
WaveFormat mWaveFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key (as in like, the musical term) this sample is in.
|
||||||
|
*/
|
||||||
|
u8 mBaseKey;
|
||||||
|
padding[1];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sample rate of the audio in Hz.
|
||||||
|
*/
|
||||||
|
float mSampleRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Position where the sample data starts.
|
||||||
|
* This is in the .aw file for the archive containing this TWave.
|
||||||
|
*/
|
||||||
|
u32 mAWOffsetStart;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Byte length of the sample data.
|
||||||
|
*/
|
||||||
|
u32 mAWLength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the sample should loop or not. All bits appear set if so.
|
||||||
|
*/
|
||||||
|
u32 mLoopFlags;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Audio sample at which the loop starts.
|
||||||
|
*/
|
||||||
|
u32 mLoopStartSample;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Audio sample at which the loop ends (and goes back to mLoopStartSample).
|
||||||
|
*/
|
||||||
|
u32 mLoopEndSample;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total sample count in this wave.
|
||||||
|
*/
|
||||||
|
u32 mSampleCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Last sample for continuing ADPCM decode after loop.
|
||||||
|
*/
|
||||||
|
s16 mpLast;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Penult sample for continuing ADPCM decode after loop.
|
||||||
|
*/
|
||||||
|
s16 mpPenult;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A single wave archive on disk.
|
||||||
|
* These are paired 1:1 with TCtrlScene objects.
|
||||||
|
*/
|
||||||
|
struct TWaveArchive {
|
||||||
|
/**
|
||||||
|
* Filename of the raw sample data on disc. Relative to /Audiores/Waves/
|
||||||
|
*/
|
||||||
|
char mFileName[0x70];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of waves in this archive.
|
||||||
|
* Matches the count in the paired TCtrl object.
|
||||||
|
*/
|
||||||
|
u32 mWaveCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offsets to the wave metadata (not sample data) in the WSYS.
|
||||||
|
* These are paired 1:1 to the TCtrlWaves, and the TCtrlWave contains the actual
|
||||||
|
* "Wave ID" used by the game for lookups.
|
||||||
|
*/
|
||||||
|
Offset<TWave> waveOffsets[mWaveCount];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Header containing data for wave archives and their metadata.
|
||||||
|
*/
|
||||||
|
struct TWaveArchiveBank {
|
||||||
|
type::Magic<"WINF"> mMagic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of archives in this wave bank.
|
||||||
|
* Matches the value in TCtrlGroup.
|
||||||
|
*/
|
||||||
|
u32 mArchiveCounts;
|
||||||
|
Offset<TWaveArchive> mArchiveOffsets[mArchiveCounts];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Definition for a single wave in a control group.
|
||||||
|
*/
|
||||||
|
struct TCtrlWave {
|
||||||
|
/**
|
||||||
|
* Group ID matches the index of the control group this item is referenced by.
|
||||||
|
*/
|
||||||
|
u16 mGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wave ID used by the game to look this wave up.
|
||||||
|
*/
|
||||||
|
u16 mWaveId;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the actual data for a TCtrlScene.
|
||||||
|
* Why is this separate? Who knows.
|
||||||
|
*/
|
||||||
|
struct TCtrl {
|
||||||
|
// Other versions of this struct with different magic (C-EX and C-ST) also exist in the file.
|
||||||
|
// They aren't pointed to so we don't need to worry about them.
|
||||||
|
type::Magic<"C-DF"> mMagic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Amount of waves in this group.
|
||||||
|
* Matches the value in TWaveArchive.
|
||||||
|
*/
|
||||||
|
u32 waveCount;
|
||||||
|
Offset<TCtrlWave> mWaveOffsets[waveCount];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A single scene or "group" of waves that are loaded at once.
|
||||||
|
*/
|
||||||
|
struct TCtrlScene {
|
||||||
|
type::Magic<"SCNE"> mMagic;
|
||||||
|
|
||||||
|
padding[8]; // unknown
|
||||||
|
TCtrl* mCtrlOffset : u32 [[inline]];
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the "control" section of the WSYS.
|
||||||
|
*/
|
||||||
|
struct TCtrlGroup {
|
||||||
|
type::Magic<"WBCT"> mMagic;
|
||||||
|
|
||||||
|
padding[4]; // unknown
|
||||||
|
u32 mGroupCount;
|
||||||
|
|
||||||
|
Offset<TCtrlScene> mCtrlSceneOffsets[mGroupCount];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct THeader {
|
||||||
|
type::Magic<"WSYS"> mMagic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size of WSYS in bytes.
|
||||||
|
*/
|
||||||
|
u32 mSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID of wave bank.
|
||||||
|
* This matches the value passed to the BAA load command.
|
||||||
|
* The game originally does not use this value itself, but Dusklight does rely on it.
|
||||||
|
*/
|
||||||
|
u32 mId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Total amount of waves in this wave bank.
|
||||||
|
* (not groups! Waves!)
|
||||||
|
*/
|
||||||
|
u32 mWaveTableSize;
|
||||||
|
|
||||||
|
TWaveArchiveBank* archiveBankOffset : u32;
|
||||||
|
TCtrlGroup* ctrlGroupOffset : u32;
|
||||||
|
};
|
||||||
|
|
||||||
|
THeader header @ 0x0;
|
||||||
|
|
||||||
|
std::assert(
|
||||||
|
header.archiveBankOffset.mArchiveCounts == header.ctrlGroupOffset.mGroupCount,
|
||||||
|
"Control group and archive count does not match!");
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
# JAudio
|
||||||
|
|
||||||
|
**JAudio** is the name for the audio engine used by Twilight Princess (along with many other Nintendo games from the era). TP uses exclusively JAudio v2, while other games use v1 or a mix of v1 and v2 infrastructure. This document will primarily focus on TP's use case, but best efforts will be made to document where behavior is TP-specific.
|
||||||
|
|
||||||
|
## Common concepts
|
||||||
|
|
||||||
|
Audio is almost exclusively
|
||||||
|
|
||||||
|
### `JAISoundID`
|
||||||
|
|
||||||
|
A "sound", be that a _sound effect_ or music, is referenced in-code through the `JAISoundID` type. This is a `u32` that the game uses to look up the relevant sound. The actual value is bitpacked (BE) from the following fields:
|
||||||
|
|
||||||
|
| Type | Field | Description |
|
||||||
|
|-------|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `u8` | Section ID | Section of the Sound Table this sound effect is located in. 0 for sound effects, 1 for sequenced music, 2 for streamed music.[^sectionids] |
|
||||||
|
| `u8` | Group ID | ID of group further used to organize inside the Sound Table's Section. Sound effects are grouped into things like "SYSTEM" and "ENEMY", other sections leave this at 0. |
|
||||||
|
| `u16` | "Wave ID" | Index inside the group to look up the sound at.<br/>**Note** that the term "wave" in code is extremely confusing[^waveterm]; it does **not** refer to audio samples ("waves") in the wave banks directly. |
|
||||||
|
|
||||||
|
[^sectionids]: JAudio itself can seemingly work outside this convention, however it is enforced by some TP-specific game code.
|
||||||
|
|
||||||
|
[^waveterm]: Possibly vestigial from JAudio v1, where I believe there were less layers of indirection.
|
||||||
|
|
||||||
|
## Disc files
|
||||||
|
|
||||||
|
All audio data is stored in `/Audiores` on the disc. Files are as follows:
|
||||||
|
|
||||||
|
### `/Audiores/Seqs/Z2SoundSeqs.arc`
|
||||||
|
|
||||||
|
Contains the BMS instructions for all BMS-based music and sound effects. Not all data is kept in memory at once.
|
||||||
|
|
||||||
|
### `/Audiores/Stream/*.ast`
|
||||||
|
|
||||||
|
Contains individual streamed music. Each file is a separate music track. See [this page](https://www.lumasworkshop.com/wiki/AST_(File_Format)) for file format description.
|
||||||
|
|
||||||
|
### `/Audiores/Waves/*.aw`
|
||||||
|
|
||||||
|
Contains audio sample data for sequenced music and sound effects. These files are pure meat, no bone: they are loaded directly into ARAM and all metadata is stored in the BAA WSYS sections.
|
||||||
|
|
||||||
|
Each file contains audio samples for one "scene", with factors like the current level determining what "scenes" are made resident in memory. There is tons of duplicate data between scenes, presumably to increase simplicity and loading performance.
|
||||||
|
|
||||||
|
### `/Audiores/Z2Sound.baa`
|
||||||
|
|
||||||
|
Contains all remaining metadata for the audio system. This is effectively a container for a bunch of different sub-sections. The file starts with a bunch of "commands" that indicate where other data in the file is. Each command has a 4-character identifier and depending on the command will be followed by some extra arguments before the next command.
|
||||||
|
|
||||||
|
The commands used by TP's BAA file are as follows (note that the decompiled code has support for more load commands, which are unused):
|
||||||
|
|
||||||
|
| Command/Argument | Value | Description |
|
||||||
|
|------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|
| Command | `AA_<` | Start of BAA commands. Must be at the start of the file and only appear once. |
|
||||||
|
| Command | `>_AA` | End of BAA commands. |
|
||||||
|
| Command | `ws `[^spaces] | Wave bank/WSYS data. Defines where audio samples are located on disc. |
|
||||||
|
| Argument | u32 | Wave bank ID, max 255. In TP, 0 is sound effects, 1 is music samples. |
|
||||||
|
| Argument | u32 | File offset for start of `WSYS` data |
|
||||||
|
| Argument | u32 | Bit field selecting which groups (= `.aw` files) to load immediately. TP leaves this at zero.[^32ws] |
|
||||||
|
| Command | `bnk `[^spaces] | Instrument bank/IBNK |
|
||||||
|
| Argument | u32 | Target wave bank ID |
|
||||||
|
| Argument | u32 | File offset for start of `IBNK` data |
|
||||||
|
| Command | `bsc `[^spaces] | Sound effect sequence collection. |
|
||||||
|
| Argument | u32 | File offset for start of `SC` data. |
|
||||||
|
| Argument | u32 | File offset for end of `SC` data. |
|
||||||
|
| Command | `bst `[^spaces] | Sound table. Defines parameters for music and sound effects. |
|
||||||
|
| Argument | u32 | File offset for start of `BST `[^spaces] data. |
|
||||||
|
| Argument | u32 | File offset for end of `BST `[^spaces] data. |
|
||||||
|
| Command | `bstn` | Sound name table. Defines names of all music and sound effects. Present on disc, but loading is disabled on release versions of the game. |
|
||||||
|
| Argument | u32 | File offset for start of `BSTN` data. |
|
||||||
|
| Argument | u32 | File offset for end of `BSTN` data. |
|
||||||
|
| Command | `bfca` | Unknown, something related to initialization of DSP FX data. |
|
||||||
|
| Argument | u32 | File offset for start of `RARC` data. |
|
||||||
|
|
||||||
|
[^spaces]: Padded with spaces.
|
||||||
|
|
||||||
|
[^32ws]: Both of TP's wave banks have far more than 32 groups, and seemingly this mechanism would not be able to deal with that.
|
||||||
|
|
||||||
|
Following is data descriptions for the remaining data in the `.BAA`, as pointed to by the above commands.
|
||||||
|
|
||||||
|
### `WSYS` / Wave banks
|
||||||
|
|
||||||
|
`WSYS` / Wave bank data defines where a set of audio samples can be found on disc. Each wave bank is made of multiple "groups", where each group corresponds to one `.aw` file on disc. Each group has a set of "wave IDs" it contains, along with the metadata (e.g. sample rate) and data offset in the `.aw` file.
|
||||||
|
|
||||||
|
Multiple groups can contain the same wave ID, thus meaning the raw audio samples can be duplicated on disk.
|
||||||
|
|
||||||
|
For the actual binary layout of this data, check [the ImHex pattern](imhex/jaudio/wsys.hexpat)
|
||||||
|
|
||||||
|
*Relevant classes: `JASWSParser`, `JASBasicWaveBank`, `JASSimpleWaveBank`.*
|
||||||
|
|
||||||
|
## Further reading & credits
|
||||||
|
|
||||||
|
* https://www.lumasworkshop.com/wiki/SMR.szs (note that details like the exact layout of the BAA are not the same as TP)
|
||||||
|
* XAYRGA for doing much RE work and making [JAMTools](https://xayr.gay/tools/SoundModdingToolkit/)
|
||||||
|
* The decompiled source code, duh.
|
||||||
+8
-101
@@ -209,8 +209,8 @@ if (svc_resource->load(mod_ctx, "config.txt", &buf) == MOD_OK) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. The bundle is read-only; use
|
Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. Note that the bundle is read-only; for writable
|
||||||
`HostService::data_dir` for persistent storage.
|
storage, use the directory from `svc_host->mod_dir(mod_ctx)`.
|
||||||
|
|
||||||
### HostService (`mods/svc/host.h`)
|
### HostService (`mods/svc/host.h`)
|
||||||
|
|
||||||
@@ -219,17 +219,9 @@ Mod metadata and runtime interaction with the loader:
|
|||||||
```cpp
|
```cpp
|
||||||
IMPORT_SERVICE(HostService, svc_host);
|
IMPORT_SERVICE(HostService, svc_host);
|
||||||
|
|
||||||
// Temporary mod data directory, wiped on startup
|
const char* id = svc_host->mod_id(mod_ctx);
|
||||||
const char* cacheDir = svc_host->mod_dir(mod_ctx);
|
const char* dir = svc_host->mod_dir(mod_ctx); // writable per-mod directory
|
||||||
|
svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened"); // disables the mod
|
||||||
// Persistent mod data directory
|
|
||||||
const char* dataDir = nullptr;
|
|
||||||
if (svc_host->data_dir(mod_ctx, &dataDir) == MOD_OK) {
|
|
||||||
// ...
|
|
||||||
}
|
|
||||||
|
|
||||||
// Report an error and disable the mod
|
|
||||||
svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened");
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`get_service`/`publish_service` provide dynamic service lookup; see [Exporting Services](#exporting-services).
|
`get_service`/`publish_service` provide dynamic service lookup; see [Exporting Services](#exporting-services).
|
||||||
@@ -348,88 +340,6 @@ 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
|
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.
|
**not** fire callbacks; read the value after `register_var` for the starting state.
|
||||||
|
|
||||||
### SaveService (`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`.
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
IMPORT_SERVICE(SaveService, svc_save);
|
|
||||||
|
|
||||||
struct MySaveData {
|
|
||||||
uint32_t version;
|
|
||||||
uint32_t counter;
|
|
||||||
};
|
|
||||||
|
|
||||||
MySaveData state{1, 42};
|
|
||||||
svc_save->set_blob(mod_ctx, "state", &state, sizeof(state));
|
|
||||||
|
|
||||||
MySaveData loaded{};
|
|
||||||
size_t loadedSize = sizeof(loaded);
|
|
||||||
if (svc_save->get_blob(mod_ctx, "state", &loaded, &loadedSize) == MOD_OK &&
|
|
||||||
loadedSize == sizeof(loaded)) {
|
|
||||||
apply_state(loaded);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
`set_blob`, `get_blob`, and `delete_blob` operate on the current slot, which is available after creating or loading a
|
|
||||||
save and unavailable at file select. Blob changes are written with the next game save. File-select copy and erase
|
|
||||||
operations update the blob data as well. Use `peek_blob` to read the calling mod's data from any slot; it uses the same
|
|
||||||
buffer contract as `get_blob`. Pass a `NULL` buffer to either read function to query the blob size.
|
|
||||||
|
|
||||||
`observe_saves` registers callbacks for new, loaded, and written saves. New-save callbacks run after the slot's blobs
|
|
||||||
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`)
|
|
||||||
|
|
||||||
Allows making changes to a stage's "stage info" (contents of .dzs/.dzr files).
|
|
||||||
(Currently only supports editing actor nodes.)
|
|
||||||
|
|
||||||
```cpp
|
|
||||||
IMPORT_SERVICE(StageService, svc_stage);
|
|
||||||
|
|
||||||
stage_actor_data_class record = {
|
|
||||||
"carry00",
|
|
||||||
0xFF000000,
|
|
||||||
cXyz(0.0f, 0.0f, 0.0f),
|
|
||||||
csXyz(0, 0, 0),
|
|
||||||
0,
|
|
||||||
};
|
|
||||||
|
|
||||||
StageActorHandle handle{};
|
|
||||||
svc_stage->patch_actor(mod_ctx, "F_SP102", 0, -1, record_crc, &record, sizeof(record), &handle);
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
|
||||||
StageActorHandle handle{};
|
|
||||||
svc_stage->delete_actor(mod_ctx, "F_SP102", 0, -1, record_crc, &handle);
|
|
||||||
```
|
|
||||||
|
|
||||||
Patch or remove actors from the original actor list as the room loads.
|
|
||||||
Given records must be of either `stage_actor_data_class` or `stage_tgsc_data_class` types.
|
|
||||||
`record_crc` is the CRC-32 of the unmodified original record used to identify the record to replace or remove.
|
|
||||||
|
|
||||||
```
|
|
||||||
stage_actor_data_class record = {
|
|
||||||
"carry00",
|
|
||||||
0xFF000000,
|
|
||||||
cXyz(0.0f, 0.0f, 0.0f),
|
|
||||||
csXyz(0, 0, 0),
|
|
||||||
0,
|
|
||||||
};
|
|
||||||
|
|
||||||
StageActorHandle handle{};
|
|
||||||
svc_stage->add_actor(mod_ctx, "F_SP102", 0, -1, &record, sizeof(record), &handle);
|
|
||||||
```
|
|
||||||
|
|
||||||
Add a new actor to the actor list as the room loads.
|
|
||||||
Given records must be of either `stage_actor_data_class` or `stage_tgsc_data_class` types.
|
|
||||||
|
|
||||||
Stage names may contain up to 8 characters. For patches and deletions, room `0xff` and layer `-1` match any room or
|
|
||||||
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`)
|
||||||
|
|
||||||
Integrate seamlessly with Dusklight's UI system: add controls and buttons to your mod's detail pane in the Mods window,
|
Integrate seamlessly with Dusklight's UI system: add controls and buttons to your mod's detail pane in the Mods window,
|
||||||
@@ -633,9 +543,6 @@ if (svc_camera->get_camera(mod_ctx, game_view, &camera) == MOD_OK) {
|
|||||||
first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention
|
first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention
|
||||||
(reversed-Z by default).
|
(reversed-Z by default).
|
||||||
|
|
||||||
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`.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Hooking Game Functions
|
## Hooking Game Functions
|
||||||
@@ -938,6 +845,6 @@ const char* nativeDir = svc_host->native_dir(mod_ctx); // read-only
|
|||||||
```
|
```
|
||||||
|
|
||||||
Libraries loaded explicitly by the mod remain its responsibility: stop their threads and unload them during
|
Libraries loaded explicitly by the mod remain its responsibility: stop their threads and unload them during
|
||||||
`mod_shutdown`. Do not write into `native_dir`; use `data_dir` for persistent storage or `mod_dir` for temporary
|
`mod_shutdown`. Do not write into `native_dir`; use `mod_dir` for writable state. Native library namespaces are
|
||||||
(session) storage. Native library namespaces are process-wide on some platforms, so two mods cannot safely assume that
|
process-wide on some platforms, so two mods cannot safely assume that incompatible libraries with the same filename
|
||||||
incompatible libraries with the same filename will remain isolated.
|
will remain isolated.
|
||||||
|
|||||||
Vendored
+1
-1
Submodule extern/aurora updated: 8005d336ab...0bddb86249
Vendored
-1
Submodule extern/borealis deleted from 6fd955e7e6
+27
-7
@@ -1421,21 +1421,30 @@ set(DUSK_FILES
|
|||||||
src/dusk/achievements.cpp
|
src/dusk/achievements.cpp
|
||||||
src/dusk/action_bindings.cpp
|
src/dusk/action_bindings.cpp
|
||||||
src/dusk/action_bindings.h
|
src/dusk/action_bindings.h
|
||||||
|
src/dusk/android_frame_rate.cpp
|
||||||
|
src/dusk/android_frame_rate.hpp
|
||||||
src/dusk/asserts.cpp
|
src/dusk/asserts.cpp
|
||||||
src/dusk/autosave.cpp
|
src/dusk/autosave.cpp
|
||||||
src/dusk/config.cpp
|
src/dusk/config.cpp
|
||||||
src/dusk/config.hpp
|
src/dusk/config.hpp
|
||||||
|
src/dusk/crash_handler.cpp
|
||||||
|
src/dusk/crash_reporting.cpp
|
||||||
src/dusk/data.cpp
|
src/dusk/data.cpp
|
||||||
src/dusk/data.hpp
|
src/dusk/data.hpp
|
||||||
|
src/dusk/discord.cpp
|
||||||
|
src/dusk/discord.hpp
|
||||||
src/dusk/discord_presence.cpp
|
src/dusk/discord_presence.cpp
|
||||||
src/dusk/dvd_asset.cpp
|
src/dusk/dvd_asset.cpp
|
||||||
src/dusk/dvd_asset.hpp
|
src/dusk/dvd_asset.hpp
|
||||||
src/dusk/extras.c
|
src/dusk/extras.c
|
||||||
|
src/dusk/file_select.cpp
|
||||||
|
src/dusk/file_select.hpp
|
||||||
src/dusk/frame_interpolation.cpp
|
src/dusk/frame_interpolation.cpp
|
||||||
src/dusk/game_clock.cpp
|
src/dusk/game_clock.cpp
|
||||||
src/dusk/gamepad_color.cpp
|
src/dusk/gamepad_color.cpp
|
||||||
src/dusk/globals.cpp
|
src/dusk/globals.cpp
|
||||||
src/dusk/gyro.cpp
|
src/dusk/gyro.cpp
|
||||||
|
src/dusk/http/http.hpp
|
||||||
src/dusk/imgui/ImGuiActorSpawner.cpp
|
src/dusk/imgui/ImGuiActorSpawner.cpp
|
||||||
src/dusk/imgui/ImGuiBloomWindow.cpp
|
src/dusk/imgui/ImGuiBloomWindow.cpp
|
||||||
src/dusk/imgui/ImGuiBloomWindow.hpp
|
src/dusk/imgui/ImGuiBloomWindow.hpp
|
||||||
@@ -1476,6 +1485,12 @@ set(DUSK_FILES
|
|||||||
src/dusk/mods/log_buffer.hpp
|
src/dusk/mods/log_buffer.hpp
|
||||||
src/dusk/mods/manifest.cpp
|
src/dusk/mods/manifest.cpp
|
||||||
src/dusk/mods/manifest.hpp
|
src/dusk/mods/manifest.hpp
|
||||||
|
src/dusk/mods/svc/audio_res/audio_res.hpp
|
||||||
|
src/dusk/mods/svc/audio_res/audio_res.cpp
|
||||||
|
src/dusk/mods/svc/audio_res/wsys.cpp
|
||||||
|
src/dusk/mods/svc/audio_res/wsys.hpp
|
||||||
|
src/dusk/mods/svc/audio_res/wave.cpp
|
||||||
|
src/dusk/mods/svc/audio_res/opus.cpp
|
||||||
src/dusk/mods/svc/camera.cpp
|
src/dusk/mods/svc/camera.cpp
|
||||||
src/dusk/mods/svc/config.cpp
|
src/dusk/mods/svc/config.cpp
|
||||||
src/dusk/mods/svc/config.hpp
|
src/dusk/mods/svc/config.hpp
|
||||||
@@ -1483,6 +1498,8 @@ set(DUSK_FILES
|
|||||||
src/dusk/mods/svc/gfx.cpp
|
src/dusk/mods/svc/gfx.cpp
|
||||||
src/dusk/mods/svc/hook.cpp
|
src/dusk/mods/svc/hook.cpp
|
||||||
src/dusk/mods/svc/host.cpp
|
src/dusk/mods/svc/host.cpp
|
||||||
|
src/dusk/mods/svc/id_allocator.cpp
|
||||||
|
src/dusk/mods/svc/id_allocator.hpp
|
||||||
src/dusk/mods/svc/log.cpp
|
src/dusk/mods/svc/log.cpp
|
||||||
src/dusk/mods/svc/overlay.cpp
|
src/dusk/mods/svc/overlay.cpp
|
||||||
src/dusk/mods/svc/registry.cpp
|
src/dusk/mods/svc/registry.cpp
|
||||||
@@ -1493,13 +1510,7 @@ set(DUSK_FILES
|
|||||||
src/dusk/mods/svc/ui.hpp
|
src/dusk/mods/svc/ui.hpp
|
||||||
src/dusk/mods/svc/window.cpp
|
src/dusk/mods/svc/window.cpp
|
||||||
src/dusk/mods/svc/window.hpp
|
src/dusk/mods/svc/window.hpp
|
||||||
src/dusk/mods/svc/save.cpp
|
|
||||||
src/dusk/mods/svc/save.hpp
|
|
||||||
src/dusk/mods/svc/stage.cpp
|
|
||||||
src/dusk/mods/svc/stage.hpp
|
|
||||||
src/dusk/mouse.cpp
|
src/dusk/mouse.cpp
|
||||||
src/dusk/presentation.cpp
|
|
||||||
src/dusk/presentation.hpp
|
|
||||||
src/dusk/scope_guard.hpp
|
src/dusk/scope_guard.hpp
|
||||||
src/dusk/settings.cpp
|
src/dusk/settings.cpp
|
||||||
src/dusk/speedrun.cpp
|
src/dusk/speedrun.cpp
|
||||||
@@ -1575,10 +1586,19 @@ set(DUSK_FILES
|
|||||||
src/dusk/ui/warp.hpp
|
src/dusk/ui/warp.hpp
|
||||||
src/dusk/ui/window.cpp
|
src/dusk/ui/window.cpp
|
||||||
src/dusk/ui/window.hpp
|
src/dusk/ui/window.hpp
|
||||||
|
src/dusk/update_check.cpp
|
||||||
|
src/dusk/update_check.hpp
|
||||||
src/dusk/version.cpp
|
src/dusk/version.cpp
|
||||||
src/dusk/utilities.cpp
|
|
||||||
src/helpers/batch.cpp
|
src/helpers/batch.cpp
|
||||||
src/helpers/endian.cpp
|
src/helpers/endian.cpp
|
||||||
src/helpers/offset_ptr.cpp
|
src/helpers/offset_ptr.cpp
|
||||||
src/helpers/string.cpp
|
src/helpers/string.cpp
|
||||||
|
src/helpers/cast.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(DUSK_HTTP_BACKEND_FILES
|
||||||
|
src/dusk/http/no_backend.cpp
|
||||||
|
src/dusk/http/curl.cpp
|
||||||
|
src/dusk/http/winhttp.cpp
|
||||||
|
src/dusk/http/url_session.mm
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -228,7 +228,7 @@
|
|||||||
ninjaFlags = [ "dusklight" ];
|
ninjaFlags = [ "dusklight" ];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DBOREALIS_APP_VERSION_OVERRIDE=${versionSuffix}"
|
"-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
|
||||||
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
|
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
|
||||||
"-DAURORA_DAWN_PROVIDER=package"
|
"-DAURORA_DAWN_PROVIDER=package"
|
||||||
"-DAURORA_DAWN_LINKAGE=static"
|
"-DAURORA_DAWN_LINKAGE=static"
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include "JSystem/JAudio2/JAUAudibleParam.h"
|
#include "JSystem/JAudio2/JAUAudibleParam.h"
|
||||||
#include "JSystem/TPosition3.h"
|
#include "JSystem/TPosition3.h"
|
||||||
|
|
||||||
|
#define Z2_AUDIO_PLAYERS 1
|
||||||
|
|
||||||
struct Z2Audible;
|
struct Z2Audible;
|
||||||
|
|
||||||
struct Z2AudibleAbsPos {
|
struct Z2AudibleAbsPos {
|
||||||
@@ -49,10 +51,14 @@ struct Z2AudioCamera {
|
|||||||
f32 getCamDist() const { return mCamDist; }
|
f32 getCamDist() const { return mCamDist; }
|
||||||
|
|
||||||
|
|
||||||
/* 0x00 */ JGeometry::TPosition3f32 field_0x0;
|
/* 0x00 */ JGeometry::TPosition3f32 mViewMatrix;
|
||||||
/* 0x30 */ JGeometry::TVec3<f32> mVel;
|
/* 0x30 */ JGeometry::TVec3<f32> mVel;
|
||||||
/* 0x3C */ JGeometry::TVec3<f32> mPos;
|
/* 0x3C */ JGeometry::TVec3<f32> mPos;
|
||||||
/* 0x48 */ JGeometry::TVec3<f32> field_0x48;
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* 0x48 */ JGeometry::TVec3<f32> mLastPos;
|
||||||
/* 0x54 */ f32 mFovySin;
|
/* 0x54 */ f32 mFovySin;
|
||||||
/* 0x58 */ f32 mVolCenterZ;
|
/* 0x58 */ f32 mVolCenterZ;
|
||||||
/* 0x5C */ f32 mTargetVolume;
|
/* 0x5C */ f32 mTargetVolume;
|
||||||
@@ -83,14 +89,14 @@ struct Z2SpotMic {
|
|||||||
/* 0x04 */ f32 field_0x4;
|
/* 0x04 */ f32 field_0x4;
|
||||||
/* 0x08 */ f32 field_0x8;
|
/* 0x08 */ f32 field_0x8;
|
||||||
/* 0x0C */ f32 field_0xc;
|
/* 0x0C */ f32 field_0xc;
|
||||||
/* 0x10 */ Z2AudioCamera* field_0x10[1];
|
/* 0x10 */ Z2AudioCamera* field_0x10[Z2_AUDIO_PLAYERS];
|
||||||
/* 0x14 */ Vec* mPosPtr;
|
/* 0x14 */ Vec* mPosPtr;
|
||||||
/* 0x18 */ f32 field_0x18[1];
|
/* 0x18 */ f32 field_0x18[Z2_AUDIO_PLAYERS];
|
||||||
/* 0x1C */ f32 field_0x1c;
|
/* 0x1C */ f32 field_0x1c;
|
||||||
/* 0x20 */ f32 field_0x20[1];
|
/* 0x20 */ f32 field_0x20[Z2_AUDIO_PLAYERS];
|
||||||
/* 0x24 */ bool mIgnoreIfOut;
|
/* 0x24 */ bool mIgnoreIfOut;
|
||||||
/* 0x25 */ bool mMicOn;
|
/* 0x25 */ bool mMicOn;
|
||||||
/* 0x26 */ bool field_0x26[1];
|
/* 0x26 */ bool field_0x26[Z2_AUDIO_PLAYERS];
|
||||||
}; // Size: 0x28
|
}; // Size: 0x28
|
||||||
|
|
||||||
struct Z2Audience3DSetting {
|
struct Z2Audience3DSetting {
|
||||||
@@ -102,62 +108,99 @@ struct Z2Audience3DSetting {
|
|||||||
void updateDolbyDist(f32, f32);
|
void updateDolbyDist(f32, f32);
|
||||||
|
|
||||||
void calcVolumeFactorAll() {
|
void calcVolumeFactorAll() {
|
||||||
field_0x0[1] = 1.25f * field_0x0[0];
|
mDistanceMaxes[1] = 1.25f * mDistanceMaxes[0];
|
||||||
field_0x0[2] = 1.5f * field_0x0[0];
|
mDistanceMaxes[2] = 1.5f * mDistanceMaxes[0];
|
||||||
field_0x0[3] = 2.0f * field_0x0[0];
|
mDistanceMaxes[3] = 2.0f * mDistanceMaxes[0];
|
||||||
field_0x0[4] = 3.0f * field_0x0[0];
|
mDistanceMaxes[4] = 3.0f * mDistanceMaxes[0];
|
||||||
field_0x0[5] = 4.0f * field_0x0[0];
|
mDistanceMaxes[5] = 4.0f * mDistanceMaxes[0];
|
||||||
field_0x0[6] = 6.0f * field_0x0[0];
|
mDistanceMaxes[6] = 6.0f * mDistanceMaxes[0];
|
||||||
field_0x0[7] = 8.0f * field_0x0[0];
|
mDistanceMaxes[7] = 8.0f * mDistanceMaxes[0];
|
||||||
field_0x0[8] = 0.9f * field_0x0[0];
|
mDistanceMaxes[8] = 0.9f * mDistanceMaxes[0];
|
||||||
field_0x0[9] = 0.8f * field_0x0[0];
|
mDistanceMaxes[9] = 0.8f * mDistanceMaxes[0];
|
||||||
field_0x0[10] = 0.7f * field_0x0[0];
|
mDistanceMaxes[10] = 0.7f * mDistanceMaxes[0];
|
||||||
field_0x0[11] = 0.6f * field_0x0[0];
|
mDistanceMaxes[11] = 0.6f * mDistanceMaxes[0];
|
||||||
field_0x0[12] = 0.5f * field_0x0[0];
|
mDistanceMaxes[12] = 0.5f * mDistanceMaxes[0];
|
||||||
field_0x0[13] = 0.4f * field_0x0[0];
|
mDistanceMaxes[13] = 0.4f * mDistanceMaxes[0];
|
||||||
field_0x0[14] = 0.3f * field_0x0[0];
|
mDistanceMaxes[14] = 0.3f * mDistanceMaxes[0];
|
||||||
for (int i = 0; i < 15; i++) {
|
for (int i = 0; i < 15; i++) {
|
||||||
field_0x70[i] = (field_0x40 - 1.0f) / (field_0x0[i] - field_0x3c);
|
mVolumeFactor[i] = (mMinDistanceVolume - 1.0f) / (mDistanceMaxes[i] - mMaxVolumeDistance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void calcPriorityFactorAll() {
|
void calcPriorityFactorAll() {
|
||||||
for (int i = 0; i < 15; i++) {
|
for (int i = 0; i < 15; i++) {
|
||||||
field_0xac[i] = field_0x64 / (field_0x0[i] - field_0x3c);
|
mPriorityFactor[i] = mMaxDistancePriority / (mDistanceMaxes[i] - mMaxVolumeDistance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void calcFxMixFactorAll() {
|
void calcFxMixFactorAll() {
|
||||||
for (int i = 0; i < 15; i++) {
|
for (int i = 0; i < 15; i++) {
|
||||||
field_0xe8[i] = (field_0x54 - field_0x50) / (field_0x0[i] - field_0x3c);
|
mFxMixFactor[i] = (mMaxDistanceFxMix - mMinDistanceFxMix) / (mDistanceMaxes[i] - mMaxVolumeDistance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0x000 */ f32 field_0x0[15];
|
/**
|
||||||
/* 0x03C */ f32 field_0x3c;
|
* Maximum distance a sound can reach before being "far away"
|
||||||
/* 0x040 */ f32 field_0x40;
|
* Being far away affects stuff like culling, lowering its priority, forcibly stopping it, etc.
|
||||||
/* 0x044 */ f32 field_0x44;
|
* Sounds select which entry they use based on their VolBits.
|
||||||
/* 0x048 */ f32 field_0x48;
|
*/
|
||||||
/* 0x04C */ f32 field_0x4c;
|
/* 0x000 */ f32 mDistanceMaxes[15];
|
||||||
/* 0x050 */ f32 field_0x50;
|
|
||||||
/* 0x054 */ f32 field_0x54;
|
/**
|
||||||
/* 0x058 */ f32 field_0x58;
|
* Distance at which the max volume of a sound is reached.
|
||||||
/* 0x05C */ f32 field_0x5c;
|
* i.e. sounds do *not* get louder if they get closer than this.
|
||||||
|
*/
|
||||||
|
/* 0x03C */ f32 mMaxVolumeDistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FX Mix value at maximum distance (@ref mDistanceMaxes)
|
||||||
|
*/
|
||||||
|
/* 0x040 */ f32 mMinDistanceVolume;
|
||||||
|
/* 0x044 */ f32 mDolbyFrontDistanceMax;
|
||||||
|
/* 0x048 */ f32 mDolbyBehindDistanceMax;
|
||||||
|
/* 0x04C */ f32 mDolbyCenterValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FX Mix value at minimum distance (@ref mMaxVolumeDistance)
|
||||||
|
*/
|
||||||
|
/* 0x050 */ f32 mMinDistanceFxMix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FX Mix value at maximum distance (@ref mDistanceMaxes)
|
||||||
|
*/
|
||||||
|
/* 0x054 */ f32 mMaxDistanceFxMix;
|
||||||
|
/* 0x058 */ f32 mPanFactor;
|
||||||
|
/* 0x05C */ f32 mSonicSpeed; // Used for doppler effect calculations.
|
||||||
/* 0x060 */ f32 field_0x60;
|
/* 0x060 */ f32 field_0x60;
|
||||||
/* 0x064 */ u32 field_0x64;
|
|
||||||
|
/**
|
||||||
|
* Priority that sounds receive when "far away".
|
||||||
|
* @see mDistanceMaxes
|
||||||
|
*/
|
||||||
|
/* 0x064 */ u32 mMaxDistancePriority;
|
||||||
/* 0x068 */ f32 field_0x68;
|
/* 0x068 */ f32 field_0x68;
|
||||||
/* 0x06C */ f32 field_0x6c;
|
/* 0x06C */ f32 field_0x6c;
|
||||||
/* 0x070 */ f32 field_0x70[15];
|
/* 0x070 */ f32 mVolumeFactor[15];
|
||||||
/* 0x0AC */ f32 field_0xac[15];
|
/* 0x0AC */ f32 mPriorityFactor[15];
|
||||||
/* 0x0E8 */ f32 field_0xe8[15];
|
/* 0x0E8 */ f32 mFxMixFactor[15];
|
||||||
/* 0x124 */ bool mVolumeDistInit;
|
/* 0x124 */ bool mVolumeDistInit;
|
||||||
/* 0x125 */ bool mDolbyDistInit;
|
/* 0x125 */ bool mDolbyDistInit;
|
||||||
}; // Size: 0x128
|
}; // Size: 0x128
|
||||||
|
|
||||||
struct Z2AudibleRelPos {
|
struct Z2AudibleRelPos {
|
||||||
/* 0x00 */ JGeometry::TVec3<f32> field_0x00;
|
/* 0x00 */ JGeometry::TVec3<f32> mCameraRelative;
|
||||||
/* 0x0C */ f32 field_0xC;
|
|
||||||
/* 0x10 */ f32 field_0x10;
|
/**
|
||||||
|
* Distance from mCameraRelative. This is from the object root and not the
|
||||||
|
* exact distance used for volume/priority calculations.
|
||||||
|
*/
|
||||||
|
/* 0x0C */ f32 mTrueDistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Distance from mCameraRelative but offset by mVolCenterZ.
|
||||||
|
* This presumably means the distance is more centered on the object than mTrueDistance.
|
||||||
|
*/
|
||||||
|
/* 0x10 */ f32 mCenterDistance;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Z2AudibleChannel {
|
struct Z2AudibleChannel {
|
||||||
@@ -171,7 +214,7 @@ struct Z2AudibleChannel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 0x00 */ JASSoundParams mParams;
|
/* 0x00 */ JASSoundParams mParams;
|
||||||
/* 0x14 */ Z2AudibleRelPos field_0x14;
|
/* 0x14 */ Z2AudibleRelPos mRelPos;
|
||||||
/* 0x28 */ f32 field_0x28;
|
/* 0x28 */ f32 field_0x28;
|
||||||
/* 0x2c */ f32 mPan;
|
/* 0x2c */ f32 mPan;
|
||||||
/* 0x30 */ f32 mDolby;
|
/* 0x30 */ f32 mDolby;
|
||||||
@@ -200,8 +243,8 @@ struct Z2Audible : public JAIAudible, public JASPoolAllocObject<Z2Audible> {
|
|||||||
|
|
||||||
/* 0x10 */ JAUAudibleParam mParam;
|
/* 0x10 */ JAUAudibleParam mParam;
|
||||||
/* 0x14 */ Z2AudibleAbsPos mAbsPos;
|
/* 0x14 */ Z2AudibleAbsPos mAbsPos;
|
||||||
/* 0x2C */ Z2AudibleChannel mChannel[1];
|
/* 0x2C */ Z2AudibleChannel mChannel[Z2_AUDIO_PLAYERS];
|
||||||
/* 0x64 */ f32 field_0x64[1];
|
/* 0x64 */ f32 mMicDistances[Z2_AUDIO_PLAYERS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> {
|
struct Z2Audience : public JAIAudience, public JASGlobalInstance<Z2Audience> {
|
||||||
|
|||||||
@@ -423,7 +423,7 @@ public:
|
|||||||
static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21];
|
static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21];
|
||||||
static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53];
|
static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53];
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x568 */ request_of_phase_process_class mPhase;
|
/* 0x568 */ request_of_phase_process_class mPhase;
|
||||||
/* 0x570 */ J3DModel* mpModel;
|
/* 0x570 */ J3DModel* mpModel;
|
||||||
/* 0x574 */ J3DModel* mpShadowModel;
|
/* 0x574 */ J3DModel* mpShadowModel;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; }
|
CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; }
|
||||||
void draw() { _draw(); }
|
void draw() { _draw(); }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x04 */ JKRArchive* mArchive;
|
/* 0x04 */ JKRArchive* mArchive;
|
||||||
/* 0x08 */ dDlst_FileInfo_c mFileInfo;
|
/* 0x08 */ dDlst_FileInfo_c mFileInfo;
|
||||||
/* 0x1C */ u8 field_0x1c[4];
|
/* 0x1C */ u8 field_0x1c[4];
|
||||||
|
|||||||
@@ -13,8 +13,36 @@ class dFile_info_c;
|
|||||||
class J2DPicture;
|
class J2DPicture;
|
||||||
|
|
||||||
#if TARGET_PC
|
#if TARGET_PC
|
||||||
|
static PaneCache mSelDtPanes[] = {
|
||||||
|
{MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('gray_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('b_base'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('b_base1'), 0.0f, 0.0f, false},
|
||||||
|
};
|
||||||
|
|
||||||
|
static PaneCache fileSelPanes[] = {
|
||||||
|
{MULTI_CHAR('w_uzu00'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu01'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu02'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu03'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu04'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu05'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu06'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu07'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu08'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_uzu09'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_er_msg'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_er_msE'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_er_msR'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('er_for0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('er_for1'), 0.0f, 0.0f, false},
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class dDlst_FileSel_c : public dDlst_base_c {
|
class dDlst_FileSel_c : public dDlst_base_c {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public:
|
|||||||
|
|
||||||
void drawSelf() { mpKanteraIcon->draw(); }
|
void drawSelf() { mpKanteraIcon->draw(); }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon;
|
/* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon;
|
||||||
/* 0x08 */ CPaneMgr* mpParent;
|
/* 0x08 */ CPaneMgr* mpParent;
|
||||||
/* 0x0C */ CPaneMgr* mpGauge;
|
/* 0x0C */ CPaneMgr* mpGauge;
|
||||||
|
|||||||
@@ -15,6 +15,49 @@ class dMenu_Fishing_c;
|
|||||||
class dMenu_Skill_c;
|
class dMenu_Skill_c;
|
||||||
class dMenu_Insect_c;
|
class dMenu_Insect_c;
|
||||||
class dSelect_cursor_c;
|
class dSelect_cursor_c;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
struct PaneCache {
|
||||||
|
u64 tag;
|
||||||
|
f32 origTransX;
|
||||||
|
f32 origTransY;
|
||||||
|
bool cached;
|
||||||
|
};
|
||||||
|
|
||||||
|
static PaneCache mpScreenPanes[] = {
|
||||||
|
{MULTI_CHAR('sa_tex_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('op_tex_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('heart_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('wolf_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('item_0_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('item_1_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('item_2_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fish_3_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('lett_4_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('maki_5_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('kabu_6n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('t_t00'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('f_t00'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('itemn_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('infotxtn'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('sa_op_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('title_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('menu_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('w_er_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('center_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('info_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('lavel_n'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('modelbgn'), 0.0f, 0.0f, false},
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class dMenu_Collect2D_c;
|
class dMenu_Collect2D_c;
|
||||||
class dMenu_Collect2DTop_c : public dDlst_base_c {
|
class dMenu_Collect2DTop_c : public dDlst_base_c {
|
||||||
public:
|
public:
|
||||||
@@ -129,7 +172,7 @@ public:
|
|||||||
J2DPicture* getBlackTex() { return mpBlackTex; }
|
J2DPicture* getBlackTex() { return mpBlackTex; }
|
||||||
u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; }
|
u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ JKRExpHeap* mpHeap;
|
/* 0x004 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x008 */ JKRExpHeap* mpSubHeap;
|
/* 0x008 */ JKRExpHeap* mpSubHeap;
|
||||||
/* 0x00C */ void* field_0xc;
|
/* 0x00C */ void* field_0xc;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
u8 getStatus() { return mStatus; }
|
u8 getStatus() { return mStatus; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ JKRExpHeap* mpHeap;
|
/* 0x004 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x008 */ JKRArchive* mpArchive;
|
/* 0x008 */ JKRArchive* mpArchive;
|
||||||
/* 0x00C */ STControl* mpStick;
|
/* 0x00C */ STControl* mpStick;
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public:
|
|||||||
|
|
||||||
static DUSK_GAME_DATA dMenu_Fmap_c* MyClass;
|
static DUSK_GAME_DATA dMenu_Fmap_c* MyClass;
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ JKRExpHeap* mpHeap;
|
/* 0x004 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x008 */ JKRExpHeap* mpTalkHeap;
|
/* 0x008 */ JKRExpHeap* mpTalkHeap;
|
||||||
/* 0x00C */ STControl* mpStick;
|
/* 0x00C */ STControl* mpStick;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
|
|
||||||
u8 getStatus() { return mStatus; }
|
u8 getStatus() { return mStatus; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x04 */ JKRExpHeap* mpHeap;
|
/* 0x04 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x08 */ JKRArchive* mpArchive;
|
/* 0x08 */ JKRArchive* mpArchive;
|
||||||
/* 0x0C */ STControl* mpStick;
|
/* 0x0C */ STControl* mpStick;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public:
|
|||||||
|
|
||||||
u8 getStatus() { return mStatus; }
|
u8 getStatus() { return mStatus; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ JKRExpHeap* mpHeap;
|
/* 0x004 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x008 */ JKRArchive* mpArchive;
|
/* 0x008 */ JKRArchive* mpArchive;
|
||||||
/* 0x00C */ STControl* mpStick;
|
/* 0x00C */ STControl* mpStick;
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public:
|
|||||||
return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false;
|
return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ J2DScreen* mpBackScreen;
|
/* 0x004 */ J2DScreen* mpBackScreen;
|
||||||
/* 0x008 */ J2DScreen* mpScreen;
|
/* 0x008 */ J2DScreen* mpScreen;
|
||||||
/* 0x00C */ J2DScreen* mpClipScreen;
|
/* 0x00C */ J2DScreen* mpClipScreen;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
void drawFlag0() { mDrawFlag = 0; }
|
void drawFlag0() { mDrawFlag = 0; }
|
||||||
void setStatus(u8 i_status) { mStatus = i_status; }
|
void setStatus(u8 i_status) { mStatus = i_status; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ JKRExpHeap* mpHeap;
|
/* 0x004 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x008 */ STControl* mpStick;
|
/* 0x008 */ STControl* mpStick;
|
||||||
/* 0x00C */ CSTControl* mpCStick;
|
/* 0x00C */ CSTControl* mpCStick;
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ public:
|
|||||||
u8 getEndStatus() { return mEndStatus; }
|
u8 getEndStatus() { return mEndStatus; }
|
||||||
void setUseType(u8 type) { mUseType = type; }
|
void setUseType(u8 type) { mUseType = type; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x0004 */ JKRArchive* mpArchive;
|
/* 0x0004 */ JKRArchive* mpArchive;
|
||||||
/* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount;
|
/* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount;
|
||||||
/* 0x000C */ STControl* stick;
|
/* 0x000C */ STControl* stick;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
u8 getStatus() { return mStatus; }
|
u8 getStatus() { return mStatus; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ JKRExpHeap* mpHeap;
|
/* 0x004 */ JKRExpHeap* mpHeap;
|
||||||
/* 0x008 */ JKRArchive* mpArchive;
|
/* 0x008 */ JKRArchive* mpArchive;
|
||||||
/* 0x00C */ STControl* mpStick;
|
/* 0x00C */ STControl* mpStick;
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public:
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ item_params mItemParams[4];
|
/* 0x004 */ item_params mItemParams[4];
|
||||||
/* 0x074 */ JKRExpHeap* heap;
|
/* 0x074 */ JKRExpHeap* heap;
|
||||||
/* 0x078 */ J2DScreen* mpScreen;
|
/* 0x078 */ J2DScreen* mpScreen;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public:
|
|||||||
void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; }
|
void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; }
|
||||||
void resetType() { mType = 0x47; }
|
void resetType() { mType = 0x47; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x04 */ J2DTextBox* mpTextBoxPtr;
|
/* 0x04 */ J2DTextBox* mpTextBoxPtr;
|
||||||
/* 0x08 */ f32 mPosX;
|
/* 0x08 */ f32 mPosX;
|
||||||
/* 0x0C */ f32 mPosY;
|
/* 0x0C */ f32 mPosY;
|
||||||
@@ -53,7 +53,7 @@ public:
|
|||||||
|
|
||||||
void setRupeeColor(u8 color) { mRupeeColor = color; }
|
void setRupeeColor(u8 color) { mRupeeColor = color; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x004 */ COutFontSet_c* mpOfs[35];
|
/* 0x004 */ COutFontSet_c* mpOfs[35];
|
||||||
/* 0x090 */ J2DPicture* mpPane[70];
|
/* 0x090 */ J2DPicture* mpPane[70];
|
||||||
/* 0x1A8 */ f32 mAlphaRatio;
|
/* 0x1A8 */ f32 mAlphaRatio;
|
||||||
|
|||||||
@@ -12,6 +12,34 @@ class J2DTextBox;
|
|||||||
class JUTFont;
|
class JUTFont;
|
||||||
class STControl;
|
class STControl;
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
struct PaneCache {
|
||||||
|
u64 tag;
|
||||||
|
f32 origTransX;
|
||||||
|
f32 origTransY;
|
||||||
|
bool cached;
|
||||||
|
};
|
||||||
|
|
||||||
|
static PaneCache l_tagName[] = {
|
||||||
|
{MULTI_CHAR('m_00_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_3'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m_01_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_2'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m03_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_1'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m_05_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_0'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m_07_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_4'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m_09_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_3'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m_10_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_2'), 0.0f, 0.0f, false},
|
||||||
|
{MULTI_CHAR('m12_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_0'), 0.0f, 0.0f, false},
|
||||||
|
};
|
||||||
|
|
||||||
|
static PaneCache l_nameTagName[] = {
|
||||||
|
{MULTI_CHAR('name_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_07'), 0.0f, 0.0f, false},
|
||||||
|
};
|
||||||
|
|
||||||
|
static PaneCache l_nameCurTagName[] = {
|
||||||
|
{MULTI_CHAR('s__n_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_07'), 0.0f, 0.0f, false},
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
class dNm_HIO_c {
|
class dNm_HIO_c {
|
||||||
public:
|
public:
|
||||||
dNm_HIO_c();
|
dNm_HIO_c();
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace dusk::helpers::alignment {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read data from an address that may not be aligned properly.
|
||||||
|
* @tparam T Type of data to read.
|
||||||
|
* @param ptr Address to read from.
|
||||||
|
* @return The copied value.
|
||||||
|
*/
|
||||||
|
template <typename T> requires std::is_trivially_copyable_v<T>
|
||||||
|
[[nodiscard]] constexpr T read_unaligned(u8 const* ptr) {
|
||||||
|
T copy;
|
||||||
|
memcpy(©, ptr, sizeof(T));
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
|
#include <utility>
|
||||||
|
#include <span>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper functions for performing casts.
|
||||||
|
*/
|
||||||
|
namespace dusk::helpers::cast {
|
||||||
|
/**
|
||||||
|
* Implementation details of dusk::helpers::cast.
|
||||||
|
*/
|
||||||
|
namespace _impl {
|
||||||
|
[[noreturn]] void overrun_high();
|
||||||
|
[[noreturn]] void overrun_low();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept IntCastable = std::is_integral_v<T> && std::is_trivially_copyable_v<T>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper type that allows easily casting between integer types,
|
||||||
|
* that safely aborts if an overflow were to occur.
|
||||||
|
* Usage:
|
||||||
|
* @code
|
||||||
|
* size_t foobar = 20;
|
||||||
|
* int real = bounded_cast(foobar);
|
||||||
|
* @endcode
|
||||||
|
*/
|
||||||
|
template <IntCastable Source>
|
||||||
|
struct bounded_cast {
|
||||||
|
Source src;
|
||||||
|
|
||||||
|
template <IntCastable Target>
|
||||||
|
[[nodiscard]] constexpr operator Target() const {
|
||||||
|
if (std::cmp_greater(src, std::numeric_limits<Target>::max())) [[unlikely]] {
|
||||||
|
_impl::overrun_high();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (std::cmp_less(src, std::numeric_limits<Target>::min())) [[unlikely]] {
|
||||||
|
_impl::overrun_low();
|
||||||
|
}
|
||||||
|
|
||||||
|
return static_cast<Target>(src);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -285,6 +285,7 @@ inline void be_swap(Mtx& val) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LE(T) T
|
||||||
#define BE(T) BE<T>
|
#define BE(T) BE<T>
|
||||||
#define BE_HOST(T) (T.host())
|
#define BE_HOST(T) (T.host())
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
JKRMemArchive* getArchive() const { return mArchive; }
|
JKRMemArchive* getArchive() const { return mArchive; }
|
||||||
JKRHeap* getHeap() const { return mHeap; }
|
JKRHeap* getHeap() const { return mHeap; }
|
||||||
|
|
||||||
// private:
|
private:
|
||||||
/* 0x14 */ u8 mMountDirection;
|
/* 0x14 */ u8 mMountDirection;
|
||||||
/* 0x18 */ s32 mEntryNumber;
|
/* 0x18 */ s32 mEntryNumber;
|
||||||
/* 0x1C */ JKRMemArchive* mArchive;
|
/* 0x1C */ JKRMemArchive* mArchive;
|
||||||
@@ -130,8 +130,8 @@ private:
|
|||||||
}; // Size = 0x28
|
}; // Size = 0x28
|
||||||
|
|
||||||
struct mDoDvdThdStack {
|
struct mDoDvdThdStack {
|
||||||
ATTRIBUTE_ALIGN(16) u8 stack[4096];
|
u8 stack[4096];
|
||||||
};
|
} ATTRIBUTE_ALIGN(16);
|
||||||
|
|
||||||
struct mDoDvdThd {
|
struct mDoDvdThd {
|
||||||
static s32 main(void*);
|
static s32 main(void*);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ struct JAISoundStatus_ {
|
|||||||
bool isMute() const { return field_0x0.flags.mute; }
|
bool isMute() const { return field_0x0.flags.mute; }
|
||||||
bool isPaused() const { return field_0x0.flags.paused; }
|
bool isPaused() const { return field_0x0.flags.paused; }
|
||||||
void pauseWhenOut() {
|
void pauseWhenOut() {
|
||||||
field_0x1.flags.flag3 = 1;
|
field_0x1.flags.mPauseWhenOut = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0x0 */ union {
|
/* 0x0 */ union {
|
||||||
@@ -120,9 +120,9 @@ struct JAISoundStatus_ {
|
|||||||
/* 0x1 */ union {
|
/* 0x1 */ union {
|
||||||
u8 value;
|
u8 value;
|
||||||
struct {
|
struct {
|
||||||
u8 flag1 : 1;
|
u8 mComesBack : 1;
|
||||||
u8 flag2 : 1;
|
u8 flag2 : 1;
|
||||||
u8 flag3 : 1;
|
u8 mPauseWhenOut : 1;
|
||||||
u8 flag4 : 1;
|
u8 flag4 : 1;
|
||||||
u8 flag5 : 1;
|
u8 flag5 : 1;
|
||||||
u8 flag6 : 1;
|
u8 flag6 : 1;
|
||||||
@@ -309,7 +309,7 @@ public:
|
|||||||
bool hasLifeTime() const { return status_.field_0x1.flags.flag2; }
|
bool hasLifeTime() const { return status_.field_0x1.flags.flag2; }
|
||||||
|
|
||||||
void removeLifeTime_() {
|
void removeLifeTime_() {
|
||||||
status_.field_0x1.flags.flag1 = false;
|
status_.field_0x1.flags.mComesBack = false;
|
||||||
status_.field_0x1.flags.flag2 = 0;
|
status_.field_0x1.flags.flag2 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ public:
|
|||||||
|
|
||||||
void setComesBack(bool param_0) {
|
void setComesBack(bool param_0) {
|
||||||
JUT_ASSERT(354, status_.state.flags.calcedOnce == 0);
|
JUT_ASSERT(354, status_.state.flags.calcedOnce == 0);
|
||||||
status_.field_0x1.flags.flag1 = 1;
|
status_.field_0x1.flags.mComesBack = 1;
|
||||||
if (param_0) {
|
if (param_0) {
|
||||||
status_.pauseWhenOut();
|
status_.pauseWhenOut();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,14 +9,14 @@
|
|||||||
*/
|
*/
|
||||||
struct JAISoundParamsProperty {
|
struct JAISoundParamsProperty {
|
||||||
void init() {
|
void init() {
|
||||||
field_0x0 = 1.0f;
|
mVolume = 1.0f;
|
||||||
field_0x4 = 0.0f;
|
mFxMix = 0.0f;
|
||||||
field_0x8 = 1.0f;
|
mPitch = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0x00 */ f32 field_0x0;
|
/* 0x00 */ f32 mVolume;
|
||||||
/* 0x04 */ f32 field_0x4;
|
/* 0x04 */ f32 mFxMix;
|
||||||
/* 0x08 */ f32 field_0x8;
|
/* 0x08 */ f32 mPitch;
|
||||||
}; // Size: 0xC
|
}; // Size: 0xC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,20 +14,20 @@ const int OSC_MAX = 2;
|
|||||||
*/
|
*/
|
||||||
struct JASInstParam : public JASSoundParams {
|
struct JASInstParam : public JASSoundParams {
|
||||||
JASInstParam() {
|
JASInstParam() {
|
||||||
field_0x14 = NULL;
|
mOscillators = NULL;
|
||||||
field_0x18 = 0;
|
mDirectRelease = 0;
|
||||||
field_0x1a = 0;
|
mWaveId = 0;
|
||||||
field_0x1c = 0;
|
mChannelType = 0;
|
||||||
field_0x1d = 0;
|
mOscillatorCount = 0;
|
||||||
field_0x1e = 0;
|
mDontSetKey = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
JASOscillator::Data** field_0x14;
|
JASOscillator::Data** mOscillators;
|
||||||
u16 field_0x18;
|
u16 mDirectRelease;
|
||||||
u16 field_0x1a;
|
u16 mWaveId;
|
||||||
u8 field_0x1c;
|
u8 mChannelType; // Always CHANNEL_WAVE in practice
|
||||||
u8 field_0x1d;
|
u8 mOscillatorCount;
|
||||||
u8 field_0x1e;
|
u8 mDontSetKey;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,10 +52,10 @@ struct JASBasicInst : public JASInst {
|
|||||||
void setHighKey(int key) { mHighKey = key; }
|
void setHighKey(int key) { mHighKey = key; }
|
||||||
|
|
||||||
/* 0x0 */ s32 mHighKey;
|
/* 0x0 */ s32 mHighKey;
|
||||||
/* 0x4 */ u16 field_0x4;
|
/* 0x4 */ u16 mWaveId;
|
||||||
/* 0x6 */ u16 field_0x6;
|
/* 0x6 */ u16 field_0x6;
|
||||||
/* 0x8 */ f32 field_0x8;
|
/* 0x8 */ f32 mVolumeMult;
|
||||||
/* 0xC */ f32 field_0xc;
|
/* 0xC */ f32 mPitchMult;
|
||||||
};
|
};
|
||||||
|
|
||||||
JASBasicInst();
|
JASBasicInst();
|
||||||
@@ -74,7 +74,7 @@ struct JASBasicInst : public JASInst {
|
|||||||
|
|
||||||
/* 0x04 */ f32 mVolume;
|
/* 0x04 */ f32 mVolume;
|
||||||
/* 0x08 */ f32 mPitch;
|
/* 0x08 */ f32 mPitch;
|
||||||
/* 0x0C */ JASOscillator::Data const* field_0xc[OSC_MAX];
|
/* 0x0C */ JASOscillator::Data const* mOscillators[OSC_MAX];
|
||||||
/* 0x10 */ u32 mKeymapCount;
|
/* 0x10 */ u32 mKeymapCount;
|
||||||
/* 0x14 */ TKeymap* mKeymap;
|
/* 0x14 */ TKeymap* mKeymap;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,21 +12,27 @@ struct JASBasicWaveBank : public JASWaveBank {
|
|||||||
struct TWaveHandle : public JASWaveHandle {
|
struct TWaveHandle : public JASWaveHandle {
|
||||||
TWaveHandle() { mHeap = NULL; }
|
TWaveHandle() { mHeap = NULL; }
|
||||||
virtual intptr_t getWavePtr() const;
|
virtual intptr_t getWavePtr() const;
|
||||||
virtual const JASWaveInfo* getWaveInfo() const { return &field_0x4; }
|
virtual const JASWaveInfo* getWaveInfo() const { return &mWaveInfo; }
|
||||||
|
#if TARGET_PC
|
||||||
|
/**
|
||||||
|
* @see JASChannel::mAramBaseAddress
|
||||||
|
*/
|
||||||
|
[[nodiscard]] void const* getAramBaseAddress() const override { return nullptr; }
|
||||||
|
#endif
|
||||||
bool compareHeap(JASHeap* heap) const { return mHeap == heap;}
|
bool compareHeap(JASHeap* heap) const { return mHeap == heap;}
|
||||||
|
|
||||||
/* 0x04 */ JASWaveInfo field_0x4;
|
/* 0x04 */ JASWaveInfo mWaveInfo;
|
||||||
/* 0x28 */ JASHeap* mHeap;
|
/* 0x28 */ JASHeap* mHeap;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TGroupWaveInfo {
|
struct TGroupWaveInfo {
|
||||||
TGroupWaveInfo() {
|
TGroupWaveInfo() {
|
||||||
field_0x0 = 0xffff;
|
waveId = 0xffff;
|
||||||
field_0x4 = -1;
|
mOffsetStart = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0x00 */ u16 field_0x0;
|
/* 0x00 */ u16 waveId;
|
||||||
/* 0x04 */ int field_0x4;
|
/* 0x04 */ int mOffsetStart;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TWaveGroup : JASWaveArc {
|
struct TWaveGroup : JASWaveArc {
|
||||||
@@ -44,7 +50,7 @@ struct JASBasicWaveBank : public JASWaveBank {
|
|||||||
u32 getWaveCount() const { return mWaveCount; }
|
u32 getWaveCount() const { return mWaveCount; }
|
||||||
};
|
};
|
||||||
|
|
||||||
JASBasicWaveBank();
|
JASBasicWaveBank(IF_DUSK(u32 bankId));
|
||||||
~JASBasicWaveBank();
|
~JASBasicWaveBank();
|
||||||
TWaveGroup* getWaveGroup(u32);
|
TWaveGroup* getWaveGroup(u32);
|
||||||
void setGroupCount(u32, JKRHeap*);
|
void setGroupCount(u32, JKRHeap*);
|
||||||
@@ -56,7 +62,7 @@ struct JASBasicWaveBank : public JASWaveBank {
|
|||||||
JASWaveArc* getWaveArc(u32 param_0) { return getWaveGroup(param_0); }
|
JASWaveArc* getWaveArc(u32 param_0) { return getWaveGroup(param_0); }
|
||||||
u32 getArcCount() const { return mGroupCount; }
|
u32 getArcCount() const { return mGroupCount; }
|
||||||
|
|
||||||
/* 0x04 */ OSMutex field_0x4;
|
/* 0x04 */ OSMutex mWaveTableMutex;
|
||||||
/* 0x1C */ TWaveHandle* mWaveTable;
|
/* 0x1C */ TWaveHandle* mWaveTable;
|
||||||
/* 0x20 */ TWaveGroup* mWaveGroupArray;
|
/* 0x20 */ TWaveGroup* mWaveGroupArray;
|
||||||
/* 0x24 */ u16 mHandleCount;
|
/* 0x24 */ u16 mHandleCount;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
#define JASCALC_H
|
#define JASCALC_H
|
||||||
|
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
#include <cstring>
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -11,31 +10,16 @@
|
|||||||
*/
|
*/
|
||||||
struct JASCalc {
|
struct JASCalc {
|
||||||
static void imixcopy(const s16*, const s16*, s16*, u32);
|
static void imixcopy(const s16*, const s16*, s16*, u32);
|
||||||
#if TARGET_PC
|
|
||||||
static void bcopyfast(const void* src, void* dest, u32 size) {
|
|
||||||
std::memcpy(dest, src, size);
|
|
||||||
}
|
|
||||||
#if TARGET_ANDROID
|
|
||||||
static void _bcopy(const void* src, void* dest, u32 size) {
|
|
||||||
#else
|
|
||||||
static void bcopy(const void* src, void* dest, u32 size) {
|
|
||||||
#endif
|
|
||||||
std::memcpy(dest, src, size);
|
|
||||||
}
|
|
||||||
static void bzerofast(void* dest, u32 size) {
|
|
||||||
std::memset(dest, 0, size);
|
|
||||||
}
|
|
||||||
#if TARGET_ANDROID
|
|
||||||
static void _bzero(void* dest, u32 size) {
|
|
||||||
#else
|
|
||||||
static void bzero(void* dest, u32 size) {
|
|
||||||
#endif
|
|
||||||
std::memset(dest, 0, size);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void bcopyfast(const void* src, void* dest, u32 size);
|
static void bcopyfast(const void* src, void* dest, u32 size);
|
||||||
|
#if TARGET_ANDROID
|
||||||
|
static void _bcopy(const void* src, void* dest, u32 size);
|
||||||
|
#else
|
||||||
static void bcopy(const void* src, void* dest, u32 size);
|
static void bcopy(const void* src, void* dest, u32 size);
|
||||||
|
#endif
|
||||||
static void bzerofast(void* dest, u32 size);
|
static void bzerofast(void* dest, u32 size);
|
||||||
|
#if TARGET_ANDROID
|
||||||
|
static void _bzero(void* dest, u32 size);
|
||||||
|
#else
|
||||||
static void bzero(void* dest, u32 size);
|
static void bzero(void* dest, u32 size);
|
||||||
#endif
|
#endif
|
||||||
static f32 pow2(f32);
|
static f32 pow2(f32);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "JSystem/JAudio2/JASWaveInfo.h"
|
#include "JSystem/JAudio2/JASWaveInfo.h"
|
||||||
#include "JSystem/JAudio2/JASDSPInterface.h"
|
#include "JSystem/JAudio2/JASDSPInterface.h"
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
struct JASDSPChannel;
|
struct JASDSPChannel;
|
||||||
|
|
||||||
@@ -15,6 +16,10 @@ namespace JASDsp {
|
|||||||
struct TChannel;
|
struct TChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
#include "JSystem/JAudio2/JASSampleDataReference.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup jsystem-jaudio
|
* @ingroup jsystem-jaudio
|
||||||
*
|
*
|
||||||
@@ -159,13 +164,30 @@ public:
|
|||||||
struct {
|
struct {
|
||||||
u32 mChannelType; // CHANNEL_WAVE or CHANNEL_OSCILLATOR
|
u32 mChannelType; // CHANNEL_WAVE or CHANNEL_OSCILLATOR
|
||||||
JASWaveInfo mWaveInfo;
|
JASWaveInfo mWaveInfo;
|
||||||
} field_0xdc;
|
} mAnon;
|
||||||
union {
|
union {
|
||||||
u32 mWaveAramAddress;
|
u32 mWaveAramAddress;
|
||||||
u32 mOscillatorSomething;
|
u32 mOscillatorSomething;
|
||||||
u32 field_0x104;
|
u32 field_0x104;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
/**
|
||||||
|
* Memory address at which this sound effect should consider ARAM to start.
|
||||||
|
*
|
||||||
|
* By changing this, sound effects can effectively be played back from anywhere in memory,
|
||||||
|
* rather than just the emulated ARAM space.
|
||||||
|
*
|
||||||
|
* If nullptr, the regular emulated ARAM is used.
|
||||||
|
*/
|
||||||
|
void const* mAramBaseAddress;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see JASSampleDataReference
|
||||||
|
*/
|
||||||
|
std::unique_ptr<JASSampleDataReference> mSampleReference;
|
||||||
|
#endif
|
||||||
|
|
||||||
static DUSK_GAME_DATA OSMessageQueue sBankDisposeMsgQ;
|
static DUSK_GAME_DATA OSMessageQueue sBankDisposeMsgQ;
|
||||||
static DUSK_GAME_DATA OSMessage sBankDisposeMsg[16];
|
static DUSK_GAME_DATA OSMessage sBankDisposeMsg[16];
|
||||||
static DUSK_GAME_DATA OSMessage sBankDisposeList[16];
|
static DUSK_GAME_DATA OSMessage sBankDisposeList[16];
|
||||||
|
|||||||
@@ -109,7 +109,9 @@ namespace JASDsp {
|
|||||||
* Pitch shift via changing playback speed.
|
* Pitch shift via changing playback speed.
|
||||||
*/
|
*/
|
||||||
/* 0x004 */ u16 mPitch;
|
/* 0x004 */ u16 mPitch;
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x006 */ short _unused1;
|
/* 0x006 */ short _unused1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to 1 when playback starts, cleared by DSP later,
|
* Set to 1 when playback starts, cleared by DSP later,
|
||||||
@@ -118,19 +120,27 @@ namespace JASDsp {
|
|||||||
* (Corroborated by fields JASAramStream checks never being cleared explicitly by CPU.)
|
* (Corroborated by fields JASAramStream checks never being cleared explicitly by CPU.)
|
||||||
*/
|
*/
|
||||||
/* 0x008 */ u16 mResetFlag;
|
/* 0x008 */ u16 mResetFlag;
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x00A */ u8 _unused2[0x00C - 0x00A];
|
/* 0x00A */ u8 _unused2[0x00C - 0x00A];
|
||||||
|
#endif
|
||||||
/* 0x00C */ s16 mPauseFlag;
|
/* 0x00C */ s16 mPauseFlag;
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x00E */ short _unused3;
|
/* 0x00E */ short _unused3;
|
||||||
|
#endif
|
||||||
/* 0x010 */ OutputChannelConfig mOutputChannels[DSP_OUTPUT_CHANNELS];
|
/* 0x010 */ OutputChannelConfig mOutputChannels[DSP_OUTPUT_CHANNELS];
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x040 */ u8 _unused4[0x050 - 0x040];
|
/* 0x040 */ u8 _unused4[0x050 - 0x040];
|
||||||
|
#endif
|
||||||
/* 0x050 */ u16 mAutoMixerPanDolby; // pan is upper 8 bits, dolby lower 8.
|
/* 0x050 */ u16 mAutoMixerPanDolby; // pan is upper 8 bits, dolby lower 8.
|
||||||
/* 0x052 */ u16 mAutoMixerFxMix;
|
/* 0x052 */ u16 mAutoMixerFxMix;
|
||||||
/* 0x054 */ u16 mAutoMixerInitVolume;
|
/* 0x054 */ u16 mAutoMixerInitVolume;
|
||||||
/* 0x056 */ u16 mAutoMixerVolume;
|
/* 0x056 */ u16 mAutoMixerVolume;
|
||||||
/* 0x058 */ u16 mAutoMixerBeenSet;
|
/* 0x058 */ u16 mAutoMixerBeenSet;
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x05A */ u8 _unused5[0x060 - 0x05A];
|
/* 0x05A */ u8 _unused5[0x060 - 0x05A];
|
||||||
/* 0x060 */ short field_0x060; // Only cleared to zero, presumed used by DSP.
|
/* 0x060 */ short field_0x060; // Only cleared to zero, presumed used by DSP.
|
||||||
/* 0x062 */ u8 _unused6[0x064 - 0x062];
|
/* 0x062 */ u8 _unused6[0x064 - 0x062];
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Samples per ADPCM frame for ADPCM audio. Seems just set to 1 for PCM formats.
|
* Samples per ADPCM frame for ADPCM audio. Seems just set to 1 for PCM formats.
|
||||||
@@ -139,7 +149,9 @@ namespace JASDsp {
|
|||||||
/* 0x064 */ u16 mSamplesPerBlock;
|
/* 0x064 */ u16 mSamplesPerBlock;
|
||||||
/* 0x066 */ short field_0x066; // Only cleared to zero, presumed used by DSP.
|
/* 0x066 */ short field_0x066; // Only cleared to zero, presumed used by DSP.
|
||||||
/* 0x068 */ u32 mSamplePosition; // Only ever initialized by code, name is guess.
|
/* 0x068 */ u32 mSamplePosition; // Only ever initialized by code, name is guess.
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x06C */ u8 _unused7[0x070 - 0x06C];
|
/* 0x06C */ u8 _unused7[0x070 - 0x06C];
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current audio read position in ARAM. Updated by DSP.
|
* Current audio read position in ARAM. Updated by DSP.
|
||||||
@@ -151,11 +163,13 @@ namespace JASDsp {
|
|||||||
* Gets written by DSP, but also CPU.
|
* Gets written by DSP, but also CPU.
|
||||||
*/
|
*/
|
||||||
/* 0x074 */ u32 mSamplesLeft; // Never directly cleared to zero. Seems sus. Cleared by DSP?
|
/* 0x074 */ u32 mSamplesLeft; // Never directly cleared to zero. Seems sus. Cleared by DSP?
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x078 */ short field_0x078[4]; // Only cleared to zero, presumed used by DSP.
|
/* 0x078 */ short field_0x078[4]; // Only cleared to zero, presumed used by DSP.
|
||||||
/* 0x080 */ short field_0x080[20]; // Only cleared to zero, presumed used by DSP.
|
/* 0x080 */ short field_0x080[20]; // Only cleared to zero, presumed used by DSP.
|
||||||
/* 0x0A8 */ short field_0x0a8[4]; // Only cleared to zero, presumed used by DSP.
|
/* 0x0A8 */ short field_0x0a8[4]; // Only cleared to zero, presumed used by DSP.
|
||||||
/* 0x0B0 */ u16 field_0x0b0[16]; // Only cleared to zero, presumed used by DSP.
|
/* 0x0B0 */ u16 field_0x0b0[16]; // Only cleared to zero, presumed used by DSP.
|
||||||
/* 0x0D0 */ u8 _unused8[0x100 - 0x0D0];
|
/* 0x0D0 */ u8 _unused8[0x100 - 0x0D0];
|
||||||
|
#endif
|
||||||
/* 0x100 */ u16 mBytesPerBlock;
|
/* 0x100 */ u16 mBytesPerBlock;
|
||||||
/* 0x102 */ u16 mLoopFlag;
|
/* 0x102 */ u16 mLoopFlag;
|
||||||
|
|
||||||
@@ -176,9 +190,26 @@ namespace JASDsp {
|
|||||||
/* 0x118 */ u32 mWaveAramAddress;
|
/* 0x118 */ u32 mWaveAramAddress;
|
||||||
/* 0x11C */ int mSampleCount;
|
/* 0x11C */ int mSampleCount;
|
||||||
/* 0x120 */ s16 fir_filter_params[8];
|
/* 0x120 */ s16 fir_filter_params[8];
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x130 */ u8 _unused9[0x148 - 0x130];
|
/* 0x130 */ u8 _unused9[0x148 - 0x130];
|
||||||
|
#endif
|
||||||
/* 0x148 */ s16 iir_filter_params[8];
|
/* 0x148 */ s16 iir_filter_params[8];
|
||||||
|
#if !TARGET_PC
|
||||||
/* 0x158 */ u8 _unused10[0x180 - 0x158];
|
/* 0x158 */ u8 _unused10[0x180 - 0x158];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
/**
|
||||||
|
* Memory address at which this sound effect should consider ARAM to start.
|
||||||
|
* This means fields like mWaveAramAddress will be relative to this pointer instead.
|
||||||
|
*
|
||||||
|
* By changing this, sound effects can effectively be played back from anywhere in memory,
|
||||||
|
* rather than just the emulated ARAM space.
|
||||||
|
*
|
||||||
|
* If nullptr, the regular emulated ARAM is used.
|
||||||
|
*/
|
||||||
|
void const* mAramBaseAddress;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
void boot(void (*)(void*));
|
void boot(void (*)(void*));
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ struct JASDrumSet : public JASInst {
|
|||||||
/* 0x00 */ f32 mVolume;
|
/* 0x00 */ f32 mVolume;
|
||||||
/* 0x04 */ f32 mPitch;
|
/* 0x04 */ f32 mPitch;
|
||||||
/* 0x08 */ f32 mPan;
|
/* 0x08 */ f32 mPan;
|
||||||
/* 0x0C */ u16 field_0xc;
|
/* 0x0C */ u16 mDirectRelease;
|
||||||
/* 0x0E */ u16 field_0xe;
|
/* 0x0E */ u16 mWaveId;
|
||||||
/* 0x10 */ f32 field_0x10;
|
/* 0x10 */ f32 mVolumeMult;
|
||||||
/* 0x14 */ f32 field_0x14;
|
/* 0x14 */ f32 mPitchMult;
|
||||||
};
|
};
|
||||||
|
|
||||||
JASDrumSet();
|
JASDrumSet();
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef DUSKLIGHT_JASSAMPLEDATAREFERENCE_H
|
||||||
|
#define DUSKLIGHT_JASSAMPLEDATAREFERENCE_H
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
/**
|
||||||
|
* An object to manage the lifetime of the sample data pointed to by JASChannel.
|
||||||
|
*
|
||||||
|
* JASChannel can (optionally) accept an unique_ptr to an object to this type,
|
||||||
|
* in which case it will be destroyed when the JASChannel is done.
|
||||||
|
*
|
||||||
|
* @see JASChannel::mSampleReference
|
||||||
|
*/
|
||||||
|
struct JASSampleDataReference {
|
||||||
|
virtual ~JASSampleDataReference() = default;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // DUSKLIGHT_JASSAMPLEDATAREFERENCE_H
|
||||||
@@ -10,12 +10,18 @@ struct JASSimpleWaveBank : JASWaveBank, JASWaveArc {
|
|||||||
intptr_t getWavePtr() const;
|
intptr_t getWavePtr() const;
|
||||||
TWaveHandle();
|
TWaveHandle();
|
||||||
const JASWaveInfo* getWaveInfo() const;
|
const JASWaveInfo* getWaveInfo() const;
|
||||||
|
#if TARGET_PC
|
||||||
|
/**
|
||||||
|
* @see JASChannel::mAramBaseAddress
|
||||||
|
*/
|
||||||
|
[[nodiscard]] void const* getAramBaseAddress() const override { return nullptr; }
|
||||||
|
#endif
|
||||||
|
|
||||||
/* 0x04 */ JASWaveInfo mWaveInfo;
|
/* 0x04 */ JASWaveInfo mWaveInfo;
|
||||||
/* 0x28 */ JASHeap* mHeap;
|
/* 0x28 */ JASHeap* mHeap;
|
||||||
};
|
};
|
||||||
|
|
||||||
JASSimpleWaveBank();
|
JASSimpleWaveBank(IF_DUSK(u32 bankId));
|
||||||
~JASSimpleWaveBank();
|
~JASSimpleWaveBank();
|
||||||
void setWaveTableSize(u32, JKRHeap*);
|
void setWaveTableSize(u32, JKRHeap*);
|
||||||
JASWaveHandle* getWaveHandle(u32) const;
|
JASWaveHandle* getWaveHandle(u32) const;
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TCtrlWave {
|
struct TCtrlWave {
|
||||||
/* 0x0 */ BE(u32) _00;
|
// Wave ID in lower half.
|
||||||
|
// Upper bits appear to be group ID, which is unused by the game code.
|
||||||
|
/* 0x0 */ BE(u32) mWaveAndGroupId;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TWave {
|
struct TWave {
|
||||||
@@ -57,13 +59,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct TCtrl {
|
struct TCtrl {
|
||||||
/* 0x0 */ u8 _00[4];
|
/* 0x0 */ BE(u32) mMagic; // 'C-DF'.
|
||||||
/* 0x4 */ BE(u32) mWaveCount;
|
/* 0x4 */ BE(u32) mWaveCount;
|
||||||
/* 0x8 */ TOffset<TCtrlWave> mCtrlWaveOffsets[0];
|
/* 0x8 */ TOffset<TCtrlWave> mCtrlWaveOffsets[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TCtrlScene {
|
struct TCtrlScene {
|
||||||
/* 0x0 */ u8 _00[0xC];
|
/* 0x0 */ BE(u32) mMagic; // 'SCNE'
|
||||||
|
/* 0x4 */ u8 _00[0x8];
|
||||||
/* 0xC */ TOffset<TCtrl> mCtrlOffset;
|
/* 0xC */ TOffset<TCtrl> mCtrlOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ struct JASWaveArc : JASDisposer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* 0x04 */ mutable JASHeap mHeap;
|
/* 0x04 */ mutable JASHeap mHeap;
|
||||||
/* 0x48 */ u32 _48;
|
/* 0x48 */ u32 mCurrentlyLoaded;
|
||||||
/* 0x4C */ volatile s32 mStatus;
|
/* 0x4C */ volatile s32 mStatus;
|
||||||
/* 0x50 */ int mEntryNum;
|
/* 0x50 */ int mEntryNum;
|
||||||
/* 0x54 */ u32 mFileLength;
|
/* 0x54 */ u32 mFileLength;
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
#define JASWAVEINFO_H
|
#define JASWAVEINFO_H
|
||||||
|
|
||||||
#include <types.h>
|
#include <types.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#if TARGET_PC
|
||||||
|
#include "JSystem/JAudio2/JASSampleDataReference.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
struct JASWaveArc;
|
struct JASWaveArc;
|
||||||
|
|
||||||
@@ -17,7 +22,7 @@ struct JASWaveArc;
|
|||||||
struct JASWaveInfo {
|
struct JASWaveInfo {
|
||||||
JASWaveInfo() {
|
JASWaveInfo() {
|
||||||
mBaseKey = 0x3c;
|
mBaseKey = 0x3c;
|
||||||
field_0x20 = &one;
|
mpLoaded = &one;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 0x00 */ u8 mWaveFormat;
|
/* 0x00 */ u8 mWaveFormat;
|
||||||
@@ -31,7 +36,7 @@ struct JASWaveInfo {
|
|||||||
/* 0x18 */ int mSampleCount;
|
/* 0x18 */ int mSampleCount;
|
||||||
/* 0x1C */ s16 mpLast;
|
/* 0x1C */ s16 mpLast;
|
||||||
/* 0x1E */ s16 mpPenult;
|
/* 0x1E */ s16 mpPenult;
|
||||||
/* 0x20 */ const u32* field_0x20;
|
/* 0x20 */ const u32* mpLoaded;
|
||||||
|
|
||||||
static DUSK_GAME_DATA u32 one;
|
static DUSK_GAME_DATA u32 one;
|
||||||
};
|
};
|
||||||
@@ -45,6 +50,17 @@ public:
|
|||||||
virtual ~JASWaveHandle() {}
|
virtual ~JASWaveHandle() {}
|
||||||
virtual const JASWaveInfo* getWaveInfo() const = 0;
|
virtual const JASWaveInfo* getWaveInfo() const = 0;
|
||||||
virtual intptr_t getWavePtr() const = 0;
|
virtual intptr_t getWavePtr() const = 0;
|
||||||
|
#if TARGET_PC
|
||||||
|
/**
|
||||||
|
* @see JASChannel::mAramBaseAddress
|
||||||
|
*/
|
||||||
|
[[nodiscard]] virtual void const* getAramBaseAddress() const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a @ref JASSampleDataReference to keep the sample data for this wave alive.
|
||||||
|
*/
|
||||||
|
[[nodiscard]] virtual std::unique_ptr<JASSampleDataReference> getSampleReference() const { return nullptr; }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,6 +69,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
class JASWaveBank {
|
class JASWaveBank {
|
||||||
public:
|
public:
|
||||||
|
#if TARGET_PC
|
||||||
|
const u32 bankId;
|
||||||
|
|
||||||
|
JASWaveBank(u32 bankId) : bankId(bankId) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
virtual ~JASWaveBank() {}
|
virtual ~JASWaveBank() {}
|
||||||
virtual JASWaveHandle* getWaveHandle(u32) const = 0;
|
virtual JASWaveHandle* getWaveHandle(u32) const = 0;
|
||||||
virtual JASWaveArc* getWaveArc(u32) = 0;
|
virtual JASWaveArc* getWaveArc(u32) = 0;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
*/
|
*/
|
||||||
struct JAUAudibleParam {
|
struct JAUAudibleParam {
|
||||||
f32 getDopplerPower() const {
|
f32 getDopplerPower() const {
|
||||||
return field_0x0.bytes.b0_0 * (1.0f / 15.0f);
|
return field_0x0.bytes.mDopplerPower * (1.0f / 15.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
union {
|
union {
|
||||||
@@ -19,14 +19,18 @@ struct JAUAudibleParam {
|
|||||||
BE(u16) f1;
|
BE(u16) f1;
|
||||||
} half;
|
} half;
|
||||||
struct {
|
struct {
|
||||||
u8 b0_0 : 4;
|
u8 mDopplerPower : 4;
|
||||||
u8 b0_4 : 1;
|
u8 mCalculatePriority : 1;
|
||||||
u8 b0_5 : 1;
|
u8 mCalcDistanceVolume : 1;
|
||||||
u8 b0_6 : 1;
|
u8 mCalcFxMix : 1;
|
||||||
u8 b0_7 : 1;
|
u8 mCullAtMaxDistance : 1;
|
||||||
u8 b1_0 : 1;
|
u8 mCalcPan : 1;
|
||||||
u8 b1_1 : 1;
|
u8 mCalcDolby : 1;
|
||||||
u8 b1_2_7 : 6;
|
/**
|
||||||
|
* Most bits in this field are unused, 8 indicates clamping of volume
|
||||||
|
* to ensure it doesn't go below 0.2 in mixChannelOut()
|
||||||
|
*/
|
||||||
|
u8 mClampMinVolume : 6;
|
||||||
u8 b2;
|
u8 b2;
|
||||||
u8 b3;
|
u8 b3;
|
||||||
} bytes;
|
} bytes;
|
||||||
|
|||||||
@@ -5,16 +5,162 @@
|
|||||||
#include "JSystem/JAudio2/JASGadget.h"
|
#include "JSystem/JAudio2/JASGadget.h"
|
||||||
#include "helpers/endian.h"
|
#include "helpers/endian.h"
|
||||||
|
|
||||||
|
// Constants for TypeIDs of JAUSoundTable entries.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used as a test to see if the type ID is valid. All other type IDs contain this bit.
|
||||||
|
*/
|
||||||
|
#define SOUND_TYPEID_VALID 0x40
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sound is a sound effect.
|
||||||
|
*/
|
||||||
|
#define SOUND_TYPEID_SOUND_EFFECT 0x51
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sound is a music sequence.
|
||||||
|
*/
|
||||||
|
#define SOUND_TYPEID_SEQUENCE 0x60
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sound is a streamed music file.
|
||||||
|
*/
|
||||||
|
#define SOUND_TYPEID_STREAM 0x70
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sound is a streamed music file. Unsure of difference from SOUND_TYPEID_STREAM
|
||||||
|
*/
|
||||||
|
#define SOUND_TYPEID_STREAM_ALT 0x71
|
||||||
|
|
||||||
|
//
|
||||||
|
// Values for mSwBit on sound effect items.
|
||||||
|
//
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sound is always calculated as max priority (0).
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_ALWAYS_MAX_PRIORITY 0x0000'0001
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Don't calculate volume by distance.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_IGNORE_DISTANCE_VOL 0x0000'0002
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Don't calculate FX mix (reverb) by distance.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_IGNORE_FX_MIX 0x0000'0004
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset to shift to access @see SOUND_SW_RANDOM_PITCH_MASK
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_RANDOM_PITCH_OFFSET 4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4-bit value (0-15) to control the power of pitch randomization on sound playback.
|
||||||
|
* Code acts different for values above 8, not sure what the exact implication is.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_RANDOM_PITCH_MASK 0x0000'00F0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset to shift to access @see SOUND_SW_DOPPLER_POWER_MASK
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_DOPPLER_POWER_OFFSET 8
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4-bit value (0-15) to scale the power of the Doppler effect for this sound.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_DOPPLER_POWER_MASK 0x0000'0F00
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Don't calculate panning (left/right) values for this sound.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_IGNORE_PAN 0x0000'1000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Don't calculate Dolby (behind/front) values for this sound.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_IGNORE_DOLBY 0x0000'2000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3-bit mask used to select a volume distance/falloff class for this sound.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_VOL_DIST_BIT_MASK 0x0007'0000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Limit minimum volume of this sound (after distance falloff) to 0.2.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_CLAMP_MIN_VOLUME 0x0008'0000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3-bit mask used to select a *different* volume distance/falloff class for this sound.
|
||||||
|
* @see SOUND_SW_VOL_DIST_BIT_MASK must be zero for this to work.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_VOL_DIST_BIT_2_MASK 0x0070'0000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark sound as "far away" or "culled" when at max distance (selected by distance class).
|
||||||
|
* This affects a bunch of stuff like culling, automatic stopping, priorities, etc.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_CULL_AT_MAX_DISTANCE 0x0080'0000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not sure what this does.
|
||||||
|
* Something causing volume/pan/dolby adjustment in Z2Audible::setOuterParams?
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_VOL_SOMETHING_MASK 0x0F00'0000
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Offset to shift to access @see SOUND_SW_RANDOM_VOLUME_MASK
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_RANDOM_VOLUME_OFFSET 28
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4-bit value (0-15) to control the power of volume randomization on sound playback.
|
||||||
|
*/
|
||||||
|
#define SOUND_SW_RANDOM_VOLUME_MASK 0xF000'0000
|
||||||
|
|
||||||
|
#define SOUND_VOL_DIST_BIT_MASK_SHIFTED (SOUND_SW_VOL_DIST_BIT_MASK >> 16)
|
||||||
|
#define SOUND_VOL_DIST_BIT_2_MASK_SHIFTED (SOUND_SW_VOL_DIST_BIT_2_MASK >> 16)
|
||||||
|
#define SOUND_VOL_SOMETHING_MASK_SHIFTED (SOUND_SW_VOL_SOMETHING_MASK >> 16)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup jsystem-jaudio
|
* @ingroup jsystem-jaudio
|
||||||
*
|
* A single entry in the sound table.
|
||||||
|
* Fields are interpreted differently depending on the type ID of the entry,
|
||||||
|
* which is not stored in this struct.
|
||||||
*/
|
*/
|
||||||
struct JAUSoundTableItem {
|
struct JAUSoundTableItem {
|
||||||
u8 mPriority;
|
u8 mPriority;
|
||||||
u8 field_0x1;
|
u8 mVolume;
|
||||||
BE(u16) mResourceId;
|
union {
|
||||||
BE(u32) field_0x4;
|
/**
|
||||||
BE(f32) field_0x8;
|
* For music sequences: the resource ID of the sequence.
|
||||||
|
*/
|
||||||
|
BE(u16) mResourceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For streamed music: bitpacked channel configuration.
|
||||||
|
*/
|
||||||
|
BE(u16) mStreamPanParameters;
|
||||||
|
};
|
||||||
|
union {
|
||||||
|
/**
|
||||||
|
* For sound effects: bitpacked field controlling a *bunch* of audio parameters.
|
||||||
|
*/
|
||||||
|
BE(u32) mSwBit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For streamed music: offset (relative to start of BST)
|
||||||
|
* to null-terminated string containing music file path.
|
||||||
|
*/
|
||||||
|
BE(u32) mStreamFilePath;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For sound effects: pitch multiplier.
|
||||||
|
*/
|
||||||
|
BE(f32) mPitch;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,23 +170,25 @@ struct JAUSoundTableItem {
|
|||||||
template<typename Root, typename Section, typename Group, typename Typename_0>
|
template<typename Root, typename Section, typename Group, typename Typename_0>
|
||||||
struct JAUSoundTable_ {
|
struct JAUSoundTable_ {
|
||||||
JAUSoundTable_() {
|
JAUSoundTable_() {
|
||||||
field_0x0 = NULL;
|
mData = NULL;
|
||||||
field_0x4 = 0;
|
mRoot = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
field_0x0 = NULL;
|
mData = NULL;
|
||||||
field_0x4 = NULL;
|
mRoot = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init(const void* param_0) {
|
void init(const void* dataStart) {
|
||||||
field_0x0 = param_0;
|
mData = dataStart;
|
||||||
// magic number is not in debug rom. I'm not sure what this comparison is (maybe some sort of '' number?)
|
// magic number is not in debug rom. I'm not sure what this comparison is (maybe some sort of '' number?)
|
||||||
// I also do not know how it is different between JAUSoundTable and JAUSoundNameTable
|
// I also do not know how it is different between JAUSoundTable and JAUSoundNameTable
|
||||||
if (*(BE(u32)*)field_0x0 + 0xbdad0000 != Root::magicNumber()) {
|
// Future person here: This is checking for either "BST " or "BSTN", with the second two letters in Root::magicNumber().
|
||||||
field_0x0 = NULL;
|
// Idk why the operations here are all weird but I can't use objdiff right now.
|
||||||
|
if (*(BE(u32)*)mData + 0xbdad0000 != Root::magicNumber()) {
|
||||||
|
mData = NULL;
|
||||||
} else {
|
} else {
|
||||||
field_0x4 = (Root*)((u8*)field_0x0 + *((BE(u32)*)field_0x0 + 3));
|
mRoot = (Root*)((u8*)mData + *((BE(u32)*)mData + 3));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,34 +196,34 @@ struct JAUSoundTable_ {
|
|||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((u32)index >= field_0x4->mSectionNumber) {
|
if ((u32)index >= mRoot->mSectionNumber) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
u32 offset = field_0x4->mSectionOffsets[index];
|
u32 offset = mRoot->mSectionOffsets[index];
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (Section*)((u8*)field_0x0 + offset);
|
return (Section*)((u8*)mData + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
Group* getGroup(Section* param_1, int index) const {
|
Group* getGroup(Section* section, int index) const {
|
||||||
int iVar1;
|
int iVar1;
|
||||||
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if ((u32)index >= param_1->mNumGroups) {
|
if ((u32)index >= section->mNumGroups) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
u32 offset = param_1->getGroupOffset(index);
|
u32 offset = section->getGroupOffset(index);
|
||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (Group*)((u8*)field_0x0 + offset);
|
return (Group*)((u8*)mData + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void* field_0x0;
|
const void* mData;
|
||||||
Root* field_0x4;
|
Root* mRoot;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,7 +231,7 @@ struct JAUSoundTable_ {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct JAUSoundTableRoot {
|
struct JAUSoundTableRoot {
|
||||||
static inline u32 magicNumber() { return 0x5420; }
|
static inline u32 magicNumber() { return 'T '; } // Second half of "BST "
|
||||||
BE(u32) mSectionNumber;
|
BE(u32) mSectionNumber;
|
||||||
BE(u32) mSectionOffsets[0];
|
BE(u32) mSectionOffsets[0];
|
||||||
};
|
};
|
||||||
@@ -134,7 +282,7 @@ struct JAUSoundTableGroup {
|
|||||||
|
|
||||||
BE(u32) mNumItems;
|
BE(u32) mNumItems;
|
||||||
BE(u32) field_0x4;
|
BE(u32) field_0x4;
|
||||||
u8 mTypeIds[0];
|
u8 mTypeIds[0]; // TODO: Should probably be BE(u32), but I can't objdiff rn.
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -142,7 +290,7 @@ struct JAUSoundTableGroup {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> {
|
struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> {
|
||||||
JAUSoundTable(bool param_0) : JASGlobalInstance<JAUSoundTable>(param_0) {
|
JAUSoundTable(bool setInstance) : JASGlobalInstance<JAUSoundTable>(setInstance) {
|
||||||
}
|
}
|
||||||
~JAUSoundTable() {}
|
~JAUSoundTable() {}
|
||||||
|
|
||||||
@@ -157,11 +305,11 @@ struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> {
|
|||||||
if (offset == 0) {
|
if (offset == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return (JAUSoundTableItem*)((u8*)field_0x0.field_0x0 + offset);
|
return (JAUSoundTableItem*)((u8*)field_0x0.mData + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void* getResource() const { return field_0x0.field_0x0; }
|
const void* getResource() const { return field_0x0.mData; }
|
||||||
bool isValid() const { return field_0x0.field_0x0 != NULL; }
|
bool isValid() const { return field_0x0.mData != NULL; }
|
||||||
|
|
||||||
JAUSoundTable_<JAUSoundTableRoot,JAUSoundTableSection,JAUSoundTableGroup,void> field_0x0;
|
JAUSoundTable_<JAUSoundTableRoot,JAUSoundTableSection,JAUSoundTableGroup,void> field_0x0;
|
||||||
};
|
};
|
||||||
@@ -171,7 +319,7 @@ struct JAUSoundTable : public JASGlobalInstance<JAUSoundTable> {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct JAUSoundNameTableRoot {
|
struct JAUSoundNameTableRoot {
|
||||||
static inline u32 magicNumber() { return 0x544e; }
|
static inline u32 magicNumber() { return 'TN'; } // Second half of "BSTN"
|
||||||
BE(u32) mSectionNumber;
|
BE(u32) mSectionNumber;
|
||||||
BE(u32) mSectionOffsets[0];
|
BE(u32) mSectionOffsets[0];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ DUSK_GAME_DATA Vec J3DSys::mParentS;
|
|||||||
DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8];
|
DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8];
|
||||||
|
|
||||||
#if TARGET_PC // Original game bug, array is too small.
|
#if TARGET_PC // Original game bug, array is too small.
|
||||||
ATTRIBUTE_ALIGN(32) static u8 NullTexData[0x20] = {0};
|
static u8 NullTexData[0x20] ATTRIBUTE_ALIGN(32) = {0};
|
||||||
#else
|
#else
|
||||||
ATTRIBUTE_ALIGN(32) static u8 NullTexData[0x10] = {0};
|
static u8 NullTexData[0x10] ATTRIBUTE_ALIGN(32) = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static Mtx j3dIdentityMtx = {
|
static Mtx j3dIdentityMtx = {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void JAISe::JAISeCategoryMgr_mixOut_(bool param_0, const JASSoundParams& params,
|
|||||||
if (inner_.field_0x26c) {
|
if (inner_.field_0x26c) {
|
||||||
switch (inner_.track.getStatus()) {
|
switch (inner_.track.getStatus()) {
|
||||||
case JASTrack::STATUS_STOPPED:
|
case JASTrack::STATUS_STOPPED:
|
||||||
if (status_.field_0x1.flags.flag1) {
|
if (status_.field_0x1.flags.mComesBack) {
|
||||||
startTrack_(params);
|
startTrack_(params);
|
||||||
} else {
|
} else {
|
||||||
stop_JAISound_();
|
stop_JAISound_();
|
||||||
@@ -84,8 +84,8 @@ void JAISe::JAISeCategoryMgr_mixOut_(bool param_0, const JASSoundParams& params,
|
|||||||
startTrack_(params);
|
startTrack_(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (status_.field_0x1.flags.flag1) {
|
} else if (status_.field_0x1.flags.mComesBack) {
|
||||||
if (status_.field_0x1.flags.flag3) {
|
if (status_.field_0x1.flags.mPauseWhenOut) {
|
||||||
inner_.track.pause(true);
|
inner_.track.pause(true);
|
||||||
} else {
|
} else {
|
||||||
stopTrack_();
|
stopTrack_();
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ JAISeMgr::JAISeMgr(bool setInstance) : JASGlobalInstance<JAISeMgr>(setInstance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool JAISeMgr::isUsingSeqData(const JAISeqDataRegion& seqDataRegion) {
|
bool JAISeMgr::isUsingSeqData(const JAISeqDataRegion& seqDataRegion) {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
if (mCategoryMgrs[i].JAISeCategoryMgr::isUsingSeqData(seqDataRegion)) {
|
if (mCategoryMgrs[i].JAISeCategoryMgr::isUsingSeqData(seqDataRegion)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -177,7 +177,7 @@ bool JAISeMgr::isUsingSeqData(const JAISeqDataRegion& seqDataRegion) {
|
|||||||
|
|
||||||
int JAISeMgr::releaseSeqData(const JAISeqDataRegion& seqDataRegion) {
|
int JAISeMgr::releaseSeqData(const JAISeqDataRegion& seqDataRegion) {
|
||||||
bool r30 = 0;
|
bool r30 = 0;
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
switch (mCategoryMgrs[i].JAISeCategoryMgr::releaseSeqData(seqDataRegion)) {
|
switch (mCategoryMgrs[i].JAISeCategoryMgr::releaseSeqData(seqDataRegion)) {
|
||||||
case 0:
|
case 0:
|
||||||
return 0;
|
return 0;
|
||||||
@@ -191,14 +191,14 @@ int JAISeMgr::releaseSeqData(const JAISeqDataRegion& seqDataRegion) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JAISeMgr::setCategoryArrangement(const JAISeCategoryArrangement& arrangement) {
|
void JAISeMgr::setCategoryArrangement(const JAISeCategoryArrangement& arrangement) {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].setMaxActiveSe(arrangement.mItems[i].mMaxActiveSe);
|
mCategoryMgrs[i].setMaxActiveSe(arrangement.mItems[i].mMaxActiveSe);
|
||||||
mCategoryMgrs[i].setMaxInactiveSe(arrangement.mItems[i].mMaxInactiveSe);
|
mCategoryMgrs[i].setMaxInactiveSe(arrangement.mItems[i].mMaxInactiveSe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JAISeMgr::getCategoryArrangement(JAISeCategoryArrangement* arrangement) {
|
void JAISeMgr::getCategoryArrangement(JAISeCategoryArrangement* arrangement) {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
int active = mCategoryMgrs[i].getMaxActiveSe();
|
int active = mCategoryMgrs[i].getMaxActiveSe();
|
||||||
JUT_ASSERT(299, active <= 255);
|
JUT_ASSERT(299, active <= 255);
|
||||||
arrangement->mItems[i].mMaxActiveSe = active;
|
arrangement->mItems[i].mMaxActiveSe = active;
|
||||||
@@ -209,19 +209,19 @@ void JAISeMgr::getCategoryArrangement(JAISeCategoryArrangement* arrangement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JAISeMgr::stop() {
|
void JAISeMgr::stop() {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].stop();
|
mCategoryMgrs[i].stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JAISeMgr::stopSoundID(JAISoundID id) {
|
void JAISeMgr::stopSoundID(JAISoundID id) {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].stopSoundID(id);
|
mCategoryMgrs[i].stopSoundID(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JAISeMgr::initParams() {
|
void JAISeMgr::initParams() {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].getParams()->init();
|
mCategoryMgrs[i].getParams()->init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,16 +270,16 @@ JAISe* JAISeMgr::newSe_(int category, u32 priority) {
|
|||||||
|
|
||||||
void JAISeMgr::calc() {
|
void JAISeMgr::calc() {
|
||||||
mParams.calc();
|
mParams.calc();
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].JAISeMgr_calc_();
|
mCategoryMgrs[i].JAISeMgr_calc_();
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].JAISeMgr_freeDeadSe_();
|
mCategoryMgrs[i].JAISeMgr_freeDeadSe_();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void JAISeMgr::mixOut() {
|
void JAISeMgr::mixOut() {
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
mCategoryMgrs[i].JAISeMgr_mixOut_(mParams, mSoundActivity);
|
mCategoryMgrs[i].JAISeMgr_mixOut_(mParams, mSoundActivity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -324,7 +324,7 @@ bool JAISeMgr::startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry
|
|||||||
|
|
||||||
int JAISeMgr::getNumActiveSe() const {
|
int JAISeMgr::getNumActiveSe() const {
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < NUM_CATEGORIES; i++) {
|
||||||
num += mCategoryMgrs[i].getNumSe();
|
num += mCategoryMgrs[i].getNumSe();
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ s32 JAISoundStatus_::unlockIfLocked() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JAISoundParams::mixOutAll(const JASSoundParams& inParams, JASSoundParams* outParams, f32 param_2) {
|
void JAISoundParams::mixOutAll(const JASSoundParams& inParams, JASSoundParams* outParams, f32 param_2) {
|
||||||
outParams->mVolume = move_.params_.mVolume * (inParams.mVolume * property_.field_0x0) * param_2;
|
outParams->mVolume = move_.params_.mVolume * (inParams.mVolume * property_.mVolume) * param_2;
|
||||||
outParams->mFxMix = move_.params_.mFxMix + (inParams.mFxMix + property_.field_0x4);
|
outParams->mFxMix = move_.params_.mFxMix + (inParams.mFxMix + property_.mFxMix);
|
||||||
outParams->mPitch = move_.params_.mPitch * (inParams.mPitch * property_.field_0x8);
|
outParams->mPitch = move_.params_.mPitch * (inParams.mPitch * property_.mPitch);
|
||||||
outParams->mPan = (inParams.mPan + move_.params_.mPan) - 0.5f;
|
outParams->mPan = (inParams.mPan + move_.params_.mPan) - 0.5f;
|
||||||
outParams->mDolby = inParams.mDolby + move_.params_.mDolby;
|
outParams->mDolby = inParams.mDolby + move_.params_.mDolby;
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ bool JAISound::calc_JAISound_() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (audience_ != NULL && audible_ != NULL) {
|
if (audience_ != NULL && audible_ != NULL) {
|
||||||
if ((priority_ = audience_->calcPriority(audible_)) == 0xFFFFFFFF && status_.field_0x1.flags.flag1 == 0) {
|
if ((priority_ = audience_->calcPriority(audible_)) == 0xFFFFFFFF && status_.field_0x1.flags.mComesBack == 0) {
|
||||||
stop_JAISound_();
|
stop_JAISound_();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -713,7 +713,7 @@ void JASAramStream::channelStart() {
|
|||||||
wave_info.mpPenult = 0;
|
wave_info.mpPenult = 0;
|
||||||
// probably a fake match, this should be set in the JASWaveInfo constructor
|
// probably a fake match, this should be set in the JASWaveInfo constructor
|
||||||
static u32 const one = 1;
|
static u32 const one = 1;
|
||||||
wave_info.field_0x20 = &one;
|
wave_info.mpLoaded = &one;
|
||||||
JASChannel* jc = JKR_NEW JASChannel(channelCallback, this);
|
JASChannel* jc = JKR_NEW JASChannel(channelCallback, this);
|
||||||
JUT_ASSERT(963, jc);
|
JUT_ASSERT(963, jc);
|
||||||
jc->setPriority(0x7f7f);
|
jc->setPriority(0x7f7f);
|
||||||
@@ -722,9 +722,9 @@ void JASAramStream::channelStart() {
|
|||||||
}
|
}
|
||||||
jc->setInitPitch(mSampleRate / JASDriver::getDacRate());
|
jc->setInitPitch(mSampleRate / JASDriver::getDacRate());
|
||||||
jc->setOscInit(0, &OSC_ENV);
|
jc->setOscInit(0, &OSC_ENV);
|
||||||
jc->field_0xdc.mWaveInfo = wave_info;
|
jc->mAnon.mWaveInfo = wave_info;
|
||||||
jc->mWaveAramAddress = mAramAddress + sBlockSize * mAramBlocksPerChannel * i;
|
jc->mWaveAramAddress = mAramAddress + sBlockSize * mAramBlocksPerChannel * i;
|
||||||
jc->field_0xdc.mChannelType = 0;
|
jc->mAnon.mChannelType = 0;
|
||||||
int ret = jc->playForce();
|
int ret = jc->playForce();
|
||||||
JUT_ASSERT(977, ret);
|
JUT_ASSERT(977, ret);
|
||||||
JUT_ASSERT_MSG(979, mChannels[i] == NULL, "channelStart for already playing channel");
|
JUT_ASSERT_MSG(979, mChannels[i] == NULL, "channelStart for already playing channel");
|
||||||
|
|||||||
@@ -115,9 +115,9 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
|
|||||||
JASBasicInst::TKeymap* keymap = instp->getKeyRegion(j);
|
JASBasicInst::TKeymap* keymap = instp->getKeyRegion(j);
|
||||||
keymap->setHighKey(*data >> 0x18);
|
keymap->setHighKey(*data >> 0x18);
|
||||||
u32 fVar4 = data[1];
|
u32 fVar4 = data[1];
|
||||||
keymap->field_0x4 = JSULoHalf(data[3]);
|
keymap->mWaveId = JSULoHalf(data[3]);
|
||||||
keymap->field_0x8 = *(BE(f32)*)&data[4];
|
keymap->mVolumeMult = *(BE(f32)*)&data[4];
|
||||||
keymap->field_0xc = *(BE(f32)*)&data[5];
|
keymap->mPitchMult = *(BE(f32)*)&data[5];
|
||||||
data += 2;
|
data += 2;
|
||||||
for (int k = 0; k < fVar4; k++) {
|
for (int k = 0; k < fVar4; k++) {
|
||||||
data += 4;
|
data += 4;
|
||||||
@@ -159,9 +159,9 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
|
|||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
u32 pVar6 = ptr[0];
|
u32 pVar6 = ptr[0];
|
||||||
percp->field_0xe = JSULoHalf(ptr[2]);
|
percp->mWaveId = JSULoHalf(ptr[2]);
|
||||||
percp->field_0x10 = *(BE(f32)*)&ptr[3];
|
percp->mVolumeMult = *(BE(f32)*)&ptr[3];
|
||||||
percp->field_0x14 = *(BE(f32)*)&ptr[4];
|
percp->mPitchMult = *(BE(f32)*)&ptr[4];
|
||||||
for (int k = 0; k < pVar6; k++) {}
|
for (int k = 0; k < pVar6; k++) {}
|
||||||
drump->setPerc(j, percp);
|
drump->setPerc(j, percp);
|
||||||
}
|
}
|
||||||
@@ -260,9 +260,9 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
|
|||||||
TKeymap* tkeymap = tinst->mKeymapOffset[j].ptr(header);
|
TKeymap* tkeymap = tinst->mKeymapOffset[j].ptr(header);
|
||||||
keymap->setHighKey(tkeymap->mHighKey);
|
keymap->setHighKey(tkeymap->mHighKey);
|
||||||
TVmap* tvmap = tkeymap->mVmapOffset.ptr(header);
|
TVmap* tvmap = tkeymap->mVmapOffset.ptr(header);
|
||||||
keymap->field_0x4 = JSULoHalf(tvmap->field_0x4);
|
keymap->mWaveId = JSULoHalf(tvmap->field_0x4);
|
||||||
keymap->field_0x8 = tvmap->field_0x8;
|
keymap->mVolumeMult = tvmap->field_0x8;
|
||||||
keymap->field_0xc = tvmap->field_0xc;
|
keymap->mPitchMult = tvmap->field_0xc;
|
||||||
}
|
}
|
||||||
|
|
||||||
bank->setInst(i, instp);
|
bank->setInst(i, instp);
|
||||||
@@ -288,9 +288,9 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
|
|||||||
percp->setRelease(tperc->mRelease[j]);
|
percp->setRelease(tperc->mRelease[j]);
|
||||||
}
|
}
|
||||||
TVmap* vmap = tpmap->mVmapOffset.ptr(header);
|
TVmap* vmap = tpmap->mVmapOffset.ptr(header);
|
||||||
percp->field_0xe = JSULoHalf(vmap->field_0x4);
|
percp->mWaveId = JSULoHalf(vmap->field_0x4);
|
||||||
percp->field_0x10 = vmap->field_0x8;
|
percp->mVolumeMult = vmap->field_0x8;
|
||||||
percp->field_0x14 = vmap->field_0xc;
|
percp->mPitchMult = vmap->field_0xc;
|
||||||
setp->setPerc(j, percp);
|
setp->setPerc(j, percp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,8 +314,8 @@ JASOscillator::Data* JASBNKParser::Ver0::findOscPtr(JASBasicBank* bank, THeader
|
|||||||
if (inst != NULL) {
|
if (inst != NULL) {
|
||||||
JASInstParam param;
|
JASInstParam param;
|
||||||
inst->getParam(0x3c, 0x7f, ¶m);
|
inst->getParam(0x3c, 0x7f, ¶m);
|
||||||
if (j < param.field_0x1d) {
|
if (j < param.mOscillatorCount) {
|
||||||
return param.field_0x14[j];
|
return param.mOscillators[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,64 +1,83 @@
|
|||||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "JSystem/JAudio2/JASBank.h"
|
#include "JSystem/JAudio2/JASBank.h"
|
||||||
|
|
||||||
|
#include "dusk/mods/svc/audio_res/wsys.hpp"
|
||||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||||
#include "JSystem/JAudio2/JASBasicInst.h"
|
#include "JSystem/JAudio2/JASBasicInst.h"
|
||||||
#include "JSystem/JAudio2/JASBasicWaveBank.h"
|
#include "JSystem/JAudio2/JASBasicWaveBank.h"
|
||||||
#include "JSystem/JAudio2/JASChannel.h"
|
#include "JSystem/JAudio2/JASChannel.h"
|
||||||
|
|
||||||
|
using namespace dusk::mods::svc::audio_res::wsys;
|
||||||
|
|
||||||
// NONMATCHING JASPoolAllocObject_MultiThreaded<_> locations
|
// NONMATCHING JASPoolAllocObject_MultiThreaded<_> locations
|
||||||
JASChannel* JASBank::noteOn(JASBank const* param_0, int param_1, u8 param_2, u8 param_3, u16 param_4,
|
JASChannel* JASBank::noteOn(JASBank const* bank, int program, u8 key, u8 velocity, u16 priority,
|
||||||
void (*param_5)(u32, JASChannel*, JASDsp::TChannel*, void*),
|
void (*callback)(u32, JASChannel*, JASDsp::TChannel*, void*),
|
||||||
void* param_6) {
|
void* callback_data) {
|
||||||
if (param_1 >= 0xf0) {
|
if (program >= 0xf0) {
|
||||||
return noteOnOsc(param_1 - 0xf0, param_2, param_3, param_4, param_5, param_6);
|
return noteOnOsc(program - 0xf0, key, velocity, priority, callback, callback_data);
|
||||||
}
|
}
|
||||||
if (!param_0) {
|
if (!bank) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
JASInstParam stack_60;
|
JASInstParam instParam;
|
||||||
if (!param_0->getInstParam(param_1, param_2, param_3, &stack_60)) {
|
if (!bank->getInstParam(program, key, velocity, &instParam)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
JASWaveBank* waveBank = param_0->getWaveBank();
|
JASWaveBank* waveBank = bank->getWaveBank();
|
||||||
if (!waveBank) {
|
if (!waveBank) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
JASWaveHandle* waveHandle = waveBank->getWaveHandle(stack_60.field_0x1a);
|
JASWaveHandle* waveHandle = waveBank->getWaveHandle(instParam.mWaveId);
|
||||||
if (!waveHandle) {
|
if (!waveHandle) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#if TARGET_PC
|
||||||
|
auto const wave_key = AudioWaveKey(static_cast<AudioWaveBank>(waveBank->bankId), instParam.mWaveId);
|
||||||
|
std::lock_guard lock(s_replacements_mutex);
|
||||||
|
auto const found_replacement = s_replacements.find(wave_key);
|
||||||
|
if (found_replacement != s_replacements.end()) {
|
||||||
|
waveHandle = &found_replacement->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto const aramBase = waveHandle->getAramBaseAddress();
|
||||||
|
#endif
|
||||||
|
|
||||||
const JASWaveInfo* waveInfo = waveHandle->getWaveInfo();
|
const JASWaveInfo* waveInfo = waveHandle->getWaveInfo();
|
||||||
if (!waveInfo) {
|
if (!waveInfo) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
intptr_t wavePtr = waveHandle->getWavePtr();
|
intptr_t wavePtr = waveHandle->getWavePtr();
|
||||||
if (!wavePtr) {
|
if (!wavePtr IF_DUSK(&& !aramBase)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
JASChannel* channel = JKR_NEW JASChannel(param_5, param_6);
|
JASChannel* channel = JKR_NEW JASChannel(callback, callback_data);
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
channel->setPriority(param_4);
|
channel->setPriority(priority);
|
||||||
channel->field_0xdc.mWaveInfo = *waveInfo;
|
channel->mAnon.mWaveInfo = *waveInfo;
|
||||||
channel->mWaveAramAddress = wavePtr;
|
channel->mWaveAramAddress = wavePtr;
|
||||||
channel->field_0xdc.mChannelType = stack_60.field_0x1c;
|
#if TARGET_PC
|
||||||
channel->setBankDisposeID(param_0);
|
channel->mAramBaseAddress = aramBase;
|
||||||
channel->setInitPitch(stack_60.mPitch * (waveInfo->mSampleRate / JASDriver::getDacRate()));
|
channel->mSampleReference = waveHandle->getSampleReference();
|
||||||
if (stack_60.field_0x1e == 0) {
|
#endif
|
||||||
channel->setKey(param_2 - waveInfo->mBaseKey);
|
channel->mAnon.mChannelType = instParam.mChannelType;
|
||||||
|
channel->setBankDisposeID(bank);
|
||||||
|
channel->setInitPitch(instParam.mPitch * (waveInfo->mSampleRate / JASDriver::getDacRate()));
|
||||||
|
if (instParam.mDontSetKey == 0) {
|
||||||
|
channel->setKey(key - waveInfo->mBaseKey);
|
||||||
}
|
}
|
||||||
channel->setInitVolume(stack_60.mVolume);
|
channel->setInitVolume(instParam.mVolume);
|
||||||
channel->setVelocity(param_3);
|
channel->setVelocity(velocity);
|
||||||
channel->setInitPan(stack_60.mPan);
|
channel->setInitPan(instParam.mPan);
|
||||||
channel->setInitFxmix(stack_60.mFxMix);
|
channel->setInitFxmix(instParam.mFxMix);
|
||||||
channel->setInitDolby(stack_60.mDolby);
|
channel->setInitDolby(instParam.mDolby);
|
||||||
for (u32 i = 0; i < stack_60.field_0x1d; i++) {
|
for (u32 i = 0; i < instParam.mOscillatorCount; i++) {
|
||||||
channel->setOscInit(i, stack_60.field_0x14[i]);
|
channel->setOscInit(i, instParam.mOscillators[i]);
|
||||||
}
|
}
|
||||||
channel->setDirectRelease(stack_60.field_0x18);
|
channel->setDirectRelease(instParam.mDirectRelease);
|
||||||
if (!channel->play()) {
|
if (!channel->play()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -66,24 +85,24 @@ JASChannel* JASBank::noteOn(JASBank const* param_0, int param_1, u8 param_2, u8
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NONMATCHING JASPoolAllocObject_MultiThreaded<_> locations
|
// NONMATCHING JASPoolAllocObject_MultiThreaded<_> locations
|
||||||
JASChannel* JASBank::noteOnOsc(int param_0, u8 param_1, u8 param_2, u16 param_3,
|
JASChannel* JASBank::noteOnOsc(int param_0, u8 key, u8 velocity, u16 priority,
|
||||||
void (*param_4)(u32, JASChannel*, JASDsp::TChannel*, void*),
|
void (*callback)(u32, JASChannel*, JASDsp::TChannel*, void*),
|
||||||
void* param_5) {
|
void* callback_data) {
|
||||||
static JASOscillator::Point const OSC_RELEASE_TABLE[2] = {
|
static JASOscillator::Point const OSC_RELEASE_TABLE[2] = {
|
||||||
{0x0001, 0x000A, 0x0000},
|
{0x0001, 0x000A, 0x0000},
|
||||||
{0x000F, 0x0000, 0x0000},
|
{0x000F, 0x0000, 0x0000},
|
||||||
};
|
};
|
||||||
static const JASOscillator::Data OSC_ENV = {0, 1.0f, NULL, OSC_RELEASE_TABLE, 1.0f, 0.0f};
|
static const JASOscillator::Data OSC_ENV = {0, 1.0f, NULL, OSC_RELEASE_TABLE, 1.0f, 0.0f};
|
||||||
JASChannel* channel = JKR_NEW JASChannel(param_4, param_5);
|
JASChannel* channel = JKR_NEW JASChannel(callback, callback_data);
|
||||||
if (!channel) {
|
if (!channel) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
channel->setPriority(param_3);
|
channel->setPriority(priority);
|
||||||
channel->mOscillatorSomething = param_0;
|
channel->mOscillatorSomething = param_0;
|
||||||
channel->field_0xdc.mChannelType = 2;
|
channel->mAnon.mChannelType = CHANNEL_OSCILLATOR;
|
||||||
channel->setInitPitch(16736.016f / JASDriver::getDacRate());
|
channel->setInitPitch(16736.016f / JASDriver::getDacRate());
|
||||||
channel->setKey(param_1 - channel->field_0xdc.mWaveInfo.mBaseKey);
|
channel->setKey(key - channel->mAnon.mWaveInfo.mBaseKey);
|
||||||
channel->setVelocity(param_2);
|
channel->setVelocity(velocity);
|
||||||
channel->setOscInit(0, &OSC_ENV);
|
channel->setOscInit(0, &OSC_ENV);
|
||||||
if (!channel->play()) {
|
if (!channel->play()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -14,20 +14,20 @@ void JASBasicBank::newInstTable(u8 num, JKRHeap* heap) {
|
|||||||
mInstNumMax = num;
|
mInstNumMax = num;
|
||||||
mInstTable = JKR_NEW_ARRAY_ARGS(JASInst*, mInstNumMax, heap, 0);
|
mInstTable = JKR_NEW_ARRAY_ARGS(JASInst*, mInstNumMax, heap, 0);
|
||||||
#if TARGET_ANDROID
|
#if TARGET_ANDROID
|
||||||
JASCalc::_bzero(mInstTable, mInstNumMax * 4);
|
JASCalc::_bzero(mInstTable, mInstNumMax * sizeof(mInstTable[0]));
|
||||||
#else
|
#else
|
||||||
JASCalc::bzero(mInstTable, mInstNumMax * 4);
|
JASCalc::bzero(mInstTable, mInstNumMax * sizeof(mInstTable[0]));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JASBasicBank::getInstParam(int prg_no, int param_1, int param_2,
|
bool JASBasicBank::getInstParam(int prg_no, int key, int velocity,
|
||||||
JASInstParam* o_param) const {
|
JASInstParam* o_param) const {
|
||||||
JASInst* inst = getInst(prg_no);
|
JASInst* inst = getInst(prg_no);
|
||||||
if (inst == NULL) {
|
if (inst == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return inst->getParam(param_1, param_2, o_param);
|
return inst->getParam(key, velocity, o_param);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JASBasicBank::setInst(int prg_no, JASInst* inst) {
|
void JASBasicBank::setInst(int prg_no, JASInst* inst) {
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ JASBasicInst::JASBasicInst() {
|
|||||||
mKeymapCount = 0;
|
mKeymapCount = 0;
|
||||||
mKeymap = NULL;
|
mKeymap = NULL;
|
||||||
#if TARGET_ANDROID
|
#if TARGET_ANDROID
|
||||||
JASCalc::_bzero(field_0xc, sizeof(field_0xc));
|
JASCalc::_bzero(mOscillators, sizeof(mOscillators));
|
||||||
#else
|
#else
|
||||||
JASCalc::bzero(field_0xc, sizeof(field_0xc));
|
JASCalc::bzero(mOscillators, sizeof(mOscillators));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,18 +24,18 @@ JASBasicInst::~JASBasicInst() {
|
|||||||
JKR_DELETE_ARRAY(mKeymap);
|
JKR_DELETE_ARRAY(mKeymap);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) const {
|
bool JASBasicInst::getParam(int key, int velocity, JASInstParam* o_param) const {
|
||||||
UNUSED(param_1);
|
UNUSED(velocity);
|
||||||
param_2->field_0x1c = 0;
|
o_param->mChannelType = 0;
|
||||||
param_2->field_0x1e = 0;
|
o_param->mDontSetKey = 0;
|
||||||
param_2->field_0x14 = (JASOscillator::Data**)&field_0xc;
|
o_param->mOscillators = (JASOscillator::Data**)&mOscillators;
|
||||||
param_2->field_0x1d = 2;
|
o_param->mOscillatorCount = 2;
|
||||||
param_2->mVolume = mVolume;
|
o_param->mVolume = mVolume;
|
||||||
param_2->mPitch = mPitch;
|
o_param->mPitch = mPitch;
|
||||||
|
|
||||||
TKeymap* keyMap = NULL;
|
TKeymap* keyMap = NULL;
|
||||||
for (int i = 0; i < mKeymapCount; i++) {
|
for (int i = 0; i < mKeymapCount; i++) {
|
||||||
if (param_0 <= mKeymap[i].mHighKey) {
|
if (key <= mKeymap[i].mHighKey) {
|
||||||
keyMap = &mKeymap[i];
|
keyMap = &mKeymap[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -45,9 +45,9 @@ bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) con
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
param_2->mVolume *= keyMap->field_0x8;
|
o_param->mVolume *= keyMap->mVolumeMult;
|
||||||
param_2->mPitch *= keyMap->field_0xc;
|
o_param->mPitch *= keyMap->mPitchMult;
|
||||||
param_2->field_0x1a = u16(keyMap->field_0x4);
|
o_param->mWaveId = u16(keyMap->mWaveId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ void JASBasicInst::setKeyRegionCount(u32 count, JKRHeap* param_1) {
|
|||||||
void JASBasicInst::setOsc(int index, JASOscillator::Data const* param_1) {
|
void JASBasicInst::setOsc(int index, JASOscillator::Data const* param_1) {
|
||||||
JUT_ASSERT(128, index < OSC_MAX);
|
JUT_ASSERT(128, index < OSC_MAX);
|
||||||
JUT_ASSERT(129, index >= 0);
|
JUT_ASSERT(129, index >= 0);
|
||||||
field_0xc[index] = param_1;
|
mOscillators[index] = param_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
JASBasicInst::TKeymap* JASBasicInst::getKeyRegion(int index) {
|
JASBasicInst::TKeymap* JASBasicInst::getKeyRegion(int index) {
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
#include "JSystem/JUtility/JUTAssert.h"
|
#include "JSystem/JUtility/JUTAssert.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
JASBasicWaveBank::JASBasicWaveBank() {
|
JASBasicWaveBank::JASBasicWaveBank(IF_DUSK(u32 bankId)) IF_DUSK(: JASWaveBank(bankId)) {
|
||||||
mWaveTable = NULL;
|
mWaveTable = NULL;
|
||||||
mWaveGroupArray = NULL;
|
mWaveGroupArray = NULL;
|
||||||
mHandleCount = 0;
|
mHandleCount = 0;
|
||||||
mGroupCount = 0;
|
mGroupCount = 0;
|
||||||
OSInitMutex(&field_0x4);
|
OSInitMutex(&mWaveTableMutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
JASBasicWaveBank::~JASBasicWaveBank() {
|
JASBasicWaveBank::~JASBasicWaveBank() {
|
||||||
@@ -44,13 +44,13 @@ void JASBasicWaveBank::setWaveTableSize(u32 param_0, JKRHeap* param_1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JASBasicWaveBank::incWaveTable(JASBasicWaveBank::TWaveGroup const* param_0) {
|
void JASBasicWaveBank::incWaveTable(JASBasicWaveBank::TWaveGroup const* param_0) {
|
||||||
JASMutexLock lock(&field_0x4);
|
JASMutexLock lock(&mWaveTableMutex);
|
||||||
for (u32 i = 0; i < param_0->getWaveCount(); i++) {
|
for (u32 i = 0; i < param_0->getWaveCount(); i++) {
|
||||||
TWaveHandle* handle = mWaveTable + param_0->getWaveID(i);
|
TWaveHandle* handle = mWaveTable + param_0->getWaveID(i);
|
||||||
if (!handle->mHeap) {
|
if (!handle->mHeap) {
|
||||||
handle->mHeap = ¶m_0->mHeap;
|
handle->mHeap = ¶m_0->mHeap;
|
||||||
handle->field_0x4.field_0x20 = ¶m_0->_48;
|
handle->mWaveInfo.mpLoaded = ¶m_0->mCurrentlyLoaded;
|
||||||
handle->field_0x4.mOffsetStart = param_0->mCtrlWaveArray[i].field_0x4;
|
handle->mWaveInfo.mOffsetStart = param_0->mCtrlWaveArray[i].mOffsetStart;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,13 +58,13 @@ void JASBasicWaveBank::incWaveTable(JASBasicWaveBank::TWaveGroup const* param_0)
|
|||||||
DUSK_GAME_DATA u32 JASBasicWaveBank::mNoLoad;
|
DUSK_GAME_DATA u32 JASBasicWaveBank::mNoLoad;
|
||||||
|
|
||||||
void JASBasicWaveBank::decWaveTable(JASBasicWaveBank::TWaveGroup const* param_0) {
|
void JASBasicWaveBank::decWaveTable(JASBasicWaveBank::TWaveGroup const* param_0) {
|
||||||
JASMutexLock lock(&field_0x4);
|
JASMutexLock lock(&mWaveTableMutex);
|
||||||
for (u32 i = 0; i < param_0->getWaveCount(); i++) {
|
for (u32 i = 0; i < param_0->getWaveCount(); i++) {
|
||||||
TWaveHandle* handle = mWaveTable + param_0->getWaveID(i);
|
TWaveHandle* handle = mWaveTable + param_0->getWaveID(i);
|
||||||
if (handle->mHeap == ¶m_0->mHeap) {
|
if (handle->mHeap == ¶m_0->mHeap) {
|
||||||
handle->mHeap = NULL;
|
handle->mHeap = NULL;
|
||||||
handle->field_0x4.field_0x20 = &mNoLoad;
|
handle->mWaveInfo.mpLoaded = &mNoLoad;
|
||||||
handle->field_0x4.mOffsetStart = -1;
|
handle->mWaveInfo.mOffsetStart = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,15 +80,15 @@ JASWaveHandle* JASBasicWaveBank::getWaveHandle(u32 param_0) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JASBasicWaveBank::setWaveInfo(JASBasicWaveBank::TWaveGroup* wgrp, int index,
|
void JASBasicWaveBank::setWaveInfo(JASBasicWaveBank::TWaveGroup* wgrp, int index,
|
||||||
u16 param_2, JASWaveInfo const& param_3) {
|
u16 waveId, JASWaveInfo const& param_3) {
|
||||||
JUT_ASSERT(204, wgrp);
|
JUT_ASSERT(204, wgrp);
|
||||||
JUT_ASSERT(205, index < wgrp->mWaveCount);
|
JUT_ASSERT(205, index < wgrp->mWaveCount);
|
||||||
JUT_ASSERT(206, index >= 0);
|
JUT_ASSERT(206, index >= 0);
|
||||||
mWaveTable[param_2].field_0x4 = param_3;
|
mWaveTable[waveId].mWaveInfo = param_3;
|
||||||
mWaveTable[param_2].field_0x4.field_0x20 = &mNoLoad;
|
mWaveTable[waveId].mWaveInfo.mpLoaded = &mNoLoad;
|
||||||
mWaveTable[param_2].field_0x4.mOffsetStart = -1;
|
mWaveTable[waveId].mWaveInfo.mOffsetStart = -1;
|
||||||
wgrp->mCtrlWaveArray[index].field_0x0 = param_2;
|
wgrp->mCtrlWaveArray[index].waveId = waveId;
|
||||||
wgrp->mCtrlWaveArray[index].field_0x4 = param_3.mOffsetStart;
|
wgrp->mCtrlWaveArray[index].mOffsetStart = param_3.mOffsetStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
JASBasicWaveBank::TWaveGroup::TWaveGroup() {
|
JASBasicWaveBank::TWaveGroup::TWaveGroup() {
|
||||||
@@ -122,7 +122,7 @@ void JASBasicWaveBank::TWaveGroup::onEraseDone() {
|
|||||||
u32 JASBasicWaveBank::TWaveGroup::getWaveID(int index) const {
|
u32 JASBasicWaveBank::TWaveGroup::getWaveID(int index) const {
|
||||||
JUT_ASSERT(298, index < mWaveCount);
|
JUT_ASSERT(298, index < mWaveCount);
|
||||||
JUT_ASSERT(299, index >= 0);
|
JUT_ASSERT(299, index >= 0);
|
||||||
return mCtrlWaveArray[index].field_0x0;
|
return mCtrlWaveArray[index].waveId;
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t JASBasicWaveBank::TWaveHandle::getWavePtr() const {
|
intptr_t JASBasicWaveBank::TWaveHandle::getWavePtr() const {
|
||||||
@@ -131,5 +131,5 @@ intptr_t JASBasicWaveBank::TWaveHandle::getWavePtr() const {
|
|||||||
if (base == 0) {
|
if (base == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return (intptr_t)base + field_0x4.mOffsetStart;
|
return (intptr_t)base + mWaveInfo.mOffsetStart;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ void JASCalc::imixcopy(const s16* s1, const s16* s2, s16* dst, u32 n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !TARGET_PC
|
|
||||||
void JASCalc::bcopyfast(const void* src, void* dest, u32 size) {
|
void JASCalc::bcopyfast(const void* src, void* dest, u32 size) {
|
||||||
JUT_ASSERT(226, (reinterpret_cast<uintptr_t>(src) & 0x03) == 0);
|
JUT_ASSERT(226, (reinterpret_cast<uintptr_t>(src) & 0x03) == 0);
|
||||||
JUT_ASSERT(227, (reinterpret_cast<uintptr_t>(dest) & 0x03) == 0);
|
JUT_ASSERT(227, (reinterpret_cast<uintptr_t>(dest) & 0x03) == 0);
|
||||||
@@ -34,7 +33,11 @@ void JASCalc::bcopyfast(const void* src, void* dest, u32 size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_ANDROID
|
||||||
|
void JASCalc::_bcopy(const void* src, void* dest, u32 size) {
|
||||||
|
#else
|
||||||
void JASCalc::bcopy(const void* src, void* dest, u32 size) {
|
void JASCalc::bcopy(const void* src, void* dest, u32 size) {
|
||||||
|
#endif
|
||||||
u32* usrc;
|
u32* usrc;
|
||||||
u32* udest;
|
u32* udest;
|
||||||
|
|
||||||
@@ -91,7 +94,11 @@ void JASCalc::bzerofast(void* dest, u32 size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TARGET_ANDROID
|
||||||
|
void JASCalc::_bzero(void* dest, u32 size) {
|
||||||
|
#else
|
||||||
void JASCalc::bzero(void* dest, u32 size) {
|
void JASCalc::bzero(void* dest, u32 size) {
|
||||||
|
#endif
|
||||||
u32* udest;
|
u32* udest;
|
||||||
u8* bdest = (u8*)dest;
|
u8* bdest = (u8*)dest;
|
||||||
if ((size & 0x1f) == 0 && (reinterpret_cast<uintptr_t>(dest) & 0x1f) == 0) {
|
if ((size & 0x1f) == 0 && (reinterpret_cast<uintptr_t>(dest) & 0x1f) == 0) {
|
||||||
@@ -132,7 +139,6 @@ void JASCalc::bzero(void* dest, u32 size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if AVOID_UB
|
#if AVOID_UB
|
||||||
DUSK_GAME_DATA s16 const JASCalc::CUTOFF_TO_IIR_TABLE[129][4] = {
|
DUSK_GAME_DATA s16 const JASCalc::CUTOFF_TO_IIR_TABLE[129][4] = {
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ JASChannel::JASChannel(Callback i_callback, void* i_callbackData) :
|
|||||||
mCallback(i_callback),
|
mCallback(i_callback),
|
||||||
mCallbackData(i_callbackData),
|
mCallbackData(i_callbackData),
|
||||||
mUpdateTimer(0),
|
mUpdateTimer(0),
|
||||||
|
#if TARGET_PC
|
||||||
|
mAramBaseAddress(nullptr),
|
||||||
|
#endif
|
||||||
mBankDisposeID(NULL),
|
mBankDisposeID(NULL),
|
||||||
mKey(0),
|
mKey(0),
|
||||||
mVelocity(0x7f),
|
mVelocity(0x7f),
|
||||||
@@ -34,7 +37,7 @@ JASChannel::JASChannel(Callback i_callback, void* i_callbackData) :
|
|||||||
mKeySweepCount(0),
|
mKeySweepCount(0),
|
||||||
mSkipSamples(0)
|
mSkipSamples(0)
|
||||||
{
|
{
|
||||||
field_0xdc.mChannelType = 0;
|
mAnon.mChannelType = 0;
|
||||||
field_0x104 = 0;
|
field_0x104 = 0;
|
||||||
mMixConfig[0].whole = 0x150;
|
mMixConfig[0].whole = 0x150;
|
||||||
mMixConfig[1].whole = 0x210;
|
mMixConfig[1].whole = 0x210;
|
||||||
@@ -237,7 +240,7 @@ s32 JASChannel::initialUpdateDSPChannel(JASDsp::TChannel* i_channel) {
|
|||||||
mCallback(CB_START, this, i_channel, mCallbackData);
|
mCallback(CB_START, this, i_channel, mCallbackData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field_0xdc.mWaveInfo.field_0x20[0] == 0) {
|
if (mAnon.mWaveInfo.mpLoaded[0] == 0) {
|
||||||
JUT_WARN_DEVICE(346, 2, "%s", "Lost wave data while playing");
|
JUT_WARN_DEVICE(346, 2, "%s", "Lost wave data while playing");
|
||||||
mDspCh->free();
|
mDspCh->free();
|
||||||
mDspCh = NULL;
|
mDspCh = NULL;
|
||||||
@@ -253,9 +256,12 @@ s32 JASChannel::initialUpdateDSPChannel(JASDsp::TChannel* i_channel) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (field_0xdc.mChannelType) {
|
switch (mAnon.mChannelType) {
|
||||||
case 0:
|
case 0:
|
||||||
i_channel->setWaveInfo(field_0xdc.mWaveInfo, mWaveAramAddress, mSkipSamples);
|
i_channel->setWaveInfo(mAnon.mWaveInfo, mWaveAramAddress, mSkipSamples);
|
||||||
|
#if TARGET_PC
|
||||||
|
i_channel->mAramBaseAddress = mAramBaseAddress;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
i_channel->setOscInfo(mOscillatorSomething);
|
i_channel->setOscInfo(mOscillatorSomething);
|
||||||
@@ -315,7 +321,7 @@ s32 JASChannel::updateDSPChannel(JASDsp::TChannel* i_channel) {
|
|||||||
mCallback(CB_PLAY, this, i_channel, mCallbackData);
|
mCallback(CB_PLAY, this, i_channel, mCallbackData);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field_0xdc.mWaveInfo.field_0x20[0] == 0) {
|
if (mAnon.mWaveInfo.mpLoaded[0] == 0) {
|
||||||
JUT_WARN_DEVICE(456, 2, "%s","Lost wave data while playing");
|
JUT_WARN_DEVICE(456, 2, "%s","Lost wave data while playing");
|
||||||
mDspCh->free();
|
mDspCh->free();
|
||||||
mDspCh = NULL;
|
mDspCh = NULL;
|
||||||
|
|||||||
@@ -99,14 +99,14 @@ void JASDsp::invalChannelAll() {
|
|||||||
DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
|
DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u8 const JASDsp::DSPADPCM_FILTER[64] = {
|
DUSK_GAME_DATA u8 const ATTRIBUTE_ALIGN(32) JASDsp::DSPADPCM_FILTER[64] = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00,
|
||||||
0x10, 0x00, 0xF8, 0x00, 0x0E, 0x00, 0xFA, 0x00, 0x0C, 0x00, 0xFC, 0x00, 0x12, 0x00, 0xF6, 0x00,
|
0x10, 0x00, 0xF8, 0x00, 0x0E, 0x00, 0xFA, 0x00, 0x0C, 0x00, 0xFC, 0x00, 0x12, 0x00, 0xF6, 0x00,
|
||||||
0x10, 0x68, 0xF7, 0x38, 0x12, 0xC0, 0xF7, 0x04, 0x14, 0x00, 0xF4, 0x00, 0x08, 0x00, 0xF8, 0x00,
|
0x10, 0x68, 0xF7, 0x38, 0x12, 0xC0, 0xF7, 0x04, 0x14, 0x00, 0xF4, 0x00, 0x08, 0x00, 0xF8, 0x00,
|
||||||
0x04, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00,
|
0x04, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u32 const JASDsp::DSPRES_FILTER[320] = {
|
DUSK_GAME_DATA u32 const ATTRIBUTE_ALIGN(32) JASDsp::DSPRES_FILTER[320] = {
|
||||||
0x0C3966AD,
|
0x0C3966AD,
|
||||||
0x0D46FFDF,
|
0x0D46FFDF,
|
||||||
0x0B396696,
|
0x0B396696,
|
||||||
@@ -523,9 +523,12 @@ void JASDsp::TChannel::init() {
|
|||||||
void JASDsp::TChannel::playStart() {
|
void JASDsp::TChannel::playStart() {
|
||||||
JUT_ASSERT(508, dspMutex);
|
JUT_ASSERT(508, dspMutex);
|
||||||
field_0x10c = 0;
|
field_0x10c = 0;
|
||||||
|
#if !TARGET_PC
|
||||||
field_0x060 = 0;
|
field_0x060 = 0;
|
||||||
|
#endif
|
||||||
mResetFlag = 1;
|
mResetFlag = 1;
|
||||||
field_0x066 = 0;
|
field_0x066 = 0;
|
||||||
|
#if !TARGET_PC
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
field_0x078[i] = 0;
|
field_0x078[i] = 0;
|
||||||
@@ -534,6 +537,7 @@ void JASDsp::TChannel::playStart() {
|
|||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
field_0x080[i] = 0;
|
field_0x080[i] = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
mIsActive = 1;
|
mIsActive = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -601,9 +605,11 @@ void JASDsp::TChannel::setWaveInfo(JASWaveInfo const& waveInfo, u32 aramAddress,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if !TARGET_PC
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
field_0x0b0[i] = 0;
|
field_0x0b0[i] = 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ void JASDrumSet::newPercArray(u8 num, JKRHeap* heap) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JASDrumSet::getParam(int key, int param_1, JASInstParam* param_2) const {
|
bool JASDrumSet::getParam(int key, int velocity, JASInstParam* o_param) const {
|
||||||
UNUSED(param_1);
|
UNUSED(velocity);
|
||||||
JUT_ASSERT(48, key >= 0);
|
JUT_ASSERT(48, key >= 0);
|
||||||
if (mPercArray == NULL) {
|
if (mPercArray == NULL) {
|
||||||
return false;
|
return false;
|
||||||
@@ -43,12 +43,12 @@ bool JASDrumSet::getParam(int key, int param_1, JASInstParam* param_2) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
param_2->field_0x1c = 0;
|
o_param->mChannelType = 0;
|
||||||
param_2->field_0x1e = 1;
|
o_param->mDontSetKey = 1;
|
||||||
param_2->mVolume = perc->mVolume;
|
o_param->mVolume = perc->mVolume;
|
||||||
param_2->mPitch = perc->mPitch;
|
o_param->mPitch = perc->mPitch;
|
||||||
param_2->mPan = perc->mPan;
|
o_param->mPan = perc->mPan;
|
||||||
param_2->field_0x18 = u16(perc->field_0xc);
|
o_param->mDirectRelease = u16(perc->mDirectRelease);
|
||||||
|
|
||||||
static JASOscillator::Data osc;
|
static JASOscillator::Data osc;
|
||||||
|
|
||||||
@@ -61,11 +61,11 @@ bool JASDrumSet::getParam(int key, int param_1, JASInstParam* param_2) const {
|
|||||||
|
|
||||||
static JASOscillator::Data* oscp = &osc;
|
static JASOscillator::Data* oscp = &osc;
|
||||||
|
|
||||||
param_2->field_0x14 = &oscp;
|
o_param->mOscillators = &oscp;
|
||||||
param_2->field_0x1d = 1;
|
o_param->mOscillatorCount = 1;
|
||||||
param_2->mVolume *= perc->field_0x10;
|
o_param->mVolume *= perc->mVolumeMult;
|
||||||
param_2->mPitch *= perc->field_0x14;
|
o_param->mPitch *= perc->mPitchMult;
|
||||||
param_2->field_0x1a = u16(perc->field_0xe);
|
o_param->mWaveId = u16(perc->mWaveId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,12 +107,12 @@ JASDrumSet::TPerc::TPerc() {
|
|||||||
mVolume = 1.0f;
|
mVolume = 1.0f;
|
||||||
mPitch = 1.0f;
|
mPitch = 1.0f;
|
||||||
mPan = 0.5f;
|
mPan = 0.5f;
|
||||||
field_0xc = 1000;
|
mDirectRelease = 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
void JASDrumSet::TPerc::setRelease(u32 release) {
|
void JASDrumSet::TPerc::setRelease(u32 release) {
|
||||||
JUT_ASSERT(224, release < 0x10000);
|
JUT_ASSERT(224, release < 0x10000);
|
||||||
field_0xc = release;
|
mDirectRelease = release;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 JASDrumSet::getType() const { return 'PERC'; }
|
u32 JASDrumSet::getType() const { return 'PERC'; }
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include "JSystem/JAudio2/JASSimpleWaveBank.h"
|
#include "JSystem/JAudio2/JASSimpleWaveBank.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
JASSimpleWaveBank::JASSimpleWaveBank() {
|
JASSimpleWaveBank::JASSimpleWaveBank(IF_DUSK(u32 bankId)) IF_DUSK(: JASWaveBank(bankId)) {
|
||||||
mWaveTable = NULL;
|
mWaveTable = NULL;
|
||||||
mWaveTableSize = 0;
|
mWaveTableSize = 0;
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ JASWaveHandle* JASSimpleWaveBank::getWaveHandle(u32 no) const {
|
|||||||
|
|
||||||
void JASSimpleWaveBank::setWaveInfo(u32 no, JASWaveInfo const& waveInfo) {
|
void JASSimpleWaveBank::setWaveInfo(u32 no, JASWaveInfo const& waveInfo) {
|
||||||
mWaveTable[no].mWaveInfo = waveInfo;
|
mWaveTable[no].mWaveInfo = waveInfo;
|
||||||
mWaveTable[no].mWaveInfo.field_0x20 = &_48;
|
mWaveTable[no].mWaveInfo.mpLoaded = &mCurrentlyLoaded;
|
||||||
mWaveTable[no].mHeap = &mHeap;
|
mWaveTable[no].mHeap = &mHeap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -288,13 +288,13 @@ void JASTrack::setLatestKey(u8 param_0) {
|
|||||||
field_0x22b += getTransposeTotal();
|
field_0x22b += getTransposeTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
JASChannel* JASTrack::channelStart(JASTrack::TChannelMgr* i_channelMgr, u32 param_1, u32 param_2,
|
JASChannel* JASTrack::channelStart(JASTrack::TChannelMgr* i_channelMgr, u32 key, u32 velocity,
|
||||||
u32 i_updateTimer) {
|
u32 i_updateTimer) {
|
||||||
JASBank* bank = NULL;
|
JASBank* bank = NULL;
|
||||||
if (mBankTable != NULL) {
|
if (mBankTable != NULL) {
|
||||||
bank = mBankTable->getBank(mBankNumber);
|
bank = mBankTable->getBank(mBankNumber);
|
||||||
}
|
}
|
||||||
JASChannel* channel = JASBank::noteOn(bank, mProgNumber, param_1, param_2,
|
JASChannel* channel = JASBank::noteOn(bank, mProgNumber, key, velocity,
|
||||||
mNoteOnPrio | mReleasePrio << 8,
|
mNoteOnPrio | mReleasePrio << 8,
|
||||||
channelUpdateCallback, i_channelMgr);
|
channelUpdateCallback, i_channelMgr);
|
||||||
if (channel == NULL) {
|
if (channel == NULL) {
|
||||||
@@ -315,17 +315,17 @@ JASChannel* JASTrack::channelStart(JASTrack::TChannelMgr* i_channelMgr, u32 para
|
|||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
int JASTrack::noteOn(u32 noteid, u32 param_1, u32 param_2) {
|
int JASTrack::noteOn(u32 noteid, u32 key, u32 velocity) {
|
||||||
JUT_ASSERT(486, noteid != 0 && noteid < TChannelMgr::CHANNEL_MAX);
|
JUT_ASSERT(486, noteid != 0 && noteid < TChannelMgr::CHANNEL_MAX);
|
||||||
if (isMute()) {
|
if (isMute()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
param_1 += getTransposeTotal();
|
key += getTransposeTotal();
|
||||||
for (u32 i = 0; i < mChannelMgrCount; i++) {
|
for (u32 i = 0; i < mChannelMgrCount; i++) {
|
||||||
if (mChannelMgrs[i] != NULL) {
|
if (mChannelMgrs[i] != NULL) {
|
||||||
mChannelMgrs[i]->noteOff(noteid, 0);
|
mChannelMgrs[i]->noteOff(noteid, 0);
|
||||||
JASChannel* channel = channelStart(mChannelMgrs[i], param_1, param_2, 0);
|
JASChannel* channel = channelStart(mChannelMgrs[i], key, velocity, 0);
|
||||||
if (channel == NULL) {
|
if (channel == NULL) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ int JASTrack::gateOn(u32 param_0, u32 i_velocity, f32 i_time, u32 i_flags) {
|
|||||||
} else {
|
} else {
|
||||||
JASChannel* channel = channel_mgr->mChannels[0];
|
JASChannel* channel = channel_mgr->mChannels[0];
|
||||||
if (channel != NULL) {
|
if (channel != NULL) {
|
||||||
channel->setKey(uvar7 - channel->field_0xdc.mWaveInfo.mBaseKey);
|
channel->setKey(uvar7 - channel->mAnon.mWaveInfo.mBaseKey);
|
||||||
channel->setVelocity(i_velocity);
|
channel->setVelocity(i_velocity);
|
||||||
channel->setUpdateTimer(update_timer);
|
channel->setUpdateTimer(update_timer);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ bool JASVoiceBank::getInstParam(int param_0, int param_1, int param_2,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
sOscTable = (JASOscillator::Data*)&sOscData;
|
sOscTable = (JASOscillator::Data*)&sOscData;
|
||||||
param_3->field_0x1a = param_0;
|
param_3->mWaveId = param_0;
|
||||||
param_3->field_0x1d = 1;
|
param_3->mOscillatorCount = 1;
|
||||||
param_3->field_0x14 = &sOscTable;
|
param_3->mOscillators = &sOscTable;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ JASBasicWaveBank* JASWSParser::createBasicWaveBank(void const* stream, JKRHeap*
|
|||||||
u32 free_size = heap->getFreeSize();
|
u32 free_size = heap->getFreeSize();
|
||||||
|
|
||||||
THeader* header = (THeader*)stream;
|
THeader* header = (THeader*)stream;
|
||||||
JASBasicWaveBank* wave_bank = JKR_NEW_ARGS (heap, 0) JASBasicWaveBank;
|
JASBasicWaveBank* wave_bank = JKR_NEW_ARGS (heap, 0) JASBasicWaveBank IF_DUSK((header->mId));
|
||||||
if (wave_bank == NULL) {
|
if (wave_bank == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ JASBasicWaveBank* JASWSParser::createBasicWaveBank(void const* stream, JKRHeap*
|
|||||||
wave_info.mpLast = wave->mpLast;
|
wave_info.mpLast = wave->mpLast;
|
||||||
wave_info.mpPenult = wave->mpPenult;
|
wave_info.mpPenult = wave->mpPenult;
|
||||||
TCtrlWave* ctrl_wave = ctrl->mCtrlWaveOffsets[j].ptr(header);
|
TCtrlWave* ctrl_wave = ctrl->mCtrlWaveOffsets[j].ptr(header);
|
||||||
u16 local_74 = JSULoHalf(ctrl_wave->_00);
|
u16 local_74 = JSULoHalf(ctrl_wave->mWaveAndGroupId);
|
||||||
wave_bank->setWaveInfo(wave_group, j, local_74, wave_info);
|
wave_bank->setWaveInfo(wave_group, j, local_74, wave_info);
|
||||||
}
|
}
|
||||||
wave_group->setFileName(archive->mFileName);
|
wave_group->setFileName(archive->mFileName);
|
||||||
@@ -82,7 +82,7 @@ JASSimpleWaveBank* JASWSParser::createSimpleWaveBank(void const* stream, JKRHeap
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
JASSimpleWaveBank* wave_bank = JKR_NEW_ARGS (heap, 0) JASSimpleWaveBank;
|
JASSimpleWaveBank* wave_bank = JKR_NEW_ARGS (heap, 0) JASSimpleWaveBank IF_DUSK((header->mId));
|
||||||
if (wave_bank == NULL) {
|
if (wave_bank == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ JASSimpleWaveBank* JASWSParser::createSimpleWaveBank(void const* stream, JKRHeap
|
|||||||
TWaveArchive* archive = archiveBank->mArchiveOffsets[0].ptr(header);
|
TWaveArchive* archive = archiveBank->mArchiveOffsets[0].ptr(header);
|
||||||
for (int i = 0; i < ctrl->mWaveCount; i++) {
|
for (int i = 0; i < ctrl->mWaveCount; i++) {
|
||||||
TCtrlWave* ctrlWave = ctrl->mCtrlWaveOffsets[i].ptr(header);
|
TCtrlWave* ctrlWave = ctrl->mCtrlWaveOffsets[i].ptr(header);
|
||||||
u32 tmp = JSULoHalf(ctrlWave->_00);
|
u32 tmp = JSULoHalf(ctrlWave->mWaveAndGroupId);
|
||||||
if (max < tmp) {
|
if (max < tmp) {
|
||||||
max = tmp;
|
max = tmp;
|
||||||
}
|
}
|
||||||
@@ -116,8 +116,8 @@ JASSimpleWaveBank* JASWSParser::createSimpleWaveBank(void const* stream, JKRHeap
|
|||||||
wave_info.mpLast = wave->mpLast;
|
wave_info.mpLast = wave->mpLast;
|
||||||
wave_info.mpPenult = wave->mpPenult;
|
wave_info.mpPenult = wave->mpPenult;
|
||||||
TCtrlWave* ctrl_wave = ctrl->mCtrlWaveOffsets[i].ptr(header);
|
TCtrlWave* ctrl_wave = ctrl->mCtrlWaveOffsets[i].ptr(header);
|
||||||
u32 tmp = JSULoHalf(ctrl_wave->_00);
|
u32 waveId = JSULoHalf(ctrl_wave->mWaveAndGroupId);
|
||||||
wave_bank->setWaveInfo(tmp, wave_info);
|
wave_bank->setWaveInfo(waveId, wave_info);
|
||||||
}
|
}
|
||||||
wave_bank->setFileName(archive->mFileName);
|
wave_bank->setFileName(archive->mFileName);
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ char* JASWaveArcLoader::getCurrentDir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JASWaveArc::JASWaveArc() : mHeap(this) {
|
JASWaveArc::JASWaveArc() : mHeap(this) {
|
||||||
_48 = 0;
|
mCurrentlyLoaded = 0;
|
||||||
mStatus = 0;
|
mStatus = 0;
|
||||||
mEntryNum = -1;
|
mEntryNum = -1;
|
||||||
mFileLength = 0;
|
mFileLength = 0;
|
||||||
@@ -57,7 +57,7 @@ bool JASWaveArc::loadSetup(u32 param_0) {
|
|||||||
if (mStatus != 1) {
|
if (mStatus != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_48 = 1;
|
mCurrentlyLoaded = 1;
|
||||||
mStatus = 2;
|
mStatus = 2;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ bool JASWaveArc::eraseSetup() {
|
|||||||
mStatus = 0;
|
mStatus = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
_48 = 0;
|
mCurrentlyLoaded = 0;
|
||||||
mStatus = 0;
|
mStatus = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ void JASWaveArc::loadToAramCallback(void* this_) {
|
|||||||
|
|
||||||
bool JASWaveArc::sendLoadCmd() {
|
bool JASWaveArc::sendLoadCmd() {
|
||||||
JASMutexLock mutexLock(&mMutex);
|
JASMutexLock mutexLock(&mMutex);
|
||||||
_48 = 0;
|
mCurrentlyLoaded = 0;
|
||||||
mStatus = 1;
|
mStatus = 1;
|
||||||
loadToAramCallbackParams commandInfo;
|
loadToAramCallbackParams commandInfo;
|
||||||
commandInfo.mWavArc = this;
|
commandInfo.mWavArc = this;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ void DspHandShake(void*) {
|
|||||||
Dsp_Running_Start();
|
Dsp_Running_Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 jdsp[7936] = {
|
static u8 jdsp[7936] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x02, 0x9F, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00,
|
0x02, 0x9F, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00,
|
||||||
0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0x9F, 0x06, 0xA5,
|
0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0x9F, 0x06, 0xA5,
|
||||||
0x02, 0x9F, 0x00, 0x4E, 0x12, 0x05, 0x02, 0xBF, 0x00, 0x57, 0x81, 0x00, 0x00, 0x9F, 0x10, 0x00,
|
0x02, 0x9F, 0x00, 0x4E, 0x12, 0x05, 0x02, 0xBF, 0x00, 0x57, 0x81, 0x00, 0x00, 0x9F, 0x10, 0x00,
|
||||||
@@ -524,9 +524,9 @@ ATTRIBUTE_ALIGN(32) static u8 jdsp[7936] = {
|
|||||||
0x80, 0x01, 0x02, 0xBF, 0x00, 0xF4, 0x02, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x80, 0x01, 0x02, 0xBF, 0x00, 0xF4, 0x02, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static DSPTaskInfo audio_task;
|
static DSPTaskInfo audio_task ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 AUDIO_YIELD_BUFFER[8192];
|
static u8 AUDIO_YIELD_BUFFER[8192] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
void DspBoot(void (*requestCallback)(void*)) {
|
void DspBoot(void (*requestCallback)(void*)) {
|
||||||
DspInitWork();
|
DspInitWork();
|
||||||
|
|||||||
@@ -452,13 +452,13 @@ static void dummy() {
|
|||||||
JUTXfb::getManager()->setDisplayingXfbIndex(0);
|
JUTXfb::getManager()->setDisplayingXfbIndex(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static Mtx e_mtx = {
|
static Mtx e_mtx ATTRIBUTE_ALIGN(32) = {
|
||||||
{1.0f, 0.0f, 0.0f, 0.0f},
|
{1.0f, 0.0f, 0.0f, 0.0f},
|
||||||
{0.0f, 1.0f, 0.0f, 0.0f},
|
{0.0f, 1.0f, 0.0f, 0.0f},
|
||||||
{0.0f, 0.0f, 1.0f, 0.0f},
|
{0.0f, 0.0f, 1.0f, 0.0f},
|
||||||
};
|
};
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 clear_z_TX[64] = {
|
static u8 clear_z_TX[64] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
|
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
|
||||||
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
|
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ inline f64 getConst2() {
|
|||||||
return 9.765625E-4;
|
return 9.765625E-4;
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_;
|
DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_ ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_;
|
DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_ ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_;
|
DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_ ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
} // namespace JMath
|
} // namespace JMath
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ JPAResource::JPAResource() {
|
|||||||
mUsrIdx = fldNum = keyNum = texNum = mpCalcEmitterFuncListNum = mpDrawEmitterFuncListNum = mpDrawEmitterChildFuncListNum = mpCalcParticleFuncListNum = mpDrawParticleFuncListNum = mpCalcParticleChildFuncListNum = mpDrawParticleChildFuncListNum = 0;
|
mUsrIdx = fldNum = keyNum = texNum = mpCalcEmitterFuncListNum = mpDrawEmitterFuncListNum = mpDrawEmitterChildFuncListNum = mpCalcParticleFuncListNum = mpDrawParticleFuncListNum = mpCalcParticleChildFuncListNum = mpDrawParticleChildFuncListNum = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 jpa_pos[324] = {
|
static u8 jpa_pos[324] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x32, 0xCE, 0x00, 0x00, 0xCE, 0x00, 0xE7, 0x00, 0x00, 0x19,
|
0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x32, 0xCE, 0x00, 0x00, 0xCE, 0x00, 0xE7, 0x00, 0x00, 0x19,
|
||||||
0x00, 0x00, 0x19, 0xCE, 0x00, 0xE7, 0xCE, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE,
|
0x00, 0x00, 0x19, 0xCE, 0x00, 0xE7, 0xCE, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE,
|
||||||
0x00, 0xCE, 0xCE, 0x00, 0x00, 0x19, 0x00, 0x32, 0x19, 0x00, 0x32, 0xE7, 0x00, 0x00, 0xE7, 0x00,
|
0x00, 0xCE, 0xCE, 0x00, 0x00, 0x19, 0x00, 0x32, 0x19, 0x00, 0x32, 0xE7, 0x00, 0x00, 0xE7, 0x00,
|
||||||
@@ -70,7 +70,7 @@ ATTRIBUTE_ALIGN(32) static u8 jpa_pos[324] = {
|
|||||||
0x00, 0x00, 0x00, 0xCE,
|
0x00, 0x00, 0x00, 0xCE,
|
||||||
};
|
};
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 jpa_crd[32] = {
|
static u8 jpa_crd[32] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x01,
|
0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x01,
|
||||||
0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02,
|
0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] = {
|
DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04,
|
0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C,
|
0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C,
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ void TRK__read_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TRK__write_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
|
void TRK__write_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
|
||||||
ATTRIBUTE_ALIGN(32) u8 buff[32];
|
u8 buff[32] ATTRIBUTE_ALIGN(32);
|
||||||
u32 err;
|
u32 err;
|
||||||
__REGISTER int count = c;
|
__REGISTER int count = c;
|
||||||
__REGISTER u32 bf;
|
__REGISTER u32 bf;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ DSError TRKDoSupportMask(TRKBuffer*) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DSError TRKDoReadMemory(TRKBuffer* buffer) {
|
DSError TRKDoReadMemory(TRKBuffer* buffer) {
|
||||||
ATTRIBUTE_ALIGN(32) u8 buf[0x820];
|
u8 buf[0x820] ATTRIBUTE_ALIGN(32);
|
||||||
size_t tempLength;
|
size_t tempLength;
|
||||||
int result;
|
int result;
|
||||||
int replyErr;
|
int replyErr;
|
||||||
@@ -158,7 +158,7 @@ DSError TRKDoReadMemory(TRKBuffer* buffer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DSError TRKDoWriteMemory(TRKBuffer* b) {
|
DSError TRKDoWriteMemory(TRKBuffer* b) {
|
||||||
ATTRIBUTE_ALIGN(32) u8 buf[0x820];
|
u8 buf[0x820] ATTRIBUTE_ALIGN(32);
|
||||||
size_t tempLength;
|
size_t tempLength;
|
||||||
int options;
|
int options;
|
||||||
int result;
|
int result;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#include "__ax.h"
|
#include "__ax.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static s32 __AXBufferAuxA[3][480];
|
static s32 __AXBufferAuxA[3][480] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static s32 __AXBufferAuxB[3][480];
|
static s32 __AXBufferAuxB[3][480] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static void (* __AXCallbackAuxA)(void*, void*);
|
static void (* __AXCallbackAuxA)(void*, void*);
|
||||||
static void (* __AXCallbackAuxB)(void*, void*);
|
static void (* __AXCallbackAuxB)(void*, void*);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "__ax.h"
|
#include "__ax.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static AXSPB __AXStudio;
|
static AXSPB __AXStudio ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static s32 __AXSpbAL;
|
static s32 __AXSpbAL;
|
||||||
static s32 __AXSpbAR;
|
static s32 __AXSpbAR;
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ static u32 __AXAuxMixCycles[32] = {
|
|||||||
0x000009E2, 0x00000E97
|
0x000009E2, 0x00000E97
|
||||||
};
|
};
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static AXPB __AXPB[AX_MAX_VOICES];
|
static AXPB __AXPB[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static AXPBITDBUFFER __AXITD[AX_MAX_VOICES];
|
static AXPBITDBUFFER __AXITD[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static AXPBU __AXUpdates[AX_MAX_VOICES];
|
static AXPBU __AXUpdates[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32);
|
||||||
static AXVPB __AXVPB[AX_MAX_VOICES];
|
static AXVPB __AXVPB[AX_MAX_VOICES];
|
||||||
|
|
||||||
static u32 __AXMaxDspCycles;
|
static u32 __AXMaxDspCycles;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
u16 axDspSlaveLength = (AX_DSP_SLAVE_LENGTH * 2);
|
u16 axDspSlaveLength = (AX_DSP_SLAVE_LENGTH * 2);
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) u16 axDspSlave[AX_DSP_SLAVE_LENGTH] = {
|
u16 axDspSlave[AX_DSP_SLAVE_LENGTH] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x0000, 0x0000, 0x029F, 0x0E88, 0x029F, 0x0E97,
|
0x0000, 0x0000, 0x029F, 0x0E88, 0x029F, 0x0E97,
|
||||||
0x029F, 0x0EB3, 0x029F, 0x0ED3, 0x029F, 0x0ED9,
|
0x029F, 0x0EB3, 0x029F, 0x0ED3, 0x029F, 0x0ED9,
|
||||||
0x029F, 0x0F0B, 0x029F, 0x0F11, 0x1302, 0x1303,
|
0x029F, 0x0F0B, 0x029F, 0x0F11, 0x1302, 0x1303,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "__card.h"
|
#include "__card.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static u8 CardData[352] = {
|
static u8 CardData[352] ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0xFF, 0x00, 0x21, 0x13, 0x06, 0x12, 0x03, 0x12, 0x04,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0xFF, 0x00, 0x21, 0x13, 0x06, 0x12, 0x03, 0x12, 0x04,
|
||||||
0x13, 0x05, 0x00, 0x92, 0x00, 0xFF, 0x00, 0x88, 0xFF, 0xFF, 0x00, 0x89, 0xFF, 0xFF, 0x00, 0x8A, 0xFF, 0xFF, 0x00,
|
0x13, 0x05, 0x00, 0x92, 0x00, 0xFF, 0x00, 0x88, 0xFF, 0xFF, 0x00, 0x89, 0xFF, 0xFF, 0x00, 0x8A, 0xFF, 0xFF, 0x00,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <dolphin/demo.h>
|
#include <dolphin/demo.h>
|
||||||
#include "sdk_math.h"
|
#include "sdk_math.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static s16 __AVX_internal_buffer[3200];
|
static s16 __AVX_internal_buffer[3200] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static void (*__AVX_save_isr)(void);
|
static void (*__AVX_save_isr)(void);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <dolphin/dolphin.h>
|
#include <dolphin/dolphin.h>
|
||||||
#include <dolphin/demo.h>
|
#include <dolphin/demo.h>
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) u32 DEMOFontBitmap[768] = {
|
u32 DEMOFontBitmap[768] ATTRIBUTE_ALIGN(32) = {
|
||||||
0x00000000,
|
0x00000000,
|
||||||
0x00000000,
|
0x00000000,
|
||||||
0x00000000,
|
0x00000000,
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void* __piReg;
|
|||||||
GXBool __GXinBegin;
|
GXBool __GXinBegin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u16 DefaultTexData[] = {
|
static u16 DefaultTexData[] ATTRIBUTE_ALIGN(32) = {
|
||||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ const char* __MCCVersion = "<< Dolphin SDK - MCC\tdebug build: Apr 5 2004 03:57
|
|||||||
const char* __MCCVersion = "<< Dolphin SDK - MCC\trelease build: Apr 5 2004 04:15:49 (0x2301) >>";
|
const char* __MCCVersion = "<< Dolphin SDK - MCC\trelease build: Apr 5 2004 04:15:49 (0x2301) >>";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static MCC_ChannelInfo gChannelInfo[16];
|
static MCC_ChannelInfo gChannelInfo[16] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static char gStreamWork[32];
|
static char gStreamWork[32] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static char m_szAdapterMode[32];
|
static char m_szAdapterMode[32] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static char m_szInitCode[32];
|
static char m_szInitCode[32] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static MCC_Info channelInfo[16];
|
static MCC_Info channelInfo[16] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
volatile static BOOL gIsChannelinfoDirty = TRUE;
|
volatile static BOOL gIsChannelinfoDirty = TRUE;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "__os.h"
|
#include "__os.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static SramControl Scb;
|
static SramControl Scb ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT);
|
||||||
|
|
||||||
// prototypes
|
// prototypes
|
||||||
static int GetRTC(u32* rtc);
|
static int GetRTC(u32* rtc);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "__card.h"
|
#include "__card.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static u8 CardData[352] = {
|
static u8 CardData[352] ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0xFF, 0x00, 0x21, 0x13, 0x06, 0x12, 0x03, 0x12, 0x04,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0xFF, 0x00, 0x21, 0x13, 0x06, 0x12, 0x03, 0x12, 0x04,
|
||||||
0x13, 0x05, 0x00, 0x92, 0x00, 0xFF, 0x00, 0x88, 0xFF, 0xFF, 0x00, 0x89, 0xFF, 0xFF, 0x00, 0x8A, 0xFF, 0xFF, 0x00,
|
0x13, 0x05, 0x00, 0x92, 0x00, 0xFF, 0x00, 0x88, 0xFF, 0xFF, 0x00, 0x89, 0xFF, 0xFF, 0x00, 0x8A, 0xFF, 0xFF, 0x00,
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ static u32 LastError;
|
|||||||
static BOOL ResetRequired;
|
static BOOL ResetRequired;
|
||||||
static u32 MotorState;
|
static u32 MotorState;
|
||||||
static volatile OSTime LastResetEnd;
|
static volatile OSTime LastResetEnd;
|
||||||
ATTRIBUTE_ALIGN(32) static u32 __DVDNumTmdBytes;
|
static u32 __DVDNumTmdBytes ATTRIBUTE_ALIGN(32);
|
||||||
static DVDGameTOC* GameToc;
|
static DVDGameTOC* GameToc;
|
||||||
static DVDPartitionInfo* PartInfo;
|
static DVDPartitionInfo* PartInfo;
|
||||||
static DVDPartitionInfo* BootGameInfo;
|
static DVDPartitionInfo* BootGameInfo;
|
||||||
@@ -80,10 +80,10 @@ static DVDCommandBlock DummyCommandBlock;
|
|||||||
static OSAlarm ResetAlarm;
|
static OSAlarm ResetAlarm;
|
||||||
static OSAlarm CoverAlarm;
|
static OSAlarm CoverAlarm;
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 __DVDGameTocBuffer[OSRoundUp32B(sizeof(DVDGameTOC) * 4)];
|
static u8 __DVDGameTocBuffer[OSRoundUp32B(sizeof(DVDGameTOC) * 4)] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static u8 __DVDPartInfoBuffer[OSRoundUp32B(sizeof(DVDPartitionInfo) * 4)];
|
static u8 __DVDPartInfoBuffer[OSRoundUp32B(sizeof(DVDPartitionInfo) * 4)] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static u8 __DVDTmdBuffer[OSRoundUp32B(sizeof(ESTitleMeta))];
|
static u8 __DVDTmdBuffer[OSRoundUp32B(sizeof(ESTitleMeta))] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static u8 __DVDTicketViewBuffer[OSRoundUp32B(sizeof(ESTicketView))];
|
static u8 __DVDTicketViewBuffer[OSRoundUp32B(sizeof(ESTicketView))] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static OSAlarm FatalAlarm;
|
static OSAlarm FatalAlarm;
|
||||||
DVDCommandBlock __DVDStopMotorCommandBlock;
|
DVDCommandBlock __DVDStopMotorCommandBlock;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "__os.h"
|
#include "__os.h"
|
||||||
#include "__dvd.h"
|
#include "__dvd.h"
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 CheckBuffer[32];
|
static u8 CheckBuffer[32] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static volatile BOOL lowDone = TRUE;
|
static volatile BOOL lowDone = TRUE;
|
||||||
static volatile u32 lowIntType = 0;
|
static volatile u32 lowIntType = 0;
|
||||||
|
|||||||
@@ -8,15 +8,15 @@ static volatile u8 requestInProgress = FALSE;
|
|||||||
static u8 breakRequested;
|
static u8 breakRequested;
|
||||||
static u8 callbackInProgress;
|
static u8 callbackInProgress;
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u32 registerBuf[8];
|
static u32 registerBuf[8] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static u32 statusRegister[8];
|
static u32 statusRegister[8] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static u32 controlRegister[8];
|
static u32 controlRegister[8] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static s32 lastTicketError[8];
|
static s32 lastTicketError[8] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static u32 readLength;
|
static u32 readLength;
|
||||||
static u32 spinUpValue;
|
static u32 spinUpValue;
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static diRegVals_t diRegValCache;
|
static diRegVals_t diRegValCache ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static u8 DVDLowInitCalled = FALSE;
|
static u8 DVDLowInitCalled = FALSE;
|
||||||
|
|
||||||
@@ -42,8 +42,8 @@ typedef struct dvdContext {
|
|||||||
|
|
||||||
static int freeDvdContext = 0;
|
static int freeDvdContext = 0;
|
||||||
static u8 dvdContextsInited = FALSE;
|
static u8 dvdContextsInited = FALSE;
|
||||||
ATTRIBUTE_ALIGN(32) static dvdContext_t dvdContexts[4];
|
static dvdContext_t dvdContexts[4] ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) static IOSIoVector ioVec[10];
|
static IOSIoVector ioVec[10] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static void* ddrAllocAligned32(const int size) {
|
static void* ddrAllocAligned32(const int size) {
|
||||||
void* low, *high;
|
void* low, *high;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ static NANDCommandBlock NandCb;
|
|||||||
static NANDFileInfo NandInfo;
|
static NANDFileInfo NandInfo;
|
||||||
static DVDCBCallback Callback;
|
static DVDCBCallback Callback;
|
||||||
static u32 NextOffset;
|
static u32 NextOffset;
|
||||||
ATTRIBUTE_ALIGN(32) DVDErrorInfo __ErrorInfo;
|
DVDErrorInfo __ErrorInfo ATTRIBUTE_ALIGN(32);
|
||||||
ATTRIBUTE_ALIGN(32) DVDErrorInfo __FirstErrorInfo;
|
DVDErrorInfo __FirstErrorInfo ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
void cbForNandClose(s32 result, NANDCommandBlock* block) {
|
void cbForNandClose(s32 result, NANDCommandBlock* block) {
|
||||||
if (Callback) {
|
if (Callback) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ s32 ESP_CloseLib(void) {
|
|||||||
|
|
||||||
s32 ESP_LaunchTitle(u64 titleID, ESTicketView* pTicketView) {
|
s32 ESP_LaunchTitle(u64 titleID, ESTicketView* pTicketView) {
|
||||||
s32 ret = 0;
|
s32 ret = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 buf[256];
|
u8 buf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* vec = (IOSIoVector*)(buf + 208);
|
IOSIoVector* vec = (IOSIoVector*)(buf + 208);
|
||||||
u64* id = (u64*)buf;
|
u64* id = (u64*)buf;
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_GetTicketViews(ESTitleId titleId, ESTicketView* ticketViewList, u32* ticketViewCnt) {
|
s32 ESP_GetTicketViews(ESTitleId titleId, ESTicketView* ticketViewList, u32* ticketViewCnt) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
ESTitleId* p1 = (ESTitleId*)__esBuf;
|
ESTitleId* p1 = (ESTitleId*)__esBuf;
|
||||||
u32* p2 = (u32*)(__esBuf + 32);
|
u32* p2 = (u32*)(__esBuf + 32);
|
||||||
@@ -111,7 +111,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_DiGetTicketView(const void* ticket, ESTicketView* ticketView) {
|
s32 ESP_DiGetTicketView(const void* ticket, ESTicketView* ticketView) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
|
|
||||||
if (__esFd < 0 || ticketView == NULL) {
|
if (__esFd < 0 || ticketView == NULL) {
|
||||||
@@ -142,7 +142,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_DiGetTmd(ESTitleMeta* tmd, u32* tmdSize) {
|
s32 ESP_DiGetTmd(ESTitleMeta* tmd, u32* tmdSize) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
u32* p1 = (u32*)__esBuf;
|
u32* p1 = (u32*)__esBuf;
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_GetTmdView(ESTitleId titleId, ESTmdView* tmdView, u32* size) {
|
s32 ESP_GetTmdView(ESTitleId titleId, ESTmdView* tmdView, u32* size) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
ESTitleId* p1 = (ESTitleId*)__esBuf;
|
ESTitleId* p1 = (ESTitleId*)__esBuf;
|
||||||
u32* p2 = (u32*)(__esBuf + 32);
|
u32* p2 = (u32*)(__esBuf + 32);
|
||||||
@@ -233,7 +233,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_GetDataDir(ESTitleId titleId, char* dataDir) {
|
s32 ESP_GetDataDir(ESTitleId titleId, char* dataDir) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
ESTitleId* p1 = (ESTitleId*)__esBuf;
|
ESTitleId* p1 = (ESTitleId*)__esBuf;
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_GetTitleId(ESTitleId* titleId) {
|
s32 ESP_GetTitleId(ESTitleId* titleId) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
|
|
||||||
if (__esFd < 0 || titleId == NULL) {
|
if (__esFd < 0 || titleId == NULL) {
|
||||||
@@ -283,7 +283,7 @@ out:
|
|||||||
|
|
||||||
s32 ESP_GetConsumption(ESTicketId ticketId, ESLpEntry* entries, u32* nEntries) {
|
s32 ESP_GetConsumption(ESTicketId ticketId, ESLpEntry* entries, u32* nEntries) {
|
||||||
s32 rv = 0;
|
s32 rv = 0;
|
||||||
ATTRIBUTE_ALIGN(32) u8 __esBuf[256];
|
u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
|
||||||
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
|
||||||
ESTicketId* p1 = (ESTicketId*)__esBuf;
|
ESTicketId* p1 = (ESTicketId*)__esBuf;
|
||||||
u32* p2 = (u32*)(__esBuf + 32);
|
u32* p2 = (u32*)(__esBuf + 32);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ typedef struct isfs_GetUsage {
|
|||||||
} isfs_GetUsage;
|
} isfs_GetUsage;
|
||||||
|
|
||||||
typedef struct __isfsCtxt {
|
typedef struct __isfsCtxt {
|
||||||
ATTRIBUTE_ALIGN(32) u8 ioBuf[ROUNDUP(256)];
|
u8 ioBuf[ROUNDUP(256)] ATTRIBUTE_ALIGN(32);
|
||||||
ISFSCallback cb;
|
ISFSCallback cb;
|
||||||
void* ctxt;
|
void* ctxt;
|
||||||
u32 func;
|
u32 func;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ volatile void* __piReg;
|
|||||||
GXBool __GXinBegin;
|
GXBool __GXinBegin;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u16 DefaultTexData[] = {
|
static u16 DefaultTexData[] ATTRIBUTE_ALIGN(32) = {
|
||||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||||
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace nw4hbm {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
/* 0x00 (base) */
|
/* 0x00 (base) */
|
||||||
/* 0xD4 */ ATTRIBUTE_ALIGN(4) ut::Color mVtxColors[VERTEXCOLOR_MAX];
|
/* 0xD4 */ ut::Color mVtxColors[VERTEXCOLOR_MAX] ATTRIBUTE_ALIGN(4);
|
||||||
/* 0xE4 */ detail::TexCoordAry mTexCoordAry;
|
/* 0xE4 */ detail::TexCoordAry mTexCoordAry;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ namespace nw4hbm {
|
|||||||
public:
|
public:
|
||||||
/* 0x14 */ ut::LinkListNode mLinkNode;
|
/* 0x14 */ ut::LinkListNode mLinkNode;
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 mMramBuf[LOAD_BUFFER_SIZE];
|
static u8 mMramBuf[LOAD_BUFFER_SIZE] ATTRIBUTE_ALIGN(32);
|
||||||
};
|
};
|
||||||
typedef ut::LinkList<LoadCommand, offsetof(LoadCommand, mLinkNode)> LoadCommandList;
|
typedef ut::LinkList<LoadCommand, offsetof(LoadCommand, mLinkNode)> LoadCommandList;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ static u32 __relnchFl = 0;
|
|||||||
|
|
||||||
typedef struct IOSRpcRequest {
|
typedef struct IOSRpcRequest {
|
||||||
IOSResourceRequest request;
|
IOSResourceRequest request;
|
||||||
ATTRIBUTE_ALIGN(32) IOSIpcCb cb; // I am assuming this is aligned due to where cbArg is stored, and I see nothing between cb and callback_arg?
|
IOSIpcCb cb ATTRIBUTE_ALIGN(32); // I am assuming this is aligned due to where cbArg is stored, and I see nothing between cb and callback_arg?
|
||||||
void* callback_arg;
|
void* callback_arg;
|
||||||
u32 relaunch_flag;
|
u32 relaunch_flag;
|
||||||
OSThreadQueue thread_queue;
|
OSThreadQueue thread_queue;
|
||||||
@@ -37,7 +37,7 @@ static IOSRpcRequest* __relnchRpcSave = 0;
|
|||||||
|
|
||||||
#define ROUNDUP(sz) (((u32)(sz) + (IPC_BUF_CNT / 2 - 1)) & ~(u32)(IPC_BUF_CNT / 2 - 1))
|
#define ROUNDUP(sz) (((u32)(sz) + (IPC_BUF_CNT / 2 - 1)) & ~(u32)(IPC_BUF_CNT / 2 - 1))
|
||||||
|
|
||||||
ATTRIBUTE_ALIGN(32) static u8 __rpcBuf[ROUNDUP(sizeof(IOSRpcRequest))];
|
static u8 __rpcBuf[ROUNDUP(sizeof(IOSRpcRequest))] ATTRIBUTE_ALIGN(32);
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
u32 rcount;
|
u32 rcount;
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ enum LibState {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static enum LibState s_libState = STATE_NOT_INITIALIZED;
|
static enum LibState s_libState = STATE_NOT_INITIALIZED;
|
||||||
ATTRIBUTE_ALIGN(32) static char s_currentDir[64] = "/";
|
static char s_currentDir[64] ATTRIBUTE_ALIGN(32) = "/";
|
||||||
ATTRIBUTE_ALIGN(32) static char s_homeDir[64] = "";
|
static char s_homeDir[64] ATTRIBUTE_ALIGN(32) = "";
|
||||||
|
|
||||||
static BOOL nandOnShutdown(BOOL final, u32 event);
|
static BOOL nandOnShutdown(BOOL final, u32 event);
|
||||||
void nandConvertPath(char* abspath, const char* wd, const char* relpath);
|
void nandConvertPath(char* abspath, const char* wd, const char* relpath);
|
||||||
@@ -262,7 +262,7 @@ s32 nandConvertErrorCode(const ISFSError err) {
|
|||||||
for (; i < sizeof(ERRMAP) / 4; i = i + 2) {
|
for (; i < sizeof(ERRMAP) / 4; i = i + 2) {
|
||||||
if (ERRMAP[i] == err) {
|
if (ERRMAP[i] == err) {
|
||||||
if (err == ISFS_ERROR_ECC_CRIT || err == ISFS_ERROR_HMAC || err == ISFS_ERROR_UNKNOWN || err == IOS_ERROR_UNKNOWN || err == IOS_ERROR_ECC_CRIT) {
|
if (err == ISFS_ERROR_ECC_CRIT || err == ISFS_ERROR_HMAC || err == ISFS_ERROR_UNKNOWN || err == IOS_ERROR_UNKNOWN || err == IOS_ERROR_ECC_CRIT) {
|
||||||
ATTRIBUTE_ALIGN(64) char buf[128];
|
char buf[128] ATTRIBUTE_ALIGN(64);
|
||||||
sprintf(buf, "ISFS error code: %d", err);
|
sprintf(buf, "ISFS error code: %d", err);
|
||||||
NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf);
|
NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf);
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ s32 nandConvertErrorCode(const ISFSError err) {
|
|||||||
|
|
||||||
OSReport("CAUTION! Unexpected error code [%d] was found.\n", err);
|
OSReport("CAUTION! Unexpected error code [%d] was found.\n", err);
|
||||||
{
|
{
|
||||||
ATTRIBUTE_ALIGN(64) char buf[128];
|
char buf[128] ATTRIBUTE_ALIGN(64);
|
||||||
sprintf(buf, "ISFS unexpected error code: %d", err);
|
sprintf(buf, "ISFS unexpected error code: %d", err);
|
||||||
NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf);
|
NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
static IOSFd s_fd = -255;
|
static IOSFd s_fd = -255;
|
||||||
static IOSError s_err = ISFS_ERROR_UNKNOWN;
|
static IOSError s_err = ISFS_ERROR_UNKNOWN;
|
||||||
static int s_stage;
|
static int s_stage;
|
||||||
ATTRIBUTE_ALIGN(64) static char s_message[256];
|
static char s_message[256] ATTRIBUTE_ALIGN(64);
|
||||||
static NANDLoggingCallback s_callback = 0;
|
static NANDLoggingCallback s_callback = 0;
|
||||||
|
|
||||||
static void asyncRoutine(ISFSError, void*);
|
static void asyncRoutine(ISFSError, void*);
|
||||||
@@ -70,8 +70,8 @@ static void callbackRoutine(BOOL result) {
|
|||||||
|
|
||||||
static void asyncRoutine(ISFSError result, void *ctxt) {
|
static void asyncRoutine(ISFSError result, void *ctxt) {
|
||||||
ISFSError ret = ISFS_ERROR_UNKNOWN;
|
ISFSError ret = ISFS_ERROR_UNKNOWN;
|
||||||
ATTRIBUTE_ALIGN(64) static char s_rBuf[256];
|
static char s_rBuf[256] ATTRIBUTE_ALIGN(64);
|
||||||
ATTRIBUTE_ALIGN(64) static char s_wBuf[256];
|
static char s_wBuf[256] ATTRIBUTE_ALIGN(64);
|
||||||
++s_stage;
|
++s_stage;
|
||||||
|
|
||||||
if (s_stage == 2) {
|
if (s_stage == 2) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user