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
225 changed files with 1681 additions and 4663 deletions
+12 -16
View File
@@ -7,10 +7,6 @@ on:
- '*LICENSE'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
@@ -26,13 +22,13 @@ jobs:
matrix:
include:
- name: GCC x86_64
runner: ubuntu-24.04
runner: ubuntu-latest
preset: gcc
artifact_arch: x86_64
- name: GCC aarch64
runner: ubuntu-24.04-arm
preset: gcc
artifact_arch: aarch64
# - name: GCC aarch64
# runner: ubuntu-24.04-arm
# preset: gcc
# artifact_arch: aarch64
# - name: Clang x86_64
# runner: ubuntu-latest
# preset: clang
@@ -225,12 +221,12 @@ jobs:
msvc_arch: amd64
vcpkg_arch: x64
artifact_arch: x86_64
- name: MSVC arm64
runner: windows-latest
preset: arm64-msvc
msvc_arch: amd64_arm64
vcpkg_arch: arm64
artifact_arch: arm64
# - name: MSVC arm64
# runner: windows-11-arm
# preset: arm64-msvc
# msvc_arch: arm64
# vcpkg_arch: arm64
# artifact_arch: arm64
# - name: Clang x86_64
# runner: windows-latest
# preset: clang
@@ -259,7 +255,7 @@ jobs:
- name: Install dependencies
run: |
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
run: cmake --preset x-windows-ci-${{matrix.preset}}
-31
View File
@@ -11,7 +11,6 @@ if (DUSK_VERSION_OVERRIDE)
set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
set(DUSK_VERSION_CODE "1")
set(DUSK_WC_REVISION "")
set(DUSK_WC_BRANCH "")
set(DUSK_WC_DATE "")
@@ -62,9 +61,6 @@ endif ()
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
set(_ver_major ${CMAKE_MATCH_1})
set(_ver_minor ${CMAKE_MATCH_2})
set(_ver_patch ${CMAKE_MATCH_3})
set(DUSK_VERSION_TWEAK "0")
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
@@ -72,19 +68,10 @@ if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
endif ()
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
if(DUSK_VERSION_TWEAK GREATER 999)
set(_tweak 999)
else()
set(_tweak ${DUSK_VERSION_TWEAK})
endif()
# encoding: major*1e7 + minor*1e5 + patch*1e3 + tweak; collision-free for major<210, minor<100, patch<100, tweak<=999
math(EXPR DUSK_VERSION_CODE
"${_ver_major} * 10000000 + ${_ver_minor} * 100000 + ${_ver_patch} * 1000 + ${_tweak}")
else ()
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
set(DUSK_VERSION_CODE "1")
endif ()
endif ()
@@ -92,7 +79,6 @@ endif ()
# Add version information to CI environment variables
if(DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION_CODE=${DUSK_VERSION_CODE}\n")
endif()
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
@@ -100,8 +86,6 @@ project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
if (APPLE)
enable_language(OBJC OBJCXX)
endif ()
# Adjust CMAKE_SYSTEM_PROCESSOR on Windows to match compiler target
include(cmake/WindowsTargetProcessor.cmake)
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
# ios.toolchain.cmake hack for SDL
set(TVOS ON)
@@ -170,7 +154,6 @@ if (DUSK_MOVIE_SUPPORT)
endif ()
set(_jpeg_cmake_args
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsTargetProcessor.cmake
-DENABLE_SHARED=OFF
-DWITH_TURBOJPEG=ON
-DWITH_JAVA=OFF
@@ -293,12 +276,6 @@ if (DUSK_ENABLE_SENTRY_NATIVE)
endif ()
endif ()
# Use signed char on ARM to match the original game (and x86)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch)
if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
add_compile_options(-fsigned-char)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set(PLATFORM_NAME win32)
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
@@ -355,10 +332,6 @@ endif ()
if (WIN32)
list(APPEND GAME_LIBS Ws2_32)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND GAME_LIBS dbghelp)
list(APPEND GAME_COMPILE_DEFS DUSK_CRASH_DBGHELP=1)
endif ()
endif ()
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/no_backend.cpp)
@@ -495,10 +468,6 @@ if (ANDROID)
target_link_options(dusklight PRIVATE "-Wl,-u,SDL_main")
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
endif ()
if (NOT APPLE)
add_custom_command(TARGET dusklight POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
+4 -12
View File
@@ -33,11 +33,7 @@
"value": true
},
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
"DUSK_SENTRY_ENVIRONMENT": "production",
"Rust_RUSTUP_INSTALL_MISSING_TARGET": {
"type": "BOOL",
"value": true
}
"DUSK_SENTRY_ENVIRONMENT": "production"
}
},
{
@@ -326,9 +322,7 @@
"BUILD_SHARED_LIBS": {
"type": "BOOL",
"value": false
},
"AURORA_SDL3_VERSION": "3.4.8",
"AURORA_SDL3_REF": "refs/tags/release-3.4.8"
}
}
},
{
@@ -436,6 +430,7 @@
"x-macos-ci"
],
"cacheVariables": {
"AURORA_DAWN_PROVIDER": "vendor",
"CMAKE_OSX_ARCHITECTURES": "x86_64",
"Rust_CARGO_TARGET": "x86_64-apple-darwin"
}
@@ -495,10 +490,7 @@
"inherits": [
"x-windows-ci",
"windows-arm64-msvc"
],
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "arm64-windows"
}
]
}
],
"buildPresets": [
+8 -3
View File
@@ -22,11 +22,16 @@ It aims to be as accurate as possible to the original while also providing new o
> [!IMPORTANT]
> At a minimum, Dusklight requires a GPU with support for either D3D12, Vulkan, or Metal. Your experience with specific hardware, operating systems, and drivers may vary. In particular, older Intel iGPUs have a high likelihood of incompatibility. We are also aware of a number of issues on devices with Adreno GPUs and are working to resolve them.
### 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 a `.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:
Currently, only the GameCube USA and EUR releases are supported. Support for other versions of the game is planned in the future.
| Version | SHA-1 hash |
|--------------| ------------------------------------------ |
| GameCube USA | `75edd3ddff41f125d1b4ce1a40378f1b565519e7` |
| GameCube EUR | `2601822a488eeb86fb89db16ca8f29c2c953e1ca` |
*Support for other versions of the game is planned in the future.
### 2. Download [Dusklight](https://github.com/TwilitRealm/dusklight/releases)
+2 -3
View File
@@ -6,7 +6,6 @@ fi
build_dir="$PWD/build"
linuxdeploy="$build_dir/linuxdeploy-$(uname -m).AppImage"
lib_dir="/usr/lib/$(uname -m)-linux-gnu"
# Get linuxdeploy
mkdir -p "$build_dir"
@@ -20,8 +19,8 @@ for install_path in build/install/*; do
cp -r "$install_path" build/appdir/usr/bin
done
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
cp platforms/freedesktop/dusklight.desktop build/appdir/usr/share/applications
cd build/install
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
-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 -181
View File
@@ -1,165 +1,51 @@
# Building Dusklight
## Dependencies
The following dependencies are required:
### Building
#### Prerequisites
* [CMake 3.25+](https://cmake.org)
* Windows: Install `CMake Tools` in Visual Studio
* macOS: `brew install cmake`
* [Python 3+](https://python.org)
### Windows
* Install [CMake 3.25+](https://cmake.org) by searching `CMake Tools` in Visual Studio
* Install Python 3 from the [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640) and verify it's added to `%PATH%` by typing `python` in `cmd`.
Recommended IDEs:
* [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx). During installation:
* Select `C++ Development` and verify the following packages are included:
* `Windows 11 SDK`
* `CMake Tools`
* `C++ Clang Compiler`
* `C++ Clang-cl`
### macOS
* Make sure [Homebrew](https://brew.sh) is installed
* Install [CMake 3.25+](https://cmake.org)
```sh
brew install cmake
```
* Install Python 3
```sh
brew install python@3
```
Recommended IDEs:
* [Xcode 16.4 or later](https://developer.apple.com/xcode/)
* [Visual Studio Code](https://code.visualstudio.com/download/)
* [CLion](https://www.jetbrains.com/clion/)
### Linux
Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
**Ubuntu 24.04+ packages**
<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:
* Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640)
* Verify it's added to `%PATH%` by typing `python` in `cmd`.
* macOS: `brew install python@3`
* **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
* Select `C++ Development` and verify the following packages are included:
* `Windows 11 SDK`
* `CMake Tools`
* `C++ Clang Compiler`
* `C++ Clang-cl`
* **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/)
* **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
* Ubuntu 24.04+ packages
```
build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
libxss-dev libxtst-dev
```
* Arch Linux packages
```
base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
```
* Fedora packages
```
cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
```
* It's also important that you install the developer tools and libraries
```
sudo dnf groupinstall "Development Tools" "Development Libraries"
```
#### Setup
Clone and initialize the Dusklight repository
```sh
git clone --recursive https://github.com/TwilitRealm/dusklight.git
git pull
cd dusklight
git pull
git submodule update --init --recursive
```
#### Building
**CLion (Windows / macOS / Linux)**
Open the project directory in CLion. Enable the appropriate presets for your platform:
@@ -178,8 +64,7 @@ cmake --build --preset macos-default-relwithdebinfo
```
Alternate presets available:
* `macos-default-debug`: Clang, Debug
- `macos-default-debug`: Clang, Debug
**ninja (Linux)**
@@ -189,10 +74,9 @@ cmake --build --preset linux-default-relwithdebinfo
```
Alternate presets available:
* `linux-default-debug`: GCC, Debug
* `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
* `linux-clang-debug`: Clang, Debug
- `linux-default-debug`: GCC, Debug
- `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
- `linux-clang-debug`: Clang, Debug
**ninja (Windows)**
@@ -202,27 +86,13 @@ cmake --build --preset windows-msvc-relwithdebinfo
```
Alternate presets available:
- `windows-msvc-debug`: MSVC, Debug
- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
- `windows-clang-debug`: Clang-cl, Debug
* `windows-msvc-debug`: MSVC, Debug
* `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
#### Running
Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
```sh
build/{preset}/dusklight --dvd /path/to/game.iso
```
**macOS**
macOS builds an `.app` bundle which contains the executable and all necessary resources.
* Pass the disc image as a positional argument using the `--dvd` flag. Supported formats are: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
```sh
build/{preset}/Dusklight.app/Contents/MacOS/Dusklight --dvd /path/to/game.iso
build/{preset}/dusklight/path/to/game.rvz
```
If no path is specified, Dusklight defaults to `game.iso` in the current working directory.
+26 -28
View File
@@ -1,48 +1,46 @@
# Installing Dusklight on iOS via iloader
# Installing Dusklight on iOS via AltStore
## Prerequisites
- A Windows, Linux, or macOS device
- iOS device connected to computer via USB
- Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases))
- Legally acquired game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL)
- Mac with Homebrew installed
- 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/dusk/releases))
- Game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL)
## 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.
- Windows WILL require iTunes to be installed
- Linux WILL require usbmuxd to be installed, this is installed by default in most distros though
```sh
brew install altserver
open -a AltServer
```
AltServer will appear in your menu bar.
## 2. Enable Developer Mode (iOS 16+)
- 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)
* You may be prompted to put in a code from your iOS device if you have 2FA enabled, do so
2. Plug in your iOS device via USB into your PC. If you're missing a dependency, an error pop-up will tell you to install it
* You will need to hit `Refresh` after plugging it in at this stage so that it can be detected, it does not automatically refresh
3. Leave settings unchanged (the Anisette server should stay Sidestore (.io))
3.(a) Installing SideStore directly is not required, but provides you a way to install Dusklight on your phone without being plugged into a computer later
4. Press `Import IPA` and choose your downloaded `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
- Click AltServer in the menu bar
- Click **Install AltStore > [Your iPhone]**
- Enter your Apple ID credentials when prompted
- On your iPhone, go to **Settings > General > VPN & Device Management**
- Tap your Apple ID under "Developer App" and tap **Trust**
## 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
- **iCloud Drive** - Place files in iCloud Drive on your Mac and they'll sync to Files on your iPhone
- **USB transfer** - Connect your iPhone and drag files via Finder's sidebar
- **Cloud storage** - Upload to Google Drive, Dropbox, etc. and download on your iPhone
You may now use Dusklight on iOS 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
+1 -1
-2
View File
@@ -1420,7 +1420,6 @@ set(DUSK_FILES
src/d/actor/d_a_alink_dusk.cpp
src/dusk/asserts.cpp
src/dusk/config.cpp
src/dusk/crash_handler.cpp
src/dusk/crash_reporting.cpp
src/dusk/data.cpp
src/dusk/data.hpp
@@ -1440,7 +1439,6 @@ set(DUSK_FILES
src/dusk/logging.cpp
src/dusk/settings.cpp
src/dusk/speedrun.cpp
src/dusk/string.cpp
src/dusk/stubs.cpp
src/dusk/update_check.cpp
src/dusk/update_check.hpp
Generated
+3 -3
View File
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1778869304,
"narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=",
"lastModified": 1775710090,
"narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d233902339c02a9c334e7e593de68855ad26c4cb",
"rev": "4c1018dae018162ec878d42fec712642d214fdfa",
"type": "github"
},
"original": {
+198 -344
View File
@@ -1,374 +1,228 @@
{
description = "Dusklight native PC port of the Twilight Princess decompilation";
inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
outputs =
{ self, nixpkgs }:
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
inherit (nixpkgs) lib;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = lib.genAttrs supportedSystems;
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system: import nixpkgs { inherit system; };
dawnVersion = "v20260423.175430";
nodVersion = "v2.0.0-alpha.8";
versionSuffix = "nix-" + (self.shortRev or self.dirtyShortRev or "dirty");
dawnInfo = {
"x86_64-linux" = {
triple = "linux-x86_64";
# Dependencies that are not packaged in nixpkgs (used by the Linux package build):
buildSources = pkgs: {
aurora-src = pkgs.fetchFromGitHub {
owner = "encounter";
repo = "aurora";
rev = "63606a43265a3bc18dafd500ab4d7a2108f109e6";
hash = "sha256-xBvnAwGwNzav67Ac6oUz7RqDUwqgL2bsME3OOMn8Tqw=";
};
dawn-src = pkgs.fetchzip {
url = "https://github.com/encounter/dawn-build/releases/download/v20260423.175430/dawn-linux-x86_64.tar.gz";
hash = "sha256-HXfKTLHtMPwupnFnaflCARtXVPuS/0PoCePXidjE5xs=";
stripRoot = false;
};
"aarch64-linux" = {
triple = "linux-aarch64";
hash = "sha256-34yyFpfqBZUwoFXQ41F0AwAU78FaNihOSY0oriwn6B0=";
};
"aarch64-darwin" = {
triple = "darwin-arm64";
hash = "sha256-eQnzrBp6gjiBek1VYQ9A5W13ClYWrDDKjIqv/7eNTR4=";
};
"x86_64-darwin" = {
triple = "darwin-x86_64";
hash = "sha256-QGWiGdxiI9kci3NPXH6QFFirxn16851zB/w3jqhIBJ4=";
};
};
nodPrebuiltInfo = {
"x86_64-linux" = {
triple = "linux-x86_64";
nod-src = pkgs.fetchzip {
url = "https://github.com/encounter/nod/releases/download/v2.0.0-alpha.8/libnod-linux-x86_64.tar.gz";
hash = "sha256-mUqvLsbsqaZ+HAjMmHYPYO+MgtanGRTw7Gzn5uXR5rE=";
stripRoot = false;
};
"aarch64-darwin" = {
triple = "macos-arm64";
hash = "sha256-UPy1ywCcv0K6VJOU3uUelJuUdBh3UNaPRlyP5LOBeDw=";
# The version of imgui on nixpkgs does not map cleanly.
imgui-src = pkgs.fetchFromGitHub {
owner = "ocornut";
repo = "imgui";
rev = "v1.91.9b-docking";
hash = "sha256-mQOJ6jCN+7VopgZ61yzaCnt4R1QLrW7+47xxMhFRHLQ=";
};
sqlite-src = pkgs.fetchzip {
url = "https://sqlite.org/2026/sqlite-amalgamation-3510300.zip";
hash = "sha256-pNMR8zxaaqfAzQ0AQBOXMct4usdjey1Q0Gnitg06UhM=";
};
rmlui-src = pkgs.fetchzip {
url = "https://github.com/mikke89/RmlUi/archive/f9b8c9e2935d5df2c7dff2c190d3968e99b0c3dc.tar.gz";
hash = "sha256-g4O/JZUrrcseOz8o2QJRt+2CeuiLnVeuDJc906xvuIg=";
};
};
perSystem =
system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs.stdenv.hostPlatform) isDarwin;
hasNodPrebuilt = nodPrebuiltInfo ? ${system};
aurora = pkgs.fetchFromGitHub {
owner = "encounter";
repo = "aurora";
rev = "10006618ee493f248b8597e4dfa1d2871d76a1d9";
hash = "sha256-lY2xuVyB7aPJ9+2wwLRB3F5U/BuPSxdSpegdG+qNd9o=";
};
dawn = pkgs.fetchzip {
url = "https://github.com/encounter/dawn-build/releases/download/${dawnVersion}/dawn-${dawnInfo.${system}.triple}.tar.gz";
hash = dawnInfo.${system}.hash;
stripRoot = false;
};
corrosion = pkgs.fetchFromGitHub {
owner = "corrosion-rs";
repo = "corrosion";
rev = "v0.6.1";
hash = "sha256-ppuDNObfKhneD9AlnPAvyCRHKW3BidXKglD1j/LE9CM=";
};
nodFromSource = pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "nod";
version = nodVersion;
src = pkgs.fetchFromGitHub {
owner = "encounter";
repo = "nod";
rev = nodVersion;
hash = "sha256-+zrtVzjo0+X/6uMcNUn1+FaSR+jOhrcQSDNBFjw0NDs=";
};
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = "${finalAttrs.src}/Cargo.lock";
};
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-warn "add_subdirectory(nod-ffi/examples)" ""
'';
nativeBuildInputs = [
pkgs.cmake
pkgs.ninja
pkgs.rustPlatform.cargoSetupHook
pkgs.cargo
pkgs.rustc
];
CARGO_NET_OFFLINE = "true";
cmakeFlags = [
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-DFETCHCONTENT_SOURCE_DIR_CORROSION=${corrosion}"
"-DNOD_ENABLE_INSTALL=ON"
"-DBUILD_SHARED_LIBS=OFF"
];
doCheck = false;
});
nod =
if hasNodPrebuilt then
pkgs.fetchzip {
url = "https://github.com/encounter/nod/releases/download/${nodVersion}/libnod-${
nodPrebuiltInfo.${system}.triple
}.tar.gz";
hash = nodPrebuiltInfo.${system}.hash;
stripRoot = false;
}
else
nodFromSource;
fetchContentDirs = {
DAWN_PREBUILT = dawn;
NOD_PREBUILT = nod;
CXXOPTS = pkgs.cxxopts.src;
JSON = pkgs.nlohmann_json.src;
XXHASH = pkgs.xxHash.src;
ZSTD = pkgs.zstd.src;
FMT = pkgs.fetchzip {
url = "https://github.com/fmtlib/fmt/archive/refs/tags/11.1.4.tar.gz";
hash = "sha256-sUbxlYi/Aupaox3JjWFqXIjcaQa0LFjclQAOleT+FRA=";
};
TRACY = pkgs.fetchzip {
url = "https://github.com/wolfpld/tracy/archive/a64b9a20294d59421a2f57aeca3c6383d8c48169.tar.gz";
hash = "sha256-hbNGOsGeyGSvCJ2No8RkwOib1lX2on3vNZSzyVkZdXw=";
};
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"
rm -rf "$sourceRoot/extern/aurora"
mkdir -p "$sourceRoot/extern"
cp -r ${aurora} "$sourceRoot/extern/aurora"
chmod -R u+w "$sourceRoot/extern/aurora"
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
];
cmakeBuildType = "RelWithDebInfo";
ninjaFlags = [ "dusklight" ];
cmakeFlags = [
"-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-DAURORA_DAWN_PROVIDER=package"
"-DAURORA_DAWN_LINKAGE=static"
"-DAURORA_NOD_PROVIDER=package"
"-DAURORA_NOD_LINKAGE=static"
"-DAURORA_SDL3_PROVIDER=system"
]
++ 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
'';
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
# Dusklight Actual (Linux x86_64 only — relies on prebuilt dawn/nod binaries)
mkDusklight = pkgs:
let srcs = buildSources pkgs;
versionSuffix = if self ? shortRev && self.shortRev != null
then "nix-${self.shortRev}"
else "nix-dirty";
in
pkgs.stdenv.mkDerivation {
name = "dusklight";
src = ./.;
postUnpack = ''
mkdir -p $sourceRoot/extern/aurora
cp -r ${srcs.aurora-src}/. $sourceRoot/extern/aurora/
chmod -R u+w $sourceRoot/extern/aurora
sed -i '/add_subdirectory(tests)/d' $sourceRoot/extern/aurora/CMakeLists.txt
'';
# Remove last line to re-enable tests
cmakeFlags = [
"-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-DFETCHCONTENT_SOURCE_DIR_CXXOPTS=${pkgs.cxxopts.src}"
"-DFETCHCONTENT_SOURCE_DIR_JSON=${pkgs.nlohmann_json.src}"
"-DFETCHCONTENT_SOURCE_DIR_DAWN_PREBUILT=${srcs.dawn-src}"
"-DFETCHCONTENT_SOURCE_DIR_XXHASH=${pkgs.xxHash.src}"
"-DFETCHCONTENT_SOURCE_DIR_FMT=${pkgs.fmt.src}"
"-DFETCHCONTENT_SOURCE_DIR_TRACY=${pkgs.tracy.src}"
"-DAURORA_SDL3_PROVIDER=system"
"-DFETCHCONTENT_SOURCE_DIR_NOD_PREBUILT=${srcs.nod-src}"
"-DAURORA_NOD_PROVIDER=package"
"-DFETCHCONTENT_SOURCE_DIR_FREETYPE=${pkgs.freetype.src}"
"-DFETCHCONTENT_SOURCE_DIR_ZSTD=${pkgs.zstd.src}"
"-DFETCHCONTENT_SOURCE_DIR_SQLITE3=${srcs.sqlite-src}"
"-DFETCHCONTENT_SOURCE_DIR_IMGUI=${srcs.imgui-src}"
"-DFETCHCONTENT_SOURCE_DIR_RMLUI=${srcs.rmlui-src}"
"-DCMAKE_CROSSCOMPILING=ON" # Tests are not working as I didn't want to work through getting google's test suite working as well. This is the only guard I could find to disable it.
];
installPhase = ''
mkdir -p $out/bin
cp dusklight $out/bin/dusklight
cp -r ./res $out/bin/res
# Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml
# so the cmake presets resolve the same set of headers as CI.
linuxDevDeps = [
# Compilers / linkers
pkgs.clang
pkgs.lld
# C/C++ utilities
pkgs.curl
pkgs.openssl
pkgs.zlib
pkgs.libpng
pkgs.libjpeg_turbo
pkgs.freetype
pkgs.zstd
pkgs.fmt
pkgs.tracy
pkgs.cxxopts
pkgs.abseil-cpp
pkgs.sdl3
pkgs.ncurses
pkgs.libunwind
pkgs.libusb1
pkgs.fuse
# Wayland / display server
mkdir -p $out/share/applications
cp $src/platforms/freedesktop/dusklight.desktop $out/share/applications/dusklight.desktop
for size in 16 32 48 64 128 256 512 1024; do
install -Dm644 $src/platforms/freedesktop/''${size}x''${size}/apps/dusklight.png \
$out/share/icons/hicolor/''${size}x''${size}/apps/dusklight.png
done
'';
nativeBuildInputs = [
pkgs.cmake
pkgs.pkg-config
pkgs.wayland
pkgs.wayland-protocols
pkgs.libxkbcommon
pkgs.libdecor
# OpenGL / Vulkan
];
buildInputs = [
pkgs.libGL
pkgs.libGLU
pkgs.libglvnd
pkgs.vulkan-headers
pkgs.vulkan-loader
# X11
pkgs.libX11
pkgs.libxcb
pkgs.libXcursor
pkgs.libxi
pkgs.libxcb
pkgs.libxrandr
pkgs.libxscrnsaver
pkgs.libxtst
pkgs.libxinerama
# Audio
pkgs.alsa-lib
pkgs.libpulseaudio
pkgs.pipewire
# System integration
pkgs.dbus
pkgs.udev
pkgs.gtk3
pkgs.libjpeg8
pkgs.libxkbcommon
pkgs.libglvnd
pkgs.cxxopts
pkgs.abseil-cpp
pkgs.sdl3
pkgs.fmt
pkgs.tracy
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;
in
{
packages = lib.mapAttrs (_: s: s.packages) systems;
devShells = lib.mapAttrs (_: s: s.devShells) systems;
# Tooling common to every supported host (Linux and macOS).
commonDevTools = pkgs: [
pkgs.cmake
pkgs.ninja
pkgs.pkg-config
pkgs.git
pkgs.python3
pkgs.python3Packages.markupsafe
pkgs.rustc
pkgs.cargo
pkgs.sccache
];
# Linux-only system libraries — mirrors the apt deps from .github/workflows/build.yml
# so the cmake presets resolve the same set of headers as CI.
linuxDevDeps = pkgs: [
# Compilers / linkers
pkgs.clang
pkgs.lld
# C/C++ utilities
pkgs.curl
pkgs.openssl
pkgs.zlib
pkgs.libpng
pkgs.libjpeg_turbo
pkgs.freetype
pkgs.zstd
pkgs.fmt
pkgs.tracy
pkgs.cxxopts
pkgs.abseil-cpp
pkgs.sdl3
pkgs.ncurses
pkgs.libunwind
pkgs.libusb1
pkgs.fuse
# Wayland / display server
pkgs.wayland
pkgs.wayland-protocols
pkgs.libxkbcommon
pkgs.libdecor
# OpenGL / Vulkan
pkgs.libGL
pkgs.libGLU
pkgs.libglvnd
pkgs.vulkan-headers
pkgs.vulkan-loader
# X11
pkgs.libX11
pkgs.libxcb
pkgs.libXcursor
pkgs.libxi
pkgs.libxrandr
pkgs.libxscrnsaver
pkgs.libxtst
pkgs.libxinerama
# Audio
pkgs.alsa-lib
pkgs.libpulseaudio
pkgs.pipewire
# System integration
pkgs.dbus
pkgs.udev
pkgs.gtk3
];
# On macOS we deliberately avoid pulling Nix's cc-wrapper so CMake picks up
# Apple Clang and the Xcode SDK directly, matching the macOS CI workflow.
mkDarwinShell = pkgs:
pkgs.mkShellNoCC {
packages = commonDevTools pkgs;
shellHook = ''
echo "Dusklight dev shell (macOS)"
echo "Requires Xcode Command Line Tools for Apple Clang and the macOS SDK."
echo "Configure: cmake --preset macos-default-relwithdebinfo"
echo "Build: cmake --build --preset macos-default-relwithdebinfo"
'';
};
mkLinuxShell = pkgs:
pkgs.mkShell {
packages = (commonDevTools pkgs) ++ (linuxDevDeps pkgs);
shellHook = ''
echo "Dusklight dev shell (Linux)"
echo "Configure: cmake --preset linux-default-relwithdebinfo"
echo " cmake --preset linux-clang-relwithdebinfo"
echo "Build: cmake --build --preset <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);
});
};
}
}
+23 -1
View File
@@ -1733,6 +1733,9 @@ public:
int checkNewItemChange(u8 i_selItemIdx);
void deleteEquipItem(BOOL i_isPlaySound, BOOL i_isDeleteKantera);
void setLight();
#if TARGET_PC
void setGhostLanternLight();
#endif
void setFrontRollCrashShock(u8);
void changeWarpMaterial(daAlink_c::daAlink_WARP_MAT_MODE i_matMode);
void commonProcInit(daAlink_c::daAlink_PROC i_procID);
@@ -2656,8 +2659,14 @@ public:
void checkWaterInKandelaar(f32);
void offKandelaarModel();
int kandelaarModelCallBack();
int ghostLanternModelCallBack();
BOOL checkKandelaarEquipAnime() const;
void preKandelaarDraw();
void preGhostLanternDraw();
static void* srchPoe(void*, void*);
#if TARGET_PC
void setGhostLanternModel();
#endif
void setKandelaarModel();
void resetOilBottleModel();
void commonKandelaarPourInit();
@@ -3977,6 +3986,9 @@ public:
/* 0x006FC */ J3DModel* mpKanteraModel;
/* 0x00700 */ J3DModel* mpKanteraGlowModel;
/* 0x00704 */ J3DAnmTextureSRTKey* mpKanteraGlowBtk;
/* 0x006FC */ J3DModel* mpGhostLanternModel;
/* 0x00700 */ J3DModel* mpGhostLanternGlowModel;
/* 0x00704 */ J3DAnmTextureSRTKey* mpGhostLanternGlowBtk;
/* 0x00708 */ J3DModel* mHeldItemModel;
/* 0x0070C */ J3DModel* mpHookTipModel; // related to held item
/* 0x00710 */ J3DModel* field_0x0710; // related to held item
@@ -4373,6 +4385,7 @@ public:
/* 0x03194 */ int field_0x3194;
/* 0x03198 */ int field_0x3198;
/* 0x0319C */ int field_0x319c;
/* 0x0319C */ s32 ghostLanternFlameEffect[2];
/* 0x031A0 */ u32 mModeFlg;
/* 0x031A4 */ int field_0x31a4;
/* 0x031A8 */ u32 field_0x31a8[2];
@@ -4442,6 +4455,9 @@ public:
/* 0x033F4 */ f32 field_0x33f4;
/* 0x033F8 */ f32 field_0x33f8;
/* 0x033FC */ f32 field_0x33fc;
#if TARGET_PC
/* 0x033FC */ f32 current_ghost_lantern_light_power;
#endif
/* 0x03400 */ f32 field_0x3400;
/* 0x03404 */ f32 field_0x3404;
/* 0x03408 */ f32 field_0x3408;
@@ -4509,9 +4525,13 @@ public:
/* 0x035F4 */ cXyz mMidnaAtnPos;
/* 0x03600 */ cXyz mMidnaHairAtnPos;
/* 0x0360C */ cXyz mKandelaarFlamePos;
/* 0x0360C */ cXyz mGhostLanternFlamePos;
/* 0x03618 */ cXyz field_0x3618;
/* 0x03624 */ cXyz field_0x3624;
/* 0x03630 */ cXyz field_0x3630;
/* 0x03618 */ cXyz ghost_lantern_0x3618;
/* 0x03624 */ cXyz ghost_lantern_0x3624;
/* 0x03630 */ cXyz ghost_lantern_0x3630;
/* 0x0363C */ cXyz field_0x363c[4];
/* 0x0366C */ cXyz field_0x366c[4];
/* 0x0369C */ cXyz field_0x369c;
@@ -4564,7 +4584,6 @@ public:
cXyz mIBChainInterpCurrHandRoot;
bool mIBChainInterpPrevValid;
bool mIBChainInterpCurrValid;
bool mIsRollstab = false;
#endif
}; // Size: 0x385C
@@ -6822,6 +6841,9 @@ public:
static daAlinkHIO_boom_c0 const mBoomerang;
static daAlinkHIO_bomb_c0 const mBomb;
static daAlinkHIO_huLight_c0 const mLanternPL;
#if TARGET_PC
static daAlinkHIO_huLight_c0 const mGhostLanternPL;
#endif
static daAlinkHIO_kandelaar_c0 const mLantern;
static daAlinkHIO_fmChain_c0 const mFmChain;
static daAlinkHIO_magneBoots_c0 const mIronBoots;
-2
View File
@@ -5,7 +5,6 @@
#include <thp.h>
#else
#include <atomic>
#include <chrono>
#endif
#include "f_op/f_op_actor.h"
#include "d/d_drawlist.h"
@@ -126,7 +125,6 @@ struct daMP_THPPlayer {
/* 0x0D4 */ s32 curCount;
#if TARGET_PC
/* 0x0D8 */ std::atomic<s32> videoDecodeCount;
std::chrono::steady_clock::time_point thpPlaybackClock;
#else
/* 0x0D8 */ s32 videoDecodeCount;
#endif
+1 -1
View File
@@ -77,7 +77,7 @@ private:
#define PLAYER_CREATE_ANM_HEAP_F(heap, type, fmt, ...) \
{ \
char pcah_name_buf[32]; \
snprintf(pcah_name_buf, sizeof(pcah_name_buf), fmt, ##__VA_ARGS__); \
sprintf(pcah_name_buf, fmt, ##__VA_ARGS__); \
(heap).createHeap(type, pcah_name_buf); \
\
}
+12 -10
View File
@@ -444,7 +444,8 @@ public:
/* 0x1C */ f32 mFovy;
/* 0x20 */ f32 mBank;
/* 0x24 */ fopAc_ac_c* mRelActor;
/* 0x28 */ char mRelUseMask[4];
/* 0x28 */ char mRelUseMask;
/* 0x29 */ char field_0x29;
/* 0x2C */ int mTimer;
/* 0x30 */ bool field_0x30;
/* 0x34 */ cXyz mBasePos;
@@ -525,7 +526,7 @@ public:
/* 0x3C */ fopAc_ac_c* field_0x3c;
/* 0x40 */ fopAc_ac_c* field_0x40;
/* 0x44 */ fpc_ProcID field_0x44;
/* 0x48 */ char field_0x48[4];
/* 0x48 */ char field_0x48;
/* 0x4C */ int field_0x4c;
};
@@ -540,7 +541,11 @@ public:
/* 0x3C */ f32 field_0x3c;
/* 0x40 */ fopAc_ac_c* mRelActor;
/* 0x44 */ fpc_ProcID mRelActorID;
/* 0x48 */ char mRelUseMask[8];
/* 0x48 */ char mRelUseMask;
/* 0x49 */ char field_0x49;
/* 0x4A */ char field_0x4a;
/* 0x4B */ char field_0x4b;
/* 0x4C */ u8 field_0x4c[4];
/* 0x50 */ int mTimer;
/* 0x54 */ int mTransType;
/* 0x58 */ f32 mCushion;
@@ -691,7 +696,8 @@ public:
/* 0x24 */ f32* field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2C */ fopAc_ac_c* mRelActor;
/* 0x30 */ char mRelUseMask[4];
/* 0x30 */ char mRelUseMask;
/* 0x31 */ char field_0x31;
/* 0x34 */ int mTimer;
/* 0x38 */ int field_0x38;
/* 0x3C */ int mChoice;
@@ -774,7 +780,8 @@ public:
/* 0xAC */ f32 field_0xac;
/* 0xB0 */ fopAc_ac_c* mRelActor;
/* 0xB4 */ fpc_ProcID mRelActorID;
/* 0xB8 */ char mRelUseMask[4];
/* 0xB8 */ char mRelUseMask;
/* 0xB9 */ char field_0xb9;
/* 0xBC */ f32 mCushion;
/* 0xC0 */ u32 field_0xc0[6];
};
@@ -910,12 +917,7 @@ public:
char* getEvStringPntData(char*, char*);
char* getEvStringPntData(char*);
bool getEvXyzData(cXyz*, char*, cXyz);
#if TARGET_PC
template<size_t N>
bool getEvStringData(char (&)[N], char*, char*);
#else
bool getEvStringData(char*, char*, char*);
#endif
fopAc_ac_c* getEvActor(char*);
fopAc_ac_c* getEvActor(char*, char*);
bool pauseEvCamera();
+2 -2
View File
@@ -1851,7 +1851,7 @@ inline u16 dComIfGs_getDeathCount() {
}
#endif
inline TEXT_SPAN dComIfGs_getPlayerName() {
inline char* dComIfGs_getPlayerName() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getPlayerName();
}
@@ -1859,7 +1859,7 @@ inline void dComIfGs_setPlayerName(const char* i_name) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().setPlayerName(i_name);
}
inline TEXT_SPAN dComIfGs_getHorseName() {
inline char* dComIfGs_getHorseName() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerInfo().getHorseName();
}
+4 -4
View File
@@ -46,10 +46,10 @@ private:
/* 0x22 */ u8 field_0x22;
/* 0x24 */ CPaneMgrAlpha* mDatBase;
/* 0x28 */ CPaneMgrAlpha* mNoDatBase;
/* 0x2C */ TEXT_SPAN mPlayerName;
/* 0x30 */ TEXT_SPAN mSaveDate;
/* 0x34 */ TEXT_SPAN mPlayTime;
/* 0x38 */ TEXT_SPAN mSaveStatus;
/* 0x2C */ char* mPlayerName;
/* 0x30 */ char* mSaveDate;
/* 0x34 */ char* mPlayTime;
/* 0x38 */ char* mSaveStatus;
};
typedef void (dFile_info_c::*warningFunc)(void);
+3 -38
View File
@@ -11,42 +11,7 @@
class dFile_info_c;
class J2DPicture;
#if TARGET_PC
static bool cachedPanes = false;
struct PaneCache {
u64 tag;
f32 origTransX;
f32 origTransY;
bool cached;
};
static PaneCache mSelDtPanes[] = {
{MULTI_CHAR('tate_n0'), 0.0f, false},
{MULTI_CHAR('tate_n1'), 0.0f, false},
{MULTI_CHAR('ken_n0'), 0.0f, false},
{MULTI_CHAR('ken_n1'), 0.0f, false},
{MULTI_CHAR('fuku_n0'), 0.0f, false},
{MULTI_CHAR('fuku_n1'), 0.0f, false},
{MULTI_CHAR('fuku_n2'), 0.0f, false},
{MULTI_CHAR('gray_n'), 0.0f, false},
{MULTI_CHAR('b_base'), 0.0f, false},
{MULTI_CHAR('b_base1'), 0.0f, false},
};
static PaneCache fileSelPanes[] = {
{MULTI_CHAR('w_uzu00'), 0.0f, false},
{MULTI_CHAR('w_uzu01'), 0.0f, false},
{MULTI_CHAR('w_uzu02'), 0.0f, false},
{MULTI_CHAR('w_uzu03'), 0.0f, false},
{MULTI_CHAR('w_uzu04'), 0.0f, false},
{MULTI_CHAR('w_uzu05'), 0.0f, false},
{MULTI_CHAR('w_uzu06'), 0.0f, false},
{MULTI_CHAR('w_uzu07'), 0.0f, false},
{MULTI_CHAR('w_uzu08'), 0.0f, false},
{MULTI_CHAR('w_uzu09'), 0.0f, false},
};
#endif
class dDlst_FileSel_c : public dDlst_base_c {
public:
void draw();
@@ -565,7 +530,7 @@ public:
/* 0x0130 */ int field_0x0130;
/* 0x0134 */ int field_0x0134;
/* 0x0138 */ CPaneMgrAlpha* mErrorMsgTxtPane[2];
/* 0x0140 */ TEXT_SPAN mErrorMsgStringPtr[2];
/* 0x0140 */ char* mErrorMsgStringPtr[2];
/* 0x0148 */ u8 mErrorTxtDispIdx;
/* 0x0149 */ u8 field_0x0149;
/* 0x014A */ bool field_0x014a;
@@ -609,7 +574,7 @@ public:
/* 0x020A */ u8 mFadeTimer;
/* 0x020B */ u8 field_0x020b;
/* 0x020C */ CPaneMgrAlpha* mHeaderTxtPane[2];
/* 0x0214 */ TEXT_SPAN mHeaderStringPtr[2];
/* 0x0214 */ char* mHeaderStringPtr[2];
/* 0x021C */ u8 mHeaderTxtDispIdx;
/* 0x021D */ u8 field_0x021d;
/* 0x021E */ u8 field_0x021e;
@@ -626,7 +591,7 @@ public:
/* 0x024B */ u8 field_0x024b;
/* 0x024C */ u8 field_0x024c;
/* 0x024B */ u8 field_0x024d[3];
/* 0x0250 */ TEXT_SPAN mModoruStringPtr;
/* 0x0250 */ char* mModoruStringPtr;
/* 0x0254 */ STControl* stick;
/* 0x0258 */ u8 mIsDataNew[3];
/* 0x025B */ u8 mIsNoData[3];
+2
View File
@@ -71,6 +71,7 @@ void item_func_WOOD_STICK();
void item_func_BOOMERANG();
void item_func_SPINNER();
void item_func_IRONBALL();
void item_func_GHOST_LANTERN();
void item_func_BOW();
void item_func_HOOKSHOT();
void item_func_HVY_BOOTS();
@@ -260,6 +261,7 @@ int item_getcheck_func_WOOD_STICK();
int item_getcheck_func_BOOMERANG();
int item_getcheck_func_SPINNER();
int item_getcheck_func_IRONBALL();
int item_getcheck_func_GHOST_LANTERN();
int item_getcheck_func_BOW();
int item_getcheck_func_HOOKSHOT();
int item_getcheck_func_HVY_BOOTS();
+1 -1
View File
@@ -317,7 +317,7 @@ enum {
/* 0xDE */ dItemNo_NOENTRY_222_e,
/* 0xDF */ dItemNo_NOENTRY_223_e,
/* 0xE0 */ dItemNo_POU_SPIRIT_e,
/* 0xE1 */ dItemNo_NOENTRY_225_e,
/* 0xE1 */ dItemNo_GHOST_LANTERN_e,
/* 0xE2 */ dItemNo_NOENTRY_226_e,
/* 0xE3 */ dItemNo_NOENTRY_227_e,
/* 0xE4 */ dItemNo_NOENTRY_228_e,
-43
View File
@@ -15,49 +15,6 @@ class dMenu_Fishing_c;
class dMenu_Skill_c;
class dMenu_Insect_c;
class dSelect_cursor_c;
#if TARGET_PC
static bool cachedPanes = false;
struct PaneCache {
u64 tag;
f32 origTransX;
f32 origTransY;
bool cached;
};
static PaneCache mpScreenPanes[] = {
{MULTI_CHAR('sa_tex_n'), 0.0f, false},
{MULTI_CHAR('op_tex_n'), 0.0f, false},
{MULTI_CHAR('heart_n'), 0.0f, false},
{MULTI_CHAR('wolf_n'), 0.0f, false},
{MULTI_CHAR('item_0_n'), 0.0f, false},
{MULTI_CHAR('item_1_n'), 0.0f, false},
{MULTI_CHAR('item_2_n'), 0.0f, false},
{MULTI_CHAR('fish_3_n'), 0.0f, false},
{MULTI_CHAR('lett_4_n'), 0.0f, false},
{MULTI_CHAR('maki_5_n'), 0.0f, false},
{MULTI_CHAR('fuku_n0'), 0.0f, false},
{MULTI_CHAR('fuku_n1'), 0.0f, false},
{MULTI_CHAR('fuku_n2'), 0.0f, false},
{MULTI_CHAR('tate_n0'), 0.0f, false},
{MULTI_CHAR('tate_n1'), 0.0f, false},
{MULTI_CHAR('ken_n0'), 0.0f, false},
{MULTI_CHAR('ken_n1'), 0.0f, false},
{MULTI_CHAR('kabu_6n'), 0.0f, false},
{MULTI_CHAR('t_t00'), 0.0f, false},
{MULTI_CHAR('f_t00'), 0.0f, false},
{MULTI_CHAR('itemn_n'), 0.0f, false},
{MULTI_CHAR('infotxtn'), 0.0f, false},
{MULTI_CHAR('sa_op_n'), 0.0f, false},
{MULTI_CHAR('title_n'), 0.0f, false},
{MULTI_CHAR('menu_n'), 0.0f, false},
{MULTI_CHAR('w_er_n'), 0.0f, false},
{MULTI_CHAR('center_n'), 0.0f, false},
{MULTI_CHAR('info_n'), 0.0f, false},
{MULTI_CHAR('lavel_n'), 0.0f, false},
{MULTI_CHAR('modelbgn'), 0.0f, false},
};
#endif
class dMenu_Collect2D_c;
class dMenu_Collect2DTop_c : public dDlst_base_c {
-5
View File
@@ -183,11 +183,6 @@ public:
/* 0xDD8 */ u8 field_0xdd8;
/* 0xDD9 */ u8 field_0xdd9;
/* 0xDDA */ u8 field_0xdda;
#if TARGET_PC
J2DTextBox* mpPoeCountPane;
J2DPicture* mpPoeCountIcon;
#endif
};
class dMenu_Dmap_c {
-6
View File
@@ -421,12 +421,6 @@ public:
/* 0xC2 */ u8 mAlphaButtonZ;
/* 0xC3 */ u8 mAlphaAnalogStick;
/* 0xC4 */ u8 mAlphaDpad;
#if TARGET_PC
J2DTextBox* mpPoeCountPane;
J2DPicture* mpPoeCountIcon;
u8 mSelectRegionNo;
#endif
};
#endif /* D_MENU_D_MENU_FMAP2D_H */
-5
View File
@@ -76,11 +76,6 @@ public:
}
#endif
#if TARGET_PC
static void getDmapPoeCount(const std::string& stageName, int& nowCount, int& totalCount);
static void getFmapPoeCount(const int regionNo, int& nowCount, int& totalCount);
#endif
struct Stage_c {
// Incomplete class
+2 -2
View File
@@ -313,7 +313,7 @@ private:
/* 0x00B8 */ int field_0xb8;
/* 0x00BC */ int field_0xbc;
/* 0x00C0 */ CPaneMgrAlpha* mpErrTxtPane[2];
/* 0x00C8 */ TEXT_SPAN mpErrTxt[2];
/* 0x00C8 */ char* mpErrTxt[2];
/* 0x00D0 */ u8 mErrTxtType;
/* 0x00D1 */ u8 mErrTxtAnmComplete;
/* 0x00D2 */ u8 field_0xd2;
@@ -344,7 +344,7 @@ private:
/* 0x0160 */ J2DAnmTevRegKey* field_0x160;
/* 0x0164 */ int field_0x164;
/* 0x0168 */ CPaneMgrAlpha* mpHeaderTxtPane[2];
/* 0x0170 */ TEXT_SPAN mpHeaderTxt[2];
/* 0x0170 */ char* mpHeaderTxt[2];
/* 0x0178 */ u8 mHeaderTxtType; // 0: Select Menu 1: YesNo Menu
/* 0x0179 */ u8 mHeaderAnmComplete;
/* 0x017A */ u8 field_0x17a;
+2 -2
View File
@@ -86,8 +86,8 @@ public:
/* 0x047 */ u8 field_0x47;
/* 0x048 */ u8 mPoes;
/* 0x049 */ u8 mPoesCopy;
/* 0x04A */ u8 mItems[24];
/* 0x062 */ u8 mItemsCopy[24];
/* 0x04A */ u8 mItems[25];
/* 0x062 */ u8 mItemsCopy[25];
/* 0x07A */ u8 field_0x7a[24];
/* 0x092 */ u8 mSwords[4];
/* 0x096 */ u8 mShields[3];
+6 -6
View File
@@ -67,9 +67,9 @@ public:
s16 decFloatingMessageTimer();
void resetFloatingMessage();
void decMsgKeyWaitTimer();
void getString(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
void getStringKana(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
void getStringKanji(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
void getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry);
void getStringKana(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry);
void getStringKanji(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry);
f32 getStringLength(J2DTextBox* i_textbox, char* i_string);
f32 getStringLength(JUTFont* i_font, f32 param_2, f32 param_3, char* i_string);
void onDirectUseItem(int);
@@ -348,15 +348,15 @@ inline CPaneMgr* dMeter2Info_getMeterItemPanePtr(s32 i_idx) {
return g_meter2_info.getMeterItemPanePtr(i_idx);
}
inline void dMeter2Info_getString(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) {
inline void dMeter2Info_getString(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) {
g_meter2_info.getString(i_stringID, o_string, i_msgEntry);
}
inline void dMeter2Info_getStringKanji(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) {
inline void dMeter2Info_getStringKanji(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) {
g_meter2_info.getStringKanji(i_stringID, o_string, i_msgEntry);
}
inline void dMeter2Info_getStringKana(u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry) {
inline void dMeter2Info_getStringKana(u32 i_stringID, char* o_string, JMSMesgEntry_c* i_msgEntry) {
g_meter2_info.getStringKana(i_stringID, o_string, i_msgEntry);
}
+1 -2
View File
@@ -1,7 +1,6 @@
#ifndef D_METER_D_METER_BUTTON_H
#define D_METER_D_METER_BUTTON_H
#include "global.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "d/d_drawlist.h"
@@ -195,7 +194,7 @@ public:
/* 0x0FC */ CPaneMgr* field_0x0fc[4];
/* 0x10C */ JKRHeap* mpHeap;
/* 0x110 */ void* mpFishingTex;
/* 0x114 */ char mButtonText[2][DUSK_IF_ELSE(32, 15)];
/* 0x114 */ char mButtonText[2][15];
/* 0x132 */ u8 field_0x132[0x134 - 0x132];
/* 0x134 */ f32 field_0x134;
/* 0x138 */ f32 field_0x138;
+7 -8
View File
@@ -5,7 +5,6 @@
#include "JSystem/JMessage/JMessage.h"
#include "SSystem/SComponent/c_xyz.h"
#include "dusk/endian.h"
#include "dusk/string.hpp"
#if REGION_JPN
#define D_MSG_CLASS_PAGE_CNT_MAX 30
@@ -68,7 +67,7 @@ struct jmessage_tReference : public JMessage::TReference {
void pageSend();
void selectMessage();
void inputNumber();
TEXT_SPAN getWord(int);
char* getWord(int);
void resetWord();
void setCharactor(u16);
void addCharactor(u16);
@@ -229,11 +228,11 @@ struct jmessage_tReference : public JMessage::TReference {
f32 getSelRubyCharSpace() { return mSelRubyCharSpace; }
f32 getRubySize() { return mRubySize; }
f32 getRubyCharSpace() { return mRubyCharSpace; }
TEXT_SPAN getSelTextPtr(int idx) { return mSelText[idx]; }
TEXT_SPAN getSelRubyPtr(int idx) { return mSelRuby[idx]; }
TEXT_SPAN getTextPtr() { return mText; }
TEXT_SPAN getTextSPtr() { return mTextS; }
TEXT_SPAN getRubyPtr() { return mRuby; }
char* getSelTextPtr(int idx) { return mSelText[idx]; }
char* getSelRubyPtr(int idx) { return mSelRuby[idx]; }
char* getTextPtr() { return mText; }
char* getTextSPtr() { return mTextS; }
char* getRubyPtr() { return mRuby; }
u8 getSelectRubyFlag() { return mSelectRubyFlag; }
f32 getSelTBoxWidth() { return mSelTBoxWidth; }
u8 getSelectPos() { return mSelectPos; }
@@ -464,7 +463,7 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
f32 getLineLength(int);
void do_strcat(char*, bool, bool, bool);
void do_rubyset(void const*, u32);
void do_rubystrcat(char*, TEXT_SPAN, f32, f32);
void do_rubystrcat(char*, char*, f32, f32);
void do_name1();
void do_numset(s16);
void push_word();
+7 -7
View File
@@ -53,8 +53,8 @@ public:
void demoMessageGroupLocal();
void endFlowGroupLocal();
void changeGroupLocal(s16);
bool getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, TEXT_SPAN,
TEXT_SPAN, TEXT_SPAN, s16*);
bool getStringLocal(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, char*,
char*, char*, s16*);
bool isGetItemMessage();
bool isKanbanMessage();
bool isHowlMessage();
@@ -121,7 +121,7 @@ public:
static void endFlowGroup();
static void changeGroup(s16);
static bool getString(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*,
TEXT_SPAN, TEXT_SPAN, TEXT_SPAN, s16*);
char*, char*, char*, s16*);
static void* getMsgDtPtr();
static void setProcessID(fpc_ProcID);
static msg_class* getActor();
@@ -246,12 +246,12 @@ public:
static void setWord(const char* i_word);
void setWordLocal(const char* i_word) {
SAFE_STRCPY(mWord, i_word);
strcpy(mWord, i_word);
}
static void setSelectWord(int i_no, const char* i_word);
void setSelectWordLocal(int i_no, const char* i_word) {
SAFE_STRCPY(mSelectWord[i_no], i_word);
strcpy(mSelectWord[i_no], i_word);
}
jmessage_tSequenceProcessor* getSequenceProcessor() { return mpSeqProc; }
@@ -426,8 +426,8 @@ inline void dMsgObject_setTalkActor(fopAc_ac_c* actor) {
}
inline bool dMsgObject_getString(u32 i_msgId, J2DTextBox* i_tbox, J2DTextBox* i_rubyTbox,
JUTFont* i_font, COutFont_c* i_outFont, TEXT_SPAN o_text,
TEXT_SPAN o_ruby, TEXT_SPAN o_textS, s16* param_8) {
JUTFont* i_font, COutFont_c* i_outFont, char* o_text,
char* o_ruby, char* o_textS, s16* param_8) {
return dMsgObject_getMsgObjectClass()->getString(i_msgId, i_tbox, i_rubyTbox, i_font, i_outFont, o_text, o_ruby,
o_textS, param_8);
}
+2 -2
View File
@@ -20,12 +20,12 @@ public:
f32 getStringPageLocal(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*,
COutFont_c*, u8);
u8 getPageMax(int);
f32 getMessageLocal(u32, TEXT_SPAN);
f32 getMessageLocal(u32, char*);
virtual f32 getString(u32, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*, u8);
virtual f32 getStringPage(u32, u8, u8, J2DTextBox*, J2DTextBox*, JUTFont*, COutFont_c*,
u8);
virtual f32 getMessage(u32, TEXT_SPAN);
virtual f32 getMessage(u32, char*);
virtual void resetStringLocal(J2DTextBox*);
virtual void drawOutFontLocal(J2DTextBox*, f32);
virtual void drawFontLocal(J2DTextBox*, u8, f32, f32, f32, f32, u32, u8);
+2 -2
View File
@@ -6,14 +6,14 @@
class dMsgUnit_c {
public:
dMsgUnit_c();
void setTag(int, int, TEXT_SPAN, bool);
void setTag(int, int, char*, bool);
virtual ~dMsgUnit_c();
};
extern dMsgUnit_c g_msg_unit;
inline void dMsgUnit_setTag(int param_0, int param_1, TEXT_SPAN param_2) {
inline void dMsgUnit_setTag(int param_0, int param_1, char* param_2) {
g_msg_unit.setTag(param_0, param_1, param_2, true);
}
+3 -3
View File
@@ -127,7 +127,7 @@ public:
u8 isInputEnd() { return mIsInputEnd; }
char* getInputStrPtr() { return mInputStr; }
void hideIcon() { mSelIcon->setAlphaRate(0.0f); }
void setNextNameStr(char* i_name) { SAFE_STRCPY(mNextNameStr,i_name); }
void setNextNameStr(char* i_name) { strcpy(mNextNameStr,i_name); }
void draw() { _draw(); }
private:
@@ -140,9 +140,9 @@ private:
/* 0x02C */ J2DAnmTextureSRTKey* mCursorTexKey;
/* 0x030 */ int mCurTexAnmF;
/* 0x034 */ CPaneMgrAlpha* mNameCursor[8];
/* 0x054 */ TEXT_SPAN mNameText[8];
/* 0x054 */ char* mNameText[8];
/* 0x074 */ CPaneMgr* mMojiIcon[65];
/* 0x178 */ TEXT_SPAN mMojiText[65];
/* 0x178 */ char* mMojiText[65];
/* 0x27C */ J2DPane* mMojiPane;
/* 0x280 */ J2DPane* mMenuPane;
/* 0x284 */ CPaneMgr* mMenuIcon[4];
+5 -9
View File
@@ -488,25 +488,21 @@ public:
}
#if TARGET_PC
u16 getDeathCount() const { return mDeathCount; }
TEXT_SPAN getPlayerName() const { return const_cast<char(&)[17]>(mPlayerName); }
#else
char* getPlayerName() const { return const_cast<char*>(mPlayerName); }
#endif
char* getPlayerName() const { return const_cast<char*>(mPlayerName); }
void setPlayerName(const char* i_name) {
#if AVOID_UB
dusk::SafeStringCopyTruncate(mPlayerName, i_name);
strncpy(mPlayerName, i_name, sizeof(mPlayerName) - 1);
mPlayerName[sizeof(mPlayerName) - 1] = '\0';
#else
strcpy(mPlayerName, i_name);
#endif
}
#if TARGET_PC
TEXT_SPAN getHorseName() const { return const_cast<char(&)[17]>(mHorseName); }
#else
char* getHorseName() const { return const_cast<char*>(mHorseName); }
#endif
void setHorseName(const char* i_name) {
#if AVOID_UB
dusk::SafeStringCopyTruncate(mHorseName, i_name);
strncpy(mHorseName, i_name, sizeof(mHorseName) - 1);
mHorseName[sizeof(mHorseName) - 1] = '\0';
#else
strcpy(mHorseName, i_name);
#endif
+1 -1
View File
@@ -51,7 +51,7 @@ public:
f32 getPositionX() const { return mPositionX; }
f32 getPositionY() const { return mPositionY; }
void refreshAspectScale(f32 param_0);
void refreshAspectScale();
#endif
void onUpdateFlag() { mUpdateFlag = true; }
+1 -1
View File
@@ -1225,7 +1225,7 @@ public:
#endif
}
static JKRExpHeap* getMemoryBlockHeap(int i_no) { return mMemoryBlock[i_no]; }
static TEXT_SPAN getDemoArcName() { return mDemoArcName; }
static char* getDemoArcName() { return mDemoArcName; }
static void offNoChangeRoom() { mNoChangeRoom = false; }
static void onNoChangeRoom() { mNoChangeRoom = true; }
+2 -3
View File
@@ -5,7 +5,7 @@
#include <queue>
#include <string>
#include <string_view>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "nlohmann/json.hpp"
@@ -47,7 +47,6 @@ public:
// Signals are visible to all achievement checks within the same tick, then cleared.
void signal(const char* key);
bool hasSignal(const char* key) const;
int signalCount(const char* key) const;
std::vector<Achievement> getAchievements() const;
@@ -63,7 +62,7 @@ private:
void processEntry(Entry& e);
std::vector<Entry> m_entries;
std::unordered_map<std::string_view, int> m_signals;
std::unordered_set<std::string_view> m_signals;
bool m_loaded = false;
bool m_dirty = false;
};
-1
View File
@@ -5,7 +5,6 @@
#include <m_Do/m_Do_MemCardRWmng.h>
#include <m_Do/m_Do_MemCard.h>
#include <d/actor/d_a_alink.h>
void noAutoSave();
void triggerAutoSave();
-7
View File
@@ -1,7 +0,0 @@
#pragma once
namespace dusk::crash_handler {
void install();
} // namespace dusk::crash_handler
-22
View File
@@ -227,28 +227,6 @@ struct BE<Mtx> {
}
};
typedef f32 Mtx23[2][3];
template <>
struct BE<Mtx23> {
BE<f32> contents[2][3];
auto& operator[](int x) {
return contents[x];
}
auto& operator[](int x) const {
return contents[x];
}
void to_host(Mtx23& mtx) const {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
mtx[i][j] = contents[i][j];
}
}
}
};
template<typename T>
void be_swap(T& val) {
val = BE<T>::swap(val);
+1 -3
View File
@@ -4,7 +4,6 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "settings.h"
class camera_process_class;
class view_class;
@@ -18,8 +17,7 @@ void ensure_initialized();
void begin_record();
void end_record();
void begin_sim_tick();
uint64_t sim_tick_seq();
void begin_frame(FrameInterpMode mode, bool is_sim_frame, float step);
void begin_frame(bool enabled, bool is_sim_frame, float step);
void interpolate();
float get_interpolation_step();
-5
View File
@@ -30,11 +30,6 @@ public:
~FileStream();
/**
* \brief Flush buffered writes and throw if the flush fails.
*/
void Flush();
/**
* \brief Open a file for reading at the given path.
*/
-5
View File
@@ -12,7 +12,6 @@ namespace dusk {
void InitializeFileLogging(const std::filesystem::path& configDir, AuroraLogLevel logLevel);
void ShutdownFileLogging();
const char* GetLogFilePath();
int GetLogFileDescriptor();
void SendToStubLog(AuroraLogLevel level, const char* module, const char* message);
}
@@ -20,11 +19,7 @@ extern bool StubLogEnabled;
extern aurora::Module DuskLog;
#ifndef NDEBUG
#define STUB_LOG() DuskLog.debug("{} is a stub", __FUNCTION__)
#else
#define STUB_LOG()
#endif
#if TARGET_PC
#define STUB_RET(...) \
+3 -58
View File
@@ -15,17 +15,6 @@ enum class BloomMode : int {
Dusk = 2,
};
enum class DepthOfFieldMode : int {
Off = 0,
Classic = 1,
Dusk = 2,
};
enum class Resampler : int {
Bilinear = 0,
Area = 1,
};
enum class GameLanguage : u8 {
English = OS_LANGUAGE_ENGLISH,
German = OS_LANGUAGE_GERMAN,
@@ -45,18 +34,6 @@ enum class GyroMode : u8 {
Mouse = 1,
};
enum class FrameInterpMode : u8 {
Off = 0,
Capped = 1,
Unlimited = 2,
};
enum class MenuScaling : u8 {
GameCube = 0,
Wii = 1,
Dusklight = 2,
};
namespace config {
template <>
struct ConfigEnumRange<BloomMode> {
@@ -64,18 +41,6 @@ struct ConfigEnumRange<BloomMode> {
static constexpr auto max = BloomMode::Dusk;
};
template <>
struct ConfigEnumRange<DepthOfFieldMode> {
static constexpr auto min = DepthOfFieldMode::Off;
static constexpr auto max = DepthOfFieldMode::Dusk;
};
template <>
struct ConfigEnumRange<Resampler> {
static constexpr auto min = Resampler::Bilinear;
static constexpr auto max = Resampler::Area;
};
template <>
struct ConfigEnumRange<GameLanguage> {
static constexpr auto min = GameLanguage::English;
@@ -93,19 +58,7 @@ struct ConfigEnumRange<GyroMode> {
static constexpr auto min = GyroMode::Sensor;
static constexpr auto max = GyroMode::Mouse;
};
template <>
struct ConfigEnumRange<FrameInterpMode> {
static constexpr auto min = FrameInterpMode::Off;
static constexpr auto max = FrameInterpMode::Unlimited;
};
template <>
struct ConfigEnumRange<MenuScaling> {
static constexpr auto min = MenuScaling::GameCube;
static constexpr auto max = MenuScaling::Dusklight;
};
} // namespace config
}
// Persistent user settings
@@ -119,7 +72,6 @@ struct UserSettings {
ConfigVar<bool> lockAspectRatio;
ConfigVar<bool> enableFpsOverlay;
ConfigVar<int> fpsOverlayCorner;
ConfigVar<int> maxFrameRate;
} video;
struct {
@@ -157,7 +109,6 @@ struct UserSettings {
ConfigVar<bool> instantText;
ConfigVar<bool> sunsSong;
ConfigVar<bool> autoSave;
ConfigVar<bool> enhancedMapMenus;
// Preferences
ConfigVar<bool> enableMirrorMode;
@@ -167,18 +118,15 @@ struct UserSettings {
ConfigVar<bool> enableAchievementToasts;
ConfigVar<bool> enableControllerToasts;
ConfigVar<bool> enableDiscordPresence;
ConfigVar<MenuScaling> menuScalingMode;
// Graphics
ConfigVar<BloomMode> bloomMode;
ConfigVar<float> bloomMultiplier;
ConfigVar<DepthOfFieldMode> depthOfFieldMode;
ConfigVar<bool> disableWaterRefraction;
ConfigVar<bool> enableTextureReplacements;
ConfigVar<FrameInterpMode> enableFrameInterpolation;
ConfigVar<bool> enableFrameInterpolation;
ConfigVar<int> internalResolutionScale;
ConfigVar<int> shadowResolutionMultiplier;
ConfigVar<Resampler> resampler;
ConfigVar<bool> enableDepthOfField;
ConfigVar<bool> enableMapBackground;
ConfigVar<bool> disableCutscenePillarboxing;
@@ -202,8 +150,6 @@ struct UserSettings {
ConfigVar<bool> invertCameraYAxis;
ConfigVar<bool> invertFirstPersonXAxis;
ConfigVar<bool> invertFirstPersonYAxis;
ConfigVar<bool> invertAirSwimX;
ConfigVar<bool> invertAirSwimY;
ConfigVar<float> freeCameraSensitivity;
ConfigVar<bool> debugFlyCam;
ConfigVar<bool> debugFlyCamLockEvents;
@@ -240,7 +186,6 @@ struct UserSettings {
ConfigVar<bool> liveSplitEnabled;
ConfigVar<bool> showSpeedrunRTATimer;
ConfigVar<bool> recordingMode;
ConfigVar<bool> removeQuestMapMarkers;
ConfigVar<bool> showInputViewer;
ConfigVar<bool> showInputViewerGyro;
} game;
+28 -98
View File
@@ -1,55 +1,22 @@
#ifndef DUSK_STRING_HPP
#define DUSK_STRING_HPP
#include <cstdarg>
#include "global.h"
#include <cstring>
#include <dolphin/os.h>
namespace dusk {
struct TextSpan {
char* buffer;
size_t size;
constexpr operator char*() const {
return buffer;
}
constexpr TextSpan(char* buffer, size_t size) : buffer(buffer), size(size) { }
template<size_t BufSize>
constexpr TextSpan(char (&buffer)[BufSize]) : buffer(buffer), size(BufSize) {
}
constexpr TextSpan() : buffer(nullptr), size(0) { }
constexpr TextSpan operator++(int) {
const auto prev = *this;
if (size > 0) [[likely]] {
size--;
}
buffer++;
return prev;
}
constexpr char& operator*() const {
if (size == 0) [[unlikely]] {
CrashSpawnEmpty();
}
return *buffer;
}
private:
static void CrashSpawnEmpty();
};
#if TARGET_PC
#define TEXT_SPAN dusk::TextSpan
#else
#define TEXT_SPAN char*
inline void strncpyProxy(char* dst, const char* src, size_t count) {
#if _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
void SafeStringCopyTruncate(char* buffer, size_t bufSize, const char* src);
strncpy(dst, src, count);
#if _MSC_VER
#pragma warning(pop)
#endif
}
/**
* Copy a string to a fixed-size array.
@@ -58,28 +25,13 @@ void SafeStringCopyTruncate(char* buffer, size_t bufSize, const char* src);
template <size_t BufSize>
void SafeStringCopyTruncate(char (&buffer)[BufSize], const char* src) {
static_assert(BufSize > 0, "Target buffer cannot be size zero");
SafeStringCopyTruncate(buffer, BufSize, src);
}
void SafeStringCopy(char* buffer, size_t bufSize, const char* src);
void SafeStringCat(char* buffer, size_t bufSize, const char* src);
int SafeStringVPrintf(char* buffer, size_t bufSize, const char* src, std::va_list args);
if (buffer == src) {
CRASH("Cannot copy string to same buffer");
}
inline void SafeStringCopy(TextSpan dst, const char* src) {
SafeStringCopy(dst.buffer, dst.size, src);
}
inline void SafeStringCat(TextSpan dst, const char* src) {
SafeStringCat(dst.buffer, dst.size, src);
}
inline int SafeStringPrintf(TextSpan dst, const char* format, ...) {
std::va_list args;
va_start(args, format);
const auto ret = SafeStringVPrintf(dst.buffer, dst.size, format, args);
va_end(args);
return ret;
strncpyProxy(buffer, src, BufSize);
buffer[BufSize - 1] = 0;
}
/**
@@ -89,40 +41,18 @@ inline int SafeStringPrintf(TextSpan dst, const char* format, ...) {
template <size_t BufSize>
void SafeStringCopy(char (&buffer)[BufSize], const char* src) {
static_assert(BufSize > 0, "Target buffer cannot be size zero");
SafeStringCopy(buffer, BufSize, src);
if (buffer == src) {
CRASH("Cannot copy string to same buffer");
}
if (strlen(src) > BufSize - 1) {
CRASH("Destination buffer too small!");
}
strncpyProxy(buffer, src, BufSize);
buffer[BufSize - 1] = 0;
}
template <size_t BufSize>
void SafeStringCat(char (&buffer)[BufSize], const char* src) {
static_assert(BufSize > 0, "Target buffer cannot be size zero");
SafeStringCat(buffer, BufSize, src);
}
template <size_t BufSize>
int SafeStringPrintf(char (&buffer)[BufSize], const char* format, ...) {
static_assert(BufSize > 0, "Target buffer cannot be size zero");
std::va_list args;
va_start(args, format);
const auto ret = SafeStringVPrintf(buffer, BufSize, format, args);
va_end(args);
return ret;
}
#if TARGET_PC
#define SAFE_STRCPY dusk::SafeStringCopy
#define SAFE_STRCAT dusk::SafeStringCat
#define SAFE_SPRINTF dusk::SafeStringPrintf
#define SAFE_STRCPY_BOUNDED dusk::SafeStringCopy
#define SAFE_STRCAT_BOUNDED dusk::SafeStringCat
#else
#define SAFE_STRCPY strcpy
#define SAFE_STRCAT strcat
#define SAFE_SPRINTF sprintf
#define SAFE_STRCPY_BOUNDED strcpy
#define SAFE_STRCPY_BOUNDED strcat
#endif
}
#endif // DUSK_STRING_HPP
+4 -40
View File
@@ -17,24 +17,16 @@
#include <shellapi.h>
#include <intrin.h>
#endif
#ifdef __APPLE__
#include <mach/mach_time.h>
#if defined(__x86_64__) || defined(__i386__)
#include <immintrin.h>
#endif
#endif
class Limiter {
public:
using duration_t = Uint64;
void Reset() {
m_oldTime = SDL_GetTicksNS();
}
void Reset() { m_oldTime = SDL_GetTicksNS(); }
duration_t Sleep(duration_t targetFrameTime) {
void Sleep(duration_t targetFrameTime) {
if (targetFrameTime == 0) {
return 0;
return;
}
const Uint64 start = SDL_GetTicksNS();
@@ -49,8 +41,6 @@ public:
}
}
Reset();
return adjustedSleepTime;
}
duration_t SleepTime(duration_t targetFrameTime) {
@@ -84,6 +74,7 @@ private:
if (!initialized || numSleeps++ % 1000 == 0) {
LARGE_INTEGER freq;
if (QueryPerformanceFrequency(&freq) == 0) {
DuskLog.warn("QueryPerformanceFrequency failed: {}", GetLastError());
return;
}
countPerNs = static_cast<double>(freq.QuadPart) / 1e9;
@@ -107,33 +98,6 @@ private:
#endif
} while (current.QuadPart - start.QuadPart < ticksToWait);
}
#elif defined (__APPLE__)
void NanoSleep(const duration_t duration) {
// Hybrid approach using Apple Mach
uint64_t start_mach = mach_absolute_time();
mach_timebase_info_data_t timebase_info;
mach_timebase_info(&timebase_info);
uint64_t total_mach_ticks = (duration * timebase_info.denom) / timebase_info.numer;
uint64_t target_mach = start_mach + total_mach_ticks;
uint64_t buffer_ns = 2'000'000ULL;
uint64_t buffer_mach_ticks = (buffer_ns * timebase_info.denom) / timebase_info.numer;
if (total_mach_ticks > buffer_mach_ticks) {
uint64_t sleep_until_mach = target_mach - buffer_mach_ticks;
mach_wait_until(sleep_until_mach);
}
while (mach_absolute_time() < target_mach) {
#if defined(__aarch64__) || defined(__arm__)
asm volatile("yield" ::: "memory"); // Hardware hint, not a scheduler hint.
#else
_mm_pause();
#endif
}
}
#else
void NanoSleep(const duration_t duration) { SDL_DelayPrecise(duration); }
#endif
+1 -1
View File
@@ -108,7 +108,7 @@ struct fopAcM_search_prm {
struct fOpAcm_HIO_entry_c : public mDoHIO_entry_c {
virtual ~fOpAcm_HIO_entry_c() {}
#if DEBUG && !TARGET_PC
#if DEBUG
void removeHIO(const fopAc_ac_c* i_this) { removeHIO(*i_this); }
void removeHIO(const fopAc_ac_c& i_this) { removeHIO(i_this.base); }
void removeHIO(const fopEn_enemy_c& i_this) { removeHIO(i_this.base); }
+1 -1
View File
@@ -50,7 +50,7 @@ fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_talkActor, u32 param_2
fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, u32 param_1);
fpc_ProcID fopMsgM_messageSetDemo(u32 i_msgidx);
msg_class* fopMsgM_SearchByID(fpc_ProcID i_id);
TEXT_SPAN fopMsgM_messageGet(TEXT_SPAN i_stringBuf, u32 i_msgId);
char* fopMsgM_messageGet(char* i_stringBuf, u32 i_msgId);
fpc_ProcID fop_Timer_create(s16 i_procName, u8 i_mode, u32 i_limitMs, u8 i_type, u8 param_4,
f32 param_5, f32 param_6, f32 param_7, f32 param_8,
fopMsgCreateFunc i_createFunc);
@@ -116,7 +116,7 @@ private:
*
*/
struct J2DIndTexMtxInfo {
/* 0x00 */ BE(Mtx23) mMtx;
/* 0x00 */ Mtx23 mMtx;
/* 0x18 */ s8 mScaleExp;
J2DIndTexMtxInfo& operator=(const J2DIndTexMtxInfo& other) {
@@ -4,7 +4,6 @@
#include "JSystem/J2DGraph/J2DMaterial.h"
#include "JSystem/J2DGraph/J2DPane.h"
#include "dusk/endian.h"
#include "dusk/string.hpp"
class J2DMaterial;
class JUTFont;
@@ -99,8 +98,7 @@ public:
void initiate(ResFONT const*, char const*, s16, J2DTextBoxHBinding,
J2DTextBoxVBinding);
void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
TEXT_SPAN getStringPtr() const;
dusk::TextSpan getSpan() const;
char* getStringPtr() const;
s32 setString(s16, char const*, ...);
s32 setString(char const*, ...);
@@ -1575,12 +1575,6 @@ struct J3DAlphaComp {
u8 getRef1() const { return mRef1; }
void load() const {
#ifdef AVOID_UB
if (mID > 255) {
J3DGDSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0);
return;
}
#endif
J3DGDSetAlphaCompare((GXCompare)getComp0(), mRef0, (GXAlphaOp)getOp(), (GXCompare)getComp1(), mRef1);
}
@@ -287,28 +287,28 @@ template <typename T>
class JASPoolAllocObject {
public:
#if TARGET_PC
static void* operator new(size_t n, JKRHeapToken) IF_DUSK(noexcept) {
static void* operator new(size_t n, JKRHeapToken) {
return operator new(n);
}
#endif
static void* operator new(size_t n) IF_DUSK(noexcept) {
static void* operator new(size_t n) {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
return memPool_.alloc(n);
}
static void* operator new(size_t n, void* ptr) IF_DUSK(noexcept) {
static void* operator new(size_t n, void* ptr) {
return ptr;
}
#if TARGET_PC
static void operator delete(void* ptr, size_t n, JKRHeapToken) IF_DUSK(noexcept) {
static void operator delete(void* ptr, size_t n, JKRHeapToken) {
operator delete(ptr, n);
}
#endif
static void operator delete(void* ptr, size_t n) IF_DUSK(noexcept) {
static void operator delete(void* ptr, size_t n) {
#if PLATFORM_GCN
JASMemPool<T>& memPool_ = getMemPool_();
#endif
@@ -402,28 +402,28 @@ template <typename T>
class JASPoolAllocObject_MultiThreaded {
public:
#if TARGET_PC
static void* operator new(size_t n, JKRHeapToken) IF_DUSK(noexcept) {
static void* operator new(size_t n, JKRHeapToken) {
return operator new(n);
}
#endif
static void* operator new(size_t n) IF_DUSK(noexcept) {
static void* operator new(size_t n) {
#if PLATFORM_GCN
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
#endif
return memPool_.alloc(n);
}
static void* operator new(size_t n, void* ptr) IF_DUSK(noexcept) {
static void* operator new(size_t n, void* ptr) {
return ptr;
}
#if TARGET_PC
static void operator delete(void* ptr, size_t n, JKRHeapToken) IF_DUSK(noexcept) {
static void operator delete(void* ptr, size_t n, JKRHeapToken) {
return operator delete(ptr, n);
}
#endif
static void operator delete(void* ptr, size_t n) IF_DUSK(noexcept) {
static void operator delete(void* ptr, size_t n) {
#if PLATFORM_GCN
JASMemPool_MultiThreaded<T>& memPool_ = getMemPool();
#endif
+15 -19
View File
@@ -237,11 +237,11 @@ enum class JKRHeapToken {
Dummy
};
inline void* operator new(size_t, JKRHeapToken, void* where) noexcept {
inline void* operator new(size_t, JKRHeapToken, void* where) {
return where;
}
inline void* operator new[](size_t, JKRHeapToken, void* where) noexcept {
inline void* operator new[](size_t, JKRHeapToken, void* where) {
return where;
}
@@ -264,21 +264,21 @@ inline void* operator new[](size_t, JKRHeapToken, void* where) noexcept {
#define JKR_HEAP_TOKEN_PARAM
#endif
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) IF_DUSK(noexcept);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) IF_DUSK(noexcept);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment);
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment);
// On PC, these new[] overloads are only used to catch usages of JKR_NEW with [].
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment) IF_DUSK(noexcept);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) IF_DUSK(noexcept);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, int alignment);
void* operator new[](size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment);
void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept);
void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept);
void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM);
void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM);
#if TARGET_PC
template<typename T>
void jkrDelete(T* ptr) IF_DUSK(noexcept) {
void jkrDelete(T* ptr) {
if (ptr == nullptr) {
return;
}
@@ -298,7 +298,7 @@ void jkrDelete(T* ptr) IF_DUSK(noexcept) {
}
template<>
inline void jkrDelete(void* ptr) IF_DUSK(noexcept) {
inline void jkrDelete(void* ptr) {
if (ptr == nullptr) {
return;
}
@@ -322,7 +322,7 @@ constexpr bool newArgsHasCustomAlignment() {
}
template<typename T, typename... Args>
T* jkrNewArray(size_t count, std::in_place_type_t<T>, Args&&... args) IF_DUSK(noexcept) {
T* jkrNewArray(size_t count, std::in_place_type_t<T>, Args&&... args) {
size_t allocSize = count * sizeof(T);
if constexpr (!std::is_trivially_destructible<T>()) {
static_assert(
@@ -333,10 +333,6 @@ T* jkrNewArray(size_t count, std::in_place_type_t<T>, Args&&... args) IF_DUSK(no
}
void* ptr = operator new(allocSize, JKRHeapToken::Dummy, args...);
if (!ptr) {
return nullptr;
}
T* dataPtr;
if constexpr (!std::is_trivially_destructible<T>()) {
auto length = static_cast<size_t*>(ptr);
@@ -356,7 +352,7 @@ T* jkrNewArray(size_t count, std::in_place_type_t<T>, Args&&... args) IF_DUSK(no
}
template<typename T>
void jkrDeleteArray(T* pointer) IF_DUSK(noexcept) {
void jkrDeleteArray(T* pointer) {
if (pointer == nullptr) {
return;
}
@@ -376,7 +372,7 @@ void jkrDeleteArray(T* pointer) IF_DUSK(noexcept) {
}
template<>
inline void jkrDeleteArray(void* pointer) IF_DUSK(noexcept) {
inline void jkrDeleteArray(void* pointer) {
if (pointer == nullptr) {
return;
}
@@ -8,8 +8,6 @@
#include <cstring>
#include <types.h>
#include "dusk/string.hpp"
J2DMaterialFactory::J2DMaterialFactory(J2DMaterialBlock const& param_0) {
mMaterialNum = param_0.field_0x8;
mpMaterialInitData = JSUConvertOffsetToPtr<J2DMaterialInitData>(&param_0, param_0.field_0xc);
@@ -94,7 +92,7 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
}
if (local_380 == NULL && J2DScreen::getDataManage() != NULL) {
char acStack_230[257];
SAFE_STRCPY(acStack_230, param_3->getName(texNo));
strcpy(acStack_230, param_3->getName(texNo));
local_380 = J2DScreen::getDataManage()->get(acStack_230);
}
}
@@ -113,7 +111,7 @@ J2DMaterial* J2DMaterialFactory::create(J2DMaterial* param_0, int index, u32 par
}
if (local_388 == NULL && J2DScreen::getDataManage() != NULL) {
char acStack_334[257];
SAFE_STRCPY(acStack_334, param_4->getName(param_0->getTevBlock()->getFontNo()));
strcpy(acStack_334, param_4->getName(param_0->getTevBlock()->getFontNo()));
local_388 = J2DScreen::getDataManage()->get(acStack_334);
}
}
-6
View File
@@ -68,14 +68,8 @@ void J2DIndTevStage::load(u8 tevStage) {
}
void J2DIndTexMtx::load(u8 indTexMtx) {
#ifdef TARGET_PC
Mtx23 mtx;
mIndTexMtxInfo.mMtx.to_host(mtx);
GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + indTexMtx), mtx, mIndTexMtxInfo.mScaleExp);
#else
GXSetIndTexMtx((GXIndTexMtxID)(GX_ITM_0 + indTexMtx), mIndTexMtxInfo.mMtx,
mIndTexMtxInfo.mScaleExp);
#endif
}
void J2DIndTexCoordScale::load(u8 indTexStage) {
+2 -6
View File
@@ -309,12 +309,8 @@ void J2DTextBox::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBind)
}
}
TEXT_SPAN J2DTextBox::getStringPtr() const {
#if TARGET_PC
return { mStringPtr, mStringLength };
#else
char* J2DTextBox::getStringPtr() const {
return mStringPtr;
#endif
}
s32 J2DTextBox::setString(char const* string, ...) {
@@ -334,7 +330,7 @@ s32 J2DTextBox::setString(char const* string, ...) {
if (mStringPtr) {
mStringLength = len + 1;
SAFE_STRCPY_BOUNDED(mStringPtr, mStringLength, string);
strcpy(mStringPtr, string);
}
va_end(args);
+1 -3
View File
@@ -2,8 +2,6 @@
#include <JSystem/JUtility/JUTAssert.h>
#include <cstring>
#include "dusk/string.hpp"
u32 JAHVirtualNode::smVirNodeNum;
void JAHVirtualNode::virtualMessage(JAHControl& control) {
@@ -79,7 +77,7 @@ void JAHVirtualNode::setVirNodeName(const char* name) {
// clang-format off
JUT_ASSERT(141, size<32);
// clang-format on
SAFE_STRCPY(mName, name);
strcpy(mName, name);
}
JAHVirtualNode::JAHVirtualNode(const char* name) : mTree(this) {
+1 -3
View File
@@ -4,9 +4,7 @@
#include "JSystem/JAHostIO/JAHioMessage.h"
#include "JSystem/JAHostIO/JAHioMgr.h"
#include "JSystem/JAHostIO/JAHioNode.h"
#include "JSystem/JHostIO/JORServer.h"
#include "dusk/string.hpp"
JAHioNode* JAHioNode::smCurrentNode;
@@ -34,7 +32,7 @@ void JAHioNode::updateNode() {
void JAHioNode::setNodeName(const char* name) {
int size = strlen(name) + 1;
JUT_ASSERT(51, size < 32);
SAFE_STRCPY(mName, name);
strcpy(mName, name);
}
void JAHioNode::genMessage(JORMContext* mctx) {
@@ -9,8 +9,6 @@
#include <os.h>
#include <stdint.h>
#include "dusk/string.hpp"
JASHeap* JASWaveArcLoader::sAramHeap;
JASHeap* JASWaveArcLoader::getRootHeap() {
@@ -24,7 +22,7 @@ char JASWaveArcLoader::sCurrentDir[DIR_MAX] = "/AudioRes/Waves/";
void JASWaveArcLoader::setCurrentDir(char const* dir) {
JUT_ASSERT(40, std::strlen(dir) < DIR_MAX - 1);
SAFE_STRCPY(sCurrentDir, dir);
strcpy(sCurrentDir, dir);
u32 len = strlen(sCurrentDir);
if (sCurrentDir[len - 1] != '/') {
JUT_ASSERT(45, len + 1 < DIR_MAX);
@@ -172,8 +170,8 @@ void JASWaveArc::setFileName(char const* fileName) {
length = length + strlen(fileName);
char* path = JKR_NEW_ARRAY_ARGS(char, length + 1, JASKernel::getSystemHeap(), -4);
JUT_ASSERT(322, path);
SAFE_STRCPY_BOUNDED(path, length + 1, currentDir);
SAFE_STRCAT_BOUNDED(path, length + 1, fileName);
strcpy(path, currentDir);
strcat(path, fileName);
path[length] = '\0';
int entryNum = DVDConvertPathToEntrynum(path);
JKR_DELETE_ARRAY(path);
+7 -7
View File
@@ -370,28 +370,28 @@ constexpr auto FRAME_PERIOD = std::chrono::duration_cast<std::chrono::nanosecond
constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2;
static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) {
const auto sleepTime = limiter.Sleep(targetNs);
const auto sleepTime = limiter.SleepTime(targetNs);
dusk::frameUsagePct =
100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs));
limiter.Sleep(targetNs);
}
#endif
static void waitForTick(u32 p1, u16 p2) {
#if TARGET_PC
static Limiter limiter;
if (dusk::frame_interp::is_enabled() && !dusk::getTransientSettings().skipFrameRateLimit) {
dusk::frameUsagePct = 0.f;
return;
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
dusk::frameUsagePct = 0.f;
return;
}
if (dusk::getTransientSettings().skipFrameRateLimit) {
p1 = OS_TIMER_CLOCK / 120;
}
#if TARGET_PC
if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) {
return;
}
#endif
ZoneScopedC(tracy::Color::DimGray);
#endif
@@ -8,7 +8,6 @@
#include <cctype>
#include <cstring>
#include "dusk/string.hpp"
#include "global.h"
JKRFileCache* JKRFileCache::mount(const char* path, JKRHeap* heap, const char* param_3) {
+2 -3
View File
@@ -4,11 +4,10 @@
#define MSL_USE_INLINES 1 // needed to inline tolower call. not inlined elsewhere in the repo
#include <cctype>
#include <cstring>
#include <cctype>
#include <string>
#include "JSystem/JKernel/JKRHeap.h"
#include "dusk/string.hpp"
#include "global.h"
JKRFileLoader* JKRFileLoader::sCurrentVolume;
@@ -105,7 +104,7 @@ const char* JKRFileLoader::fetchVolumeName(char* buffer, s32 bufferSize, const c
static char rootPath[2] = "/";
if (strcmp(path, "/") == 0) {
SAFE_STRCPY_BOUNDED(buffer, bufferSize, rootPath);
strcpy(buffer, rootPath);
return rootPath;
}
+8 -8
View File
@@ -559,7 +559,7 @@ void* operator new(size_t size) {
return JKRHeap::alloc(size, 4, NULL);
}
#else
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM) noexcept {
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM) {
if (sCurrentHeap == NULL) {
return fallback_alloc(size, 0, false);
}
@@ -576,7 +576,7 @@ void* operator new(size_t size, int alignment) {
return JKRHeap::alloc(size, alignment, NULL);
}
#else
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) noexcept {
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) {
void* mem = JKRHeap::alloc(size, alignment, nullptr);
if (mem == nullptr) {
return fallback_alloc(size, abs(alignment), true);
@@ -585,7 +585,7 @@ void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, int alignment) noexcept {
}
#endif
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) IF_DUSK(noexcept) {
void* operator new(size_t size JKR_HEAP_TOKEN_PARAM, JKRHeap* heap, int alignment) {
void* mem = JKRHeap::alloc(size, alignment, heap);
#if TARGET_PC
if (mem == nullptr) {
@@ -600,7 +600,7 @@ void* operator new[](size_t size) {
return JKRHeap::alloc(size, 4, NULL);
}
#else
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept) {
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM) {
OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead");
}
#endif
@@ -610,12 +610,12 @@ void* operator new[](size_t size, int alignment) {
return JKRHeap::alloc(size, alignment, NULL);
}
#else
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, int) IF_DUSK(noexcept) {
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, int) {
OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead");
}
#endif
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, JKRHeap*, int) IF_DUSK(noexcept) {
void* operator new[](size_t JKR_HEAP_TOKEN_PARAM, JKRHeap*, int) {
OSPanic(__FILE__, __LINE__, "Allocation should go through JKR_NEW_ARRAY instead");
}
@@ -624,7 +624,7 @@ void operator delete(void* ptr) {
JKRHeap::free(ptr, NULL);
}
#else
void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept) {
void operator delete(void* ptr JKR_HEAP_TOKEN_PARAM) {
if (ptr == NULL)
return;
JKRHeap* heap = JKRHeap::findFromRoot(ptr);
@@ -645,7 +645,7 @@ void operator delete[](void* ptr) {
JKRHeap::free(ptr, NULL);
}
#else
void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) IF_DUSK(noexcept) {
void operator delete[](void* ptr JKR_HEAP_TOKEN_PARAM) {
if (ptr == NULL)
return;
JKRHeap* heap = JKRHeap::findFromRoot(ptr);
+1 -3
View File
@@ -7,8 +7,6 @@
#include "global.h"
#include <stdint.h>
#include "dusk/string.hpp"
#if TARGET_PC
#include "dusk/os.h"
#endif
@@ -276,7 +274,7 @@ void JKRThreadSwitch::draw(JKRThreadName_* thread_name_list, JUTConsole* console
if (!thread_print_name) {
char buffer[16];
SAFE_SPRINTF(buffer, "%d", loadInfo->getId());
sprintf(buffer, "%d", loadInfo->getId());
thread_print_name = buffer;
}
@@ -76,7 +76,6 @@ void JPARegistAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
}
void JPARegistPrmAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
ZoneScoped;
JPABaseEmitter* emtr = work->mpEmtr;
GXColor prm = ptcl->mPrmClr;
prm.r = COLOR_MULTI(prm.r, emtr->mGlobalPrmClr.r);
@@ -88,7 +87,6 @@ void JPARegistPrmAlpha(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
}
void JPARegistPrmAlphaEnv(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
ZoneScoped;
JPABaseEmitter* emtr = work->mpEmtr;
GXColor prm = ptcl->mPrmClr;
GXColor env = ptcl->mEnvClr;
@@ -227,7 +225,6 @@ void JPAGenTexCrdMtxPrj(JPAEmitterWorkData* param_0) {
}
void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData* work) {
ZoneScoped;
JPABaseShape* shape = work->mpRes->getBsp();
f32 dVar16 = work->mpEmtr->mTick;
f32 dVar15 = 0.5f * (1.0f + shape->getTilingS());
@@ -259,7 +256,6 @@ void JPAGenCalcTexCrdMtxAnm(JPAEmitterWorkData* work) {
}
void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
ZoneScoped;
JPABaseShape* shape = work->mpRes->getBsp();
f32 dVar16 = param_1->mAge;
f32 dVar15 = 0.5f * (1.0f + shape->getTilingS());
@@ -290,17 +286,14 @@ void JPALoadCalcTexCrdMtxAnm(JPAEmitterWorkData* work, JPABaseParticle* param_1)
}
void JPALoadTex(JPAEmitterWorkData* work) {
ZoneScoped;
work->mpResMgr->load(work->mpRes->getTexIdx(work->mpRes->getBsp()->getTexIdx()), GX_TEXMAP0);
}
void JPALoadTexAnm(JPAEmitterWorkData* work) {
ZoneScoped;
work->mpResMgr->load(work->mpRes->getTexIdx(work->mpEmtr->mTexAnmIdx), GX_TEXMAP0);
}
void JPALoadTexAnm(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
ZoneScoped;
work->mpResMgr->load(work->mpRes->getTexIdx(ptcl->mTexAnmIdx), GX_TEXMAP0);
}
@@ -453,7 +446,6 @@ void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
return;
}
ZoneScoped;
JGeometry::TVec3<f32> pos;
#if TARGET_PC
Mtx ptclPosMtx;
@@ -483,7 +475,6 @@ void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
return;
}
ZoneScoped;
if (work->mpRes->getUsrIdx() == 0x89d7) {
int a = 0;
}
@@ -527,7 +518,6 @@ void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
return;
}
ZoneScoped;
JGeometry::TVec3<f32> local_48;
MTXMultVec(work->mPosCamMtx, &param_1->mPosition, &local_48);
Mtx local_38;
@@ -552,7 +542,6 @@ void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
return;
}
ZoneScoped;
JGeometry::TVec3<f32> local_48;
MTXMultVec(work->mPosCamMtx, &param_1->mPosition, &local_48);
f32 sinRot = JMASSin(param_1->mRotateAngle);
@@ -1279,8 +1268,6 @@ void JPADrawStripeX(JPAEmitterWorkData* param_0) {
}
void JPADrawEmitterCallBackB(JPAEmitterWorkData* work) {
ZoneScoped;
JPABaseEmitter* emtr = work->mpEmtr;
if (emtr->mpEmtrCallBack == NULL) {
return;
@@ -1295,7 +1282,6 @@ void JPADrawParticleCallBack(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
return;
}
ZoneScoped;
emtr->mpPtclCallBack->draw(emtr, ptcl);
}
@@ -6,8 +6,6 @@
#include <gx.h>
void JPALoadExTex(JPAEmitterWorkData* work) {
ZoneScoped;
JPAExTexShape* ets = work->mpRes->getEts();
GXTexCoordID secTexCoordID = GX_TEXCOORD1;
@@ -655,7 +655,7 @@ value_or_fun:
value:
#if TARGET_PC
if (dusk::frame_interp::is_enabled() && u <= 5 &&
if (dusk::getSettings().game.enableFrameInterpolation && u <= 5 &&
(operation == data::UNK_0x2 || operation == data::UNK_0x3 || operation == data::UNK_0x12))
{
dusk::frame_interp::request_presentation_sync();
@@ -666,7 +666,7 @@ value:
value_n:
#if TARGET_PC
if (dusk::frame_interp::is_enabled() &&
if (dusk::getSettings().game.enableFrameInterpolation &&
(pN == TAdaptor_camera::sauVariableValue_3_POSITION_XYZ || pN == TAdaptor_camera::sauVariableValue_3_TARGET_POSITION_XYZ) &&
(operation == data::UNK_0x2 || operation == data::UNK_0x3 || operation == data::UNK_0x12))
{
+5 -6
View File
@@ -1,14 +1,13 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include <cstdio>
#include <vi.h>
#include "JSystem/JUtility/JUTConsole.h"
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTConsole.h"
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "JSystem/JUtility/JUTVideo.h"
#include "dusk/string.hpp"
#include <vi.h>
#include <cstdio>
#include "global.h"
JUTConsoleManager* JUTConsoleManager::sManager;
@@ -205,10 +204,10 @@ void JUTConsole::doDraw(JUTConsole::EConsoleType consoleType) const {
mFont->drawString_scale((int)f31, sp94, mFontSizeX, mFontSizeY, spA8, TRUE);
f31 += mFontSizeX * 13.0f;
if (sp88) {
SAFE_SPRINTF(spB8, "ALL");
sprintf(spB8, "ALL");
} else {
f32 f29 = sp8C / (f32)(sp90 - mHeight);
SAFE_SPRINTF(spB8, "%3d%%(%dL)", (int)(100.0 * f29), sp90);
sprintf(spB8, "%3d%%(%dL)", (int)(100.0 * f29), sp90);
}
mFont->drawString_scale(f31, sp94, mFontSizeX, mFontSizeY, spB8, TRUE);
}
+2 -4
View File
@@ -9,8 +9,6 @@
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include "dusk/string.hpp"
#ifdef __REVOLUTION_SDK__
#include <revolution.h>
#else
@@ -847,8 +845,8 @@ bool JUTException::queryMapAddress(char* mapPath, u32 address, s32 section_id, u
bool begin_with_newline) {
if (mapPath) {
char buffer[80];
SAFE_STRCPY(buffer, mapPath);
SAFE_STRCAT(buffer, ".map");
strcpy(buffer, mapPath);
strcat(buffer, ".map");
if (queryMapAddress_single(buffer, address, section_id, out_addr, out_size, out_line,
line_length, print, begin_with_newline) == true)
{
+1 -14
View File
@@ -13,33 +13,20 @@ inline denormal_state denormals_enable()
}
inline void denormals_restore(denormal_state saved) { _mm_setcsr(saved); }
#elif defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC)
#elif defined(__aarch64__) || defined(_M_ARM64)
#include <cstdint>
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
#include <intrin.h>
#endif
using denormal_state = uint64_t;
inline denormal_state denormals_enable()
{
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
denormal_state saved = static_cast<denormal_state>(_ReadStatusReg(ARM64_FPCR));
_WriteStatusReg(ARM64_FPCR, static_cast<__int64>(saved | (1ULL << 24))); // FZ
return saved;
#else
denormal_state saved;
asm volatile("mrs %0, fpcr" : "=r"(saved));
asm volatile("msr fpcr, %0" :: "r"(saved | (1ULL << 24))); // FZ
return saved;
#endif
}
inline void denormals_restore(denormal_state saved)
{
#if defined(_MSC_VER) && !defined(__clang__) && (defined(_M_ARM64) || defined(_M_ARM64EC))
_WriteStatusReg(ARM64_FPCR, static_cast<__int64>(saved));
#else
asm volatile("msr fpcr, %0" :: "r"(saved));
#endif
}
#elif defined(__arm__) || defined(_M_ARM)
+2 -5
View File
@@ -2,9 +2,6 @@ plugins {
id 'com.android.application'
}
def versionNameStr = (System.getenv("DUSK_VERSION") ?: "v0.1.0").replaceFirst("^v", "")
def versionCodeInt = (System.getenv("DUSK_VERSION_CODE") ?: "100000").toInteger()
def duskRepoDir = rootProject.projectDir.parentFile.parentFile
def duskGeneratedAssetsDir = layout.buildDirectory.dir('generated/assets/dusklight').get().asFile
def syncDuskAssets = tasks.register('syncDuskAssets', Sync) {
@@ -23,8 +20,8 @@ android {
applicationId 'dev.twilitrealm.dusk'
minSdk 26
targetSdk 36
versionCode versionCodeInt
versionName versionNameStr
versionCode 1
versionName '0.1.0'
}
buildTypes {
@@ -11,7 +11,6 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
@@ -12,7 +12,6 @@ import android.os.Bundle;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.OpenableColumns;
import android.provider.Settings;
import android.util.Log;
import android.view.View;
import android.view.Window;
@@ -28,12 +27,10 @@ import java.util.List;
public class DuskActivity extends SDLActivity {
private static final String TAG = "DuskActivity";
private static final int FOLDER_DIALOG_REQUEST_CODE = 0x4455;
private static final int MANAGE_STORAGE_REQUEST_CODE = 0x4456;
private static final String EXTERNAL_STORAGE_AUTHORITY =
"com.android.externalstorage.documents";
private long folderDialogUserdata = 0;
private boolean awaitingManageStoragePermission = false;
private static native void nativeFolderDialogResult(long userdata, String path, String error);
@@ -92,9 +89,6 @@ public class DuskActivity extends SDLActivity {
protected void onResume() {
super.onResume();
hideSystemBars();
if (awaitingManageStoragePermission) {
resumeFolderDialogAfterPermissionGrant();
}
}
@Override
@@ -177,19 +171,6 @@ public class DuskActivity extends SDLActivity {
}
folderDialogUserdata = userdata;
if (requiresManageStoragePermission() && !hasManageStoragePermission()) {
if (!requestManageStoragePermission()) {
finishFolderDialogWithError("Unable to request Android file access permission");
return false;
}
return true;
}
openFolderDialog();
return true;
}
private void openFolderDialog() {
runOnUiThread(() -> {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION |
@@ -204,71 +185,9 @@ public class DuskActivity extends SDLActivity {
finishFolderDialog(Activity.RESULT_CANCELED, null);
}
});
}
private boolean requiresManageStoragePermission() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R;
}
private boolean hasManageStoragePermission() {
return !requiresManageStoragePermission() || Environment.isExternalStorageManager();
}
private boolean requestManageStoragePermission() {
if (!requiresManageStoragePermission()) {
return true;
}
awaitingManageStoragePermission = true;
runOnUiThread(() -> {
if (tryStartManageStorageIntent(
new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
.setData(Uri.parse("package:" + getPackageName()))) ||
tryStartManageStorageIntent(
new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)))
{
return;
}
finishFolderDialogWithError("Unable to request Android file access permission");
});
return true;
}
private boolean tryStartManageStorageIntent(Intent intent) {
try {
startActivityForResult(intent, MANAGE_STORAGE_REQUEST_CODE);
return true;
} catch (ActivityNotFoundException e) {
Log.w(TAG, "Unable to open all-files access settings.", e);
return false;
}
}
private void resumeFolderDialogAfterPermissionGrant() {
awaitingManageStoragePermission = false;
if (folderDialogUserdata == 0) {
return;
}
if (hasManageStoragePermission()) {
openFolderDialog();
return;
}
finishFolderDialogWithError(
"Allow \"All files access\" for Dusklight before choosing a custom data folder");
}
private void finishFolderDialogWithError(String error) {
long userdata = folderDialogUserdata;
folderDialogUserdata = 0;
awaitingManageStoragePermission = false;
if (userdata != 0) {
nativeFolderDialogResult(userdata, null, error);
}
}
private void finishFolderDialog(int resultCode, Intent data) {
long userdata = folderDialogUserdata;
folderDialogUserdata = 0;
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 3;
private static final int SDL_MINOR_VERSION = 4;
private static final int SDL_MICRO_VERSION = 8;
private static final int SDL_MICRO_VERSION = 4;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
@@ -570,7 +570,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static int getNaturalOrientation() {
int result = SDL_ORIENTATION_UNKNOWN;
Activity activity = getContext();
Activity activity = (Activity)getContext();
if (activity != null) {
Configuration config = activity.getResources().getConfiguration();
Display display = activity.getWindowManager().getDefaultDisplay();
@@ -590,7 +590,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static int getCurrentRotation() {
int result = 0;
Activity activity = getContext();
Activity activity = (Activity)getContext();
if (activity != null) {
Display display = activity.getWindowManager().getDefaultDisplay();
switch (display.getRotation()) {
@@ -1292,7 +1292,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
public static double getDiagonal()
{
DisplayMetrics metrics = new DisplayMetrics();
Activity activity = getContext();
Activity activity = (Activity)getContext();
if (activity == null) {
return 0.0;
}
@@ -1940,7 +1940,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
return;
}
Activity activity = getContext();
Activity activity = (Activity)getContext();
if (activity.checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
activity.requestPermissions(new String[]{permission}, requestCode);
} else {

Before

Width:  |  Height:  |  Size: 928 KiB

After

Width:  |  Height:  |  Size: 928 KiB

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Before

Width:  |  Height:  |  Size: 1014 B

After

Width:  |  Height:  |  Size: 1014 B

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 279 KiB

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

@@ -3,7 +3,7 @@ Name=Dusklight
GenericName=Dusklight
Comment=PC port of a classic adventure game
Exec=dusklight
Icon=dev.twilitrealm.dusk
Icon=dusklight
Terminal=false
Type=Application
Categories=Game;
+1 -3
View File
@@ -28,9 +28,7 @@
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.adventure-games</string>
<key>LSSupportsGameMode</key>
<true/>
<true/>
</dict>
</plist>
-4
View File
@@ -58,10 +58,6 @@ toast:active {
background-color: rgba(45, 43, 26, 80%);
}*/
b {
font-weight: bold;
}
toast heading {
display: flex;
gap: 18dp;
-2
View File
@@ -447,7 +447,6 @@ body.animate-in .intro-item {
top: auto;
text-align: right;
font-size: 16dp;
gap: 8dp;
}
#disc-status {
@@ -469,7 +468,6 @@ body.animate-in .intro-item {
top: 32dp;
text-align: right;
font-size: 16dp;
gap: 8dp;
}
.update {
-4
View File
@@ -14,10 +14,6 @@ body {
color: #E0DBC8;
}
b {
font-weight: bold;
}
window {
display: flex;
flex-flow: column;
+1 -1
View File
@@ -183,7 +183,7 @@ bool Z2SoundMgr::startSound(JAISoundID soundID, JAISoundHandle* handle, const JG
return streamMgr_.startSound(soundID, handle, posPtr);
default:
char error[64];
SAFE_SPRINTF(error, "Unknown Sound-Type id :%08x\n", (u32)soundID);
sprintf(error, "Unknown Sound-Type id :%08x\n", (u32)soundID);
JUT_WARN(277, "%s", error);
}
+124 -9
View File
@@ -57,7 +57,6 @@
#include "dusk/settings.h"
#include "res/Object/Alink.h"
#include <cstring>
#include <dusk/string.hpp>
#endif
static int daAlink_Create(fopAc_ac_c* i_this);
@@ -5991,7 +5990,7 @@ void daAlink_c::setItemMatrix(int param_0) {
mDoMtx_stack_c::XrotS(-0x8000);
#ifdef TARGET_PC
if (dusk::frame_interp::is_enabled()) {
if (dusk::getSettings().game.enableFrameInterpolation) {
Mtx boot_mtx;
mDoMtx_concat(mpLinkModel->getAnmMtx(0x18), mDoMtx_stack_c::get(), boot_mtx);
mpLinkBootModels[1]->setAnmMtx(1, boot_mtx);
@@ -6101,6 +6100,21 @@ void daAlink_c::setItemMatrix(int param_0) {
modelCalc(mpKanteraGlowModel);
}
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
simpleAnmPlay(mpGhostLanternGlowBtk);
mDoMtx_stack_c::copy(mpLinkModel->getAnmMtx(mLeftItemJntNo));
mDoMtx_stack_c::transM(-2.0f, -0.1f, -0.7f);
mDoMtx_stack_c::XYZrotM(cM_deg2s(100.0f), cM_deg2s(9.3f), cM_deg2s(183.0f));
mDoMtx_stack_c::scaleM(0.75f, 0.75f, 0.75f);
mpGhostLanternModel->setBaseTRMtx(mDoMtx_stack_c::get());
modelCalc(mpGhostLanternModel);
mDoMtx_stack_c::transS(mGhostLanternFlamePos);
mpGhostLanternGlowModel->setBaseTRMtx(mDoMtx_stack_c::get());
modelCalc(mpGhostLanternGlowModel);
}
setSwordPos();
simpleAnmPlay(m_mSwordBtk);
simpleAnmPlay(m_mSwordBrk);
@@ -6921,7 +6935,7 @@ const daAlink_BckData* daAlink_c::getMainBckData(daAlink_c::daAlink_ANM i_anmID)
{dRes_ID_ALANM_BCK_WAITHS_e, dRes_ID_ALANM_BCK_WAITHK_e},
};
if (mEquipItem == dItemNo_KANTERA_e) {
if (mEquipItem == dItemNo_KANTERA_e || mEquipItem == dItemNo_GHOST_LANTERN_e) {
if (i_anmID == ANM_WAIT) {
return &kandelaarAnm[0];
}
@@ -7563,7 +7577,12 @@ void daAlink_c::setBlendMoveAnime(f32 i_morf) {
f32 sp2C;
f32 sp28 = mpHIO->mMove.m.mFootPositionRatio;
BOOL sp24 = checkEventRun();
BOOL sp20 = checkBootsMoveAnime(1) IF_DUSK(&& !dusk::getSettings().game.enableFastIronBoots);
BOOL sp20 = checkBootsMoveAnime(1);
#if TARGET_PC
if (dusk::getSettings().game.enableFastIronBoots) {
sp20 = FALSE;
}
#endif
f32 var_f29;
@@ -8076,7 +8095,7 @@ void daAlink_c::setBlendAtnBackMoveAnime(f32 i_morf) {
daAlink_ANM var_r27;
daAlink_ANM var_r29;
if (checkBootsMoveAnime(1) IF_DUSK(&& !dusk::getSettings().game.enableFastIronBoots)) {
if (checkBootsMoveAnime(1)) {
mMaxSpeed = mpHIO->mAtnMove.m.mMaxBackwardsSpeed;
var_f27 = mpHIO->mAtnMove.m.mMinBackWalkFrame;
var_f31 = mpHIO->mAtnMove.m.mBackWalkChangeRate;
@@ -12063,7 +12082,8 @@ void daAlink_c::itemUnequip(u16 i_itemID, f32 i_playSpeed) {
u16 anm_id;
const daAlinkHIO_anm_c* anm_data;
if (i_itemID == dItemNo_BOOMERANG_e || i_itemID == dItemNo_COPY_ROD_e || i_itemID == dItemNo_KANTERA_e ||
if (i_itemID == dItemNo_BOOMERANG_e || i_itemID == dItemNo_COPY_ROD_e ||
i_itemID == dItemNo_KANTERA_e || i_itemID == dItemNo_GHOST_LANTERN_e ||
i_itemID == dItemNo_HOOKSHOT_e || checkBottleItem(i_itemID))
{
anm_id = dRes_ID_ALANM_BCK_TAKEL_e;
@@ -14153,6 +14173,11 @@ BOOL daAlink_c::setItemModel() {
}
}
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
setGhostLanternModel();
return 1;
}
if (mEquipItem == dItemNo_KANTERA_e) {
setKandelaarModel();
return 1;
@@ -14494,6 +14519,7 @@ enum daAlink_ItemProc {
/* 13 */ ITEM_PROC_BOTTLE_SWING,
/* 14 */ ITEM_PROC_NOT_USE_ITEM,
/* 15 */ ITEM_PROC_GRASS_WHISTLE,
/* 16 */ ITEM_PROC_GHOST_LANTERN,
};
int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) {
@@ -14518,7 +14544,8 @@ int daAlink_c::changeItemTriggerKeepProc(u8 i_selItemIdx, int i_procType) {
} else {
procKandelaarPourInit();
}
} else if (i_procType == ITEM_PROC_FISHING_FOOD) {
}
else if (i_procType == ITEM_PROC_FISHING_FOOD) {
procFishingFoodInit();
} else if (i_procType == ITEM_PROC_BOOTS_EQUIP) {
procBootsEquipInit();
@@ -14823,6 +14850,43 @@ void daAlink_c::deleteEquipItem(BOOL i_isPlaySound, BOOL i_isDeleteKantera) {
}
}
#if TARGET_PC
void daAlink_c::setGhostLanternLight() {
const daAlinkHIO_huLight_c1* light_m = &mpHIO->mItem.mGhostLanternPL.m;
BOOL var_r28 = false;
f32 lightPower = 0.0f;
daE_HP_c* foundPoe = (daE_HP_c*)fopAcM_Search(srchPoe, this);
if (mEquipItem == dItemNo_GHOST_LANTERN_e && foundPoe != NULL) {
lightPower = 1.0f;
}
cLib_chaseF(&current_ghost_lantern_light_power, lightPower, 0.25f);
cXyz spB8;
f32 var_f27;
if (current_ghost_lantern_light_power > 0.0f) {
GXColor sp30 = {(u8)light_m->mColorR, (u8)light_m->mColorG, (u8)light_m->mColorB, 0xFF};
sp30.r = 120;
sp30.g = 150;
sp30.b = 150;
Vec sp5C = {0.0f, light_m->mYOffset, light_m->mZOffset};
f32 var_f26;
spB8 = mGhostLanternFlamePos;
var_f27 = 0.0f;
var_f26 = cM_sht2d(-shape_angle.y);
dKy_WolfEyeLight_set(&spB8, var_f27 + light_m->mXAngle, var_f26,
(light_m->mWidth * current_ghost_lantern_light_power) / light_m->mPower, &sp30, current_ghost_lantern_light_power,
light_m->mAngleAttenuationType,
light_m->mDistanceAttenuationType);
}
}
#endif
void daAlink_c::setLight() {
const daAlinkHIO_huLight_c1* light_m = &mpHIO->mItem.mLanternPL.m;
BOOL var_r28 = false;
@@ -18261,7 +18325,8 @@ int daAlink_c::execute() {
resetUpperAnime(UPPER_2, 5.0f);
}
if (mEquipItem == dItemNo_KANTERA_e && checkNoUpperAnime() && !checkKandelaarEquipAnime() &&
if ((mEquipItem == dItemNo_KANTERA_e || mEquipItem == dItemNo_GHOST_LANTERN_e) &&
checkNoUpperAnime() && !checkKandelaarEquipAnime() &&
(checkModeFlg(MODE_UNK_1000) || mProcID == PROC_CROUCH))
{
if (checkReinRide()) {
@@ -18612,8 +18677,29 @@ int daAlink_c::execute() {
setCollision();
setAttentionPos();
setLight();
#if TARGET_PC
setGhostLanternLight();
#endif
setEffect();
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
cXyz effscale(0.75f, 0.75f, 0.75f);
static u16 particleNmaeDt[2] = {
0x8789,
0x878A,
};
for (s32 i = 0; i < 2; i++) {
ghostLanternFlameEffect[i] = dComIfGp_particle_set(ghostLanternFlameEffect[i], particleNmaeDt[i],
&mGhostLanternFlamePos, 0, &effscale);
}
} else {
for (s32 i = 0; i < 2; i++) {
stopDrawParticle(ghostLanternFlameEffect[i]);
}
}
if (mClothesChangeWaitTimer != 0) {
mDoMtx_stack_c::copy(mpLinkModel->getBaseTRMtx());
@@ -19315,6 +19401,10 @@ void daAlink_c::shadowDraw() {
dComIfGd_addRealShadow(shadowID, mpKanteraModel);
}
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
dComIfGd_addRealShadow(shadowID, mpGhostLanternModel);
}
if (checkEquipHeavyBoots()) {
for (int i = 0; i < 2; i++) {
dComIfGd_addRealShadow(shadowID, mpLinkBootModels[i]);
@@ -19475,6 +19565,22 @@ int daAlink_c::draw() {
}
}
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
daE_HP_c* foundPoe = (daE_HP_c*)fopAcM_Search(srchPoe, this);
for (s32 i = 0; i < 2; i++) {
JPABaseEmitter* emitter_gl = dComIfGp_particle_getEmitter(ghostLanternFlameEffect[i]);
if (emitter_gl != NULL) {
emitter_gl->setLocalTranslation({2.5f, -15.0f, 0.0f});
if (checkPlayerNoDraw() || foundPoe == NULL) {
emitter_gl->stopDrawParticle();
} else {
emitter_gl->playDrawParticle();
}
}
}
}
if (mClothesChangeWaitTimer != 0) {
if (mProcID == PROC_METAMORPHOSE) {
if (mProcVar3.field_0x300e > 0) {
@@ -19768,7 +19874,7 @@ int daAlink_c::draw() {
dComIfGd_getOpaListDark()->entryImm(mpHookChain, 0);
#if TARGET_PC
if (dusk::frame_interp::is_enabled() &&
if (dusk::getSettings().game.enableFrameInterpolation &&
mEquipItem == dItemNo_IRONBALL_e &&
mIronBallChainPos != NULL && mIronBallChainAngle != NULL)
{
@@ -19800,6 +19906,15 @@ int daAlink_c::draw() {
basicModelDraw(mpKanteraGlowModel);
}
if (mEquipItem == dItemNo_GHOST_LANTERN_e) {
daE_HP_c* foundPoe = (daE_HP_c*)fopAcM_Search(srchPoe, this);
modelDraw(mpGhostLanternModel, isPlayerNoDraw);
if (foundPoe != NULL) {
preGhostLanternDraw();
modelDraw(mpGhostLanternGlowModel, isPlayerNoDraw);
}
}
if (checkEquipHeavyBoots()) {
GXColorS10 color = tevStr.TevColor;
for (int i = 0; i < 2; i++) {
-4
View File
@@ -1165,10 +1165,6 @@ int daAlink_c::procCutFinishInit(int i_type) {
const daAlink_cutParamTbl* cutParams = &cutParamTable[i_type];
BOOL is_proc_frontRoll = mProcID == PROC_FRONT_ROLL;
#if TARGET_PC
mIsRollstab = (is_proc_frontRoll != FALSE) && (i_type == CUT_FINISH_PARAM_STAB);
#endif
commonProcInit(PROC_CUT_FINISH);
setCutType(cutParams->m_cutType);
field_0x3198 = cutParams->m_recoilAnmID;
+3 -3
View File
@@ -2184,7 +2184,7 @@ void daAlink_c::setGetSubBgm(int i_itemNo) {
/* dItemNo_NOENTRY_222_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_223_e */ SETYPE_NONE,
/* dItemNo_POU_SPIRIT_e */ SETYPE_ITEM_GET_POU,
/* dItemNo_NOENTRY_225_e */ SETYPE_NONE,
/* dItemNo_GHOST_LANTERN_e */ SETYPE_ITEM_GET,
/* dItemNo_NOENTRY_226_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_227_e */ SETYPE_NONE,
/* dItemNo_NOENTRY_228_e */ SETYPE_NONE,
@@ -4359,7 +4359,7 @@ void daAlink_c::dungeonReturnWarp() {
s16 angle = dComIfGs_getWarpPlayerAngleY();
s8 room = dComIfGs_getWarpRoomNo();
char name[8];
SAFE_STRCPY(name, dComIfGs_getWarpStageName());
strcpy(name, dComIfGs_getWarpStageName());
dComIfGs_setRestartRoom(pos, angle, room);
dComIfGp_setNextStage(name, -1, dComIfGs_getRestartRoomNo(), -1, 0.0f, 12, 0,
@@ -4535,7 +4535,7 @@ int daAlink_c::procCoWarpInit(int param_0, int param_1) {
if (checkBossRoom() && fopAcM_GetRoomNo(this) == 50) {
char stageName[32];
SAFE_STRCPY(stageName, dComIfGp_getStartStageName());
strcpy(stageName, dComIfGp_getStartStageName());
for (int i = 0; i < 32; i++) {
if ((s64)stageName[i] == 0) {
+121
View File
@@ -9,6 +9,7 @@
#include "d/actor/d_a_tag_ss_drink.h"
#include "m_Do/m_Do_lib.h"
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_e_hp.h"
static fopAc_ac_c* daAlink_searchTagKandelaar(fopAc_ac_c* i_actor, void* i_data) {
UNUSED(i_data);
@@ -138,6 +139,50 @@ int daAlink_c::kandelaarModelCallBack() {
return 1;
}
int daAlink_c::ghostLanternModelCallBack() {
cXyz sp44;
mDoMtx_multVecZero(J3DSys::mCurrentMtx, &sp44);
ghost_lantern_0x3630 = ghost_lantern_0x3624;
ghost_lantern_0x3624 = mGhostLanternFlamePos;
cXyz sp38 = (mGhostLanternFlamePos - sp44) + ghost_lantern_0x3618;
sp38.y -= 3.0f;
cXyz sp2C;
mDoMtx_multVec(J3DSys::mCurrentMtx, &cXyz::BaseZ, &sp2C);
s16 var_r29 = sp2C.atan2sX_Z();
mDoMtx_stack_c::YrotS(-var_r29);
mDoMtx_stack_c::multVec(&sp38, &sp38);
s16 var_r28 = cLib_minMaxLimit<s16>(cM_atan2s(-sp38.z, -sp38.y), -0x1800, 0x1800);
s16 var_r27 = cLib_minMaxLimit<s16>(cM_atan2s(sp38.x, JMAFastSqrt(SQUARE(sp38.y) + SQUARE(sp38.z))), -0x1800, 0x1800);
mDoMtx_stack_c::transS(sp44);
if (mProcID != PROC_OPEN_TREASURE && (mProcID != PROC_GET_ITEM || mProcVar4.field_0x3010 == 0)) {
mDoMtx_stack_c::ZXYrotM(var_r28, var_r29, var_r27);
}
static Vec const ghostLanternOffset = {0.0f, -20.0f, 0.0f};
mDoMtx_stack_c::multVec(&ghostLanternOffset, &mGhostLanternFlamePos);
ghost_lantern_0x3618 = (mGhostLanternFlamePos - ghost_lantern_0x3624) * 0.9f;
if (!checkEndResetFlg1(ERFLG1_UNK_8) && mpGhostLanternModel != nullptr) {
f32 scale = JMAFastSqrt(SQUARE(J3DSys::mCurrentMtx[0][0]) + SQUARE(J3DSys::mCurrentMtx[1][0]) + SQUARE(J3DSys::mCurrentMtx[2][0]));
mDoMtx_stack_c::transS(J3DSys::mCurrentMtx[0][3], J3DSys::mCurrentMtx[1][3], J3DSys::mCurrentMtx[2][3]);
mDoMtx_stack_c::ZXYrotM(var_r28, var_r29, var_r27);
mDoMtx_stack_c::ZXYrotM(0, 0, -16384);
mDoMtx_stack_c::scaleM(scale, scale, scale);
mpGhostLanternModel->setAnmMtx(1, mDoMtx_stack_c::get());
cMtx_copy(mDoMtx_stack_c::get(), J3DSys::mCurrentMtx);
}
return 1;
}
static int daAlink_kandelaarModelCallBack(J3DJoint* i_joint, int param_1) {
UNUSED(i_joint);
@@ -150,6 +195,18 @@ static int daAlink_kandelaarModelCallBack(J3DJoint* i_joint, int param_1) {
return 1;
}
static int daAlink_ghostLanternModelCallBack(J3DJoint* i_joint, int param_1) {
UNUSED(i_joint);
daAlink_c* player_p = (daAlink_c*)j3dSys.getModel()->getUserArea();
if (param_1 == 0) {
player_p->ghostLanternModelCallBack();
}
return 1;
}
cXyz* daAlink_c::getKandelaarFlamePos() {
if ((!checkNoResetFlg2(daPy_FLG2(FLG2_UNK_20000 | FLG2_UNK_1)) && !checkEndResetFlg1(ERFLG1_UNK_4)) ||
checkWolf() || !checkNoResetFlg1(FLG1_UNK_80))
@@ -164,6 +221,60 @@ BOOL daAlink_c::checkKandelaarEquipAnime() const {
return checkUpperAnime(dRes_ID_ALANM_BCK_WAITHK_e) || checkUpperAnime(dRes_ID_ALANM_BCK_WAITK_e);
}
void* daAlink_c::srchPoe(void* i_actor, void* i_this) {
if (i_actor != NULL && i_actor != i_this) {
if (fopAcM_IsExecuting(fopAcM_GetID(i_actor)) && fopAcM_GetName(i_actor) == fpcNm_E_HP_e) {
return i_actor;
}
}
return NULL;
}
void daAlink_c::preGhostLanternDraw() {
J3DMaterial* mat_p = mpGhostLanternGlowModel->getModelData()->getMaterialNodePointer(0);
J3DGXColorS10 color;
color.r = 120;
color.g = 150;
color.b = 150;
color.a = 255;
mat_p->setTevColor(1, &color);
color.r = 0;
color.g = 60;
color.b = 101;
mat_p->setTevColor(2, &color);
cXyz proj;
mDoLib_project(&mGhostLanternFlamePos, &proj);
camera_process_class* camera_p = dComIfGp_getCamera(0);
f32 trimHeight;
if (camera_p != NULL) {
trimHeight = camera_p->mCamera.TrimHeight();
} else {
trimHeight = 0.0f;
}
if (proj.x > 0.0f && proj.x < FB_WIDTH && proj.y > trimHeight && proj.y < FB_HEIGHT - trimHeight) {
dComIfGd_peekZ(proj.x, proj.y, &field_0x32c8);
} else {
field_0x32c8 = 0;
}
f32 near_ = dComIfGd_getView()->near_;
f32 far_ = dComIfGd_getView()->far_;
mDoLib_pos2camera(&mGhostLanternFlamePos, &proj);
proj.z += 30.0f;
if (proj.z > -0.01f) {
proj.z = -0.01f;
}
field_0x344c = ((near_ + (far_ * near_) / proj.z) / (far_ - near_) + 1.0f) * 1.6777215E7f;
}
void daAlink_c::preKandelaarDraw() {
J3DMaterial* mat_p = mpKanteraGlowModel->getModelData()->getMaterialNodePointer(0);
@@ -208,6 +319,16 @@ void daAlink_c::preKandelaarDraw() {
field_0x344c = ((near_ + (far_ * near_) / proj.z) / (far_ - near_) + 1.0f) * 1.6777215E7f;
}
void daAlink_c::setGhostLanternModel() {
field_0x2f94 = 0;
mDoMtx_multVecZero(mpLinkModel->getAnmMtx(mLeftItemJntNo), &mGhostLanternFlamePos);
ghost_lantern_0x3630 = ghost_lantern_0x3624;
ghost_lantern_0x3624 = mGhostLanternFlamePos;
ghost_lantern_0x3618 = cXyz::Zero;
}
void daAlink_c::setKandelaarModel() {
field_0x2f94 = 0;
+2 -2
View File
@@ -216,7 +216,7 @@ void daAlink_c::setSpeedAndAngleSwim() {
if (checkEventRun()) {
var_r28 = mMoveAngle;
} else {
var_r28 = shape_angle.y + (16384.0f * cM_ssin(mStickAngle) IF_DUSK(* (dusk::getSettings().game.invertAirSwimX ? -1.0f : 1.0f)));
var_r28 = shape_angle.y + (16384.0f * cM_ssin(mStickAngle));
}
cLib_addCalcAngleS(&shape_angle.y, var_r28, mpHIO->mSwim.m.mUnderwaterTurnRate, mpHIO->mSwim.m.mUnderwaterMaxTurn, mpHIO->mSwim.m.mUnderwaterMinTurn);
@@ -835,7 +835,7 @@ void daAlink_c::setSwimMoveAnime() {
} else {
s16 var_r24;
if (checkInputOnR() && !checkEventRun()) {
var_r24 = 13653.0f * cM_scos(mStickAngle) IF_DUSK(* (dusk::getSettings().game.invertAirSwimY ? -1.0f : 1.0f));
var_r24 = 13653.0f * cM_scos(mStickAngle);
} else {
var_r24 = 0;
}
+14 -7
View File
@@ -300,6 +300,7 @@ void daAlink_c::changeWolf() {
mAtSph.SetR(40.0f);
mpKanteraModel = NULL;
mpGhostLanternModel = NULL;
mpLinkHatModel = NULL;
mpLinkFaceModel = NULL;
mpLinkHandModel = NULL;
@@ -406,12 +407,20 @@ void daAlink_c::changeLink(int param_0) {
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd"));
mpKanteraGlowModel = initModel(modelData, 0x200);
mpKanteraGlowBtk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk"));
mpKanteraGlowBtk->setFrame(0.0f);
mpKanteraGlowBtk->searchUpdateMaterialID(modelData);
modelData->entryTexMtxAnimator(mpKanteraGlowBtk);
mpGhostLanternModel = initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes("E_HP", "hp_ori.bmd")), 0);
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.bmd"));
mpGhostLanternGlowModel = initModel(modelData, 0x200);
mpGhostLanternGlowBtk = static_cast<J3DAnmTextureSRTKey*>(dComIfG_getObjectRes(mArcName, "ef_ktGlow.btk"));
mpGhostLanternGlowBtk->setFrame(0.0f);
mpGhostLanternGlowBtk->searchUpdateMaterialID(modelData);
modelData->entryTexMtxAnimator(mpGhostLanternGlowBtk);
mWoodSwordModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_SWB.bmd")), 0);
mDoExt_setCurrentHeap(current_heap);
@@ -504,6 +513,10 @@ void daAlink_c::changeLink(int param_0) {
mpKanteraModel->setUserArea((uintptr_t)this);
mpKanteraModel->getModelData()->getJointNodePointer(1)->setCallBack(daAlink_kandelaarModelCallBack);
mpGhostLanternModel->setUserArea((uintptr_t)this);
mpGhostLanternModel->getModelData()->getJointNodePointer(1)->setCallBack(daAlink_ghostLanternModelCallBack);
mZ2Link.setLinkState(var_r27);
#if VERSION != VERSION_SHIELD_DEBUG
@@ -4005,13 +4018,7 @@ int daAlink_c::procWolfHowlDemoInit() {
} else if (name == fpcNm_Tag_WaraHowl_e) {
mZ2WolfHowlMgr.setCorrectCurve(static_cast<daTagWrHowl_c*>(field_0x27f4)->getTuneId());
} else {
#if TARGET_PC
if (mZ2WolfHowlMgr.getCorrectCurveID() != 9) {
mZ2WolfHowlMgr.setCorrectCurve(-1);
}
#else
mZ2WolfHowlMgr.setCorrectCurve(-1);
#endif
}
} else {
#if TARGET_PC
+1 -5
View File
@@ -397,7 +397,7 @@ static int daB_GND_Draw(b_gnd_class* i_this) {
i_this->field_0x21e8.update(2, l_color, &a_this->tevStr);
dComIfGd_set3DlineMat(&i_this->field_0x21e8);
#if TARGET_PC
if (dusk::frame_interp::is_enabled()) {
if (dusk::getSettings().game.enableFrameInterpolation) {
if (i_this->mReinsInterpCurrValid) {
memcpy(i_this->mReinsInterpPrev, i_this->mReinsInterpCurr, sizeof(i_this->mReinsInterpCurr));
memcpy(i_this->mReinsTexInterpPrev, i_this->mReinsTexInterpCurr, sizeof(i_this->mReinsTexInterpCurr));
@@ -2192,9 +2192,6 @@ static void damage_check(b_gnd_class* i_this) {
i_this->mDamageInvulnerabilityTimer = 100;
}
}
#if TARGET_PC
dusk::AchievementSystem::get().signal("ganondorf_hit");
#endif
}
cXyz hitmark_size(1.0f, 1.0f, 1.0f);
@@ -2221,7 +2218,6 @@ static void damage_check(b_gnd_class* i_this) {
i_this->field_0xc7c = 0;
dScnPly_c::setPauseTimer(7);
a_this->health = 100;
dusk::AchievementSystem::get().signal("ganondorf_knocked_down");
}
break;
}
+16 -17
View File
@@ -5,25 +5,24 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include <cstdio>
#include <cstring>
#include <os.h>
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "SSystem/SComponent/c_math.h"
#include "d/actor/d_a_bg_obj.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include <cstdio>
#include <os.h>
#include <cstring>
#include "d/actor/d_a_set_bgobj.h"
#include "d/d_s_play.h"
#include "dusk/string.hpp"
#include "SSystem/SComponent/c_math.h"
static const char* getBmdName(int param_0, int param_1) {
static char l_bmdName[16];
switch (param_1) {
case 0:
SAFE_SPRINTF(l_bmdName, "model%d.bmd", param_0);
sprintf(l_bmdName, "model%d.bmd", param_0);
break;
default:
SAFE_SPRINTF(l_bmdName, "model%d_%d.bmd", param_0, param_1);
sprintf(l_bmdName, "model%d_%d.bmd", param_0, param_1);
break;
}
@@ -35,10 +34,10 @@ static const char* getBtkName(int param_0, int param_1) {
switch (param_1) {
case 0:
SAFE_SPRINTF(l_btkName, "model%d.btk", param_0);
sprintf(l_btkName, "model%d.btk", param_0);
break;
default:
SAFE_SPRINTF(l_btkName, "model%d_%d.btk", param_0, param_1);
sprintf(l_btkName, "model%d_%d.btk", param_0, param_1);
break;
}
@@ -50,10 +49,10 @@ static const char* getBrkName(int param_0, int param_1) {
switch (param_1) {
case 0:
SAFE_SPRINTF(l_brkName, "model%d.brk", param_0);
sprintf(l_brkName, "model%d.brk", param_0);
break;
default:
SAFE_SPRINTF(l_brkName, "model%d_%d.brk", param_0, param_1);
sprintf(l_brkName, "model%d_%d.brk", param_0, param_1);
break;
}
@@ -63,7 +62,7 @@ static const char* getBrkName(int param_0, int param_1) {
static const char* getDzbName(int param_0) {
static char l_dzbName[16];
SAFE_SPRINTF(l_dzbName, "model%d.dzb", param_0);
sprintf(l_dzbName, "model%d.dzb", param_0);
return l_dzbName;
}
@@ -96,12 +95,12 @@ u8* daBgObj_c::spec_data_c::initTexShareBlock(u8* i_dataPtr) {
u8* dataPos = i_dataPtr + 8;
for (; i < mTexShareNum; i++) {
SAFE_STRCPY(sp48, (char*)dataPos);
strcpy(sp48, (char*)dataPos);
int len = strlen((char*)dataPos);
dataPos += len + 1;
if (*dataPos != 0) {
SAFE_STRCPY(sp8, (char*)dataPos);
strcpy(sp8, (char*)dataPos);
dataPos += strlen((char*)dataPos) + 1;
} else if (*dataPos == 0 && dataPos[1] == 1) {
dataPos += 2;
@@ -647,14 +646,14 @@ void daBgObj_c::doShareTexture() {
u8* spec_res_name = mSpecData.mpTexShareBlock + 8;
for (int i = 0; i < mSpecData.mTexShareNum; i++) {
SAFE_STRCPY(res_name, (char*)spec_res_name);
strcpy(res_name, (char*)spec_res_name);
spec_res_name += strlen((char*)spec_res_name) + 1;
J3DModelData* modelData =
(J3DModelData*)dComIfG_getObjectRes(daSetBgObj_c::getArcName(this), res_name);
if (*spec_res_name != 0) {
SAFE_STRCPY(share_res_name, (char*)spec_res_name);
strcpy(share_res_name, (char*)spec_res_name);
spec_res_name += strlen((char*)spec_res_name) + 1;
J3DModelData* shareModelData =
+1 -1
View File
@@ -51,7 +51,7 @@ static char* l_bmd_base_name = "door-pushDouble_";
char* daDbDoor00_c::getBmdName() {
static char l_bmdName[32];
SAFE_SPRINTF(l_bmdName, "%s%02d.bmd", l_bmd_base_name, door_param2_c::getDoorModel(this));
sprintf(l_bmdName, "%s%02d.bmd", l_bmd_base_name, door_param2_c::getDoorModel(this));
return l_bmdName;
}
+1 -1
View File
@@ -55,7 +55,7 @@ static char* l_bmd_base_name = "door-knob_";
char* daKnob20_c::getBmd() {
static char l_bmdName[32];
SAFE_SPRINTF(l_bmdName, "%s%02d.bmd", l_bmd_base_name, knob_param_c::getDoorModel(this));
sprintf(l_bmdName, "%s%02d.bmd", l_bmd_base_name, knob_param_c::getDoorModel(this));
return l_bmdName;
}
+2 -2
View File
@@ -65,10 +65,10 @@ char* daDoor20_c::getBmdName() {
case 10:
case 12:
default:
SAFE_SPRINTF(bmdName, "door-shutter_%02d.bmd", door_param2_c::getDoorModel(this));
sprintf(bmdName, "door-shutter_%02d.bmd", door_param2_c::getDoorModel(this));
break;
case 9:
SAFE_SPRINTF(bmdName, "door-knob_%02d.bmd", door_param2_c::getDoorModel(this));
sprintf(bmdName, "door-knob_%02d.bmd", door_param2_c::getDoorModel(this));
break;
}
return bmdName;

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