Compare commits

..

199 Commits

Author SHA1 Message Date
Luke Street 0c1372f986 Revert "Kinda crappy initial controller support"
This reverts commit 23a91a37be.
2026-04-27 21:55:57 -06:00
TakaRikka a4777045fe Merge pull request #578 from TwilitRealm/fix/fix-disable-hud
Fix bugs with Disable Main HUD
2026-04-27 15:29:02 -07:00
TakaRikka bbe8ea6aa6 Merge pull request #577 from TwilitRealm/better-freecam-code
Better Freecam code + Allow Freecam in Target mode
2026-04-27 15:28:39 -07:00
MelonSpeedruns d662db69f0 Fix bugs with Disable Main HUD 2026-04-27 17:04:42 -04:00
MelonSpeedruns 9b259143be Better Freecam code + Allow Freecam in Target mode 2026-04-27 12:05:26 -04:00
Irastris 5f33489465 Register interp callback for d_a_obj_lv8Lift 2026-04-27 01:04:45 -04:00
Luke Street 23a91a37be Kinda crappy initial controller support 2026-04-26 21:01:41 -06:00
TakaRikka a886f8a2df Merge pull request #568 from TwilitRealm/fix/d_a_obj_balloon
d_a_balloon score and interp fixes
2026-04-26 17:00:30 -07:00
TakaRikka 6df7b1e9cd Merge pull request #357 from TwilitRealm/speedrun-timer
speedrun timer
2026-04-26 16:59:47 -07:00
TakaRikka 206c02b527 fix igt timer 2026-04-26 16:51:10 -07:00
Pheenoh a05d1a9ee6 d_a_balloon score and interp fixes 2026-04-26 17:05:46 -06:00
Howard Luck ed0df01b8d Merge pull request #565 from TwilitRealm/fix/clib_offsetpos
cLib_offsetPos param aliasing fix
2026-04-26 16:09:26 -06:00
Pheenoh 0f9d563a3e cLib_offsetPos param aliasing fix 2026-04-26 15:59:45 -06:00
TakaRikka f3fb65495e Merge pull request #561 from TwilitRealm/fix/pal_lang
Only show language selection if PAL disc
2026-04-26 14:50:14 -07:00
TakaRikka 196f33005e Merge pull request #560 from TwilitRealm/fix/imgui-and-camera-x
ImGui Button name change + Fix Freecam Invert X Axis option
2026-04-26 14:49:40 -07:00
Luke Street 90c0bdded0 Use GXDestroyCopyTex on map destroy
Resolves #469
2026-04-26 14:02:28 -06:00
Pheenoh f856f871bb Only show languages if PAL disc 2026-04-26 13:58:38 -06:00
Jasper St. Pierre e75ea18ef0 map deco perf 2026-04-26 11:52:20 -07:00
Jasper St. Pierre 50e2d9d1a7 grass draw fix
closes #534
2026-04-26 11:18:25 -07:00
Jasper St. Pierre 5c84978c3c evil perf fix
closes #552
2026-04-26 10:44:52 -07:00
MelonSpeedruns 3859f39729 Fix camera radius to be smoother 2026-04-26 10:25:10 -04:00
MelonSpeedruns 3498ded9d9 ImGui Button name change + Fix Freecam Invert X Axis option 2026-04-26 10:18:47 -04:00
Phillip Stephens 8784958c40 Quick PAD rumble fixes, add button to test rumble configuration 2026-04-25 22:51:39 -07:00
Phillip Stephens c1231885fe Add rumble intensity sliders to input configurator (#558) 2026-04-25 23:17:17 -06:00
TakaRikka 2b65a696dd Merge pull request #556 from TwilitRealm/fix/zant_fog
Frame Interp: Fix Zant Fog Spin
2026-04-25 21:31:30 -07:00
Pheenoh 02924549be fix idle howl blinking 2026-04-25 21:21:22 -07:00
TakaRikka 6cf94b4491 remove unneeded file 2026-04-25 21:18:51 -07:00
TakaRikka 30aa2dd527 Merge branch 'main' of github.com:TwilitRealm/dusk into speedrun-timer 2026-04-25 21:16:27 -07:00
TakaRikka 8e121a7e51 update timer impl 2026-04-25 21:12:51 -07:00
Pheenoh 34ec362876 fix zant fog spin and culling 2026-04-25 21:37:11 -06:00
MelonSpeedruns ba58d2486e Free Camera (#542)
* freecam wip

* added manual mode

* fix freecam collision

* made freecam into its own function

* Added settings & Radius modification when camer is higher up

---------

Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
2026-04-25 21:35:43 -06:00
Luke Street f7b5350d60 Update README.md 2026-04-25 20:42:02 -06:00
Howard Luck 9ddfcc38c9 fix interp on ooks rope (#553) 2026-04-25 20:37:36 -06:00
TakaRikka cee66a6fd5 Merge pull request #554 from TwilitRealm/achievements
achievements
2026-04-25 19:25:50 -07:00
madeline 574b6197a2 achievements 2026-04-25 18:23:12 -07:00
Howard Luck 6fc8628144 fix gdorf horseback reins + demo cuts (#551) 2026-04-25 20:44:38 -04:00
Irastris ca9330b412 Register interp callback for d_a_obj_lv8OptiLift
Fixes disappearing platforms
2026-04-25 20:40:29 -04:00
Luke Street 1b792eb964 Update aurora 2026-04-25 16:18:16 -06:00
Howard Luck 0e5ea0d3b1 fix d_meter_button flashing (#549) 2026-04-25 15:48:45 -06:00
Pieter-Jan Briers 977ad16806 GCN PAL support (#533)
* Basic PAL ISO & language support

Probably still needs much more work

* Add language selector to pre-launch

* Store DVDDiskID in a global

Can use this later for things

* More version system API improvements

* d_name mostly region switching fully

JPN doesn't work yet cuz it'll be a nightmare, probably.

* More version switching support

* Mark GCN PAL as supported ROM

* Fix remaining REL assets to have PAL offsets

* d_a_mg_fish PAL

* d_a_mg_fshop PAL

* isRegionUsa helper

* d_menu_fishing PAL

* d_msg_class PAL

* m_Do_MemCardRWmng PAL

* Update CARDInit call & remove DUSK_TP_VERSION

* Fix Ganon cape

Missed this one.

* Remove tp_version from Sentry

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-04-25 15:46:12 -06:00
Irastris 41420bc71c Chu Fix 2: Electric Boogaloo 2026-04-25 17:08:22 -04:00
Irastris 5ec5f8864a Register interp callback for d_a_e_sm2
Fixes chu color changes
2026-04-25 16:59:48 -04:00
MelonSpeedruns 60e8836968 Tears Collect during cutscenes (#539)
TPHD has tears collectable just as fast during cutscenes, this changes our implementation to reflect that.

Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
2026-04-25 14:59:30 -06:00
MelonSpeedruns e755148f16 Fix some UBs (#544)
Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
2026-04-25 14:59:04 -06:00
TakaRikka 17949e526b Merge branch 'main' of github.com:TwilitRealm/dusk into speedrun-timer 2026-04-25 06:05:50 -07:00
Luke Street 4e264d6a22 Fix Zbuffer texture binding
Resolves #511
2026-04-24 22:53:48 -06:00
Irastris c8e89a0f99 Fix grass cutting when interp is enabled 2026-04-25 00:31:40 -04:00
Luke Street c61e32cd4f Update aurora for GXPeekZ
Resolves #281
Resolves #468
2026-04-24 22:10:56 -06:00
Irastris 274bf61b3e Fix Link's hands detaching when interp is enabled 2026-04-24 22:56:47 -04:00
TakaRikka 05b2a5cbe9 Merge pull request #530 from TwilitRealm/fix-event-flag-constant-sorting
Implement custom sorting when sorting event flags by flag on/off
2026-04-24 15:23:49 -07:00
TakaRikka aa838c8003 Merge pull request #532 from TwilitRealm/feature/even-faster-tears
Even faster tears to match TPHD
2026-04-24 15:14:10 -07:00
MelonSpeedruns d5aabe9f9e Even faster tears to match TPHD 2026-04-24 18:06:02 -04:00
roeming 171dbdd0a1 Implement custom sorting when sorting event flags by flag on/off 2026-04-24 16:50:31 -04:00
Luke Street b2c09d56d6 Remove unnecessary logic from dMirror_packet_c::entryModel 2026-04-24 13:34:51 -06:00
Luke Street f0e8379fa5 Fix UaF in d_a_mirror
Resolves #505
2026-04-24 13:19:09 -06:00
Irastris 1fea4f02ed Fix camera bouncing with interp enabled 2026-04-24 14:26:56 -04:00
Luke Street 35ea13c53a Update aurora 2026-04-24 12:25:15 -06:00
PJB3005 5fab665f21 Don't allocate giant unused stacks for movie player
How to save 800 KiB of commit charge easy
2026-04-24 15:25:14 +02:00
madeline 109f0a50e5 fix sun song again 2026-04-24 03:37:35 -07:00
Irastris 746910c59f Register interp callback for d_a_obj_item
Fixes rupee color changes
2026-04-24 05:13:31 -04:00
CraftyBoss ae4806ae4f Merge remote-tracking branch 'origin/main' 2026-04-23 23:40:36 -07:00
CraftyBoss 1c00e2cdde fix unsafe cstr usage in flag editor, remove stray backslash 2026-04-23 23:40:20 -07:00
Luke Street 78301a8a83 Restore half-size in drawDepth2 2026-04-24 00:39:20 -06:00
CraftyBoss ca798049b3 Merge remote-tracking branch 'origin/main' 2026-04-23 23:31:24 -07:00
CraftyBoss daf4b1dfeb update aurora, add pre launch option to determine save file type (gci or raw) 2026-04-23 23:31:07 -07:00
TakaRikka 5bdd31a5af Merge pull request #517 from TwilitRealm/midna-eye
Clamp max LOD for Wolf Link and Midna eyes
2026-04-23 22:43:16 -07:00
Luke Street 3cb5e5172b Add Adult Link eye LOD fix 2026-04-23 23:42:15 -06:00
TakaRikka d625c7ab0c fix save editor clothes change crash 2026-04-23 20:26:50 -07:00
Luke Street c2045391c8 Fix a couple issues for Xcode projects (#513)
* Link separate JSystem libraries due to control.cpp

This allows the Xcode generator to work, otherwise
it breaks on the duplicate control.o files within
the game_debug library.

* Fix __memcpy define on GCC

* Try LINK_GROUP:RESCAN for GNU ld

* Combine dusk/game_base/game_debug targets

* Fix compile defs syntax
2026-04-23 21:05:38 -06:00
TakaRikka f04a0ffcf1 forgot pic oops 2026-04-23 15:12:40 -07:00
TakaRikka dfdac1c1cd update setup instructions 2026-04-23 15:11:51 -07:00
TakaRikka f4b361ab02 Merge pull request #510 from TwilitRealm/feature/thinner-map-lines
Thinner map lines at higher resolution
2026-04-23 14:36:02 -07:00
TakaRikka 5f3d3012ff Merge pull request #509 from TwilitRealm/fix/ring_menu_cursor_interp
Frame interp: interpolate ring menu cursor along arc
2026-04-23 14:09:35 -07:00
TakaRikka 0897ef1132 Merge pull request #508 from TwilitRealm/fix/wolf-dive-fix
Fix Sun Song check
2026-04-23 14:08:44 -07:00
TakaRikka 8b89dbcbf0 Merge pull request #506 from TwilitRealm/instant-text-responsiveness
Instant Text: Fix holding B in the middle of a textbox
2026-04-23 14:08:09 -07:00
TakaRikka f24e944ab0 Merge pull request #492 from TwilitRealm/feature/gamepad-color
Gamepad Colors for DS4/DS5
2026-04-23 14:07:43 -07:00
MelonSpeedruns 23130d5a57 Thinner map lines at higher resolution
Affects both the Map Menu and the Mini-Map.
2026-04-23 15:08:34 -04:00
Luke Street 1e6e1976e3 Clamp max LOD for Wolf Link and Midna eyes 2026-04-23 13:07:42 -06:00
MelonSpeedruns 4453316bb0 Separated gamepad color into its own files 2026-04-23 14:25:50 -04:00
Pheenoh 14aeefb813 Frame interp: interpolate ring menu cursor along arc 2026-04-23 08:38:47 -06:00
MelonSpeedruns c991c7c407 Fixes sun songing underwater 2026-04-23 09:42:02 -04:00
madeline 251c6e7aec more precise link debug info 2026-04-23 06:28:16 -07:00
madeline cf2357fff2 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-23 03:58:38 -07:00
madeline 06e6b0d47e fix safety bit on interp fixes #507 2026-04-23 03:58:35 -07:00
gymnast86 a83b4186af fix holding B in the middle of text 2026-04-23 03:25:19 -07:00
TakaRikka dc5de83436 Merge pull request #503 from TwilitRealm/feature/rotate-link-doll
Add ability to rotate link on the collection screen
2026-04-22 23:36:55 -07:00
TakaRikka 77425b4b25 Merge pull request #500 from TwilitRealm/fix/interp_dselect_cursor_ring_menu
Frame Interp: dselect_cursor_c in d_menu_ring
2026-04-22 23:31:16 -07:00
Phillip Stephens 5a109313cb Minor tooltip cleanup 2026-04-22 23:02:11 -07:00
Phillip Stephens d8a7927602 Clarify tooltip 2026-04-22 22:59:56 -07:00
Phillip Stephens cccddee106 Add ability to rotate link on the collection screen 2026-04-22 22:58:38 -07:00
madeline 6c252c6d26 disallow breaking share state by overlapping loads 2026-04-22 22:37:21 -07:00
madeline b06c1911c6 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-22 22:33:59 -07:00
madeline 7c9e99220a better impl of insta state shares 2026-04-22 22:33:55 -07:00
madeline bfd8b9f453 make state share loads basically instant 2026-04-22 22:27:14 -07:00
Pheenoh 53e8662335 frame interp: dselect_cursor_c in d_menu_ring 2026-04-22 21:57:36 -06:00
Luke Street ae54f024cd Update aurora 2026-04-22 21:48:58 -06:00
TakaRikka 9aa391c5bf Merge pull request #499 from TwilitRealm/fix/dmap_frame_interp
Frame interp: Fix dmap scroll arrows
2026-04-22 17:41:56 -07:00
TakaRikka ec48249934 Merge pull request #495 from TwilitRealm/limiter
Limiter: Use SDL_GetTicksNS instead of std::chrono
2026-04-22 17:40:47 -07:00
Pheenoh 6a8f3516f9 Frame interp: Fix dmap scroll arrows 2026-04-22 18:35:07 -06:00
TakaRikka 79d4835784 Merge pull request #496 from TwilitRealm/feat/esc_fs
Press esc to exit full screen
2026-04-22 17:00:54 -07:00
TakaRikka b1a4783e38 Merge pull request #494 from TwilitRealm/fix/wide-fused-shadows
Widescreenified Fused Shadow Animations for all first 3 bosses
2026-04-22 16:59:45 -07:00
Pheenoh 0038afa392 Press esc to exit full screen 2026-04-22 17:51:16 -06:00
Luke Street 5fcffa0b4f Use SDL_GetTicksNS instead of std::chrono 2026-04-22 17:18:18 -06:00
MelonSpeedruns 9e9d11ae89 Widescreenified Fused Shadow Animations for all first 3 bosses 2026-04-22 18:47:51 -04:00
TakaRikka 97bd84725c Merge pull request #491 from TwilitRealm/gyro-roll
Incorporate roll into gyro horizontal aiming
2026-04-22 14:45:57 -07:00
Captain Kitty Cat 19c86b1b73 Items Don't Despawn (#488)
* Indefinite Item Drops

* Preserve Disappear Effect when Disabled

* Changed to "Items Don't Despawn". Under "Cheats"

* SetItemTooltip for description
2026-04-22 12:27:54 -06:00
Luke Street ca247095da Reset gravity baseline on aim start 2026-04-22 12:20:44 -06:00
MelonSpeedruns c350b7b8ed fix building on linux 2026-04-22 13:52:14 -04:00
Luke Street ac3d3314c4 Incorporate roll into gyro horizontal aiming 2026-04-22 11:47:40 -06:00
MelonSpeedruns f916a48db0 optimized code and removed bugs 2026-04-22 13:36:06 -04:00
MelonSpeedruns 6963a4b554 Merge remote-tracking branch 'origin/main' into feature/gamepad-color
# Conflicts:
#	src/f_ap/f_ap_game.cpp
2026-04-22 13:01:03 -04:00
MelonSpeedruns 4466bf4e12 wip 2026-04-22 13:00:35 -04:00
madeline c4d01b82a6 get rid of old logs 2026-04-22 03:16:13 -07:00
madeline 42e8d9ab9d name fix 2026-04-22 02:50:49 -07:00
madeline 9c562ff740 state packs and partial states 2026-04-22 02:44:58 -07:00
madeline 1787de517c properly set oxygen in share states 2026-04-22 01:55:23 -07:00
madeline 832e567620 better share states 2026-04-22 01:50:17 -07:00
Luke Street 319efbe662 Reset game clock with over 250ms frame gap 2026-04-22 00:30:11 -06:00
Luke Street 6f34bb050a Call J3DModel::diff in mDoExt_modelEntryDL when interpolating
Fixes #355
2026-04-22 00:17:52 -06:00
Irastris a2a56122e2 Gyro: Hawk Aiming 2026-04-22 01:46:10 -04:00
Irastris 58f2679def Rollgoal: Gyro & Mirror Mode Fixes 2026-04-22 01:41:35 -04:00
Luke Street 396ea02fe5 Fix flowers with interpolation on (#486) 2026-04-21 23:33:03 -06:00
TakaRikka 8100ddb990 Merge pull request #485 from TwilitRealm/frame-pacing-2
Rework interpolation pacing; interpolate every frame
2026-04-21 22:05:33 -07:00
Luke Street d78c46a628 Rework interpolation pacing; interpolate every frame 2026-04-21 22:45:18 -06:00
Phillip Stephens 1e93657ab5 Update aurora for fix 2026-04-21 19:25:28 -07:00
madeline 366e47245e make sun song play the correct notes 2026-04-21 19:23:53 -07:00
madeline 4c53ba91be Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-21 18:59:23 -07:00
madeline cf080523cb dsp oscillator channels fixes #471 fixes #131 2026-04-21 18:59:11 -07:00
Luke Street a15d0af139 Better fix for mirror crashes 2026-04-21 17:39:53 -06:00
Luke Street d99205ecc6 Update aurora 2026-04-21 17:12:28 -06:00
TakaRikka dd3a61d84c fix dmap background 2026-04-21 15:13:55 -07:00
Luke Street 595a6f1c9e Enable DoF (+ setting) & fix texture cache leak 2026-04-21 14:52:26 -06:00
MelonSpeedruns 18d70df188 Small Imgui changes for better visibility by end user (#473)
Co-authored-by: MelonSpeedruns <melonspeedruns@stratobox.net>
2026-04-21 10:17:56 -06:00
TakaRikka 46f6dc67c1 make file select card wait times obey instantSaves setting 2026-04-21 00:46:22 -07:00
madeline 6267b79da3 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-20 20:22:12 -07:00
madeline 62f3d09076 fix incorrect eldin field name on map 2026-04-20 20:22:06 -07:00
Luke Street 4b3c559df3 CMake: Don't build a game static lib 2026-04-20 20:47:03 -06:00
Luke Street 30a99c22f1 Reorganize ImGui menus (#456)
* Reorganize ImGui menus

* Fix crash_reporting.cpp

* Update aurora
2026-04-20 20:45:16 -06:00
TakaRikka 360cb37028 Merge pull request #463 from TwilitRealm/fix/interp_map_save
Frame Interp: d_menu_save and d_menu_fmap2D
2026-04-20 19:17:56 -07:00
TakaRikka 4b6b41a6aa Merge pull request #461 from TwilitRealm/26-04-21-thp-shutdown-crash
Fix THP shutdown crash
2026-04-20 18:45:29 -07:00
Pheenoh faa8618124 Fix frame interpolation on save and world map menus 2026-04-20 19:37:38 -06:00
PJB3005 89acf923e0 Fix THP shutdown crash
Cleanly shut down movie player threads on exit.

I'm not 100% fond of having to manually insert a call like this into the shutdown logic, but the other solution is shutting down all processes and that's likely to result in causing more crashes.
2026-04-21 01:11:49 +02:00
Irastris c42a33154c Frame Interp: Fix flickering refraction in cutscenes 2026-04-20 18:11:27 -04:00
madeline a074e30147 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-20 06:45:09 -07:00
madeline 2ce272d586 fix some menus scaling wrong 2026-04-20 06:45:05 -07:00
TakaRikka e1636e20bd Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-20 06:14:28 -07:00
TakaRikka 9904720e5a better lv5key fix 2026-04-20 06:14:21 -07:00
madeline 9910320fb4 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-20 06:10:22 -07:00
madeline b43a9e2ccc menu cursor resizing fixes #313 closes #314 2026-04-20 06:10:18 -07:00
TakaRikka 23d81492e6 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-20 06:02:11 -07:00
TakaRikka 65b0ec3f90 add failsafes to lv5key to avoid reverse unlock softlock 2026-04-20 06:02:03 -07:00
madeline 91248d10db disable water refraction in debug, fixes #422 2026-04-20 05:36:31 -07:00
TakaRikka f76a4d7087 add dMsgUnit_c::setTag bug fix 2026-04-20 05:15:02 -07:00
TakaRikka c7b609945b fix option menu widescreen regression 2026-04-20 04:48:58 -07:00
TakaRikka 6ca6ea8065 fix crawl arrow direction with mirror mode 2026-04-20 04:16:35 -07:00
TakaRikka 315f621176 Merge pull request #450 from TwilitRealm/discord
Discord rich presence
2026-04-20 03:36:03 -07:00
madeline 10d9a818c2 fix apple ci? 2026-04-20 00:31:41 -07:00
madeline e3761784af rich presence 2026-04-20 00:21:09 -07:00
Phillip Stephens d85556a063 Use vendored SDL on ubuntu for libusb (#448) 2026-04-19 23:27:29 -06:00
madeline c43f33a5bc Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-19 21:43:32 -07:00
madeline e63897d1f7 add --console to launch.json 2026-04-19 21:43:29 -07:00
Howard Luck 35a69e7ff1 Frame interp pacing/camera cuts, King Bulblin reins, and crash fixes
* misc fixes round 1

* kb1 fixes

* fixes for encounter/ira
2026-04-20 00:34:13 -04:00
Luke Street 8b9f09bda5 Frame interp: Fix cloud shadow flickering (#446) 2026-04-19 21:31:34 -06:00
Jasper St. Pierre 32cddc725b mirror flicker fix 2 2026-04-19 16:21:30 -07:00
Jasper St. Pierre 55eec3b0de hitstun camera interp fix 2026-04-19 16:01:51 -07:00
TakaRikka 1cf14f176c Merge pull request #438 from TwilitRealm/frame-interp-simplify
Frame interp simplify
2026-04-19 14:58:38 -07:00
TakaRikka 74550b031f Merge pull request #436 from TwilitRealm/feat/pause_on_unfocus
Add pause on unfocus feature
2026-04-19 14:26:58 -07:00
Jasper St. Pierre 2f84f0eaa4 j3d small cleanup 2026-04-19 14:16:38 -07:00
Jasper St. Pierre 3ed7ef1c88 fix stone shadow flicker 2026-04-19 13:22:00 -07:00
Jasper St. Pierre eace147652 mirror interp fix 2026-04-19 12:57:30 -07:00
Jasper St. Pierre 53c005c4f1 jutfader doc 2026-04-19 12:48:50 -07:00
Jasper St. Pierre a4ff97564c minor cleanup 2026-04-19 12:39:08 -07:00
Jasper St. Pierre c6beeba14f proct 2026-04-19 11:56:48 -07:00
Jasper St. Pierre e470278717 grass/flower/shadow interp fixes 2026-04-19 10:27:37 -07:00
Pheenoh 783230b654 Add pause on unfocus feature 2026-04-19 10:02:55 -06:00
TakaRikka 4e7711725a attempt to fix clawshot aim model position 2026-04-19 03:58:22 -07:00
Jasper St. Pierre e5bf7606ec run d_a_bg::draw on interp frames
to set up lights. this is a somewhat hacky workaround for lighting setup, but it might be good enough?
2026-04-19 03:19:44 -07:00
Jasper St. Pierre aa377cd5c1 add alternate to interp callbacks, flags on the leafdraw 2026-04-19 02:43:25 -07:00
Jasper St. Pierre bb9a88d7dc frame interp camera cleanups 2026-04-19 02:25:00 -07:00
Jasper St. Pierre 341e97ba82 simple shadow interp fix 2026-04-19 01:14:58 -07:00
Jasper St. Pierre 8d3cb51157 frame interp simplify 2026-04-18 23:26:28 -07:00
TakaRikka 7fff3b5ae0 Merge pull request #430 from TwilitRealm/fix/JAISeqMgr
Fix JAISeqMgr
2026-04-18 22:57:57 -07:00
TakaRikka 6beb73b7a6 Merge pull request #429 from TwilitRealm/fix/d_menu_fmap2d_interp
Fix d_menu_fmap2d interpolation for tears of light
2026-04-18 22:57:45 -07:00
Jasper St. Pierre c239a5a226 freelook fix 2026-04-18 22:45:54 -07:00
Jasper St. Pierre b3f8fecfe4 water interpolation fix 2026-04-18 22:17:35 -07:00
Phillip Stephens 6dcf4942f5 Update aurora for CARDFormat speedup 2026-04-18 21:51:28 -07:00
Phillip Stephens cd7e429a66 Fix memory card not properly attaching on init. (#433)
* Fix memory card not properly attaching on init.

Previously the card status was forced to ready which caused quite a bit of default state getting set properly,
reverting that and setting mCardCommand to `COMM_ATTACH_e` allows the memory card system to properly probe and
detect the card status.

A companion fix in aurora addresses the "Memory Card corrupted" error message.

* Update aurora
2026-04-18 21:33:02 -07:00
Pheenoh fcfcb35929 fix JAISeqMgr beginStartSeq_ to check free memory before allocation 2026-04-18 19:53:40 -06:00
Pheenoh 82b20be436 Merge remote-tracking branch 'origin/main' into fix/d_menu_fmap2d_interp 2026-04-18 19:34:57 -06:00
Pheenoh 33101d8050 fix minimap tear of light flash not respecting interpolation 2026-04-18 19:34:38 -06:00
TakaRikka 05160a968c Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-18 18:08:40 -07:00
TakaRikka 623f29eb24 volume setting effects movie now 2026-04-18 18:08:33 -07:00
TakaRikka 0a3833818a Merge pull request #427 from TwilitRealm/fix/interp_d_file_select
Fix file select fade not rendering with frame interpolation
2026-04-18 16:17:54 -07:00
TakaRikka 4f276252a3 Merge branch 'main' of https://github.com/TakaRikka/dusk 2026-04-18 15:54:47 -07:00
TakaRikka d17c629ce0 fix bulblin eye glow 2026-04-18 15:54:42 -07:00
Pheenoh 5bcc969778 fix file select fade not rendering with frame interpolation 2026-04-18 16:53:48 -06:00
MelonSpeedruns 31c5397ae3 Gamepad Color Implementation 2026-04-15 14:36:20 -04:00
TakaRikka 0d76b90144 Merge branch 'main' of https://github.com/TakaRikka/dusk into speedrun-timer 2026-04-14 04:10:28 -07:00
madeline a6690c2052 speedrun timer 2026-04-12 23:22:25 -07:00
180 changed files with 6013 additions and 1721 deletions
+1 -1
View File
@@ -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}",
+102 -39
View File
@@ -90,6 +90,11 @@ 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 ()
@@ -275,22 +280,16 @@ 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
@@ -307,6 +306,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)
@@ -316,6 +319,48 @@ 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)
if ("${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}" STREQUAL "" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -332,47 +377,65 @@ 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>")
target_include_directories(game_debug PRIVATE ${GAME_INCLUDE_DIRS})
target_include_directories(game_base PRIVATE ${GAME_INCLUDE_DIRS})
# 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})
if(ANDROID)
add_library(dusk SHARED src/dusk/main.cpp)
set_target_properties(dusk PROPERTIES OUTPUT_NAME main)
else ()
add_executable(dusk src/dusk/main.cpp)
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_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)
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 ()
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 ()
+4 -1
View File
@@ -358,7 +358,10 @@
"inherits": [
"relwithdebinfo",
"ci"
]
],
"cacheVariables": {
"AURORA_SDL3_PROVIDER": "vendor"
}
},
{
"name": "x-linux-ci-gcc",
+8 -36
View File
@@ -4,56 +4,28 @@
- ### **[Discord](https://discord.gg/QACynxeyna)**
# Setup
**⚠️Dusk does NOT provide any copyrighted assets. You must provide your own copy of the game.**
**⚠️ Dusk does NOT provide any copyrighted assets. You must provide your own copy of the game.**
### 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 |
### 2. Download [Dusk](https://github.com/TwilitRealm/dusk/releases)
### 3. Setup the game
#### Windows
- Extract the zip folder
- Place your dump of the game into the same folder where you extracted to
- Launch `dusk.exe`
- Launch Dusk
- Select Options, then set the ISO Path to your supported game dump
- Press Start Game to play!
#### macOS
- TODO
#### Linux
- TODO
#### iOS
- TODO
#### android
- TODO
![Dusk options](assets/dusk_options.png)
# Building
If you'd like to build Dusk from source, please read the [build instructions](docs/building.md).
# Credits
- Taka
- encounter
- Antidote
- caseif
- CraftyBoss
- crowell
- dooplecks
- gymnast86
- Irastris
- kipcode66
- Lars
- LunarSoap
- Maddie
- MelonSpeedruns
- Pheenoh
- PJB
- Roeming
- YunataSavior
Special thanks to the TP Decomp team, the GC/Wii Decomp community, the Aurora developers, and the TP speedrunning community.
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

-10
View File
@@ -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
+1 -1
+90 -6
View File
@@ -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
@@ -1342,13 +1422,13 @@ 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.cpp
src/dusk/gamepad_color.cpp
src/dusk/io.cpp
src/dusk/layout.cpp
src/dusk/logging.cpp
@@ -1366,8 +1446,6 @@ set(DUSK_FILES
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
@@ -1382,9 +1460,15 @@ 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/achievements.cpp
src/dusk/iso_validate.cpp
src/dusk/livesplit.cpp
src/dusk/offset_ptr.cpp
src/dusk/OSContext.cpp
src/dusk/OSThread.cpp
src/dusk/OSMutex.cpp
src/dusk/discord_presence.cpp
src/dusk/version.cpp
)
+9
View File
@@ -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);
+6
View File
@@ -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);
+9
View File
@@ -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);
+3
View File
@@ -25,6 +25,9 @@ public:
/* 0x164 */ cXyz mMinVal;
/* 0x170 */ cXyz mMaxVal;
/* 0x17C */ cXyz mViewScale;
#if TARGET_PC
bool mbReset = false;
#endif
};
/**
+6
View File
@@ -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;
+3
View File
@@ -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); }
+2 -4
View File
@@ -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;
};
+6
View File
@@ -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; }
+5
View File
@@ -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);
+2 -4
View File
@@ -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
+4
View File
@@ -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;
+16
View File
@@ -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 */
+4
View File
@@ -103,6 +103,10 @@ public:
field_0xd98 = param_1;
}
#if TARGET_PC
void resetScrollArrowMask() { field_0xdda = 0; }
#endif
/* 0xC98 */ JKRExpHeap* mpHeap;
/* 0xC9C */ JKRExpHeap* mpTalkHeap;
/* 0xCA0 */ STControl* mpStick;
+3 -1
View File
@@ -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];
+9
View File
@@ -206,6 +206,15 @@ private:
/* 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
};
+5
View File
@@ -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 */
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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;
+10
View File
@@ -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;
+65
View File
@@ -0,0 +1,65 @@
#pragma once
#include <cstdint>
#include <functional>
#include <queue>
#include <string>
#include <vector>
#include "nlohmann/json.hpp"
namespace dusk {
enum class AchievementCategory : uint8_t {
Story,
Collection,
Challenge,
Minigame,
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();
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;
bool m_loaded = false;
bool m_dirty = false;
std::queue<std::string> m_pendingUnlocks;
};
} // namespace dusk
+2
View File
@@ -12,6 +12,8 @@ namespace dusk::audio {
void SetMasterVolume(f32 value);
void SetPaused(bool paused);
u32 GetResetCount(int channelIdx);
f32 VolumeFromU16(u16 value);
+18
View File
@@ -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
-1
View File
@@ -6,7 +6,6 @@
#include "aurora/gfx.h"
extern AuroraInfo auroraInfo;
extern const char* configPath;
namespace dusk {
extern AuroraStats lastFrameAuroraStats;
+12 -3
View File
@@ -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
+18 -21
View File
@@ -1,5 +1,4 @@
#ifndef DUSK_FRAME_INTERP_H
#define DUSK_FRAME_INTERP_H
#pragma once
#include <dolphin/mtx.h>
#include <stdbool.h>
@@ -7,6 +6,7 @@
#include <stdint.h>
class camera_process_class;
class view_class;
#ifdef __cplusplus
namespace dusk {
@@ -16,40 +16,37 @@ void ensure_initialized();
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 request_presentation_sync();
bool presentation_sync_active();
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();
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 record_final_mtx_raw_tagged(const Mtx* dest, const Mtx src, uint64_t stable_tag);
bool is_sim_frame();
bool lookup_replacement(const void* source, Mtx out);
void record_camera(::camera_process_class* cam, int camera_id);
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* key, Mtx out);
bool lookup_concat_replacement(const void* lhs, const void* rhs, Mtx out);
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();
struct PresentationCameraScope {
PresentationCameraScope() { begin_presentation_camera(); }
~PresentationCameraScope() { end_presentation_camera(); }
PresentationCameraScope(const PresentationCameraScope&) = delete;
PresentationCameraScope& operator=(const PresentationCameraScope&) = delete;
PresentationCameraScope(PresentationCameraScope&&) = delete;
PresentationCameraScope& operator=(PresentationCameraScope&&) = delete;
};
uint64_t alloc_simple_shadow_pair_base();
} // namespace frame_interp
} // namespace dusk
#endif
#endif
+7 -13
View File
@@ -1,13 +1,9 @@
#ifndef DUSK_GAME_CLOCK_H
#define DUSK_GAME_CLOCK_H
#pragma once
#include <stddef.h>
namespace dusk {
namespace game_clock {
namespace dusk::game_clock {
void ensure_initialized();
void reset_accumulator();
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(); }
@@ -17,16 +13,14 @@ constexpr float ui_initial_dt() { return 1.0f / 60.0f; }
struct MainLoopPacer {
float presentation_dt_seconds;
bool is_interpolating;
bool do_sim_tick;
float interpolation_step;
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 game_clock
} // namespace dusk
#endif // DUSK_GAME_CLOCK_H
} // namespace dusk::game_clock
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#ifndef GAMEPAD_COLOR_H
#define GAMEPAD_COLOR_H
void handleGamepadColor();
#endif
+16
View File
@@ -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();
}
+3 -1
View File
@@ -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);
+4
View File
@@ -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
+34 -2
View File
@@ -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
@@ -46,6 +60,8 @@ struct UserSettings {
// Game settings
struct {
ConfigVar<GameLanguage> language;
// QoL
ConfigVar<bool> enableQuickTransform;
ConfigVar<bool> hideTvSettingsScreen;
@@ -66,16 +82,21 @@ struct UserSettings {
// 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;
@@ -91,6 +112,10 @@ struct UserSettings {
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;
@@ -99,6 +124,7 @@ struct UserSettings {
ConfigVar<bool> infiniteOil;
ConfigVar<bool> infiniteOxygen;
ConfigVar<bool> infiniteRupees;
ConfigVar<bool> enableIndefiniteItemDrops;
ConfigVar<bool> moonJump;
ConfigVar<bool> superClawshot;
ConfigVar<bool> alwaysGreatspin;
@@ -112,6 +138,10 @@ struct UserSettings {
// Controls
ConfigVar<bool> enableTurboKeybind;
// Tools
ConfigVar<bool> speedrunMode;
ConfigVar<bool> liveSplitEnabled;
} game;
struct {
@@ -122,6 +152,7 @@ struct UserSettings {
ConfigVar<bool> wasPresetChosen;
ConfigVar<bool> enableCrashReporting;
ConfigVar<bool> duskMenuOpen;
ConfigVar<int> cardFileType;
} backend;
};
@@ -146,6 +177,7 @@ struct TransientSettings {
CollisionViewSettings collisionView;
bool skipFrameRateLimit;
bool moveLinkActive;
bool stateShareLoadActive;
};
TransientSettings& getTransientSettings();
+25 -25
View File
@@ -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(&current);
@@ -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
};
+67
View File
@@ -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
+1 -1
View File
@@ -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;
+1
View File
@@ -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 {
+15 -1
View File
@@ -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,12 +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
@@ -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; }
@@ -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 */
@@ -263,6 +263,9 @@ public:
/* 0x9C */ u8 field_0x9c[4];
/* 0xA0 */ OSTime mResetHoldStartTime;
/* 0xA8 */ u8 field_0xa8;
#if TARGET_PC
u32 mResetHoldFrameCount;
#endif
};
/**
+20 -5
View File
@@ -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());
+27 -3
View File
@@ -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();
}
+2 -2
View File
@@ -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;
+9 -1
View File
@@ -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) {
+14 -5
View File
@@ -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"
@@ -219,7 +220,7 @@ void JFWDisplay::endGX() {
if (dusk::frame_interp::get_ui_tick_pending()) {
mFader->advance();
}
if (mFader->getStatus() != 1) {
if (mFader->getStatus() != JUTFader::Wait) {
mFader->draw();
}
#else
@@ -368,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 && !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
+44 -44
View File
@@ -10,51 +10,51 @@
JUTFader::JUTFader(int x, int y, int width, int height, JUtility::TColor pColor)
: mColor(pColor), mBox(x, y, x + width, y + height) {
mStatus = 0;
field_0x8 = 0;
field_0xa = 0;
field_0x24 = 0;
mEStatus = UNKSTATUS_M1;
mStatus = None;
mDuration = 0;
mTimer = 0;
mNextStatus = 0;
mStatusTimer = -1;
}
void JUTFader::advance() {
if (0 <= mEStatus && mEStatus-- == 0) {
mStatus = field_0x24;
if (0 <= mStatusTimer && mStatusTimer-- == 0) {
mStatus = mNextStatus;
}
if (mStatus == 1) {
if (mStatus == Wait) {
return;
}
switch (mStatus) {
case 0:
case None:
mColor.a = 0xFF;
break;
case 2:
case FadeIn:
#if AVOID_UB
if (field_0x8 == 0) {
mStatus = 1;
if (mDuration == 0) {
mStatus = Wait;
break;
}
#endif
mColor.a = 0xFF - ((++field_0xa * 0xFF) / field_0x8);
mColor.a = 0xFF - ((++mTimer * 0xFF) / mDuration);
if (field_0xa >= field_0x8) {
mStatus = 1;
if (mTimer >= mDuration) {
mStatus = Wait;
}
break;
case 3:
case FadeOut:
#if AVOID_UB
if (field_0x8 == 0) {
mStatus = 0;
if (mDuration == 0) {
mStatus = None;
break;
}
#endif
mColor.a = ((++field_0xa * 0xFF) / field_0x8);
mColor.a = ((++mTimer * 0xFF) / mDuration);
if (field_0xa >= field_0x8) {
mStatus = 0;
if (mTimer >= mDuration) {
mStatus = None;
}
break;
@@ -77,53 +77,53 @@ void JUTFader::draw() {
}
}
bool JUTFader::startFadeIn(int param_0) {
bool JUTFader::startFadeIn(int duration) {
bool statusCheck = mStatus == 0;
if (statusCheck) {
mStatus = 2;
field_0xa = 0;
field_0x8 = param_0;
mStatus = FadeIn;
mTimer = 0;
mDuration = duration;
}
return statusCheck;
}
bool JUTFader::startFadeOut(int param_0) {
bool JUTFader::startFadeOut(int duration) {
bool statusCheck = mStatus == 1;
if (statusCheck) {
mStatus = 3;
field_0xa = 0;
field_0x8 = param_0;
mStatus = FadeOut;
mTimer = 0;
mDuration = duration;
}
return statusCheck;
}
void JUTFader::setStatus(JUTFader::EStatus i_status, int param_1) {
void JUTFader::setStatus(JUTFader::EStatus i_status, int timer) {
switch (i_status) {
case 0:
if (param_1 != 0) {
field_0x24 = 0;
mEStatus = param_1;
case None:
if (timer != 0) {
mNextStatus = None;
mStatusTimer = timer;
break;
}
mStatus = 0;
field_0x24 = 0;
mEStatus = 0;
mStatus = None;
mNextStatus = None;
mStatusTimer = 0;
break;
case 1:
if (param_1 != 0) {
field_0x24 = 1;
mEStatus = param_1;
case Wait:
if (timer != 0) {
mNextStatus = Wait;
mStatusTimer = timer;
break;
}
mStatus = 1;
field_0x24 = 1;
mEStatus = 0;
mStatus = Wait;
mNextStatus = Wait;
mStatusTimer = 0;
break;
}
}
+11
View File
@@ -64,6 +64,9 @@ BOOL JUTGamePad::init() {
void JUTGamePad::clear() {
mButtonReset.mReset = false;
field_0xa8 = 1;
#if TARGET_PC
mResetHoldFrameCount = 0;
#endif
}
PADStatus JUTGamePad::mPadStatus[4];
@@ -219,11 +222,19 @@ void JUTGamePad::update() {
mButtonReset.mReset = false;
} else if (!JUTGamePad::C3ButtonReset::sResetOccurred) {
if (mButtonReset.mReset == true) {
#if TARGET_PC
checkResetCallback(++mResetHoldFrameCount * (OS_TIMER_CLOCK / 30));
#else
OSTime hold_time = OSGetTime() - mResetHoldStartTime;
checkResetCallback(hold_time);
#endif
} else {
mButtonReset.mReset = true;
#if TARGET_PC
mResetHoldFrameCount = 0;
#else
mResetHoldStartTime = OSGetTime();
#endif
}
}
+11
View File
@@ -468,9 +468,20 @@ s16 cLib_targetAngleX(cXyz const* lhs, cXyz const* rhs) {
void cLib_offsetPos(cXyz* pdest, cXyz const* psrc, s16 angle, cXyz const* vec) {
f32 cos = cM_scos(angle);
f32 sin = cM_ssin(angle);
// MWCC loads vec members into registers before writing to pdest; other compilers may not,
// which corrupts results when pdest and vec alias the same memory.
#if !__MWERKS__
f32 vx = vec->x;
f32 vy = vec->y;
f32 vz = vec->z;
pdest->x = psrc->x + (vx * cos + vz * sin);
pdest->y = psrc->y + vy;
pdest->z = psrc->z + (vz * cos - vx * sin);
#else
pdest->x = psrc->x + (vec->x * cos + vec->z * sin);
pdest->y = psrc->y + vec->y;
pdest->z = psrc->z + (vec->z * cos - vec->x * sin);
#endif
}
/**
+5 -5
View File
@@ -117,8 +117,8 @@ static Z2WolfHowlLine sNewSong3[9] = {
#if TARGET_PC
static Z2WolfHowlLine sHowlTimeSong[6] = {
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
{HOWL_LINE_MID, 15}, {HOWL_LINE_LOW, 15}, {HOWL_LINE_HIGH, 30},
{HOWL_LINE_MID, 15}, {HOWL_LINE_LOW, 15}, {HOWL_LINE_HIGH, 30},
};
#endif
@@ -368,9 +368,9 @@ void Z2WolfHowlMgr::setCorrectData(s8 curveID, Z2WolfHowlData* data) {
break;
#if TARGET_PC
case Z2WOLFHOWL_TIMESONG:
cPitchUp = 1.259906f;
cPitchCenter = 0.94387f;
cPitchDown = 0.840885f;
cPitchUp = 1.3348f;
cPitchCenter = 0.8909f;
cPitchDown = 0.7937f;
break;
#endif
default:
+16
View File
@@ -5877,6 +5877,11 @@ void daAlink_c::setItemMatrix(int param_0) {
modelCalc(mSheathModel);
int var_r26;
#if AVOID_UB
var_r26 = 0;
#endif
if (!checkNoResetFlg3(FLG3_UNK_4000000)) {
if (mEquipItem == 0x103 || param_0 != 0) {
mSwordModel->setBaseTRMtx(mpLinkModel->getAnmMtx(mLeftItemJntNo));
@@ -18936,11 +18941,20 @@ void daAlink_c::setDrawHand() {
mpLinkHandModel->setBaseTRMtx(mpLinkModel->getBaseTRMtx());
mpLinkHandModel->calc();
#if TARGET_PC
// FRAME INTERP NOTE: Always set these, otherwise the hands occasionally zip to origin.
// Doing it regardless of interpolation being active seems harmless.
mpLinkHandModel->setAnmMtx(1, mpLinkModel->getAnmMtx(9));
mpLinkHandModel->setAnmMtx(2, mpLinkModel->getAnmMtx(0xE));
#endif
if (var_r30 == 0xFE || var_r30 == 0xFB) {
field_0x06d0 = field_0x06d8;
} else {
field_0x06d0 = mpLinkHandModel->getModelData()->getMaterialNodePointer(var_r30)->getShape();
#if !TARGET_PC
mpLinkHandModel->setAnmMtx(1, mpLinkModel->getAnmMtx(9));
#endif
}
if (var_r30 == 0xFB) {
@@ -18959,7 +18973,9 @@ void daAlink_c::setDrawHand() {
field_0x06d4 = field_0x06dc;
} else {
field_0x06d4 = mpLinkHandModel->getModelData()->getMaterialNodePointer(var_r29)->getShape();
#if !TARGET_PC
mpLinkHandModel->setAnmMtx(2, mpLinkModel->getAnmMtx(0xE));
#endif
}
if (var_r29 == 0xFB) {
+30 -8
View File
@@ -37,18 +37,40 @@ void daAlink_c::setCrawlMoveDirectionArrow() {
}
if (field_0x3198 & 4) {
if (!bvar) {
direction |= data_80452F38;
} else {
direction |= data_80452F39;
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
if (!bvar) {
direction |= data_80452F39;
} else {
direction |= data_80452F38;
}
} else
#endif
{
if (!bvar) {
direction |= data_80452F38;
} else {
direction |= data_80452F39;
}
}
}
if (field_0x3198 & 8) {
if (!bvar) {
direction |= data_80452F39;
} else {
direction |= data_80452F38;
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
if (!bvar) {
direction |= data_80452F38;
} else {
direction |= data_80452F39;
}
} else
#endif
{
if (!bvar) {
direction |= data_80452F39;
} else {
direction |= data_80452F38;
}
}
}
+10
View File
@@ -23,6 +23,7 @@
#include "d/actor/d_a_npc_tkc.h"
#include <cstring>
#include "dusk/imgui/ImGuiConsole.hpp"
#include "dusk/settings.h"
BOOL daAlink_c::checkEventRun() const {
@@ -4005,6 +4006,15 @@ int daAlink_c::procGanonFinishInit() {
field_0x37c8 = current.pos;
onEndResetFlg1(ERFLG1_SHIELD_BACKBONE);
#if TARGET_PC
if (dusk::getSettings().game.speedrunMode) {
if (dusk::m_speedrunInfo.m_isRunStarted) {
dusk::m_speedrunInfo.stopRun();
}
}
#endif
return 1;
}
+8 -2
View File
@@ -41,7 +41,7 @@ void daAlink_c::handleWolfHowl() {
return;
}
bool canTransform = false;
bool canHowl = false;
if (mLinkAcch.ChkGroundHit() && !checkModeFlg(MODE_PLAYER_FLY) && !checkMagneBootsOn()) {
if (!checkForestOldCentury()) {
@@ -52,12 +52,17 @@ void daAlink_c::handleWolfHowl() {
(checkEventRun() || getMidnaActor()->checkMetamorphoseEnable()) &&
(checkModeFlg(4) || dComIfGp_checkPlayerStatus0(0, 0x10))))
{
canTransform = true;
canHowl = true;
}
}
}
}
if (!canHowl) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
getWolfHowlMgrP()->setCorrectCurve(9);
procWolfHowlDemoInit();
}
@@ -154,6 +159,7 @@ bool daAlink_c::checkGyroAimContext() {
case PROC_BOW_SUBJECT:
case PROC_BOOMERANG_SUBJECT:
case PROC_COPY_ROD_SUBJECT:
case PROC_HAWK_SUBJECT:
case PROC_HOOKSHOT_SUBJECT:
case PROC_SWIM_HOOKSHOT_SUBJECT:
case PROC_HORSE_BOW_SUBJECT:
+54
View File
@@ -149,6 +149,23 @@ void daAlink_c::changeWolf() {
mpLinkModel = initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 14)), 0x20200);
#ifdef TARGET_PC
// Update Wolf Link's eye maxLOD to prevent the eyes from disappearing
{
J3DTexture* tex = mpLinkModel->getModelData()->getTexture();
JUTNameTab* nametable = mpLinkModel->getModelData()->getTextureName();
if (tex != nullptr && nametable != nullptr) {
for (u16 i = 0; i < tex->getNum(); i++) {
const char* tex_name = nametable->getName(i);
if (tex_name != NULL && strcmp(tex_name, "wl_eyeball") == 0) {
ResTIMG* timg = tex->getResTIMG(i);
timg->maxLOD = 0;
}
}
}
}
#endif
J3DModelData* chainModelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 15));
for (u16 i = 0; i < 4; i++) {
mpWlChainModels[i] = initModel(chainModelData, 0);
@@ -162,6 +179,23 @@ void daAlink_c::changeWolf() {
mpWlMidnaHairModel =
initModelEnv(static_cast<J3DModelData*>(dComIfG_getObjectRes(l_wArcName, 11)), 0x1000000);
#ifdef TARGET_PC
// Update Midna's eye maxLOD to prevent the eyes from disappearing
{
J3DTexture* tex = mpWlMidnaModel->getModelData()->getTexture();
JUTNameTab* nametable = mpWlMidnaModel->getModelData()->getTextureName();
if (tex != nullptr && nametable != nullptr) {
for (u16 i = 0; i < tex->getNum(); i++) {
const char* tex_name = nametable->getName(i);
if (tex_name != NULL && strcmp(tex_name, "midona_eyeball") == 0) {
ResTIMG* timg = tex->getResTIMG(i);
timg->maxLOD = 0;
}
}
}
}
#endif
mpDMidnaBrk = static_cast<J3DAnmTevRegKey*>(dComIfG_getObjectRes(l_wArcName, 18));
mpDMidnaBrk->searchUpdateMaterialID(mpWlMidnaModel->getModelData());
mpWlMidnaModel->getModelData()->entryTevRegAnimator(mpDMidnaBrk);
@@ -342,6 +376,26 @@ void daAlink_c::changeLink(int param_0) {
initModel(static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "zl_face.bmd")), 0x20200);
}
#ifdef TARGET_PC
// Update Adult Link's eye maxLOD to prevent the eyes from disappearing
{
J3DTexture* tex = mpLinkFaceModel->getModelData()->getTexture();
JUTNameTab* nametable = mpLinkFaceModel->getModelData()->getTextureName();
if (tex != nullptr && nametable != nullptr) {
for (u16 i = 0; i < tex->getNum(); i++) {
const char* tex_name = nametable->getName(i);
if (tex_name != nullptr &&
(strcmp(tex_name, "al_eyeball") == 0 || strcmp(tex_name, "highlight02") == 0 ||
strcmp(tex_name, "eye_kage01") == 0))
{
ResTIMG* timg = tex->getResTIMG(i);
timg->maxLOD = 0;
}
}
}
}
#endif
modelData = static_cast<J3DModelData*>(dComIfG_getObjectRes(mArcName, "al_bootsH.bmd"));
u16 i;
for (i = 0; i < 2; i++) {
+9 -1
View File
@@ -2059,7 +2059,15 @@ static void demo_camera(b_bq_class* i_this) {
for (int i = 0; i < 5; i++) {
static u16 g_e_i[] = {0x83EB, 0x83EC, 0x83ED, 0x83EE, 0x83EF};
dComIfGp_particle_set(g_e_i[i], &pos, NULL, NULL);
#if TARGET_PC
if (i == 0) {
static const cXyz effWideScale = {mDoGph_gInf_c::getAspect(), 1.0f, 1.0f};
dComIfGp_particle_set(g_e_i[i], &pos, NULL, &effWideScale);
} else
#endif
{
dComIfGp_particle_set(g_e_i[i], &pos, NULL, NULL);
}
}
i_this->mSound.startCreatureSound(Z2SE_EN_BOSS_CONVERGE, 0, 0);
+60
View File
@@ -17,6 +17,9 @@
#include "Z2AudioLib/Z2Instances.h"
#include "dusk/frame_interpolation.h"
#include "dusk/settings.h"
class daB_GND_HIO_c : public JORReflexible {
public:
daB_GND_HIO_c();
@@ -279,6 +282,30 @@ static int h_nodeCallBack(J3DJoint* i_joint, int param_2) {
return 1;
}
#if TARGET_PC
static void b_gnd_rein_interp_callback(bool isSimFrame, void* pUserWork) {
b_gnd_class* i_this = (b_gnd_class*)pUserWork;
if (!i_this->mReinsInterpPrevValid || !i_this->mReinsInterpCurrValid) {
return;
}
const f32 alpha = dusk::frame_interp::get_interpolation_step();
for (int r = 0; r < 2; r++) {
cXyz* dst = i_this->mHorseReins[r].getPos(0);
for (int i = 0; i < 16; i++) {
const cXyz& p0 = i_this->mReinsInterpPrev[r][i];
const cXyz& p1 = i_this->mReinsInterpCurr[r][i];
dst[i] = p0 + (p1 - p0) * alpha;
}
}
cXyz* dst = i_this->field_0x21e8.getPos(0);
for (int i = 0; i < 2; i++) {
const cXyz& p0 = i_this->mReinsTexInterpPrev[i];
const cXyz& p1 = i_this->mReinsTexInterpCurr[i];
dst[i] = p0 + (p1 - p0) * alpha;
}
}
#endif
static int daB_GND_Draw(b_gnd_class* i_this) {
fopAc_ac_c* a_this = (fopAc_ac_c*)i_this;
@@ -366,6 +393,21 @@ static int daB_GND_Draw(b_gnd_class* i_this) {
i_this->field_0x21e8.update(2, l_color, &a_this->tevStr);
dComIfGd_set3DlineMat(&i_this->field_0x21e8);
#if TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
if (i_this->mReinsInterpCurrValid) {
memcpy(i_this->mReinsInterpPrev, i_this->mReinsInterpCurr, sizeof(i_this->mReinsInterpCurr));
memcpy(i_this->mReinsTexInterpPrev, i_this->mReinsTexInterpCurr, sizeof(i_this->mReinsTexInterpCurr));
i_this->mReinsInterpPrevValid = true;
}
for (int r = 0; r < 2; r++) {
memcpy(i_this->mReinsInterpCurr[r], i_this->mHorseReins[r].getPos(0), 16 * sizeof(cXyz));
}
memcpy(i_this->mReinsTexInterpCurr, i_this->field_0x21e8.getPos(0), 2 * sizeof(cXyz));
i_this->mReinsInterpCurrValid = true;
dusk::frame_interp::add_interpolation_callback(&b_gnd_rein_interp_callback, i_this);
}
#endif
}
return 1;
@@ -1189,10 +1231,16 @@ static void b_gnd_h_end(b_gnd_class* i_this) {
if (i_this->mDemoCamMode < 32) {
i_this->mDemoCamMode = 32;
#if TARGET_PC
i_this->mDemoCamSyncTicks = 2;
#endif
} else {
i_this->mDemoCamMode = 34;
i_this->mDemoCamTimer = 0;
i_this->mMoveMode = 2;
#if TARGET_PC
i_this->mDemoCamSyncTicks = 2;
#endif
}
}
break;
@@ -2887,6 +2935,9 @@ static void demo_camera(b_gnd_class* i_this) {
cXyz spF0;
s8 sp8 = false;
#if TARGET_PC
const s16 entry_demo_cam_mode = i_this->mDemoCamMode;
#endif
switch (i_this->mDemoCamMode) {
case 0:
break;
@@ -3725,6 +3776,15 @@ static void demo_camera(b_gnd_class* i_this) {
i_this->mDemoCamTimer = 10000;
}
}
#if TARGET_PC
if (entry_demo_cam_mode != i_this->mDemoCamMode) {
i_this->mDemoCamSyncTicks = 2;
}
if (i_this->mDemoCamSyncTicks > 0) {
dusk::frame_interp::request_presentation_sync();
i_this->mDemoCamSyncTicks--;
}
#endif
}
static void anm_se_set(b_gnd_class* i_this) {
+10 -1
View File
@@ -2725,7 +2725,16 @@ static void demo_camera(b_ob_class* i_this) {
for (int i = 0; i < 5; i++) {
static u16 ex_eff[] = {dPa_RM(ID_ZI_S_OI_CONVERGE_FILTER), dPa_RM(ID_ZI_S_OI_CONVERGE_FILTEROUT), dPa_RM(ID_ZI_S_OI_CONVERGE_HIDE), dPa_RM(ID_ZI_S_OI_CONVERGE_POLYGON_A), dPa_RM(ID_ZI_S_OI_CONVERGE_POLYGON_B)};
dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &sc);
#if TARGET_PC
if (i == 0) {
static const cXyz effWideScale = {mDoGph_gInf_c::getAspect() * 10.0f, 10.0f, 10.0f};
dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &effWideScale);
} else
#endif
{
dComIfGp_particle_set(ex_eff[i], &room_pos, NULL, &sc);
}
}
i_this->mDemoCamEye.set(-4820.0f, -18600.0f, -510.0f);
+14 -3
View File
@@ -6,6 +6,7 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_balloon_2D.h"
#include "dusk/frame_interpolation.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
@@ -438,7 +439,12 @@ void daBalloon2D_c::setComboAlpha() {
void daBalloon2D_c::drawAddScore() {
for (s32 i = 19; i >= 0; i--) {
if (field_0x5f8[i].field_0xe != 0) {
field_0x5f8[i].field_0xe--;
#ifdef TARGET_PC
if (dusk::frame_interp::get_ui_tick_pending())
#endif
{
field_0x5f8[i].field_0xe--;
}
s32 score3;
s32 score2;
s32 score = field_0x5f8[i].field_0xc;
@@ -446,8 +452,13 @@ void daBalloon2D_c::drawAddScore() {
u8 local_88 = 0xff;
f32 dVar11 = 30.0f;
f32 dVar9 = 30.0f;
field_0x5f8[i].field_0x0.x += cM_ssin(temp0) * 0.3f;
field_0x5f8[i].field_0x0.y -= 1.0f;
#ifdef TARGET_PC
if (dusk::frame_interp::get_ui_tick_pending())
#endif
{
field_0x5f8[i].field_0x0.x += cM_ssin(temp0) * 0.3f;
field_0x5f8[i].field_0x0.y -= 1.0f;
}
if (field_0x5f8[i].field_0xe < 10) {
f32 fVar5 = field_0x5f8[i].field_0xe / 10.0f;
local_88 = fVar5 * 255.0f;
+5
View File
@@ -623,6 +623,11 @@ int daBg_c::create() {
dComIfGp_roomControl_onStatusFlag(roomNo, 0x10);
OS_REPORT("<BG> room%d\n", roomNo);
#if TARGET_PC
draw_interp_frame = true;
#endif
return cPhs_COMPLEATE_e;
}
+7 -8
View File
@@ -215,15 +215,14 @@ int daDsh_c::create() {
mType = getType();
#ifdef TARGET_PC
const char* l_resName[] = {l_arcName[mType], ""};
#else
// !@bug By making this static, it is only initialized the first time it runs
// If gate types that use other arcs are loaded later (without reloading the code)
// this array never gets updated and will load the incorrect arc
// On GC/Wii, REL loading causes this to reset/reinitialize so the bug is avoided
// but TPHD is all statically linked so daDsh_c::CreateHeap fails to get model data and the gate unloads
// !@bug Static-init only runs once, so slot 0 keeps the first mType's arc name forever.
// GC/Wii dodges this via REL reload; TPHD is statically linked so later gates of a
// different type load the wrong arc and CreateHeap fails. The storage must stay static
// because mResLoader.load holds the pointer past create(), so we just overwrite slot 0
// each call instead.
static const char* l_resName[] = {l_arcName[mType], ""};
#ifdef TARGET_PC
l_resName[0] = l_arcName[mType];
#endif
int phase = mResLoader.load(l_resName, NULL);
+10 -1
View File
@@ -1677,7 +1677,16 @@ static void demo_camera(e_fm_class* i_this) {
cXyz spBC(0.0f, 0.0f, 0.0f);
for (int i = 0; i < 4; i++) {
static u16 g_e_i[] = {0x847B, 0x847C, 0x847D, 0x847E};
dComIfGp_particle_set(g_e_i[i], &spBC, NULL, NULL);
#if TARGET_PC
if (i == 0) {
static const cXyz effWideScale = {mDoGph_gInf_c::getAspect(), 1.0f, 1.0f};
dComIfGp_particle_set(g_e_i[i], &spBC, NULL, &effWideScale);
} else
#endif
{
dComIfGp_particle_set(g_e_i[i], &spBC, NULL, NULL);
}
}
i_this->mDemoCamFovy = 55.0f + NREG_F(10);
+29
View File
@@ -12,6 +12,8 @@
#include "d/d_bomb.h"
#include "c/c_damagereaction.h"
#include "Z2AudioLib/Z2Instances.h"
#include "dusk/frame_interpolation.h"
#include "dusk/settings.h"
#define ACTION_STANDBY 0
#define ACTION_WALK1 1
@@ -63,6 +65,22 @@ static void anm_init(e_mb_class* i_this, int i_anmID, f32 i_morf, u8 i_attr, f32
i_this->mAnm = i_anmID;
}
#if TARGET_PC
static void e_mb_rope_interp_callback(bool isSimFrame, void* pUserWork) {
e_mb_class* i_this = (e_mb_class*)pUserWork;
if (!i_this->mRopeInterpPrevValid || !i_this->mRopeInterpCurrValid) {
return;
}
const f32 alpha = dusk::frame_interp::get_interpolation_step();
cXyz* dst = i_this->mRopeMat.getPos(0);
for (int i = 0; i < 16; i++) {
const cXyz& p0 = i_this->mRopeInterpPrev[i];
const cXyz& p1 = i_this->mRopeInterpCurr[i];
dst[i] = p0 + (p1 - p0) * alpha;
}
}
#endif
static int daE_MB_Draw(e_mb_class* i_this) {
fopAc_ac_c* a_this = (fopAc_ac_c*)i_this;
@@ -86,6 +104,17 @@ static int daE_MB_Draw(e_mb_class* i_this) {
static GXColor l_color = {0x14, 0x0F, 0x00, 0xFF};
i_this->mRopeMat.update(16, l_color, &a_this->tevStr);
dComIfGd_set3DlineMat(&i_this->mRopeMat);
#if TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
if (i_this->mRopeInterpCurrValid) {
memcpy(i_this->mRopeInterpPrev, i_this->mRopeInterpCurr, sizeof(i_this->mRopeInterpCurr));
i_this->mRopeInterpPrevValid = true;
}
memcpy(i_this->mRopeInterpCurr, i_this->mRopeMat.getPos(0), 16 * sizeof(cXyz));
i_this->mRopeInterpCurrValid = true;
dusk::frame_interp::add_interpolation_callback(&e_mb_rope_interp_callback, i_this);
}
#endif
return 1;
}
+5 -4
View File
@@ -6601,13 +6601,14 @@ static int daE_RD_Execute(e_rd_class* i_this) {
1.2f,
};
#if AVOID_UB
s16 x = 0;
s16 y = 0;
#endif
for (int i = 0; i < 2; i++) {
MtxPush();
#if !AVOID_UB
s16 x, y;
#if AVOID_UB
x = 0;
y = 0;
#endif
if (i == 0) {
+58
View File
@@ -14,6 +14,10 @@
#include "f_op/f_op_camera_mng.h"
#include <cstring>
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#endif
class daE_SM2_HIO_c : public fOpAcm_HIO_entry_c {
public:
daE_SM2_HIO_c();
@@ -76,8 +80,62 @@ static int nodeCallBack(J3DJoint* i_joint, int param_1) {
return 1;
}
#if TARGET_PC
static void daE_SM2_interp_callback(bool isSimFrame, void* pUserWork) {
e_sm2_class* i_this = static_cast<e_sm2_class*>(pUserWork);
if (i_this == NULL) {
return;
}
fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->enemy;
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
if (!i_this->isPiece) {
if (i_this->modelMorf == NULL) {
return;
}
J3DModel* model = i_this->modelMorf->getModel();
if (model == NULL) {
return;
}
g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
J3DMaterial* material = model->getModelData()->getMaterialNodePointer(0);
material->getTevKColor(1)->r = i_this->color_R;
material->getTevKColor(1)->g = i_this->color_G;
material->getTevKColor(1)->b = i_this->color_B;
material->getTevKColor(1)->a = 217.0f * i_this->color_alpha;
if (i_this->pbtk != NULL) {
i_this->pbtk->entry(model->getModelData());
}
} else {
if (i_this->pieceModelMorf == NULL) {
return;
}
J3DModel* model = i_this->pieceModelMorf->getModel();
if (model == NULL) {
return;
}
J3DMaterial* material = model->getModelData()->getMaterialNodePointer(0);
material->getTevKColor(1)->r = i_this->color_R;
material->getTevKColor(1)->g = i_this->color_G;
material->getTevKColor(1)->b = i_this->color_B;
material->getTevKColor(1)->a = 217.0f * i_this->color_alpha;
g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
}
}
#endif
static int daE_SM2_Draw(e_sm2_class* i_this) {
fopAc_ac_c* actor = (fopAc_ac_c*)&i_this->enemy;
#if TARGET_PC
dusk::frame_interp::add_interpolation_callback(&daE_SM2_interp_callback, i_this);
#endif
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
J3DModel* model;
+62
View File
@@ -18,6 +18,8 @@
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_graphic.h"
#include "res/Object/Always.h"
#include "dusk/dusk.h"
#include "dusk/frame_interpolation.h"
#include <cstring>
@@ -184,6 +186,30 @@ static bool hio_set;
static daE_WB_HIO_c l_HIO;
#if TARGET_PC
static void e_wb_rein_interp_callback(bool isSimFrame, void* pUserWork) {
e_wb_class* i_this = (e_wb_class*)pUserWork;
if (!i_this->himo_interp_prev_valid || !i_this->himo_interp_curr_valid) {
return;
}
const f32 alpha = dusk::frame_interp::get_interpolation_step();
for (int r = 0; r < 2; r++) {
cXyz* dst = i_this->himo_mat[r].getPos(0);
for (int i = 0; i < 16; i++) {
const cXyz& p0 = i_this->himo_mat_interp_prev[r][i];
const cXyz& p1 = i_this->himo_mat_interp_curr[r][i];
dst[i] = p0 + (p1 - p0) * alpha;
}
}
cXyz* dst = i_this->himo_tex.getPos(0);
for (int i = 0; i < 2; i++) {
const cXyz& p0 = i_this->himo_tex_interp_prev[i];
const cXyz& p1 = i_this->himo_tex_interp_curr[i];
dst[i] = p0 + (p1 - p0) * alpha;
}
}
#endif
static void himo_control1(e_wb_class* i_this, cXyz* i_pos, int i_no, s8 param_3) {
fopEn_enemy_c* enemy = &i_this->enemy;
cXyz mae, ato;
@@ -508,6 +534,21 @@ static int daE_WB_Draw(e_wb_class* i_this) {
dComIfGd_set3DlineMat(&i_this->himo_mat[1]);
i_this->himo_tex.update(2, l_color, &actor->tevStr);
dComIfGd_set3DlineMat(&i_this->himo_tex);
#if TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
if (i_this->himo_interp_curr_valid) {
memcpy(i_this->himo_mat_interp_prev, i_this->himo_mat_interp_curr, sizeof(i_this->himo_mat_interp_curr));
memcpy(i_this->himo_tex_interp_prev, i_this->himo_tex_interp_curr, sizeof(i_this->himo_tex_interp_curr));
i_this->himo_interp_prev_valid = true;
}
for (int r = 0; r < 2; r++) {
memcpy(i_this->himo_mat_interp_curr[r], i_this->himo_mat[r].getPos(0), 16 * sizeof(cXyz));
}
memcpy(i_this->himo_tex_interp_curr, i_this->himo_tex.getPos(0), 2 * sizeof(cXyz));
i_this->himo_interp_curr_valid = true;
dusk::frame_interp::add_interpolation_callback(&e_wb_rein_interp_callback, i_this);
}
#endif
}
return 1;
@@ -3726,6 +3767,9 @@ static void demo_camera(e_wb_class* i_this) {
boss = (e_rdb_class*)fopAcM_SearchByName(fpcNm_E_RDB_e);
}
cXyz mae, ato, eye, center;
#if TARGET_PC
const s16 entry_demo_mode = i_this->demo_mode;
#endif
switch (i_this->demo_mode) {
case 1: {
@@ -4255,6 +4299,9 @@ static void demo_camera(e_wb_class* i_this) {
if (i_this->demo_timer == 325) {
fpcM_Search(s_wbZrevise_sub, i_this);
#if TARGET_PC
i_this->demo_cam_sync_ticks = 2;
#endif
}
if (i_this->demo_timer == 335) {
@@ -4495,6 +4542,9 @@ static void demo_camera(e_wb_class* i_this) {
i_this->demo_cam_way_spd.z = fabsf(i_this->demo_cam_way.z - i_this->demo_cam_ctr.z);
i_this->demo_cam_morf = 0;
pla->setPlayerPosAndAngle(&pla->current.pos, pla->shape_angle.y - 4000, 0);
#if TARGET_PC
dusk::frame_interp::request_presentation_sync();
#endif
}
if (i_this->demo_timer == 345) {
daPy_getPlayerActorClass()->setThrowDamage(boss->enemy.shape_angle.y - 8000 + TREG_S(8),
@@ -4741,6 +4791,9 @@ static void demo_camera(e_wb_class* i_this) {
i_this->demo_cam_eye.x += 300.0f + VREG_F(8);
i_this->demo_cam_eye.y += 150.0f + VREG_F(9);
i_this->demo_cam_eye.z -= 1400.0f + VREG_F(10);
#if TARGET_PC
dusk::frame_interp::request_presentation_sync();
#endif
}
} else {
i_this->demo_cam_eye = enemy->current.pos;
@@ -4996,6 +5049,15 @@ static void demo_camera(e_wb_class* i_this) {
}
}
}
#if TARGET_PC
if (entry_demo_mode != i_this->demo_mode) {
i_this->demo_cam_sync_ticks = 2;
}
if (i_this->demo_cam_sync_ticks > 0) {
dusk::frame_interp::request_presentation_sync();
i_this->demo_cam_sync_ticks--;
}
#endif
}
static void anm_se_eff_set(e_wb_class* i_this) {
+3 -3
View File
@@ -1069,7 +1069,7 @@ void daE_YM_c::executeDown() {
if (mAcch.ChkGroundHit()) {
if (mFlyType != 1) {
#if TARGET_PC
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f);
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears ? 2.0f : 1.0f);
#else
bckSet(6, 0, 0.0f, 1.0f);
#endif
@@ -1093,7 +1093,7 @@ void daE_YM_c::executeDown() {
mSound.startCreatureSound(Z2SE_CM_BODYFALL_WATER_M, 0, -1);
mSound.startCreatureSound(Z2SE_EN_YM_MOGAKU, 0, -1);
#if TARGET_PC
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f);
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears ? 2.0f : 1.0f);
#else
bckSet(6, 0, 0.0f, 1.0f);
#endif
@@ -1115,7 +1115,7 @@ void daE_YM_c::executeDown() {
|| dComIfG_Bgsp().GetGroundCode(gnd_chk) == 5)
{
#if TARGET_PC
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 2.0f : 1.0f);
bckSet(6, 0, 0.0f, dusk::getSettings().game.fastTears ? 2.0f : 1.0f);
#else
bckSet(6, 0, 0.0f, 1.0f);
#endif
+9 -4
View File
@@ -13,9 +13,12 @@
#if TARGET_PC
#include "dusk/dvd_asset.hpp"
#include "dusk/frame_interpolation.h"
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x1C00, 0x4000), true); return buf; }
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x5C00, 0x4000), true); return buf; }
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0x9C00, 0x60), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_Egnd_mantTEX_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x1C00}, {GameVersion::GcnPal, 0x1C00}}, 0x4000), true); return buf; }
static u8* l_Egnd_mantTEX_U_get() { alignas(32) static u8 buf[0x4000]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x5C00}, {GameVersion::GcnPal, 0x5C00}}, 0x4000), true); return buf; }
static u8* l_Egnd_mantPAL_get() { alignas(32) static u8 buf[0x60]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0x9C00}, {GameVersion::GcnPal, 0x9C00}}, 0x60), true); return buf; }
#define l_Egnd_mantTEX (l_Egnd_mantTEX_get())
#define l_Egnd_mantTEX_U (l_Egnd_mantTEX_U_get())
#define l_Egnd_mantPAL (l_Egnd_mantPAL_get())
@@ -251,7 +254,9 @@ static u32 l_texCoord[338] = {
};
#if TARGET_PC
static u8* l_Egnd_mantDL_get() { alignas(32) static u8 buf[0x3EC]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", 0xA9A0, 0x3EC), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_Egnd_mantDL_get() { alignas(32) static u8 buf[0x3EC]; static bool _ = (dusk::LoadRelAsset(buf, "/rel/Final/Release/d_a_mant.rel", {{GameVersion::GcnUsa, 0xA9A0}, {GameVersion::GcnPal, 0xA9A0}}, 0x3EC), true); return buf; }
#define l_Egnd_mantDL (l_Egnd_mantDL_get())
#else
#include "assets/l_Egnd_mantDL.h"
+25 -2
View File
@@ -22,6 +22,7 @@
#include "d/d_s_play.h"
#include "d/d_vibration.h"
#include "f_op/f_op_kankyo_mng.h"
#include "dusk/version.hpp"
#include <cstring>
#define ANM_MG_FISH_MOUTH_CLOSE 4
@@ -3230,7 +3231,17 @@ static int daMg_Fish_Execute(mg_fish_class* i_this) {
daPy_py_c* player = daPy_getPlayerActorClass();
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
lit_1008 = 0;
} else if (dusk::version::isRegionPal()) {
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
lit_1008 = 2;
} else {
lit_1008 = 0;
}
}
#elif VERSION == VERSION_GCN_JPN
lit_1008 = 0;
#elif VERSION == VERSION_GCN_PAL
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
@@ -3843,7 +3854,19 @@ static int daMg_Fish_Create(fopAc_ac_c* i_this) {
a_this->mResName = "O_gD_bott";
}
#if VERSION == VERSION_GCN_JPN
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
lit_1008 = 0;
} else if (dusk::version::isRegionPal()) {
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
lit_1008 = 2;
} else {
lit_1008 = 0;
}
} else {
lit_1008 = 1;
}
#elif VERSION == VERSION_GCN_JPN
lit_1008 = 0;
#elif VERSION == VERSION_GCN_PAL
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
+27 -15
View File
@@ -5,14 +5,15 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "Z2AudioLib/Z2Instances.h"
#include "d/actor/d_a_mg_fish.h"
#include "d/actor/d_a_mg_fshop.h"
#include "d/actor/d_a_npc_henna.h"
#include "d/actor/d_a_mg_fish.h"
#include "d/actor/d_a_player.h"
#include "f_op/f_op_camera_mng.h"
#include "d/d_timer.h"
#include "d/d_s_play.h"
#include "Z2AudioLib/Z2Instances.h"
#include "d/d_timer.h"
#include "dusk/version.hpp"
#include "f_op/f_op_camera_mng.h"
#if TARGET_PC
#include "dusk/gyro.h"
@@ -761,6 +762,11 @@ static void koro2_game(fshop_class* i_this) {
sp5C.x = mDoCPd_c::getStickX3D(PAD_1);
sp5C.y = 0.0f;
sp5C.z = mDoCPd_c::getStickY(PAD_1);
#if TARGET_PC
if (dusk::getSettings().game.enableMirrorMode) {
sp5C.x = -sp5C.x;
}
#endif
MtxPosition(&sp5C, &sp68);
f32 reg_f31 = sp68.x;
@@ -782,20 +788,15 @@ static void koro2_game(fshop_class* i_this) {
reg_f30 = 0.0f;
}
s16 gyro_ax = 0;
s16 gyro_az = 0;
#if TARGET_PC
if (dusk::getSettings().game.enableGyroRollgoal) {
s16 rg_add_x;
s16 rg_add_z;
dusk::gyro::rollgoalTableOffset(rg_add_x, rg_add_z);
s16 tgt_x = static_cast<s16>(reg_f30 * (-6000.0f + JREG_F(7))) + rg_add_x;
s16 tgt_z = static_cast<s16>(reg_f31 * (-6000.0f + JREG_F(8))) + rg_add_z;
cLib_addCalcAngleS2(&i_this->field_0x4020.x, tgt_x, 4, 0x200);
cLib_addCalcAngleS2(&i_this->field_0x4020.z, tgt_z, 4, 0x200);
dusk::gyro::rollgoalTableOffset(gyro_ax, gyro_az);
}
#else
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)), 4, 0x200);
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)), 4, 0x200);
#endif
cLib_addCalcAngleS2(&i_this->field_0x4020.x, reg_f30 * (-6000.0f + JREG_F(7)) + gyro_ax, 4, 0x200);
cLib_addCalcAngleS2(&i_this->field_0x4020.z, reg_f31 * (-6000.0f + JREG_F(8)) + gyro_az, 4, 0x200);
}
#if TARGET_PC
if (i_this->field_0x4010 != 2) {
@@ -1742,7 +1743,18 @@ static int daFshop_Create(fopAc_ac_c* actor) {
fopAcM_createChild(fpcNm_FSHOP_e, fopAcM_GetID(actor), 0xFFFFFF23, &actor->current.pos, fopAcM_GetRoomNo(actor), NULL, NULL, -1, NULL);
u8 sp10;
#if VERSION == VERSION_GCN_PAL || VERSION == VERSION_WII_PAL
#if TARGET_PC
if (dusk::version::isRegionPal()) {
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
sp10 = 2;
} else {
sp10 = 0;
}
} else {
sp10 = 1;
}
#elif VERSION == VERSION_GCN_PAL || VERSION == VERSION_WII_PAL
if (dComIfGs_getPalLanguage() == dSv_player_config_c::LANGUAGE_ENGLISH) {
sp10 = 2;
} else {
+28 -2
View File
@@ -25,6 +25,8 @@
#include <cmath>
#include <cstring>
#include "dusk/version.hpp"
class dmg_rod_HIO_c : public JORReflexible {
public:
dmg_rod_HIO_c();
@@ -5734,10 +5736,22 @@ static void play_camera_u(dmg_rod_class* i_this) {
static int dmg_rod_Execute(dmg_rod_class* i_this) {
fopAc_ac_c* actor = &i_this->actor;
#if TARGET_PC
if (dusk::version::isPalOrAtLeastWiiR2()) {
if (dComIfGs_getPalLanguage() == 0) {
data_804BBBD4 = 2;
} else {
data_804BBBD4 = 0;
}
} else if (dusk::version::isRegionJpn()) {
data_804BBBD4 = 0;
} else {
data_804BBBD4 = 1;
}
//TODO: It seems possible that dComIfGs_getPalLanguage returns a constant value for non-PAL
// versions (causing the first block to be elided), and it's also possible that the value
// being compared against is an enum value with per-version definitions.
#if VERSION == VERSION_SHIELD_DEBUG
#elif VERSION == VERSION_SHIELD_DEBUG
if (dComIfGs_getPalLanguage() == 1) {
data_804BBBD4 = 2;
} else {
@@ -6303,7 +6317,19 @@ static int dmg_rod_Create(fopAc_ac_c* i_this) {
heap_size = 0xC9A0;
}
#if VERSION == VERSION_SHIELD_DEBUG
#if TARGET_PC
if (dusk::version::isPalOrAtLeastWiiR2()) {
if (dComIfGs_getPalLanguage() == 0) {
data_804BBBD4 = 2;
} else {
data_804BBBD4 = 0;
}
} else if (dusk::version::isRegionJpn()) {
data_804BBBD4 = 0;
} else {
data_804BBBD4 = 1;
}
#elif VERSION == VERSION_SHIELD_DEBUG
if (dComIfGs_getPalLanguage() == 1) {
data_804BBBD4 = 2;
} else {
+1 -1
View File
@@ -1056,7 +1056,7 @@ void daMidna_c::setBodyPartMatrix() {
#ifdef TARGET_PC
// FRAME INTERP NOTE: Record weight envelopes for Midna here, as they are otherwise missed causing distortion
for (u16 i = 0; i < mpModel->getModelData()->getWEvlpMtxNum(); i++) {
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(mpModel->getWeightAnmMtx(i)), mpModel->getWeightAnmMtx(i));
dusk::frame_interp::record_final_mtx(mpModel->getWeightAnmMtx(i));
}
#endif
}
+18
View File
@@ -13,6 +13,9 @@
#include <gf/GFGeometry.h>
#include <gf/GFLight.h>
#include "m_Do/m_Do_lib.h"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#endif
#ifndef __MWERKS__
#include "dusk/math.h"
@@ -27,11 +30,19 @@ static char* l_arcName = "Mirror";
static char* l_arcName2 = "MR-Table";
dMirror_packet_c::dMirror_packet_c() {
#ifdef TARGET_PC
GXInitTexObj(&mTexObj, nullptr, 0, 0, static_cast<GXTexFmt>(-1), GX_MAX_TEXWRAPMODE,
GX_MAX_TEXWRAPMODE, GX_FALSE);
#endif
reset();
}
void dMirror_packet_c::reset() {
#if TARGET_PC
mbReset = true;
#else
mModelCount = 0;
#endif
}
void dMirror_packet_c::calcMinMax() {
@@ -581,6 +592,13 @@ int daMirror_c::execute() {
return 1;
}
#if TARGET_PC
if (mPacket.mbReset) {
mPacket.mModelCount = 0;
mPacket.mbReset = false;
}
#endif
daPy_py_c* player = daPy_getLinkPlayerActorClass();
JUT_ASSERT(0, player != NULL);
+14 -3
View File
@@ -2855,7 +2855,7 @@ void* daMP_Reader(void*) {
#endif
}
static u8 daMP_ReadThreadStack[0x2000];
static u8 daMP_ReadThreadStack[DUSK_IF_ELSE(8, 0x2000)];
#if TARGET_PC
static BOOL VideoThreadCancelled;
@@ -2880,7 +2880,7 @@ static BOOL daMP_CreateReadThread(s32 param_0) {
static OSThread daMP_VideoDecodeThread;
static u8 daMP_VideoDecodeThreadStack[0x64000];
static u8 daMP_VideoDecodeThreadStack[DUSK_IF_ELSE(8, 0x64000)];
static OSMessageQueue daMP_FreeTextureSetQueue;
@@ -3132,7 +3132,7 @@ static BOOL AudioThreadCancelled;
static OSThread daMP_AudioDecodeThread;
static u8 daMP_AudioDecodeThreadStack[0x64000];
static u8 daMP_AudioDecodeThreadStack[DUSK_IF_ELSE(8, 0x64000)];
static OSMessageQueue daMP_FreeAudioBufferQueue;
@@ -4378,6 +4378,8 @@ static void daMP_ActivePlayer_Draw() {
daMP_DrawPosX = static_cast<u32>(rect.PosX);
daMP_DrawPosY = static_cast<u32>(rect.PosY);
daMP_THPPlayerSetVolume((dusk::getSettings().audio.masterVolume / 100.0f) * 127.0f, 0);
#endif
int frame = daMP_THPPlayerDrawCurrentFrame(
@@ -4578,3 +4580,12 @@ actor_process_profile_definition g_profile_MOVIE_PLAYER = {
};
AUDIO_INSTANCES;
#if TARGET_PC
void dusk::MoviePlayerShutdown() {
// We need to cleanly shut down the threads to avoid crashes on shutdown.
if (daMP_c::m_myObj) {
daMP_c::m_myObj->daMP_c_Finish();
}
}
#endif
+2 -2
View File
@@ -170,7 +170,7 @@ void daObjLv5Key_c::Fall(int param_0) {
OS_REPORT("FALL SPD = %f\n", speed.y);
if (mAcch.ChkGroundHit()) {
if (mAcch.ChkGroundHit() IF_DUSK(|| current.pos.abs(home.pos) > 200.0f)) {
fopAcM_GetSpeed(this);
fopAcM_SetSpeedF(this, 4.0f);
fopAcM_SetSpeed(this, 0.0f, 22.0f, 0.0f);
@@ -192,7 +192,7 @@ void daObjLv5Key_c::Fall(int param_0) {
mAcch.CrrPos(dComIfG_Bgsp());
current.pos.y = prev_y;
if (mAcch.ChkGroundHit()) {
if (mAcch.ChkGroundHit() IF_DUSK(|| current.pos.abs(home.pos) > 200.0f)) {
setAction(&daObjLv5Key_c::Land, 1);
}
}
+7
View File
@@ -205,6 +205,13 @@ int daObj_Balloon_c::_delete() {
Z2GetAudioMgr()->seStop(Z2SE_OBJ_WATERMILL_ROUND, 0);
if (mHIOInit) {
hio_set = false;
#ifdef TARGET_PC
// !@bug d_a_obj_balloon.rel unload used to zero these file-statics; with static linking they dangle across scenes.
m_combo_type = 0xFFFFFFFF;
m_combo_count = 0;
m_combo_next_score = 0;
m_balloon_score = 0;
#endif
}
return 1;
}
+4 -4
View File
@@ -265,8 +265,8 @@ int daObjDrop_c::modeParentWait() {
mModeAction = 1;
#if TARGET_PC
mModeTimer = dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 20 : 40;
if (dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0) {
mModeTimer = dusk::getSettings().game.fastTears ? 0 : 40;
if (dusk::getSettings().game.fastTears) {
current.pos.y += 100.0f;
} else {
current.pos.y += 300.0f;
@@ -285,7 +285,7 @@ int daObjDrop_c::modeParentWait() {
case 2:
createBodyEffect();
#if TARGET_PC
mModeTimer = dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0 ? 5 : 45;
mModeTimer = dusk::getSettings().game.fastTears ? 0 : 45;
#else
mModeTimer = 45;
#endif
@@ -331,7 +331,7 @@ int daObjDrop_c::modeWait() {
case 2:
case 50:
#if TARGET_PC
if (dusk::getSettings().game.fastTears && dComIfGp_event_getMode() == 0) {
if (dusk::getSettings().game.fastTears) {
f32 player_dist = current.pos.abs(daPy_getPlayerActorClass()->current.pos);
f32 home_dist = current.pos.abs(home.pos);
+43 -1
View File
@@ -16,6 +16,10 @@
#include "f_op/f_op_camera_mng.h"
#include "m_Do/m_Do_mtx.h"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#endif
static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) {
cM3dGPla plane;
@@ -31,6 +35,27 @@ static f32 Reflect(cXyz* i_vec, cBgS_PolyInfo const& i_polyinfo, f32 i_scale) {
return 0.0f;
}
#if TARGET_PC
static void d_a_obj_item_interp_callback(bool isSimFrame, void* pUserWork) {
daItem_c* item = static_cast<daItem_c*>(pUserWork);
if (item == NULL || item->mpModel == NULL || !item->chkDraw()) {
return;
}
item->setTevStr();
if (item->mpBrkAnm != NULL) {
s8 tevFrm = item->getTevFrm();
if (tevFrm != -1) {
item->mpBrkAnm->entry(item->mpModel->getModelData(), tevFrm);
} else {
item->mpBrkAnm->entry(item->mpModel->getModelData());
}
}
if (item->chkFlag(4)) {
fopAcM_setEffectMtx(item, item->mpModel->getModelData());
}
}
#endif
const daItemBase_data& daItemBase_c::getData() {
return m_data;
}
@@ -353,6 +378,10 @@ int daItem_c::_daItem_draw() {
return 1;
}
#if TARGET_PC
dusk::frame_interp::add_interpolation_callback(&d_a_obj_item_interp_callback, this);
#endif
if (chkDraw()) {
return DrawBase();
}
@@ -390,6 +419,9 @@ void daItem_c::procMainNormal() {
cLib_chaseF(&scale.z, mItemScale.z, step_z);
}
#if TARGET_PC
if (!dusk::getSettings().game.enableIndefiniteItemDrops) {
#endif
if (mWaitTimer == 0) {
if (mDisappearTimer == 0) {
deleteItem();
@@ -399,6 +431,9 @@ void daItem_c::procMainNormal() {
changeDraw();
}
}
#if TARGET_PC
}
#endif
mCcCyl.SetC(current.pos);
dComIfG_Ccsp()->Set(&mCcCyl);
@@ -1058,9 +1093,16 @@ int daItem_c::CountTimer() {
if (checkCountTimer()) {
if (mWaitTimer > 0) {
mWaitTimer--;
} else if (mDisappearTimer > 0) {
}
#if TARGET_PC
else if (!dusk::getSettings().game.enableIndefiniteItemDrops && mDisappearTimer > 0) {
mDisappearTimer--;
}
#else
else if (mDisappearTimer > 0) {
mDisappearTimer--;
}
#endif
}
cLib_calcTimer<u8>(&mBoomWindTgTimer);
+41
View File
@@ -10,6 +10,10 @@
#include "d/d_path.h"
#include "d/d_bg_w.h"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#endif
daL8Lift_HIO_c::daL8Lift_HIO_c() {
mStopDisappearTime = 30;
mStartMoveTime = 60;
@@ -380,7 +384,44 @@ void daL8Lift_c::setNextPoint() {
mCurrentPoint = next_point;
}
#if TARGET_PC
void daL8Lift_interp_callback(bool isSimFrame, void* pUserWork) {
daL8Lift_c* lift = static_cast<daL8Lift_c*>(pUserWork);
if (lift == NULL || lift->mpModel == NULL) {
return;
}
g_env_light.settingTevStruct(0x10, &lift->current.pos, &lift->tevStr);
g_env_light.setLightTevColorType_MAJI(lift->mpModel, &lift->tevStr);
J3DModelData* modelData = lift->mpModel->getModelData();
J3DMaterial* materialp = modelData->getMaterialNodePointer(0);
if (materialp->getTexGenBlock()->getTexMtx(1) != NULL) {
J3DTexMtxInfo* mtx_info = &materialp->getTexGenBlock()->getTexMtx(1)->getTexMtxInfo();
if (mtx_info != NULL) {
Mtx m;
C_MTXLightOrtho(m, 100.0f, -100.0f, -100.0f, 100.0f, 1.0f, 1.0f, 0.0f, 0.0f);
mDoMtx_stack_c::XrotS(0x4000);
mDoMtx_stack_c::transM(-lift->current.pos.x, -lift->current.pos.y, -lift->current.pos.z);
cMtx_concat(m, mDoMtx_stack_c::get(), mtx_info->mEffectMtx);
}
}
lift->mBtk.entry(modelData);
J3DGXColor* color = materialp->getTevKColor(1);
color->r = l_HIO.mColorR;
color->g = l_HIO.mColorG;
color->b = l_HIO.mColorB;
}
#endif
int daL8Lift_c::Draw() {
#if TARGET_PC
dusk::frame_interp::add_interpolation_callback(&daL8Lift_interp_callback, this);
#endif
g_env_light.settingTevStruct(16, &current.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
J3DModelData* modelData = mpModel->getModelData();
+41
View File
@@ -11,6 +11,10 @@
#include "d/d_com_inf_game.h"
#include "d/d_path.h"
#if TARGET_PC
#include "dusk/frame_interpolation.h"
#endif
daOptiLift_HIO_c::daOptiLift_HIO_c() {
mStopDisappearTime = 30;
mStartMoveTime = 30;
@@ -412,7 +416,44 @@ void daOptiLift_c::setNextPoint() {
mCurrentPoint = next_point;
}
#if TARGET_PC
static void daOptiLift_interp_callback(bool isSimFrame, void* pUserWork) {
daOptiLift_c* lift = static_cast<daOptiLift_c*>(pUserWork);
if (lift == NULL || lift->mpModel == NULL) {
return;
}
g_env_light.settingTevStruct(0x10, &lift->current.pos, &lift->tevStr);
g_env_light.setLightTevColorType_MAJI(lift->mpModel, &lift->tevStr);
J3DModelData* modelData = lift->mpModel->getModelData();
J3DMaterial* materialp = modelData->getMaterialNodePointer(0);
if (materialp->getTexGenBlock()->getTexMtx(1) != NULL) {
J3DTexMtxInfo* mtx_info = &materialp->getTexGenBlock()->getTexMtx(1)->getTexMtxInfo();
if (mtx_info != NULL) {
Mtx m;
C_MTXLightOrtho(m, 100.0f, -100.0f, -100.0f, 100.0f, 1.0f, 1.0f, 0.0f, 0.0f);
mDoMtx_stack_c::XrotS(0x4000);
mDoMtx_stack_c::transM(-lift->current.pos.x, -lift->current.pos.y, -lift->current.pos.z);
cMtx_concat(m, mDoMtx_stack_c::get(), mtx_info->mEffectMtx);
}
}
lift->mBtk.entry(modelData);
J3DGXColor* color = materialp->getTevKColor(1);
color->r = l_HIO.mColorR;
color->g = l_HIO.mColorG;
color->b = l_HIO.mColorB;
}
#endif
int daOptiLift_c::Draw() {
#if TARGET_PC
dusk::frame_interp::add_interpolation_callback(&daOptiLift_interp_callback, this);
#endif
g_env_light.settingTevStruct(0x10, &current.pos, &tevStr);
g_env_light.setLightTevColorType_MAJI(mpModel, &tevStr);
+1 -3
View File
@@ -981,9 +981,7 @@ int daObjStone_c::draw() {
if (!model) {
f32 shadow_size = l_shadow_size[mStoneType];
TGXTexObj* pTex = dDlst_shadowControl_c::getSimpleTex();
cXyz pos = current.pos;
dComIfGd_setSimpleShadow(&pos, mChkObj.GetGroundH(), shadow_size, mChkObj.m_gnd, 0,
dComIfGd_setSimpleShadow(&current.pos, mChkObj.GetGroundH(), shadow_size, mChkObj.m_gnd, 0,
1.0f, pTex);
}
return 1;
+6 -7
View File
@@ -369,18 +369,17 @@ JKRHeap* daPy_anmHeap_c::setAnimeHeap() {
#if !PLATFORM_WII
#if TARGET_PC
#include "dusk/dvd_asset.hpp"
using GameVersion = dusk::version::GameVersion;
static const u8* l_sightDL_get() {
static u8 buf[0x89];
static bool _ = (
dusk::LoadDolAsset(
buf,
#if VERSION == VERSION_GCN_PAL
0x803BBDA0,
#elif VERSION == VERSION_GCN_JPN
0x803B4220,
#elif VERSION == VERSION_GCN_USA
0x803BA0C0,
#endif
{
{GameVersion::GcnUsa, 0x803BA0C0},
{GameVersion::GcnPal, 0x803BBDA0},
{GameVersion::GcnJpn, 0x803B4220}
},
0x89
),
true
+17 -13
View File
@@ -1,21 +1,22 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRMemArchive.h"
#include "d/actor/d_a_title.h"
#include "d/d_com_inf_game.h"
#include "d/d_demo.h"
#include "d/d_menu_collect.h"
#include "d/d_pane_class_alpha.h"
#include "d/d_s_logo.h"
#include "d/d_s_play.h"
#include "d/d_demo.h"
#include "d/d_pane_class_alpha.h"
#include "d/d_menu_collect.h"
#include "dusk/version.hpp"
#include "f_op/f_op_msg_mng.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "m_Do/m_Do_Reset.h"
#include "m_Do/m_Do_controller_pad.h"
#include "d/d_com_inf_game.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "f_op/f_op_overlap_mng.h"
#include "f_op/f_op_msg_mng.h"
#include "f_op/f_op_scene_mng.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JKernel/JKRMemArchive.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "m_Do/m_Do_graphic.h"
#ifdef TARGET_PC
@@ -49,7 +50,10 @@ static u8 const lit_3772[12] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
#if VERSION == VERSION_GCN_PAL
#if TARGET_PC
using namespace dusk::version;
#define l_arcName versionSelect<const char*>({{GameVersion::GcnPal, "TitlePal"}}, "Title")
#elif VERSION == VERSION_GCN_PAL
static char const l_arcName[] = "TitlePal";
#else
static char const l_arcName[] = "Title";
@@ -59,7 +63,7 @@ daTit_HIO_c::daTit_HIO_c() {
mPSScaleX = 1.0f;
mPSScaleY = 1.0f;
#if VERSION == VERSION_GCN_PAL
#if TARGET_PC || VERSION == VERSION_GCN_PAL
switch (OSGetLanguage()) {
case OS_LANGUAGE_ENGLISH:
case OS_LANGUAGE_GERMAN:
+32 -34
View File
@@ -7,17 +7,13 @@
#include "dusk/frame_interpolation.h"
#if TARGET_PC
const u16 l_J_Ohana00_64TEX__width = 64;
const u16 l_J_Ohana00_64TEX__height = 64;
#else
const u16 l_J_Ohana00_64TEX__width = 63;
const u16 l_J_Ohana00_64TEX__height = 63;
#endif
#if TARGET_PC
#include "dusk/dvd_asset.hpp"
static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9060, 0x800), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_J_Ohana00_64TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9060}, {GameVersion::GcnPal, 0x9060}}, 0x800), true); return buf; }
#define l_J_Ohana00_64TEX (l_J_Ohana00_64TEX_get())
#else
#include "assets/l_J_Ohana00_64TEX.h"
@@ -113,10 +109,12 @@ static u8 l_flowerTexCoord[] = {
0x3E, 0xA7, 0x72, 0xD6, 0xBD, 0x2F, 0x46, 0xAA};
#if TARGET_PC
static u8* l_J_hana00DL_get() { static u8 buf[0x150]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9D20, 0x150), true); return buf; }
static u8* l_J_hana00_cDL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9E80, 0xDE), true); return buf; }
static u8* l_matDL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x9F60, 0x99), true); return buf; }
static u8* l_matLight4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xA000, 0x99), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_J_hana00DL_get() { static u8 buf[0x150]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9D20}, {GameVersion::GcnPal, 0x9D20}}, 0x150), true); return buf; }
static u8* l_J_hana00_cDL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9E80}, {GameVersion::GcnPal, 0x9E80}}, 0xDE), true); return buf; }
static u8* l_matDL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x9F60}, {GameVersion::GcnPal, 0x9F60}}, 0x99), true); return buf; }
static u8* l_matLight4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA000}, {GameVersion::GcnPal, 0xA000}}, 0x99), true); return buf; }
#define l_J_hana00DL (l_J_hana00DL_get())
#define l_J_hana00_cDL (l_J_hana00_cDL_get())
#define l_matDL (l_matDL_get())
@@ -133,16 +131,12 @@ l_matDL__d_a_grass(l_J_Ohana00_64TEX)
l_matLight4DL(l_J_Ohana00_64TEX)
#endif
#if TARGET_PC
const u16 l_J_Ohana01_64128_0419TEX__width = 64;
const u16 l_J_Ohana01_64128_0419TEX__height = 128;
#else
const u16 l_J_Ohana01_64128_0419TEX__width = 63;
const u16 l_J_Ohana01_64128_0419TEX__height = 127;
#endif
#if TARGET_PC
static u8* l_J_Ohana01_64128_0419TEX_get() { static u8 buf[0x1000]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xA0A0, 0x1000), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_J_Ohana01_64128_0419TEX_get() { static u8 buf[0x1000]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xA0A0}, {GameVersion::GcnPal, 0xA0A0}}, 0x1000), true); return buf; }
#define l_J_Ohana01_64128_0419TEX (l_J_Ohana01_64128_0419TEX_get())
#else
#include "assets/l_J_Ohana01_64128_0419TEX.h"
@@ -274,11 +268,13 @@ static u8 l_flowerTexCoord2[] = {
0x40, 0x1B, 0x7D, 0x52, 0x3F, 0x80, 0x3F, 0x79, 0x40, 0x1B, 0x7D, 0x52, 0x3F, 0x51, 0x10, 0x6F};
#if TARGET_PC
static u8* l_J_hana01DL_get() { static u8 buf[0x138]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xB7C0, 0x138), true); return buf; }
static u8* l_J_hana01_c_00DL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xB900, 0xDE), true); return buf; }
static u8* l_J_hana01_c_01DL_get() { static u8 buf[0x128]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xB9E0, 0x128), true); return buf; }
static u8* l_mat2DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xBB20, 0x99), true); return buf; }
static u8* l_mat2Light4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0xBBC0, 0x99), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_J_hana01DL_get() { static u8 buf[0x138]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB7C0}, {GameVersion::GcnPal, 0xB7C0}}, 0x138), true); return buf; }
static u8* l_J_hana01_c_00DL_get() { static u8 buf[0xDE]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB900}, {GameVersion::GcnPal, 0xB900}}, 0xDE), true); return buf; }
static u8* l_J_hana01_c_01DL_get() { static u8 buf[0x128]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xB9E0}, {GameVersion::GcnPal, 0xB9E0}}, 0x128), true); return buf; }
static u8* l_mat2DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBB20}, {GameVersion::GcnPal, 0xBB20}}, 0x99), true); return buf; }
static u8* l_mat2Light4DL_get() { static u8 buf[0x99]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0xBBC0}, {GameVersion::GcnPal, 0xBBC0}}, 0x99), true); return buf; }
#define l_J_hana01DL (l_J_hana01DL_get())
#define l_J_hana01_c_00DL (l_J_hana01_c_00DL_get())
#define l_J_hana01_c_01DL (l_J_hana01_c_01DL_get())
@@ -586,11 +582,11 @@ dFlower_packet_c::dFlower_packet_c() {
#if TARGET_PC
GXInitTexObj(&mTexObj_l_J_Ohana00_64TEX, l_J_Ohana00_64TEX,
l_J_Ohana00_64TEX__width, l_J_Ohana00_64TEX__height, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
l_J_Ohana00_64TEX__width + 1, l_J_Ohana00_64TEX__height + 1, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
);
GXInitTexObj(&mTexObj_l_J_Ohana01_64128_0419TEX, l_J_Ohana01_64128_0419TEX,
l_J_Ohana01_64128_0419TEX__width, l_J_Ohana01_64128_0419TEX__height, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
l_J_Ohana01_64128_0419TEX__width + 1, l_J_Ohana01_64128_0419TEX__height + 1, GX_TF_CMPR, GX_MIRROR, GX_MIRROR, GX_FALSE
);
#endif
@@ -699,14 +695,14 @@ void dFlower_packet_c::draw() {
if (!cLib_checkBit<u8>(sp44->m_state, 4) && !cLib_checkBit<u8>(sp44->m_state, 0x40)) {
#ifdef TARGET_PC
Mtx flower_mtx;
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&sp44->m_modelMtx), flower_mtx)) {
if (dusk::frame_interp::lookup_replacement(&sp44->m_modelMtx, flower_mtx)) {
cMtx_concat(j3dSys.getViewMtx(), flower_mtx, flower_mtx);
GXLoadPosMtxImm(flower_mtx, 0);
} else {
} else
#endif
{
GXLoadPosMtxImm(sp44->m_modelMtx, 0);
#ifdef TARGET_PC
}
#endif
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
#if TARGET_PC
@@ -789,6 +785,10 @@ void dFlower_packet_c::draw() {
GXColor sp28;
#if AVOID_UB
sp28 = {1, 1, 1, 1};
#endif
//u8 sp26, sp25, sp24;
GXColor sp24;
sp24.r = -0.4f * temp_r29->AmbCol.r * var_f29;
@@ -854,20 +854,18 @@ void dFlower_packet_c::draw() {
if (!cLib_checkBit<u8>(sp34->m_state, 4) && cLib_checkBit<u8>(sp34->m_state, 0x40)) {
#ifdef TARGET_PC
Mtx flower_mtx;
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&sp34->m_modelMtx), flower_mtx)) {
if (dusk::frame_interp::lookup_replacement(&sp34->m_modelMtx, flower_mtx)) {
cMtx_concat(j3dSys.getViewMtx(), flower_mtx, flower_mtx);
GXLoadPosMtxImm(flower_mtx, 0);
} else {
} else
#endif
{
GXLoadPosMtxImm(sp34->m_modelMtx, 0);
#ifdef TARGET_PC
}
#endif
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
#if TARGET_PC
GXLoadTexObj(&mTexObj_l_J_Ohana01_64128_0419TEX, GX_TEXMAP0);
#endif
if (!cLib_checkBit<u8>(sp34->m_state, 8)) {
if (!cLib_checkBit<u8>(sp34->m_state, 0x10)) {
GXCallDisplayList(mp_Jhana01DL, m_Jhana01DL_size);
@@ -994,7 +992,7 @@ void dFlower_packet_c::update() {
mDoMtx_stack_c::scaleM(temp_f31, temp_f31, temp_f31);
cMtx_concat(j3dSys.getViewMtx(), temp_r28, data_p->m_modelMtx);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(&data_p->m_modelMtx), data_p->m_modelMtx);
dusk::frame_interp::record_final_mtx(temp_r28, data_p->m_modelMtx);
#endif
}
}
+21 -20
View File
@@ -20,8 +20,9 @@ const u16 l_M_kusa05_RGBATEX__height = 31;
#if TARGET_PC
#include "dusk/dvd_asset.hpp"
static u8* l_M_kusa05_RGBATEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x7680, 0x800), true); return buf; }
static u8* l_M_Hijiki00TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x7E80, 0x800), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_M_kusa05_RGBATEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7680}, {GameVersion::GcnPal, 0x7680}}, 0x800), true); return buf; }
static u8* l_M_Hijiki00TEX_get() { static u8 buf[0x800]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x7E80}, {GameVersion::GcnPal, 0x7E80}}, 0x800), true); return buf; }
#define l_M_kusa05_RGBATEX (l_M_kusa05_RGBATEX_get())
#define l_M_Hijiki00TEX (l_M_Hijiki00TEX_get())
#else
@@ -113,12 +114,14 @@ static u8 l_texCoord[160] = {
};
#if TARGET_PC
static u8* l_M_Kusa_9qDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8B00, 0xCB), true); return buf; }
static u8* l_M_Kusa_9q_cDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8BE0, 0xCB), true); return buf; }
static u8* l_M_TenGusaDL_get() { static u8 buf[0xD4]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8CC0, 0xD4), true); return buf; }
static u8* l_Tengusa_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8DA0, 0xA8), true); return buf; }
static u8* l_kusa9q_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8E60, 0xA8), true); return buf; }
static u8* l_kusa9q_l4_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", 0x8F20, 0xA8), true); return buf; }
using GameVersion = dusk::version::GameVersion;
static u8* l_M_Kusa_9qDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8B00}, {GameVersion::GcnPal, 0x8B00}}, 0xCB), true); return buf; }
static u8* l_M_Kusa_9q_cDL_get() { static u8 buf[0xCB]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8BE0}, {GameVersion::GcnPal, 0x8BE0}}, 0xCB), true); return buf; }
static u8* l_M_TenGusaDL_get() { static u8 buf[0xD4]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8CC0}, {GameVersion::GcnPal, 0x8CC0}}, 0xD4), true); return buf; }
static u8* l_Tengusa_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8DA0}, {GameVersion::GcnPal, 0x8DA0}}, 0xA8), true); return buf; }
static u8* l_kusa9q_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8E60}, {GameVersion::GcnPal, 0x8E60}}, 0xA8), true); return buf; }
static u8* l_kusa9q_l4_matDL_get() { static u8 buf[0xA8]; static bool _ = (dusk::LoadArchivedRelAsset(buf, 'AMEM', "d_a_grass.rel", {{GameVersion::GcnUsa, 0x8F20}, {GameVersion::GcnPal, 0x8F20}}, 0xA8), true); return buf; }
#define l_M_Kusa_9qDL (l_M_Kusa_9qDL_get())
#define l_M_Kusa_9q_cDL (l_M_Kusa_9q_cDL_get())
#define l_M_TenGusaDL (l_M_TenGusaDL_get())
@@ -491,11 +494,11 @@ dGrass_packet_c::dGrass_packet_c() {
#if TARGET_PC
GXInitTexObj(&mTexObj_l_M_kusa05_RGBATEX, l_M_kusa05_RGBATEX,
l_M_kusa05_RGBATEX__width, l_M_kusa05_RGBATEX__height, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
l_M_kusa05_RGBATEX__width + 1, l_M_kusa05_RGBATEX__height + 1, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
);
GXInitTexObj(&mTexObj_l_M_Hijiki00TEX, l_M_Hijiki00TEX,
l_M_Hijiki00TEX__width, l_M_Hijiki00TEX__height, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
l_M_Hijiki00TEX__width + 1, l_M_Hijiki00TEX__height + 1, GX_TF_RGB5A3, GX_REPEAT, GX_CLAMP, GX_FALSE
);
#endif
@@ -643,18 +646,14 @@ void dGrass_packet_c::draw() {
}
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
#if TARGET_PC
GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0);
#endif
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0));
if (sp48 <= 3) {
GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size);
} else {
GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size);
}
} else {
#if TARGET_PC
GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0);
#endif
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0));
GXCallDisplayList(l_Tengusa_matDL, 0xA0);
}
@@ -680,12 +679,14 @@ void dGrass_packet_c::draw() {
while (var_r29 != NULL) {
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_kusa05_RGBATEX, GX_TEXMAP0));
if (sp48 <= 2) {
GXCallDisplayList(mp_kusa9q_14_DL, m_kusa9q_DL_14_size);
} else {
GXCallDisplayList(mp_kusa9q_DL, m_kusa9q_DL_size);
}
} else {
IF_DUSK(GXLoadTexObj(&mTexObj_l_M_Hijiki00TEX, GX_TEXMAP0));
GXCallDisplayList(l_Tengusa_matDL, 0xA0);
}
@@ -756,13 +757,13 @@ void dGrass_packet_c::draw() {
#ifdef TARGET_PC
Mtx grass_mtx;
if (dusk::frame_interp::lookup_replacement(reinterpret_cast<const void*>(&var_r29->m_modelMtx), grass_mtx)) {
cMtx_concat(j3dSys.getViewMtx(), grass_mtx, grass_mtx);
GXLoadPosMtxImm(grass_mtx, 0);
} else {
} else
#endif
{
GXLoadPosMtxImm(var_r29->m_modelMtx, 0);
#ifdef TARGET_PC
}
#endif
GXLoadNrmMtxImm(j3dSys.getViewMtx(), 0);
if (var_r29->field_0x05 <= 3 || var_r29->field_0x05 >= 10) {
if (var_r29->field_0x02 < -1) {
@@ -1018,7 +1019,7 @@ void dGrass_packet_c::update() {
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), data_p->m_modelMtx);
}
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(reinterpret_cast<const Mtx*>(&data_p->m_modelMtx), data_p->m_modelMtx);
dusk::frame_interp::record_final_mtx(mDoMtx_stack_c::get(), data_p->m_modelMtx);
#endif
}
}
+13
View File
@@ -9,6 +9,8 @@
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "d/d_msg_string.h"
#include "dusk/livesplit.h"
#include "dusk/imgui/ImGuiConsole.hpp"
#include "m_Do/m_Do_controller_pad.h"
dBrightCheck_c::dBrightCheck_c(JKRArchive* i_archive) {
@@ -138,6 +140,17 @@ void dBrightCheck_c::modeWait() {}
void dBrightCheck_c::modeMove() {
if (mDoCPd_c::getTrigA(PAD_1) || mDoCPd_c::getTrigStart(PAD_1)) {
mDoAud_seStart(Z2SE_ENTER_GAME, NULL, 0, 0);
#ifdef TARGET_PC
dusk::speedrun::start();
if (dusk::getSettings().game.speedrunMode && !dusk::getSettings().game.hideTvSettingsScreen) {
// start a new run if a run isn't already in progress
if (!dusk::m_speedrunInfo.m_isRunStarted) {
dusk::ImGuiMenuGame::resetForSpeedrunMode();
dusk::m_speedrunInfo.startRun();
}
}
#endif
mCompleteCheck = true;
mMode = MODE_WAIT_e;
}
+96 -3
View File
@@ -794,6 +794,9 @@ void dCamera_c::updatePad() {
if (mTriggerLeftLast > mCamSetup.ManualEndVal()) {
if (mLockLActive == 0) {
#if TARGET_PC
mCamParam.mManualMode = 0;
#endif
mLockLJustActivated = 1;
} else {
mLockLJustActivated = 0;
@@ -833,6 +836,12 @@ void dCamera_c::updatePad() {
mHoldB = mDoCPd_c::getHoldB(mPadID) ? true : false;
mTrigB = mDoCPd_c::getTrigB(mPadID) ? true : false;
#if TARGET_PC
if (mCamParam.mManualMode) {
return;
}
#endif
bool sp6B = true;
bool sp6C = true;
int temp1;
@@ -1167,6 +1176,7 @@ bool dCamera_c::Run() {
}
} else {
sp0F = (this->*engine_tbl[mCamParam.Algorythmn(mCamStyle)])(mCamStyle);
field_0x170++;
field_0x160++;
mCurCamStyleTimer++;
@@ -3078,6 +3088,11 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
} else {
field_0x968 *= mMonitor.field_0xc / 5.0f;
}
#if TARGET_PC
if (!dusk::getSettings().game.freeCamera || !mCamParam.mManualMode) {
#endif
f32 tmp = field_0x96c * (mIsWolf == 1 ? 30.0f : 30.0f);
center += vec3.norm() * (tmp * globe.V().Sin());
cSGlobe globe2(vec2 - center);
@@ -3091,6 +3106,10 @@ bool dCamera_c::bumpCheck(u32 i_flags) {
vec = lin_chk1.GetCross();
}
#if TARGET_PC
}
#endif
#if DEBUG
if (mCamSetup.CheckFlag(0x8000)) {
dDbVw_Report(20, 235, " U");
@@ -3501,6 +3520,12 @@ void dCamera_c::checkGroundInfo() {
}
bool dCamera_c::chaseCamera(s32 param_0) {
#if TARGET_PC
if (freeCamera()) {
return 1;
}
#endif
static f32 JumpCushion = 0.9f;
f32 charge_latitude = mCamSetup.ChargeLatitude();
int charge_timer = mCamSetup.ChargeTimer();
@@ -4604,6 +4629,7 @@ bool dCamera_c::chaseCamera(s32 param_0) {
sp110 = mViewCache.mDirection.R();
mViewCache.mDirection.R(mViewCache.mDirection.R() + (fVar55 - mViewCache.mDirection.R()) * chase->field_0x74);
chase->field_0x64 = mViewCache.mCenter + mViewCache.mDirection.Xyz();
mViewCache.mEye = chase->field_0x64;
@@ -7063,6 +7089,15 @@ bool dCamera_c::subjectCamera(s32 param_0) {
}
cXyz sp1E0(val0, val2, val1);
#if TARGET_PC
f32 aspect = mDoGph_gInf_c::getAspect();
f32 baseAspect = FB_WIDTH / FB_HEIGHT;
if (aspect > baseAspect) {
sp1E0.z += (aspect - baseAspect) * 4;
}
#endif
sp1D4 = dCamMath::xyzRotateX(sp1E0, angle_x);
sp1E0 = dCamMath::xyzRotateY(sp1D4, angle_y);
f32 sp6C = sp12 ? 40.0f : 0.0f;
@@ -7435,6 +7470,58 @@ bool dCamera_c::test2Camera(s32 param_0) {
return false;
}
#if TARGET_PC
bool dCamera_c::freeCamera() {
if (!dusk::getSettings().game.freeCamera) {
mCamParam.mManualMode = 0;
return false;
}
mCamParam.freeXAngle = mViewCache.mDirection.mAzimuth.Degree();
mCamParam.freeYAngle = mViewCache.mDirection.mInclination.Degree();
cXyz camMovement = {mPadInfo.mCStick.mLastPosX, mPadInfo.mCStick.mLastPosY, 0.0f};
f32 magnitude = sqrt(mPadInfo.mCStick.mLastPosX * mPadInfo.mCStick.mLastPosX + mPadInfo.mCStick.mLastPosY * mPadInfo.mCStick.mLastPosY);
if (mPadInfo.mCStick.mLastPosX != 0 || mPadInfo.mCStick.mLastPosY != 0) {
if (!mCamParam.mManualMode) {
mCamParam.mManualMode = 1;
mCamParam.freeXAngle = mViewCache.mDirection.mAzimuth.Degree();
mCamParam.freeYAngle = mViewCache.mDirection.mInclination.Degree();
}
camMovement = camMovement.normalize();
camMovement.y *= dusk::getSettings().game.invertCameraYAxis ? 1.0f : -1.0f;
mCamParam.freeXAngle += camMovement.x * magnitude * dusk::getSettings().game.freeCameraSensitivity * 4.0f;
mCamParam.freeYAngle += camMovement.y * magnitude * dusk::getSettings().game.freeCameraSensitivity * 4.0f;
}
if (!mCamParam.mManualMode) {
return false;
}
f32 minYAngle = -10.0f;
f32 maxAngle = 50.0f;
mCamParam.freeYAngle = std::clamp(mCamParam.freeYAngle, minYAngle, maxAngle);
mViewCache.mDirection.mAzimuth = cSAngle(mCamParam.freeXAngle);
mViewCache.mDirection.mInclination = cSAngle(mCamParam.freeYAngle);
f32 currentLerp = (mCamParam.freeYAngle - minYAngle) / (maxAngle - minYAngle);
mViewCache.mDirection.mRadius = std::lerp(200.0f, 1000.0f, currentLerp);
cXyz finalCenter = mpPlayerActor->current.pos;
finalCenter.y += mIsWolf ? 90.0f : 100.0f;
mViewCache.mCenter = finalCenter;
cXyz finalEye = finalCenter + mViewCache.mDirection.Xyz();
mViewCache.mEye = finalEye;
mViewCache.mFovy = 60.0f;
return true;
}
#endif
bool dCamera_c::towerCamera(s32 param_0) {
cSAngle stack_444 = cSAngle(mCamSetup.ChargeLatitude());
f32 sp224 = mCamSetup.ChargeBRatio();
@@ -11009,6 +11096,15 @@ static int camera_execute(camera_process_class* i_this) {
i_this->mCamera.CalcTrimSize();
store(i_this);
#ifdef TARGET_PC
// record new camera for our sim frame
dusk::frame_interp::record_camera(i_this, get_camera_id(i_this));
// interpolate the view now so that this sim frame's view matrix matches what
// we'll be rendering with later
dusk::frame_interp::interp_view(&i_this->view);
#endif
view_setup(i_this);
return 1;
}
@@ -11077,9 +11173,6 @@ static int camera_draw(camera_process_class* i_this) {
C_MTXPerspective(process->view.projMtx, process->view.fovy, process->view.aspect, process->view.near_, process->view.far_);
mDoMtx_lookAt(process->view.viewMtx, &process->view.lookat.eye, &process->view.lookat.center,
&process->view.lookat.up, process->view.bank);
#ifdef TARGET_PC
dusk::frame_interp::record_camera(process, camera_id);
#endif
#if WIDESCREEN_SUPPORT
mDoGph_gInf_c::setWideZoomProjection(process->view.projMtx);
+23 -32
View File
@@ -1096,16 +1096,7 @@ void dDlst_shadowReal_c::draw() {
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
GXSetCurrentMtx(GX_PNMTX0);
#ifdef TARGET_PC
Mtx receiver_proj_mtx;
if (dusk::frame_interp::lookup_replacement(&mReceiverProjMtx, receiver_proj_mtx)) {
GXLoadTexMtxImm(receiver_proj_mtx, GX_TEXMTX0, GX_MTX3x4);
} else {
#endif
GXLoadTexMtxImm(mReceiverProjMtx, GX_TEXMTX0, GX_MTX3x4);
#ifdef TARGET_PC
}
#endif
GXLoadTexMtxImm(mReceiverProjMtx, GX_TEXMTX0, GX_MTX3x4);
mShadowRealPoly.draw();
}
@@ -1263,14 +1254,9 @@ u8 dDlst_shadowReal_c::setShadowRealMtx(cXyz* param_0, cXyz* param_1, f32 param_
C_MTXOrtho(mRenderProjMtx, param_2, -param_2, -param_2, param_2, 1.0f, 10000.0f);
C_MTXLightOrtho(mReceiverProjMtx, param_2, -param_2, -param_2, param_2, 0.5f, -0.5f, 0.5f, 0.5f);
cMtx_concat(mReceiverProjMtx, mViewMtx, mReceiverProjMtx);
#ifdef TARGET_PC
dusk::frame_interp::record_final_mtx_raw(&mViewMtx, mViewMtx);
dusk::frame_interp::record_final_mtx_raw(&mReceiverProjMtx, mReceiverProjMtx);
#endif
return r29;
}
u32 dDlst_shadowReal_c::set(u32 i_key, J3DModel* i_model, cXyz* param_2, f32 param_3, f32 param_4,
dKy_tevstr_c* param_5, f32 i_cameraZ, f32 param_7) {
dScnKy_env_light_c* env_light = dKy_getEnvlight();
@@ -1292,6 +1278,7 @@ u32 dDlst_shadowReal_c::set(u32 i_key, J3DModel* i_model, cXyz* param_2, f32 par
}
field_0x1 = setShadowRealMtx(&sp60, param_2, param_3, param_4, param_7, param_5);
if (!field_0x1) {
return 0;
}
@@ -1331,14 +1318,14 @@ void dDlst_shadowSimple_c::draw() {
GXSetVtxDesc(GX_VA_POS, GX_INDEX8);
#ifdef TARGET_PC
Mtx volume_mtx;
if (dusk::frame_interp::lookup_replacement(&mVolumeMtx, volume_mtx)) {
if (dusk::frame_interp::lookup_replacement(mVolumeMtxKey, volume_mtx)) {
cMtx_concat(j3dSys.getViewMtx(), volume_mtx, volume_mtx);
GXLoadPosMtxImm(volume_mtx, GX_PNMTX0);
} else {
} else
#endif
{
GXLoadPosMtxImm(mVolumeMtx, GX_PNMTX0);
#ifdef TARGET_PC
}
#endif
GXSetCurrentMtx(GX_PNMTX0);
GXCallDisplayList(l_frontMat, 0x40);
GXCallDisplayList(l_shadowVolumeDL, 0x40);
@@ -1346,14 +1333,14 @@ void dDlst_shadowSimple_c::draw() {
GXCallDisplayList(l_shadowVolumeDL, 0x40);
#ifdef TARGET_PC
Mtx shadow_mtx;
if (dusk::frame_interp::lookup_replacement(&mMtx, shadow_mtx)) {
if (dusk::frame_interp::lookup_replacement(mMtxKey, shadow_mtx)) {
cMtx_concat(j3dSys.getViewMtx(), shadow_mtx, shadow_mtx);
GXLoadPosMtxImm(shadow_mtx, GX_PNMTX1);
} else {
} else
#endif
{
GXLoadPosMtxImm(mMtx, GX_PNMTX1);
#ifdef TARGET_PC
}
#endif
GXSetCurrentMtx(GX_PNMTX1);
if (mpTexObj != NULL) {
@@ -1383,6 +1370,12 @@ void dDlst_shadowSimple_c::draw() {
GXCallDisplayList(l_shadowVolumeDL, 0x40);
}
#if TARGET_PC
static const void* getInterpKey(const void* base, int idx) {
return reinterpret_cast<const void*>(reinterpret_cast<uintptr_t>(base) ^ idx);
}
#endif
void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* param_3,
s16 param_4, f32 param_5, TGXTexObj* param_6) {
if (param_5 < 0.0f) {
@@ -1406,6 +1399,10 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
mDoMtx_stack_c::transS(param_0->x, param_1 + f30, param_0->z);
mDoMtx_stack_c::YrotM(param_4);
mDoMtx_stack_c::scaleM(param_2, f30 + f30 + 16.0f, param_2 * param_5);
#if TARGET_PC
mVolumeMtxKey = getInterpKey(param_0, 0x1);
dusk::frame_interp::record_final_mtx(mDoMtx_stack_c::get(), mVolumeMtxKey);
#endif
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mVolumeMtx);
f32 f31 = JMAFastSqrt(1.0f - param_3->x * param_3->x);
f32 f29;
@@ -1431,17 +1428,11 @@ void dDlst_shadowSimple_c::set(cXyz* param_0, f32 param_1, f32 param_2, cXyz* pa
mDoMtx_stack_c::get()[2][3] = param_0->z;
mDoMtx_stack_c::YrotM(param_4);
mDoMtx_stack_c::scaleM(param_2, 1.0f, param_2 * param_5);
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mMtx);
#ifdef TARGET_PC
const uint64_t shadow_tag_base = dusk::frame_interp::alloc_simple_shadow_pair_base();
if (shadow_tag_base != 0) {
dusk::frame_interp::record_final_mtx_raw_tagged(&mVolumeMtx, mVolumeMtx, shadow_tag_base);
dusk::frame_interp::record_final_mtx_raw_tagged(&mMtx, mMtx, shadow_tag_base + 1u);
} else {
dusk::frame_interp::record_final_mtx_raw(&mVolumeMtx, mVolumeMtx);
dusk::frame_interp::record_final_mtx_raw(&mMtx, mMtx);
}
mMtxKey = getInterpKey(param_0, 0x2);
dusk::frame_interp::record_final_mtx(mDoMtx_stack_c::get(), mMtxKey);
#endif
cMtx_concat(j3dSys.getViewMtx(), mDoMtx_stack_c::get(), mMtx);
mpTexObj = param_6;
}
+14 -1
View File
@@ -14,6 +14,8 @@
#include <cstdio>
#include <cstring>
#include "dusk/version.hpp"
dFile_info_c::dFile_info_c(JKRArchive* i_archive, u8 param_1) {
mArchive = i_archive;
field_0x22 = param_1;
@@ -169,7 +171,18 @@ void dFile_info_c::setSaveDate(dSv_save_c* i_savedata) {
OSCalendarTime time;
OSTicksToCalendarTime(i_savedata->getPlayer().getPlayerStatusB().getDateIpl(), &time);
#if (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
#if TARGET_PC
if (dusk::version::isRegionJpn()) {
sprintf(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday,
time.hour, time.min);
} else if (dusk::version::isRegionPal() && dComIfGs_getPalLanguage() != dSv_player_config_c::LANGUAGE_ENGLISH) {
sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mday, time.mon + 1, time.year, time.hour,
time.min);
} else {
sprintf(mSaveDate, "%02d/%02d/%d %02d:%02d", time.mon + 1, time.mday, time.year, time.hour,
time.min);
}
#elif (VERSION == VERSION_GCN_JPN) || (VERSION == VERSION_WII_JPN)
sprintf(mSaveDate, "%d.%02d.%02d %02d:%02d", time.year, time.mon + 1, time.mday,
time.hour, time.min);
#elif VERSION == VERSION_GCN_PAL
+27 -31
View File
@@ -70,11 +70,7 @@ dFs_HIO_c::dFs_HIO_c() {
select_icon_appear_frames = 5;
appear_display_wait_frames = 15;
field_0x000d = 15;
#if TARGET_PC
card_wait_frames = 0;
#else
card_wait_frames = 90;
#endif
test_frame_counts[0] = 1.11f;
test_frame_counts[1] = 1.11f;
test_frame_counts[2] = 1.11f;
@@ -2102,11 +2098,7 @@ void dFile_select_c::yesnoCursorShow() {
mSelIcon->setPos(pos.x, pos.y, mYnSelPane[field_0x0268]->getPanePtr(), true);
mSelIcon->setAlphaRate(1.0f);
#if TARGET_PC
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
#else
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
#endif
}
}
@@ -2259,11 +2251,7 @@ void dFile_select_c::YesNoCancelMove() {
m3mSelPane[mSelectMenuNum]->getPanePtr(), true);
mSelIcon->setAlphaRate(1.0f);
#if TARGET_PC
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
#else
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
#endif
#if PLATFORM_WII || PLATFORM_SHIELD
field_0x4333 = mSelectMenuNum;
@@ -2375,7 +2363,7 @@ void dFile_select_c::CommandExec() {
break;
}
mWaitTimer = g_fsHIO.card_wait_frames;
mWaitTimer = IF_DUSK(dusk::getSettings().game.instantSaves ? 0 :) g_fsHIO.card_wait_frames;
}
void dFile_select_c::DataEraseWait() {
@@ -3147,11 +3135,7 @@ void dFile_select_c::screenSet() {
mSelIcon = JKR_NEW dSelect_cursor_c(0, 1.0f, NULL);
JUT_ASSERT(5209, mSelIcon != NULL);
#if TARGET_PC
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
#else
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
#endif
Vec vtxCenter;
vtxCenter = mSelFilePanes[mSelectNum]->getGlobalVtxCenter(false, 0);
@@ -3204,6 +3188,9 @@ void dFile_select_c::screenSet() {
timg, NULL);
mpFadePict->setBlackWhite(black, white);
mpFadePict->setAlpha(0);
#ifdef TARGET_PC
mFadeDlst.mpPict = mpFadePict;
#endif
#endif
}
@@ -3284,11 +3271,7 @@ void dFile_select_c::screenSetCopySel() {
mSelIcon2 = JKR_NEW dSelect_cursor_c(0, 1.0f, NULL);
JUT_ASSERT(5406, mSelIcon2 != NULL);
#if TARGET_PC
mSelIcon2->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
#else
mSelIcon2->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
#endif
Vec center = mCpSelPane[0]->getGlobalVtxCenter(false, 0);
mSelIcon2->setPos(center.x, center.y, mCpSelPane[0]->getPanePtr(), true);
@@ -3680,11 +3663,7 @@ void dFile_select_c::selFileCursorShow() {
mSelIcon->setPos(local_1c.x, local_1c.y, mSelFilePanes[mSelectNum]->getPanePtr(), true);
mSelIcon->setAlphaRate(1.0f);
#if TARGET_PC
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.94f, 0.03f, 0.7f, 0.7f);
#else
mSelIcon->setParam(0.96f, 0.94f, 0.03f, 0.7f, 0.7f);
#endif
}
void dFile_select_c::menuWakuAlpahAnmInit(u8 i_idx, u8 param_1, u8 param_2, u8 param_3) {
@@ -3727,11 +3706,7 @@ void dFile_select_c::menuCursorShow() {
mSelIcon->setPos(local_24.x, local_24.y, m3mSelPane[mSelectMenuNum]->getPanePtr(), true);
mSelIcon->setAlphaRate(1.0f);
#if TARGET_PC
mSelIcon->setParam(0.96f * mDoGph_gInf_c::hudAspectScaleUp, 0.84f, 0.06f, 0.5f, 0.5f);
#else
mSelIcon->setParam(0.96f, 0.84f, 0.06f, 0.5f, 0.5f);
#endif
}
}
@@ -3833,6 +3808,16 @@ void dFile_select_c::fileSelectWide() {
fileSel.Scr->search(MULTI_CHAR('w_uzu07'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
fileSel.Scr->search(MULTI_CHAR('w_uzu08'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
fileSel.Scr->search(MULTI_CHAR('w_uzu09'))->scale(mDoGph_gInf_c::hudAspectScaleDown, 1.0f);
#if TARGET_PC
if (mSelIcon) {
mSelIcon->refreshAspectScale();
}
if (mSelIcon2) {
mSelIcon2->refreshAspectScale();
}
#endif
}
#endif
@@ -3870,10 +3855,14 @@ void dFile_select_c::_draw() {
dComIfGd_set2DOpa(mSelIcon2);
#if PLATFORM_GCN
#if TARGET_PC
dComIfGd_set2DOpaTop(&mFadeDlst);
#else
mpFadePict->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), false, false,
false);
#endif
#endif
}
}
@@ -3917,6 +3906,13 @@ void dDlst_FileSel3m_c::draw() {
Scr3m->draw(0.0f, 0.0f, graf);
}
#ifdef TARGET_PC
void dDlst_FileSelFade_c::draw() {
mpPict->draw(mDoGph_gInf_c::getMinXF(), mDoGph_gInf_c::getMinYF(),
mDoGph_gInf_c::getWidthF(), mDoGph_gInf_c::getHeightF(), false, false, false);
}
#endif
void dFile_select_c::errorMoveAnmInitSet(int param_1, int param_2) {
mErrorMsgPane->setAnimation(field_0x0090);
field_0x0130 = param_1;
@@ -4759,7 +4755,7 @@ void dFile_select_c::MemCardFormatYesSel2Disp() {
bool isErrorTxtChange = errorTxtChangeAnm();
bool isYnMenuMove = yesnoMenuMoveAnm();
if (isErrorTxtChange == true && isYnMenuMove == true) {
mWaitTimer = g_fsHIO.card_wait_frames;
mWaitTimer = IF_DUSK(dusk::getSettings().game.instantSaves ? 0 :) g_fsHIO.card_wait_frames;
mDoMemCd_Format();
mCardCheckProc = MEMCARDCHECKPROC_FORMAT;
}
@@ -4830,7 +4826,7 @@ void dFile_select_c::MemCardMakeGameFileSelDisp() {
if (isErrorTxtChange == true && isYnMenuMove == true && isKetteiTxtDisp == true) {
if (field_0x0268 != 0) {
mWaitTimer = g_fsHIO.card_wait_frames;
mWaitTimer = IF_DUSK(dusk::getSettings().game.instantSaves ? 0 :) g_fsHIO.card_wait_frames;
setInitSaveData();
dataSave();
mCardCheckProc = MEMCARDCHECKPROC_MAKE_GAMEFILE;
+5
View File
@@ -35,6 +35,7 @@
#if TARGET_PC
#include "dusk/imgui/ImGuiBloomWindow.hpp"
#include "dusk/settings.h"
#include "dusk/frame_interpolation.h"
#endif
static void GxXFog_set();
@@ -8251,6 +8252,10 @@ static int dKy_Create(void* i_this) {
kankyo_class* kankyo = (kankyo_class*)i_this;
BOOL next_time_set = false;
#if TARGET_PC
kankyo->base.draw_interp_frame = true;
#endif
stage_envr_info_class* stage_envr_p = dComIfGp_getStageEnvrInfo();
if (stage_envr_p != NULL && dComIfGp_getStartStageRoomNo() != -1) {
stage_envr_p += dComIfGp_getStartStageRoomNo();

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