Compare commits

..

12 Commits

Author SHA1 Message Date
MelonSpeedruns 957ab06fc2 fix autosave spam 2026-05-14 09:36:00 -04:00
MelonSpeedruns fe270d976d Merge remote-tracking branch 'origin/main' into rando/new-item 2026-05-14 09:20:46 -04:00
MelonSpeedruns 9e0966e069 don't change save file length and use unused slot for ghost lantern 2026-05-08 16:32:12 -04:00
MelonSpeedruns b51e672540 Merge remote-tracking branch 'origin/main' into rando/new-item 2026-05-08 15:38:02 -04:00
MelonSpeedruns c844eb2b4a Merge remote-tracking branch 'origin/main' into rando/new-item 2026-05-05 08:33:25 -04:00
MelonSpeedruns 416bfaa90b added light to lantern + proper blue flame particle 2026-05-01 10:17:29 -04:00
MelonSpeedruns 365a0a2188 fire particle + closed link hand 2026-04-28 13:02:31 -04:00
MelonSpeedruns 4ff41fce4e Merge branch 'main' into rando/new-item 2026-04-26 12:10:21 -04:00
MelonSpeedruns a470b73b1b fix weirdnesses with real lantern 2026-04-26 12:10:08 -04:00
MelonSpeedruns 120864a5c9 working lantern model but with hack atm 2026-04-25 18:18:02 -04:00
MelonSpeedruns ba7fc14e87 added poe lantern wip code 2026-04-25 17:17:12 -04:00
MelonSpeedruns c42d10a74b new item code 2026-04-24 16:01:15 -04:00
1976 changed files with 28121 additions and 58088 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
--- ---
Language: Cpp Language: Cpp
Standard: c++20 Standard: C++03
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false AlignConsecutiveAssignments: false
-121
View File
@@ -1,121 +0,0 @@
name: Bug Report
description: Report an issue with Dusklight
type: Bug
body:
- type: checkboxes
id: official-build-certification
attributes:
label: Mods and Forks
description: Certify that this issue exists on the official builds of Dusklight
options:
- label: The bug occurs on an **official release** of Dusklight, without any forks or third-party patches installed
required: true
validations:
required: true
- type: input
id: dusklight-version
attributes:
label: Dusklight Version
placeholder: ex. 1.3.1
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Bug Description
placeholder: Describe the bug you are encountering
validations:
required: true
- type: textarea
id: repro-steps
attributes:
label: Steps to Reproduce
placeholder: |
1. Load save
2. Go to Hyrule Field
3. See bug
- type: textarea
id: expected-behavior
attributes:
label: Expected Behavior
placeholder: Describe what should be happening
- type: textarea
id: current-behavior
attributes:
label: Current Behavior
placeholder: Describe what is happening instead
- type: dropdown
id: system-os-architecture
attributes:
label: OS / Architecture
description: The operating system and architecture you are running Dusklight on
options:
- Windows x86-64
- Windows ARM64
- MacOS ARM64
- MacOS x86-64
- Linux ARM64
- Linux x84-64
- Android ARM64
- iOS ARM64
validations:
required: true
- type: dropdown
id: game-disc
attributes:
label: Game Disc
description: The game disc you are playing on
options:
- GameCube NTSC-U (North America)
- GameCube PAL (Europe)
- GameCube NTSC-J (Japan)
- Wii NTSC-U (North America) Revision 0
- Wii NTSC-U (North America) Revision 2
- Wii PAL (Europe)
- Wii NTSC-J (Japan)
validations:
required: true
- type: input
id: game-language
attributes:
label: Game Language
description: The language you are playing the game in
placeholder: ex. English, Spanish, etc.
- type: dropdown
attributes:
label: Graphics Backend
options:
- Vulkan
- D3D12
- Metal
- D3D11
- OpenGL ES
- Unsure / Default
default: 5
- type: textarea
id: texture-packs-mods
attributes:
label: Texture Packs and Mods
placeholder: List any texture packs or mods you had installed
- type: upload
id: logs-upload
attributes:
label: Logs and Other Files
description: Include any relevant logs, config files, or saves to reproduce the bug
- type: textarea
id: additional-context
attributes:
label: Additional Context
placeholder: Any other information that might be helpful
@@ -1,24 +0,0 @@
name: Feature Request
description: Request a new Dusklight feature. Not all requests can/will be included, but we will take these ideas into consideration.
type: Feature
body:
- type: textarea
id: feature-description
attributes:
label: Feature Description
placeholder: Describe the feature you are requesting
validations:
required: true
- type: input
id: feature-platform
attributes:
label: Platform
description: If applicable, list the platforms this feature applies to. If it is for all platforms, feel free to leave this field blank.
placeholder: ex. Mac, Android, Steam Deck, etc.
- type: textarea
id: feature-related-info
attributes:
label: Additional Information
placeholder: Any other information that might be helpful (related features, existing implementations, open pull requests or issues, etc.)
+20 -39
View File
@@ -5,16 +5,7 @@ on:
paths-ignore: paths-ignore:
- '*.md' - '*.md'
- '*LICENSE' - '*LICENSE'
- 'docs/**'
pull_request: pull_request:
paths-ignore:
- '*.md'
- '*LICENSE'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env: env:
SCCACHE_GHA_ENABLED: "true" SCCACHE_GHA_ENABLED: "true"
@@ -31,13 +22,13 @@ jobs:
matrix: matrix:
include: include:
- name: GCC x86_64 - name: GCC x86_64
runner: ubuntu-24.04 runner: ubuntu-latest
preset: gcc preset: gcc
artifact_arch: x86_64 artifact_arch: x86_64
- name: GCC aarch64 # - name: GCC aarch64
runner: ubuntu-24.04-arm # runner: ubuntu-24.04-arm
preset: gcc # preset: gcc
artifact_arch: aarch64 # artifact_arch: aarch64
# - name: Clang x86_64 # - name: Clang x86_64
# runner: ubuntu-latest # runner: ubuntu-latest
# preset: clang # preset: clang
@@ -52,7 +43,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get -y install ninja-build clang lld mold openssl libcurl4-openssl-dev \ sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \ zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \ libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \
libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \ libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \
@@ -76,11 +67,10 @@ 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.*
build/install/sdk/
build-apple: build-apple:
name: Build Apple (${{matrix.name}}) name: Build Apple (${{matrix.name}})
@@ -145,11 +135,10 @@ 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.*
build/install/sdk/
build-android: build-android:
name: Build Android (${{matrix.name}}) name: Build Android (${{matrix.name}})
@@ -205,24 +194,18 @@ jobs:
- name: Build native library - name: Build native library
run: cmake --build --preset ${{matrix.preset}} --target dusklight run: cmake --build --preset ${{matrix.preset}} --target dusklight
- name: Build bundled mods - name: Stage stripped JNI library
run: cmake --build --preset ${{matrix.preset}} --target dusklight_mods run: ANDROID_STAGE_ABIS="${{matrix.abi}}" platforms/android/scripts/stage-jni-libs.sh
- name: Build APK - name: Build APK
working-directory: platforms/android working-directory: platforms/android
run: ./gradlew :app:assembleRelease --rerun-tasks run: ./gradlew :app:assembleRelease --rerun-tasks
- name: Stage artifacts
run: |
mkdir -p upload/sdk
cp build/*/stub-android-*.so upload/sdk/
cp platforms/android/app/build/outputs/apk/release/app-${{matrix.abi}}-release-unsigned.apk upload/
- name: Upload artifacts - 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: platforms/android/app/build/outputs/apk/release/app-${{matrix.abi}}-release-unsigned.apk
build-windows: build-windows:
name: Build Windows (${{matrix.name}}) name: Build Windows (${{matrix.name}})
@@ -238,12 +221,12 @@ jobs:
msvc_arch: amd64 msvc_arch: amd64
vcpkg_arch: x64 vcpkg_arch: x64
artifact_arch: x86_64 artifact_arch: x86_64
- name: MSVC arm64 # - name: MSVC arm64
runner: windows-latest # runner: windows-11-arm
preset: arm64-msvc # preset: arm64-msvc
msvc_arch: amd64_arm64 # msvc_arch: arm64
vcpkg_arch: arm64 # vcpkg_arch: arm64
artifact_arch: arm64 # artifact_arch: arm64
# - name: Clang x86_64 # - name: Clang x86_64
# runner: windows-latest # runner: windows-latest
# preset: clang # preset: clang
@@ -272,7 +255,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
choco install ninja choco install ninja
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows zstd:${{matrix.vcpkg_arch}}-windows vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static
- name: Configure CMake - name: Configure CMake
run: cmake --preset x-windows-ci-${{matrix.preset}} run: cmake --preset x-windows-ci-${{matrix.preset}}
@@ -283,11 +266,9 @@ 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
build/install/res/ build/install/res/
build/install/mods/
build/install/debug.7z build/install/debug.7z
build/install/sdk/
-3
View File
@@ -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
+242 -278
View File
@@ -5,16 +5,87 @@ 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) set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)")
borealis_detect_version()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
project(dusklight LANGUAGES C CXX VERSION ${BOREALIS_APP_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_WC_REVISION "")
set(DUSK_WC_BRANCH "")
set(DUSK_WC_DATE "")
message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}")
else ()
# obtain revision info from git
find_package(Git)
if (GIT_FOUND)
# make sure version information gets re-run when the current Git HEAD changes
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
OUTPUT_VARIABLE dusk_git_head_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
OUTPUT_VARIABLE dusk_git_head_symbolic
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
# defines DUSK_WC_REVISION
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE DUSK_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DESCRIBE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove the git hash, then collapse a clean "-0" suffix only
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
# defines DUSK_WC_BRANCH
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE DUSK_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DATE
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
OUTPUT_VARIABLE DUSK_WC_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
message(STATUS "Unable to find git, commit information will not be available")
endif ()
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
set(DUSK_VERSION_TWEAK "0")
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
endif ()
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
else ()
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
endif ()
endif ()
# Add version information to CI environment variables
if(DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
endif()
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
if (APPLE) if (APPLE)
enable_language(OBJC OBJCXX) enable_language(OBJC OBJCXX)
endif () endif ()
# Adjust CMAKE_SYSTEM_PROCESSOR on Windows to match compiler target
include(cmake/WindowsTargetProcessor.cmake)
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS) if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
# ios.toolchain.cmake hack for SDL # ios.toolchain.cmake hack for SDL
set(TVOS ON) set(TVOS ON)
@@ -33,40 +104,12 @@ 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
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_cmake") set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_cmake")
option(ENABLE_ASAN "Enable AddressSanitizer" OFF)
if (ENABLE_ASAN)
if (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/fsanitize=address>)
add_link_options(/fsanitize=address /INCREMENTAL:NO)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase")
foreach (_lang C CXX)
foreach (_rtc_flag /RTC1 /RTCc /RTCs /RTCu)
string(REPLACE "${_rtc_flag}" "" CMAKE_${_lang}_FLAGS_DEBUG "${CMAKE_${_lang}_FLAGS_DEBUG}")
endforeach ()
endforeach ()
elseif (CMAKE_C_COMPILER_FRONTEND_VARIANT STREQUAL "GNU" AND
CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
add_compile_options(
$<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-fsanitize=address>
$<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-fno-omit-frame-pointer>
)
add_link_options(-fsanitize=address)
else ()
message(FATAL_ERROR "ENABLE_ASAN requires GNU-like or MSVC-like C/C++ compiler frontends")
endif ()
add_compile_definitions(NDEBUG_SANITIZER) # Avoids absl issue with SwissTable debug code
message(STATUS "dusklight: Enabled AddressSanitizer")
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux) if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE) set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE)
endif () endif ()
@@ -76,56 +119,19 @@ 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")
set(DUSK_GFX_DEBUG_GROUPS_DEFAULT ON)
else ()
set(DUSK_GFX_DEBUG_GROUPS_DEFAULT OFF)
endif ()
option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)") option(DUSK_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_PACKAGE_INSTALL "Install Dusklight with a Linux-native file structure" OFF) option(DUSK_ENABLE_UPDATE_CHECKER "Enable update checking support" ON)
option(DUSK_GFX_DEBUG_GROUPS "Report debug groups to the native graphics API" ${DUSK_GFX_DEBUG_GROUPS_DEFAULT}) option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF)
option(DUSK_ENABLE_CODE_MODS "Enable code mods" OFF) set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
set(DUSK_HAS_FUNCHOOK OFF)
if (DUSK_ENABLE_CODE_MODS AND (NOT APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Darwin"))
set(DUSK_HAS_FUNCHOOK ON)
endif ()
set(DUSK_HAS_FUNCHOOK ${DUSK_HAS_FUNCHOOK} CACHE INTERNAL "Enable funchook" FORCE)
set(_target_architectures ${CMAKE_OSX_ARCHITECTURES})
if (NOT _target_architectures)
set(_target_architectures ${CMAKE_SYSTEM_PROCESSOR})
endif ()
list(LENGTH _target_architectures _target_arch_count)
set(DUSK_HAS_PREPATCH OFF)
if (DUSK_ENABLE_CODE_MODS AND APPLE AND _target_arch_count EQUAL 1)
list(GET _target_architectures 0 _target_arch)
if (_target_arch STREQUAL "arm64")
set(DUSK_HAS_PREPATCH ON)
endif ()
endif ()
set(DUSK_HAS_PREPATCH ${DUSK_HAS_PREPATCH} CACHE INTERNAL "Enable symgen prepatch support" FORCE)
if (DUSK_ENABLE_CODE_MODS AND CMAKE_SYSTEM_NAME MATCHES "^(iOS|tvOS)$")
list(LENGTH CMAKE_OSX_ARCHITECTURES _mobile_arch_count)
if (NOT _mobile_arch_count EQUAL 1 OR NOT CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
message(FATAL_ERROR
"iOS/tvOS code mods require a single arm64 architecture; got "
"CMAKE_OSX_ARCHITECTURES='${CMAKE_OSX_ARCHITECTURES}'")
endif ()
endif ()
# Edit & Continue # Edit & Continue
if (MSVC) if (MSVC)
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug" if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue") set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
endif () endif ()
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue") if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
@@ -148,11 +154,9 @@ if (DUSK_MOVIE_SUPPORT)
endif () endif ()
set(_jpeg_cmake_args set(_jpeg_cmake_args
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir} -DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsTargetProcessor.cmake
-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}")
@@ -168,8 +172,6 @@ if (DUSK_MOVIE_SUPPORT)
CMAKE_MSVC_RUNTIME_LIBRARY CMAKE_MSVC_RUNTIME_LIBRARY
CMAKE_MSVC_DEBUG_INFORMATION_FORMAT CMAKE_MSVC_DEBUG_INFORMATION_FORMAT
CMAKE_OSX_ARCHITECTURES CMAKE_OSX_ARCHITECTURES
CMAKE_OSX_DEPLOYMENT_TARGET
CMAKE_OSX_SYSROOT
DEPLOYMENT_TARGET DEPLOYMENT_TARGET
ENABLE_ARC ENABLE_ARC
ENABLE_BITCODE ENABLE_BITCODE
@@ -196,21 +198,26 @@ if (DUSK_MOVIE_SUPPORT)
endif () endif ()
endif () endif ()
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") if (CMAKE_SYSTEM_NAME STREQUAL Linux)
# -Wno-multichar: Multi-character constants ('ABCD') are implementation-defined but all compilers # -Wno-multichar: Multi-character constants ('ABCD') are implementation-defined but all compilers
# (CW, GCC, Clang, MSVC) encode them identically in big-endian order. # (CW, GCC, Clang, MSVC) encode them identically in big-endian order.
# For >4-char literals (which GCC/Clang truncate to int), use the MULTI_CHAR() macro. # For >4-char literals (which GCC/Clang truncate to int), use the MULTI_CHAR() macro.
# -Wwrite-strings: Game code relies on implicit const char* -> char* conversions
# -Wdeprecated-declarations: JSystem uses std::iterator, deprecated in C++17 # -Wdeprecated-declarations: JSystem uses std::iterator, deprecated in C++17
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-multichar -Wno-write-strings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Wno-write-strings -Wno-trigraphs -Wno-deprecated-declarations")
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_RPATH "$ORIGIN")
elseif (APPLE)
add_compile_options(-Wno-declaration-after-statement -Wno-non-pod-varargs)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_RPATH "$ORIGIN")
elseif (MSVC)
add_compile_options( add_compile_options(
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-multichar> $<$<COMPILE_LANGUAGE:C,CXX>:/bigobj>
$<$<COMPILE_LANGUAGE:CXX>:-Wno-trigraphs> $<$<COMPILE_LANGUAGE:C,CXX>:/Zc:strictStrings->
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-declarations> $<$<COMPILE_LANGUAGE:C,CXX>:/MP>
) $<$<COMPILE_LANGUAGE:C,CXX>:/FS>
elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
add_compile_options(
$<$<COMPILE_LANGUAGE:C,CXX>:/bigobj>
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
) )
if (NOT DUSK_BUILD_WARNINGS) if (NOT DUSK_BUILD_WARNINGS)
@@ -225,65 +232,65 @@ elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/utf-8>) add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/utf-8>)
endif () endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_BUILD_RPATH "$ORIGIN")
elseif (APPLE)
add_compile_options(-Wno-declaration-after-statement -Wno-non-pod-varargs)
set(CMAKE_INSTALL_RPATH "@loader_path")
set(CMAKE_BUILD_RPATH "@loader_path")
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 miniz") message(STATUS "dusklight: Fetching cxxopts")
FetchContent_Declare(miniz FetchContent_Declare(cxxopts
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip URL https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.3.1.tar.gz
URL_HASH SHA256=3bfc70542c521d4b55a46429d808178916a579b28d048bd8c727ee76c39e2072
DOWNLOAD_EXTRACT_TIMESTAMP TRUE DOWNLOAD_EXTRACT_TIMESTAMP TRUE
EXCLUDE_FROM_ALL
) )
message(STATUS "dusklight: Fetching nlohmann/json")
FetchContent_Declare(json
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(cxxopts json)
set(_fetch_content_deps miniz) if (DUSK_ENABLE_SENTRY_NATIVE)
if (DUSK_HAS_FUNCHOOK) message(STATUS "dusklight: Fetching sentry-native")
message(STATUS "dusklight: Fetching funchook") set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
# cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a set(SENTRY_BACKEND crashpad CACHE STRING "" FORCE)
# PATCH_COMMAND into capstone's inner ExternalProject. That PATCH_COMMAND runs if (WIN32)
# cmake/PatchCapstone.cmake after capstone is cloned, which removes the set(SENTRY_TRANSPORT winhttp CACHE STRING "" FORCE)
# cmake_policy(SET CMP0048 OLD) line that CMake >= 3.27 rejects. endif ()
# This is incredibly scuffed and we should probably think of a better way to do this set(SENTRY_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(CAPSTONE_FIX_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/PatchCapstone.cmake") set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
FetchContent_Declare(funchook set(SENTRY_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
GIT_REPOSITORY https://github.com/kubo/funchook.git FetchContent_Declare(sentry_native
GIT_TAG v1.1.3 GIT_REPOSITORY https://github.com/getsentry/sentry-native.git
GIT_TAG 0.13.6
GIT_SHALLOW TRUE GIT_SHALLOW TRUE
GIT_PROGRESS TRUE GIT_PROGRESS TRUE
PATCH_COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=<SOURCE_DIR> -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/PatchFunchook.cmake GIT_SUBMODULES_RECURSE TRUE
EXCLUDE_FROM_ALL
) )
set(FUNCHOOK_BUILD_TESTS OFF CACHE BOOL "" FORCE) if (NOT sentry_native_POPULATED)
set(FUNCHOOK_BUILD_SHARED OFF CACHE BOOL "" FORCE) FetchContent_Populate(sentry_native)
set(FUNCHOOK_INSTALL OFF CACHE BOOL "" FORCE) set(_dusk_skip_install_rules ${CMAKE_SKIP_INSTALL_RULES})
if (APPLE AND CMAKE_OSX_ARCHITECTURES) set(CMAKE_SKIP_INSTALL_RULES ON)
list(LENGTH CMAKE_OSX_ARCHITECTURES _osx_arch_count) add_subdirectory(${sentry_native_SOURCE_DIR} ${sentry_native_BINARY_DIR} EXCLUDE_FROM_ALL)
if (_osx_arch_count EQUAL 1) set(CMAKE_SKIP_INSTALL_RULES ${_dusk_skip_install_rules})
list(GET CMAKE_OSX_ARCHITECTURES 0 _osx_arch)
if (_osx_arch MATCHES "^(arm64|aarch64|ARM64)$")
set(FUNCHOOK_CPU arm64 CACHE STRING "" FORCE)
elseif (_osx_arch MATCHES "^(x86_64|AMD64|amd64|i[3-6]86|x86)$")
set(FUNCHOOK_CPU x86 CACHE STRING "" FORCE)
endif ()
endif ()
endif () endif ()
list(APPEND _fetch_content_deps funchook)
endif () endif ()
FetchContent_MakeAvailable(${_fetch_content_deps})
# Use signed char on ARM to match the original game (and x86) if (CMAKE_SYSTEM_NAME STREQUAL Windows)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch) set(PLATFORM_NAME win32)
if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_compile_options(-fsigned-char) if (IOS)
endif() set(PLATFORM_NAME ios)
elseif (TVOS)
set(PLATFORM_NAME tvos)
else ()
set(PLATFORM_NAME macos)
endif ()
else ()
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
endif ()
configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
include(files.cmake) include(files.cmake)
@@ -297,23 +304,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) set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1)
set(GAME_INCLUDE_DIRS
include
src
assets/GZ2E01 # TODO: make this dynamic if needed?
libs/JSystem/include
libs
extern/aurora/include/dolphin
extern
${CMAKE_BINARY_DIR})
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(GAME_COMPILE_DEFS DUSK_BUILDING_GAME=1)
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd 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)
if (DUSK_HAS_FUNCHOOK)
list(APPEND GAME_LIBS funchook-static) list(APPEND GAME_LIBS libzstd_static)
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 () endif ()
if (WIN32) if (WIN32)
list(APPEND GAME_LIBS Ws2_32) list(APPEND GAME_LIBS Ws2_32)
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,21 +378,17 @@ if (DUSK_MOVIE_SUPPORT)
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1) list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
endif () endif ()
if (DUSK_ENABLE_CODE_MODS) set(DUSK_ENABLE_DISCORD_DEFAULT ON)
list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1) if (DEFINED DUSK_ENABLE_DISCORD_RPC AND NOT DEFINED DUSK_ENABLE_DISCORD)
set(DUSK_ENABLE_DISCORD_DEFAULT ${DUSK_ENABLE_DISCORD_RPC})
endif () endif ()
list(APPEND GAME_COMPILE_DEFS option(DUSK_ENABLE_DISCORD "Enable Discord Rich Presence support" ${DUSK_ENABLE_DISCORD_DEFAULT})
DUSK_HAS_FUNCHOOK=$<BOOL:${DUSK_HAS_FUNCHOOK}> if (DUSK_ENABLE_DISCORD AND NOT ANDROID AND NOT IOS AND NOT TVOS)
DUSK_HAS_PREPATCH=$<BOOL:${DUSK_HAS_PREPATCH}>) list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD=1)
if (DUSK_PACKAGE_INSTALL)
include(GNUInstallDirs)
list(APPEND GAME_COMPILE_DEFS DUSK_ASSET_DIR="${CMAKE_INSTALL_FULL_DATADIR}/dusklight/")
endif () endif ()
if (DUSK_GFX_DEBUG_GROUPS) if(ANDROID)
list(APPEND GAME_COMPILE_DEFS DUSK_GFX_DEBUG_GROUPS=1) list(APPEND GAME_COMPILE_DEFS TARGET_ANDROID=1)
target_compile_definitions(aurora_gx PRIVATE AURORA_GFX_DEBUG_GROUPS)
endif () endif ()
# game_debug is for game code files that we know work when compiled with DEBUG=1 # game_debug is for game code files that we know work when compiled with DEBUG=1
@@ -354,7 +405,7 @@ set(GAME_DEBUG_FILES
set_source_files_properties( set_source_files_properties(
${GAME_DEBUG_FILES} ${GAME_DEBUG_FILES}
PROPERTIES PROPERTIES
COMPILE_DEFINITIONS "$<$<CONFIG:Debug>:DEBUG=1>" COMPILE_DEFINITIONS "$<$<CONFIG:Debug>:DEBUG=1>;$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>"
) )
# game_base is for all other game code files # game_base is for all other game code files
@@ -368,11 +419,16 @@ set(GAME_BASE_FILES
set_source_files_properties( set_source_files_properties(
${GAME_BASE_FILES} ${GAME_BASE_FILES}
PROPERTIES PROPERTIES
COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0" COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0;$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>"
) )
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES) foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
target_compile_definitions(${jsystem_lib} PRIVATE ${GAME_COMPILE_DEFS} $<$<CONFIG:Debug>:DEBUG=1>) target_compile_definitions(${jsystem_lib} PRIVATE
${GAME_COMPILE_DEFS}
$<$<CONFIG:Debug>:DEBUG=1>
$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>
)
target_include_directories(${jsystem_lib} PRIVATE ${GAME_INCLUDE_DIRS})
target_link_libraries(${jsystem_lib} PRIVATE ${GAME_LIBS}) target_link_libraries(${jsystem_lib} PRIVATE ${GAME_LIBS})
set_target_properties(${jsystem_lib} PROPERTIES FOLDER "JSystem") set_target_properties(${jsystem_lib} PROPERTIES FOLDER "JSystem")
endforeach() endforeach()
@@ -384,80 +440,18 @@ if (CMAKE_CXX_LINK_GROUP_USING_RESCAN_SUPPORTED OR CMAKE_LINK_GROUP_USING_RESCAN
set(JSYSTEM_LINK_LIBRARIES "$<LINK_GROUP:RESCAN,${JSYSTEM_LIBRARIES}>") set(JSYSTEM_LINK_LIBRARIES "$<LINK_GROUP:RESCAN,${JSYSTEM_LIBRARIES}>")
endif () 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})
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)
target_sources(dusklight PRIVATE src/dusk/asan_options.c)
endif ()
target_compile_definitions(dusklight PRIVATE ${GAME_COMPILE_DEFS}) target_compile_definitions(dusklight PRIVATE ${GAME_COMPILE_DEFS})
target_include_directories(dusklight PRIVATE ${miniz_SOURCE_DIR}) target_include_directories(dusklight PRIVATE ${GAME_INCLUDE_DIRS})
target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES}) target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES})
target_precompile_headers(dusklight PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>") target_precompile_headers(dusklight PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>")
if (DUSK_ENABLE_CODE_MODS)
include(cmake/SymbolManifest.cmake)
if (WIN32)
# Game ABI exports & import library for mod linking
include(cmake/WindowsExports.cmake)
setup_windows_exports(dusklight)
endif ()
# Post-link symbol manifest: hookable-surface name->address map keyed to the build.
setup_symbol_manifest(dusklight)
endif ()
# Hook reliability: guaranteed patchable entries on the game ABI surface, and no identical-code folding.
if (MSVC)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:/hotpatch>)
endif ()
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
target_link_options(dusklight PRIVATE /FUNCTIONPADMIN:16 /OPT:NOICF)
else ()
target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF)
endif ()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "^(AppleClang|Clang)$")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=2,1>)
else ()
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=10,5>)
endif ()
endif ()
if (DEFINED DUSK_PATCHABLE_ENTRY_FLAG)
target_compile_options(dusklight PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG})
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
target_compile_options(${jsystem_lib} PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG})
endforeach()
foreach(_sdk_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
aurora_os aurora_pad aurora_si aurora_vi)
if (TARGET ${_sdk_lib})
get_target_property(_sdk_lib_imported ${_sdk_lib} IMPORTED)
if (NOT _sdk_lib_imported)
target_compile_options(${_sdk_lib} PRIVATE ${DUSK_PATCHABLE_ENTRY_FLAG})
endif ()
endif ()
endforeach ()
endif ()
if (WIN32)
target_link_libraries(dusklight PRIVATE Psapi)
endif ()
if (APPLE)
include(cmake/AppleExports.cmake)
setup_apple_exports(dusklight)
elseif (ANDROID)
include(cmake/AndroidExports.cmake)
setup_android_exports(dusklight)
elseif (UNIX)
target_link_options(dusklight PRIVATE -rdynamic)
endif ()
if (TARGET crashpad_handler) if (TARGET crashpad_handler)
add_dependencies(dusklight crashpad_handler) add_dependencies(dusklight crashpad_handler)
add_custom_command(TARGET dusklight POST_BUILD add_custom_command(TARGET dusklight POST_BUILD
@@ -468,9 +462,10 @@ if (TARGET crashpad_handler)
) )
endif () endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux) if (ANDROID)
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1") # SDLActivity loads SDL_main via dlsym on Android. Since aurora::main is a static
target_link_libraries(dusklight PRIVATE dl) # archive, force an undefined reference so the linker keeps the SDL_main object.
target_link_options(dusklight PRIVATE "-Wl,-u,SDL_main")
endif () endif ()
if (NOT APPLE) if (NOT APPLE)
@@ -511,17 +506,6 @@ if (WIN32)
endif () endif ()
endif () endif ()
include(cmake/ModSDK.cmake)
if (DUSK_ENABLE_CODE_MODS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_custom_target(dusklight_mods) # Aggregate target for all in-tree mods
add_subdirectory(mods/template_mod)
add_subdirectory(mods/ao_mod)
add_subdirectory(mods/shadow_mod)
add_subdirectory(mods/window_demo)
add_subdirectory(mods/flow_demo)
endif ()
if (APPLE) if (APPLE)
if (IOS) if (IOS)
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios) set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
@@ -529,7 +513,6 @@ if (APPLE)
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos) set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos)
else () else ()
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos) set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos)
set(DUSK_ENTITLEMENTS ${DUSK_RESOURCE_DIR}/Dusklight.entitlements)
endif () endif ()
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in) set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
file(GLOB_RECURSE DUSK_RESOURCE_FILES file(GLOB_RECURSE DUSK_RESOURCE_FILES
@@ -549,42 +532,33 @@ if (APPLE)
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY) get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}") set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}")
endforeach () endforeach ()
set(_apple_bundle_properties set_target_properties(
dusklight PROPERTIES
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"
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES" XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
) )
if (DUSK_ENTITLEMENTS) endif ()
list(APPEND _apple_bundle_properties
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${DUSK_ENTITLEMENTS})
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND _apple_bundle_properties
XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES")
endif ()
set_target_properties(dusklight PROPERTIES ${_apple_bundle_properties})
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode") if (APPLE AND NOT IOS AND NOT TVOS)
set(_sign_nested_commands) find_library(APPKIT_FRAMEWORK AppKit REQUIRED)
if (TARGET crashpad_handler) target_sources(dusklight PRIVATE src/dusk/file_select_macos.mm)
list(APPEND _sign_nested_commands set_source_files_properties(src/dusk/file_select_macos.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
COMMAND /usr/bin/codesign --force --sign - target_link_libraries(dusklight PRIVATE ${APPKIT_FRAMEWORK})
"$<TARGET_FILE_DIR:dusklight>/crashpad_handler") endif ()
endif ()
add_custom_command(TARGET dusklight POST_BUILD if (IOS)
${_sign_nested_commands} find_library(UIKIT_FRAMEWORK UIKit REQUIRED)
COMMAND /usr/bin/codesign --force --sign - --entitlements find_library(UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK UniformTypeIdentifiers REQUIRED)
"${DUSK_ENTITLEMENTS}" "$<TARGET_BUNDLE_DIR:dusklight>" target_sources(dusklight PRIVATE src/dusk/ios/FileSelectDialog.m)
COMMENT "Signing Dusklight.app with entitlements" set_source_files_properties(src/dusk/ios/FileSelectDialog.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
VERBATIM target_link_libraries(dusklight PRIVATE ${UIKIT_FRAMEWORK} ${UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK})
)
endif ()
endif () endif ()
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake) include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
@@ -631,20 +605,12 @@ set(EXTRA_TARGETS "")
if (TARGET crashpad_handler) if (TARGET crashpad_handler)
list(APPEND EXTRA_TARGETS crashpad_handler) list(APPEND EXTRA_TARGETS crashpad_handler)
endif () endif ()
if (DUSK_PACKAGE_INSTALL) install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
aurora_install_runtime_dlls(dusklight ${CMAKE_INSTALL_PREFIX}) aurora_install_runtime_dlls(dusklight ${CMAKE_INSTALL_PREFIX})
if (NOT APPLE) if (NOT APPLE)
if (DUSK_PACKAGE_INSTALL) install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dusklight)
else()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
endif () endif ()
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo AND NOT DUSK_PACKAGE_INSTALL) if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
set(DEBUG_FILES_LIST "") set(DEBUG_FILES_LIST "")
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS) foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
get_target_output_name(${target} output_name) get_target_output_name(${target} output_name)
@@ -693,5 +659,3 @@ foreach (target IN LISTS BINARY_TARGETS)
endif () endif ()
endforeach () endforeach ()
endforeach () endforeach ()
install_bundled_mods()
+30 -148
View File
@@ -19,7 +19,7 @@
"hidden": true, "hidden": true,
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL" "CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded"
} }
}, },
{ {
@@ -28,26 +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": {
"type": "BOOL",
"value": true
}
}
},
{
"name": "asan",
"hidden": true,
"cacheVariables": {
"ENABLE_ASAN": {
"type": "BOOL",
"value": true
}
} }
}, },
{ {
@@ -56,15 +42,7 @@
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}", "binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": { "cacheVariables": {
"BUILD_SHARED_LIBS": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
"type": "BOOL",
"value": false
},
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
"DUSK_ENABLE_CODE_MODS": {
"type": "BOOL",
"value": true
}
}, },
"vendor": { "vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -85,15 +63,6 @@
"linux-default" "linux-default"
] ]
}, },
{
"name": "linux-default-debug-asan",
"displayName": "Linux (default) Debug ASan",
"inherits": [
"debug",
"linux-default",
"asan"
]
},
{ {
"name": "linux-default-relwithdebinfo", "name": "linux-default-relwithdebinfo",
"displayName": "Linux (default) RelWithDebInfo", "displayName": "Linux (default) RelWithDebInfo",
@@ -121,15 +90,6 @@
"linux-clang" "linux-clang"
] ]
}, },
{
"name": "linux-clang-debug-asan",
"displayName": "Linux (Clang) Debug ASan",
"inherits": [
"debug",
"linux-clang",
"asan"
]
},
{ {
"name": "linux-clang-relwithdebinfo", "name": "linux-clang-relwithdebinfo",
"displayName": "Linux (Clang) RelWithDebInfo", "displayName": "Linux (Clang) RelWithDebInfo",
@@ -150,15 +110,7 @@
"cacheVariables": { "cacheVariables": {
"CMAKE_C_COMPILER": "cl", "CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl", "CMAKE_CXX_COMPILER": "cl",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install", "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
"DUSK_ENABLE_CODE_MODS": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
"type": "BOOL",
"value": true
}
}, },
"vendor": { "vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -176,15 +128,6 @@
"windows-msvc" "windows-msvc"
] ]
}, },
{
"name": "windows-msvc-debug-asan",
"displayName": "Windows (MSVC) Debug ASan",
"inherits": [
"debug",
"windows-msvc",
"asan"
]
},
{ {
"name": "windows-msvc-relwithdebinfo", "name": "windows-msvc-relwithdebinfo",
"displayName": "Windows (MSVC) RelWithDebInfo", "displayName": "Windows (MSVC) RelWithDebInfo",
@@ -196,13 +139,17 @@
{ {
"name": "windows-arm64-msvc", "name": "windows-arm64-msvc",
"displayName": "Windows ARM64 (MSVC)", "displayName": "Windows ARM64 (MSVC)",
"inherits": [ "generator": "Ninja",
"windows-msvc" "binaryDir": "${sourceDir}/build/${presetName}",
],
"architecture": { "architecture": {
"value": "arm64", "value": "arm64",
"strategy": "external" "strategy": "external"
}, },
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
},
"vendor": { "vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "microsoft.com/VisualStudioSettings/CMake/1.0": {
"hostOS": [ "hostOS": [
@@ -250,15 +197,7 @@
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}", "binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": { "cacheVariables": {
"BUILD_SHARED_LIBS": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
"type": "BOOL",
"value": false
},
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
"DUSK_ENABLE_CODE_MODS": {
"type": "BOOL",
"value": true
}
}, },
"vendor": { "vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -276,15 +215,6 @@
"macos-default" "macos-default"
] ]
}, },
{
"name": "macos-default-debug-asan",
"displayName": "macOS (default) Debug ASan",
"inherits": [
"debug",
"macos-default",
"asan"
]
},
{ {
"name": "macos-default-relwithdebinfo", "name": "macos-default-relwithdebinfo",
"displayName": "macOS (default) RelWithDebInfo", "displayName": "macOS (default) RelWithDebInfo",
@@ -314,19 +244,11 @@
"type": "BOOL", "type": "BOOL",
"value": false "value": false
}, },
"ENABLE_VISIBILITY": {
"type": "BOOL",
"value": true
},
"Rust_CARGO_TARGET": "aarch64-apple-ios", "Rust_CARGO_TARGET": "aarch64-apple-ios",
"BUILD_SHARED_LIBS": { "BUILD_SHARED_LIBS": {
"type": "BOOL", "type": "BOOL",
"value": false "value": false
}, },
"DUSK_ENABLE_CODE_MODS": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
"type": "BOOL", "type": "BOOL",
"value": true "value": true
@@ -358,29 +280,24 @@
"type": "BOOL", "type": "BOOL",
"value": false "value": false
}, },
"ENABLE_ARC": {
"type": "BOOL",
"value": false
},
"ENABLE_VISIBILITY": {
"type": "BOOL",
"value": true
},
"Rust_CARGO_TARGET": "aarch64-apple-tvos", "Rust_CARGO_TARGET": "aarch64-apple-tvos",
"Rust_TOOLCHAIN": "nightly", "Rust_TOOLCHAIN": "nightly",
"BUILD_SHARED_LIBS": { "BUILD_SHARED_LIBS": {
"type": "BOOL", "type": "BOOL",
"value": false "value": false
}, },
"DUSK_ENABLE_CODE_MODS": { "CMAKE_DISABLE_FIND_PACKAGE_BZip2": {
"type": "BOOL", "type": "BOOL",
"value": true "value": true
}, },
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": { "CMAKE_DISABLE_FIND_PACKAGE_LibLZMA": {
"type": "BOOL", "type": "BOOL",
"value": true "value": true
}, },
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew" "CMAKE_DISABLE_FIND_PACKAGE_zstd": {
"type": "BOOL",
"value": true
}
}, },
"vendor": { "vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": { "microsoft.com/VisualStudioSettings/CMake/1.0": {
@@ -405,18 +322,6 @@
"BUILD_SHARED_LIBS": { "BUILD_SHARED_LIBS": {
"type": "BOOL", "type": "BOOL",
"value": false "value": false
},
"DUSK_ENABLE_CODE_MODS": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
"type": "BOOL",
"value": true
},
"CMAKE_DISABLE_FIND_PACKAGE_zstd": {
"type": "BOOL",
"value": true
} }
} }
}, },
@@ -448,7 +353,7 @@
"ci" "ci"
], ],
"cacheVariables": { "cacheVariables": {
"BOREALIS_ENABLE_SENTRY": { "DUSK_ENABLE_SENTRY_NATIVE": {
"type": "BOOL", "type": "BOOL",
"value": false "value": false
} }
@@ -473,8 +378,7 @@
"ci" "ci"
], ],
"cacheVariables": { "cacheVariables": {
"AURORA_SDL3_PROVIDER": "vendor", "AURORA_SDL3_PROVIDER": "vendor"
"CMAKE_LINKER_TYPE": "MOLD"
} }
}, },
{ {
@@ -503,8 +407,12 @@
"type": "BOOL", "type": "BOOL",
"value": true "value": true
}, },
"CMAKE_OSX_DEPLOYMENT_TARGET": "12.0", "CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew" "CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew",
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": false
}
} }
}, },
{ {
@@ -522,6 +430,7 @@
"x-macos-ci" "x-macos-ci"
], ],
"cacheVariables": { "cacheVariables": {
"AURORA_DAWN_PROVIDER": "vendor",
"CMAKE_OSX_ARCHITECTURES": "x86_64", "CMAKE_OSX_ARCHITECTURES": "x86_64",
"Rust_CARGO_TARGET": "x86_64-apple-darwin" "Rust_CARGO_TARGET": "x86_64-apple-darwin"
} }
@@ -581,10 +490,7 @@
"inherits": [ "inherits": [
"x-windows-ci", "x-windows-ci",
"windows-arm64-msvc" "windows-arm64-msvc"
], ]
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-windows"
}
} }
], ],
"buildPresets": [ "buildPresets": [
@@ -594,12 +500,6 @@
"description": "Linux (default) debug build", "description": "Linux (default) debug build",
"displayName": "Linux (default) Debug" "displayName": "Linux (default) Debug"
}, },
{
"name": "linux-default-debug-asan",
"configurePreset": "linux-default-debug-asan",
"description": "Linux (default) debug build with AddressSanitizer",
"displayName": "Linux (default) Debug ASan"
},
{ {
"name": "linux-default-relwithdebinfo", "name": "linux-default-relwithdebinfo",
"configurePreset": "linux-default-relwithdebinfo", "configurePreset": "linux-default-relwithdebinfo",
@@ -612,12 +512,6 @@
"description": "Linux (Clang) debug build", "description": "Linux (Clang) debug build",
"displayName": "Linux (Clang) Debug" "displayName": "Linux (Clang) Debug"
}, },
{
"name": "linux-clang-debug-asan",
"configurePreset": "linux-clang-debug-asan",
"description": "Linux (Clang) debug build with AddressSanitizer",
"displayName": "Linux (Clang) Debug ASan"
},
{ {
"name": "linux-clang-relwithdebinfo", "name": "linux-clang-relwithdebinfo",
"configurePreset": "linux-clang-relwithdebinfo", "configurePreset": "linux-clang-relwithdebinfo",
@@ -630,12 +524,6 @@
"description": "macOS debug build", "description": "macOS debug build",
"displayName": "macOS Debug" "displayName": "macOS Debug"
}, },
{
"name": "macos-default-debug-asan",
"configurePreset": "macos-default-debug-asan",
"description": "macOS debug build with AddressSanitizer",
"displayName": "macOS Debug ASan"
},
{ {
"name": "macos-default-relwithdebinfo", "name": "macos-default-relwithdebinfo",
"configurePreset": "macos-default-relwithdebinfo", "configurePreset": "macos-default-relwithdebinfo",
@@ -693,12 +581,6 @@
"description": "Windows (MSVC) debug build", "description": "Windows (MSVC) debug build",
"displayName": "Windows (MSVC) Debug" "displayName": "Windows (MSVC) Debug"
}, },
{
"name": "windows-msvc-debug-asan",
"configurePreset": "windows-msvc-debug-asan",
"description": "Windows (MSVC) debug build with AddressSanitizer",
"displayName": "Windows (MSVC) Debug ASan"
},
{ {
"name": "windows-msvc-relwithdebinfo", "name": "windows-msvc-relwithdebinfo",
"configurePreset": "windows-msvc-relwithdebinfo", "configurePreset": "windows-msvc-relwithdebinfo",
+24 -8
View File
@@ -20,20 +20,36 @@ It aims to be as accurate as possible to the original while also providing new o
> Dusklight does *not* provide any copyrighted assets. You must provide your own copy of the original game. > Dusklight does *not* provide any copyrighted assets. You must provide your own copy of the original game.
> [!IMPORTANT] > [!IMPORTANT]
> At a minimum, Dusklight requires a GPU with support for D3D12, Vulkan 1.1+, or Metal. For older devices, best-effort support is provided for D3D11 and OpenGL ES (Android), but will not achieve full accuracy or performance. Your experience with specific hardware, operating systems, and drivers may vary. > At a minimum, Dusklight requires a GPU with support for either D3D12, Vulkan, or Metal. Your experience with specific hardware, operating systems, and drivers may vary. In particular, older Intel iGPUs have a high likelihood of incompatibility. We are also aware of a number of issues on devices with Adreno GPUs and are working to resolve them.
### 1. Dump your game ### 1. Verify your dump
You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space. First, make sure your dump of the game is clean and supported by Dusklight. You can do this by checking the SHA-1 hash of your dump against this list of supported versions:
Dusklight currently supports all commercial discs except for Wii's Korean release. | Version | SHA-1 hash |
|--------------| ------------------------------------------ |
| GameCube USA | `75edd3ddff41f125d1b4ce1a40378f1b565519e7` |
| GameCube EUR | `2601822a488eeb86fb89db16ca8f29c2c953e1ca` |
> [!NOTE] *Support for other versions of the game is planned in the future.
> Dusklight is based on the [Twilight Princess decompilation](https://github.com/zeldaret/tp), which is currently only matching for GameCube. As a result, even when playing Dusklight with a Wii disc, you will be presented with the GameCube version's HUD and certain other specificities.
### 2. Install Dusklight ### 2. Download [Dusklight](https://github.com/TwilitRealm/dusklight/releases)
Visit the [official installation guide](https://twilitrealm.dev/install/) for full instructions. ### 3. Setup the game
**Windows / macOS / Linux**
- Extract the .zip file
- Launch Dusklight
- Press **Select Disc Image** and provide the path to your supported game dump
- Press **Play**!
**iOS**
- Follow the [iOS setup guide](docs/ios-install-altstore.md)
**Android**
- Install the Dusklight APK
- Launch Dusklight
- Press **Select Disc Image** and provide the path to your supported game dump
- Press **Play**!
# Building # Building
+3 -4
View File
@@ -6,7 +6,6 @@ fi
build_dir="$PWD/build" build_dir="$PWD/build"
linuxdeploy="$build_dir/linuxdeploy-$(uname -m).AppImage" linuxdeploy="$build_dir/linuxdeploy-$(uname -m).AppImage"
lib_dir="/usr/lib/$(uname -m)-linux-gnu"
# Get linuxdeploy # Get linuxdeploy
mkdir -p "$build_dir" mkdir -p "$build_dir"
@@ -20,8 +19,8 @@ for install_path in build/install/*; do
cp -r "$install_path" build/appdir/usr/bin cp -r "$install_path" build/appdir/usr/bin
done done
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications cp platforms/freedesktop/dusklight.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 /usr/lib/x86_64-linux-gnu/libusb-1.0.so --appdir "$build_dir/appdir" --output appimage
-63
View File
@@ -1,63 +0,0 @@
include_guard(GLOBAL)
get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
# Android mod linking: symgen scans and filters the game's exports, generating a version script used for the executable
# link step, and generates a shared object stub that mods can link against without having to build the whole game.
function(setup_android_exports target)
include("${_dir}/SymbolManifest.cmake")
ensure_symgen(TRUE)
add_dependencies(${target} symgen)
set(_rsp_lines "$<TARGET_OBJECTS:${target}>")
foreach (_lib IN LISTS JSYSTEM_LIBRARIES)
list(APPEND _rsp_lines "$<TARGET_FILE:${_lib}>")
endforeach ()
list(JOIN _rsp_lines "\n" _rsp_content)
set(_rsp "${CMAKE_BINARY_DIR}/dusklight_exports_input.rsp")
file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}")
set(_sdk_args)
foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
aurora_os aurora_pad aurora_si aurora_vi)
if (TARGET ${_lib})
list(APPEND _sdk_args --sdk-lib "$<TARGET_FILE:${_lib}>")
endif ()
endforeach ()
if (TARGET dawn::webgpu_dawn)
get_target_property(_dawn_type dawn::webgpu_dawn TYPE)
if (_dawn_type STREQUAL "STATIC_LIBRARY")
list(APPEND _sdk_args --sdk-lib "$<TARGET_FILE:dawn::webgpu_dawn>")
endif ()
endif ()
set(_vscript "${CMAKE_BINARY_DIR}/dusklight_exports.ver")
add_custom_command(TARGET ${target} PRE_LINK
COMMAND "${SYMGEN_EXE}" exports
"@${_rsp}"
--out "${_vscript}"
--format version-script
--exclude cmake_pch
--exclude miniz
--exclude asan_options
--exclude src/dusk
# Resolved from the Java side; the SDL ones live in the statically-linked
# SDL archive, outside the provenance scan.
--extra-sym JNI_OnLoad
--extra-sym SDL_main
--extra-sym "Java_*"
${_sdk_args}
COMMENT "Generating dusklight exports"
VERBATIM)
target_link_options(${target} PRIVATE "-Wl,--version-script=${_vscript}")
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch)
set(_stub "${CMAKE_BINARY_DIR}/stub-android-${_arch}.so")
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${SYMGEN_EXE}" stub -f elf "$<TARGET_FILE:${target}>" -o "${_stub}"
--soname "$<TARGET_FILE_NAME:${target}>" --arch "${_arch}"
BYPRODUCTS "${_stub}"
COMMENT "Generating dusklight link stub"
VERBATIM)
install(FILES "${_stub}" DESTINATION sdk)
endfunction()
-90
View File
@@ -1,90 +0,0 @@
include_guard(GLOBAL)
get_filename_component(_dir "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
# Apple mod linking: symgen scans and filters the game's exports, generating an exports list used for the executable
# link step, and generates a MH_EXECUTE Mach-O stub that mods can link against without having to build the whole game.
function(setup_apple_exports target)
include("${_dir}/SymbolManifest.cmake")
ensure_symgen(TRUE)
set(_symgen "${SYMGEN_EXE}")
add_dependencies(${target} symgen)
set(_config_subdir "")
if (CMAKE_CONFIGURATION_TYPES)
set(_config_subdir "$<CONFIG>/")
endif ()
set(_rsp_lines "$<TARGET_OBJECTS:${target}>")
foreach (_lib IN LISTS JSYSTEM_LIBRARIES)
list(APPEND _rsp_lines "$<TARGET_FILE:${_lib}>")
endforeach ()
list(JOIN _rsp_lines "\n" _rsp_content)
set(_rsp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports_input.rsp")
file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}")
set(_sdk_args)
foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
aurora_os aurora_pad aurora_si aurora_vi)
if (TARGET ${_lib})
list(APPEND _sdk_args --sdk-lib "$<TARGET_FILE:${_lib}>")
endif ()
endforeach ()
# Dawn is linked statically on Apple; mods reach wgpu* through the executable.
if (TARGET dawn::webgpu_dawn)
get_target_property(_dawn_type dawn::webgpu_dawn TYPE)
if (_dawn_type STREQUAL "STATIC_LIBRARY")
list(APPEND _sdk_args --sdk-lib "$<TARGET_FILE:dawn::webgpu_dawn>")
endif ()
endif ()
set(_exp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports.exp")
add_custom_command(TARGET ${target} PRE_LINK
COMMAND "${_symgen}" exports
"@${_rsp}"
--out "${_exp}"
--exclude cmake_pch
--exclude miniz
--exclude asan_options
--exclude src/dusk
${_sdk_args}
COMMENT "Generating dusklight exports"
VERBATIM)
target_link_options(${target} PRIVATE -Xlinker -exported_symbols_list -Xlinker "${_exp}")
# Generate the stub executable mods link against via -bundle_loader.
set(_stub_args)
if (IOS)
set(_stub_platform "ios")
list(APPEND _stub_args --platform ios)
elseif (TVOS)
set(_stub_platform "tvos")
list(APPEND _stub_args --platform tvos)
else ()
set(_stub_platform "macos")
endif ()
if (CMAKE_OSX_DEPLOYMENT_TARGET)
list(APPEND _stub_args --min-os "${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif ()
if (CMAKE_OSX_ARCHITECTURES)
set(_archs "${CMAKE_OSX_ARCHITECTURES}")
else ()
set(_archs "${CMAKE_SYSTEM_PROCESSOR}")
endif ()
set(_arch_names "")
foreach (_arch IN LISTS _archs)
string(TOLOWER "${_arch}" _arch)
list(APPEND _stub_args --arch "${_arch}")
list(APPEND _arch_names "${_arch}")
endforeach ()
list(JOIN _arch_names "_" _arch_name)
set(_stub "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight-stub")
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${_symgen}" stub -f macho "${_exp}" -o "${_stub}" ${_stub_args}
BYPRODUCTS "${_stub}"
COMMENT "Generating dusklight link stub"
VERBATIM)
install(FILES "${_stub}" DESTINATION sdk RENAME "stub-${_stub_platform}-${_arch_name}")
endfunction()
-10
View File
@@ -1,10 +0,0 @@
# Copies a mod asset directory for packaging, skipping dotfiles and dot-directories
# (.gitkeep, .DS_Store, ...). Usage: cmake -DSRC=<dir> -DDST=<dir> -P CopyModAssets.cmake
file(MAKE_DIRECTORY "${DST}")
file(GLOB_RECURSE _files RELATIVE "${SRC}" "${SRC}/*")
foreach (_file IN LISTS _files)
if (NOT _file MATCHES "(^|/)\\.")
get_filename_component(_dir "${_file}" DIRECTORY)
file(COPY "${SRC}/${_file}" DESTINATION "${DST}/${_dir}")
endif ()
endforeach ()
-68
View File
@@ -1,68 +0,0 @@
# The game ABI surface shared by the main build and the mod SDK (sdk/CMakeLists.txt)
include_guard(GLOBAL)
get_filename_component(_game_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
# PARTIAL_DEBUG makes debug and release share one struct/vtable ABI so a mod binary loads into either
set(_game_compile_defs TARGET_PC=1 WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1 PARTIAL_DEBUG=1)
if (ANDROID)
list(APPEND _game_compile_defs TARGET_ANDROID=1)
endif ()
# Public game headers
set(_game_abi_include_dirs
${_game_root}/include
${_game_root}/assets/GZ2E01
${_game_root}/libs/JSystem/include
${_game_root}/extern/aurora/include/dolphin
${_game_root}/extern/aurora/include
${_game_root}/sdk/include
)
# Internal game headers
set(_game_include_dirs
${_game_abi_include_dirs}
${_game_root}/src
${_game_root}/extern
${CMAKE_CURRENT_BINARY_DIR}
)
# Mod API, including services
add_library(dusklight_mod_api INTERFACE)
target_include_directories(dusklight_mod_api INTERFACE ${_game_root}/sdk/include)
# Full internal headers used to build the game
add_library(dusklight_game_headers INTERFACE)
target_include_directories(dusklight_game_headers INTERFACE ${_game_include_dirs})
target_compile_definitions(dusklight_game_headers INTERFACE ${_game_compile_defs})
# Public game ABI for mods
add_library(dusklight_game_abi_headers INTERFACE)
target_include_directories(dusklight_game_abi_headers INTERFACE ${_game_abi_include_dirs})
target_compile_definitions(dusklight_game_abi_headers INTERFACE ${_game_compile_defs})
# Mod feature targets
add_library(dusklight_mod_feature_game INTERFACE)
target_link_libraries(dusklight_mod_feature_game INTERFACE
dusklight_mod_api
dusklight_game_abi_headers)
target_compile_definitions(dusklight_mod_feature_game INTERFACE DUSK_MOD_FEATURE_GAME=1)
# Game headers assume global.h comes first in the translation unit (it defines DUSK_GAME_DATA
# and friends); force-include it so mods don't depend on include order.
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
target_compile_options(dusklight_mod_feature_game INTERFACE
"$<$<COMPILE_LANGUAGE:CXX>:/FIglobal.h>")
else ()
target_compile_options(dusklight_mod_feature_game INTERFACE
"$<$<COMPILE_LANGUAGE:CXX>:SHELL:-include global.h>")
endif ()
target_sources(dusklight_mod_feature_game INTERFACE
${_game_root}/sdk/src/game_feature.cpp)
add_library(dusklight_mod_feature_webgpu INTERFACE)
target_link_libraries(dusklight_mod_feature_webgpu INTERFACE dusklight_mod_api)
target_compile_definitions(dusklight_mod_feature_webgpu INTERFACE DUSK_MOD_FEATURE_WEBGPU=1)
add_library(dusklight_mod_feature_fmt INTERFACE)
target_link_libraries(dusklight_mod_feature_fmt INTERFACE dusklight_mod_api)
target_compile_definitions(dusklight_mod_feature_fmt INTERFACE DUSK_MOD_FEATURE_FMT=1)
-518
View File
@@ -1,518 +0,0 @@
# add_mod(<target> [FEATURES <feature>...] SOURCES <file>... MOD_JSON <mod.json>
# [RUNTIME_LIBRARIES <file>...] [RES_DIR <res>] [OVERLAY_DIR <overlay>]
# [TEXTURES_DIR <textures>] [OUTPUT_DIR <dir>] [BUNDLE])
set(DUSK_MODS_OUTPUT_DIR "${CMAKE_BINARY_DIR}/mods" CACHE PATH "Directory to write mod packages into")
set(DUSKLIGHT_SDK_STUB_URL "https://github.com/encounter/dusklight/releases/download/sdk"
CACHE STRING "Base URL for game link stubs downloaded by out-of-tree mod builds")
function(_mod_lib_info out_platform_var out_name_var)
set(_arch "${CMAKE_SYSTEM_PROCESSOR}")
if (APPLE AND CMAKE_OSX_ARCHITECTURES)
list(LENGTH CMAKE_OSX_ARCHITECTURES _count)
if (_count GREATER 1)
message(FATAL_ERROR "add_mod: universal binaries are not supported")
endif ()
set(_arch "${CMAKE_OSX_ARCHITECTURES}")
elseif (WIN32)
set(_arch_id "${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
if (NOT _arch_id)
set(_arch_id "${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
endif ()
if (_arch_id MATCHES "^ARM64(EC)?$")
set(_arch "arm64")
elseif (_arch_id STREQUAL "x64")
set(_arch "amd64")
elseif (_arch_id STREQUAL "X86")
set(_arch "x86")
endif ()
endif ()
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _platform)
if (_platform STREQUAL "darwin")
set(_platform "macos")
endif ()
string(TOLOWER "${_arch}" _arch)
if (_arch MATCHES "^(i[3-6]86|x86)$")
set(_arch "x86")
endif ()
if (WIN32)
set(_ext ".dll")
else ()
set(_ext ".so")
endif ()
set(${out_platform_var} "${_platform}-${_arch}" PARENT_SCOPE)
set(${out_name_var} "mod${_ext}" PARENT_SCOPE)
endfunction()
# For out-of-tree builds without a game binary: download the version-independent link stub
# (generated by symgen) for the target platform.
function(_mod_download_link_stub out_var)
_mod_lib_info(_platform _lib_name)
if (WIN32)
set(_asset "${_platform}.lib")
elseif (ANDROID)
set(_asset "stub-${_platform}.so")
else ()
set(_asset "stub-${_platform}")
endif ()
set(_stub "${CMAKE_BINARY_DIR}/dusklight-sdk-stubs/${_asset}")
if (NOT EXISTS "${_stub}")
message(STATUS "Mod SDK: downloading link stub ${_asset}")
file(DOWNLOAD "${DUSKLIGHT_SDK_STUB_URL}/${_asset}" "${_stub}.tmp" STATUS _status)
list(GET _status 0 _code)
if (NOT _code EQUAL 0)
list(GET _status 1 _error)
file(REMOVE "${_stub}.tmp")
message(FATAL_ERROR
"Mod SDK: failed to download ${DUSKLIGHT_SDK_STUB_URL}/${_asset}: ${_error}\n"
"Set DUSK_GAME_EXE to a game binary or link stub to skip the download.")
endif ()
file(RENAME "${_stub}.tmp" "${_stub}")
endif ()
set(${out_var} "${_stub}" PARENT_SCOPE)
endfunction()
function(_mod_resolve_source_path out_var path)
if (IS_ABSOLUTE "${path}")
set(_path "${path}")
else ()
set(_path "${CMAKE_CURRENT_SOURCE_DIR}/${path}")
endif ()
set(${out_var} "${_path}" PARENT_SCOPE)
endfunction()
function(_mod_collect_assets out_var dir)
if (NOT IS_DIRECTORY "${dir}")
message(FATAL_ERROR "add_mod: asset directory does not exist: ${dir}")
endif ()
file(GLOB_RECURSE _files CONFIGURE_DEPENDS LIST_DIRECTORIES false "${dir}/*")
# Dotfiles (.gitkeep, .DS_Store, ...) are not packaged; see CopyModAssets.cmake.
set(_assets "")
foreach (_file IN LISTS _files)
file(RELATIVE_PATH _rel "${dir}" "${_file}")
if (NOT _rel MATCHES "(^|/)\\.")
list(APPEND _assets "${_file}")
endif ()
endforeach ()
set(${out_var} ${_assets} PARENT_SCOPE)
endfunction()
function(_mod_add_webgpu_headers target_name)
if (NOT TARGET dawn::dawncpp_headers AND NOT TARGET dawn::webgpu_dawn)
include("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../extern/aurora/cmake/AuroraDependencyVersions.cmake")
set(AURORA_DAWN_PROVIDER "package" CACHE STRING "How to provide Dawn for the mod SDK")
include("${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../extern/aurora/cmake/AuroraDawnProvider.cmake")
endif ()
if (TARGET dawn::dawncpp_headers)
target_link_libraries(${target_name} PRIVATE dawn::dawncpp_headers)
elseif (TARGET dawn::webgpu_dawn)
target_link_libraries(${target_name} PRIVATE dawn::webgpu_dawn)
else ()
message(FATAL_ERROR "add_mod: FEATURES webgpu could not provide WebGPU headers")
endif ()
endfunction()
function(_mod_add_fmt target_name)
if (NOT TARGET fmt::fmt-header-only)
find_package(fmt 11 CONFIG QUIET GLOBAL)
endif ()
if (NOT TARGET fmt::fmt-header-only)
include(FetchContent)
message(STATUS "Mod SDK: fetching fmt")
# Keep the fallback version in sync with extern/aurora/extern/CMakeLists.txt.
FetchContent_Declare(fmt
URL https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz
URL_HASH SHA256=ea7de4299689e12b6dddd392f9896f08fb0777ac7168897a244a6d6085043fea
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(fmt)
endif ()
if (NOT TARGET fmt::fmt-header-only)
message(FATAL_ERROR "add_mod: FEATURES fmt could not provide fmt::fmt-header-only")
endif ()
target_link_libraries(${target_name} PRIVATE fmt::fmt-header-only)
endfunction()
function(add_mod target_name)
cmake_parse_arguments(ARG "BUNDLE" "MOD_JSON;RES_DIR;OVERLAY_DIR;TEXTURES_DIR;OUTPUT_DIR"
"SOURCES;RUNTIME_LIBRARIES;FEATURES" ${ARGN})
if (ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "add_mod: unknown arguments: ${ARG_UNPARSED_ARGUMENTS}")
endif ()
if (NOT ARG_MOD_JSON)
message(FATAL_ERROR "add_mod: MOD_JSON is required")
endif ()
_mod_resolve_source_path(_mod_json "${ARG_MOD_JSON}")
if (NOT EXISTS "${_mod_json}")
message(FATAL_ERROR "add_mod: MOD_JSON does not exist: ${_mod_json}")
endif ()
set(_supported_features fmt game webgpu)
set(_features "")
foreach (_feature IN LISTS ARG_FEATURES)
list(FIND _supported_features "${_feature}" _feature_index)
if (_feature_index EQUAL -1)
list(JOIN _supported_features ", " _supported_features_text)
message(FATAL_ERROR
"add_mod: unknown feature '${_feature}' (supported: ${_supported_features_text})")
endif ()
list(FIND _features "${_feature}" _duplicate_index)
if (NOT _duplicate_index EQUAL -1)
message(FATAL_ERROR "add_mod: duplicate feature '${_feature}'")
endif ()
list(APPEND _features "${_feature}")
endforeach ()
if (_features AND NOT ARG_SOURCES)
message(FATAL_ERROR "add_mod: FEATURES requires SOURCES")
endif ()
set(_has_lib FALSE)
set(_needs_host_link FALSE)
set(_lib_platform "")
set(_lib_name "")
if (ARG_SOURCES)
set(_has_lib TRUE)
add_library(${target_name} MODULE ${ARG_SOURCES})
_mod_lib_info(_lib_platform _lib_name)
set_target_properties(${target_name} PROPERTIES
PREFIX ""
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN ON
WINDOWS_EXPORT_ALL_SYMBOLS OFF)
target_compile_features(${target_name} PRIVATE cxx_std_20)
target_link_libraries(${target_name} PRIVATE dusklight_mod_api)
foreach (_feature IN LISTS _features)
target_link_libraries(${target_name} PRIVATE dusklight_mod_feature_${_feature})
if (_feature STREQUAL "webgpu")
_mod_add_webgpu_headers(${target_name})
endif ()
if (_feature STREQUAL "fmt")
_mod_add_fmt(${target_name})
endif ()
if (_feature STREQUAL "game" OR _feature STREQUAL "webgpu")
set(_needs_host_link TRUE)
endif ()
endforeach ()
if (NOT TARGET dusklight)
# Apply global compile options for out-of-tree mod builds
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_compile_options(${target_name} PRIVATE
-Wno-multichar -Wno-trigraphs -Wno-deprecated-declarations)
elseif (APPLE)
target_compile_options(${target_name} PRIVATE
-Wno-declaration-after-statement -Wno-non-pod-varargs)
elseif (MSVC)
target_compile_options(${target_name} PRIVATE
"$<$<COMPILE_LANGUAGE:C,CXX>:/bigobj>"
"$<$<COMPILE_LANGUAGE:C,CXX>:/utf-8>")
endif ()
# Use signed char on ARM to match the original game (and x86)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _mod_arch)
if (_mod_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
target_compile_options(${target_name} PRIVATE -fsigned-char)
endif ()
endif ()
if (APPLE)
if (_needs_host_link)
if (TARGET dusklight)
set(_game_exe "$<TARGET_FILE:dusklight>")
add_dependencies(${target_name} dusklight)
elseif (DUSK_GAME_EXE)
_mod_resolve_source_path(_game_exe "${DUSK_GAME_EXE}")
else ()
_mod_download_link_stub(_game_exe)
endif ()
target_link_options(${target_name} PRIVATE
-Xlinker -bundle_loader -Xlinker "${_game_exe}")
set_property(TARGET ${target_name} APPEND PROPERTY LINK_DEPENDS "${_game_exe}")
endif ()
set_target_properties(${target_name} PROPERTIES
BUILD_RPATH "@loader_path"
INSTALL_RPATH "@loader_path")
elseif (ANDROID)
if (_needs_host_link)
if (TARGET dusklight)
target_link_libraries(${target_name} PRIVATE dusklight)
else ()
if (DUSK_GAME_EXE)
_mod_resolve_source_path(_game_lib "${DUSK_GAME_EXE}")
else ()
_mod_download_link_stub(_game_lib)
endif ()
target_link_libraries(${target_name} PRIVATE "${_game_lib}")
endif ()
endif ()
set_target_properties(${target_name} PROPERTIES
BUILD_RPATH "$ORIGIN"
INSTALL_RPATH "$ORIGIN")
elseif (UNIX)
if (_needs_host_link)
target_link_options(${target_name} PRIVATE -Wl,--allow-shlib-undefined)
endif ()
set_target_properties(${target_name} PROPERTIES
BUILD_RPATH "$ORIGIN"
INSTALL_RPATH "$ORIGIN")
elseif (WIN32)
# Mods link against the game's import library (sdk/windows-<arch>.lib, generated by
# setup_windows_exports); cl and clang-cl both consume it in MSVC mode. Function
# calls resolve through import thunks; game data is reachable only through
# __declspec(dllimport), i.e. DUSK_GAME_DATA-annotated declarations.
if (_needs_host_link)
if (TARGET dusklight)
if (NOT DUSK_GAME_IMPLIB)
message(FATAL_ERROR
"add_mod: DUSK_GAME_IMPLIB is not set (see setup_windows_exports)")
endif ()
set(_game_lib "${DUSK_GAME_IMPLIB}")
elseif (DUSK_GAME_EXE)
_mod_resolve_source_path(_game_lib "${DUSK_GAME_EXE}")
if (NOT _game_lib MATCHES "\\.lib$")
message(FATAL_ERROR
"add_mod: DUSK_GAME_EXE must be an import library on Windows "
"(sdk/windows-<arch>.lib)")
endif ()
else ()
_mod_download_link_stub(_game_lib)
endif ()
target_link_libraries(${target_name} PRIVATE "${_game_lib}")
endif ()
set_target_properties(${target_name} PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
target_compile_definitions(${target_name} PRIVATE _ITERATOR_DEBUG_LEVEL=0)
endif ()
endif ()
if (ARG_RUNTIME_LIBRARIES AND NOT _has_lib)
message(FATAL_ERROR "add_mod: RUNTIME_LIBRARIES requires SOURCES")
endif ()
set(_output_dir "${DUSK_MODS_OUTPUT_DIR}")
if (ARG_OUTPUT_DIR)
set(_output_dir "${ARG_OUTPUT_DIR}")
endif ()
set(_stage "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_stage")
set(_out "${_output_dir}/${target_name}.dusk")
set(_zip_args mod.json)
set(_package_deps "${_mod_json}")
set(_package_inputs "${_mod_json}")
set(_extra_cmds "")
set(_lib_copy_cmd "")
set(_target_depend "")
if (_has_lib)
list(APPEND _zip_args lib)
set(_lib_copy_cmd
COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}/lib/${_lib_platform}"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:${target_name}>" "${_stage}/lib/${_lib_platform}/${_lib_name}")
set(_target_depend ${target_name})
endif ()
string(TOLOWER "${_lib_name}" _lib_name_key)
set(_runtime_lib_name_keys "${_lib_name_key}")
foreach (_runtime_lib IN LISTS ARG_RUNTIME_LIBRARIES)
_mod_resolve_source_path(_runtime_lib_path "${_runtime_lib}")
if (NOT EXISTS "${_runtime_lib_path}" OR IS_DIRECTORY "${_runtime_lib_path}")
message(FATAL_ERROR "add_mod: runtime library does not exist or is not a file: ${_runtime_lib_path}")
endif ()
get_filename_component(_runtime_lib_name "${_runtime_lib_path}" NAME)
string(TOLOWER "${_runtime_lib_name}" _runtime_lib_name_key)
list(FIND _runtime_lib_name_keys "${_runtime_lib_name_key}" _runtime_lib_name_index)
if (NOT _runtime_lib_name_index EQUAL -1)
message(FATAL_ERROR "add_mod: duplicate runtime library filename: ${_runtime_lib_name}")
endif ()
list(APPEND _runtime_lib_name_keys "${_runtime_lib_name_key}")
list(APPEND _package_deps "${_runtime_lib_path}")
list(APPEND _package_inputs "${_runtime_lib_path}")
list(APPEND _lib_copy_cmd COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${_runtime_lib_path}" "${_stage}/lib/${_lib_platform}/${_runtime_lib_name}")
endforeach ()
if (ARG_RES_DIR)
_mod_resolve_source_path(_res_dir "${ARG_RES_DIR}")
_mod_collect_assets(_res_deps "${_res_dir}")
list(APPEND _package_deps ${_res_deps})
list(APPEND _package_inputs "${_res_dir}" ${_res_deps})
list(APPEND _zip_args res)
list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} "-DSRC=${_res_dir}"
"-DDST=${_stage}/res" -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CopyModAssets.cmake")
endif ()
if (ARG_OVERLAY_DIR)
_mod_resolve_source_path(_overlay_dir "${ARG_OVERLAY_DIR}")
_mod_collect_assets(_overlay_deps "${_overlay_dir}")
list(APPEND _package_deps ${_overlay_deps})
list(APPEND _package_inputs "${_overlay_dir}" ${_overlay_deps})
list(APPEND _zip_args overlay)
list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} "-DSRC=${_overlay_dir}"
"-DDST=${_stage}/overlay" -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CopyModAssets.cmake")
endif ()
if (ARG_TEXTURES_DIR)
_mod_resolve_source_path(_textures_dir "${ARG_TEXTURES_DIR}")
_mod_collect_assets(_textures_deps "${_textures_dir}")
list(APPEND _package_deps ${_textures_deps})
list(APPEND _package_inputs "${_textures_dir}" ${_textures_deps})
list(APPEND _zip_args textures)
list(APPEND _extra_cmds COMMAND ${CMAKE_COMMAND} "-DSRC=${_textures_dir}"
"-DDST=${_stage}/textures" -P "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/CopyModAssets.cmake")
endif ()
set(_bundle_cmds "")
if (ARG_BUNDLE AND TARGET dusklight)
file(READ "${_mod_json}" _mod_json_text)
string(JSON _mod_id GET "${_mod_json_text}" id)
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_TARGETS "${target_name}")
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_IDS "${_mod_id}")
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_STAGES "${_stage}")
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_PACKAGES "${_out}")
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_LIB_PLATFORMS "${_lib_platform}")
set_property(GLOBAL APPEND PROPERTY DUSK_BUNDLED_MOD_LIB_NAMES "${_lib_name}")
set(_bundle_cmds
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bundled_mods"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_out}" "${CMAKE_BINARY_DIR}/bundled_mods/${target_name}.dusk")
endif ()
set(_package_target "${target_name}_package")
set(_package_inputs_file "${CMAKE_CURRENT_BINARY_DIR}/${target_name}_package_inputs.txt")
list(SORT _package_inputs)
set(_package_inputs_text "")
foreach (_package_input IN LISTS _package_inputs)
string(APPEND _package_inputs_text "${_package_input}\n")
endforeach ()
file(GENERATE OUTPUT "${_package_inputs_file}" CONTENT "${_package_inputs_text}")
add_custom_command(OUTPUT "${_out}"
COMMAND ${CMAKE_COMMAND} -E rm -rf "${_stage}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${_stage}" "${_output_dir}"
${_lib_copy_cmd}
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_mod_json}" "${_stage}/mod.json"
${_extra_cmds}
COMMAND ${CMAKE_COMMAND} -E chdir "${_stage}" ${CMAKE_COMMAND} -E tar cvf "${_out}" --format=zip ${_zip_args}
${_bundle_cmds}
DEPENDS ${_target_depend} ${_package_deps} "${_package_inputs_file}"
COMMENT "Packaging ${target_name} -> ${_out}"
COMMAND_EXPAND_LISTS
VERBATIM
)
add_custom_target(${_package_target} ALL DEPENDS "${_out}")
if (TARGET dusklight_mods)
add_dependencies(dusklight_mods ${_package_target})
endif ()
endfunction()
# Install rules for BUNDLE mods.
# - Windows: the .dusk archives into <install>/mods (the loader extracts native libs to the
# user cache).
# - Linux: pre-extracted stage dirs into <install>/mods so native libs dlopen in place from
# read-only installs.
# - macOS: pre-extracted stage dirs into the installed app's Contents/Resources/mods, native
# libs ad-hoc signed in place, then the whole bundle re-signed.
# - iOS/tvOS: assets into <app>/mods/<id>, the mod library into Frameworks/<id>.so,
# and runtime libraries alongside it.
# - Android: nothing here; gradle packs ${CMAKE_BINARY_DIR}/bundled_mods into APK assets.
function(install_bundled_mods)
get_property(_targets GLOBAL PROPERTY DUSK_BUNDLED_MOD_TARGETS)
if (NOT _targets OR ANDROID)
return ()
endif ()
get_property(_ids GLOBAL PROPERTY DUSK_BUNDLED_MOD_IDS)
get_property(_stages GLOBAL PROPERTY DUSK_BUNDLED_MOD_STAGES)
get_property(_lib_platforms GLOBAL PROPERTY DUSK_BUNDLED_MOD_LIB_PLATFORMS)
get_property(_lib_names GLOBAL PROPERTY DUSK_BUNDLED_MOD_LIB_NAMES)
list(LENGTH _targets _count)
math(EXPR _last "${_count} - 1")
if (APPLE)
get_target_property(_app_name dusklight OUTPUT_NAME)
if (NOT _app_name)
set(_app_name dusklight)
endif ()
set(_bundle_dir "${CMAKE_INSTALL_PREFIX}/${_app_name}.app")
if (IOS OR TVOS)
foreach (_i RANGE ${_last})
list(GET _targets ${_i} _target)
list(GET _ids ${_i} _id)
list(GET _stages ${_i} _stage)
list(GET _lib_platforms ${_i} _lib_platform)
list(GET _lib_names ${_i} _lib_name)
install(DIRECTORY "${_stage}/" DESTINATION "${_bundle_dir}/mods/${_id}"
PATTERN "lib" EXCLUDE)
install(PROGRAMS "$<TARGET_FILE:${_target}>"
DESTINATION "${_bundle_dir}/Frameworks" RENAME "${_id}.so")
install(DIRECTORY "${_stage}/lib/${_lib_platform}/"
DESTINATION "${_bundle_dir}/Frameworks"
PATTERN "${_lib_name}" EXCLUDE)
endforeach ()
if (DUSK_HAS_PREPATCH)
set(_prepatch_executable "${_bundle_dir}/Dusklight")
set(_prepatch_mod_args "")
foreach (_id IN LISTS _ids)
string(APPEND _prepatch_mod_args
" \"${_bundle_dir}/Frameworks/${_id}.so\"")
endforeach ()
install(CODE "
execute_process(
COMMAND \"${SYMGEN_EXE}\" prepatch
--binary \"${_prepatch_executable}\"
--report \"${CMAKE_BINARY_DIR}/prepatch-report-$<CONFIG>.json\"
${_prepatch_mod_args}
COMMAND_ERROR_IS_FATAL ANY)")
endif ()
else ()
foreach (_i RANGE ${_last})
list(GET _ids ${_i} _id)
list(GET _stages ${_i} _stage)
list(GET _lib_platforms ${_i} _lib_platform)
list(GET _lib_names ${_i} _lib_name)
install(DIRECTORY "${_stage}/" DESTINATION "${_bundle_dir}/Contents/Resources/mods/${_id}")
install(CODE "
file(GLOB _mod_libs \"${_bundle_dir}/Contents/Resources/mods/${_id}/lib/${_lib_platform}/*\")
foreach (_mod_lib IN LISTS _mod_libs)
if (NOT IS_DIRECTORY \"\${_mod_lib}\")
execute_process(COMMAND /usr/bin/codesign --force --sign - \"\${_mod_lib}\" COMMAND_ERROR_IS_FATAL ANY)
endif ()
endforeach ()")
endforeach ()
if (DUSK_HAS_PREPATCH)
set(_prepatch_executable "${_bundle_dir}/Contents/MacOS/Dusklight")
set(_prepatch_mod_args "")
foreach (_i RANGE ${_last})
list(GET _ids ${_i} _id)
list(GET _lib_platforms ${_i} _lib_platform)
list(GET _lib_names ${_i} _lib_name)
string(APPEND _prepatch_mod_args
" \"${_bundle_dir}/Contents/Resources/mods/${_id}/lib/${_lib_platform}/${_lib_name}\"")
endforeach ()
install(CODE "
execute_process(
COMMAND \"${SYMGEN_EXE}\" prepatch
--binary \"${_prepatch_executable}\"
--report \"${CMAKE_BINARY_DIR}/prepatch-report-$<CONFIG>.json\"
${_prepatch_mod_args}
COMMAND_ERROR_IS_FATAL ANY)")
endif ()
if (TARGET crashpad_handler)
install(CODE "execute_process(COMMAND /usr/bin/codesign --force --sign - \"${_bundle_dir}/Contents/MacOS/$<TARGET_FILE_NAME:crashpad_handler>\" COMMAND_ERROR_IS_FATAL ANY)")
endif ()
install(CODE "execute_process(COMMAND /usr/bin/codesign --force --sign - --entitlements \"${DUSK_ENTITLEMENTS}\" \"${_bundle_dir}\" COMMAND_ERROR_IS_FATAL ANY)")
endif ()
return ()
endif ()
if (DUSK_PACKAGE_INSTALL)
set(_mods_dest "${CMAKE_INSTALL_DATAROOTDIR}/dusklight/mods")
else ()
set(_mods_dest "${CMAKE_INSTALL_PREFIX}/mods")
endif ()
if (WIN32)
foreach (_target IN LISTS _targets)
install(FILES "${CMAKE_BINARY_DIR}/bundled_mods/${_target}.dusk" DESTINATION "${_mods_dest}")
endforeach ()
else ()
foreach (_i RANGE ${_last})
list(GET _ids ${_i} _id)
list(GET _stages ${_i} _stage)
install(DIRECTORY "${_stage}/" DESTINATION "${_mods_dest}/${_id}")
endforeach ()
endif ()
endfunction()
-13
View File
@@ -1,13 +0,0 @@
# Patches capstone's CMakeLists.txt for compatibility with CMake >= 4.0:
# - Bumps cmake_minimum_required to 3.10 (CMake >= 4.0 dropped < 3.5 support; < 3.10 warns)
# - Removes cmake_policy(SET CMP0048 OLD) (rejected by CMake >= 3.27)
file(READ "${DIR}/CMakeLists.txt" _content)
string(REGEX REPLACE
"cmake_minimum_required[ \t]*\\([ \t]*VERSION[ \t]+[0-9]+\\.[0-9]+(\\.[0-9]+)?[ \t]*\\)"
"cmake_minimum_required(VERSION 3.10)"
_content "${_content}")
string(REGEX REPLACE
"cmake_policy[ \t]*\\([ \t]*SET[ \t]+CMP0048[ \t]+OLD[ \t]*\\)"
"# cmake_policy(SET CMP0048 OLD)"
_content "${_content}")
file(WRITE "${DIR}/CMakeLists.txt" "${_content}")
-60
View File
@@ -1,60 +0,0 @@
file(READ "${SOURCE_DIR}/cmake/capstone.cmake.in" _content)
# Insert PATCH_COMMAND before CONFIGURE_COMMAND in the ExternalProject_Add.
# Bracket args prevent cmake from substituting ${...} while writing this file.
string(REPLACE
" CONFIGURE_COMMAND \"\""
[=[ PATCH_COMMAND "${CMAKE_COMMAND}" -DDIR=${CMAKE_CURRENT_BINARY_DIR}/capstone-src -P "${CAPSTONE_FIX_SCRIPT}"
CONFIGURE_COMMAND ""]=]
_content "${_content}")
file(WRITE "${SOURCE_DIR}/cmake/capstone.cmake.in" "${_content}")
file(READ "${SOURCE_DIR}/src/funchook_unix.c" _unix_content)
# macOS rejects the POSIX mprotect RWX/RW transition for executable image pages on arm64.
# Use Mach VM_PROT_COPY for the short patch window, then restore RX permissions.
if (NOT _unix_content MATCHES "VM_PROT_READ \\| VM_PROT_WRITE \\| VM_PROT_COPY")
string(REPLACE
[=[ rv = mprotect(mstate->addr, mstate->size, prot);]=]
[=[#ifdef __APPLE__
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)mstate->addr,
(vm_size_t)mstate->size, FALSE,
VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY);
if (kr == KERN_SUCCESS) {
funchook_log(funchook, " unprotect memory %p (size=%"PRIuPTR", prot=read,write,copy) <- %p (size=%"PRIuPTR")\n",
mstate->addr, mstate->size, start, len);
return 0;
}
funchook_set_error_message(funchook, "Failed to unprotect memory %p (size=%"PRIuPTR", prot=read,write,copy) <- %p (size=%"PRIuPTR", error=%s)",
mstate->addr, mstate->size, start, len,
mach_error_string(kr));
return FUNCHOOK_ERROR_MEMORY_FUNCTION;
#endif
rv = mprotect(mstate->addr, mstate->size, prot);]=]
_unix_content "${_unix_content}")
string(REPLACE
[=[ char errbuf[128];
int rv = mprotect(mstate->addr, mstate->size, PROT_READ | PROT_EXEC);]=]
[=[ char errbuf[128];
#ifdef __APPLE__
kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)mstate->addr,
(vm_size_t)mstate->size, FALSE,
VM_PROT_READ | VM_PROT_EXECUTE);
if (kr == KERN_SUCCESS) {
funchook_log(funchook, " protect memory %p (size=%"PRIuPTR", prot=read,exec)\n",
mstate->addr, mstate->size);
return 0;
}
funchook_set_error_message(funchook, "Failed to protect memory %p (size=%"PRIuPTR", prot=read,exec, error=%s)",
mstate->addr, mstate->size,
mach_error_string(kr));
return FUNCHOOK_ERROR_MEMORY_FUNCTION;
#endif
int rv = mprotect(mstate->addr, mstate->size, PROT_READ | PROT_EXEC);]=]
_unix_content "${_unix_content}")
endif ()
file(WRITE "${SOURCE_DIR}/src/funchook_unix.c" "${_unix_content}")
-153
View File
@@ -1,153 +0,0 @@
include_guard(GLOBAL)
get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
set(_SYMGEN_VERSION "1.3.2")
set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}")
set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release")
mark_as_advanced(SYMGEN_PATH)
function(symgen_host_asset out_name out_hash)
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" _host_processor)
set(_asset "")
set(_asset_hash "")
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if (_host_processor MATCHES "^(arm64|aarch64)$")
set(_asset "symgen-macos-arm64")
set(_asset_hash "SHA256=0344838d1674df09c17c3eeddcf26eb89c333fdb85dfd78f68adc436070eccbe")
elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-macos-x86_64")
set(_asset_hash "SHA256=ae0674f4a1e9d0dedfa02d35939ac28cdd229276b331c1f507df5df809cbec7e")
endif ()
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if (_host_processor MATCHES "^(aarch64|arm64)$")
set(_asset "symgen-linux-aarch64")
set(_asset_hash "SHA256=af766de2bfaeb0a06f6d7bc17bb2510b4a9c40f44a56e49bc4a4b798a6223042")
elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-linux-x86_64")
set(_asset_hash "SHA256=ebd62fb9623acc942b6295609e2306f85a73043b0a8a117f2072b761dd08e68f")
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
set(_asset "symgen-linux-i686")
set(_asset_hash "SHA256=07780a4513fd29726578efc4ff2d88736b22f407ed821b32a68e35ff1e9af5f4")
endif ()
elseif (CMAKE_HOST_WIN32)
if (_host_processor MATCHES "^(arm64|aarch64)$")
set(_asset "symgen-windows-arm64.exe")
set(_asset_hash "SHA256=5bb22b4a4a9b5ad45646af411bfb09b8321a732ff3a077eb4c9de1feaef27d2b")
elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-windows-x86_64.exe")
set(_asset_hash "SHA256=1d1ac087f991a96932d108969e15998becfec643e88f3e7d182ca97ebfc6a46f")
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
set(_asset "symgen-windows-x86.exe")
set(_asset_hash "SHA256=c113f4cd05f813efe2b1878dbfcf44d6302aee3974271736e0036430b0cced78")
endif ()
endif ()
set(${out_name} "${_asset}" PARENT_SCOPE)
set(${out_hash} "${_asset_hash}" PARENT_SCOPE)
endfunction()
function(ensure_symgen required)
if (TARGET symgen)
return()
endif ()
if (SYMGEN_PATH)
get_filename_component(_symgen "${SYMGEN_PATH}" ABSOLUTE)
if (NOT EXISTS "${_symgen}")
if (required)
message(FATAL_ERROR "symgen: SYMGEN_PATH does not exist: ${_symgen}")
endif ()
message(STATUS "symgen: SYMGEN_PATH does not exist, symbol manifest generation "
"skipped (by-name hook resolution will be unavailable)")
return()
endif ()
else ()
symgen_host_asset(_asset _asset_hash)
if (_asset STREQUAL "")
if (required)
message(FATAL_ERROR "symgen: no prebuilt binary for host "
"${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR} "
"(configure with -DDUSK_ENABLE_CODE_MODS=OFF)")
endif ()
message(STATUS "symgen: no prebuilt binary for host "
"${CMAKE_HOST_SYSTEM_NAME}/${CMAKE_HOST_SYSTEM_PROCESSOR}; "
"symbol manifest generation skipped (by-name hook resolution will be unavailable)")
return()
endif ()
set(_symgen_dir "${CMAKE_BINARY_DIR}/_deps/symgen")
set(_symgen "${_symgen_dir}/${_asset}")
set(_url "${_SYMGEN_RELEASE_BASE_URL}/${_asset}")
message(STATUS "dusklight: Fetching symgen ${_SYMGEN_VERSION} (${_asset})")
file(MAKE_DIRECTORY "${_symgen_dir}")
file(DOWNLOAD "${_url}" "${_symgen}"
TLS_VERIFY ON
STATUS _download_status
SHOW_PROGRESS
EXPECTED_HASH "${_asset_hash}")
list(GET _download_status 0 _download_code)
if (NOT _download_code EQUAL 0)
list(GET _download_status 1 _download_message)
file(REMOVE "${_symgen}")
if (required)
message(FATAL_ERROR "symgen: failed to download ${_url}: ${_download_message}")
endif ()
message(STATUS "symgen: failed to download ${_url}: ${_download_message}; "
"symbol manifest generation skipped (by-name hook resolution will be unavailable)")
return()
endif ()
if (NOT CMAKE_HOST_WIN32)
file(CHMOD "${_symgen}" PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)
endif ()
endif ()
add_custom_target(symgen DEPENDS "${_symgen}")
set(SYMGEN_EXE "${_symgen}" CACHE INTERNAL "symgen executable" FORCE)
endfunction()
function(setup_symbol_manifest target)
ensure_symgen(TRUE)
if (NOT TARGET symgen)
return()
endif ()
add_dependencies(${target} symgen)
# Reserve an ELF program-header entry when the linker supports it (mold).
# symgen can replace the PT_NULL entry without relocating the table, keeping later post-link tools safe.
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
include(CheckLinkerFlag)
check_linker_flag(CXX "LINKER:--spare-program-headers=1" _linker_supports_spare_program_headers)
if (_linker_supports_spare_program_headers)
target_link_options(${target} PRIVATE "LINKER:--spare-program-headers=1")
endif ()
endif ()
if (WIN32)
set(_input --pdb "$<TARGET_PDB_FILE:${target}>")
else ()
set(_input --binary "$<TARGET_FILE:${target}>")
endif ()
if (APPLE)
# Room for the symbol manifest and several prepatch arenas.
target_link_options(${target} PRIVATE "LINKER:-headerpad,0x1000")
# ld64 may update an existing output, which breaks our symdb insertion. Remove it first.
add_custom_command(TARGET ${target} PRE_LINK
COMMAND "${CMAKE_COMMAND}" -E rm -f "$<TARGET_FILE:${target}>"
VERBATIM)
endif ()
# The manifest is embedded into the image as a new section, located at runtime through
# the descriptor manifest.cpp reserves. On Apple platforms this command must stay
# attached before the ad-hoc codesign POST_BUILD command: the patch removes any existing
# signature.
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${SYMGEN_EXE}" manifest ${_input} --embed "$<TARGET_FILE:${target}>"
COMMENT "Embedding symbol manifest"
VERBATIM)
endfunction()
-93
View File
@@ -1,93 +0,0 @@
include_guard(GLOBAL)
get_filename_component(_DUSK_WINDOWS_EXPORTS_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
# Windows mod linking: generate the curated export surface for the game executable and the
# import library mods link against. symgen scans the built objects, filters by source, and
# writes a .def used by the main link and import library generation.
function(setup_windows_exports target)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _implib_arch)
if (_implib_arch STREQUAL "arm64")
set(_dlltool_machine "arm64")
set(_lib_machine "arm64")
elseif (_implib_arch MATCHES "^(amd64|x86_64)$")
set(_dlltool_machine "i386:x86-64")
set(_lib_machine "x64")
else ()
message(FATAL_ERROR
"dusklight: no Windows mod linking support for ${CMAKE_SYSTEM_PROCESSOR}")
endif ()
include("${_DUSK_WINDOWS_EXPORTS_CMAKE_DIR}/SymbolManifest.cmake")
ensure_symgen(TRUE)
set(_symgen "${SYMGEN_EXE}")
add_dependencies(${target} symgen)
set(_config_subdir "")
if (CMAKE_CONFIGURATION_TYPES)
set(_config_subdir "$<CONFIG>/")
endif ()
set(_rsp_lines "$<TARGET_OBJECTS:${target}>")
foreach (_lib IN LISTS JSYSTEM_LIBRARIES)
list(APPEND _rsp_lines "$<TARGET_FILE:${_lib}>")
endforeach ()
list(JOIN _rsp_lines "\n" _rsp_content)
set(_rsp "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports_input.rsp")
file(GENERATE OUTPUT "${_rsp}" CONTENT "${_rsp_content}")
set(_sdk_args)
foreach (_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
aurora_os aurora_pad aurora_si aurora_vi)
if (TARGET ${_lib})
list(APPEND _sdk_args --sdk-lib "$<TARGET_FILE:${_lib}>")
endif ()
endforeach ()
set(_forward_args)
if (TARGET dawn::webgpu_dawn)
get_target_property(_dawn_type dawn::webgpu_dawn TYPE)
if (_dawn_type STREQUAL "SHARED_LIBRARY")
list(APPEND _forward_args
--forward-dll "$<TARGET_FILE:dawn::webgpu_dawn>"
--forward-sym-prefix wgpu)
endif ()
endif ()
# Generate curated exports list from the main binary
set(_def "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_exports.def")
add_custom_command(TARGET ${target} PRE_LINK
COMMAND "${_symgen}" def
"@${_rsp}"
--out "${_def}"
--exclude cmake_pch
--exclude miniz
--exclude asan_options
--exclude src/dusk
--max-exports 58000
${_sdk_args}
${_forward_args}
COMMENT "Generating dusklight exports"
VERBATIM)
target_link_options(${target} PRIVATE "/DEF:${_def}")
# Generate import library for mods to link against.
set(_implib "${CMAKE_BINARY_DIR}/${_config_subdir}dusklight_imports.lib")
get_filename_component(_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
find_program(DUSK_LLVM_DLLTOOL llvm-dlltool HINTS "${_compiler_dir}")
if (DUSK_LLVM_DLLTOOL)
set(_implib_cmd "${DUSK_LLVM_DLLTOOL}" -d "${_def}" -D dusklight.exe
-m "${_dlltool_machine}" -l "${_implib}")
else ()
set(_implib_cmd "${CMAKE_AR}" /nologo "/def:${_def}" "/machine:${_lib_machine}"
/name:dusklight.exe "/out:${_implib}")
endif ()
add_custom_command(TARGET ${target} POST_BUILD
COMMAND ${_implib_cmd}
BYPRODUCTS "${_implib}"
COMMENT "Generating dusklight import library"
VERBATIM)
set(DUSK_GAME_IMPLIB "${_implib}" CACHE INTERNAL "Import library for Windows mod linking")
install(FILES "${_implib}" DESTINATION sdk RENAME "windows-${_implib_arch}.lib")
endfunction()
-9
View File
@@ -1,9 +0,0 @@
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64" OR CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC")
set(CMAKE_SYSTEM_PROCESSOR "ARM64")
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "x64")
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
elseif (CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "X86")
set(CMAKE_SYSTEM_PROCESSOR "X86")
endif ()
endif ()
+51 -185
View File
@@ -1,165 +1,51 @@
# Building Dusklight ### Building
#### Prerequisites
## Dependencies
The following dependencies are required:
* [CMake 3.25+](https://cmake.org) * [CMake 3.25+](https://cmake.org)
* Windows: Install `CMake Tools` in Visual Studio
* macOS: `brew install cmake`
* [Python 3+](https://python.org) * [Python 3+](https://python.org)
* Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640)
### Windows * Verify it's added to `%PATH%` by typing `python` in `cmd`.
* macOS: `brew install python@3`
* Install [CMake 3.25+](https://cmake.org) by searching `CMake Tools` in Visual Studio * **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
* Install Python 3 from the [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640) and verify it's added to `%PATH%` by typing `python` in `cmd`. * Select `C++ Development` and verify the following packages are included:
* `Windows 11 SDK`
Recommended IDEs: * `CMake Tools`
* `C++ Clang Compiler`
* [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx). During installation: * `C++ Clang-cl`
* Select `C++ Development` and verify the following packages are included: * **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/)
* `Windows 11 SDK` * **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
* `CMake Tools` * Ubuntu 24.04+ packages
* `C++ Clang Compiler` ```
* `C++ Clang-cl` build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
### macOS libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
* Make sure [Homebrew](https://brew.sh) is installed libxss-dev libxtst-dev
* Install [CMake 3.25+](https://cmake.org) ```
* Arch Linux packages
```sh ```
brew install cmake base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
``` ```
* Fedora packages
* Install Python 3 ```
cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
```sh ```
brew install python@3 * It's also important that you install the developer tools and libraries
``` ```
sudo dnf groupinstall "Development Tools" "Development Libraries"
Recommended IDEs: ```
#### Setup
* [Xcode 16.4 or later](https://developer.apple.com/xcode/) Clone and initialize the Dusklight repository
* [Visual Studio Code](https://code.visualstudio.com/download/)
* [CLion](https://www.jetbrains.com/clion/)
### Linux
Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
**Ubuntu 24.04+ packages**
<details>
<summary>Click to expand</summary>
* Run the following command to install the required dependencies:
```sh
sudo apt update && sudo apt install -y \
build-essential \
clang \
cmake \
curl \
git \
libasound2-dev \
libclang-dev \
libcurl4-openssl-dev \
libdbus-1-dev \
libfreetype-dev \
libglu1-mesa-dev \
libgtk-3-dev \
libncurses5-dev \
libpng-dev \
libpulse-dev \
libudev-dev \
libvulkan-dev \
libx11-xcb-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libxrandr-dev \
libxss-dev \
libxtst-dev \
lld \
ninja-build \
python-is-python3 \
python3 \
python3-markupsafe \
zlib1g-dev
```
</details>
<br>
**Arch Linux packages**
<details>
<summary>Click to expand</summary>
* Run the following command to install the required dependencies:
```sh
sudo pacman -S --needed \
alsa-lib \
base-devel \
clang \
cmake \
freetype2 \
libpulse \
libxrandr \
lld \
llvm \
ninja \
python \
python-markupsafe \
vulkan-headers
```
</details>
<br>
**Fedora packages**
<details>
<summary>Click to expand</summary>
* Run the following command to install the required dependencies:
```sh
sudo dnf install -y \
clang-devel \
cmake \
libpng-devel \
llvm-devel \
ninja-build \
vulkan-headers
```
* It's also important that you install the developer tools and libraries
```sh
sudo dnf groupinstall \
"Development Libraries" "Development Tools"
```
</details>
<br>
Recommended IDEs:
* [CLion](https://www.jetbrains.com/clion/)
* [Visual Studio Code](https://code.visualstudio.com/download/)
## Building
* Clone and initialize the Dusklight repository:
```sh ```sh
git clone --recursive https://github.com/TwilitRealm/dusklight.git git clone --recursive https://github.com/TwilitRealm/dusklight.git
git pull
cd dusklight cd dusklight
git pull
git submodule update --init --recursive git submodule update --init --recursive
``` ```
#### Building
**CLion (Windows / macOS / Linux)** **CLion (Windows / macOS / Linux)**
Open the project directory in CLion. Enable the appropriate presets for your platform: Open the project directory in CLion. Enable the appropriate presets for your platform:
@@ -178,9 +64,7 @@ cmake --build --preset macos-default-relwithdebinfo
``` ```
Alternate presets available: Alternate presets available:
- `macos-default-debug`: Clang, Debug
* `macos-default-debug`: Clang, Debug
* `macos-default-debug-asan`: Clang, Debug, AddressSanitizer
**ninja (Linux)** **ninja (Linux)**
@@ -190,12 +74,9 @@ cmake --build --preset linux-default-relwithdebinfo
``` ```
Alternate presets available: Alternate presets available:
- `linux-default-debug`: GCC, Debug
* `linux-default-debug`: GCC, Debug - `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
* `linux-default-debug-asan`: GCC, Debug, AddressSanitizer - `linux-clang-debug`: Clang, Debug
* `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
* `linux-clang-debug`: Clang, Debug
* `linux-clang-debug-asan`: Clang, Debug, AddressSanitizer
**ninja (Windows)** **ninja (Windows)**
@@ -205,28 +86,13 @@ cmake --build --preset windows-msvc-relwithdebinfo
``` ```
Alternate presets available: Alternate presets available:
- `windows-msvc-debug`: MSVC, Debug
- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
- `windows-clang-debug`: Clang-cl, Debug
* `windows-msvc-debug`: MSVC, Debug #### Running
* `windows-msvc-debug-asan`: MSVC, Debug, AddressSanitizer Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
* `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
* `windows-clang-debug`: Clang-cl, Debug
## Running
**Windows / Linux**
* Pass the disc image as a positional argument using the `--dvd` flag. Supported formats are: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
```sh ```sh
build/{preset}/dusklight --dvd /path/to/game.iso build/{preset}/dusklight/path/to/game.rvz
```
**macOS**
macOS builds an `.app` bundle which contains the executable and all necessary resources.
* Pass the disc image as a positional argument using the `--dvd` flag. Supported formats are: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
```sh
build/{preset}/Dusklight.app/Contents/MacOS/Dusklight --dvd /path/to/game.iso
``` ```
If no path is specified, Dusklight defaults to `game.iso` in the current working directory.
+26 -34
View File
@@ -1,54 +1,46 @@
# Installing Dusklight on iOS via iloader # Installing Dusklight on iOS via AltStore
## Prerequisites ## Prerequisites
- A Windows, Linux, or macOS device - Mac with Homebrew installed
- iOS device connected to computer via USB - iPhone connected via USB
- Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases)) - Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusk/releases))
- Legally acquired game disc: - Game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL)
- `GZ2E01` (GameCube USA)
- `GZ2P01` (GameCube PAL)
- `GZ2J01` (GameCube JPN)
- `RZDE01` (Wii USA Rev. 0 *or* Rev. 2)
- `RZDP01` (Wii PAL)
- `RZDJ01` (Wii JPN)
## 1. Install iloader ## 1. Install AltServer
- Executable bundles can be installed from [iloader's main page](https://iloader.app/) or [their GitHub](https://github.com/nab138/iloader) for Windows, Linux, and macOS. ```sh
- Windows WILL require iTunes to be installed brew install altserver
- Linux WILL require usbmuxd to be installed, this is installed by default in most distros though open -a AltServer
```
AltServer will appear in your menu bar.
## 2. Enable Developer Mode (iOS 16+) ## 2. Enable Developer Mode (iOS 16+)
- On your iPhone, go to **Settings > Privacy & Security > Developer Mode** - On your iPhone, go to **Settings > Privacy & Security > Developer Mode**
- Toggle it on, put in your device passcode, and restart when prompted - Toggle it on and restart when prompted
## 3. Install Dusklight on Your iPhone ## 3. Install AltStore on Your iPhone
1. Sign into your Apple ID (this is required for registering app IDs, it is sent securely directly to Apple and not stored by iloader) - Click AltServer in the menu bar
* You may be prompted to put in a code from your iOS device if you have 2FA enabled, do so - Click **Install AltStore > [Your iPhone]**
2. Plug in your iOS device via USB into your PC. If you're missing a dependency, an error pop-up will tell you to install it - Enter your Apple ID credentials when prompted
* You will need to hit `Refresh` after plugging it in at this stage so that it can be detected, it does not automatically refresh - On your iPhone, go to **Settings > General > VPN & Device Management**
3. Leave settings unchanged (the Anisette server should stay Sidestore (.io)) - Tap your Apple ID under "Developer App" and tap **Trust**
3.(a) Installing SideStore directly is not required, but provides you a way to install Dusklight on your phone without being plugged into a computer later
4. Press `Import IPA` and choose your downloaded `Dusklight-v.X.X.X-ios-arm64.ipa`, it will begin installing on your device
**NOTE:** *At various stages, you may be prompted to trust your device, do so*
## 3. Getting Dusklight trusted
When installing sideloaded iOS applications, at first you will need to manually trust the app due to Apple's security policies
* Go to **Settings > General > VPN & Device Management**
* Tap the Apple ID you signed into iloader with under "Developer App" and tap **Trust**
* Tap **Allow** on the pop-up
## 4. Copy Files to Your iPhone ## 4. Copy Files to Your iPhone
Transfer the game disc (and optionally, the Dusklight IPA) to your iPhone so they are accessible in the Files app. A few ways to do this: Transfer the IPA and game disc to your iPhone so they're accessible in the Files app. A few ways to do this:
- **AirDrop** - Right-click the files on your Mac and choose Share > AirDrop - **AirDrop** - Right-click the files on your Mac and choose Share > AirDrop
- **iCloud Drive** - Place files in iCloud Drive on your Mac and they'll sync to Files on your iPhone - **iCloud Drive** - Place files in iCloud Drive on your Mac and they'll sync to Files on your iPhone
- **USB transfer** - Connect your iPhone and drag files via Finder's sidebar - **USB transfer** - Connect your iPhone and drag files via Finder's sidebar
- **Cloud storage** - Upload to Google Drive, Dropbox, etc. and download on your iPhone - **Cloud storage** - Upload to Google Drive, Dropbox, etc. and download on your iPhone
You may now use Dusklight on iOS and iPadOS! ## 5. Install via AltStore
- Open **AltStore** on your iPhone
- Go to the **My Apps** tab
- Tap the **+** button (top left)
- Open the **Files** app and select the `.ipa` file
-1072
View File
File diff suppressed because it is too large Load Diff
+1 -1
-1
Submodule extern/borealis deleted from 6fd955e7e6
+55 -116
View File
@@ -1411,114 +1411,56 @@ set(DOLPHIN_FILES
) )
set(DUSK_FILES set(DUSK_FILES
include/helpers/batch.hpp include/dusk/action_bindings.h
include/helpers/bits.hpp include/dusk/endian_gx.hpp
include/helpers/endian_gx.hpp include/dusk/config.hpp
include/dusk/dvd_asset.hpp
include/dusk/scope_guard.hpp
src/dusk/dvd_asset.cpp
src/d/actor/d_a_alink_dusk.cpp src/d/actor/d_a_alink_dusk.cpp
src/dusk/OSContext.cpp
src/dusk/OSMutex.cpp
src/dusk/OSReport.cpp
src/dusk/OSThread.cpp
src/dusk/achievements.cpp
src/dusk/action_bindings.cpp
src/dusk/action_bindings.h
src/dusk/asserts.cpp src/dusk/asserts.cpp
src/dusk/autosave.cpp
src/dusk/config.cpp src/dusk/config.cpp
src/dusk/config.hpp src/dusk/crash_reporting.cpp
src/dusk/data.cpp src/dusk/data.cpp
src/dusk/data.hpp src/dusk/data.hpp
src/dusk/discord_presence.cpp src/dusk/endian.cpp
src/dusk/dvd_asset.cpp
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/game_mode.cpp
src/dusk/gamepad_color.cpp
src/dusk/globals.cpp src/dusk/globals.cpp
src/dusk/gyro.cpp src/dusk/gyro.cpp
src/dusk/hq_minimap.cpp src/dusk/gamepad_color.cpp
src/dusk/imgui/ImGuiActorSpawner.cpp src/dusk/autosave.cpp
src/dusk/imgui/ImGuiBloomWindow.cpp src/dusk/http/http.hpp
src/dusk/imgui/ImGuiBloomWindow.hpp
src/dusk/imgui/ImGuiCameraOverlay.cpp
src/dusk/imgui/ImGuiConfig.hpp
src/dusk/imgui/ImGuiConsole.cpp
src/dusk/imgui/ImGuiConsole.hpp
src/dusk/imgui/ImGuiControllerOverlay.cpp
src/dusk/imgui/ImGuiEngine.cpp
src/dusk/imgui/ImGuiEngine.hpp
src/dusk/imgui/ImGuiHeapOverlay.cpp
src/dusk/imgui/ImGuiMenuTools.cpp
src/dusk/imgui/ImGuiMenuTools.hpp
src/dusk/imgui/ImGuiProcessOverlay.cpp
src/dusk/imgui/ImGuiSaveEditor.cpp
src/dusk/imgui/ImGuiStateShare.cpp
src/dusk/imgui/ImGuiStateShare.hpp
src/dusk/imgui/ImGuiStubLog.cpp
src/dusk/io.cpp src/dusk/io.cpp
src/dusk/iso_validate.cpp
src/dusk/language.cpp
src/dusk/language.hpp
src/dusk/layout.cpp src/dusk/layout.cpp
src/dusk/livesplit.cpp
src/dusk/logging.cpp src/dusk/logging.cpp
src/dusk/menu_pointer.cpp
src/dusk/menu_pointer.h
src/dusk/mods/loader/bundle_disk.cpp
src/dusk/mods/loader/bundle_zip.cpp
src/dusk/mods/loader/context.cpp
src/dusk/mods/loader/depgraph.cpp
src/dusk/mods/loader/depgraph.hpp
src/dusk/mods/loader/loader.cpp
src/dusk/mods/loader/loader.hpp
src/dusk/mods/loader/native_module.cpp
src/dusk/mods/loader/native_module.hpp
src/dusk/mods/loader/prepatch.cpp
src/dusk/mods/loader/prepatch.hpp
src/dusk/mods/item.hpp
src/dusk/mods/item_checks.cpp
src/dusk/mods/item_gives.cpp
src/dusk/mods/log_buffer.cpp
src/dusk/mods/log_buffer.hpp
src/dusk/mods/manifest.cpp
src/dusk/mods/manifest.hpp
src/dusk/mods/svc/camera.cpp
src/dusk/mods/svc/config.cpp
src/dusk/mods/svc/config.hpp
src/dusk/mods/svc/game.cpp
src/dusk/mods/svc/gfx.cpp
src/dusk/mods/svc/flow.cpp
src/dusk/mods/svc/hook.cpp
src/dusk/mods/svc/host.cpp
src/dusk/mods/svc/item.cpp
src/dusk/mods/svc/item.hpp
src/dusk/mods/svc/log.cpp
src/dusk/mods/svc/overlay.cpp
src/dusk/mods/svc/registry.cpp
src/dusk/mods/svc/registry.hpp
src/dusk/mods/svc/resource.cpp
src/dusk/mods/svc/texture.cpp
src/dusk/mods/svc/ui.cpp
src/dusk/mods/svc/ui.hpp
src/dusk/mods/svc/game_mode.cpp
src/dusk/mods/svc/window.cpp
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/presentation.cpp
src/dusk/presentation.hpp
src/dusk/scope_guard.hpp
src/dusk/settings.cpp src/dusk/settings.cpp
src/dusk/speedrun.cpp src/dusk/speedrun.cpp
src/dusk/stubs.cpp src/dusk/stubs.cpp
src/dusk/texture_replacements.cpp src/dusk/update_check.cpp
src/dusk/texture_replacements.hpp src/dusk/update_check.hpp
src/dusk/touch_camera.cpp #src/dusk/m_Do_ext_dusk.cpp
src/dusk/imgui/ImGuiConfig.hpp
src/dusk/imgui/ImGuiConsole.hpp
src/dusk/imgui/ImGuiConsole.cpp
src/dusk/imgui/ImGuiEngine.cpp
src/dusk/imgui/ImGuiEngine.hpp
src/dusk/imgui/ImGuiBloomWindow.cpp
src/dusk/imgui/ImGuiBloomWindow.hpp
src/dusk/imgui/ImGuiMenuTools.cpp
src/dusk/imgui/ImGuiMenuTools.hpp
src/dusk/imgui/ImGuiActorSpawner.cpp
src/dusk/imgui/ImGuiProcessOverlay.cpp
src/dusk/imgui/ImGuiCameraOverlay.cpp
src/dusk/imgui/ImGuiHeapOverlay.cpp
src/dusk/imgui/ImGuiControllerOverlay.cpp
src/dusk/imgui/ImGuiStubLog.cpp
src/dusk/imgui/ImGuiSaveEditor.cpp
src/dusk/imgui/ImGuiStateShare.hpp
src/dusk/imgui/ImGuiStateShare.cpp
src/dusk/ui/achievements.cpp src/dusk/ui/achievements.cpp
src/dusk/ui/achievements.hpp src/dusk/ui/achievements.hpp
src/dusk/ui/bool_button.cpp src/dusk/ui/bool_button.cpp
@@ -1529,7 +1471,6 @@ set(DUSK_FILES
src/dusk/ui/component.hpp src/dusk/ui/component.hpp
src/dusk/ui/controller_config.cpp src/dusk/ui/controller_config.cpp
src/dusk/ui/controller_config.hpp src/dusk/ui/controller_config.hpp
src/dusk/ui/controls.hpp
src/dusk/ui/document.cpp src/dusk/ui/document.cpp
src/dusk/ui/document.hpp src/dusk/ui/document.hpp
src/dusk/ui/editor.cpp src/dusk/ui/editor.cpp
@@ -1538,22 +1479,10 @@ set(DUSK_FILES
src/dusk/ui/event.hpp src/dusk/ui/event.hpp
src/dusk/ui/graphics_tuner.cpp src/dusk/ui/graphics_tuner.cpp
src/dusk/ui/graphics_tuner.hpp src/dusk/ui/graphics_tuner.hpp
src/dusk/ui/icon_provider.cpp
src/dusk/ui/icon_provider.hpp
src/dusk/ui/input.cpp src/dusk/ui/input.cpp
src/dusk/ui/input.hpp src/dusk/ui/input.hpp
src/dusk/ui/logs_window.cpp
src/dusk/ui/logs_window.hpp
src/dusk/ui/menu_bar.cpp
src/dusk/ui/menu_bar.hpp
src/dusk/ui/mod_texture_provider.cpp
src/dusk/ui/mod_texture_provider.hpp
src/dusk/ui/mod_window.cpp
src/dusk/ui/mod_window.hpp
src/dusk/ui/modal.cpp src/dusk/ui/modal.cpp
src/dusk/ui/modal.hpp src/dusk/ui/modal.hpp
src/dusk/ui/mods_window.cpp
src/dusk/ui/mods_window.hpp
src/dusk/ui/nav_types.hpp src/dusk/ui/nav_types.hpp
src/dusk/ui/number_button.cpp src/dusk/ui/number_button.cpp
src/dusk/ui/number_button.hpp src/dusk/ui/number_button.hpp
@@ -1561,6 +1490,8 @@ set(DUSK_FILES
src/dusk/ui/overlay.hpp src/dusk/ui/overlay.hpp
src/dusk/ui/pane.cpp src/dusk/ui/pane.cpp
src/dusk/ui/pane.hpp src/dusk/ui/pane.hpp
src/dusk/ui/menu_bar.cpp
src/dusk/ui/menu_bar.hpp
src/dusk/ui/prelaunch.cpp src/dusk/ui/prelaunch.cpp
src/dusk/ui/prelaunch.hpp src/dusk/ui/prelaunch.hpp
src/dusk/ui/preset.cpp src/dusk/ui/preset.cpp
@@ -1575,22 +1506,30 @@ set(DUSK_FILES
src/dusk/ui/string_button.hpp src/dusk/ui/string_button.hpp
src/dusk/ui/tab_bar.cpp src/dusk/ui/tab_bar.cpp
src/dusk/ui/tab_bar.hpp src/dusk/ui/tab_bar.hpp
src/dusk/ui/touch_controls.cpp
src/dusk/ui/touch_controls.hpp
src/dusk/ui/touch_controls_common.cpp
src/dusk/ui/touch_controls_common.hpp
src/dusk/ui/touch_controls_editor.cpp
src/dusk/ui/touch_controls_editor.hpp
src/dusk/ui/ui.cpp src/dusk/ui/ui.cpp
src/dusk/ui/ui.hpp src/dusk/ui/ui.hpp
src/dusk/ui/warp.cpp src/dusk/ui/warp.cpp
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/achievements.cpp
src/dusk/iso_validate.cpp
src/dusk/livesplit.cpp
src/dusk/offset_ptr.cpp
src/dusk/OSContext.cpp
src/dusk/OSReport.cpp
src/dusk/OSThread.cpp
src/dusk/OSMutex.cpp
src/dusk/discord.cpp
src/dusk/discord.hpp
src/dusk/discord_presence.cpp
src/dusk/version.cpp src/dusk/version.cpp
src/dusk/utilities.cpp src/dusk/action_bindings.cpp
src/helpers/batch.cpp )
src/helpers/endian.cpp
src/helpers/offset_ptr.cpp set(DUSK_HTTP_BACKEND_FILES
src/helpers/string.cpp src/dusk/http/no_backend.cpp
src/dusk/http/curl.cpp
src/dusk/http/winhttp.cpp
src/dusk/http/url_session.mm
) )
-32
View File
@@ -1,32 +0,0 @@
From f69d29614644f9963f5cb3f828b58575d60a1c5a Mon Sep 17 00:00:00 2001
From: Joshua Trees <gh@jtrees.io>
Date: Thu, 4 Jun 2026 01:04:04 +0100
Subject: [PATCH] fix cmake paths
---
cmake/nodConfig.cmake.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/cmake/nodConfig.cmake.in b/cmake/nodConfig.cmake.in
index 0969382..2a24a88 100644
--- a/cmake/nodConfig.cmake.in
+++ b/cmake/nodConfig.cmake.in
@@ -1,12 +1,12 @@
@PACKAGE_INIT@
-set(_nod_libdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@")
-set(_nod_incdir "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@")
+set(_nod_libdir "@CMAKE_INSTALL_FULL_LIBDIR@")
+set(_nod_incdir "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
if (NOT TARGET nod::nod_shared AND NOT TARGET nod::nod_static)
# Shared library
if (WIN32)
- set(_nod_dll "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_BINDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}nod${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ set(_nod_dll "@CMAKE_INSTALL_FULL_BINDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}nod${CMAKE_SHARED_LIBRARY_SUFFIX}")
set(_nod_implib "${_nod_libdir}/${CMAKE_IMPORT_LIBRARY_PREFIX}nod${CMAKE_IMPORT_LIBRARY_SUFFIX}")
if (EXISTS "${_nod_dll}")
add_library(nod::nod_shared SHARED IMPORTED)
--
2.53.0
Generated
+3 -3
View File
@@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1778869304, "lastModified": 1775710090,
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", "narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb", "rev": "4c1018dae018162ec878d42fec712642d214fdfa",
"type": "github" "type": "github"
}, },
"original": { "original": {
+199 -354
View File
@@ -1,383 +1,228 @@
{ {
description = "Dusklight native PC port of the Twilight Princess decompilation"; inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };
inputs.self.submodules = true; outputs = { self, nixpkgs }:
outputs =
{ self, nixpkgs }:
let let
inherit (nixpkgs) lib;
supportedSystems = [ supportedSystems = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
]; ];
forAllSystems = lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system: import nixpkgs { inherit system; };
dawnVersion = "v20260618.032059"; # Dependencies that are not packaged in nixpkgs (used by the Linux package build):
nodVersion = "v2.0.0-alpha.10"; buildSources = pkgs: {
versionSuffix = "nix-" + (self.shortRev or self.dirtyShortRev or "dirty"); aurora-src = pkgs.fetchFromGitHub {
owner = "encounter";
dawnInfo = { repo = "aurora";
"x86_64-linux" = { rev = "63606a43265a3bc18dafd500ab4d7a2108f109e6";
triple = "linux-x86_64"; hash = "sha256-xBvnAwGwNzav67Ac6oUz7RqDUwqgL2bsME3OOMn8Tqw=";
hash = "sha256-GFSd573b+VQx/VmFdNQgWDd0V9ayQlcw0Zuopke12ak=";
}; };
"aarch64-linux" = { dawn-src = pkgs.fetchzip {
triple = "linux-aarch64"; url = "https://github.com/encounter/dawn-build/releases/download/v20260423.175430/dawn-linux-x86_64.tar.gz";
hash = "sha256-ZaoP7BAjBMnfAv2/AMRi3FNH2ZtyqASCSFyU/oB2Mzg="; hash = "sha256-HXfKTLHtMPwupnFnaflCARtXVPuS/0PoCePXidjE5xs=";
stripRoot = false;
}; };
"aarch64-darwin" = { nod-src = pkgs.fetchzip {
triple = "darwin-arm64"; url = "https://github.com/encounter/nod/releases/download/v2.0.0-alpha.8/libnod-linux-x86_64.tar.gz";
hash = "sha256-HT+qtlLaSHyoXPrUcXgcTGa877X5YfzbxRD4bJb7i1Y="; hash = "sha256-mUqvLsbsqaZ+HAjMmHYPYO+MgtanGRTw7Gzn5uXR5rE=";
stripRoot = false;
}; };
"x86_64-darwin" = { # The version of imgui on nixpkgs does not map cleanly.
triple = "darwin-x86_64"; imgui-src = pkgs.fetchFromGitHub {
hash = "sha256-cUNaCbA7rlKSukDVKGaVEVw0Zt1+mSbaHbmUCMvMVWc="; owner = "ocornut";
repo = "imgui";
rev = "v1.91.9b-docking";
hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ=";
};
sqlite-src = pkgs.fetchzip {
url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip";
hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM=";
};
rmlui-src = pkgs.fetchzip {
url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz";
hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg=";
}; };
}; };
nodPrebuiltInfo = { # Dusklight Actual (Linux x86_64 only — relies on prebuilt dawn/nod binaries)
"x86_64-linux" = { mkDusklight = pkgs:
triple = "linux-x86_64"; let srcs = buildSources pkgs;
hash = "sha256-FVQWECVA2gWdc+n5OQ/Tvwn8z0qdgjSd1WlFt5HKOec="; versionSuffix = if self ? shortRev && self.shortRev != null
}; then "nix-${self.shortRev}"
"aarch64-darwin" = { else "nix-dirty";
triple = "macos-arm64"; in
hash = "sha256-8ZEejxksVgShNKUVRCBYaLOp9x/qOC9pAeVrElQUGUk="; pkgs.stdenv.mkDerivation {
}; name = "dusklight";
}; src = ./.;
postUnpack = ''
perSystem = mkdir -p $sourceRoot/extern/aurora
system: cp -r ${srcs.aurora-src}/. $sourceRoot/extern/aurora/
let chmod -R u+w $sourceRoot/extern/aurora
pkgs = import nixpkgs { inherit system; }; sed -i '/add_subdirectory(tests)/d' $sourceRoot/extern/aurora/CMakeLists.txt
inherit (pkgs.stdenv.hostPlatform) isDarwin; '';
hasNodPrebuilt = nodPrebuiltInfo ? ${system}; # Remove last line to re-enable tests
cmakeFlags = [
aurora = builtins.pathExists "${self}/extern/aurora/CMakeLists.txt"; "-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
dawn = pkgs.fetchzip { "-DFETCHCONTENT_SOURCE_DIR_CXXOPTS=${pkgs.cxxopts.src}"
url = "https://github.com/encounter/dawn/releases/download/${dawnVersion}/dawn-${dawnInfo.${system}.triple}.tar.gz"; "-DFETCHCONTENT_SOURCE_DIR_JSON=${pkgs.nlohmann_json.src}"
hash = dawnInfo.${system}.hash; "-DFETCHCONTENT_SOURCE_DIR_DAWN_PREBUILT=${srcs.dawn-src}"
stripRoot = false; "-DFETCHCONTENT_SOURCE_DIR_XXHASH=${pkgs.xxHash.src}"
}; "-DFETCHCONTENT_SOURCE_DIR_FMT=${pkgs.fmt.src}"
"-DFETCHCONTENT_SOURCE_DIR_TRACY=${pkgs.tracy.src}"
corrosion = pkgs.fetchFromGitHub { "-DAURORA_SDL3_PROVIDER=system"
owner = "corrosion-rs"; "-DFETCHCONTENT_SOURCE_DIR_NOD_PREBUILT=${srcs.nod-src}"
repo = "corrosion"; "-DAURORA_NOD_PROVIDER=package"
rev = "v0.6.1"; "-DFETCHCONTENT_SOURCE_DIR_FREETYPE=${pkgs.freetype.src}"
hash = "sha256-ppuDNObfKhneD9AlnPAvyCRHKW3BidXKglD1j/LE9CM="; "-DFETCHCONTENT_SOURCE_DIR_ZSTD=${pkgs.zstd.src}"
}; "-DFETCHCONTENT_SOURCE_DIR_SQLITE3=${srcs.sqlite-src}"
"-DFETCHCONTENT_SOURCE_DIR_IMGUI=${srcs.imgui-src}"
nodFromSource = pkgs.stdenv.mkDerivation (finalAttrs: { "-DFETCHCONTENT_SOURCE_DIR_RMLUI=${srcs.rmlui-src}"
pname = "nod"; "-DCMAKE_CROSSCOMPILING=ON" # Tests are not working as I didn't want to work through getting google's test suite working as well. This is the only guard I could find to disable it.
version = nodVersion;
src = pkgs.fetchFromGitHub {
owner = "encounter";
repo = "nod";
rev = nodVersion;
hash = "sha256-r8qDlOVxv5iKiFjJQrcBuL9HVoOM3yEjRVnQIMqaICs=";
};
patches = [ ./fix-cmake-paths.patch ];
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = "${finalAttrs.src}/Cargo.lock";
};
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-warn "add_subdirectory(nod-ffi/examples)" ""
'';
nativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.rustPlatform.cargoSetupHook
pkgs.cargo
pkgs.rustc
];
CARGO_NET_OFFLINE = "true";
cmakeFlags = [
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-DFETCHCONTENT_SOURCE_DIR_CORROSION=${corrosion}"
"-DNOD_ENABLE_INSTALL=ON"
"-DBUILD_SHARED_LIBS=OFF"
];
doCheck = false;
});
nod =
if hasNodPrebuilt then
pkgs.fetchzip {
url = "https://github.com/encounter/nod/releases/download/${nodVersion}/libnod-${
nodPrebuiltInfo.${system}.triple
}.tar.gz";
hash = nodPrebuiltInfo.${system}.hash;
stripRoot = false;
}
else
nodFromSource;
fetchContentDirs = {
DAWN_PREBUILT = dawn;
NOD_PREBUILT = nod;
CXXOPTS = pkgs.cxxopts.src;
JSON = pkgs.nlohmann_json.src;
XXHASH = pkgs.xxhash.src;
ZSTD = pkgs.zstd.src;
MINIZ = pkgs.fetchzip {
url = "https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip";
hash = "sha256-DXysXkQEmoDAMMg1F8KexkwpXNyiHNzLJqXR9SMEkxk=";
stripRoot = false;
};
FMT = pkgs.fetchzip {
url = "https://github.com/fmtlib/fmt/archive/refs/tags/12.1.0.tar.gz";
hash = "sha256-ZmI1Dv0ZabPlxa02OpERI47jp7zFfjpeWCy1WyuPYZ0=";
};
TRACY = pkgs.fetchzip {
url = "https://github.com/wolfpld/tracy/archive/6789e7d6f9a65ec98926b602097a33a9676d2606.tar.gz";
hash = "sha256-Xxyd7G/mnXEPpN+ehmwl0AkAhS3CwObpJNDgcqbdUJg=";
};
IMGUI = pkgs.fetchFromGitHub {
owner = "ocornut";
repo = "imgui";
rev = "v1.91.9b-docking";
hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ=";
};
SQLITE3 = pkgs.fetchzip {
url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip";
hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM=";
};
RMLUI = pkgs.fetchzip {
url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz";
hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg=";
};
};
dusklight =
pkgs.stdenv.mkDerivation {
pname = "dusklight";
version = versionSuffix;
src = ./.;
postUnpack = ''
chmod -R u+w "$sourceRoot"
substituteInPlace "$sourceRoot/extern/aurora/CMakeLists.txt" \
--replace-warn "add_subdirectory(tests)" ""
'';
nativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
pkgs.python3
pkgs.python3Packages.markupsafe
]
++ lib.optionals (!isDarwin) [ pkgs.autoPatchelfHook ];
buildInputs = [
pkgs.sdl3
pkgs.freetype
pkgs.zstd
pkgs.cxxopts
pkgs.nlohmann_json
pkgs.xxhash
pkgs.abseil-cpp
pkgs.zlib
pkgs.libpng
pkgs.libjpeg_turbo
pkgs.curl
pkgs.openssl
]
++ lib.optionals isDarwin [
pkgs.apple-sdk_15
pkgs.libiconv
]
++ lib.optionals (!isDarwin) [
pkgs.libGL
pkgs.libGLU
pkgs.libglvnd
pkgs.vulkan-loader
pkgs.libX11
pkgs.libxcb
pkgs.libXcursor
pkgs.libxi
pkgs.libxrandr
pkgs.libxscrnsaver
pkgs.libxtst
pkgs.libxinerama
pkgs.libxkbcommon
pkgs.wayland
pkgs.libdecor
pkgs.alsa-lib
pkgs.libpulseaudio
pkgs.pipewire
pkgs.dbus
pkgs.udev
pkgs.libusb1
pkgs.libunwind
pkgs.gtk3
nod
];
cmakeBuildType = "RelWithDebInfo";
ninjaFlags = [ "dusklight" ];
cmakeFlags = [
"-DBOREALIS_APP_VERSION_OVERRIDE=${versionSuffix}"
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-DAURORA_DAWN_PROVIDER=package"
"-DAURORA_DAWN_LINKAGE=static"
"-DAURORA_NOD_PROVIDER=system"
"-DAURORA_SDL3_PROVIDER=system"
"-DBUILD_SHARED_LIBS=OFF"
]
++ lib.mapAttrsToList (key: src: "-DFETCHCONTENT_SOURCE_DIR_${key}=${src}") fetchContentDirs;
installPhase =
if isDarwin then
''
runHook preInstall
mkdir -p "$out/Applications"
cp -r Dusklight.app "$out/Applications/Dusklight.app"
runHook postInstall
''
else
''
runHook preInstall
install -Dm755 dusklight "$out/bin/dusklight"
cp -r "$src/res" "$out/bin/res"
install -Dm644 "$src/platforms/freedesktop/dev.twilitrealm.dusk.desktop" \
"$out/share/applications/dev.twilitrealm.dusk.desktop"
for size in 16 32 48 64 128 256 512 1024; do
install -Dm644 "$src/platforms/freedesktop/''${size}x''${size}/apps/dev.twilitrealm.dusk.png" \
"$out/share/icons/hicolor/''${size}x''${size}/apps/dev.twilitrealm.dusk.png"
done
runHook postInstall
'';
postFixup = lib.optionalString (!isDarwin) ''
patchelf \
--add-needed "${pkgs.vulkan-loader}/lib/libvulkan.so" \
$out/bin/dusklight
'';
dontStrip = true;
meta = {
description = "Dusklight native PC port of the Twilight Princess decompilation";
homepage = "https://github.com/zeldaret/tp";
platforms = supportedSystems;
mainProgram = "dusklight";
};
};
# Tooling common to every supported host (Linux and macOS).
commonDevTools = [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
pkgs.git
pkgs.python3
pkgs.python3Packages.markupsafe
pkgs.rustc
pkgs.cargo
pkgs.sccache
]; ];
installPhase = ''
mkdir -p $out/bin
cp dusklight $out/bin/dusklight
cp -r ./res $out/bin/res
# Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml mkdir -p $out/share/applications
# so the cmake presets resolve the same set of headers as CI. cp $src/platforms/freedesktop/dusklight.desktop $out/share/applications/dusklight.desktop
linuxDevDeps = [
# Compilers / linkers for size in 16 32 48 64 128 256 512 1024; do
pkgs.clang install -Dm644 $src/platforms/freedesktop/''${size}x''${size}/apps/dusklight.png \
pkgs.lld $out/share/icons/hicolor/''${size}x''${size}/apps/dusklight.png
# C/C++ utilities done
pkgs.curl '';
pkgs.openssl nativeBuildInputs = [
pkgs.zlib pkgs.cmake
pkgs.libpng pkgs.pkg-config
pkgs.libjpeg_turbo
pkgs.freetype
pkgs.zstd
pkgs.fmt
pkgs.tracy
pkgs.cxxopts
pkgs.abseil-cpp
pkgs.sdl3
pkgs.ncurses
pkgs.libunwind
pkgs.libusb1
pkgs.fuse
# Wayland / display server
pkgs.wayland pkgs.wayland
pkgs.wayland-protocols ];
pkgs.libxkbcommon buildInputs = [
pkgs.libdecor
# OpenGL / Vulkan
pkgs.libGL pkgs.libGL
pkgs.libGLU
pkgs.libglvnd
pkgs.vulkan-headers
pkgs.vulkan-loader
# X11
pkgs.libX11 pkgs.libX11
pkgs.libxcb
pkgs.libXcursor pkgs.libXcursor
pkgs.libxi pkgs.libxi
pkgs.libxcb
pkgs.libxrandr pkgs.libxrandr
pkgs.libxscrnsaver pkgs.libxscrnsaver
pkgs.libxtst pkgs.libxtst
pkgs.libxinerama pkgs.libjpeg8
# Audio pkgs.libxkbcommon
pkgs.alsa-lib pkgs.libglvnd
pkgs.libpulseaudio pkgs.cxxopts
pkgs.pipewire pkgs.abseil-cpp
# System integration pkgs.sdl3
pkgs.dbus pkgs.fmt
pkgs.udev pkgs.tracy
pkgs.gtk3 pkgs.freetype
pkgs.zstd
]; ];
# On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up
# Apple Clang and the Xcode SDK directly, matching the macOS CI workflow.
darwinShell = pkgs.mkShellNoCC {
packages = commonDevTools;
shellHook = ''
echo "Dusklight dev shell (macOS)"
echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK."
echo "Configure: cmake --preset macos-default-relwithdebinfo"
echo "Build: cmake --build --preset macos-default-relwithdebinfo"
'';
};
linuxShell = pkgs.mkShell {
packages = commonDevTools ++ linuxDevDeps;
shellHook = ''
echo "Dusklight dev shell (Linux)"
echo "Configure: cmake --preset linux-default-relwithdebinfo"
echo " cmake --preset linux-clang-relwithdebinfo"
echo "Build: cmake --build --preset <preset>"
'';
};
in
{
packages = {
default = dusklight;
dusklight = dusklight;
}
// lib.optionalAttrs (!hasNodPrebuilt) { nod = nodFromSource; };
devShells.default = if isDarwin then darwinShell else linuxShell;
}; };
systems = forAllSystems perSystem; # Tooling common to every supported host (Linux and macOS).
in commonDevTools = pkgs: [
{ pkgs.cmake
packages = lib.mapAttrs (_: s: s.packages) systems; pkgs.ninja
devShells = lib.mapAttrs (_: s: s.devShells) systems; pkgs.pkg-config
pkgs.git
pkgs.python3
pkgs.python3Packages.markupsafe
pkgs.rustc
pkgs.cargo
pkgs.sccache
];
# Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml
# so the cmake presets resolve the same set of headers as CI.
linuxDevDeps = pkgs: [
# Compilers / linkers
pkgs.clang
pkgs.lld
# C/C++ utilities
pkgs.curl
pkgs.openssl
pkgs.zlib
pkgs.libpng
pkgs.libjpeg_turbo
pkgs.freetype
pkgs.zstd
pkgs.fmt
pkgs.tracy
pkgs.cxxopts
pkgs.abseil-cpp
pkgs.sdl3
pkgs.ncurses
pkgs.libunwind
pkgs.libusb1
pkgs.fuse
# Wayland / display server
pkgs.wayland
pkgs.wayland-protocols
pkgs.libxkbcommon
pkgs.libdecor
# OpenGL / Vulkan
pkgs.libGL
pkgs.libGLU
pkgs.libglvnd
pkgs.vulkan-headers
pkgs.vulkan-loader
# X11
pkgs.libX11
pkgs.libxcb
pkgs.libXcursor
pkgs.libxi
pkgs.libxrandr
pkgs.libxscrnsaver
pkgs.libxtst
pkgs.libxinerama
# Audio
pkgs.alsa-lib
pkgs.libpulseaudio
pkgs.pipewire
# System integration
pkgs.dbus
pkgs.udev
pkgs.gtk3
];
# On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up
# Apple Clang and the Xcode SDK directly, matching the macOS CI workflow.
mkDarwinShell = pkgs:
pkgs.mkShellNoCC {
packages = commonDevTools pkgs;
shellHook = ''
echo "Dusklight dev shell (macOS)"
echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK."
echo "Configure: cmake --preset macos-default-relwithdebinfo"
echo "Build: cmake --build --preset macos-default-relwithdebinfo"
'';
};
mkLinuxShell = pkgs:
pkgs.mkShell {
packages = (commonDevTools pkgs) ++ (linuxDevDeps pkgs);
shellHook = ''
echo "Dusklight dev shell (Linux)"
echo "Configure: cmake --preset linux-default-relwithdebinfo"
echo " cmake --preset linux-clang-relwithdebinfo"
echo "Build: cmake --build --preset <preset>"
'';
};
mkDevShell = pkgs:
if pkgs.stdenv.isDarwin
then mkDarwinShell pkgs
else mkLinuxShell pkgs;
in {
packages.x86_64-linux.default = mkDusklight (pkgsFor "x86_64-linux");
devShells = forAllSystems (system: {
default = mkDevShell (pkgsFor system);
});
}; };
} }
+3 -3
View File
@@ -88,9 +88,9 @@ struct DynamicModuleControl : DynamicModuleControlBase {
/* 0x24 */ s32 mSize; /* 0x24 */ s32 mSize;
/* 0x28 */ mDoDvdThd_callback_c* mAsyncLoadCallback; /* 0x28 */ mDoDvdThd_callback_c* mAsyncLoadCallback;
static DUSK_GAME_DATA u32 sAllocBytes; static u32 sAllocBytes;
static DUSK_GAME_DATA JKRArchive* sArchive; static JKRArchive* sArchive;
static DUSK_GAME_DATA JKRFileCache* sFileCache; static JKRFileCache* sFileCache;
}; };
#endif /* DYNAMICLINK_H */ #endif /* DYNAMICLINK_H */
+1 -1
View File
@@ -12,6 +12,6 @@ struct cAPI_Interface {
/* 0x14 */ cAPIGph_Mthd blankingOffMtd; /* 0x14 */ cAPIGph_Mthd blankingOffMtd;
}; };
DUSK_GAME_EXTERN cAPI_Interface g_cAPI_Interface; extern cAPI_Interface g_cAPI_Interface;
#endif /* C_API_H */ #endif /* C_API_H */
+5 -5
View File
@@ -24,11 +24,11 @@ private:
s16 mAngle; s16 mAngle;
public: public:
const static DUSK_GAME_DATA cSAngle _0; const static cSAngle _0;
const static DUSK_GAME_DATA cSAngle _1; const static cSAngle _1;
const static DUSK_GAME_DATA cSAngle _90; const static cSAngle _90;
const static DUSK_GAME_DATA cSAngle _180; const static cSAngle _180;
const static DUSK_GAME_DATA cSAngle _270; const static cSAngle _270;
#ifdef __MWERKS__ #ifdef __MWERKS__
cSAngle() {} cSAngle() {}
~cSAngle() {} ~cSAngle() {}
+1 -1
View File
@@ -5,7 +5,7 @@
#include "f_pc/f_pc_base.h" #include "f_pc/f_pc_base.h"
#include "SSystem/SComponent/c_bg_s_grp_pass_chk.h" #include "SSystem/SComponent/c_bg_s_grp_pass_chk.h"
#include "SSystem/SComponent/c_bg_s_poly_pass_chk.h" #include "SSystem/SComponent/c_bg_s_poly_pass_chk.h"
#include "helpers/endian.h" #include "dusk/endian.h"
struct cBgD_Vtx_t : public Vec {}; struct cBgD_Vtx_t : public Vec {};
@@ -20,7 +20,7 @@ public:
/* 0x14 */ cM3dGAab mM3dGAab; /* 0x14 */ cM3dGAab mM3dGAab;
/* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun; /* 0x30 */ cBgS_ShdwDraw_Callback mCallbackFun;
#if PARTIAL_DEBUG || DEBUG #if DEBUG
/* 0x34 */ int field_0x34; /* 0x34 */ int field_0x34;
#endif #endif
}; };
+1 -1
View File
@@ -435,7 +435,7 @@ public:
cM3dGAab& GetWorkAab() { return mAab; } cM3dGAab& GetWorkAab() { return mAab; }
static DUSK_GAME_DATA cXyz m_virtual_center; static cXyz m_virtual_center;
}; };
STATIC_ASSERT(0x20 == sizeof(cCcD_ShapeAttr)); STATIC_ASSERT(0x20 == sizeof(cCcD_ShapeAttr));
+1 -1
View File
@@ -9,7 +9,7 @@ struct counter_class {
u32 mTimer; u32 mTimer;
}; };
DUSK_GAME_EXTERN counter_class g_Counter; extern counter_class g_Counter;
void cCt_Counter(int resetCounter1); void cCt_Counter(int resetCounter1);
+2 -2
View File
@@ -98,10 +98,10 @@ T cLib_calcTimer(T* value) {
void MtxInit(void); void MtxInit(void);
void MtxTrans(f32, f32, f32, u8); void MtxTrans(f32, f32, f32, u8);
void MtxScale(f32, f32, f32, u8); void MtxScale(f32, f32, f32, u8);
void MtxPosition(cXyz DUSK_CONST*, cXyz*); void MtxPosition(cXyz*, cXyz*);
void MtxPush(void); void MtxPush(void);
void MtxPull(void); void MtxPull(void);
DUSK_GAME_EXTERN Mtx* calc_mtx; extern Mtx* calc_mtx;
#endif #endif
+1 -1
View File
@@ -20,7 +20,7 @@ struct cM3d_Range {
}; };
#define G_CM3D_F_INF (1000000000.0f) #define G_CM3D_F_INF (1000000000.0f)
DUSK_GAME_EXTERN const f32 G_CM3D_F_ABS_MIN; extern const f32 G_CM3D_F_ABS_MIN;
static void cM3d_InDivPos1(const Vec*, const Vec*, f32, Vec*); static void cM3d_InDivPos1(const Vec*, const Vec*, f32, Vec*);
void cM3d_InDivPos2(const Vec*, const Vec*, f32, Vec*); void cM3d_InDivPos2(const Vec*, const Vec*, f32, Vec*);
+1 -1
View File
@@ -2,7 +2,7 @@
#define C_M3D_G_TRI_H_ #define C_M3D_G_TRI_H_
#include "SSystem/SComponent/c_m3d_g_pla.h" #include "SSystem/SComponent/c_m3d_g_pla.h"
#include "helpers/endian.h" #include "dusk/endian.h"
class cM3dGCyl; class cM3dGCyl;
+1 -1
View File
@@ -6,7 +6,7 @@
class JKRHeap; class JKRHeap;
struct cMl { struct cMl {
static DUSK_GAME_DATA JKRHeap* Heap; static JKRHeap* Heap;
static void init(JKRHeap*); static void init(JKRHeap*);
static void* memalignB(int, u32); static void* memalignB(int, u32);
static void free(void*); static void free(void*);
+1 -1
View File
@@ -9,7 +9,7 @@ struct SVec {
class csXyz : public SVec { class csXyz : public SVec {
public: public:
static DUSK_GAME_DATA const csXyz Zero; static const csXyz Zero;
~csXyz() {} ~csXyz() {}
csXyz() {} csXyz() {}
csXyz(s16, s16, s16); csXyz(s16, s16, s16);
+11 -11
View File
@@ -14,14 +14,14 @@ struct cXy {
}; };
struct cXyz : Vec { struct cXyz : Vec {
static DUSK_GAME_DATA const cXyz Zero; static const cXyz Zero;
static DUSK_GAME_DATA const cXyz BaseX; static const cXyz BaseX;
static DUSK_GAME_DATA const cXyz BaseY; static const cXyz BaseY;
static DUSK_GAME_DATA const cXyz BaseZ; static const cXyz BaseZ;
static DUSK_GAME_DATA const cXyz BaseXY; static const cXyz BaseXY;
static DUSK_GAME_DATA const cXyz BaseXZ; static const cXyz BaseXZ;
static DUSK_GAME_DATA const cXyz BaseYZ; static const cXyz BaseYZ;
static DUSK_GAME_DATA const cXyz BaseXYZ; static const cXyz BaseXYZ;
#ifdef __MWERKS__ #ifdef __MWERKS__
cXyz() {} cXyz() {}
~cXyz() {} ~cXyz() {}
@@ -45,17 +45,17 @@ struct cXyz : Vec {
~cXyz() = default; ~cXyz() = default;
cXyz(const cXyz& vec) = default; cXyz(const cXyz& vec) = default;
#endif #endif
DUSK_CONSTEXPR cXyz(f32 x, f32 y, f32 z) { cXyz(f32 x, f32 y, f32 z) {
this->x = x; this->x = x;
this->y = y; this->y = y;
this->z = z; this->z = z;
} }
DUSK_CONSTEXPR cXyz(const Vec& vec) { cXyz(const Vec& vec) {
this->x = vec.x; this->x = vec.x;
this->y = vec.y; this->y = vec.y;
this->z = vec.z; this->z = vec.z;
} }
DUSK_CONSTEXPR cXyz& operator=(const Vec& vec) { cXyz& operator=(const Vec& vec) {
this->x = vec.x; this->x = vec.x;
this->y = vec.y; this->y = vec.y;
this->z = vec.z; this->z = vec.z;
+2 -2
View File
@@ -256,7 +256,7 @@ inline Z2Audience* Z2GetAudience() {
return JASGlobalInstance<Z2Audience>::getInstance(); return JASGlobalInstance<Z2Audience>::getInstance();
} }
DUSK_GAME_EXTERN s8 data_80451358; extern s8 data_80451358;
DUSK_GAME_EXTERN s8 data_80451359; extern s8 data_80451359;
#endif /* Z2AUDIENCE_H */ #endif /* Z2AUDIENCE_H */
+1 -3
View File
@@ -34,7 +34,7 @@ public:
bool isResetting() { return mResettingFlag; } bool isResetting() { return mResettingFlag; }
static Z2AudioMgr* getInterface() { return mAudioMgrPtr; } static Z2AudioMgr* getInterface() { return mAudioMgrPtr; }
static DUSK_GAME_DATA Z2AudioMgr* mAudioMgrPtr; static Z2AudioMgr* mAudioMgrPtr;
/* 0x0514 */ virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr); /* 0x0514 */ virtual bool startSound(JAISoundID soundID, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr);
/* 0x0518 */ bool mResettingFlag; /* 0x0518 */ bool mResettingFlag;
@@ -48,8 +48,6 @@ public:
/* 0x1370 */ Z2FxLineMgr mFxLineMgr; /* 0x1370 */ Z2FxLineMgr mFxLineMgr;
#if DEBUG #if DEBUG
/* 0x13BC */ Z2DebugSys mDebugSys; /* 0x13BC */ Z2DebugSys mDebugSys;
#elif PARTIAL_DEBUG
alignas(Z2DebugSys) u8 mDebugSys[sizeof(Z2DebugSys)];
#endif #endif
}; // Size: 0x138C }; // Size: 0x138C
+2 -2
View File
@@ -42,8 +42,8 @@ f32 getParamByExp(f32 value, f32 inMin, f32 inMax, f32 exponent, f32 outMin, f32
f32 getRandom(f32 magnitude, f32 exponent, f32 bias); f32 getRandom(f32 magnitude, f32 exponent, f32 bias);
f32 getRandom_0_1(); f32 getRandom_0_1();
DUSK_GAME_EXTERN const f32 cEqualCSlope; extern const f32 cEqualCSlope;
DUSK_GAME_EXTERN const f32 cEqualPSlope; extern const f32 cEqualPSlope;
} // namespace Z2Calc } // namespace Z2Calc
#endif /* Z2CALC_H */ #endif /* Z2CALC_H */
+1 -1
View File
@@ -175,7 +175,7 @@ struct Z2EnvSeMgr : public JASGlobalInstance<Z2EnvSeMgr> {
STATIC_ASSERT(sizeof(Z2EnvSeMgr) == 0x30C); STATIC_ASSERT(sizeof(Z2EnvSeMgr) == 0x30C);
DUSK_GAME_EXTERN Z2EnvSeMgr g_mEnvSeMgr; extern Z2EnvSeMgr g_mEnvSeMgr;
inline Z2EnvSeMgr* Z2GetEnvSeMgr() { inline Z2EnvSeMgr* Z2GetEnvSeMgr() {
return JASGlobalInstance<Z2EnvSeMgr>::getInstance(); return JASGlobalInstance<Z2EnvSeMgr>::getInstance();
+1 -1
View File
@@ -57,7 +57,7 @@ public:
void setUsingIronBall(bool isUsingIronBall) { mUsingIronBall = isUsingIronBall; } void setUsingIronBall(bool isUsingIronBall) { mUsingIronBall = isUsingIronBall; }
void setMarkState(u8 state) { mMarkState = state; } void setMarkState(u8 state) { mMarkState = state; }
static DUSK_GAME_DATA Z2CreatureLink* mLinkPtr; static Z2CreatureLink* mLinkPtr;
static Z2CreatureLink* getLink() { return mLinkPtr; } static Z2CreatureLink* getLink() { return mLinkPtr; }
friend class Z2LinkSoundStarter; friend class Z2LinkSoundStarter;
+52 -52
View File
@@ -4,72 +4,72 @@
#include <types.h> #include <types.h>
struct Z2Param { struct Z2Param {
static DUSK_GAME_DATA f32 DISTANCE_MAX; static f32 DISTANCE_MAX;
static DUSK_GAME_DATA f32 MAX_VOLUME_DISTANCE; static f32 MAX_VOLUME_DISTANCE;
static DUSK_GAME_DATA f32 DOLBY_CENTER_VALUE; static f32 DOLBY_CENTER_VALUE;
static DUSK_GAME_DATA f32 DOLBY_FLONT_DISTANCE_MAX; static f32 DOLBY_FLONT_DISTANCE_MAX;
static DUSK_GAME_DATA f32 DOLBY_BEHIND_DISTANCE_MAX; static f32 DOLBY_BEHIND_DISTANCE_MAX;
static DUSK_GAME_DATA f32 DISTANCE_FX_PARAM; static f32 DISTANCE_FX_PARAM;
static DUSK_GAME_DATA f32 SONIC_SPEED; static f32 SONIC_SPEED;
static DUSK_GAME_DATA f32 VOL_BGM_DEFAULT; static f32 VOL_BGM_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_SYSTEM_DEFAULT; static f32 VOL_SE_SYSTEM_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_LINK_VOICE_DEFAULT; static f32 VOL_SE_LINK_VOICE_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_LINK_MOTION_DEFAULT; static f32 VOL_SE_LINK_MOTION_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_LINK_FOOTNOTE_DEFAULT; static f32 VOL_SE_LINK_FOOTNOTE_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_CHAR_VOICE_DEFAULT; static f32 VOL_SE_CHAR_VOICE_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_CHAR_MOVE_DEFAULT; static f32 VOL_SE_CHAR_MOVE_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_OBJECT_DEFAULT; static f32 VOL_SE_OBJECT_DEFAULT;
static DUSK_GAME_DATA f32 VOL_SE_ATMOSPHERE_DEFAULT; static f32 VOL_SE_ATMOSPHERE_DEFAULT;
static DUSK_GAME_DATA f32 VOL_BGM_TALKING; static f32 VOL_BGM_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_SYSTEM_TALKING; static f32 VOL_SE_SYSTEM_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_LINK_VOICE_TALKING; static f32 VOL_SE_LINK_VOICE_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_LINK_MOTION_TALKING; static f32 VOL_SE_LINK_MOTION_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_LINK_FOOTNOTE_TALKING; static f32 VOL_SE_LINK_FOOTNOTE_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_CHAR_VOICE_TALKING; static f32 VOL_SE_CHAR_VOICE_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_CHAR_MOVE_TALKING; static f32 VOL_SE_CHAR_MOVE_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_OBJECT_TALKING; static f32 VOL_SE_OBJECT_TALKING;
static DUSK_GAME_DATA f32 VOL_SE_ATMOSPHERE_TALKING; static f32 VOL_SE_ATMOSPHERE_TALKING;
static DUSK_GAME_DATA f32 VOL_BGM_PAUSING; static f32 VOL_BGM_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_SYSTEM_PAUSING; static f32 VOL_SE_SYSTEM_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_LINK_VOICE_PAUSING; static f32 VOL_SE_LINK_VOICE_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_LINK_MOTION_PAUSING; static f32 VOL_SE_LINK_MOTION_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_LINK_FOOTNOTE_PAUSING; static f32 VOL_SE_LINK_FOOTNOTE_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_CHAR_VOICE_PAUSING; static f32 VOL_SE_CHAR_VOICE_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_CHAR_MOVE_PAUSING; static f32 VOL_SE_CHAR_MOVE_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_OBJECT_PAUSING; static f32 VOL_SE_OBJECT_PAUSING;
static DUSK_GAME_DATA f32 VOL_SE_ATMOSPHERE_PAUSING; static f32 VOL_SE_ATMOSPHERE_PAUSING;
static DUSK_GAME_DATA f32 MIN_DISTANCE_VOLUME; static f32 MIN_DISTANCE_VOLUME;
static DUSK_GAME_DATA f32 ENEMY_LASTHIT_MUTE_VOLUME; static f32 ENEMY_LASTHIT_MUTE_VOLUME;
// made up names based on HIO labels // made up names based on HIO labels
static DUSK_GAME_DATA u8 SCENE_CHANGE_BGM_FADEOUT_TIME; static u8 SCENE_CHANGE_BGM_FADEOUT_TIME;
static DUSK_GAME_DATA u8 BGM_CROSS_FADEIN_TIME; static u8 BGM_CROSS_FADEIN_TIME;
static DUSK_GAME_DATA u8 BGM_CROSS_FADEOUT_TIME; static u8 BGM_CROSS_FADEOUT_TIME;
static DUSK_GAME_DATA u8 BATTLE_BGM_WAIT_TIME; static u8 BATTLE_BGM_WAIT_TIME;
static f32 ENEMY_NEARBY_DIST; static f32 ENEMY_NEARBY_DIST;
static f32 BATTLE_FADEIN_DIST; static f32 BATTLE_FADEIN_DIST;
static f32 BATTLE_FADEOUT_DIST; static f32 BATTLE_FADEOUT_DIST;
static DUSK_GAME_DATA u8 FOUND_TRACK_FI_TIME; static u8 FOUND_TRACK_FI_TIME;
static DUSK_GAME_DATA u8 FOUND_TRACK_FO_TIME; static u8 FOUND_TRACK_FO_TIME;
static DUSK_GAME_DATA u8 CLOSE_BATTLE_TRACK_FI_TIME; static u8 CLOSE_BATTLE_TRACK_FI_TIME;
static DUSK_GAME_DATA u8 CLOSE_BATTLE_TRACK_FO_TIME; static u8 CLOSE_BATTLE_TRACK_FO_TIME;
static DUSK_GAME_DATA u8 ENDING_BLOW_VOL_DOWN_TIME; static u8 ENDING_BLOW_VOL_DOWN_TIME;
static DUSK_GAME_DATA u8 ENDING_BLOW_VOL_LOWER_TIME; static u8 ENDING_BLOW_VOL_LOWER_TIME;
static DUSK_GAME_DATA u8 ENDING_BLOW_VOL_LOWER_RECOVER_TIME; static u8 ENDING_BLOW_VOL_LOWER_RECOVER_TIME;
static DUSK_GAME_DATA u8 ENDING_BLOW_MIN_FINISH_TIME; static u8 ENDING_BLOW_MIN_FINISH_TIME;
static DUSK_GAME_DATA u8 DARK_SE_FILTER_ON; static u8 DARK_SE_FILTER_ON;
static DUSK_GAME_DATA u8 DARK_SE_LOW_PASS_FILTER_SETTING; static u8 DARK_SE_LOW_PASS_FILTER_SETTING;
static DUSK_GAME_DATA u8 SYSTEM_SE_USE_DARK_SE_SETTING; static u8 SYSTEM_SE_USE_DARK_SE_SETTING;
static f32 AUDIBLE_DELTA_RANGE_VOLUME; static f32 AUDIBLE_DELTA_RANGE_VOLUME;
static f32 AUDIBLE_DELTA_RANGE_PAN; static f32 AUDIBLE_DELTA_RANGE_PAN;
static f32 AUDIBLE_DELTA_RANGE_DOLBY; static f32 AUDIBLE_DELTA_RANGE_DOLBY;
}; };
DUSK_GAME_EXTERN u8 data_8045086C; extern u8 data_8045086C;
#endif /* Z2PARAM_H */ #endif /* Z2PARAM_H */
+1 -1
View File
@@ -194,7 +194,7 @@ public:
JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; } JAISoundHandle* getMainBgmHandle() { return &mMainBgmHandle; }
JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; } JAISoundHandle* getSubBgmHandle() { return &mSubBgmHandle; }
#if PARTIAL_DEBUG || DEBUG #if DEBUG
f32 field_0x00_debug; f32 field_0x00_debug;
u8 field_0x04_debug; u8 field_0x04_debug;
#endif #endif
+2 -2
View File
@@ -100,13 +100,13 @@ public:
bool isForceBattle() { return forceBattle_; } bool isForceBattle() { return forceBattle_; }
JSUList<Z2CreatureEnemy>* getEnemyList() { return &field_0x0; } JSUList<Z2CreatureEnemy>* getEnemyList() { return &field_0x0; }
#if PARTIAL_DEBUG || DEBUG #if DEBUG
JSUList<Z2SoundObjBase>* getAllList() { return &allList_; } JSUList<Z2SoundObjBase>* getAllList() { return &allList_; }
#endif #endif
private: private:
/* 0x00 */ JSUList<Z2CreatureEnemy> field_0x0; /* 0x00 */ JSUList<Z2CreatureEnemy> field_0x0;
#if PARTIAL_DEBUG || DEBUG #if DEBUG
/* 0x0C */ JSUList<Z2SoundObjBase> allList_; /* 0x0C */ JSUList<Z2SoundObjBase> allList_;
#endif #endif
/* 0x0C */ Z2EnemyArea enemyArea_; /* 0x0C */ Z2EnemyArea enemyArea_;
+1 -1
View File
@@ -7,7 +7,7 @@
struct Z2SoundStarter; struct Z2SoundStarter;
class Z2SoundObjBase : public Z2SoundHandles class Z2SoundObjBase : public Z2SoundHandles
#if PARTIAL_DEBUG || DEBUG #if DEBUG
, public JSULink<Z2SoundObjBase> , public JSULink<Z2SoundObjBase>
#endif #endif
{ {
+1 -1
View File
@@ -14,7 +14,7 @@ struct Z2StatusMgr : public JASGlobalInstance<Z2StatusMgr> {
void menuIn(); void menuIn();
void menuOut(); void menuOut();
bool isMovieDemo(); bool isMovieDemo();
void setDemoName(DUSK_CONST char* demoName); void setDemoName(char* demoName);
void processTime(); void processTime();
bool checkDayTime(); bool checkDayTime();
void setEventBit(void* eventBit); void setEventBit(void* eventBit);
+10 -10
View File
@@ -12,18 +12,18 @@ public:
BOOL cDmrNowMidnaTalk(); BOOL cDmrNowMidnaTalk();
DUSK_GAME_EXTERN u8 cDmr_SkipInfo; extern u8 cDmr_SkipInfo;
DUSK_GAME_EXTERN u8 data_80450C99; extern u8 data_80450C99;
DUSK_GAME_EXTERN u8 data_80450C9A; extern u8 data_80450C9A;
DUSK_GAME_EXTERN u8 data_80450C9B; extern u8 data_80450C9B;
DUSK_GAME_EXTERN u8 data_80450C9C; extern u8 data_80450C9C;
DUSK_GAME_EXTERN u8 data_80450C9D; extern u8 data_80450C9D;
DUSK_GAME_EXTERN u8 data_80450C9E; extern u8 data_80450C9E;
DUSK_GAME_EXTERN u8 cDmr_FishingWether; extern u8 cDmr_FishingWether;
DUSK_GAME_EXTERN u8 data_80450CA0; extern u8 data_80450CA0;
extern "C" { extern "C" {
DUSK_GAME_EXTERN JPTraceParticleCallBack4 JPTracePCB4; extern JPTraceParticleCallBack4 JPTracePCB4;
} }
void debug_actor_create(); void debug_actor_create();
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -161,7 +161,7 @@ private:
/* 0xA10 */ dPa_hermiteEcallBack_c field_0xa10; /* 0xA10 */ dPa_hermiteEcallBack_c field_0xa10;
/* 0xA28 */ int (daArrow_c::*mProcFunc)(); /* 0xA28 */ int (daArrow_c::*mProcFunc)();
static DUSK_GAME_DATA s16 m_count; static s16 m_count;
}; };
STATIC_ASSERT(sizeof(daArrow_c) == 0xA34); STATIC_ASSERT(sizeof(daArrow_c) == 0xA34);
+1 -1
View File
@@ -203,7 +203,7 @@ private:
/* 0x0AAD */ bool mStayNo2Flag; /* 0x0AAD */ bool mStayNo2Flag;
/* 0x0AAE */ u8 mBlendStatus; /* 0x0AAE */ u8 mBlendStatus;
/* 0x0AB0 */ f32 mBlend; /* 0x0AB0 */ f32 mBlend;
/* 0x0AB4 */ char DUSK_CONST* mArcName; /* 0x0AB4 */ char* mArcName;
/* 0x0AB8 */ dBgS_AcchCir mAcchCir; /* 0x0AB8 */ dBgS_AcchCir mAcchCir;
/* 0x0AF8 */ dBgS_ObjAcch mAcch; /* 0x0AF8 */ dBgS_ObjAcch mAcch;
/* 0x0CD0 */ dBgS_AcchCir mAcchCirArr[16]; /* 0x0CD0 */ dBgS_AcchCir mAcchCirArr[16];
+1 -1
View File
@@ -67,7 +67,7 @@ public:
void hide() { mIsVisible = 0; } void hide() { mIsVisible = 0; }
u8 isVisible() { return mIsVisible; } u8 isVisible() { return mIsVisible; }
static DUSK_GAME_DATA daBalloon2D_c* myclass; static daBalloon2D_c* myclass;
struct ScoreCount { struct ScoreCount {
cXyz field_0x0; cXyz field_0x0;
+4 -4
View File
@@ -89,10 +89,10 @@ public:
void setAction(u8 i_action) { mAction = i_action; } void setAction(u8 i_action) { mAction = i_action; }
static DUSK_GAME_DATA createHeapFunc mCreateHeapFunc[]; static createHeapFunc mCreateHeapFunc[];
static DUSK_GAME_DATA createInitFunc mCreateInitFunc[]; static createInitFunc mCreateInitFunc[];
static DUSK_GAME_DATA executeFunc mExecuteFunc[]; static executeFunc mExecuteFunc[];
static DUSK_GAME_DATA tgSetFunc mTgSetFunc[]; static tgSetFunc mTgSetFunc[];
/* 0x5A0 */ request_of_phase_process_class mPhase; /* 0x5A0 */ request_of_phase_process_class mPhase;
/* 0x5A8 */ J3DModel* field_0x5a8[2][2]; /* 0x5A8 */ J3DModel* field_0x5a8[2][2];
+6 -6
View File
@@ -190,12 +190,12 @@ STATIC_ASSERT(sizeof(daBoomerang_c) == 0xDE4);
class daBoomerang_HIO_c0 { class daBoomerang_HIO_c0 {
public: public:
static DUSK_GAME_DATA u16 const m_lockWaitTime; static u16 const m_lockWaitTime;
static DUSK_GAME_DATA f32 const m_minCircleR; static f32 const m_minCircleR;
static DUSK_GAME_DATA f32 const m_middleCircleR; static f32 const m_middleCircleR;
static DUSK_GAME_DATA f32 const m_maxCircleR; static f32 const m_maxCircleR;
static DUSK_GAME_DATA f32 const m_scale; static f32 const m_scale;
static DUSK_GAME_DATA f32 const m_lockWindScale; static f32 const m_lockWindScale;
}; };
#endif /* D_A_BOOMERANG_H */ #endif /* D_A_BOOMERANG_H */
+3 -3
View File
@@ -18,7 +18,7 @@ class daBullet_Param_c {
public: public:
virtual ~daBullet_Param_c() {} virtual ~daBullet_Param_c() {}
static DUSK_GAME_DATA daBullet_HIOParam const m; static daBullet_HIOParam const m;
}; };
#if DEBUG #if DEBUG
@@ -80,8 +80,8 @@ public:
int wait(void*); int wait(void*);
int move(void*); int move(void*);
static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static dCcD_SrcGObjInf const mCcDObjInfo;
static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; static dCcD_SrcSph mCcDSph;
}; };
STATIC_ASSERT(sizeof(daBullet_c) == 0x95c); STATIC_ASSERT(sizeof(daBullet_c) == 0x95c);
+1 -1
View File
@@ -33,7 +33,7 @@ public:
const CoachFireAttr& attr() { return M_attr; } const CoachFireAttr& attr() { return M_attr; }
static DUSK_GAME_DATA CoachFireAttr const M_attr; static CoachFireAttr const M_attr;
inline ~daCoachFire_c(); inline ~daCoachFire_c();
+1 -1
View File
@@ -38,7 +38,7 @@ public:
struct BckTbl { struct BckTbl {
u16 idx[4]; u16 idx[4];
}; };
static DUSK_GAME_DATA const BckTbl m_bckIdxTable[]; static const BckTbl m_bckIdxTable[];
private: private:
/* 0x5A0 */ const char* m_arcName; /* 0x5A0 */ const char* m_arcName;
+1 -1
View File
@@ -99,7 +99,7 @@ public:
mWarpMode = daCstatueWarpMode_Active; mWarpMode = daCstatueWarpMode_Active;
} }
static DUSK_GAME_DATA u16 const m_bckIdxTable[daCstatueType_N][7]; static u16 const m_bckIdxTable[daCstatueType_N][7];
private: private:
/* 0x568 */ const char* mResName; /* 0x568 */ const char* mResName;
+4 -4
View File
@@ -23,10 +23,10 @@ public:
/* 3 */ ACT_END, /* 3 */ ACT_END,
}; };
DUSK_CONST char* getArcName(); char* getArcName();
DUSK_CONST char* getBmd(); char* getBmd();
DUSK_CONST char* getDzb(); char* getDzb();
DUSK_CONST char* getBmd2(); char* getBmd2();
J3DModelData* getDoorModelData(); J3DModelData* getDoorModelData();
int CreateHeap(); int CreateHeap();
void calcMtx(); void calcMtx();
+2 -2
View File
@@ -33,8 +33,8 @@ public:
typedef int (daBdoorL1_c::*actionFunc)(); typedef int (daBdoorL1_c::*actionFunc)();
DUSK_CONST char* getDoorEventName(); char* getDoorEventName();
DUSK_CONST char* getDoorEventName2(); char* getDoorEventName2();
const char* getArcName(); const char* getArcName();
const char* getAnmArcName(); const char* getAnmArcName();
int getDoorType(); int getDoorType();
+5 -5
View File
@@ -14,11 +14,11 @@
*/ */
class daDbDoor00_c : public fopAc_ac_c { class daDbDoor00_c : public fopAc_ac_c {
public: public:
DUSK_CONST char* getAlwaysArcName(); char* getAlwaysArcName();
DUSK_CONST char* getDzb(); char* getDzb();
DUSK_CONST char* getDummyBmdName(); char* getDummyBmdName();
DUSK_CONST char* getBmdArcName(); char* getBmdArcName();
DUSK_CONST char* getBmdName(); char* getBmdName();
J3DModelData* getDoorModelData(); J3DModelData* getDoorModelData();
int CreateHeap(); int CreateHeap();
void calcMtx(); void calcMtx();
+5 -5
View File
@@ -29,11 +29,11 @@ public:
typedef int (daKnob20_c::*actionFunc)(); typedef int (daKnob20_c::*actionFunc)();
DUSK_CONST char* getAlwaysArcName(); char* getAlwaysArcName();
DUSK_CONST char* getEvArcName(); char* getEvArcName();
DUSK_CONST char* getDzb(); char* getDzb();
DUSK_CONST char* getDummyBmd(); char* getDummyBmd();
DUSK_CONST char* getBmd(); char* getBmd();
J3DModelData* getDoorModelData(); J3DModelData* getDoorModelData();
int CreateHeap(); int CreateHeap();
void calcMtx(); void calcMtx();
+8 -8
View File
@@ -54,15 +54,15 @@ public:
typedef int (daMBdoorL1_c::*actionFunc)(); typedef int (daMBdoorL1_c::*actionFunc)();
DUSK_CONST char* getAnmArcName(); char* getAnmArcName();
DUSK_CONST char* getArcName(); char* getArcName();
DUSK_CONST char* getAlwaysArcName(); char* getAlwaysArcName();
int getDoorType(); int getDoorType();
DUSK_CONST char* getOpenAnm(); char* getOpenAnm();
DUSK_CONST char* getCloseAnm(); char* getCloseAnm();
DUSK_CONST char* getBmd(); char* getBmd();
DUSK_CONST char* getBtk(); char* getBtk();
DUSK_CONST char* getDzb(); char* getDzb();
J3DModelData* getDoorModelData(); J3DModelData* getDoorModelData();
int CreateHeap(); int CreateHeap();
void calcMtx(); void calcMtx();
+6 -6
View File
@@ -45,12 +45,12 @@ public:
ACTION_DEMO, ACTION_DEMO,
}; };
char DUSK_CONST* getStopBmdName(); char* getStopBmdName();
J3DModelData* getStopModelData(); J3DModelData* getStopModelData();
char DUSK_CONST* getAlwaysArcName(); char* getAlwaysArcName();
char DUSK_CONST* getArcName(); char* getArcName();
char DUSK_CONST* getBmdName(); char* getBmdName();
char DUSK_CONST* getBtk(); char* getBtk();
J3DModelData* getModelData(); J3DModelData* getModelData();
f32 getSize2X(); f32 getSize2X();
int CreateHeap(); int CreateHeap();
@@ -115,7 +115,7 @@ public:
int chkStopOpen(); int chkStopOpen();
int chkMakeKey(); int chkMakeKey();
virtual char DUSK_CONST* getDzbName(); virtual char* getDzbName();
virtual int getDemoAction(); virtual int getDemoAction();
void onFlag(u16 flag) { field_0x68e |= flag; } void onFlag(u16 flag) { field_0x68e |= flag; }
+9 -9
View File
@@ -65,15 +65,15 @@ public:
f32 getCloseBoundSpeed() { return CLOSE_BOUND_SPEED; } f32 getCloseBoundSpeed() { return CLOSE_BOUND_SPEED; }
f32 getCloseBoundRatio() { return CLOSE_BOUND_RATIO; } f32 getCloseBoundRatio() { return CLOSE_BOUND_RATIO; }
static DUSK_GAME_DATA f32 const OPEN_SIZE; static f32 const OPEN_SIZE;
static DUSK_GAME_DATA f32 const OPEN_ACCEL; static f32 const OPEN_ACCEL;
static DUSK_GAME_DATA f32 const OPEN_SPEED; static f32 const OPEN_SPEED;
static DUSK_GAME_DATA f32 const OPEN_BOUND_SPEED; static f32 const OPEN_BOUND_SPEED;
static DUSK_GAME_DATA f32 const OPEN_BOUND_RATIO; static f32 const OPEN_BOUND_RATIO;
static DUSK_GAME_DATA f32 const CLOSE_ACCEL; static f32 const CLOSE_ACCEL;
static DUSK_GAME_DATA f32 const CLOSE_SPEED; static f32 const CLOSE_SPEED;
static DUSK_GAME_DATA f32 const CLOSE_BOUND_SPEED; static f32 const CLOSE_BOUND_SPEED;
static DUSK_GAME_DATA f32 const CLOSE_BOUND_RATIO; static f32 const CLOSE_BOUND_RATIO;
/* 0x5A0 */ dComIfG_resLoader_c mResLoader; /* 0x5A0 */ dComIfG_resLoader_c mResLoader;
/* 0x5B0 */ J3DModel* mpModel; /* 0x5B0 */ J3DModel* mpModel;
+1 -1
View File
@@ -32,7 +32,7 @@ public:
/* 0x5B4 */ J3DModel* mpModel; /* 0x5B4 */ J3DModel* mpModel;
/* 0x5B8 */ u8 mArrowType; /* 0x5B8 */ u8 mArrowType;
/* 0x5B9 */ u8 mFlags; /* 0x5B9 */ u8 mFlags;
/* 0x5BC */ char DUSK_CONST* mResName; /* 0x5BC */ char* mResName;
/* 0x5C0 */ s16 field_0x5c0; /* 0x5C0 */ s16 field_0x5c0;
/* 0x5C2 */ s16 mAction; /* 0x5C2 */ s16 mAction;
/* 0x5C4 */ s16 mMode; /* 0x5C4 */ s16 mMode;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
/* 0x5B5 */ u8 mDistanceParam; /* 0x5B5 */ u8 mDistanceParam;
/* 0x5B6 */ u8 mType; /* 0x5B6 */ u8 mType;
/* 0x5B7 */ u8 mPathIndex; /* 0x5B7 */ u8 mPathIndex;
/* 0x5B8 */ DUSK_CONST char* mArcName; /* 0x5B8 */ char* mArcName;
/* 0x5BC */ u8 field_0x5bc; /* 0x5BC */ u8 field_0x5bc;
/* 0x5BD */ s8 mPathPoint; /* 0x5BD */ s8 mPathPoint;
/* 0x5BE */ s8 mPathStep; /* 0x5BE */ s8 mPathStep;
+8 -8
View File
@@ -175,14 +175,14 @@ private:
STATIC_ASSERT(sizeof(daE_DT_c) == 0x1174); STATIC_ASSERT(sizeof(daE_DT_c) == 0x1174);
struct E_DT_n { struct E_DT_n {
static DUSK_GAME_DATA f32 eDt_ShakeFrame[10]; static f32 eDt_ShakeFrame[10];
static DUSK_GAME_DATA f32 eDt_ShakeFrameDemo[10]; static f32 eDt_ShakeFrameDemo[10];
static DUSK_GAME_DATA dCcD_SrcSph cc_dt_body_src; static dCcD_SrcSph cc_dt_body_src;
static DUSK_GAME_DATA dCcD_SrcSph cc_dt_tongue_src; static dCcD_SrcSph cc_dt_tongue_src;
static DUSK_GAME_DATA int mDt_OtamaNum; static int mDt_OtamaNum;
static DUSK_GAME_DATA int mDt_OtamaNo[20]; static int mDt_OtamaNo[20];
static DUSK_GAME_DATA int m_fall_no; static int m_fall_no;
static DUSK_GAME_DATA cXyz m_tongue_pos; static cXyz m_tongue_pos;
}; };
+1 -1
View File
@@ -101,7 +101,7 @@ private:
/* 0xB9E */ u8 field_0xb9e; /* 0xB9E */ u8 field_0xb9e;
/* 0xB9F */ u8 mHIOInit; /* 0xB9F */ u8 mHIOInit;
static DUSK_GAME_DATA actionFunc l_actionmenu[9]; static actionFunc l_actionmenu[9];
}; };
STATIC_ASSERT(sizeof(daE_GE_c) == 0xBA0); STATIC_ASSERT(sizeof(daE_GE_c) == 0xBA0);
-3
View File
@@ -96,9 +96,6 @@ public:
/* 0xDE0 */ cXyz field_0xde0; /* 0xDE0 */ cXyz field_0xde0;
/* 0xDEC */ u8 field_0xdec[0xdf9 - 0xdec]; /* 0xDEC */ u8 field_0xdec[0xdf9 - 0xdec];
/* 0xDF9 */ u8 field_0xdf9; /* 0xDF9 */ u8 field_0xdf9;
#if TARGET_PC
bool mItemCheckOverridden;
#endif
}; };
STATIC_ASSERT(sizeof(daE_HP_c) == 0xdfc); STATIC_ASSERT(sizeof(daE_HP_c) == 0xdfc);
+8 -8
View File
@@ -159,14 +159,14 @@ private:
STATIC_ASSERT(sizeof(daE_OC_c) == 0xe88); STATIC_ASSERT(sizeof(daE_OC_c) == 0xe88);
struct E_OC_n { struct E_OC_n {
static DUSK_GAME_DATA f32 const oc_attackb_trans[10]; static f32 const oc_attackb_trans[10];
static DUSK_GAME_DATA f32 const oc_attackc_trans[10]; static f32 const oc_attackc_trans[10];
static DUSK_GAME_DATA dCcD_SrcSph cc_sph_src; static dCcD_SrcSph cc_sph_src;
static DUSK_GAME_DATA dCcD_SrcSph at_sph_src; static dCcD_SrcSph at_sph_src;
static DUSK_GAME_DATA daE_OC_c* m_battle_oc; static daE_OC_c* m_battle_oc;
static DUSK_GAME_DATA daE_OC_c* m_damage_oc; static daE_OC_c* m_damage_oc;
static DUSK_GAME_DATA daE_OC_c* m_death_oc; static daE_OC_c* m_death_oc;
static DUSK_GAME_DATA daE_OC_c* m_talk_oc; static daE_OC_c* m_talk_oc;
}; };
#endif /* D_A_E_OC_H */ #endif /* D_A_E_OC_H */
+1 -1
View File
@@ -38,7 +38,7 @@ public:
/* 0x05CC */ s16 target_ya; /* 0x05CC */ s16 target_ya;
/* 0x05D0 */ mDoExt_McaMorfSO* anm_p; /* 0x05D0 */ mDoExt_McaMorfSO* anm_p;
/* 0x05D4 */ Z2CreatureEnemy sound; /* 0x05D4 */ Z2CreatureEnemy sound;
/* 0x0678 */ DUSK_CONST char* resName; /* 0x0678 */ char* resName;
/* 0x067C */ int anm; /* 0x067C */ int anm;
/* 0x0680 */ int field_0x680; /* 0x0680 */ int field_0x680;
/* 0x0684 */ dJntCol_c mJntCol; /* 0x0684 */ dJntCol_c mJntCol;
+1 -1
View File
@@ -36,7 +36,7 @@ public:
/* 0x05C8 */ s16 mTargetAngleY; /* 0x05C8 */ s16 mTargetAngleY;
/* 0x05CC */ mDoExt_McaMorfSO* mpMorf; /* 0x05CC */ mDoExt_McaMorfSO* mpMorf;
/* 0x05D0 */ Z2CreatureEnemy mSound; /* 0x05D0 */ Z2CreatureEnemy mSound;
/* 0x0674 */ char DUSK_CONST* mpArcName; /* 0x0674 */ char* mpArcName;
/* 0x0678 */ int mAnm; /* 0x0678 */ int mAnm;
/* 0x067C */ u8 field_0x67c[0x680 - 0x67c]; /* 0x067C */ u8 field_0x67c[0x680 - 0x67c];
/* 0x0680 */ dJntCol_c mJntCol; /* 0x0680 */ dJntCol_c mJntCol;
+1 -1
View File
@@ -63,7 +63,7 @@ private:
/* 0x6D4 */ f32 field_0x6d4; /* 0x6D4 */ f32 field_0x6d4;
/* 0x6D8 */ s16 mFootJoints[4]; /* 0x6D8 */ s16 mFootJoints[4];
/* 0x6E0 */ s16 field_0x6e0; /* 0x6E0 */ s16 field_0x6e0;
/* 0x6E4 */ char DUSK_CONST* mpResName; /* 0x6E4 */ char* mpResName;
/* 0x6E8 */ u16 mDamageCooldownTimer; /* 0x6E8 */ u16 mDamageCooldownTimer;
/* 0x6EA */ u8 mGenericTimer; /* 0x6EA */ u8 mGenericTimer;
/* 0x6EC */ int mAttackTimer; /* 0x6EC */ int mAttackTimer;
+1 -1
View File
@@ -99,7 +99,7 @@ public:
/* 0x0000 */ fopEn_enemy_c enemy; ///< @brief Base enemy class instance. /* 0x0000 */ fopEn_enemy_c enemy; ///< @brief Base enemy class instance.
/* 0x05AC */ request_of_phase_process_class phase; ///< @brief Phase process request handler. /* 0x05AC */ request_of_phase_process_class phase; ///< @brief Phase process request handler.
/* 0x05B4 */ s16 ride_mode; ///< @brief Current sub-action mode within the run action. /* 0x05B4 */ s16 ride_mode; ///< @brief Current sub-action mode within the run action.
/* 0x05B8 */ char DUSK_CONST* resName; ///< @brief Resource name for loading models/animations. /* 0x05B8 */ char* resName; ///< @brief Resource name for loading models/animations.
/* 0x05BC */ u8 arg0; ///< @brief Creation parameter 1. /* 0x05BC */ u8 arg0; ///< @brief Creation parameter 1.
/* 0x05BD */ u8 arg1; ///< @brief Creation parameter 2. /* 0x05BD */ u8 arg1; ///< @brief Creation parameter 2.
/* 0x05BE */ u8 field_0x5be; /* 0x05BE */ u8 field_0x5be;
+1 -1
View File
@@ -215,7 +215,7 @@ private:
STATIC_ASSERT(sizeof(daE_YM_c) == 0xAF8); STATIC_ASSERT(sizeof(daE_YM_c) == 0xAF8);
struct E_YM_n { struct E_YM_n {
static DUSK_GAME_DATA dCcD_SrcSph cc_sph_src; static dCcD_SrcSph cc_sph_src;
}; };
+2 -2
View File
@@ -311,10 +311,10 @@ struct daFmtMng_c : public fopAc_ac_c {
} }
static FmtMngAttributes const& attr() { return M_attr; } static FmtMngAttributes const& attr() { return M_attr; }
static DUSK_GAME_DATA FmtMngAttributes const M_attr; static FmtMngAttributes const M_attr;
typedef void (daFmtMng_c::*ActionFunc)(); typedef void (daFmtMng_c::*ActionFunc)();
static DUSK_GAME_DATA daFmtMng_c::ActionFunc ActionTable[10]; static daFmtMng_c::ActionFunc ActionTable[10];
/* 0x568 */ FmtPos_c* mPos; /* 0x568 */ FmtPos_c* mPos;
/* 0x56C */ FmtMember_c* mMember; /* 0x56C */ FmtMember_c* mMember;
+3 -3
View File
@@ -41,9 +41,9 @@ public:
static void deleteRoomGrass(int); static void deleteRoomGrass(int);
static void deleteRoomFlower(int); static void deleteRoomFlower(int);
static DUSK_GAME_DATA daGrass_c* m_myObj; static daGrass_c* m_myObj;
static DUSK_GAME_DATA dGrass_packet_c* m_grass; static dGrass_packet_c* m_grass;
static DUSK_GAME_DATA dFlower_packet_c* m_flower; static dFlower_packet_c* m_flower;
/* 0x568 */ u8 unk_0x568[0x570 - 0x568]; /* 0x568 */ u8 unk_0x568[0x570 - 0x568];
}; };
+3 -3
View File
@@ -351,8 +351,8 @@ public:
m_modelData->getMaterialNodePointer(5)->getShape()->hide(); m_modelData->getMaterialNodePointer(5)->getShape()->hide();
} }
static DUSK_GAME_DATA u16 const m_footJointTable[]; static u16 const m_footJointTable[];
static DUSK_GAME_DATA f32 const m_callLimitDistance2; static f32 const m_callLimitDistance2;
/* 0x0568 */ request_of_phase_process_class m_phase; /* 0x0568 */ request_of_phase_process_class m_phase;
/* 0x0570 */ J3DModel* m_model; /* 0x0570 */ J3DModel* m_model;
@@ -567,7 +567,7 @@ public:
class daHorse_hio_c0 { class daHorse_hio_c0 {
public: public:
static DUSK_GAME_DATA const daHorse_hio_c1 m; static const daHorse_hio_c1 m;
}; };
class daHorse_hio_c : public JORReflexible { class daHorse_hio_c : public JORReflexible {
+3 -3
View File
@@ -29,8 +29,8 @@ public:
static void setMorfFrame(u8 i_frame) { mMorfFrame = i_frame; } static void setMorfFrame(u8 i_frame) { mMorfFrame = i_frame; }
static void decMorfFrame() { cLib_calcTimer<u8>(&mMorfFrame); } static void decMorfFrame() { cLib_calcTimer<u8>(&mMorfFrame); }
static DUSK_GAME_DATA u8 mEyeMoveFlg; static u8 mEyeMoveFlg;
static DUSK_GAME_DATA u8 mMorfFrame; static u8 mMorfFrame;
/* 0x0F4 */ f32 field_0xf4; /* 0x0F4 */ f32 field_0xf4;
/* 0x0F8 */ f32 field_0xf8; /* 0x0F8 */ f32 field_0xf8;
@@ -50,7 +50,7 @@ struct daHoZelda_hio_c1 {
struct daHoZelda_hio_c0 { struct daHoZelda_hio_c0 {
daHoZelda_hio_c0() {} daHoZelda_hio_c0() {}
static DUSK_GAME_DATA daHoZelda_hio_c1 const m; static daHoZelda_hio_c1 const m;
}; };
class daHoZelda_hio_c : public JORReflexible { class daHoZelda_hio_c : public JORReflexible {
+1 -1
View File
@@ -60,7 +60,7 @@ public:
virtual u8 getCollisionH(); virtual u8 getCollisionH();
virtual u8 getCollisionR(); virtual u8 getCollisionR();
static DUSK_GAME_DATA daItemBase_data const m_data; static daItemBase_data const m_data;
/* 0x56C */ request_of_phase_process_class mPhase; /* 0x56C */ request_of_phase_process_class mPhase;
/* 0x574 */ J3DModel* mpModel; /* 0x574 */ J3DModel* mpModel;
+2 -2
View File
@@ -213,8 +213,8 @@ private:
/* 0x750 */ int field_0x750; /* 0x750 */ int field_0x750;
/* 0x754 */ int field_0x754; /* 0x754 */ int field_0x754;
/* 0x758 */ int field_0x758; /* 0x758 */ int field_0x758;
/* 0x75C */ DUSK_CONST char* mArcName; /* 0x75C */ char* mArcName;
/* 0x760 */ DUSK_CONST char* mDemoName; /* 0x760 */ char* mDemoName;
/* 0x764 */ u32 mShadowId; /* 0x764 */ u32 mShadowId;
/* 0x768 */ dPath* mpPath1; /* 0x768 */ dPath* mpPath1;
/* 0x76C */ dPath* mpPath2; /* 0x76C */ dPath* mpPath2;
+2 -7
View File
@@ -88,14 +88,9 @@ public:
/* 0x396A */ u8 field_0x396A[0x399E - 0x396A]; /* 0x396A */ u8 field_0x396A[0x399E - 0x396A];
/* 0x399E */ s16 field_0x399e; /* 0x399E */ s16 field_0x399e;
/* 0x39A0 */ u8 field_0x39A0[0x39A4 - 0x39A0]; /* 0x39A0 */ u8 field_0x39A0[0x39A4 - 0x39A0];
#if TARGET_PC
/* 0x39A4 */ cM_rnd_c mMantRng;
#endif
}; };
#if TARGET_PC
STATIC_ASSERT(sizeof(mant_class) == 0x39ac);
#else
STATIC_ASSERT(sizeof(mant_class) == 0x39a4); STATIC_ASSERT(sizeof(mant_class) == 0x39a4);
#endif
#endif /* D_A_MANT_H */ #endif /* D_A_MANT_H */
+1 -1
View File
@@ -49,7 +49,7 @@ public:
/* 0x5F4 */ s16 mYawToPlayer; /* 0x5F4 */ s16 mYawToPlayer;
/* 0x5F6 */ s16 field_0x5f6; /* 0x5F6 */ s16 field_0x5f6;
/* 0x5F8 */ s16 field_0x5f8; /* 0x5F8 */ s16 field_0x5f8;
/* 0x5FC */ DUSK_CONST char* mResName; /* 0x5FC */ char* mResName;
/* 0x600 */ mDoExt_McaMorf* mpMorf; /* 0x600 */ mDoExt_McaMorf* mpMorf;
/* 0x604 */ J3DAnmTransform* mAnmTransform; /* 0x604 */ J3DAnmTransform* mAnmTransform;
/* 0x608 */ u32 mShadowId; /* 0x608 */ u32 mShadowId;
+3 -8
View File
@@ -90,7 +90,7 @@ public:
/* 0x0000 */ fopAc_ac_c actor; /* 0x0000 */ fopAc_ac_c actor;
/* 0x0568 */ request_of_phase_process_class phase; /* 0x0568 */ request_of_phase_process_class phase;
/* 0x0570 */ DUSK_CONST char* arcname; /* 0x0570 */ char* arcname;
/* 0x0574 */ u8 arg0; /* 0x0574 */ u8 arg0;
/* 0x0575 */ u8 arg1; /* 0x0575 */ u8 arg1;
/* 0x0576 */ u8 arg2; /* 0x0576 */ u8 arg2;
@@ -299,13 +299,8 @@ public:
/* 0x168C */ u8 field_0x168c; /* 0x168C */ u8 field_0x168c;
/* 0x168D */ u8 field_0x168d; /* 0x168D */ u8 field_0x168d;
/* 0x168E */ u8 HIOInit; /* 0x168E */ u8 HIOInit;
#if TARGET_PC
cXyz mLineInterpPrev[MG_ROD_LURE_LINE_LEN];
cXyz mLineInterpCurr[MG_ROD_LURE_LINE_LEN];
bool mLineInterpPrevValid;
bool mLineInterpCurrValid;
#endif
}; };
STATIC_ASSERT(sizeof(dmg_rod_class) == 0x1690);
#endif /* D_A_MG_ROD_H */ #endif /* D_A_MG_ROD_H */
+5 -5
View File
@@ -32,7 +32,7 @@ public:
class daMidna_hio_c0 { class daMidna_hio_c0 {
public: public:
static DUSK_GAME_DATA daMidna_hio_c1 const m; static daMidna_hio_c1 const m;
}; };
STATIC_ASSERT(sizeof(daMidna_hio_c0::m) == 0x20); STATIC_ASSERT(sizeof(daMidna_hio_c0::m) == 0x20);
@@ -87,8 +87,8 @@ public:
/* 0x0FC */ f32 mNowOffsetX; /* 0x0FC */ f32 mNowOffsetX;
/* 0x100 */ f32 mNowOffsetY; /* 0x100 */ f32 mNowOffsetY;
static DUSK_GAME_DATA bool sEyeMoveFlg; static bool sEyeMoveFlg;
static DUSK_GAME_DATA u8 sMorfFrame; static u8 sMorfFrame;
}; };
STATIC_ASSERT(sizeof(daMidna_matAnm_c) == 0x104); STATIC_ASSERT(sizeof(daMidna_matAnm_c) == 0x104);
@@ -420,8 +420,8 @@ public:
static u32 getOtherHeapSize() { return 0x1D0; } static u32 getOtherHeapSize() { return 0x1D0; }
static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21]; static daMidna_texData_s const m_texDataTable[21];
static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53]; static daMidna_anmData_s const m_anmDataTable[53];
private: private:
/* 0x568 */ request_of_phase_process_class mPhase; /* 0x568 */ request_of_phase_process_class mPhase;
+2 -2
View File
@@ -58,8 +58,8 @@ public:
static u32 getMirrorRoomPrm() { return 0xFF03; } static u32 getMirrorRoomPrm() { return 0xFF03; }
typedef int (daMirror_c::*entryModelFunc)(J3DModel*); typedef int (daMirror_c::*entryModelFunc)(J3DModel*);
static DUSK_GAME_DATA entryModelFunc m_entryModel; static entryModelFunc m_entryModel;
static DUSK_GAME_DATA daMirror_c* m_myObj; static daMirror_c* m_myObj;
/* 0x570 */ dMirror_packet_c mPacket; /* 0x570 */ dMirror_packet_c mPacket;
/* 0x6f8 */ J3DModel* mpModel; /* 0x6f8 */ J3DModel* mpModel;
+7 -3
View File
@@ -5,7 +5,6 @@
#include <thp.h> #include <thp.h>
#else #else
#include <atomic> #include <atomic>
#include <chrono>
#endif #endif
#include "f_op/f_op_actor.h" #include "f_op/f_op_actor.h"
#include "d/d_drawlist.h" #include "d/d_drawlist.h"
@@ -95,6 +94,12 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
#define THP_TEXTURE_SET_COUNT 3 #define THP_TEXTURE_SET_COUNT 3
#endif #endif
#if TARGET_PC
namespace dusk {
void MoviePlayerShutdown();
}
#endif
struct daMP_THPPlayer { struct daMP_THPPlayer {
/* 0x000 */ DVDFileInfo fileInfo; /* 0x000 */ DVDFileInfo fileInfo;
/* 0x03C */ THPHeader header; /* 0x03C */ THPHeader header;
@@ -120,7 +125,6 @@ struct daMP_THPPlayer {
/* 0x0D4 */ s32 curCount; /* 0x0D4 */ s32 curCount;
#if TARGET_PC #if TARGET_PC
/* 0x0D8 */ std::atomic<s32> videoDecodeCount; /* 0x0D8 */ std::atomic<s32> videoDecodeCount;
std::chrono::steady_clock::time_point thpPlaybackClock;
#else #else
/* 0x0D8 */ s32 videoDecodeCount; /* 0x0D8 */ s32 videoDecodeCount;
#endif #endif
@@ -164,7 +168,7 @@ public:
static int daMP_c_Callback_Main(daMP_c*); static int daMP_c_Callback_Main(daMP_c*);
static int daMP_c_Callback_Draw(daMP_c*); static int daMP_c_Callback_Draw(daMP_c*);
static DUSK_GAME_DATA daMP_c* m_myObj; static daMP_c* m_myObj;
private: private:
/* 0x568 */ u32 (*mpGetMovieRestFrame)(void); /* 0x568 */ u32 (*mpGetMovieRestFrame)(void);
+4 -4
View File
@@ -103,8 +103,8 @@ public:
void animePlay(); void animePlay();
int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int); int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int);
void setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); void setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int);
J3DAnmTransformKey* getTrnsfrmKeyAnm(DUSK_CONST char*); J3DAnmTransformKey* getTrnsfrmKeyAnm(char*);
J3DAnmTexPattern* getTexPtrnAnm(DUSK_CONST char*); J3DAnmTexPattern* getTexPtrnAnm(char*);
int checkEndAnm(J3DFrameCtrl*); int checkEndAnm(J3DFrameCtrl*);
int checkEndAnm(f32); int checkEndAnm(f32);
u8 getItemNumMax(); u8 getItemNumMax();
@@ -131,8 +131,8 @@ public:
typedef void (daMyna_c::*ProcFunc)(); typedef void (daMyna_c::*ProcFunc)();
typedef int (daMyna_c::*BaseMotionFunc)(int); typedef int (daMyna_c::*BaseMotionFunc)(int);
static DUSK_GAME_DATA dCcD_SrcSph const mCcDSph; static dCcD_SrcSph const mCcDSph;
static DUSK_GAME_DATA daMyna_c::BaseMotionFunc mBaseMotionTBL[7]; static daMyna_c::BaseMotionFunc mBaseMotionTBL[7];
/* 0x56C */ request_of_phase_process_class mPhase; /* 0x56C */ request_of_phase_process_class mPhase;
/* 0x574 */ mDoExt_McaMorfSO* mpMorf; /* 0x574 */ mDoExt_McaMorfSO* mpMorf;
+1 -1
View File
@@ -91,7 +91,7 @@ public:
s16 getExTime() { return mExTime; } s16 getExTime() { return mExTime; }
static DUSK_GAME_DATA const char* m_arcNameList[6]; static const char* m_arcNameList[6];
/* 0x56C */ request_of_phase_process_class mPhase; /* 0x56C */ request_of_phase_process_class mPhase;
/* 0x574 */ J3DModel* mpModel; /* 0x574 */ J3DModel* mpModel;
+10 -10
View File
@@ -519,7 +519,7 @@ public:
/* 0x568 */ daNpcT_faceMotionAnmData_c const* mpFaceMotionAnmData; /* 0x568 */ daNpcT_faceMotionAnmData_c const* mpFaceMotionAnmData;
/* 0x56C */ daNpcT_motionAnmData_c const* mpMotionAnmData; /* 0x56C */ daNpcT_motionAnmData_c const* mpMotionAnmData;
/* 0x570 */ daNpcT_evtData_c const* mpEvtData; /* 0x570 */ daNpcT_evtData_c const* mpEvtData;
/* 0x574 */ DUSK_CONST char* DUSK_CONST* mpArcNames; /* 0x574 */ char** mpArcNames;
/* 0x578 */ mDoExt_McaMorfSO* mpMorf[2]; /* 0x578 */ mDoExt_McaMorfSO* mpMorf[2];
/* 0x580 */ Z2Creature mSound; /* 0x580 */ Z2Creature mSound;
/* 0x610 */ mDoExt_bckAnm mBckAnm; /* 0x610 */ mDoExt_bckAnm mBckAnm;
@@ -627,7 +627,7 @@ public:
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_faceMotionSequenceData,
int i_faceMotionStepNum, int i_faceMotionStepNum,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
int i_motionStepNum, daNpcT_evtData_c const* i_evtData, DUSK_CONST char* DUSK_CONST* i_arcNames) int i_motionStepNum, daNpcT_evtData_c const* i_evtData, char** i_arcNames)
: :
mpFaceMotionAnmData(i_faceMotionAnmData), mpFaceMotionAnmData(i_faceMotionAnmData),
mpMotionAnmData(i_motionAnmData), mpMotionAnmData(i_motionAnmData),
@@ -654,8 +654,8 @@ public:
int setBtkAnm(J3DAnmTextureSRTKey*, J3DModelData*, f32, int); int setBtkAnm(J3DAnmTextureSRTKey*, J3DModelData*, f32, int);
int setBrkAnm(J3DAnmTevRegKey*, J3DModelData*, f32, int); int setBrkAnm(J3DAnmTevRegKey*, J3DModelData*, f32, int);
int setBpkAnm(J3DAnmColor*, J3DModelData*, f32, int); int setBpkAnm(J3DAnmColor*, J3DModelData*, f32, int);
int loadRes(s8 const*, char const* DUSK_CONST*); int loadRes(s8 const*, char const**);
void deleteRes(s8 const*, char const* DUSK_CONST*); void deleteRes(s8 const*, char const**);
int execute(); int execute();
int draw(BOOL, BOOL, f32, GXColorS10*, f32, BOOL, BOOL, BOOL); int draw(BOOL, BOOL, f32, GXColorS10*, f32, BOOL, BOOL, BOOL);
void setEnvTevColor(); void setEnvTevColor();
@@ -776,12 +776,12 @@ public:
return chkFindActor(daPy_getPlayerActorClass(), param_0, param_1); return chkFindActor(daPy_getPlayerActorClass(), param_0, param_1);
} }
static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjData; static dCcD_SrcGObjInf const mCcDObjData;
static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; static dCcD_SrcCyl mCcDCyl;
static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; static dCcD_SrcSph mCcDSph;
static DUSK_GAME_DATA fopAc_ac_c* mFindActorPtrs[50]; static fopAc_ac_c* mFindActorPtrs[50];
static DUSK_GAME_DATA s16 mSrchName; static s16 mSrchName;
static DUSK_GAME_DATA int mFindCount; static int mFindCount;
enum Mode { enum Mode {
/* 0 */ MODE_ENTER, /* 0 */ MODE_ENTER,
+10 -10
View File
@@ -86,12 +86,12 @@ public:
class daBaseNpc_c : public fopAc_ac_c { class daBaseNpc_c : public fopAc_ac_c {
public: public:
daBaseNpc_c(); daBaseNpc_c();
J3DAnmTransform* getTrnsfrmKeyAnmP(char DUSK_CONST*, int); J3DAnmTransform* getTrnsfrmKeyAnmP(char*, int);
int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int); int setMcaMorfAnm(J3DAnmTransformKey*, f32, f32, int, int, int);
int setBckAnm(J3DAnmTransform*, f32, int, int, int, bool); int setBckAnm(J3DAnmTransform*, f32, int, int, int, bool);
J3DAnmTransform* getTexPtrnAnmP(char DUSK_CONST*, int); J3DAnmTransform* getTexPtrnAnmP(char*, int);
int setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int); int setBtpAnm(J3DAnmTexPattern*, J3DModelData*, f32, int);
void orderEvent(int, char DUSK_CONST*); void orderEvent(int, char*);
void setEnvTevColor(); void setEnvTevColor();
void setRoomNo(); void setRoomNo();
int checkEndAnm(f32); int checkEndAnm(f32);
@@ -113,9 +113,9 @@ public:
virtual void drawOtherMdls(); virtual void drawOtherMdls();
virtual bool dbgDraw(); virtual bool dbgDraw();
static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObj; static dCcD_SrcGObjInf const mCcDObj;
static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; static dCcD_SrcCyl mCcDCyl;
static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; static dCcD_SrcSph mCcDSph;
public: public:
/* 0x56C */ dBgS_ObjAcch mAcch; /* 0x56C */ dBgS_ObjAcch mAcch;
@@ -128,7 +128,7 @@ public:
/* 0x808 */ mDoExt_btpAnm mBtp; /* 0x808 */ mDoExt_btpAnm mBtp;
/* 0x820 */ mDoExt_btkAnm mBtk; /* 0x820 */ mDoExt_btkAnm mBtk;
/* 0x838 */ s16 field_0x838; /* 0x838 */ s16 field_0x838;
/* 0x83C */ u16 DUSK_CONST* field_0x83c; /* 0x83C */ u16* field_0x83c;
/* 0x840 */ u16 field_0x840; /* 0x840 */ u16 field_0x840;
/* 0x842 */ u16 field_0x842; /* 0x842 */ u16 field_0x842;
/* 0x844 */ u8 field_0x844; /* 0x844 */ u8 field_0x844;
@@ -173,9 +173,9 @@ public:
virtual int ToFore() { return 1; } virtual int ToFore() { return 1; }
virtual int ToBack() { return 1; } virtual int ToBack() { return 1; }
static DUSK_GAME_DATA const char* m_name; static const char* m_name;
static DUSK_GAME_DATA int m_dzb_id; static int m_dzb_id;
static DUSK_GAME_DATA MoveBGActor_SetFunc m_set_func; static MoveBGActor_SetFunc m_set_func;
public: public:
/* 0xA14 */ dBgW* mpBgw; /* 0xA14 */ dBgW* mpBgw;
+13 -13
View File
@@ -311,10 +311,10 @@ public:
static void* srchActor(void*, void*); static void* srchActor(void*, void*);
void initialize(); void initialize();
J3DAnmTransformKey* getTrnsfrmKeyAnmP(DUSK_CONST char*, int); J3DAnmTransformKey* getTrnsfrmKeyAnmP(char*, int);
J3DAnmTexPattern* getTexPtrnAnmP(DUSK_CONST char*, int); J3DAnmTexPattern* getTexPtrnAnmP(char*, int);
J3DAnmTextureSRTKey* getTexSRTKeyAnmP(DUSK_CONST char*, int); J3DAnmTextureSRTKey* getTexSRTKeyAnmP(char*, int);
J3DAnmTevRegKey* getTevRegKeyAnmP(DUSK_CONST char*, int); J3DAnmTevRegKey* getTevRegKeyAnmP(char*, int);
BOOL setMcaMorfAnm(J3DAnmTransformKey* i_anm, f32 i_rate, f32 i_morf, int i_attr, BOOL setMcaMorfAnm(J3DAnmTransformKey* i_anm, f32 i_rate, f32 i_morf, int i_attr,
int i_start, int i_end); int i_start, int i_end);
BOOL setBckAnm(J3DAnmTransform* i_bck, f32 i_rate, int i_attr, int i_start, BOOL setBckAnm(J3DAnmTransform* i_bck, f32 i_rate, int i_attr, int i_start,
@@ -336,8 +336,8 @@ public:
BOOL hitChk2(dCcD_Cyl*, BOOL, BOOL); BOOL hitChk2(dCcD_Cyl*, BOOL, BOOL);
void setDamage(int, int, int); void setDamage(int, int, int);
int ctrlMsgAnm(int&, int&, fopAc_ac_c*, BOOL); int ctrlMsgAnm(int&, int&, fopAc_ac_c*, BOOL);
void orderEvent(int, DUSK_CONST char*, u16, u16, u8, u16); void orderEvent(int, char*, u16, u16, u8, u16);
void changeEvent(DUSK_CONST char*, DUSK_CONST char*, u16, u16); void changeEvent(char*, char*, u16, u16);
BOOL chkActorInSight(fopAc_ac_c*, f32); BOOL chkActorInSight(fopAc_ac_c*, f32);
BOOL chkActorInArea(fopAc_ac_c*, cXyz, cXyz, s16); BOOL chkActorInArea(fopAc_ac_c*, cXyz, cXyz, s16);
BOOL chkActorInAttnArea(fopAc_ac_c*, fopAc_ac_c*, int); BOOL chkActorInAttnArea(fopAc_ac_c*, fopAc_ac_c*, int);
@@ -394,13 +394,13 @@ public:
void onHide() { mHide = true; } void onHide() { mHide = true; }
void offHide() { mHide = false; } void offHide() { mHide = false; }
static DUSK_GAME_DATA dCcD_SrcGObjInf const mCcDObjInfo; static dCcD_SrcGObjInf const mCcDObjInfo;
static DUSK_GAME_DATA dCcD_SrcCyl mCcDCyl; static dCcD_SrcCyl mCcDCyl;
static DUSK_GAME_DATA dCcD_SrcSph mCcDSph; static dCcD_SrcSph mCcDSph;
static DUSK_GAME_DATA fopAc_ac_c* mFindActorPList[100]; static fopAc_ac_c* mFindActorPList[100];
static DUSK_GAME_DATA s32 mFindCount; static s32 mFindCount;
static DUSK_GAME_DATA s16 mSrchActorName; static s16 mSrchActorName;
static DUSK_GAME_DATA char mFileNameBuf[0x15]; static char mFileNameBuf[0x15];
}; };
STATIC_ASSERT(sizeof(daNpcF_c) == 0xB48); STATIC_ASSERT(sizeof(daNpcF_c) == 0xB48);
+4 -4
View File
@@ -17,7 +17,7 @@ class daNpc_Aru_Param_c {
public: public:
virtual ~daNpc_Aru_Param_c() {} virtual ~daNpc_Aru_Param_c() {}
static DUSK_GAME_DATA daNpc_Aru_HIOParam const m; static daNpc_Aru_HIOParam const m;
}; };
#if DEBUG #if DEBUG
@@ -149,7 +149,7 @@ public:
int i_faceMotionStepNum, int i_faceMotionStepNum,
daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData, daNpcT_MotionSeqMngr_c::sequenceStepData_c const* i_motionSequenceData,
int i_motionStepNum, int i_motionStepNum,
daNpcT_evtData_c const* i_evtData, char DUSK_CONST* DUSK_CONST* i_arcNames) daNpcT_evtData_c const* i_evtData, char** i_arcNames)
: daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData, : daNpcT_c(i_faceMotionAnmData, i_motionAnmData, i_faceMotionSequenceData,
i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData, i_faceMotionStepNum, i_motionSequenceData, i_motionStepNum, i_evtData,
i_arcNames) { i_arcNames) {
@@ -171,8 +171,8 @@ public:
u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; } u8 getPathID() { return (fopAcM_GetParam(this) & 0xFF00) >> 8; }
void setLastIn() { mLastGoatIn = true; } void setLastIn() { mLastGoatIn = true; }
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[7]; static char* mCutNameList[7];
static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[7]; static cutFunc mCutList[7];
private: private:
/* 0xE40 */ NPC_ARU_HIO_CLASS* mpHIO; /* 0xE40 */ NPC_ARU_HIO_CLASS* mpHIO;
+2 -2
View File
@@ -12,7 +12,7 @@ public:
daNpcAsh_Param_c() {} daNpcAsh_Param_c() {}
virtual ~daNpcAsh_Param_c() {} virtual ~daNpcAsh_Param_c() {}
static DUSK_GAME_DATA const daNpcAsh_HIOParam m; static const daNpcAsh_HIOParam m;
}; };
#if DEBUG #if DEBUG
@@ -143,7 +143,7 @@ public:
inline bool step(s16, bool); inline bool step(s16, bool);
inline void playExpression(); inline void playExpression();
static DUSK_GAME_DATA EventFn mEvtSeqList[6]; static EventFn mEvtSeqList[6];
private: private:
/* 0xB48 */ Z2Creature mCreatureSound; /* 0xB48 */ Z2Creature mCreatureSound;
+2 -2
View File
@@ -12,7 +12,7 @@ class daNpcAshB_Param_c {
public: public:
virtual ~daNpcAshB_Param_c() {} virtual ~daNpcAshB_Param_c() {}
static DUSK_GAME_DATA const daNpcAshB_HIOParam m; static const daNpcAshB_HIOParam m;
}; };
#if DEBUG #if DEBUG
@@ -135,7 +135,7 @@ public:
inline bool step(s16, int, f32); inline bool step(s16, int, f32);
inline void playExpression(); inline void playExpression();
static DUSK_GAME_DATA EventFn DUSK_CONST mEvtSeqList[2]; static EventFn mEvtSeqList[2];
private: private:
/* 0xB48 */ Z2Creature mCreatureSound; /* 0xB48 */ Z2Creature mCreatureSound;

Some files were not shown because too many files have changed in this diff Show More