mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-04 03:12:48 -04:00
Compare commits
525 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 93e9767c9f | |||
| c774f53dad | |||
| 7fbfe5ad88 | |||
| ef02037990 | |||
| 23cc18ba0e | |||
| 924dbc7715 | |||
| 742f4938f2 | |||
| 02e0f586d3 | |||
| 5717aeef85 | |||
| da9b99f650 | |||
| dd2b993cd5 | |||
| 83577d3b82 | |||
| 1cb8b19520 | |||
| d109cd891e | |||
| 63c4002ca6 | |||
| 6954efcd15 | |||
| 78c2147771 | |||
| c938d5468e | |||
| 35590c5312 | |||
| e976b10e2a | |||
| 3949706b28 | |||
| ce55916845 | |||
| 9b252cbdd2 | |||
| 97fa09f6ee | |||
| 0e7a7cccb9 | |||
| 1c0cdcc176 | |||
| 280305c2ba | |||
| d1f1d579bc | |||
| eeeb3ffe25 | |||
| 1ee0f862e1 | |||
| 6b327c9f61 | |||
| f148e0ebc1 | |||
| 6f20f4d629 | |||
| 94670270d6 | |||
| 8e21247a97 | |||
| aa84004cb4 | |||
| e1c201f4bd | |||
| 425a1d15a0 | |||
| e3ad41792a | |||
| c1ba10fc8b | |||
| 1c5686f71b | |||
| b9e0f2b9ca | |||
| ede175f141 | |||
| a301874e30 | |||
| 9b4a9a6bd9 | |||
| 04274b1884 | |||
| ca783b8424 | |||
| 2e4c2b5b46 | |||
| 4c09d8b910 | |||
| fb1b260d09 | |||
| 98eb8f718e | |||
| 68b2e0ee2d | |||
| 81771a0522 | |||
| 93c8bcc210 | |||
| 176bf5f0c4 | |||
| 65a5945778 | |||
| 8f7b9cdfdd | |||
| acecba7ff7 | |||
| 507e0aadbc | |||
| 8406d9b192 | |||
| 6f3170cb56 | |||
| 835582224e | |||
| 52879f50f0 | |||
| 2b505f1be4 | |||
| f089f9024d | |||
| 43fb421a93 | |||
| f06d6b50a9 | |||
| 2c987b0211 | |||
| 3d860ad454 | |||
| b5bf19569b | |||
| 5a7f5cb4a7 | |||
| 1affefbbfc | |||
| e4ff38a712 | |||
| f2ac4d6f44 | |||
| 48b98a5432 | |||
| a4752154f7 | |||
| 0d973a497b | |||
| ab4eccf1df | |||
| e0c449f28e | |||
| ce9a5c06d5 | |||
| 2bbba1e4e8 | |||
| 39298f8d8f | |||
| 32b4c0567a | |||
| 7ff1b5332e | |||
| 5e77a60bd6 | |||
| 9629c000bd | |||
| 9dc5fed686 | |||
| 2cc9db77dd | |||
| 8aa08c9443 | |||
| dca3e2eba6 | |||
| 57061fba38 | |||
| cee6a24309 | |||
| 62edb3abc6 | |||
| 1c9e1c0a66 | |||
| a06aeb10c1 | |||
| b84b309e00 | |||
| 62eecb3ccd | |||
| ec07572ced | |||
| b45e2fa34d | |||
| 289a718446 | |||
| 292a2a6c34 | |||
| 2e8415b950 | |||
| dbf1f6e354 | |||
| 9a2fe9745d | |||
| b5ca343fac | |||
| 88c7ff63ff | |||
| 7a438ad30f | |||
| 89649de7c3 | |||
| a1960eaa33 | |||
| d6820c9233 | |||
| 5c4bb8d33d | |||
| e3ce1f01c9 | |||
| 9b6b344ecf | |||
| 3db85d5b44 | |||
| b5871d72d9 | |||
| b70a714f88 | |||
| cad5a8d1bc | |||
| 93f8a5fa8f | |||
| b0809ea78c | |||
| b0e9033736 | |||
| 1ac6df8de7 | |||
| 5899b2157a | |||
| 3185f578fb | |||
| 4fc09799b6 | |||
| fe0e3cad72 | |||
| 37d1aa7f40 | |||
| 4a12554bf4 | |||
| fecd1d5683 | |||
| bce9bf6fd9 | |||
| fbf63b075a | |||
| b86d6e90e2 | |||
| 6425b452e7 | |||
| 1657fe8083 | |||
| ecd74a4cbd | |||
| 36dc43c602 | |||
| d92515f0d4 | |||
| f147dcac0c | |||
| ee4c84f39b | |||
| b8a83c6f59 | |||
| 4462c0ef69 | |||
| c803bfb545 | |||
| 2623c44cab | |||
| 24dd02fc81 | |||
| a97602b6dc | |||
| e2943e90dc | |||
| 3cb7fbd030 | |||
| afe54f22ab | |||
| e15f5bcee9 | |||
| 1e372a856d | |||
| b26896cad5 | |||
| f75faf6b06 | |||
| b48d9aa052 | |||
| d899706208 | |||
| 3e05789b58 | |||
| 9a7b62cbc6 | |||
| 8e0f0e878e | |||
| 79344edf0d | |||
| e59bfd1a9c | |||
| 4d12cc8ea2 | |||
| 2ed2268579 | |||
| 94a99e8da0 | |||
| ddaf50c01d | |||
| 7566949b42 | |||
| bb6db3caea | |||
| 2dc494dc1c | |||
| 3c25633ee9 | |||
| d99ed2729b | |||
| 782455d48b | |||
| 47863b34c2 | |||
| 92391d5eb8 | |||
| 0d37cb4e54 | |||
| ea528ed9d9 | |||
| f7b880c5ea | |||
| ff78bc8d6c | |||
| 6503b4e7eb | |||
| 30b7087f30 | |||
| 0c1372f986 | |||
| 8fb4ba8924 | |||
| 5f675c6f2b | |||
| b3333241c5 | |||
| e39079c0f8 | |||
| c3317d9232 | |||
| a4777045fe | |||
| bbe8ea6aa6 | |||
| d662db69f0 | |||
| 9b259143be | |||
| 025cb58493 | |||
| b3dee825e8 | |||
| f6c5aac3c8 | |||
| 25e9064d09 | |||
| 5f33489465 | |||
| 3e1e8f1244 | |||
| 23a91a37be | |||
| a886f8a2df | |||
| 6df7b1e9cd | |||
| 206c02b527 | |||
| a05d1a9ee6 | |||
| ed0df01b8d | |||
| 0f9d563a3e | |||
| f3fb65495e | |||
| 196f33005e | |||
| 90c0bdded0 | |||
| f856f871bb | |||
| e75ea18ef0 | |||
| 50e2d9d1a7 | |||
| 5c84978c3c | |||
| 3859f39729 | |||
| 3498ded9d9 | |||
| 8784958c40 | |||
| c1231885fe | |||
| 2b65a696dd | |||
| 02924549be | |||
| 6cf94b4491 | |||
| 30aa2dd527 | |||
| 8e121a7e51 | |||
| 34ec362876 | |||
| ba58d2486e | |||
| f7b5350d60 | |||
| 9ddfcc38c9 | |||
| cee66a6fd5 | |||
| 574b6197a2 | |||
| 6fc8628144 | |||
| ca9330b412 | |||
| 1b792eb964 | |||
| 0e5ea0d3b1 | |||
| 977ad16806 | |||
| 41420bc71c | |||
| 5ec5f8864a | |||
| 60e8836968 | |||
| e755148f16 | |||
| 0bf663141a | |||
| 17949e526b | |||
| d7dced7ddf | |||
| 4e264d6a22 | |||
| c8e89a0f99 | |||
| c61e32cd4f | |||
| 274bf61b3e | |||
| 05b2a5cbe9 | |||
| aa838c8003 | |||
| d5aabe9f9e | |||
| 171dbdd0a1 | |||
| b2c09d56d6 | |||
| f0e8379fa5 | |||
| 1fea4f02ed | |||
| 35ea13c53a | |||
| 78b0563c0e | |||
| 5fab665f21 | |||
| 109f0a50e5 | |||
| 746910c59f | |||
| ae4806ae4f | |||
| 1c00e2cdde | |||
| 78301a8a83 | |||
| ca798049b3 | |||
| daf4b1dfeb | |||
| 5bdd31a5af | |||
| 3cb5e5172b | |||
| d625c7ab0c | |||
| c2045391c8 | |||
| f04a0ffcf1 | |||
| dfdac1c1cd | |||
| f4b361ab02 | |||
| 5f3d3012ff | |||
| 0897ef1132 | |||
| 8b89dbcbf0 | |||
| f24e944ab0 | |||
| 23130d5a57 | |||
| 1e6e1976e3 | |||
| 4453316bb0 | |||
| 14aeefb813 | |||
| c991c7c407 | |||
| 251c6e7aec | |||
| cf2357fff2 | |||
| 06e6b0d47e | |||
| a83b4186af | |||
| dc5de83436 | |||
| 77425b4b25 | |||
| 5a109313cb | |||
| d8a7927602 | |||
| cccddee106 | |||
| 6c252c6d26 | |||
| b06c1911c6 | |||
| 7c9e99220a | |||
| bfd8b9f453 | |||
| 53e8662335 | |||
| ae54f024cd | |||
| 9aa391c5bf | |||
| ec48249934 | |||
| 6a8f3516f9 | |||
| 79d4835784 | |||
| b1a4783e38 | |||
| 0038afa392 | |||
| 5fcffa0b4f | |||
| 9e9d11ae89 | |||
| 97bd84725c | |||
| 19c86b1b73 | |||
| ca247095da | |||
| c350b7b8ed | |||
| ac3d3314c4 | |||
| f916a48db0 | |||
| 6963a4b554 | |||
| 4466bf4e12 | |||
| c4d01b82a6 | |||
| 42e8d9ab9d | |||
| 9c562ff740 | |||
| 1787de517c | |||
| 832e567620 | |||
| 319efbe662 | |||
| 6f34bb050a | |||
| a2a56122e2 | |||
| 58f2679def | |||
| 396ea02fe5 | |||
| 8100ddb990 | |||
| d78c46a628 | |||
| 1e93657ab5 | |||
| 366e47245e | |||
| 4c53ba91be | |||
| cf080523cb | |||
| a15d0af139 | |||
| d99205ecc6 | |||
| dd3a61d84c | |||
| 595a6f1c9e | |||
| 18d70df188 | |||
| 46f6dc67c1 | |||
| 6267b79da3 | |||
| 62f3d09076 | |||
| 4b3c559df3 | |||
| 30a99c22f1 | |||
| 360cb37028 | |||
| 4b6b41a6aa | |||
| faa8618124 | |||
| 89acf923e0 | |||
| c42a33154c | |||
| 871d18e294 | |||
| c157564da6 | |||
| ecc3b00c51 | |||
| a074e30147 | |||
| 2ce272d586 | |||
| e1636e20bd | |||
| 9904720e5a | |||
| 9910320fb4 | |||
| b43a9e2ccc | |||
| 23d81492e6 | |||
| 65b0ec3f90 | |||
| 91248d10db | |||
| f76a4d7087 | |||
| c7b609945b | |||
| 6ca6ea8065 | |||
| 315f621176 | |||
| 10d9a818c2 | |||
| e3761784af | |||
| d85556a063 | |||
| c43f33a5bc | |||
| e63897d1f7 | |||
| 35a69e7ff1 | |||
| 8b9f09bda5 | |||
| 32cddc725b | |||
| 55eec3b0de | |||
| 1cf14f176c | |||
| 74550b031f | |||
| 2f84f0eaa4 | |||
| 3ed7ef1c88 | |||
| eace147652 | |||
| 53c005c4f1 | |||
| a4ff97564c | |||
| c6beeba14f | |||
| e470278717 | |||
| 783230b654 | |||
| 4e7711725a | |||
| e5bf7606ec | |||
| aa377cd5c1 | |||
| bb9a88d7dc | |||
| 341e97ba82 | |||
| 8d3cb51157 | |||
| 7fff3b5ae0 | |||
| 6beb73b7a6 | |||
| c239a5a226 | |||
| b3f8fecfe4 | |||
| 6dcf4942f5 | |||
| cd7e429a66 | |||
| fcfcb35929 | |||
| 82b20be436 | |||
| 33101d8050 | |||
| 05160a968c | |||
| 623f29eb24 | |||
| 0a3833818a | |||
| 4f276252a3 | |||
| d17c629ce0 | |||
| 5bcc969778 | |||
| 09e3e17aa6 | |||
| f02a39d921 | |||
| effe5cb9e2 | |||
| 767bb6826f | |||
| a9f8595901 | |||
| 56239e77ff | |||
| 763cb7f92f | |||
| 85120648b1 | |||
| b77ef63d5e | |||
| 45adce4af2 | |||
| 7b8f9c6f46 | |||
| 1c8bb1206e | |||
| 78d1596f66 | |||
| 4cda2cd5f0 | |||
| d34be5143a | |||
| c00fc756e3 | |||
| 6ea3fef8c6 | |||
| 8010e16cab | |||
| 2ec6f65572 | |||
| 5c20f527ac | |||
| 3d9dfbd447 | |||
| 3a538d45cf | |||
| 59d2014fb9 | |||
| bc6c132d69 | |||
| 83ddb2c6c8 | |||
| 3fe26f8dd6 | |||
| 054c4384be | |||
| 439cc936a1 | |||
| 570d00ee8c | |||
| 7ae1818550 | |||
| 8afb1141ab | |||
| 4ddd243eca | |||
| 8c5673d9b8 | |||
| 916dfcd9da | |||
| edea6a1418 | |||
| 9614614981 | |||
| 4e433f646b | |||
| 5ba04524eb | |||
| e566202c26 | |||
| f293281eb2 | |||
| e9689f9abb | |||
| 36bfce534c | |||
| 8ba1133e34 | |||
| 2db4040843 | |||
| f2848f0be0 | |||
| 363788accd | |||
| c7de341484 | |||
| 842210e539 | |||
| 39d951d0cb | |||
| a4be0841e5 | |||
| b182e18fab | |||
| 72a73ba661 | |||
| d882ce47fc | |||
| 2cc11c74b7 | |||
| c7d9a8733f | |||
| 88bdea1fd3 | |||
| 6c055d462f | |||
| dd84c3f46d | |||
| 3db0281088 | |||
| 8230ebcced | |||
| a2882711ee | |||
| 6bc1d3d847 | |||
| 06e6a97ee7 | |||
| ff92ba3abc | |||
| 5c61c5ede8 | |||
| 98b0c8296e | |||
| 269505a69f | |||
| 433f058aea | |||
| 1c057bb24a | |||
| 31c5397ae3 | |||
| b0b1978c76 | |||
| 965e958222 | |||
| 8de4863426 | |||
| 9235833413 | |||
| a0e9ee73a8 | |||
| 99fd2f9bc5 | |||
| 7eb61b71f1 | |||
| 2a49673dce | |||
| 20e958bf12 | |||
| d8df116047 | |||
| d432fbcd10 | |||
| 5f69895326 | |||
| 194cb94d43 | |||
| 22535ba84d | |||
| ab65f42816 | |||
| 0508acaa79 | |||
| bf83f40ec5 | |||
| ada67f1be1 | |||
| d876c62822 | |||
| c26b05b1dd | |||
| 97c459a614 | |||
| cd9bb31b02 | |||
| e37c912053 | |||
| 4e42af6cd8 | |||
| 87a95fb1b8 | |||
| 83b210e26c | |||
| 158f31d056 | |||
| 3bcb07dba4 | |||
| 86bea34bb2 | |||
| 09e9c6ad34 | |||
| 0d76b90144 | |||
| 54db8e4b5b | |||
| ec091ac3af | |||
| 35650784c3 | |||
| 86c1e21ac1 | |||
| a2f8fffc8d | |||
| ddfe21b18a | |||
| 93450dce7b | |||
| 38cfaae940 | |||
| 7e56747e33 | |||
| 72a97d62d8 | |||
| 130e5c9502 | |||
| 505ef363fd | |||
| b7f3dbb8b3 | |||
| 5155270fd3 | |||
| d865c82f76 | |||
| ad94d9656f | |||
| 143aa51eb3 | |||
| e3b3eabfeb | |||
| f15a4f07e5 | |||
| 277d16c110 | |||
| 18995f3d7c | |||
| 5e6d240d0f | |||
| a6690c2052 | |||
| fbec777b0a | |||
| 8cd8d1b90c | |||
| fc659b966f | |||
| 7e1e193f64 | |||
| 75a4fe4429 | |||
| 6a07f82425 | |||
| 1a91c77a64 | |||
| 0649aa4828 | |||
| 4ec4cd363e | |||
| d01f6bafff | |||
| 627cf559c9 | |||
| 7e797b2320 | |||
| 228a305110 |
+1
-1
@@ -2,7 +2,7 @@
|
||||
Language: Cpp
|
||||
Standard: C++03
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignOperands: true
|
||||
|
||||
+49
-41
@@ -8,8 +8,9 @@ on:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
SCCACHE_GHA_ENABLED: "true"
|
||||
# SCCACHE_GHA_ENABLED: "true"
|
||||
RUSTC_WRAPPER: "sccache"
|
||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@@ -21,13 +22,13 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- name: GCC x86_64
|
||||
runner: ubuntu-latest
|
||||
runner: [self-hosted, Linux]
|
||||
preset: gcc
|
||||
artifact_arch: x86_64
|
||||
- name: GCC aarch64
|
||||
runner: ubuntu-24.04-arm
|
||||
preset: gcc
|
||||
artifact_arch: aarch64
|
||||
# - name: GCC aarch64
|
||||
# runner: ubuntu-24.04-arm
|
||||
# preset: gcc
|
||||
# artifact_arch: aarch64
|
||||
# - name: Clang x86_64
|
||||
# runner: ubuntu-latest
|
||||
# preset: clang
|
||||
@@ -40,17 +41,22 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Install dependencies
|
||||
if: 'false' # disabled for self-hosted
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ninja-build clang lld openssl libcurl4-openssl-dev \
|
||||
zlib1g-dev libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev \
|
||||
libpulse-dev libudev-dev libpng-dev libncurses5-dev libx11-xcb-dev libfreetype-dev \
|
||||
libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev libssl-dev \
|
||||
libxss-dev libfuse2
|
||||
libxss-dev libfuse2 libusb-1.0-0-dev libdecor-0-dev libpipewire-0.3-dev libunwind-dev
|
||||
|
||||
- name: Setup sccache
|
||||
if: 'false' # disabled for self-hosted
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
- name: Print sccache stats
|
||||
run: sccache --show-stats
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake --preset x-linux-ci-${{matrix.preset}}
|
||||
|
||||
@@ -61,6 +67,7 @@ jobs:
|
||||
run: ci/build-appimage.sh
|
||||
|
||||
- name: Upload artifacts
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dusk-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
|
||||
@@ -68,23 +75,26 @@ jobs:
|
||||
build/install/Dusk-*.AppImage
|
||||
build/install/debug.tar.*
|
||||
|
||||
|
||||
build-apple:
|
||||
name: Build Apple (${{matrix.name}})
|
||||
runs-on: macos-latest
|
||||
runs-on: [self-hosted, macOS]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: AppleClang macOS universal
|
||||
- name: AppleClang macOS arm64
|
||||
platform: macos
|
||||
preset: x-macos-ci
|
||||
artifact_name: macos-appleclang-universal
|
||||
# - name: AppleClang iOS arm64 # TODO enable when CI is free
|
||||
preset: x-macos-ci-arm64
|
||||
artifact_name: macos-appleclang-arm64
|
||||
# - name: AppleClang macOS x86_64
|
||||
# platform: macos
|
||||
# preset: x-macos-ci-x86_64
|
||||
# artifact_name: macos-appleclang-x86_64
|
||||
# - name: AppleClang iOS arm64
|
||||
# platform: ios
|
||||
# preset: x-ios-ci
|
||||
# artifact_name: ios-appleclang-arm64
|
||||
# - name: AppleClang tvOS arm64 # TODO enable when CI is free
|
||||
# - name: AppleClang tvOS arm64
|
||||
# platform: tvos
|
||||
# preset: x-tvos-ci
|
||||
# artifact_name: tvos-appleclang-arm64
|
||||
@@ -95,22 +105,15 @@ jobs:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
|
||||
- name: Update Homebrew
|
||||
if: matrix.platform == 'tvos'
|
||||
run: |
|
||||
brew update
|
||||
brew upgrade --formula
|
||||
|
||||
- name: Install dependencies
|
||||
if: 'false'
|
||||
run: brew install cmake ninja
|
||||
|
||||
- name: Install markupsafe
|
||||
if: matrix.platform == 'tvos'
|
||||
run: pip3 install --break-system-packages markupsafe
|
||||
|
||||
- name: Install Rust iOS target
|
||||
if: matrix.platform == 'ios'
|
||||
run: rustup target add aarch64-apple-ios
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup target add aarch64-apple-ios
|
||||
|
||||
- name: Install Rust tvOS target
|
||||
if: matrix.platform == 'tvos'
|
||||
@@ -118,6 +121,12 @@ jobs:
|
||||
rustup toolchain install nightly
|
||||
rustup target add --toolchain nightly aarch64-apple-tvos
|
||||
|
||||
- name: Install Rust x86_64 macOS target
|
||||
if: endsWith(matrix.preset, 'x86_64')
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup target add x86_64-apple-darwin
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
@@ -128,6 +137,7 @@ jobs:
|
||||
run: cmake --build --preset ${{matrix.preset}}
|
||||
|
||||
- name: Upload artifacts
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dusk-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
|
||||
@@ -139,26 +149,22 @@ jobs:
|
||||
name: Build Windows (${{matrix.name}})
|
||||
runs-on: ${{matrix.runner}}
|
||||
|
||||
env:
|
||||
BUILD_DIR: C:\build
|
||||
SCCACHE_DIR: C:\sccache
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: MSVC x86_64
|
||||
runner: windows-latest
|
||||
runner: [self-hosted, Windows]
|
||||
preset: msvc
|
||||
msvc_arch: amd64
|
||||
vcpkg_arch: x64
|
||||
artifact_arch: x86_64
|
||||
- name: MSVC arm64
|
||||
runner: windows-11-arm
|
||||
preset: arm64-msvc
|
||||
msvc_arch: arm64
|
||||
vcpkg_arch: arm64
|
||||
artifact_arch: arm64
|
||||
# - name: MSVC arm64
|
||||
# runner: windows-11-arm
|
||||
# preset: arm64-msvc
|
||||
# msvc_arch: arm64
|
||||
# vcpkg_arch: arm64
|
||||
# artifact_arch: arm64
|
||||
# - name: Clang x86_64
|
||||
# runner: windows-latest
|
||||
# preset: clang
|
||||
@@ -185,11 +191,10 @@ jobs:
|
||||
uses: mozilla-actions/sccache-action@v0.0.9
|
||||
|
||||
- name: Install dependencies
|
||||
if: 'false' # disabled for self-hosted
|
||||
run: |
|
||||
choco install ninja
|
||||
vcpkg install zlib:${{matrix.vcpkg_arch}}-windows-static bzip2:${{matrix.vcpkg_arch}}-windows-static `
|
||||
zstd:${{matrix.vcpkg_arch}}-windows-static liblzma:${{matrix.vcpkg_arch}}-windows-static `
|
||||
freetype:${{matrix.vcpkg_arch}}-windows-static
|
||||
vcpkg install freetype:${{matrix.vcpkg_arch}}-windows-static zstd:${{matrix.vcpkg_arch}}-windows-static
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake --preset x-windows-ci-${{matrix.preset}}
|
||||
@@ -198,9 +203,12 @@ jobs:
|
||||
run: cmake --build --preset x-windows-ci-${{matrix.preset}}
|
||||
|
||||
- name: Upload artifacts
|
||||
if: startsWith(github.event.ref, 'refs/tags/v')
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: dusk-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
|
||||
path: |
|
||||
${{env.BUILD_DIR}}/install/*.exe
|
||||
${{env.BUILD_DIR}}/install/debug.7z
|
||||
build/install/*.exe
|
||||
build/install/*.dll
|
||||
build/install/res/
|
||||
build/install/debug.7z
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
||||
"type": "cppvsdbg",
|
||||
"request": "launch",
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": ["-l", "1", "--dvd", "${workspaceRoot}/orig/GZ2E01/GZ2E01.iso"],
|
||||
"args": ["-l", "1", "--dvd", "${workspaceRoot}/orig/GZ2E01/GZ2E01.iso", "--console"],
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"symbolSearchPath": "${command:cmake.launchTargetPath}",
|
||||
|
||||
+230
-104
@@ -68,6 +68,9 @@ endif()
|
||||
message(STATUS "Dusk version set to ${DUSK_WC_DESCRIBE}")
|
||||
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
|
||||
project(dusk LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
|
||||
if (APPLE)
|
||||
enable_language(OBJC)
|
||||
endif ()
|
||||
if (APPLE AND NOT TVOS AND CMAKE_SYSTEM_NAME STREQUAL tvOS)
|
||||
# ios.toolchain.cmake hack for SDL
|
||||
set(TVOS ON)
|
||||
@@ -87,11 +90,17 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
|
||||
# Folder-based instead of target-based organization
|
||||
# in Visual Studio and Xcode generators
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "_cmake")
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
|
||||
set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE)
|
||||
endif ()
|
||||
set(AURORA_ENABLE_DVD ON CACHE BOOL "Enable DVD API support" FORCE)
|
||||
set(AURORA_ENABLE_CARD ON CACHE BOOL "Enable CARD API support" FORCE)
|
||||
set(AURORA_ENABLE_RMLUI ON CACHE BOOL "Enable RmlUi UI support" FORCE)
|
||||
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(libs/freeverb)
|
||||
@@ -100,12 +109,20 @@ option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)")
|
||||
option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.")
|
||||
option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON)
|
||||
|
||||
if(ANDROID)
|
||||
set(DUSK_MOVIE_SUPPORT OFF)
|
||||
set(NOD_COMPRESS_BZIP2 OFF CACHE BOOL "" FORCE)
|
||||
set(NOD_COMPRESS_LZMA OFF CACHE BOOL "" FORCE)
|
||||
set(NOD_COMPRESS_ZLIB OFF CACHE BOOL "" FORCE)
|
||||
set(NOD_COMPRESS_ZSTD OFF CACHE BOOL "" FORCE)
|
||||
endif ()
|
||||
|
||||
option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF)
|
||||
set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
|
||||
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
|
||||
|
||||
if (DUSK_MOVIE_SUPPORT)
|
||||
find_package(libjpeg-turbo QUIET)
|
||||
find_package(libjpeg-turbo 3.0 CONFIG QUIET)
|
||||
if (libjpeg-turbo_FOUND)
|
||||
message(STATUS "dusk: Using system libjpeg-turbo")
|
||||
else ()
|
||||
@@ -117,19 +134,37 @@ if (DUSK_MOVIE_SUPPORT)
|
||||
else ()
|
||||
set(_jpeg_lib ${_jpeg_install_dir}/lib/libturbojpeg.a)
|
||||
endif ()
|
||||
set(_jpeg_cmake_args
|
||||
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
|
||||
-DENABLE_SHARED=OFF
|
||||
-DWITH_TURBOJPEG=ON
|
||||
-DWITH_JAVA=OFF
|
||||
)
|
||||
if (CMAKE_TOOLCHAIN_FILE)
|
||||
get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
|
||||
list(APPEND _jpeg_cmake_args -DCMAKE_TOOLCHAIN_FILE=${_jpeg_toolchain_file})
|
||||
endif ()
|
||||
set(_jpeg_passthrough_vars
|
||||
CMAKE_BUILD_TYPE
|
||||
CMAKE_C_COMPILER
|
||||
CMAKE_C_COMPILER_LAUNCHER
|
||||
CMAKE_MAKE_PROGRAM
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY
|
||||
CMAKE_OSX_ARCHITECTURES
|
||||
DEPLOYMENT_TARGET
|
||||
ENABLE_ARC
|
||||
ENABLE_BITCODE
|
||||
PLATFORM
|
||||
)
|
||||
foreach(_var IN LISTS _jpeg_passthrough_vars)
|
||||
if (DEFINED ${_var})
|
||||
list(APPEND _jpeg_cmake_args -D${_var}=${${_var}})
|
||||
endif ()
|
||||
endforeach ()
|
||||
ExternalProject_Add(libjpeg-turbo-ext
|
||||
URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/3.1.0.tar.gz
|
||||
URL_HASH SHA256=35fec2e1ddfb05ecf6d93e50bc57c1e54bc81c16d611ddf6eff73fff266d8285
|
||||
CMAKE_ARGS
|
||||
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_INSTALL_PREFIX=${_jpeg_install_dir}
|
||||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY}
|
||||
-DENABLE_SHARED=OFF
|
||||
-DWITH_TURBOJPEG=ON
|
||||
-DWITH_JAVA=OFF
|
||||
CMAKE_ARGS ${_jpeg_cmake_args}
|
||||
BUILD_BYPRODUCTS ${_jpeg_lib}
|
||||
)
|
||||
file(MAKE_DIRECTORY ${_jpeg_install_dir}/include)
|
||||
@@ -241,27 +276,21 @@ include(files.cmake)
|
||||
# TODO: version handling for res includes
|
||||
|
||||
set(DUSK_BUNDLE_NAME Dusk)
|
||||
set(DUSK_BUNDLE_IDENTIFIER dev.decomp.dusk)
|
||||
set(DUSK_BUNDLE_IDENTIFIER dev.twilitrealm.dusk)
|
||||
set(DUSK_COMPANY_NAME "Twilit Realm")
|
||||
set(DUSK_FILE_DESCRIPTION "Dusk")
|
||||
set(DUSK_PRODUCT_NAME "Dusk")
|
||||
set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors")
|
||||
set(DUSK_GAME_NAME "GZ2E")
|
||||
set(DUSK_GAME_VERSION "01")
|
||||
set(DUSK_TP_VERSION ${DUSK_GAME_NAME}${DUSK_GAME_VERSION})
|
||||
|
||||
message(STATUS "dusk: Game Version: ${DUSK_TP_VERSION}")
|
||||
|
||||
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${JSYSTEM_DEBUG_FILES} ${REL_FILES})
|
||||
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES})
|
||||
source_group("dusk" FILES ${DUSK_FILES})
|
||||
|
||||
set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0
|
||||
DUSK_TP_VERSION="${DUSK_TP_VERSION}" DUSK_GAME_NAME="${DUSK_GAME_NAME}" DUSK_GAME_VERSION="${DUSK_GAME_VERSION}")
|
||||
set(GAME_COMPILE_DEFS TARGET_PC WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0)
|
||||
|
||||
set(GAME_INCLUDE_DIRS
|
||||
include
|
||||
src
|
||||
assets/${DUSK_TP_VERSION}
|
||||
assets/GZ2E01 # TODO: make this dynamic if needed?
|
||||
libs/JSystem/include
|
||||
libs
|
||||
extern/aurora/include/dolphin
|
||||
@@ -269,7 +298,7 @@ set(GAME_INCLUDE_DIRS
|
||||
${CMAKE_BINARY_DIR})
|
||||
|
||||
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd
|
||||
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient)
|
||||
aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt)
|
||||
|
||||
list(APPEND GAME_LIBS libzstd_static)
|
||||
|
||||
@@ -278,6 +307,10 @@ if (DUSK_ENABLE_SENTRY_NATIVE)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_SENTRY_NATIVE=1 SENTRY_BUILD_STATIC=1)
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND GAME_LIBS Ws2_32)
|
||||
endif ()
|
||||
|
||||
if (DUSK_MOVIE_SUPPORT)
|
||||
if (TARGET libjpeg-turbo::turbojpeg-static)
|
||||
list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static)
|
||||
@@ -287,59 +320,141 @@ if (DUSK_MOVIE_SUPPORT)
|
||||
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
|
||||
endif ()
|
||||
|
||||
option(DUSK_ENABLE_DISCORD_RPC "Enable Discord Rich Presence support" ON)
|
||||
if (DUSK_ENABLE_DISCORD_RPC AND NOT ANDROID AND NOT IOS AND NOT TVOS)
|
||||
|
||||
FetchContent_Populate(discord_rpc
|
||||
URL https://github.com/discord/discord-rpc/archive/refs/tags/v3.4.0.tar.gz
|
||||
URL_HASH SHA256=e13427019027acd187352dacba6c65953af66fdf3c35fcf38fc40b454a9d7855
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||
)
|
||||
# RapidJSON is a git submodule absent from the discord-rpc tarball; fetch separately.
|
||||
FetchContent_Populate(rapidjson
|
||||
URL https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.tar.gz
|
||||
URL_HASH SHA256=bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
||||
)
|
||||
|
||||
if (NOT TARGET discord-rpc)
|
||||
set(_drpc ${discord_rpc_SOURCE_DIR}/src)
|
||||
set(_drpc_src
|
||||
${_drpc}/discord_rpc.cpp
|
||||
${_drpc}/rpc_connection.cpp
|
||||
${_drpc}/serialization.cpp
|
||||
)
|
||||
if (WIN32)
|
||||
list(APPEND _drpc_src ${_drpc}/connection_win.cpp ${_drpc}/discord_register_win.cpp)
|
||||
elseif (APPLE)
|
||||
list(APPEND _drpc_src ${_drpc}/connection_unix.cpp ${_drpc}/discord_register_osx.m)
|
||||
else ()
|
||||
list(APPEND _drpc_src ${_drpc}/connection_unix.cpp ${_drpc}/discord_register_linux.cpp)
|
||||
endif ()
|
||||
add_library(discord-rpc STATIC ${_drpc_src})
|
||||
target_include_directories(discord-rpc PUBLIC
|
||||
${discord_rpc_SOURCE_DIR}/include
|
||||
${rapidjson_SOURCE_DIR}/include
|
||||
)
|
||||
if (UNIX)
|
||||
target_link_libraries(discord-rpc PUBLIC pthread)
|
||||
endif ()
|
||||
endif ()
|
||||
list(APPEND GAME_LIBS discord-rpc)
|
||||
list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD_RPC=1)
|
||||
endif ()
|
||||
|
||||
# Edit & Continue
|
||||
if (MSVC)
|
||||
add_compile_options("/ZI")
|
||||
add_link_options("/INCREMENTAL")
|
||||
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "EditAndContinue")
|
||||
endif ()
|
||||
if (CMAKE_MSVC_DEBUG_INFORMATION_FORMAT STREQUAL "EditAndContinue")
|
||||
add_link_options("/INCREMENTAL")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if(ANDROID)
|
||||
list(APPEND GAME_COMPILE_DEFS TARGET_ANDROID=1)
|
||||
endif ()
|
||||
|
||||
# game_debug is for game code files that we know work when compiled with DEBUG=1
|
||||
# Of course, if building a release build, this distinction is irrelevant
|
||||
add_library(game_debug OBJECT ${JSYSTEM_DEBUG_FILES} ${SSYSTEM_FILES}
|
||||
set(GAME_DEBUG_FILES
|
||||
${SSYSTEM_FILES}
|
||||
src/dusk/audio/DuskAudioSystem.cpp
|
||||
src/dusk/audio/JASCriticalSection.cpp
|
||||
src/dusk/audio/DuskDsp.cpp
|
||||
src/dusk/audio/Adpcm.cpp
|
||||
src/dusk/audio/DspStub.cpp
|
||||
src/dusk/imgui/ImGuiAudio.cpp)
|
||||
src/dusk/imgui/ImGuiAudio.cpp
|
||||
)
|
||||
set_source_files_properties(
|
||||
${GAME_DEBUG_FILES}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "$<$<CONFIG:Debug>:DEBUG=1>;$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>"
|
||||
)
|
||||
|
||||
# game_base is for all other game code files
|
||||
add_library(game_base OBJECT ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${JSYSTEM_FILES} ${REL_FILES} ${DUSK_FILES} ${DOLPHIN_FILES})
|
||||
set(GAME_BASE_FILES
|
||||
${DOLZEL_FILES}
|
||||
${Z2AUDIOLIB_FILES}
|
||||
${REL_FILES}
|
||||
${DUSK_FILES}
|
||||
${DOLPHIN_FILES}
|
||||
)
|
||||
set_source_files_properties(
|
||||
${GAME_BASE_FILES}
|
||||
PROPERTIES
|
||||
COMPILE_DEFINITIONS "NDEBUG=1;NDEBUG_DEFINED=1;DEBUG_DEFINED=0;$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>"
|
||||
)
|
||||
|
||||
target_compile_definitions(game_debug PRIVATE ${GAME_COMPILE_DEFS} $<$<CONFIG:Debug>:DEBUG=1> $<$<CONFIG:Debug>:PARTIAL_DEBUG=1>)
|
||||
target_compile_definitions(game_base PRIVATE ${GAME_COMPILE_DEFS} NDEBUG=1 NDEBUG_DEFINED=1 DEBUG_DEFINED=0 $<$<CONFIG:Debug>:PARTIAL_DEBUG=1>)
|
||||
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
|
||||
target_compile_definitions(${jsystem_lib} PRIVATE
|
||||
${GAME_COMPILE_DEFS}
|
||||
$<$<CONFIG:Debug>:DEBUG=1>
|
||||
$<$<CONFIG:Debug>:PARTIAL_DEBUG=1>
|
||||
)
|
||||
target_include_directories(${jsystem_lib} PRIVATE ${GAME_INCLUDE_DIRS})
|
||||
target_link_libraries(${jsystem_lib} PRIVATE ${GAME_LIBS})
|
||||
set_target_properties(${jsystem_lib} PROPERTIES FOLDER "JSystem")
|
||||
endforeach()
|
||||
|
||||
# only apply PCH to game_base since not all headers are necessarily validated with DEBUG=1
|
||||
target_precompile_headers(game_base PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>")
|
||||
set(JSYSTEM_LINK_LIBRARIES ${JSYSTEM_LIBRARIES})
|
||||
if (CMAKE_CXX_LINK_GROUP_USING_RESCAN_SUPPORTED OR CMAKE_LINK_GROUP_USING_RESCAN_SUPPORTED)
|
||||
# GNU ld resolves static archives in a single left-to-right pass. The split
|
||||
# JSystem libraries reference each other, so they need a RESCAN group there.
|
||||
set(JSYSTEM_LINK_LIBRARIES "$<LINK_GROUP:RESCAN,${JSYSTEM_LIBRARIES}>")
|
||||
endif ()
|
||||
|
||||
target_include_directories(game_debug PRIVATE ${GAME_INCLUDE_DIRS})
|
||||
target_include_directories(game_base PRIVATE ${GAME_INCLUDE_DIRS})
|
||||
set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES})
|
||||
if(ANDROID)
|
||||
add_library(dusk SHARED ${DUSK_FILES})
|
||||
set_target_properties(dusk PROPERTIES OUTPUT_NAME main)
|
||||
else ()
|
||||
add_executable(dusk ${DUSK_FILES})
|
||||
endif ()
|
||||
|
||||
# This implicitly pulls in the library include directories even though no
|
||||
# linking actually takes place for object libraries
|
||||
target_link_libraries(game_debug PRIVATE ${GAME_LIBS})
|
||||
target_link_libraries(game_base PRIVATE ${GAME_LIBS})
|
||||
|
||||
# Combined game library
|
||||
add_library(game STATIC
|
||||
$<TARGET_OBJECTS:game_base>
|
||||
$<TARGET_OBJECTS:game_debug>)
|
||||
target_link_libraries(game PUBLIC ${GAME_LIBS})
|
||||
|
||||
add_executable(dusk src/dusk/main.cpp)
|
||||
target_compile_definitions(dusk PRIVATE TARGET_PC AVOID_UB=1 VERSION=0)
|
||||
target_include_directories(dusk PRIVATE include)
|
||||
target_link_libraries(dusk PRIVATE game aurora::main)
|
||||
target_compile_definitions(dusk PRIVATE ${GAME_COMPILE_DEFS})
|
||||
target_include_directories(dusk PRIVATE ${GAME_INCLUDE_DIRS})
|
||||
target_link_libraries(dusk PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES})
|
||||
target_precompile_headers(dusk PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/include/dusk_pch.hpp>")
|
||||
if (TARGET crashpad_handler)
|
||||
add_dependencies(dusk crashpad_handler)
|
||||
endif ()
|
||||
|
||||
add_custom_command(TARGET dusk POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/res"
|
||||
"$<TARGET_FILE_DIR:dusk>/res"
|
||||
COMMENT "Copying resources"
|
||||
)
|
||||
if (ANDROID)
|
||||
# SDLActivity loads SDL_main via dlsym on Android. Since aurora::main is a static
|
||||
# archive, force an undefined reference so the linker keeps the SDL_main object.
|
||||
target_link_options(dusk PRIVATE "-Wl,-u,SDL_main")
|
||||
endif ()
|
||||
|
||||
if (NOT APPLE)
|
||||
add_custom_command(TARGET dusk POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_SOURCE_DIR}/res"
|
||||
"$<TARGET_FILE_DIR:dusk>/res"
|
||||
COMMENT "Copying resources"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
set(DUSK_WINDOWS_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/windows)
|
||||
@@ -373,44 +488,49 @@ endif ()
|
||||
if (APPLE)
|
||||
if (IOS)
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios)
|
||||
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
|
||||
file(GLOB_RECURSE DUSK_RESOURCE_FILES "${DUSK_RESOURCE_DIR}/Base.lproj/*")
|
||||
endif ()
|
||||
if (IOS OR TVOS)
|
||||
target_sources(dusk PRIVATE ${DUSK_RESOURCE_FILES})
|
||||
foreach (FILE ${DUSK_RESOURCE_FILES})
|
||||
file(RELATIVE_PATH NEW_FILE "${DUSK_RESOURCE_DIR}" ${FILE})
|
||||
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
|
||||
set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}")
|
||||
endforeach ()
|
||||
set_target_properties(
|
||||
dusk PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING}
|
||||
OUTPUT_NAME dusk
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
|
||||
)
|
||||
if (CMAKE_GENERATOR STREQUAL "Xcode")
|
||||
set_target_properties(dusk PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST})
|
||||
elseif (DEFINED DUSK_INFO_PLIST)
|
||||
set(MACOSX_BUNDLE_EXECUTABLE_NAME dusk)
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER})
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME})
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING})
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING})
|
||||
set(DUSK_GENERATED_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/dusk.Info.plist)
|
||||
configure_file(${DUSK_INFO_PLIST} ${DUSK_GENERATED_INFO_PLIST})
|
||||
add_custom_command(
|
||||
TARGET dusk POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DUSK_GENERATED_INFO_PLIST} $<TARGET_FILE_DIR:dusk>/Info.plist
|
||||
VERBATIM
|
||||
)
|
||||
endif ()
|
||||
elseif (TVOS)
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/tvos)
|
||||
else ()
|
||||
set(DUSK_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos)
|
||||
endif ()
|
||||
set(DUSK_INFO_PLIST ${DUSK_RESOURCE_DIR}/Info.plist.in)
|
||||
file(GLOB_RECURSE DUSK_RESOURCE_FILES
|
||||
"${DUSK_RESOURCE_DIR}/Assets.car"
|
||||
"${DUSK_RESOURCE_DIR}/Base.lproj/*"
|
||||
"${DUSK_RESOURCE_DIR}/Dusk.icns")
|
||||
file(GLOB_RECURSE DUSK_APP_RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/res/*")
|
||||
target_sources(dusk PRIVATE ${DUSK_RESOURCE_FILES})
|
||||
target_sources(dusk PRIVATE ${DUSK_APP_RESOURCE_FILES})
|
||||
foreach (FILE ${DUSK_RESOURCE_FILES})
|
||||
file(RELATIVE_PATH NEW_FILE "${DUSK_RESOURCE_DIR}" ${FILE})
|
||||
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
|
||||
set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}")
|
||||
endforeach ()
|
||||
foreach (FILE ${DUSK_APP_RESOURCE_FILES})
|
||||
file(RELATIVE_PATH NEW_FILE "${CMAKE_CURRENT_SOURCE_DIR}" ${FILE})
|
||||
get_filename_component(NEW_FILE_PATH ${NEW_FILE} DIRECTORY)
|
||||
set_property(SOURCE ${FILE} PROPERTY MACOSX_PACKAGE_LOCATION "Resources/${NEW_FILE_PATH}")
|
||||
endforeach ()
|
||||
set_target_properties(
|
||||
dusk PROPERTIES
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
|
||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
|
||||
MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING}
|
||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING}
|
||||
MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST}
|
||||
OUTPUT_NAME Dusk
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
|
||||
XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "YES"
|
||||
)
|
||||
endif ()
|
||||
|
||||
if (IOS)
|
||||
find_library(UIKIT_FRAMEWORK UIKit REQUIRED)
|
||||
find_library(UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK UniformTypeIdentifiers REQUIRED)
|
||||
target_sources(dusk PRIVATE src/dusk/ios/FileSelectDialog.m)
|
||||
set_source_files_properties(src/dusk/ios/FileSelectDialog.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
target_link_libraries(dusk PRIVATE ${UIKIT_FRAMEWORK} ${UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK})
|
||||
endif ()
|
||||
|
||||
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
|
||||
@@ -459,7 +579,9 @@ if (TARGET crashpad_handler)
|
||||
endif ()
|
||||
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
aurora_install_runtime_dlls(dusk ${CMAKE_INSTALL_PREFIX})
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
if (NOT APPLE)
|
||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
endif ()
|
||||
if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||
set(DEBUG_FILES_LIST "")
|
||||
foreach (target IN LISTS BINARY_TARGETS EXTRA_TARGETS)
|
||||
@@ -481,18 +603,22 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
|
||||
endif ()
|
||||
list(APPEND DEBUG_FILES_LIST "${output_name}")
|
||||
endforeach ()
|
||||
if (WIN32)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND 7z a -t7z \"${CMAKE_INSTALL_PREFIX}/debug.7z\" ${DEBUG_FILES})")
|
||||
elseif (APPLE)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar acfv \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
elseif (UNIX)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dbg")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar -I \"xz -9 -T0\" -cvf \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
# This is a terrible hack to only run this on CI
|
||||
# until I turn this into a script or something
|
||||
if(DEFINED ENV{GITHUB_ENV})
|
||||
if (WIN32)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".pdb")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND 7z a -t7z \"${CMAKE_INSTALL_PREFIX}/debug.7z\" ${DEBUG_FILES})")
|
||||
elseif (APPLE)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dSYM")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar acfv \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
elseif (UNIX)
|
||||
list(TRANSFORM DEBUG_FILES_LIST APPEND ".dbg")
|
||||
list(JOIN DEBUG_FILES_LIST " " DEBUG_FILES)
|
||||
install(CODE "execute_process(WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\" COMMAND tar -I \"xz -9 -T0\" -cvf \"${CMAKE_INSTALL_PREFIX}/debug.tar.xz\" ${DEBUG_FILES})")
|
||||
endif ()
|
||||
endif ()
|
||||
endif ()
|
||||
foreach (target IN LISTS BINARY_TARGETS)
|
||||
|
||||
+86
-25
@@ -22,6 +22,20 @@
|
||||
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci",
|
||||
"hidden": true,
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"DUSK_ENABLE_SENTRY_NATIVE": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
|
||||
"DUSK_SENTRY_ENVIRONMENT": "production"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "linux-default",
|
||||
"displayName": "Linux (default)",
|
||||
@@ -134,8 +148,7 @@
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "cl",
|
||||
"CMAKE_CXX_COMPILER": "cl",
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
||||
"AURORA_DAWN_PROVIDER": "vendor"
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install"
|
||||
},
|
||||
"vendor": {
|
||||
"microsoft.com/VisualStudioSettings/CMake/1.0": {
|
||||
@@ -316,7 +329,7 @@
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install",
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{ANDROID_HOME}/ndk/$env{ANDROID_NDK_VERSION}/build/cmake/android.toolchain.cmake",
|
||||
"ANDROID_PLATFORM": "android-24"
|
||||
"ANDROID_PLATFORM": "android-28"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -343,11 +356,11 @@
|
||||
"name": "x-linux-ci",
|
||||
"hidden": true,
|
||||
"inherits": [
|
||||
"relwithdebinfo"
|
||||
"relwithdebinfo",
|
||||
"ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"AURORA_SDL3_PROVIDER": "vendor"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -367,11 +380,40 @@
|
||||
{
|
||||
"name": "x-macos-ci",
|
||||
"inherits": [
|
||||
"macos-default-relwithdebinfo"
|
||||
"macos-default-relwithdebinfo",
|
||||
"ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"AURORA_NOD_PROVIDER": "vendor",
|
||||
"CMAKE_DISABLE_FIND_PACKAGE_PkgConfig": {
|
||||
"type": "BOOL",
|
||||
"value": true
|
||||
},
|
||||
"CMAKE_OSX_DEPLOYMENT_TARGET": "11.0",
|
||||
"CMAKE_IGNORE_PREFIX_PATH": "/opt/homebrew",
|
||||
"DUSK_MOVIE_SUPPORT": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x-macos-ci-arm64",
|
||||
"inherits": [
|
||||
"x-macos-ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_OSX_ARCHITECTURES": "arm64"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x-macos-ci-x86_64",
|
||||
"inherits": [
|
||||
"x-macos-ci"
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_OSX_ARCHITECTURES": "x86_64",
|
||||
"Rust_CARGO_TARGET": "x86_64-apple-darwin"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -381,7 +423,11 @@
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"DUSK_MOVIE_SUPPORT": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -391,21 +437,27 @@
|
||||
],
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache"
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"DUSK_MOVIE_SUPPORT": {
|
||||
"type": "BOOL",
|
||||
"value": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x-windows-ci",
|
||||
"hidden": true,
|
||||
"inherits": [
|
||||
"relwithdebinfo"
|
||||
"relwithdebinfo",
|
||||
"ci"
|
||||
],
|
||||
"binaryDir": "$env{BUILD_DIR}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_PREFIX": "$env{BUILD_DIR}/install",
|
||||
"CMAKE_C_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
|
||||
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded"
|
||||
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "Embedded",
|
||||
"CMAKE_TOOLCHAIN_FILE": {
|
||||
"type": "FILEPATH",
|
||||
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
|
||||
},
|
||||
"VCPKG_TARGET_TRIPLET": "x64-windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -546,10 +598,19 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x-macos-ci",
|
||||
"configurePreset": "x-macos-ci",
|
||||
"description": "(Internal) macOS CI",
|
||||
"displayName": "(Internal) macOS CI",
|
||||
"name": "x-macos-ci-arm64",
|
||||
"configurePreset": "x-macos-ci-arm64",
|
||||
"description": "(Internal) macOS CI arm64",
|
||||
"displayName": "(Internal) macOS CI arm64",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "x-macos-ci-x86_64",
|
||||
"configurePreset": "x-macos-ci-x86_64",
|
||||
"description": "(Internal) macOS CI x86_64",
|
||||
"displayName": "(Internal) macOS CI x86_64",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
@@ -557,8 +618,8 @@
|
||||
{
|
||||
"name": "x-ios-ci",
|
||||
"configurePreset": "x-ios-ci",
|
||||
"description": "(Internal) iOS CI",
|
||||
"displayName": "(Internal) iOS CI",
|
||||
"description": "(Internal) iOS CI arm64",
|
||||
"displayName": "(Internal) iOS CI arm64",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
@@ -566,8 +627,8 @@
|
||||
{
|
||||
"name": "x-tvos-ci",
|
||||
"configurePreset": "x-tvos-ci",
|
||||
"description": "(Internal) tvOS CI",
|
||||
"displayName": "(Internal) tvOS CI",
|
||||
"description": "(Internal) tvOS CI arm64",
|
||||
"displayName": "(Internal) tvOS CI arm64",
|
||||
"targets": [
|
||||
"install"
|
||||
]
|
||||
|
||||
@@ -1,103 +1,37 @@
|
||||
## Dusk
|
||||

|
||||
|
||||
### Building
|
||||
#### Prerequisites
|
||||
* [CMake 3.25+](https://cmake.org)
|
||||
* Windows: Install `CMake Tools` in Visual Studio
|
||||
* macOS: `brew install cmake`
|
||||
* [Python 3+](https://python.org)
|
||||
* Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640)
|
||||
* Verify it's added to `%PATH%` by typing `python` in `cmd`.
|
||||
* macOS: `brew install python@3`
|
||||
* **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
|
||||
* Select `C++ Development` and verify the following packages are included:
|
||||
* `Windows 11 SDK`
|
||||
* `CMake Tools`
|
||||
* `C++ Clang Compiler`
|
||||
* `C++ Clang-cl`
|
||||
* **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/)
|
||||
* **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
|
||||
* Ubuntu 24.04+ packages
|
||||
```
|
||||
build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
|
||||
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
|
||||
libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
|
||||
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
|
||||
libxss-dev libxtst-dev
|
||||
```
|
||||
* Arch Linux packages
|
||||
```
|
||||
base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
|
||||
```
|
||||
* Fedora packages
|
||||
```
|
||||
cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
|
||||
```
|
||||
* It's also important that you install the developer tools and libraries
|
||||
```
|
||||
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
||||
```
|
||||
#### Setup
|
||||
Clone and initialize the Dusk repository
|
||||
```sh
|
||||
git clone --recursive https://github.com/TwilitRealm/dusk.git
|
||||
cd dusk
|
||||
git pull
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
- ### **[Official Website](https://twilitrealm.dev)**
|
||||
- ### **[Discord](https://discord.gg/QACynxeyna)**
|
||||
|
||||
#### Building
|
||||
# Overview
|
||||
Dusk is a reverse-engineered reimplementation of Twilight Princess.
|
||||
It aims to be as accurate as possible to the original while also providing new options, enhancements, and tools to customize your experience.
|
||||
|
||||
**CLion (Windows / macOS / Linux)**
|
||||
# Setup
|
||||
**⚠️ Dusk does NOT provide any copyrighted assets. You must provide your own copy of the game.**
|
||||
|
||||
Open the project directory in CLion. Enable the appropriate presets for your platform:
|
||||
### 1. Verify your ROM dump
|
||||
First make sure your dump of the game is clean and supported by Dusk. You can do this by checking the sha1 hash of your dump against this list of supported versions.
|
||||
|
||||

|
||||
| Version | sha1 hash |
|
||||
|--------------| ---------------------------------------- |
|
||||
| GameCube USA | 75edd3ddff41f125d1b4ce1a40378f1b565519e7 |
|
||||
| GameCube PAL | 2601822a488eeb86fb89db16ca8f29c2c953e1ca |
|
||||
|
||||
**Visual Studio (Windows)**
|
||||
### 2. Download [Dusk](https://github.com/TwilitRealm/dusk/releases)
|
||||
|
||||
Open the project directory in Visual Studio. The CMake configuration will be loaded automatically.
|
||||
### 3. Setup the game
|
||||
- Extract the zip folder
|
||||
- Launch Dusk
|
||||
- Select Options, then set the ISO Path to your supported game dump
|
||||
- Press Start Game to play!
|
||||
|
||||
**ninja (macOS)**
|
||||

|
||||
|
||||
```sh
|
||||
cmake --preset macos-default-relwithdebinfo
|
||||
cmake --build --preset macos-default-relwithdebinfo
|
||||
```
|
||||
# Building
|
||||
If you'd like to build Dusk from source, please read the [build instructions](docs/building.md).
|
||||
|
||||
Alternate presets available:
|
||||
- `macos-default-debug`: Clang, Debug
|
||||
Pull Requests are welcomed! Note that we do not accept contributions that are primarily AI generated and will close your PR if we suspect as much.
|
||||
|
||||
**ninja (Linux)**
|
||||
|
||||
```sh
|
||||
cmake --preset linux-default-relwithdebinfo
|
||||
cmake --build --preset linux-default-relwithdebinfo
|
||||
```
|
||||
|
||||
Alternate presets available:
|
||||
- `linux-default-debug`: GCC, Debug
|
||||
- `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
|
||||
- `linux-clang-debug`: Clang, Debug
|
||||
|
||||
**ninja (Windows)**
|
||||
|
||||
```sh
|
||||
cmake --preset windows-msvc-relwithdebinfo
|
||||
cmake --build --preset windows-msvc-relwithdebinfo
|
||||
```
|
||||
|
||||
Alternate presets available:
|
||||
- `windows-msvc-debug`: MSVC, Debug
|
||||
- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
|
||||
- `windows-clang-debug`: Clang-cl, Debug
|
||||
|
||||
#### Running
|
||||
Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
|
||||
```sh
|
||||
build/{preset}/dusk /path/to/game.rvz
|
||||
```
|
||||
If no path is specified, Dusk defaults to `game.iso` in the current working directory.
|
||||
|
||||
#### 30 FPS on Debug
|
||||
When compiled fully in a Debug the game runs too slowly to hit playable 30 FPS. To avoid this, you can set a CMake cache variable to optimize specific critical files without hampering debuggability in the rest of the program: `-DDUSK_SELECTED_OPT=ON`. When building for MSVC (Windows) you must also modify `CMAKE_CXX_FLAGS_DEBUG` and `CMAKE_C_FLAGS_DEBUG` to remove `/RTC1` from the flags, like so: `-DCMAKE_CXX_FLAGS_DEBUG="/MDd /Zi /Ob0 /Od" -DCMAKE_C_FLAGS_DEBUG="/MDd /Zi /Ob0 /Od"`
|
||||
# Credits
|
||||
Special thanks to the [TP decompilation](https://github.com/zeldaret/tp) team, the GC/Wii decompilation community, the [Aurora](https://github.com/encounter/aurora) developers, the [TP speedrunning community](https://zsrtp.link), and all [contributors](https://github.com/TwilitRealm/dusk/graphs/contributors).
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
@@ -9,10 +9,10 @@ chmod +x linuxdeploy-$(uname -m).AppImage
|
||||
# Build AppImage
|
||||
cd "$GITHUB_WORKSPACE"
|
||||
mkdir -p build/appdir/usr/{bin,share/{applications,icons/hicolor}}
|
||||
cp build/install/!(*.*) build/appdir/usr/bin
|
||||
cp -r build/install/!(*.*) build/appdir/usr/bin
|
||||
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
|
||||
cp platforms/freedesktop/dusk.desktop build/appdir/usr/share/applications
|
||||
|
||||
cd build/install
|
||||
VERSION="$DUSK_VERSION" NO_STRIP=1 "$RUNNER_WORKSPACE"/linuxdeploy-$(uname -m).AppImage \
|
||||
--appdir "$GITHUB_WORKSPACE"/build/appdir --output appimage
|
||||
-l /usr/lib/x86_64-linux-gnu/libusb-1.0.so --appdir "$GITHUB_WORKSPACE"/build/appdir --output appimage
|
||||
|
||||
@@ -13,13 +13,3 @@ buildType:
|
||||
short: RelWithDebInfo
|
||||
long: Optimized, with debug symbols
|
||||
buildType: RelWithDebInfo
|
||||
|
||||
tp_version:
|
||||
default: GZ2E01
|
||||
description: TP Version
|
||||
choices:
|
||||
GZ2E01:
|
||||
short: GZ2E01
|
||||
long: GZ2E01
|
||||
settings:
|
||||
DUSK_TP_VERSION: GZ2E01
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
### Building
|
||||
#### Prerequisites
|
||||
* [CMake 3.25+](https://cmake.org)
|
||||
* Windows: Install `CMake Tools` in Visual Studio
|
||||
* macOS: `brew install cmake`
|
||||
* [Python 3+](https://python.org)
|
||||
* Windows: [Microsoft Store](https://go.microsoft.com/fwlink?linkID=2082640)
|
||||
* Verify it's added to `%PATH%` by typing `python` in `cmd`.
|
||||
* macOS: `brew install python@3`
|
||||
* **[Windows]** [Visual Studio 2026 Community](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
|
||||
* Select `C++ Development` and verify the following packages are included:
|
||||
* `Windows 11 SDK`
|
||||
* `CMake Tools`
|
||||
* `C++ Clang Compiler`
|
||||
* `C++ Clang-cl`
|
||||
* **[macOS]** [Xcode 16.4+](https://developer.apple.com/xcode/download/)
|
||||
* **[Linux]** Actively tested on Ubuntu 24.04, Arch Linux & derivatives.
|
||||
* Ubuntu 24.04+ packages
|
||||
```
|
||||
build-essential curl git ninja-build clang lld zlib1g-dev libcurl4-openssl-dev \
|
||||
libglu1-mesa-dev libdbus-1-dev libvulkan-dev libxi-dev libxrandr-dev libasound2-dev libpulse-dev \
|
||||
libudev-dev libpng-dev libncurses5-dev cmake libx11-xcb-dev python3 python-is-python3 \
|
||||
libclang-dev libfreetype-dev libxinerama-dev libxcursor-dev python3-markupsafe libgtk-3-dev \
|
||||
libxss-dev libxtst-dev
|
||||
```
|
||||
* Arch Linux packages
|
||||
```
|
||||
base-devel cmake ninja llvm vulkan-headers python python-markupsafe clang lld alsa-lib libpulse libxrandr freetype2
|
||||
```
|
||||
* Fedora packages
|
||||
```
|
||||
cmake vulkan-headers ninja-build clang-devel llvm-devel libpng-devel
|
||||
```
|
||||
* It's also important that you install the developer tools and libraries
|
||||
```
|
||||
sudo dnf groupinstall "Development Tools" "Development Libraries"
|
||||
```
|
||||
#### Setup
|
||||
Clone and initialize the Dusk repository
|
||||
```sh
|
||||
git clone --recursive https://github.com/TwilitRealm/dusk.git
|
||||
cd dusk
|
||||
git pull
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
#### Building
|
||||
|
||||
**CLion (Windows / macOS / Linux)**
|
||||
|
||||
Open the project directory in CLion. Enable the appropriate presets for your platform:
|
||||
|
||||

|
||||
|
||||
**Visual Studio (Windows)**
|
||||
|
||||
Open the project directory in Visual Studio. The CMake configuration will be loaded automatically.
|
||||
|
||||
**ninja (macOS)**
|
||||
|
||||
```sh
|
||||
cmake --preset macos-default-relwithdebinfo
|
||||
cmake --build --preset macos-default-relwithdebinfo
|
||||
```
|
||||
|
||||
Alternate presets available:
|
||||
- `macos-default-debug`: Clang, Debug
|
||||
|
||||
**ninja (Linux)**
|
||||
|
||||
```sh
|
||||
cmake --preset linux-default-relwithdebinfo
|
||||
cmake --build --preset linux-default-relwithdebinfo
|
||||
```
|
||||
|
||||
Alternate presets available:
|
||||
- `linux-default-debug`: GCC, Debug
|
||||
- `linux-clang-relwithdebinfo`: Clang, RelWithDebInfo
|
||||
- `linux-clang-debug`: Clang, Debug
|
||||
|
||||
**ninja (Windows)**
|
||||
|
||||
```sh
|
||||
cmake --preset windows-msvc-relwithdebinfo
|
||||
cmake --build --preset windows-msvc-relwithdebinfo
|
||||
```
|
||||
|
||||
Alternate presets available:
|
||||
- `windows-msvc-debug`: MSVC, Debug
|
||||
- `windows-clang-relwithdebinfo`: Clang-cl, RelWithDebInfo
|
||||
- `windows-clang-debug`: Clang-cl, Debug
|
||||
|
||||
#### Running
|
||||
Pass the disc image as a positional argument. Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, GCZ
|
||||
```sh
|
||||
build/{preset}/dusk /path/to/game.rvz
|
||||
```
|
||||
If no path is specified, Dusk defaults to `game.iso` in the current working directory.
|
||||
Vendored
+1
-1
Submodule extern/aurora updated: 4dd23c74d8...77ad549530
+142
-8
@@ -1,7 +1,7 @@
|
||||
|
||||
set(DOLZEL_FILES
|
||||
src/m_Do/m_Do_main.cpp
|
||||
src/m_Do/m_Do_printf.cpp
|
||||
#src/m_Do/m_Do_printf.cpp
|
||||
src/m_Do/m_Do_audio.cpp
|
||||
src/m_Do/m_Do_controller_pad.cpp
|
||||
#src/m_Do/m_Re_controller_pad.cpp
|
||||
@@ -15,7 +15,6 @@ set(DOLZEL_FILES
|
||||
src/m_Do/m_Do_DVDError.cpp
|
||||
src/m_Do/m_Do_MemCard.cpp
|
||||
src/m_Do/m_Do_MemCardRWmng.cpp
|
||||
src/m_Do/m_Do_machine_exception.cpp
|
||||
src/m_Do/m_Do_hostIO.cpp
|
||||
src/c/c_damagereaction.cpp
|
||||
src/c/c_dylink.cpp
|
||||
@@ -315,7 +314,7 @@ set(SSYSTEM_FILES
|
||||
src/SSystem/SStandard/s_basic.cpp
|
||||
)
|
||||
|
||||
set(JSYSTEM_DEBUG_FILES
|
||||
add_library(JSystem_JParticle STATIC
|
||||
libs/JSystem/src/JParticle/JPAResourceManager.cpp
|
||||
libs/JSystem/src/JParticle/JPAResource.cpp
|
||||
libs/JSystem/src/JParticle/JPABaseShape.cpp
|
||||
@@ -331,10 +330,19 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JParticle/JPAEmitter.cpp
|
||||
libs/JSystem/src/JParticle/JPAParticle.cpp
|
||||
libs/JSystem/src/JParticle/JPAMath.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JFramework STATIC
|
||||
libs/JSystem/src/JFramework/JFWSystem.cpp
|
||||
libs/JSystem/src/JFramework/JFWDisplay.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_J3DU STATIC
|
||||
libs/JSystem/src/J3DU/J3DUClipper.cpp
|
||||
libs/JSystem/src/J3DU/J3DUDL.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JKernel STATIC
|
||||
libs/JSystem/src/JKernel/JKRHeap.cpp
|
||||
libs/JSystem/src/JKernel/JKRExpHeap.cpp
|
||||
libs/JSystem/src/JKernel/JKRSolidHeap.cpp
|
||||
@@ -360,14 +368,23 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JKernel/JKRDvdRipper.cpp
|
||||
libs/JSystem/src/JKernel/JKRDvdAramRipper.cpp
|
||||
libs/JSystem/src/JKernel/JKRDecomp.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JMath STATIC
|
||||
libs/JSystem/src/JMath/JMath.cpp
|
||||
libs/JSystem/src/JMath/random.cpp
|
||||
libs/JSystem/src/JMath/JMATrigonometric.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JSupport STATIC
|
||||
libs/JSystem/src/JSupport/JSUList.cpp
|
||||
libs/JSystem/src/JSupport/JSUInputStream.cpp
|
||||
libs/JSystem/src/JSupport/JSUOutputStream.cpp
|
||||
libs/JSystem/src/JSupport/JSUMemoryStream.cpp
|
||||
libs/JSystem/src/JSupport/JSUFileStream.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JUtility STATIC
|
||||
libs/JSystem/src/JUtility/JUTCacheFont.cpp
|
||||
libs/JSystem/src/JUtility/JUTResource.cpp
|
||||
libs/JSystem/src/JUtility/JUTTexture.cpp
|
||||
@@ -388,6 +405,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JUtility/JUTConsole.cpp
|
||||
libs/JSystem/src/JUtility/JUTDirectFile.cpp
|
||||
libs/JSystem/src/JUtility/JUTFontData_Ascfont_fix12.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JStage STATIC
|
||||
libs/JSystem/src/JStage/JSGActor.cpp
|
||||
libs/JSystem/src/JStage/JSGAmbientLight.cpp
|
||||
libs/JSystem/src/JStage/JSGCamera.cpp
|
||||
@@ -395,6 +415,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JStage/JSGLight.cpp
|
||||
libs/JSystem/src/JStage/JSGObject.cpp
|
||||
libs/JSystem/src/JStage/JSGSystem.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_J2DGraph STATIC
|
||||
libs/JSystem/src/J2DGraph/J2DGrafContext.cpp
|
||||
libs/JSystem/src/J2DGraph/J2DOrthoGraph.cpp
|
||||
libs/JSystem/src/J2DGraph/J2DTevs.cpp
|
||||
@@ -413,6 +436,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/J2DGraph/J2DAnmLoader.cpp
|
||||
libs/JSystem/src/J2DGraph/J2DAnimation.cpp
|
||||
libs/JSystem/src/J2DGraph/J2DManage.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_J3DGraphBase STATIC
|
||||
libs/JSystem/src/J3DGraphBase/J3DGD.cpp
|
||||
libs/JSystem/src/J3DGraphBase/J3DSys.cpp
|
||||
libs/JSystem/src/J3DGraphBase/J3DVertex.cpp
|
||||
@@ -427,6 +453,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/J3DGraphBase/J3DTevs.cpp
|
||||
libs/JSystem/src/J3DGraphBase/J3DDrawBuffer.cpp
|
||||
libs/JSystem/src/J3DGraphBase/J3DStruct.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_J3DGraphAnimator STATIC
|
||||
libs/JSystem/src/J3DGraphAnimator/J3DShapeTable.cpp
|
||||
libs/JSystem/src/J3DGraphAnimator/J3DJointTree.cpp
|
||||
libs/JSystem/src/J3DGraphAnimator/J3DModelData.cpp
|
||||
@@ -438,6 +467,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/J3DGraphAnimator/J3DCluster.cpp
|
||||
libs/JSystem/src/J3DGraphAnimator/J3DJoint.cpp
|
||||
libs/JSystem/src/J3DGraphAnimator/J3DMaterialAttach.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_J3DGraphLoader STATIC
|
||||
libs/JSystem/src/J3DGraphLoader/J3DMaterialFactory.cpp
|
||||
libs/JSystem/src/J3DGraphLoader/J3DMaterialFactory_v21.cpp
|
||||
libs/JSystem/src/J3DGraphLoader/J3DClusterLoader.cpp
|
||||
@@ -446,6 +478,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/J3DGraphLoader/J3DJointFactory.cpp
|
||||
libs/JSystem/src/J3DGraphLoader/J3DShapeFactory.cpp
|
||||
libs/JSystem/src/J3DGraphLoader/J3DAnmLoader.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JStudio STATIC
|
||||
libs/JSystem/src/JStudio/JStudio/ctb.cpp
|
||||
libs/JSystem/src/JStudio/JStudio/ctb-data.cpp
|
||||
libs/JSystem/src/JStudio/JStudio/functionvalue.cpp
|
||||
@@ -460,6 +495,9 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JStudio/JStudio/stb.cpp
|
||||
libs/JSystem/src/JStudio/JStudio/stb-data-parse.cpp
|
||||
libs/JSystem/src/JStudio/JStudio/stb-data.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JStudio_JStage STATIC
|
||||
libs/JSystem/src/JStudio/JStudio_JStage/control.cpp
|
||||
libs/JSystem/src/JStudio/JStudio_JStage/object.cpp
|
||||
libs/JSystem/src/JStudio/JStudio_JStage/object-actor.cpp
|
||||
@@ -467,10 +505,19 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JStudio/JStudio_JStage/object-camera.cpp
|
||||
libs/JSystem/src/JStudio/JStudio_JStage/object-fog.cpp
|
||||
libs/JSystem/src/JStudio/JStudio_JStage/object-light.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JStudio_JAudio2 STATIC
|
||||
libs/JSystem/src/JStudio/JStudio_JAudio2/control.cpp
|
||||
libs/JSystem/src/JStudio/JStudio_JAudio2/object-sound.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JStudio_JParticle STATIC
|
||||
libs/JSystem/src/JStudio/JStudio_JParticle/control.cpp
|
||||
libs/JSystem/src/JStudio/JStudio_JParticle/object-particle.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JAudio2 STATIC
|
||||
libs/JSystem/src/JAudio2/JASCalc.cpp
|
||||
libs/JSystem/src/JAudio2/JASTaskThread.cpp
|
||||
libs/JSystem/src/JAudio2/JASDvdThread.cpp
|
||||
@@ -535,22 +582,34 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JAudio2/JAUSoundAnimator.cpp
|
||||
libs/JSystem/src/JAudio2/JAUSoundTable.cpp
|
||||
libs/JSystem/src/JAudio2/JAUStreamFileTable.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JMessage STATIC
|
||||
libs/JSystem/src/JMessage/control.cpp
|
||||
libs/JSystem/src/JMessage/data.cpp
|
||||
libs/JSystem/src/JMessage/processor.cpp
|
||||
libs/JSystem/src/JMessage/resource.cpp
|
||||
libs/JSystem/src/JMessage/locale.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JGadget STATIC
|
||||
libs/JSystem/src/JGadget/binary.cpp
|
||||
libs/JSystem/src/JGadget/define.cpp
|
||||
libs/JSystem/src/JGadget/linklist.cpp
|
||||
libs/JSystem/src/JGadget/search.cpp
|
||||
libs/JSystem/src/JGadget/std-vector.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JAHostIO STATIC
|
||||
libs/JSystem/src/JAHostIO/JAHFrameNode.cpp
|
||||
libs/JSystem/src/JAHostIO/JAHioMessage.cpp
|
||||
libs/JSystem/src/JAHostIO/JAHioMgr.cpp
|
||||
libs/JSystem/src/JAHostIO/JAHioNode.cpp
|
||||
libs/JSystem/src/JAHostIO/JAHioUtil.cpp
|
||||
libs/JSystem/src/JAHostIO/JAHVirtualNode.cpp
|
||||
)
|
||||
|
||||
add_library(JSystem_JHostIO STATIC
|
||||
libs/JSystem/src/JHostIO/JORFile.cpp
|
||||
libs/JSystem/src/JHostIO/JORHostInfo.cpp
|
||||
libs/JSystem/src/JHostIO/JORMessageBox.cpp
|
||||
@@ -560,7 +619,28 @@ set(JSYSTEM_DEBUG_FILES
|
||||
libs/JSystem/src/JHostIO/JHIMccBuf.cpp
|
||||
)
|
||||
|
||||
set(JSYSTEM_FILES
|
||||
set(JSYSTEM_LIBRARIES
|
||||
JSystem_JParticle
|
||||
JSystem_JFramework
|
||||
JSystem_J3DU
|
||||
JSystem_JKernel
|
||||
JSystem_JMath
|
||||
JSystem_JSupport
|
||||
JSystem_JUtility
|
||||
JSystem_JStage
|
||||
JSystem_J2DGraph
|
||||
JSystem_J3DGraphBase
|
||||
JSystem_J3DGraphAnimator
|
||||
JSystem_J3DGraphLoader
|
||||
JSystem_JStudio
|
||||
JSystem_JStudio_JStage
|
||||
JSystem_JStudio_JAudio2
|
||||
JSystem_JStudio_JParticle
|
||||
JSystem_JAudio2
|
||||
JSystem_JMessage
|
||||
JSystem_JGadget
|
||||
JSystem_JAHostIO
|
||||
JSystem_JHostIO
|
||||
)
|
||||
|
||||
set(REL_FILES
|
||||
@@ -1334,6 +1414,7 @@ set(DUSK_FILES
|
||||
include/dusk/endian_gx.hpp
|
||||
include/dusk/config.hpp
|
||||
include/dusk/dvd_asset.hpp
|
||||
include/dusk/scope_guard.hpp
|
||||
src/dusk/dvd_asset.cpp
|
||||
src/d/actor/d_a_alink_dusk.cpp
|
||||
src/dusk/asserts.cpp
|
||||
@@ -1341,10 +1422,14 @@ set(DUSK_FILES
|
||||
src/dusk/crash_reporting.cpp
|
||||
src/dusk/endian.cpp
|
||||
src/dusk/extras.c
|
||||
src/dusk/extras.cpp
|
||||
src/dusk/file_select.cpp
|
||||
src/dusk/file_select.hpp
|
||||
src/dusk/frame_interpolation.cpp
|
||||
src/dusk/game_clock.cpp
|
||||
src/dusk/globals.cpp
|
||||
src/dusk/gyro_aim.cpp
|
||||
src/dusk/gyro.cpp
|
||||
src/dusk/gamepad_color.cpp
|
||||
src/dusk/autosave.cpp
|
||||
src/dusk/io.cpp
|
||||
src/dusk/layout.cpp
|
||||
src/dusk/logging.cpp
|
||||
@@ -1358,10 +1443,10 @@ set(DUSK_FILES
|
||||
src/dusk/imgui/ImGuiEngine.hpp
|
||||
src/dusk/imgui/ImGuiMenuGame.cpp
|
||||
src/dusk/imgui/ImGuiMenuGame.hpp
|
||||
src/dusk/imgui/ImGuiBloomWindow.cpp
|
||||
src/dusk/imgui/ImGuiBloomWindow.hpp
|
||||
src/dusk/imgui/ImGuiMenuTools.cpp
|
||||
src/dusk/imgui/ImGuiMenuTools.hpp
|
||||
src/dusk/imgui/ImGuiMenuEnhancements.cpp
|
||||
src/dusk/imgui/ImGuiMenuEnhancements.hpp
|
||||
src/dusk/imgui/ImGuiPreLaunchWindow.cpp
|
||||
src/dusk/imgui/ImGuiPreLaunchWindow.hpp
|
||||
src/dusk/imgui/ImGuiFirstRunPreset.hpp
|
||||
@@ -1376,8 +1461,57 @@ set(DUSK_FILES
|
||||
src/dusk/imgui/ImGuiSaveEditor.cpp
|
||||
src/dusk/imgui/ImGuiStateShare.hpp
|
||||
src/dusk/imgui/ImGuiStateShare.cpp
|
||||
src/dusk/imgui/ImGuiAchievements.hpp
|
||||
src/dusk/imgui/ImGuiAchievements.cpp
|
||||
src/dusk/ui/bool_button.cpp
|
||||
src/dusk/ui/bool_button.hpp
|
||||
src/dusk/ui/button.cpp
|
||||
src/dusk/ui/button.hpp
|
||||
src/dusk/ui/component.cpp
|
||||
src/dusk/ui/component.hpp
|
||||
src/dusk/ui/controller_config.cpp
|
||||
src/dusk/ui/controller_config.hpp
|
||||
src/dusk/ui/document.cpp
|
||||
src/dusk/ui/document.hpp
|
||||
src/dusk/ui/editor.cpp
|
||||
src/dusk/ui/editor.hpp
|
||||
src/dusk/ui/event.cpp
|
||||
src/dusk/ui/event.hpp
|
||||
src/dusk/ui/input.cpp
|
||||
src/dusk/ui/input.hpp
|
||||
src/dusk/ui/nav_types.hpp
|
||||
src/dusk/ui/number_button.cpp
|
||||
src/dusk/ui/number_button.hpp
|
||||
src/dusk/ui/overlay.cpp
|
||||
src/dusk/ui/overlay.hpp
|
||||
src/dusk/ui/pane.cpp
|
||||
src/dusk/ui/pane.hpp
|
||||
src/dusk/ui/popup.cpp
|
||||
src/dusk/ui/popup.hpp
|
||||
src/dusk/ui/prelaunch.cpp
|
||||
src/dusk/ui/prelaunch.hpp
|
||||
src/dusk/ui/prelaunch_options.cpp
|
||||
src/dusk/ui/prelaunch_options.hpp
|
||||
src/dusk/ui/select_button.cpp
|
||||
src/dusk/ui/select_button.hpp
|
||||
src/dusk/ui/settings.cpp
|
||||
src/dusk/ui/settings.hpp
|
||||
src/dusk/ui/string_button.cpp
|
||||
src/dusk/ui/string_button.hpp
|
||||
src/dusk/ui/tab_bar.cpp
|
||||
src/dusk/ui/tab_bar.hpp
|
||||
src/dusk/ui/ui.cpp
|
||||
src/dusk/ui/ui.hpp
|
||||
src/dusk/ui/window.cpp
|
||||
src/dusk/ui/window.hpp
|
||||
src/dusk/achievements.cpp
|
||||
src/dusk/iso_validate.cpp
|
||||
src/dusk/livesplit.cpp
|
||||
src/dusk/offset_ptr.cpp
|
||||
src/dusk/OSContext.cpp
|
||||
src/dusk/OSReport.cpp
|
||||
src/dusk/OSThread.cpp
|
||||
src/dusk/OSMutex.cpp
|
||||
src/dusk/discord_presence.cpp
|
||||
src/dusk/version.cpp
|
||||
)
|
||||
|
||||
Generated
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1775710090,
|
||||
"narHash": "sha256-ar3rofg+awPB8QXDaFJhJ2jJhu+KqN/PRCXeyuXR76E=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4c1018dae018162ec878d42fec712642d214fdfa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
};
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||
dusk = pkgs.stdenv.mkDerivation {
|
||||
name = "dusk";
|
||||
src = ./.;
|
||||
nativeBuildInputs = [
|
||||
pkgs.cmake
|
||||
pkgs.pkg-config
|
||||
pkgs.wayland
|
||||
];
|
||||
buildInputs = [
|
||||
pkgs.libGL
|
||||
pkgs.libX11
|
||||
pkgs.libXcursor
|
||||
pkgs.libxi
|
||||
pkgs.libxcb
|
||||
pkgs.libxrandr
|
||||
pkgs.libxscrnsaver
|
||||
pkgs.libxtst
|
||||
pkgs.libjpeg8
|
||||
pkgs.libxkbcommon
|
||||
pkgs.libglvnd
|
||||
];
|
||||
};
|
||||
in {
|
||||
packages.x86_64-linux.default = dusk;
|
||||
};
|
||||
}
|
||||
@@ -39,6 +39,10 @@ enum Z2WolfHowlCurveID {
|
||||
Z2WOLFHOWL_NEWSONG2,
|
||||
Z2WOLFHOWL_NEWSONG3,
|
||||
|
||||
#if TARGET_PC
|
||||
Z2WOLFHOWL_TIMESONG,
|
||||
#endif
|
||||
|
||||
Z2WOLFHOWL_MAX
|
||||
};
|
||||
|
||||
|
||||
@@ -4549,8 +4549,9 @@ public:
|
||||
/* 0x03850 */ daAlink_procFunc mpProcFunc;
|
||||
|
||||
#if TARGET_PC
|
||||
void handleWolfHowl();
|
||||
void handleQuickTransform();
|
||||
bool checkGyroAimItemContext();
|
||||
bool checkGyroAimContext();
|
||||
#endif
|
||||
}; // Size: 0x385C
|
||||
|
||||
|
||||
@@ -188,6 +188,15 @@ public:
|
||||
/* 0x273C */ f32 mKankyoBlend;
|
||||
/* 0x2740 */ u8 field_0x2740;
|
||||
/* 0x2744 */ dMsgFlow_c mMsgFlow;
|
||||
#if TARGET_PC
|
||||
cXyz mReinsInterpPrev[2][16];
|
||||
cXyz mReinsInterpCurr[2][16];
|
||||
cXyz mReinsTexInterpPrev[2];
|
||||
cXyz mReinsTexInterpCurr[2];
|
||||
bool mReinsInterpPrevValid;
|
||||
bool mReinsInterpCurrValid;
|
||||
s8 mDemoCamSyncTicks;
|
||||
#endif
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(b_gnd_class) == 0x2790);
|
||||
|
||||
@@ -44,6 +44,9 @@ public:
|
||||
int draw();
|
||||
int execute();
|
||||
void drawMeter();
|
||||
#if TARGET_PC
|
||||
void updateOnWide();
|
||||
#endif
|
||||
void setComboCount(u8, u8);
|
||||
void setScoreCount(u32);
|
||||
void addScoreCount(cXyz*, u32, u8);
|
||||
|
||||
@@ -44,6 +44,12 @@ public:
|
||||
/* 0x88C */ u8 field_0x88C[0x8C8 - 0x88C];
|
||||
/* 0x8C8 */ s8 field_0x8c8;
|
||||
/* 0x8C9 */ u8 mInitHIO;
|
||||
#if TARGET_PC
|
||||
cXyz mRopeInterpPrev[16];
|
||||
cXyz mRopeInterpCurr[16];
|
||||
bool mRopeInterpPrevValid;
|
||||
bool mRopeInterpCurrValid;
|
||||
#endif
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(e_mb_class) == 0x8cc);
|
||||
|
||||
@@ -220,6 +220,15 @@ public:
|
||||
/* 0x17E2 */ s16 wait_roll_angle; ///< @brief Roll angle during wait state.
|
||||
/* 0x17E4 */ u8 field_0x17e4[0x17e8 - 0x17e4];
|
||||
/* 0x17E8 */ f32 ride_speed_max; ///< @brief Speed rate for riding calculations.
|
||||
#if TARGET_PC
|
||||
cXyz himo_mat_interp_prev[2][16];
|
||||
cXyz himo_mat_interp_curr[2][16];
|
||||
cXyz himo_tex_interp_prev[2];
|
||||
cXyz himo_tex_interp_curr[2];
|
||||
bool himo_interp_prev_valid;
|
||||
bool himo_interp_curr_valid;
|
||||
s8 demo_cam_sync_ticks;
|
||||
#endif
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(e_wb_class) == 0x17EC);
|
||||
|
||||
@@ -25,6 +25,10 @@ public:
|
||||
/* 0x164 */ cXyz mMinVal;
|
||||
/* 0x170 */ cXyz mMaxVal;
|
||||
/* 0x17C */ cXyz mViewScale;
|
||||
#if TARGET_PC
|
||||
bool mbReset = false;
|
||||
bool mbHadEntry = false;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -94,6 +94,12 @@ static void __THPAudioInitialize(THPAudioDecodeInfo* info, u8* ptr);
|
||||
#define THP_TEXTURE_SET_COUNT 3
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
namespace dusk {
|
||||
void MoviePlayerShutdown();
|
||||
}
|
||||
#endif
|
||||
|
||||
struct daMP_THPPlayer {
|
||||
/* 0x000 */ DVDFileInfo fileInfo;
|
||||
/* 0x03C */ THPHeader header;
|
||||
|
||||
@@ -25,6 +25,10 @@ public:
|
||||
int Draw();
|
||||
int Delete();
|
||||
|
||||
#if TARGET_PC
|
||||
void onInterpCallback();
|
||||
#endif
|
||||
|
||||
enum Param_e {
|
||||
LOCK_e = (1 << 6), NO_BASE_DISP = (1 << 7)
|
||||
};
|
||||
@@ -50,6 +54,13 @@ private:
|
||||
/* 0x1020 */ dCcD_Cyl mCylinderCollider;
|
||||
/* 0x115C */ s32 mStopSwingingFrames;
|
||||
|
||||
#if TARGET_PC
|
||||
cXyz mChainInterpPrev[64];
|
||||
cXyz mChainInterpCurr[64];
|
||||
bool mChainInterpPrevValid;
|
||||
bool mChainInterpCurrValid;
|
||||
#endif
|
||||
|
||||
// Number of chain models
|
||||
u32 getArg0() {
|
||||
return fopAcM_GetParamBit(this, 0, 6);
|
||||
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
void setNextPoint();
|
||||
int Draw();
|
||||
int Delete();
|
||||
#if TARGET_PC
|
||||
friend void daL8Lift_interp_callback(bool isSimFrame, void* pUserWork);
|
||||
#endif
|
||||
|
||||
u8 getPthID() { return fopAcM_GetParamBit(this, 0, 8); }
|
||||
u8 getMoveSpeed() { return fopAcM_GetParamBit(this, 8, 4); }
|
||||
|
||||
@@ -68,10 +68,8 @@ public:
|
||||
/* 0x904 */ cXyz field_0x904[2];
|
||||
/* 0x91C */ int field_0x91c;
|
||||
/* 0x920 */ cXyz field_0x920[63];
|
||||
/* 0xC14 */ f32 field_0xc14[4];
|
||||
/* 0xC24 */ u8 field_0xc24[0xd10 - 0xc24];
|
||||
/* 0xD10 */ s8 field_0xd10[4];
|
||||
/* 0xD14 */ u8 field_0xd14[0xd50 - 0xd14];
|
||||
/* 0xC14 */ f32 field_0xc14[63];
|
||||
/* 0xD10 */ s8 field_0xd10[64];
|
||||
/* 0xD50 */ mDoExt_3DlineMat1_c field_0xd50;
|
||||
/* 0xD8C */ int field_0xd8c;
|
||||
};
|
||||
|
||||
@@ -143,6 +143,12 @@ public:
|
||||
/* 0x20 */ JORFile mFile;
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
/* 0x24 */ u8 mManualMode;
|
||||
/* 0x25 */ f32 freeXAngle;
|
||||
/* 0x29 */ f32 freeYAngle;
|
||||
#endif
|
||||
|
||||
u32 Id(s32 i_style) { return mCamStyleData[i_style].field_0x0; }
|
||||
int Algorythmn(s32 i_style) { return mCamStyleData[i_style].field_0x4; }
|
||||
int Algorythmn() { return mCurrentStyle->field_0x4; }
|
||||
|
||||
@@ -273,6 +273,8 @@ public:
|
||||
/* 0xA4 */ f32 field_0xa4;
|
||||
/* 0xA8 */ int field_0xa8;
|
||||
/* 0xAC */ f32 field_0xac;
|
||||
f32 xAngle;
|
||||
f32 yAngle;
|
||||
};
|
||||
|
||||
struct LockOnData {
|
||||
@@ -1024,6 +1026,9 @@ public:
|
||||
bool colosseumCamera(s32);
|
||||
bool test1Camera(s32);
|
||||
bool test2Camera(s32);
|
||||
#if TARGET_PC
|
||||
bool freeCamera();
|
||||
#endif
|
||||
bool towerCamera(s32);
|
||||
bool hookshotCamera(s32);
|
||||
bool railCamera(s32);
|
||||
|
||||
@@ -4834,8 +4834,7 @@ inline void dComIfGd_drawXluListDark() {
|
||||
inline void dComIfGd_drawXluListInvisible() {
|
||||
ZoneScoped;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableWaterRefraction &&
|
||||
!dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (!dusk::getSettings().game.disableWaterRefraction) {
|
||||
#endif
|
||||
g_dComIfG_gameInfo.drawlist.drawXluListInvisible();
|
||||
#ifdef TARGET_PC
|
||||
@@ -4846,8 +4845,7 @@ inline void dComIfGd_drawXluListInvisible() {
|
||||
inline void dComIfGd_drawOpaListInvisible() {
|
||||
ZoneScoped;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableWaterRefraction &&
|
||||
!dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (!dusk::getSettings().game.disableWaterRefraction) {
|
||||
#endif
|
||||
g_dComIfG_gameInfo.drawlist.drawOpaListInvisible();
|
||||
#ifdef TARGET_PC
|
||||
|
||||
@@ -209,6 +209,10 @@ public:
|
||||
/* 0x04 */ TGXTexObj* mpTexObj;
|
||||
/* 0x08 */ Mtx mVolumeMtx;
|
||||
/* 0x38 */ Mtx mMtx;
|
||||
#if TARGET_PC
|
||||
const void* mVolumeMtxKey;
|
||||
const void* mMtxKey;
|
||||
#endif
|
||||
}; // Size: 0x68
|
||||
|
||||
struct cBgD_Vtx_t;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
|
||||
|
||||
class dFile_info_c;
|
||||
class J2DPicture;
|
||||
|
||||
class dDlst_FileSel_c : public dDlst_base_c {
|
||||
public:
|
||||
@@ -113,6 +114,14 @@ public:
|
||||
/* 0x04 */ J2DScreen* Scr3m;
|
||||
};
|
||||
|
||||
class dDlst_FileSelFade_c : public dDlst_base_c {
|
||||
public:
|
||||
void draw();
|
||||
virtual ~dDlst_FileSelFade_c() {}
|
||||
|
||||
/* 0x04 */ J2DPicture* mpPict;
|
||||
};
|
||||
|
||||
class dFs_HIO_c : public JORReflexible {
|
||||
public:
|
||||
dFs_HIO_c();
|
||||
@@ -676,6 +685,9 @@ public:
|
||||
#if PLATFORM_GCN
|
||||
/* 0x2378 */ J2DPicture* mpFadePict;
|
||||
#endif
|
||||
#ifdef TARGET_PC
|
||||
dDlst_FileSelFade_c mFadeDlst;
|
||||
#endif
|
||||
|
||||
#if PLATFORM_WII || PLATFORM_SHIELD
|
||||
/* 0x2376 */ u8 field_0x2376[SAVEFILE_SIZE];
|
||||
@@ -684,6 +696,10 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef TARGET_PC
|
||||
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C + sizeof(dDlst_FileSelFade_c));
|
||||
#else
|
||||
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C);
|
||||
#endif
|
||||
|
||||
#endif /* D_FILE_D_FILE_SELECT_H */
|
||||
|
||||
@@ -91,6 +91,10 @@ public:
|
||||
void calcCursor();
|
||||
void drawCursor();
|
||||
|
||||
#if TARGET_PC
|
||||
void dMapBgWide();
|
||||
#endif
|
||||
|
||||
void setDPDFloorSelCurPos(s8 i_pos) { field_0xdd6 = i_pos; }
|
||||
|
||||
f32 getMapWidth() { return mMapWidth; }
|
||||
@@ -103,6 +107,10 @@ public:
|
||||
field_0xd98 = param_1;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void resetScrollArrowMask() { field_0xdda = 0; }
|
||||
#endif
|
||||
|
||||
/* 0xC98 */ JKRExpHeap* mpHeap;
|
||||
/* 0xC9C */ JKRExpHeap* mpTalkHeap;
|
||||
/* 0xCA0 */ STControl* mpStick;
|
||||
|
||||
@@ -75,7 +75,9 @@ public:
|
||||
/* 0x8 */ BE(u16) mAreaName;
|
||||
/* 0xA */ u8 mCount;
|
||||
#ifdef _MSVC_LANG
|
||||
u8* __get_mRoomNos() const { return (u8*)(this + 1); }
|
||||
// Room numbers start at offset 0xB (right after mCount), NOT at sizeof(data)=12.
|
||||
// (u8*)(this+1) would give offset 12 because MSVC sizeof=12; use &mCount+1 instead.
|
||||
u8* __get_mRoomNos() const { return (u8*)&mCount + 1; }
|
||||
__declspec(property(get = __get_mRoomNos)) u8* mRoomNos;
|
||||
#else
|
||||
/* 0xB */ u8 mRoomNos[0];
|
||||
|
||||
@@ -81,6 +81,10 @@ public:
|
||||
void calcDrawPriority();
|
||||
void setArrowPosAxis(f32, f32);
|
||||
|
||||
#if TARGET_PC
|
||||
void fMapBackWide();
|
||||
#endif
|
||||
|
||||
virtual void draw();
|
||||
virtual ~dMenu_Fmap2DBack_c();
|
||||
|
||||
@@ -330,6 +334,10 @@ public:
|
||||
void setHIO(bool);
|
||||
bool isWarpAccept();
|
||||
|
||||
#if TARGET_PC
|
||||
void fMapTopWide();
|
||||
#endif
|
||||
|
||||
virtual void draw();
|
||||
virtual ~dMenu_Fmap2DTop_c();
|
||||
|
||||
|
||||
@@ -204,6 +204,18 @@ private:
|
||||
/* 0x6D1 */ u8 field_0x6d1;
|
||||
/* 0x6D2 */ u8 field_0x6d2;
|
||||
/* 0x6D3 */ u8 field_0x6d3;
|
||||
#if TARGET_PC
|
||||
f32 mSelectItemSlideElapsed[4];
|
||||
f32 mCursorInterpPrevX;
|
||||
f32 mCursorInterpPrevY;
|
||||
f32 mCursorInterpCurrX;
|
||||
f32 mCursorInterpCurrY;
|
||||
s16 mCursorInterpPrevAngle;
|
||||
s16 mCursorInterpCurrAngle;
|
||||
bool mCursorInterpPrevAngular;
|
||||
bool mCursorInterpCurrAngular;
|
||||
bool mCursorInterpInit;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* D_MENU_D_MENU_RING_H */
|
||||
|
||||
@@ -343,6 +343,11 @@ public:
|
||||
/* 0x624 */ f32 mMidonaPosX;
|
||||
/* 0x628 */ f32 mMidonaPosY;
|
||||
/* 0x62C */ f32 mMidonaScale;
|
||||
|
||||
#ifdef TARGET_PC
|
||||
bool mWasListen[2];
|
||||
bool mWasRepeat[2];
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* D_METER_D_METER_BUTTON_H */
|
||||
|
||||
@@ -67,6 +67,9 @@ public:
|
||||
bool isStaffMessage();
|
||||
bool isSaveMessage();
|
||||
bool isTalkMessage();
|
||||
#if TARGET_PC
|
||||
bool isShopItemMessage();
|
||||
#endif
|
||||
const char* getSmellName();
|
||||
const char* getPortalName();
|
||||
const char* getBombName();
|
||||
|
||||
@@ -110,6 +110,10 @@ struct dMsgScrnHowl_c : public dMsgScrnBase_c {
|
||||
/* 0x27A0 */ f32 field_0x27a0;
|
||||
/* 0x27A4 */ f32 field_0x27a4;
|
||||
/* 0x27A8 */ f32 field_0x27a8;
|
||||
|
||||
#if TARGET_PC
|
||||
u8 showCursor;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* MSG_SCRN_D_MSG_SCRN_HOWL_H */
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public:
|
||||
void MojiSelectAnm3();
|
||||
int mojiChange(u8);
|
||||
void selectMojiSet();
|
||||
#if REGION_JPN
|
||||
#if TARGET_PC || REGION_JPN
|
||||
int checkDakuon(int, u8);
|
||||
int setDakuon(int, u8);
|
||||
#endif
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
bool isProgressiveMode();
|
||||
void setRenderMode();
|
||||
|
||||
#if VERSION == VERSION_GCN_PAL || PLATFORM_WII || PLATFORM_SHIELD
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL || PLATFORM_WII || PLATFORM_SHIELD
|
||||
u8 getPalLanguage();
|
||||
#endif
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
/* 0x200 */ dDlst_2D_c* mNvLogo;
|
||||
/* 0x204 */ dDlst_2D_c* mMocImg;
|
||||
#endif
|
||||
#if VERSION == VERSION_GCN_PAL
|
||||
#if TARGET_PC || VERSION == VERSION_GCN_PAL
|
||||
/* 0x1FC */ mDoDvdThd_mountArchive_c* mpPalLogoResCommand;
|
||||
#endif
|
||||
/* 0x1FC */ request_of_phase_process_class* m_preLoad_dylPhase;
|
||||
|
||||
+18
-6
@@ -487,19 +487,31 @@ public:
|
||||
}
|
||||
}
|
||||
char* getPlayerName() const { return const_cast<char*>(mPlayerName); }
|
||||
void setPlayerName(const char* i_name) { strcpy(mPlayerName, i_name); }
|
||||
void setPlayerName(const char* i_name) {
|
||||
#if AVOID_UB
|
||||
strncpy(mPlayerName, i_name, sizeof(mPlayerName) - 1);
|
||||
mPlayerName[sizeof(mPlayerName) - 1] = '\0';
|
||||
#else
|
||||
strcpy(mPlayerName, i_name);
|
||||
#endif
|
||||
}
|
||||
char* getHorseName() const { return const_cast<char*>(mHorseName); }
|
||||
void setHorseName(const char* i_name) { strcpy(mHorseName, i_name); }
|
||||
void setHorseName(const char* i_name) {
|
||||
#if AVOID_UB
|
||||
strncpy(mHorseName, i_name, sizeof(mHorseName) - 1);
|
||||
mHorseName[sizeof(mHorseName) - 1] = '\0';
|
||||
#else
|
||||
strcpy(mHorseName, i_name);
|
||||
#endif
|
||||
}
|
||||
u8 getClearCount() const { return mClearCount; }
|
||||
|
||||
/* 0x00 */ BE(u64) unk0;
|
||||
/* 0x08 */ BE(s64) mTotalTime;
|
||||
/* 0x10 */ BE(u16) unk16;
|
||||
/* 0x12 */ BE(u16) mDeathCount;
|
||||
/* 0x14 */ char mPlayerName[16];
|
||||
/* 0x24 */ u8 unk36;
|
||||
/* 0x25 */ char mHorseName[16];
|
||||
/* 0x35 */ u8 unk53;
|
||||
/* 0x14 */ char mPlayerName[17];
|
||||
/* 0x25 */ char mHorseName[17];
|
||||
/* 0x36 */ u8 mClearCount;
|
||||
/* 0x37 */ u8 unk55[5];
|
||||
}; // Size: 0x40
|
||||
|
||||
@@ -47,6 +47,13 @@ public:
|
||||
mPositionY = y;
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
f32 getPositionX() const { return mPositionX; }
|
||||
f32 getPositionY() const { return mPositionY; }
|
||||
|
||||
void refreshAspectScale();
|
||||
#endif
|
||||
|
||||
void onUpdateFlag() { mUpdateFlag = true; }
|
||||
|
||||
void resetUpdateFlag() { mUpdateFlag = false; }
|
||||
@@ -79,6 +86,9 @@ private:
|
||||
/* 0x58 */ f32 mPositionX;
|
||||
/* 0x5C */ f32 mPositionY;
|
||||
/* 0x60 */ f32 mParam1;
|
||||
#ifdef TARGET_PC
|
||||
f32 mBaseParam1;
|
||||
#endif
|
||||
/* 0x64 */ f32 mParam2;
|
||||
/* 0x68 */ f32 mParam3;
|
||||
/* 0x6C */ f32 mParam4;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include "nlohmann/json.hpp"
|
||||
|
||||
namespace dusk {
|
||||
|
||||
enum class AchievementCategory : uint8_t {
|
||||
Story,
|
||||
Collection,
|
||||
Challenge,
|
||||
Minigame,
|
||||
Misc,
|
||||
Glitched
|
||||
};
|
||||
|
||||
struct Achievement {
|
||||
const char* key;
|
||||
const char* name;
|
||||
const char* description;
|
||||
AchievementCategory category;
|
||||
bool isCounter;
|
||||
int32_t goal;
|
||||
int32_t progress;
|
||||
bool unlocked;
|
||||
};
|
||||
|
||||
// Responsible for updating a.progress.
|
||||
// Use extra for any per-achievement state that must survive across frames or sessions, extra is saved
|
||||
using AchievementCheckFn = std::function<void(Achievement& a, nlohmann::json& extra)>;
|
||||
|
||||
class AchievementSystem {
|
||||
public:
|
||||
static AchievementSystem& get();
|
||||
|
||||
void load();
|
||||
void save();
|
||||
void tick();
|
||||
void clearAll();
|
||||
void clearOne(const char* key);
|
||||
|
||||
// Signals are visible to all achievement checks within the same tick, then cleared.
|
||||
void signal(const char* key);
|
||||
bool hasSignal(const char* key) const;
|
||||
|
||||
std::vector<Achievement> getAchievements() const;
|
||||
bool hasPendingUnlock() const { return !m_pendingUnlocks.empty(); }
|
||||
std::string consumePendingUnlock();
|
||||
|
||||
private:
|
||||
struct Entry {
|
||||
Achievement achievement;
|
||||
AchievementCheckFn check;
|
||||
nlohmann::json extra;
|
||||
};
|
||||
|
||||
AchievementSystem();
|
||||
static std::vector<Entry> makeEntries();
|
||||
void processEntry(Entry& e);
|
||||
|
||||
std::vector<Entry> m_entries;
|
||||
std::unordered_set<std::string_view> m_signals;
|
||||
bool m_loaded = false;
|
||||
bool m_dirty = false;
|
||||
std::queue<std::string> m_pendingUnlocks;
|
||||
};
|
||||
|
||||
} // namespace dusk
|
||||
@@ -12,6 +12,8 @@ namespace dusk::audio {
|
||||
|
||||
void SetMasterVolume(f32 value);
|
||||
|
||||
void SetPaused(bool paused);
|
||||
|
||||
u32 GetResetCount(int channelIdx);
|
||||
|
||||
f32 VolumeFromU16(u16 value);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef AUTOSAVE_H
|
||||
#define AUTOSAVE_H
|
||||
|
||||
#include <m_Do/m_Do_MemCardRWmng.h>
|
||||
#include <m_Do/m_Do_MemCard.h>
|
||||
|
||||
void noAutoSave();
|
||||
void triggerAutoSave();
|
||||
void updateAutoSave();
|
||||
void enterAutoSave();
|
||||
void autoSaving();
|
||||
void waitingForWrite();
|
||||
void endAutoSave();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef DUSK_DISCORD_RPC
|
||||
|
||||
namespace dusk {
|
||||
namespace discord {
|
||||
|
||||
void Initialize();
|
||||
|
||||
void RunCallbacks();
|
||||
|
||||
void UpdatePresence();
|
||||
|
||||
void Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DUSK_DISCORD_RPC
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "aurora/gfx.h"
|
||||
|
||||
extern AuroraInfo auroraInfo;
|
||||
extern const char* configPath;
|
||||
|
||||
namespace dusk {
|
||||
extern AuroraStats lastFrameAuroraStats;
|
||||
|
||||
@@ -1,22 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "version.hpp"
|
||||
|
||||
namespace dusk {
|
||||
|
||||
struct OffsetVersion {
|
||||
version::GameVersion mGameVersion;
|
||||
u32 mOffset;
|
||||
|
||||
constexpr OffsetVersion(const version::GameVersion gameVersion, const u32 offset)
|
||||
: mGameVersion(gameVersion), mOffset(offset) {}
|
||||
};
|
||||
|
||||
/**
|
||||
* Load bytes from the main DOL by GameCube virtual address
|
||||
*/
|
||||
bool LoadDolAsset(void* dst, u32 virtualAddress, s32 size);
|
||||
bool LoadDolAsset(void* dst, std::initializer_list<OffsetVersion> virtualAddress, s32 size);
|
||||
|
||||
/**
|
||||
* Load bytes from a REL file in the ISO filesystem, dst must be 32-byte aligned
|
||||
*/
|
||||
bool LoadRelAsset(void* dst, const char* dvdPath, s32 offset, s32 size);
|
||||
bool LoadRelAsset(void* dst, const char* dvdPath, std::initializer_list<OffsetVersion> offset, s32 size);
|
||||
|
||||
/**
|
||||
* Load bytes from a REL inside RELS.arc
|
||||
*/
|
||||
bool LoadArchivedRelAsset(void* dst, u32 memType, const char* relFileName, s32 offset, s32 size);
|
||||
bool LoadArchivedRelAsset(void* dst, u32 memType, const char* relFileName, std::initializer_list<OffsetVersion> offset, s32 size);
|
||||
|
||||
} // namespace dusk
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#ifndef DUSK_FRAME_INTERP_H
|
||||
#define DUSK_FRAME_INTERP_H
|
||||
#pragma once
|
||||
|
||||
#include <dolphin/mtx.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct cXyz;
|
||||
class camera_process_class;
|
||||
class view_class;
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace dusk {
|
||||
@@ -15,34 +14,39 @@ namespace frame_interp {
|
||||
|
||||
void ensure_initialized();
|
||||
|
||||
void begin_record_camera();
|
||||
void begin_record();
|
||||
void end_record();
|
||||
void interpolate(float step);
|
||||
void begin_sim_tick();
|
||||
void begin_frame(bool enabled, bool is_sim_frame, float step);
|
||||
void interpolate();
|
||||
float get_interpolation_step();
|
||||
|
||||
void notify_presentation_frame();
|
||||
void request_presentation_sync();
|
||||
bool presentation_sync_active();
|
||||
|
||||
void notify_sim_tick_complete();
|
||||
uint32_t begin_presentation_ui_pass();
|
||||
uint32_t get_presentation_ui_advance_ticks();
|
||||
void end_presentation_ui_pass();
|
||||
bool is_enabled();
|
||||
|
||||
// TODO: These should be phased out as UI is progressively updated to use game_clock
|
||||
void set_ui_tick_pending(bool value);
|
||||
bool get_ui_tick_pending();
|
||||
|
||||
bool is_sim_frame();
|
||||
|
||||
void open_child(const void* key, int32_t id);
|
||||
void close_child();
|
||||
void record_camera(::camera_process_class* cam, int camera_id);
|
||||
void record_final_mtx_raw(const Mtx* dest, const Mtx src);
|
||||
void interp_view(::view_class* view);
|
||||
void record_final_mtx(Mtx m, const void *key);
|
||||
void record_final_mtx(Mtx m);
|
||||
|
||||
bool lookup_replacement(const void* source, Mtx out);
|
||||
bool lookup_replacement(const void* key, Mtx out);
|
||||
bool lookup_concat_replacement(const void* lhs, const void* rhs, Mtx out);
|
||||
|
||||
void camera_eye_from_view_mtx(MtxP view_mtx, cXyz* o_eye);
|
||||
bool build_star_view(Mtx o_view, Mtx o_cam_billboard_base, cXyz* o_anchor_eye, float* o_fovy);
|
||||
typedef void (*InterpolationCallBack)(bool isSimFrame, void* pUserWork);
|
||||
// call on a sim tick, will get called during presentation
|
||||
void add_interpolation_callback(InterpolationCallBack pCallBack, void* pUserWork);
|
||||
|
||||
void begin_presentation_camera();
|
||||
void end_presentation_camera();
|
||||
|
||||
} // namespace frame_interp
|
||||
} // namespace dusk
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
namespace dusk::game_clock {
|
||||
|
||||
void ensure_initialized();
|
||||
void reset_frame_timer();
|
||||
|
||||
constexpr float sim_pace() { return 1.0f / 30.0f; }
|
||||
constexpr float period_for_original_frames(float frame_count) { return frame_count * sim_pace(); }
|
||||
constexpr float ui_maximum_dt() { return 0.05f; }
|
||||
constexpr float ui_initial_dt() { return 1.0f / 60.0f; }
|
||||
|
||||
struct MainLoopPacer {
|
||||
float presentation_dt_seconds;
|
||||
bool is_interpolating;
|
||||
int sim_ticks_to_run;
|
||||
float sim_pace;
|
||||
};
|
||||
|
||||
MainLoopPacer advance_main_loop();
|
||||
void commit_sim_tick();
|
||||
float sample_interpolation_step();
|
||||
|
||||
float consume_interval(const void* consumer);
|
||||
|
||||
} // namespace dusk::game_clock
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef GAMEPAD_COLOR_H
|
||||
#define GAMEPAD_COLOR_H
|
||||
|
||||
void handleGamepadColor();
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef DUSK_GYRO_H
|
||||
#define DUSK_GYRO_H
|
||||
|
||||
namespace dusk::gyro {
|
||||
void read(float dt);
|
||||
void getAimDeltas(float& out_yaw, float& out_pitch);
|
||||
bool queryGyroAimContext();
|
||||
|
||||
void rollgoalTick(bool play_active, s16 camera_yaw);
|
||||
void rollgoalTableOffset(s16& out_ax, s16& out_az);
|
||||
|
||||
extern bool s_sensor_keep_alive;
|
||||
bool get_sensor_keep_alive();
|
||||
void set_sensor_keep_alive(bool value);
|
||||
} // namespace dusk::gyro
|
||||
|
||||
#endif
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef DUSK_GYRO_AIM_H
|
||||
#define DUSK_GYRO_AIM_H
|
||||
|
||||
namespace dusk::gyro_aim {
|
||||
void read(float dt, bool context_active);
|
||||
void consumeAimDeltas(float& out_yaw_rad, float& out_pitch_rad);
|
||||
bool queryGyroAimItemContext();
|
||||
} // namespace dusk::gyro_aim
|
||||
|
||||
#endif
|
||||
@@ -9,15 +9,17 @@ constexpr const char* DO_RESET = "Cmd+R";
|
||||
constexpr const char* DO_RESET = "Ctrl+R";
|
||||
#endif
|
||||
|
||||
constexpr const char* TOGGLE_FULLSCREEN = "F11";
|
||||
|
||||
constexpr const char* SHOW_PROCESS_MANAGEMENT = "F2";
|
||||
constexpr const char* SHOW_DEBUG_OVERLAY = "F3";
|
||||
constexpr const char* SHOW_HEAP_VIEWER = "F4";
|
||||
constexpr const char* SHOW_STUB_LOG = "F5";
|
||||
constexpr const char* SHOW_CAMERA_DEBUG = "F6";
|
||||
constexpr const char* SHOW_AUDIO_DEBUG = "F7";
|
||||
constexpr const char* SHOW_PLAYER_INFO = "F5";
|
||||
constexpr const char* SHOW_SAVE_EDITOR = "F6";
|
||||
constexpr const char* SHOW_MAP_LOADER = "F7";
|
||||
constexpr const char* SHOW_STATE_SHARE = "F8";
|
||||
constexpr const char* SHOW_DEBUG_CAMERA = "F9";
|
||||
constexpr const char* SHOW_AUDIO_DEBUG = "F10";
|
||||
|
||||
constexpr const char* TOGGLE_FULLSCREEN = "F11";
|
||||
|
||||
constexpr const char* TURBO = "Tab";
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace dusk::speedrun {
|
||||
void onGameFrame();
|
||||
uint64_t getFrameCount();
|
||||
void start();
|
||||
void reset();
|
||||
void connectLiveSplit(const char* host = "127.0.0.1", int port = 16834);
|
||||
void disconnectLiveSplit();
|
||||
bool consumeConnectedEvent();
|
||||
bool consumeDisconnectedEvent();
|
||||
void updateLiveSplit();
|
||||
void shutdown();
|
||||
}
|
||||
@@ -4,10 +4,12 @@
|
||||
#include <aurora/aurora.h>
|
||||
#include <aurora/lib/logging.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
void aurora_log_callback(AuroraLogLevel level, const char* module, const char* message, unsigned int len);
|
||||
|
||||
namespace dusk {
|
||||
void InitializeFileLogging(const char* configDir, AuroraLogLevel logLevel);
|
||||
void InitializeFileLogging(const std::filesystem::path& configDir, AuroraLogLevel logLevel);
|
||||
void ShutdownFileLogging();
|
||||
const char* GetLogFilePath();
|
||||
void SendToStubLog(AuroraLogLevel level, const char* module, const char* message);
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#ifndef DUSK_MAIN_H
|
||||
#define DUSK_MAIN_H
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace dusk {
|
||||
extern bool IsRunning;
|
||||
extern bool IsShuttingDown;
|
||||
extern bool IsGameLaunched;
|
||||
extern bool IsFocusPaused;
|
||||
extern std::filesystem::path ConfigPath;
|
||||
}
|
||||
|
||||
#endif // DUSK_MAIN_H
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef DUSK_SCOPE_GUARD_HPP
|
||||
#define DUSK_SCOPE_GUARD_HPP
|
||||
|
||||
#include <functional>
|
||||
|
||||
class SimpleScopeGuard {
|
||||
public:
|
||||
// Store the function in the constructor
|
||||
explicit SimpleScopeGuard(const std::function<void()>& func) : m_func(func) {}
|
||||
|
||||
// Run the function when the object goes out of scope
|
||||
~SimpleScopeGuard() {
|
||||
if (m_func) m_func();
|
||||
}
|
||||
|
||||
private:
|
||||
std::function<void()> m_func;
|
||||
};
|
||||
|
||||
#endif //DUSK_SCOPE_GUARD_HPP
|
||||
+59
-6
@@ -13,12 +13,26 @@ enum class BloomMode : int {
|
||||
Dusk = 2,
|
||||
};
|
||||
|
||||
enum class GameLanguage : u8 {
|
||||
English = OS_LANGUAGE_ENGLISH,
|
||||
German = OS_LANGUAGE_GERMAN,
|
||||
French = OS_LANGUAGE_FRENCH,
|
||||
Spanish = OS_LANGUAGE_SPANISH,
|
||||
Italian = OS_LANGUAGE_ITALIAN,
|
||||
};
|
||||
|
||||
namespace config {
|
||||
template <>
|
||||
struct ConfigEnumRange<BloomMode> {
|
||||
static constexpr auto min = BloomMode::Off;
|
||||
static constexpr auto max = BloomMode::Dusk;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct ConfigEnumRange<GameLanguage> {
|
||||
static constexpr auto min = GameLanguage::English;
|
||||
static constexpr auto max = GameLanguage::Italian;
|
||||
};
|
||||
}
|
||||
|
||||
// Persistent user settings
|
||||
@@ -41,11 +55,14 @@ struct UserSettings {
|
||||
ConfigVar<int> soundEffectsVolume;
|
||||
ConfigVar<int> fanfareVolume;
|
||||
ConfigVar<bool> enableReverb;
|
||||
ConfigVar<bool> enableHrtf;
|
||||
} audio;
|
||||
|
||||
// Game settings
|
||||
|
||||
struct {
|
||||
ConfigVar<GameLanguage> language;
|
||||
|
||||
// QoL
|
||||
ConfigVar<bool> enableQuickTransform;
|
||||
ConfigVar<bool> hideTvSettingsScreen;
|
||||
@@ -60,18 +77,29 @@ struct UserSettings {
|
||||
ConfigVar<bool> fastClimbing;
|
||||
ConfigVar<bool> noMissClimbing;
|
||||
ConfigVar<bool> fastTears;
|
||||
ConfigVar<bool> no2ndFishForCat;
|
||||
ConfigVar<bool> instantSaves;
|
||||
ConfigVar<bool> instantText;
|
||||
ConfigVar<bool> sunsSong;
|
||||
ConfigVar<bool> autoSave;
|
||||
|
||||
// Preferences
|
||||
ConfigVar<bool> enableMirrorMode;
|
||||
ConfigVar<bool> invertCameraXAxis;
|
||||
ConfigVar<bool> disableMainHUD;
|
||||
ConfigVar<bool> pauseOnFocusLost;
|
||||
ConfigVar<bool> enableLinkDollRotation;
|
||||
ConfigVar<bool> enableAchievementNotifications;
|
||||
|
||||
|
||||
// Graphics
|
||||
ConfigVar<BloomMode> bloomMode;
|
||||
ConfigVar<float> bloomMultiplier;
|
||||
ConfigVar<bool> enableWaterRefraction;
|
||||
ConfigVar<bool> disableWaterRefraction;
|
||||
ConfigVar<bool> enableFrameInterpolation;
|
||||
ConfigVar<int> internalResolutionScale;
|
||||
ConfigVar<int> shadowResolutionMultiplier;
|
||||
ConfigVar<bool> enableDepthOfField;
|
||||
ConfigVar<bool> enableMapBackground;
|
||||
|
||||
// Audio
|
||||
ConfigVar<bool> noLowHpSound;
|
||||
@@ -79,12 +107,30 @@ struct UserSettings {
|
||||
|
||||
// Input
|
||||
ConfigVar<bool> enableGyroAim;
|
||||
ConfigVar<float> gyroAimSensitivityX;
|
||||
ConfigVar<float> gyroAimSensitivityY;
|
||||
ConfigVar<bool> gyroAimInvertPitch;
|
||||
ConfigVar<bool> gyroAimInvertYaw;
|
||||
ConfigVar<bool> enableGyroRollgoal;
|
||||
ConfigVar<float> gyroSensitivityX;
|
||||
ConfigVar<float> gyroSensitivityY;
|
||||
ConfigVar<float> gyroSensitivityRollgoal;
|
||||
ConfigVar<float> gyroSmoothing;
|
||||
ConfigVar<float> gyroDeadband;
|
||||
ConfigVar<bool> gyroInvertPitch;
|
||||
ConfigVar<bool> gyroInvertYaw;
|
||||
ConfigVar<bool> freeCamera;
|
||||
ConfigVar<bool> invertCameraXAxis;
|
||||
ConfigVar<bool> invertCameraYAxis;
|
||||
ConfigVar<float> freeCameraSensitivity;
|
||||
|
||||
// Cheats
|
||||
ConfigVar<bool> infiniteHearts;
|
||||
ConfigVar<bool> infiniteArrows;
|
||||
ConfigVar<bool> infiniteBombs;
|
||||
ConfigVar<bool> infiniteOil;
|
||||
ConfigVar<bool> infiniteOxygen;
|
||||
ConfigVar<bool> infiniteRupees;
|
||||
ConfigVar<bool> enableIndefiniteItemDrops;
|
||||
ConfigVar<bool> moonJump;
|
||||
ConfigVar<bool> superClawshot;
|
||||
ConfigVar<bool> alwaysGreatspin;
|
||||
ConfigVar<bool> enableFastIronBoots;
|
||||
ConfigVar<bool> canTransformAnywhere;
|
||||
ConfigVar<bool> fastSpinner;
|
||||
@@ -95,6 +141,10 @@ struct UserSettings {
|
||||
|
||||
// Controls
|
||||
ConfigVar<bool> enableTurboKeybind;
|
||||
|
||||
// Tools
|
||||
ConfigVar<bool> speedrunMode;
|
||||
ConfigVar<bool> liveSplitEnabled;
|
||||
} game;
|
||||
|
||||
struct {
|
||||
@@ -104,6 +154,8 @@ struct UserSettings {
|
||||
ConfigVar<bool> showPipelineCompilation;
|
||||
ConfigVar<bool> wasPresetChosen;
|
||||
ConfigVar<bool> enableCrashReporting;
|
||||
ConfigVar<bool> duskMenuOpen;
|
||||
ConfigVar<int> cardFileType;
|
||||
} backend;
|
||||
};
|
||||
|
||||
@@ -128,6 +180,7 @@ struct TransientSettings {
|
||||
CollisionViewSettings collisionView;
|
||||
bool skipFrameRateLimit;
|
||||
bool moveLinkActive;
|
||||
bool stateShareLoadActive;
|
||||
};
|
||||
|
||||
TransientSettings& getTransientSettings();
|
||||
|
||||
+25
-25
@@ -1,9 +1,10 @@
|
||||
#ifndef DUSK_TIME_H
|
||||
#define DUSK_TIME_H
|
||||
|
||||
#include <chrono>
|
||||
#include <numeric>
|
||||
#include <array>
|
||||
#include <numeric>
|
||||
|
||||
#include "SDL3/SDL_timer.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
@@ -15,28 +16,26 @@
|
||||
#include <Windows.h>
|
||||
#include <shellapi.h>
|
||||
#include <intrin.h>
|
||||
#else
|
||||
#include "SDL3/SDL_timer.h"
|
||||
#endif
|
||||
|
||||
class Limiter {
|
||||
using delta_clock = std::chrono::high_resolution_clock;
|
||||
using duration_t = std::chrono::nanoseconds;
|
||||
|
||||
public:
|
||||
void Reset() { m_oldTime = delta_clock::now(); }
|
||||
using duration_t = Uint64;
|
||||
|
||||
void Reset() { m_oldTime = SDL_GetTicksNS(); }
|
||||
|
||||
void Sleep(duration_t targetFrameTime) {
|
||||
if (targetFrameTime.count() == 0) {
|
||||
if (targetFrameTime == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto start = delta_clock::now();
|
||||
const Uint64 start = SDL_GetTicksNS();
|
||||
duration_t adjustedSleepTime = SleepTime(targetFrameTime);
|
||||
if (adjustedSleepTime.count() > 0) {
|
||||
if (adjustedSleepTime > 0) {
|
||||
NanoSleep(adjustedSleepTime);
|
||||
duration_t overslept = TimeSince(start) - adjustedSleepTime;
|
||||
if (overslept < duration_t{targetFrameTime}) {
|
||||
const duration_t elapsed = TimeSince(start);
|
||||
const duration_t overslept = elapsed > adjustedSleepTime ? elapsed - adjustedSleepTime : 0;
|
||||
if (overslept < targetFrameTime) {
|
||||
m_overheadTimes[m_overheadTimeIdx] = overslept;
|
||||
m_overheadTimeIdx = (m_overheadTimeIdx + 1) % m_overheadTimes.size();
|
||||
}
|
||||
@@ -45,23 +44,23 @@ public:
|
||||
}
|
||||
|
||||
duration_t SleepTime(duration_t targetFrameTime) {
|
||||
const auto sleepTime = duration_t{targetFrameTime} - TimeSince(m_oldTime);
|
||||
m_overhead = std::accumulate(m_overheadTimes.begin(), m_overheadTimes.end(), duration_t{}) / m_overheadTimes.size();
|
||||
const duration_t elapsed = TimeSince(m_oldTime);
|
||||
const duration_t sleepTime = elapsed < targetFrameTime ? targetFrameTime - elapsed : 0;
|
||||
m_overhead = std::accumulate(m_overheadTimes.begin(), m_overheadTimes.end(), duration_t{0}) /
|
||||
m_overheadTimes.size();
|
||||
if (sleepTime > m_overhead) {
|
||||
return sleepTime - m_overhead;
|
||||
}
|
||||
return duration_t{0};
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
delta_clock::time_point m_oldTime;
|
||||
Uint64 m_oldTime = 0;
|
||||
std::array<duration_t, 4> m_overheadTimes{};
|
||||
size_t m_overheadTimeIdx = 0;
|
||||
duration_t m_overhead = duration_t{0};
|
||||
duration_t m_overhead = 0;
|
||||
|
||||
duration_t TimeSince(delta_clock::time_point start) {
|
||||
return std::chrono::duration_cast<duration_t>(delta_clock::now() - start);
|
||||
}
|
||||
duration_t TimeSince(Uint64 start) const { return SDL_GetTicksNS() - start; }
|
||||
|
||||
#if _WIN32
|
||||
void NanoSleep(const duration_t duration) {
|
||||
@@ -85,9 +84,10 @@ private:
|
||||
|
||||
LARGE_INTEGER start, current;
|
||||
QueryPerformanceCounter(&start);
|
||||
LONGLONG ticksToWait = static_cast<LONGLONG>(duration.count() * countPerNs);
|
||||
if (DWORD ms = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count(); ms > 1) {
|
||||
::Sleep(ms - 1);
|
||||
const LONGLONG ticksToWait = static_cast<LONGLONG>(duration * countPerNs);
|
||||
const Uint64 ms = duration / 1'000'000ULL;
|
||||
if (ms > 1) {
|
||||
::Sleep(static_cast<DWORD>(ms - 1));
|
||||
}
|
||||
do {
|
||||
QueryPerformanceCounter(¤t);
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
} while (current.QuadPart - start.QuadPart < ticksToWait);
|
||||
}
|
||||
#else
|
||||
void NanoSleep(const duration_t duration) { SDL_DelayPrecise(duration.count()); }
|
||||
void NanoSleep(const duration_t duration) { SDL_DelayPrecise(duration); }
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
#ifndef DUSK_VERSION_HPP
|
||||
#define DUSK_VERSION_HPP
|
||||
|
||||
/**
|
||||
* Functionality for switching game behavior based on the loaded game version (e.g. PAL/JPN, GC/Wii)
|
||||
*/
|
||||
namespace dusk::version {
|
||||
enum class GameVersion : u8 {
|
||||
GcnUsa = VERSION_GCN_USA,
|
||||
GcnPal = VERSION_GCN_PAL,
|
||||
GcnJpn = VERSION_GCN_JPN,
|
||||
WiiUsaRev0 = VERSION_WII_USA_R0,
|
||||
WiiUsa = VERSION_WII_USA_R2,
|
||||
WiiPal = VERSION_WII_PAL,
|
||||
WiiJpn = VERSION_WII_JPN,
|
||||
WiiKor = VERSION_WII_KOR,
|
||||
};
|
||||
|
||||
bool isGcn();
|
||||
bool isWii();
|
||||
bool isPalOrAtLeastWiiR2();
|
||||
|
||||
bool isRegionPal();
|
||||
bool isRegionJpn();
|
||||
bool isRegionUsa();
|
||||
|
||||
GameVersion getGameVersion();
|
||||
|
||||
const DVDDiskID& getDiskID();
|
||||
|
||||
void init();
|
||||
|
||||
template<typename T>
|
||||
struct VersionOption {
|
||||
GameVersion mVersion;
|
||||
T mValue;
|
||||
|
||||
constexpr VersionOption(GameVersion version, T value) : mVersion(version), mValue(value) {}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
const T& versionSelect(const std::initializer_list<VersionOption<T>> options) {
|
||||
const auto version = getGameVersion();
|
||||
for (const auto& opt : options) {
|
||||
if (opt.mVersion == version) {
|
||||
return opt.mValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Unable to find value.
|
||||
abort();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
const T& versionSelect(const std::initializer_list<VersionOption<T>> options, const T& defaultValue) {
|
||||
const auto version = getGameVersion();
|
||||
for (const auto& opt : options) {
|
||||
if (opt.mVersion == version) {
|
||||
return opt.mValue;
|
||||
}
|
||||
}
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
} // namespace dusk::version
|
||||
|
||||
#endif // DUSK_VERSION_HPP
|
||||
@@ -25,7 +25,7 @@ typedef struct leafdraw_class : base_process_class {
|
||||
#endif
|
||||
/* 0xB8 */ leafdraw_method_class* leaf_methods;
|
||||
/* 0xBC */ s8 unk_0xBC;
|
||||
/* 0xBD */ u8 unk_0xBD;
|
||||
/* 0xBD */ u8 draw_interp_frame;
|
||||
/* 0xBE */ draw_priority_class draw_priority;
|
||||
} leafdraw_class;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef struct process_node_class {
|
||||
/* 0x0BC */ layer_class layer;
|
||||
/* 0x0E8 */ node_list_class layer_nodelist[16];
|
||||
/* 0x1A8 */ s8 unk_0x1A8;
|
||||
/* 0x1A9 */ s8 draw_interp_frame;
|
||||
} process_node_class;
|
||||
|
||||
typedef struct node_process_profile_definition {
|
||||
|
||||
+17
-1
@@ -73,6 +73,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef __MWERKS__
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// Silence clangd errors about MWCC PPC intrinsics by declaring them here.
|
||||
extern int __cntlzw(unsigned int);
|
||||
extern int __rlwimi(int, int, int, int, int);
|
||||
@@ -80,7 +83,14 @@ extern void __dcbf(void*, int);
|
||||
extern void __dcbz(void*, int);
|
||||
extern void __sync();
|
||||
extern int __abs(int);
|
||||
void* __memcpy(void*, const void*, int);
|
||||
#if defined(__has_builtin) && __has_builtin(__builtin_memcpy)
|
||||
#define __memcpy __builtin_memcpy
|
||||
#else
|
||||
#define __memcpy memcpy
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef M_PI
|
||||
@@ -220,10 +230,16 @@ using std::isnan;
|
||||
// Some basic macros that are more convenient than putting down #if blocks for one-line changes.
|
||||
#if TARGET_PC
|
||||
#define IF_DUSK(statement) statement
|
||||
#define IF_DUSK_BLOCK(cond) if (cond) {
|
||||
#define IF_DUSK_BLOCK_END }
|
||||
#define IF_DUSK_ARG(expr) , expr
|
||||
#define IF_NOT_DUSK(statement)
|
||||
#define DUSK_IF_ELSE(dusk, orig) dusk
|
||||
#else
|
||||
#define IF_DUSK(statement)
|
||||
#define IF_DUSK_ARG(expr)
|
||||
#define IF_DUSK_BLOCK(cond)
|
||||
#define IF_DUSK_BLOCK_END
|
||||
#define IF_NOT_DUSK(statement) statement
|
||||
#define DUSK_IF_ELSE(dusk, orig) orig
|
||||
#endif
|
||||
|
||||
@@ -125,8 +125,15 @@ public:
|
||||
#if TARGET_PC
|
||||
static f32 hudAspectScaleDown;
|
||||
static f32 hudAspectScaleUp;
|
||||
static f32 ScaleHUDXLeft(f32 baseX) { return getMinXF() + baseX; }
|
||||
static f32 ScaleHUDXRight(f32 baseX) { return -getMinXF() + baseX; }
|
||||
static void updateSafeAreaBounds();
|
||||
static f32 getSafeMinXF() { return m_safeMinXF; }
|
||||
static f32 getSafeMinYF() { return m_safeMinYF; }
|
||||
static f32 getSafeWidthF() { return m_safeWidthF; }
|
||||
static f32 getSafeHeightF() { return m_safeHeightF; }
|
||||
static f32 getSafeMaxXF() { return m_safeMaxXF; }
|
||||
static f32 getSafeMaxYF() { return m_safeMaxYF; }
|
||||
static f32 ScaleHUDXLeft(f32 baseX) { return getSafeMinXF() + baseX; }
|
||||
static f32 ScaleHUDXRight(f32 baseX) { return getSafeMaxXF() - FB_WIDTH_BASE + baseX; }
|
||||
#endif
|
||||
|
||||
static void setBlureMtx(const Mtx m) {
|
||||
@@ -279,12 +286,7 @@ public:
|
||||
#if WIDESCREEN_SUPPORT
|
||||
static void setTvSize();
|
||||
|
||||
#if TARGET_PC
|
||||
static void onWide(f32 width, f32 height);
|
||||
#else
|
||||
static void onWide();
|
||||
#endif
|
||||
|
||||
static void offWide();
|
||||
static u8 isWide();
|
||||
|
||||
@@ -297,7 +299,7 @@ public:
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
static void setWindowSize(AuroraWindowSize const& size);
|
||||
static void updateRenderSize();
|
||||
#endif
|
||||
|
||||
static TGXTexObj mFrameBufferTexObj;
|
||||
@@ -369,6 +371,15 @@ public:
|
||||
static int m_height;
|
||||
static f32 m_heightF;
|
||||
static f32 m_widthF;
|
||||
|
||||
#if TARGET_PC
|
||||
static f32 m_safeMinXF;
|
||||
static f32 m_safeMinYF;
|
||||
static f32 m_safeMaxXF;
|
||||
static f32 m_safeMaxYF;
|
||||
static f32 m_safeWidthF;
|
||||
static f32 m_safeHeightF;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -43,10 +43,6 @@ struct mDoLib_clipper {
|
||||
};
|
||||
|
||||
void mDoLib_project(Vec* src, Vec* dst);
|
||||
#if TARGET_PC
|
||||
void mDoLib_project(Vec* src, Vec* dst, JGeometry::TBox2<f32> viewport);
|
||||
#endif
|
||||
|
||||
u32 mDoLib_setResTimgObj(ResTIMG const* res, TGXTexObj* o_texObj, u32 tlut_name,
|
||||
GXTlutObj* o_tlutObj);
|
||||
void mDoLib_pos2camera(Vec* src, Vec* dst);
|
||||
|
||||
@@ -79,6 +79,10 @@ public:
|
||||
virtual void viewCalc();
|
||||
virtual ~J3DModel() {}
|
||||
|
||||
#if TARGET_PC
|
||||
static void interp_callback(bool isSimFrame, void* pUserWork);
|
||||
#endif
|
||||
|
||||
J3DModelData* getModelData() { return mModelData; }
|
||||
|
||||
void onFlag(u32 flag) { mFlags |= flag; }
|
||||
@@ -105,9 +109,7 @@ public:
|
||||
void setAnmMtx(int jointNo, Mtx m) {
|
||||
mMtxBuffer->setAnmMtx(jointNo, m);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(
|
||||
reinterpret_cast<const Mtx*>(mMtxBuffer->getAnmMtx(jointNo)),
|
||||
mMtxBuffer->getAnmMtx(jointNo));
|
||||
dusk::frame_interp::record_final_mtx(mMtxBuffer->getAnmMtx(jointNo));
|
||||
#endif
|
||||
}
|
||||
MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); }
|
||||
|
||||
@@ -23,6 +23,10 @@ public:
|
||||
void syncJ3DSysPointers() const;
|
||||
void syncJ3DSysFlags() const;
|
||||
|
||||
#if TARGET_PC
|
||||
bool needsInterpCallBack() const;
|
||||
#endif
|
||||
|
||||
virtual ~J3DModelData() {}
|
||||
|
||||
void simpleCalcMaterial(Mtx mtx) { simpleCalcMaterial(0, mtx); }
|
||||
|
||||
@@ -33,6 +33,9 @@ public:
|
||||
void copy(J3DMaterial*);
|
||||
s32 newSharedDisplayList(u32);
|
||||
s32 newSingleSharedDisplayList(u32);
|
||||
#if TARGET_PC
|
||||
bool needsInterpCallBack() const;
|
||||
#endif
|
||||
|
||||
virtual void calc(f32 const (*)[4]);
|
||||
virtual void calcDiffTexMtx(f32 const (*)[4]);
|
||||
@@ -46,7 +49,6 @@ public:
|
||||
virtual void change();
|
||||
|
||||
J3DMaterial() { initialize(); }
|
||||
~J3DMaterial() {}
|
||||
J3DMaterial* getNext() { return mNext; }
|
||||
J3DShape* getShape() { return mShape; }
|
||||
J3DTevBlock* getTevBlock() { return mTevBlock; }
|
||||
|
||||
@@ -59,6 +59,9 @@ public:
|
||||
bool isActive() const { return mSeqList.getNumLinks() != 0; }
|
||||
int getNumActiveSeqs() const { return mSeqList.getNumLinks(); }
|
||||
void pause(bool paused) { mActivity.field_0x0.flags.flag2 = paused; }
|
||||
#if TARGET_PC
|
||||
JSUList<JAISeq>* getSeqList() { return &mSeqList; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
/* 0x08 */ JAIAudience* mAudience;
|
||||
|
||||
@@ -11,9 +11,17 @@
|
||||
struct JASCalc {
|
||||
static void imixcopy(const s16*, const s16*, s16*, u32);
|
||||
static void bcopyfast(const void* src, void* dest, u32 size);
|
||||
#if TARGET_ANDROID
|
||||
static void _bcopy(const void* src, void* dest, u32 size);
|
||||
#else
|
||||
static void bcopy(const void* src, void* dest, u32 size);
|
||||
#endif
|
||||
static void bzerofast(void* dest, u32 size);
|
||||
#if TARGET_ANDROID
|
||||
static void _bzero(void* dest, u32 size);
|
||||
#else
|
||||
static void bzero(void* dest, u32 size);
|
||||
#endif
|
||||
static f32 pow2(f32);
|
||||
|
||||
template <typename A, typename B>
|
||||
|
||||
@@ -101,10 +101,6 @@ public:
|
||||
|
||||
void setDrawDoneMethod(EDrawDone drawDone) { mDrawDoneMethod = drawDone; }
|
||||
void setFader(JUTFader* fader) { mFader = fader; }
|
||||
#ifdef TARGET_PC
|
||||
// For frame interpolation
|
||||
void setFaderSimSteps(u32 steps);
|
||||
#endif
|
||||
void resetFader() { setFader(NULL); }
|
||||
JUTFader* getFader() const { return mFader; }
|
||||
void setClearColor(JUtility::TColor color) { mClearColor = color; }
|
||||
|
||||
@@ -207,4 +207,11 @@ void JPARegistAlphaEnv(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistPrmAlpha(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPARegistPrmAlphaEnv(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
|
||||
#if TARGET_PC
|
||||
void JPAInterpBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPAInterpRotBillboard(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPAInterpDirection(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
void JPAInterpRotDirection(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
#endif
|
||||
|
||||
#endif /* JPABASESHAPE_H */
|
||||
|
||||
@@ -24,6 +24,9 @@ public:
|
||||
void init_c(JPAEmitterWorkData*, JPABaseParticle*);
|
||||
bool calc_p(JPAEmitterWorkData*);
|
||||
bool calc_c(JPAEmitterWorkData*);
|
||||
#if TARGET_PC
|
||||
void interp(JPAEmitterWorkData*, void const* drawFunc);
|
||||
#endif
|
||||
bool canCreateChild(JPAEmitterWorkData*);
|
||||
f32 getWidth(JPABaseEmitter const*) const;
|
||||
f32 getHeight(JPABaseEmitter const*) const;
|
||||
|
||||
@@ -11,8 +11,10 @@
|
||||
class JUTFader {
|
||||
public:
|
||||
enum EStatus {
|
||||
UNKSTATUS_M1 = -1,
|
||||
UNKSTATUS_0 = 0,
|
||||
None,
|
||||
Wait,
|
||||
FadeIn,
|
||||
FadeOut,
|
||||
};
|
||||
|
||||
JUTFader(int, int, int, int, JUtility::TColor);
|
||||
@@ -29,12 +31,12 @@ public:
|
||||
void setColor(JUtility::TColor color) { mColor.set(color); }
|
||||
|
||||
/* 0x04 */ s32 mStatus;
|
||||
/* 0x08 */ u16 field_0x8;
|
||||
/* 0x0A */ u16 field_0xa;
|
||||
/* 0x08 */ u16 mDuration;
|
||||
/* 0x0A */ u16 mTimer;
|
||||
/* 0x0C */ JUtility::TColor mColor;
|
||||
/* 0x10 */ JGeometry::TBox2<f32> mBox;
|
||||
/* 0x20 */ int mEStatus;
|
||||
/* 0x24 */ u32 field_0x24;
|
||||
/* 0x20 */ int mStatusTimer;
|
||||
/* 0x24 */ u32 mNextStatus;
|
||||
};
|
||||
|
||||
#endif /* JUTFADER_H */
|
||||
|
||||
@@ -5,6 +5,17 @@
|
||||
#include <cstring>
|
||||
#include "dusk/endian.h"
|
||||
|
||||
#if TARGET_PC
|
||||
struct FontDrawContext {
|
||||
bool isTextureLoaded = false;
|
||||
};
|
||||
#define FONT_DRAW_CTX , FontDrawContext* context
|
||||
#define FONT_DRAW_CTX_ARG , context
|
||||
#else
|
||||
#define FONT_DRAW_CTX
|
||||
#define FONT_DRAW_CTX_ARG
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
*
|
||||
@@ -84,7 +95,12 @@ public:
|
||||
|
||||
/* 0x0C */ virtual void setGX() = 0;
|
||||
/* 0x10 */ virtual void setGX(JUtility::TColor col1, JUtility::TColor col2) { setGX(); }
|
||||
/* 0x14 */ virtual f32 drawChar_scale(f32 a1, f32 a2, f32 a3, f32 a4, int a5, bool a6) = 0;
|
||||
/* 0x14 */ virtual f32 drawChar_scale(f32 a1, f32 a2, f32 a3, f32 a4, int a5, bool a6 FONT_DRAW_CTX) = 0;
|
||||
#if TARGET_PC
|
||||
f32 drawChar_scale(f32 a1, f32 a2, f32 a3, f32 a4, int a5, bool a6) {
|
||||
return drawChar_scale(a1, a2, a3, a4, a5, a6, nullptr);
|
||||
}
|
||||
#endif
|
||||
/* 0x18 */ virtual int getLeading() const = 0;
|
||||
/* 0x1C */ virtual s32 getAscent() const = 0;
|
||||
/* 0x20 */ virtual s32 getDescent() const = 0;
|
||||
@@ -97,6 +113,11 @@ public:
|
||||
/* 0x3C */ virtual ResFONT* getResFont() const = 0;
|
||||
/* 0x40 */ virtual bool isLeadByte(int a1) const = 0;
|
||||
|
||||
#if TARGET_PC
|
||||
virtual void pushDrawState() = 0;
|
||||
virtual void popDrawState() = 0;
|
||||
#endif
|
||||
|
||||
static bool isLeadByte_1Byte(int b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -263,6 +263,9 @@ public:
|
||||
/* 0x9C */ u8 field_0x9c[4];
|
||||
/* 0xA0 */ OSTime mResetHoldStartTime;
|
||||
/* 0xA8 */ u8 field_0xa8;
|
||||
#if TARGET_PC
|
||||
u32 mResetHoldFrameCount;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,9 @@ public:
|
||||
JUTTransparency getTransparency() const { return JUTTransparency(mTransparency); }
|
||||
u16 getNumColors() const { return mNumColors; }
|
||||
ResTLUT* getColorTable() const { return mColorTable; }
|
||||
#if TARGET_PC
|
||||
void dataUploaded();
|
||||
#endif
|
||||
|
||||
private:
|
||||
/* 0x00 */ GXTlutObj mTlutObj;
|
||||
|
||||
@@ -18,10 +18,6 @@ struct BlockHeader {
|
||||
BE(u32) size;
|
||||
};
|
||||
|
||||
#if TARGET_PC
|
||||
struct GlyphTextures;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
*
|
||||
@@ -31,7 +27,7 @@ public:
|
||||
virtual ~JUTResFont();
|
||||
virtual void setGX();
|
||||
virtual void setGX(JUtility::TColor, JUtility::TColor);
|
||||
virtual f32 drawChar_scale(f32, f32, f32, f32, int, bool);
|
||||
virtual f32 drawChar_scale(f32, f32, f32, f32, int, bool FONT_DRAW_CTX);
|
||||
virtual int getLeading() const;
|
||||
virtual s32 getAscent() const;
|
||||
virtual s32 getDescent() const;
|
||||
@@ -43,7 +39,7 @@ public:
|
||||
virtual int getFontType() const;
|
||||
virtual ResFONT* getResFont() const;
|
||||
virtual bool isLeadByte(int) const;
|
||||
virtual void loadImage(int, GXTexMapID);
|
||||
virtual void loadImage(int, GXTexMapID FONT_DRAW_CTX);
|
||||
virtual void setBlock();
|
||||
|
||||
JUTResFont(ResFONT const*, JKRHeap*);
|
||||
@@ -53,10 +49,15 @@ public:
|
||||
bool initiate(ResFONT const*, JKRHeap*);
|
||||
bool protected_initiate(ResFONT const*, JKRHeap*);
|
||||
void countBlock();
|
||||
void loadFont(int, GXTexMapID, JUTFont::TWidth*);
|
||||
void loadFont(int, GXTexMapID, JUTFont::TWidth* FONT_DRAW_CTX);
|
||||
int getFontCode(int) const;
|
||||
int convertSjis(int, BE(u16)*) const;
|
||||
|
||||
#if TARGET_PC
|
||||
void pushDrawState() override;
|
||||
void popDrawState() override;
|
||||
#endif
|
||||
|
||||
inline void delete_and_initialize() {
|
||||
deleteMemBlocks_ResFont();
|
||||
initialize_state();
|
||||
@@ -68,11 +69,7 @@ public:
|
||||
// some types uncertain, may need to be fixed
|
||||
/* 0x1C */ int mWidth;
|
||||
/* 0x20 */ int mHeight;
|
||||
#if TARGET_PC
|
||||
GlyphTextures* mGlyphTextures;
|
||||
#else
|
||||
/* 0x24 */ TGXTexObj mTexObj;
|
||||
#endif
|
||||
/* 0x44 */ int mTexPageIdx;
|
||||
/* 0x48 */ const ResFONT* mResFont;
|
||||
/* 0x4C */ ResFONT::INF1* mInf1Ptr;
|
||||
@@ -86,6 +83,16 @@ public:
|
||||
/* 0x66 */ u16 field_0x66;
|
||||
/* 0x68 */ u16 mMaxCode;
|
||||
/* 0x6C */ const IsLeadByte_func* mIsLeadByte;
|
||||
|
||||
#if TARGET_PC
|
||||
// Dusk change: we use a single large texture for all characters.
|
||||
// This enables better draw call merging, ideally enabling entire blocks of
|
||||
// text to be one draw call.
|
||||
TGXTexObj mJoinedTextureObject;
|
||||
u16 mJoinedTextureHeight;
|
||||
|
||||
void initJoinedTexture();
|
||||
#endif
|
||||
};
|
||||
|
||||
extern u8 const JUTResFONT_Ascfont_fix12[];
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
s32 getTransparency() const { return mTexInfo->alphaEnabled; }
|
||||
s32 getWidth() const { return mTexInfo->width; }
|
||||
s32 getHeight() const { return mTexInfo->height; }
|
||||
JUTPalette* getPalette() const { return mPalette; }
|
||||
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
|
||||
bool getCaptureFlag() const { return mFlags & 1; }
|
||||
bool getEmbPaletteDelFlag() const { return mFlags & 2; }
|
||||
@@ -82,7 +83,7 @@ public:
|
||||
int getTlutName() const { return mTlutName; }
|
||||
bool operator==(const JUTTexture& other) {
|
||||
return mTexInfo == other.mTexInfo
|
||||
&& field_0x2c == other.field_0x2c
|
||||
&& mPalette == other.mPalette
|
||||
&& mWrapS == other.mWrapS
|
||||
&& mWrapT == other.mWrapT
|
||||
&& mMinFilter == other.mMinFilter
|
||||
@@ -100,7 +101,7 @@ private:
|
||||
/* 0x20 */ const ResTIMG* mTexInfo;
|
||||
/* 0x24 */ void* mTexData;
|
||||
/* 0x28 */ JUTPalette* mEmbPalette;
|
||||
/* 0x2C */ JUTPalette* field_0x2c;
|
||||
/* 0x2C */ JUTPalette* mPalette;
|
||||
/* 0x30 */ u8 mWrapS;
|
||||
/* 0x31 */ u8 mWrapT;
|
||||
/* 0x32 */ u8 mMinFilter;
|
||||
|
||||
@@ -33,24 +33,16 @@ public:
|
||||
static void postRetraceProc(u32);
|
||||
static void drawDoneCallback();
|
||||
|
||||
u16 getFbWidth() const {
|
||||
#if TARGET_PC
|
||||
return m_WindowSize.fb_width;
|
||||
#else
|
||||
return mRenderObj->fbWidth;
|
||||
#endif
|
||||
}
|
||||
u16 getEfbHeight() const {
|
||||
#if TARGET_PC
|
||||
return m_WindowSize.fb_height;
|
||||
#else
|
||||
return mRenderObj->efbHeight;
|
||||
#endif
|
||||
}
|
||||
u16 getFbWidth() const { return mRenderObj->fbWidth; }
|
||||
u16 getEfbHeight() const { return mRenderObj->efbHeight; }
|
||||
void getBounds(u16& width, u16& height) const {
|
||||
width = (u16)getFbWidth();
|
||||
height = (u16)getEfbHeight();
|
||||
}
|
||||
#ifdef TARGET_PC
|
||||
u32 getRenderWidth() const { return mRenderWidth; }
|
||||
u32 getRenderHeight() const { return mRenderHeight; }
|
||||
#endif
|
||||
u16 getXfbHeight() const { return u16(mRenderObj->xfbHeight); }
|
||||
u8 isAntiAliasing() const { return u8(mRenderObj->aa); }
|
||||
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
|
||||
@@ -63,7 +55,7 @@ public:
|
||||
|
||||
GXRenderModeObj* getRenderMode() const { return mRenderObj; }
|
||||
#if TARGET_PC
|
||||
void setWindowSize(AuroraWindowSize const& size);
|
||||
void setRenderSize(u32 width, u32 height);
|
||||
#endif
|
||||
|
||||
private:
|
||||
@@ -89,7 +81,8 @@ private:
|
||||
|
||||
#if TARGET_PC
|
||||
public:
|
||||
AuroraWindowSize m_WindowSize;
|
||||
u32 mRenderWidth;
|
||||
u32 mRenderHeight;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -64,10 +64,6 @@ void J2DGrafContext::setup2D() {
|
||||
}
|
||||
|
||||
void J2DGrafContext::setScissor() {
|
||||
#if TARGET_PC
|
||||
GXSetScissor(mScissorBounds.i.x, mScissorBounds.i.y, mScissorBounds.getWidth(),
|
||||
mScissorBounds.getHeight());
|
||||
#else
|
||||
JGeometry::TBox2<f32> bounds(0, 0, 1024, 1024);
|
||||
JGeometry::TBox2<f32> curBounds(mScissorBounds);
|
||||
mScissorBounds.intersect(bounds);
|
||||
@@ -81,7 +77,6 @@ void J2DGrafContext::setScissor() {
|
||||
} else {
|
||||
GXSetScissor(0, 0, 0, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void J2DGrafContext::scissor(JGeometry::TBox2<f32> const& bounds) {
|
||||
|
||||
@@ -211,6 +211,11 @@ f32 J2DPrint::parse(const u8* pString, int length, int param_2, u16* param_3,
|
||||
local_bc.a = local_bc.a * alpha / 0xFF;
|
||||
mFont->setGradColor(local_b8, field_0x22 ? local_bc : local_b8);
|
||||
|
||||
#if TARGET_PC
|
||||
FontDrawContext context;
|
||||
mFont->pushDrawState();
|
||||
#endif
|
||||
|
||||
do {
|
||||
bool b2ByteCharacter = false;
|
||||
bool r25;
|
||||
@@ -312,9 +317,9 @@ f32 J2DPrint::parse(const u8* pString, int length, int param_2, u16* param_3,
|
||||
} else {
|
||||
if (param_6) {
|
||||
if (param_3 != NULL) {
|
||||
mFont->drawChar_scale(mCursorH + (s16)param_3[someIndex], mCursorV, (s32)mScaleX, (s32)mScaleY, iCharacter, true);
|
||||
mFont->drawChar_scale(mCursorH + (s16)param_3[someIndex], mCursorV, (s32)mScaleX, (s32)mScaleY, iCharacter, true IF_DUSK_ARG(&context));
|
||||
} else {
|
||||
mFont->drawChar_scale(mCursorH, mCursorV, (s32)mScaleX, (s32)mScaleY, iCharacter, true);
|
||||
mFont->drawChar_scale(mCursorH, mCursorV, (s32)mScaleX, (s32)mScaleY, iCharacter, true IF_DUSK_ARG(&context));
|
||||
}
|
||||
}
|
||||
mCursorH += field_0x34;
|
||||
@@ -353,6 +358,8 @@ f32 J2DPrint::parse(const u8* pString, int length, int param_2, u16* param_3,
|
||||
iCharacter = *(pString++);
|
||||
} while (true);
|
||||
|
||||
IF_DUSK(mFont->popDrawState());
|
||||
|
||||
if (param_3 != NULL) {
|
||||
param_3[someIndex] = 0xFFFF;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,16 @@ s32 J3DModel::entryModelData(J3DModelData* pModelData, u32 mdlFlags, u32 mtxNum)
|
||||
return kJ3DError_Success;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
void J3DModel::interp_callback(bool isSimFrame, void* pUserWork) {
|
||||
J3DModel* i_this = static_cast<J3DModel*>(pUserWork);
|
||||
if (!isSimFrame) {
|
||||
i_this->calcMaterial();
|
||||
i_this->diff();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
s32 J3DModel::createShapePacket(J3DModelData* pModelData) {
|
||||
J3D_ASSERTMSG(173, pModelData != NULL, "Error : null pointer.");
|
||||
|
||||
@@ -452,11 +462,11 @@ void J3DModel::calc() {
|
||||
|
||||
#ifdef TARGET_PC
|
||||
for (u16 i = 0; i < mModelData->getJointNum(); ++i) {
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(getAnmMtx(i)), getAnmMtx(i));
|
||||
dusk::frame_interp::record_final_mtx(getAnmMtx(i));
|
||||
}
|
||||
|
||||
for (u16 i = 0; i < mModelData->getWEvlpMtxNum(); ++i) {
|
||||
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(getWeightAnmMtx(i)), getWeightAnmMtx(i));
|
||||
dusk::frame_interp::record_final_mtx(getWeightAnmMtx(i));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -485,6 +495,11 @@ void J3DModel::entry() {
|
||||
joint->entryIn();
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (mModelData->needsInterpCallBack())
|
||||
dusk::frame_interp::add_interpolation_callback(&J3DModel::interp_callback, this);
|
||||
#endif
|
||||
}
|
||||
|
||||
void J3DModel::viewCalc() {
|
||||
@@ -496,7 +511,7 @@ void J3DModel::viewCalc() {
|
||||
J3DCalcViewBaseMtx(j3dSys.getViewMtx(), mBaseScale, mBaseTransformMtx,
|
||||
(MtxP)&mInternalView);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(&mInternalView, mInternalView);
|
||||
dusk::frame_interp::record_final_mtx(mInternalView);
|
||||
#endif
|
||||
}
|
||||
} else if (isCpuSkinningOn()) {
|
||||
@@ -504,7 +519,7 @@ void J3DModel::viewCalc() {
|
||||
J3DCalcViewBaseMtx(j3dSys.getViewMtx(), mBaseScale, mBaseTransformMtx,
|
||||
(MtxP)&mInternalView);
|
||||
#ifdef TARGET_PC
|
||||
dusk::frame_interp::record_final_mtx_raw(&mInternalView, mInternalView);
|
||||
dusk::frame_interp::record_final_mtx(mInternalView);
|
||||
#endif
|
||||
}
|
||||
} else if (checkFlag(J3DMdlFlag_SkinPosCpu)) {
|
||||
@@ -528,7 +543,7 @@ void J3DModel::viewCalc() {
|
||||
|
||||
#ifdef TARGET_PC
|
||||
for (u16 i = 0; i < mModelData->getDrawMtxNum(); ++i) {
|
||||
dusk::frame_interp::record_final_mtx_raw(&getDrawMtxPtr()[i], getDrawMtxPtr()[i]);
|
||||
dusk::frame_interp::record_final_mtx(getDrawMtxPtr()[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -84,6 +84,15 @@ void J3DModelData::simpleCalcMaterial(u16 idx, Mtx param_1) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
bool J3DModelData::needsInterpCallBack() const {
|
||||
for (u16 i = 0, n = getMaterialNum(); i < n; i++)
|
||||
if (getMaterialNodePointer(i)->needsInterpCallBack())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void J3DModelData::syncJ3DSysPointers() const {
|
||||
j3dSys.setTexture(getTexture());
|
||||
j3dSys.setVtxPos(getVtxPosArray(), getVtxNum());
|
||||
|
||||
@@ -265,7 +265,7 @@ void J3DMaterial::diff(u32 diffFlags) {
|
||||
}
|
||||
|
||||
void J3DMaterial::calc(f32 const (*param_0)[4]) {
|
||||
if (j3dSys.checkFlag(0x40000000)) {
|
||||
if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||
mTexGenBlock->calcPostTexMtx(param_0);
|
||||
} else {
|
||||
mTexGenBlock->calc(param_0);
|
||||
@@ -276,7 +276,7 @@ void J3DMaterial::calc(f32 const (*param_0)[4]) {
|
||||
}
|
||||
|
||||
void J3DMaterial::calcDiffTexMtx(f32 const (*param_0)[4]) {
|
||||
if (j3dSys.checkFlag(0x40000000)) {
|
||||
if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||
mTexGenBlock->calcPostTexMtxWithoutViewMtx(param_0);
|
||||
} else {
|
||||
mTexGenBlock->calcWithoutViewMtx(param_0);
|
||||
@@ -288,7 +288,7 @@ void J3DMaterial::setCurrentMtx() {
|
||||
}
|
||||
|
||||
void J3DMaterial::calcCurrentMtx() {
|
||||
if (!j3dSys.checkFlag(0x40000000)) {
|
||||
if (!j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||
mCurrentMtx.setCurrentTexMtx(
|
||||
getTexCoord(0)->getTexGenMtx(),
|
||||
getTexCoord(1)->getTexGenMtx(),
|
||||
@@ -371,6 +371,30 @@ s32 J3DMaterial::newSingleSharedDisplayList(u32 dlSize) {
|
||||
return kJ3DError_Success;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
bool J3DMaterial::needsInterpCallBack() const {
|
||||
for (int i = 0, n = getTexGenNum(); i < n; i++) {
|
||||
J3DTexMtx* pTexMtx = mTexGenBlock->getTexMtx(i);
|
||||
if (pTexMtx != NULL) {
|
||||
u32 texMtxMode = pTexMtx->getTexMtxInfo().mInfo & 0x3f;
|
||||
|
||||
// uses j3dSys.getViewMtx()
|
||||
switch (texMtxMode) {
|
||||
case J3DTexMtxMode_EnvmapBasic:
|
||||
case J3DTexMtxMode_EnvmapOld:
|
||||
case J3DTexMtxMode_Envmap:
|
||||
case J3DTexMtxMode_ProjmapBasic:
|
||||
case J3DTexMtxMode_Projmap:
|
||||
case J3DTexMtxMode_ViewProjmap:
|
||||
case J3DTexMtxMode_ViewProjmapBasic:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void J3DPatchedMaterial::initialize() {
|
||||
J3DMaterial::initialize();
|
||||
}
|
||||
|
||||
@@ -37,9 +37,9 @@ void loadTexCoordGens(u32 texGenNum, J3DTexCoord* texCoords) {
|
||||
var_r28 = 61;
|
||||
J3DGDWriteXFCmdHdr(GX_XF_REG_DUALTEX0, texGenNum);
|
||||
|
||||
if (j3dSys.checkFlag(0x40000000)) {
|
||||
if (j3dSys.checkFlag(J3DSysFlag_PostTexMtx)) {
|
||||
for (int i = 0; i < texGenNum; i++) {
|
||||
if (texCoords[i].getTexGenMtx() != 60) {
|
||||
if (texCoords[i].getTexGenMtx() != GX_IDENTITY) {
|
||||
var_r28 = i * 3;
|
||||
} else {
|
||||
var_r28 = 61;
|
||||
|
||||
@@ -120,11 +120,19 @@ void JAISeqMgr::mixOut() {
|
||||
}
|
||||
|
||||
JAISeq* JAISeqMgr::beginStartSeq_() {
|
||||
JAISeq* seq = JKR_NEW JAISeq(this, field_0x10);
|
||||
#ifdef TARGET_PC
|
||||
if (JAISeq::getFreeMemCount() == 0) {
|
||||
JUT_WARN(273, "%s", "JASPoolAllocObject::<JAISeq>::operator new failed .\n");
|
||||
return NULL;
|
||||
}
|
||||
return JKR_NEW JAISeq(this, field_0x10);
|
||||
#else
|
||||
JAISeq* seq = new JAISeq(this, field_0x10);
|
||||
if (seq == NULL) {
|
||||
JUT_WARN(273, "%s", "JASPoolAllocObject::<JAISeq>::operator new failed .\n");
|
||||
}
|
||||
return seq;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool JAISeqMgr::endStartSeq_(JAISeq* seq, JAISoundHandle* handle) {
|
||||
|
||||
@@ -55,7 +55,11 @@ void JASDriver::initAI(void (*param_0)(void)) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
sDmaDacBuffer[i] = JKR_NEW_ARRAY_ARGS(s16, dacSize, JASDram, 0x20);
|
||||
JUT_ASSERT(102, sDmaDacBuffer[i])
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(sDmaDacBuffer[i], size);
|
||||
#else
|
||||
JASCalc::bzero(sDmaDacBuffer[i], size);
|
||||
#endif
|
||||
DCStoreRange(sDmaDacBuffer[i], size);
|
||||
}
|
||||
sDspDacBuffer = JKR_NEW_ARRAY_ARGS(s16*, data_804507A8, JASDram, 0);
|
||||
@@ -63,7 +67,11 @@ void JASDriver::initAI(void (*param_0)(void)) {
|
||||
for (int i = 0; i < data_804507A8; i++) {
|
||||
sDspDacBuffer[i] = JKR_NEW_ARRAY_ARGS(s16, getDacSize(), JASDram, 0x20);
|
||||
JUT_ASSERT(119, sDspDacBuffer[i]);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(sDspDacBuffer[i], size);
|
||||
#else
|
||||
JASCalc::bzero(sDspDacBuffer[i], size);
|
||||
#endif
|
||||
DCStoreRange(sDspDacBuffer[i], size);
|
||||
}
|
||||
sDspDacWriteBuffer = data_804507A8 - 1;
|
||||
|
||||
@@ -69,7 +69,11 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
|
||||
JUT_ASSERT(145, list_chunk);
|
||||
|
||||
u8* envt = JKR_NEW_ARRAY_ARGS(u8, envt_chunk->mSize, heap, 2);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bcopy(envt_chunk->mData, envt, envt_chunk->mSize);
|
||||
#else
|
||||
JASCalc::bcopy(envt_chunk->mData, envt, envt_chunk->mSize);
|
||||
#endif
|
||||
|
||||
BE(u32)* ptr = &osc_chunk->mCount;
|
||||
u32 count = *ptr++;
|
||||
@@ -215,7 +219,11 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
|
||||
int size = endPtr - points;
|
||||
JASOscillator::Point* table = JKR_NEW_ARRAY_ARGS(JASOscillator::Point, size, heap, 0);
|
||||
JUT_ASSERT(396, table != NULL);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bcopy(points, table, size * sizeof(JASOscillator::Point));
|
||||
#else
|
||||
JASCalc::bcopy(points, table, size * sizeof(JASOscillator::Point));
|
||||
#endif
|
||||
osc->mTable = table;
|
||||
} else {
|
||||
osc->mTable = NULL;
|
||||
@@ -227,7 +235,11 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
|
||||
int size = endPtr - points;
|
||||
JASOscillator::Point* table = JKR_NEW_ARRAY_ARGS(JASOscillator::Point, size, heap, 0);
|
||||
JUT_ASSERT(409, table != NULL);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bcopy(points, table, size * sizeof(JASOscillator::Point));
|
||||
#else
|
||||
JASCalc::bcopy(points, table, size * sizeof(JASOscillator::Point));
|
||||
#endif
|
||||
osc->rel_table = table;
|
||||
} else {
|
||||
osc->rel_table = NULL;
|
||||
|
||||
@@ -13,7 +13,11 @@ void JASBasicBank::newInstTable(u8 num, JKRHeap* heap) {
|
||||
JUT_ASSERT(31, num <= JASBank::PRG_OSC);
|
||||
mInstNumMax = num;
|
||||
mInstTable = JKR_NEW_ARRAY_ARGS(JASInst*, mInstNumMax, heap, 0);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(mInstTable, mInstNumMax * 4);
|
||||
#else
|
||||
JASCalc::bzero(mInstTable, mInstNumMax * 4);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,11 @@ JASBasicInst::JASBasicInst() {
|
||||
mPitch = 1.0;
|
||||
mKeymapCount = 0;
|
||||
mKeymap = NULL;
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(field_0xc, sizeof(field_0xc));
|
||||
#else
|
||||
JASCalc::bzero(field_0xc, sizeof(field_0xc));
|
||||
#endif
|
||||
}
|
||||
|
||||
JASBasicInst::~JASBasicInst() {
|
||||
|
||||
@@ -33,7 +33,11 @@ void JASCalc::bcopyfast(const void* src, void* dest, u32 size) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_ANDROID
|
||||
void JASCalc::_bcopy(const void* src, void* dest, u32 size) {
|
||||
#else
|
||||
void JASCalc::bcopy(const void* src, void* dest, u32 size) {
|
||||
#endif
|
||||
u32* usrc;
|
||||
u32* udest;
|
||||
|
||||
@@ -90,7 +94,11 @@ void JASCalc::bzerofast(void* dest, u32 size) {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_ANDROID
|
||||
void JASCalc::_bzero(void* dest, u32 size) {
|
||||
#else
|
||||
void JASCalc::bzero(void* dest, u32 size) {
|
||||
#endif
|
||||
u32* udest;
|
||||
u8* bdest = (u8*)dest;
|
||||
if ((size & 0x1f) == 0 && (reinterpret_cast<uintptr_t>(dest) & 0x1f) == 0) {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAudio2/JASChannel.h"
|
||||
#if TARGET_PC
|
||||
#include "dusk/audio/DuskDsp.hpp"
|
||||
#endif
|
||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||
#include "JSystem/JAudio2/JASCalc.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
@@ -170,7 +173,12 @@ void JASChannel::updateEffectorParam(JASDsp::TChannel* i_channel, u16* i_mixerVo
|
||||
|
||||
f32 pan = 0.5f;
|
||||
f32 dolby = 0.0f;
|
||||
switch (JASDriver::getOutputMode()) {
|
||||
#if TARGET_PC
|
||||
u32 effectiveOutputMode = dusk::audio::EnableHrtf ? JAS_OUTPUT_SURROUND : JASDriver::getOutputMode();
|
||||
#else
|
||||
u32 effectiveOutputMode = JASDriver::getOutputMode();
|
||||
#endif
|
||||
switch (effectiveOutputMode) {
|
||||
case JAS_OUTPUT_MONO:
|
||||
break;
|
||||
case JAS_OUTPUT_STEREO:
|
||||
|
||||
@@ -434,8 +434,14 @@ void JASDsp::initBuffer() {
|
||||
JUT_ASSERT(354, CH_BUF);
|
||||
FX_BUF = JKR_NEW_ARRAY_ARGS(FxBuf, 4, JASDram, 0x20);
|
||||
JUT_ASSERT(356, FX_BUF);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
|
||||
JASCalc::_bzero(FX_BUF, sizeof(FxBuf) * 4);
|
||||
#else
|
||||
JASCalc::bzero(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
|
||||
JASCalc::bzero(FX_BUF, sizeof(FxBuf) * 4);
|
||||
#endif
|
||||
|
||||
for (u8 i = 0; i < 4; i++) {
|
||||
setFXLine(i, NULL, NULL);
|
||||
}
|
||||
@@ -459,7 +465,11 @@ int JASDsp::setFXLine(u8 param_0, s16* buffer, JASDsp::FxlineConfig_* param_2) {
|
||||
if (buffer != NULL && param_2 != NULL) {
|
||||
u32 bufsize = param_2->field_0xc * 0xa0;
|
||||
puVar3->field_0x4 = buffer;
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(buffer, bufsize);
|
||||
#else
|
||||
JASCalc::bzero(buffer, bufsize);
|
||||
#endif
|
||||
JUT_ASSERT(420, ((u32)((uintptr_t)buffer) & 0x1f) == 0);
|
||||
JUT_ASSERT(421, (bufsize & 0x1f) == 0);
|
||||
DCFlushRange(buffer, bufsize);
|
||||
|
||||
@@ -18,7 +18,11 @@ void JASDrumSet::newPercArray(u8 num, JKRHeap* heap) {
|
||||
JUT_ASSERT(39, num <= 128);
|
||||
mPercNumMax = num;
|
||||
mPercArray = JKR_NEW_ARRAY_ARGS(TPerc*, mPercNumMax, heap, 0);
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bzero(mPercArray, mPercNumMax * sizeof(TPerc*));
|
||||
#else
|
||||
JASCalc::bzero(mPercArray, mPercNumMax * sizeof(TPerc*));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +302,6 @@ void JASKernel::setupRootHeap(JKRSolidHeap* heap, u32 size) {
|
||||
JKRHEAP_NAME(sSystemHeap, "JASKernel::sSystemHeap");
|
||||
JUT_ASSERT(787, sSystemHeap);
|
||||
sCommandHeap = JKR_NEW_ARGS (heap, 0) JASMemChunkPool<1024, JASThreadingModel::ObjectLevelLockable>;
|
||||
JKRHEAP_NAME(sSystemHeap, "JASKernel::sCommandHeap");
|
||||
JUT_ASSERT(790, sCommandHeap);
|
||||
JASDram = heap;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,11 @@ int JASReportCopyBuffer(char *param_1,int lines) {
|
||||
r30 = sLineMax - 1;
|
||||
}
|
||||
src = &sBuffer[r30 * 64];
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bcopy(src, dest, 64);
|
||||
#else
|
||||
JASCalc::bcopy(src, dest, 64);
|
||||
#endif
|
||||
r30--;
|
||||
dest += 64;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,11 @@ void* JASTaskThread::allocCallStack(JASThreadCallback callback, const void* msg,
|
||||
}
|
||||
|
||||
callStack->msgType_ = 1;
|
||||
#if TARGET_ANDROID
|
||||
JASCalc::_bcopy(msg, callStack->msg.buffer, msgSize);
|
||||
#else
|
||||
JASCalc::bcopy(msg, callStack->msg.buffer, msgSize);
|
||||
#endif
|
||||
callStack->callback_ = callback;
|
||||
return callStack;
|
||||
}
|
||||
|
||||
@@ -442,6 +442,7 @@ static JAUSectionHeap* JAUNewSectionHeap(JKRSolidHeap* heap, bool param_1) {
|
||||
JAUSectionHeap* JAUNewSectionHeap(bool param_0) {
|
||||
s32 freeSize = JASDram->getFreeSize();
|
||||
JKRSolidHeap* sectionHeap = JKRCreateSolidHeap(freeSize, JASDram, true);
|
||||
JKRHEAP_NAME(sectionHeap, "sectionHeap");
|
||||
JUT_ASSERT(821, sectionHeap);
|
||||
return JAUNewSectionHeap(sectionHeap, param_0);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/settings.h"
|
||||
#include "dusk/time.h"
|
||||
#include "f_op/f_op_overlap_mng.h"
|
||||
|
||||
#include "SDL3/SDL_timer.h"
|
||||
#include "tracy/Tracy.hpp"
|
||||
@@ -205,14 +206,6 @@ void JFWDisplay::preGX() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TARGET_PC
|
||||
static s32 s_faderSimSteps = -1;
|
||||
|
||||
void JFWDisplay::setFaderSimSteps(u32 steps) {
|
||||
s_faderSimSteps = static_cast<s32>(steps);
|
||||
}
|
||||
#endif
|
||||
|
||||
void JFWDisplay::endGX() {
|
||||
s32 bufferNum = JUTXfb::getManager()->getBufferNum();
|
||||
u16 width = JUTVideo::getManager()->getFbWidth();
|
||||
@@ -224,17 +217,10 @@ void JFWDisplay::endGX() {
|
||||
if (mFader != NULL) {
|
||||
ortho.setPort();
|
||||
#ifdef TARGET_PC
|
||||
u32 advance_count = 1;
|
||||
if (dusk::getSettings().game.enableFrameInterpolation && s_faderSimSteps >= 0) {
|
||||
advance_count = static_cast<u32>(s_faderSimSteps);
|
||||
s_faderSimSteps = -1;
|
||||
} else {
|
||||
s_faderSimSteps = -1;
|
||||
}
|
||||
for (u32 i = 0; i < advance_count; i++) {
|
||||
if (dusk::frame_interp::get_ui_tick_pending()) {
|
||||
mFader->advance();
|
||||
}
|
||||
if (mFader->getStatus() != 1) {
|
||||
if (mFader->getStatus() != JUTFader::Wait) {
|
||||
mFader->draw();
|
||||
}
|
||||
#else
|
||||
@@ -383,22 +369,30 @@ constexpr auto FRAME_PERIOD = std::chrono::duration_cast<std::chrono::nanosecond
|
||||
std::chrono::duration<double>(1001.0 / 30000.0));
|
||||
constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2;
|
||||
|
||||
static void waitPrecise(Limiter& limiter, Uint64 targetNs) {
|
||||
const auto sleepTime = limiter.SleepTime(std::chrono::nanoseconds(targetNs));
|
||||
static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) {
|
||||
const auto sleepTime = limiter.SleepTime(targetNs);
|
||||
dusk::frameUsagePct =
|
||||
100.0f * (1.0f - static_cast<float>(sleepTime.count()) / static_cast<float>(targetNs));
|
||||
limiter.Sleep(std::chrono::nanoseconds(targetNs));
|
||||
100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs));
|
||||
limiter.Sleep(targetNs);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void waitForTick(u32 p1, u16 p2) {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (dusk::getSettings().game.enableFrameInterpolation && !dusk::getTransientSettings().skipFrameRateLimit) {
|
||||
dusk::frameUsagePct = 0.f;
|
||||
return;
|
||||
}
|
||||
if (dusk::getTransientSettings().skipFrameRateLimit) {
|
||||
p1 = OS_TIMER_CLOCK / 120;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
ZoneScopedC(tracy::Color::DimGray);
|
||||
#endif
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user