mirror of
https://github.com/Mr-Wiseguy/Zelda64Recomp.git
synced 2025-04-23 21:51:27 +02:00
Compare commits
177 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0e96cc3dc9 | ||
![]() |
fd16c379ff | ||
![]() |
3d3524ffe7 | ||
![]() |
1c8668fb65 | ||
![]() |
c6d77fe5ca | ||
![]() |
21a6f4046f | ||
![]() |
25e7b31228 | ||
![]() |
91db87632c | ||
![]() |
0d0f64e32f | ||
![]() |
d99a84f04f | ||
![]() |
af1404b83d | ||
![]() |
83ecc68d18 | ||
![]() |
7697a972a3 | ||
![]() |
473b3d3d02 | ||
![]() |
d782d3dcb9 | ||
![]() |
142b4d021b | ||
![]() |
6598da434e | ||
![]() |
3346400775 | ||
![]() |
c90434962f | ||
![]() |
9981b922dc | ||
![]() |
528a22d86f | ||
![]() |
4c2cc2003a | ||
![]() |
c21d55938b | ||
![]() |
5aa650bffa | ||
![]() |
a8a5e216fe | ||
![]() |
97912578e9 | ||
![]() |
e35bb0700f | ||
![]() |
c7baa7ef8f | ||
![]() |
19d2e38499 | ||
![]() |
79fc56f1fd | ||
![]() |
5e3aac4b45 | ||
![]() |
6dd618e5a4 | ||
![]() |
208e3044fc | ||
![]() |
cbb5e8e7a4 | ||
![]() |
4abd0fe720 | ||
![]() |
07cfe51010 | ||
![]() |
b086945b67 | ||
![]() |
1a6a3b3082 | ||
![]() |
19fcd9bf31 | ||
![]() |
b31cf0a76b | ||
![]() |
0e31d3b582 | ||
![]() |
2607c8098f | ||
![]() |
e819c62da2 | ||
![]() |
b0d0cab6c2 | ||
![]() |
1c00519938 | ||
![]() |
030d793056 | ||
![]() |
bec699f0bd | ||
![]() |
6e9ee3498b | ||
![]() |
4d682fac8a | ||
![]() |
d1f5ff3bba | ||
![]() |
9ab97993e1 | ||
![]() |
49baa68ea1 | ||
![]() |
db1def4280 | ||
![]() |
7d3ae05436 | ||
![]() |
763c714653 | ||
![]() |
ce406e9c5d | ||
![]() |
3e5efc935e | ||
![]() |
a3d287575d | ||
![]() |
8319d97ad1 | ||
![]() |
b6b3bca731 | ||
![]() |
95b7a64f1c | ||
![]() |
790b10a4b4 | ||
![]() |
32b0fc5f53 | ||
![]() |
1ea7d4ebe9 | ||
![]() |
4ebe71bfcc | ||
![]() |
d4898f2316 | ||
![]() |
3c34fa63c1 | ||
![]() |
a4f61016bb | ||
![]() |
773cc3bbb0 | ||
![]() |
332a45cd64 | ||
![]() |
23eb6b7eea | ||
![]() |
169155953e | ||
![]() |
41e737249e | ||
![]() |
02a774e4ff | ||
![]() |
466b766cfa | ||
![]() |
26f5fcc952 | ||
![]() |
b803da8a58 | ||
![]() |
0a0699f272 | ||
![]() |
0b609752ce | ||
![]() |
f872ca87cc | ||
![]() |
671d94a6d5 | ||
![]() |
6121e5aa3c | ||
![]() |
b791a4aa1d | ||
![]() |
3f9478c7e6 | ||
![]() |
511fca8393 | ||
![]() |
7e8782c114 | ||
![]() |
008dfa5b0b | ||
![]() |
29161d17f2 | ||
![]() |
ada320a184 | ||
![]() |
4873460b88 | ||
![]() |
abbf090153 | ||
![]() |
89af45ae34 | ||
![]() |
d5fb5f50c1 | ||
![]() |
a72f4d6072 | ||
![]() |
452d2af067 | ||
![]() |
b1109f66c1 | ||
![]() |
028fa7fd17 | ||
![]() |
c9c1726a8b | ||
![]() |
82c449045f | ||
![]() |
b18262c692 | ||
![]() |
c898edd749 | ||
![]() |
b89d9c8508 | ||
![]() |
f56b6c6b87 | ||
![]() |
8a035386c0 | ||
![]() |
25461da8ab | ||
![]() |
ac14e4ca3f | ||
![]() |
4c3d48ba8f | ||
![]() |
18be149b7b | ||
![]() |
af165cb21c | ||
![]() |
47de6032d9 | ||
![]() |
db41873d69 | ||
![]() |
300af8c8c4 | ||
![]() |
d1fb2bd278 | ||
![]() |
73eac7c88d | ||
![]() |
2a72fc25ca | ||
![]() |
83b196a4e5 | ||
![]() |
9ff794f502 | ||
![]() |
a324b7853d | ||
![]() |
54b862599c | ||
![]() |
7034243ff6 | ||
![]() |
0faf51e8a2 | ||
![]() |
b7775e1e96 | ||
![]() |
3fdb2dc001 | ||
![]() |
55aa02c4b3 | ||
![]() |
619325366e | ||
![]() |
20d6f56644 | ||
![]() |
6aaf0bbd71 | ||
![]() |
76a879359e | ||
![]() |
7491eabde0 | ||
![]() |
956db3366f | ||
![]() |
11012cdfc6 | ||
![]() |
1ef8656a93 | ||
![]() |
b9c9e65672 | ||
![]() |
52278c5a4d | ||
![]() |
1ec20de2f5 | ||
![]() |
0aafcb6ee2 | ||
![]() |
d555f0c65b | ||
![]() |
8a70b2313e | ||
![]() |
fab4f66903 | ||
![]() |
7c37f8ef8e | ||
![]() |
598948bfb6 | ||
![]() |
a6f94f9e2e | ||
![]() |
3537a22ccd | ||
![]() |
b28614b128 | ||
![]() |
539497f84d | ||
![]() |
c4b89613ab | ||
![]() |
ac2150b0fa | ||
![]() |
dd1315e6eb | ||
![]() |
25a3837b37 | ||
![]() |
a6e34bb49b | ||
![]() |
68ee43f5ac | ||
![]() |
5382ce6fd0 | ||
![]() |
4076591be1 | ||
![]() |
4fef9d9203 | ||
![]() |
73ea635f9c | ||
![]() |
8fbb7b6025 | ||
![]() |
c06889c3bb | ||
![]() |
17aa09506b | ||
![]() |
6613c9967d | ||
![]() |
26117389aa | ||
![]() |
a5c359d28c | ||
![]() |
9a23d00a36 | ||
![]() |
a215605b5d | ||
![]() |
fe3670d08f | ||
![]() |
12f52eab2f | ||
![]() |
bf167f31c7 | ||
![]() |
95ab0074ea | ||
![]() |
2b96bb8be9 | ||
![]() |
0fd4f8b859 | ||
![]() |
af3c4f4df7 | ||
![]() |
51759611e1 | ||
![]() |
fa8092b70e | ||
![]() |
0555d5cd97 | ||
![]() |
a293673a32 | ||
![]() |
38f813ae04 | ||
![]() |
fe8f45eaf2 | ||
![]() |
b334c677b9 |
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
40
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Report a bug in the project
|
||||||
|
title: ''
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## If you have a crash on startup, please make sure your graphics drivers are up to date before submitting a bug report.
|
||||||
|
|
||||||
|
**What is your GPU driver version? Old drivers, particularly on Nvidia, are known to cause crashes on boot on 1.1.0. If you are on Nvidia and the game is crashing on boot, please update to driver version 555.85 or newer before opening an issue.**
|
||||||
|
|
||||||
|
**Have you checked whether this issue is vanilla behavior? In other words, does it occur on original hardware?**
|
||||||
|
|
||||||
|
**Were you playing with intended mechanics, or using glitches? If it's the latter, which glitches?**
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. etc.
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
Please attach a screenshot of the bug.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [Windows 10, Windows 11, Linux distro]
|
||||||
|
- Version: [e.g. 1.0.0]
|
||||||
|
- CPU: [e.g. Intel Core ..., AMD Ryzen ..., etc.]
|
||||||
|
- GPU: [e.g. NVIDIA GeForce .../Radeon RX .../Intel UHD .../etc.]
|
||||||
|
- GPU driver: [e.g Nvidia driver 545.XX, AMD driver 24.X.X, etc]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
9
.github/linux/Zelda64Recompiled.desktop
vendored
Normal file
9
.github/linux/Zelda64Recompiled.desktop
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=Zelda64Recompiled
|
||||||
|
Type=Application
|
||||||
|
Terminal=false
|
||||||
|
Icon=Zelda64Recompiled
|
||||||
|
Exec=Zelda64Recompiled
|
||||||
|
GenericName=Zelda64Recompiled
|
||||||
|
Categories=Game;
|
||||||
|
|
45
.github/linux/appimage.sh
vendored
Executable file
45
.github/linux/appimage.sh
vendored
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
ARCH=$(uname -m)
|
||||||
|
LINUX_DEPLOY_ARCH=$(uname -m)
|
||||||
|
|
||||||
|
if [ "$ARCH" = "x86_64" ]; then
|
||||||
|
ARCH="x86_64"
|
||||||
|
LINUX_DEPLOY_ARCH="x86_64"
|
||||||
|
elif [ "$ARCH" = "aarch64" ]; then
|
||||||
|
ARCH="arm_aarch64"
|
||||||
|
LINUX_DEPLOY_ARCH="aarch64"
|
||||||
|
else
|
||||||
|
echo "Unsupported architecture: $ARCH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$LINUX_DEPLOY_ARCH.AppImage"
|
||||||
|
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/raw/master/linuxdeploy-plugin-gtk.sh"
|
||||||
|
|
||||||
|
chmod a+x linuxdeploy*
|
||||||
|
|
||||||
|
mkdir -p AppDir/usr/bin
|
||||||
|
cp Zelda64Recompiled AppDir/usr/bin/
|
||||||
|
cp -r assets/ AppDir/usr/bin/
|
||||||
|
cp gamecontrollerdb.txt AppDir/usr/bin/
|
||||||
|
cp icons/512.png AppDir/Zelda64Recompiled.png
|
||||||
|
cp .github/linux/Zelda64Recompiled.desktop AppDir/
|
||||||
|
|
||||||
|
"./linuxdeploy-$LINUX_DEPLOY_ARCH.AppImage" --appimage-extract
|
||||||
|
mv squashfs-root/ deploy
|
||||||
|
./deploy/AppRun --appdir=AppDir/ -d AppDir/Zelda64Recompiled.desktop -i AppDir/Zelda64Recompiled.png -e AppDir/usr/bin/Zelda64Recompiled --plugin gtk
|
||||||
|
sed -i 's/exec/#exec/g' AppDir/AppRun
|
||||||
|
echo 'if [ -f "portable.txt" ]; then' >> AppDir/AppRun
|
||||||
|
echo ' APP_FOLDER_PATH=$PWD' >> AppDir/AppRun
|
||||||
|
echo ' cd "$this_dir"/usr/bin/' >> AppDir/AppRun
|
||||||
|
echo ' APP_FOLDER_PATH=$APP_FOLDER_PATH ./Zelda64Recompiled' >> AppDir/AppRun
|
||||||
|
echo 'else' >> AppDir/AppRun
|
||||||
|
echo ' cd "$this_dir"/usr/bin/' >> AppDir/AppRun
|
||||||
|
echo ' ./Zelda64Recompiled' >> AppDir/AppRun
|
||||||
|
echo 'fi' >> AppDir/AppRun
|
||||||
|
|
||||||
|
# Remove conflicting libraries
|
||||||
|
rm -rf AppDir/usr/lib/libgmodule*
|
||||||
|
rm -rf AppDir/usr/lib/gio/modules/*.so
|
||||||
|
rm -rf AppDir/usr/lib/libwayland*
|
||||||
|
|
||||||
|
./deploy/usr/bin/linuxdeploy-plugin-appimage --appdir=AppDir
|
26
.github/macos/Info.plist.in
vendored
Normal file
26
.github/macos/Info.plist.in
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>Zelda64Recompiled</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
|
<key>LSApplicationCategoryType</key>
|
||||||
|
<string>public.app-category.games</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>11</string>
|
||||||
|
<key>GCSupportsGameMode</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
87
.github/macos/apple_bundle.cmake
vendored
Normal file
87
.github/macos/apple_bundle.cmake
vendored
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
# Define the path to the entitlements file
|
||||||
|
set(ENTITLEMENTS_FILE ${CMAKE_SOURCE_DIR}/.github/macos/entitlements.plist)
|
||||||
|
|
||||||
|
# Set bundle properties
|
||||||
|
set_target_properties(Zelda64Recompiled PROPERTIES
|
||||||
|
MACOSX_BUNDLE TRUE
|
||||||
|
MACOSX_BUNDLE_BUNDLE_NAME "Zelda64Recompiled"
|
||||||
|
MACOSX_BUNDLE_GUI_IDENTIFIER "com.github.zelda64recompiled"
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION "1.0"
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING "1.0"
|
||||||
|
MACOSX_BUNDLE_ICON_FILE "AppIcon.icns"
|
||||||
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/Info.plist
|
||||||
|
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "-"
|
||||||
|
XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_FILE}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Create icon files for macOS bundle
|
||||||
|
set(ICON_SOURCE ${CMAKE_SOURCE_DIR}/icons/512.png)
|
||||||
|
set(ICONSET_DIR ${CMAKE_BINARY_DIR}/AppIcon.iconset)
|
||||||
|
set(ICNS_FILE ${CMAKE_BINARY_DIR}/resources/AppIcon.icns)
|
||||||
|
|
||||||
|
# Create iconset directory and add PNG file
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${ICONSET_DIR}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${ICONSET_DIR}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${ICON_SOURCE} ${ICONSET_DIR}/icon_512x512.png
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${ICON_SOURCE} ${ICONSET_DIR}/icon_512x512@2x.png
|
||||||
|
COMMAND touch ${ICONSET_DIR}
|
||||||
|
COMMENT "Creating iconset directory and copying PNG file"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Convert iconset to icns
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${ICNS_FILE}
|
||||||
|
DEPENDS ${ICONSET_DIR}
|
||||||
|
COMMAND iconutil -c icns ${ICONSET_DIR} -o ${ICNS_FILE}
|
||||||
|
COMMENT "Converting iconset to icns"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Custom target to ensure icns creation
|
||||||
|
add_custom_target(create_icns ALL DEPENDS ${ICNS_FILE})
|
||||||
|
|
||||||
|
# Set source file properties for the resulting icns file
|
||||||
|
set_source_files_properties(${ICNS_FILE} PROPERTIES
|
||||||
|
MACOSX_PACKAGE_LOCATION "Resources"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add the icns file to the executable target
|
||||||
|
target_sources(Zelda64Recompiled PRIVATE ${ICNS_FILE})
|
||||||
|
|
||||||
|
# Ensure Zelda64Recompiled depends on create_icns
|
||||||
|
add_dependencies(Zelda64Recompiled create_icns)
|
||||||
|
|
||||||
|
# Configure Info.plist
|
||||||
|
configure_file(${CMAKE_SOURCE_DIR}/.github/macos/Info.plist.in ${CMAKE_BINARY_DIR}/Info.plist @ONLY)
|
||||||
|
|
||||||
|
# Install the app bundle
|
||||||
|
install(TARGETS Zelda64Recompiled BUNDLE DESTINATION .)
|
||||||
|
|
||||||
|
# Ensure the entitlements file exists
|
||||||
|
if(NOT EXISTS ${ENTITLEMENTS_FILE})
|
||||||
|
message(FATAL_ERROR "Entitlements file not found at ${ENTITLEMENTS_FILE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Post-build steps for macOS bundle
|
||||||
|
add_custom_command(TARGET Zelda64Recompiled POST_BUILD
|
||||||
|
# Copy and fix frameworks first
|
||||||
|
COMMAND ${CMAKE_COMMAND} -D CMAKE_BUILD_TYPE=$<CONFIG> -D CMAKE_GENERATOR=${CMAKE_GENERATOR} -P ${CMAKE_SOURCE_DIR}/.github/macos/fixup_bundle.cmake
|
||||||
|
|
||||||
|
# Copy all resources
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/assets ${CMAKE_BINARY_DIR}/temp_assets
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/temp_assets/scss
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/temp_assets $<TARGET_BUNDLE_DIR:Zelda64Recompiled>/Contents/Resources/assets
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/temp_assets
|
||||||
|
|
||||||
|
# Copy controller database
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/gamecontrollerdb.txt $<TARGET_BUNDLE_DIR:Zelda64Recompiled>/Contents/Resources/
|
||||||
|
|
||||||
|
# Set RPATH
|
||||||
|
COMMAND install_name_tool -add_rpath "@executable_path/../Frameworks/" $<TARGET_BUNDLE_DIR:Zelda64Recompiled>/Contents/MacOS/Zelda64Recompiled
|
||||||
|
|
||||||
|
# Sign the bundle
|
||||||
|
COMMAND codesign --verbose=4 --options=runtime --no-strict --sign - --entitlements ${ENTITLEMENTS_FILE} --deep --force $<TARGET_BUNDLE_DIR:Zelda64Recompiled>
|
||||||
|
|
||||||
|
COMMENT "Performing post-build steps for macOS bundle"
|
||||||
|
VERBATIM
|
||||||
|
)
|
14
.github/macos/entitlements.plist
vendored
Normal file
14
.github/macos/entitlements.plist
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.disable-library-validation</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
44
.github/macos/fixup_bundle.cmake
vendored
Normal file
44
.github/macos/fixup_bundle.cmake
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
include(BundleUtilities)
|
||||||
|
|
||||||
|
# Check for pkgx installation
|
||||||
|
find_program(PKGX_EXECUTABLE pkgx)
|
||||||
|
|
||||||
|
# Xcode generator puts the build type in the build directory
|
||||||
|
set(BUILD_PREFIX "")
|
||||||
|
if (CMAKE_GENERATOR STREQUAL "Xcode")
|
||||||
|
set(BUILD_PREFIX "${CMAKE_BUILD_TYPE}/")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Use generator expressions to get the absolute path to the bundle
|
||||||
|
set(APPS "${BUILD_PREFIX}Zelda64Recompiled.app/Contents/MacOS/Zelda64Recompiled")
|
||||||
|
|
||||||
|
# Set up framework search paths
|
||||||
|
set(DIRS "${BUILD_PREFIX}Zelda64Recompiled.app/Contents/Frameworks")
|
||||||
|
|
||||||
|
# Detect if we're using pkgx
|
||||||
|
if(PKGX_EXECUTABLE)
|
||||||
|
message(STATUS "pkgx detected, adding pkgx directories to framework search path")
|
||||||
|
list(APPEND DIRS "$ENV{HOME}/.pkgx/")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Convert all paths to absolute paths
|
||||||
|
file(REAL_PATH ${APPS} APPS)
|
||||||
|
|
||||||
|
set(RESOLVED_DIRS "")
|
||||||
|
foreach(DIR IN LISTS DIRS)
|
||||||
|
# Handle home directory expansion
|
||||||
|
string(REPLACE "~" "$ENV{HOME}" DIR "${DIR}")
|
||||||
|
# Convert to absolute path, but don't fail if directory doesn't exist
|
||||||
|
if(EXISTS "${DIR}")
|
||||||
|
file(REAL_PATH "${DIR}" RESOLVED_DIR)
|
||||||
|
list(APPEND RESOLVED_DIRS "${RESOLVED_DIR}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Debug output
|
||||||
|
message(STATUS "Bundle fixup paths:")
|
||||||
|
message(STATUS " App: ${APPS}")
|
||||||
|
message(STATUS " Search dirs: ${RESOLVED_DIRS}")
|
||||||
|
|
||||||
|
# Fix up the bundle
|
||||||
|
fixup_bundle("${APPS}" "" "${RESOLVED_DIRS}")
|
73
.github/macos/ld64
vendored
Executable file
73
.github/macos/ld64
vendored
Executable file
@ -0,0 +1,73 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
"""
|
||||||
|
Custom ld64 wrapper for macOS
|
||||||
|
|
||||||
|
This script wraps the standard macOS linker (/usr/bin/ld) to modify executable memory
|
||||||
|
protection flags in the resulting Mach-O binary. It works in three stages:
|
||||||
|
|
||||||
|
1. First, it passes through all arguments to the regular macOS linker to create the binary
|
||||||
|
2. Then, it parses command line arguments to identify output file and segment protection flags
|
||||||
|
3. Finally, it modifies the output binary's Mach-O headers to ensure segments (particularly __TEXT)
|
||||||
|
have the maximum protection flags (rwx) we specify, even if the default macOS linker would restrict them
|
||||||
|
|
||||||
|
This is necessary because macOS restricts writable+executable memory by default,
|
||||||
|
but certain applications need this capability for dynamic code generation or JIT compilation.
|
||||||
|
|
||||||
|
Usage: Same as the standard ld64 linker, with the added benefit that -segprot options
|
||||||
|
will have their max_prot values properly preserved in the output binary.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
from itertools import takewhile
|
||||||
|
from macholib import MachO, ptypes
|
||||||
|
|
||||||
|
def parse_rwx(text):
|
||||||
|
return ('r' in text and 1) | ('w' in text and 2) | ('x' in text and 4)
|
||||||
|
|
||||||
|
def apply_maxprots(path, maxprots):
|
||||||
|
mach = MachO.MachO(path)
|
||||||
|
header = mach.headers[0]
|
||||||
|
offset = ptypes.sizeof(header.mach_header)
|
||||||
|
|
||||||
|
for cload, ccmd, cdata in header.commands:
|
||||||
|
if not hasattr(ccmd, 'segname'):
|
||||||
|
break
|
||||||
|
|
||||||
|
if hasattr(ccmd.segname, 'to_str'):
|
||||||
|
segname = ccmd.segname.to_str().decode('utf-8').strip('\0')
|
||||||
|
else:
|
||||||
|
segname = ccmd.segname.decode('utf-8').strip('\0')
|
||||||
|
|
||||||
|
if segname in maxprots and ccmd.maxprot != maxprots[segname]:
|
||||||
|
fields = list(takewhile(lambda field: field[0] != 'maxprot', cload._fields_ + ccmd._fields_))
|
||||||
|
index = offset + sum(ptypes.sizeof(typ) for _, typ in fields)
|
||||||
|
|
||||||
|
with open(path, 'r+b') as fh:
|
||||||
|
fh.seek(index)
|
||||||
|
fh.write(bytes([maxprots[segname]]))
|
||||||
|
|
||||||
|
offset += cload.cmdsize
|
||||||
|
|
||||||
|
try:
|
||||||
|
subprocess.check_call(['/usr/bin/ld'] + sys.argv[1:])
|
||||||
|
except subprocess.CalledProcessError as ex:
|
||||||
|
sys.exit(ex.returncode)
|
||||||
|
|
||||||
|
output_file = 'a.out'
|
||||||
|
segprots = {'__TEXT': parse_rwx('rwx')} # maxprot = rwx
|
||||||
|
|
||||||
|
i = 1
|
||||||
|
while i < len(sys.argv):
|
||||||
|
if sys.argv[i] == '-o' and i + 1 < len(sys.argv):
|
||||||
|
output_file = sys.argv[i + 1]
|
||||||
|
i += 2
|
||||||
|
elif sys.argv[i] == '-segprot' and i + 3 < len(sys.argv):
|
||||||
|
segment = sys.argv[i + 1]
|
||||||
|
maxprot = sys.argv[i + 2]
|
||||||
|
segprots[segment] = parse_rwx(maxprot)
|
||||||
|
i += 4
|
||||||
|
else:
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
apply_maxprots(output_file, segprots)
|
14
.github/macos/macports.yaml
vendored
Normal file
14
.github/macos/macports.yaml
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
version: '2.9.3'
|
||||||
|
prefix: '/opt/local'
|
||||||
|
variants:
|
||||||
|
select:
|
||||||
|
- aqua
|
||||||
|
- metal
|
||||||
|
deselect: x11
|
||||||
|
ports:
|
||||||
|
- name: clang-18
|
||||||
|
- name: llvm-18
|
||||||
|
- name: libsdl2
|
||||||
|
select: universal
|
||||||
|
- name: freetype
|
||||||
|
select: universal
|
64
.github/workflows/update-pr-artifacts.yml
vendored
Normal file
64
.github/workflows/update-pr-artifacts.yml
vendored
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
name: update-pr-artifacts
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [validate-external, validate-internal]
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
jobs:
|
||||||
|
update-pr-artifacts:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: (github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target') && github.event.workflow_run.conclusion == 'success'
|
||||||
|
name: Update PR Artifacts
|
||||||
|
steps:
|
||||||
|
- name: Get PR Number
|
||||||
|
id: pr-number
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
const { owner, repo } = context.repo;
|
||||||
|
|
||||||
|
const findPRNumber = async () => {
|
||||||
|
const pulls = await github.rest.pulls.list({ owner, repo });
|
||||||
|
for await (const { data } of github.paginate.iterator(pulls)) {
|
||||||
|
for (const pull of data) {
|
||||||
|
if (pull.head.sha === '${{ github.event.workflow_run.head_sha }}' && pull.user.id === ${{ github.event.sender.id }}) {
|
||||||
|
return pull.number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const prNumber = await findPRNumber();
|
||||||
|
if (!prNumber) {
|
||||||
|
core.error(`No matching pull request found`);
|
||||||
|
} else {
|
||||||
|
return prNumber;
|
||||||
|
}
|
||||||
|
- name: Create Artifacts Content
|
||||||
|
id: artifacts-content
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
result-encoding: string
|
||||||
|
script: |
|
||||||
|
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: context.payload.workflow_run.id,
|
||||||
|
});
|
||||||
|
|
||||||
|
const nightlyLinks = artifacts.data.artifacts.reduce((acc, item) => {
|
||||||
|
acc += `- [${item.name}.zip](https://nightly.link/${context.repo.owner}/${context.repo.repo}/actions/artifacts/${item.id}.zip)\n`;
|
||||||
|
return acc;
|
||||||
|
}, '### Build Artifacts\n');
|
||||||
|
|
||||||
|
return nightlyLinks;
|
||||||
|
- name: Update PR Description
|
||||||
|
uses: garrettjoecox/pr-section@3.1.0
|
||||||
|
with:
|
||||||
|
section-name: 'artifacts'
|
||||||
|
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||||
|
pr-number: ${{ steps.pr-number.outputs.result }}
|
||||||
|
section-value: '${{ steps.artifacts-content.outputs.result }}'
|
19
.github/workflows/validate-external.yml
vendored
Normal file
19
.github/workflows/validate-external.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
name: validate-external
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, synchronize]
|
||||||
|
jobs:
|
||||||
|
authorize:
|
||||||
|
if: github.repository != github.event.pull_request.head.repo.full_name
|
||||||
|
environment:
|
||||||
|
${{ github.event_name == 'pull_request_target' &&
|
||||||
|
github.event.pull_request.head.repo.full_name != github.repository &&
|
||||||
|
'external' || 'internal' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo ✓
|
||||||
|
build:
|
||||||
|
needs: authorize
|
||||||
|
uses: ./.github/workflows/validate.yml
|
||||||
|
secrets:
|
||||||
|
ZRE_REPO_WITH_PAT: ${{ secrets.ZRE_REPO_WITH_PAT }}
|
12
.github/workflows/validate-internal.yml
vendored
Normal file
12
.github/workflows/validate-internal.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
name: validate-internal
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
|
||||||
|
uses: ./.github/workflows/validate.yml
|
||||||
|
secrets: inherit
|
363
.github/workflows/validate.yml
vendored
Normal file
363
.github/workflows/validate.yml
vendored
Normal file
@ -0,0 +1,363 @@
|
|||||||
|
name: validate
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
SDL2_VERSION:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: '2.30.3'
|
||||||
|
N64RECOMP_COMMIT:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: '989a86b36912403cd323de884bf834f2605ea770'
|
||||||
|
DXC_CHECKSUM:
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
default: '4e6f4e52989aca69739880b40b9f988357f15d10ca03284377b81f1502463ff5'
|
||||||
|
secrets:
|
||||||
|
ZRE_REPO_WITH_PAT:
|
||||||
|
required: true
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
jobs:
|
||||||
|
build-linux:
|
||||||
|
runs-on: ${{ format('blaze/compute/{0}-amd64', matrix.os) }}
|
||||||
|
container:
|
||||||
|
image: dcvz/n64recomp:ubuntu-18.04
|
||||||
|
volumes:
|
||||||
|
# create a volume that we'll use as the new source for the node binary
|
||||||
|
# https://github.com/actions/checkout/issues/1809
|
||||||
|
- /nodeoverride:/nodeoverride:rw,rshared
|
||||||
|
- /nodeoverride:/__e/node20:ro,rshared
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
type: [ Debug, Release ]
|
||||||
|
os: [ ubuntu-22.04 ]
|
||||||
|
name: ubuntu-18.04 (x64, ${{ matrix.type }})
|
||||||
|
steps:
|
||||||
|
- name: Copy the Node20 binary
|
||||||
|
run: |
|
||||||
|
cp -r /node20217/* /nodeoverride/
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
||||||
|
submodules: recursive
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-x64-${{ inputs.N64RECOMP_COMMIT }}
|
||||||
|
- name: Prepare Build
|
||||||
|
run: |-
|
||||||
|
git clone ${{ secrets.ZRE_REPO_WITH_PAT }}
|
||||||
|
unzip zre/files.zip > /dev/null 2>&1
|
||||||
|
- name: Build N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
|
||||||
|
cd N64RecompSource
|
||||||
|
git checkout ${{ inputs.N64RECOMP_COMMIT }}
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
# Build N64Recomp & RSPRecomp
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
||||||
|
cmake --build cmake-build --config Release --target N64RecompCLI -j $(nproc)
|
||||||
|
cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc)
|
||||||
|
|
||||||
|
# Copy N64Recomp & RSPRecomp to root directory
|
||||||
|
cp cmake-build/N64Recomp ..
|
||||||
|
cp cmake-build/RSPRecomp ..
|
||||||
|
- name: Run N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
./N64Recomp us.rev1.toml
|
||||||
|
./RSPRecomp aspMain.us.rev1.toml
|
||||||
|
./RSPRecomp njpgdspMain.us.rev1.toml
|
||||||
|
- name: Hotpatch DXC into RT64's contrib
|
||||||
|
run: |
|
||||||
|
# check if dxc was updated before we replace it, to detect changes
|
||||||
|
echo ${{ inputs.DXC_CHECKSUM }} ./lib/rt64/src/contrib/dxc/bin/x64/dxc-linux | sha256sum --status -c -
|
||||||
|
|
||||||
|
cp -v /usr/local/lib/libdxcompiler.so ./lib/rt64/src/contrib/dxc/lib/x64/libdxcompiler.so
|
||||||
|
cp -v /usr/local/bin/dxc ./lib/rt64/src/contrib/dxc/bin/x64/dxc-linux
|
||||||
|
- name: Build ZeldaRecomp
|
||||||
|
run: |-
|
||||||
|
# enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_C_COMPILER=clang-17 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build -DPATCHES_C_COMPILER=clang-17 -DPATCHES_LD=ld.lld-17
|
||||||
|
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $(nproc)
|
||||||
|
- name: Prepare Archive
|
||||||
|
run: |
|
||||||
|
mv cmake-build/Zelda64Recompiled Zelda64Recompiled
|
||||||
|
rm -rf assets/scss
|
||||||
|
tar -czf Zelda64Recompiled.tar.gz Zelda64Recompiled assets/ gamecontrollerdb.txt
|
||||||
|
- name: Archive Zelda64Recomp
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-${{ runner.os }}-X64-${{ matrix.type }}
|
||||||
|
path: Zelda64Recompiled.tar.gz
|
||||||
|
- name: Build AppImage
|
||||||
|
run: |-
|
||||||
|
./.github/linux/appimage.sh
|
||||||
|
- name: Zelda64Recomp AppImage
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-AppImage-X64-${{ matrix.type }}
|
||||||
|
path: Zelda64Recompiled-*.AppImage
|
||||||
|
build-linux-arm64:
|
||||||
|
runs-on: ${{ format('blaze/compute/{0}', matrix.os) }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
type: [ Debug, Release ]
|
||||||
|
os: [ ubuntu-22.04 ]
|
||||||
|
name: ${{ matrix.os }} (arm64, ${{ matrix.type }})
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
||||||
|
submodules: recursive
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ matrix.os }}-z64re-ccache-${{ matrix.type }}-arm64-${{ inputs.N64RECOMP_COMMIT }}
|
||||||
|
- name: Install Linux Dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev lld llvm clang-15 libfuse2
|
||||||
|
|
||||||
|
# Install SDL2
|
||||||
|
echo ::group::install SDL2
|
||||||
|
|
||||||
|
# Enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
wget https://github.com/libsdl-org/SDL/releases/download/release-${{ inputs.SDL2_VERSION }}/SDL2-${{ inputs.SDL2_VERSION }}.tar.gz
|
||||||
|
tar -xzf SDL2-${{ inputs.SDL2_VERSION }}.tar.gz
|
||||||
|
cd SDL2-${{ inputs.SDL2_VERSION }}
|
||||||
|
./configure
|
||||||
|
make -j 10
|
||||||
|
sudo make install
|
||||||
|
sudo cp -av /usr/local/lib/libSDL* /lib/aarch64-linux-gnu/
|
||||||
|
echo ::endgroup::
|
||||||
|
- name: Prepare Build
|
||||||
|
run: |-
|
||||||
|
git clone ${{ secrets.ZRE_REPO_WITH_PAT }}
|
||||||
|
./zre/process.sh
|
||||||
|
cp ./zre/mm_shader_cache.bin ./shadercache/
|
||||||
|
- name: Build N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
|
||||||
|
cd N64RecompSource
|
||||||
|
git checkout ${{ inputs.N64RECOMP_COMMIT }}
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
# Build N64Recomp & RSPRecomp
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
||||||
|
cmake --build cmake-build --config Release --target N64RecompCLI -j $(nproc)
|
||||||
|
cmake --build cmake-build --config Release --target RSPRecomp -j $(nproc)
|
||||||
|
|
||||||
|
# Copy N64Recomp & RSPRecomp to root directory
|
||||||
|
cp cmake-build/N64Recomp ..
|
||||||
|
cp cmake-build/RSPRecomp ..
|
||||||
|
- name: Run N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
./N64Recomp us.rev1.toml
|
||||||
|
./RSPRecomp aspMain.us.rev1.toml
|
||||||
|
./RSPRecomp njpgdspMain.us.rev1.toml
|
||||||
|
- name: Build ZeldaRecomp
|
||||||
|
run: |-
|
||||||
|
# enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_C_COMPILER=clang-15 -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
||||||
|
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $(nproc)
|
||||||
|
- name: Prepare Archive
|
||||||
|
run: |
|
||||||
|
mv cmake-build/Zelda64Recompiled Zelda64Recompiled
|
||||||
|
rm -rf assets/scss
|
||||||
|
tar -czf Zelda64Recompiled.tar.gz Zelda64Recompiled assets/ gamecontrollerdb.txt
|
||||||
|
- name: Archive Zelda64Recomp
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-${{ runner.os }}-ARM64-${{ matrix.type }}
|
||||||
|
path: Zelda64Recompiled.tar.gz
|
||||||
|
- name: Prepare AppImage
|
||||||
|
run: ./.github/linux/appimage.sh
|
||||||
|
- name: Zelda64Recomp AppImage
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-AppImage-ARM64-${{ matrix.type }}
|
||||||
|
path: Zelda64Recompiled-*.AppImage
|
||||||
|
build-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
type: [ Debug, RelWithDebInfo ]
|
||||||
|
name: windows (${{ matrix.type }})
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
||||||
|
submodules: recursive
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }}
|
||||||
|
- name: Install Windows Dependencies
|
||||||
|
run: |
|
||||||
|
choco install ninja
|
||||||
|
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
|
||||||
|
- name: Download portable LLVM
|
||||||
|
run: |
|
||||||
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
|
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.3/LLVM-19.1.3-Windows-X64.tar.xz" -OutFile "LLVM.tar.xz"
|
||||||
|
New-Item -ItemType Directory -Path portable-llvm > $null
|
||||||
|
7z x LLVM.tar.xz
|
||||||
|
7z x LLVM.tar -oportable-llvm
|
||||||
|
- name: Configure Developer Command Prompt
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1
|
||||||
|
- name: Prepare Build
|
||||||
|
run: |-
|
||||||
|
git clone ${{ secrets.ZRE_REPO_WITH_PAT }}
|
||||||
|
./zre/process.ps1
|
||||||
|
cp ./zre/mm_shader_cache.bin ./shadercache/
|
||||||
|
- name: Build N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
|
||||||
|
cd N64RecompSource
|
||||||
|
git checkout ${{ inputs.N64RECOMP_COMMIT }}
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# enable ccache
|
||||||
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
||||||
|
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
||||||
|
cmake --build cmake-build --config Release --target N64RecompCLI -j $cpuCores
|
||||||
|
cmake --build cmake-build --config Release --target RSPRecomp -j $cpuCores
|
||||||
|
|
||||||
|
# Copy N64Recomp & RSPRecomp to root directory
|
||||||
|
cp cmake-build/N64Recomp.exe ..
|
||||||
|
cp cmake-build/RSPRecomp.exe ..
|
||||||
|
- name: Run N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
./N64Recomp.exe us.rev1.toml
|
||||||
|
./RSPRecomp.exe aspMain.us.rev1.toml
|
||||||
|
./RSPRecomp.exe njpgdspMain.us.rev1.toml
|
||||||
|
- name: Build ZeldaRecomp
|
||||||
|
run: |-
|
||||||
|
# enable ccache
|
||||||
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
||||||
|
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
|
||||||
|
|
||||||
|
# remove LLVM from PATH so it doesn't overshadow the one provided by VS
|
||||||
|
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -DPATCHES_C_COMPILER="..\portable-llvm\LLVM-19.1.3-Windows-X64\bin\clang" -DPATCHES_LD="..\portable-llvm\LLVM-19.1.3-Windows-X64\bin\ld.lld" -G Ninja -S . -B cmake-build -DCMAKE_CXX_FLAGS="-Xclang -fexceptions -Xclang -fcxx-exceptions"
|
||||||
|
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $cpuCores
|
||||||
|
env:
|
||||||
|
SDL2_VERSION: ${{ inputs.SDL2_VERSION }}
|
||||||
|
- name: Prepare Archive
|
||||||
|
run: |
|
||||||
|
Move-Item -Path "cmake-build/Zelda64Recompiled.exe" -Destination "Zelda64Recompiled.exe"
|
||||||
|
Move-Item -Path "cmake-build/dxcompiler.dll" -Destination "dxcompiler.dll"
|
||||||
|
Move-Item -Path "cmake-build/dxil.dll" -Destination "dxil.dll"
|
||||||
|
Move-Item -Path "cmake-build/SDL2.dll" -Destination "SDL2.dll"
|
||||||
|
Move-Item -Path "cmake-build/Zelda64Recompiled.pdb" -Destination "Zelda64Recompiled.pdb"
|
||||||
|
Remove-Item -Path "assets/scss" -Recurse -Force
|
||||||
|
- name: Archive Zelda64Recomp
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}
|
||||||
|
path: |
|
||||||
|
Zelda64Recompiled.exe
|
||||||
|
dxcompiler.dll
|
||||||
|
dxil.dll
|
||||||
|
SDL2.dll
|
||||||
|
assets/
|
||||||
|
gamecontrollerdb.txt
|
||||||
|
- name: Archive Debug Files
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-PDB-${{ matrix.type }}
|
||||||
|
path: |
|
||||||
|
Zelda64Recompiled.pdb
|
||||||
|
build-macos:
|
||||||
|
runs-on: blaze/macos-14
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
type: [ Debug, Release ]
|
||||||
|
name: macos (x64, arm64, ${{ matrix.type }})
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha || github.ref }}
|
||||||
|
submodules: recursive
|
||||||
|
- name: ccache
|
||||||
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
|
with:
|
||||||
|
key: ${{ runner.os }}-z64re-ccache-${{ matrix.type }}
|
||||||
|
- name: Homebrew Setup
|
||||||
|
run: |
|
||||||
|
brew install ninja
|
||||||
|
brew uninstall --ignore-dependencies libpng freetype
|
||||||
|
- name: MacPorts Setup
|
||||||
|
uses: melusina-org/setup-macports@v1
|
||||||
|
id: 'macports'
|
||||||
|
with:
|
||||||
|
parameters: '.github/macos/macports.yaml'
|
||||||
|
- name: Prepare Build
|
||||||
|
run: |-
|
||||||
|
git clone ${{ secrets.ZRE_REPO_WITH_PAT }}
|
||||||
|
./zre/process.sh
|
||||||
|
cp ./zre/mm_shader_cache.bin ./shadercache/
|
||||||
|
- name: Build N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource
|
||||||
|
cd N64RecompSource
|
||||||
|
git checkout ${{ inputs.N64RECOMP_COMMIT }}
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
# enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
# Build N64Recomp & RSPRecomp
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
||||||
|
cmake --build cmake-build --config Release --target N64Recomp -j $(sysctl -n hw.ncpu)
|
||||||
|
cmake --build cmake-build --config Release --target RSPRecomp -j $(sysctl -n hw.ncpu)
|
||||||
|
|
||||||
|
# Copy N64Recomp & RSPRecomp to root directory
|
||||||
|
cp cmake-build/N64Recomp ..
|
||||||
|
cp cmake-build/RSPRecomp ..
|
||||||
|
- name: Run N64Recomp & RSPRecomp
|
||||||
|
run: |
|
||||||
|
./N64Recomp us.rev1.toml
|
||||||
|
./RSPRecomp aspMain.us.rev1.toml
|
||||||
|
./RSPRecomp njpgdspMain.us.rev1.toml
|
||||||
|
- name: Build ZeldaRecomp
|
||||||
|
run: |-
|
||||||
|
# enable ccache
|
||||||
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
||||||
|
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build \
|
||||||
|
-DPATCHES_LD=/opt/local/bin/ld.lld-mp-18 -DCMAKE_AR=/opt/local/bin/llvm-ar-mp-18 -DPATCHES_C_COMPILER=/opt/local/bin/clang-mp-18 \
|
||||||
|
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
|
||||||
|
cmake --build cmake-build --config ${{ matrix.type }} --target Zelda64Recompiled -j $(sysctl -n hw.ncpu)
|
||||||
|
- name: Prepare Archive
|
||||||
|
run: |
|
||||||
|
mv cmake-build/Zelda64Recompiled.app Zelda64Recompiled.app
|
||||||
|
zip -r -y Zelda64Recompiled.zip Zelda64Recompiled.app
|
||||||
|
- name: Archive Zelda64Recomp
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}
|
||||||
|
path: Zelda64Recompiled.zip
|
16
.gitignore
vendored
16
.gitignore
vendored
@ -1,6 +1,8 @@
|
|||||||
# VSCode file settings
|
# VSCode file settings
|
||||||
.vscode/settings.json
|
.vscode/settings.json
|
||||||
.vscode/c_cpp_properties.json
|
.vscode/c_cpp_properties.json
|
||||||
|
.vscode/launch.json
|
||||||
|
.vscode/tasks.json
|
||||||
|
|
||||||
# Input elf and rom files
|
# Input elf and rom files
|
||||||
*.elf
|
*.elf
|
||||||
@ -53,3 +55,17 @@ imgui.ini
|
|||||||
rt64.log
|
rt64.log
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
# Recompiler Linux binary
|
||||||
|
N64Recomp
|
||||||
|
RSPRecomp
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Controller mappings file
|
||||||
|
gamecontrollerdb.txt
|
||||||
|
|
||||||
|
# Cmake build directory
|
||||||
|
.cache
|
||||||
|
.idea
|
||||||
|
build-*
|
||||||
|
cmake-build-*
|
9
.gitmodules
vendored
9
.gitmodules
vendored
@ -1,9 +1,6 @@
|
|||||||
[submodule "lib/RmlUi"]
|
[submodule "lib/RmlUi"]
|
||||||
path = lib/RmlUi
|
path = lib/RmlUi
|
||||||
url = https://github.com/mikke89/RmlUi/
|
url = https://github.com/mikke89/RmlUi/
|
||||||
[submodule "lib/nativefiledialog-extended"]
|
|
||||||
path = lib/nativefiledialog-extended
|
|
||||||
url = https://github.com/btzy/nativefiledialog-extended
|
|
||||||
[submodule "lib/rt64"]
|
[submodule "lib/rt64"]
|
||||||
path = lib/rt64
|
path = lib/rt64
|
||||||
url = https://github.com/rt64/rt64
|
url = https://github.com/rt64/rt64
|
||||||
@ -16,3 +13,9 @@
|
|||||||
[submodule "lib/lunasvg"]
|
[submodule "lib/lunasvg"]
|
||||||
path = lib/lunasvg
|
path = lib/lunasvg
|
||||||
url = https://github.com/sammycage/lunasvg
|
url = https://github.com/sammycage/lunasvg
|
||||||
|
[submodule "lib/N64ModernRuntime"]
|
||||||
|
path = lib/N64ModernRuntime
|
||||||
|
url = https://github.com/N64Recomp/N64ModernRuntime.git
|
||||||
|
[submodule "Zelda64RecompSyms"]
|
||||||
|
path = Zelda64RecompSyms
|
||||||
|
url = https://github.com/Zelda64Recomp/Zelda64RecompSyms
|
||||||
|
77
BUILDING.md
Normal file
77
BUILDING.md
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
# Building Guide
|
||||||
|
|
||||||
|
This guide will help you build the project on your local machine. The process will require you to provide a decompressed ROM of the US version of the game.
|
||||||
|
|
||||||
|
These steps cover: decompressing the ROM, running the recompiler and finally building the project.
|
||||||
|
|
||||||
|
## 1. Clone the Zelda64Recomp Repository
|
||||||
|
This project makes use of submodules so you will need to clone the repository with the `--recurse-submodules` flag.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone --recurse-submodules
|
||||||
|
# if you forgot to clone with --recurse-submodules
|
||||||
|
# cd /path/to/cloned/repo && git submodule update --init --recursive
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. Install Dependencies
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
For Linux the instructions for Ubuntu are provided, but you can find the equivalent packages for your preferred distro.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# For Ubuntu, simply run:
|
||||||
|
sudo apt-get install cmake ninja-build libsdl2-dev libgtk-3-dev lld llvm clang
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
You will need to install [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/).
|
||||||
|
In the setup process you'll need to select the following options and tools for installation:
|
||||||
|
- Desktop development with C++
|
||||||
|
- C++ Clang Compiler for Windows
|
||||||
|
- C++ CMake tools for Windows
|
||||||
|
|
||||||
|
The other tool necessary will be `make` which can be installe via [Chocolatey](https://chocolatey.org/):
|
||||||
|
```bash
|
||||||
|
choco install make
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. Decompressing the target ROM
|
||||||
|
You will need to decompress the NTSC-U N64 Majora's Mask ROM (sha1: d6133ace5afaa0882cf214cf88daba39e266c078) before running the recompiler.
|
||||||
|
|
||||||
|
There are a few tools that can do it:
|
||||||
|
* This python script from the Majora's Mask decompilation project: https://github.com/zeldaret/mm/blob/main/tools/decompress_baserom.py
|
||||||
|
* https://github.com/z64tools/z64decompress
|
||||||
|
|
||||||
|
Regardless of which method you use, copy the decompressed ROM to the root of the Zelda64Recomp repository with this filename:
|
||||||
|
- `mm.us.rev1.rom_uncompressed.z64`
|
||||||
|
|
||||||
|
## 4. Generating the C code
|
||||||
|
|
||||||
|
Now that you have the required files, you must build [N64Recomp](https://github.com/Mr-Wiseguy/N64Recomp) and run it to generate the C code to be compiled. The building instructions can be found [here](https://github.com/Mr-Wiseguy/N64Recomp?tab=readme-ov-file#building). That will build the executables: `N64Recomp` and `RSPRecomp` which you should copy to the root of the Zelda64Recomp repository.
|
||||||
|
|
||||||
|
After that, go back to the repository root, and run the following commands:
|
||||||
|
```bash
|
||||||
|
./N64Recomp us.rev1.toml
|
||||||
|
./RSPRecomp aspMain.us.rev1.toml
|
||||||
|
./RSPRecomp njpgdspMain.us.rev1.toml
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. Building the Project
|
||||||
|
|
||||||
|
Finally, you can build the project! :rocket:
|
||||||
|
|
||||||
|
On Windows, you can open the repository folder with Visual Studio, and you'll be able to `[build / run / debug]` the project from there.
|
||||||
|
|
||||||
|
If you prefer the command line or you're on a Unix platform you can build the project using CMake:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake -S . -B build-cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -G Ninja -DCMAKE_BUILD_TYPE=Release # or Debug if you want to debug
|
||||||
|
cmake --build build-cmake --target Zelda64Recompiled -j$(nproc) --config Release # or Debug
|
||||||
|
```
|
||||||
|
|
||||||
|
## 6. Success
|
||||||
|
|
||||||
|
Voilà! You should now have a `Zelda64Recompiled` executable in the build directory! If you used Visual Studio this will be `out/build/x64-[Configuration]` and if you used the provided CMake commands then this will be `build-cmake`. You will need to run the executable out of the root folder of this project or copy the assets folder to the build folder to run it.
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> In the game itself, you should be using a standard ROM, not the decompressed one.
|
251
CMakeLists.txt
251
CMakeLists.txt
@ -1,27 +1,43 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
project(Zelda64Recompiled)
|
|
||||||
|
if (APPLE)
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
project(Zelda64Recompiled LANGUAGES C CXX)
|
||||||
set(CMAKE_C_STANDARD 17)
|
set(CMAKE_C_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
# set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
# set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-everything -Wall -Wextra")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-everything /W4")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Opt out of constexpr mutex constructor on windows to prevent vcredist issues
|
||||||
|
if (WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
enable_language(OBJC OBJCXX)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
|
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
|
||||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
||||||
cmake_policy(SET CMP0135 NEW)
|
cmake_policy(SET CMP0135 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
set(LINUX TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/")
|
if (WIN32)
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/lib/")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(RT64_STATIC TRUE)
|
||||||
|
set(RT64_SDL_WINDOW_VULKAN TRUE)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/rt64 ${CMAKE_BINARY_DIR}/rt64)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/rt64 ${CMAKE_BINARY_DIR}/rt64)
|
||||||
|
|
||||||
# set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
|
# set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
|
||||||
@ -29,13 +45,13 @@ set(BUILD_SHARED_LIBS OFF)
|
|||||||
SET(LUNASVG_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
SET(LUNASVG_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/lunasvg)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/lunasvg)
|
||||||
# set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
|
# set(BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS_SAVED}")
|
||||||
SET(ENABLE_SVG_PLUGIN OFF CACHE BOOL "" FORCE)
|
SET(ENABLE_SVG_PLUGIN ON CACHE BOOL "" FORCE)
|
||||||
|
SET(RMLUI_TESTS_ENABLED OFF CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/RmlUi)
|
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/RmlUi)
|
||||||
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/nativefiledialog-extended)
|
|
||||||
|
add_subdirectory(${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime)
|
||||||
|
|
||||||
target_include_directories(rt64 PRIVATE ${CMAKE_BINARY_DIR}/rt64/src)
|
target_include_directories(rt64 PRIVATE ${CMAKE_BINARY_DIR}/rt64/src)
|
||||||
get_target_property(RT64_BASENAME rt64 OUTPUT_NAME)
|
|
||||||
set(RT64_DLL ${RT64_BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
||||||
|
|
||||||
# RecompiledFuncs - Library containing the primary recompiler output
|
# RecompiledFuncs - Library containing the primary recompiler output
|
||||||
add_library(RecompiledFuncs STATIC)
|
add_library(RecompiledFuncs STATIC)
|
||||||
@ -43,10 +59,15 @@ add_library(RecompiledFuncs STATIC)
|
|||||||
target_compile_options(RecompiledFuncs PRIVATE
|
target_compile_options(RecompiledFuncs PRIVATE
|
||||||
# -Wno-unused-but-set-variable
|
# -Wno-unused-but-set-variable
|
||||||
-fno-strict-aliasing
|
-fno-strict-aliasing
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-implicit-function-declaration
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(RecompiledFuncs PRIVATE
|
target_include_directories(RecompiledFuncs PRIVATE
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/N64Recomp/include
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB FUNC_C_SOURCES ${CMAKE_SOURCE_DIR}/RecompiledFuncs/*.c)
|
file(GLOB FUNC_C_SOURCES ${CMAKE_SOURCE_DIR}/RecompiledFuncs/*.c)
|
||||||
@ -60,10 +81,15 @@ add_library(PatchesLib STATIC)
|
|||||||
target_compile_options(PatchesLib PRIVATE
|
target_compile_options(PatchesLib PRIVATE
|
||||||
# -Wno-unused-but-set-variable
|
# -Wno-unused-but-set-variable
|
||||||
-fno-strict-aliasing
|
-fno-strict-aliasing
|
||||||
|
-Wno-unused-variable
|
||||||
|
-Wno-implicit-function-declaration
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(PatchesLib PRIVATE
|
target_include_directories(PatchesLib PRIVATE
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/N64Recomp/include
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(PatchesLib PRIVATE
|
target_sources(PatchesLib PRIVATE
|
||||||
@ -74,10 +100,18 @@ target_sources(PatchesLib PRIVATE
|
|||||||
set_source_files_properties(${CMAKE_SOURCE_DIR}/RecompiledPatches/patches.c PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
|
set_source_files_properties(${CMAKE_SOURCE_DIR}/RecompiledPatches/patches.c PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
|
||||||
|
|
||||||
# Build patches elf
|
# Build patches elf
|
||||||
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/patches/patches.bin
|
if(NOT DEFINED PATCHES_C_COMPILER)
|
||||||
COMMAND make
|
set(PATCHES_C_COMPILER clang)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED PATCHES_LD)
|
||||||
|
set(PATCHES_LD ld.lld)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_custom_target(PatchesBin
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env CC=${PATCHES_C_COMPILER} LD=${PATCHES_LD} make
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/patches
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/patches
|
||||||
BYPRODUCTS ${CMAKE_SOURCE_DIR}/patches/patches.bin}
|
BYPRODUCTS ${CMAKE_SOURCE_DIR}/patches/patches.elf
|
||||||
)
|
)
|
||||||
|
|
||||||
# Generate patches_bin.c from patches.bin
|
# Generate patches_bin.c from patches.bin
|
||||||
@ -86,52 +120,38 @@ add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/RecompiledPatches/patches_bin.c
|
|||||||
DEPENDS ${CMAKE_SOURCE_DIR}/patches/patches.bin
|
DEPENDS ${CMAKE_SOURCE_DIR}/patches/patches.bin
|
||||||
)
|
)
|
||||||
|
|
||||||
# Recompile patches elf into patches.c
|
# Recompile patches elf into patches.c and patches.bin
|
||||||
add_custom_command(OUTPUT
|
add_custom_command(OUTPUT
|
||||||
|
${CMAKE_SOURCE_DIR}/patches/patches.bin
|
||||||
${CMAKE_SOURCE_DIR}/RecompiledPatches/patches.c
|
${CMAKE_SOURCE_DIR}/RecompiledPatches/patches.c
|
||||||
${CMAKE_SOURCE_DIR}/RecompiledPatches/recomp_overlays.inl
|
${CMAKE_SOURCE_DIR}/RecompiledPatches/recomp_overlays.inl
|
||||||
${CMAKE_SOURCE_DIR}/RecompiledPatches/funcs.h
|
${CMAKE_SOURCE_DIR}/RecompiledPatches/funcs.h
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/patch_loading.cpp
|
# TODO: Look into why modifying patches requires two builds to take
|
||||||
COMMAND RecompPort patches.toml && ${CMAKE_COMMAND} -E touch ${CMAKE_SOURCE_DIR}/src/recomp/patch_loading.cpp
|
COMMAND ./N64Recomp patches.toml
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/patches/patches.bin
|
DEPENDS ${CMAKE_SOURCE_DIR}/patches/patches.elf
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Download controller db file for controller support via SDL2
|
||||||
|
set(GAMECONTROLLERDB_COMMIT "b1e4090b3d4266e55feb0793efa35792e05faf66")
|
||||||
|
set(GAMECONTROLLERDB_URL "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/${GAMECONTROLLERDB_COMMIT}/gamecontrollerdb.txt")
|
||||||
|
|
||||||
|
file(DOWNLOAD ${GAMECONTROLLERDB_URL} ${CMAKE_SOURCE_DIR}/gamecontrollerdb.txt
|
||||||
|
TLS_VERIFY ON)
|
||||||
|
|
||||||
|
add_custom_target(DownloadGameControllerDB
|
||||||
|
DEPENDS ${CMAKE_SOURCE_DIR}/gamecontrollerdb.txt)
|
||||||
|
|
||||||
# Main executable
|
# Main executable
|
||||||
add_executable(Zelda64Recompiled)
|
add_executable(Zelda64Recompiled)
|
||||||
|
add_dependencies(Zelda64Recompiled DownloadGameControllerDB)
|
||||||
|
|
||||||
set (SOURCES
|
set (SOURCES
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/audio.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/events.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/mesgqueue.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/misc_ultra.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/port_main.c
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/scheduler.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/task_win32.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/threads.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/timer.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/ultramodern/ultrainit.cpp
|
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/ai.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/cont.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/dp.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/eep.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/euc-jp.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/flash.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/math_routines.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/overlays.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/patch_loading.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/pak.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/pi.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/ultra_stubs.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/ultra_translation.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/print.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/recomp.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/rt64_layer.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/sp.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/recomp/vi.cpp
|
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/src/main/main.cpp
|
${CMAKE_SOURCE_DIR}/src/main/main.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/main/support.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/main/register_overlays.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/main/register_patches.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/main/rt64_render_context.cpp
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/src/game/input.cpp
|
${CMAKE_SOURCE_DIR}/src/game/input.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/game/controls.cpp
|
${CMAKE_SOURCE_DIR}/src/game/controls.cpp
|
||||||
@ -140,21 +160,13 @@ set (SOURCES
|
|||||||
${CMAKE_SOURCE_DIR}/src/game/debug.cpp
|
${CMAKE_SOURCE_DIR}/src/game/debug.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/game/quicksaving.cpp
|
${CMAKE_SOURCE_DIR}/src/game/quicksaving.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/game/recomp_api.cpp
|
${CMAKE_SOURCE_DIR}/src/game/recomp_api.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/game/rom_decompression.cpp
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/ui_renderer.cpp
|
${CMAKE_SOURCE_DIR}/src/ui/ui_renderer.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/ui_launcher.cpp
|
${CMAKE_SOURCE_DIR}/src/ui/ui_launcher.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/ui_config.cpp
|
${CMAKE_SOURCE_DIR}/src/ui/ui_config.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/ui_color_hack.cpp
|
${CMAKE_SOURCE_DIR}/src/ui/ui_color_hack.cpp
|
||||||
|
${CMAKE_SOURCE_DIR}/src/ui/ui_rml_hacks.cpp
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FontEngineInterfaceScaled.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FontFace.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FontFaceHandleScaled.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FontFaceLayer.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FontFamily.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FontProvider.cpp
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/FontEngineScaled/FreeTypeInterface.cpp
|
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/src/ui/ScaledSVG/ElementScaledSVG.cpp
|
|
||||||
|
|
||||||
${CMAKE_SOURCE_DIR}/rsp/aspMain.cpp
|
${CMAKE_SOURCE_DIR}/rsp/aspMain.cpp
|
||||||
${CMAKE_SOURCE_DIR}/rsp/njpgdspMain.cpp
|
${CMAKE_SOURCE_DIR}/rsp/njpgdspMain.cpp
|
||||||
@ -162,8 +174,13 @@ set (SOURCES
|
|||||||
${CMAKE_SOURCE_DIR}/lib/RmlUi/Backends/RmlUi_Platform_SDL.cpp
|
${CMAKE_SOURCE_DIR}/lib/RmlUi/Backends/RmlUi_Platform_SDL.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
list(APPEND SOURCES ${CMAKE_SOURCE_DIR}/src/main/support_apple.mm)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(Zelda64Recompiled PRIVATE
|
target_include_directories(Zelda64Recompiled PRIVATE
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${CMAKE_SOURCE_DIR}/include
|
||||||
|
${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/N64Recomp/include
|
||||||
${CMAKE_SOURCE_DIR}/lib/concurrentqueue
|
${CMAKE_SOURCE_DIR}/lib/concurrentqueue
|
||||||
${CMAKE_SOURCE_DIR}/lib/GamepadMotionHelpers
|
${CMAKE_SOURCE_DIR}/lib/GamepadMotionHelpers
|
||||||
${CMAKE_SOURCE_DIR}/lib/RmlUi/Include
|
${CMAKE_SOURCE_DIR}/lib/RmlUi/Include
|
||||||
@ -175,23 +192,48 @@ target_include_directories(Zelda64Recompiled PRIVATE
|
|||||||
${CMAKE_SOURCE_DIR}/lib/rt64/src/rhi
|
${CMAKE_SOURCE_DIR}/lib/rt64/src/rhi
|
||||||
${CMAKE_SOURCE_DIR}/lib/rt64/src/render
|
${CMAKE_SOURCE_DIR}/lib/rt64/src/render
|
||||||
${CMAKE_SOURCE_DIR}/lib/freetype-windows-binaries/include
|
${CMAKE_SOURCE_DIR}/lib/freetype-windows-binaries/include
|
||||||
${CMAKE_SOURCE_DIR}/lib/lib/nativefiledialog-extended/src/include
|
${CMAKE_SOURCE_DIR}/lib/rt64/src/contrib/nativefiledialog-extended/src/include
|
||||||
${CMAKE_BINARY_DIR}/shaders
|
${CMAKE_BINARY_DIR}/shaders
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_options(Zelda64Recompiled PRIVATE
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
|
||||||
|
target_compile_options(Zelda64Recompiled PRIVATE
|
||||||
-march=nehalem
|
-march=nehalem
|
||||||
-fno-strict-aliasing
|
-fno-strict-aliasing
|
||||||
-fms-extensions
|
-fms-extensions
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
target_compile_options(Zelda64Recompiled PRIVATE
|
||||||
|
-fno-strict-aliasing
|
||||||
|
-fms-extensions
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
# Disable identical code folding, since this breaks mod function patching as multiple functions can get merged into one.
|
||||||
|
target_link_options(Zelda64Recompiled PRIVATE /OPT:NOICF)
|
||||||
|
elseif (APPLE)
|
||||||
|
# Use a wrapper around ld64 that respects segprot's `max_prot` value in order
|
||||||
|
# to make our executable memory writable (required for mod function patching)
|
||||||
|
target_link_options(Zelda64Recompiled PRIVATE
|
||||||
|
"-fuse-ld=${CMAKE_SOURCE_DIR}/.github/macos/ld64"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
|
if (DEFINED ENV{SDL2_VERSION})
|
||||||
|
set(SDL2_VERSION $ENV{SDL2_VERSION})
|
||||||
|
else()
|
||||||
|
set(SDL2_VERSION "2.30.3")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Fetch SDL2 on windows
|
# Fetch SDL2 on windows
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
sdl2
|
sdl2
|
||||||
URL https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip
|
URL https://github.com/libsdl-org/SDL/releases/download/release-${SDL2_VERSION}/SDL2-devel-${SDL2_VERSION}-VC.zip
|
||||||
URL_HASH MD5=d8173db078e54040c666f411c5a6afff
|
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(sdl2)
|
FetchContent_MakeAvailable(sdl2)
|
||||||
target_include_directories(Zelda64Recompiled PRIVATE
|
target_include_directories(Zelda64Recompiled PRIVATE
|
||||||
@ -219,12 +261,69 @@ if (WIN32)
|
|||||||
)
|
)
|
||||||
|
|
||||||
target_sources(Zelda64Recompiled PRIVATE ${CMAKE_SOURCE_DIR}/icons/app.rc)
|
target_sources(Zelda64Recompiled PRIVATE ${CMAKE_SOURCE_DIR}/icons/app.rc)
|
||||||
|
target_link_libraries(Zelda64Recompiled PRIVATE SDL2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
find_package(SDL2 REQUIRED)
|
||||||
|
target_include_directories(Zelda64Recompiled PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||||
|
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
target_link_libraries(Zelda64Recompiled PRIVATE ${CMAKE_DL_LIBS} Threads::Threads SDL2::SDL2)
|
||||||
|
|
||||||
|
include(${CMAKE_SOURCE_DIR}/.github/macos/apple_bundle.cmake)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
find_package(SDL2 REQUIRED)
|
||||||
|
find_package(X11 REQUIRED)
|
||||||
|
|
||||||
|
add_compile_definitions("RT64_SDL_WINDOW_VULKAN")
|
||||||
|
|
||||||
|
# Generate icon_bytes.c from the app icon PNG.
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h
|
||||||
|
COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/512.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h
|
||||||
|
DEPENDS ${CMAKE_SOURCE_DIR}/icons/512.png
|
||||||
|
)
|
||||||
|
target_sources(Zelda64Recompiled PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c)
|
||||||
|
|
||||||
|
message(STATUS "SDL2_FOUND = ${SDL2_FOUND}")
|
||||||
|
message(STATUS "SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
|
||||||
|
|
||||||
|
target_include_directories(Zelda64Recompiled PRIVATE ${SDL2_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
message(STATUS "X11_FOUND = ${X11_FOUND}")
|
||||||
|
message(STATUS "X11_Xrandr_FOUND = ${X11_Xrandr_FOUND}")
|
||||||
|
message(STATUS "X11_INCLUDE_DIR = ${X11_INCLUDE_DIR}")
|
||||||
|
message(STATUS "X11_LIBRARIES = ${X11_LIBRARIES}")
|
||||||
|
|
||||||
|
target_include_directories(Zelda64Recompiled PRIVATE ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
|
||||||
|
target_link_libraries(Zelda64Recompiled PRIVATE ${X11_LIBRARIES} ${X11_Xrandr_LIB})
|
||||||
|
|
||||||
|
find_package(Freetype REQUIRED)
|
||||||
|
|
||||||
|
message(STATUS "FREETYPE_FOUND = ${FREETYPE_FOUND}")
|
||||||
|
message(STATUS "FREETYPE_INCLUDE_DIRS = ${FREETYPE_INCLUDE_DIRS}")
|
||||||
|
message(STATUS "FREETYPE_LIBRARIES = ${FREETYPE_LIBRARIES}")
|
||||||
|
|
||||||
|
include_directories(${FREETYPE_LIBRARIES})
|
||||||
|
target_link_libraries(Zelda64Recompiled PRIVATE ${FREETYPE_LIBRARIES} SDL2::SDL2)
|
||||||
|
|
||||||
|
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
|
||||||
|
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
target_link_libraries(Zelda64Recompiled PRIVATE "-latomic -static-libstdc++" ${CMAKE_DL_LIBS} Threads::Threads)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(Zelda64Recompiled PRIVATE
|
target_link_libraries(Zelda64Recompiled PRIVATE
|
||||||
PatchesLib
|
PatchesLib
|
||||||
RecompiledFuncs
|
RecompiledFuncs
|
||||||
SDL2
|
librecomp
|
||||||
|
ultramodern
|
||||||
rt64
|
rt64
|
||||||
RmlCore
|
RmlCore
|
||||||
RmlDebugger
|
RmlDebugger
|
||||||
@ -247,18 +346,26 @@ if (${WIN32})
|
|||||||
set (DXC "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxc.exe")
|
set (DXC "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxc.exe")
|
||||||
add_compile_definitions(NOMINMAX)
|
add_compile_definitions(NOMINMAX)
|
||||||
else()
|
else()
|
||||||
set (DXC "LD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/src/contrib/dxc/lib/x64" "${PROJECT_SOURCE_DIR}/src/contrib/dxc/bin/x64/dxc")
|
if (APPLE)
|
||||||
|
# Apple's binary is universal, so it'll work on both x86_64 and arm64
|
||||||
|
set (DXC "DYLD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/lib/arm64" "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/arm64/dxc-macos")
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
|
||||||
|
set(SPIRVCROSS "DYLD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/spirv-cross/lib/x64" "${PROJECT_SOURCE_DIR}/lib/rt64//src/contrib/spirv-cross/bin/x64/spirv-cross")
|
||||||
|
else()
|
||||||
|
set(SPIRVCROSS "DYLD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/spirv-cross/lib/arm64" "${PROJECT_SOURCE_DIR}/lib/rt64//src/contrib/spirv-cross/bin/x64/spirv-cross")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64")
|
||||||
|
set (DXC "LD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/lib/x64" "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/x64/dxc-linux")
|
||||||
|
else()
|
||||||
|
set (DXC "LD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/lib/arm64" "${PROJECT_SOURCE_DIR}/lib/rt64/src/contrib/dxc/bin/arm64/dxc-linux")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
build_vertex_shader(Zelda64Recompiled "shaders/InterfaceVS.hlsl" "shaders/InterfaceVS.hlsl")
|
build_vertex_shader(Zelda64Recompiled "shaders/InterfaceVS.hlsl" "shaders/InterfaceVS.hlsl")
|
||||||
build_pixel_shader (Zelda64Recompiled "shaders/InterfacePS.hlsl" "shaders/InterfacePS.hlsl")
|
build_pixel_shader(Zelda64Recompiled "shaders/InterfacePS.hlsl" "shaders/InterfacePS.hlsl")
|
||||||
|
|
||||||
target_sources(Zelda64Recompiled PRIVATE ${SOURCES})
|
target_sources(Zelda64Recompiled PRIVATE ${SOURCES})
|
||||||
|
|
||||||
set_property(TARGET Zelda64Recompiled PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
set_property(TARGET Zelda64Recompiled PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
|
||||||
|
|
||||||
add_custom_command(TARGET Zelda64Recompiled POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
|
||||||
${CMAKE_BINARY_DIR}/${RT64_DLL}
|
|
||||||
${CMAKE_SOURCE_DIR}
|
|
||||||
MAIN_DEPENDENCY ${CMAKE_BINARY_DIR}/${RT64_DLL})
|
|
||||||
|
674
COPYING
Normal file
674
COPYING
Normal file
@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
150
README.md
Normal file
150
README.md
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
# Zelda 64: Recompiled
|
||||||
|
Zelda 64: Recompiled is a project that uses [N64: Recompiled](https://github.com/Mr-Wiseguy/N64Recomp) to **statically recompile** Majora's Mask (and soon Ocarina of Time) into a native port with many new features and enhancements. This project uses [RT64](https://github.com/rt64/rt64) as the rendering engine to provide some of these enhancements.
|
||||||
|
|
||||||
|
### [Check out the latest release here](https://github.com/Mr-Wiseguy/Zelda64Recomp/releases/latest).
|
||||||
|
|
||||||
|
### **This repository and its releases do not contain game assets. The original game is required to build or run this project.**
|
||||||
|
|
||||||
|
<div align="left" valign="middle">
|
||||||
|
<a href="https://runblaze.dev">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://www.runblaze.dev/logo_dark.png">
|
||||||
|
<img align="right" src="https://www.runblaze.dev/logo_light.png" height="102px"/>
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<br style="display: none;"/>
|
||||||
|
|
||||||
|
_Special thanks to [Blaze](https://runblaze.dev) for their support of this project. They provide high-performance Linux (AMD64 & ARM64) and Apple Silicon macOS runners for GitHub Actions, greatly reducing our automated build times._
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## Table of Contents
|
||||||
|
* [System Requirements](#system-requirements)
|
||||||
|
* [Features](#features)
|
||||||
|
* [Plug and Play](#plug-and-play)
|
||||||
|
* [Fully Intact N64 Effects](#fully-intact-n64-effects)
|
||||||
|
* [Easy-to-Use Menus](#easy-to-use-menus)
|
||||||
|
* [High Framerate Support](#high-framerate-support)
|
||||||
|
* [Widescreen and Ultrawide Support](#widescreen-and-ultrawide-support)
|
||||||
|
* [Dual Analog Camera](#dual-analog-camera)
|
||||||
|
* [Gyro Aim](#gyro-aim)
|
||||||
|
* [Additional Control Options](#additional-control-options)
|
||||||
|
* [Autosaving](#autosaving)
|
||||||
|
* [Low Input Lag](#low-input-lag)
|
||||||
|
* [Instant Load Times](#instant-load-times)
|
||||||
|
* [Linux and Steam Deck Support](#linux-and-steam-deck-support)
|
||||||
|
* [Planned Features](#planned-features)
|
||||||
|
* [FAQ](#faq)
|
||||||
|
* [Known Issues](#known-issues)
|
||||||
|
* [Building](#building)
|
||||||
|
* [Libraries Used and Projects Referenced](#libraries-used-and-projects-referenced)
|
||||||
|
|
||||||
|
## System Requirements
|
||||||
|
A GPU supporting Direct3D 12.0 (Shader Model 6) or Vulkan 1.2 is required to run this project. The oldest GPUs that should be supported for each vendor are:
|
||||||
|
* GeForce GT 630
|
||||||
|
* Radeon HD 7750 (the one from 2012, not to be confused with the RX 7000 series) and newer
|
||||||
|
* Intel HD 510 (Skylake)
|
||||||
|
|
||||||
|
A CPU supporting the AVX instruction set is also required (Intel Core 2000 series or AMD Bulldozer and newer).
|
||||||
|
|
||||||
|
If you have issues with crashes on startup, make sure your graphics drivers are fully up to date.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
#### Plug and Play
|
||||||
|
Simply provide your copy of the North American version of the game in the main menu and start playing! This project will automatically load assets from the provided copy, so there is no need to go through a separate extraction step or build the game yourself. Other versions of the game may be supported in the future.
|
||||||
|
|
||||||
|
#### Fully Intact N64 Effects
|
||||||
|
A lot of care was put into RT64 to make sure all graphical effects were rendered exactly as they did originally on the N64. No workarounds or "hacks" were made to replicate these effects, with the only modifications to them being made for enhancement purposes such as widescreen support. This includes framebuffer effects like the grayscale cutscenes and the Deku bubble projectile, depth effects like the lens of truth, decals such as shadows or impact textures, accurate lighting, shading effects like the fire arrows and bomb explosions, and various textures that are often rendered incorrectly.
|
||||||
|
|
||||||
|
#### Easy-to-Use Menus
|
||||||
|
Gameplay settings, graphics settings, input mappings, and audio settings can all be configured with the in-game config menu. The menus can all be used with mouse, controller, or keyboard for maximum convenience.
|
||||||
|
|
||||||
|
#### High Framerate Support
|
||||||
|
Play at any framerate you want thanks to functionality provided by RT64! Game objects and terrain, texture scrolling, screen effects, and most HUD elements are all rendered at high framerates. By default, this project is configured to run at your monitor's refresh rate. You can also play at the original framerate of the game if you prefer. **Changing framerate has no effect on gameplay.**
|
||||||
|
|
||||||
|
**Note**: External framerate limiters (such as the NVIDIA Control Panel) are known to potentially cause problems, so if you notice any stuttering then turn them off and use the manual framerate slider in the in-game graphics menu instead.
|
||||||
|
|
||||||
|
#### Widescreen and Ultrawide Support
|
||||||
|
Any aspect ratio is supported, with most effects modded to work correctly in widescreen. The HUD can also be positioned at 16:9 when using ultrawide aspect ratios if preferred.
|
||||||
|
|
||||||
|
**Note**: Some animation quirks can be seen at the edges of the screen in certain cutscenes when using very wide aspect ratios.
|
||||||
|
|
||||||
|
#### Dual Analog Camera
|
||||||
|
Play with a dual analog control layout like later entries in the series! When this option is enabled, the right stick will control the camera. You can still have the C-Buttons mapped to the right stick if you so wish, so long as you also map them to other buttons on the controller. The right stick C-button inputs will be "silenced", except when you take out the ocarina, so you can still play the ocarina with the right stick.
|
||||||
|
|
||||||
|
#### Gyro Aim
|
||||||
|
When playing with a supported controller, first-person items such as the bow can be aimed with your controller's gyro sensor. This includes (but is not limited to) controllers such as the Dualshock 4, Dualsense, Switch Pro, and most third party Switch controllers (such as the 8BitDo Pro 2 in Switch mode).
|
||||||
|
|
||||||
|
**Note**: Gamepad mappers such as BetterJoy or DS4Windows may intercept gyro data and prevent the game from receiving it. Most controllers are natively supported, so turning gamepad mappers off is recommended if you want to use gyro.
|
||||||
|
|
||||||
|
#### Additional Control Options
|
||||||
|
Customize your experience by setting your stick deadzone to your liking, as well as adjusting the X and Y axis inversion for both aiming and the optional dual analog camera.
|
||||||
|
|
||||||
|
#### Autosaving
|
||||||
|
Never worry about losing progress if your power goes out thanks to autosaving! The autosave system is designed to respect Majora's Mask's original save system and maintain the intention of owl saves by triggering automatically and replacing the previous autosave or owl save. However, if you'd still rather play with the untouched save system, simply turn off autosaving in the ingame menu.
|
||||||
|
|
||||||
|
#### Low Input Lag
|
||||||
|
This project has been optimized to have as little input lag as possible, making the game feel more responsive than ever!
|
||||||
|
|
||||||
|
#### Instant Load Times
|
||||||
|
Saving and loading files, going from place to place, and pausing all happen in the blink of an eye thanks to the game running natively on modern hardware.
|
||||||
|
|
||||||
|
#### Linux and Steam Deck Support
|
||||||
|
A Linux binary is available for playing on most up-to-date distros, including on the Steam Deck.
|
||||||
|
|
||||||
|
To play on Steam Deck, extract the Linux build onto your deck. Then, in desktop mode, right click the Zelda64Recompiled executable file and select "Add to Steam". From there, you can return to Gaming mode and configure the controls as needed. See the [Steam Deck gyro aim FAQ section](#how-do-i-set-up-gyro-aiming-on-steam-deck) for more detailed instructions.
|
||||||
|
|
||||||
|
## Planned Features
|
||||||
|
* Ocarina of Time support
|
||||||
|
* Mod support and Randomizer
|
||||||
|
* Texture Packs
|
||||||
|
* Model Replacements
|
||||||
|
* Ray Tracing (via RT64)
|
||||||
|
* Multi-language support with support for loading custom translations
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
#### What is static recompilation?
|
||||||
|
Static recompilation is the process of automatically translating an application from one platform to another. For more details, check out the full description of how this project's recompilation works here: [N64: Recompiled](https://github.com/Mr-Wiseguy/N64Recomp).
|
||||||
|
|
||||||
|
#### How is this related to the decompilation project?
|
||||||
|
Unlike N64 ports in the past, this project is not based on the source code provided by a decompilation of the game. This is because static recompilation bypasses the need for decompiled source code when making a port, allowing ports to be made **without source code**. However, the reverse engineering work done by the decompilation team was invaluable for providing some of the enhancements featured in this project. For this reason, the project uses headers and some functions from the decompilation project in order to make modifications to the game. Many thanks to the decompilation team for all of the hard work they've done.
|
||||||
|
|
||||||
|
#### How do I set up gyro aiming on Steam Deck?
|
||||||
|
This project provides mouse aiming as a way to allow using gyro on Steam Deck, as the Steam Deck's gyro sensors cannot be read directly. First, launch the game in Gaming Mode, press the Steam button and go to "Controller Settings". Choose "Controller Settings" again in the menu that follows, and then set "Gyro Behavior" to "As Mouse".
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
You'll probably also want to change the default behavior so that you don't need to be touching the right stick to allow gyro input. To do so, click on the Gear icon to the right of "Gyro Behavior" and ensure that "Gyro Activation Buttons" is set to "None Selected (Gyro Always On)." If this isn't the case, then select that option and then press "Select None" in the following menu.
|
||||||
|
|
||||||
|
#### Where is the savefile stored?
|
||||||
|
- Windows: `%LOCALAPPDATA%\Zelda64Recompiled\saves`
|
||||||
|
- Linux: `~/.config/Zelda64Recompiled/saves`
|
||||||
|
- macOS: `~/Library/Application Support/Zelda64Recompiled/saves`
|
||||||
|
|
||||||
|
#### How do I choose a different ROM?
|
||||||
|
**You don't.** This project is **only** a port of Majora's Mask (and Ocarina of Time in the future), and it will only accept one specific ROM: the US version of the N64 release of Majora's Mask. ROMs in formats other than .z64 will be automatically converted, as long as it is the correct ROM. **It is not an emulator and it cannot run any arbitrary ROM.**
|
||||||
|
|
||||||
|
If you want to play a modded ROM or in another language, note that support for modding and other languages will be added to the project itself in the future and will not rely on you supplying a different ROM.
|
||||||
|
|
||||||
|
## Known Issues
|
||||||
|
* Intel GPUs on Linux may not currently work. If you have experience with Vulkan development on Linux, help here would be greatly appreciated!
|
||||||
|
* The prebuilt Linux binary may not work correctly on some distributions of Linux. If you encounter such an issue, building the project locally yourself is recommended. A Flatpak or AppImage may be provided in the future to solve this issue. Adding the Linux version to Steam and setting "Steam Linux Runtime" as the compatibility tool or launching it via Gamescope may work around the issue. Alternatively, running the Windows version with Proton is known to work well and may also work around this issue.
|
||||||
|
* Overlays such as MSI Afterburner and other software such as Wallpaper Engine can cause performance issues with this project that prevent the game from rendering correctly. Disabling such software is recommended.
|
||||||
|
|
||||||
|
## Building
|
||||||
|
Building is not required to play this project, as prebuilt binaries (which do not contain game assets) can be found in the [Releases](https://github.com/Mr-Wiseguy/Zelda64Recomp/releases) section. Instructions on how to build this project can be found in the [BUILDING.md](BUILDING.md) file.
|
||||||
|
|
||||||
|
## Libraries Used and Projects Referenced
|
||||||
|
* [RT64](https://github.com/rt64/rt64) for the project's rendering engine
|
||||||
|
* [RmlUi](https://github.com/mikke89/RmlUi) for building the menus and launcher
|
||||||
|
* [lunasvg](https://github.com/sammycage/lunasvg) for SVG rendering, used by RmlUi
|
||||||
|
* [FreeType](https://freetype.org/) for font rendering, used by RmlUi
|
||||||
|
* [moodycamel::ConcurrentQueue](https://github.com/cameron314/concurrentqueue) for semaphores and fast, lock-free MPMC queues
|
||||||
|
* [Gamepad Motion Helpers](https://github.com/JibbSmart/GamepadMotionHelpers) for sensor fusion and calibration algorithms to implement gyro aiming
|
||||||
|
* [Majora's Mask Decompilation](https://github.com/zeldaret/mm) for headers and some function definitions, used for making patches or some enhancements
|
||||||
|
* [Ares emulator](https://github.com/ares-emulator/ares) for RSP vector instruction reference implementations, used in RSP recompilation
|
||||||
|
|
||||||
|
Special thanks to [thecozies](https://github.com/thecozies) for designing and helping implement the launcher and config menus!
|
1
Zelda64RecompSyms
Submodule
1
Zelda64RecompSyms
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit a325f8fa5c48c925616bd43685ef14bbabc29537
|
11
aspMain.us.rev1.toml
Normal file
11
aspMain.us.rev1.toml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
text_offset = 0xC40FF0
|
||||||
|
text_size = 0x1000
|
||||||
|
text_address = 0x04001000
|
||||||
|
rom_file_path = "mm.us.rev1.rom_uncompressed.z64"
|
||||||
|
output_file_path = "rsp/aspMain.cpp"
|
||||||
|
output_function_name = "aspMain"
|
||||||
|
extra_indirect_branch_targets = [
|
||||||
|
0x1F80, 0x1250, 0x1154, 0x1094, 0x1E0C, 0x1514, 0x1E7C, 0x1C90,
|
||||||
|
0x1180, 0x1808, 0x11E8, 0x1ADC, 0x1B6C, 0x1194, 0x1EF8, 0x1240,
|
||||||
|
0x17C0, 0x186C, 0x1A58, 0x18BC, 0x1ABC, 0x1ACC, 0x1A80, 0x1BD4
|
||||||
|
]
|
30
assets/components/prompt.rml
Normal file
30
assets/components/prompt.rml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<template name="prompt">
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body class="prompt">
|
||||||
|
<div class="prompt__overlay" />
|
||||||
|
<div class="prompt__content-wrapper" data-if="promptOpen">
|
||||||
|
<div class="prompt__content">
|
||||||
|
<h3>{{ promptHeader }}</h3>
|
||||||
|
<p>{{ promptContent }}</p>
|
||||||
|
<div class="prompt__controls">
|
||||||
|
<button
|
||||||
|
autofocus="true"
|
||||||
|
id="prompt__confirm-button"
|
||||||
|
class="button button--success"
|
||||||
|
style="nav-left: none; nav-right: #prompt__cancel-button"
|
||||||
|
>
|
||||||
|
<div class="button__label" id="prompt__confirm-button-label">{{ promptConfirmLabel }}</div>
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
id="prompt__cancel-button"
|
||||||
|
class="button button--error"
|
||||||
|
style="nav-right: none; nav-left: #prompt__confirm-button"
|
||||||
|
>
|
||||||
|
<div class="button__label" id="prompt__cancel-button-label">{{ promptCancelLabel }}</div>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</template>
|
@ -28,6 +28,7 @@
|
|||||||
<link type="text/template" href="config_menu/graphics.rml" />
|
<link type="text/template" href="config_menu/graphics.rml" />
|
||||||
<link type="text/template" href="config_menu/sound.rml" />
|
<link type="text/template" href="config_menu/sound.rml" />
|
||||||
<link type="text/template" href="config_menu/debug.rml" />
|
<link type="text/template" href="config_menu/debug.rml" />
|
||||||
|
<link type="text/template" href="components/prompt.rml" />
|
||||||
</head>
|
</head>
|
||||||
<body class="window">
|
<body class="window">
|
||||||
<!-- <handle move_target="#document"> -->
|
<!-- <handle move_target="#document"> -->
|
||||||
@ -42,7 +43,7 @@
|
|||||||
<panel class="config" data-model="general_model">
|
<panel class="config" data-model="general_model">
|
||||||
<template src="config-menu__general" />
|
<template src="config-menu__general" />
|
||||||
</panel>
|
</panel>
|
||||||
<tab class="tab">
|
<tab class="tab" id="tab_controls">
|
||||||
<div>Controls</div>
|
<div>Controls</div>
|
||||||
<div class="tab__indicator"></div>
|
<div class="tab__indicator"></div>
|
||||||
</tab>
|
</tab>
|
||||||
@ -63,7 +64,7 @@
|
|||||||
<panel class="config" data-model="sound_options_model">
|
<panel class="config" data-model="sound_options_model">
|
||||||
<template src="config-menu__sound" />
|
<template src="config-menu__sound" />
|
||||||
</panel>
|
</panel>
|
||||||
<tab class="tab" data-model="debug_model" data-if="debug_enabled">
|
<tab class="tab" data-model="debug_model" data-if="debug_enabled" id="tab_debug">
|
||||||
<div>Debug</div>
|
<div>Debug</div>
|
||||||
<div class="tab__indicator"></div>
|
<div class="tab__indicator"></div>
|
||||||
</tab>
|
</tab>
|
||||||
@ -71,15 +72,23 @@
|
|||||||
<template src="config-menu__debug" />
|
<template src="config-menu__debug" />
|
||||||
</panel>
|
</panel>
|
||||||
</tabset>
|
</tabset>
|
||||||
<!-- Close button absolutely positioned on top right of modal -->
|
<div class="config__icon-buttons">
|
||||||
<button
|
<button
|
||||||
class="icon-button config__exit-button"
|
class="icon-button"
|
||||||
|
onclick="open_quit_game_prompt"
|
||||||
|
id="config__quit-game-button"
|
||||||
|
>
|
||||||
|
<svg src="icons/Quit.svg" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
class="icon-button"
|
||||||
onclick="close_config_menu"
|
onclick="close_config_menu"
|
||||||
style="z-index: 10000;"
|
id="config__close-menu-button"
|
||||||
>
|
>
|
||||||
<svg src="icons/X.svg" />
|
<svg src="icons/X.svg" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="centered-page__controls"
|
class="centered-page__controls"
|
||||||
data-model="nav_help_model"
|
data-model="nav_help_model"
|
||||||
@ -100,6 +109,19 @@
|
|||||||
<label><span style="font-family:promptfont;">↧</span> Accept</label> -->
|
<label><span style="font-family:promptfont;">↧</span> Accept</label> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
id="prompt-root"
|
||||||
|
data-model="prompt_model"
|
||||||
|
data-if="prompt__open"
|
||||||
|
data-alias-promptOpen="prompt__open"
|
||||||
|
data-alias-promptHeader="prompt__header"
|
||||||
|
data-alias-promptContent="prompt__content"
|
||||||
|
data-alias-promptConfirmLabel="prompt__confirmLabel"
|
||||||
|
data-alias-promptCancelLabel="prompt__cancelLabel"
|
||||||
|
data-event-click="prompt__on_click"
|
||||||
|
>
|
||||||
|
<template src="prompt"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- </handle> -->
|
<!-- </handle> -->
|
||||||
<!-- <handle size_target="#document" style="position: absolute; width: 16dp; height: 16dp; bottom: 0px; right: 0px; cursor: resize;"></handle> -->
|
<!-- <handle size_target="#document" style="position: absolute; width: 16dp; height: 16dp; bottom: 0px; right: 0px; cursor: resize;"></handle> -->
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
id="cont_kb_toggle"
|
id="cont_kb_toggle"
|
||||||
data-class-toggle--checked="input_device_is_keyboard"
|
data-class-toggle--checked="input_device_is_keyboard"
|
||||||
onclick="toggle_input_device"
|
onclick="toggle_input_device"
|
||||||
style="nav-down:#input_row_button_0_0"
|
style="nav-down: #input_row_button_0_0; nav-up: #tab_controls"
|
||||||
>
|
>
|
||||||
<div class="toggle__border" />
|
<div class="toggle__border" />
|
||||||
<div class="toggle__floater" />
|
<div class="toggle__floater" />
|
||||||
@ -24,6 +24,7 @@
|
|||||||
<button
|
<button
|
||||||
class="button button--warning"
|
class="button button--warning"
|
||||||
style="nav-down:#input_row_button_0_0"
|
style="nav-down:#input_row_button_0_0"
|
||||||
|
data-event-click="reset_input_bindings_to_defaults"
|
||||||
>
|
>
|
||||||
<div class="button__label">Reset to defaults</div>
|
<div class="button__label">Reset to defaults</div>
|
||||||
</button>
|
</button>
|
||||||
@ -40,6 +41,7 @@
|
|||||||
data-for="input_bindings, i : inputs.array"
|
data-for="input_bindings, i : inputs.array"
|
||||||
data-event-mouseover="set_input_row_focus(i)"
|
data-event-mouseover="set_input_row_focus(i)"
|
||||||
data-class-control-option--active="get_input_enum_name(i)==cur_input_row"
|
data-class-control-option--active="get_input_enum_name(i)==cur_input_row"
|
||||||
|
data-if="!input_device_is_keyboard || (get_input_enum_name(i) != 'TOGGLE_MENU' && get_input_enum_name(i) != 'ACCEPT_MENU' && get_input_enum_name(i) != 'APPLY_MENU')"
|
||||||
>
|
>
|
||||||
<label
|
<label
|
||||||
class="control-option__label"
|
class="control-option__label"
|
||||||
@ -65,6 +67,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
data-if="get_input_enum_name(i) != 'TOGGLE_MENU' && get_input_enum_name(i) != 'ACCEPT_MENU'"
|
||||||
data-event-blur="set_input_row_focus(-1)"
|
data-event-blur="set_input_row_focus(-1)"
|
||||||
data-event-focus="set_input_row_focus(i)"
|
data-event-focus="set_input_row_focus(i)"
|
||||||
data-event-click="clear_input_bindings(i)"
|
data-event-click="clear_input_bindings(i)"
|
||||||
@ -73,6 +76,16 @@
|
|||||||
>
|
>
|
||||||
<svg src="icons/Trash.svg" />
|
<svg src="icons/Trash.svg" />
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
data-if="get_input_enum_name(i) == 'TOGGLE_MENU' || get_input_enum_name(i) == 'ACCEPT_MENU'"
|
||||||
|
data-event-blur="set_input_row_focus(-1)"
|
||||||
|
data-event-focus="set_input_row_focus(i)"
|
||||||
|
data-event-click="reset_single_input_binding_to_default(i)"
|
||||||
|
class="icon-button icon-button--danger"
|
||||||
|
data-attr-style="i == 0 ? 'nav-up:#cont_kb_toggle' : 'nav-up:auto'"
|
||||||
|
>
|
||||||
|
<svg src="icons/Reset.svg" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<div class="config-debug__option-controls">
|
<div class="config-debug__option-controls">
|
||||||
<div class="config-debug__select-wrapper">
|
<div class="config-debug__select-wrapper">
|
||||||
<div class="config-debug__select-label"><div>Region</div></div>
|
<div class="config-debug__select-label"><div>Region</div></div>
|
||||||
<select data-value="area_index" onchange="area_index_changed">
|
<select data-value="area_index" onchange="area_index_changed" id="area_index_select" style="nav-up: #tab_debug">
|
||||||
<option data-for="area, i : area_names" data-attr-value="i">{{area}}</option>
|
<option data-for="area, i : area_names" data-attr-value="i">{{area}}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
<head>
|
<head>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form class="config__form">
|
<form class="config__form" id="conf-general__form">
|
||||||
<div class="config__hz-wrapper">
|
<div class="config__hz-wrapper" id="conf-general__hz-wrapper">
|
||||||
<!-- Options -->
|
<!-- Options -->
|
||||||
<div class="config__wrapper" data-event-mouseout="set_cur_config_index(-1)">
|
<div class="config__wrapper" data-event-mouseout="set_cur_config_index(-1)" id="conf-general__wrapper">
|
||||||
<!-- targeting mode -->
|
<!-- targeting mode -->
|
||||||
<div class="config-option" data-event-mouseover="set_cur_config_index(0)">
|
<div class="config-option" data-event-mouseover="set_cur_config_index(0)" id="conf-general__Targeting-Mode">
|
||||||
<label class="config-option__title">Targeting Mode</label>
|
<label class="config-option__title">Targeting Mode</label>
|
||||||
<div class="config-option__list">
|
<div class="config-option__list">
|
||||||
<input
|
<input
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<div class="config-option" data-event-mouseover="set_cur_config_index(1)">
|
<div class="config-option" data-event-mouseover="set_cur_config_index(1)">
|
||||||
<label class="config-option__title">Rumble Strength</label>
|
<label class="config-option__title">Rumble Strength</label>
|
||||||
<div class="config-option__range-wrapper config-option__list">
|
<div class="config-option__range-wrapper config-option__list">
|
||||||
<label class="config-option__range-label">{{rumble_strength}}</label>
|
<label class="config-option__range-label">{{rumble_strength}}%</label>
|
||||||
<input
|
<input
|
||||||
class="nav-vert"
|
class="nav-vert"
|
||||||
data-event-blur="set_cur_config_index(-1)"
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
@ -54,14 +54,313 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- gyro sensitivity -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(2)">
|
||||||
|
<label class="config-option__title">Gyro Sensitivity</label>
|
||||||
|
<div class="config-option__range-wrapper config-option__list">
|
||||||
|
<label class="config-option__range-label">{{gyro_sensitivity}}%</label>
|
||||||
|
<input
|
||||||
|
class="nav-vert"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(2)"
|
||||||
|
id="gyro_sensitivity_input"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
style="flex: 1; margin: 0dp;"
|
||||||
|
data-value="gyro_sensitivity"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- mouse sensitivity -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(3)">
|
||||||
|
<label class="config-option__title">Mouse Sensitivity</label>
|
||||||
|
<div class="config-option__range-wrapper config-option__list">
|
||||||
|
<label class="config-option__range-label">{{mouse_sensitivity}}%</label>
|
||||||
|
<input
|
||||||
|
class="nav-vert"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(3)"
|
||||||
|
id="mouse_sensitivity_input"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
style="flex: 1; margin: 0dp;"
|
||||||
|
data-value="mouse_sensitivity"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- joystick deadzone -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(4)">
|
||||||
|
<label class="config-option__title">Joystick Deadzone</label>
|
||||||
|
<div class="config-option__range-wrapper config-option__list">
|
||||||
|
<label class="config-option__range-label">{{joystick_deadzone}}%</label>
|
||||||
|
<input
|
||||||
|
class="nav-vert"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(4)"
|
||||||
|
id="joystick_deadzone_input"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
style="flex: 1; margin: 0dp; nav-down: #bg_input_enabled"
|
||||||
|
data-value="joystick_deadzone"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- background input -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(5)" id="conf-general__Background-Input">
|
||||||
|
<label class="config-option__title">Background Input</label>
|
||||||
|
<div class="config-option__list">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(5)"
|
||||||
|
name="background_input_mode"
|
||||||
|
data-checked="background_input_mode"
|
||||||
|
value="On"
|
||||||
|
id="bg_input_enabled"
|
||||||
|
style="nav-up: #joystick_deadzone_input; nav-down: #autosave_enabled"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="bg_input_enabled">On</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(5)"
|
||||||
|
name="background_input_mode"
|
||||||
|
data-checked="background_input_mode"
|
||||||
|
value="Off"
|
||||||
|
id="bg_input_disabled"
|
||||||
|
style="nav-up: #joystick_deadzone_input; nav-down: #autosave_disabled"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="bg_input_disabled">Off</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- autosave -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(6)">
|
||||||
|
<label class="config-option__title">Autosaving</label>
|
||||||
|
<div class="config-option__list">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(6)"
|
||||||
|
name="autosave_mode"
|
||||||
|
data-checked="autosave_mode"
|
||||||
|
value="On"
|
||||||
|
id="autosave_enabled"
|
||||||
|
style="nav-up: #bg_input_enabled; nav-down: #camera_inversion_none"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="autosave_enabled">On</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(6)"
|
||||||
|
name="autosave_mode"
|
||||||
|
data-checked="autosave_mode"
|
||||||
|
value="Off"
|
||||||
|
id="autosave_disabled"
|
||||||
|
style="nav-up: #bg_input_disabled; nav-down: #camera_inversion_x"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="autosave_disabled">Off</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- camera inversion -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(7)">
|
||||||
|
<label class="config-option__title">Aiming Camera Mode</label>
|
||||||
|
<div class="config-option__list">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(7)"
|
||||||
|
name="camera_invert_mode"
|
||||||
|
data-checked="camera_invert_mode"
|
||||||
|
value="InvertNone"
|
||||||
|
id="camera_inversion_none"
|
||||||
|
style="nav-up: #autosave_enabled; nav-down: #analog_cam_enabled"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="camera_inversion_none">None</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(7)"
|
||||||
|
name="camera_invert_mode"
|
||||||
|
data-checked="camera_invert_mode"
|
||||||
|
value="InvertX"
|
||||||
|
id="camera_inversion_x"
|
||||||
|
style="nav-up: #autosave_disabled; nav-down: #analog_cam_disabled"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="camera_inversion_x">Invert X</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(7)"
|
||||||
|
name="camera_invert_mode"
|
||||||
|
data-checked="camera_invert_mode"
|
||||||
|
value="InvertY"
|
||||||
|
id="camera_inversion_y"
|
||||||
|
style="nav-up: #autosave_disabled; nav-down: #analog_cam_disabled"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="camera_inversion_y">Invert Y</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(7)"
|
||||||
|
name="camera_invert_mode"
|
||||||
|
data-checked="camera_invert_mode"
|
||||||
|
value="InvertBoth"
|
||||||
|
id="camera_inversion_both"
|
||||||
|
style="nav-up: #autosave_disabled; nav-down: #analog_cam_disabled"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="camera_inversion_both">Invert Both</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- analog camera -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(8)">
|
||||||
|
<label class="config-option__title">Analog Camera</label>
|
||||||
|
<div class="config-option__list">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(8)"
|
||||||
|
name="analog_cam_mode"
|
||||||
|
data-checked="analog_cam_mode"
|
||||||
|
value="On"
|
||||||
|
id="analog_cam_enabled"
|
||||||
|
style="nav-up: #camera_inversion_none; nav-down: #analog_camera_inversion_none"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="analog_cam_enabled">On</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(8)"
|
||||||
|
name="analog_cam_mode"
|
||||||
|
data-checked="analog_cam_mode"
|
||||||
|
value="Off"
|
||||||
|
id="analog_cam_disabled"
|
||||||
|
style="nav-up: #camera_inversion_x; nav-down: #analog_camera_inversion_x"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="analog_cam_disabled">Off</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- analog camera inversion -->
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(9)">
|
||||||
|
<label class="config-option__title">Analog Camera Mode</label>
|
||||||
|
<div class="config-option__list">
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(9)"
|
||||||
|
name="analog_camera_invert_mode"
|
||||||
|
data-checked="analog_camera_invert_mode"
|
||||||
|
value="InvertNone"
|
||||||
|
id="analog_camera_inversion_none"
|
||||||
|
style="nav-up: #analog_cam_enabled;"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="analog_camera_inversion_none">None</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(9)"
|
||||||
|
name="analog_camera_invert_mode"
|
||||||
|
data-checked="analog_camera_invert_mode"
|
||||||
|
value="InvertX"
|
||||||
|
id="analog_camera_inversion_x"
|
||||||
|
style="nav-up: #analog_cam_disabled;"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="analog_camera_inversion_x">Invert X</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(9)"
|
||||||
|
name="analog_camera_invert_mode"
|
||||||
|
data-checked="analog_camera_invert_mode"
|
||||||
|
value="InvertY"
|
||||||
|
id="analog_camera_inversion_y"
|
||||||
|
style="nav-up: #analog_cam_disabled;"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="analog_camera_inversion_y">Invert Y</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="radio"
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(9)"
|
||||||
|
name="analog_camera_invert_mode"
|
||||||
|
data-checked="analog_camera_invert_mode"
|
||||||
|
value="InvertBoth"
|
||||||
|
id="analog_camera_inversion_both"
|
||||||
|
style="nav-up: #analog_cam_disabled;"
|
||||||
|
/>
|
||||||
|
<label class="config-option__tab-label" for="analog_camera_inversion_both">Invert Both</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Descriptions -->
|
<!-- Descriptions -->
|
||||||
<div class="config__wrapper">
|
<div class="config__wrapper">
|
||||||
<p data-if="cur_config_index == 0">
|
<p data-if="cur_config_index == 0">
|
||||||
Controls how targeting enemies and objects works. Switch will start or stop targeting each time the target button is pressed. Hold will start when the target button is pressed and stop when the button is released.
|
Controls how targeting enemies and objects works. <b>Switch</b> will start or stop targeting each time the target button is pressed. <b>Hold</b> will start when the target button is pressed and stop when the button is released.
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 1">
|
<p data-if="cur_config_index == 1">
|
||||||
Controls the strength of rumble when using a controller that supports it. Setting this to zero will disable rumble.
|
Controls the strength of rumble when using a controller that supports it. <b>Setting this to zero will disable rumble.</b>
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 2">
|
||||||
|
Controls the sensitivity of gyro aiming when using items in first person for controllers that support it. <b>Setting this to zero will disable gyro.</b>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<b>Note: To recalibrate controller gyro, set the controller down on a still, flat surface for 5 seconds.</b>
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 3">
|
||||||
|
Controls the sensitivity of mouse aiming when using items in first person. <b>Setting this to zero will disable mouse aiming.</b>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<b>Note: This option does not allow mouse buttons to activate items. Mouse aiming is intended to be used with inputs that are mapped to mouse movement, such as gyro on Steam Deck.</b>
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 4">
|
||||||
|
Applies a deadzone to joystick inputs.
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 5">
|
||||||
|
Allows the game to read controller input when out of focus.
|
||||||
|
<br/>
|
||||||
|
<b>This setting does not affect keyboard input.</b>
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 6">
|
||||||
|
Turns on autosaving and prevents owl saves from being deleted on load. Autosaves act as owl saves and take up the same slot as they do.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
Loading an autosave will place you in Clock Town or at the entrance of the current dungeon if you were in one.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
<b>If autosaving is disabled, existing autosaves will be deleted when loaded.</b>
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 7">
|
||||||
|
Inverts the camera controls for first-person aiming. <b>Invert Y</b> is the default and matches the original game.
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 8">
|
||||||
|
Enables an analog "free" camera similar to later entries in the series that's mapped to the right analog stick on the controller.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
When you move the right stick, the camera will enter free mode and stop centering behind Link. Press the <b>Target</b> button at any time to go back into the normal camera mode. The camera will also return to normal mode after a cutscene plays or when you move between areas.
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
This option also enables right stick control while looking and aiming.
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 9">
|
||||||
|
Inverts the camera controls for the analog camera if it's enabled. <b>None</b> is the default.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -158,7 +158,8 @@
|
|||||||
data-checked="rr_option"
|
data-checked="rr_option"
|
||||||
value="Display"
|
value="Display"
|
||||||
id="rr_display"
|
id="rr_display"
|
||||||
data-attr-style="rr_option=='Manual' ? 'nav-up: #wm_fullscreen; nav-down: #rr_manual_input' : 'nav-up: #wm_fullscreen; nav-down: #msaa_2x'"
|
style="nav-up: #wm_fullscreen"
|
||||||
|
data-style-nav-down="rr_option=='Manual' ? '#rr_manual_input' : (msaa2x_supported ? '#msaa_2x' : '#msaa_none')"
|
||||||
/>
|
/>
|
||||||
<label class="config-option__tab-label" for="rr_display">Display</label>
|
<label class="config-option__tab-label" for="rr_display">Display</label>
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
@ -168,7 +169,8 @@
|
|||||||
data-checked="rr_option"
|
data-checked="rr_option"
|
||||||
value="Manual"
|
value="Manual"
|
||||||
id="rr_manual"
|
id="rr_manual"
|
||||||
data-attr-style="rr_option=='Manual' ? 'nav-up: #wm_fullscreen; nav-down: #rr_manual_input' : 'nav-up: #wm_fullscreen; nav-down: #msaa_4x'"
|
style="nav-up: #wm_fullscreen"
|
||||||
|
data-style-nav-down="rr_option=='Manual' ? '#rr_manual_input' : (msaa4x_supported ? '#msaa_4x' : (msaa2x_supported ? '#msaa_2x' : '#msaa_none'))"
|
||||||
/>
|
/>
|
||||||
<label class="config-option__tab-label" for="rr_manual">Manual</label>
|
<label class="config-option__tab-label" for="rr_manual">Manual</label>
|
||||||
</div>
|
</div>
|
||||||
@ -181,7 +183,7 @@
|
|||||||
type="range"
|
type="range"
|
||||||
min="20"
|
min="20"
|
||||||
max="360"
|
max="360"
|
||||||
style="flex:1;margin: 0dp;nav-up:auto;nav-down:auto;"
|
style="flex:1;margin: 0dp;nav-up:#rr_manual;nav-down:#msaa_none;"
|
||||||
data-value="rr_manual_value"
|
data-value="rr_manual_value"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -209,6 +211,7 @@
|
|||||||
value="MSAA2X"
|
value="MSAA2X"
|
||||||
id="msaa_2x"
|
id="msaa_2x"
|
||||||
data-attr-style="rr_option=='Manual' ? 'nav-up: #rr_manual_input; nav-down: #hr_16_9' : 'nav-up: #rr_display; nav-down: #hr_16_9'"
|
data-attr-style="rr_option=='Manual' ? 'nav-up: #rr_manual_input; nav-down: #hr_16_9' : 'nav-up: #rr_display; nav-down: #hr_16_9'"
|
||||||
|
data-style-nav-right="msaa4x_supported ? '#msaa_4x' : 'none'"
|
||||||
/>
|
/>
|
||||||
<label class="config-option__tab-label" for="msaa_2x">2x</label>
|
<label class="config-option__tab-label" for="msaa_2x">2x</label>
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
@ -247,6 +250,7 @@
|
|||||||
value="Clamp16x9"
|
value="Clamp16x9"
|
||||||
id="hr_16_9"
|
id="hr_16_9"
|
||||||
style="nav-up: #msaa_2x; nav-down: #apply_button"
|
style="nav-up: #msaa_2x; nav-down: #apply_button"
|
||||||
|
data-style-nav-up="msaa2x_supported ? '#msaa_2x' : '#msaa_none'"
|
||||||
/>
|
/>
|
||||||
<label class="config-option__tab-label" for="hr_16_9">16:9</label>
|
<label class="config-option__tab-label" for="hr_16_9">16:9</label>
|
||||||
<input type="radio"
|
<input type="radio"
|
||||||
@ -257,6 +261,7 @@
|
|||||||
value="Full"
|
value="Full"
|
||||||
id="hr_full"
|
id="hr_full"
|
||||||
style="nav-up: #msaa_4x; nav-down: #apply_button"
|
style="nav-up: #msaa_4x; nav-down: #apply_button"
|
||||||
|
data-style-nav-up="msaa4x_supported ? '#msaa_4x' : (msaa2x_supported ? '#msaa_2x' : '#msaa_none')"
|
||||||
/>
|
/>
|
||||||
<label class="config-option__tab-label" for="hr_full">Expand</label>
|
<label class="config-option__tab-label" for="hr_full">Expand</label>
|
||||||
</div>
|
</div>
|
||||||
@ -265,34 +270,37 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="config__wrapper">
|
<div class="config__wrapper">
|
||||||
<p data-if="cur_config_index == 0">
|
<p data-if="cur_config_index == 0">
|
||||||
Sets the output resolution of the game. Original matches the game's original 240p resolution. Original 2x will render at 480p. Auto will scale based on the game window's resolution.
|
Sets the output resolution of the game. <b>Original</b> matches the game's original 240p resolution. <b>Original 2x</b> will render at 480p. <b>Auto</b> will scale based on the game window's resolution.
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 1">
|
<p data-if="cur_config_index == 1">
|
||||||
Renders at a higher resolution and scales it down to the output resolution for increased quality. Only available in Original and Original 2x resolution.
|
Renders at a higher resolution and scales it down to the output resolution for increased quality. Only available in <b>Original</b> and <b>Original 2x</b> resolution.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Note: 4x downsampling quality at Original 2x resolution may cause performance issues on low end devices, as it will cause the game to render at almost 4k internal resolution.
|
Note: <b>4x</b> downsampling quality at <b>Original 2x</b> resolution may cause performance issues on low end devices, as it will cause the game to render <i>at almost 4k internal resolution</i>.
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 2">
|
<p data-if="cur_config_index == 2">
|
||||||
Sets the horizontal aspect ratio. Original uses the game's original 4:3 aspect ratio. Expand will adjust to match the game window's aspect ratio.
|
Sets the horizontal aspect ratio. <b>Original</b> uses the game's original 4:3 aspect ratio. <b>Expand</b> will adjust to match the game window's aspect ratio.
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 3">
|
<p data-if="cur_config_index == 3">
|
||||||
Sets whether the game should display on a Window or Fullscreen. You can also use Alt + Enter to toggle this option.
|
Sets whether the game should display <b>Windowed</b> or <b>Fullscreen</b>. You can also use <b>F11</b> or <b>Alt + Enter</b> to toggle this option.
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 4">
|
<p data-if="cur_config_index == 4">
|
||||||
Sets the game's output framerate. This option does not affect gameplay.
|
Sets the game's output framerate. This option does not affect gameplay.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Note: If you have issues with Display mode while using an external frame limiter, use Manual mode instead and configure it to that same frame limit.
|
Note: If you have issues with <b>Display</b> mode while using an external frame limiter, use <b>Manual</b> mode instead and configure it to that same frame limit.
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<b>Detected display refresh rate: {{display_refresh_rate}}hz</b>
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 5">
|
<p data-if="cur_config_index == 5">
|
||||||
Sets the multisample anti-aliasing (MSAA) quality level. This reduces jagged edges in the final image at the expense of rendering performance.
|
Sets the multisample anti-aliasing (MSAA) quality level. This reduces jagged edges in the final image at the expense of rendering performance.
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
Note: This option won't be available if your GPU does not support programmable MSAA sample positions, as it is currently required to avoid rendering glitches.
|
<b>Note: This option won't be available if your GPU does not support programmable MSAA sample positions, as it is currently required to avoid rendering glitches.</b>
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 6">
|
<p data-if="cur_config_index == 6">
|
||||||
Adjusts the placement of HUD elements to fit the selected aspect ratio. Expand will use the aspect ratio of the game's output window.
|
Adjusts the placement of HUD elements to fit the selected aspect ratio. <b>Expand</b> will use the aspect ratio of the game's output window.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -308,7 +316,7 @@
|
|||||||
id="apply_button"
|
id="apply_button"
|
||||||
style="nav-up:#hr_original"
|
style="nav-up:#hr_original"
|
||||||
>
|
>
|
||||||
<div class="button__label">Apply</div>
|
<div class="button__label">Apply<span class="prompt-font-sm">{{gfx_help__apply}}</span></div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,30 +7,47 @@
|
|||||||
<!-- Options -->
|
<!-- Options -->
|
||||||
<div class="config__wrapper" data-event-mouseout="set_cur_config_index(-1)">
|
<div class="config__wrapper" data-event-mouseout="set_cur_config_index(-1)">
|
||||||
<div class="config-option" data-event-mouseover="set_cur_config_index(0)">
|
<div class="config-option" data-event-mouseover="set_cur_config_index(0)">
|
||||||
<label class="config-option__title">Background Music Volume</label>
|
<label class="config-option__title">Main Volume</label>
|
||||||
<div class="config-option__range-wrapper config-option__list">
|
<div class="config-option__range-wrapper config-option__list">
|
||||||
<label class="config-option__range-label">{{bgm_volume}}</label>
|
<label class="config-option__range-label">{{main_volume}}%</label>
|
||||||
<input
|
<input
|
||||||
data-event-blur="set_cur_config_index(-1)"
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
data-event-focus="set_cur_config_index(0)"
|
data-event-focus="set_cur_config_index(0)"
|
||||||
class="nav-vert"
|
class="nav-vert"
|
||||||
|
id="main_volume_input"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
style="flex: 1; margin: 0dp; nav-up: #tab_sound; nav-down: #bgm_volume_input;"
|
||||||
|
data-value="main_volume"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="config-option" data-event-mouseover="set_cur_config_index(1)">
|
||||||
|
<label class="config-option__title">Background Music Volume</label>
|
||||||
|
<div class="config-option__range-wrapper config-option__list">
|
||||||
|
<label class="config-option__range-label">{{bgm_volume}}%</label>
|
||||||
|
<input
|
||||||
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
|
data-event-focus="set_cur_config_index(1)"
|
||||||
|
class="nav-vert"
|
||||||
id="bgm_volume_input"
|
id="bgm_volume_input"
|
||||||
type="range"
|
type="range"
|
||||||
min="0"
|
min="0"
|
||||||
max="100"
|
max="100"
|
||||||
style="flex: 1; margin: 0dp; nav-up: #tab_sound; nav-down: #lhb_on;"
|
style="flex: 1; margin: 0dp; nav-up: #main_volume_input; nav-down: #lhb_on;"
|
||||||
data-value="bgm_volume"
|
data-value="bgm_volume"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="config-option" data-event-mouseover="set_cur_config_index(1)">
|
<div class="config-option" data-event-mouseover="set_cur_config_index(2)">
|
||||||
<label class="config-option__title">Low Health Beeps</label>
|
<label class="config-option__title">Low Health Beeps</label>
|
||||||
<div class="config-option__list">
|
<div class="config-option__list">
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
data-event-blur="set_cur_config_index(-1)"
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
data-event-focus="set_cur_config_index(1)"
|
data-event-focus="set_cur_config_index(2)"
|
||||||
name="lhb"
|
name="lhb"
|
||||||
data-checked="low_health_beeps_enabled"
|
data-checked="low_health_beeps_enabled"
|
||||||
value="1"
|
value="1"
|
||||||
@ -42,7 +59,7 @@
|
|||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
data-event-blur="set_cur_config_index(-1)"
|
data-event-blur="set_cur_config_index(-1)"
|
||||||
data-event-focus="set_cur_config_index(1)"
|
data-event-focus="set_cur_config_index(2)"
|
||||||
name="lhb"
|
name="lhb"
|
||||||
data-checked="low_health_beeps_enabled"
|
data-checked="low_health_beeps_enabled"
|
||||||
value="0"
|
value="0"
|
||||||
@ -56,9 +73,12 @@
|
|||||||
<!-- Descriptions -->
|
<!-- Descriptions -->
|
||||||
<div class="config__wrapper">
|
<div class="config__wrapper">
|
||||||
<p data-if="cur_config_index == 0">
|
<p data-if="cur_config_index == 0">
|
||||||
Controls the overall volume of background music.
|
Controls the main volume of the game.
|
||||||
</p>
|
</p>
|
||||||
<p data-if="cur_config_index == 1">
|
<p data-if="cur_config_index == 1">
|
||||||
|
Controls the overall volume of background music.
|
||||||
|
</p>
|
||||||
|
<p data-if="cur_config_index == 2">
|
||||||
Toggles whether or not the low-health beeping sound plays.
|
Toggles whether or not the low-health beeping sound plays.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
11
assets/icons/Quit.svg
Normal file
11
assets/icons/Quit.svg
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M29 16L25 21" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M25 11L29 16" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M12 16L27 16" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M7 5L20 5" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M7 27L7 5" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M7 27L20 27" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M20 27V22" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M20 10V5" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
|
|
After Width: | Height: | Size: 781 B |
5
assets/icons/Reset.svg
Normal file
5
assets/icons/Reset.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M27.6949 10.3162C25.5859 5.98481 21.1415 3 16 3C8.8203 3 3 8.8203 3 16C3 23.1797 8.8203 29 16 29C21.1415 29 25.5859 26.0152 27.6949 21.6838" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round"/>
|
||||||
|
<path d="M29.052 11.0519V5.0519" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M29.052 11.0519H23.052" stroke="#FFFFFF" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 555 B |
@ -58,7 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-left">
|
<div class="bottom-left">
|
||||||
<label>{{version_number}}</label>
|
<label>v{{version_number}}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -30,7 +30,7 @@
|
|||||||
"color-no-hex": true,
|
"color-no-hex": true,
|
||||||
"function-url-quotes": "always",
|
"function-url-quotes": "always",
|
||||||
"max-nesting-depth": [
|
"max-nesting-depth": [
|
||||||
3,
|
4,
|
||||||
{
|
{
|
||||||
"ignoreAtRules": ["each", "media", "supports", "include"],
|
"ignoreAtRules": ["each", "media", "supports", "include"],
|
||||||
"severity": "warning"
|
"severity": "warning"
|
||||||
@ -69,7 +69,7 @@
|
|||||||
"scss/selector-no-redundant-nesting-selector": null,
|
"scss/selector-no-redundant-nesting-selector": null,
|
||||||
"selector-class-pattern": null,
|
"selector-class-pattern": null,
|
||||||
"selector-max-compound-selectors": [
|
"selector-max-compound-selectors": [
|
||||||
3,
|
4,
|
||||||
{
|
{
|
||||||
"severity": "warning"
|
"severity": "warning"
|
||||||
}
|
}
|
||||||
@ -83,12 +83,17 @@
|
|||||||
"scss/dollar-variable-empty-line-before": null,
|
"scss/dollar-variable-empty-line-before": null,
|
||||||
"scss/dollar-variable-pattern": "[a-z-]",
|
"scss/dollar-variable-pattern": "[a-z-]",
|
||||||
"scss/at-import-partial-extension": null,
|
"scss/at-import-partial-extension": null,
|
||||||
"declaration-block-no-redundant-longhand-properties": [true, { "severity": "warning" }],
|
"declaration-block-no-redundant-longhand-properties": null,
|
||||||
"color-function-notation": null,
|
"color-function-notation": null,
|
||||||
"alpha-value-notation": null,
|
"alpha-value-notation": null,
|
||||||
"at-rule-no-unknown": null,
|
"at-rule-no-unknown": null,
|
||||||
|
"property-no-unknown": null,
|
||||||
"scss/at-rule-no-unknown": true,
|
"scss/at-rule-no-unknown": true,
|
||||||
|
"selector-pseudo-class-no-unknown": [true, { "ignorePseudoClasses": ["selected"] }],
|
||||||
|
"font-family-no-missing-generic-family-keyword": null,
|
||||||
"scss/no-global-function-names": null,
|
"scss/no-global-function-names": null,
|
||||||
"unit-no-unknown": [true, { "ignoreUnits": ["dp"] }]
|
"unit-no-unknown": [true, { "ignoreUnits": ["dp"] }],
|
||||||
|
"selector-type-no-unknown": [true, { "ignore": ["custom-elements", "default-namespace"] }],
|
||||||
|
"value-keyword-case": null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
115
assets/scss/package-lock.json
generated
115
assets/scss/package-lock.json
generated
@ -8,6 +8,9 @@
|
|||||||
"name": "mmrecomp-ui-scss",
|
"name": "mmrecomp-ui-scss",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"sass": "^1.75.0"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"postcss-scss": "^4.0.9",
|
"postcss-scss": "^4.0.9",
|
||||||
"stylelint": "^15.11.0",
|
"stylelint": "^15.11.0",
|
||||||
@ -225,6 +228,18 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/anymatch": {
|
||||||
|
"version": "3.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
|
||||||
|
"integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
|
||||||
|
"dependencies": {
|
||||||
|
"normalize-path": "^3.0.0",
|
||||||
|
"picomatch": "^2.0.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/argparse": {
|
"node_modules/argparse": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||||
@ -264,6 +279,17 @@
|
|||||||
"integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
|
"integrity": "sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/binary-extensions": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/brace-expansion": {
|
"node_modules/brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
@ -284,7 +310,6 @@
|
|||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fill-range": "^7.0.1"
|
"fill-range": "^7.0.1"
|
||||||
},
|
},
|
||||||
@ -345,6 +370,29 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/chokidar": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
|
||||||
|
"dependencies": {
|
||||||
|
"anymatch": "~3.1.2",
|
||||||
|
"braces": "~3.0.2",
|
||||||
|
"glob-parent": "~5.1.2",
|
||||||
|
"is-binary-path": "~2.1.0",
|
||||||
|
"is-glob": "~4.0.1",
|
||||||
|
"normalize-path": "~3.0.0",
|
||||||
|
"readdirp": "~3.6.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8.10.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "~2.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/color-convert": {
|
"node_modules/color-convert": {
|
||||||
"version": "1.9.3",
|
"version": "1.9.3",
|
||||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||||
@ -593,7 +641,6 @@
|
|||||||
"version": "7.0.1",
|
"version": "7.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"to-regex-range": "^5.0.1"
|
"to-regex-range": "^5.0.1"
|
||||||
},
|
},
|
||||||
@ -643,6 +690,19 @@
|
|||||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
|
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/function-bind": {
|
"node_modules/function-bind": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
@ -676,7 +736,6 @@
|
|||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||||
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-glob": "^4.0.1"
|
"is-glob": "^4.0.1"
|
||||||
},
|
},
|
||||||
@ -799,6 +858,11 @@
|
|||||||
"node": ">= 4"
|
"node": ">= 4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/immutable": {
|
||||||
|
"version": "4.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.5.tgz",
|
||||||
|
"integrity": "sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw=="
|
||||||
|
},
|
||||||
"node_modules/import-fresh": {
|
"node_modules/import-fresh": {
|
||||||
"version": "3.3.0",
|
"version": "3.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
||||||
@ -882,6 +946,17 @@
|
|||||||
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
|
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/is-binary-path": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
|
||||||
|
"dependencies": {
|
||||||
|
"binary-extensions": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-core-module": {
|
"node_modules/is-core-module": {
|
||||||
"version": "2.13.1",
|
"version": "2.13.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz",
|
||||||
@ -898,7 +973,6 @@
|
|||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
|
||||||
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
@ -916,7 +990,6 @@
|
|||||||
"version": "4.0.3",
|
"version": "4.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
|
||||||
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-extglob": "^2.1.1"
|
"is-extglob": "^2.1.1"
|
||||||
},
|
},
|
||||||
@ -928,7 +1001,6 @@
|
|||||||
"version": "7.0.0",
|
"version": "7.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.12.0"
|
"node": ">=0.12.0"
|
||||||
}
|
}
|
||||||
@ -1210,7 +1282,6 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
@ -1321,7 +1392,6 @@
|
|||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
},
|
},
|
||||||
@ -1515,6 +1585,17 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/readdirp": {
|
||||||
|
"version": "3.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
|
||||||
|
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
|
||||||
|
"dependencies": {
|
||||||
|
"picomatch": "^2.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/redent": {
|
"node_modules/redent": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/redent/-/redent-4.0.0.tgz",
|
||||||
@ -1597,6 +1678,22 @@
|
|||||||
"queue-microtask": "^1.2.2"
|
"queue-microtask": "^1.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/sass": {
|
||||||
|
"version": "1.75.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.75.0.tgz",
|
||||||
|
"integrity": "sha512-ShMYi3WkrDWxExyxSZPst4/okE9ts46xZmJDSawJQrnte7M1V9fScVB+uNXOVKRBt0PggHOwoZcn8mYX4trnBw==",
|
||||||
|
"dependencies": {
|
||||||
|
"chokidar": ">=3.0.0 <4.0.0",
|
||||||
|
"immutable": "^4.0.0",
|
||||||
|
"source-map-js": ">=0.6.2 <2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"sass": "sass.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.5.4",
|
"version": "7.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||||
@ -1687,7 +1784,6 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
@ -2047,7 +2143,6 @@
|
|||||||
"version": "5.0.1",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-number": "^7.0.0"
|
"is-number": "^7.0.0"
|
||||||
},
|
},
|
||||||
|
@ -5,9 +5,10 @@
|
|||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "npm run watch",
|
"start": "npm run watch",
|
||||||
"watch": "sass --no-source-map --style=compressed main.scss ..\\recomp.rcss --watch",
|
"watch": "sass --no-source-map --no-charset --style=compressed main.scss ..\\recomp.rcss --watch",
|
||||||
"watch-debug": "sass --no-source-map main.scss ..\\recomp.rcss --watch",
|
"watch:debug": "sass --no-source-map --no-charset main.scss ..\\recomp.rcss --watch",
|
||||||
"build": "sass --no-source-map --style=compressed main.scss ..\\recomp.rcss",
|
"build": "sass --no-source-map --no-charset --style=compressed main.scss ..\\recomp.rcss",
|
||||||
|
"build:debug": "sass --no-source-map --no-charset main.scss ..\\recomp.rcss",
|
||||||
"lint": "stylelint '.\\**\\*.scss'"
|
"lint": "stylelint '.\\**\\*.scss'"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
@ -21,5 +22,8 @@
|
|||||||
"stylelint-config-standard": "^34.0.0",
|
"stylelint-config-standard": "^34.0.0",
|
||||||
"stylelint-config-standard-scss": "^11.1.0",
|
"stylelint-config-standard-scss": "^11.1.0",
|
||||||
"stylelint-scss": "^5.3.1"
|
"stylelint-scss": "^5.3.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"sass": "^1.75.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
@import "./vars/borders";
|
@import "./vars/borders";
|
||||||
@import "./vars/gradients";
|
@import "./vars/gradients";
|
||||||
@import "./vars/transitions";
|
@import "./vars/transitions";
|
||||||
|
@import "./vars/animations";
|
||||||
@import "./mixins/typography";
|
@import "./mixins/typography";
|
||||||
@import "./mixins/transitions";
|
@import "./mixins/transitions";
|
||||||
@import "./mixins/helpers";
|
@import "./mixins/helpers";
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
.bottom-left {
|
.bottom-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
bottom: space(4);
|
||||||
|
flex-direction: row;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
height: auto;
|
|
||||||
bottom: space(4);
|
|
||||||
margin: 0 space(4);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: space($base-modal-max-width);
|
max-width: space($base-modal-max-width);
|
||||||
|
height: auto;
|
||||||
|
margin: 0 space(4);
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
@use 'sass:color';
|
@use 'sass:color';
|
||||||
|
|
||||||
@mixin create-button-variation($base-col) {
|
@mixin create-button-variation($base-col) {
|
||||||
|
border-color: rgba($base-col, 0.8);
|
||||||
background-color: rgba($base-col, 0.05);
|
background-color: rgba($base-col, 0.05);
|
||||||
color: $color-text-dim;
|
color: $color-text-dim;
|
||||||
border-color: rgba($base-col, 0.8);
|
|
||||||
|
|
||||||
&:focus, &:hover {
|
&:focus, &:hover {
|
||||||
color: $color-text;
|
|
||||||
border-color: $base-col;
|
border-color: $base-col;
|
||||||
background-color: rgba($base-col, 0.3);
|
background-color: rgba($base-col, 0.3);
|
||||||
|
color: $color-text;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:disabled,&[disabled] {
|
&:disabled,&[disabled] {
|
||||||
@ -28,18 +28,18 @@
|
|||||||
@include trans-colors;
|
@include trans-colors;
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
// leave 1dp room for border expansion
|
|
||||||
padding: space(24 - 1);
|
|
||||||
|
|
||||||
border-radius: $border-radius-md;
|
|
||||||
border-width: $border-width-thickness;
|
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
// leave 1dp room for border expansion
|
||||||
|
padding: space(24 - 1);
|
||||||
|
border-width: $border-width-thickness;
|
||||||
|
|
||||||
|
border-radius: $border-radius-md;
|
||||||
|
|
||||||
// Setting it by default for convenience
|
// Setting it by default for convenience
|
||||||
// &--primary {
|
&--primary {
|
||||||
// @include create-button-variation($color-primary);
|
@include create-button-variation($color-primary);
|
||||||
// }
|
}
|
||||||
|
|
||||||
&--large {
|
&--large {
|
||||||
@extend %label-lg;
|
@extend %label-lg;
|
||||||
|
@ -13,29 +13,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.centered-page__modal {
|
.centered-page__modal {
|
||||||
@extend %nav-all;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: auto;
|
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
max-width: space($base-modal-max-width);
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: space($base-modal-max-width);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: $color-modal-overlay;
|
margin: auto;
|
||||||
|
border-width: $border-width-thickness;
|
||||||
border-radius: $border-radius-modal;
|
border-radius: $border-radius-modal;
|
||||||
border-color: $color-border;
|
border-color: $color-border;
|
||||||
border-width: $border-width-thickness;
|
background: $color-modal-overlay;
|
||||||
|
|
||||||
> .tabs {
|
> .tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: auto;
|
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
max-width: space($base-modal-max-width);
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: space($base-modal-max-width);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
panels {
|
panels {
|
||||||
@ -45,15 +44,15 @@
|
|||||||
|
|
||||||
.centered-page__controls {
|
.centered-page__controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
bottom: space(24);
|
||||||
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: auto;
|
|
||||||
bottom: space(24);
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: space($base-modal-max-width);
|
max-width: space($base-modal-max-width);
|
||||||
|
height: auto;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
> label {
|
> label {
|
||||||
@extend %label-sm;
|
@extend %label-sm;
|
||||||
|
@ -1,51 +1,73 @@
|
|||||||
|
|
||||||
.config__exit-button {
|
.config__icon-buttons {
|
||||||
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: space(8);
|
top: space(8);
|
||||||
right: space(8);
|
right: space(0);
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: auto;
|
||||||
|
|
||||||
|
.icon-button {
|
||||||
|
margin: 0 space(8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.config__form {
|
.config__form {
|
||||||
@include border-top($color-border-soft);
|
@include border-top($color-border-soft);
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex: 1 1 100%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex: 1 1 100%;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-bottom-left-radius: $border-radius-modal;
|
|
||||||
border-bottom-right-radius: $border-radius-modal;
|
border-bottom-right-radius: $border-radius-modal;
|
||||||
|
border-bottom-left-radius: $border-radius-modal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.config__wrapper {
|
.config__wrapper {
|
||||||
border-radius: 0dp;
|
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
height: 100%;
|
width: auto;
|
||||||
|
height: auto;
|
||||||
padding: space(16);
|
padding: space(16);
|
||||||
text-align: left;
|
border-radius: 0dp;
|
||||||
|
border-bottom-right-radius: $border-radius-modal;
|
||||||
|
border-bottom-left-radius: $border-radius-modal;
|
||||||
background-color: $color-bg-shadow;
|
background-color: $color-bg-shadow;
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
p {
|
p {
|
||||||
@extend %body;
|
@extend %body;
|
||||||
padding: space(16);
|
padding: space(16);
|
||||||
white-space: pre-line;
|
|
||||||
line-height: space(28);
|
line-height: space(28);
|
||||||
|
white-space: pre-line;
|
||||||
|
|
||||||
|
b {
|
||||||
|
color: $color-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
color: $color-warning;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.config__hz-wrapper {
|
.config__hz-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
|
||||||
border-radius: 0dp;
|
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border-radius: 0dp;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.config__header, .config__footer {
|
.config__header, .config__footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: $color-bg-shadow;
|
background-color: $color-bg-shadow;
|
||||||
}
|
}
|
||||||
@ -58,14 +80,14 @@
|
|||||||
.config__footer {
|
.config__footer {
|
||||||
@include border-top($color-border-soft);
|
@include border-top($color-border-soft);
|
||||||
padding: space(20) space(20);
|
padding: space(20) space(20);
|
||||||
border-bottom-left-radius: $border-radius-modal;
|
|
||||||
border-bottom-right-radius: $border-radius-modal;
|
border-bottom-right-radius: $border-radius-modal;
|
||||||
|
border-bottom-left-radius: $border-radius-modal;
|
||||||
}
|
}
|
||||||
|
|
||||||
.config__header-left {
|
.config__header-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
|
flex-direction: row;
|
||||||
|
|
||||||
> :not(:first-child) {
|
> :not(:first-child) {
|
||||||
margin-left: space(8);
|
margin-left: space(8);
|
||||||
@ -79,8 +101,8 @@
|
|||||||
|
|
||||||
.config-option {
|
.config-option {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
margin: space(16) space(0) space(24);
|
margin: space(16) space(0) space(24);
|
||||||
@ -97,12 +119,12 @@
|
|||||||
|
|
||||||
.config-option__list {
|
.config-option__list {
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0;
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
input:first-of-type {
|
input:first-of-type {
|
||||||
nav-left: none;
|
nav-left: none;
|
||||||
@ -114,16 +136,17 @@
|
|||||||
|
|
||||||
.config-option__tab-label {
|
.config-option__tab-label {
|
||||||
@extend %label-sm;
|
@extend %label-sm;
|
||||||
|
@include trans-colors-opa;
|
||||||
display: block;
|
display: block;
|
||||||
padding: space(12) 0 space(8);
|
position: relative;
|
||||||
height: auto;
|
height: auto;
|
||||||
margin: 0 space(12);
|
margin: space(4) space(12) 0;
|
||||||
margin-right: space(16);
|
padding: space(8) 0;
|
||||||
color: $color-text-inactive;
|
color: $color-text-inactive;
|
||||||
tab-index: none;
|
tab-index: none;
|
||||||
transition: color $transition-quick;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
color: $color-text;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,13 +161,21 @@
|
|||||||
&:not(:disabled) {
|
&:not(:disabled) {
|
||||||
&:checked + .config-option__tab-label {
|
&:checked + .config-option__tab-label {
|
||||||
border-bottom: 1dp;
|
border-bottom: 1dp;
|
||||||
border-color: $color-border-hard;
|
border-color: $color-text;
|
||||||
|
color: $color-text;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rmlui-window:not([mouse-active]) &:focus + .config-option__tab-label {
|
||||||
|
transition: none;
|
||||||
|
animation: $focus-anim-border;
|
||||||
|
border-color: $color-secondary;
|
||||||
|
color: $color-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
&:focus + .config-option__tab-label,
|
&:focus + .config-option__tab-label,
|
||||||
&:hover + .config-option__tab-label {
|
&:hover + .config-option__tab-label {
|
||||||
color: $color-text;
|
color: $color-text;
|
||||||
@ -162,29 +193,30 @@
|
|||||||
|
|
||||||
input.range slidertrack {
|
input.range slidertrack {
|
||||||
@include trans-colors;
|
@include trans-colors;
|
||||||
margin-top: 7dp;
|
|
||||||
height: 2dp;
|
height: 2dp;
|
||||||
|
margin-top: space(8);
|
||||||
background-color: $color-border;
|
background-color: $color-border;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.range sliderbar {
|
input.range sliderbar {
|
||||||
@include trans-colors;
|
@include trans-colors;
|
||||||
margin-left: -8dp;
|
|
||||||
margin-right: -6dp;
|
|
||||||
width: space(16);
|
width: space(16);
|
||||||
height: space(16);
|
height: space(16);
|
||||||
background-color: $color-text-dim;
|
margin-top: space(1);
|
||||||
border-radius: 8dp;
|
margin-right: space(-8);
|
||||||
|
margin-left: space(-8);
|
||||||
transition: background-color $transition-quick;
|
transition: background-color $transition-quick;
|
||||||
|
border-radius: 8dp;
|
||||||
|
background-color: $color-text-dim;
|
||||||
|
|
||||||
.rmlui-window:not([mouse-active]) &:focus {
|
.rmlui-window:not([mouse-active]) &:focus {
|
||||||
@include border($color-a);
|
@include border($color-a);
|
||||||
background-color: $color-secondary;
|
animation: $focus-anim-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
|
||||||
background-color: $color-text;
|
background-color: $color-text;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,24 +233,25 @@
|
|||||||
|
|
||||||
.config-option__details {
|
.config-option__details {
|
||||||
@extend %label-xs;
|
@extend %label-xs;
|
||||||
color: $color-secondary;
|
|
||||||
margin: space(14) space(12) 0;
|
|
||||||
height: space(18);
|
height: space(18);
|
||||||
|
margin: space(14) space(12) 0;
|
||||||
|
color: $color-primary;
|
||||||
}
|
}
|
||||||
|
|
||||||
.config-option__range-wrapper {
|
.config-option__range-wrapper {
|
||||||
margin-top: space(4);
|
|
||||||
max-width: space(360);
|
max-width: space(360);
|
||||||
|
margin-top: space(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
.config-option__range-label {
|
.config-option__range-label {
|
||||||
@extend %label-sm;
|
@extend %label-sm;
|
||||||
flex: 0 0 space(16);
|
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0;
|
// flex: 0 0 space(32);
|
||||||
|
width: space(56);
|
||||||
margin: 0 12dp;
|
margin: 0 12dp;
|
||||||
margin-right: space(16);
|
margin-right: space(16);
|
||||||
|
padding: 0;
|
||||||
color: $color-text;
|
color: $color-text;
|
||||||
tab-index: none;
|
tab-index: none;
|
||||||
}
|
}
|
||||||
|
@ -59,10 +59,10 @@
|
|||||||
.control-option__bindings {
|
.control-option__bindings {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
flex: 2 1 space(400);
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex: 2 1 space(400);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: space(56);
|
height: space(56);
|
||||||
padding: 0 space(12) 0 space(4);
|
padding: 0 space(12) 0 space(4);
|
||||||
@ -73,23 +73,23 @@
|
|||||||
@include trans-colors-border;
|
@include trans-colors-border;
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin: 0 space(4);
|
|
||||||
|
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: space(56);
|
height: space(56);
|
||||||
|
margin: 0 space(4);
|
||||||
padding: space(8);
|
padding: space(8);
|
||||||
background-color: $color-bg-overlay;
|
|
||||||
border-color: $color-bg-overlay;
|
|
||||||
border-width: $border-width-thickness;
|
border-width: $border-width-thickness;
|
||||||
border-radius: $border-radius-sm;
|
border-radius: $border-radius-sm;
|
||||||
|
border-color: $color-bg-overlay;
|
||||||
|
background-color: $color-bg-overlay;
|
||||||
|
|
||||||
&:focus, &:hover {
|
&:focus, &:hover {
|
||||||
@include set-color($color-text);
|
@include set-color($color-text);
|
||||||
background-color: $color-border-soft;
|
|
||||||
border-color: $color-text;
|
border-color: $color-text;
|
||||||
|
background-color: $color-border-soft;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
@ -116,24 +116,26 @@
|
|||||||
0% {
|
0% {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
transform: scale(0.85);
|
transform: scale(0.85);
|
||||||
}
|
}
|
||||||
to {
|
|
||||||
|
100% {
|
||||||
transform: scale(1);
|
transform: scale(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.control-option__binding-recording {
|
.control-option__binding-recording {
|
||||||
@include trans-colors-opa;
|
@include trans-colors-opa;
|
||||||
position: absolute;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
position: absolute;
|
||||||
justify-content: center;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
|
||||||
.control-option__binding-circle {
|
.control-option__binding-circle {
|
||||||
@ -141,9 +143,9 @@
|
|||||||
|
|
||||||
width: space($rec-size);
|
width: space($rec-size);
|
||||||
height: space($rec-size);
|
height: space($rec-size);
|
||||||
background-color: $color-error;
|
|
||||||
border-radius: space($rec-size);
|
|
||||||
animation: 1.5s sine-in-out infinite control-option__binding-recording-scale;
|
animation: 1.5s sine-in-out infinite control-option__binding-recording-scale;
|
||||||
|
border-radius: space($rec-size);
|
||||||
|
background-color: $color-error;
|
||||||
}
|
}
|
||||||
|
|
||||||
.control-option__binding-edge {
|
.control-option__binding-edge {
|
||||||
@ -152,13 +154,13 @@
|
|||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
|
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
width: space($edge-size);
|
width: space($edge-size);
|
||||||
height: space($edge-size);
|
height: space($edge-size);
|
||||||
|
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
> svg.control-option__binding-edge-svg {
|
> svg.control-option__binding-edge-svg {
|
||||||
width: space($edge-size);
|
width: space($edge-size);
|
||||||
height: space($edge-size);
|
height: space($edge-size);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@use 'sass:color';
|
@use 'sass:color';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
<button
|
<button
|
||||||
class="icon-button icon-button--danger"
|
class="icon-button icon-button--danger"
|
||||||
@ -7,8 +8,8 @@
|
|||||||
</button>
|
</button>
|
||||||
*/
|
*/
|
||||||
@mixin create-icon-button-variation($base-col) {
|
@mixin create-icon-button-variation($base-col) {
|
||||||
background-color: rgba($base-col, 0.05);
|
|
||||||
border-color: rgba($base-col, 0.8);
|
border-color: rgba($base-col, 0.8);
|
||||||
|
background-color: rgba($base-col, 0.05);
|
||||||
|
|
||||||
&:focus, &:hover {
|
&:focus, &:hover {
|
||||||
border-color: $base-col;
|
border-color: $base-col;
|
||||||
@ -29,18 +30,16 @@ $icon-button-size: 56 - ($border-width-thickness-num * 2);
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
overflow: hidden;
|
width: space($icon-button-size);
|
||||||
|
min-width: space($icon-button-size);
|
||||||
border-radius: space($icon-button-size * 0.5);
|
max-width: space($icon-button-size);
|
||||||
|
height: space($icon-button-size);
|
||||||
|
min-height: space($icon-button-size);
|
||||||
|
max-height: space($icon-button-size);
|
||||||
border-width: $border-width-thickness;
|
border-width: $border-width-thickness;
|
||||||
|
border-radius: space($icon-button-size * 0.5);
|
||||||
border-color: $color-transparent;
|
border-color: $color-transparent;
|
||||||
background-color: $color-transparent;
|
background-color: $color-transparent;
|
||||||
width: space($icon-button-size);
|
|
||||||
height: space($icon-button-size);
|
|
||||||
min-width: space($icon-button-size);
|
|
||||||
min-height: space($icon-button-size);
|
|
||||||
max-width: space($icon-button-size);
|
|
||||||
max-height: space($icon-button-size);
|
|
||||||
|
|
||||||
&:focus, &:hover {
|
&:focus, &:hover {
|
||||||
@include set-color($color-text);
|
@include set-color($color-text);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
@use 'sass:math';
|
@use 'sass:math';
|
||||||
|
|
||||||
// Probably will need to adjust for other langs...
|
// Probably will need to adjust for other langs...
|
||||||
$mapping-min-width: 80*8;
|
$mapping-min-width: 80 * 8;
|
||||||
$visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width;
|
$visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width;
|
||||||
|
|
||||||
.input-config {
|
.input-config {
|
||||||
@ -18,8 +18,8 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
.input-config__mappings {
|
.input-config__mappings {
|
||||||
display: block;
|
display: block;
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
height: 100%;
|
|
||||||
min-width: space($mapping-min-width);
|
min-width: space($mapping-min-width);
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-config__mappings-scroll {
|
.input-config__mappings-scroll {
|
||||||
@ -35,30 +35,30 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
|
|
||||||
.input-config__visual-wrapper {
|
.input-config__visual-wrapper {
|
||||||
display: block;
|
display: block;
|
||||||
|
flex: 1 1 100%;
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
|
||||||
max-width: space($visual-max-width);
|
max-width: space($visual-max-width);
|
||||||
|
height: auto;
|
||||||
max-height: space(math.div($visual-max-width, 4) * 3);
|
max-height: space(math.div($visual-max-width, 4) * 3);
|
||||||
margin: auto 0;
|
margin: auto 0;
|
||||||
flex: 1 1 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-config__visual-aspect {
|
.input-config__visual-aspect {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
margin: auto 0;
|
||||||
padding-bottom: 75%;
|
padding-bottom: 75%;
|
||||||
background-color: $color-bg-shadow;
|
background-color: $color-bg-shadow;
|
||||||
margin: auto 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-config__visual {
|
.input-config__visual {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: space(16);
|
top: space(16);
|
||||||
right: space(16);
|
right: space(16);
|
||||||
bottom: space(16);
|
bottom: space(16);
|
||||||
left: space(16);
|
left: space(16);
|
||||||
|
flex-direction: column;
|
||||||
border-radius: space(108);
|
border-radius: space(108);
|
||||||
background-color: $color-white-a5;
|
background-color: $color-white-a5;
|
||||||
}
|
}
|
||||||
@ -66,8 +66,8 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
.input-config__visual-half {
|
.input-config__visual-half {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
flex-direction: row;
|
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
|
flex-direction: row;
|
||||||
padding: 6%;
|
padding: 6%;
|
||||||
|
|
||||||
&--bottom {
|
&--bottom {
|
||||||
@ -79,9 +79,9 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
.input-config__visual-quarter-left {
|
.input-config__visual-quarter-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 1 50%;
|
flex: 1 1 50%;
|
||||||
width: auto;
|
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-config__visual-quarter-right {
|
.input-config__visual-quarter-right {
|
||||||
@ -94,18 +94,18 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
.input-config__visual-stick-wrapper {
|
.input-config__visual-stick-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-viz {
|
.input-viz {
|
||||||
@include trans-colors-opa;
|
@include trans-colors-opa;
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
@ -113,8 +113,8 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__mappings div {
|
&__mappings div {
|
||||||
@ -122,8 +122,7 @@ $visual-max-width: $base-modal-max-width - $mapping-min-width - $scrollbar-width
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$all-inputs:
|
$all-inputs: A,
|
||||||
A,
|
|
||||||
B,
|
B,
|
||||||
Z,
|
Z,
|
||||||
START,
|
START,
|
||||||
@ -206,6 +205,7 @@ $all-inputs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
$dpad-size: 192;
|
$dpad-size: 192;
|
||||||
|
|
||||||
.input-viz.input-viz__dpad {
|
.input-viz.input-viz__dpad {
|
||||||
@include set-svgs-color($color-text);
|
@include set-svgs-color($color-text);
|
||||||
@include set-sizes($dpad-size);
|
@include set-sizes($dpad-size);
|
||||||
@ -213,6 +213,7 @@ $dpad-size: 192;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stick-size: 200;
|
$stick-size: 200;
|
||||||
|
|
||||||
.input-config__visual-stick {
|
.input-config__visual-stick {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -246,9 +247,9 @@ $stick-size: 200;
|
|||||||
> div {
|
> div {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 1 100%;
|
flex: 1 1 100%;
|
||||||
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-direction: row;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,10 +264,10 @@ $stick-size: 200;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.input-viz__dpad-arrow {
|
.input-viz__dpad-arrow {
|
||||||
|
$edge-dist: space(4);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: space(60);
|
width: space(60);
|
||||||
height: space(60);
|
height: space(60);
|
||||||
$edge-dist: space(4);
|
|
||||||
|
|
||||||
&--up {
|
&--up {
|
||||||
top: $edge-dist;
|
top: $edge-dist;
|
||||||
@ -304,16 +305,16 @@ $stick-size: 200;
|
|||||||
|
|
||||||
.input-config__c-buttons {
|
.input-config__c-buttons {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: space(76+76+56);
|
width: space(76 + 76 + 56);
|
||||||
height: space(76+56);
|
height: space(76 + 56);
|
||||||
|
|
||||||
&-lr, &-du {
|
&-lr, &-du {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-lr {
|
&-lr {
|
||||||
@ -337,10 +338,10 @@ $stick-size: 200;
|
|||||||
|
|
||||||
.input-config__main-buttons {
|
.input-config__main-buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
width: space(268);
|
width: space(268);
|
||||||
height: space(128);
|
height: space(128);
|
||||||
position: relative;
|
|
||||||
margin-right: space(10);
|
margin-right: space(10);
|
||||||
}
|
}
|
||||||
|
@ -11,31 +11,29 @@
|
|||||||
|
|
||||||
.launcher {
|
.launcher {
|
||||||
display: block;
|
display: block;
|
||||||
|
position: relative;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: $color-background-1;
|
background-color: $color-background-1;
|
||||||
// TODO: Affect all elements with launcher fade-in
|
|
||||||
// animation: 1.5s cubic-in-out 1 fade-launcher-in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.launcher__vertical-split {
|
.launcher__vertical-split {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
justify-content: space-between;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 50%;
|
right: 50%;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
&--right {
|
&--right {
|
||||||
align-items: flex-end;
|
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
align-items: flex-end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,52 +42,52 @@
|
|||||||
0% {
|
0% {
|
||||||
transform: translateX(space(100));
|
transform: translateX(space(100));
|
||||||
}
|
}
|
||||||
to {
|
|
||||||
|
100% {
|
||||||
transform: translateX(space(0));
|
transform: translateX(space(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.launcher__background-wrapper {
|
.launcher__background-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: -55vw;
|
||||||
|
right: -100%;
|
||||||
|
bottom: -50vw;
|
||||||
|
left: -70vw;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
position: absolute;
|
|
||||||
left: -70vw;
|
|
||||||
right: -100%;
|
|
||||||
top: -55vw;
|
|
||||||
bottom: -50vw;
|
|
||||||
transform: translateX(space(0));
|
transform: translateX(space(0));
|
||||||
animation: 25s cubic-out 1 slide-mm-bg-over;
|
animation: 25s cubic-out 1 slide-mm-bg-over;
|
||||||
// height: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes fade-mm-in {
|
@keyframes fade-mm-in {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
to {
|
|
||||||
|
100% {
|
||||||
opacity: 0.1;
|
opacity: 0.1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.launcher__background-mm {
|
.launcher__background-mm {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
// top: -20%;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
height: 100%;
|
left: 0;
|
||||||
width: auto;
|
width: auto;
|
||||||
opacity: 0.1;
|
height: 100%;
|
||||||
animation: 2.5s cubic-in-out 1 fade-mm-in;
|
animation: 2.5s cubic-in-out 1 fade-mm-in;
|
||||||
|
opacity: 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.launcher__title-quadrant {
|
.launcher__title-quadrant {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
padding-top: space(96);
|
|
||||||
padding-left: space(96);
|
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
padding-top: space(96);
|
||||||
|
padding-left: space(96);
|
||||||
|
|
||||||
&--right {
|
&--right {
|
||||||
padding-right: space(96);
|
padding-right: space(96);
|
||||||
@ -100,11 +98,11 @@
|
|||||||
.launcher__content-quadrant {
|
.launcher__content-quadrant {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
flex: 1 1 100%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
padding: space(32);
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
flex: 1 1 100%;
|
padding: space(32);
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
&--right {
|
&--right {
|
||||||
align-content: flex-end;
|
|
||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
|
align-content: flex-end;
|
||||||
|
|
||||||
.menu-list-item__bullet {
|
.menu-list-item__bullet {
|
||||||
opacity: 1;
|
|
||||||
margin-left: space(12);
|
margin-left: space(12);
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.menu-list-item:focus:not(:disabled, [disabled]),
|
&.menu-list-item:focus:not(:disabled, [disabled]),
|
||||||
@ -60,11 +60,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-list-item__label {
|
.menu-list-item__label {
|
||||||
@extend .label-lg;
|
@extend %label-lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-list-item__bullet {
|
.menu-list-item__bullet {
|
||||||
opacity: 0;
|
|
||||||
margin-right: space(12);
|
margin-right: space(12);
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
70
assets/scss/styles/components/Prompt.scss
Normal file
70
assets/scss/styles/components/Prompt.scss
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
@use 'sass:math';
|
||||||
|
|
||||||
|
$prompt-space: 24;
|
||||||
|
|
||||||
|
.prompt {
|
||||||
|
&__overlay {
|
||||||
|
background-color: $color-bg-overlay;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__overlay,
|
||||||
|
&__content-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content-wrapper {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__content {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
flex: 1 1 100%;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
max-width: space(700);
|
||||||
|
height: auto;
|
||||||
|
margin: auto;
|
||||||
|
border-width: $border-width-thickness;
|
||||||
|
border-radius: $border-radius-modal;
|
||||||
|
border-color: $color-border;
|
||||||
|
background: $color-modal-overlay;
|
||||||
|
|
||||||
|
h3, p {
|
||||||
|
margin: space($prompt-space);
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__controls {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: center;
|
||||||
|
padding: space($prompt-space) space(math.div($prompt-space, 2));
|
||||||
|
border-top-width: $border-width-thickness;
|
||||||
|
border-top-color: $color-border-soft;
|
||||||
|
|
||||||
|
.button {
|
||||||
|
min-width: space(math.div(700, 3));
|
||||||
|
margin: 0 space(math.div($prompt-space, 2));
|
||||||
|
text-align: center;
|
||||||
|
nav-up: none;
|
||||||
|
nav-down: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -16,16 +16,16 @@
|
|||||||
.subtitle-title {
|
.subtitle-title {
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
flex-direction: column;
|
||||||
|
align-content: flex-start;
|
||||||
|
align-items: flex-start;
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
flex-direction: column;
|
padding: 0;
|
||||||
align-items: flex-start;
|
|
||||||
align-content: flex-start;
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
background-color: rgba(0, 0, 0, 0);
|
||||||
color: $color-text-dim;
|
color: $color-text-dim;
|
||||||
cursor: pointer;
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding: 0;
|
cursor: pointer;
|
||||||
|
|
||||||
&--right {
|
&--right {
|
||||||
align-content: flex-end;
|
align-content: flex-end;
|
||||||
@ -64,7 +64,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&__disclaimer {
|
&__disclaimer {
|
||||||
@extend .label-sm;
|
@extend %label-sm;
|
||||||
|
|
||||||
margin-top: space(16);
|
margin-top: space(16);
|
||||||
}
|
}
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
@extend %header-3;
|
@extend %header-3;
|
||||||
display: block;
|
display: block;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: space(20) space(24);
|
|
||||||
background-color: rgba(0,0,0,0);
|
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: $color-text-inactive;
|
padding: space(20) space(24);
|
||||||
transition: color $transition-quick;
|
transition: color $transition-quick;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
background-color: rgba(0,0,0,0);
|
||||||
|
color: $color-text-inactive;
|
||||||
|
|
||||||
&:selected {
|
&:selected {
|
||||||
color: $color-text;
|
color: $color-text;
|
||||||
@ -37,18 +37,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rmlui-window:not([mouse-active]) &:focus {
|
||||||
|
transition: none;
|
||||||
|
animation: $focus-anim-border;
|
||||||
|
|
||||||
|
&:selected .tab__indicator {
|
||||||
|
animation: $focus-anim-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:focus, &:hover {
|
&:focus, &:hover {
|
||||||
cursor: pointer;
|
|
||||||
color: $color-text;
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
color: $color-text;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab__indicator {
|
.tab__indicator {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 2dp;
|
bottom: 2dp;
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 2dp;
|
height: 2dp;
|
||||||
|
background-color: rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -12,25 +12,25 @@ $toggle-checked-left-offset: $toggle-width - $toggle-floater-margin - $toggle-fl
|
|||||||
@extend %nav-all;
|
@extend %nav-all;
|
||||||
@include trans-colors-opa;
|
@include trans-colors-opa;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
position: relative;
|
|
||||||
width: space($toggle-width);
|
width: space($toggle-width);
|
||||||
height: space($toggle-height);
|
height: space($toggle-height);
|
||||||
background: $color-transparent;
|
|
||||||
border-radius: space(math.div($toggle-height, 2));
|
border-radius: space(math.div($toggle-height, 2));
|
||||||
cursor: pointer;
|
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
background: $color-transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover, &:focus-visible, &:focus {
|
&:hover, &:focus-visible, &:focus {
|
||||||
background-color: $color-secondary-a30;
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
background-color: $color-secondary-a30;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: $color-secondary-a5;
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
background-color: $color-secondary-a5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle__border {
|
.toggle__border {
|
||||||
@ -40,10 +40,10 @@ $toggle-checked-left-offset: $toggle-width - $toggle-floater-margin - $toggle-fl
|
|||||||
|
|
||||||
.toggle__floater {
|
.toggle__floater {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: space($toggle-floater-width);
|
|
||||||
height: space($toggle-floater-height);
|
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: space($toggle-floater-margin);
|
left: space($toggle-floater-margin);
|
||||||
|
width: space($toggle-floater-width);
|
||||||
|
height: space($toggle-floater-height);
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
border-radius: space(math.div($toggle-floater-height, 2));
|
border-radius: space(math.div($toggle-floater-height, 2));
|
||||||
background: $color-secondary-d;
|
background: $color-secondary-d;
|
||||||
@ -56,12 +56,13 @@ $toggle-checked-left-offset: $toggle-width - $toggle-floater-margin - $toggle-fl
|
|||||||
|
|
||||||
.toggle__icon {
|
.toggle__icon {
|
||||||
&.toggle__icon--left {
|
&.toggle__icon--left {
|
||||||
color: $color-secondary-l;
|
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
color: $color-secondary-l;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.toggle__icon--right {
|
&.toggle__icon--right {
|
||||||
color: $color-text;
|
|
||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
|
color: $color-text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -70,13 +71,13 @@ $toggle-checked-left-offset: $toggle-width - $toggle-floater-margin - $toggle-fl
|
|||||||
.toggle__icons {
|
.toggle__icons {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: space(56);
|
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
|
||||||
right: space(16);
|
right: space(16);
|
||||||
left: space(16);
|
left: space(16);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
height: space(56);
|
||||||
|
transform: translateY(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.toggle__icon {
|
.toggle__icon {
|
||||||
|
@ -9,4 +9,5 @@
|
|||||||
@import "./MenuListItem";
|
@import "./MenuListItem";
|
||||||
@import "./SubtitleTitle";
|
@import "./SubtitleTitle";
|
||||||
@import "./Toggle";
|
@import "./Toggle";
|
||||||
@import "./BottomLeft"
|
@import "./BottomLeft";
|
||||||
|
@import "./Prompt";
|
||||||
|
@ -25,18 +25,23 @@ body
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-vert {
|
.nav-vert {
|
||||||
@extend %nav-vert;
|
@extend %nav-vert;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-horiz {
|
.nav-horiz {
|
||||||
@extend %nav-horiz;
|
@extend %nav-horiz;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-dir {
|
.nav-dir {
|
||||||
@extend %nav-dir;
|
@extend %nav-dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-foc {
|
.nav-foc {
|
||||||
@extend %nav-foc;
|
@extend %nav-foc;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-all {
|
.nav-all {
|
||||||
@extend %nav-all;
|
@extend %nav-all;
|
||||||
}
|
}
|
||||||
@ -80,3 +85,48 @@ h3 {
|
|||||||
button {
|
button {
|
||||||
background-color: $color-primary-d;
|
background-color: $color-primary-d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes blue-pulse {
|
||||||
|
0% {
|
||||||
|
color: $color-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
color: $color-secondary-l;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
color: $color-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blue-pulse-with-border {
|
||||||
|
0% {
|
||||||
|
border-color: $color-secondary;
|
||||||
|
color: $color-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
border-color: $color-secondary-l;
|
||||||
|
color: $color-secondary-l;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
border-color: $color-secondary;
|
||||||
|
color: $color-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blue-pulse-background {
|
||||||
|
0% {
|
||||||
|
background-color: $color-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
background-color: $color-secondary-l;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
background-color: $color-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/* stylelint-disable color-no-hex */
|
||||||
|
/* stylelint-disable selector-max-id */
|
||||||
|
|
||||||
* {
|
* {
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
@ -5,16 +7,16 @@
|
|||||||
|
|
||||||
hr {
|
hr {
|
||||||
display:block;
|
display:block;
|
||||||
background:black;
|
|
||||||
padding:1.5dp;
|
padding:1.5dp;
|
||||||
|
background: $color-background-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
color: #fff;
|
||||||
font-family: chiaro;
|
font-family: chiaro;
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
font-size: 20dp;
|
font-size: 20dp;
|
||||||
color: #fff
|
font-style: normal;
|
||||||
|
font-weight: normal
|
||||||
}
|
}
|
||||||
|
|
||||||
/* div {
|
/* div {
|
||||||
@ -24,11 +26,11 @@ body {
|
|||||||
|
|
||||||
div#window {
|
div#window {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: $color-background-2;
|
|
||||||
border-color: $color-border;
|
border-color: $color-border;
|
||||||
|
background-color: $color-background-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#content {
|
div#content {
|
||||||
@ -53,14 +55,14 @@ input.password {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 31dp;
|
height: 31dp;
|
||||||
padding: 11dp 10dp 0;
|
padding: 11dp 10dp 0;
|
||||||
cursor: text;
|
text-align: left;
|
||||||
text-align: left
|
cursor: text
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
padding: 14dp 12dp 10dp;
|
padding: 14dp 12dp 10dp;
|
||||||
cursor: text;
|
text-align: left;
|
||||||
text-align: left
|
cursor: text
|
||||||
}
|
}
|
||||||
|
|
||||||
input.text,
|
input.text,
|
||||||
@ -68,6 +70,7 @@ input.password,
|
|||||||
select,
|
select,
|
||||||
textarea {
|
textarea {
|
||||||
/* color: #333; */
|
/* color: #333; */
|
||||||
|
|
||||||
/* font-size: 13dp */
|
/* font-size: 13dp */
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
@ -75,16 +78,19 @@ textarea {
|
|||||||
table input.text {
|
table input.text {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
/* height: 18dp; */
|
/* height: 18dp; */
|
||||||
margin: 0;
|
margin: 0;
|
||||||
/* padding: 0 5dp; */
|
|
||||||
line-height: 1;
|
|
||||||
border-width: $border-width-thickness;
|
border-width: $border-width-thickness;
|
||||||
border-color: #000;
|
border-color: #000;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
font-size: 15dp;
|
font-size: 15dp;
|
||||||
|
|
||||||
|
/* padding: 0 5dp; */
|
||||||
|
line-height: 1;
|
||||||
decorator: none;
|
decorator: none;
|
||||||
height: auto;
|
|
||||||
/* vertical-align: center; */
|
/* vertical-align: center; */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,11 +192,11 @@ select {
|
|||||||
input.radio,
|
input.radio,
|
||||||
input.checkbox {
|
input.checkbox {
|
||||||
flex: 0;
|
flex: 0;
|
||||||
|
width:0dp;
|
||||||
|
nav-up:auto;
|
||||||
|
nav-right:auto;
|
||||||
|
nav-down:auto;
|
||||||
|
nav-left:auto;
|
||||||
tab-index:auto;
|
tab-index:auto;
|
||||||
focus:auto;
|
focus:auto;
|
||||||
nav-up:auto;
|
|
||||||
nav-down:auto;
|
|
||||||
nav-right:auto;
|
|
||||||
nav-left:auto;
|
|
||||||
width:0dp;
|
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
image-color: $col;
|
image-color: $col;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@include set-color(COLOR);
|
@include set-color(COLOR);
|
||||||
*/
|
*/
|
||||||
|
@ -60,24 +60,24 @@ $font-stack: chiaro;
|
|||||||
|
|
||||||
%prompt-font-lg {
|
%prompt-font-lg {
|
||||||
font-family: promptfont;
|
font-family: promptfont;
|
||||||
|
font-size: space(56);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: space(56);
|
|
||||||
line-height: space(56);
|
line-height: space(56);
|
||||||
}
|
}
|
||||||
|
|
||||||
%prompt-font {
|
%prompt-font {
|
||||||
font-family: promptfont;
|
font-family: promptfont;
|
||||||
|
font-size: space(40);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: space(40);
|
|
||||||
line-height: space(40);
|
line-height: space(40);
|
||||||
}
|
}
|
||||||
|
|
||||||
%prompt-font-sm {
|
%prompt-font-sm {
|
||||||
font-family: promptfont;
|
font-family: promptfont;
|
||||||
|
font-size: space(32);
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: space(32);
|
|
||||||
line-height: space(32);
|
line-height: space(32);
|
||||||
}
|
}
|
||||||
|
4
assets/scss/styles/vars/_animations.scss
Normal file
4
assets/scss/styles/vars/_animations.scss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
$focus-anim: blue-pulse-with-border 0.75s infinite;
|
||||||
|
$focus-anim-border: blue-pulse 0.75s infinite;
|
||||||
|
$focus-anim-bg: blue-pulse-background 0.75s infinite;
|
@ -11,18 +11,18 @@ $border-width-thickness-num: 1.1;
|
|||||||
$border-width-thickness: space($border-width-thickness-num);
|
$border-width-thickness: space($border-width-thickness-num);
|
||||||
|
|
||||||
@mixin border($col: $color-border) {
|
@mixin border($col: $color-border) {
|
||||||
border-color: $col;
|
|
||||||
border-width: $border-width-thickness;
|
border-width: $border-width-thickness;
|
||||||
|
border-color: $col;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin border-top($col: $color-border) {
|
@mixin border-top($col: $color-border) {
|
||||||
border-top-color: $col;
|
|
||||||
border-top-width: $border-width-thickness;
|
border-top-width: $border-width-thickness;
|
||||||
|
border-top-color: $col;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin border-bottom($col: $color-border) {
|
@mixin border-bottom($col: $color-border) {
|
||||||
border-bottom-color: $col;
|
|
||||||
border-bottom-width: $border-width-thickness;
|
border-bottom-width: $border-width-thickness;
|
||||||
|
border-bottom-color: $col;
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin inset-block($inset-amt) {
|
@mixin inset-block($inset-amt) {
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
// $primary-lr-fade: linear-gradient(90deg, rgba($color-primary-l, 0.08) 0%, rgba($color-primary-l, 0.00) 100%);
|
// $primary-lr-fade: linear-gradient(90deg, rgba($color-primary-l, 0.08) 0%, rgba($color-primary-l, 0.00) 100%);
|
||||||
// $primary-rl-fade: linear-gradient(90deg, rgba($color-primary-l, 0.00) 0%, rgba($color-primary-l, 0.08) 100%);
|
// $primary-rl-fade: linear-gradient(90deg, rgba($color-primary-l, 0.00) 0%, rgba($color-primary-l, 0.08) 100%);
|
||||||
|
|
||||||
$primary-lr-fade: gradient(horizontal #{$color-primary-d}14 #{$color-primary-l}00);
|
$primary-lr-fade: horizontal-gradient(#{$color-primary-d}14 #{$color-primary-l}00);
|
||||||
$primary-rl-fade: gradient(horizontal #{$color-primary-d}00 #{$color-primary-l}14);
|
$primary-rl-fade: horizontal-gradient(#{$color-primary-d}00 #{$color-primary-l}14);
|
||||||
|
BIN
docs/deck_gyro_1.jpg
Normal file
BIN
docs/deck_gyro_1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 109 KiB |
BIN
icons/512.png
Normal file
BIN
icons/512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
@ -1,4 +0,0 @@
|
|||||||
#ifdef __clang__
|
|
||||||
#pragma clang diagnostic ignored "-Wunused-variable"
|
|
||||||
#pragma clang diagnostic ignored "-Wimplicit-function-declaration"
|
|
||||||
#endif
|
|
9
include/ovl_patches.hpp
Normal file
9
include/ovl_patches.hpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef __OVL_PATCHES_HPP__
|
||||||
|
#define __OVL_PATCHES_HPP__
|
||||||
|
|
||||||
|
namespace zelda64 {
|
||||||
|
void register_overlays();
|
||||||
|
void register_patches();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
327
include/recomp.h
327
include/recomp.h
@ -1,327 +0,0 @@
|
|||||||
#ifndef __RECOMP_H__
|
|
||||||
#define __RECOMP_H__
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <math.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <setjmp.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
|
|
||||||
#if 0 // treat GPRs as 32-bit, should be better codegen
|
|
||||||
typedef uint32_t gpr;
|
|
||||||
|
|
||||||
#define SIGNED(val) \
|
|
||||||
((int32_t)(val))
|
|
||||||
#else
|
|
||||||
typedef uint64_t gpr;
|
|
||||||
|
|
||||||
#define SIGNED(val) \
|
|
||||||
((int64_t)(val))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ADD32(a, b) \
|
|
||||||
((gpr)(int32_t)((a) + (b)))
|
|
||||||
|
|
||||||
#define SUB32(a, b) \
|
|
||||||
((gpr)(int32_t)((a) - (b)))
|
|
||||||
|
|
||||||
#define MEM_W(offset, reg) \
|
|
||||||
(*(int32_t*)(rdram + ((((reg) + (offset))) - 0xFFFFFFFF80000000)))
|
|
||||||
//(*(int32_t*)(rdram + ((((reg) + (offset))) & 0x3FFFFFF)))
|
|
||||||
|
|
||||||
#define MEM_H(offset, reg) \
|
|
||||||
(*(int16_t*)(rdram + ((((reg) + (offset)) ^ 2) - 0xFFFFFFFF80000000)))
|
|
||||||
//(*(int16_t*)(rdram + ((((reg) + (offset)) ^ 2) & 0x3FFFFFF)))
|
|
||||||
|
|
||||||
#define MEM_B(offset, reg) \
|
|
||||||
(*(int8_t*)(rdram + ((((reg) + (offset)) ^ 3) - 0xFFFFFFFF80000000)))
|
|
||||||
//(*(int8_t*)(rdram + ((((reg) + (offset)) ^ 3) & 0x3FFFFFF)))
|
|
||||||
|
|
||||||
#define MEM_HU(offset, reg) \
|
|
||||||
(*(uint16_t*)(rdram + ((((reg) + (offset)) ^ 2) - 0xFFFFFFFF80000000)))
|
|
||||||
//(*(uint16_t*)(rdram + ((((reg) + (offset)) ^ 2) & 0x3FFFFFF)))
|
|
||||||
|
|
||||||
#define MEM_BU(offset, reg) \
|
|
||||||
(*(uint8_t*)(rdram + ((((reg) + (offset)) ^ 3) - 0xFFFFFFFF80000000)))
|
|
||||||
//(*(uint8_t*)(rdram + ((((reg) + (offset)) ^ 3) & 0x3FFFFFF)))
|
|
||||||
|
|
||||||
#define SD(val, offset, reg) { \
|
|
||||||
*(uint32_t*)(rdram + ((((reg) + (offset) + 4)) - 0xFFFFFFFF80000000)) = (uint32_t)((gpr)(val) >> 0); \
|
|
||||||
*(uint32_t*)(rdram + ((((reg) + (offset) + 0)) - 0xFFFFFFFF80000000)) = (uint32_t)((gpr)(val) >> 32); \
|
|
||||||
}
|
|
||||||
|
|
||||||
//#define SD(val, offset, reg) { \
|
|
||||||
// *(uint32_t*)(rdram + ((((reg) + (offset) + 4)) & 0x3FFFFFF)) = (uint32_t)((val) >> 32); \
|
|
||||||
// *(uint32_t*)(rdram + ((((reg) + (offset) + 0)) & 0x3FFFFFF)) = (uint32_t)((val) >> 0); \
|
|
||||||
//}
|
|
||||||
|
|
||||||
static inline uint64_t load_doubleword(uint8_t* rdram, gpr reg, gpr offset) {
|
|
||||||
uint64_t ret = 0;
|
|
||||||
uint64_t lo = (uint64_t)(uint32_t)MEM_W(reg, offset + 4);
|
|
||||||
uint64_t hi = (uint64_t)(uint32_t)MEM_W(reg, offset + 0);
|
|
||||||
ret = (lo << 0) | (hi << 32);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LD(offset, reg) \
|
|
||||||
load_doubleword(rdram, offset, reg)
|
|
||||||
|
|
||||||
static inline gpr do_lwl(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) {
|
|
||||||
// Calculate the overall address
|
|
||||||
gpr address = (offset + reg);
|
|
||||||
|
|
||||||
// Load the aligned word
|
|
||||||
gpr word_address = address & ~0x3;
|
|
||||||
uint32_t loaded_value = MEM_W(0, word_address);
|
|
||||||
|
|
||||||
// Mask the existing value and shift the loaded value appropriately
|
|
||||||
gpr misalignment = address & 0x3;
|
|
||||||
gpr masked_value = initial_value & ~(0xFFFFFFFFu << (misalignment * 8));
|
|
||||||
loaded_value <<= (misalignment * 8);
|
|
||||||
|
|
||||||
// Cast to int32_t to sign extend first
|
|
||||||
return (gpr)(int32_t)(masked_value | loaded_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline gpr do_lwr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) {
|
|
||||||
// Calculate the overall address
|
|
||||||
gpr address = (offset + reg);
|
|
||||||
|
|
||||||
// Load the aligned word
|
|
||||||
gpr word_address = address & ~0x3;
|
|
||||||
uint32_t loaded_value = MEM_W(0, word_address);
|
|
||||||
|
|
||||||
// Mask the existing value and shift the loaded value appropriately
|
|
||||||
gpr misalignment = address & 0x3;
|
|
||||||
gpr masked_value = initial_value & ~(0xFFFFFFFFu >> (24 - misalignment * 8));
|
|
||||||
loaded_value >>= (24 - misalignment * 8);
|
|
||||||
|
|
||||||
// Cast to int32_t to sign extend first
|
|
||||||
return (gpr)(int32_t)(masked_value | loaded_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void do_swl(uint8_t* rdram, gpr offset, gpr reg, gpr val) {
|
|
||||||
// Calculate the overall address
|
|
||||||
gpr address = (offset + reg);
|
|
||||||
|
|
||||||
// Get the initial value of the aligned word
|
|
||||||
gpr word_address = address & ~0x3;
|
|
||||||
uint32_t initial_value = MEM_W(0, word_address);
|
|
||||||
|
|
||||||
// Mask the initial value and shift the input value appropriately
|
|
||||||
gpr misalignment = address & 0x3;
|
|
||||||
uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu >> (misalignment * 8));
|
|
||||||
uint32_t shifted_input_value = ((uint32_t)val) >> (misalignment * 8);
|
|
||||||
MEM_W(0, word_address) = masked_initial_value | shifted_input_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) {
|
|
||||||
// Calculate the overall address
|
|
||||||
gpr address = (offset + reg);
|
|
||||||
|
|
||||||
// Get the initial value of the aligned word
|
|
||||||
gpr word_address = address & ~0x3;
|
|
||||||
uint32_t initial_value = MEM_W(0, word_address);
|
|
||||||
|
|
||||||
// Mask the initial value and shift the input value appropriately
|
|
||||||
gpr misalignment = address & 0x3;
|
|
||||||
uint32_t masked_initial_value = initial_value & ~(0xFFFFFFFFu << (24 - misalignment * 8));
|
|
||||||
uint32_t shifted_input_value = ((uint32_t)val) << (24 - misalignment * 8);
|
|
||||||
MEM_W(0, word_address) = masked_initial_value | shifted_input_value;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define S32(val) \
|
|
||||||
((int32_t)(val))
|
|
||||||
|
|
||||||
#define U32(val) \
|
|
||||||
((uint32_t)(val))
|
|
||||||
|
|
||||||
#define S64(val) \
|
|
||||||
((int64_t)(val))
|
|
||||||
|
|
||||||
#define U64(val) \
|
|
||||||
((uint64_t)(val))
|
|
||||||
|
|
||||||
#define MUL_S(val1, val2) \
|
|
||||||
((val1) * (val2))
|
|
||||||
|
|
||||||
#define MUL_D(val1, val2) \
|
|
||||||
((val1) * (val2))
|
|
||||||
|
|
||||||
#define DIV_S(val1, val2) \
|
|
||||||
((val1) / (val2))
|
|
||||||
|
|
||||||
#define DIV_D(val1, val2) \
|
|
||||||
((val1) / (val2))
|
|
||||||
|
|
||||||
#define CVT_S_W(val) \
|
|
||||||
((float)((int32_t)(val)))
|
|
||||||
|
|
||||||
#define CVT_D_W(val) \
|
|
||||||
((double)((int32_t)(val)))
|
|
||||||
|
|
||||||
#define CVT_D_S(val) \
|
|
||||||
((double)(val))
|
|
||||||
|
|
||||||
#define CVT_S_D(val) \
|
|
||||||
((float)(val))
|
|
||||||
|
|
||||||
#define TRUNC_W_S(val) \
|
|
||||||
((int32_t)(val))
|
|
||||||
|
|
||||||
#define TRUNC_W_D(val) \
|
|
||||||
((int32_t)(val))
|
|
||||||
|
|
||||||
#define TRUNC_L_S(val) \
|
|
||||||
((int64_t)(val))
|
|
||||||
|
|
||||||
#define TRUNC_L_D(val) \
|
|
||||||
((int64_t)(val))
|
|
||||||
|
|
||||||
#define DEFAULT_ROUNDING_MODE 0
|
|
||||||
|
|
||||||
static inline int32_t do_cvt_w_s(float val, unsigned int rounding_mode) {
|
|
||||||
switch (rounding_mode) {
|
|
||||||
case 0: // round to nearest value
|
|
||||||
return (int32_t)lroundf(val);
|
|
||||||
case 1: // round to zero (truncate)
|
|
||||||
return (int32_t)val;
|
|
||||||
case 2: // round to positive infinity (ceil)
|
|
||||||
return (int32_t)ceilf(val);
|
|
||||||
case 3: // round to negative infinity (floor)
|
|
||||||
return (int32_t)floorf(val);
|
|
||||||
}
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CVT_W_S(val) \
|
|
||||||
do_cvt_w_s(val, rounding_mode)
|
|
||||||
|
|
||||||
static inline int32_t do_cvt_w_d(double val, unsigned int rounding_mode) {
|
|
||||||
switch (rounding_mode) {
|
|
||||||
case 0: // round to nearest value
|
|
||||||
return (int32_t)lround(val);
|
|
||||||
case 1: // round to zero (truncate)
|
|
||||||
return (int32_t)val;
|
|
||||||
case 2: // round to positive infinity (ceil)
|
|
||||||
return (int32_t)ceil(val);
|
|
||||||
case 3: // round to negative infinity (floor)
|
|
||||||
return (int32_t)floor(val);
|
|
||||||
}
|
|
||||||
assert(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CVT_W_D(val) \
|
|
||||||
do_cvt_w_d(val, rounding_mode)
|
|
||||||
|
|
||||||
#define NAN_CHECK(val) \
|
|
||||||
assert(val == val)
|
|
||||||
|
|
||||||
//#define NAN_CHECK(val)
|
|
||||||
|
|
||||||
typedef union {
|
|
||||||
double d;
|
|
||||||
struct {
|
|
||||||
float fl;
|
|
||||||
float fh;
|
|
||||||
};
|
|
||||||
struct {
|
|
||||||
uint32_t u32l;
|
|
||||||
uint32_t u32h;
|
|
||||||
};
|
|
||||||
uint64_t u64;
|
|
||||||
} fpr;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
gpr r0, r1, r2, r3, r4, r5, r6, r7,
|
|
||||||
r8, r9, r10, r11, r12, r13, r14, r15,
|
|
||||||
r16, r17, r18, r19, r20, r21, r22, r23,
|
|
||||||
r24, r25, r26, r27, r28, r29, r30, r31;
|
|
||||||
fpr f0, f1, f2, f3, f4, f5, f6, f7,
|
|
||||||
f8, f9, f10, f11, f12, f13, f14, f15,
|
|
||||||
f16, f17, f18, f19, f20, f21, f22, f23,
|
|
||||||
f24, f25, f26, f27, f28, f29, f30, f31;
|
|
||||||
uint64_t hi, lo;
|
|
||||||
uint32_t* f_odd;
|
|
||||||
uint32_t status_reg;
|
|
||||||
uint8_t mips3_float_mode;
|
|
||||||
} recomp_context;
|
|
||||||
|
|
||||||
// Checks if the target is an even float register or that mips3 float mode is enabled
|
|
||||||
#define CHECK_FR(ctx, idx) \
|
|
||||||
assert(((idx) & 1) == 0 || (ctx)->mips3_float_mode)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void cop0_status_write(recomp_context* ctx, gpr value);
|
|
||||||
gpr cop0_status_read(recomp_context* ctx);
|
|
||||||
void switch_error(const char* func, uint32_t vram, uint32_t jtbl);
|
|
||||||
void do_break(uint32_t vram);
|
|
||||||
|
|
||||||
typedef void (recomp_func_t)(uint8_t* rdram, recomp_context* ctx);
|
|
||||||
|
|
||||||
recomp_func_t* get_function(int32_t vram);
|
|
||||||
|
|
||||||
#define LOOKUP_FUNC(val) \
|
|
||||||
get_function((int32_t)(val))
|
|
||||||
|
|
||||||
extern int32_t section_addresses[];
|
|
||||||
|
|
||||||
#define LO16(x) \
|
|
||||||
((x) & 0xFFFF)
|
|
||||||
|
|
||||||
#define HI16(x) \
|
|
||||||
(((x) >> 16) + (((x) >> 15) & 1))
|
|
||||||
|
|
||||||
#define RELOC_HI16(section_index, offset) \
|
|
||||||
HI16(section_addresses[section_index] + (offset))
|
|
||||||
|
|
||||||
#define RELOC_LO16(section_index, offset) \
|
|
||||||
LO16(section_addresses[section_index] + (offset))
|
|
||||||
|
|
||||||
// For Banjo-Tooie
|
|
||||||
void recomp_syscall_handler(uint8_t* rdram, recomp_context* ctx, int32_t instruction_vram);
|
|
||||||
|
|
||||||
// For the Mario Party games (not working)
|
|
||||||
//// This has to be in this file so it can be inlined
|
|
||||||
//struct jmp_buf_storage {
|
|
||||||
// jmp_buf buffer;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//struct RecompJmpBuf {
|
|
||||||
// int32_t owner;
|
|
||||||
// struct jmp_buf_storage* storage;
|
|
||||||
// uint64_t magic;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//// Randomly generated constant
|
|
||||||
//#define SETJMP_MAGIC 0xe17afdfa939a437bu
|
|
||||||
//
|
|
||||||
//int32_t osGetThreadEx(void);
|
|
||||||
//
|
|
||||||
//#define setjmp_recomp(rdram, ctx) { \
|
|
||||||
// struct RecompJmpBuf* buf = (struct RecompJmpBuf*)(&rdram[(uint64_t)ctx->r4 - 0xFFFFFFFF80000000]); \
|
|
||||||
// \
|
|
||||||
// /* Check if this jump buffer was previously set up */ \
|
|
||||||
// if (buf->magic == SETJMP_MAGIC) { \
|
|
||||||
// /* If so, free the old jmp_buf */ \
|
|
||||||
// free(buf->storage); \
|
|
||||||
// } \
|
|
||||||
// \
|
|
||||||
// buf->magic = SETJMP_MAGIC; \
|
|
||||||
// buf->owner = osGetThreadEx(); \
|
|
||||||
// buf->storage = (struct jmp_buf_storage*)calloc(1, sizeof(struct jmp_buf_storage)); \
|
|
||||||
// ctx->r2 = setjmp(buf->storage->buffer); \
|
|
||||||
//}
|
|
||||||
|
|
||||||
void pause_self(uint8_t *rdram);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||||||
#ifndef __RECOMP_CONFIG_H__
|
|
||||||
#define __RECOMP_CONFIG_H__
|
|
||||||
|
|
||||||
#include <filesystem>
|
|
||||||
#include <string_view>
|
|
||||||
#include "../ultramodern/config.hpp"
|
|
||||||
|
|
||||||
namespace recomp {
|
|
||||||
constexpr std::u8string_view program_id = u8"Zelda64Recompiled";
|
|
||||||
constexpr std::u8string_view mm_game_id = u8"mm.n64.us.1.0";
|
|
||||||
|
|
||||||
void load_config();
|
|
||||||
void save_config();
|
|
||||||
|
|
||||||
void reset_input_bindings();
|
|
||||||
|
|
||||||
std::filesystem::path get_app_folder_path();
|
|
||||||
|
|
||||||
bool get_debug_mode_enabled();
|
|
||||||
void set_debug_mode_enabled(bool enabled);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
14
include/recomp_files.h
Normal file
14
include/recomp_files.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef __RECOMP_FILES_H__
|
||||||
|
#define __RECOMP_FILES_H__
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
namespace recomp {
|
||||||
|
std::ifstream open_input_file_with_backup(const std::filesystem::path& filepath, std::ios_base::openmode mode = std::ios_base::in);
|
||||||
|
std::ifstream open_input_backup_file(const std::filesystem::path& filepath, std::ios_base::openmode mode = std::ios_base::in);
|
||||||
|
std::ofstream open_output_file_with_backup(const std::filesystem::path& filepath, std::ios_base::openmode mode = std::ios_base::out);
|
||||||
|
bool finalize_output_file_with_backup(const std::filesystem::path& filepath);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -1,39 +0,0 @@
|
|||||||
#ifndef __RECOMP_GAME__
|
|
||||||
#define __RECOMP_GAME__
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <filesystem>
|
|
||||||
|
|
||||||
#include "recomp.h"
|
|
||||||
#include "../ultramodern/ultramodern.hpp"
|
|
||||||
#include "rt64_layer.h"
|
|
||||||
|
|
||||||
namespace recomp {
|
|
||||||
enum class Game {
|
|
||||||
OoT,
|
|
||||||
MM,
|
|
||||||
None,
|
|
||||||
Quit
|
|
||||||
};
|
|
||||||
enum class RomValidationError {
|
|
||||||
Good,
|
|
||||||
FailedToOpen,
|
|
||||||
NotARom,
|
|
||||||
IncorrectRom,
|
|
||||||
NotYet,
|
|
||||||
IncorrectVersion,
|
|
||||||
OtherError
|
|
||||||
};
|
|
||||||
void check_all_stored_roms();
|
|
||||||
bool load_stored_rom(Game game);
|
|
||||||
RomValidationError select_rom(const std::filesystem::path& rom_path, Game game);
|
|
||||||
bool is_rom_valid(Game game);
|
|
||||||
bool is_rom_loaded();
|
|
||||||
void set_rom_contents(std::vector<uint8_t>&& new_rom);
|
|
||||||
void do_rom_read(uint8_t* rdram, gpr ram_address, uint32_t physical_addr, size_t num_bytes);
|
|
||||||
void start(ultramodern::WindowHandle window_handle, const ultramodern::audio_callbacks_t& audio_callbacks, const ultramodern::input_callbacks_t& input_callbacks, const ultramodern::gfx_callbacks_t& gfx_callbacks);
|
|
||||||
void start_game(Game game);
|
|
||||||
void message_box(const char* message);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,50 +0,0 @@
|
|||||||
#ifndef __RECOMP_HELPERS__
|
|
||||||
#define __RECOMP_HELPERS__
|
|
||||||
|
|
||||||
#include "recomp.h"
|
|
||||||
#include "../ultramodern/ultra64.h"
|
|
||||||
|
|
||||||
template<int index, typename T>
|
|
||||||
T _arg(uint8_t* rdram, recomp_context* ctx) {
|
|
||||||
static_assert(index < 4, "Only args 0 through 3 supported");
|
|
||||||
gpr raw_arg = (&ctx->r4)[index];
|
|
||||||
if constexpr (std::is_same_v<T, float>) {
|
|
||||||
if constexpr (index < 2) {
|
|
||||||
static_assert(index != 1, "Floats in arg 1 not supported");
|
|
||||||
return ctx->f12.fl;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// static_assert in else workaround
|
|
||||||
[] <bool flag = false>() {
|
|
||||||
static_assert(flag, "Floats in a2/a3 not supported");
|
|
||||||
}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if constexpr (std::is_pointer_v<T>) {
|
|
||||||
static_assert (!std::is_pointer_v<std::remove_pointer_t<T>>, "Double pointers not supported");
|
|
||||||
return TO_PTR(std::remove_pointer_t<T>, raw_arg);
|
|
||||||
}
|
|
||||||
else if constexpr (std::is_integral_v<T>) {
|
|
||||||
static_assert(sizeof(T) <= 4, "64-bit args not supported");
|
|
||||||
return static_cast<T>(raw_arg);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// static_assert in else workaround
|
|
||||||
[] <bool flag = false>() {
|
|
||||||
static_assert(flag, "Unsupported type");
|
|
||||||
}();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
void _return(recomp_context* ctx, T val) {
|
|
||||||
static_assert(sizeof(T) <= 4 && "Only 32-bit value returns supported currently");
|
|
||||||
if (std::is_same_v<T, float>) {
|
|
||||||
ctx->f0.fl = val;
|
|
||||||
}
|
|
||||||
else if (std::is_integral_v<T> && sizeof(T) <= 4) {
|
|
||||||
ctx->r2 = int32_t(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
@ -9,11 +9,14 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
|
#include "ultramodern/input.hpp"
|
||||||
|
|
||||||
#include "json/json.hpp"
|
#include "json/json.hpp"
|
||||||
|
|
||||||
namespace recomp {
|
namespace recomp {
|
||||||
// x-macros to build input enums and arrays.
|
// x-macros to build input enums and arrays.
|
||||||
// First parameter is the enum name, second parameter is the bit field for the input (or 0 if there is no associated one), third is the readable name.
|
// First parameter is the enum name, second parameter is the bit field for the input (or 0 if there is no associated one), third is the readable name.
|
||||||
|
// TODO refactor this to allow projects to rename these, or get rid of the readable name and leave that up to individual projects to map.
|
||||||
#define DEFINE_N64_BUTTON_INPUTS() \
|
#define DEFINE_N64_BUTTON_INPUTS() \
|
||||||
DEFINE_INPUT(A, 0x8000, "Action") \
|
DEFINE_INPUT(A, 0x8000, "Action") \
|
||||||
DEFINE_INPUT(B, 0x4000, "Attack/Cancel") \
|
DEFINE_INPUT(B, 0x4000, "Attack/Cancel") \
|
||||||
@ -36,9 +39,15 @@ namespace recomp {
|
|||||||
DEFINE_INPUT(X_AXIS_NEG, 0, "Left") \
|
DEFINE_INPUT(X_AXIS_NEG, 0, "Left") \
|
||||||
DEFINE_INPUT(X_AXIS_POS, 0, "Right") \
|
DEFINE_INPUT(X_AXIS_POS, 0, "Right") \
|
||||||
|
|
||||||
|
#define DEFINE_RECOMP_UI_INPUTS() \
|
||||||
|
DEFINE_INPUT(TOGGLE_MENU, 0, "Toggle Menu") \
|
||||||
|
DEFINE_INPUT(ACCEPT_MENU, 0, "Accept (Menu)") \
|
||||||
|
DEFINE_INPUT(APPLY_MENU, 0, "Apply (Menu)")
|
||||||
|
|
||||||
#define DEFINE_ALL_INPUTS() \
|
#define DEFINE_ALL_INPUTS() \
|
||||||
DEFINE_N64_BUTTON_INPUTS() \
|
DEFINE_N64_BUTTON_INPUTS() \
|
||||||
DEFINE_N64_AXIS_INPUTS()
|
DEFINE_N64_AXIS_INPUTS() \
|
||||||
|
DEFINE_RECOMP_UI_INPUTS()
|
||||||
|
|
||||||
// Enum containing every recomp input.
|
// Enum containing every recomp input.
|
||||||
#define DEFINE_INPUT(name, value, readable) name,
|
#define DEFINE_INPUT(name, value, readable) name,
|
||||||
@ -66,6 +75,8 @@ namespace recomp {
|
|||||||
bool get_input_digital(const InputField& field);
|
bool get_input_digital(const InputField& field);
|
||||||
bool get_input_digital(const std::span<const recomp::InputField> fields);
|
bool get_input_digital(const std::span<const recomp::InputField> fields);
|
||||||
void get_gyro_deltas(float* x, float* y);
|
void get_gyro_deltas(float* x, float* y);
|
||||||
|
void get_mouse_deltas(float* x, float* y);
|
||||||
|
void get_right_analog(float* x, float* y);
|
||||||
|
|
||||||
enum class InputDevice {
|
enum class InputDevice {
|
||||||
Controller,
|
Controller,
|
||||||
@ -77,8 +88,9 @@ namespace recomp {
|
|||||||
void stop_scanning_input();
|
void stop_scanning_input();
|
||||||
void finish_scanning_input(InputField scanned_field);
|
void finish_scanning_input(InputField scanned_field);
|
||||||
void cancel_scanning_input();
|
void cancel_scanning_input();
|
||||||
void set_cont_or_kb(bool cont_interacted);
|
void config_menu_set_cont_or_kb(bool cont_interacted);
|
||||||
InputField get_scanned_input();
|
InputField get_scanned_input();
|
||||||
|
int get_scanned_input_index();
|
||||||
|
|
||||||
struct DefaultN64Mappings {
|
struct DefaultN64Mappings {
|
||||||
std::vector<InputField> a;
|
std::vector<InputField> a;
|
||||||
@ -102,8 +114,40 @@ namespace recomp {
|
|||||||
std::vector<InputField> analog_right;
|
std::vector<InputField> analog_right;
|
||||||
std::vector<InputField> analog_up;
|
std::vector<InputField> analog_up;
|
||||||
std::vector<InputField> analog_down;
|
std::vector<InputField> analog_down;
|
||||||
|
|
||||||
|
std::vector<InputField> toggle_menu;
|
||||||
|
std::vector<InputField> accept_menu;
|
||||||
|
std::vector<InputField> apply_menu;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline const std::vector<InputField>& get_default_mapping_for_input(const DefaultN64Mappings& defaults, const GameInput input) {
|
||||||
|
static const std::vector<InputField> empty_input_field{};
|
||||||
|
switch (input) {
|
||||||
|
case GameInput::A: return defaults.a;
|
||||||
|
case GameInput::B: return defaults.b;
|
||||||
|
case GameInput::L: return defaults.l;
|
||||||
|
case GameInput::R: return defaults.r;
|
||||||
|
case GameInput::Z: return defaults.z;
|
||||||
|
case GameInput::START: return defaults.start;
|
||||||
|
case GameInput::C_LEFT: return defaults.c_left;
|
||||||
|
case GameInput::C_RIGHT: return defaults.c_right;
|
||||||
|
case GameInput::C_UP: return defaults.c_up;
|
||||||
|
case GameInput::C_DOWN: return defaults.c_down;
|
||||||
|
case GameInput::DPAD_LEFT: return defaults.dpad_left;
|
||||||
|
case GameInput::DPAD_RIGHT: return defaults.dpad_right;
|
||||||
|
case GameInput::DPAD_UP: return defaults.dpad_up;
|
||||||
|
case GameInput::DPAD_DOWN: return defaults.dpad_down;
|
||||||
|
case GameInput::X_AXIS_NEG: return defaults.analog_left;
|
||||||
|
case GameInput::X_AXIS_POS: return defaults.analog_right;
|
||||||
|
case GameInput::Y_AXIS_POS: return defaults.analog_up;
|
||||||
|
case GameInput::Y_AXIS_NEG: return defaults.analog_down;
|
||||||
|
case GameInput::TOGGLE_MENU: return defaults.toggle_menu;
|
||||||
|
case GameInput::ACCEPT_MENU: return defaults.accept_menu;
|
||||||
|
case GameInput::APPLY_MENU: return defaults.apply_menu;
|
||||||
|
default: return empty_input_field;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extern const DefaultN64Mappings default_n64_keyboard_mappings;
|
extern const DefaultN64Mappings default_n64_keyboard_mappings;
|
||||||
extern const DefaultN64Mappings default_n64_controller_mappings;
|
extern const DefaultN64Mappings default_n64_controller_mappings;
|
||||||
|
|
||||||
@ -116,34 +160,43 @@ namespace recomp {
|
|||||||
InputField& get_input_binding(GameInput input, size_t binding_index, InputDevice device);
|
InputField& get_input_binding(GameInput input, size_t binding_index, InputDevice device);
|
||||||
void set_input_binding(GameInput input, size_t binding_index, InputDevice device, InputField value);
|
void set_input_binding(GameInput input, size_t binding_index, InputDevice device, InputField value);
|
||||||
|
|
||||||
void get_n64_input(uint16_t* buttons_out, float* x_out, float* y_out);
|
bool get_n64_input(int controller_num, uint16_t* buttons_out, float* x_out, float* y_out);
|
||||||
void set_rumble(bool);
|
void set_rumble(int controller_num, bool);
|
||||||
|
void update_rumble();
|
||||||
void handle_events();
|
void handle_events();
|
||||||
|
|
||||||
|
ultramodern::input::connected_device_info_t get_connected_device_info(int controller_num);
|
||||||
|
|
||||||
// Rumble strength ranges from 0 to 100.
|
// Rumble strength ranges from 0 to 100.
|
||||||
int get_rumble_strength();
|
int get_rumble_strength();
|
||||||
void set_rumble_strength(int strength);
|
void set_rumble_strength(int strength);
|
||||||
|
|
||||||
enum class TargetingMode {
|
// Gyro and mouse sensitivities range from 0 to 100.
|
||||||
Switch,
|
int get_gyro_sensitivity();
|
||||||
Hold,
|
int get_mouse_sensitivity();
|
||||||
|
int get_joystick_deadzone();
|
||||||
|
void set_gyro_sensitivity(int strength);
|
||||||
|
void set_mouse_sensitivity(int strength);
|
||||||
|
void set_joystick_deadzone(int strength);
|
||||||
|
void apply_joystick_deadzone(float x_in, float y_in, float* x_out, float* y_out);
|
||||||
|
void set_right_analog_suppressed(bool suppressed);
|
||||||
|
|
||||||
|
enum class BackgroundInputMode {
|
||||||
|
On,
|
||||||
|
Off,
|
||||||
OptionCount
|
OptionCount
|
||||||
};
|
};
|
||||||
|
|
||||||
NLOHMANN_JSON_SERIALIZE_ENUM(recomp::TargetingMode, {
|
NLOHMANN_JSON_SERIALIZE_ENUM(recomp::BackgroundInputMode, {
|
||||||
{recomp::TargetingMode::Switch, "Switch"},
|
{recomp::BackgroundInputMode::On, "On"},
|
||||||
{recomp::TargetingMode::Hold, "Hold"}
|
{recomp::BackgroundInputMode::Off, "Off"}
|
||||||
});
|
});
|
||||||
|
|
||||||
TargetingMode get_targeting_mode();
|
BackgroundInputMode get_background_input_mode();
|
||||||
void set_targeting_mode(TargetingMode mode);
|
void set_background_input_mode(BackgroundInputMode mode);
|
||||||
|
|
||||||
bool game_input_disabled();
|
bool game_input_disabled();
|
||||||
bool all_input_disabled();
|
bool all_input_disabled();
|
||||||
|
|
||||||
// TODO move these
|
|
||||||
void quicksave_save();
|
|
||||||
void quicksave_load();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
#include "RmlUi/Core.h"
|
||||||
|
|
||||||
namespace Rml {
|
namespace Rml {
|
||||||
class ElementDocument;
|
class ElementDocument;
|
||||||
@ -13,7 +14,7 @@ namespace Rml {
|
|||||||
class Event;
|
class Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace recomp {
|
namespace recompui {
|
||||||
class UiEventListenerInstancer;
|
class UiEventListenerInstancer;
|
||||||
|
|
||||||
class MenuController {
|
class MenuController {
|
||||||
@ -53,6 +54,16 @@ namespace recomp {
|
|||||||
Count
|
Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class ButtonVariant {
|
||||||
|
Primary,
|
||||||
|
Secondary,
|
||||||
|
Tertiary,
|
||||||
|
Success,
|
||||||
|
Error,
|
||||||
|
Warning,
|
||||||
|
NumVariants,
|
||||||
|
};
|
||||||
|
|
||||||
void set_config_submenu(ConfigSubmenu submenu);
|
void set_config_submenu(ConfigSubmenu submenu);
|
||||||
|
|
||||||
void destroy_ui();
|
void destroy_ui();
|
||||||
@ -61,6 +72,56 @@ namespace recomp {
|
|||||||
void set_cursor_visible(bool visible);
|
void set_cursor_visible(bool visible);
|
||||||
void update_supported_options();
|
void update_supported_options();
|
||||||
void toggle_fullscreen();
|
void toggle_fullscreen();
|
||||||
|
void update_rml_display_refresh_rate();
|
||||||
|
|
||||||
|
extern const std::unordered_map<ButtonVariant, std::string> button_variants;
|
||||||
|
|
||||||
|
struct PromptContext {
|
||||||
|
Rml::DataModelHandle model_handle;
|
||||||
|
std::string header = "";
|
||||||
|
std::string content = "";
|
||||||
|
std::string confirmLabel = "Confirm";
|
||||||
|
std::string cancelLabel = "Cancel";
|
||||||
|
ButtonVariant confirmVariant = ButtonVariant::Success;
|
||||||
|
ButtonVariant cancelVariant = ButtonVariant::Error;
|
||||||
|
std::function<void()> onConfirm;
|
||||||
|
std::function<void()> onCancel;
|
||||||
|
|
||||||
|
std::string returnElementId = "";
|
||||||
|
|
||||||
|
bool open = false;
|
||||||
|
bool shouldFocus = false;
|
||||||
|
bool focusOnCancel = true;
|
||||||
|
|
||||||
|
PromptContext() = default;
|
||||||
|
|
||||||
|
void close_prompt();
|
||||||
|
void open_prompt(
|
||||||
|
const std::string& headerText,
|
||||||
|
const std::string& contentText,
|
||||||
|
const std::string& confirmLabelText,
|
||||||
|
const std::string& cancelLabelText,
|
||||||
|
std::function<void()> confirmCb,
|
||||||
|
std::function<void()> cancelCb,
|
||||||
|
ButtonVariant _confirmVariant = ButtonVariant::Success,
|
||||||
|
ButtonVariant _cancelVariant = ButtonVariant::Error,
|
||||||
|
bool _focusOnCancel = true,
|
||||||
|
const std::string& _returnElementId = ""
|
||||||
|
);
|
||||||
|
void on_confirm(void);
|
||||||
|
void on_cancel(void);
|
||||||
|
void on_click(Rml::DataModelHandle model_handle, Rml::Event& event, const Rml::VariantList& inputs);
|
||||||
|
};
|
||||||
|
|
||||||
|
PromptContext *get_prompt_context(void);
|
||||||
|
|
||||||
|
bool get_cont_active(void);
|
||||||
|
void set_cont_active(bool active);
|
||||||
|
void activate_mouse();
|
||||||
|
|
||||||
|
void message_box(const char* msg);
|
||||||
|
|
||||||
|
void set_render_hooks();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
#ifndef __RSP_H__
|
|
||||||
#define __RSP_H__
|
|
||||||
|
|
||||||
#include "rsp_vu.h"
|
|
||||||
#include "recomp.h"
|
|
||||||
|
|
||||||
enum class RspExitReason {
|
|
||||||
Invalid,
|
|
||||||
Broke,
|
|
||||||
ImemOverrun,
|
|
||||||
UnhandledJumpTarget,
|
|
||||||
Unsupported
|
|
||||||
};
|
|
||||||
|
|
||||||
extern uint8_t dmem[];
|
|
||||||
extern uint16_t rspReciprocals[512];
|
|
||||||
extern uint16_t rspInverseSquareRoots[512];
|
|
||||||
|
|
||||||
#define RSP_MEM_W(offset, addr) \
|
|
||||||
(*reinterpret_cast<uint32_t*>(dmem + (0xFFF & ((offset) + (addr)))))
|
|
||||||
|
|
||||||
#define RSP_MEM_H(offset, addr) \
|
|
||||||
(*reinterpret_cast<int16_t*>(dmem + (0xFFF & (((offset) + (addr)) ^ 2))))
|
|
||||||
|
|
||||||
#define RSP_MEM_HU(offset, addr) \
|
|
||||||
(*reinterpret_cast<uint16_t*>(dmem + (0xFFF & (((offset) + (addr)) ^ 2))))
|
|
||||||
|
|
||||||
#define RSP_MEM_B(offset, addr) \
|
|
||||||
(*reinterpret_cast<int8_t*>(dmem + (0xFFF & (((offset) + (addr)) ^ 3))))
|
|
||||||
|
|
||||||
#define RSP_MEM_BU(offset, addr) \
|
|
||||||
(*reinterpret_cast<uint8_t*>(dmem + (0xFFF & (((offset) + (addr)) ^ 3))))
|
|
||||||
|
|
||||||
#define RSP_ADD32(a, b) \
|
|
||||||
((int32_t)((a) + (b)))
|
|
||||||
|
|
||||||
#define RSP_SUB32(a, b) \
|
|
||||||
((int32_t)((a) - (b)))
|
|
||||||
|
|
||||||
#define RSP_SIGNED(val) \
|
|
||||||
((int32_t)(val))
|
|
||||||
|
|
||||||
#define SET_DMA_DMEM(dmem_addr) dma_dmem_address = (dmem_addr)
|
|
||||||
#define SET_DMA_DRAM(dram_addr) dma_dram_address = (dram_addr)
|
|
||||||
#define DO_DMA_READ(rd_len) dma_rdram_to_dmem(rdram, dma_dmem_address, dma_dram_address, (rd_len))
|
|
||||||
#define DO_DMA_WRITE(wr_len) dma_dmem_to_rdram(rdram, dma_dmem_address, dma_dram_address, (wr_len))
|
|
||||||
|
|
||||||
static inline void dma_rdram_to_dmem(uint8_t* rdram, uint32_t dmem_addr, uint32_t dram_addr, uint32_t rd_len) {
|
|
||||||
rd_len += 1; // Read length is inclusive
|
|
||||||
dram_addr &= 0xFFFFF8;
|
|
||||||
assert(dmem_addr + rd_len <= 0x1000);
|
|
||||||
for (uint32_t i = 0; i < rd_len; i++) {
|
|
||||||
RSP_MEM_B(i, dmem_addr) = MEM_B(0, (int64_t)(int32_t)(dram_addr + i + 0x80000000));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void dma_dmem_to_rdram(uint8_t* rdram, uint32_t dmem_addr, uint32_t dram_addr, uint32_t wr_len) {
|
|
||||||
wr_len += 1; // Write length is inclusive
|
|
||||||
dram_addr &= 0xFFFFF8;
|
|
||||||
assert(dmem_addr + wr_len <= 0x1000);
|
|
||||||
for (uint32_t i = 0; i < wr_len; i++) {
|
|
||||||
MEM_B(0, (int64_t)(int32_t)(dram_addr + i + 0x80000000)) = RSP_MEM_B(i, dmem_addr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
204
include/rsp_vu.h
204
include/rsp_vu.h
@ -1,204 +0,0 @@
|
|||||||
// This file is modified from the Ares N64 emulator core. Ares can
|
|
||||||
// be found at https://github.com/ares-emulator/ares. The original license
|
|
||||||
// for this portion of Ares is as follows:
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
// ares
|
|
||||||
//
|
|
||||||
// Copyright(c) 2004 - 2021 ares team, Near et al
|
|
||||||
//
|
|
||||||
// Permission to use, copy, modify, and /or distribute this software for any
|
|
||||||
// purpose with or without fee is hereby granted, provided that the above
|
|
||||||
// copyright noticeand this permission notice appear in all copies.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
// MERCHANTABILITY AND FITNESS.IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
// ----------------------------------------------------------------------
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#define ARCHITECTURE_AMD64
|
|
||||||
#define ARCHITECTURE_SUPPORTS_SSE4_1 1
|
|
||||||
|
|
||||||
#if defined(ARCHITECTURE_AMD64)
|
|
||||||
#include <nmmintrin.h>
|
|
||||||
using v128 = __m128i;
|
|
||||||
#elif defined(ARCHITECTURE_ARM64)
|
|
||||||
#include <sse2neon.h>
|
|
||||||
using v128 = __m128i;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace Accuracy {
|
|
||||||
namespace RSP {
|
|
||||||
#if ARCHITECTURE_SUPPORTS_SSE4_1
|
|
||||||
constexpr bool SISD = false;
|
|
||||||
constexpr bool SIMD = true;
|
|
||||||
#else
|
|
||||||
constexpr bool SISD = true;
|
|
||||||
constexpr bool SIMD = false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
using u8 = uint8_t;
|
|
||||||
using s8 = int8_t;
|
|
||||||
using u16 = uint16_t;
|
|
||||||
using s16 = int16_t;
|
|
||||||
using u32 = uint32_t;
|
|
||||||
using s32 = int32_t;
|
|
||||||
using u64 = uint64_t;
|
|
||||||
using s64 = int64_t;
|
|
||||||
using uint128_t = uint64_t[2];
|
|
||||||
|
|
||||||
template<u32 bits> inline auto sclamp(s64 x) -> s64 {
|
|
||||||
enum : s64 { b = 1ull << (bits - 1), m = b - 1 };
|
|
||||||
return (x > m) ? m : (x < -b) ? -b : x;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<u32 bits> inline auto sclip(s64 x) -> s64 {
|
|
||||||
enum : u64 { b = 1ull << (bits - 1), m = b * 2 - 1 };
|
|
||||||
return ((x & m) ^ b) - b;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct RSP {
|
|
||||||
using r32 = uint32_t;
|
|
||||||
using cr32 = const r32;
|
|
||||||
|
|
||||||
union r128 {
|
|
||||||
struct { uint64_t u128[2]; };
|
|
||||||
#if ARCHITECTURE_SUPPORTS_SSE4_1
|
|
||||||
struct { __m128i v128; };
|
|
||||||
|
|
||||||
operator __m128i() const { return v128; }
|
|
||||||
auto operator=(__m128i value) { v128 = value; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
auto byte(u32 index) -> uint8_t& { return ((uint8_t*)&u128)[15 - index]; }
|
|
||||||
auto byte(u32 index) const -> uint8_t { return ((uint8_t*)&u128)[15 - index]; }
|
|
||||||
|
|
||||||
auto element(u32 index) -> uint16_t& { return ((uint16_t*)&u128)[7 - index]; }
|
|
||||||
auto element(u32 index) const -> uint16_t { return ((uint16_t*)&u128)[7 - index]; }
|
|
||||||
|
|
||||||
auto u8(u32 index) -> uint8_t& { return ((uint8_t*)&u128)[15 - index]; }
|
|
||||||
auto u8(u32 index) const -> uint8_t { return ((uint8_t*)&u128)[15 - index]; }
|
|
||||||
|
|
||||||
auto s16(u32 index) -> int16_t& { return ((int16_t*)&u128)[7 - index]; }
|
|
||||||
auto s16(u32 index) const -> int16_t { return ((int16_t*)&u128)[7 - index]; }
|
|
||||||
|
|
||||||
auto u16(u32 index) -> uint16_t& { return ((uint16_t*)&u128)[7 - index]; }
|
|
||||||
auto u16(u32 index) const -> uint16_t { return ((uint16_t*)&u128)[7 - index]; }
|
|
||||||
|
|
||||||
//VCx registers
|
|
||||||
auto get(u32 index) const -> bool { return u16(index) != 0; }
|
|
||||||
auto set(u32 index, bool value) -> bool { return u16(index) = 0 - value, value; }
|
|
||||||
|
|
||||||
//vu-registers.cpp
|
|
||||||
inline auto operator()(u32 index) const -> r128;
|
|
||||||
};
|
|
||||||
using cr128 = const r128;
|
|
||||||
|
|
||||||
struct VU {
|
|
||||||
r128 r[32];
|
|
||||||
r128 acch, accm, accl;
|
|
||||||
r128 vcoh, vcol; //16-bit little endian
|
|
||||||
r128 vcch, vccl; //16-bit little endian
|
|
||||||
r128 vce; // 8-bit little endian
|
|
||||||
s16 divin;
|
|
||||||
s16 divout;
|
|
||||||
bool divdp;
|
|
||||||
} vpu;
|
|
||||||
|
|
||||||
static constexpr r128 zero{0};
|
|
||||||
static constexpr r128 invert{(uint64_t)-1, (uint64_t)-1};
|
|
||||||
|
|
||||||
inline auto accumulatorGet(u32 index) const -> u64;
|
|
||||||
inline auto accumulatorSet(u32 index, u64 value) -> void;
|
|
||||||
inline auto accumulatorSaturate(u32 index, bool slice, u16 negative, u16 positive) const -> u16;
|
|
||||||
|
|
||||||
inline auto CFC2(r32& rt, u8 rd) -> void;
|
|
||||||
inline auto CTC2(cr32& rt, u8 rd) -> void;
|
|
||||||
template<u8 e> inline auto LBV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LDV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LFV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LHV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LLV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LPV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LQV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LRV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LSV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LTV(u8 vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LUV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto LWV(r128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto MFC2(r32& rt, cr128& vs) -> void;
|
|
||||||
template<u8 e> inline auto MTC2(cr32& rt, r128& vs) -> void;
|
|
||||||
template<u8 e> inline auto SBV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SDV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SFV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SHV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SLV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SPV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SQV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SRV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SSV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto STV(u8 vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SUV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto SWV(cr128& vt, cr32& rs, s8 imm) -> void;
|
|
||||||
template<u8 e> inline auto VABS(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VADD(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VADDC(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VAND(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VCH(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VCL(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VCR(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VEQ(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VGE(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VLT(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<bool U, u8 e>
|
|
||||||
inline auto VMACF(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMACF(r128& vd, cr128& vs, cr128& vt) -> void { VMACF<0, e>(vd, vs, vt); }
|
|
||||||
template<u8 e> inline auto VMACU(r128& vd, cr128& vs, cr128& vt) -> void { VMACF<1, e>(vd, vs, vt); }
|
|
||||||
inline auto VMACQ(r128& vd) -> void;
|
|
||||||
template<u8 e> inline auto VMADH(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMADL(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMADM(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMADN(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMOV(r128& vd, u8 de, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMRG(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMUDH(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMUDL(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMUDM(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMUDN(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<bool U, u8 e>
|
|
||||||
inline auto VMULF(r128& rd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VMULF(r128& rd, cr128& vs, cr128& vt) -> void { VMULF<0, e>(rd, vs, vt); }
|
|
||||||
template<u8 e> inline auto VMULU(r128& rd, cr128& vs, cr128& vt) -> void { VMULF<1, e>(rd, vs, vt); }
|
|
||||||
template<u8 e> inline auto VMULQ(r128& rd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VNAND(r128& rd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VNE(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
inline auto VNOP() -> void;
|
|
||||||
template<u8 e> inline auto VNOR(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VNXOR(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VOR(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<bool L, u8 e>
|
|
||||||
inline auto VRCP(r128& vd, u8 de, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VRCP(r128& vd, u8 de, cr128& vt) -> void { VRCP<0, e>(vd, de, vt); }
|
|
||||||
template<u8 e> inline auto VRCPL(r128& vd, u8 de, cr128& vt) -> void { VRCP<1, e>(vd, de, vt); }
|
|
||||||
template<u8 e> inline auto VRCPH(r128& vd, u8 de, cr128& vt) -> void;
|
|
||||||
template<bool D, u8 e>
|
|
||||||
inline auto VRND(r128& vd, u8 vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VRNDN(r128& vd, u8 vs, cr128& vt) -> void { VRND<0, e>(vd, vs, vt); }
|
|
||||||
template<u8 e> inline auto VRNDP(r128& vd, u8 vs, cr128& vt) -> void { VRND<1, e>(vd, vs, vt); }
|
|
||||||
template<bool L, u8 e>
|
|
||||||
inline auto VRSQ(r128& vd, u8 de, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VRSQ(r128& vd, u8 de, cr128& vt) -> void { VRSQ<0, e>(vd, de, vt); }
|
|
||||||
template<u8 e> inline auto VRSQL(r128& vd, u8 de, cr128& vt) -> void { VRSQ<1, e>(vd, de, vt); }
|
|
||||||
template<u8 e> inline auto VRSQH(r128& vd, u8 de, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VSAR(r128& vd, cr128& vs) -> void;
|
|
||||||
template<u8 e> inline auto VSUB(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VSUBC(r128& vd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VXOR(r128& rd, cr128& vs, cr128& vt) -> void;
|
|
||||||
template<u8 e> inline auto VZERO(r128& rd, cr128& vs, cr128& vt) -> void;
|
|
||||||
};
|
|
File diff suppressed because it is too large
Load Diff
@ -1,29 +0,0 @@
|
|||||||
#ifndef __RT64_LAYER_H__
|
|
||||||
#define __RT64_LAYER_H__
|
|
||||||
|
|
||||||
#include "../ultramodern/ultramodern.hpp"
|
|
||||||
#include "../ultramodern/config.hpp"
|
|
||||||
|
|
||||||
namespace RT64 {
|
|
||||||
struct Application;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace ultramodern {
|
|
||||||
struct WindowHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
RT64::Application* RT64Init(uint8_t* rdram, ultramodern::WindowHandle window_handle, bool developer_mode);
|
|
||||||
void RT64UpdateConfig(RT64::Application* application, const ultramodern::GraphicsConfig& old_config, const ultramodern::GraphicsConfig& new_config);
|
|
||||||
void RT64EnableInstantPresent(RT64::Application* application);
|
|
||||||
void RT64SendDL(uint8_t* rdram, const OSTask* task);
|
|
||||||
void RT64UpdateScreen(uint32_t vi_origin);
|
|
||||||
void RT64ChangeWindow();
|
|
||||||
void RT64Shutdown();
|
|
||||||
RT64::UserConfiguration::Antialiasing RT64MaxMSAA();
|
|
||||||
bool RT64SamplePositionsSupported();
|
|
||||||
uint32_t RT64GetDisplayFramerate(RT64::Application* application);
|
|
||||||
|
|
||||||
void set_rt64_hooks();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
#ifndef __SECTIONS_H__
|
|
||||||
#define __SECTIONS_H__
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "recomp.h"
|
|
||||||
|
|
||||||
#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
recomp_func_t* func;
|
|
||||||
uint32_t offset;
|
|
||||||
} FuncEntry;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint32_t rom_addr;
|
|
||||||
uint32_t ram_addr;
|
|
||||||
uint32_t size;
|
|
||||||
FuncEntry *funcs;
|
|
||||||
size_t num_funcs;
|
|
||||||
size_t index;
|
|
||||||
} SectionTableEntry;
|
|
||||||
|
|
||||||
#endif
|
|
93
include/zelda_config.h
Normal file
93
include/zelda_config.h
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
#ifndef __ZELDA_CONFIG_H__
|
||||||
|
#define __ZELDA_CONFIG_H__
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string_view>
|
||||||
|
#include "ultramodern/config.hpp"
|
||||||
|
#include "recomp_input.h"
|
||||||
|
|
||||||
|
namespace zelda64 {
|
||||||
|
constexpr std::u8string_view program_id = u8"Zelda64Recompiled";
|
||||||
|
constexpr std::string_view program_name = "Zelda 64: Recompiled";
|
||||||
|
|
||||||
|
// TODO: Move loading configs to the runtime once we have a way to allow per-project customization.
|
||||||
|
void load_config();
|
||||||
|
void save_config();
|
||||||
|
|
||||||
|
void reset_input_bindings();
|
||||||
|
void reset_cont_input_bindings();
|
||||||
|
void reset_kb_input_bindings();
|
||||||
|
void reset_single_input_binding(recomp::InputDevice device, recomp::GameInput input);
|
||||||
|
|
||||||
|
std::filesystem::path get_app_folder_path();
|
||||||
|
|
||||||
|
bool get_debug_mode_enabled();
|
||||||
|
void set_debug_mode_enabled(bool enabled);
|
||||||
|
|
||||||
|
enum class AutosaveMode {
|
||||||
|
On,
|
||||||
|
Off,
|
||||||
|
OptionCount
|
||||||
|
};
|
||||||
|
|
||||||
|
NLOHMANN_JSON_SERIALIZE_ENUM(zelda64::AutosaveMode, {
|
||||||
|
{zelda64::AutosaveMode::On, "On"},
|
||||||
|
{zelda64::AutosaveMode::Off, "Off"}
|
||||||
|
});
|
||||||
|
|
||||||
|
enum class TargetingMode {
|
||||||
|
Switch,
|
||||||
|
Hold,
|
||||||
|
OptionCount
|
||||||
|
};
|
||||||
|
|
||||||
|
NLOHMANN_JSON_SERIALIZE_ENUM(zelda64::TargetingMode, {
|
||||||
|
{zelda64::TargetingMode::Switch, "Switch"},
|
||||||
|
{zelda64::TargetingMode::Hold, "Hold"}
|
||||||
|
});
|
||||||
|
|
||||||
|
TargetingMode get_targeting_mode();
|
||||||
|
void set_targeting_mode(TargetingMode mode);
|
||||||
|
|
||||||
|
enum class CameraInvertMode {
|
||||||
|
InvertNone,
|
||||||
|
InvertX,
|
||||||
|
InvertY,
|
||||||
|
InvertBoth,
|
||||||
|
OptionCount
|
||||||
|
};
|
||||||
|
|
||||||
|
NLOHMANN_JSON_SERIALIZE_ENUM(zelda64::CameraInvertMode, {
|
||||||
|
{zelda64::CameraInvertMode::InvertNone, "InvertNone"},
|
||||||
|
{zelda64::CameraInvertMode::InvertX, "InvertX"},
|
||||||
|
{zelda64::CameraInvertMode::InvertY, "InvertY"},
|
||||||
|
{zelda64::CameraInvertMode::InvertBoth, "InvertBoth"}
|
||||||
|
});
|
||||||
|
|
||||||
|
CameraInvertMode get_camera_invert_mode();
|
||||||
|
void set_camera_invert_mode(CameraInvertMode mode);
|
||||||
|
|
||||||
|
CameraInvertMode get_analog_camera_invert_mode();
|
||||||
|
void set_analog_camera_invert_mode(CameraInvertMode mode);
|
||||||
|
|
||||||
|
enum class AnalogCamMode {
|
||||||
|
On,
|
||||||
|
Off,
|
||||||
|
OptionCount
|
||||||
|
};
|
||||||
|
|
||||||
|
NLOHMANN_JSON_SERIALIZE_ENUM(zelda64::AnalogCamMode, {
|
||||||
|
{zelda64::AnalogCamMode::On, "On"},
|
||||||
|
{zelda64::AnalogCamMode::Off, "Off"}
|
||||||
|
});
|
||||||
|
|
||||||
|
AutosaveMode get_autosave_mode();
|
||||||
|
void set_autosave_mode(AutosaveMode mode);
|
||||||
|
|
||||||
|
AnalogCamMode get_analog_cam_mode();
|
||||||
|
void set_analog_cam_mode(AnalogCamMode mode);
|
||||||
|
|
||||||
|
void open_quit_game_prompt();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -1,10 +1,10 @@
|
|||||||
#ifndef __RECOMP_DEBUG_H__
|
#ifndef __ZELDA_DEBUG_H__
|
||||||
#define __RECOMP_DEBUG_H__
|
#define __ZELDA_DEBUG_H__
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace recomp {
|
namespace zelda64 {
|
||||||
struct SceneWarps {
|
struct SceneWarps {
|
||||||
int index;
|
int index;
|
||||||
std::string name;
|
std::string name;
|
14
include/zelda_game.h
Normal file
14
include/zelda_game.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef __ZELDA_GAME_H__
|
||||||
|
#define __ZELDA_GAME_H__
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
#include <span>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace zelda64 {
|
||||||
|
void quicksave_save();
|
||||||
|
void quicksave_load();
|
||||||
|
std::vector<uint8_t> decompress_mm(std::span<const uint8_t> compressed_rom);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
49
include/zelda_render.h
Normal file
49
include/zelda_render.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
#ifndef __ZELDA_RENDER_H__
|
||||||
|
#define __ZELDA_RENDER_H__
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
|
#include "common/rt64_user_configuration.h"
|
||||||
|
#include "ultramodern/renderer_context.hpp"
|
||||||
|
#include "librecomp/mods.hpp"
|
||||||
|
|
||||||
|
namespace RT64 {
|
||||||
|
struct Application;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace zelda64 {
|
||||||
|
namespace renderer {
|
||||||
|
class RT64Context final : public ultramodern::renderer::RendererContext {
|
||||||
|
public:
|
||||||
|
~RT64Context() override;
|
||||||
|
RT64Context(uint8_t *rdram, ultramodern::renderer::WindowHandle window_handle, bool developer_mode);
|
||||||
|
|
||||||
|
bool valid() override { return static_cast<bool>(app); }
|
||||||
|
|
||||||
|
bool update_config(const ultramodern::renderer::GraphicsConfig &old_config, const ultramodern::renderer::GraphicsConfig &new_config) override;
|
||||||
|
|
||||||
|
void enable_instant_present() override;
|
||||||
|
void send_dl(const OSTask *task) override;
|
||||||
|
void update_screen(uint32_t vi_origin) override;
|
||||||
|
void shutdown() override;
|
||||||
|
uint32_t get_display_framerate() const override;
|
||||||
|
float get_resolution_scale() const override;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::unique_ptr<RT64::Application> app;
|
||||||
|
std::set<std::filesystem::path> enabled_texture_packs;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::unique_ptr<ultramodern::renderer::RendererContext> create_render_context(uint8_t *rdram, ultramodern::renderer::WindowHandle window_handle, bool developer_mode);
|
||||||
|
|
||||||
|
RT64::UserConfiguration::Antialiasing RT64MaxMSAA();
|
||||||
|
bool RT64SamplePositionsSupported();
|
||||||
|
bool RT64HighPrecisionFBEnabled();
|
||||||
|
|
||||||
|
void enable_texture_pack(const recomp::mods::ModHandle& mod);
|
||||||
|
void disable_texture_pack(const recomp::mods::ModHandle& mod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -1,8 +1,10 @@
|
|||||||
#ifndef __RECOMP_SOUND_H__
|
#ifndef __ZELDA_SOUND_H__
|
||||||
#define __RECOMP_SOUND_H__
|
#define __ZELDA_SOUND_H__
|
||||||
|
|
||||||
namespace recomp {
|
namespace zelda64 {
|
||||||
void reset_sound_settings();
|
void reset_sound_settings();
|
||||||
|
void set_main_volume(int volume);
|
||||||
|
int get_main_volume();
|
||||||
void set_bgm_volume(int volume);
|
void set_bgm_volume(int volume);
|
||||||
int get_bgm_volume();
|
int get_bgm_volume();
|
||||||
void set_low_health_beeps_enabled(bool enabled);
|
void set_low_health_beeps_enabled(bool enabled);
|
22
include/zelda_support.h
Normal file
22
include/zelda_support.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifndef __ZELDA_SUPPORT_H__
|
||||||
|
#define __ZELDA_SUPPORT_H__
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
namespace zelda64 {
|
||||||
|
std::filesystem::path get_asset_path(const char* asset);
|
||||||
|
void open_file_dialog(std::function<void(bool success, const std::filesystem::path& path)> callback);
|
||||||
|
void show_error_message_box(const char *title, const char *message);
|
||||||
|
|
||||||
|
// Apple specific methods that usually require Objective-C. Implemented in support_apple.mm.
|
||||||
|
#ifdef __APPLE__
|
||||||
|
void dispatch_on_ui_thread(std::function<void()> func);
|
||||||
|
std::optional<std::filesystem::path> get_application_support_directory();
|
||||||
|
std::filesystem::path get_bundle_resource_directory();
|
||||||
|
std::filesystem::path get_bundle_directory();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
1
lib/N64ModernRuntime
Submodule
1
lib/N64ModernRuntime
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit ec56fb39b0d295d9636cb60e252088d7b23c7ac9
|
@ -1 +1 @@
|
|||||||
Subproject commit bb25b881791bc77805b30b22fea01ae42b619bd7
|
Subproject commit a893ea6386e0c842f90a726a53c9b9e888797519
|
@ -1 +1 @@
|
|||||||
Subproject commit 73cc40b482d0adad226ad101bff40d8ffa69ffeb
|
Subproject commit 610b8bf5148a27489b4e3344b4f5617b81be38c7
|
@ -1 +0,0 @@
|
|||||||
Subproject commit 75cbdf819785d9f94855987724e30a6ba0a87e29
|
|
2
lib/rt64
2
lib/rt64
@ -1 +1 @@
|
|||||||
Subproject commit 3e20a48565c8b33dce93c283267262854bdd36df
|
Subproject commit ca146dbd312e91afeacb8e2b0e8702c33db35de6
|
6
njpgdspMain.us.rev1.toml
Normal file
6
njpgdspMain.us.rev1.toml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
text_offset = 0xC438B0
|
||||||
|
text_size = 0xAF0
|
||||||
|
text_address = 0x04001080
|
||||||
|
rom_file_path = "mm.us.rev1.rom_uncompressed.z64"
|
||||||
|
output_file_path = "rsp/njpgdspMain.cpp"
|
||||||
|
output_function_name = "njpgdspMain"
|
13
patches.toml
13
patches.toml
@ -5,5 +5,16 @@
|
|||||||
elf_path = "patches/patches.elf"
|
elf_path = "patches/patches.elf"
|
||||||
output_func_path = "RecompiledPatches"
|
output_func_path = "RecompiledPatches"
|
||||||
single_file_output = true
|
single_file_output = true
|
||||||
# Allow absolute symbols to be used as jump targets
|
# Allow absolute symbols to be used as jump targets.
|
||||||
use_absolute_symbols = true
|
use_absolute_symbols = true
|
||||||
|
# Point the recompiler at the symbol files so that it can resolve relocations during recompilation.
|
||||||
|
func_reference_syms_file = "Zelda64RecompSyms/mm.us.rev1.syms.toml"
|
||||||
|
data_reference_syms_files = [ "Zelda64RecompSyms/mm.us.rev1.datasyms.toml", "Zelda64RecompSyms/mm.us.rev1.datasyms_static.toml", "patches/custom_syms.toml" ]
|
||||||
|
# Tell the recompiler to write the output binary. Doing this instead of using objcopy allows the recompiler to patch MIPS32 relocs.
|
||||||
|
output_binary_path = "patches/patches.bin"
|
||||||
|
# Do not emit warnings for unpaired LO16 values, as clang produces many of them.
|
||||||
|
unpaired_lo16_warnings = false
|
||||||
|
# Allow exporting functions and events for mods to use.
|
||||||
|
allow_exports = true
|
||||||
|
# # Enable strict patch mode, validates that patched symbols exist and that non-patch functions aren't symbols.
|
||||||
|
strict_patch_mode = true
|
||||||
|
1
patches/.gitignore
vendored
1
patches/.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
*.elf
|
*.elf
|
||||||
*.bin
|
*.bin
|
||||||
./funcs.h
|
./funcs.h
|
||||||
|
patches.map
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
TARGET = patches.elf
|
TARGET = patches.elf
|
||||||
|
|
||||||
CC := clang
|
CC ?= clang
|
||||||
LD := ld.lld
|
LD ?= ld.lld
|
||||||
OBJCOPY := llvm-objcopy
|
|
||||||
|
|
||||||
CFLAGS := -target mips -mips2 -mabi=32 -O2 -G0 -mno-abicalls -mno-odd-spreg -mno-check-zero-division \
|
CFLAGS := -target mips -mips2 -mabi=32 -O2 -G0 -mno-abicalls -mno-odd-spreg -mno-check-zero-division \
|
||||||
-fomit-frame-pointer -ffast-math -fno-unsafe-math-optimizations -fno-builtin-memset \
|
-fomit-frame-pointer -ffast-math -fno-unsafe-math-optimizations -fno-builtin-memset \
|
||||||
-Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces -Wno-unsupported-floating-point-opt
|
-Wall -Wextra -Wno-incompatible-library-redeclaration -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-variable -Wno-missing-braces -Wno-unsupported-floating-point-opt
|
||||||
CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -I dummy_headers -I ../lib/mm-decomp/include -I ../lib/mm-decomp/src -I ../lib/mm-decomp/assets -I../lib/rt64/include
|
CPPFLAGS := -nostdinc -D_LANGUAGE_C -DMIPS -I dummy_headers -I ../lib/mm-decomp/include -I ../lib/mm-decomp/src -I ../lib/mm-decomp/assets -I../lib/rt64/include
|
||||||
LDFLAGS := -nostdlib -T patches.ld -T syms.ld --just-symbols=../mm.us.rev1.elf --allow-multiple-definition
|
LDFLAGS := -nostdlib -T patches.ld -T syms.ld -Map patches.map --unresolved-symbols=ignore-all --emit-relocs
|
||||||
BINFLAGS := -O binary --remove-section=.bss --remove-section=.pad --remove-section=.text
|
|
||||||
|
|
||||||
C_SRCS := $(wildcard *.c)
|
C_SRCS := $(wildcard *.c)
|
||||||
C_OBJS := $(C_SRCS:.c=.o)
|
C_OBJS := $(C_SRCS:.c=.o)
|
||||||
C_DEPS := $(C_SRCS:.c=.d)
|
C_DEPS := $(C_SRCS:.c=.d)
|
||||||
|
|
||||||
DATABIN := $(TARGET:.elf=.bin)
|
|
||||||
|
|
||||||
$(DATABIN): $(TARGET)
|
|
||||||
$(OBJCOPY) $(BINFLAGS) $(TARGET) $@
|
|
||||||
|
|
||||||
$(TARGET): $(C_OBJS) patches.ld syms.ld
|
$(TARGET): $(C_OBJS) patches.ld syms.ld
|
||||||
$(LD) $(C_OBJS) $(LDFLAGS) -o $@
|
$(LD) $(C_OBJS) $(LDFLAGS) -o $@
|
||||||
|
|
||||||
@ -27,7 +20,7 @@ $(C_OBJS): %.o : %.c
|
|||||||
$(CC) $(CFLAGS) $(CPPFLAGS) $< -MMD -MF $(@:.o=.d) -c -o $@
|
$(CC) $(CFLAGS) $(CPPFLAGS) $< -MMD -MF $(@:.o=.d) -c -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(C_OBJS) $(TARGET) $(DATABIN)
|
rm -rf $(C_OBJS) $(TARGET) $(C_DEPS)
|
||||||
|
|
||||||
-include $(C_DEPS)
|
-include $(C_DEPS)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ extern FaultClient sActorFaultClient;
|
|||||||
Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play);
|
Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play);
|
||||||
void ZeldaArena_Free(void* ptr);
|
void ZeldaArena_Free(void* ptr);
|
||||||
|
|
||||||
void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play) {
|
RECOMP_PATCH void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play) {
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
||||||
Fault_RemoveClient(&sActorFaultClient);
|
Fault_RemoveClient(&sActorFaultClient);
|
||||||
@ -47,7 +47,7 @@ u32 create_actor_transform_id() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Actor_Init(Actor* actor, PlayState* play) {
|
RECOMP_PATCH void Actor_Init(Actor* actor, PlayState* play) {
|
||||||
Actor_SetWorldToHome(actor);
|
Actor_SetWorldToHome(actor);
|
||||||
Actor_SetShapeRotToWorld(actor);
|
Actor_SetShapeRotToWorld(actor);
|
||||||
Actor_SetFocus(actor, 0.0f);
|
Actor_SetFocus(actor, 0.0f);
|
||||||
@ -135,7 +135,7 @@ Gfx* pop_post_limb_matrix_group(Gfx* dlist, Actor* actor) {
|
|||||||
/*
|
/*
|
||||||
* Draws the limb at `limbIndex` with a level of detail display lists index by `dListIndex`
|
* Draws the limb at `limbIndex` with a level of detail display lists index by `dListIndex`
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod) {
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod) {
|
||||||
LodLimb* limb;
|
LodLimb* limb;
|
||||||
Gfx* dList;
|
Gfx* dList;
|
||||||
@ -197,7 +197,7 @@ void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3
|
|||||||
* Draw all limbs of type `LodLimb` in a given skeleton
|
* Draw all limbs of type `LodLimb` in a given skeleton
|
||||||
* Near or far display list is specified via `lod`
|
* Near or far display list is specified via `lod`
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
|
RECOMP_PATCH void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
|
||||||
PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod) {
|
PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod) {
|
||||||
LodLimb* rootLimb;
|
LodLimb* rootLimb;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
@ -261,7 +261,7 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over
|
|||||||
* Draw a limb of type `LodLimb` contained within a flexible skeleton
|
* Draw a limb of type `LodLimb` contained within a flexible skeleton
|
||||||
* Near or far display list is specified via `lod`
|
* Near or far display list is specified via `lod`
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor,
|
OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor,
|
||||||
s32 lod, Mtx** mtx) {
|
s32 lod, Mtx** mtx) {
|
||||||
LodLimb* limb;
|
LodLimb* limb;
|
||||||
@ -332,7 +332,7 @@ void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton,
|
|||||||
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
||||||
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
RECOMP_PATCH void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||||
OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor,
|
OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor,
|
||||||
s32 lod) {
|
s32 lod) {
|
||||||
LodLimb* rootLimb;
|
LodLimb* rootLimb;
|
||||||
@ -403,7 +403,7 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
|
|||||||
/*
|
/*
|
||||||
* Draws the limb of the Skeleton `skeleton` at `limbIndex`
|
* Draws the limb of the Skeleton `skeleton` at `limbIndex`
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor) {
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor) {
|
||||||
StandardLimb* limb;
|
StandardLimb* limb;
|
||||||
Gfx* dList;
|
Gfx* dList;
|
||||||
@ -463,7 +463,7 @@ void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3
|
|||||||
/**
|
/**
|
||||||
* Draw all limbs of type `StandardLimb` in a given skeleton to the polyOpa buffer
|
* Draw all limbs of type `StandardLimb` in a given skeleton to the polyOpa buffer
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
|
RECOMP_PATCH void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
|
||||||
PostLimbDrawOpa postLimbDraw, Actor* actor) {
|
PostLimbDrawOpa postLimbDraw, Actor* actor) {
|
||||||
StandardLimb* rootLimb;
|
StandardLimb* rootLimb;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
@ -521,7 +521,7 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over
|
|||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor,
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor,
|
||||||
Mtx** limbMatricies) {
|
Mtx** limbMatricies) {
|
||||||
StandardLimb* limb;
|
StandardLimb* limb;
|
||||||
@ -591,7 +591,7 @@ void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton,
|
|||||||
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
||||||
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
RECOMP_PATCH void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor) {
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor) {
|
||||||
StandardLimb* rootLimb;
|
StandardLimb* rootLimb;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
@ -661,7 +661,7 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable,
|
|||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkelAnime_DrawTransformFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH void SkelAnime_DrawTransformFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
||||||
TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx) {
|
TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx) {
|
||||||
StandardLimb* limb;
|
StandardLimb* limb;
|
||||||
@ -744,7 +744,7 @@ void SkelAnime_DrawTransformFlexLimbOpa(PlayState* play, s32 limbIndex, void** s
|
|||||||
* coordinates.
|
* coordinates.
|
||||||
* Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
|
* Note that the `TransformLimbDraw` does not have a NULL check, so must be provided even if empty.
|
||||||
*/
|
*/
|
||||||
void SkelAnime_DrawTransformFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
RECOMP_PATCH void SkelAnime_DrawTransformFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||||
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw,
|
||||||
TransformLimbDrawOpa transformLimbDraw, Actor* actor) {
|
TransformLimbDrawOpa transformLimbDraw, Actor* actor) {
|
||||||
StandardLimb* rootLimb;
|
StandardLimb* rootLimb;
|
||||||
@ -825,7 +825,7 @@ void SkelAnime_DrawTransformFlexOpa(PlayState* play, void** skeleton, Vec3s* joi
|
|||||||
* Draws the Skeleton `skeleton`'s limb at index `limbIndex`. Appends all generated graphics commands to
|
* Draws the Skeleton `skeleton`'s limb at index `limbIndex`. Appends all generated graphics commands to
|
||||||
* `gfx`. Returns a pointer to the next gfx to be appended to.
|
* `gfx`. Returns a pointer to the next gfx to be appended to.
|
||||||
*/
|
*/
|
||||||
Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx) {
|
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx) {
|
||||||
StandardLimb* limb;
|
StandardLimb* limb;
|
||||||
Gfx* dList;
|
Gfx* dList;
|
||||||
@ -884,7 +884,7 @@ Gfx* SkelAnime_DrawLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s*
|
|||||||
* Draws the Skeleton `skeleton` Appends all generated graphics to `gfx`, and returns a pointer to the
|
* Draws the Skeleton `skeleton` Appends all generated graphics to `gfx`, and returns a pointer to the
|
||||||
* next gfx to be appended to.
|
* next gfx to be appended to.
|
||||||
*/
|
*/
|
||||||
Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw,
|
RECOMP_PATCH Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw,
|
||||||
PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx) {
|
PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx) {
|
||||||
StandardLimb* rootLimb;
|
StandardLimb* rootLimb;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
@ -944,7 +944,7 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid
|
|||||||
/**
|
/**
|
||||||
* Draw a limb of type `StandardLimb` contained within a flexible skeleton to the specified display buffer
|
* Draw a limb of type `StandardLimb` contained within a flexible skeleton to the specified display buffer
|
||||||
*/
|
*/
|
||||||
Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
RECOMP_PATCH Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable,
|
||||||
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Mtx** mtx,
|
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Mtx** mtx,
|
||||||
Gfx* gfx) {
|
Gfx* gfx) {
|
||||||
StandardLimb* limb;
|
StandardLimb* limb;
|
||||||
@ -1014,7 +1014,7 @@ Gfx* SkelAnime_DrawFlexLimb(PlayState* play, s32 limbIndex, void** skeleton, Vec
|
|||||||
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
* Limbs in a flexible skeleton have meshes that can stretch to line up with other limbs.
|
||||||
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
* An array of matrices is dynamically allocated so each limb can access any transform to ensure its meshes line up.
|
||||||
*/
|
*/
|
||||||
Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
RECOMP_PATCH Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
|
||||||
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx) {
|
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, Gfx* gfx) {
|
||||||
StandardLimb* rootLimb;
|
StandardLimb* rootLimb;
|
||||||
s32 pad;
|
s32 pad;
|
||||||
@ -1085,7 +1085,7 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32
|
|||||||
|
|
||||||
extern MtxF gSkinLimbMatrices[];
|
extern MtxF gSkinLimbMatrices[];
|
||||||
|
|
||||||
void Skin_DrawImpl(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
RECOMP_PATCH void Skin_DrawImpl(Actor* actor, PlayState* play, Skin* skin, SkinPostDraw postDraw,
|
||||||
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags) {
|
SkinOverrideLimbDraw overrideLimbDraw, s32 setTranslation, s32 arg6, s32 drawFlags) {
|
||||||
s32 i;
|
s32 i;
|
||||||
SkinLimb** skeleton;
|
SkinLimb** skeleton;
|
||||||
@ -1145,7 +1145,7 @@ close_disps:;
|
|||||||
CLOSE_DISPS(gfxCtx);
|
CLOSE_DISPS(gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((noinline)) s32 scan_for_matrices(Gfx* start, Gfx* end) {
|
s32 scan_for_matrices(Gfx* start, Gfx* end) {
|
||||||
s32 matrix_count = 0;
|
s32 matrix_count = 0;
|
||||||
Gfx* cur = start;
|
Gfx* cur = start;
|
||||||
// Count any G_MTX commands between the start and end commands.
|
// Count any G_MTX commands between the start and end commands.
|
||||||
@ -1201,7 +1201,7 @@ void tag_actor_displaylists(Actor* actor, PlayState* play, Gfx* opa_start, Gfx*
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @recomp Patched to automatically add transform tagging to actor matrices based on what DL commands they write in their draw function
|
// @recomp Patched to automatically add transform tagging to actor matrices based on what DL commands they write in their draw function
|
||||||
void Actor_Draw(PlayState* play, Actor* actor) {
|
RECOMP_PATCH void Actor_Draw(PlayState* play, Actor* actor) {
|
||||||
Lights* light;
|
Lights* light;
|
||||||
|
|
||||||
OPEN_DISPS(play->state.gfxCtx);
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
BIN
patches/autosave.rgba32.bin
Normal file
BIN
patches/autosave.rgba32.bin
Normal file
Binary file not shown.
BIN
patches/autosave.rgba32.png
Normal file
BIN
patches/autosave.rgba32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 794 B |
814
patches/autosaving.c
Normal file
814
patches/autosaving.c
Normal file
@ -0,0 +1,814 @@
|
|||||||
|
#include "patches.h"
|
||||||
|
#include "play_patches.h"
|
||||||
|
#include "z64save.h"
|
||||||
|
#include "z64horse.h"
|
||||||
|
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
|
||||||
|
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||||
|
#include "overlays/actors/ovl_Obj_Warpstone/z_obj_warpstone.h"
|
||||||
|
#include "misc_funcs.h"
|
||||||
|
|
||||||
|
#define SAVE_TYPE_AUTOSAVE 2
|
||||||
|
|
||||||
|
u8 gCanPause;
|
||||||
|
s32 ShrinkWindow_Letterbox_GetSizeTarget(void);
|
||||||
|
void ShrinkWindow_Letterbox_SetSizeTarget(s32 target);
|
||||||
|
|
||||||
|
// @recomp Patched function to set a global variable if the player can pause
|
||||||
|
RECOMP_PATCH void KaleidoSetup_Update(PlayState* play) {
|
||||||
|
Input* input = CONTROLLER1(&play->state);
|
||||||
|
MessageContext* msgCtx = &play->msgCtx;
|
||||||
|
Player* player = GET_PLAYER(play);
|
||||||
|
PauseContext* pauseCtx = &play->pauseCtx;
|
||||||
|
|
||||||
|
if (CHECK_BTN_ALL(input->cur.button, BTN_R)) {
|
||||||
|
if (msgCtx && msgCtx) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pauseCtx->state == PAUSE_STATE_OFF) && (pauseCtx->debugEditor == DEBUG_EDITOR_NONE) &&
|
||||||
|
(play->gameOverCtx.state == GAMEOVER_INACTIVE)) {
|
||||||
|
if ((play->transitionTrigger == TRANS_TRIGGER_OFF) && (play->transitionMode == TRANS_MODE_OFF)) {
|
||||||
|
if ((gSaveContext.save.cutsceneIndex < 0xFFF0) && (gSaveContext.nextCutsceneIndex < 0xFFF0)) {
|
||||||
|
if (!Play_InCsMode(play) || ((msgCtx->msgMode != MSGMODE_NONE) && (msgCtx->currentTextId == 0xFF))) {
|
||||||
|
if ((play->unk_1887C < 2) && (gSaveContext.magicState != MAGIC_STATE_STEP_CAPACITY) &&
|
||||||
|
(gSaveContext.magicState != MAGIC_STATE_FILL)) {
|
||||||
|
if (!CHECK_EVENTINF(EVENTINF_17) && !(player->stateFlags1 & PLAYER_STATE1_20)) {
|
||||||
|
if (!(play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON) &&
|
||||||
|
!(play->actorCtx.flags & ACTORCTX_FLAG_PICTO_BOX_ON)) {
|
||||||
|
if (!play->actorCtx.isOverrideInputOn) {
|
||||||
|
if (CHECK_BTN_ALL(input->press.button, BTN_START)) {
|
||||||
|
gSaveContext.prevHudVisibility = gSaveContext.hudVisibility;
|
||||||
|
pauseCtx->itemDescriptionOn = false;
|
||||||
|
pauseCtx->state = PAUSE_STATE_OPENING_0;
|
||||||
|
func_800F4A10(play);
|
||||||
|
// Set next page mode to scroll left
|
||||||
|
pauseCtx->nextPageMode = pauseCtx->pageIndex * 2 + 1;
|
||||||
|
Audio_SetPauseState(true);
|
||||||
|
}
|
||||||
|
// @recomp Create a variable to check if the player can pause or not, which is used to determine when to autosave
|
||||||
|
else {
|
||||||
|
gCanPause = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pauseCtx->state == PAUSE_STATE_OPENING_0) {
|
||||||
|
GameState_SetFramerateDivisor(&play->state, 2);
|
||||||
|
if (ShrinkWindow_Letterbox_GetSizeTarget() != 0) {
|
||||||
|
ShrinkWindow_Letterbox_SetSizeTarget(0);
|
||||||
|
}
|
||||||
|
Audio_PlaySfx_PauseMenuOpenOrClose(SFX_PAUSE_MENU_OPEN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sram_SyncWriteToFlash(SramContext* sramCtx, s32 curPage, s32 numPages);
|
||||||
|
|
||||||
|
void recomp_reset_autosave_timer();
|
||||||
|
void recomp_reset_autosave_timer_slow();
|
||||||
|
|
||||||
|
RECOMP_EXPORT void recomp_do_autosave(PlayState* play) {
|
||||||
|
// Transfer the scene flags into the cycle flags.
|
||||||
|
Play_SaveCycleSceneFlags(&play->state);
|
||||||
|
// Transfer the cycle flags into the save buffer. Logic copied from func_8014546C.
|
||||||
|
for (s32 i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].chest = gSaveContext.cycleSceneFlags[i].chest;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0 = gSaveContext.cycleSceneFlags[i].switch0;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1 = gSaveContext.cycleSceneFlags[i].switch1;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom = gSaveContext.cycleSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible = gSaveContext.cycleSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 fileNum = gSaveContext.fileNum;
|
||||||
|
|
||||||
|
gSaveContext.save.isOwlSave = SAVE_TYPE_AUTOSAVE;
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.checksum = 0;
|
||||||
|
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
|
||||||
|
SramContext* sramCtx = &play->sramCtx;
|
||||||
|
// Copy the saved parts of the global save context into the sram saving buffer.
|
||||||
|
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
// Synchronously save into the owl save slot and the backup owl save slot.
|
||||||
|
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2], gFlashOwlSaveNumPages[fileNum * 2]);
|
||||||
|
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2 + 1], gFlashOwlSaveNumPages[fileNum * 2 + 1]);
|
||||||
|
|
||||||
|
gSaveContext.save.isOwlSave = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool loading_deletes_owl_save = true;
|
||||||
|
|
||||||
|
// @recomp_export void recomp_set_loading_deletes_owl_save(bool new_val): Set whether loading an owl save should also delete it.
|
||||||
|
RECOMP_EXPORT void recomp_set_loading_deletes_owl_save(bool new_val)
|
||||||
|
{
|
||||||
|
loading_deletes_owl_save = new_val;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @recomp Do not clear the save if the save was an autosave, or if mods have disabled save deletion.
|
||||||
|
RECOMP_PATCH void func_80147314(SramContext* sramCtx, s32 fileNum) {
|
||||||
|
s32 save_type = gSaveContext.save.isOwlSave;
|
||||||
|
gSaveContext.save.isOwlSave = false;
|
||||||
|
|
||||||
|
// @recomp Prevent owl save/autosave deletion if autosaving is enabled, and...
|
||||||
|
// @recomp_use_export_var loading_deletes_owl_save: Prevent owl save deletion if mods disable it.
|
||||||
|
if (!recomp_get_autosave_enabled() && loading_deletes_owl_save) {
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[0] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[1] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[2] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[3] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[4] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[5] = '\0';
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.checksum = 0;
|
||||||
|
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
|
||||||
|
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2], gFlashOwlSaveNumPages[fileNum * 2]);
|
||||||
|
//! Note: should be `gFlashOwlSaveNumPages[fileNum * 2 + 1]`?
|
||||||
|
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2 + 1], gFlashOwlSaveNumPages[fileNum * 2]);
|
||||||
|
|
||||||
|
gSaveContext.save.isOwlSave = true;
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[0] = 'Z';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[1] = 'E';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[2] = 'L';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[3] = 'D';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[4] = 'A';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[5] = '3';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void delete_owl_save(SramContext* sramCtx, s32 fileNum) {
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[0] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[1] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[2] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[3] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[4] = '\0';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[5] = '\0';
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.checksum = 0;
|
||||||
|
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
|
||||||
|
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2], gFlashOwlSaveNumPages[fileNum * 2]);
|
||||||
|
Sram_SyncWriteToFlash(sramCtx, gFlashOwlSaveStartPages[fileNum * 2 + 1], gFlashOwlSaveNumPages[fileNum * 2 + 1]);
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[0] = 'Z';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[1] = 'E';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[2] = 'L';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[3] = 'D';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[4] = 'A';
|
||||||
|
gSaveContext.save.saveInfo.playerData.newf[5] = '3';
|
||||||
|
}
|
||||||
|
|
||||||
|
// @recomp Patched to delete owl saves when making regular saves.
|
||||||
|
RECOMP_PATCH void func_8014546C(SramContext* sramCtx) {
|
||||||
|
s32 i;
|
||||||
|
|
||||||
|
if (gSaveContext.save.isOwlSave) {
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].chest = gSaveContext.cycleSceneFlags[i].chest;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0 = gSaveContext.cycleSceneFlags[i].switch0;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1 = gSaveContext.cycleSceneFlags[i].switch1;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom = gSaveContext.cycleSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible = gSaveContext.cycleSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.checksum = 0;
|
||||||
|
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
|
||||||
|
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
} else {
|
||||||
|
// @recomp Delete the owl save.
|
||||||
|
delete_owl_save(sramCtx, gSaveContext.fileNum);
|
||||||
|
// @recomp Reset the autosave timer.
|
||||||
|
recomp_reset_autosave_timer();
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].chest = gSaveContext.cycleSceneFlags[i].chest;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0 = gSaveContext.cycleSceneFlags[i].switch0;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1 = gSaveContext.cycleSceneFlags[i].switch1;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom = gSaveContext.cycleSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible = gSaveContext.cycleSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.checksum = 0;
|
||||||
|
gSaveContext.save.saveInfo.checksum = Sram_CalcChecksum(&gSaveContext.save, sizeof(Save));
|
||||||
|
|
||||||
|
if (gSaveContext.flashSaveAvailable) {
|
||||||
|
Lib_MemCpy(sramCtx->saveBuf, &gSaveContext, sizeof(Save));
|
||||||
|
Lib_MemCpy(&sramCtx->saveBuf[0x2000], &gSaveContext.save, sizeof(Save));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extern u16 D_801F6AF0;
|
||||||
|
extern u8 D_801F6AF2;
|
||||||
|
|
||||||
|
// @recomp Patched to call the new owl save deletion function.
|
||||||
|
RECOMP_PATCH void Sram_EraseSave(FileSelectState* fileSelect2, SramContext* sramCtx, s32 fileNum) {
|
||||||
|
FileSelectState* fileSelect = fileSelect2;
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
|
if (gSaveContext.flashSaveAvailable) {
|
||||||
|
if (fileSelect->isOwlSave[fileNum + 2]) {
|
||||||
|
// @recomp Call the new owl save deletion function.
|
||||||
|
delete_owl_save(sramCtx, fileNum);
|
||||||
|
fileSelect->isOwlSave[fileNum + 2] = false;
|
||||||
|
}
|
||||||
|
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||||
|
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
|
||||||
|
}
|
||||||
|
|
||||||
|
gSaveContext.save.time = D_801F6AF0;
|
||||||
|
gSaveContext.flashSaveAvailable = D_801F6AF2;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveContext prev_save_ctx;
|
||||||
|
int bcmp_recomp(void* __s1, void* __s2, int __n);
|
||||||
|
|
||||||
|
#define SAVE_COMPARE_MEMBER(ctx1, ctx2, member) \
|
||||||
|
if ((ctx1)->member != ((ctx2)->member)) { \
|
||||||
|
return true; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define SAVE_COMPARE_MEMBER_ARRAY(ctx1, ctx2, member) \
|
||||||
|
if (bcmp_recomp(&(ctx1)->member, &(ctx2)->member, sizeof((ctx1)->member))) { \
|
||||||
|
recomp_printf(#member " differed\n"); \
|
||||||
|
return true; \
|
||||||
|
}
|
||||||
|
|
||||||
|
bool autosave_compare_saves(SaveContext* a, SaveContext* b) {
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.playerData.healthCapacity);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.playerData.isMagicAcquired);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.playerData.isDoubleMagicAcquired);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.playerData.doubleDefense);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.playerData.owlActivationFlags);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.inventory.items);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.inventory.upgrades);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.inventory.questItems);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.inventory.dungeonItems);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.inventory.dungeonKeys);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.inventory.strayFairies);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.permanentSceneFlags);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.dekuPlaygroundHighScores);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.scenesVisible);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.stolenItems);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.highScores);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.weekEventReg);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.regionsVisited);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.worldMapCloudVisibility);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.scarecrowSpawnSongSet);
|
||||||
|
SAVE_COMPARE_MEMBER_ARRAY(a, b, save.saveInfo.scarecrowSpawnSong);
|
||||||
|
// SAVE_COMPARE_MEMBER_ARRAY(a, b, eventInf);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Gfx* Gfx_DrawRect_DropShadow(Gfx* gfx, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy,
|
||||||
|
s16 r, s16 g, s16 b, s16 a);
|
||||||
|
|
||||||
|
int autosave_icon_counter = 0;
|
||||||
|
|
||||||
|
#define AUTOSAVE_ICON_FADE_OUT_FRAMES 5
|
||||||
|
#define AUTOSAVE_ICON_FADE_IN_FRAMES 5
|
||||||
|
#define AUTOSAVE_ICON_SHOW_FRAMES 30
|
||||||
|
#define AUTOSAVE_ICON_TOTAL_FRAMES (AUTOSAVE_ICON_FADE_IN_FRAMES + AUTOSAVE_ICON_SHOW_FRAMES + AUTOSAVE_ICON_FADE_OUT_FRAMES)
|
||||||
|
|
||||||
|
#define AUTOSAVE_ICON_WIDTH 24
|
||||||
|
#define AUTOSAVE_ICON_HEIGHT 16
|
||||||
|
#define AUTOSAVE_ICON_DRAW_WIDTH (AUTOSAVE_ICON_WIDTH * 3 / 4)
|
||||||
|
#define AUTOSAVE_ICON_DRAW_HEIGHT (AUTOSAVE_ICON_HEIGHT * 3 / 4)
|
||||||
|
#define AUTOSAVE_ICON_X (SCREEN_WIDTH - AUTOSAVE_ICON_DRAW_WIDTH - 4)
|
||||||
|
#define AUTOSAVE_ICON_Y (SCREEN_HEIGHT - AUTOSAVE_ICON_DRAW_HEIGHT - 4)
|
||||||
|
|
||||||
|
INCBIN(autosave_icon, "autosave.rgba32.bin");
|
||||||
|
|
||||||
|
Gfx* GfxEx_DrawRect_DropShadow(Gfx* gfx, s16 rectLeft, s16 rectTop, s16 rectWidth, s16 rectHeight, u16 dsdx, u16 dtdy,
|
||||||
|
s16 r, s16 g, s16 b, s16 a, u16 origin) {
|
||||||
|
s16 dropShadowAlpha = a;
|
||||||
|
|
||||||
|
if (a > 100) {
|
||||||
|
dropShadowAlpha = 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
gDPPipeSync(gfx++);
|
||||||
|
gDPSetPrimColor(gfx++, 0, 0, 0, 0, 0, dropShadowAlpha);
|
||||||
|
gEXTextureRectangle(gfx++, origin, origin, (rectLeft + 2) * 4, (rectTop + 2) * 4, (rectLeft + rectWidth + 2) * 4,
|
||||||
|
(rectTop + rectHeight + 2) * 4, G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
|
||||||
|
|
||||||
|
gDPPipeSync(gfx++);
|
||||||
|
gDPSetPrimColor(gfx++, 0, 0, r, g, b, a);
|
||||||
|
|
||||||
|
gEXTextureRectangle(gfx++, origin, origin, rectLeft * 4, rectTop * 4, (rectLeft + rectWidth) * 4, (rectTop + rectHeight) * 4,
|
||||||
|
G_TX_RENDERTILE, 0, 0, dsdx, dtdy);
|
||||||
|
|
||||||
|
return gfx;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool autosave_was_ready = false;
|
||||||
|
|
||||||
|
s32 recomp_autosave_debug_enabled() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void draw_autosave_icon(PlayState* play) {
|
||||||
|
s32 alpha = 0;
|
||||||
|
if (autosave_icon_counter > (AUTOSAVE_ICON_SHOW_FRAMES + AUTOSAVE_ICON_FADE_OUT_FRAMES)) {
|
||||||
|
alpha = (255 * (AUTOSAVE_ICON_FADE_IN_FRAMES - (autosave_icon_counter - AUTOSAVE_ICON_SHOW_FRAMES - AUTOSAVE_ICON_FADE_OUT_FRAMES))) / AUTOSAVE_ICON_FADE_IN_FRAMES;
|
||||||
|
}
|
||||||
|
else if (autosave_icon_counter > AUTOSAVE_ICON_FADE_OUT_FRAMES) {
|
||||||
|
alpha = 255;
|
||||||
|
}
|
||||||
|
else if (autosave_icon_counter > 0) {
|
||||||
|
alpha = (255 * autosave_icon_counter) / AUTOSAVE_ICON_FADE_OUT_FRAMES;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (autosave_icon_counter > 0) {
|
||||||
|
autosave_icon_counter--;
|
||||||
|
}
|
||||||
|
|
||||||
|
OPEN_DISPS(play->state.gfxCtx);
|
||||||
|
|
||||||
|
if (alpha != 0) {
|
||||||
|
gEXForceUpscale2D(OVERLAY_DISP++, 1);
|
||||||
|
gDPLoadTextureBlock(OVERLAY_DISP++, autosave_icon, G_IM_FMT_RGBA, G_IM_SIZ_32b, AUTOSAVE_ICON_WIDTH, AUTOSAVE_ICON_HEIGHT, 0,
|
||||||
|
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||||
|
|
||||||
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||||
|
OVERLAY_DISP = GfxEx_DrawRect_DropShadow(OVERLAY_DISP, AUTOSAVE_ICON_X - SCREEN_WIDTH, AUTOSAVE_ICON_Y, AUTOSAVE_ICON_DRAW_WIDTH, AUTOSAVE_ICON_DRAW_HEIGHT,
|
||||||
|
(s32)(1024.0f * AUTOSAVE_ICON_WIDTH / AUTOSAVE_ICON_DRAW_WIDTH), (s32)(1024.0f * AUTOSAVE_ICON_HEIGHT / AUTOSAVE_ICON_DRAW_HEIGHT),
|
||||||
|
255, 255, 255, alpha, G_EX_ORIGIN_RIGHT);
|
||||||
|
gEXForceUpscale2D(OVERLAY_DISP++, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (recomp_autosave_debug_enabled() && autosave_was_ready) {
|
||||||
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 0, 0, 255);
|
||||||
|
gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE);
|
||||||
|
gEXFillRectangle(OVERLAY_DISP++, G_EX_ORIGIN_LEFT, G_EX_ORIGIN_LEFT, 0, SCREEN_HEIGHT - 10, 20, SCREEN_HEIGHT);
|
||||||
|
}
|
||||||
|
|
||||||
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
RECOMP_EXPORT void recomp_show_autosave_icon() {
|
||||||
|
autosave_icon_counter = AUTOSAVE_ICON_TOTAL_FRAMES;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECOMP_EXPORT u32 recomp_autosave_interval() {
|
||||||
|
return 2 * 60 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MIN_FRAMES_SINCE_CHANGED 10
|
||||||
|
#define MIN_FRAMES_SINCE_READY 20
|
||||||
|
OSTime last_autosave_time = 0;
|
||||||
|
u32 extra_autosave_delay_milliseconds = 0;
|
||||||
|
|
||||||
|
bool reached_final_three_hours() {
|
||||||
|
// Logic copied with modifications from Interface_DrawClock.
|
||||||
|
if ((CURRENT_DAY >= 4) ||
|
||||||
|
((CURRENT_DAY == 3) && (CURRENT_TIME >= CLOCK_TIME(3, 0)) && (CURRENT_TIME < CLOCK_TIME(6, 0)))
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECOMP_EXPORT void recomp_reset_autosave_timer() {
|
||||||
|
last_autosave_time = osGetTime();
|
||||||
|
extra_autosave_delay_milliseconds = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECOMP_EXPORT void recomp_reset_autosave_timer_slow() {
|
||||||
|
// Set the most recent autosave time in the future to give extra time before an autosave triggers.
|
||||||
|
last_autosave_time = osGetTime();
|
||||||
|
extra_autosave_delay_milliseconds = 2 * 60 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
void autosave_post_play_update(PlayState* play) {
|
||||||
|
static int frames_since_save_changed = 0;
|
||||||
|
static int frames_since_autosave_ready = 0;
|
||||||
|
if (recomp_get_autosave_enabled()) {
|
||||||
|
if (autosave_compare_saves(&gSaveContext, &prev_save_ctx)) {
|
||||||
|
frames_since_save_changed = 0;
|
||||||
|
Lib_MemCpy(&prev_save_ctx, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frames_since_save_changed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
OSTime time_now = osGetTime();
|
||||||
|
|
||||||
|
// Check the following conditions:
|
||||||
|
// * The UI is in a normal state.
|
||||||
|
// * Time is passing.
|
||||||
|
// * No message is on screen.
|
||||||
|
// * The game is not paused.
|
||||||
|
// * No cutscene is running.
|
||||||
|
// * The game is not in cutscene mode.
|
||||||
|
// * The clock has not reached the final 3 hours.
|
||||||
|
// * The player is allowed to pause.
|
||||||
|
if (gSaveContext.hudVisibility == HUD_VISIBILITY_ALL &&
|
||||||
|
R_TIME_SPEED != 0 &&
|
||||||
|
!Environment_IsTimeStopped() &&
|
||||||
|
play->msgCtx.msgMode == MSGMODE_NONE &&
|
||||||
|
play->pauseCtx.state == PAUSE_STATE_OFF &&
|
||||||
|
gSaveContext.save.cutsceneIndex < 0xFFF0 &&
|
||||||
|
!Play_InCsMode(play) &&
|
||||||
|
!reached_final_three_hours() &&
|
||||||
|
gCanPause
|
||||||
|
) {
|
||||||
|
frames_since_autosave_ready++;
|
||||||
|
autosave_was_ready = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
frames_since_autosave_ready = 0;
|
||||||
|
autosave_was_ready = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the frame count thresholds for the save data remaining unchanged and autosaving being ready have both been met
|
||||||
|
// and that enough time has passed since the previous autosave to create a new one.
|
||||||
|
if (frames_since_save_changed >= MIN_FRAMES_SINCE_CHANGED &&
|
||||||
|
frames_since_autosave_ready >= MIN_FRAMES_SINCE_READY &&
|
||||||
|
time_now - last_autosave_time > (OS_USEC_TO_CYCLES(1000 * (recomp_autosave_interval() + extra_autosave_delay_milliseconds)))
|
||||||
|
) {
|
||||||
|
recomp_do_autosave(play);
|
||||||
|
recomp_show_autosave_icon();
|
||||||
|
recomp_reset_autosave_timer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Update the last autosave time to the current time to prevent autosaving immediately if autosaves are turned back on.
|
||||||
|
recomp_reset_autosave_timer();
|
||||||
|
}
|
||||||
|
gCanPause = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void autosave_init() {
|
||||||
|
recomp_reset_autosave_timer_slow();
|
||||||
|
Lib_MemCpy(&prev_save_ctx, &gSaveContext, offsetof(SaveContext, fileNum));
|
||||||
|
}
|
||||||
|
|
||||||
|
extern s32 gFlashSaveSizes[];
|
||||||
|
extern u16 D_801C6A58[];
|
||||||
|
|
||||||
|
#define CHECK_NEWF(newf) \
|
||||||
|
((newf)[0] != 'Z' || (newf)[1] != 'E' || (newf)[2] != 'L' || (newf)[3] != 'D' || (newf)[4] != 'A' || \
|
||||||
|
(newf)[5] != '3')
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0x00 */ s16 csId;
|
||||||
|
/* 0x02 */ s16 length;
|
||||||
|
/* 0x04 */ s16 endCsId;
|
||||||
|
/* 0x06 */ s16 subCamId;
|
||||||
|
/* 0x08 */ Actor* targetActor;
|
||||||
|
/* 0x0C */ s32 startMethod;
|
||||||
|
/* 0x10 */ PlayState* play;
|
||||||
|
/* 0x14 */ s16 retCamId;
|
||||||
|
/* 0x16 */ s16 isCameraStored;
|
||||||
|
} CutsceneManager; // size = 0x18
|
||||||
|
|
||||||
|
extern CutsceneManager sCutsceneMgr;
|
||||||
|
extern ActorCutscene* sSceneCutsceneList;
|
||||||
|
extern s16 sSceneCutsceneCount;
|
||||||
|
|
||||||
|
bool skip_entry_cutscene = false;
|
||||||
|
|
||||||
|
// @recomp Patched to skip the entrance cutscene if the flag is enabled.
|
||||||
|
RECOMP_PATCH s16 CutsceneManager_FindEntranceCsId(void) {
|
||||||
|
PlayState* play;
|
||||||
|
s32 csId;
|
||||||
|
|
||||||
|
for (csId = 0; csId < sSceneCutsceneCount; csId++) {
|
||||||
|
//! FAKE:
|
||||||
|
if ((sSceneCutsceneList[csId].scriptIndex != CS_SCRIPT_ID_NONE) &&
|
||||||
|
(sSceneCutsceneList[csId].scriptIndex < (play = sCutsceneMgr.play)->csCtx.scriptListCount) &&
|
||||||
|
(sCutsceneMgr.play->curSpawn ==
|
||||||
|
sCutsceneMgr.play->csCtx.scriptList[sSceneCutsceneList[csId].scriptIndex].spawn)) {
|
||||||
|
|
||||||
|
// @recomp Check if the entry cutscene should be skipped and do so.
|
||||||
|
if (skip_entry_cutscene) {
|
||||||
|
skip_entry_cutscene = false;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return csId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (csId = 0; csId < sSceneCutsceneCount; csId++) {
|
||||||
|
if ((sSceneCutsceneList[csId].customValue >= 100) &&
|
||||||
|
(sSceneCutsceneList[csId].customValue == (sCutsceneMgr.play->curSpawn + 100))) {
|
||||||
|
return csId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 spawn_entrance_from_autosave_entrance(s16 autosave_entrance) {
|
||||||
|
s32 scene_id = Entrance_GetSceneIdAbsolute(gSaveContext.save.entrance);
|
||||||
|
recomp_printf("Loaded entrance: %d in scene: %d\n", autosave_entrance, scene_id);
|
||||||
|
|
||||||
|
switch (scene_id) {
|
||||||
|
default:
|
||||||
|
return ENTRANCE(SOUTH_CLOCK_TOWN, 0);
|
||||||
|
case SCENE_MITURIN: // Woodfall Temple
|
||||||
|
case SCENE_MITURIN_BS: // Odolwa's Lair
|
||||||
|
return ENTRANCE(WOODFALL_TEMPLE, 0);
|
||||||
|
case SCENE_HAKUGIN: // Snowhead Temple
|
||||||
|
case SCENE_HAKUGIN_BS: // Goht's Lair
|
||||||
|
return ENTRANCE(SNOWHEAD_TEMPLE, 0);
|
||||||
|
case SCENE_SEA: // Great Bay Temple
|
||||||
|
case SCENE_SEA_BS: // Gyorg's Lair
|
||||||
|
return ENTRANCE(GREAT_BAY_TEMPLE, 0);
|
||||||
|
case SCENE_INISIE_N: // Stone Tower Temple
|
||||||
|
return ENTRANCE(STONE_TOWER_TEMPLE, 0);
|
||||||
|
case SCENE_INISIE_R: // Inverted Stone Tower Temple
|
||||||
|
case SCENE_INISIE_BS: // Twinmold's Lair
|
||||||
|
return ENTRANCE(STONE_TOWER_TEMPLE_INVERTED, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_on_load_save(FileSelectState* fileSelect, SramContext* sramCtx));
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_after_load_save(FileSelectState* fileSelect, SramContext* sramCtx));
|
||||||
|
|
||||||
|
// @recomp Patched to change the entrance for autosaves and initialize autosaves.
|
||||||
|
RECOMP_PATCH void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
|
||||||
|
s32 i;
|
||||||
|
s32 pad;
|
||||||
|
s32 phi_t1 = 0;
|
||||||
|
s32 pad1;
|
||||||
|
s32 fileNum;
|
||||||
|
|
||||||
|
// @recomp_event recomp_on_load_save(FileSelectState* fileSelect, SramContext* sramCtx): A save-file was just chosen.
|
||||||
|
recomp_on_load_save(fileSelect, sramCtx);
|
||||||
|
|
||||||
|
if (gSaveContext.flashSaveAvailable) {
|
||||||
|
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||||
|
|
||||||
|
if (gSaveContext.fileNum == 0xFF) {
|
||||||
|
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[0], gFlashSaveNumPages[0]);
|
||||||
|
} else if (fileSelect->isOwlSave[gSaveContext.fileNum + 2]) {
|
||||||
|
phi_t1 = gSaveContext.fileNum + 2;
|
||||||
|
phi_t1 *= 2;
|
||||||
|
|
||||||
|
if (SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[phi_t1], gFlashSaveNumPages[phi_t1]) != 0) {
|
||||||
|
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[phi_t1 + 1],
|
||||||
|
gFlashSaveNumPages[phi_t1 + 1]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
phi_t1 = gSaveContext.fileNum;
|
||||||
|
phi_t1 *= 2;
|
||||||
|
|
||||||
|
if (SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[phi_t1], gFlashSaveNumPages[phi_t1]) != 0) {
|
||||||
|
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[phi_t1 + 1],
|
||||||
|
gFlashSaveNumPages[phi_t1 + 1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[phi_t1]);
|
||||||
|
|
||||||
|
if (CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf)) {
|
||||||
|
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[phi_t1 + 1], gFlashSaveNumPages[phi_t1 + 1]);
|
||||||
|
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, gFlashSaveSizes[phi_t1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gSaveContext.save.saveInfo.playerData.magicLevel = 0;
|
||||||
|
|
||||||
|
if (!gSaveContext.save.isOwlSave) {
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.eventInf); i++) {
|
||||||
|
gSaveContext.eventInf[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.cycleSceneFlags[i].chest = gSaveContext.save.saveInfo.permanentSceneFlags[i].chest;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch0 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch1 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1;
|
||||||
|
gSaveContext.cycleSceneFlags[i].clearedRoom = gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < TIMER_ID_MAX; i++) {
|
||||||
|
gSaveContext.timerStates[i] = TIMER_STATE_OFF;
|
||||||
|
gSaveContext.timerCurTimes[i] = SECONDS_TO_TIMER(0);
|
||||||
|
gSaveContext.timerTimeLimits[i] = SECONDS_TO_TIMER(0);
|
||||||
|
gSaveContext.timerStartOsTimes[i] = 0;
|
||||||
|
gSaveContext.timerStopTimes[i] = SECONDS_TO_TIMER(0);
|
||||||
|
gSaveContext.timerPausedOsTimes[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gSaveContext.save.isFirstCycle) {
|
||||||
|
gSaveContext.save.entrance = ENTRANCE(SOUTH_CLOCK_TOWN, 0);
|
||||||
|
gSaveContext.save.day = 0;
|
||||||
|
gSaveContext.save.time = CLOCK_TIME(6, 0) - 1;
|
||||||
|
} else {
|
||||||
|
gSaveContext.save.entrance = ENTRANCE(CUTSCENE, 0);
|
||||||
|
gSaveContext.nextCutsceneIndex = 0;
|
||||||
|
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @recomp Handle autosaves.
|
||||||
|
else if (gSaveContext.save.isOwlSave == SAVE_TYPE_AUTOSAVE) {
|
||||||
|
gSaveContext.save.entrance = spawn_entrance_from_autosave_entrance(gSaveContext.save.entrance);
|
||||||
|
|
||||||
|
// Skip the turtle cutscene that happens when entering Great Bay Temple.
|
||||||
|
if (gSaveContext.save.entrance == ENTRANCE(GREAT_BAY_TEMPLE, 0)) {
|
||||||
|
skip_entry_cutscene = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.cycleSceneFlags[i].chest = gSaveContext.save.saveInfo.permanentSceneFlags[i].chest;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch0 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch1 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1;
|
||||||
|
gSaveContext.cycleSceneFlags[i].clearedRoom = gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gSaveContext.save.saveInfo.scarecrowSpawnSongSet) {
|
||||||
|
Lib_MemCpy(gScarecrowSpawnSongPtr, gSaveContext.save.saveInfo.scarecrowSpawnSong,
|
||||||
|
sizeof(gSaveContext.save.saveInfo.scarecrowSpawnSong));
|
||||||
|
|
||||||
|
for (i = 0; i != ARRAY_COUNT(gSaveContext.save.saveInfo.scarecrowSpawnSong); i++) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fileNum = gSaveContext.fileNum;
|
||||||
|
func_80147314(sramCtx, fileNum);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
gSaveContext.save.entrance = D_801C6A58[(void)0, gSaveContext.save.owlWarpId];
|
||||||
|
if ((gSaveContext.save.entrance == ENTRANCE(SOUTHERN_SWAMP_POISONED, 10)) &&
|
||||||
|
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_WOODFALL_TEMPLE)) {
|
||||||
|
gSaveContext.save.entrance = ENTRANCE(SOUTHERN_SWAMP_CLEARED, 10);
|
||||||
|
} else if ((gSaveContext.save.entrance == ENTRANCE(MOUNTAIN_VILLAGE_WINTER, 8)) &&
|
||||||
|
CHECK_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE)) {
|
||||||
|
gSaveContext.save.entrance = ENTRANCE(MOUNTAIN_VILLAGE_SPRING, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.cycleSceneFlags[i].chest = gSaveContext.save.saveInfo.permanentSceneFlags[i].chest;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch0 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch1 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1;
|
||||||
|
gSaveContext.cycleSceneFlags[i].clearedRoom = gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gSaveContext.save.saveInfo.scarecrowSpawnSongSet) {
|
||||||
|
Lib_MemCpy(gScarecrowSpawnSongPtr, gSaveContext.save.saveInfo.scarecrowSpawnSong,
|
||||||
|
sizeof(gSaveContext.save.saveInfo.scarecrowSpawnSong));
|
||||||
|
|
||||||
|
for (i = 0; i != ARRAY_COUNT(gSaveContext.save.saveInfo.scarecrowSpawnSong); i++) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fileNum = gSaveContext.fileNum;
|
||||||
|
func_80147314(sramCtx, fileNum);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @recomp Initialize the autosave state tracking.
|
||||||
|
autosave_init();
|
||||||
|
|
||||||
|
// @recomp_event recomp_after_load_save(FileSelectState* fileSelect, SramContext* sramCtx): The save has finished loading.
|
||||||
|
recomp_after_load_save(fileSelect, sramCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool moon_crash_resets_save = true;
|
||||||
|
|
||||||
|
// @recomp_export void recomp_set_moon_crash_resets_save(bool new_val): Set whether a moon crash should revert the player's save data.
|
||||||
|
RECOMP_EXPORT void recomp_set_moon_crash_resets_save(bool new_val)
|
||||||
|
{
|
||||||
|
moon_crash_resets_save = new_val;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern s32 Actor_ProcessTalkRequest(Actor* actor, GameState* gameState);
|
||||||
|
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_on_moon_crash(SramContext* sramCtx));
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_after_moon_crash(SramContext* sramCtx));
|
||||||
|
|
||||||
|
// @recomp Reset the autosave timer when the moon crashes.
|
||||||
|
RECOMP_PATCH void Sram_ResetSaveFromMoonCrash(SramContext* sramCtx) {
|
||||||
|
s32 i;
|
||||||
|
s32 cutsceneIndex = gSaveContext.save.cutsceneIndex;
|
||||||
|
|
||||||
|
// @recomp_event recomp_on_moon_crash(SramContext* sramCtx): A moon crash has just been triggered.
|
||||||
|
recomp_on_moon_crash(sramCtx);
|
||||||
|
|
||||||
|
if (moon_crash_resets_save)
|
||||||
|
{
|
||||||
|
bzero(sramCtx->saveBuf, SAVE_BUFFER_SIZE);
|
||||||
|
|
||||||
|
if (SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[gSaveContext.fileNum * 2],
|
||||||
|
gFlashSaveNumPages[gSaveContext.fileNum * 2]) != 0) {
|
||||||
|
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[gSaveContext.fileNum * 2 + 1],
|
||||||
|
gFlashSaveNumPages[gSaveContext.fileNum * 2 + 1]);
|
||||||
|
}
|
||||||
|
Lib_MemCpy(&gSaveContext.save, sramCtx->saveBuf, sizeof(Save));
|
||||||
|
if (CHECK_NEWF(gSaveContext.save.saveInfo.playerData.newf)) {
|
||||||
|
SysFlashrom_ReadData(sramCtx->saveBuf, gFlashSaveStartPages[gSaveContext.fileNum * 2 + 1],
|
||||||
|
gFlashSaveNumPages[gSaveContext.fileNum * 2 + 1]);
|
||||||
|
Lib_MemCpy(&gSaveContext, sramCtx->saveBuf, sizeof(Save));
|
||||||
|
}
|
||||||
|
gSaveContext.save.cutsceneIndex = cutsceneIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.eventInf); i++) {
|
||||||
|
gSaveContext.eventInf[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_COUNT(gSaveContext.cycleSceneFlags); i++) {
|
||||||
|
gSaveContext.cycleSceneFlags[i].chest = gSaveContext.save.saveInfo.permanentSceneFlags[i].chest;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch0 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch0;
|
||||||
|
gSaveContext.cycleSceneFlags[i].switch1 = gSaveContext.save.saveInfo.permanentSceneFlags[i].switch1;
|
||||||
|
gSaveContext.cycleSceneFlags[i].clearedRoom = gSaveContext.save.saveInfo.permanentSceneFlags[i].clearedRoom;
|
||||||
|
gSaveContext.cycleSceneFlags[i].collectible = gSaveContext.save.saveInfo.permanentSceneFlags[i].collectible;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < TIMER_ID_MAX; i++) {
|
||||||
|
gSaveContext.timerStates[i] = TIMER_STATE_OFF;
|
||||||
|
gSaveContext.timerCurTimes[i] = SECONDS_TO_TIMER(0);
|
||||||
|
gSaveContext.timerTimeLimits[i] = SECONDS_TO_TIMER(0);
|
||||||
|
gSaveContext.timerStartOsTimes[i] = 0;
|
||||||
|
gSaveContext.timerStopTimes[i] = SECONDS_TO_TIMER(0);
|
||||||
|
gSaveContext.timerPausedOsTimes[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
D_801BDAA0 = true;
|
||||||
|
gHorseIsMounted = false;
|
||||||
|
gSaveContext.powderKegTimer = 0;
|
||||||
|
gSaveContext.unk_1014 = 0;
|
||||||
|
gSaveContext.jinxTimer = 0;
|
||||||
|
|
||||||
|
// @recomp Use the slow autosave timer to give the player extra time to respond to the moon crashing to decide if they want to reload their autosave.
|
||||||
|
recomp_reset_autosave_timer_slow();
|
||||||
|
|
||||||
|
// @recomp_event recomp_after_moon_crash(SramContext* sramCtx): The effects of moon crash have been written.
|
||||||
|
recomp_after_moon_crash(sramCtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool owls_save_and_quit = true;
|
||||||
|
|
||||||
|
// @recomp_export void recomp_set_owls_save_and_quit(bool new_val): Set if owls should use their code to save and quit. If false is passed, owl saves now do nothing.
|
||||||
|
RECOMP_EXPORT void recomp_set_owls_save_and_quit(bool new_val)
|
||||||
|
{
|
||||||
|
owls_save_and_quit = new_val;
|
||||||
|
}
|
||||||
|
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_on_owl_update(ObjWarpstone* this, PlayState* play));
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_on_owl_save(ObjWarpstone* this, PlayState* play));
|
||||||
|
RECOMP_DECLARE_EVENT(recomp_after_owl_save(ObjWarpstone* this, PlayState* play));
|
||||||
|
|
||||||
|
// @recomp If autosave is enabled or owl save deletion is disabled, skip the part of the owl statue dialog that talks about the file being deleted on load, since it's not true.
|
||||||
|
RECOMP_PATCH void ObjWarpstone_Update(Actor* thisx, PlayState* play) {
|
||||||
|
ObjWarpstone* this = (ObjWarpstone*)thisx;
|
||||||
|
s32 pad;
|
||||||
|
|
||||||
|
// @recomp_event recomp_on_owl_update(ObjWarpstone* this, PlayState* play): Allow mods to handle owl update frames.
|
||||||
|
recomp_on_owl_update(this, play);
|
||||||
|
|
||||||
|
if (this->isTalking) {
|
||||||
|
if (Actor_TextboxIsClosing(&this->dyna.actor, play)) {
|
||||||
|
this->isTalking = false;
|
||||||
|
} else if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
|
||||||
|
if (play->msgCtx.choiceIndex != 0) {
|
||||||
|
// @recomp_event recomp_on_owl_save(ObjWarpstone* this, PlayState* play): The player chose to save from an owl statue.
|
||||||
|
recomp_on_owl_save(this, play);
|
||||||
|
|
||||||
|
Audio_PlaySfx_MessageDecide();
|
||||||
|
|
||||||
|
// @recomp_use_export_var owls_save_and_quit: Only use normal owl save if quit flag is set.
|
||||||
|
if (owls_save_and_quit) {
|
||||||
|
play->msgCtx.msgMode = MSGMODE_OWL_SAVE_0;
|
||||||
|
} else {
|
||||||
|
Message_CloseTextbox(play);
|
||||||
|
}
|
||||||
|
|
||||||
|
play->msgCtx.unk120D6 = 0;
|
||||||
|
play->msgCtx.unk120D4 = 0;
|
||||||
|
gSaveContext.save.owlWarpId = OBJ_WARPSTONE_GET_OWL_WARP_ID(&this->dyna.actor);
|
||||||
|
|
||||||
|
// @recomp_event recomp_after_owl_save(ObjWarpstone* this, PlayState* play): Owl save is finished.
|
||||||
|
recomp_after_owl_save(this, play);
|
||||||
|
} else {
|
||||||
|
Message_CloseTextbox(play);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (Actor_ProcessTalkRequest(&this->dyna.actor, &play->state)) {
|
||||||
|
this->isTalking = true;
|
||||||
|
} else if (!this->actionFunc(this, play)) {
|
||||||
|
Actor_OfferTalkNearColChkInfoCylinder(&this->dyna.actor, play);
|
||||||
|
}
|
||||||
|
|
||||||
|
// @recomp_use_export_var loading_deletes_owl_save: Skip the text talking about the save being deleted on load, if autosave is enabled or if owl save deletion is disabled.
|
||||||
|
if (recomp_get_autosave_enabled() || !loading_deletes_owl_save) {
|
||||||
|
if (this->isTalking && play->msgCtx.currentTextId == 0xC01 && play->msgCtx.msgBufPos == 269) {
|
||||||
|
play->msgCtx.msgBufPos = 530;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Collider_ResetCylinderAC(play, &this->collider.base);
|
||||||
|
Collider_UpdateCylinder(&this->dyna.actor, &this->collider);
|
||||||
|
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||||
|
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||||
|
}
|
@ -61,7 +61,7 @@ void edit_billboard_groups(PlayState* play) {
|
|||||||
CLOSE_DISPS(play->state.gfxCtx);
|
CLOSE_DISPS(play->state.gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx) {
|
RECOMP_PATCH Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx) {
|
||||||
Mtx* ret = Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
|
Mtx* ret = Matrix_ToMtx(GRAPH_ALLOC(gfxCtx, sizeof(Mtx)));
|
||||||
|
|
||||||
if (*current_billboard_state) {
|
if (*current_billboard_state) {
|
||||||
@ -77,7 +77,7 @@ Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Init(GameState* gameState) {
|
RECOMP_PATCH void Matrix_Init(GameState* gameState) {
|
||||||
sMatrixStack = THA_AllocTailAlign16(&gameState->tha, MATRIX_STACK_SIZE * sizeof(MtxF));
|
sMatrixStack = THA_AllocTailAlign16(&gameState->tha, MATRIX_STACK_SIZE * sizeof(MtxF));
|
||||||
sCurrentMatrix = sMatrixStack;
|
sCurrentMatrix = sMatrixStack;
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ void matrix_play_update(PlayState* play) {
|
|||||||
play_billboard_matrix = &play->billboardMtxF;
|
play_billboard_matrix = &play->billboardMtxF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Push(void) {
|
RECOMP_PATCH void Matrix_Push(void) {
|
||||||
MtxF* prev = sCurrentMatrix;
|
MtxF* prev = sCurrentMatrix;
|
||||||
|
|
||||||
sCurrentMatrix++;
|
sCurrentMatrix++;
|
||||||
@ -106,20 +106,20 @@ void Matrix_Push(void) {
|
|||||||
*current_billboard_state = *prev_billboard;
|
*current_billboard_state = *prev_billboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Pop(void) {
|
RECOMP_PATCH void Matrix_Pop(void) {
|
||||||
sCurrentMatrix--;
|
sCurrentMatrix--;
|
||||||
// @recomp Pop the matrix stack billboard state.
|
// @recomp Pop the matrix stack billboard state.
|
||||||
current_billboard_state--;
|
current_billboard_state--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Put(MtxF* src) {
|
RECOMP_PATCH void Matrix_Put(MtxF* src) {
|
||||||
Matrix_MtxFCopy(sCurrentMatrix, src);
|
Matrix_MtxFCopy(sCurrentMatrix, src);
|
||||||
|
|
||||||
// @recomp Update the current billboard state.
|
// @recomp Update the current billboard state.
|
||||||
*current_billboard_state = (src == play_billboard_matrix);
|
*current_billboard_state = (src == play_billboard_matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_ReplaceRotation(MtxF* mf) {
|
RECOMP_PATCH void Matrix_ReplaceRotation(MtxF* mf) {
|
||||||
MtxF* cmf = sCurrentMatrix;
|
MtxF* cmf = sCurrentMatrix;
|
||||||
f32 acc;
|
f32 acc;
|
||||||
f32 component;
|
f32 component;
|
||||||
@ -168,7 +168,7 @@ void Matrix_ReplaceRotation(MtxF* mf) {
|
|||||||
*current_billboard_state = (mf == play_billboard_matrix);
|
*current_billboard_state = (mf == play_billboard_matrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Mult(MtxF* mf, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_Mult(MtxF* mf, MatrixMode mode) {
|
||||||
MtxF* cmf = Matrix_GetCurrent();
|
MtxF* cmf = Matrix_GetCurrent();
|
||||||
|
|
||||||
if (mode == MTXMODE_APPLY) {
|
if (mode == MTXMODE_APPLY) {
|
||||||
@ -183,7 +183,7 @@ void Matrix_Mult(MtxF* mf, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Translate(f32 x, f32 y, f32 z, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_Translate(f32 x, f32 y, f32 z, MatrixMode mode) {
|
||||||
MtxF* cmf = sCurrentMatrix;
|
MtxF* cmf = sCurrentMatrix;
|
||||||
f32 tempX;
|
f32 tempX;
|
||||||
f32 tempY;
|
f32 tempY;
|
||||||
@ -209,7 +209,7 @@ void Matrix_Translate(f32 x, f32 y, f32 z, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_Scale(f32 x, f32 y, f32 z, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_Scale(f32 x, f32 y, f32 z, MatrixMode mode) {
|
||||||
MtxF* cmf = sCurrentMatrix;
|
MtxF* cmf = sCurrentMatrix;
|
||||||
|
|
||||||
if (mode == MTXMODE_APPLY) {
|
if (mode == MTXMODE_APPLY) {
|
||||||
@ -233,7 +233,7 @@ void Matrix_Scale(f32 x, f32 y, f32 z, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateXS(s16 x, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateXS(s16 x, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -300,7 +300,7 @@ void Matrix_RotateXS(s16 x, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateXF(f32 x, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateXF(f32 x, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -369,7 +369,7 @@ void Matrix_RotateXF(f32 x, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateXFNew(f32 x) {
|
RECOMP_PATCH void Matrix_RotateXFNew(f32 x) {
|
||||||
MtxF* cmf = sCurrentMatrix;
|
MtxF* cmf = sCurrentMatrix;
|
||||||
s32 pad[2];
|
s32 pad[2];
|
||||||
f32 sin;
|
f32 sin;
|
||||||
@ -406,7 +406,7 @@ void Matrix_RotateXFNew(f32 x) {
|
|||||||
// @recomp Clear the current billboard state.
|
// @recomp Clear the current billboard state.
|
||||||
*current_billboard_state = false;
|
*current_billboard_state = false;
|
||||||
}
|
}
|
||||||
void Matrix_RotateYS(s16 y, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateYS(s16 y, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -473,7 +473,7 @@ void Matrix_RotateYS(s16 y, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateYF(f32 y, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateYF(f32 y, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -542,7 +542,7 @@ void Matrix_RotateYF(f32 y, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateZS(s16 z, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateZS(s16 z, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -611,7 +611,7 @@ void Matrix_RotateZS(s16 z, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateZF(f32 z, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateZF(f32 z, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -678,7 +678,7 @@ void Matrix_RotateZF(f32 z, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateZYX(s16 x, s16 y, s16 z, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateZYX(s16 x, s16 y, s16 z, MatrixMode mode) {
|
||||||
MtxF* cmf = sCurrentMatrix;
|
MtxF* cmf = sCurrentMatrix;
|
||||||
f32 temp1;
|
f32 temp1;
|
||||||
f32 temp2;
|
f32 temp2;
|
||||||
@ -768,7 +768,7 @@ void Matrix_RotateZYX(s16 x, s16 y, s16 z, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_SetTranslateRotateYXZ(f32 x, f32 y, f32 z, Vec3s* rot) {
|
RECOMP_PATCH void Matrix_SetTranslateRotateYXZ(f32 x, f32 y, f32 z, Vec3s* rot) {
|
||||||
MtxF* cmf = sCurrentMatrix;
|
MtxF* cmf = sCurrentMatrix;
|
||||||
f32 sinY = Math_SinS(rot->y);
|
f32 sinY = Math_SinS(rot->y);
|
||||||
f32 cosY = Math_CosS(rot->y);
|
f32 cosY = Math_CosS(rot->y);
|
||||||
@ -829,7 +829,7 @@ void Matrix_SetTranslateRotateYXZ(f32 x, f32 y, f32 z, Vec3s* rot) {
|
|||||||
*current_billboard_state = false;
|
*current_billboard_state = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateAxisF(f32 angle, Vec3f* axis, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateAxisF(f32 angle, Vec3f* axis, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
@ -926,7 +926,7 @@ void Matrix_RotateAxisF(f32 angle, Vec3f* axis, MatrixMode mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Matrix_RotateAxisS(s16 angle, Vec3f* axis, MatrixMode mode) {
|
RECOMP_PATCH void Matrix_RotateAxisS(s16 angle, Vec3f* axis, MatrixMode mode) {
|
||||||
MtxF* cmf;
|
MtxF* cmf;
|
||||||
f32 cos;
|
f32 cos;
|
||||||
f32 sin;
|
f32 sin;
|
||||||
|
File diff suppressed because it is too large
Load Diff
15
patches/camera_patches.h
Normal file
15
patches/camera_patches.h
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef __CAMERA_PATCHES_H__
|
||||||
|
#define __CAMERA_PATCHES_H__
|
||||||
|
|
||||||
|
#include "z64camera.h"
|
||||||
|
|
||||||
|
#define RELOAD_PARAMS(camera) ((camera->animState == 0) || (camera->animState == 10) || (camera->animState == 20))
|
||||||
|
#define CAM_RODATA_SCALE(x) ((x)*100.0f)
|
||||||
|
#define CAM_RODATA_UNSCALE(x) ((x)*0.01f)
|
||||||
|
|
||||||
|
// Load the next value from camera read-only data stored in CameraModeValue
|
||||||
|
#define GET_NEXT_RO_DATA(values) ((values++)->val)
|
||||||
|
// Load the next value and scale down from camera read-only data stored in CameraModeValue
|
||||||
|
#define GET_NEXT_SCALED_RO_DATA(values) CAM_RODATA_UNSCALE(GET_NEXT_RO_DATA(values))
|
||||||
|
|
||||||
|
#endif
|
@ -1,9 +1,12 @@
|
|||||||
#include "patches.h"
|
#include "patches.h"
|
||||||
|
#include "camera_patches.h"
|
||||||
#include "transform_ids.h"
|
#include "transform_ids.h"
|
||||||
#include "z64cutscene.h"
|
#include "z64cutscene.h"
|
||||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||||
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
|
#include "overlays/gamestates/ovl_file_choose/z_file_select.h"
|
||||||
|
|
||||||
|
// #define PRINT_CAMERA_INFO
|
||||||
|
|
||||||
static bool camera_interpolation_forced = false;
|
static bool camera_interpolation_forced = false;
|
||||||
static bool camera_skip_interpolation_forced = false;
|
static bool camera_skip_interpolation_forced = false;
|
||||||
static bool camera_ignore_tracking = false;
|
static bool camera_ignore_tracking = false;
|
||||||
@ -36,6 +39,44 @@ void camera_post_play_update(PlayState* play) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
in_kaleido = false;
|
in_kaleido = false;
|
||||||
|
|
||||||
|
if (play->activeCamId >= 0 && play->activeCamId < NUM_CAMS) {
|
||||||
|
Camera *active_cam = play->cameraPtrs[play->activeCamId];
|
||||||
|
#ifdef PRINT_CAMERA_INFO
|
||||||
|
recomp_printf("active_cam->setting %d active_cam->mode %d play->sceneId %d\n", active_cam->setting, active_cam->mode, play->sceneId);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Dedicated section for workarounds where the heuristic fails to detect the large amount of movements the camera does in these particular areas.
|
||||||
|
bool force_interpolation = false;
|
||||||
|
if (active_cam->setting == CAM_SET_BOSS_MAJORA) {
|
||||||
|
// Majora's Mask final fight. All cameras should transition smoothly during this fight while not in a cutscene.
|
||||||
|
force_interpolation = true;
|
||||||
|
}
|
||||||
|
else if (active_cam->setting == CAM_SET_NORMAL0 || active_cam->setting == CAM_SET_DUNGEON0) {
|
||||||
|
force_interpolation =
|
||||||
|
// Pirates' Fortress Moat. Pushing the switch that unlocks the fortress will cause very large camera movement.
|
||||||
|
play->sceneId == SCENE_TORIDE ||
|
||||||
|
// Z-targetting an actor.
|
||||||
|
active_cam->mode == CAM_MODE_FOLLOWTARGET ||
|
||||||
|
// Z-targetting nothing.
|
||||||
|
active_cam->mode == CAM_MODE_TARGET ||
|
||||||
|
// Z-targetting in battle.
|
||||||
|
active_cam->mode == CAM_MODE_BATTLE;
|
||||||
|
}
|
||||||
|
// TODO: This setting claims "Smoothly and gradually return camera to Player after a cutscene "CONNECT0"". It might be worth it to enable this globally regardless of the scene.
|
||||||
|
else if (active_cam->setting == CAM_SET_CONNECT0) {
|
||||||
|
// Stone tower and inverted stone tower. The block puzzles will cause very large camera movement after they're activated.
|
||||||
|
force_interpolation = play->sceneId == SCENE_F40 || play->sceneId == SCENE_F41;
|
||||||
|
}
|
||||||
|
else if (active_cam->setting == CAM_SET_FREE0) {
|
||||||
|
// Cutscene after Majora fight. The camera zooms out while facing the moon with a very large movement.
|
||||||
|
force_interpolation = play->sceneId == SCENE_00KEIKOKU && play->csCtx.scriptIndex == 0 && play->csCtx.curFrame <= 98 && gSaveContext.sceneLayer == 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (force_interpolation) {
|
||||||
|
force_camera_interpolation();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +95,7 @@ void force_camera_ignore_tracking() {
|
|||||||
camera_ignore_tracking = true;
|
camera_ignore_tracking = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KaleidoScope_SetView(PauseContext* pauseCtx, f32 eyeX, f32 eyeY, f32 eyeZ) {
|
RECOMP_PATCH void KaleidoScope_SetView(PauseContext* pauseCtx, f32 eyeX, f32 eyeY, f32 eyeZ) {
|
||||||
Vec3f eye;
|
Vec3f eye;
|
||||||
Vec3f at;
|
Vec3f at;
|
||||||
Vec3f up;
|
Vec3f up;
|
||||||
@ -76,7 +117,7 @@ void KaleidoScope_SetView(PauseContext* pauseCtx, f32 eyeX, f32 eyeY, f32 eyeZ)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FileSelect_SetView(FileSelectState* this, f32 eyeX, f32 eyeY, f32 eyeZ) {
|
RECOMP_PATCH void FileSelect_SetView(FileSelectState* this, f32 eyeX, f32 eyeY, f32 eyeZ) {
|
||||||
Vec3f eye;
|
Vec3f eye;
|
||||||
Vec3f lookAt;
|
Vec3f lookAt;
|
||||||
Vec3f up;
|
Vec3f up;
|
||||||
@ -156,7 +197,7 @@ bool should_interpolate_perspective(Vec3f* eye, Vec3f* at) {
|
|||||||
/**
|
/**
|
||||||
* Apply view to POLY_OPA_DISP, POLY_XLU_DISP (and OVERLAY_DISP if ortho)
|
* Apply view to POLY_OPA_DISP, POLY_XLU_DISP (and OVERLAY_DISP if ortho)
|
||||||
*/
|
*/
|
||||||
void View_Apply(View* view, s32 mask) {
|
RECOMP_PATCH void View_Apply(View* view, s32 mask) {
|
||||||
mask = (view->flags & mask) | (mask >> 4);
|
mask = (view->flags & mask) | (mask >> 4);
|
||||||
|
|
||||||
// @recomp Determine if the camera should be interpolated this frame.
|
// @recomp Determine if the camera should be interpolated this frame.
|
||||||
@ -214,3 +255,152 @@ void View_Apply(View* view, s32 mask) {
|
|||||||
|
|
||||||
CLOSE_DISPS(gfxCtx);
|
CLOSE_DISPS(gfxCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef s32 (*CameraUpdateFunc)(Camera*);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0x0 */ s16 val;
|
||||||
|
/* 0x2 */ s16 param;
|
||||||
|
} CameraModeValue; // size = 0x4
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0x0 */ s16 funcId;
|
||||||
|
/* 0x2 */ s16 numValues;
|
||||||
|
/* 0x4 */ CameraModeValue* values;
|
||||||
|
} CameraMode; // size = 0x8
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0x0 */ u32 validModes;
|
||||||
|
/* 0x4 */ u32 flags;
|
||||||
|
/* 0x8 */ CameraMode* cameraModes;
|
||||||
|
} CameraSetting; // size = 0xC
|
||||||
|
|
||||||
|
extern CameraSetting sCameraSettings[];
|
||||||
|
extern s32 sCameraInterfaceFlags;
|
||||||
|
|
||||||
|
s32 Camera_BgCheck(Camera* camera, Vec3f* from, Vec3f* to);
|
||||||
|
Vec3s* Camera_GetBgCamOrActorCsCamFuncData(Camera* camera, u32 camDataId);
|
||||||
|
f32 Camera_GetFocalActorHeight(Camera* camera);
|
||||||
|
f32 Camera_ScaledStepToCeilF(f32 target, f32 cur, f32 stepScale, f32 minDiff);
|
||||||
|
s16 Camera_ScaledStepToCeilS(s16 target, s16 cur, f32 stepScale, s16 minDiff);
|
||||||
|
void Camera_ScaledStepToCeilVec3f(Vec3f* target, Vec3f* cur, f32 xzStepScale, f32 yStepScale, f32 minDiff);
|
||||||
|
void Camera_SetFocalActorAtOffset(Camera* camera, Vec3f* focalActorPos);
|
||||||
|
void Camera_SetUpdateRatesSlow(Camera* camera);
|
||||||
|
Vec3f Camera_Vec3sToVec3f(Vec3s* src);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for many fixed-based camera settings i.e. camera is fixed in rotation, and often position (but not always)
|
||||||
|
*/
|
||||||
|
// @recomp Modified to not force interpolation while panning.
|
||||||
|
RECOMP_PATCH s32 Camera_Fixed1(Camera* camera) {
|
||||||
|
s32 pad[2];
|
||||||
|
s32 yawDiff;
|
||||||
|
VecGeo eyeOffset;
|
||||||
|
VecGeo eyeAtOffset;
|
||||||
|
VecGeo sp7C;
|
||||||
|
u32 negOne;
|
||||||
|
Vec3f adjustedPos;
|
||||||
|
BgCamFuncData* bgCamFuncData;
|
||||||
|
Vec3f* eye = &camera->eye;
|
||||||
|
Vec3f* at = &camera->at;
|
||||||
|
PosRot* focalActorPosRot = &camera->focalActorPosRot;
|
||||||
|
f32 focalActorHeight = Camera_GetFocalActorHeight(camera);
|
||||||
|
CameraModeValue* values;
|
||||||
|
PosRot* targetHome;
|
||||||
|
PosRot* targetWorld;
|
||||||
|
VecGeo sp44;
|
||||||
|
Fixed1ReadOnlyData* roData = &camera->paramData.fixd1.roData;
|
||||||
|
Fixed1ReadWriteData* rwData = &camera->paramData.fixd1.rwData;
|
||||||
|
|
||||||
|
sp7C = OLib_Vec3fDiffToVecGeo(at, eye);
|
||||||
|
|
||||||
|
if (!RELOAD_PARAMS(camera)) {
|
||||||
|
} else {
|
||||||
|
values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
|
||||||
|
bgCamFuncData = (BgCamFuncData*)Camera_GetBgCamOrActorCsCamFuncData(camera, camera->bgCamIndex);
|
||||||
|
rwData->eyePosRotTarget.pos = Camera_Vec3sToVec3f(&bgCamFuncData->pos);
|
||||||
|
|
||||||
|
rwData->eyePosRotTarget.rot = bgCamFuncData->rot;
|
||||||
|
rwData->fov = bgCamFuncData->fov;
|
||||||
|
rwData->focalActor = camera->focalActor;
|
||||||
|
|
||||||
|
roData->unk_00 = GET_NEXT_SCALED_RO_DATA(values) * focalActorHeight;
|
||||||
|
roData->unk_04 = GET_NEXT_SCALED_RO_DATA(values);
|
||||||
|
roData->fov = GET_NEXT_RO_DATA(values);
|
||||||
|
roData->interfaceFlags = GET_NEXT_RO_DATA(values);
|
||||||
|
|
||||||
|
if (roData->interfaceFlags & FIXED1_FLAG_4) {
|
||||||
|
if (camera->target == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHome = &camera->target->home;
|
||||||
|
targetWorld = &camera->target->world;
|
||||||
|
|
||||||
|
sp44 = OLib_Vec3fDiffToVecGeo(&targetHome->pos, &rwData->eyePosRotTarget.pos);
|
||||||
|
sp44.yaw = targetWorld->rot.y + (s16)(sp44.yaw - targetHome->rot.y);
|
||||||
|
rwData->eyePosRotTarget.pos = OLib_AddVecGeoToVec3f(&targetWorld->pos, &sp44);
|
||||||
|
yawDiff = (s16)(rwData->eyePosRotTarget.rot.y - targetHome->rot.y);
|
||||||
|
rwData->eyePosRotTarget.rot.y = targetWorld->rot.y + yawDiff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
negOne = -1;
|
||||||
|
|
||||||
|
if (rwData->focalActor != camera->focalActor) {
|
||||||
|
camera->animState = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rwData->fov == (s32)negOne) {
|
||||||
|
rwData->fov = roData->fov * 100;
|
||||||
|
} else if (rwData->fov <= 360) {
|
||||||
|
rwData->fov *= 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
sCameraInterfaceFlags = roData->interfaceFlags;
|
||||||
|
|
||||||
|
if (camera->animState == 0) {
|
||||||
|
camera->animState++;
|
||||||
|
Camera_SetUpdateRatesSlow(camera);
|
||||||
|
if (rwData->fov != (s32)negOne) {
|
||||||
|
roData->fov = CAM_RODATA_UNSCALE(rwData->fov);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bgCamFuncData->unk_0E != (s32)negOne) {
|
||||||
|
roData->unk_04 = CAM_RODATA_UNSCALE(bgCamFuncData->unk_0E);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @recomp Camera interpolation should always apply on this mode unless something else modified it externally.
|
||||||
|
// We check for the approach percentage as well to detect when it wants to force an interpolation to the next position.
|
||||||
|
static Vec3f lastEye = {};
|
||||||
|
static Vec3f lastAt = {};
|
||||||
|
if (OLib_Vec3fDist(eye, &lastEye) < 1e-6f && OLib_Vec3fDist(at, &lastAt) < 1e-6f && (roData->unk_04 < 0.999f)) {
|
||||||
|
force_camera_interpolation();
|
||||||
|
}
|
||||||
|
|
||||||
|
eyeAtOffset = OLib_Vec3fDiffToVecGeo(eye, at);
|
||||||
|
Camera_ScaledStepToCeilVec3f(&rwData->eyePosRotTarget.pos, eye, roData->unk_04, roData->unk_04, 0.2f);
|
||||||
|
adjustedPos = focalActorPosRot->pos;
|
||||||
|
adjustedPos.y += focalActorHeight;
|
||||||
|
camera->dist = OLib_Vec3fDist(&adjustedPos, eye);
|
||||||
|
eyeOffset.r = camera->dist;
|
||||||
|
eyeOffset.pitch =
|
||||||
|
Camera_ScaledStepToCeilS(rwData->eyePosRotTarget.rot.x * -1, eyeAtOffset.pitch, roData->unk_04, 5);
|
||||||
|
eyeOffset.yaw = Camera_ScaledStepToCeilS(rwData->eyePosRotTarget.rot.y, eyeAtOffset.yaw, roData->unk_04, 5);
|
||||||
|
*at = OLib_AddVecGeoToVec3f(eye, &eyeOffset);
|
||||||
|
camera->eyeNext = *eye;
|
||||||
|
Camera_BgCheck(camera, eye, at);
|
||||||
|
|
||||||
|
camera->fov = Camera_ScaledStepToCeilF(roData->fov, camera->fov, roData->unk_04, 0.1f);
|
||||||
|
camera->roll = 0;
|
||||||
|
camera->atLerpStepScale = 0.0f;
|
||||||
|
Camera_SetFocalActorAtOffset(camera, &focalActorPosRot->pos);
|
||||||
|
camera->roll = Camera_ScaledStepToCeilS(rwData->eyePosRotTarget.rot.z, camera->roll, roData->unk_04, 5);
|
||||||
|
|
||||||
|
// @recomp
|
||||||
|
lastEye = *eye;
|
||||||
|
lastAt = *at;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "patches.h"
|
#include "patches.h"
|
||||||
|
|
||||||
// Disable frustum culling for actors, but leave distance culling intact
|
// Disable frustum culling for actors, but leave distance culling intact
|
||||||
s32 func_800BA2FC(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projectedW) {
|
RECOMP_PATCH s32 func_800BA2FC(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projectedW) {
|
||||||
if ((-actor->uncullZoneScale < projectedPos->z) &&
|
if ((-actor->uncullZoneScale < projectedPos->z) &&
|
||||||
(projectedPos->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
|
(projectedPos->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
|
||||||
// f32 phi_f12;
|
// f32 phi_f12;
|
||||||
@ -30,7 +30,7 @@ s32 func_800BA2FC(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projec
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Disable frustum culling for bush spawning
|
// Disable frustum culling for bush spawning
|
||||||
// s32 EnWood02_SpawnZoneCheck(EnWood02* this, PlayState* play, Vec3f* arg2) {
|
// RECOMP_PATCH s32 EnWood02_SpawnZoneCheck(EnWood02* this, PlayState* play, Vec3f* arg2) {
|
||||||
// f32 phi_f12;
|
// f32 phi_f12;
|
||||||
|
|
||||||
// SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, arg2, &this->actor.projectedPos, &this->actor.projectedW);
|
// SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, arg2, &this->actor.projectedPos, &this->actor.projectedW);
|
||||||
@ -52,7 +52,7 @@ s32 func_800BA2FC(PlayState* play, Actor* actor, Vec3f* projectedPos, f32 projec
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// Disable frustum culling for grass
|
// Disable frustum culling for grass
|
||||||
s32 func_809A9110(PlayState* play, Vec3f* pos) {
|
RECOMP_PATCH s32 func_809A9110(PlayState* play, Vec3f* pos) {
|
||||||
f32 w;
|
f32 w;
|
||||||
Vec3f projectedPos;
|
Vec3f projectedPos;
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ s32 func_809A9110(PlayState* play, Vec3f* pos) {
|
|||||||
|
|
||||||
// Replace point light glow effect with RT64 point Z test so it works in widescreen
|
// Replace point light glow effect with RT64 point Z test so it works in widescreen
|
||||||
|
|
||||||
void Lights_GlowCheck(PlayState* play) {
|
RECOMP_PATCH void Lights_GlowCheck(PlayState* play) {
|
||||||
LightNode* light = play->lightCtx.listHead;
|
LightNode* light = play->lightCtx.listHead;
|
||||||
|
|
||||||
while (light != NULL) {
|
while (light != NULL) {
|
||||||
@ -107,7 +107,7 @@ extern Gfx gameplay_keep_DL_029CF0[];
|
|||||||
|
|
||||||
Vtx light_test_vert = VTX(0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
|
Vtx light_test_vert = VTX(0, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||||
|
|
||||||
void Lights_DrawGlow(PlayState* play) {
|
RECOMP_PATCH void Lights_DrawGlow(PlayState* play) {
|
||||||
Gfx* dl;
|
Gfx* dl;
|
||||||
LightPoint* params;
|
LightPoint* params;
|
||||||
LightNode* light = play->lightCtx.listHead;
|
LightNode* light = play->lightCtx.listHead;
|
||||||
|
16
patches/custom_syms.toml
Normal file
16
patches/custom_syms.toml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Custom symbols used for patches.
|
||||||
|
[[section]]
|
||||||
|
name = "ABSOLUTE_SYMS"
|
||||||
|
vram = 0x00000000
|
||||||
|
size = 0x0
|
||||||
|
|
||||||
|
symbols = [
|
||||||
|
# Alternate references to symbols that would otherwise be relocated
|
||||||
|
{ name = "Setup_Init_NORELOCATE", vram = 0x80173338 }, # Not relocatable, but here for uniformity with the other gamestate funcs
|
||||||
|
{ name = "MapSelect_Init_NORELOCATE", vram = 0x80801B4C },
|
||||||
|
{ name = "ConsoleLogo_Init_NORELOCATE", vram = 0x8080074C },
|
||||||
|
{ name = "Play_Init_NORELOCATE", vram = 0x8016A2C8 },
|
||||||
|
{ name = "TitleSetup_Init_NORELOCATE", vram = 0x80803F30 },
|
||||||
|
{ name = "FileSelect_Init_NORELOCATE", vram = 0x80813C98 },
|
||||||
|
{ name = "DayTelop_Init_NORELOCATE", vram = 0x80815820 },
|
||||||
|
]
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
CsCmdActorCue* prev_cues_checked[ARRAY_COUNT(((CutsceneContext*)0)->actorCues)] = {0};
|
CsCmdActorCue* prev_cues_checked[ARRAY_COUNT(((CutsceneContext*)0)->actorCues)] = {0};
|
||||||
|
|
||||||
void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 cueChannel) {
|
RECOMP_PATCH void Cutscene_ActorTranslate(Actor* actor, PlayState* play, s32 cueChannel) {
|
||||||
Vec3f startPos;
|
Vec3f startPos;
|
||||||
Vec3f endPos;
|
Vec3f endPos;
|
||||||
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
CsCmdActorCue* cue = play->csCtx.actorCues[cueChannel];
|
||||||
@ -39,7 +39,7 @@ extern EnHorseCsFunc D_808890F0[];
|
|||||||
extern EnHorseCsFunc D_8088911C[];
|
extern EnHorseCsFunc D_8088911C[];
|
||||||
|
|
||||||
// @recomp Patched to skip interpolation on Epona when she's teleported by a cutscene.
|
// @recomp Patched to skip interpolation on Epona when she's teleported by a cutscene.
|
||||||
void func_80884718(EnHorse* this, PlayState* play) {
|
RECOMP_PATCH void func_80884718(EnHorse* this, PlayState* play) {
|
||||||
CsCmdActorCue* cue;
|
CsCmdActorCue* cue;
|
||||||
|
|
||||||
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_112)) {
|
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_112)) {
|
||||||
@ -63,23 +63,19 @@ void func_80884718(EnHorse* this, PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->cueId = cue->id;
|
this->cueId = cue->id;
|
||||||
// @recomp Manual relocation, TODO remove when automated.
|
if (D_808890F0[this->cueId] != NULL) {
|
||||||
EnHorseCsFunc* D_808890F0_reloc = actor_relocate(&this->actor, D_808890F0);
|
D_808890F0[this->cueId](this, play, cue);
|
||||||
if (D_808890F0_reloc[this->cueId] != NULL) {
|
|
||||||
D_808890F0_reloc[this->cueId](this, play, cue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @recomp Manual relocation, TODO remove when automated.
|
if (D_8088911C[this->cueId] != NULL) {
|
||||||
EnHorseCsFunc* D_8088911C_reloc = actor_relocate(&this->actor, D_8088911C);
|
D_8088911C[this->cueId](this, play, cue);
|
||||||
if (D_8088911C_reloc[this->cueId] != NULL) {
|
|
||||||
D_8088911C_reloc[this->cueId](this, play, cue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @recomp Patched to skip interpolation on Epona when she's teleported by a cutscene.
|
// @recomp Patched to skip interpolation on Epona when she's teleported by a cutscene.
|
||||||
void func_80883B70(EnHorse* this, CsCmdActorCue* cue) {
|
RECOMP_PATCH void func_80883B70(EnHorse* this, CsCmdActorCue* cue) {
|
||||||
// @recomp Being teleported by a new cue, so skip interpolation.
|
// @recomp Being teleported by a new cue, so skip interpolation.
|
||||||
actor_set_interpolation_skipped(&this->actor);
|
actor_set_interpolation_skipped(&this->actor);
|
||||||
|
|
||||||
@ -94,7 +90,7 @@ void func_80883B70(EnHorse* this, CsCmdActorCue* cue) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @recomp Patched to skip interpolation on Link when he's teleported to a new cue.
|
// @recomp Patched to skip interpolation on Link when he's teleported to a new cue.
|
||||||
void Player_Cutscene_SetPosAndYawToStart(Player* this, CsCmdActorCue* cue) {
|
RECOMP_PATCH void Player_Cutscene_SetPosAndYawToStart(Player* this, CsCmdActorCue* cue) {
|
||||||
// @recomp Being teleported by a new cue, so skip interpolation.
|
// @recomp Being teleported by a new cue, so skip interpolation.
|
||||||
actor_set_interpolation_skipped(&this->actor);
|
actor_set_interpolation_skipped(&this->actor);
|
||||||
|
|
||||||
@ -108,7 +104,7 @@ void Player_Cutscene_SetPosAndYawToStart(Player* this, CsCmdActorCue* cue) {
|
|||||||
CsCmdActorCue* prev_link_cue = NULL;
|
CsCmdActorCue* prev_link_cue = NULL;
|
||||||
|
|
||||||
// @recomp Patched to skip interpolation on Link when he's teleported to a new cue.
|
// @recomp Patched to skip interpolation on Link when he's teleported to a new cue.
|
||||||
void Player_Cutscene_Translate(PlayState* play, Player* this, CsCmdActorCue* cue) {
|
RECOMP_PATCH void Player_Cutscene_Translate(PlayState* play, Player* this, CsCmdActorCue* cue) {
|
||||||
f32 startX = cue->startPos.x;
|
f32 startX = cue->startPos.x;
|
||||||
f32 startY = cue->startPos.y;
|
f32 startY = cue->startPos.y;
|
||||||
f32 startZ = cue->startPos.z;
|
f32 startZ = cue->startPos.z;
|
||||||
|
@ -9,7 +9,7 @@ extern Gfx sTransWipe3DL[];
|
|||||||
|
|
||||||
#define THIS ((TransitionWipe3*)thisx)
|
#define THIS ((TransitionWipe3*)thisx)
|
||||||
// @recomp patched to scale the transition based on aspect ratio
|
// @recomp patched to scale the transition based on aspect ratio
|
||||||
void TransitionWipe3_Draw(void* thisx, Gfx** gfxP) {
|
RECOMP_PATCH void TransitionWipe3_Draw(void* thisx, Gfx** gfxP) {
|
||||||
Gfx* gfx = *gfxP;
|
Gfx* gfx = *gfxP;
|
||||||
Mtx* modelView = &THIS->modelView[THIS->frame];
|
Mtx* modelView = &THIS->modelView[THIS->frame];
|
||||||
f32 scale = 14.8f;
|
f32 scale = 14.8f;
|
||||||
@ -17,7 +17,7 @@ void TransitionWipe3_Draw(void* thisx, Gfx** gfxP) {
|
|||||||
|
|
||||||
// @recomp Modify the scale based on the aspect ratio to make sure the transition circle covers the whole screen
|
// @recomp Modify the scale based on the aspect ratio to make sure the transition circle covers the whole screen
|
||||||
float original_aspect_ratio = ((float)SCREEN_WIDTH) / ((float)SCREEN_HEIGHT);
|
float original_aspect_ratio = ((float)SCREEN_WIDTH) / ((float)SCREEN_HEIGHT);
|
||||||
scale *= recomp_get_aspect_ratio(original_aspect_ratio) / original_aspect_ratio;
|
scale *= recomp_get_target_aspect_ratio(original_aspect_ratio) / original_aspect_ratio;
|
||||||
|
|
||||||
THIS->frame ^= 1;
|
THIS->frame ^= 1;
|
||||||
gDPPipeSync(gfx++);
|
gDPPipeSync(gfx++);
|
||||||
@ -34,12 +34,7 @@ void TransitionWipe3_Draw(void* thisx, Gfx** gfxP) {
|
|||||||
guScale(modelView, scale, scale, 1.0f);
|
guScale(modelView, scale, scale, 1.0f);
|
||||||
gSPMatrix(gfx++, modelView, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
gSPMatrix(gfx++, modelView, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||||
}
|
}
|
||||||
// sTransWipe3DL is an overlay symbol, so its addresses need to be offset to get the actual loaded vram address.
|
gSPDisplayList(gfx++, sTransWipe3DL);
|
||||||
// TODO remove this once the recompiler is able to handle overlay symbols automatically for patch functions.
|
|
||||||
ptrdiff_t reloc_offset;
|
|
||||||
TransitionOverlay* overlay_entry = &gTransitionOverlayTable[FBDEMO_WIPE3];
|
|
||||||
reloc_offset = (uintptr_t)Lib_PhysicalToVirtual(overlay_entry->loadInfo.addr) - (uintptr_t)overlay_entry->vramStart;
|
|
||||||
gSPDisplayList(gfx++, (Gfx*)((u8*)sTransWipe3DL + reloc_offset));
|
|
||||||
gDPPipeSync(gfx++);
|
gDPPipeSync(gfx++);
|
||||||
*gfxP = gfx;
|
*gfxP = gfx;
|
||||||
}
|
}
|
||||||
@ -58,7 +53,7 @@ extern s32 gFramerateDivisor;
|
|||||||
|
|
||||||
// @recomp Motion blur works fine normally, but when running at a higher framerate the effect is much less pronounced
|
// @recomp Motion blur works fine normally, but when running at a higher framerate the effect is much less pronounced
|
||||||
// as the previous frames decay quicker due to there being more frames drawn in the same period of time.
|
// as the previous frames decay quicker due to there being more frames drawn in the same period of time.
|
||||||
void Play_DrawMotionBlur(PlayState* this) {
|
RECOMP_PATCH void Play_DrawMotionBlur(PlayState* this) {
|
||||||
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
||||||
s32 alpha;
|
s32 alpha;
|
||||||
Gfx* gfx;
|
Gfx* gfx;
|
||||||
@ -98,11 +93,20 @@ void Play_DrawMotionBlur(PlayState* this) {
|
|||||||
f32 exponent = 20.0f / recomp_get_target_framerate(gFramerateDivisor);
|
f32 exponent = 20.0f / recomp_get_target_framerate(gFramerateDivisor);
|
||||||
f32 alpha_float = recomp_powf(alpha / 255.0f, exponent);
|
f32 alpha_float = recomp_powf(alpha / 255.0f, exponent);
|
||||||
// Clamp the blur alpha, which ensures that the output color converges to within a reasonable delta of the target color
|
// Clamp the blur alpha, which ensures that the output color converges to within a reasonable delta of the target color
|
||||||
// when using an R8G8B8A8 framebuffer as RT64 currently does. Although this makes the effect less noticeable at high framerates,
|
// when using an R8G8B8A8 framebuffer. Although this makes the effect less noticeable at high framerates,
|
||||||
// not clamping leads to noticeable image retention.
|
// not clamping leads to noticeable image retention.
|
||||||
|
// Skip clamping if high precision framebuffers are in use, as there's no risk of ghosting with those.
|
||||||
|
if (!recomp_high_precision_fb_enabled()) {
|
||||||
alpha_float = MIN(alpha_float, 0.825f);
|
alpha_float = MIN(alpha_float, 0.825f);
|
||||||
|
}
|
||||||
alpha = (s32)(alpha_float * 255.0f);
|
alpha = (s32)(alpha_float * 255.0f);
|
||||||
|
|
||||||
|
// @recomp Set the dither noise strength based on the resolution scale to make it easier to see at higher resolutions.
|
||||||
|
float res_scale = recomp_get_resolution_scale();
|
||||||
|
float dither_noise_strength = CLAMP(1.0 + (res_scale - 1.0f) / 8.0f, 1.0f, 2.0f);
|
||||||
|
// recomp_printf("res scale: %5.3f dither noise strength: %5.3f\n", res_scale, dither_noise_strength);
|
||||||
|
gEXSetDitherNoiseStrength(OVERLAY_DISP++, dither_noise_strength);
|
||||||
|
|
||||||
if (sMotionBlurStatus == MOTION_BLUR_PROCESS) {
|
if (sMotionBlurStatus == MOTION_BLUR_PROCESS) {
|
||||||
func_80170AE0(&this->pauseBgPreRender, &gfx, alpha);
|
func_80170AE0(&this->pauseBgPreRender, &gfx, alpha);
|
||||||
} else {
|
} else {
|
||||||
@ -122,10 +126,10 @@ void Play_DrawMotionBlur(PlayState* this) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// @recomp Patched to increase the scale based on the aspect ratio.
|
// @recomp Patched to increase the scale based on the aspect ratio.
|
||||||
void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) {
|
RECOMP_PATCH void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) {
|
||||||
// @recomp Calculate the increase in aspect ratio.
|
// @recomp Calculate the increase in aspect ratio.
|
||||||
f32 original_aspect_ratio = (float)SCREEN_WIDTH / SCREEN_HEIGHT;
|
f32 original_aspect_ratio = (float)SCREEN_WIDTH / SCREEN_HEIGHT;
|
||||||
f32 aspect_ratio_scale = recomp_get_aspect_ratio(original_aspect_ratio) / original_aspect_ratio;
|
f32 aspect_ratio_scale = recomp_get_target_aspect_ratio(original_aspect_ratio) / original_aspect_ratio;
|
||||||
|
|
||||||
// @recomp Increase the circle's scale based on the aspect ratio scale. Also increase the base scaling
|
// @recomp Increase the circle's scale based on the aspect ratio scale. Also increase the base scaling
|
||||||
// from 0.003f to 0.004f to account for overscan removal.
|
// from 0.003f to 0.004f to account for overscan removal.
|
||||||
@ -135,7 +139,7 @@ void Actor_DrawLensOverlay(Gfx** gfxP, s32 lensMaskSize) {
|
|||||||
|
|
||||||
|
|
||||||
// @recomp Patched to use ortho tris for interpolation and to prevent the telescope and lens effects from getting stretched wide.
|
// @recomp Patched to use ortho tris for interpolation and to prevent the telescope and lens effects from getting stretched wide.
|
||||||
void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, TexturePtr texture, s32 fmt, s32 arg3, s32 masks, s32 maskt,
|
RECOMP_PATCH void TransitionCircle_LoadAndSetTexture(Gfx** gfxp, TexturePtr texture, s32 fmt, s32 arg3, s32 masks, s32 maskt,
|
||||||
f32 arg6) {
|
f32 arg6) {
|
||||||
Gfx* gfx = *gfxp;
|
Gfx* gfx = *gfxp;
|
||||||
s32 xh = gCfbWidth;
|
s32 xh = gCfbWidth;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user