Compare commits

..

509 Commits

Author SHA1 Message Date
gymnast86 07a4d1ec6c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-08-04 07:03:46 -07:00
gymnast86 56bede561c move more checks from code into flows 2026-08-04 07:02:13 -07:00
gymnast86 e5b9af9c53 fix bulblin camp key not being accounted for in keysy 2026-08-04 03:24:56 -07:00
gymnast86 320acda383 set rando temp flags using flows 2026-08-03 13:52:52 -07:00
gymnast86 3ccfe81914 rework some locations to modify flow nodes instead 2026-08-03 13:25:43 -07:00
gymnast86 8220f2b8e9 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-08-01 09:31:39 -07:00
gymnast86 ce2d37df68 first pass at hint system 2026-08-01 09:31:29 -07:00
gymnast86 687307b4c1 fix hyrule castle logic error 2026-07-24 17:07:52 -07:00
gymnast86 4b0a58b8f2 add hint signs to various maps 2026-07-23 05:06:31 -07:00
gymnast86 f16290d1e0 better accounting for custom flow/text ids 2026-07-23 00:58:20 -07:00
gymnast86 e9a84c2fb5 change default param value for BreakLines 2026-07-23 00:57:54 -07:00
gymnast86 c1d34d7b68 change default custom message attributes 2026-07-22 23:32:54 -07:00
gymnast86 d12cf18ce1 change name of default entry 2026-07-22 04:23:07 -07:00
gymnast86 1643474573 handle custom text id attributes 2026-07-22 04:17:26 -07:00
gymnast86 3d06c6607c account for custom flow indices in getInitNodeIndex 2026-07-22 04:17:07 -07:00
gymnast86 1d275f4ead actually save attribute overrides 2026-07-22 04:15:39 -07:00
gymnast86 957dbe976e add extra exit out of City in the Sky 2026-07-22 02:44:52 -07:00
gymnast86 ba994a4e65 add required dungeons to Midna hint text 2026-07-22 02:12:59 -07:00
gymnast86 21e75bac1c properly set flag for cutscene in Hyrule Castle 2026-07-22 00:46:11 -07:00
gymnast86 9b087aadda Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-21 00:57:59 -07:00
gymnast86 1aa81ff907 remove warp to start from menu (it's on midna now) 2026-07-21 00:55:06 -07:00
gymnast86 21a7823045 custom flow nodes and initial custom midna choices 2026-07-21 00:51:33 -07:00
gymnast86 a245876f7f Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-16 01:11:04 -07:00
gymnast86 1c59d124dc fix include 2026-07-15 01:50:15 -07:00
gymnast86 7766739df1 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-15 01:08:32 -07:00
gymnast86 0b23015ddb fix Hyrule Castle being wrongly considered a barren dungeon when placing "any dungeon" items 2026-07-15 00:49:30 -07:00
gymnast86 9537df2ee7 fixes for running standalone generator 2026-07-15 00:48:22 -07:00
gymnast86 9e6dd59e49 fix "any dungeon" items sometimes being placed wrong 2026-07-15 00:47:42 -07:00
gymnast86 fa34335a09 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-14 15:33:40 -07:00
gymnast86 a4c619ad58 move yeta fixes to flow patches 2026-07-14 15:24:34 -07:00
gymnast86 cf0c1c3160 fix goron mines key shards in tracker 2026-07-13 23:48:25 -07:00
gymnast86 6be65a461d fix include paths to not pollute d_com_inf_game.h 2026-07-13 22:50:41 -07:00
gymnast86 bb1c1447d0 fix conflicts 2026-07-13 16:55:08 -07:00
gymnast86 dce6b4c666 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-13 15:52:24 -07:00
gymnast86 9756612b35 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-02 20:01:09 -07:00
gymnast86 49f27acb2b fix rando config not saving when it should 2026-07-02 20:01:02 -07:00
gymnast86 d1ea637d22 add midna hair and charge ring colors 2026-07-02 20:00:47 -07:00
gymnast86 591c38e871 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-07-01 00:27:50 -07:00
gymnast86 a5bc71795e add various cosmetic options 2026-07-01 00:27:35 -07:00
gymnast86 26d0725c76 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-26 11:56:32 -07:00
gymnast86 1b3b493fbf reset rando context if current seed is deleted 2026-06-26 11:53:33 -07:00
gymnast86 f62a70f9d0 update starting time of day descriptions 2026-06-26 11:40:09 -07:00
gymnast86 ec2173db9f change seed option menu styling 2026-06-26 11:34:22 -07:00
gymnast86 563944d4a3 use updated shadow crystal bti from melonspeedruns 2026-06-26 11:32:59 -07:00
gymnast86 b8f69e82dd add shadow crystal icon 2026-06-25 08:57:34 -07:00
gymnast86 830b560933 text changes to account for long item names 2026-06-25 03:15:14 -07:00
gymnast86 6592871fa2 add mirror chamber access setting 2026-06-23 09:16:39 -07:00
gymnast86 e57c952deb print required dungeons to spoiler log 2026-06-21 16:18:07 -07:00
gymnast86 4239cea3d5 Fix arbiters grounds sometimes not being listed as a required dungeon 2026-06-21 15:59:39 -07:00
gymnast86 9bd34a0d02 fix gor liggs always setting item bit for 3 key shards 2026-06-21 09:07:54 -07:00
gymnast86 cce67c1809 fix dpad icon not drawing at unlocked framerates 2026-06-21 08:32:58 -07:00
gymnast86 6bf0dfd92a properly patch CT malo mart door to be open at any time of day 2026-06-20 10:24:17 -07:00
gymnast86 4d8fcfa551 add permalink sharing 2026-06-20 07:57:49 -07:00
gymnast86 a3de85fb4b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-19 03:09:50 -07:00
gymnast86 08e0645ef8 add functionality for saving and loading presets 2026-06-19 03:08:12 -07:00
gymnast86 f20cf3c24e change spoiler log wording 2026-06-19 03:03:03 -07:00
gymnast86 b2dfdf4158 fix entrance metadata 2026-06-19 03:02:47 -07:00
gymnast86 99689258a2 misc cleanup 2026-06-17 23:56:37 -07:00
gymnast86 08345d01ed Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-17 03:01:05 -07:00
gymnast86 56d47d475f add button to reset settings to default 2026-06-17 03:00:40 -07:00
gymnast86 8a92efbe0d properly save rando file during autosave 2026-06-17 02:30:54 -07:00
gymnast86 1790ad6faf fix merge conflicts 2026-06-16 05:30:08 -04:00
gymnast86 e39c139b97 Merge branch 'main' of https://github.com/TwilitRealm/dusklight into randomizer 2026-06-16 05:18:57 -04:00
gymnast86 54b3545736 properly refocus child element after deleting a seed 2026-06-16 05:14:32 -04:00
gymnast86 2428ca2efe Merge branch 'main' of https://github.com/TwilitRealm/dusklight into randomizer 2026-06-15 06:04:32 -04:00
gymnast86 05d9cf0402 make requirement tooltips more readable 2026-06-15 06:03:08 -04:00
gymnast86 2651640ee0 Merge branch 'main' of https://github.com/TwilitRealm/dusklight into randomizer 2026-06-13 20:59:48 -04:00
gymnast86 f8c5a8988b fix getTempleKeysFound 2026-06-13 20:57:32 -04:00
gymnast86 544964c1a5 properly implement no logic 2026-06-13 07:56:51 -04:00
gymnast86 7bd3e9cafd move saved file seed load to file select instead of file start 2026-06-12 21:25:49 -04:00
gymnast86 8999c4c9c5 remove asheis sketch after showing it to Ralis 2026-06-12 20:48:24 -04:00
gymnast86 917def4732 fix missed string 2026-06-12 20:48:02 -04:00
gymnast86 0516282bb6 cleanup settings_list.yaml and related files 2026-06-12 19:26:09 -04:00
gymnast86 d855efe513 remove instances of double actors 2026-06-10 23:05:25 -06:00
gymnast86 28733f5c15 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-10 06:23:31 -07:00
gymnast86 b2ac2d6600 overhaul seed selection to be on file creation 2026-06-10 06:22:03 -07:00
gymnast86 68bebfad3a Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-08 22:58:46 -07:00
gymnast86 a0f5b250b4 Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-08 22:58:41 -07:00
gymnast86 cb70f2c3b3 use C-style array for adjectives and nouns 2026-06-08 22:58:29 -07:00
Luke Street 5851954ca1 Revert "Move RegisteredConfigVars to function-local static"
This reverts commit ea09dd73c6.
2026-06-08 22:16:10 -06:00
gymnast86 c65f0bb0ac Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-08 21:06:52 -07:00
gymnast86 038254db48 decouple generation modal from config menu 2026-06-08 21:05:30 -07:00
Luke Street c1997b3d68 Remove huge TLS variable; fixes Linux issues
Randomizer code was allocating a 25MB buffer
for file I/O using thread-local storage,
which was starving the stack space of threads
created on Linux.

The buffer appears to be a workaround for
Wii U homebrew I/O, so we can just disable
it altogether.

Resolves #1836
2026-06-08 21:52:12 -06:00
gymnast86 474a7dce00 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-08 18:08:13 -07:00
gymnast86 382f33d021 fix some tracker locations not getting updated fast enough 2026-06-08 18:05:21 -07:00
gymnast86 b743a762b4 fix swapped flags for male/female beetle 2026-06-08 16:04:58 -07:00
gymnast86 302abd6b65 track twilight tears in tracker 2026-06-08 13:44:35 -07:00
gymnast86 3f6ae4324b Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-08 00:12:19 -07:00
gymnast86 dccded964b fix hang on swim spawn with no water 2026-06-07 21:09:31 -07:00
Luke Street ea09dd73c6 Move RegisteredConfigVars to function-local static
Defers initialization until used to avoid crash
with specific file-local static initialization ordering.

Fixes #1836
2026-06-07 21:08:41 -06:00
gymnast86 c426b52a15 use constexpr for seed nouns and adjectives 2026-06-07 09:32:53 -07:00
gymnast86 41e0a81c39 fix rando first item bits in editor 2026-06-07 00:54:13 -07:00
gymnast86 5b6f2f6e91 fix some first item bits accidentally getting unset 2026-06-06 23:39:18 -07:00
gymnast86 bbea07ba9e fix boomerang sometimes not spinning as freestanding item 2026-06-06 21:41:16 -07:00
gymnast86 0f0dca5514 fix boomerang potentially not being collected as freestanding item 2026-06-06 21:11:40 -07:00
gymnast86 3fb86dbac8 better plando error messaging 2026-06-06 20:17:51 -07:00
gymnast86 7e367c1e15 parameter cleanup 2026-06-06 18:21:01 -07:00
gymnast86 46e81963e2 focus seed gen modal after seed generates 2026-06-06 17:39:44 -07:00
gymnast86 4f1d4cde3d Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-06 11:14:02 -07:00
gymnast86 45c8fa9f19 update seed generation modal when generation finishes 2026-06-06 11:11:17 -07:00
gymnast86 87635d3cf7 Coro bottle hint in text 2026-06-06 06:46:58 -07:00
gymnast86 e5324c7562 remove old comments 2026-06-05 22:58:58 -07:00
gymnast86 03593def22 fix setting jumpstrike event bit 2026-06-05 22:45:42 -07:00
gymnast86 2ae5518c81 SetPsuedoClass -> SetClass 2026-06-05 21:23:10 -07:00
gymnast86 bc45bf27c2 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-05 21:11:36 -07:00
gymnast86 7d2c9776ea implement excluded locations menu 2026-06-05 21:10:57 -07:00
gymnast86 fbf4fcc50c add crc32.hpp to files.cmake 2026-06-04 18:46:38 -07:00
gymnast86 1868d698f5 include crc32.hpp 2026-06-04 18:05:08 -07:00
gymnast86 d858626be1 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-04 17:56:36 -07:00
gymnast86 f00ad8e0ea maybe fix linux crash 2026-06-04 17:55:48 -07:00
gymnast86 7b521aef02 fix missing location category 2026-06-03 19:39:25 -07:00
gymnast86 4721b8da50 Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-03 16:49:15 -07:00
gymnast86 b06af0e057 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-03 16:48:57 -07:00
gymnast86 518dea482e fix lost woods boulder poe logic 2026-06-03 16:48:50 -07:00
gymnast86 daf2f18369 fix asheis sketch disappearing 2026-06-03 16:48:33 -07:00
CraftyBoss 9307d8abde dont throw on failed to obtain item name, fix getTempleKeysFound not checking flag correctly 2026-06-03 16:47:04 -07:00
gymnast86 b3dbf2c71b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-02 23:25:57 -07:00
gymnast86 4bb5f320c3 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-02 22:15:42 -07:00
gymnast86 f1357f09ed add starting inventory management to UI 2026-06-02 22:15:34 -07:00
gymnast86 e3eb63f158 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-01 19:28:36 -07:00
gymnast86 47c0a399e1 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-06-01 02:07:47 -07:00
gymnast86 dfdd5250bd fix prologue items sometimes being in excluded locations 2026-06-01 02:07:37 -07:00
gymnast86 ba7211126c only spawn donation bridge after twilights are cleared 2026-06-01 01:54:28 -07:00
gymnast86 ef607434dd fix twilight clear checks 2026-06-01 01:53:43 -07:00
gymnast86 f12838ea3b fix required dungeons sign when no dungeons are required 2026-06-01 01:53:04 -07:00
gymnast86 dc88e11115 implement framework for custom text in other languages 2026-05-31 01:41:12 -07:00
gymnast86 e671ed748b change some custom text coloring 2026-05-31 01:38:49 -07:00
gymnast86 98633a5cb6 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-30 19:28:29 -07:00
gymnast86 6c1aeb0d0a reset conversation bit after exiting ordon shield house 2026-05-30 19:28:24 -07:00
gymnast86 a2d41bcfba Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-29 22:57:56 -07:00
gymnast86 96ed5c671b fix garbled ice trap audio 2026-05-29 22:57:38 -07:00
gymnast86 de12d277d0 restricted fills cleanup 2026-05-29 11:31:29 -07:00
gymnast86 3b8ec9efa6 quick no logic implementation 2026-05-29 11:31:13 -07:00
gymnast86 39b079ddb9 fix plentiful item pool crash 2026-05-28 20:33:20 -07:00
gymnast86 e2790d922a reorganize includes 2026-05-28 20:25:26 -07:00
gymnast86 afed2c1774 Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-28 20:22:12 -07:00
gymnast86 46a67c658c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-28 20:21:14 -07:00
gymnast86 351afd6686 add item text replacements 2026-05-28 20:04:20 -07:00
gymnast86 485374abba Outside Castle Town -> South of Castle Town 2026-05-28 20:02:21 -07:00
gymnast86 8ecd848307 filter out nonprogress locations when placing goal items 2026-05-28 20:02:03 -07:00
CraftyBoss c4a13c8c10 add WIP inventory window in check tracker, only decrease available locations if check is accessible
also fixed issue with getSaveItemPool not counting base skybook item, as well as Aurus Memo if it was used
2026-05-28 01:16:53 -07:00
CraftyBoss 313e9be99d Merge remote-tracking branch 'origin/main' into randomizer
# Conflicts:
#	src/d/actor/d_a_npc_kkri.cpp
#	src/d/actor/d_a_npc_rafrel.cpp
2026-05-28 01:15:08 -07:00
gymnast86 d79088ba05 Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-27 10:54:52 -07:00
gymnast86 3aa7abe73f add required dungeons to links house sign 2026-05-27 10:54:35 -07:00
CraftyBoss 8e38f27602 sort checks by status, add hide button, cleanup code layout 2026-05-27 02:00:48 -07:00
Luke Street 7543db2222 Merge branch 'main' into randomizer 2026-05-26 20:58:20 -06:00
gymnast86 32e553e38d Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-25 23:41:18 -07:00
gymnast86 089a947c30 rework some prologue logic 2026-05-25 23:41:10 -07:00
gymnast86 83a5ccce92 fix blank letters 2026-05-25 22:43:09 -07:00
gymnast86 48de086d65 fix logic tests path 2026-05-25 22:39:30 -07:00
gymnast86 5a61b912bb Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-24 22:00:10 -07:00
gymnast86 4e92b22c5d fix auru having a model scale of 0 2026-05-24 21:59:26 -07:00
gymnast86 ede9697dae update bobm refill logic 2026-05-24 19:12:17 -07:00
gymnast86 580b772c3c update tracker flags for various locations 2026-05-24 19:12:10 -07:00
gymnast86 143b548102 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-24 10:32:31 -07:00
gymnast86 15742c71f3 fix aurus memo temporarily disappearing 2026-05-24 10:29:49 -07:00
CraftyBoss 40f753e18b Merge remote-tracking branch 'origin/main' into randomizer
# Conflicts:
#	src/f_op/f_op_actor_mng.cpp
2026-05-24 03:40:08 -07:00
CraftyBoss 65f4048a41 show item name when location is collected, fix ordon shield flag being incorrect 2026-05-23 19:50:45 -07:00
gymnast86 e78a198adf fix horse call get item func 2026-05-23 11:44:21 -07:00
gymnast86 75d86ab296 fix ilia quest logic setting logic 2026-05-23 11:44:05 -07:00
gymnast86 62e48984bf Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-23 09:11:07 -07:00
gymnast86 deb213d07a path cleanup 2026-05-23 09:10:58 -07:00
gymnast86 484c5e8bf3 variable change 2026-05-23 09:10:01 -07:00
gymnast86 bb67fc991d fix isStageItem check 2026-05-23 09:09:13 -07:00
gymnast86 7326a619da fix tears in itempool 2026-05-23 09:08:53 -07:00
CraftyBoss 4ce5800a33 fix some config options not saving on change, move check obtained checking to tool func, tracker cleanup 2026-05-23 03:05:54 -07:00
CraftyBoss 66a8af31b3 fix non msvc compile error 2026-05-23 00:20:38 -07:00
CraftyBoss 85fe76b5be add tracker_isStageItem for Freestanding Item checking 2026-05-22 23:03:06 -07:00
CraftyBoss ffa1fd5da4 add ability to toggle tracker in rmlui (hack for now), show area remaining checks, misc debugging info 2026-05-22 22:49:44 -07:00
gymnast86 3d2c5633cd set nonprogress locations in tracker 2026-05-22 20:35:15 -07:00
gymnast86 08ce522edb add flag checking for more intuitve location marking 2026-05-22 19:58:05 -07:00
gymnast86 ab007b4c44 revert updateTracker check 2026-05-22 19:53:09 -07:00
gymnast86 2cf2442dc8 update location metadata for switch/event flags 2026-05-21 20:03:32 -07:00
gymnast86 7354bfc163 remove unused include 2026-05-21 20:02:18 -07:00
gymnast86 7bca56ea80 uncomment option 2026-05-21 10:04:48 -07:00
gymnast86 42eb9ef518 use region for areas instead of area name 2026-05-21 10:04:38 -07:00
gymnast86 be4a1d8838 don't search if type is NO_SEARCH 2026-05-21 05:53:27 -07:00
gymnast86 fd523a7e4d more intuitive GetWorld function 2026-05-21 05:52:48 -07:00
gymnast86 650b56beee more guarding against null stag info 2026-05-21 05:51:33 -07:00
CraftyBoss 1e3f097e63 start work on detecting if a check has been collected in tracker
the func getStageSaveId in randomizer/game/tools.cpp might not be totally accurate, and is based off google spreadsheet data
2026-05-21 03:26:10 -07:00
CraftyBoss 9fd5678ae4 Merge remote-tracking branch 'origin/main' into randomizer 2026-05-21 00:32:38 -07:00
CraftyBoss dcf6268444 sort tracker checks by area name, uncomment manual update button for now, always generate search when updating tracker 2026-05-20 21:17:27 -07:00
gymnast86 1f4370af85 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-20 17:42:10 -07:00
gymnast86 ed458dc2b3 backend tracker updates 2026-05-20 17:41:03 -07:00
gymnast86 7cebc42266 comments 2026-05-20 14:00:58 -07:00
gymnast86 0d819b215d comment out other options 2026-05-20 13:58:37 -07:00
gymnast86 8113fc3088 Remove entrance rando options until they're hooked up 2026-05-20 13:56:50 -07:00
gymnast86 78bc0216fb Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-19 22:13:29 -07:00
gymnast86 b74603c883 basic backend for tracking 2026-05-19 22:13:06 -07:00
gymnast86 9e8b451462 fix starting time of day button 2026-05-19 19:31:05 -07:00
CraftyBoss d25695be0e implement basic warp to start button in rando menu
serves as a sort of placeholder until Midna can be properly edited to behave like console rando
2026-05-19 17:40:49 -07:00
CraftyBoss ba9dc8e9ba finish up rando config ui, remove randomizerEnabled CVar, fix seed strings not saving to config
i would like to have someone more aquainted with the UI system to look over the config menu at some point, as i do think it could be better.
2026-05-19 16:13:50 -07:00
gymnast86 ddb9816158 use config path for imgui seed selection 2026-05-19 08:43:56 -07:00
gymnast86 33e19f58e0 github action fixes 2026-05-19 07:56:32 -07:00
gymnast86 ece92765c9 use dusk config path for settings file 2026-05-19 00:51:17 -07:00
CraftyBoss c2dea2ab8f switch GenerateSeed to use c++ rand instead 2026-05-18 23:21:08 -07:00
CraftyBoss e0dea86134 embed rando generator yamls into binary 2026-05-18 22:37:55 -07:00
gymnast86 8409c2ab9f Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-18 20:00:57 -07:00
gymnast86 3eb4181b9c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-18 20:00:51 -07:00
gymnast86 0d33d44e75 fix crash after getting Ook item 2026-05-18 20:00:44 -07:00
CraftyBoss 6ea50f33e4 remove fog lantern cooldown while rando is active 2026-05-18 19:17:34 -07:00
CraftyBoss 769b8f02c8 optimize config option finding a bit, add optional settings in config menu, load last generated seed and set generator seed 2026-05-18 19:14:42 -07:00
gymnast86 d77da3fba3 don't show special text for 20 poe souls 2026-05-18 17:50:08 -07:00
gymnast86 ea0c697afa fix key count inconsistency 2026-05-18 11:05:46 -07:00
gymnast86 6321bcf0d8 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-18 07:31:38 -07:00
gymnast86 1e7e9b3513 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-17 17:40:24 -07:00
gymnast86 63e7fb4187 Merge branch 'randomizer' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-17 17:39:59 -07:00
gymnast86 453accc674 draw d-pad icon for quest item slot 2026-05-17 17:39:53 -07:00
madeline a565601849 fix rando_config.cpp on linux maybe 2026-05-17 16:45:18 -07:00
gymnast86 e92a3b4a90 fix epona crash on ordon layer 0 2026-05-17 15:52:16 -07:00
gymnast86 141ddafdc8 another tbox id swap 2026-05-17 13:47:03 -07:00
gymnast86 007561874d Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-17 13:41:36 -07:00
gymnast86 b167124a70 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-17 07:07:09 -07:00
gymnast86 879c68f8a3 fix incorrect stage check 2026-05-17 07:07:02 -07:00
gymnast86 ccaee02c2e Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-17 02:19:59 -07:00
gymnast86 ff498af6e8 add horse jump scob on post mdh kak gorge 2026-05-17 02:19:24 -07:00
gymnast86 9c3420bcc7 fix midna being on players back 2026-05-17 01:56:24 -07:00
gymnast86 23a6719e99 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-16 01:56:46 -07:00
gymnast86 95c1a93332 poe soul option swap 2026-05-16 01:56:37 -07:00
gymnast86 63a91bffde another tbox id swap 2026-05-16 01:56:17 -07:00
gymnast86 d33b3c16e1 zlib cmake fix 2026-05-16 01:56:06 -07:00
gymnast86 33e2ffbb6e Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-15 17:14:46 -07:00
gymnast86 491a73f517 fix swapped tbox IDs 2026-05-15 15:09:54 -07:00
gymnast86 54efc49bd8 fix lake hylia poe logic 2026-05-15 15:09:41 -07:00
gymnast86 f6eaa64156 don't check time when going into malo mart 2026-05-15 11:17:25 -07:00
gymnast86 ed1f21f333 allow overriding flw types 2026-05-15 11:16:11 -07:00
gymnast86 0a0f1e9a04 rando rider ub 2026-05-15 09:09:19 -07:00
gymnast86 64720ef0e0 membit onSwitch patches 2026-05-15 09:08:51 -07:00
gymnast86 b213ae2faa more boulder rupee layer patches 2026-05-15 09:08:15 -07:00
gymnast86 d7e0c240d0 fix domain rock rupee layers 2026-05-15 08:42:14 -07:00
gymnast86 56de23e2e6 fix itempool size 2026-05-15 03:39:44 -07:00
gymnast86 0862408ee8 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-15 02:46:23 -07:00
gymnast86 b2b74e5c4d fix transform after faron twilight 2026-05-15 02:46:08 -07:00
gymnast86 39da278394 fix gate to north faron 2026-05-15 02:32:15 -07:00
gymnast86 ec2f2753a2 update versioning in logs 2026-05-15 01:10:58 -07:00
gymnast86 89a0702d2b put kak bomb rock hp on twilight layer 2026-05-15 00:59:49 -07:00
gymnast86 9d94e9684f Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-14 08:00:45 -07:00
gymnast86 f8d01ae6d2 onEventBit patches 2026-05-14 08:00:34 -07:00
gymnast86 9f400543c2 update startflags 2026-05-14 08:00:09 -07:00
gymnast86 3861bf5506 add twilight layer to eldin boulder rupees 2026-05-14 06:44:20 -07:00
gymnast86 5c745735d7 fix faron boulder rupee layers 2026-05-14 06:13:26 -07:00
gymnast86 886fb7f2db Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-14 04:09:12 -07:00
gymnast86 01d0d12af0 comment 2026-05-14 04:08:35 -07:00
gymnast86 c0f882845d add barriers to prevent early lanayru twilight access 2026-05-13 18:28:48 -07:00
gymnast86 7225fb25dc Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-13 17:04:13 -07:00
gymnast86 5ab46c604b always show reekfish scent path after having smelled reekfish 2026-05-13 17:04:06 -07:00
gymnast86 f3b29d97d0 fix bo house door patches 2026-05-13 06:55:25 -07:00
gymnast86 9447f4e89b fix LH cave chest metadata 2026-05-13 05:09:33 -07:00
gymnast86 7db5386885 use main zlib 2026-05-13 02:47:40 -07:00
gymnast86 9c1617d423 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-13 02:24:56 -07:00
gymnast86 4c4e3e4b10 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-11 14:13:11 -07:00
gymnast86 4db50d2843 fix progressive items in chests on the same stage 2026-05-11 14:05:23 -07:00
gymnast86 ba5a59eee2 Foolish items 2026-05-11 13:47:17 -07:00
CraftyBoss 5e69c7bdce Merge remote-tracking branch 'origin/main' into randomizer
# Conflicts:
#	files.cmake
#	src/m_Do/m_Do_main.cpp
2026-05-10 23:14:50 -07:00
CraftyBoss 04d9640eff add config menu and hook it up into current config system
currently any options that requires additional settings, like "Hyrule Barrier Requirements", wont actually have any additional options yet until i figure out a clean way to handle that
2026-05-10 23:13:02 -07:00
CraftyBoss 83480110fd Merge branch 'main' into randomizer 2026-05-10 15:16:07 -07:00
gymnast86 5038068905 patch spawns between faron field and outside sct to not be inside rocks 2026-05-10 10:45:29 -07:00
gymnast86 7388213715 allow patching of PLYR objects 2026-05-10 10:45:04 -07:00
gymnast86 0e1e64fe7d Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-10 09:56:06 -07:00
gymnast86 f48a3be466 patch cits objects 2026-05-10 09:55:52 -07:00
gymnast86 61835c05ba add support for patching objects in stage.dzs 2026-05-10 09:54:55 -07:00
gymnast86 762a597eba delete midna trigger that sometimes prevents going north in palace 2026-05-10 05:12:17 -07:00
gymnast86 69283fc611 remove grove portal fight walls 2026-05-10 04:51:31 -07:00
gymnast86 b0efe464c0 make shoe shiner always available 2026-05-10 04:05:58 -07:00
gymnast86 a6fda86ebf fix sera bottle check if faorn twilight is cleared 2026-05-10 03:02:27 -07:00
gymnast86 4b363dab06 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-10 01:26:10 -07:00
gymnast86 77ae5fd0b3 implement temple of time sword requirement 2026-05-10 01:25:44 -07:00
gymnast86 2890a663f3 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-09 10:38:57 -07:00
gymnast86 f263a33db2 change time of day with midna 2026-05-09 10:38:34 -07:00
gymnast86 99ee9c2f48 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-09 06:38:27 -07:00
gymnast86 1cfb22fdd9 handle unknown patch action 2026-05-09 06:38:14 -07:00
gymnast86 bf85d511a8 make the gate to KB2 stay open permanently once it's been unlocked 2026-05-09 06:24:27 -07:00
gymnast86 dc9dce2cd7 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-09 04:39:24 -07:00
gymnast86 8333ae35a8 refactor object overrides 2026-05-09 04:38:38 -07:00
gymnast86 ced018794f remove invisible wall blocking north palace 2026-05-09 01:52:27 -07:00
gymnast86 bfb715e11a Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-08 16:26:52 -07:00
gymnast86 9e9f36e484 autoskip cutscenes when skip major cutscenes is on 2026-05-08 16:21:26 -07:00
gymnast86 38031e2545 set all letters obtained when skip minor cutscenes is on 2026-05-08 16:00:42 -07:00
gymnast86 2dea7375ef custom text for donating 100 rupees to charlo 2026-05-08 09:11:36 -07:00
gymnast86 48bfcec0a3 missed include 2026-05-07 23:24:45 -07:00
gymnast86 7a4c23fa33 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-07 23:23:16 -07:00
gymnast86 0014be0e82 implement custom item text 2026-05-07 23:17:58 -07:00
gymnast86 870bd6476c show rando stats by default 2026-05-06 18:41:59 -07:00
gymnast86 96d9b5e7b1 update old category name 2026-05-06 15:35:20 -07:00
gymnast86 09a73d5828 organize items.yaml 2026-05-06 09:06:46 -07:00
gymnast86 e14d1f1f68 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-06 07:56:33 -07:00
gymnast86 9f6c39754b rework actor additions 2026-05-06 07:56:17 -07:00
gymnast86 eda9991e6a sols check 2026-05-06 07:53:02 -07:00
gymnast86 95e699fb63 don't transform in twilight fog if the player doesn't have shadow crystal 2026-05-06 03:48:06 -07:00
gymnast86 618d5b5733 fix data typos 2026-05-06 03:27:28 -07:00
gymnast86 2ececa3206 update goal flags during play 2026-05-06 03:27:14 -07:00
gymnast86 4fddaba76b fix conflict 2026-05-05 21:33:24 -07:00
gymnast86 045df82445 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-05 21:33:06 -07:00
gymnast86 b3833be529 don't try to play get item cutscene when swimming or snowboarding 2026-05-05 21:21:47 -07:00
gymnast86 f45aa6040e fix multiple progressive items on the same stage giving the same item 2026-05-05 21:20:56 -07:00
gymnast86 25b273a726 fix single arrow drops being too large 2026-05-05 21:12:24 -07:00
gymnast86 3e99420527 allow keeping ooccoo jr through dungeon exits 2026-05-05 05:13:26 -07:00
gymnast86 f6e526b187 fix missed metadata 2026-05-05 04:15:53 -07:00
gymnast86 23567fba42 fix boss arena music 2026-05-05 03:47:42 -07:00
gymnast86 255a55d4c8 remove uneeded code 2026-05-05 02:46:52 -07:00
gymnast86 d7ca855d9a Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-05 02:40:56 -07:00
gymnast86 e8318e2eb3 switch fishing hole bottle to FLW message patch 2026-05-05 02:26:18 -07:00
gymnast86 f4992aa378 data cleanup 2026-05-05 02:08:51 -07:00
gymnast86 97388be8e5 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-04 23:58:32 -07:00
gymnast86 dbad1a4832 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-04 22:26:07 -07:00
gymnast86 40949474a1 wooden statue check 2026-05-04 22:23:30 -07:00
gymnast86 1166b58447 telma invoice check 2026-05-04 10:34:05 -07:00
gymnast86 2c7cfa8951 ilia reward and hdiden village checks 2026-05-04 08:37:46 -07:00
gymnast86 89621dbff5 allow swapping between different trade quest items 2026-05-04 06:47:09 -07:00
gymnast86 18f688e4b3 fix blank item slot 2026-05-04 06:14:04 -07:00
gymnast86 354d9b2fde Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-03 18:53:42 -07:00
gymnast86 bc7faadc02 bulblin key 2026-05-03 18:52:59 -07:00
gymnast86 c265207c92 ball and chain check 2026-05-03 17:58:11 -07:00
gymnast86 05678f1ddc snowpeak mansion map check 2026-05-03 17:11:09 -07:00
gymnast86 cf015c4219 goron elder checks 2026-05-03 16:49:14 -07:00
gymnast86 a11427a48f dungeon reward and boss heart container checks 2026-05-03 16:06:45 -07:00
gymnast86 c87d7e3875 gale boomerang check 2026-05-03 06:56:57 -07:00
gymnast86 75f6337985 forest temple baba key 2026-05-03 06:28:57 -07:00
gymnast86 71f33021cc comment consistency 2026-05-03 05:57:56 -07:00
gymnast86 5b52f13f4b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-03 05:34:18 -07:00
gymnast86 0a8cbc8f08 cave of ordeals fairy check 2026-05-03 05:33:13 -07:00
gymnast86 28e907aafd bulblin camp checks 2026-05-03 04:31:39 -07:00
gymnast86 7018796b93 snowboard racing check 2026-05-03 03:13:15 -07:00
gymnast86 b28e21fa18 snowboarding rupees 2026-05-03 02:28:18 -07:00
gymnast86 afc53ce1b2 ashei sketch check 2026-05-03 01:25:29 -07:00
gymnast86 4b0564779f underwater goron check 2026-05-03 01:13:47 -07:00
gymnast86 dc5fd98cfd zoras domain rupee checks 2026-05-03 01:02:40 -07:00
gymnast86 e2c51ec45c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-02 07:45:21 -07:00
gymnast86 38640354b0 fix getting fishing hole HP with fishing rod 2026-05-02 07:44:59 -07:00
gymnast86 0393fdad6d fishing hole bottle check 2026-05-02 06:08:09 -07:00
gymnast86 5fc0340603 iza 1 and 2 checks 2026-05-01 19:33:59 -07:00
gymnast86 99652c01ed uzr rupee checks 2026-05-01 19:04:32 -07:00
gymnast86 580d50ab05 comment 2026-05-01 18:25:20 -07:00
gymnast86 cfa680f2d8 fruit balloon minigame check 2026-05-01 18:24:02 -07:00
gymnast86 e4e438e1ba lanayru spring rupee checks 2026-05-01 18:14:14 -07:00
gymnast86 4ec1a0e52c lake hylia rupees 2026-05-01 09:52:26 -07:00
gymnast86 f251a3497d bridge of hylia rupee checks 2026-05-01 08:20:18 -07:00
gymnast86 05734d9e93 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-05-01 05:52:41 -07:00
gymnast86 30e4291f14 malo mart magic armor check 2026-05-01 05:52:25 -07:00
gymnast86 88770b90ab STAR minigame checks 2026-05-01 05:39:32 -07:00
gymnast86 5a22ce6321 charlo donation check 2026-05-01 05:23:43 -07:00
gymnast86 62b30d2dad properly spawn jovani house poe 2026-05-01 01:11:31 -07:00
gymnast86 5a5004793a Jovani poe reward checks 2026-05-01 01:11:21 -07:00
gymnast86 d0cb0c001a outside castle town rupees 2026-05-01 00:26:18 -07:00
gymnast86 7a246941f8 fix bomb drops always being blue rupees 2026-04-30 23:01:27 -07:00
gymnast86 c3ad0abd37 lanayru field rupee checks 2026-04-30 22:55:57 -07:00
gymnast86 91d6ec1f26 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-30 21:26:12 -07:00
gymnast86 a863ea253e remove todo 2026-04-30 21:25:51 -07:00
gymnast86 f5789aaebd turn off gravity for zant and stallord hc actors 2026-04-30 21:25:45 -07:00
gymnast86 438fd2fe71 goron springwater check 2026-04-30 21:11:01 -07:00
gymnast86 040094115b move item override checks into param init block 2026-04-30 21:10:51 -07:00
gymnast86 d4bc2daa89 simplify chest and freestanding item lookups 2026-04-30 19:19:42 -07:00
gymnast86 622920d8c0 rutela and ralis checks 2026-04-30 04:39:41 -07:00
gymnast86 2b9dd50a8d fix forest temple compass item resource 2026-04-30 04:36:02 -07:00
gymnast86 ff44cdfd3c talo sharpshooting check 2026-04-30 03:20:44 -07:00
gymnast86 3b0cc4c712 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-30 01:20:30 -07:00
gymnast86 71d73a9db4 barnes bomb bag check 2026-04-30 01:19:59 -07:00
gymnast86 4ef7511336 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-29 16:15:48 -07:00
gymnast86 9b34fd8f8f implement kak malo mart shop checks 2026-04-29 16:15:29 -07:00
gymnast86 a5cc64c2fe Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-28 14:45:45 -07:00
gymnast86 ce88c237a3 always make barne's shop available 2026-04-28 14:45:36 -07:00
gymnast86 cee8101b37 fix includes 2026-04-28 04:00:03 -07:00
gymnast86 409663711b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-28 03:56:05 -07:00
gymnast86 decf925e5d remove todo 2026-04-28 03:55:58 -07:00
gymnast86 cbead7bbb0 setup shop model overrides 2026-04-28 03:55:51 -07:00
gymnast86 05e5023354 implement eldin rupee checks 2026-04-28 03:02:59 -07:00
gymnast86 3126605cd6 coro boulder rupees 2026-04-28 00:14:29 -07:00
gymnast86 0b932c1993 fix conflict 2026-04-28 00:14:22 -07:00
gymnast86 5ed72f4af2 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-27 23:35:59 -07:00
gymnast86 1a3aac4d05 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-27 21:31:34 -07:00
gymnast86 573414dc83 fix old category name 2026-04-27 16:00:44 -07:00
gymnast86 7132655d42 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-27 15:57:37 -07:00
gymnast86 318bf293ca Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-27 04:08:20 -07:00
gymnast86 3149f929c1 implement golden wolf checks 2026-04-27 04:05:36 -07:00
gymnast86 8acdbf03bf fix portal item ids 2026-04-27 03:52:48 -07:00
gymnast86 11a632511f fix wrong stage on chest near bulblin camp 2026-04-27 02:31:28 -07:00
gymnast86 33941d8ede update warp portal logic 2026-04-26 16:31:30 -07:00
gymnast86 01d217acb5 patch flight by fowl top chest to not always start closed 2026-04-26 04:12:09 -07:00
gymnast86 7c331fdb2c coro bottle check 2026-04-26 02:00:11 -07:00
gymnast86 f7d3cf32fd add red rupee behind canon 2026-04-26 01:59:57 -07:00
gymnast86 95ceb1241b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-26 01:05:35 -07:00
gymnast86 5c9ff2f5fa properly clear item queue on file load 2026-04-26 01:04:49 -07:00
gymnast86 6b5e251037 auru check 2026-04-26 01:04:24 -07:00
gymnast86 4905718024 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-25 21:48:11 -07:00
gymnast86 00929789a1 add master sword and shadow crystal checks 2026-04-25 21:43:59 -07:00
gymnast86 8e3306f87f add master sword actor to grove layer 2 2026-04-25 21:43:32 -07:00
gymnast86 8ea4b7747d update poe todos 2026-04-25 03:44:36 -07:00
gymnast86 02852eb586 fix pill bug categories 2026-04-25 03:41:59 -07:00
gymnast86 7d9d398844 fix actor patching on room load 2026-04-25 03:35:19 -07:00
gymnast86 dfe6d10c07 implement poe checks 2026-04-25 03:07:25 -07:00
gymnast86 80f4284e82 implement item queue 2026-04-25 03:07:07 -07:00
gymnast86 c7c9b664e8 sky character checks 2026-04-25 00:32:23 -07:00
gymnast86 e2de904f8a fix progressive dominion rod check 2026-04-25 00:18:34 -07:00
gymnast86 1f593812c8 cleanup 2026-04-24 23:41:20 -07:00
gymnast86 d3d0016d16 label locations which are still TODO 2026-04-24 23:05:53 -07:00
gymnast86 b7adbde0d5 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-24 22:42:18 -07:00
gymnast86 94bfb8c9e3 implement freestanding heart pieces 2026-04-24 22:42:12 -07:00
gymnast86 8949a3a8ee Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-24 12:22:31 -07:00
gymnast86 80b0d11319 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-24 03:26:24 -07:00
gymnast86 49e8058f4e implement golden bugs 2026-04-24 03:25:33 -07:00
gymnast86 fccce91ea5 fix yaml field typo 2026-04-24 03:25:05 -07:00
gymnast86 8b117c8ed3 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-23 16:51:45 -07:00
gymnast86 e77fe61596 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-23 06:37:06 -07:00
gymnast86 0da8b4c6dc implement agitha rewards 2026-04-23 06:37:00 -07:00
gymnast86 726999c476 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-22 23:10:54 -07:00
gymnast86 f774cc689c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-22 16:58:05 -07:00
gymnast86 498db43c62 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-22 03:47:20 -07:00
gymnast86 89f1c6c71f ordon freestanding rupees 2026-04-22 03:47:14 -07:00
gymnast86 c801cb2a84 update randomizer_isActive() 2026-04-21 23:25:34 -07:00
gymnast86 f069be5789 herding goats reward check 2026-04-21 23:16:26 -07:00
gymnast86 b4722177ca Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-21 22:38:37 -07:00
gymnast86 a36695a240 ordon shield check 2026-04-21 22:36:33 -07:00
gymnast86 148a3d23eb sera shop slingshot check 2026-04-21 22:05:38 -07:00
gymnast86 e7e5363c0c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-21 21:51:09 -07:00
gymnast86 93cc3bd2ce ordon cat rescue check 2026-04-21 21:51:01 -07:00
gymnast86 52a53b64dc Ordon Sword check 2026-04-21 21:05:23 -07:00
gymnast86 fa473d48a9 implement Uli Cradle Delivery check 2026-04-21 20:54:07 -07:00
gymnast86 8774cfa31b fix conflicts 2026-04-21 18:51:14 -07:00
gymnast86 8270ec3050 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-21 18:50:43 -07:00
gymnast86 6113df21e0 fix stuff relating to getting the Iron Boots chest 2026-04-21 18:47:04 -07:00
gymnast86 dbdb4daa58 isEventBit patches 2026-04-21 18:40:44 -07:00
gymnast86 dd04da230f add necessary settings to rando context 2026-04-21 01:32:08 -07:00
gymnast86 7606998ba6 Patch Jovani to only give 60 reward if 20 reward has been gotten. 2026-04-17 18:23:40 -07:00
gymnast86 0f0c10d26a Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-17 18:02:14 -07:00
gymnast86 88dd4a2aae Patch bo to prevent softlock if chest doesn't contain iron boots 2026-04-17 14:44:39 -07:00
gymnast86 cc75af7cce Patch shadow beasts to set Iza flags even if they are defeated as wolf. 2026-04-17 14:36:43 -07:00
gymnast86 7520998aca Patch suits of armor to spawn regardless of boss flag value 2026-04-17 11:20:06 -07:00
gymnast86 ab28ae36e3 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-17 11:12:19 -07:00
gymnast86 88826bd5f8 Patch shad so he spawns until he gives the dominion rod check 2026-04-17 11:07:09 -07:00
gymnast86 39a9dd4029 Patch SPR locks to prevent softlock when opening them from behind. 2026-04-17 10:40:37 -07:00
gymnast86 23fe55fdca Add Yeta door patch for SPR 2026-04-17 09:27:23 -07:00
gymnast86 a31e388b3a Prevent game from removing bulblin camp key from inventory 2026-04-17 09:20:45 -07:00
gymnast86 3e241da2a4 patch Ilia 2026-04-17 09:11:03 -07:00
gymnast86 ce80d83c00 Patch Diababa and Ook to transform player if they are wolf to avoid softlocks 2026-04-17 09:06:32 -07:00
gymnast86 f62fb69a4d patch d_a_obj_life_container so only certain actors sparkle 2026-04-17 08:52:04 -07:00
gymnast86 782bf4e0b3 Patch Yeto and Yeta to not leave the dungeon even if the BK is obtained 2026-04-17 08:46:34 -07:00
gymnast86 727066e54e Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-17 00:17:50 -07:00
gymnast86 f13ecbaec7 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-16 23:45:07 -07:00
gymnast86 be390c3645 fix item scaling mistake 2026-04-16 23:44:58 -07:00
gymnast86 fdfe379824 remove enhancements from randomizer settings list 2026-04-16 22:25:50 -07:00
gymnast86 da2cb85aa1 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-16 19:50:26 -07:00
gymnast86 2b4598821b add imgui menu for generating and selecting seeds 2026-04-16 19:50:17 -07:00
gymnast86 4cd911a114 restructure randomizer folder 2026-04-15 19:55:46 -07:00
gymnast86 5484cd69b5 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-15 19:20:50 -07:00
gymnast86 1ff9421cea set starting time of day 2026-04-15 19:20:44 -07:00
gymnast86 c0e83af35e fix patch being in wrong spot 2026-04-15 19:20:28 -07:00
gymnast86 2c6d0b11dd Add warp portals to item pool 2026-04-15 15:36:20 -07:00
gymnast86 bab1cda97a Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-15 10:42:17 -07:00
gymnast86 da24b6a1e2 fix more startflags 2026-04-15 01:35:46 -07:00
gymnast86 2bb05b0248 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-15 00:05:53 -07:00
gymnast86 96d82c5fc2 add starting inventory to file 2026-04-15 00:02:44 -07:00
gymnast86 5175795814 Add patches for onDungeonItem 2026-04-14 18:58:46 -07:00
gymnast86 049758431c Patch isStageLife calls since we handle hearts differently. Also patch isDungeon item and item wheel amounts 2026-04-14 18:16:10 -07:00
gymnast86 762f103991 Patch setGetItemFace to add more items to expressions 2026-04-14 17:39:25 -07:00
gymnast86 66aeeb8857 Patch execItemGet and patch CoO fairy to give item no matter what 2026-04-14 17:34:07 -07:00
gymnast86 d3a9c52ec5 patch seLineUpItem to use all item slots 2026-04-14 17:21:34 -07:00
gymnast86 dea93938e6 Patch createInit to use custom item scale and prevent giving booomerang on room load 2026-04-14 17:12:11 -07:00
gymnast86 890a42b3ee patch checkFieldItemCreateHeap to properly create certain field models 2026-04-14 17:02:58 -07:00
gymnast86 38f591c521 Patch existing item_funcs 2026-04-14 16:59:35 -07:00
gymnast86 14ec080a23 Add custom item functions and check functions 2026-04-14 16:51:13 -07:00
gymnast86 48da572df0 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-14 15:27:08 -07:00
gymnast86 0cb77802be Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-14 03:21:36 -07:00
gymnast86 dacfe11d95 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-14 03:17:46 -07:00
gymnast86 cc58b41901 Patch create functions to handle progressive items and special circumstances 2026-04-14 03:12:11 -07:00
gymnast86 04a2417f02 progressive item functions 2026-04-14 02:55:09 -07:00
gymnast86 9e74ffd9be Patch d_a_demo item to use special scales for defined items 2026-04-14 02:02:07 -07:00
gymnast86 dec4045e25 add rando item ids enum 2026-04-14 02:01:48 -07:00
gymnast86 4daf410cce throw error if generation fails 2026-04-14 02:01:40 -07:00
gymnast86 cf604b5fb0 tab 2026-04-14 01:32:56 -07:00
gymnast86 8738e5b122 update item resources, field resources, and info 2026-04-14 01:12:54 -07:00
gymnast86 38bea19a7b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-13 23:51:28 -07:00
gymnast86 bf70de83f1 add basic chest overrides 2026-04-13 23:51:10 -07:00
gymnast86 f478751080 add some location metadata 2026-04-13 23:50:57 -07:00
gymnast86 a18ce4e6dd add item ids 2026-04-13 23:50:42 -07:00
gymnast86 e77bc5c9e5 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-13 07:51:11 -07:00
gymnast86 7e39274da2 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-12 21:43:51 -07:00
gymnast86 4ad05a3445 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-11 23:01:58 -07:00
gymnast86 4e25db0f20 more clean up 2026-04-11 23:01:46 -07:00
gymnast86 98b492bd89 remove redundant specifiers 2026-04-11 20:21:59 -07:00
gymnast86 461d59984f update hyrule castle settings 2026-04-11 19:37:45 -07:00
gymnast86 796a67f207 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-11 13:27:33 -07:00
gymnast86 2d4247f10e fix starting with maps and compasses 2026-04-11 09:06:29 -07:00
gymnast86 d4028fefa8 fix ordon rupee logic 2026-04-11 09:05:00 -07:00
gymnast86 7e5726c255 add rupees to generator 2026-04-11 08:30:39 -07:00
gymnast86 1873330e61 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-11 00:29:48 -07:00
gymnast86 9c9316466b swap fill order of prologue and own dungeon items 2026-04-10 21:39:42 -07:00
gymnast86 123c809e14 hold Z to create randomizer save 2026-04-10 21:04:35 -07:00
gymnast86 8172e672de place goal locations items before prologue items 2026-04-10 20:57:23 -07:00
gymnast86 4d1771649a Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-10 19:23:16 -07:00
gymnast86 c91925f243 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-10 17:21:35 -07:00
gymnast86 87116b871b add randomizer startflags 2026-04-10 17:20:34 -07:00
gymnast86 3547c57de0 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-09 22:34:10 -07:00
gymnast86 2d8a60aa75 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-09 19:03:01 -07:00
gymnast86 dd773bc261 properly set RANDOMIZER_ONLY 2026-04-09 19:02:55 -07:00
gymnast86 535c2f53c1 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-09 16:31:51 -07:00
gymnast86 c8cde246a9 add back SD only twilit insects 2026-04-09 16:31:44 -07:00
gymnast86 bc66d96d8b Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-09 15:39:02 -07:00
gymnast86 6c55f42ce2 Wrap generator in Randomizer class 2026-04-09 15:38:56 -07:00
gymnast86 679044f33d Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-09 12:27:13 -07:00
gymnast86 ac53fdbbff cmake cleanup 2026-04-09 12:27:05 -07:00
gymnast86 0b78547ba1 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-09 09:22:33 -07:00
gymnast86 0ebab8bad3 change how randomizer is included 2026-04-09 00:29:16 -07:00
gymnast86 ab7d3a5e03 change macro name 2026-04-09 00:28:52 -07:00
gymnast86 2f79bbe067 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-08 16:28:14 -07:00
gymnast86 b8b5b7197c Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-08 16:11:17 -07:00
gymnast86 554a461c95 add entrance aliases 2026-04-08 16:11:11 -07:00
gymnast86 1efb6c4a80 change namespace to "randomizer" 2026-04-08 01:18:35 -07:00
gymnast86 377d6a0d25 Merge branch 'main' of https://github.com/TwilitRealm/dusk into randomizer 2026-04-08 00:35:08 -07:00
gymnast86 72bed7a1ba initial rando generator hookup 2026-04-08 00:35:02 -07:00
706 changed files with 28873 additions and 46766 deletions
+5 -10
View File
@@ -68,18 +68,13 @@ body:
required: true required: true
- type: dropdown - type: dropdown
id: game-disc id: game-region
attributes: attributes:
label: Game Disc label: Game Region
description: The game disc you are playing on description: The game region you are playing on
options: options:
- GameCube NTSC-U (North America) - NTSC-U (North America)
- GameCube PAL (Europe) - PAL (Europe)
- GameCube NTSC-J (Japan)
- Wii NTSC-U (North America) Revision 0
- Wii NTSC-U (North America) Revision 2
- Wii PAL (Europe)
- Wii NTSC-J (Japan)
validations: validations:
required: true required: true
+4 -4
View File
@@ -76,7 +76,7 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: dusklight-${{env.APP_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}} name: dusklight-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}}
path: | path: |
build/install/Dusklight-*.AppImage build/install/Dusklight-*.AppImage
build/install/debug.tar.* build/install/debug.tar.*
@@ -145,7 +145,7 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: dusklight-${{env.APP_VERSION}}-${{matrix.artifact_name}} name: dusklight-${{env.DUSK_VERSION}}-${{matrix.artifact_name}}
path: | path: |
build/install/Dusklight.app build/install/Dusklight.app
build/install/debug.tar.* build/install/debug.tar.*
@@ -221,7 +221,7 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: dusklight-${{env.APP_VERSION}}-android-${{matrix.artifact_arch}} name: dusklight-${{env.DUSK_VERSION}}-android-${{matrix.artifact_arch}}
path: upload/ path: upload/
build-windows: build-windows:
@@ -283,7 +283,7 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: dusklight-${{env.APP_VERSION}}-win32-msvc-${{matrix.artifact_arch}} name: dusklight-${{env.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
path: | path: |
build/install/*.exe build/install/*.exe
build/install/*.dll build/install/*.dll
-3
View File
@@ -1,6 +1,3 @@
[submodule "extern/aurora"] [submodule "extern/aurora"]
path = extern/aurora path = extern/aurora
url = https://github.com/encounter/aurora.git url = https://github.com/encounter/aurora.git
[submodule "extern/borealis"]
path = extern/borealis
url = https://github.com/encounter/borealis.git
+151 -61
View File
@@ -5,11 +5,10 @@ if (NOT CMAKE_BUILD_TYPE)
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE) "Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
endif () endif ()
include(extern/borealis/cmake/DetectVersion.cmake) include(cmake/DetectVersion.cmake)
borealis_detect_version() detect_version()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
project(dusklight LANGUAGES C CXX VERSION ${BOREALIS_APP_VERSION}) project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING})
if (APPLE) if (APPLE)
enable_language(OBJC OBJCXX) enable_language(OBJC OBJCXX)
endif () endif ()
@@ -33,7 +32,6 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(CMAKE_COLOR_DIAGNOSTICS ON)
# Folder-based instead of target-based organization # Folder-based instead of target-based organization
# in Visual Studio and Xcode generators # in Visual Studio and Xcode generators
@@ -76,8 +74,6 @@ set(AURORA_ENABLE_RMLUI ON CACHE BOOL "Enable RmlUi UI support" FORCE)
add_subdirectory(extern/aurora EXCLUDE_FROM_ALL) add_subdirectory(extern/aurora EXCLUDE_FROM_ALL)
target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1) target_compile_definitions(aurora_mtx PRIVATE MTX_USE_PS=1)
add_subdirectory(extern/borealis EXCLUDE_FROM_ALL)
add_subdirectory(libs/freeverb) add_subdirectory(libs/freeverb)
if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -89,6 +85,8 @@ endif ()
option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)") option(DUSK_BUILD_WARNINGS "Enable compiler warnings (off by default)")
option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.") option(DUSK_SELECTED_OPT "If on, selected parts of the project will be compiled with optimizations on Debug, intending to make the game run at 30 FPS. Note for MSVC: you will need to remove '/RTC1' from your debug flags in CMake.")
option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON) option(DUSK_MOVIE_SUPPORT "If on, compile against libjpeg-turbo to enable THP file decoding" ON)
option(DUSK_ENABLE_UPDATE_CHECKER "Enable update checking support" ON)
option(DUSK_ENABLE_SENTRY_NATIVE "Enable sentry-native crash reporting support" OFF)
option(DUSK_PACKAGE_INSTALL "Install Dusklight with a Linux-native file structure" OFF) option(DUSK_PACKAGE_INSTALL "Install Dusklight with a Linux-native file structure" OFF)
option(DUSK_GFX_DEBUG_GROUPS "Report debug groups to the native graphics API" ${DUSK_GFX_DEBUG_GROUPS_DEFAULT}) option(DUSK_GFX_DEBUG_GROUPS "Report debug groups to the native graphics API" ${DUSK_GFX_DEBUG_GROUPS_DEFAULT})
option(DUSK_ENABLE_CODE_MODS "Enable code mods" OFF) option(DUSK_ENABLE_CODE_MODS "Enable code mods" OFF)
@@ -152,7 +150,6 @@ if (DUSK_MOVIE_SUPPORT)
-DENABLE_SHARED=OFF -DENABLE_SHARED=OFF
-DWITH_TURBOJPEG=ON -DWITH_TURBOJPEG=ON
-DWITH_JAVA=OFF -DWITH_JAVA=OFF
-DCMAKE_INSTALL_LIBDIR=lib
) )
if (CMAKE_TOOLCHAIN_FILE) if (CMAKE_TOOLCHAIN_FILE)
get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}") get_filename_component(_jpeg_toolchain_file "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
@@ -237,6 +234,18 @@ endif ()
include(FetchContent) include(FetchContent)
# Declare all dependencies first so CMake can download them in parallel # Declare all dependencies first so CMake can download them in parallel
message(STATUS "dusklight: Fetching cxxopts")
FetchContent_Declare(cxxopts
URL https://github.com/jarro2783/cxxopts/archive/refs/tags/v3.3.1.tar.gz
URL_HASH SHA256=3bfc70542c521d4b55a46429d808178916a579b28d048bd8c727ee76c39e2072
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
)
message(STATUS "dusklight: Fetching nlohmann/json")
FetchContent_Declare(json
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
URL_HASH SHA256=42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
DOWNLOAD_EXTRACT_TIMESTAMP FALSE
)
message(STATUS "dusklight: Fetching miniz") message(STATUS "dusklight: Fetching miniz")
FetchContent_Declare(miniz FetchContent_Declare(miniz
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip
@@ -244,7 +253,7 @@ FetchContent_Declare(miniz
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
) )
set(_fetch_content_deps miniz) set(_fetch_content_deps cxxopts json miniz)
if (DUSK_HAS_FUNCHOOK) if (DUSK_HAS_FUNCHOOK)
message(STATUS "dusklight: Fetching funchook") message(STATUS "dusklight: Fetching funchook")
# cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a # cmake/PatchFunchook.cmake patches funchook's cmake/capstone.cmake.in to inject a
@@ -279,12 +288,40 @@ if (DUSK_HAS_FUNCHOOK)
endif () endif ()
FetchContent_MakeAvailable(${_fetch_content_deps}) FetchContent_MakeAvailable(${_fetch_content_deps})
if (DUSK_ENABLE_SENTRY_NATIVE)
message(STATUS "dusklight: Fetching sentry-native")
set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(SENTRY_BACKEND crashpad CACHE STRING "" FORCE)
if (WIN32)
set(SENTRY_TRANSPORT winhttp CACHE STRING "" FORCE)
endif ()
set(SENTRY_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SENTRY_BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
FetchContent_Declare(sentry_native
GIT_REPOSITORY https://github.com/getsentry/sentry-native.git
GIT_TAG 0.13.6
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
GIT_SUBMODULES_RECURSE TRUE
)
if (NOT sentry_native_POPULATED)
FetchContent_Populate(sentry_native)
set(_skip_install_rules ${CMAKE_SKIP_INSTALL_RULES})
set(CMAKE_SKIP_INSTALL_RULES ON)
add_subdirectory(${sentry_native_SOURCE_DIR} ${sentry_native_BINARY_DIR} EXCLUDE_FROM_ALL)
set(CMAKE_SKIP_INSTALL_RULES ${_skip_install_rules})
endif ()
endif ()
# Use signed char on ARM to match the original game (and x86) # Use signed char on ARM to match the original game (and x86)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch) string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _arch)
if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU") if(_arch MATCHES "^(arm|aarch64)" AND CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
add_compile_options(-fsigned-char) add_compile_options(-fsigned-char)
endif() endif()
configure_version_header()
include(files.cmake) include(files.cmake)
# TODO: version handling for res includes # TODO: version handling for res includes
@@ -297,23 +334,67 @@ set(DUSK_PRODUCT_NAME "Dusklight")
set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors") set(DUSK_COPYRIGHT "Copyright (C) Twilit Realm contributors")
source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES}) source_group("dolzel" FILES ${DOLZEL_FILES} ${Z2AUDIOLIB_FILES} ${REL_FILES})
source_group("dusklight" FILES ${DUSK_FILES}) source_group("dusklight" FILES ${DUSK_FILES} ${DUSK_HTTP_BACKEND_FILES})
include(cmake/GameABIConfig.cmake) include(cmake/GameABIConfig.cmake)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
set(GAME_COMPILE_DEFS DUSK_BUILDING_GAME=1) set(GAME_COMPILE_DEFS DUSK_BUILDING_GAME=1)
set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd set(GAME_LIBS aurora::core aurora::gx aurora::gd aurora::si aurora::vi aurora::pad aurora::mtx aurora::os aurora::dvd
aurora::card borealis::cli borealis::crash borealis::data borealis::disc borealis::discord borealis::file_select borealis::log borealis::presentation borealis::sentry borealis::update freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt aurora::card freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt
Threads::Threads zstd::libzstd dusklight_game_headers) Threads::Threads zstd::libzstd dusklight_game_headers)
if (DUSK_HAS_FUNCHOOK) if (DUSK_HAS_FUNCHOOK)
list(APPEND GAME_LIBS funchook-static) list(APPEND GAME_LIBS funchook-static)
endif () endif ()
if (DUSK_ENABLE_SENTRY_NATIVE)
list(APPEND GAME_LIBS sentry)
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_SENTRY_NATIVE=1 SENTRY_BUILD_STATIC=1)
endif ()
if (WIN32) if (WIN32)
list(APPEND GAME_LIBS Ws2_32) list(APPEND GAME_LIBS Ws2_32)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND GAME_LIBS dbghelp)
list(APPEND GAME_COMPILE_DEFS DUSK_CRASH_DBGHELP=1)
endif ()
endif () endif ()
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/no_backend.cpp)
if (DUSK_ENABLE_UPDATE_CHECKER)
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_UPDATE_CHECKER=1)
if (WIN32)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/winhttp.cpp)
list(APPEND GAME_LIBS winhttp)
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_WINHTTP=1)
message(STATUS "dusklight: Enabled update checker (WinHTTP)")
elseif (ANDROID)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/android.cpp)
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_ANDROID=1)
message(STATUS "dusklight: Enabled update checker (Android)")
elseif (APPLE)
find_library(FOUNDATION_FRAMEWORK Foundation REQUIRED)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/url_session.mm)
set_source_files_properties(src/dusk/http/url_session.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
list(APPEND GAME_LIBS ${FOUNDATION_FRAMEWORK})
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_URLSESSION=1)
message(STATUS "dusklight: Enabled update checker (NSURLSession)")
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
find_package(CURL QUIET OPTIONAL_COMPONENTS HTTPS SSL)
if (CURL_FOUND AND CURL_HTTPS_FOUND AND CURL_SSL_FOUND)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/curl.cpp)
list(APPEND GAME_LIBS CURL::libcurl)
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_LIBCURL=1)
message(STATUS "dusklight: Enabled update checker (libcurl)")
else ()
message(STATUS "dusklight: Disabled update checker (libcurl + HTTPS/SSL not found)")
endif ()
else ()
message(STATUS "dusklight: Disabled update checker (unsupported platform)")
endif ()
endif ()
list(APPEND DUSK_FILES ${DUSK_HTTP_BACKEND_SOURCE})
if (DUSK_MOVIE_SUPPORT) if (DUSK_MOVIE_SUPPORT)
if (TARGET libjpeg-turbo::turbojpeg-static) if (TARGET libjpeg-turbo::turbojpeg-static)
list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static) list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static)
@@ -323,6 +404,17 @@ if (DUSK_MOVIE_SUPPORT)
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1) list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
endif () endif ()
include(src/dusk/randomizer/randomizer.cmake)
set(DUSK_ENABLE_DISCORD_DEFAULT ON)
if (DEFINED DUSK_ENABLE_DISCORD_RPC AND NOT DEFINED DUSK_ENABLE_DISCORD)
set(DUSK_ENABLE_DISCORD_DEFAULT ${DUSK_ENABLE_DISCORD_RPC})
endif ()
option(DUSK_ENABLE_DISCORD "Enable Discord Rich Presence support" ${DUSK_ENABLE_DISCORD_DEFAULT})
if (DUSK_ENABLE_DISCORD AND NOT ANDROID AND NOT IOS AND NOT TVOS)
list(APPEND GAME_COMPILE_DEFS DUSK_DISCORD=1)
endif ()
if (DUSK_ENABLE_CODE_MODS) if (DUSK_ENABLE_CODE_MODS)
list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1) list(APPEND GAME_COMPILE_DEFS DUSK_CODE_MODS=1)
endif () endif ()
@@ -387,14 +479,32 @@ endif ()
set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c) set(DUSK_FILES src/dusk/main.cpp ${GAME_BASE_FILES} ${GAME_DEBUG_FILES} ${miniz_SOURCE_DIR}/miniz.c)
if(ANDROID) if(ANDROID)
add_library(dusklight SHARED ${DUSK_FILES}) add_library(dusklight SHARED ${DUSK_FILES})
set_target_properties(dusklight PROPERTIES OUTPUT_NAME main)
else () else ()
add_executable(dusklight ${DUSK_FILES}) add_executable(dusklight ${DUSK_FILES})
endif () endif ()
borealis_configure_android_application(dusklight)
if (ENABLE_ASAN) if (ENABLE_ASAN)
target_sources(dusklight PRIVATE src/dusk/asan_options.c) target_sources(dusklight PRIVATE src/dusk/asan_options.c)
endif () endif ()
# Add embedded data to target
file(GLOB_RECURSE RANDOMIZER_DATA "src/dusk/randomizer/generator/data/*")
file(GLOB_RECURSE RANDOMIZER_ASSETS "src/dusk/randomizer/assets/*")
list(APPEND RANDOMIZER_DATA ${RANDOMIZER_ASSETS})
set(RANDO_ROOT_DATA_DIR ${CMAKE_CURRENT_SOURCE_DIR})
foreach (RANDOMIZER_FILE IN LISTS RANDOMIZER_DATA)
file(RELATIVE_PATH REL_PATH ${RANDO_ROOT_DATA_DIR} ${RANDOMIZER_FILE})
if(REL_PATH MATCHES "^src/dusk/randomizer/generator/data/tests")
message(STATUS "Skipping Embed: ${REL_PATH}")
continue()
endif ()
message(STATUS "Embedding File: ${REL_PATH}")
b_embed(dusklight ${REL_PATH})
endforeach ()
target_compile_definitions(dusklight PRIVATE ${GAME_COMPILE_DEFS}) target_compile_definitions(dusklight PRIVATE ${GAME_COMPILE_DEFS})
target_include_directories(dusklight PRIVATE ${miniz_SOURCE_DIR}) target_include_directories(dusklight PRIVATE ${miniz_SOURCE_DIR})
target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES}) target_link_libraries(dusklight PRIVATE aurora::main ${GAME_LIBS} ${JSYSTEM_LINK_LIBRARIES})
@@ -411,47 +521,7 @@ if (DUSK_ENABLE_CODE_MODS)
setup_symbol_manifest(dusklight) setup_symbol_manifest(dusklight)
endif () endif ()
# Hook reliability: prevent auto-inlining, guarantee patchable function entries, # Hook reliability: guaranteed patchable entries on the game ABI surface, and no identical-code folding.
# and disable identical-code folding for game functions.
set(DUSK_GAME_ABI_INLINE_OPTIONS)
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND DUSK_GAME_ABI_INLINE_OPTIONS
$<$<COMPILE_LANGUAGE:CXX>:-finline-hint-functions>)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND DUSK_GAME_ABI_INLINE_OPTIONS
$<$<COMPILE_LANGUAGE:CXX>:-flive-patching=inline-clone>
$<$<COMPILE_LANGUAGE:CXX>:-fno-inline-functions>
$<$<COMPILE_LANGUAGE:CXX>:-fno-inline-small-functions>
$<$<COMPILE_LANGUAGE:CXX>:-fno-inline-functions-called-once>
$<$<COMPILE_LANGUAGE:CXX>:-fno-early-inlining>
$<$<COMPILE_LANGUAGE:CXX>:-fno-ipa-cp>
$<$<COMPILE_LANGUAGE:CXX>:-fno-ipa-cp-clone>
$<$<COMPILE_LANGUAGE:CXX>:-fno-ipa-sra>
$<$<COMPILE_LANGUAGE:CXX>:-fno-partial-inlining>)
endif ()
endif ()
if (DUSK_GAME_ABI_INLINE_OPTIONS)
set(_game_abi_files ${GAME_BASE_FILES} ${GAME_DEBUG_FILES})
list(FILTER _game_abi_files EXCLUDE REGEX "^src/dusk/")
set_property(SOURCE ${_game_abi_files} APPEND PROPERTY
COMPILE_OPTIONS ${DUSK_GAME_ABI_INLINE_OPTIONS})
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
target_compile_options(${jsystem_lib} PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS})
endforeach()
foreach(_sdk_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
aurora_os aurora_pad aurora_si aurora_vi)
if (TARGET ${_sdk_lib})
get_target_property(_sdk_lib_imported ${_sdk_lib} IMPORTED)
if (NOT _sdk_lib_imported)
target_compile_options(${_sdk_lib} PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS})
endif ()
endif ()
endforeach ()
endif ()
if (MSVC) if (MSVC)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:/hotpatch>) set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:/hotpatch>)
@@ -461,11 +531,11 @@ if (MSVC)
else () else ()
target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF) target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF)
endif () endif ()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU)$") elseif (CMAKE_CXX_COMPILER_ID MATCHES "^(AppleClang|Clang)$")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64") if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=2,1>) set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=2,1>)
else () else ()
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=10,4>) set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=10,5>)
endif () endif ()
endif () endif ()
@@ -508,9 +578,17 @@ if (TARGET crashpad_handler)
) )
endif () endif ()
if (ANDROID)
# SDLActivity loads SDL_main via dlsym on Android. Since aurora::main is a static
# archive, force an undefined reference so the linker keeps the SDL_main object.
target_link_options(dusklight PRIVATE "-Wl,-u,SDL_main")
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux) if (CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1") target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
target_link_libraries(dusklight PRIVATE dl) target_link_libraries(dusklight PRIVATE dl)
elseif (ANDROID)
target_link_options(dusklight PRIVATE "-Wl,--build-id=sha1")
endif () endif ()
if (NOT APPLE) if (NOT APPLE)
@@ -559,9 +637,6 @@ if (DUSK_ENABLE_CODE_MODS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR
add_subdirectory(mods/ao_mod) add_subdirectory(mods/ao_mod)
add_subdirectory(mods/shadow_mod) add_subdirectory(mods/shadow_mod)
add_subdirectory(mods/window_demo) add_subdirectory(mods/window_demo)
add_subdirectory(mods/flow_demo)
add_subdirectory(mods/basic_cosmetics_mod)
add_subdirectory(mods/randomizer)
endif () endif ()
if (APPLE) if (APPLE)
@@ -595,8 +670,8 @@ if (APPLE)
MACOSX_BUNDLE TRUE MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME} MACOSX_BUNDLE_BUNDLE_NAME ${DUSK_BUNDLE_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER} MACOSX_BUNDLE_GUI_IDENTIFIER ${DUSK_BUNDLE_IDENTIFIER}
MACOSX_BUNDLE_BUNDLE_VERSION ${BOREALIS_APP_VERSION} MACOSX_BUNDLE_BUNDLE_VERSION ${DUSK_VERSION_STRING}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${BOREALIS_APP_SHORT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING}
MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST} MACOSX_BUNDLE_INFO_PLIST ${DUSK_INFO_PLIST}
OUTPUT_NAME Dusklight OUTPUT_NAME Dusklight
XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES" XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "YES"
@@ -629,6 +704,21 @@ if (APPLE)
endif () endif ()
endif () endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(APPKIT_FRAMEWORK AppKit REQUIRED)
target_sources(dusklight PRIVATE src/dusk/file_select_macos.mm)
set_source_files_properties(src/dusk/file_select_macos.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
target_link_libraries(dusklight PRIVATE ${APPKIT_FRAMEWORK})
endif ()
if (IOS)
find_library(UIKIT_FRAMEWORK UIKit REQUIRED)
find_library(UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK UniformTypeIdentifiers REQUIRED)
target_sources(dusklight PRIVATE src/dusk/ios/FileSelectDialog.m)
set_source_files_properties(src/dusk/ios/FileSelectDialog.m PROPERTIES COMPILE_FLAGS -fobjc-arc)
target_link_libraries(dusklight PRIVATE ${UIKIT_FRAMEWORK} ${UNIFORM_TYPE_IDENTIFIERS_FRAMEWORK})
endif ()
include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake) include(extern/aurora/cmake/AuroraCopyRuntimeDLLs.cmake)
aurora_copy_runtime_dlls(dusklight) aurora_copy_runtime_dlls(dusklight)
+4 -4
View File
@@ -28,12 +28,12 @@
"cacheVariables": { "cacheVariables": {
"CMAKE_C_COMPILER_LAUNCHER": "sccache", "CMAKE_C_COMPILER_LAUNCHER": "sccache",
"CMAKE_CXX_COMPILER_LAUNCHER": "sccache", "CMAKE_CXX_COMPILER_LAUNCHER": "sccache",
"BOREALIS_ENABLE_SENTRY": { "DUSK_ENABLE_SENTRY_NATIVE": {
"type": "BOOL", "type": "BOOL",
"value": true "value": true
}, },
"BOREALIS_SENTRY_DSN": "$env{SENTRY_DSN}", "DUSK_SENTRY_DSN": "$env{SENTRY_DSN}",
"BOREALIS_SENTRY_ENVIRONMENT": "production", "DUSK_SENTRY_ENVIRONMENT": "production",
"Rust_RUSTUP_INSTALL_MISSING_TARGET": { "Rust_RUSTUP_INSTALL_MISSING_TARGET": {
"type": "BOOL", "type": "BOOL",
"value": true "value": true
@@ -448,7 +448,7 @@
"ci" "ci"
], ],
"cacheVariables": { "cacheVariables": {
"BOREALIS_ENABLE_SENTRY": { "DUSK_ENABLE_SENTRY_NATIVE": {
"type": "BOOL", "type": "BOOL",
"value": false "value": false
} }
+1 -4
View File
@@ -26,10 +26,7 @@ It aims to be as accurate as possible to the original while also providing new o
You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space. You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space.
Dusklight currently supports all commercial discs except for Wii's Korean release. Currently, only the GameCube releases are supported. Support for other versions of the game is planned in the future.
> [!NOTE]
> Dusklight is based on the [Twilight Princess decompilation](https://github.com/zeldaret/tp), which is currently only matching for GameCube. As a result, even when playing Dusklight with a Wii disc, you will be presented with the GameCube version's HUD and certain other specificities.
### 2. Install Dusklight ### 2. Install Dusklight
+1 -1
View File
@@ -23,5 +23,5 @@ cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,102
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
cd build/install cd build/install
VERSION="$APP_VERSION" NO_STRIP=1 "$linuxdeploy" \ VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \
-l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage -l "$lib_dir/libusb-1.0.so" --appdir "$build_dir/appdir" --output appimage
+121
View File
@@ -0,0 +1,121 @@
# Version detection shared by the main build and the mod SDK (sdk/CMakeLists.txt)
include_guard(GLOBAL)
get_filename_component(_DUSK_VERSION_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)")
macro(detect_version)
if (DUSK_VERSION_OVERRIDE)
set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
set(DUSK_VERSION_CODE "1")
set(DUSK_WC_REVISION "")
set(DUSK_WC_BRANCH "")
set(DUSK_WC_DATE "")
message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}")
else ()
# obtain revision info from git
find_package(Git)
if (GIT_FOUND)
# make sure version information gets re-run when the current Git HEAD changes
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
OUTPUT_VARIABLE dusk_git_head_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(dusk_git_head_filename "${dusk_git_head_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
OUTPUT_VARIABLE dusk_git_head_symbolic
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT}
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(dusk_git_head_symbolic_filename "${dusk_git_head_symbolic_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
# defines DUSK_WC_REVISION
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE DUSK_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DESCRIBE
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove the git hash, then collapse a clean "-0" suffix only
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
# defines DUSK_WC_BRANCH
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE DUSK_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DATE
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
OUTPUT_VARIABLE DUSK_WC_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
message(STATUS "Unable to find git, commit information will not be available")
endif ()
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
set(_ver_major ${CMAKE_MATCH_1})
set(_ver_minor ${CMAKE_MATCH_2})
set(_ver_patch ${CMAKE_MATCH_3})
set(DUSK_VERSION_TWEAK "0")
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
endif ()
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
if (DUSK_VERSION_TWEAK GREATER 999)
set(_tweak 999)
else ()
set(_tweak ${DUSK_VERSION_TWEAK})
endif ()
# encoding: major*1e7 + minor*1e5 + patch*1e3 + tweak; collision-free for major<210, minor<100, patch<100, tweak<=999
math(EXPR DUSK_VERSION_CODE
"${_ver_major} * 10000000 + ${_ver_minor} * 100000 + ${_ver_patch} * 1000 + ${_tweak}")
else ()
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
set(DUSK_VERSION_CODE "1")
endif ()
endif ()
# Add version information to CI environment variables
if (DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION_CODE=${DUSK_VERSION_CODE}\n")
endif ()
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
endmacro()
# Sets PLATFORM_NAME and configures version.h into the caller's binary dir.
macro(configure_version_header)
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set(PLATFORM_NAME win32)
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
if (IOS)
set(PLATFORM_NAME ios)
elseif (TVOS)
set(PLATFORM_NAME tvos)
else ()
set(PLATFORM_NAME macos)
endif ()
else ()
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
endif ()
configure_file(${_DUSK_VERSION_ROOT}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
endmacro()
+9 -9
View File
@@ -2,7 +2,7 @@ include_guard(GLOBAL)
get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
set(_SYMGEN_VERSION "1.3.3") set(_SYMGEN_VERSION "1.3.2")
set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}") set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}")
set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release") set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release")
mark_as_advanced(SYMGEN_PATH) mark_as_advanced(SYMGEN_PATH)
@@ -15,32 +15,32 @@ function(symgen_host_asset out_name out_hash)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if (_host_processor MATCHES "^(arm64|aarch64)$") if (_host_processor MATCHES "^(arm64|aarch64)$")
set(_asset "symgen-macos-arm64") set(_asset "symgen-macos-arm64")
set(_asset_hash "SHA256=e8420df1160242c83bd0e5197efeeb25ceb9fecc69dbc82bdc4927476381e948") set(_asset_hash "SHA256=0344838d1674df09c17c3eeddcf26eb89c333fdb85dfd78f68adc436070eccbe")
elseif (_host_processor MATCHES "^(x86_64|amd64)$") elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-macos-x86_64") set(_asset "symgen-macos-x86_64")
set(_asset_hash "SHA256=e51d13bbf0e982d1519f56850ff3c7b5910ca5a7095dd5a82cd8e59750e2d013") set(_asset_hash "SHA256=ae0674f4a1e9d0dedfa02d35939ac28cdd229276b331c1f507df5df809cbec7e")
endif () endif ()
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if (_host_processor MATCHES "^(aarch64|arm64)$") if (_host_processor MATCHES "^(aarch64|arm64)$")
set(_asset "symgen-linux-aarch64") set(_asset "symgen-linux-aarch64")
set(_asset_hash "SHA256=331190dd21ecee12a52e857b7f90a8b3e0a114608173813f7df74a31cf783f70") set(_asset_hash "SHA256=af766de2bfaeb0a06f6d7bc17bb2510b4a9c40f44a56e49bc4a4b798a6223042")
elseif (_host_processor MATCHES "^(x86_64|amd64)$") elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-linux-x86_64") set(_asset "symgen-linux-x86_64")
set(_asset_hash "SHA256=d727e0ba43242f92a92865af1b69c47aa9d81a0242c4570ce53b90e1ecd15e84") set(_asset_hash "SHA256=ebd62fb9623acc942b6295609e2306f85a73043b0a8a117f2072b761dd08e68f")
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
set(_asset "symgen-linux-i686") set(_asset "symgen-linux-i686")
set(_asset_hash "SHA256=0c9f94d36b7fa46d15a199c9d0f1a633b73eb7d9c02621a6a76a676b83a135c7") set(_asset_hash "SHA256=07780a4513fd29726578efc4ff2d88736b22f407ed821b32a68e35ff1e9af5f4")
endif () endif ()
elseif (CMAKE_HOST_WIN32) elseif (CMAKE_HOST_WIN32)
if (_host_processor MATCHES "^(arm64|aarch64)$") if (_host_processor MATCHES "^(arm64|aarch64)$")
set(_asset "symgen-windows-arm64.exe") set(_asset "symgen-windows-arm64.exe")
set(_asset_hash "SHA256=c699192957e2086ed68912ed39fa77858e1ae894476ab8b557711804cf2aa7cb") set(_asset_hash "SHA256=5bb22b4a4a9b5ad45646af411bfb09b8321a732ff3a077eb4c9de1feaef27d2b")
elseif (_host_processor MATCHES "^(x86_64|amd64)$") elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-windows-x86_64.exe") set(_asset "symgen-windows-x86_64.exe")
set(_asset_hash "SHA256=6d56a45617c75065ab7a3192d09ca52ff735baf5637b0899f446138d46acc310") set(_asset_hash "SHA256=1d1ac087f991a96932d108969e15998becfec643e88f3e7d182ca97ebfc6a46f")
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
set(_asset "symgen-windows-x86.exe") set(_asset "symgen-windows-x86.exe")
set(_asset_hash "SHA256=6cccc3a8d29e7525a4d1ade1dc4d89327b7c3002a604ab1c7decb43eea6fd4ab") set(_asset_hash "SHA256=c113f4cd05f813efe2b1878dbfcf44d6302aee3974271736e0036430b0cced78")
endif () endif ()
endif () endif ()
+1 -7
View File
@@ -5,13 +5,7 @@
- A Windows, Linux, or macOS device - A Windows, Linux, or macOS device
- iOS device connected to computer via USB - iOS device connected to computer via USB
- Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases)) - Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases))
- Legally acquired game disc: - Legally acquired game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL)
- `GZ2E01` (GameCube USA)
- `GZ2P01` (GameCube PAL)
- `GZ2J01` (GameCube JPN)
- `RZDE01` (Wii USA Rev. 0 *or* Rev. 2)
- `RZDP01` (Wii PAL)
- `RZDJ01` (Wii JPN)
## 1. Install iloader ## 1. Install iloader
+19 -281
View File
@@ -209,8 +209,8 @@ if (svc_resource->load(mod_ctx, "config.txt", &buf) == MOD_OK) {
} }
``` ```
Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. The bundle is read-only; use Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. Note that the bundle is read-only; for writable
`HostService::data_dir` for persistent storage. storage, use the directory from `svc_host->mod_dir(mod_ctx)`.
### HostService (`mods/svc/host.h`) ### HostService (`mods/svc/host.h`)
@@ -219,17 +219,9 @@ Mod metadata and runtime interaction with the loader:
```cpp ```cpp
IMPORT_SERVICE(HostService, svc_host); IMPORT_SERVICE(HostService, svc_host);
// Temporary mod data directory, wiped on startup const char* id = svc_host->mod_id(mod_ctx);
const char* cacheDir = svc_host->mod_dir(mod_ctx); const char* dir = svc_host->mod_dir(mod_ctx); // writable per-mod directory
svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened"); // disables the mod
// Persistent mod data directory
const char* dataDir = nullptr;
if (svc_host->data_dir(mod_ctx, &dataDir) == MOD_OK) {
// ...
}
// Report an error and disable the mod
svc_host->fail(mod_ctx, MOD_ERROR, "something unrecoverable happened");
``` ```
`get_service`/`publish_service` provide dynamic service lookup; see [Exporting Services](#exporting-services). `get_service`/`publish_service` provide dynamic service lookup; see [Exporting Services](#exporting-services).
@@ -262,16 +254,14 @@ Installs hooks on game functions and resolves symbols by name. You'll rarely cal
### OverlayService (`mods/svc/overlay.h`) ### OverlayService (`mods/svc/overlay.h`)
Registers DVD file overlays at runtime: the dynamic counterpart to the static `overlay/` directory (see Registers DVD file overlays at runtime: the dynamic counterpart to the static `overlay/` directory (see
[Asset Overlays](#asset-overlays)). Overlay a disc path with a file from your bundle, a file within an archive, [Asset Overlays](#asset-overlays)). Overlay a disc path with a file from your bundle, or with a caller-owned buffer
or with a caller-owned buffer
(copied on registration): (copied on registration):
```cpp ```cpp
IMPORT_SERVICE(OverlayService, svc_overlay); IMPORT_SERVICE(OverlayService, svc_overlay);
OverlayHandle handle = 0; OverlayHandle handle = 0;
svc_overlay->add_file(mod_ctx, "/Movie/demo_movie98_00.thp", "res/replacement.thp", &handle); // Replaces the demo movie svc_overlay->add_file(mod_ctx, "/res/Msgus.arc", "res/replacement.arc", &handle);
svc_overlay->add_file(mod_ctx, "/res/Object/Kmdl/archive/bmwr/al.bmd", "res/link_model.bmd", &handle); // Replaces link's model
svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr); svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr);
svc_overlay->remove(mod_ctx, handle); svc_overlay->remove(mod_ctx, handle);
``` ```
@@ -280,9 +270,6 @@ svc_overlay->remove(mod_ctx, handle);
on the disc are added as new files. Changes are applied at the next frame boundary, and data the game already read on the disc are added as new files. Changes are applied at the next frame boundary, and data the game already read
stays in memory until the file is re-read: sometimes a scene reload, and in the worst case, a full restart. stays in memory until the file is re-read: sometimes a scene reload, and in the worst case, a full restart.
Dusklight reloads core archive files during scene transitions so modifications to Link, Midna or other globally-loaded
data get refreshed without a full restart.
See [Asset Overlays](#asset-overlays) for priority and conflict handling. See [Asset Overlays](#asset-overlays) for priority and conflict handling.
### TextureService (`mods/svc/texture.h`) ### TextureService (`mods/svc/texture.h`)
@@ -386,55 +373,6 @@ buffer contract as `get_blob`. Pass a `NULL` buffer to either read function to q
are cleared. Observers are removed automatically when the mod is detached, so the output handle is only needed for are cleared. Observers are removed automatically when the mod is detached, so the output handle is only needed for
manual unregistration. Save callbacks run on the game thread. manual unregistration. Save callbacks run on the game thread.
### StageService (`mods/svc/stage.h`)
Allows making changes to a stage's "stage info" (contents of .dzs/.dzr files).
(Currently only supports editing actor nodes.)
```cpp
IMPORT_SERVICE(StageService, svc_stage);
stage_actor_data_class record = {
"carry00",
0xFF000000,
cXyz(0.0f, 0.0f, 0.0f),
csXyz(0, 0, 0),
0,
};
StageActorHandle handle{};
svc_stage->patch_actor(mod_ctx, "F_SP102", 0, -1, record_crc, &record, sizeof(record), &handle);
```
```
StageActorHandle handle{};
svc_stage->delete_actor(mod_ctx, "F_SP102", 0, -1, record_crc, &handle);
```
Patch or remove actors from the original actor list as the room loads.
Given records must be of either `stage_actor_data_class` or `stage_tgsc_data_class` types.
`record_crc` is the CRC-32 of the unmodified original record used to identify the record to replace or remove.
```
stage_actor_data_class record = {
"carry00",
0xFF000000,
cXyz(0.0f, 0.0f, 0.0f),
csXyz(0, 0, 0),
0,
};
StageActorHandle handle{};
svc_stage->add_actor(mod_ctx, "F_SP102", 0, -1, &record, sizeof(record), &handle);
```
Add a new actor to the actor list as the room loads.
Given records must be of either `stage_actor_data_class` or `stage_tgsc_data_class` types.
Stage names may contain up to 8 characters. For patches and deletions, room `0xff` and layer `-1` match any room or
layer; additions require a specific room. Edits are removed when the mod is detached. If multiple mods edit the same
record, the later-loaded mod wins.
### UiService (`mods/svc/ui.h`) ### UiService (`mods/svc/ui.h`)
Integrate seamlessly with Dusklight's UI system: add controls and buttons to your mod's detail pane in the Mods window, Integrate seamlessly with Dusklight's UI system: add controls and buttons to your mod's detail pane in the Mods window,
@@ -474,8 +412,8 @@ per-window RCSS. A non-`MOD_OK` result from `build`/`update` fails your mod, as
callback. callback.
**Controls:** `pane_add_control` adds an input row described by a `UiControlDesc`: `UI_CONTROL_BUTTON`, **Controls:** `pane_add_control` adds an input row described by a `UiControlDesc`: `UI_CONTROL_BUTTON`,
`UI_CONTROL_GROUP`, `UI_CONTROL_TOGGLE`, `UI_CONTROL_NUMBER`, `UI_CONTROL_STRING`, `UI_CONTROL_SELECT`, or `UI_CONTROL_TOGGLE`, `UI_CONTROL_NUMBER`, `UI_CONTROL_STRING`, or `UI_CONTROL_SELECT`. Values bind with callbacks or
`UI_CONTROL_COLOR`. Values bind with callbacks or directly to a config var. directly to a config var.
```cpp ```cpp
UiControlDesc control = UI_CONTROL_DESC_INIT; UiControlDesc control = UI_CONTROL_DESC_INIT;
@@ -488,56 +426,9 @@ svc_ui->pane_add_control(mod_ctx, leftPane, &control, nullptr);
``` ```
`UI_BINDING_CONFIG_VAR` wires persistence, change notifications, and the modified indicator automatically. The var `UI_BINDING_CONFIG_VAR` wires persistence, change notifications, and the modified indicator automatically. The var
type must match the control: `TOGGLE` = bool, `NUMBER` and `SELECT` = int, `STRING` and `COLOR` = string. Float vars type must match the control: `TOGGLE` = bool, `NUMBER` and `SELECT` = int, `STRING` = string. Float vars are not
are not bindable; use callbacks and convert. `help_rml` and `SELECT` option lists render in a help pane, so `SELECT` bindable; use callbacks and convert. `help_rml` and `SELECT` option lists render in a help pane, so `SELECT` controls
controls are only available inside window tabs. are only available inside window tabs.
`pane_add_group` adds a category button to a window tab's left pane. Focusing the button clears the paired right pane
and calls the group's build callback with that pane, which is useful for organizing related controls without adding
more tabs.
**Lists:** `pane_add_list` adds a scrollable virtualized list of items that can be efficiently updated and filtered.
Keys must be unique and remain stable across replacements.
```cpp
UiListHandle locationList = 0;
void replace_locations(std::string_view query) {
std::vector<UiListItem> items;
for (uint64_t i = 0; i < locations.size(); ++i) {
if (matches(locations[i], query)) {
UiListItem item = UI_LIST_ITEM_INIT;
item.key = i;
item.label = locations[i].c_str();
items.push_back(item);
}
}
svc_ui->list_set_items(mod_ctx, locationList, items.data(), items.size());
}
void set_filter(ModContext*, void*, const UiControlValue* value) {
replace_locations(value->string_value);
}
bool location_selected(ModContext*, UiListHandle, uint64_t key, void*) {
return selected_locations.contains(key);
}
UiControlDesc filter = UI_CONTROL_DESC_INIT;
filter.kind = UI_CONTROL_STRING;
filter.label = "Filter";
filter.get = get_filter;
filter.set = set_filter;
filter.string_set_mode = UI_STRING_SET_ON_CHANGE; /* invoke `set` while typing */
svc_ui->pane_add_control(mod_ctx, pane, &filter, nullptr);
UiListDesc list = UI_LIST_DESC_INIT;
/* items may be passed as a part of list creation, or set afterwards */
list.on_pressed = location_pressed;
list.is_selected = location_selected;
svc_ui->pane_add_list(mod_ctx, pane, &list, &locationList);
replace_locations(""); /* calls `list_set_items` */
```
**Windows:** `window_push` pushes a tabbed two-pane window onto the document stack and shows it. Each tab's `build` **Windows:** `window_push` pushes a tabbed two-pane window onto the document stack and shows it. Each tab's `build`
receives the window handle plus fresh left and right pane handles on every activation. The optional per-tab `update` receives the window handle plus fresh left and right pane handles on every activation. The optional per-tab `update`
@@ -559,36 +450,10 @@ svc_ui->window_push(mod_ctx, &desc, &window);
``` ```
**Dialogs:** `dialog_push` shows a modal dialog. `variant` picks the style, `icon` optionally overrides the variant's **Dialogs:** `dialog_push` shows a modal dialog. `variant` picks the style, `icon` optionally overrides the variant's
default icon, and actions become buttons. The optional `build` callback allows you to add controls to a pane between default icon, and actions become buttons. After an action's `on_pressed` returns, the dialog closes unless the action
the body and actions. It uses the same text, progress, and control builders as panels. sets `keep_open`. A `keep_open` action can close it later (or immediately) with `dialog_close`. Cancel fires
`on_dismiss` if present and always closes. `dialog_set_body`, `dialog_set_icon`, and `dialog_add_action` mutate a live
```cpp dialog.
ModResult build_dialog(ModContext*, UiElementHandle pane, void*, ModError*) {
UiControlDesc input = UI_CONTROL_DESC_INIT;
input.kind = UI_CONTROL_STRING;
input.label = "Name";
input.get = get_name;
input.set = set_name;
return svc_ui->pane_add_control(mod_ctx, pane, &input, nullptr);
}
UiDialogAction action = UI_DIALOG_ACTION_INIT;
action.label = "Save";
action.on_pressed = save;
action.is_disabled = is_save_disabled;
UiDialogDesc dialog = UI_DIALOG_DESC_INIT;
dialog.title = "New Preset";
dialog.body_rml = "Choose a name for the preset.";
dialog.actions = &action;
dialog.action_count = 1;
dialog.build = build_dialog;
svc_ui->dialog_push(mod_ctx, &dialog, nullptr);
```
After an action's `on_pressed`, the dialog closes unless the action sets `keep_open`. It can then be closed later
(or immediately) with `dialog_close`. Cancel fires `on_dismiss` and always closes. `dialog_set_body` and
`dialog_set_icon` mutate a live dialog.
**Toasts:** `push_toast` enqueues a notification. Titles and bodies accept RML. The optional `type` is applied as an **Toasts:** `push_toast` enqueues a notification. Titles and bodies accept RML. The optional `type` is applied as an
RCSS class; `warning` uses the built-in warning appearance, and mods can define their own types. A duration of 0 uses RCSS class; `warning` uses the built-in warning appearance, and mods can define their own types. A duration of 0 uses
@@ -711,128 +576,6 @@ if (svc_camera->get_camera(mod_ctx, game_view, &camera) == MOD_OK) {
first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention
(reversed-Z by default). (reversed-Z by default).
Camera operators allow overriding the main camera. When an operator callback returns true, its values replace the camera
state for the current frame. Register and unregister using `register_camera_operator` / `unregister_camera_operator`.
### GameModeService (`mods/svc/game_mode.h`)
Allows a mod to register a game mode with callbacks for key gameplay and save lifecycle events. Registered game modes
appear in the prelaunch menu. Game modes may use a unique set of saves by configuring `save_name`; leave it empty to use
the vanilla `gczelda2` save.
```cpp
IMPORT_SERVICE(LogService, svc_log);
IMPORT_SERVICE(HookService, svc_hook);
IMPORT_SERVICE(GameModeService, svc_game_mode);
DEFINE_HOOK(fopAcM_createItem, CreateItem);
#define MY_GAME_MODE_ID "game-mode-id"
static HookAction my_function_hook(ModContext* ctx, void* args, void*, void*) {
// If we wish to have this hook only run while the gamemode is registered, we need to hook the function from the
// gamemode's onActivatedFunction, and uninstall the hook during the onDeactivatedFunction. Example below.
// Alternatively, check with `svc_game_mode->is_active(mod_ctx, MY_GAME_MODE_ID, &active) == MOD_OK && active`.
return HOOK_CONTINUE;
}
ModResult on_game_mode_activated(void*, ModError* outError) {
// Setup the gamemode, Add any hooks that are gamemode specific
// Overlay any files that are gamemode specific
ModResult result = mods::hook_add_pre<CreateItem>(svc_hook, my_function_hook);
if (result != MOD_OK) {
return mods::set_error(outError, result, "failed to install fopAcM_createItem hook");
}
return MOD_OK;
}
ModResult on_game_mode_deactivated(void*, ModError* outError) {
// Uninstall any hooks that are gamemode specific
// Remove any file overlays that are gamemode specific
ModResult result = mods::hook_uninstall<CreateItem>();
if (result != MOD_OK) {
return mods::set_error(outError, result, "failed to uninstall fopAcM_createItem hook");
}
return MOD_OK;
}
ModResult on_save_loaded(void*, ModError*) {
// This function will be invoked by the game as a save is loaded
return MOD_OK;
}
const GameModeDesc gameModeDesc = {
.struct_size = sizeof(GameModeDesc),
.game_mode_id = MY_GAME_MODE_ID,
.full_name = "My Game Mode",
.save_name = "my-unique-save",
.user_data = nullptr,
.on_activated = on_game_mode_activated,
.on_deactivated = on_game_mode_deactivated,
.on_save_loaded = on_save_loaded,
};
svc_game_mode->register_game_mode(mod_ctx, &gameModeDesc);
```
A game mode can also open UI for per-save settings when creating a new file. The state begins as
`GAME_MODE_STATE_PENDING` and remains valid until the mod selects `PROCEED` or `RETURN`.
```cpp
IMPORT_SERVICE(GameModeService, svc_game_mode);
IMPORT_SERVICE(UiService, svc_ui);
ModResult on_new_save_select(void*, GameModeNewSaveState* state, ModError* outError) {
static GameModeNewSaveState* newSaveState;
static UiWindowHandle windowHandle;
newSaveState = state;
UiTabDesc tabs[1]{};
tabs[0].struct_size = sizeof(UiTabDesc);
tabs[0].title = "Play";
tabs[0].build = [](ModContext* ctx, UiWindowHandle, UiElementHandle leftPane, UiElementHandle rightPane, void*, ModError*) {
UiControlDesc desc = UI_CONTROL_DESC_INIT;
desc.kind = UI_CONTROL_BUTTON;
desc.label = "Play";
desc.help_rml = "Play Button";
desc.on_pressed = [](ModContext* ctx, void* userdata) {
*newSaveState = GAME_MODE_STATE_PROCEED;
svc_ui->window_close(ctx, *static_cast<UiWindowHandle*>(userdata));
};
desc.user_data = &windowHandle;
svc_ui->pane_add_control(mod_ctx, leftPane, &desc, nullptr);
return MOD_OK;
};
UiWindowDesc desc = UI_WINDOW_DESC_INIT;
desc.tabs = tabs;
desc.tab_count = 1;
desc.on_closed = [](ModContext *, UiWindowHandle, void *userdata) {
// If closing the window through backing out, return to file select
if (*newSaveState == GAME_MODE_STATE_PENDING) {
*newSaveState = GAME_MODE_STATE_RETURN;
}
};
ModResult result = svc_ui->window_push(mod_ctx, &desc, &windowHandle);
if (result != MOD_OK) {
return mods::set_error(outError, result, "failed to open new-save settings");
}
return MOD_OK;
}
const GameModeDesc gameModeDesc = {
.struct_size = sizeof(GameModeDesc),
.game_mode_id = "my-game-mode-id",
.full_name = "My Game Mode",
.save_name = "my-unique-save",
.on_new_save_select = on_new_save_select,
};
svc_game_mode->register_game_mode(mod_ctx, &gameModeDesc);
```
--- ---
## Hooking Game Functions ## Hooking Game Functions
@@ -960,11 +703,6 @@ For reference parameters (e.g. `const cXyz& pos`), `arg_ref<cXyz>` yields a dire
Files placed under `overlay/` in the `.dusk` archive override game files at the corresponding path, equivalent to Files placed under `overlay/` in the `.dusk` archive override game files at the corresponding path, equivalent to
replacing files in the .iso. This requires no code: an archive with just `mod.json` and `overlay/` is a complete mod. replacing files in the .iso. This requires no code: an archive with just `mod.json` and `overlay/` is a complete mod.
To replace a file within an `.arc` archive, replace the archive suffix with a directory and place the replacement at
its path within the archive.
- `overlay/Audiores/Stream/menu_select.ast` replaces the main title's audio stream.
- `overlay/res/Layout/main2D/main2d/timg/midona64.bti` replaces Midna's UI icon inside `main2D.arc`.
Files placed under `textures/` register as texture replacements, and act just like the user's general Files placed under `textures/` register as texture replacements, and act just like the user's general
`texture_replacements/` directory: Dolphin-style naming, matched by texture hash `texture_replacements/` directory: Dolphin-style naming, matched by texture hash
@@ -1140,6 +878,6 @@ const char* nativeDir = svc_host->native_dir(mod_ctx); // read-only
``` ```
Libraries loaded explicitly by the mod remain its responsibility: stop their threads and unload them during Libraries loaded explicitly by the mod remain its responsibility: stop their threads and unload them during
`mod_shutdown`. Do not write into `native_dir`; use `data_dir` for persistent storage or `mod_dir` for temporary `mod_shutdown`. Do not write into `native_dir`; use `mod_dir` for writable state. Native library namespaces are
(session) storage. Native library namespaces are process-wide on some platforms, so two mods cannot safely assume that process-wide on some platforms, so two mods cannot safely assume that incompatible libraries with the same filename
incompatible libraries with the same filename will remain isolated. will remain isolated.
+1 -1
-1
Submodule extern/borealis deleted from 6fd955e7e6
+162 -26
View File
@@ -1412,7 +1412,6 @@ set(DOLPHIN_FILES
set(DUSK_FILES set(DUSK_FILES
include/helpers/batch.hpp include/helpers/batch.hpp
include/helpers/bits.hpp
include/helpers/endian_gx.hpp include/helpers/endian_gx.hpp
src/d/actor/d_a_alink_dusk.cpp src/d/actor/d_a_alink_dusk.cpp
src/dusk/OSContext.cpp src/dusk/OSContext.cpp
@@ -1422,23 +1421,30 @@ set(DUSK_FILES
src/dusk/achievements.cpp src/dusk/achievements.cpp
src/dusk/action_bindings.cpp src/dusk/action_bindings.cpp
src/dusk/action_bindings.h src/dusk/action_bindings.h
src/dusk/android_frame_rate.cpp
src/dusk/android_frame_rate.hpp
src/dusk/asserts.cpp src/dusk/asserts.cpp
src/dusk/autosave.cpp src/dusk/autosave.cpp
src/dusk/config.cpp src/dusk/config.cpp
src/dusk/config.hpp src/dusk/config.hpp
src/dusk/crash_handler.cpp
src/dusk/crash_reporting.cpp
src/dusk/data.cpp src/dusk/data.cpp
src/dusk/data.hpp src/dusk/data.hpp
src/dusk/discord.cpp
src/dusk/discord.hpp
src/dusk/discord_presence.cpp src/dusk/discord_presence.cpp
src/dusk/dvd_asset.cpp src/dusk/dvd_asset.cpp
src/dusk/dvd_asset.hpp src/dusk/dvd_asset.hpp
src/dusk/extras.c src/dusk/extras.c
src/dusk/file_select.cpp
src/dusk/file_select.hpp
src/dusk/frame_interpolation.cpp src/dusk/frame_interpolation.cpp
src/dusk/game_clock.cpp src/dusk/game_clock.cpp
src/dusk/game_mode.cpp
src/dusk/gamepad_color.cpp src/dusk/gamepad_color.cpp
src/dusk/globals.cpp src/dusk/globals.cpp
src/dusk/gyro.cpp src/dusk/gyro.cpp
src/dusk/hq_minimap.cpp src/dusk/http/http.hpp
src/dusk/imgui/ImGuiActorSpawner.cpp src/dusk/imgui/ImGuiActorSpawner.cpp
src/dusk/imgui/ImGuiBloomWindow.cpp src/dusk/imgui/ImGuiBloomWindow.cpp
src/dusk/imgui/ImGuiBloomWindow.hpp src/dusk/imgui/ImGuiBloomWindow.hpp
@@ -1452,6 +1458,8 @@ set(DUSK_FILES
src/dusk/imgui/ImGuiHeapOverlay.cpp src/dusk/imgui/ImGuiHeapOverlay.cpp
src/dusk/imgui/ImGuiMenuTools.cpp src/dusk/imgui/ImGuiMenuTools.cpp
src/dusk/imgui/ImGuiMenuTools.hpp src/dusk/imgui/ImGuiMenuTools.hpp
src/dusk/imgui/ImGuiMenuRandomizer.cpp
src/dusk/imgui/ImGuiMenuRandomizer.hpp
src/dusk/imgui/ImGuiProcessOverlay.cpp src/dusk/imgui/ImGuiProcessOverlay.cpp
src/dusk/imgui/ImGuiSaveEditor.cpp src/dusk/imgui/ImGuiSaveEditor.cpp
src/dusk/imgui/ImGuiStateShare.cpp src/dusk/imgui/ImGuiStateShare.cpp
@@ -1459,8 +1467,6 @@ set(DUSK_FILES
src/dusk/imgui/ImGuiStubLog.cpp src/dusk/imgui/ImGuiStubLog.cpp
src/dusk/io.cpp src/dusk/io.cpp
src/dusk/iso_validate.cpp src/dusk/iso_validate.cpp
src/dusk/language.cpp
src/dusk/language.hpp
src/dusk/layout.cpp src/dusk/layout.cpp
src/dusk/livesplit.cpp src/dusk/livesplit.cpp
src/dusk/logging.cpp src/dusk/logging.cpp
@@ -1477,9 +1483,6 @@ set(DUSK_FILES
src/dusk/mods/loader/native_module.hpp src/dusk/mods/loader/native_module.hpp
src/dusk/mods/loader/prepatch.cpp src/dusk/mods/loader/prepatch.cpp
src/dusk/mods/loader/prepatch.hpp src/dusk/mods/loader/prepatch.hpp
src/dusk/mods/item.hpp
src/dusk/mods/item_checks.cpp
src/dusk/mods/item_gives.cpp
src/dusk/mods/log_buffer.cpp src/dusk/mods/log_buffer.cpp
src/dusk/mods/log_buffer.hpp src/dusk/mods/log_buffer.hpp
src/dusk/mods/manifest.cpp src/dusk/mods/manifest.cpp
@@ -1489,11 +1492,8 @@ set(DUSK_FILES
src/dusk/mods/svc/config.hpp src/dusk/mods/svc/config.hpp
src/dusk/mods/svc/game.cpp src/dusk/mods/svc/game.cpp
src/dusk/mods/svc/gfx.cpp src/dusk/mods/svc/gfx.cpp
src/dusk/mods/svc/flow.cpp
src/dusk/mods/svc/hook.cpp src/dusk/mods/svc/hook.cpp
src/dusk/mods/svc/host.cpp src/dusk/mods/svc/host.cpp
src/dusk/mods/svc/item.cpp
src/dusk/mods/svc/item.hpp
src/dusk/mods/svc/log.cpp src/dusk/mods/svc/log.cpp
src/dusk/mods/svc/overlay.cpp src/dusk/mods/svc/overlay.cpp
src/dusk/mods/svc/registry.cpp src/dusk/mods/svc/registry.cpp
@@ -1502,16 +1502,11 @@ set(DUSK_FILES
src/dusk/mods/svc/texture.cpp src/dusk/mods/svc/texture.cpp
src/dusk/mods/svc/ui.cpp src/dusk/mods/svc/ui.cpp
src/dusk/mods/svc/ui.hpp src/dusk/mods/svc/ui.hpp
src/dusk/mods/svc/game_mode.cpp
src/dusk/mods/svc/window.cpp src/dusk/mods/svc/window.cpp
src/dusk/mods/svc/window.hpp src/dusk/mods/svc/window.hpp
src/dusk/mods/svc/save.cpp src/dusk/mods/svc/save.cpp
src/dusk/mods/svc/save.hpp src/dusk/mods/svc/save.hpp
src/dusk/mods/svc/stage.cpp
src/dusk/mods/svc/stage.hpp
src/dusk/mouse.cpp src/dusk/mouse.cpp
src/dusk/presentation.cpp
src/dusk/presentation.hpp
src/dusk/scope_guard.hpp src/dusk/scope_guard.hpp
src/dusk/settings.cpp src/dusk/settings.cpp
src/dusk/speedrun.cpp src/dusk/speedrun.cpp
@@ -1525,12 +1520,12 @@ set(DUSK_FILES
src/dusk/ui/bool_button.hpp src/dusk/ui/bool_button.hpp
src/dusk/ui/button.cpp src/dusk/ui/button.cpp
src/dusk/ui/button.hpp src/dusk/ui/button.hpp
src/dusk/ui/color_input.cpp
src/dusk/ui/color_input.hpp
src/dusk/ui/component.cpp src/dusk/ui/component.cpp
src/dusk/ui/component.hpp src/dusk/ui/component.hpp
src/dusk/ui/controller_config.cpp src/dusk/ui/controller_config.cpp
src/dusk/ui/controller_config.hpp src/dusk/ui/controller_config.hpp
src/dusk/ui/cosmetics.hpp
src/dusk/ui/cosmetics.cpp
src/dusk/ui/controls.hpp src/dusk/ui/controls.hpp
src/dusk/ui/document.cpp src/dusk/ui/document.cpp
src/dusk/ui/document.hpp src/dusk/ui/document.hpp
@@ -1540,16 +1535,12 @@ set(DUSK_FILES
src/dusk/ui/event.hpp src/dusk/ui/event.hpp
src/dusk/ui/graphics_tuner.cpp src/dusk/ui/graphics_tuner.cpp
src/dusk/ui/graphics_tuner.hpp src/dusk/ui/graphics_tuner.hpp
src/dusk/ui/group_button.cpp
src/dusk/ui/group_button.hpp
src/dusk/ui/icon_provider.cpp src/dusk/ui/icon_provider.cpp
src/dusk/ui/icon_provider.hpp src/dusk/ui/icon_provider.hpp
src/dusk/ui/input.cpp src/dusk/ui/input.cpp
src/dusk/ui/input.hpp src/dusk/ui/input.hpp
src/dusk/ui/logs_window.cpp src/dusk/ui/logs_window.cpp
src/dusk/ui/logs_window.hpp src/dusk/ui/logs_window.hpp
src/dusk/ui/list.cpp
src/dusk/ui/list.hpp
src/dusk/ui/menu_bar.cpp src/dusk/ui/menu_bar.cpp
src/dusk/ui/menu_bar.hpp src/dusk/ui/menu_bar.hpp
src/dusk/ui/mod_texture_provider.cpp src/dusk/ui/mod_texture_provider.cpp
@@ -1561,16 +1552,12 @@ set(DUSK_FILES
src/dusk/ui/mods_window.cpp src/dusk/ui/mods_window.cpp
src/dusk/ui/mods_window.hpp src/dusk/ui/mods_window.hpp
src/dusk/ui/nav_types.hpp src/dusk/ui/nav_types.hpp
src/dusk/ui/nav_group.cpp
src/dusk/ui/nav_group.hpp
src/dusk/ui/number_button.cpp src/dusk/ui/number_button.cpp
src/dusk/ui/number_button.hpp src/dusk/ui/number_button.hpp
src/dusk/ui/overlay.cpp src/dusk/ui/overlay.cpp
src/dusk/ui/overlay.hpp src/dusk/ui/overlay.hpp
src/dusk/ui/pane.cpp src/dusk/ui/pane.cpp
src/dusk/ui/pane.hpp src/dusk/ui/pane.hpp
src/dusk/ui/popover.cpp
src/dusk/ui/popover.hpp
src/dusk/ui/prelaunch.cpp src/dusk/ui/prelaunch.cpp
src/dusk/ui/prelaunch.hpp src/dusk/ui/prelaunch.hpp
src/dusk/ui/preset.cpp src/dusk/ui/preset.cpp
@@ -1597,10 +1584,159 @@ set(DUSK_FILES
src/dusk/ui/warp.hpp src/dusk/ui/warp.hpp
src/dusk/ui/window.cpp src/dusk/ui/window.cpp
src/dusk/ui/window.hpp src/dusk/ui/window.hpp
src/dusk/ui/rando_config.cpp
src/dusk/ui/rando_config.hpp
src/dusk/ui/rando_seed_generation.cpp
src/dusk/ui/rando_seed_generation.hpp
src/dusk/achievements.cpp
src/dusk/iso_validate.cpp
src/dusk/livesplit.cpp
src/dusk/OSContext.cpp
src/dusk/OSReport.cpp
src/dusk/OSThread.cpp
src/dusk/OSMutex.cpp
src/dusk/mods/log_buffer.cpp
src/dusk/mods/log_buffer.hpp
src/dusk/mods/manifest.cpp
src/dusk/mods/manifest.hpp
src/dusk/mods/loader/bundle_disk.cpp
src/dusk/mods/loader/bundle_zip.cpp
src/dusk/mods/loader/context.cpp
src/dusk/mods/loader/depgraph.cpp
src/dusk/mods/loader/depgraph.hpp
src/dusk/mods/loader/loader.cpp
src/dusk/mods/loader/loader.hpp
src/dusk/mods/loader/native_module.cpp
src/dusk/mods/loader/native_module.hpp
src/dusk/mods/svc/camera.cpp
src/dusk/mods/svc/config.cpp
src/dusk/mods/svc/config.hpp
src/dusk/mods/svc/game.cpp
src/dusk/mods/svc/gfx.cpp
src/dusk/mods/svc/hook.cpp
src/dusk/mods/svc/host.cpp
src/dusk/mods/svc/log.cpp
src/dusk/mods/svc/overlay.cpp
src/dusk/mods/svc/resource.cpp
src/dusk/mods/svc/texture.cpp
src/dusk/mods/svc/ui.cpp
src/dusk/mods/svc/ui.hpp
src/dusk/mods/svc/registry.cpp
src/dusk/mods/svc/registry.hpp
src/dusk/discord.cpp
src/dusk/discord.hpp
src/dusk/discord_presence.cpp
src/dusk/version.cpp src/dusk/version.cpp
src/dusk/action_bindings.cpp
src/dusk/update_check.cpp
src/dusk/update_check.hpp
src/dusk/version.cpp
src/dusk/cosmetics/color_utils.hpp
src/dusk/cosmetics/color_utils.cpp
src/dusk/cosmetics/midna_hair_color.hpp
src/dusk/cosmetics/midna_hair_color.cpp
src/dusk/cosmetics/texture_utils.hpp
src/dusk/cosmetics/texture_utils.cpp
# Randomizer files
src/dusk/randomizer/game/custom_flow_ids.hpp
src/dusk/randomizer/game/flags.cpp
src/dusk/randomizer/game/flags.h
src/dusk/randomizer/game/messages.cpp
src/dusk/randomizer/game/messages.hpp
src/dusk/randomizer/game/stages.cpp
src/dusk/randomizer/game/stages.h
src/dusk/randomizer/game/tools.cpp
src/dusk/randomizer/game/tools.h
src/dusk/randomizer/game/verify_item_functions.cpp
src/dusk/randomizer/game/verify_item_functions.h
src/dusk/randomizer/game/randomizer_context.cpp
src/dusk/randomizer/game/randomizer_context.hpp
src/dusk/randomizer/generator/logic/area.cpp
src/dusk/randomizer/generator/logic/area.hpp
src/dusk/randomizer/generator/logic/dungeon.cpp
src/dusk/randomizer/generator/logic/dungeon.hpp
src/dusk/randomizer/generator/logic/entrance.cpp
src/dusk/randomizer/generator/logic/entrance.hpp
src/dusk/randomizer/generator/logic/entrance_shuffle.cpp
src/dusk/randomizer/generator/logic/entrance_shuffle.hpp
src/dusk/randomizer/generator/logic/fill.cpp
src/dusk/randomizer/generator/logic/fill.hpp
src/dusk/randomizer/generator/logic/flatten/bits.cpp
src/dusk/randomizer/generator/logic/flatten/bits.hpp
src/dusk/randomizer/generator/logic/flatten/flatten.cpp
src/dusk/randomizer/generator/logic/flatten/flatten.hpp
src/dusk/randomizer/generator/logic/flatten/simplify_algebraic.cpp
src/dusk/randomizer/generator/logic/flatten/simplify_algebraic.hpp
src/dusk/randomizer/generator/logic/hint_types.hpp
src/dusk/randomizer/generator/logic/hints.cpp
src/dusk/randomizer/generator/logic/hints.hpp
src/dusk/randomizer/generator/logic/item.cpp
src/dusk/randomizer/generator/logic/item.hpp
src/dusk/randomizer/generator/logic/item_pool.cpp
src/dusk/randomizer/generator/logic/item_pool.hpp
src/dusk/randomizer/generator/logic/location.cpp
src/dusk/randomizer/generator/logic/location.hpp
src/dusk/randomizer/generator/logic/plandomizer.cpp
src/dusk/randomizer/generator/logic/plandomizer.hpp
src/dusk/randomizer/generator/logic/requirement.cpp
src/dusk/randomizer/generator/logic/requirement.hpp
src/dusk/randomizer/generator/logic/search.cpp
src/dusk/randomizer/generator/logic/search.hpp
src/dusk/randomizer/generator/logic/spoiler_log.cpp
src/dusk/randomizer/generator/logic/spoiler_log.hpp
src/dusk/randomizer/generator/logic/world.cpp
src/dusk/randomizer/generator/logic/world.hpp
src/dusk/randomizer/generator/randomizer.cpp
src/dusk/randomizer/generator/randomizer.hpp
src/dusk/randomizer/generator/seedgen/config.cpp
src/dusk/randomizer/generator/seedgen/config.hpp
src/dusk/randomizer/generator/seedgen/packed_bits.hpp
src/dusk/randomizer/generator/seedgen/seed.cpp
src/dusk/randomizer/generator/seedgen/seed.hpp
src/dusk/randomizer/generator/seedgen/settings.cpp
src/dusk/randomizer/generator/seedgen/settings.hpp
src/dusk/randomizer/generator/test/test.cpp
src/dusk/randomizer/generator/test/test.hpp
src/dusk/randomizer/generator/utility/base64pp.hpp
src/dusk/randomizer/generator/utility/color.cpp
src/dusk/randomizer/generator/utility/color.hpp
src/dusk/randomizer/generator/utility/crc32.hpp
src/dusk/randomizer/generator/utility/common.cpp
src/dusk/randomizer/generator/utility/common.hpp
src/dusk/randomizer/generator/utility/container.hpp
src/dusk/randomizer/generator/utility/endian.cpp
src/dusk/randomizer/generator/utility/endian.hpp
src/dusk/randomizer/generator/utility/exception.hpp
src/dusk/randomizer/generator/utility/file.cpp
src/dusk/randomizer/generator/utility/file.hpp
src/dusk/randomizer/generator/utility/general.hpp
src/dusk/randomizer/generator/utility/log.cpp
src/dusk/randomizer/generator/utility/log.hpp
src/dusk/randomizer/generator/utility/math.hpp
src/dusk/randomizer/generator/utility/path.cpp
src/dusk/randomizer/generator/utility/path.hpp
src/dusk/randomizer/generator/utility/platform.cpp
src/dusk/randomizer/generator/utility/platform.hpp
src/dusk/randomizer/generator/utility/random.cpp
src/dusk/randomizer/generator/utility/random.hpp
src/dusk/randomizer/generator/utility/string.cpp
src/dusk/randomizer/generator/utility/string.hpp
src/dusk/randomizer/generator/utility/text.cpp
src/dusk/randomizer/generator/utility/text.hpp
src/dusk/randomizer/generator/utility/thread_local.hpp
src/dusk/randomizer/generator/utility/time.cpp
src/dusk/randomizer/generator/utility/time.hpp
src/dusk/randomizer/generator/utility/yaml.hpp
src/dusk/utilities.cpp src/dusk/utilities.cpp
src/helpers/batch.cpp src/helpers/batch.cpp
src/helpers/endian.cpp src/helpers/endian.cpp
src/helpers/offset_ptr.cpp src/helpers/offset_ptr.cpp
src/helpers/string.cpp src/helpers/string.cpp
) )
set(DUSK_HTTP_BACKEND_FILES
src/dusk/http/no_backend.cpp
src/dusk/http/curl.cpp
src/dusk/http/winhttp.cpp
src/dusk/http/url_session.mm
)
+1 -1
View File
@@ -228,7 +228,7 @@
ninjaFlags = [ "dusklight" ]; ninjaFlags = [ "dusklight" ];
cmakeFlags = [ cmakeFlags = [
"-DBOREALIS_APP_VERSION_OVERRIDE=${versionSuffix}" "-DDUSK_VERSION_OVERRIDE=${versionSuffix}"
"-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-DAURORA_DAWN_PROVIDER=package" "-DAURORA_DAWN_PROVIDER=package"
"-DAURORA_DAWN_LINKAGE=static" "-DAURORA_DAWN_LINKAGE=static"
+6 -1
View File
@@ -46,8 +46,13 @@ public:
s32 getSeLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 0); } s32 getSeLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 0); }
s32 getBgmLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 1); } s32 getBgmLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 1); }
u8 getDemoSeWaveNum() { return loadedDemoWave; } u8 getDemoSeWaveNum() { return loadedDemoWave; }
#if TARGET_PC
u8 getLoadedSeWave_1() { return loadedSeWave_1;}
u8 getLoadedSeWave_2() { return loadedSeWave_2;}
#endif
// private:
private:
/* 0x00 */ JAISoundID BGM_ID; /* 0x00 */ JAISoundID BGM_ID;
/* 0x04 */ int sceneNum; /* 0x04 */ int sceneNum;
/* 0x08 */ int timer; /* 0x08 */ int timer;
+14 -4
View File
@@ -3912,6 +3912,16 @@ public:
u16 getReadyItem() { return dComIfGp_getSelectItem(mSelectItemId); } u16 getReadyItem() { return dComIfGp_getSelectItem(mSelectItemId); }
static u32 getOtherHeapSize() { return 0xF0A60; } static u32 getOtherHeapSize() { return 0xF0A60; }
#if TARGET_PC
u16 getEventId() { return mMsgFlow.getEventId(); }
bool checkSwimming() {return checkModeFlg(MODE_SWIMMING);}
BE<short>** getDomeLockChromaTable() {
return &field_0x0724->mAnmCRegDataR;
}
#endif
static DUSK_GAME_DATA daAlink_BckData const m_mainBckShield[20]; static DUSK_GAME_DATA daAlink_BckData const m_mainBckShield[20];
static DUSK_GAME_DATA daAlink_BckData const m_mainBckSword[5]; static DUSK_GAME_DATA daAlink_BckData const m_mainBckSword[5];
@@ -6391,7 +6401,8 @@ public:
class daAlinkHIO_huLight_c0 { class daAlinkHIO_huLight_c0 {
public: public:
static DUSK_GAME_DATA daAlinkHIO_huLight_c1 const m; static DUSK_GAME_DATA daAlinkHIO_huLight_c1 IF_NOT_DUSK(const) m;
IF_DUSK(static DUSK_GAME_DATA daAlinkHIO_huLight_c1 const original;)
}; };
class daAlinkHIO_wlLight_c1 { class daAlinkHIO_wlLight_c1 {
@@ -6465,7 +6476,8 @@ public:
class daAlinkHIO_kandelaar_c0 { class daAlinkHIO_kandelaar_c0 {
public: public:
static DUSK_GAME_DATA daAlinkHIO_kandelaar_c1 const m; static DUSK_GAME_DATA daAlinkHIO_kandelaar_c1 IF_NOT_DUSK(const) m;
IF_DUSK(static DUSK_GAME_DATA daAlinkHIO_kandelaar_c1 const original;)
}; };
class daAlinkHIO_kandelaar_c : public daAlinkHIO_data_c { class daAlinkHIO_kandelaar_c : public daAlinkHIO_data_c {
@@ -8449,10 +8461,8 @@ struct daAlink_cutHorseParamTbl {
/* 0xA */ u8 m_cutType; /* 0xA */ u8 m_cutType;
}; // Size: 0xC }; // Size: 0xC
#if !TARGET_PC
inline BOOL dComIfGs_isTransformLV(int i_no); inline BOOL dComIfGs_isTransformLV(int i_no);
inline BOOL dComIfGs_isEventBit(const u16); inline BOOL dComIfGs_isEventBit(const u16);
#endif
static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* i_actor, void* i_data); static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* i_actor, void* i_data);
static fopAc_ac_c* daAlink_searchCanoe(fopAc_ac_c* i_actor, void* i_data); static fopAc_ac_c* daAlink_searchCanoe(fopAc_ac_c* i_actor, void* i_data);
+1 -1
View File
@@ -123,7 +123,7 @@ public:
bool checkFlag(u16 flag) { return field_0x68e & flag; } bool checkFlag(u16 flag) { return field_0x68e & flag; }
void setAction(u8 action) { mAction = action; } void setAction(u8 action) { mAction = action; }
// private: private:
/* 0x56C */ request_of_phase_process_class mPhase1; /* 0x56C */ request_of_phase_process_class mPhase1;
/* 0x574 */ request_of_phase_process_class mPhase2; /* 0x574 */ request_of_phase_process_class mPhase2;
/* 0x57C */ J3DModel* mModel1; /* 0x57C */ J3DModel* mModel1;
-3
View File
@@ -96,9 +96,6 @@ public:
/* 0xDE0 */ cXyz field_0xde0; /* 0xDE0 */ cXyz field_0xde0;
/* 0xDEC */ u8 field_0xdec[0xdf9 - 0xdec]; /* 0xDEC */ u8 field_0xdec[0xdf9 - 0xdec];
/* 0xDF9 */ u8 field_0xdf9; /* 0xDF9 */ u8 field_0xdf9;
#if TARGET_PC
bool mItemCheckHandled;
#endif
}; };
STATIC_ASSERT(sizeof(daE_HP_c) == 0xdfc); STATIC_ASSERT(sizeof(daE_HP_c) == 0xdfc);
-9
View File
@@ -32,12 +32,6 @@ struct daItemBase_data {
class daItemBase_c : public fopAc_ac_c { class daItemBase_c : public fopAc_ac_c {
public: public:
u8 getItemNo(); u8 getItemNo();
#if TARGET_PC
u8 getDisplayItemNo() const {
return mDisplayItemNo != 0xFF ? mDisplayItemNo : m_itemNo;
}
void setDisplayItemNo(u8 itemNo) { mDisplayItemNo = itemNo; }
#endif
void hide(); void hide();
void show(); void show();
void changeDraw(); void changeDraw();
@@ -85,9 +79,6 @@ public:
/* 0x928 */ s16 m_get_timer; /* 0x928 */ s16 m_get_timer;
/* 0x92A */ u8 m_itemNo; /* 0x92A */ u8 m_itemNo;
/* 0x92B */ u8 field_0x92b; /* 0x92B */ u8 field_0x92b;
#if TARGET_PC
u8 mDisplayItemNo = 0xFF;
#endif
}; };
#endif /* D_A_D_A_ITEMBASE_H */ #endif /* D_A_D_A_ITEMBASE_H */
+1 -1
View File
@@ -423,7 +423,7 @@ public:
static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21]; static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21];
static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53]; static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53];
// private: private:
/* 0x568 */ request_of_phase_process_class mPhase; /* 0x568 */ request_of_phase_process_class mPhase;
/* 0x570 */ J3DModel* mpModel; /* 0x570 */ J3DModel* mpModel;
/* 0x574 */ J3DModel* mpShadowModel; /* 0x574 */ J3DModel* mpShadowModel;
+1 -1
View File
@@ -296,7 +296,7 @@ public:
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[18]; static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[18];
static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[18]; static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[18];
// private: private:
/* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO; /* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO;
/* 0x0E44 */ dCcD_Cyl mCyl; /* 0x0E44 */ dCcD_Cyl mCyl;
/* 0x0F80 */ u8 mType; /* 0x0F80 */ u8 mType;
+4 -1
View File
@@ -120,7 +120,10 @@ public:
BOOL chkAction(actionFunc action) { return action == mAction; } BOOL chkAction(actionFunc action) { return action == mAction; }
static DUSK_GAME_DATA eventFunc mEvtSeqList[1]; static DUSK_GAME_DATA eventFunc mEvtSeqList[1];
#if TARGET_PC
// Keep track of last given bug for rando
static DUSK_GAME_DATA u8 mGivenInsectId;
#endif
private: private:
/* 0xB48 */ Z2Creature mSound; /* 0xB48 */ Z2Creature mSound;
/* 0xBD8 */ J3DModel* mpUmbrellaModel; /* 0xBD8 */ J3DModel* mpUmbrellaModel;
+1 -1
View File
@@ -287,7 +287,7 @@ public:
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[10]; static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[10];
static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[10]; static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[10];
// private: private:
/* 0x0E40 */ mDoExt_McaMorfSO* mFishModelMorf; /* 0x0E40 */ mDoExt_McaMorfSO* mFishModelMorf;
/* 0x0E44 */ mDoExt_McaMorfSO* mLeafModelMorf; /* 0x0E44 */ mDoExt_McaMorfSO* mLeafModelMorf;
/* 0x0E48 */ NPC_YKM_HIO_CLASS* mpHIO; /* 0x0E48 */ NPC_YKM_HIO_CLASS* mpHIO;
+1 -1
View File
@@ -96,7 +96,7 @@ public:
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2];
static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[2]; static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[2];
// private: private:
/* 0xB48 */ Z2Creature mCreatureSound; /* 0xB48 */ Z2Creature mCreatureSound;
/* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm;
/* 0xBDC */ daNpcF_Lookat_c mLookat; /* 0xBDC */ daNpcF_Lookat_c mLookat;
+1 -1
View File
@@ -114,7 +114,7 @@ public:
void himoCalc(); void himoCalc();
void adjustShapeAngle() {} void adjustShapeAngle() {}
// private: private:
/* 0x0B48 */ Z2Creature mCreatureSound; /* 0x0B48 */ Z2Creature mCreatureSound;
/* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm;
/* 0x0BDC */ mDoExt_invisibleModel mInvisibleModel; /* 0x0BDC */ mDoExt_invisibleModel mInvisibleModel;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
bool isFirst() { return fopAcM_GetParamBit(this, 0x1b, 1); } bool isFirst() { return fopAcM_GetParamBit(this, 0x1b, 1); }
void setAction(u8 action) { mAction = action; } void setAction(u8 action) { mAction = action; }
// private: private:
/* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x568 */ request_of_phase_process_class mPhaseReq;
/* 0x570 */ J3DModel* mpModel; /* 0x570 */ J3DModel* mpModel;
/* 0x574 */ mDoExt_btkAnm* mpBtkAnm[2]; /* 0x574 */ mDoExt_btkAnm* mpBtkAnm[2];
+1 -7
View File
@@ -64,7 +64,7 @@ public:
current.pos = new_pos; current.pos = new_pos;
} }
// private: private:
/* 0x92C */ fpc_ProcID mItemId; /* 0x92C */ fpc_ProcID mItemId;
/* 0x930 */ int mCounter; /* 0x930 */ int mCounter;
/* 0x934 */ u8 mStatus; /* 0x934 */ u8 mStatus;
@@ -88,12 +88,6 @@ public:
/* 0x99C */ dPa_followEcallBack mEffect2; /* 0x99C */ dPa_followEcallBack mEffect2;
/* 0x9B0 */ Z2SoundObjSimple mSound; /* 0x9B0 */ Z2SoundObjSimple mSound;
/* 0x9D0 */ u8 mIsHookCarry; /* 0x9D0 */ u8 mIsHookCarry;
#if TARGET_PC
u8 mOriginalItemNo;
bool mItemOverridden;
bool mOverrideHover;
bool mGoldenWolfItem;
#endif
}; };
STATIC_ASSERT(sizeof(daObjLife_c) == 0x9d4); STATIC_ASSERT(sizeof(daObjLife_c) == 0x9d4);
+1 -1
View File
@@ -51,7 +51,7 @@ public:
static DUSK_GAME_DATA daObjMasterSword_Attr_c const mAttr; static DUSK_GAME_DATA daObjMasterSword_Attr_c const mAttr;
static DUSK_GAME_DATA actionFunc ActionTable[]; static DUSK_GAME_DATA actionFunc ActionTable[];
// private: private:
/* 0x568 */ J3DModel* mpModel; /* 0x568 */ J3DModel* mpModel;
/* 0x56C */ request_of_phase_process_class mPhase; /* 0x56C */ request_of_phase_process_class mPhase;
/* 0x574 */ mDoExt_btkAnm mBtk; /* 0x574 */ mDoExt_btkAnm mBtk;
-2
View File
@@ -311,11 +311,9 @@ private:
class daMidna_c; class daMidna_c;
class daSpinner_c; class daSpinner_c;
class daPy_py_c; class daPy_py_c;
#if !TARGET_PC
inline daPy_py_c* dComIfGp_getLinkPlayer(); inline daPy_py_c* dComIfGp_getLinkPlayer();
inline BOOL dComIfGs_isEventBit(const u16); inline BOOL dComIfGs_isEventBit(const u16);
inline u32 dComIfGs_getLastSceneMode(); inline u32 dComIfGs_getLastSceneMode();
#endif
class daPy_py_c : public fopAc_ac_c { class daPy_py_c : public fopAc_ac_c {
public: public:
-3
View File
@@ -194,9 +194,6 @@ private:
/* 0x9FC */ u8 field_0x9fc; /* 0x9FC */ u8 field_0x9fc;
/* 0x9FD */ u8 field_0x9fd; /* 0x9FD */ u8 field_0x9fd;
/* 0xA00 */ Mtx mDrawMtx; /* 0xA00 */ Mtx mDrawMtx;
#if TARGET_PC
u8 mOriginalItemNo;
#endif
}; };
STATIC_ASSERT(sizeof(daTbox_c) == 0xA30); STATIC_ASSERT(sizeof(daTbox_c) == 0xA30);
+4 -5
View File
@@ -64,10 +64,13 @@ public:
virtual int Delete(); virtual int Delete();
virtual BOOL checkSmallTbox() { return true; } virtual BOOL checkSmallTbox() { return true; }
#if TARGET_PC
u8 getTboxNo() { return fopAcM_GetParamBit(this, 16, 8);}
#endif
u8 getModelType() { return fopAcM_GetParamBit(this, 8, 4); } u8 getModelType() { return fopAcM_GetParamBit(this, 8, 4); }
u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); } u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); }
// private: private:
/* 0x718 */ u8 mReturnRupee; /* 0x718 */ u8 mReturnRupee;
/* 0x71C */ request_of_phase_process_class mPhase; /* 0x71C */ request_of_phase_process_class mPhase;
/* 0x724 */ J3DModel* mpModel; /* 0x724 */ J3DModel* mpModel;
@@ -83,10 +86,6 @@ public:
/* 0xAC0 */ u8 field_0xAC0[0xAC4 - 0xAC0]; /* 0xAC0 */ u8 field_0xAC0[0xAC4 - 0xAC0];
/* 0xAC4 */ int mStaffIdx; /* 0xAC4 */ int mStaffIdx;
/* 0xAC8 */ dBgW* mBoxBgW; /* 0xAC8 */ dBgW* mBoxBgW;
#if TARGET_PC
bool mParamsInit;
u8 mOriginalItemNo;
#endif
}; };
STATIC_ASSERT(sizeof(daTbox2_c) == 0xACC); STATIC_ASSERT(sizeof(daTbox2_c) == 0xACC);
+4 -4
View File
@@ -114,6 +114,10 @@ public:
bool checkBoomWindTgTimer() { return mBoomWindTgTimer == 0; } bool checkBoomWindTgTimer() { return mBoomWindTgTimer == 0; }
#if TARGET_PC
void setRandomizerItem(bool setFoolishItemModel = false);
#endif
static DUSK_GAME_DATA procFunc mFuncPtr[]; static DUSK_GAME_DATA procFunc mFuncPtr[];
static DUSK_GAME_DATA const dCcD_SrcCyl m_cyl_src; static DUSK_GAME_DATA const dCcD_SrcCyl m_cyl_src;
static DUSK_GAME_DATA s32 m_timer_max; static DUSK_GAME_DATA s32 m_timer_max;
@@ -145,10 +149,6 @@ public:
/* 0x9BC */ u8 field_0x9bc[4]; /* 0x9BC */ u8 field_0x9bc[4];
/* 0x9C0 */ u8 field_0x9c0; /* 0x9C0 */ u8 field_0x9c0;
/* 0x9C1 */ u8 field_0x9c1; /* 0x9C1 */ u8 field_0x9c1;
#if TARGET_PC
u8 mOriginalItemNo;
bool mItemOverridden;
#endif
}; // Size: 0x9C4 }; // Size: 0x9C4
#endif /* D_A_D_A_ITEM_STATIC_H */ #endif /* D_A_D_A_ITEM_STATIC_H */
+2 -2
View File
@@ -1,7 +1,6 @@
#ifndef D_A_D_A_ITEMBASE_STATIC_H #ifndef D_A_D_A_ITEMBASE_STATIC_H
#define D_A_D_A_ITEMBASE_STATIC_H #define D_A_D_A_ITEMBASE_STATIC_H
#include "dolphin/types.h"
class fopAc_ac_c; class fopAc_ac_c;
@@ -9,7 +8,8 @@ int CheckFieldItemCreateHeap(fopAc_ac_c* actor);
int CheckItemCreateHeap(fopAc_ac_c* i_this); int CheckItemCreateHeap(fopAc_ac_c* i_this);
#if TARGET_PC #if TARGET_PC
const char* dItem_fieldModelArc(u8 itemNo); // Used for foolish items in rando. Foolish item model id is saved to home.angle.z
#define M_ITEMNO_MODEL_ITEM_ID (IF_DUSK(randomizer_IsActive() && m_itemNo == dItemNo_Randomizer_FOOLISH_ITEM_e && home.angle.z != 0 ? home.angle.z :) m_itemNo)
#endif #endif
#endif /* D_A_D_A_ITEMBASE_STATIC_H */ #endif /* D_A_D_A_ITEMBASE_STATIC_H */
+10 -7
View File
@@ -50,9 +50,6 @@ public:
csXyz* getRotateP(); csXyz* getRotateP();
cXyz* getPosP(); cXyz* getPosP();
const char* getShopArcname(); const char* getShopArcname();
#if TARGET_PC
const ResourceData& getResourceData() const;
#endif
u16 getHeapSize(); u16 getHeapSize();
void CreateInit(); void CreateInit();
void set_mtx(); void set_mtx();
@@ -77,7 +74,17 @@ public:
s16 getAngleY() const { return mAngleY; } s16 getAngleY() const { return mAngleY; }
void setAngleY(s16 angle) { mAngleY = angle;} void setAngleY(s16 angle) { mAngleY = angle;}
#if TARGET_PC
BOOL isRandomized() const;
#endif
static DUSK_GAME_DATA ResourceData const mData[23]; static DUSK_GAME_DATA ResourceData const mData[23];
#if TARGET_PC
static DUSK_GAME_DATA ResourceData mRandoData[23];
#define M_SHOP_DATA (isRandomized() ? mRandoData : mData)
#else
#define M_SHOP_DATA mData
#endif
static DUSK_GAME_DATA f32 const m_cullfar_max; static DUSK_GAME_DATA f32 const m_cullfar_max;
enum { enum {
@@ -113,10 +120,6 @@ private:
/* 0x960 */ s16 mAngleX; /* 0x960 */ s16 mAngleX;
/* 0x962 */ s16 mAngleY; /* 0x962 */ s16 mAngleY;
/* 0x964 */ u8 mShopItemID; /* 0x964 */ u8 mShopItemID;
#if TARGET_PC
ResourceData mOverrideData;
bool mItemOverridden;
#endif
}; };
int CheckShopItemCreateHeap(fopAc_ac_c* i_this); int CheckShopItemCreateHeap(fopAc_ac_c* i_this);
+143 -931
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -37,7 +37,7 @@ public:
CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; } CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; }
void draw() { _draw(); } void draw() { _draw(); }
// private: private:
/* 0x04 */ JKRArchive* mArchive; /* 0x04 */ JKRArchive* mArchive;
/* 0x08 */ dDlst_FileInfo_c mFileInfo; /* 0x08 */ dDlst_FileInfo_c mFileInfo;
/* 0x1C */ u8 field_0x1c[4]; /* 0x1C */ u8 field_0x1c[4];
+46 -15
View File
@@ -9,13 +9,42 @@
#include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" #include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
#if TARGET_PC
#include "mods/svc/game_mode.h"
#endif
class dFile_info_c; class dFile_info_c;
class J2DPicture; class J2DPicture;
#if TARGET_PC
static PaneCache mSelDtPanes[] = {
{MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false},
{MULTI_CHAR('gray_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('b_base'), 0.0f, 0.0f, false},
{MULTI_CHAR('b_base1'), 0.0f, 0.0f, false},
};
static PaneCache fileSelPanes[] = {
{MULTI_CHAR('w_uzu00'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu01'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu02'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu03'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu04'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu05'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu06'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu07'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu08'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu09'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_msg'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_msE'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_msR'), 0.0f, 0.0f, false},
{MULTI_CHAR('er_for0'), 0.0f, 0.0f, false},
{MULTI_CHAR('er_for1'), 0.0f, 0.0f, false},
};
#endif
class dDlst_FileSel_c : public dDlst_base_c { class dDlst_FileSel_c : public dDlst_base_c {
public: public:
void draw(); void draw();
@@ -174,6 +203,9 @@ public:
DATASELPROC_DATA_SELECT_MOVE_ANIME, DATASELPROC_DATA_SELECT_MOVE_ANIME,
DATASELPROC_SELECT_DATA_OPEN_MOVE, DATASELPROC_SELECT_DATA_OPEN_MOVE,
DATASELPROC_SELECT_DATA_NAME_MOVE, DATASELPROC_SELECT_DATA_NAME_MOVE,
#if TARGET_PC
DATASELPROC_SELECT_DATA_PLAY_MOVE, // Select between vanilla or randomizer play
#endif
DATASELPROC_SELECT_DATA_OPENERASE_MOVE, DATASELPROC_SELECT_DATA_OPENERASE_MOVE,
DATASELPROC_MENU_SELECT, DATASELPROC_MENU_SELECT,
DATASELPROC_MENU_SELECT_MOVE_ANM, DATASELPROC_MENU_SELECT_MOVE_ANM,
@@ -302,6 +334,9 @@ public:
void makeRecInfo(u8); void makeRecInfo(u8);
void selectDataOpenMove(); void selectDataOpenMove();
void selectDataNameMove(); void selectDataNameMove();
#if TARGET_PC
void selectDataPlayTypeMove();
#endif
void selectDataOpenEraseMove(); void selectDataOpenEraseMove();
void menuSelect(); void menuSelect();
void menuSelectStart(); void menuSelectStart();
@@ -391,13 +426,6 @@ public:
bool pointerMenuSelect(); bool pointerMenuSelect();
bool pointerCopyDataToSelect(); bool pointerCopyDataToSelect();
bool pointerYesNoSelect(bool errorSelect); bool pointerYesNoSelect(bool errorSelect);
void backToDataSelectMove() {
headerTxtSet(0x43, 1, 0);
fileRecScaleAnmInitSet2(0.0f, 1.0f);
nameMoveAnmInitSet(0xd29, 0xd1f);
modoruTxtDispAnmInit(0);
mDataSelProc = DATASELPROC_NAME_TO_DATA_SELECT_MOVE;
}
#endif #endif
void _draw(); void _draw();
void errorMoveAnmInitSet(int, int); void errorMoveAnmInitSet(int, int);
@@ -710,9 +738,12 @@ public:
/* 0x2378 */ J2DPicture* mpFadePict; /* 0x2378 */ J2DPicture* mpFadePict;
#endif #endif
#ifdef TARGET_PC #ifdef TARGET_PC
dDlst_FileSelFade_c mFadeDlst; struct mDusk {
bool mGameModeSaveStartBuildUi = true; dDlst_FileSelFade_c mFadeDlst;
GameModeNewSaveState mGameModeNewSaveState = GAME_MODE_STATE_PENDING; bool mStartNameAnm;
bool mBackToFileSelect;
int mPendingRmlCloseFrames{0};
} mDusk;
#endif #endif
#if PLATFORM_WII || PLATFORM_SHIELD #if PLATFORM_WII || PLATFORM_SHIELD
@@ -723,7 +754,7 @@ public:
}; };
#ifdef TARGET_PC #ifdef TARGET_PC
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C + sizeof(dDlst_FileSelFade_c)); STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C + sizeof(dFile_select_c::mDusk));
#else #else
STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C); STATIC_ASSERT(sizeof(dFile_select_c) == 0x237C);
#endif #endif
+135 -3
View File
@@ -11,9 +11,7 @@ public:
static DUSK_GAME_DATA u8* mData; static DUSK_GAME_DATA u8* mData;
}; };
class fopAc_ac_c; void execItemGet(u8 item_id);
void execItemGet(
u8 item_id IF_DUSK_ARG(u32 item_give_tag = 0) IF_DUSK_ARG(fopAc_ac_c* giver = NULL));
void item_func_HEART(); void item_func_HEART();
void item_func_GREEN_RUPEE(); void item_func_GREEN_RUPEE();
@@ -34,6 +32,11 @@ void item_func_ARROW_20();
void item_func_ARROW_30(); void item_func_ARROW_30();
void item_func_ARROW_1(); void item_func_ARROW_1();
void item_func_PACHINKO_SHOT(); void item_func_PACHINKO_SHOT();
#if TARGET_PC
void item_func_FOOLISH_ITEM();
void item_func_ORDON_PORTAL();
void item_func_SOUTH_FARON_PORTAL();
#endif
void item_func_WATER_BOMB_5(); void item_func_WATER_BOMB_5();
void item_func_WATER_BOMB_10(); void item_func_WATER_BOMB_10();
void item_func_WATER_BOMB_20(); void item_func_WATER_BOMB_20();
@@ -67,6 +70,12 @@ void item_func_DUNGEON_EXIT_2();
void item_func_WALLET_LV1(); void item_func_WALLET_LV1();
void item_func_WALLET_LV2(); void item_func_WALLET_LV2();
void item_func_WALLET_LV3(); void item_func_WALLET_LV3();
#if TARGET_PC
void item_func_UPPER_ZORAS_RIVER_PORTAL();
void item_func_CASTLE_TOWN_PORTAL();
void item_func_GERUDO_DESERT_PORTAL();
void item_func_NORTH_FARON_PORTAL();
#endif
void item_func_ZORAS_JEWEL(); void item_func_ZORAS_JEWEL();
void item_func_HAWK_EYE(); void item_func_HAWK_EYE();
void item_func_WOOD_STICK(); void item_func_WOOD_STICK();
@@ -83,13 +92,23 @@ void item_func_LIGHT_SWORD();
void item_func_FISHING_ROD_1(); void item_func_FISHING_ROD_1();
void item_func_PACHINKO(); void item_func_PACHINKO();
void item_func_COPY_ROD_2(); void item_func_COPY_ROD_2();
#if TARGET_PC
void item_func_KAKARIKO_GORGE_PORTAL();
void item_func_KAKARIKO_VILLAGE_PORTAL();
#endif
void item_func_BOMB_BAG_LV2(); void item_func_BOMB_BAG_LV2();
void item_func_BOMB_BAG_LV1(); void item_func_BOMB_BAG_LV1();
void item_func_BOMB_IN_BAG(); void item_func_BOMB_IN_BAG();
#if TARGET_PC
void item_func_DEATH_MOUNTAIN_PORTAL();
#endif
void item_func_LIGHT_ARROW(); void item_func_LIGHT_ARROW();
void item_func_ARROW_LV1(); void item_func_ARROW_LV1();
void item_func_ARROW_LV2(); void item_func_ARROW_LV2();
void item_func_ARROW_LV3(); void item_func_ARROW_LV3();
#if TARGET_PC
void item_func_ZORAS_DOMAIN_PORTAL();
#endif
void item_func_LURE_ROD(); void item_func_LURE_ROD();
void item_func_BOMB_ARROW(); void item_func_BOMB_ARROW();
void item_func_HAWK_ARROW(); void item_func_HAWK_ARROW();
@@ -135,8 +154,33 @@ void item_func_BILL();
void item_func_WOOD_STATUE(); void item_func_WOOD_STATUE();
void item_func_IRIAS_PENDANT(); void item_func_IRIAS_PENDANT();
void item_func_HORSE_FLUTE(); void item_func_HORSE_FLUTE();
#if TARGET_PC
void item_func_FOREST_SMALL_KEY();
void item_func_MINES_SMALL_KEY();
void item_func_LAKEBED_SMALL_KEY();
void item_func_ARBITERS_SMALL_KEY();
void item_func_SNOWPEAK_SMALL_KEY();
void item_func_TEMPLE_OF_TIME_SMALL_KEY();
void item_func_CITY_SMALL_KEY();
void item_func_PALACE_SMALL_KEY();
void item_func_HYRULE_SMALL_KEY();
void item_func_CAMP_SMALL_KEY();
void item_func_LAKE_HYLIA_PORTAL();
#endif
void item_func_RAFRELS_MEMO(); void item_func_RAFRELS_MEMO();
void item_func_ASHS_SCRIBBLING(); void item_func_ASHS_SCRIBBLING();
#if TARGET_PC
void item_func_FOREST_BOSS_KEY();
void item_func_LAKEBED_BOSS_KEY();
void item_func_ARBITERS_BOSS_KEY();
void item_func_TEMPLE_OF_TIME_BOSS_KEY();
void item_func_CITY_BOSS_KEY();
void item_func_PALACE_BOSS_KEY();
void item_func_HYRULE_BOSS_KEY();
void item_func_FOREST_COMPASS();
void item_func_MINES_COMPASS();
void item_func_LAKEBED_COMPASS();
#endif
void item_func_CHUCHU_YELLOW2(); void item_func_CHUCHU_YELLOW2();
void item_func_OIL_BOTTLE3(); void item_func_OIL_BOTTLE3();
void item_func_SHOP_BEE_CHILD(); void item_func_SHOP_BEE_CHILD();
@@ -149,12 +193,34 @@ void item_func_FILLED_CONTAINER();
void item_func_MIRROR_PIECE_2(); void item_func_MIRROR_PIECE_2();
void item_func_MIRROR_PIECE_3(); void item_func_MIRROR_PIECE_3();
void item_func_MIRROR_PIECE_4(); void item_func_MIRROR_PIECE_4();
#if TARGET_PC
void item_func_ARBITERS_COMPASS();
void item_func_SNOWPEAK_COMPASS();
void item_func_TEMPLE_OF_TIME_COMPASS();
void item_func_CITY_COMPASS();
void item_func_PALACE_COMPASS();
void item_func_HYRULE_COMPASS();
void item_func_MIRROR_CHAMBER_PORTAL();
void item_func_SNOWPEAK_PORTAL();
#endif
void item_func_SMELL_YELIA_POUCH(); void item_func_SMELL_YELIA_POUCH();
void item_func_SMELL_PUMPKIN(); void item_func_SMELL_PUMPKIN();
void item_func_SMELL_POH(); void item_func_SMELL_POH();
void item_func_SMELL_FISH(); void item_func_SMELL_FISH();
void item_func_SMELL_CHILDREN(); void item_func_SMELL_CHILDREN();
void item_func_SMELL_MEDICINE(); void item_func_SMELL_MEDICINE();
#if TARGET_PC
void item_func_FOREST_MAP();
void item_func_MINES_MAP();
void item_func_LAKEBED_MAP();
void item_func_ARBITERS_MAP();
void item_func_SNOWPEAK_MAP();
void item_func_TEMPLE_OF_TIME_MAP();
void item_func_CITY_MAP();
void item_func_PALACE_MAP();
void item_func_HYRULE_MAP();
void item_func_SACRED_GROVE_PORTAL();
#endif
void item_func_M_BEETLE(); void item_func_M_BEETLE();
void item_func_F_BEETLE(); void item_func_F_BEETLE();
void item_func_M_BUTTERFLY(); void item_func_M_BUTTERFLY();
@@ -179,7 +245,23 @@ void item_func_M_ANT();
void item_func_F_ANT(); void item_func_F_ANT();
void item_func_M_MAYFLY(); void item_func_M_MAYFLY();
void item_func_F_MAYFLY(); void item_func_F_MAYFLY();
#if TARGET_PC
void item_func_FUSED_SHADOW_1();
void item_func_FUSED_SHADOW_2();
void item_func_FUSED_SHADOW_3();
void item_func_MIRROR_PIECE_1();
#endif
void item_func_POU_SPIRIT(); void item_func_POU_SPIRIT();
#if TARGET_PC
void item_func_ENDING_BLOW();
void item_func_SHIELD_ATTACK();
void item_func_BACK_SLICE();
void item_func_HELM_SPLITTER();
void item_func_MORTAL_DRAW();
void item_func_JUMP_STRIKE();
void item_func_GREAT_SPIN();
void item_func_ELDIN_BRIDGE_PORTAL();
#endif
void item_func_ANCIENT_DOCUMENT(); void item_func_ANCIENT_DOCUMENT();
void item_func_AIR_LETTER(); void item_func_AIR_LETTER();
void item_func_ANCIENT_DOCUMENT2(); void item_func_ANCIENT_DOCUMENT2();
@@ -223,6 +305,10 @@ int item_getcheck_func_ARROW_20();
int item_getcheck_func_ARROW_30(); int item_getcheck_func_ARROW_30();
int item_getcheck_func_ARROW_1(); int item_getcheck_func_ARROW_1();
int item_getcheck_func_PACHINKO_SHOT(); int item_getcheck_func_PACHINKO_SHOT();
#if TARGET_PC
int item_getcheck_func_ORDON_PORTAL();
int item_getcheck_func_SOUTH_FARON_PORTAL();
#endif
int item_getcheck_func_WATER_BOMB_5(); int item_getcheck_func_WATER_BOMB_5();
int item_getcheck_func_WATER_BOMB_10(); int item_getcheck_func_WATER_BOMB_10();
int item_getcheck_func_WATER_BOMB_20(); int item_getcheck_func_WATER_BOMB_20();
@@ -256,6 +342,12 @@ int item_getcheck_func_DUNGEON_EXIT_2();
int item_getcheck_func_WALLET_LV1(); int item_getcheck_func_WALLET_LV1();
int item_getcheck_func_WALLET_LV2(); int item_getcheck_func_WALLET_LV2();
int item_getcheck_func_WALLET_LV3(); int item_getcheck_func_WALLET_LV3();
#if TARGET_PC
int item_getcheck_func_UPPER_ZORAS_RIVER_PORTAL();
int item_getcheck_func_CASTLE_TOWN_PORTAL();
int item_getcheck_func_GERUDO_DESERT_PORTAL();
int item_getcheck_func_NORTH_FARON_PORTAL();
#endif
int item_getcheck_func_ZORAS_JEWEL(); int item_getcheck_func_ZORAS_JEWEL();
int item_getcheck_func_HAWK_EYE(); int item_getcheck_func_HAWK_EYE();
int item_getcheck_func_WOOD_STICK(); int item_getcheck_func_WOOD_STICK();
@@ -272,13 +364,23 @@ int item_getcheck_func_LIGHT_SWORD();
int item_getcheck_func_FISHING_ROD_1(); int item_getcheck_func_FISHING_ROD_1();
int item_getcheck_func_PACHINKO(); int item_getcheck_func_PACHINKO();
int item_getcheck_func_COPY_ROD_2(); int item_getcheck_func_COPY_ROD_2();
#if TARGET_PC
int item_getcheck_func_KAKARIKO_GORGE_PORTAL();
int item_getcheck_func_KAKARIKO_VILLAGE_PORTAL();
#endif
int item_getcheck_func_BOMB_BAG_LV2(); int item_getcheck_func_BOMB_BAG_LV2();
int item_getcheck_func_BOMB_BAG_LV1(); int item_getcheck_func_BOMB_BAG_LV1();
int item_getcheck_func_BOMB_IN_BAG(); int item_getcheck_func_BOMB_IN_BAG();
#if TARGET_PC
int item_getcheck_func_DEATH_MOUNTAIN_PORTAL();
#endif
int item_getcheck_func_LIGHT_ARROW(); int item_getcheck_func_LIGHT_ARROW();
int item_getcheck_func_ARROW_LV1(); int item_getcheck_func_ARROW_LV1();
int item_getcheck_func_ARROW_LV2(); int item_getcheck_func_ARROW_LV2();
int item_getcheck_func_ARROW_LV3(); int item_getcheck_func_ARROW_LV3();
#if TARGET_PC
int item_getcheck_func_ZORAS_DOMAIN_PORTAL();
#endif
int item_getcheck_func_LURE_ROD(); int item_getcheck_func_LURE_ROD();
int item_getcheck_func_BOMB_ARROW(); int item_getcheck_func_BOMB_ARROW();
int item_getcheck_func_HAWK_ARROW(); int item_getcheck_func_HAWK_ARROW();
@@ -324,6 +426,10 @@ int item_getcheck_func_BILL();
int item_getcheck_func_WOOD_STATUE(); int item_getcheck_func_WOOD_STATUE();
int item_getcheck_func_IRIAS_PENDANT(); int item_getcheck_func_IRIAS_PENDANT();
int item_getcheck_func_HORSE_FLUTE(); int item_getcheck_func_HORSE_FLUTE();
#if TARGET_PC
int item_getcheck_func_CAMP_SMALL_KEY();
int item_getcheck_func_LAKE_HYLIA_PORTAL();
#endif
int item_getcheck_func_RAFRELS_MEMO(); int item_getcheck_func_RAFRELS_MEMO();
int item_getcheck_func_ASHS_SCRIBBLING(); int item_getcheck_func_ASHS_SCRIBBLING();
int item_getcheck_func_CHUCHU_YELLOW2(); int item_getcheck_func_CHUCHU_YELLOW2();
@@ -338,12 +444,19 @@ int item_getcheck_func_FILLED_CONTAINER();
int item_getcheck_func_MIRROR_PIECE_2(); int item_getcheck_func_MIRROR_PIECE_2();
int item_getcheck_func_MIRROR_PIECE_3(); int item_getcheck_func_MIRROR_PIECE_3();
int item_getcheck_func_MIRROR_PIECE_4(); int item_getcheck_func_MIRROR_PIECE_4();
#if TARGET_PC
int item_getcheck_func_MIRROR_CHAMBER_PORTAL();
int item_getcheck_func_SNOWPEAK_PORTAL();
#endif
int item_getcheck_func_SMELL_YELIA_POUCH(); int item_getcheck_func_SMELL_YELIA_POUCH();
int item_getcheck_func_SMELL_PUMPKIN(); int item_getcheck_func_SMELL_PUMPKIN();
int item_getcheck_func_SMELL_POH(); int item_getcheck_func_SMELL_POH();
int item_getcheck_func_SMELL_FISH(); int item_getcheck_func_SMELL_FISH();
int item_getcheck_func_SMELL_CHILDREN(); int item_getcheck_func_SMELL_CHILDREN();
int item_getcheck_func_SMELL_MEDICINE(); int item_getcheck_func_SMELL_MEDICINE();
#if TARGET_PC
int item_getcheck_func_SACRED_GROVE_PORTAL();
#endif
int item_getcheck_func_M_BEETLE(); int item_getcheck_func_M_BEETLE();
int item_getcheck_func_F_BEETLE(); int item_getcheck_func_F_BEETLE();
int item_getcheck_func_M_BUTTERFLY(); int item_getcheck_func_M_BUTTERFLY();
@@ -368,7 +481,23 @@ int item_getcheck_func_M_ANT();
int item_getcheck_func_F_ANT(); int item_getcheck_func_F_ANT();
int item_getcheck_func_M_MAYFLY(); int item_getcheck_func_M_MAYFLY();
int item_getcheck_func_F_MAYFLY(); int item_getcheck_func_F_MAYFLY();
#if TARGET_PC
int item_getcheck_func_FUSED_SHADOW_1();
int item_getcheck_func_FUSED_SHADOW_2();
int item_getcheck_func_FUSED_SHADOW_3();
int item_getcheck_func_MIRROR_PIECE_1();
#endif
int item_getcheck_func_POU_SPIRIT(); int item_getcheck_func_POU_SPIRIT();
#if TARGET_PC
int item_getcheck_func_ENDING_BLOW();
int item_getcheck_func_SHIELD_ATTACK();
int item_getcheck_func_BACK_SLICE();
int item_getcheck_func_HELM_SPLITTER();
int item_getcheck_func_MORTAL_DRAW();
int item_getcheck_func_JUMP_STRIKE();
int item_getcheck_func_GREAT_SPIN();
int item_getcheck_func_ELDIN_BRIDGE_PORTAL();
#endif
int item_getcheck_func_ANCIENT_DOCUMENT(); int item_getcheck_func_ANCIENT_DOCUMENT();
int item_getcheck_func_AIR_LETTER(); int item_getcheck_func_AIR_LETTER();
int item_getcheck_func_ANCIENT_DOCUMENT2(); int item_getcheck_func_ANCIENT_DOCUMENT2();
@@ -397,6 +526,9 @@ int checkItemGet(u8, int);
BOOL isHeart(u8 item_no); BOOL isHeart(u8 item_no);
int isBomb(u8); int isBomb(u8);
int isArrow(u8); int isArrow(u8);
#if TARGET_PC
int isRupee(u8);
#endif
int addBombCount(u8, u8); int addBombCount(u8, u8);
BOOL isBottleItem(u8 item_no); BOOL isBottleItem(u8 item_no);
u8 check_itemno(int i_itemNo); u8 check_itemno(int i_itemNo);
+327 -5
View File
@@ -35,7 +35,65 @@ struct dItem_fieldItemResource {
/* 0xC */ u16 mHeapSize; /* 0xC */ u16 mHeapSize;
}; // Size: 0x10 }; // Size: 0x10
#if TARGET_PC
// Delcared helper functions since we can't include dComIfg_isRandomizer here
dItem_itemResource* dItem_data_getItemResource();
dItem_fieldItemResource* dItem_data_getFieldItemResource();
dItem_itemInfo* dItem_data_getItemInfo();
#endif
struct dItem_data { struct dItem_data {
#if TARGET_PC
static const char* getArcName(u8 index) { return dItem_data_getItemResource()[index].mArcName; }
static s16 getBtpName(u8 index) { return dItem_data_getItemResource()[index].mBtpName; }
static s16 getBrkName(u8 index) { return dItem_data_getItemResource()[index].mBrkName; }
static s16 getBxaName(u8 index) { return -1; }
static s16 getBckName(u8 index) { return dItem_data_getItemResource()[index].mBckName; }
static s16 getBpkName(u8 index) { return -1; }
static s16 getBtkName(u8 index) { return dItem_data_getItemResource()[index].mBtkName; }
static s16 getBmdName(u8 index) { return dItem_data_getItemResource()[index].mBmdName; }
static s8 getTevFrm(u8 index) { return dItem_data_getItemResource()[index].mTevFrm; }
static s8 getBtpFrm(u8 index) { return dItem_data_getItemResource()[index].mBtpFrm; }
static s16 getTexture(u8 index) { return dItem_data_getItemResource()[index].mTexture; }
static u8 getTexScale (u8 index) { return dItem_data_getItemResource()[index].mTexScale; }
static const char* getFieldArc(u8 index) { return dItem_data_getFieldItemResource()[index].mFieldArc; }
static s16 getItemBmdName(u8 index) { return dItem_data_getFieldItemResource()[index].mItemBmdName; }
static s16 getItemBtkName(u8 index) { return -1; }
static s16 getItemBpkName(u8 index) { return -1; }
static s16 getItemBckName(u8 index) { return dItem_data_getFieldItemResource()[index].mItemBckName; }
static s16 getItemBxaName(u8 index) { return -1; }
static s16 getItemBrkName(u8 index) { return dItem_data_getFieldItemResource()[index].mItemBrkName; }
static s16 getItemBtpName(u8 index) { return -1; }
static BOOL chkFlag(u8 index, int flag) { return dItem_data_getItemInfo()[index].mFlag & flag; }
static u8 getShadowSize(u8 index) { return dItem_data_getItemInfo()[index].mShadowSize; }
static const u8 getH(u8 index) { return dItem_data_getItemInfo()[index].mH; }
static const u8 getR(u8 index) { return dItem_data_getItemInfo()[index].mR; }
static u16 getFieldHeapSize(u8 index) { return dItem_data_getFieldItemResource()[index].mHeapSize; }
#else
static const char* getArcName(u8 index) { return item_resource[index].mArcName; } static const char* getArcName(u8 index) { return item_resource[index].mArcName; }
static s16 getBtpName(u8 index) { return item_resource[index].mBtpName; } static s16 getBtpName(u8 index) { return item_resource[index].mBtpName; }
@@ -85,10 +143,16 @@ struct dItem_data {
static const u8 getR(u8 index) { return item_info[index].mR; } static const u8 getR(u8 index) { return item_info[index].mR; }
static u16 getFieldHeapSize(u8 index) { return field_item_res[index].mHeapSize; } static u16 getFieldHeapSize(u8 index) { return field_item_res[index].mHeapSize; }
#endif
static DUSK_GAME_DATA dItem_itemResource item_resource[255]; static DUSK_GAME_DATA dItem_itemResource item_resource[255];
static DUSK_GAME_DATA dItem_fieldItemResource field_item_res[255]; static DUSK_GAME_DATA dItem_fieldItemResource field_item_res[255];
static DUSK_GAME_DATA dItem_itemInfo item_info[255]; static DUSK_GAME_DATA dItem_itemInfo item_info[255];
#if TARGET_PC
static DUSK_GAME_DATA dItem_itemResource item_resource_randomizer[255];
static DUSK_GAME_DATA dItem_fieldItemResource field_item_res_randomizer[255];
static DUSK_GAME_DATA dItem_itemInfo item_info_randomizer[255];
#endif
}; };
enum { enum {
@@ -142,12 +206,7 @@ enum {
/* 0x2F */ dItemNo_WEAR_KOKIRI_e, /* 0x2F */ dItemNo_WEAR_KOKIRI_e,
/* 0x30 */ dItemNo_ARMOR_e, /* 0x30 */ dItemNo_ARMOR_e,
/* 0x31 */ dItemNo_WEAR_ZORA_e, /* 0x31 */ dItemNo_WEAR_ZORA_e,
#if TARGET_PC
/* 0x32 */ dItemNo_MAGIC_LV1_e, /* 0x32 */ dItemNo_MAGIC_LV1_e,
dItemNo_SHADOW_CRYSTAL_e = dItemNo_MAGIC_LV1_e,
#else
/* 0x32 */ dItemNo_MAGIC_LV1_e,
#endif
/* 0x33 */ dItemNo_DUNGEON_EXIT_2_e, /* 0x33 */ dItemNo_DUNGEON_EXIT_2_e,
/* 0x34 */ dItemNo_WALLET_LV1_e, /* 0x34 */ dItemNo_WALLET_LV1_e,
/* 0x35 */ dItemNo_WALLET_LV2_e, /* 0x35 */ dItemNo_WALLET_LV2_e,
@@ -355,4 +414,267 @@ enum {
/* 0xFF */ dItemNo_NONE_e, /* 0xFF */ dItemNo_NONE_e,
}; };
#if TARGET_PC
// Randomizer item ids. Mostly the same, but we use most unused
// entries for custom portals and keys
enum {
/* 0x00 */ dItemNo_Randomizer_HEART_e,
/* 0x01 */ dItemNo_Randomizer_GREEN_RUPEE_e,
/* 0x02 */ dItemNo_Randomizer_BLUE_RUPEE_e,
/* 0x03 */ dItemNo_Randomizer_YELLOW_RUPEE_e,
/* 0x04 */ dItemNo_Randomizer_RED_RUPEE_e,
/* 0x05 */ dItemNo_Randomizer_PURPLE_RUPEE_e,
/* 0x06 */ dItemNo_Randomizer_ORANGE_RUPEE_e,
/* 0x07 */ dItemNo_Randomizer_SILVER_RUPEE_e,
/* 0x08 */ dItemNo_Randomizer_S_MAGIC_e,
/* 0x09 */ dItemNo_Randomizer_L_MAGIC_e,
/* 0x0A */ dItemNo_Randomizer_BOMB_5_e,
/* 0x0B */ dItemNo_Randomizer_BOMB_10_e,
/* 0x0C */ dItemNo_Randomizer_BOMB_20_e,
/* 0x0D */ dItemNo_Randomizer_BOMB_30_e,
/* 0x0E */ dItemNo_Randomizer_ARROW_10_e,
/* 0x0F */ dItemNo_Randomizer_ARROW_20_e,
/* 0x10 */ dItemNo_Randomizer_ARROW_30_e,
/* 0x11 */ dItemNo_Randomizer_ARROW_1_e,
/* 0x12 */ dItemNo_Randomizer_PACHINKO_SHOT_e,
/* 0x13 */ dItemNo_Randomizer_FOOLISH_ITEM_e,
/* 0x14 */ dItemNo_Randomizer_ORDON_PORTAL_e,
/* 0x15 */ dItemNo_Randomizer_SOUTH_FARON_PORTAL_e,
/* 0x16 */ dItemNo_Randomizer_WATER_BOMB_5_e,
/* 0x17 */ dItemNo_Randomizer_WATER_BOMB_10_e,
/* 0x18 */ dItemNo_Randomizer_WATER_BOMB_20_e,
/* 0x19 */ dItemNo_Randomizer_WATER_BOMB_30_e,
/* 0x1A */ dItemNo_Randomizer_BOMB_INSECT_5_e,
/* 0x1B */ dItemNo_Randomizer_BOMB_INSECT_10_e,
/* 0x1C */ dItemNo_Randomizer_BOMB_INSECT_20_e,
/* 0x1D */ dItemNo_Randomizer_BOMB_INSECT_30_e,
/* 0x1E */ dItemNo_Randomizer_RECOVERY_FAILY_e,
/* 0x1F */ dItemNo_Randomizer_TRIPLE_HEART_e,
/* 0x20 */ dItemNo_Randomizer_SMALL_KEY_e,
/* 0x21 */ dItemNo_Randomizer_KAKERA_HEART_e,
/* 0x22 */ dItemNo_Randomizer_UTAWA_HEART_e,
/* 0x23 */ dItemNo_Randomizer_MAP_e,
/* 0x24 */ dItemNo_Randomizer_COMPUS_e,
/* 0x25 */ dItemNo_Randomizer_DUNGEON_EXIT_e,
/* 0x26 */ dItemNo_Randomizer_BOSS_KEY_e,
/* 0x27 */ dItemNo_Randomizer_DUNGEON_BACK_e,
/* 0x28 */ dItemNo_Randomizer_SWORD_e,
/* 0x29 */ dItemNo_Randomizer_MASTER_SWORD_e,
/* 0x2A */ dItemNo_Randomizer_WOOD_SHIELD_e,
/* 0x2B */ dItemNo_Randomizer_SHIELD_e,
/* 0x2C */ dItemNo_Randomizer_HYLIA_SHIELD_e,
/* 0x2D */ dItemNo_Randomizer_TKS_LETTER_e,
/* 0x2E */ dItemNo_Randomizer_WEAR_CASUAL_e,
/* 0x2F */ dItemNo_Randomizer_WEAR_KOKIRI_e,
/* 0x30 */ dItemNo_Randomizer_ARMOR_e,
/* 0x31 */ dItemNo_Randomizer_WEAR_ZORA_e,
/* 0x32 */ dItemNo_Randomizer_MAGIC_LV1_e,
/* 0x33 */ dItemNo_Randomizer_DUNGEON_EXIT_2_e,
/* 0x34 */ dItemNo_Randomizer_WALLET_LV1_e,
/* 0x35 */ dItemNo_Randomizer_WALLET_LV2_e,
/* 0x36 */ dItemNo_Randomizer_WALLET_LV3_e,
/* 0x37 */ dItemNo_Randomizer_NOENTRY_55_e,
/* 0x38 */ dItemNo_Randomizer_NOENTRY_56_e,
/* 0x39 */ dItemNo_Randomizer_UPPER_ZORAS_RIVER_PORTAL_e,
/* 0x3A */ dItemNo_Randomizer_CASTLE_TOWN_PORTAL_e,
/* 0x3B */ dItemNo_Randomizer_GERUDO_DESERT_PORTAL_e,
/* 0x3C */ dItemNo_Randomizer_NORTH_FARON_PORTAL_e,
/* 0x3D */ dItemNo_Randomizer_ZORAS_JEWEL_e,
/* 0x3E */ dItemNo_Randomizer_HAWK_EYE_e,
/* 0x3F */ dItemNo_Randomizer_WOOD_STICK_e,
/* 0x40 */ dItemNo_Randomizer_BOOMERANG_e,
/* 0x41 */ dItemNo_Randomizer_SPINNER_e,
/* 0x42 */ dItemNo_Randomizer_IRONBALL_e,
/* 0x43 */ dItemNo_Randomizer_BOW_e,
/* 0x44 */ dItemNo_Randomizer_HOOKSHOT_e,
/* 0x45 */ dItemNo_Randomizer_HVY_BOOTS_e,
/* 0x46 */ dItemNo_Randomizer_COPY_ROD_e,
/* 0x47 */ dItemNo_Randomizer_W_HOOKSHOT_e,
/* 0x48 */ dItemNo_Randomizer_KANTERA_e,
/* 0x49 */ dItemNo_Randomizer_LIGHT_SWORD_e,
/* 0x4A */ dItemNo_Randomizer_FISHING_ROD_1_e,
/* 0x4B */ dItemNo_Randomizer_PACHINKO_e,
/* 0x4C */ dItemNo_Randomizer_COPY_ROD_2_e,
/* 0x4D */ dItemNo_Randomizer_KAKARIKO_GORGE_PORTAL_e,
/* 0x4E */ dItemNo_Randomizer_KAKARIKO_VILLAGE_PORTAL_e,
/* 0x4F */ dItemNo_Randomizer_BOMB_BAG_LV2_e,
/* 0x50 */ dItemNo_Randomizer_BOMB_BAG_LV1_e,
/* 0x51 */ dItemNo_Randomizer_BOMB_IN_BAG_e,
/* 0x52 */ dItemNo_Randomizer_DEATH_MOUNTAIN_PORTAL_e,
/* 0x53 */ dItemNo_Randomizer_LIGHT_ARROW_e,
/* 0x54 */ dItemNo_Randomizer_ARROW_LV1_e,
/* 0x55 */ dItemNo_Randomizer_ARROW_LV2_e,
/* 0x56 */ dItemNo_Randomizer_ARROW_LV3_e,
/* 0x57 */ dItemNo_Randomizer_ZORAS_DOMAIN_PORTAL_e,
/* 0x58 */ dItemNo_Randomizer_LURE_ROD_e,
/* 0x59 */ dItemNo_Randomizer_BOMB_ARROW_e,
/* 0x5A */ dItemNo_Randomizer_HAWK_ARROW_e,
/* 0x5B */ dItemNo_Randomizer_BEE_ROD_e,
/* 0x5C */ dItemNo_Randomizer_JEWEL_ROD_e,
/* 0x5D */ dItemNo_Randomizer_WORM_ROD_e,
/* 0x5E */ dItemNo_Randomizer_JEWEL_BEE_ROD_e,
/* 0x5F */ dItemNo_Randomizer_JEWEL_WORM_ROD_e,
/* 0x60 */ dItemNo_Randomizer_EMPTY_BOTTLE_e,
/* 0x61 */ dItemNo_Randomizer_RED_BOTTLE_e,
/* 0x62 */ dItemNo_Randomizer_GREEN_BOTTLE_e,
/* 0x63 */ dItemNo_Randomizer_BLUE_BOTTLE_e,
/* 0x64 */ dItemNo_Randomizer_MILK_BOTTLE_e,
/* 0x65 */ dItemNo_Randomizer_HALF_MILK_BOTTLE_e,
/* 0x66 */ dItemNo_Randomizer_OIL_BOTTLE_e,
/* 0x67 */ dItemNo_Randomizer_WATER_BOTTLE_e,
/* 0x68 */ dItemNo_Randomizer_OIL_BOTTLE_2_e,
/* 0x69 */ dItemNo_Randomizer_RED_BOTTLE_2_e,
/* 0x6A */ dItemNo_Randomizer_UGLY_SOUP_e,
/* 0x6B */ dItemNo_Randomizer_HOT_SPRING_e,
/* 0x6C */ dItemNo_Randomizer_FAIRY_e,
/* 0x6D */ dItemNo_Randomizer_HOT_SPRING_2_e,
/* 0x6E */ dItemNo_Randomizer_OIL2_e,
/* 0x6F */ dItemNo_Randomizer_OIL_e,
/* 0x70 */ dItemNo_Randomizer_NORMAL_BOMB_e,
/* 0x71 */ dItemNo_Randomizer_WATER_BOMB_e,
/* 0x72 */ dItemNo_Randomizer_POKE_BOMB_e,
/* 0x73 */ dItemNo_Randomizer_FAIRY_DROP_e,
/* 0x74 */ dItemNo_Randomizer_WORM_e,
/* 0x75 */ dItemNo_Randomizer_DROP_BOTTLE_e,
/* 0x76 */ dItemNo_Randomizer_BEE_CHILD_e,
/* 0x77 */ dItemNo_Randomizer_CHUCHU_RARE_e,
/* 0x78 */ dItemNo_Randomizer_CHUCHU_RED_e,
/* 0x79 */ dItemNo_Randomizer_CHUCHU_BLUE_e,
/* 0x7A */ dItemNo_Randomizer_CHUCHU_GREEN_e,
/* 0x7B */ dItemNo_Randomizer_CHUCHU_YELLOW_e,
/* 0x7C */ dItemNo_Randomizer_CHUCHU_PURPLE_e,
/* 0x7D */ dItemNo_Randomizer_LV1_SOUP_e,
/* 0x7E */ dItemNo_Randomizer_LV2_SOUP_e,
/* 0x7F */ dItemNo_Randomizer_LV3_SOUP_e,
/* 0x80 */ dItemNo_Randomizer_LETTER_e,
/* 0x81 */ dItemNo_Randomizer_BILL_e,
/* 0x82 */ dItemNo_Randomizer_WOOD_STATUE_e,
/* 0x83 */ dItemNo_Randomizer_IRIAS_PENDANT_e,
/* 0x84 */ dItemNo_Randomizer_HORSE_FLUTE_e,
/* 0x85 */ dItemNo_Randomizer_FOREST_SMALL_KEY_e,
/* 0x86 */ dItemNo_Randomizer_MINES_SMALL_KEY_e,
/* 0x87 */ dItemNo_Randomizer_LAKEBED_SMALL_KEY_e,
/* 0x88 */ dItemNo_Randomizer_ARBITERS_SMALL_KEY_e,
/* 0x89 */ dItemNo_Randomizer_SNOWPEAK_SMALL_KEY_e,
/* 0x8A */ dItemNo_Randomizer_TEMPLE_OF_TIME_SMALL_KEY_e,
/* 0x8B */ dItemNo_Randomizer_CITY_SMALL_KEY_e,
/* 0x8C */ dItemNo_Randomizer_PALACE_SMALL_KEY_e,
/* 0x8D */ dItemNo_Randomizer_HYRULE_SMALL_KEY_e,
/* 0x8E */ dItemNo_Randomizer_CAMP_SMALL_KEY_e,
/* 0x8F */ dItemNo_Randomizer_LAKE_HYLIA_PORTAL_e,
/* 0x90 */ dItemNo_Randomizer_RAFRELS_MEMO_e,
/* 0x91 */ dItemNo_Randomizer_ASHS_SCRIBBLING_e,
/* 0x92 */ dItemNo_Randomizer_FOREST_BOSS_KEY_e,
/* 0x93 */ dItemNo_Randomizer_LAKEBED_BOSS_KEY_e,
/* 0x94 */ dItemNo_Randomizer_ARBITERS_BOSS_KEY_e,
/* 0x95 */ dItemNo_Randomizer_TEMPLE_OF_TIME_BOSS_KEY_e,
/* 0x96 */ dItemNo_Randomizer_CITY_BOSS_KEY_e,
/* 0x97 */ dItemNo_Randomizer_PALACE_BOSS_KEY_e,
/* 0x98 */ dItemNo_Randomizer_HYRULE_BOSS_KEY_e,
/* 0x99 */ dItemNo_Randomizer_FOREST_COMPASS_e,
/* 0x9A */ dItemNo_Randomizer_MINES_COMPASS_e,
/* 0x9B */ dItemNo_Randomizer_LAKEBED_COMPASS_e,
/* 0x9C */ dItemNo_Randomizer_CHUCHU_YELLOW2_e,
/* 0x9D */ dItemNo_Randomizer_OIL_BOTTLE3_e,
/* 0x9E */ dItemNo_Randomizer_SHOP_BEE_CHILD_e,
/* 0x9F */ dItemNo_Randomizer_CHUCHU_BLACK_e,
/* 0xA0 */ dItemNo_Randomizer_LIGHT_DROP_e,
/* 0xA1 */ dItemNo_Randomizer_DROP_CONTAINER_e,
/* 0xA2 */ dItemNo_Randomizer_DROP_CONTAINER02_e,
/* 0xA3 */ dItemNo_Randomizer_DROP_CONTAINER03_e,
/* 0xA4 */ dItemNo_Randomizer_FILLED_CONTAINER_e,
/* 0xA5 */ dItemNo_Randomizer_MIRROR_PIECE_2_e,
/* 0xA6 */ dItemNo_Randomizer_MIRROR_PIECE_3_e,
/* 0xA7 */ dItemNo_Randomizer_MIRROR_PIECE_4_e,
/* 0xA8 */ dItemNo_Randomizer_ARBITERS_COMPASS_e,
/* 0xA9 */ dItemNo_Randomizer_SNOWPEAK_COMPASS_e,
/* 0xAA */ dItemNo_Randomizer_TEMPLE_OF_TIME_COMPASS_e,
/* 0xAB */ dItemNo_Randomizer_CITY_COMPASS_e,
/* 0xAC */ dItemNo_Randomizer_PALACE_COMPASS_e,
/* 0xAD */ dItemNo_Randomizer_HYRULE_COMPASS_e,
/* 0xAE */ dItemNo_Randomizer_MIRROR_CHAMBER_PORTAL_e,
/* 0xAF */ dItemNo_Randomizer_SNOWPEAK_PORTAL_e,
/* 0xB0 */ dItemNo_Randomizer_SMELL_YELIA_POUCH_e,
/* 0xB1 */ dItemNo_Randomizer_SMELL_PUMPKIN_e,
/* 0xB2 */ dItemNo_Randomizer_SMELL_POH_e,
/* 0xB3 */ dItemNo_Randomizer_SMELL_FISH_e,
/* 0xB4 */ dItemNo_Randomizer_SMELL_CHILDREN_e,
/* 0xB5 */ dItemNo_Randomizer_SMELL_MEDICINE_e,
/* 0xB6 */ dItemNo_Randomizer_FOREST_MAP_e,
/* 0xB7 */ dItemNo_Randomizer_MINES_MAP_e,
/* 0xB8 */ dItemNo_Randomizer_LAKEBED_MAP_e,
/* 0xB9 */ dItemNo_Randomizer_ARBITERS_MAP_e,
/* 0xBA */ dItemNo_Randomizer_SNOWPEAK_MAP_e,
/* 0xBB */ dItemNo_Randomizer_TEMPLE_OF_TIME_MAP_e,
/* 0xBC */ dItemNo_Randomizer_CITY_MAP_e,
/* 0xBD */ dItemNo_Randomizer_PALACE_MAP_e,
/* 0xBE */ dItemNo_Randomizer_HYRULE_MAP_e,
/* 0xBF */ dItemNo_Randomizer_SACRED_GROVE_PORTAL_e,
/* 0xC0 */ dItemNo_Randomizer_M_BEETLE_e,
/* 0xC1 */ dItemNo_Randomizer_F_BEETLE_e,
/* 0xC2 */ dItemNo_Randomizer_M_BUTTERFLY_e,
/* 0xC3 */ dItemNo_Randomizer_F_BUTTERFLY_e,
/* 0xC4 */ dItemNo_Randomizer_M_STAG_BEETLE_e,
/* 0xC5 */ dItemNo_Randomizer_F_STAG_BEETLE_e,
/* 0xC6 */ dItemNo_Randomizer_M_GRASSHOPPER_e,
/* 0xC7 */ dItemNo_Randomizer_F_GRASSHOPPER_e,
/* 0xC8 */ dItemNo_Randomizer_M_NANAFUSHI_e,
/* 0xC9 */ dItemNo_Randomizer_F_NANAFUSHI_e,
/* 0xCA */ dItemNo_Randomizer_M_DANGOMUSHI_e,
/* 0xCB */ dItemNo_Randomizer_F_DANGOMUSHI_e,
/* 0xCC */ dItemNo_Randomizer_M_MANTIS_e,
/* 0xCD */ dItemNo_Randomizer_F_MANTIS_e,
/* 0xCE */ dItemNo_Randomizer_M_LADYBUG_e,
/* 0xCF */ dItemNo_Randomizer_F_LADYBUG_e,
/* 0xD0 */ dItemNo_Randomizer_M_SNAIL_e,
/* 0xD1 */ dItemNo_Randomizer_F_SNAIL_e,
/* 0xD2 */ dItemNo_Randomizer_M_DRAGONFLY_e,
/* 0xD3 */ dItemNo_Randomizer_F_DRAGONFLY_e,
/* 0xD4 */ dItemNo_Randomizer_M_ANT_e,
/* 0xD5 */ dItemNo_Randomizer_F_ANT_e,
/* 0xD6 */ dItemNo_Randomizer_M_MAYFLY_e,
/* 0xD7 */ dItemNo_Randomizer_F_MAYFLY_e,
/* 0xD8 */ dItemNo_Randomizer_FUSED_SHADOW_1_e,
/* 0xD9 */ dItemNo_Randomizer_FUSED_SHADOW_2_e,
/* 0xDA */ dItemNo_Randomizer_FUSED_SHADOW_3_e,
/* 0xDB */ dItemNo_Randomizer_MIRROR_PIECE_1_e,
/* 0xDC */ dItemNo_Randomizer_NOENTRY_220_e,
/* 0xDD */ dItemNo_Randomizer_NOENTRY_221_e,
/* 0xDE */ dItemNo_Randomizer_NOENTRY_222_e,
/* 0xDF */ dItemNo_Randomizer_NOENTRY_223_e,
/* 0xE0 */ dItemNo_Randomizer_POU_SPIRIT_e,
/* 0xE1 */ dItemNo_Randomizer_ENDING_BLOW_e,
/* 0xE2 */ dItemNo_Randomizer_SHIELD_ATTACK_e,
/* 0xE3 */ dItemNo_Randomizer_BACK_SLICE_e,
/* 0xE4 */ dItemNo_Randomizer_HELM_SPLITTER_e,
/* 0xE5 */ dItemNo_Randomizer_MORTAL_DRAW_e,
/* 0xE6 */ dItemNo_Randomizer_JUMP_STRIKE_e,
/* 0xE7 */ dItemNo_Randomizer_GREAT_SPIN_e,
/* 0xE8 */ dItemNo_Randomizer_ELDIN_BRIDGE_PORTAL_e,
/* 0xE9 */ dItemNo_Randomizer_ANCIENT_DOCUMENT_e,
/* 0xEA */ dItemNo_Randomizer_AIR_LETTER_e,
/* 0xEB */ dItemNo_Randomizer_ANCIENT_DOCUMENT2_e,
/* 0xEC */ dItemNo_Randomizer_LV7_DUNGEON_EXIT_e,
/* 0xED */ dItemNo_Randomizer_LINKS_SAVINGS_e,
/* 0xEE */ dItemNo_Randomizer_SMALL_KEY2_e,
/* 0xEF */ dItemNo_Randomizer_POU_FIRE1_e,
/* 0xF0 */ dItemNo_Randomizer_POU_FIRE2_e,
/* 0xF1 */ dItemNo_Randomizer_POU_FIRE3_e,
/* 0xF2 */ dItemNo_Randomizer_POU_FIRE4_e,
/* 0xF3 */ dItemNo_Randomizer_BOSSRIDER_KEY_e,
/* 0xF4 */ dItemNo_Randomizer_TOMATO_PUREE_e,
/* 0xF5 */ dItemNo_Randomizer_TASTE_e,
/* 0xF6 */ dItemNo_Randomizer_LV5_BOSS_KEY_e,
/* 0xF7 */ dItemNo_Randomizer_SURFBOARD_e,
/* 0xF8 */ dItemNo_Randomizer_KANTERA2_e,
/* 0xF9 */ dItemNo_Randomizer_L2_KEY_PIECES1_e,
/* 0xFA */ dItemNo_Randomizer_L2_KEY_PIECES2_e,
/* 0xFB */ dItemNo_Randomizer_L2_KEY_PIECES3_e,
/* 0xFC */ dItemNo_Randomizer_KEY_OF_CARAVAN_e,
/* 0xFD */ dItemNo_Randomizer_LV2_BOSS_KEY_e,
/* 0xFE */ dItemNo_Randomizer_KEY_OF_FILONE_e,
/* 0xFF */ dItemNo_Randomizer_NONE_e,
};
#endif
#endif /* D_D_ITEM_DATA_H */ #endif /* D_D_ITEM_DATA_H */
+1 -1
View File
@@ -30,7 +30,7 @@ public:
void drawSelf() { mpKanteraIcon->draw(); } void drawSelf() { mpKanteraIcon->draw(); }
// private: private:
/* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon; /* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon;
/* 0x08 */ CPaneMgr* mpParent; /* 0x08 */ CPaneMgr* mpParent;
/* 0x0C */ CPaneMgr* mpGauge; /* 0x0C */ CPaneMgr* mpGauge;
+44 -1
View File
@@ -15,6 +15,49 @@ class dMenu_Fishing_c;
class dMenu_Skill_c; class dMenu_Skill_c;
class dMenu_Insect_c; class dMenu_Insect_c;
class dSelect_cursor_c; class dSelect_cursor_c;
#if TARGET_PC
struct PaneCache {
u64 tag;
f32 origTransX;
f32 origTransY;
bool cached;
};
static PaneCache mpScreenPanes[] = {
{MULTI_CHAR('sa_tex_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('op_tex_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('heart_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('wolf_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('item_0_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('item_1_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('item_2_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('fish_3_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('lett_4_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('maki_5_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false},
{MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('kabu_6n'), 0.0f, 0.0f, false},
{MULTI_CHAR('t_t00'), 0.0f, 0.0f, false},
{MULTI_CHAR('f_t00'), 0.0f, 0.0f, false},
{MULTI_CHAR('itemn_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('infotxtn'), 0.0f, 0.0f, false},
{MULTI_CHAR('sa_op_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('title_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('menu_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('center_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('info_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('lavel_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('modelbgn'), 0.0f, 0.0f, false},
};
#endif
class dMenu_Collect2D_c; class dMenu_Collect2D_c;
class dMenu_Collect2DTop_c : public dDlst_base_c { class dMenu_Collect2DTop_c : public dDlst_base_c {
public: public:
@@ -129,7 +172,7 @@ public:
J2DPicture* getBlackTex() { return mpBlackTex; } J2DPicture* getBlackTex() { return mpBlackTex; }
u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; } u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; }
// private: private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRExpHeap* mpSubHeap; /* 0x008 */ JKRExpHeap* mpSubHeap;
/* 0x00C */ void* field_0xc; /* 0x00C */ void* field_0xc;
+1 -1
View File
@@ -43,7 +43,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
// private: private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRArchive* mpArchive; /* 0x008 */ JKRArchive* mpArchive;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -270,7 +270,7 @@ public:
static DUSK_GAME_DATA dMenu_Fmap_c* MyClass; static DUSK_GAME_DATA dMenu_Fmap_c* MyClass;
// private: private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRExpHeap* mpTalkHeap; /* 0x008 */ JKRExpHeap* mpTalkHeap;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
// private: private:
/* 0x04 */ JKRExpHeap* mpHeap; /* 0x04 */ JKRExpHeap* mpHeap;
/* 0x08 */ JKRArchive* mpArchive; /* 0x08 */ JKRArchive* mpArchive;
/* 0x0C */ STControl* mpStick; /* 0x0C */ STControl* mpStick;
+1 -1
View File
@@ -64,7 +64,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
// private: private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRArchive* mpArchive; /* 0x008 */ JKRArchive* mpArchive;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -117,7 +117,7 @@ public:
return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false; return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false;
} }
// private: private:
/* 0x004 */ J2DScreen* mpBackScreen; /* 0x004 */ J2DScreen* mpBackScreen;
/* 0x008 */ J2DScreen* mpScreen; /* 0x008 */ J2DScreen* mpScreen;
/* 0x00C */ J2DScreen* mpClipScreen; /* 0x00C */ J2DScreen* mpClipScreen;
+3 -1
View File
@@ -75,6 +75,7 @@ public:
bool dpdMove(); bool dpdMove();
u8 openExplain(u8); u8 openExplain(u8);
#if TARGET_PC #if TARGET_PC
void updateSlotImage(u8 slot);
bool pointerMove(); bool pointerMove();
#endif #endif
@@ -84,7 +85,7 @@ public:
void drawFlag0() { mDrawFlag = 0; } void drawFlag0() { mDrawFlag = 0; }
void setStatus(u8 i_status) { mStatus = i_status; } void setStatus(u8 i_status) { mStatus = i_status; }
// private: private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ STControl* mpStick; /* 0x008 */ STControl* mpStick;
/* 0x00C */ CSTControl* mpCStick; /* 0x00C */ CSTControl* mpCStick;
@@ -219,6 +220,7 @@ public:
bool mCursorInterpCurrAngular; bool mCursorInterpCurrAngular;
bool mCursorInterpInit; bool mCursorInterpInit;
bool mPointerTouchPressHoveredCurrent; bool mPointerTouchPressHoveredCurrent;
J2DPicture* mDpadIcon;
#endif #endif
}; };
+1 -1
View File
@@ -278,7 +278,7 @@ public:
u8 getEndStatus() { return mEndStatus; } u8 getEndStatus() { return mEndStatus; }
void setUseType(u8 type) { mUseType = type; } void setUseType(u8 type) { mUseType = type; }
// private: private:
/* 0x0004 */ JKRArchive* mpArchive; /* 0x0004 */ JKRArchive* mpArchive;
/* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount; /* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount;
/* 0x000C */ STControl* stick; /* 0x000C */ STControl* stick;
+1 -1
View File
@@ -58,7 +58,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
// private: private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRArchive* mpArchive; /* 0x008 */ JKRArchive* mpArchive;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+4 -2
View File
@@ -129,7 +129,9 @@ public:
bool getPlayerSubject(); bool getPlayerSubject();
bool isBButtonShow(bool); bool isBButtonShow(bool);
s16 getButtonTimer(); s16 getButtonTimer();
#if TARGET_PC
f32 getZButtonAlpha() { return mButtonZAlpha;}
#endif
virtual ~dMeter2Draw_c(); virtual ~dMeter2Draw_c();
J2DScreen* getMainScreenPtr() { return mpScreen; } J2DScreen* getMainScreenPtr() { return mpScreen; }
@@ -154,7 +156,7 @@ public:
} }
#endif #endif
// private: private:
/* 0x004 */ item_params mItemParams[4]; /* 0x004 */ item_params mItemParams[4];
/* 0x074 */ JKRExpHeap* heap; /* 0x074 */ JKRExpHeap* heap;
/* 0x078 */ J2DScreen* mpScreen; /* 0x078 */ J2DScreen* mpScreen;
-146
View File
@@ -328,150 +328,6 @@ void dMeter2Info_onWide2D();
void dMeter2Info_offWide2D(); void dMeter2Info_offWide2D();
#endif #endif
#if TARGET_PC
DUSK_NOINLINE void dMeter2Info_Initialize();
DUSK_NOINLINE dMeterMap_c* dMeter2Info_getMeterMapClass();
DUSK_NOINLINE dMw_c* dMeter2Info_getMenuWindowClass();
DUSK_NOINLINE void dMeter2Info_setWindowStatus(u8 i_status);
DUSK_NOINLINE CPaneMgr* dMeter2Info_getMeterItemPanePtr(s32 i_idx);
DUSK_NOINLINE void dMeter2Info_getString(
u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
DUSK_NOINLINE void dMeter2Info_getStringKanji(
u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
DUSK_NOINLINE void dMeter2Info_getStringKana(
u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
DUSK_NOINLINE f32 dMeter2Info_getStringLength(
JUTFont* i_font, f32 param_2, f32 param_3, char* i_string);
DUSK_NOINLINE f32 dMeter2Info_getStringLength(J2DTextBox* i_textbox, char* i_string);
DUSK_NOINLINE void dMeter2Info_setHotSpringTimer(u8 i_slotNo);
DUSK_NOINLINE u16 dMeter2Info_getOilGaugeBackUp();
DUSK_NOINLINE void dMeter2Info_setOilGaugeBackUp(u16 param_1);
DUSK_NOINLINE void dMeter2Info_setSaveStageName(const char* i_stageName);
DUSK_NOINLINE u8 dMeter2Info_getInsectSelectType();
DUSK_NOINLINE void dMeter2Info_setInsectSelectType(u8 i_type);
DUSK_NOINLINE u8 dMeter2Info_getWarpStatus();
DUSK_NOINLINE void dMeter2Info_setWarpStatus(u8 i_status);
DUSK_NOINLINE int dMeter2Info_readItemTexture(u8 i_itemNo, void* i_texBuf1, J2DPicture* i_pic1,
void* i_texBuf2, J2DPicture* i_pic2, void* i_texBuf3, J2DPicture* i_pic3, void* i_texBuf4,
J2DPicture* i_pic4, int param_9);
DUSK_NOINLINE void dMeter2Info_setItemColor(
u8 i_itemNo, J2DPicture* i_pic1, J2DPicture* i_pic2, J2DPicture* i_pic3, J2DPicture* i_pic4);
DUSK_NOINLINE u8 dMeter2Info_getWarpRoomNo();
DUSK_NOINLINE u8 dMeter2Info_getWarpPlayerNo();
DUSK_NOINLINE cXyz& dMeter2Info_getWarpPos();
DUSK_NOINLINE const char* dMeter2Info_getWarpStageName();
DUSK_NOINLINE void dMeter2Info_setNowCount(u8 i_count);
DUSK_NOINLINE void dMeter2Info_setMaxCount(u8 i_count);
DUSK_NOINLINE BOOL dMeter2Info_isDirectUseItem(int param_0);
DUSK_NOINLINE bool dMeter2Info_isUseButton(int i_buttonBit);
DUSK_NOINLINE void dMeter2Info_setMeterMapClass(dMeterMap_c* i_map);
DUSK_NOINLINE void dMeter2Info_decHotSpringTimer();
DUSK_NOINLINE void dMeter2Info_allUseButton();
DUSK_NOINLINE void dMeter2Info_offUseButton(int i_buttonBit);
DUSK_NOINLINE void dMeter2Info_resetGameStatus();
DUSK_NOINLINE void dMeter2Info_onGameStatus(int i_status);
DUSK_NOINLINE void dMeter2Info_setMapStatus(u8 i_status);
DUSK_NOINLINE u8 dMeter2Info_getMapStatus();
DUSK_NOINLINE void dMeter2Info_setPauseStatus(u8 i_status);
DUSK_NOINLINE void dMeter2Info_resetPauseStatus();
DUSK_NOINLINE u8 dMeter2Info_getPauseStatus();
DUSK_NOINLINE bool dMeter2Info_isGameStatus(int i_status);
DUSK_NOINLINE bool dMeter2Info_isTouchKeyCheck(int i_status);
DUSK_NOINLINE void dMeter2Info_setMapKeyDirection(u16 i_direction);
DUSK_NOINLINE bool dMeter2Info_isSub2DStatus(int i_flag);
DUSK_NOINLINE void dMeter2Info_offMenuInForce(int i_flag);
DUSK_NOINLINE bool dMeter2Info_isMenuInForce(int i_flag);
DUSK_NOINLINE void dMeter2Info_setMenuWindowClass(dMw_c* i_menu);
DUSK_NOINLINE void dMeter2Info_resetWarpStatus();
DUSK_NOINLINE u16 dMeter2Info_getMapKeyDirection();
DUSK_NOINLINE u8 dMeter2Info_getWindowStatus();
DUSK_NOINLINE void dMeter2Info_setMsgResource(void* i_res);
DUSK_NOINLINE void dMeter2Info_setStageMsgResource(void* i_res);
DUSK_NOINLINE void dMeter2Info_setMsgUnitResource(void* i_res);
DUSK_NOINLINE void* dMeter2Info_getMsgResource();
DUSK_NOINLINE void* dMeter2Info_getStageMsgResource();
DUSK_NOINLINE void* dMeter2Info_getMsgUnitResource();
DUSK_NOINLINE u8 dMeter2Info_getLightDropGetFlag(int i_no);
DUSK_NOINLINE s32 dMeter2Info_getMeterStringType();
DUSK_NOINLINE void dMeter2Info_setMeterClass(dMeter2_c* i_meter);
DUSK_NOINLINE void dMeter2Info_onLifeGaugeSE();
DUSK_NOINLINE void dMeter2Info_offLifeGaugeSE();
DUSK_NOINLINE u8 dMeter2Info_getLifeGaugeSE();
DUSK_NOINLINE const char* dMeter2Info_getSaveStageName();
DUSK_NOINLINE void dMeter2Info_onShopTalkFlag();
DUSK_NOINLINE void dMeter2Info_setLightDropGetFlag(int i_no, u8 i_flag);
DUSK_NOINLINE u8 dMeter2Info_getRentalBombBag();
DUSK_NOINLINE u8 dMeter2Info_getMiniGameItemSetFlag();
DUSK_NOINLINE void dMeter2Info_setMiniGameItem(u8 i_minigameFlag);
DUSK_NOINLINE void dMeter2Info_resetMiniGameItem(bool i_saveItem);
DUSK_NOINLINE void dMeter2Info_setTableMapRegionNo(u8 i_regionNo);
DUSK_NOINLINE void dMeter2Info_setGoldWolfMapType(u8 i_mapType);
DUSK_NOINLINE void dMeter2Info_changeWater(u8 i_slotNo);
DUSK_NOINLINE void dMeter2Info_warpInProc();
DUSK_NOINLINE void dMeter2Info_warpOutProc();
DUSK_NOINLINE dMeter2_c* dMeter2Info_getMeterClass();
DUSK_NOINLINE s16 dMeter2Info_getMsgKeyWaitTimer();
DUSK_NOINLINE void dMeter2Info_onDirectUseItem(int param_0);
DUSK_NOINLINE void dMeter2Info_setFloatingFlow(u16 i_flowID, s16 i_msgTimer, bool i_wakuVisible);
DUSK_NOINLINE u8 dMeter2Info_getGameOverType();
DUSK_NOINLINE void dMeter2Info_setGameOverType(u8 i_gameoverType);
DUSK_NOINLINE void dMeter2Info_setMsgKeyWaitTimer(s16 i_waitTimer);
DUSK_NOINLINE s32 dMeter2Info_getMsgTimeMs();
DUSK_NOINLINE s32 dMeter2Info_getTimeMs();
DUSK_NOINLINE void dMeter2Info_setMsgTimeMs(s32 i_msgTime);
DUSK_NOINLINE void dMeter2Info_setTimeMs(s32 i_time);
DUSK_NOINLINE u8 dMeter2Info_getNowCount();
DUSK_NOINLINE u8 dMeter2Info_getMaxCount();
DUSK_NOINLINE void dMeter2Info_setScopeZoomPointer(u8 param_0);
DUSK_NOINLINE void dMeter2Info_decMsgKeyWaitTimer();
DUSK_NOINLINE bool dMeter2Info_isFloatingMessageVisible();
DUSK_NOINLINE u8 dMeter2Info_getItemExplainWindowStatus();
DUSK_NOINLINE void dMeter2Info_setItemExplainWindowStatus(u8 i_value);
DUSK_NOINLINE void dMeter2Info_resetDirectUseItem();
DUSK_NOINLINE u16 dMeter2Info_getFloatingFlowID();
DUSK_NOINLINE u8 dMeter2Info_getCollectCursorPosX();
DUSK_NOINLINE u8 dMeter2Info_getCollectCursorPosY();
DUSK_NOINLINE void dMeter2Info_setCollectCursorPosXY(u8 x, u8 y);
DUSK_NOINLINE void dMeter2Info_onBlinkButton(int i_flag);
DUSK_NOINLINE bool dMeter2Info_isFloatingMessageWakuVisible();
DUSK_NOINLINE bool dMeter2Info_isBlinkButton(int i_flag);
DUSK_NOINLINE void dMeter2Info_resetBlinkButton();
DUSK_NOINLINE void dMeter2Info_resetFloatingMessage();
DUSK_NOINLINE s16 dMeter2Info_decFloatingMessageTimer();
DUSK_NOINLINE s16 dMeter2Info_getFloatingMessageTimer();
DUSK_NOINLINE u16 dMeter2Info_getFloatingMessageID();
DUSK_NOINLINE s16 dMeter2Info_getHorseLifeCount();
DUSK_NOINLINE void dMeter2Info_setMeterString(s32 i_string);
DUSK_NOINLINE void dMeter2Info_resetMeterString();
DUSK_NOINLINE void dMeter2Info_setMeterItemPanePtr(int i_no, CPaneMgr* i_pane);
DUSK_NOINLINE bool dMeter2Info_isShopTalkFlag();
DUSK_NOINLINE void dMeter2Info_setMapDrugFlag(bool i_flag);
DUSK_NOINLINE bool dMeter2Info_isTempBit(int i_bit);
DUSK_NOINLINE void dMeter2Info_offSub2DStatus(int i_bit);
DUSK_NOINLINE void dMeter2Info_onSub2DStatus(int i_bit);
DUSK_NOINLINE void dMeter2Info_set2DWidth(f32 i_width);
DUSK_NOINLINE void dMeter2Info_set2DHeight(f32 i_height);
DUSK_NOINLINE void dMeter2Info_set2DPosH(f32 i_posH);
DUSK_NOINLINE void dMeter2Info_set2DPosV(f32 i_posV);
DUSK_NOINLINE void dMeter2Info_offShopTalkFlag();
DUSK_NOINLINE void dMeter2Info_onUseButton(int i_button);
DUSK_NOINLINE f32 dMeter2Info_get2DWidth();
DUSK_NOINLINE f32 dMeter2Info_get2DHeight();
DUSK_NOINLINE void dMeter2Info_setWarpInfo(const char* i_stageName, const cXyz& i_position,
s16 i_angle, u8 i_roomNo, u8 param_4, u8 i_warpPlayerNo);
DUSK_NOINLINE u8 dMeter2Info_getTableMapRegionNo();
DUSK_NOINLINE u8 dMeter2Info_getGoldWolfMapType();
DUSK_NOINLINE bool dMeter2Info_isWindowAccept(int param_0);
DUSK_NOINLINE void dMeter2Info_setHorseLifeCount(s16 i_count);
DUSK_NOINLINE void dMeter2Info_offTempBit(int i_bit);
DUSK_NOINLINE void dMeter2Info_onTempBit(int i_bit);
DUSK_NOINLINE void dMeter2Info_setFloatingMessage(u16 i_msgID, s16 i_msgTimer, bool i_wakuVisible);
DUSK_NOINLINE void dMeter2Info_setMiniGameCount(s8 i_count);
DUSK_NOINLINE void dMeter2Info_onWindowAccept(int param_0);
DUSK_NOINLINE void dMeter2Info_offWindowAccept(int param_0);
DUSK_NOINLINE void dMeter2Info_onMenuInForce(int param_0);
#else
inline void dMeter2Info_Initialize() { inline void dMeter2Info_Initialize() {
g_meter2_info.init(); g_meter2_info.init();
} }
@@ -1009,6 +865,4 @@ inline void dMeter2Info_onMenuInForce(int param_0) {
g_meter2_info.onMenuInForce(param_0); g_meter2_info.onMenuInForce(param_0);
} }
#endif
#endif /* D_METER_D_METER2_INFO_H */ #endif /* D_METER_D_METER2_INFO_H */
+35 -47
View File
@@ -27,22 +27,40 @@ public:
// Attributes // Attributes
/* 0x04 */ BE(u16) message_id; /* 0x04 */ BE(u16) message_id;
/* 0x06 */ BE(u16) event_label_id; // saveBitLabels index set when the message displays /* 0x06 */ BE(u16) event_label_id;
/* 0x08 */ u8 speaker; // Z2SpeechMgr2 voice bank ID /* 0x08 */ u8 se_speaker;
/* 0x09 */ u8 box_kind; // screen class, see dMsgObject_c::talkStartInit /* 0x09 */ u8 fuki_kind;
/* 0x0A */ u8 draw_type; // text pacing, see jmessage_tSequenceProcessor::do_begin /* 0x0A */ u8 output_type;
/* 0x0B */ u8 box_position; // see dMsgObject_c::fukiPosCalc /* 0x0B */ u8 fuki_pos_type;
/* 0x0C */ u8 item_no; // unused; legacy dItemNo, 0xFF = none /* 0x0C */ u8 unk_0xc;
/* 0x0D */ u8 line_alignment; // 0 centered (JP only), 1 left; also copied to /* 0x0D */ u8 unk_0xd;
// jmessage_tReference::mForm /* 0x0E */ u8 se_mood;
/* 0x0E */ u8 speaker_mood; // grunt emotion index for the voice bank /* 0x0F */ u8 camera_id;
/* 0x0F */ u8 camera_attr; // 1-10 talk-actor slot, >=11 talk-camera style /* 0x10 */ u8 base_anm_id;
/* 0x10 */ u8 talk_anim; // NPC talk motion attribute /* 0x11 */ u8 face_anm_id;
/* 0x11 */ u8 face_anim; // NPC talk face attribute /* 0x12 */ BE(u16) unk_0x12;
/* 0x12 */ u8 lines_per_page; // unused; runtime uses getLineMax()
/* 0x13 */ u8 _pad;
}; };
#if TARGET_PC
// Default attributes for custom text ids
static JMSMesgEntry_c defaultJMSMesgEntry{
.string_offset = 0,
.message_id = 0,
.event_label_id = 0,
.se_speaker = 0x24,
.fuki_kind = 0x00,
.output_type = 0x00,
.fuki_pos_type = 0x00,
.unk_0xc = 0xFF,
.unk_0xd = 0x00,
.se_mood = 0x00,
.camera_id = 0x00,
.base_anm_id = 0x02,
.face_anm_id = 0x03,
.unk_0x12 = 0x0400,
};
#endif
class JMSMesgInfo_c { class JMSMesgInfo_c {
public: public:
/* 0x00 */ bmg_section_t header; // section header /* 0x00 */ bmg_section_t header; // section header
@@ -50,6 +68,9 @@ public:
/* 0x0A */ BE(u16) entry_size; // size of an entry /* 0x0A */ BE(u16) entry_size; // size of an entry
/* 0x0C */ u8 padding[4]; // padding /* 0x0C */ u8 padding[4]; // padding
/* 0x10 */ JMSMesgEntry_c entries[0]; /* 0x10 */ JMSMesgEntry_c entries[0];
#if TARGET_PC
JMSMesgEntry_c& getEntry(u16 index);
#endif
}; };
class COutFont_c; class COutFont_c;
@@ -121,25 +142,6 @@ struct jmessage_tReference : public JMessage::TReference {
void setDemoFrame(u32 i_frame) { mDemoFrame = i_frame; } void setDemoFrame(u32 i_frame) { mDemoFrame = i_frame; }
void setTopColorType(u8 i_colorType) { mTopColorType = i_colorType; } void setTopColorType(u8 i_colorType) { mTopColorType = i_colorType; }
void setNowColorType(u8 i_colorType) { mNowColorType = i_colorType; } void setNowColorType(u8 i_colorType) { mNowColorType = i_colorType; }
#if TARGET_PC
void resetColors() {
mNowCCColor = 0xFFFFFFFF;
mNowGCColor = 0xFFFFFFFF;
mTopCCColor = 0xFFFFFFFF;
mTopGCColor = 0xFFFFFFFF;
mNowFullColor = false;
mTopFullColor = false;
}
void setFullColor(u32 ccColor, u32 gcColor) {
mNowCCColor = ccColor;
mNowGCColor = gcColor;
mNowFullColor = true;
}
void clearNowFullColor() { mNowFullColor = false; }
bool hasTopFullColor() { return mTopFullColor; }
u32 getTopCCColor() { return mTopCCColor; }
u32 getTopGCColor() { return mTopGCColor; }
#endif
void setTopTagScale(u16 i_tagScale) { mTopTagScale = i_tagScale; } void setTopTagScale(u16 i_tagScale) { mTopTagScale = i_tagScale; }
void setNowTagScale(u16 i_tagScale) { mNowTagScale = i_tagScale; } void setNowTagScale(u16 i_tagScale) { mNowTagScale = i_tagScale; }
void setRevoMessageID(u32 i_msgID) { mRevoMessageID = i_msgID; } void setRevoMessageID(u32 i_msgID) { mRevoMessageID = i_msgID; }
@@ -384,14 +386,6 @@ struct jmessage_tReference : public JMessage::TReference {
/* 0x1274 */ bool mSelectSetCancelFlag; /* 0x1274 */ bool mSelectSetCancelFlag;
/* 0x1275 */ bool mBombNameUseFlag; /* 0x1275 */ bool mBombNameUseFlag;
/* 0x1276 */ u8 mBatchColorFlag; /* 0x1276 */ u8 mBatchColorFlag;
#if TARGET_PC
u32 mNowCCColor;
u32 mNowGCColor;
u32 mTopCCColor;
u32 mTopGCColor;
bool mNowFullColor;
bool mTopFullColor;
#endif
}; // Size: 0x1278 }; // Size: 0x1278
struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor { struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor {
@@ -489,9 +483,6 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
void do_selwidthcenter(int); void do_selwidthcenter(int);
void do_heightcenter(); void do_heightcenter();
void do_color(u8); void do_color(u8);
#if TARGET_PC
void do_fullcolor(u32 ccColor, u32 gcColor);
#endif
void do_scale(f32); void do_scale(f32);
void do_linedown(s16); void do_linedown(s16);
void do_transY(s16, bool); void do_transY(s16, bool);
@@ -670,9 +661,6 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
void do_rubystrcat(char*); void do_rubystrcat(char*);
void do_outfont(u8); void do_outfont(u8);
void do_color(u8); void do_color(u8);
#if TARGET_PC
void do_fullcolor(u32 ccColor, u32 gcColor);
#endif
void do_scale(f32); void do_scale(f32);
void do_linedown(s16); void do_linedown(s16);
void do_numset(s16); void do_numset(s16);
+29 -4
View File
@@ -22,7 +22,7 @@ struct msg_class;
// all mesg_flow_node structs members might be wrong // all mesg_flow_node structs members might be wrong
struct mesg_flow_node { struct mesg_flow_node {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x01 */ u8 subtype; /* 0x01 */ u8 field_0x1;
/* 0x02 */ BE(u16) msg_index; /* 0x02 */ BE(u16) msg_index;
/* 0x04 */ BE(u16) next_node_idx; /* 0x04 */ BE(u16) next_node_idx;
/* 0x06 */ BE(u16) unk_0x6; /* 0x06 */ BE(u16) unk_0x6;
@@ -30,7 +30,7 @@ struct mesg_flow_node {
struct mesg_flow_node_branch { struct mesg_flow_node_branch {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x01 */ u8 result_count; /* 0x01 */ u8 field_0x1;
/* 0x02 */ BE(u16) query_idx; /* 0x02 */ BE(u16) query_idx;
/* 0x04 */ BE(u16) param; /* 0x04 */ BE(u16) param;
/* 0x06 */ BE(u16) next_node_idx; /* 0x06 */ BE(u16) next_node_idx;
@@ -58,6 +58,9 @@ public:
int checkEventRender(int*, int*, int*, int*); int checkEventRender(int*, int*, int*, int*);
void remove(); void remove();
u16 getEventId(int*); u16 getEventId(int*);
#if TARGET_PC
u16 getEventId();
#endif
u32 getMsgNo(); u32 getMsgNo();
u32 getNowMsgNo(); u32 getNowMsgNo();
msg_class* getMsg(); msg_class* getMsg();
@@ -128,6 +131,11 @@ public:
u16 query051(mesg_flow_node_branch*, fopAc_ac_c*, int); u16 query051(mesg_flow_node_branch*, fopAc_ac_c*, int);
u16 query052(mesg_flow_node_branch*, fopAc_ac_c*, int); u16 query052(mesg_flow_node_branch*, fopAc_ac_c*, int);
u16 query053(mesg_flow_node_branch*, fopAc_ac_c*, int); u16 query053(mesg_flow_node_branch*, fopAc_ac_c*, int);
#if TARGET_PC
u16 query054(mesg_flow_node_branch*, fopAc_ac_c*, int);
u16 query055(mesg_flow_node_branch*, fopAc_ac_c*, int);
u16 query056(mesg_flow_node_branch*, fopAc_ac_c*, int);
#endif
int event000(mesg_flow_node_event*, fopAc_ac_c*); int event000(mesg_flow_node_event*, fopAc_ac_c*);
int event001(mesg_flow_node_event*, fopAc_ac_c*); int event001(mesg_flow_node_event*, fopAc_ac_c*);
int event002(mesg_flow_node_event*, fopAc_ac_c*); int event002(mesg_flow_node_event*, fopAc_ac_c*);
@@ -171,6 +179,14 @@ public:
int event040(mesg_flow_node_event*, fopAc_ac_c*); int event040(mesg_flow_node_event*, fopAc_ac_c*);
int event041(mesg_flow_node_event*, fopAc_ac_c*); int event041(mesg_flow_node_event*, fopAc_ac_c*);
int event042(mesg_flow_node_event*, fopAc_ac_c*); int event042(mesg_flow_node_event*, fopAc_ac_c*);
#if TARGET_PC
// events for rando
int event043(mesg_flow_node_event*, fopAc_ac_c*);
int event044(mesg_flow_node_event*, fopAc_ac_c*);
int event045(mesg_flow_node_event*, fopAc_ac_c*);
int event046(mesg_flow_node_event*, fopAc_ac_c*);
int event047(mesg_flow_node_event*, fopAc_ac_c*);
#endif
void initWord(fopAc_ac_c*, const char*, u8, int, fopAc_ac_c**); void initWord(fopAc_ac_c*, const char*, u8, int, fopAc_ac_c**);
@@ -185,8 +201,17 @@ public:
void setMsg(u32 msg) { mMsg = msg; } void setMsg(u32 msg) { mMsg = msg; }
bool checkEndFlow() { return (u32)field_0x26 == 1; } bool checkEndFlow() { return (u32)field_0x26 == 1; }
static DUSK_GAME_DATA queryFunc mQueryList[53]; static DUSK_GAME_DATA queryFunc mQueryList[DUSK_IF_ELSE(56, 53)];
static DUSK_GAME_DATA eventFunc mEventList[43]; static DUSK_GAME_DATA eventFunc mEventList[DUSK_IF_ELSE(48, 43)];
#if TARGET_PC
// patch funcs for rando
u32 getKeyForIndex(u16 nodeIdx);
void randoPatchNodeType(u8& type, u16 nodeIdx);
void randoPatchMessageNode(mesg_flow_node*& message_node, u16 nodeIdx);
void randoPatchBranchNode(mesg_flow_node_branch*& branch_node, u16 nodeIdx);
void randoPatchEventNode(mesg_flow_node_event*& event_node, u16 nodeIdx);
#endif
private: private:
/* 0x04 */ u8* mFlow_p; /* 0x04 */ u8* mFlow_p;
+2 -2
View File
@@ -280,13 +280,13 @@ public:
/* 0x150 */ f32 field_0x150; /* 0x150 */ f32 field_0x150;
/* 0x154 */ u32 mMessageID; /* 0x154 */ u32 mMessageID;
/* 0x158 */ u32 field_0x158; /* 0x158 */ u32 field_0x158;
/* 0x15C */ u32 mSelectMessageID; // message ID of the selection options message; 1000 = none /* 0x15C */ u32 field_0x15c;
/* 0x160 */ int mIdx; /* 0x160 */ int mIdx;
/* 0x164 */ u16 mNodeIdx; /* 0x164 */ u16 mNodeIdx;
/* 0x166 */ u16 field_0x166; /* 0x166 */ u16 field_0x166;
/* 0x168 */ u16 field_0x168; /* 0x168 */ u16 field_0x168;
/* 0x16A */ s16 field_0x16a; /* 0x16A */ s16 field_0x16a;
/* 0x16C */ s16 mCurrentGroupID; // group whose BMG is parsed; -1 none, 0 common, 1-8 stage /* 0x16C */ s16 field_0x16c;
/* 0x16E */ s16 field_0x16e; /* 0x16E */ s16 field_0x16e;
/* 0x170 */ s16 mNowTalkFlowNo; /* 0x170 */ s16 mNowTalkFlowNo;
/* 0x172 */ s16 field_0x172; /* 0x172 */ s16 field_0x172;
+2 -2
View File
@@ -25,7 +25,7 @@ public:
void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; } void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; }
void resetType() { mType = 0x47; } void resetType() { mType = 0x47; }
// private: private:
/* 0x04 */ J2DTextBox* mpTextBoxPtr; /* 0x04 */ J2DTextBox* mpTextBoxPtr;
/* 0x08 */ f32 mPosX; /* 0x08 */ f32 mPosX;
/* 0x0C */ f32 mPosY; /* 0x0C */ f32 mPosY;
@@ -53,7 +53,7 @@ public:
void setRupeeColor(u8 color) { mRupeeColor = color; } void setRupeeColor(u8 color) { mRupeeColor = color; }
// private: private:
/* 0x004 */ COutFontSet_c* mpOfs[35]; /* 0x004 */ COutFontSet_c* mpOfs[35];
/* 0x090 */ J2DPicture* mpPane[70]; /* 0x090 */ J2DPicture* mpPane[70];
/* 0x1A8 */ f32 mAlphaRatio; /* 0x1A8 */ f32 mAlphaRatio;
+28
View File
@@ -12,6 +12,34 @@ class J2DTextBox;
class JUTFont; class JUTFont;
class STControl; class STControl;
#if TARGET_PC
struct PaneCache {
u64 tag;
f32 origTransX;
f32 origTransY;
bool cached;
};
static PaneCache l_tagName[] = {
{MULTI_CHAR('m_00_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_3'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_01_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_2'), 0.0f, 0.0f, false},
{MULTI_CHAR('m03_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_1'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_05_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_0'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_07_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_4'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_09_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_3'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_10_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_2'), 0.0f, 0.0f, false},
{MULTI_CHAR('m12_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_0'), 0.0f, 0.0f, false},
};
static PaneCache l_nameTagName[] = {
{MULTI_CHAR('name_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_07'), 0.0f, 0.0f, false},
};
static PaneCache l_nameCurTagName[] = {
{MULTI_CHAR('s__n_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_07'), 0.0f, 0.0f, false},
};
#endif
class dNm_HIO_c { class dNm_HIO_c {
public: public:
dNm_HIO_c(); dNm_HIO_c();
+29
View File
@@ -199,6 +199,9 @@ public:
void setTime(f32 i_time) { mTime = i_time; } void setTime(f32 i_time) { mTime = i_time; }
u16 getDate() const { return mDate; } u16 getDate() const { return mDate; }
void setDate(u16 i_date) { mDate = i_date; } void setDate(u16 i_date) { mDate = i_date; }
#if TARGET_PC
u8 getDarkClearLV() const { return mDarkClearLevelFlag; }
#endif
/* 0x00 */ BE(OSTime) mDateIpl; /* 0x00 */ BE(OSTime) mDateIpl;
/* 0x08 */ u8 mTransformLevelFlag; /* 0x08 */ u8 mTransformLevelFlag;
@@ -272,6 +275,9 @@ public:
bool isFieldDataExistFlag() const { return mFieldDataExistFlag ? true : false; } bool isFieldDataExistFlag() const { return mFieldDataExistFlag ? true : false; }
void offFieldDataExistFlag() { mFieldDataExistFlag = false; } void offFieldDataExistFlag() { mFieldDataExistFlag = false; }
void onFieldDataExistFlag() { mFieldDataExistFlag = true; } void onFieldDataExistFlag() { mFieldDataExistFlag = true; }
#if TARGET_PC
void setRegionBit(u8 region) { mRegion |= region;}
#endif
#if TARGET_PC #if TARGET_PC
/* 0x00 */ BE(Vec) mPos; /* 0x00 */ BE(Vec) mPos;
@@ -376,12 +382,21 @@ public:
void setArrowNum(u8 i_num) { mArrowNum = i_num; } void setArrowNum(u8 i_num) { mArrowNum = i_num; }
u8 getPachinkoNum() const { return mPachinkoNum; } u8 getPachinkoNum() const { return mPachinkoNum; }
void setPachinkoNum(u8 i_num) { mPachinkoNum = i_num; } void setPachinkoNum(u8 i_num) { mPachinkoNum = i_num; }
#if TARGET_PC
u8 getAncientDocumentNum() const { return mAncientDocumentNum; }
void setAncientDocumentNum(u8 i_num) { mAncientDocumentNum = i_num; }
#endif
/* 0x0 */ u8 mArrowNum; /* 0x0 */ u8 mArrowNum;
/* 0x1 */ u8 mBombNum[3]; /* 0x1 */ u8 mBombNum[3];
/* 0x4 */ u8 mBottleNum[4]; /* 0x4 */ u8 mBottleNum[4];
/* 0x8 */ u8 mPachinkoNum; /* 0x8 */ u8 mPachinkoNum;
#if TARGET_PC
/* 0x9 */ u8 mAncientDocumentNum; // Custom Field for Randomizer
/* 0x9 */ u8 unk5[2];
#else
/* 0x9 */ u8 unk5[3]; /* 0x9 */ u8 unk5[3];
#endif
}; // Size: 0xC }; // Size: 0xC
class dSv_player_item_max_c { class dSv_player_item_max_c {
@@ -413,7 +428,11 @@ public:
u8 getPohNum() const { return mPohNum; } u8 getPohNum() const { return mPohNum; }
void addPohNum() { void addPohNum() {
#if TARGET_PC
if (mPohNum < 0x3D) {
#else
if (mPohNum < 0xFF) { if (mPohNum < 0xFF) {
#endif
mPohNum++; mPohNum++;
} }
} }
@@ -458,6 +477,11 @@ public:
int isLetterReadFlag(int i_no) const; int isLetterReadFlag(int i_no) const;
u8 getGetNumber(int i_no) { return mGetNumber[i_no]; } u8 getGetNumber(int i_no) { return mGetNumber[i_no]; }
void setGetNumber(int i_no, u8 i_value) { mGetNumber[i_no] = i_value; } void setGetNumber(int i_no, u8 i_value) { mGetNumber[i_no] = i_value; }
#if TARGET_PC
// For rando
void setAllLetterGet() { mLetterGetFlags[0] |= 0xFFFF;}
void setAllLetterRead() { mLetterReadFlags[0] |= 0xFFFF;}
#endif
/* 0x00 */ BE(u32) mLetterGetFlags[2]; /* 0x00 */ BE(u32) mLetterGetFlags[2];
/* 0x08 */ BE(u32) mLetterReadFlags[2]; /* 0x08 */ BE(u32) mLetterReadFlags[2];
@@ -664,10 +688,14 @@ public:
void onDungeonItemBossKey() { onDungeonItem(BOSS_KEY); } void onDungeonItemBossKey() { onDungeonItem(BOSS_KEY); }
void offDungeonItemBossKey() { offDungeonItem(BOSS_KEY); } void offDungeonItemBossKey() { offDungeonItem(BOSS_KEY); }
s32 isDungeonItemBossKey() const { return isDungeonItem(BOSS_KEY); } s32 isDungeonItemBossKey() const { return isDungeonItem(BOSS_KEY); }
#if TARGET_PC
void onStageBossEnemy();
#else
void onStageBossEnemy() { void onStageBossEnemy() {
onDungeonItem(STAGE_BOSS_ENEMY); onDungeonItem(STAGE_BOSS_ENEMY);
onDungeonItem(OOCCOO_NOTE); onDungeonItem(OOCCOO_NOTE);
} }
#endif
void offStageBossEnemy() { offDungeonItem(STAGE_BOSS_ENEMY); } void offStageBossEnemy() { offDungeonItem(STAGE_BOSS_ENEMY); }
s32 isStageBossEnemy() const { return isDungeonItem(STAGE_BOSS_ENEMY); } s32 isStageBossEnemy() const { return isDungeonItem(STAGE_BOSS_ENEMY); }
void onStageLife() { onDungeonItem(STAGE_LIFE); } void onStageLife() { onDungeonItem(STAGE_LIFE); }
@@ -948,6 +976,7 @@ public:
/* 0x8 */ s8 m_no; /* 0x8 */ s8 m_no;
}; };
class dSv_info_c { class dSv_info_c {
public: public:
void init(); void init();
+3 -1
View File
@@ -1291,8 +1291,10 @@ public:
} }
void set(const char*, s8, s16, s8, s8, u8); void set(const char*, s8, s16, s8, s8, u8);
void offEnable() { enabled = 0; } void offEnable() { enabled = 0; }
void onEnable() { enabled = 1; }
BOOL isEnable() const { return enabled; } BOOL isEnable() const { return enabled; }
#if TARGET_PC
void setEnable() { enabled |= 0x1; }
#endif
s8 getWipe() const { return wipe; } s8 getWipe() const { return wipe; }
u8 getWipeSpeed() const { return wipe_speed; } u8 getWipeSpeed() const { return wipe_speed; }
dStage_startStage_c* getStartStage() { return this; } dStage_startStage_c* getStartStage() { return this; }
-5
View File
@@ -318,11 +318,6 @@ public:
/* 0x566 */ s8 field_0x566; /* 0x566 */ s8 field_0x566;
/* 0x567 */ s8 field_0x567; /* 0x567 */ s8 field_0x567;
#if TARGET_PC
u32 mItemGiveTag;
u8 mItemGiveOriginalNo;
#endif
#if !__MWERKS__ #if !__MWERKS__
s8 actor_last_base_field; s8 actor_last_base_field;
#endif #endif
+13 -22
View File
@@ -79,10 +79,6 @@ struct fopAcM_prm_class {
/* 0x1C */ fpc_ProcID parent_id; /* 0x1C */ fpc_ProcID parent_id;
/* 0x20 */ s8 argument; /* 0x20 */ s8 argument;
/* 0x21 */ s8 room_no; /* 0x21 */ s8 room_no;
#if TARGET_PC
u32 mItemGiveTag;
u8 mItemGiveOriginalNo;
#endif
}; };
struct fopAcM_search4ev_prm { struct fopAcM_search4ev_prm {
@@ -520,9 +516,8 @@ s32 fopAcM_SearchByName(s16 i_procName, fopAc_ac_c** i_outActor);
fopAcM_prm_class* fopAcM_CreateAppend(); fopAcM_prm_class* fopAcM_CreateAppend();
fopAcM_prm_class* createAppend(u16 i_setId, u32 i_parameters, const cXyz* i_pos, int i_roomNo, fopAcM_prm_class* createAppend(u16 i_setId, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
fpc_ProcID i_parentId IF_DUSK_ARG(u32 i_itemGiveTag = 0) fpc_ProcID i_parentId);
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
void fopAcM_Log(fopAc_ac_c const* i_actor, char const* i_message); void fopAcM_Log(fopAc_ac_c const* i_actor, char const* i_message);
@@ -531,22 +526,19 @@ s32 fopAcM_delete(fopAc_ac_c* i_actor);
s32 fopAcM_delete(fpc_ProcID i_actorID); s32 fopAcM_delete(fpc_ProcID i_actorID);
fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cXyz* i_pos, fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cXyz* i_pos,
int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
createFunc i_createFunc IF_DUSK_ARG(u32 i_itemGiveTag = 0) createFunc i_createFunc);
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo, fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument IF_DUSK_ARG(u32 i_itemGiveTag = 0) const csXyz* i_angle, const cXyz* i_scale, s8 i_argument);
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* params) { inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* params) {
return fpcM_Create(i_procName, i_createFunc,params); return fpcM_Create(i_procName, i_createFunc,params);
} }
fopAc_ac_c* fopAcM_fastCreate(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo, fopAc_ac_c* fopAcM_fastCreate(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, createFunc i_createFunc, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
void* i_createFuncData IF_DUSK_ARG(u32 i_itemGiveTag = 0) createFunc i_createFunc, void* i_createFuncData);
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
fopAc_ac_c* fopAcM_fastCreate(const char* i_actorname, u32 i_parameters, const cXyz* i_pos, fopAc_ac_c* fopAcM_fastCreate(const char* i_actorname, u32 i_parameters, const cXyz* i_pos,
int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, int i_roomNo, const csXyz* i_angle, const cXyz* i_scale,
@@ -631,11 +623,11 @@ fopAc_ac_c* fopAcM_getItemEventPartner(const fopAc_ac_c*);
fopAc_ac_c* fopAcM_getEventPartner(const fopAc_ac_c*); fopAc_ac_c* fopAcM_getEventPartner(const fopAc_ac_c*);
fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 param_2, fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 param_2,
int i_itemBitNo, int i_roomNo, csXyz const* i_angle, int i_itemBitNo, int i_roomNo, csXyz const* i_angle,
cXyz const* i_scale IF_DUSK_ARG(u32 i_itemGiveTag = 0)); cXyz const* i_scale);
fpc_ProcID fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_itemBitNo, fpc_ProcID fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_itemBitNo,
int i_roomNo, csXyz const* i_angle, cXyz const* i_scale IF_DUSK_ARG(u32 i_itemGiveTag = 0)); int i_roomNo, csXyz const* i_angle, cXyz const* i_scale);
u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo); u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo);
@@ -649,12 +641,11 @@ fpc_ProcID fopAcM_createItemFromTable(cXyz const* i_pos, int i_tableNo, int i_it
bool i_createDirect); bool i_createDirect);
fpc_ProcID fopAcM_createDemoItem(const cXyz* i_pos, int i_itemNo, int i_itemBitNo, fpc_ProcID fopAcM_createDemoItem(const cXyz* i_pos, int i_itemNo, int i_itemBitNo,
const csXyz* i_angle, int i_roomNo, const cXyz* scale, const csXyz* i_angle, int i_roomNo, const cXyz* scale, u8 param_7);
u8 param_7 IF_DUSK_ARG(u32 i_itemGiveTag = 0));
fpc_ProcID fopAcM_createItemForBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo, fpc_ProcID fopAcM_createItemForBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF, f32 i_speedY, const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF,
int param_8 IF_DUSK_ARG(const char* i_itemCheckName = NULL)); f32 i_speedY, int param_8);
fpc_ProcID fopAcM_createItemForMidBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo, fpc_ProcID fopAcM_createItemForMidBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, int param_6, const csXyz* i_angle, const cXyz* i_scale, int param_6,
+1 -1
View File
@@ -30,7 +30,7 @@ struct msg_class {
/* 0xDC */ fopAc_ac_c* talk_actor; /* 0xDC */ fopAc_ac_c* talk_actor;
/* 0xE0 */ cXyz pos; /* 0xE0 */ cXyz pos;
/* 0xEC */ u32 msg_idx; /* 0xEC */ u32 msg_idx;
/* 0xF0 */ u32 select_msg_idx; // selection options message ID; 1000 = none /* 0xF0 */ u32 field_0xf0;
/* 0xF4 */ u32 field_0xf4; /* 0xF4 */ u32 field_0xf4;
/* 0xF8 */ u16 mode; /* 0xF8 */ u16 mode;
/* 0xFA */ u8 select_idx; /* 0xFA */ u8 select_idx;
+3 -3
View File
@@ -19,7 +19,7 @@ struct fopMsg_prm_class {
/* 0x00 */ fopAc_ac_c* talk_actor; /* 0x00 */ fopAc_ac_c* talk_actor;
/* 0x04 */ cXyz pos; /* 0x04 */ cXyz pos;
/* 0x10 */ u32 msg_idx; /* 0x10 */ u32 msg_idx;
/* 0x14 */ u32 select_msg_idx; // selection options message ID; 1000 = none /* 0x14 */ u32 field_0x14;
/* 0x18 */ fpc_ProcID field_0x18; /* 0x18 */ fpc_ProcID field_0x18;
}; // Size: 0x1C }; // Size: 0x1C
@@ -46,8 +46,8 @@ void fopMsgM_setMessageID(fpc_ProcID msg_id);
void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap); void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap);
f32 fopMsgM_valueIncrease(int param_0, int param_1, u8 i_type); f32 fopMsgM_valueIncrease(int param_0, int param_1, u8 i_type);
s32 fopMsgM_setStageLayer(void* i_process); s32 fopMsgM_setStageLayer(void* i_process);
fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_talkActor, u32 i_selectMsgIdx); fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_talkActor, u32 param_2);
fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, u32 i_selectMsgIdx); fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, u32 param_1);
fpc_ProcID fopMsgM_messageSetDemo(u32 i_msgidx); fpc_ProcID fopMsgM_messageSetDemo(u32 i_msgidx);
msg_class* fopMsgM_SearchByID(fpc_ProcID i_id); msg_class* fopMsgM_SearchByID(fpc_ProcID i_id);
TEXT_SPAN fopMsgM_messageGet(TEXT_SPAN i_stringBuf, u32 i_msgId); TEXT_SPAN fopMsgM_messageGet(TEXT_SPAN i_stringBuf, u32 i_msgId);
-27
View File
@@ -123,14 +123,6 @@ inline int __builtin_clz(unsigned int v) {
#endif #endif
#define DUSK_GAME_EXTERN extern DUSK_GAME_DATA #define DUSK_GAME_EXTERN extern DUSK_GAME_DATA
#if defined(_MSC_VER)
#define DUSK_NOINLINE __declspec(noinline)
#elif defined(__GNUC__)
#define DUSK_NOINLINE __attribute__((noinline))
#else
#define DUSK_NOINLINE
#endif
#define FAST_DIV(x, n) (x >> (n / 2)) #define FAST_DIV(x, n) (x >> (n / 2))
#define SQUARE(x) ((x) * (x)) #define SQUARE(x) ((x) * (x))
@@ -264,23 +256,4 @@ using std::isnan;
#define DUSK_CONST IF_DUSK(const) #define DUSK_CONST IF_DUSK(const)
#define DUSK_CONSTEXPR IF_DUSK(constexpr) #define DUSK_CONSTEXPR IF_DUSK(constexpr)
#if TARGET_PC && defined(DUSK_BUILDING_GAME)
#include "dusk/mods/item.hpp"
#define DUSK_ITEM_CHECK(name, item_no, giver) \
(item_no) = ::dusk::mods::item_check_commit(name, (item_no), giver).itemNo
#define DUSK_ITEM_CHECK_EXPR(name, item_no, giver) \
(::dusk::mods::item_check_commit(name, (item_no), giver).itemNo)
#define DUSK_ITEM_CHECK_PREVIEW(name, item_no, giver) \
(item_no) = ::dusk::mods::item_check(name, (item_no), giver)
#define DUSK_ITEM_CHECK_PREVIEW_EXPR(name, item_no, giver) \
(::dusk::mods::item_check(name, (item_no), giver))
#define DUSK_GIVE_TAG(name) IF_DUSK_ARG(::dusk::mods::item_give_tag(name))
#else
#define DUSK_ITEM_CHECK(name, item_no, giver)
#define DUSK_ITEM_CHECK_EXPR(name, item_no, giver) (item_no)
#define DUSK_ITEM_CHECK_PREVIEW(name, item_no, giver)
#define DUSK_ITEM_CHECK_PREVIEW_EXPR(name, item_no, giver) (item_no)
#define DUSK_GIVE_TAG(name)
#endif
#endif #endif
-178
View File
@@ -1,178 +0,0 @@
#pragma once
#include <bit>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <type_traits>
namespace dusk {
namespace detail {
template <size_t Size>
struct uint_of_size;
template <>
struct uint_of_size<1> {
using type = uint8_t;
};
template <>
struct uint_of_size<2> {
using type = uint16_t;
};
template <>
struct uint_of_size<4> {
using type = uint32_t;
};
template <>
struct uint_of_size<8> {
using type = uint64_t;
};
template <size_t Size>
using uint_of_size_t = uint_of_size<Size>::type;
template <typename T>
requires(std::is_trivially_copyable_v<T>)
T unaligned_load(const void* source) noexcept {
T value;
std::memcpy(&value, source, sizeof(value));
return value;
}
template <typename T>
requires(std::is_trivially_copyable_v<T>)
void unaligned_store(void* destination, T value) noexcept {
std::memcpy(destination, &value, sizeof(value));
}
} // namespace detail
template <typename T>
requires(std::is_unsigned_v<T>)
constexpr T bswap(T value) noexcept {
if constexpr (sizeof(T) == 1) {
return value;
} else if constexpr (sizeof(T) == 2) {
return static_cast<T>((value << 8) | (value >> 8));
} else if constexpr (sizeof(T) == 4) {
return static_cast<T>(((value & 0x000000ffU) << 24) | ((value & 0x0000ff00U) << 8) |
((value & 0x00ff0000U) >> 8) | ((value & 0xff000000U) >> 24));
} else {
static_assert(sizeof(T) == 8);
return static_cast<T>(
((value & 0x00000000000000ffULL) << 56) | ((value & 0x000000000000ff00ULL) << 40) |
((value & 0x0000000000ff0000ULL) << 24) | ((value & 0x00000000ff000000ULL) << 8) |
((value & 0x000000ff00000000ULL) >> 8) | ((value & 0x0000ff0000000000ULL) >> 24) |
((value & 0x00ff000000000000ULL) >> 40) | ((value & 0xff00000000000000ULL) >> 56));
}
}
/// Reads an unaligned integral value in the specified byte order.
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
T read_bits(const void* source, std::endian endian = std::endian::big) noexcept {
using Bits = std::make_unsigned_t<T>;
Bits value = detail::unaligned_load<Bits>(source);
if constexpr (sizeof(Bits) > 1) {
if (endian != std::endian::native) {
value = bswap(value);
}
}
return std::bit_cast<T>(value);
}
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
constexpr T read_bits(const uint8_t* source, std::endian endian = std::endian::big) noexcept {
if (!std::is_constant_evaluated()) {
return read_bits<T>(static_cast<const void*>(source), endian);
}
using Bits = std::make_unsigned_t<T>;
Bits value{};
if (endian == std::endian::big) {
for (size_t i = 0; i < sizeof(Bits); ++i) {
value = static_cast<Bits>((value << 8) | source[i]);
}
} else {
for (size_t i = 0; i < sizeof(Bits); ++i) {
value |= static_cast<Bits>(source[i]) << (i * 8);
}
}
return std::bit_cast<T>(value);
}
/// Reads an unaligned floating-point value in the specified byte order.
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
T read_bits(const void* source, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
return std::bit_cast<T>(read_bits<Bits>(source, endian));
}
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
constexpr T read_bits(const uint8_t* source, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
return std::bit_cast<T>(read_bits<Bits>(source, endian));
}
/// Writes an unaligned integral value in the specified byte order.
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
void write_bits(void* destination, T value, std::endian endian = std::endian::big) noexcept {
using Bits = std::make_unsigned_t<T>;
Bits bits = std::bit_cast<Bits>(value);
if constexpr (sizeof(Bits) > 1) {
if (endian != std::endian::native) {
bits = bswap(bits);
}
}
detail::unaligned_store(destination, bits);
}
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
constexpr void write_bits(
uint8_t* destination, T value, std::endian endian = std::endian::big) noexcept {
if (!std::is_constant_evaluated()) {
write_bits(static_cast<void*>(destination), value, endian);
return;
}
using Bits = std::make_unsigned_t<T>;
const Bits bits = std::bit_cast<Bits>(value);
if (endian == std::endian::big) {
for (size_t i = 0; i < sizeof(Bits); ++i) {
destination[sizeof(Bits) - i - 1] = static_cast<uint8_t>(bits >> (i * 8));
}
} else {
for (size_t i = 0; i < sizeof(Bits); ++i) {
destination[i] = static_cast<uint8_t>(bits >> (i * 8));
}
}
}
/// Writes an unaligned floating-point value in the specified byte order.
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
void write_bits(void* destination, T value, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
write_bits(destination, std::bit_cast<Bits>(value), endian);
}
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
constexpr void write_bits(
uint8_t* destination, T value, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
write_bits(destination, std::bit_cast<Bits>(value), endian);
}
} // namespace dusk
-20
View File
@@ -112,11 +112,6 @@ public:
mSerialNo = serial_no; mSerialNo = serial_no;
} }
#ifdef TARGET_PC
void setFileName(const std::string& fileName);
const char* getFileName();
#endif
/* 0x0000 */ u8 mData[SAVEFILE_SIZE]; /* 0x0000 */ u8 mData[SAVEFILE_SIZE];
/* 0x1FBC */ u8 mChannel; /* 0x1FBC */ u8 mChannel;
/* 0x1FBD */ u8 mCopyToPos; /* 0x1FBD */ u8 mCopyToPos;
@@ -129,11 +124,6 @@ public:
/* 0x1FEC */ s32 mNandState; /* 0x1FEC */ s32 mNandState;
/* 0x1FF0 */ u64 mSerialNo; /* 0x1FF0 */ u64 mSerialNo;
/* 0x1FF8 */ u32 mDataVersion; /* 0x1FF8 */ u32 mDataVersion;
#ifdef TARGET_PC
bool mInitialized;
std::string mFileName;
#endif
}; // Size: 0x2000 }; // Size: 0x2000
STATIC_ASSERT(sizeof(mDoMemCd_Ctrl_c) == 8192); STATIC_ASSERT(sizeof(mDoMemCd_Ctrl_c) == 8192);
@@ -240,14 +230,4 @@ inline s32 mDoMemCd_checkNANDFile() {
} }
#endif #endif
#ifdef TARGET_PC
inline void mDoMemCd_SetFileName(const std::string& fileName) {
g_mDoMemCd_control.setFileName(fileName);
}
inline const char* mDoMemCd_GetFileName() {
return g_mDoMemCd_control.getFileName();
}
#endif
#endif /* M_DO_M_DO_MEMCARD_H */ #endif /* M_DO_M_DO_MEMCARD_H */
+3
View File
@@ -394,4 +394,7 @@ inline int mDoAud_monsSeStart(u32 i_soundId, const Vec* i_pos, u32 i_actorId, u3
0); 0);
} }
#if TARGET_PC
mDoAud_zelAudio_c& mDoAud_getZelAudio();
#endif
#endif /* M_DO_M_DO_AUDIO_H */ #endif /* M_DO_M_DO_AUDIO_H */
+7 -3
View File
@@ -67,8 +67,12 @@ public:
JKRMemArchive* getArchive() const { return mArchive; } JKRMemArchive* getArchive() const { return mArchive; }
JKRHeap* getHeap() const { return mHeap; } JKRHeap* getHeap() const { return mHeap; }
#if TARGET_PC
s32 getEntryNumber() const { return mEntryNumber; }
#endif
// private:
private:
/* 0x14 */ u8 mMountDirection; /* 0x14 */ u8 mMountDirection;
/* 0x18 */ s32 mEntryNumber; /* 0x18 */ s32 mEntryNumber;
/* 0x1C */ JKRMemArchive* mArchive; /* 0x1C */ JKRMemArchive* mArchive;
@@ -130,8 +134,8 @@ private:
}; // Size = 0x28 }; // Size = 0x28
struct mDoDvdThdStack { struct mDoDvdThdStack {
ATTRIBUTE_ALIGN(16) u8 stack[4096]; u8 stack[4096];
}; } ATTRIBUTE_ALIGN(16);
struct mDoDvdThd { struct mDoDvdThd {
static s32 main(void*); static s32 main(void*);
@@ -154,6 +154,18 @@ public:
return (J2DTextBoxHBinding)((mFlags >> 2) & 3); return (J2DTextBoxHBinding)((mFlags >> 2) & 3);
} }
#if TARGET_PC
void setVBinding(J2DTextBoxVBinding vBinding) {
mFlags &= 0b1100;
mFlags |= (vBinding & 3);
}
void setHBinding(J2DTextBoxHBinding hBinding) {
mFlags &= 0b0011;
mFlags |= ((hBinding & 3) << 2);
}
#endif
JUtility::TColor getCharColor() { return mCharColor; } JUtility::TColor getCharColor() { return mCharColor; }
JUtility::TColor getGradColor() { return mGradientColor; } JUtility::TColor getGradColor() { return mGradientColor; }
u16 getStringAllocByte() const { return mStringLength; } u16 getStringAllocByte() const { return mStringLength; }
@@ -9,7 +9,6 @@
class J3DModelData; class J3DModelData;
class J3DMaterialTable; class J3DMaterialTable;
struct J3DModelHierarchy; struct J3DModelHierarchy;
class J3DVertexData;
#if TARGET_PC #if TARGET_PC
#define OFFSET_PTR_V0 BE(u32) #define OFFSET_PTR_V0 BE(u32)
@@ -6,17 +6,11 @@
#include "global.h" #include "global.h"
#include "helpers/endian.h" #include "helpers/endian.h"
#if TARGET_PC
#include <atomic>
#include <string>
#include <unordered_map>
#endif
class JKRHeap; class JKRHeap;
/** /**
* @ingroup jsystem-jkernel * @ingroup jsystem-jkernel
* *
*/ */
struct SArcHeader { struct SArcHeader {
/* 0x00 */ BE(u32) signature; /* 0x00 */ BE(u32) signature;
@@ -31,7 +25,7 @@ struct SArcHeader {
/** /**
* @ingroup jsystem-jkernel * @ingroup jsystem-jkernel
* *
*/ */
struct SArcDataInfo { struct SArcDataInfo {
/* 0x00 */ BE(u32) num_nodes; /* 0x00 */ BE(u32) num_nodes;
@@ -65,7 +59,7 @@ extern u32 sCurrentDirID__10JKRArchive; // JKRArchive::sCurrentDirID
/** /**
* @ingroup jsystem-jkernel * @ingroup jsystem-jkernel
* *
*/ */
class JKRArchive : public JKRFileLoader { class JKRArchive : public JKRFileLoader {
public: public:
@@ -198,7 +192,9 @@ public:
u32 countFile() const { return mArcInfoBlock->num_file_entries; } u32 countFile() const { return mArcInfoBlock->num_file_entries; }
s32 countDirectory() const { return mArcInfoBlock->num_nodes; } s32 countDirectory() const { return mArcInfoBlock->num_nodes; }
u8 getMountMode() const { return mMountMode; } u8 getMountMode() const { return mMountMode; }
bool isFileEntry(u32 param_0) const { return getFileAttribute(param_0) & 1; } bool isFileEntry(u32 param_0) const {
return getFileAttribute(param_0) & 1;
}
public: public:
/* 0x00 */ // vtable /* 0x00 */ // vtable
@@ -214,36 +210,7 @@ public:
/* 0x54 */ const char* mStringTable; /* 0x54 */ const char* mStringTable;
#if TARGET_PC #if TARGET_PC
u32 getFileSize(SDIFileEntry* entry) const;
void* getOverlayData(SDIFileEntry* entry, u32* outSize);
bool getOverlayFileSize(SDIFileEntry* entry, u32* outSize) const;
static void notifyOverlayFilesChanged();
protected:
void** mFileData; void** mFileData;
struct ArcOverlayResource {
u32 entryIndex;
u32 size;
u64 generation;
};
// Resource pointers remain valid until removed through the JKR resource APIs.
// That way, any pointers to old overlay data remain valid even when the overlay changed.
std::unordered_map<void*, ArcOverlayResource> mArcOverlayResources;
mutable std::unordered_map<u32, void*> mActiveArcOverlayResources;
mutable std::string mArcOverlaysPath;
mutable std::unordered_map<u32, std::string> mIdxToPathMap;
mutable bool mArcOverlaysPathResolved = false;
bool buildArcOverlaysPath() const;
void buildIndexToPathMap(u32 dirIndex, const std::string& currentPath) const;
bool getOverlayPath(SDIFileEntry* entry, std::string& path) const;
void* getActiveOverlayData(SDIFileEntry* entry, u32* outSize) const;
bool copyOverlayData(void* buffer, u32 bufferSize, SDIFileEntry* entry, u32* outSize);
bool getOverlayResourceSize(const void* data, u32* outSize) const;
bool removeOverlayResource(void* resource, bool freeResource);
void removeAllOverlayResources();
#endif #endif
protected: protected:
@@ -267,7 +234,7 @@ public:
} else if (attr & JKRARCHIVE_ATTR_YAZ0) { } else if (attr & JKRARCHIVE_ATTR_YAZ0) {
return COMPRESSION_YAZ0; return COMPRESSION_YAZ0;
} else { } else {
return COMPRESSION_YAY0; return COMPRESSION_YAY0;
} }
} }
@@ -276,9 +243,6 @@ public:
protected: protected:
static DUSK_GAME_DATA u32 sCurrentDirID; static DUSK_GAME_DATA u32 sCurrentDirID;
#if TARGET_PC
static std::atomic<u64> sArcOverlayGeneration;
#endif
}; };
inline JKRCompression JKRConvertAttrToCompressionType(int attr) { inline JKRCompression JKRConvertAttrToCompressionType(int attr) {
@@ -297,8 +261,8 @@ inline bool JKRRemoveResource(void* resource, JKRFileLoader* fileLoader) {
return JKRFileLoader::removeResource(resource, fileLoader); return JKRFileLoader::removeResource(resource, fileLoader);
} }
inline JKRArchive* JKRMountArchive( inline JKRArchive* JKRMountArchive(void* ptr, JKRHeap* heap,
void* ptr, JKRHeap* heap, JKRArchive::EMountDirection mountDirection) { JKRArchive::EMountDirection mountDirection) {
return JKRArchive::mount(ptr, heap, mountDirection); return JKRArchive::mount(ptr, heap, mountDirection);
} }
@@ -7,7 +7,6 @@
#include <new> #include <new>
#include <utility> #include <utility>
#include <cstdint> #include <cstdint>
#include <type_traits>
class JKRHeap; class JKRHeap;
typedef void (*JKRErrorHandler)(void*, u32, int); typedef void (*JKRErrorHandler)(void*, u32, int);
@@ -174,14 +174,10 @@ struct TProcessor {
} }
void on_character(int iCharacter) { do_character(iCharacter); } void on_character(int iCharacter) { do_character(iCharacter); }
#if TARGET_PC
const char* on_message_limited(u16 u16Index) const;
#else
const char* on_message_limited(u16 u16Index) const { const char* on_message_limited(u16 u16Index) const {
JUT_ASSERT(482, pResourceCache_!=NULL); JUT_ASSERT(482, pResourceCache_!=NULL);
return pResourceCache_->getMessageText_messageIndex(u16Index); return pResourceCache_->getMessageText_messageIndex(u16Index);
} }
#endif
bool on_setBegin_isReady_() const { return do_setBegin_isReady_(); } bool on_setBegin_isReady_() const { return do_setBegin_isReady_(); }
@@ -199,10 +195,6 @@ struct TProcessor {
return 1; return 1;
} }
#if TARGET_PC
void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const;
const char* getMessageText_messageCode(u16 u16Code, u16 u16Index) const;
#else
void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const { void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const {
const TResource* pResource = getResource_groupID(u16Code); const TResource* pResource = getResource_groupID(u16Code);
@@ -222,7 +214,6 @@ struct TProcessor {
return pResourceCache_->getMessageText_messageEntry(pEntry); return pResourceCache_->getMessageText_messageEntry(pEntry);
} }
#endif
void stack_pushCurrent_(const char* pszText) { void stack_pushCurrent_(const char* pszText) {
oStack_.push(getCurrent()); oStack_.push(getCurrent());
+2 -2
View File
@@ -23,9 +23,9 @@ DUSK_GAME_DATA Vec J3DSys::mParentS;
DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8]; DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8];
#if TARGET_PC // Original game bug, array is too small. #if TARGET_PC // Original game bug, array is too small.
ATTRIBUTE_ALIGN(32) static u8 NullTexData[0x20] = {0}; static u8 NullTexData[0x20] ATTRIBUTE_ALIGN(32) = {0};
#else #else
ATTRIBUTE_ALIGN(32) static u8 NullTexData[0x10] = {0}; static u8 NullTexData[0x10] ATTRIBUTE_ALIGN(32) = {0};
#endif #endif
static Mtx j3dIdentityMtx = { static Mtx j3dIdentityMtx = {
+2 -2
View File
@@ -99,14 +99,14 @@ void JASDsp::invalChannelAll() {
DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS); DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
} }
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u8 const JASDsp::DSPADPCM_FILTER[64] = { DUSK_GAME_DATA u8 const ATTRIBUTE_ALIGN(32) JASDsp::DSPADPCM_FILTER[64] = {
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x04, 0x00,
0x10, 0x00, 0xF8, 0x00, 0x0E, 0x00, 0xFA, 0x00, 0x0C, 0x00, 0xFC, 0x00, 0x12, 0x00, 0xF6, 0x00, 0x10, 0x00, 0xF8, 0x00, 0x0E, 0x00, 0xFA, 0x00, 0x0C, 0x00, 0xFC, 0x00, 0x12, 0x00, 0xF6, 0x00,
0x10, 0x68, 0xF7, 0x38, 0x12, 0xC0, 0xF7, 0x04, 0x14, 0x00, 0xF4, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x10, 0x68, 0xF7, 0x38, 0x12, 0xC0, 0xF7, 0x04, 0x14, 0x00, 0xF4, 0x00, 0x08, 0x00, 0xF8, 0x00,
0x04, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x04, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0x04, 0x00, 0xFC, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00,
}; };
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u32 const JASDsp::DSPRES_FILTER[320] = { DUSK_GAME_DATA u32 const ATTRIBUTE_ALIGN(32) JASDsp::DSPRES_FILTER[320] = {
0x0C3966AD, 0x0C3966AD,
0x0D46FFDF, 0x0D46FFDF,
0x0B396696, 0x0B396696,
+1 -8
View File
@@ -17,7 +17,7 @@ size_t JASResArcLoader::getResSize(JKRArchive const* i_archiveP, u16 i_resourceI
return 0; return 0;
} }
return DUSK_IF_ELSE(i_archiveP->getFileSize(file), file->data_size); return file->data_size;
} }
size_t JASResArcLoader::getResMaxSize(JKRArchive const* i_archiveP) { size_t JASResArcLoader::getResMaxSize(JKRArchive const* i_archiveP) {
@@ -27,16 +27,9 @@ size_t JASResArcLoader::getResMaxSize(JKRArchive const* i_archiveP) {
for (index = 0; index < fileEntries; index++) { for (index = 0; index < fileEntries; index++) {
JKRArchive::SDIFileEntry* file = i_archiveP->findIdxResource(index); JKRArchive::SDIFileEntry* file = i_archiveP->findIdxResource(index);
if (file) { if (file) {
#if TARGET_PC
const u32 fileSize = i_archiveP->getFileSize(file);
if (maxSize < fileSize) {
maxSize = fileSize;
}
#else
if (maxSize < file->data_size) { if (maxSize < file->data_size) {
maxSize = file->data_size; maxSize = file->data_size;
} }
#endif
} }
} }
+3 -3
View File
@@ -25,7 +25,7 @@ void DspHandShake(void*) {
Dsp_Running_Start(); Dsp_Running_Start();
} }
ATTRIBUTE_ALIGN(32) static u8 jdsp[7936] = { static u8 jdsp[7936] ATTRIBUTE_ALIGN(32) = {
0x02, 0x9F, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0x9F, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00,
0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0x9F, 0x06, 0xA5, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0xFF, 0x00, 0x00, 0x02, 0x9F, 0x06, 0xA5,
0x02, 0x9F, 0x00, 0x4E, 0x12, 0x05, 0x02, 0xBF, 0x00, 0x57, 0x81, 0x00, 0x00, 0x9F, 0x10, 0x00, 0x02, 0x9F, 0x00, 0x4E, 0x12, 0x05, 0x02, 0xBF, 0x00, 0x57, 0x81, 0x00, 0x00, 0x9F, 0x10, 0x00,
@@ -524,9 +524,9 @@ ATTRIBUTE_ALIGN(32) static u8 jdsp[7936] = {
0x80, 0x01, 0x02, 0xBF, 0x00, 0xF4, 0x02, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x02, 0xBF, 0x00, 0xF4, 0x02, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}; };
ATTRIBUTE_ALIGN(32) static DSPTaskInfo audio_task; static DSPTaskInfo audio_task ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 AUDIO_YIELD_BUFFER[8192]; static u8 AUDIO_YIELD_BUFFER[8192] ATTRIBUTE_ALIGN(32);
void DspBoot(void (*requestCallback)(void*)) { void DspBoot(void (*requestCallback)(void*)) {
DspInitWork(); DspInitWork();
+14 -9
View File
@@ -38,7 +38,7 @@ void JFWDisplay::ctor_subroutine(bool enableAlpha) {
mTickRate = 0; mTickRate = 0;
mCombinationRatio = 0.0f; mCombinationRatio = 0.0f;
field_0x30 = 0; field_0x30 = 0;
field_0x2c = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick()); field_0x2c = OSGetTick();
field_0x34 = 0; field_0x34 = 0;
field_0x48 = 0; field_0x48 = 0;
field_0x4a = 0; field_0x4a = 0;
@@ -258,7 +258,7 @@ void JFWDisplay::beginRender() {
waitForTick(mTickRate, mFrameRate); waitForTick(mTickRate, mFrameRate);
JUTVideo::getManager()->waitRetraceIfNeed(); JUTVideo::getManager()->waitRetraceIfNeed();
OSTick tick = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick()); OSTick tick = OSGetTick();
field_0x30 = tick - field_0x2c; field_0x30 = tick - field_0x2c;
field_0x2c = tick; field_0x2c = tick;
field_0x34 = field_0x2c - JUTVideo::getVideoLastTick(); field_0x34 = field_0x2c - JUTVideo::getVideoLastTick();
@@ -371,7 +371,7 @@ constexpr auto FRAME_PERIOD = std::chrono::duration_cast<std::chrono::nanosecond
constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2; constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2;
static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) { static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) {
const auto sleepTime = limiter.Sleep(targetNs); const auto sleepTime = limiter.Sleep(targetNs);
dusk::frameUsagePct = dusk::frameUsagePct =
100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs)); 100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs));
} }
@@ -381,12 +381,15 @@ static void waitForTick(u32 p1, u16 p2) {
#if TARGET_PC #if TARGET_PC
static Limiter limiter; static Limiter limiter;
if (dusk::frame_interp::is_enabled() || dusk::getTransientSettings().turboMode) { if (dusk::frame_interp::is_enabled() && !dusk::getTransientSettings().skipFrameRateLimit) {
limiter.Reset(); dusk::frameUsagePct = 0.f;
dusk::frameUsagePct = 0.f; return;
return;
} }
if (dusk::getTransientSettings().skipFrameRateLimit) {
p1 = OS_TIMER_CLOCK / 120;
}
if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) { if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) {
return; return;
} }
@@ -396,6 +399,7 @@ static void waitForTick(u32 p1, u16 p2) {
if (p1 != 0) { if (p1 != 0) {
#if TARGET_PC #if TARGET_PC
static Limiter limiter;
waitPrecise(limiter, static_cast<Uint64>(OSTicksToMicroseconds(p1)) * 1000ULL); waitPrecise(limiter, static_cast<Uint64>(OSTicksToMicroseconds(p1)) * 1000ULL);
#else #else
static OSTime nextTick = OSGetTime(); static OSTime nextTick = OSGetTime();
@@ -409,6 +413,7 @@ static void waitForTick(u32 p1, u16 p2) {
} else { } else {
u32 uVar1 = (p2 == 0) ? 1 : p2; u32 uVar1 = (p2 == 0) ? 1 : p2;
#if TARGET_PC #if TARGET_PC
static Limiter limiter;
waitPrecise(limiter, static_cast<Uint64>((RETRACE_PERIOD * uVar1).count())); waitPrecise(limiter, static_cast<Uint64>((RETRACE_PERIOD * uVar1).count()));
#else #else
static u32 nextCount = VIGetRetraceCount(); static u32 nextCount = VIGetRetraceCount();
@@ -447,13 +452,13 @@ static void dummy() {
JUTXfb::getManager()->setDisplayingXfbIndex(0); JUTXfb::getManager()->setDisplayingXfbIndex(0);
} }
ATTRIBUTE_ALIGN(32) static Mtx e_mtx = { static Mtx e_mtx ATTRIBUTE_ALIGN(32) = {
{1.0f, 0.0f, 0.0f, 0.0f}, {1.0f, 0.0f, 0.0f, 0.0f},
{0.0f, 1.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 1.0f, 0.0f},
}; };
ATTRIBUTE_ALIGN(32) static u8 clear_z_TX[64] = { static u8 clear_z_TX[64] ATTRIBUTE_ALIGN(32) = {
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -196,13 +196,6 @@ cleanup:
void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) { void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) {
JUT_ASSERT(442, isMounted()); JUT_ASSERT(442, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(pEntry, pOutSize); data != nullptr) {
return data;
}
#endif
u32 outSize; u32 outSize;
u8* outBuf; u8* outBuf;
if (pOutSize == NULL) { if (pOutSize == NULL) {
@@ -238,13 +231,6 @@ void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) {
void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* pEntry, void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* pEntry,
u32* resourceSize) { u32* resourceSize) {
JUT_ASSERT(515, isMounted()); JUT_ASSERT(515, isMounted());
#if TARGET_PC
if (copyOverlayData(buffer, bufferSize, pEntry, resourceSize)) {
return buffer;
}
#endif
u32 size = pEntry->data_size; u32 size = pEntry->data_size;
if (size > bufferSize) { if (size > bufferSize) {
size = bufferSize; size = bufferSize;
@@ -351,12 +337,6 @@ u32 JKRAramArchive::getExpandedResSize(const void* ptr) const {
return this->getResSize(ptr); return this->getResSize(ptr);
} }
#if TARGET_PC
if (u32 size; getOverlayResourceSize(ptr, &size)) {
return size;
}
#endif
JKRArchive::SDIFileEntry* entry = this->findPtrResource(ptr); JKRArchive::SDIFileEntry* entry = this->findPtrResource(ptr);
if (entry == NULL) { if (entry == NULL) {
return 0xFFFFFFFF; return 0xFFFFFFFF;
-268
View File
@@ -7,37 +7,6 @@
#if TARGET_PC #if TARGET_PC
#include <cassert> #include <cassert>
#include <cstddef>
#include <cstdlib>
#include <limits>
#include <ranges>
#include <string_view>
#include "JSystem/JKernel/JKRDvdRipper.h"
#if _WIN32
#include <malloc.h>
#endif
std::atomic<u64> JKRArchive::sArcOverlayGeneration{0};
namespace {
void* alloc_overlay_buffer(u32 size) {
#if _WIN32
return _aligned_malloc(size, alignof(std::max_align_t));
#else
return std::malloc(size);
#endif
}
void free_overlay_buffer(void* data) {
#if _WIN32
_aligned_free(data);
#else
std::free(data);
#endif
}
} // namespace
#endif #endif
DUSK_GAME_DATA u32 JKRArchive::sCurrentDirID; DUSK_GAME_DATA u32 JKRArchive::sCurrentDirID;
@@ -73,7 +42,6 @@ JKRArchive::JKRArchive(s32 entryNumber, JKRArchive::EMountMode mountMode) {
JKRArchive::~JKRArchive() { JKRArchive::~JKRArchive() {
#if TARGET_PC #if TARGET_PC
removeAllOverlayResources();
if (mFileData != nullptr) { if (mFileData != nullptr) {
JKRHeap::getSystemHeap()->free(mFileData); JKRHeap::getSystemHeap()->free(mFileData);
mFileData = nullptr; mFileData = nullptr;
@@ -302,240 +270,4 @@ void JKRArchive::initFileDataPointers() {
mFiles[i].index = i; mFiles[i].index = i;
} }
} }
void JKRArchive::notifyOverlayFilesChanged() {
sArcOverlayGeneration.fetch_add(1, std::memory_order_release);
}
bool JKRArchive::buildArcOverlaysPath() const {
if (mArcOverlaysPathResolved) {
return !mArcOverlaysPath.empty();
}
mArcOverlaysPathResolved = true;
if (mEntryNum < 0) {
return false;
}
char pathBuffer[1024];
if (!DVDConvertEntrynumToPath(mEntryNum, pathBuffer, sizeof(pathBuffer))) {
return false;
}
std::string path{pathBuffer};
constexpr std::string_view extension{".arc"};
if (path.size() < extension.size() ||
path.compare(path.size() - extension.size(), extension.size(), extension) != 0)
{
return false;
}
path.resize(path.size() - extension.size());
path.push_back('/');
mArcOverlaysPath = std::move(path);
return true;
}
void JKRArchive::buildIndexToPathMap(u32 dirIndex, const std::string& currentPath) const {
const SDIDirEntry& dir = mNodes[dirIndex];
for (int i = 0; i < dir.num_entries; i++) {
const SDIFileEntry& entry = mFiles[dir.first_file_index + i];
std::string entryName{&mStringTable[entry.getNameOffset()]};
if (entryName == "." || entryName == "..") {
continue;
}
if (entry.isDirectory()) {
buildIndexToPathMap(entry.data_offset, currentPath + entryName + "/");
} else {
mIdxToPathMap[entry.index] = currentPath + entryName;
}
}
}
bool JKRArchive::getOverlayPath(SDIFileEntry* entry, std::string& path) const {
if (entry == nullptr || !buildArcOverlaysPath()) {
return false;
}
if (mIdxToPathMap.empty()) {
buildIndexToPathMap(0, std::string{&mStringTable[mNodes[0].name_offset]} + "/");
}
const auto pathIt = mIdxToPathMap.find(entry->index);
if (pathIt == mIdxToPathMap.end()) {
return false;
}
path = mArcOverlaysPath + pathIt->second;
return true;
}
void* JKRArchive::getActiveOverlayData(SDIFileEntry* entry, u32* outSize) const {
const auto activeIt = mActiveArcOverlayResources.find(entry->index);
if (activeIt == mActiveArcOverlayResources.end()) {
return nullptr;
}
const auto resourceIt = mArcOverlayResources.find(activeIt->second);
const u64 generation = sArcOverlayGeneration.load(std::memory_order_acquire);
if (resourceIt == mArcOverlayResources.end() || resourceIt->second.generation != generation) {
// Keep the allocation owned so raw pointers returned by earlier fetches remain valid.
mActiveArcOverlayResources.erase(activeIt);
return nullptr;
}
if (outSize != nullptr) {
*outSize = resourceIt->second.size;
}
return resourceIt->first;
}
void* JKRArchive::getOverlayData(SDIFileEntry* entry, u32* outSize) {
if (entry == nullptr) {
return nullptr;
}
if (void* data = getActiveOverlayData(entry, outSize)) {
return data;
}
std::string path;
if (!getOverlayPath(entry, path)) {
return nullptr;
}
constexpr u32 alignmentMask = 0x1f;
const u64 generation = sArcOverlayGeneration.load(std::memory_order_acquire);
DVDFileInfo fileInfo{};
if (!DVDOpen(path.c_str(), &fileInfo)) {
return nullptr;
}
const u32 logicalSize = fileInfo.length;
if (logicalSize > static_cast<u32>(std::numeric_limits<s32>::max()) - alignmentMask) {
DVDClose(&fileInfo);
return nullptr;
}
const u32 readSize = ALIGN_NEXT(logicalSize, 0x20);
const u32 allocationSize = readSize == 0 ? 1 : readSize;
void* data = alloc_overlay_buffer(allocationSize);
if (data == nullptr) {
DVDClose(&fileInfo);
return nullptr;
}
const s32 status = DVDReadPrio(&fileInfo, data, readSize, 0, 2);
DVDClose(&fileInfo);
if (status < DVD_RESULT_GOOD || static_cast<u32>(status) != logicalSize) {
free_overlay_buffer(data);
return nullptr;
}
mArcOverlayResources.emplace(data, ArcOverlayResource{
.entryIndex = entry->index,
.size = logicalSize,
.generation = generation,
});
mActiveArcOverlayResources[entry->index] = data;
if (outSize != nullptr) {
*outSize = logicalSize;
}
return data;
}
bool JKRArchive::copyOverlayData(void* buffer, u32 bufferSize, SDIFileEntry* entry, u32* outSize) {
u32 overlaySize;
const void* overlayData = getOverlayData(entry, &overlaySize);
if (overlayData == nullptr) {
return false;
}
const u32 copySize = overlaySize < bufferSize ? overlaySize : bufferSize;
if (copySize != 0) {
memcpy(buffer, overlayData, copySize);
}
if (outSize != nullptr) {
*outSize = copySize;
}
return true;
}
bool JKRArchive::getOverlayResourceSize(const void* data, u32* outSize) const {
const auto resourceIt = mArcOverlayResources.find(const_cast<void*>(data));
if (resourceIt == mArcOverlayResources.end()) {
return false;
}
if (outSize != nullptr) {
*outSize = resourceIt->second.size;
}
return true;
}
bool JKRArchive::getOverlayFileSize(SDIFileEntry* entry, u32* outSize) const {
if (entry == nullptr) {
return false;
}
u32 activeSize;
if (getActiveOverlayData(entry, &activeSize) != nullptr) {
if (outSize != nullptr) {
*outSize = activeSize;
}
return true;
}
std::string path;
if (!getOverlayPath(entry, path)) {
return false;
}
DVDFileInfo fileInfo{};
if (!DVDOpen(path.c_str(), &fileInfo)) {
return false;
}
if (outSize != nullptr) {
*outSize = fileInfo.length;
}
DVDClose(&fileInfo);
return true;
}
u32 JKRArchive::getFileSize(SDIFileEntry* entry) const {
u32 size;
if (getOverlayFileSize(entry, &size)) {
return size;
}
return entry != nullptr ? entry->getSize() : 0;
}
bool JKRArchive::removeOverlayResource(void* resource, bool freeResource) {
const auto resourceIt = mArcOverlayResources.find(resource);
if (resourceIt == mArcOverlayResources.end()) {
return false;
}
const auto activeIt = mActiveArcOverlayResources.find(resourceIt->second.entryIndex);
if (activeIt != mActiveArcOverlayResources.end() && activeIt->second == resource) {
mActiveArcOverlayResources.erase(activeIt);
}
if (freeResource) {
free_overlay_buffer(resource);
}
mArcOverlayResources.erase(resourceIt);
return true;
}
void JKRArchive::removeAllOverlayResources() {
mActiveArcOverlayResources.clear();
for (const auto& key : mArcOverlayResources | std::views::keys) {
free_overlay_buffer(key);
}
mArcOverlayResources.clear();
}
#endif #endif
@@ -246,7 +246,6 @@ u32 JKRArchive::readResource(void* buffer, u32 bufferSize, u16 id) {
void JKRArchive::removeResourceAll() { void JKRArchive::removeResourceAll() {
if (mArcInfoBlock && mMountMode != MOUNT_MEM) { if (mArcInfoBlock && mMountMode != MOUNT_MEM) {
IF_DUSK(removeAllOverlayResources();)
SDIFileEntry* fileEntry = mFiles; SDIFileEntry* fileEntry = mFiles;
for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) { for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) {
if (JKAR_DATA(fileEntry)) { if (JKAR_DATA(fileEntry)) {
@@ -260,13 +259,6 @@ void JKRArchive::removeResourceAll() {
bool JKRArchive::removeResource(void* resource) { bool JKRArchive::removeResource(void* resource) {
JUT_ASSERT(678, resource != NULL); JUT_ASSERT(678, resource != NULL);
#if TARGET_PC
if (removeOverlayResource(resource, true)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return false; return false;
@@ -278,13 +270,6 @@ bool JKRArchive::removeResource(void* resource) {
bool JKRArchive::detachResource(void* resource) { bool JKRArchive::detachResource(void* resource) {
JUT_ASSERT(707, resource != NULL); JUT_ASSERT(707, resource != NULL);
#if TARGET_PC
if (removeOverlayResource(resource, false)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return false; return false;
@@ -295,13 +280,6 @@ bool JKRArchive::detachResource(void* resource) {
u32 JKRArchive::getResSize(const void* resource) const { u32 JKRArchive::getResSize(const void* resource) const {
JUT_ASSERT(732, resource != NULL); JUT_ASSERT(732, resource != NULL);
#if TARGET_PC
if (u32 size; getOverlayResourceSize(resource, &size)) {
return size;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return -1; return -1;
@@ -226,13 +226,6 @@ bool JKRCompArchive::open(s32 entryNum) {
void* JKRCompArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) { void* JKRCompArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) {
JUT_ASSERT(597, isMounted()); JUT_ASSERT(597, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(fileEntry, pSize); data != nullptr) {
return data;
}
#endif
u32 ptrSize; u32 ptrSize;
u32 size = fileEntry->data_size; u32 size = fileEntry->data_size;
int compression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 0x18)); int compression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 0x18));
@@ -281,13 +274,6 @@ void *JKRCompArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry
{ {
u32 size = 0; u32 size = 0;
JUT_ASSERT(708, isMounted()); JUT_ASSERT(708, isMounted());
#if TARGET_PC
if (copyOverlayData(data, compressedSize, fileEntry, pSize)) {
return data;
}
#endif
u32 fileSize = fileEntry->data_size; u32 fileSize = fileEntry->data_size;
u32 alignedSize = ALIGN_NEXT(fileSize, 32); u32 alignedSize = ALIGN_NEXT(fileSize, 32);
u32 fileFlag = fileEntry->type_flags_and_name_offset >> 0x18; u32 fileFlag = fileEntry->type_flags_and_name_offset >> 0x18;
@@ -333,7 +319,6 @@ void *JKRCompArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry
void JKRCompArchive::removeResourceAll() { void JKRCompArchive::removeResourceAll() {
if (mArcInfoBlock != NULL && mMountMode != MOUNT_MEM) { if (mArcInfoBlock != NULL && mMountMode != MOUNT_MEM) {
IF_DUSK(removeAllOverlayResources();)
SDIFileEntry* fileEntry = mFiles; SDIFileEntry* fileEntry = mFiles;
for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) { for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) {
int tmp = fileEntry->type_flags_and_name_offset >> 0x18; int tmp = fileEntry->type_flags_and_name_offset >> 0x18;
@@ -351,12 +336,6 @@ void JKRCompArchive::removeResourceAll() {
} }
bool JKRCompArchive::removeResource(void* resource) { bool JKRCompArchive::removeResource(void* resource) {
#if TARGET_PC
if (removeOverlayResource(resource, true)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (!fileEntry) if (!fileEntry)
return false; return false;
@@ -377,12 +356,6 @@ u32 JKRCompArchive::getExpandedResSize(const void *resource) const
return getResSize(resource); return getResSize(resource);
} }
#if TARGET_PC
if (u32 size; getOverlayResourceSize(resource, &size)) {
return size;
}
#endif
SDIFileEntry *fileEntry = findPtrResource(resource); SDIFileEntry *fileEntry = findPtrResource(resource);
if(!fileEntry) { if(!fileEntry) {
return 0xffffffff; return 0xffffffff;
@@ -147,13 +147,6 @@ cleanup:
void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) { void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) {
JUT_ASSERT(428, isMounted()); JUT_ASSERT(428, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(fileEntry, returnSize); data != nullptr) {
return data;
}
#endif
u32 tempReturnSize; u32 tempReturnSize;
if (returnSize == NULL) { if (returnSize == NULL) {
returnSize = &tempReturnSize; returnSize = &tempReturnSize;
@@ -188,13 +181,6 @@ void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) {
void* JKRDvdArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry, void* JKRDvdArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry,
u32* returnSize) { u32* returnSize) {
JUT_ASSERT(504, isMounted()); JUT_ASSERT(504, isMounted());
#if TARGET_PC
if (copyOverlayData(buffer, bufferSize, fileEntry, returnSize)) {
return buffer;
}
#endif
u32 size = fileEntry->data_size; u32 size = fileEntry->data_size;
JKRCompression fileCompression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 24)); JKRCompression fileCompression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 24));
@@ -358,12 +344,6 @@ u32 JKRDvdArchive::getExpandedResSize(const void* resource) const {
return getResSize(resource); return getResSize(resource);
} }
#if TARGET_PC
if (u32 size; getOverlayResourceSize(resource, &size)) {
return size;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (!fileEntry) { if (!fileEntry) {
return -1; return -1;
@@ -135,13 +135,6 @@ bool JKRMemArchive::open(void* buffer, u32 bufferSize, JKRMemBreakFlag flag) {
void* JKRMemArchive::fetchResource(SDIFileEntry* fileEntry, u32* resourceSize) { void* JKRMemArchive::fetchResource(SDIFileEntry* fileEntry, u32* resourceSize) {
JUT_ASSERT(555, isMounted()); JUT_ASSERT(555, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(fileEntry, resourceSize); data != nullptr) {
return data;
}
#endif
if (!JKAR_DATA(fileEntry)) { if (!JKAR_DATA(fileEntry)) {
JKAR_DATA(fileEntry) = mArchiveData + fileEntry->data_offset; JKAR_DATA(fileEntry) = mArchiveData + fileEntry->data_offset;
} }
@@ -156,13 +149,6 @@ void* JKRMemArchive::fetchResource(SDIFileEntry* fileEntry, u32* resourceSize) {
void* JKRMemArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry, void* JKRMemArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry,
u32* resourceSize) { u32* resourceSize) {
JUT_ASSERT(595, isMounted()); JUT_ASSERT(595, isMounted());
#if TARGET_PC
if (copyOverlayData(buffer, bufferSize, fileEntry, resourceSize)) {
return buffer;
}
#endif
u32 srcLength = fileEntry->data_size; u32 srcLength = fileEntry->data_size;
if (srcLength > bufferSize) { if (srcLength > bufferSize) {
srcLength = bufferSize; srcLength = bufferSize;
@@ -187,8 +173,6 @@ void* JKRMemArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* f
void JKRMemArchive::removeResourceAll(void) { void JKRMemArchive::removeResourceAll(void) {
JUT_ASSERT(642, isMounted()); JUT_ASSERT(642, isMounted());
IF_DUSK(removeAllOverlayResources();)
if (mArcInfoBlock == NULL) if (mArcInfoBlock == NULL)
return; return;
if (mMountMode == MOUNT_MEM) if (mMountMode == MOUNT_MEM)
@@ -208,12 +192,6 @@ void JKRMemArchive::removeResourceAll(void) {
bool JKRMemArchive::removeResource(void* resource) { bool JKRMemArchive::removeResource(void* resource) {
JUT_ASSERT(673, isMounted()); JUT_ASSERT(673, isMounted());
#if TARGET_PC
if (removeOverlayResource(resource, true)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (!fileEntry) if (!fileEntry)
return false; return false;
@@ -253,12 +231,6 @@ u32 JKRMemArchive::fetchResource_subroutine(u8* src, u32 srcLength, u8* dst, u32
} }
u32 JKRMemArchive::getExpandedResSize(const void* resource) const { u32 JKRMemArchive::getExpandedResSize(const void* resource) const {
#if TARGET_PC
if (u32 overlaySize; getOverlayResourceSize(resource, &overlaySize)) {
return overlaySize;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return -1; return -1;
+3 -3
View File
@@ -16,10 +16,10 @@ inline f64 getConst2() {
return 9.765625E-4; return 9.765625E-4;
} }
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_; DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_ ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_; DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_ ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_; DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_ ATTRIBUTE_ALIGN(32);
} // namespace JMath } // namespace JMath
+24 -49
View File
@@ -8,7 +8,8 @@
#include "JSystem/JMessage/control.h" #include "JSystem/JMessage/control.h"
#if TARGET_PC #if TARGET_PC
#include "dusk/mods/svc/flow.hpp" #include "dusk/randomizer/game/custom_flow_ids.hpp"
#include "dusk/randomizer/game/messages.hpp"
#endif #endif
JMessage::TControl::TControl() JMessage::TControl::TControl()
@@ -23,16 +24,9 @@ JMessage::TControl::TControl()
pMessageText_current_(NULL) pMessageText_current_(NULL)
{} {}
JMessage::TControl::~TControl() { JMessage::TControl::~TControl() {}
#if TARGET_PC
dusk::flow::release_message_control(this);
#endif
}
void JMessage::TControl::reset() { void JMessage::TControl::reset() {
#if TARGET_PC
dusk::flow::release_message_control(this);
#endif
pEntry_ = NULL; pEntry_ = NULL;
pMessageText_begin_ = NULL; pMessageText_begin_ = NULL;
pszText_update_current_ = NULL; pszText_update_current_ = NULL;
@@ -82,6 +76,12 @@ int JMessage::TControl::setMessageID(u32 uMsgID, u32 param_1, bool* pbValid) {
u32 uCode = pProcessor->toMessageCode_messageID(uMsgID, param_1, pbValid); u32 uCode = pProcessor->toMessageCode_messageID(uMsgID, param_1, pbValid);
if (uCode == 0xFFFFFFFF) { if (uCode == 0xFFFFFFFF) {
#if TARGET_PC
// If this is a custom text id
if (uMsgID >= BASE_CUSTOM_MSG_AND_FLOW_ID)
uCode = CUSTOM_BMG_GROUP << 16 | uMsgID;
else // return 0
#endif
return 0; return 0;
} }
@@ -89,56 +89,31 @@ int JMessage::TControl::setMessageID(u32 uMsgID, u32 param_1, bool* pbValid) {
} }
bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* pProcessor, u16 u16GroupID, u16 u16Index) { bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* pProcessor, u16 u16GroupID, u16 u16Index) {
#if TARGET_PC
const TResource* resource = NULL;
const void* resolvedEntry = NULL;
const char* resolvedText = NULL;
if (u16Index >= dusk::flow::kCustomMessageMin) {
if (!dusk::flow::custom_message_for_processor(
this, pProcessor, u16Index, resource, resolvedEntry, resolvedText))
{
return false;
}
const_cast<TProcessor*>(pProcessor)->setResourceCache(const_cast<TResource*>(resource));
} else {
resource = pProcessor->getResource_groupID(u16GroupID);
if (resource == NULL) {
return false;
}
const void* nativeEntry = resource->getMessageEntry_messageIndex(u16Index);
const char* nativeText =
nativeEntry != NULL ? resource->getMessageText_messageEntry(nativeEntry) : NULL;
resolvedEntry = nativeEntry;
resolvedText = nativeText;
dusk::flow::resolve_message_for_control(this, resource->oParse_THeader_.getRaw(), u16Index,
nativeEntry, nativeText, resolvedEntry, resolvedText);
}
pEntry_ = const_cast<void*>(resolvedEntry);
if (pEntry_ == NULL || resolvedText == NULL) {
return false;
}
#else
pEntry_ = pProcessor->getMessageEntry_messageCode(u16GroupID, u16Index); pEntry_ = pProcessor->getMessageEntry_messageCode(u16GroupID, u16Index);
if (pEntry_ == NULL) { if (pEntry_ == NULL) {
#if TARGET_PC
if (HandleCustomText(this, u16Index)) {
uMessageGroupID_ = u16GroupID;
uMessageID_ = u16Index;
pResourceCache_ = pProcessor->getResourceCache();
pMessageText_current_ = pMessageText_begin_;
oStack_renderingProcessor_.clear();
return true;
} else
#endif
return false; return false;
} }
#endif
#if TARGET_PC
uMessageGroupID_ = resource->getGroupID();
pResourceCache_ = resource;
#else
uMessageGroupID_ = u16GroupID; uMessageGroupID_ = u16GroupID;
pResourceCache_ = pProcessor->getResourceCache();
#endif
uMessageID_ = u16Index; uMessageID_ = u16Index;
pResourceCache_ = pProcessor->getResourceCache();
JUT_ASSERT(155, pResourceCache_!=NULL); JUT_ASSERT(155, pResourceCache_!=NULL);
#if TARGET_PC
pMessageText_begin_ = resolvedText;
#else
pMessageText_begin_ = pResourceCache_->getMessageText_messageEntry(pEntry_); pMessageText_begin_ = pResourceCache_->getMessageText_messageEntry(pEntry_);
#if TARGET_PC
// Feels kinda hacky to have to hijack this deep into JSystem, but works for now
HandleTextOverrides(this, pProcessor, uMessageGroupID_, uMessageID_);
#endif #endif
pMessageText_current_ = pMessageText_begin_; pMessageText_current_ = pMessageText_begin_;
oStack_renderingProcessor_.clear(); oStack_renderingProcessor_.clear();
+1 -89
View File
@@ -5,26 +5,15 @@
#include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JUtility/JUTAssert.h"
#include <cstdint> #include <cstdint>
#if TARGET_PC
#include "dusk/mods/svc/flow.hpp"
#endif
JMessage::TReference::~TReference() {} JMessage::TReference::~TReference() {}
const char* JMessage::TReference::do_word(u32 param_0) const { const char* JMessage::TReference::do_word(u32 param_0) const {
return NULL; return NULL;
} }
JMessage::TProcessor::~TProcessor() { JMessage::TProcessor::~TProcessor() {}
#if TARGET_PC
dusk::flow::release_message_processor(this);
#endif
}
void JMessage::TProcessor::reset() { void JMessage::TProcessor::reset() {
#if TARGET_PC
dusk::flow::release_message_processor(this);
#endif
on_resetStatus_(NULL); on_resetStatus_(NULL);
do_reset(); do_reset();
} }
@@ -55,15 +44,6 @@ const JMessage::TResource* JMessage::TProcessor::getResource_groupID(u16 u16Grou
} }
u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool* pbValid) const { u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool* pbValid) const {
#if TARGET_PC
u32 customCode = 0;
if (dusk::flow::message_code_for_id(this, uMsgID, customCode)) {
if (pbValid != NULL) {
*pbValid = true;
}
return customCode;
}
#endif
const TResource* pResourceCache = (const TResource*)getResourceCache(); const TResource* pResourceCache = (const TResource*)getResourceCache();
if (pResourceCache != NULL) { if (pResourceCache != NULL) {
u16 u16Index = pResourceCache->toMessageIndex_messageID(uMsgID, param_1, pbValid); u16 u16Index = pResourceCache->toMessageIndex_messageID(uMsgID, param_1, pbValid);
@@ -93,74 +73,6 @@ u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool*
return 0xFFFFFFFF; return 0xFFFFFFFF;
} }
#if TARGET_PC
void* JMessage::TProcessor::getMessageEntry_messageCode(u16 groupId, u16 index) const {
if (index >= dusk::flow::kCustomMessageMin) {
const TResource* customResource = NULL;
const void* customEntry = NULL;
const char* customText = NULL;
if (!dusk::flow::custom_message_for_processor(
NULL, this, index, customResource, customEntry, customText))
{
return NULL;
}
const_cast<TProcessor*>(this)->setResourceCache(const_cast<TResource*>(customResource));
return const_cast<void*>(customEntry);
}
const TResource* resource = getResource_groupID(groupId);
if (resource == NULL) {
return NULL;
}
void* nativeEntry = resource->getMessageEntry_messageIndex(index);
const char* nativeText =
nativeEntry != NULL ? resource->getMessageText_messageEntry(nativeEntry) : NULL;
const void* resolvedEntry = nativeEntry;
const char* resolvedText = nativeText;
dusk::flow::resolve_message(this, resource->oParse_THeader_.getRaw(), index, nativeEntry,
nativeText, resolvedEntry, resolvedText);
return const_cast<void*>(resolvedEntry);
}
const char* JMessage::TProcessor::getMessageText_messageCode(u16 groupId, u16 index) const {
if (index >= dusk::flow::kCustomMessageMin) {
const TResource* customResource = NULL;
const void* customEntry = NULL;
const char* customText = NULL;
if (!dusk::flow::custom_message_for_processor(
NULL, this, index, customResource, customEntry, customText))
{
return NULL;
}
const_cast<TProcessor*>(this)->setResourceCache(const_cast<TResource*>(customResource));
return customText;
}
const TResource* resource = getResource_groupID(groupId);
if (resource == NULL) {
return NULL;
}
const void* nativeEntry = resource->getMessageEntry_messageIndex(index);
const char* nativeText =
nativeEntry != NULL ? resource->getMessageText_messageEntry(nativeEntry) : NULL;
const void* resolvedEntry = nativeEntry;
const char* resolvedText = nativeText;
dusk::flow::resolve_message(this, resource->oParse_THeader_.getRaw(), index, nativeEntry,
nativeText, resolvedEntry, resolvedText);
return resolvedText;
}
const char* JMessage::TProcessor::on_message_limited(u16 index) const {
JUT_ASSERT(482, pResourceCache_!=NULL);
const void* nativeEntry = pResourceCache_->getMessageEntry_messageIndex(index);
const char* nativeText =
nativeEntry != NULL ? pResourceCache_->getMessageText_messageEntry(nativeEntry) : NULL;
const void* resolvedEntry = nativeEntry;
const char* resolvedText = nativeText;
dusk::flow::resolve_message(this, pResourceCache_->oParse_THeader_.getRaw(), index,
nativeEntry, nativeText, resolvedEntry, resolvedText);
return resolvedText;
}
#endif
void JMessage::TProcessor::on_select_begin(char const* (*pfn)(JMessage::TProcessor*), void JMessage::TProcessor::on_select_begin(char const* (*pfn)(JMessage::TProcessor*),
void const* pOffset, char const* pcBase, u32 uNumber) { void const* pOffset, char const* pcBase, u32 uNumber) {
JUT_ASSERT(191, uNumber>0); JUT_ASSERT(191, uNumber>0);
+2 -2
View File
@@ -46,7 +46,7 @@ JPAResource::JPAResource() {
mUsrIdx = fldNum = keyNum = texNum = mpCalcEmitterFuncListNum = mpDrawEmitterFuncListNum = mpDrawEmitterChildFuncListNum = mpCalcParticleFuncListNum = mpDrawParticleFuncListNum = mpCalcParticleChildFuncListNum = mpDrawParticleChildFuncListNum = 0; mUsrIdx = fldNum = keyNum = texNum = mpCalcEmitterFuncListNum = mpDrawEmitterFuncListNum = mpDrawEmitterChildFuncListNum = mpCalcParticleFuncListNum = mpDrawParticleFuncListNum = mpCalcParticleChildFuncListNum = mpDrawParticleChildFuncListNum = 0;
} }
ATTRIBUTE_ALIGN(32) static u8 jpa_pos[324] = { static u8 jpa_pos[324] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x32, 0xCE, 0x00, 0x00, 0xCE, 0x00, 0xE7, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x32, 0xCE, 0x00, 0x00, 0xCE, 0x00, 0xE7, 0x00, 0x00, 0x19,
0x00, 0x00, 0x19, 0xCE, 0x00, 0xE7, 0xCE, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x19, 0xCE, 0x00, 0xE7, 0xCE, 0x00, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE,
0x00, 0xCE, 0xCE, 0x00, 0x00, 0x19, 0x00, 0x32, 0x19, 0x00, 0x32, 0xE7, 0x00, 0x00, 0xE7, 0x00, 0x00, 0xCE, 0xCE, 0x00, 0x00, 0x19, 0x00, 0x32, 0x19, 0x00, 0x32, 0xE7, 0x00, 0x00, 0xE7, 0x00,
@@ -70,7 +70,7 @@ ATTRIBUTE_ALIGN(32) static u8 jpa_pos[324] = {
0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xCE,
}; };
ATTRIBUTE_ALIGN(32) static u8 jpa_crd[32] = { static u8 jpa_crd[32] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x00, 0x02, 0x01, 0x00, 0x01,
0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00, 0x02, 0x02, 0x00, 0x02,
}; };
@@ -8,7 +8,7 @@
#endif #endif
#include "global.h" #include "global.h"
ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] = { DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] ATTRIBUTE_ALIGN(32) = {
0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04, 0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C,
+1 -1
View File
@@ -71,7 +71,7 @@ void JUTResFont::initJoinedTexture() {
int pageCount = 0; int pageCount = 0;
u32 pageNumCells = block.numRows * block.numColumns; u32 pageNumCells = block.numRows * block.numColumns;
if (dusk::version::isRegionJpn()) { if (dusk::version::getGameVersion() == dusk::version::GameVersion::GcnJpn) {
pageCount = 1; pageCount = 1;
if (pageNumCells > 0 && block.endCode > block.startCode) { if (pageNumCells > 0 && block.endCode > block.startCode) {
pageCount = (block.endCode - block.startCode + pageNumCells - 1) / pageNumCells; pageCount = (block.endCode - block.startCode + pageNumCells - 1) / pageNumCells;
+2 -7
View File
@@ -42,7 +42,7 @@ JUTVideo::JUTVideo(GXRenderModeObj const* param_0) {
mRetraceCount = VIGetRetraceCount(); mRetraceCount = VIGetRetraceCount();
field_0x10 = 1; field_0x10 = 1;
field_0x18 = 0; field_0x18 = 0;
sVideoLastTick = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick()); sVideoLastTick = OSGetTick();
sVideoInterval = 670000; sVideoInterval = 670000;
mPreRetraceCallback = VISetPreRetraceCallback(preRetraceProc); mPreRetraceCallback = VISetPreRetraceCallback(preRetraceProc);
mPostRetraceCallback = VISetPostRetraceCallback(postRetraceProc); mPostRetraceCallback = VISetPostRetraceCallback(postRetraceProc);
@@ -68,13 +68,8 @@ void JUTVideo::preRetraceProc(u32 retrace_count) {
(*sManager->mPreCallback)(retrace_count); (*sManager->mPreCallback)(retrace_count);
} }
OSTick tick = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick()); OSTick tick = OSGetTick();
sVideoInterval = tick - sVideoLastTick; sVideoInterval = tick - sVideoLastTick;
#if TARGET_PC
if (sVideoInterval <= 0) {
sVideoInterval = 1;
}
#endif
sVideoLastTick = tick; sVideoLastTick = tick;
JUTXfb* xfb = JUTXfb::getManager(); JUTXfb* xfb = JUTXfb::getManager();
@@ -136,7 +136,7 @@ void TRK__read_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
} }
void TRK__write_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) { void TRK__write_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
ATTRIBUTE_ALIGN(32) u8 buff[32]; u8 buff[32] ATTRIBUTE_ALIGN(32);
u32 err; u32 err;
__REGISTER int count = c; __REGISTER int count = c;
__REGISTER u32 bf; __REGISTER u32 bf;
@@ -85,7 +85,7 @@ DSError TRKDoSupportMask(TRKBuffer*) {
} }
DSError TRKDoReadMemory(TRKBuffer* buffer) { DSError TRKDoReadMemory(TRKBuffer* buffer) {
ATTRIBUTE_ALIGN(32) u8 buf[0x820]; u8 buf[0x820] ATTRIBUTE_ALIGN(32);
size_t tempLength; size_t tempLength;
int result; int result;
int replyErr; int replyErr;
@@ -158,7 +158,7 @@ DSError TRKDoReadMemory(TRKBuffer* buffer) {
} }
DSError TRKDoWriteMemory(TRKBuffer* b) { DSError TRKDoWriteMemory(TRKBuffer* b) {
ATTRIBUTE_ALIGN(32) u8 buf[0x820]; u8 buf[0x820] ATTRIBUTE_ALIGN(32);
size_t tempLength; size_t tempLength;
int options; int options;
int result; int result;
+2 -2
View File
@@ -3,8 +3,8 @@
#include "__ax.h" #include "__ax.h"
ATTRIBUTE_ALIGN(32) static s32 __AXBufferAuxA[3][480]; static s32 __AXBufferAuxA[3][480] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static s32 __AXBufferAuxB[3][480]; static s32 __AXBufferAuxB[3][480] ATTRIBUTE_ALIGN(32);
static void (* __AXCallbackAuxA)(void*, void*); static void (* __AXCallbackAuxA)(void*, void*);
static void (* __AXCallbackAuxB)(void*, void*); static void (* __AXCallbackAuxB)(void*, void*);
+1 -1
View File
@@ -3,7 +3,7 @@
#include "__ax.h" #include "__ax.h"
ATTRIBUTE_ALIGN(32) static AXSPB __AXStudio; static AXSPB __AXStudio ATTRIBUTE_ALIGN(32);
static s32 __AXSpbAL; static s32 __AXSpbAL;
static s32 __AXSpbAR; static s32 __AXSpbAR;
+3 -3
View File
@@ -35,9 +35,9 @@ static u32 __AXAuxMixCycles[32] = {
0x000009E2, 0x00000E97 0x000009E2, 0x00000E97
}; };
ATTRIBUTE_ALIGN(32) static AXPB __AXPB[AX_MAX_VOICES]; static AXPB __AXPB[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static AXPBITDBUFFER __AXITD[AX_MAX_VOICES]; static AXPBITDBUFFER __AXITD[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static AXPBU __AXUpdates[AX_MAX_VOICES]; static AXPBU __AXUpdates[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32);
static AXVPB __AXVPB[AX_MAX_VOICES]; static AXVPB __AXVPB[AX_MAX_VOICES];
static u32 __AXMaxDspCycles; static u32 __AXMaxDspCycles;
+1 -1
View File
@@ -3,7 +3,7 @@
u16 axDspSlaveLength = (AX_DSP_SLAVE_LENGTH * 2); u16 axDspSlaveLength = (AX_DSP_SLAVE_LENGTH * 2);
ATTRIBUTE_ALIGN(32) u16 axDspSlave[AX_DSP_SLAVE_LENGTH] = { u16 axDspSlave[AX_DSP_SLAVE_LENGTH] ATTRIBUTE_ALIGN(32) = {
0x0000, 0x0000, 0x029F, 0x0E88, 0x029F, 0x0E97, 0x0000, 0x0000, 0x029F, 0x0E88, 0x029F, 0x0E97,
0x029F, 0x0EB3, 0x029F, 0x0ED3, 0x029F, 0x0ED9, 0x029F, 0x0EB3, 0x029F, 0x0ED3, 0x029F, 0x0ED9,
0x029F, 0x0F0B, 0x029F, 0x0F11, 0x1302, 0x1303, 0x029F, 0x0F0B, 0x029F, 0x0F11, 0x1302, 0x1303,
+1 -1
View File
@@ -4,7 +4,7 @@
#include "__card.h" #include "__card.h"
ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static u8 CardData[352] = { static u8 CardData[352] ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0xFF, 0x00, 0x21, 0x13, 0x06, 0x12, 0x03, 0x12, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x02, 0xFF, 0x00, 0x21, 0x13, 0x06, 0x12, 0x03, 0x12, 0x04,
0x13, 0x05, 0x00, 0x92, 0x00, 0xFF, 0x00, 0x88, 0xFF, 0xFF, 0x00, 0x89, 0xFF, 0xFF, 0x00, 0x8A, 0xFF, 0xFF, 0x00, 0x13, 0x05, 0x00, 0x92, 0x00, 0xFF, 0x00, 0x88, 0xFF, 0xFF, 0x00, 0x89, 0xFF, 0xFF, 0x00, 0x8A, 0xFF, 0xFF, 0x00,
+1 -1
View File
@@ -3,7 +3,7 @@
#include <dolphin/demo.h> #include <dolphin/demo.h>
#include "sdk_math.h" #include "sdk_math.h"
ATTRIBUTE_ALIGN(32) static s16 __AVX_internal_buffer[3200]; static s16 __AVX_internal_buffer[3200] ATTRIBUTE_ALIGN(32);
static void (*__AVX_save_isr)(void); static void (*__AVX_save_isr)(void);
+1 -1
View File
@@ -1,7 +1,7 @@
#include <dolphin/dolphin.h> #include <dolphin/dolphin.h>
#include <dolphin/demo.h> #include <dolphin/demo.h>
ATTRIBUTE_ALIGN(32) u32 DEMOFontBitmap[768] = { u32 DEMOFontBitmap[768] ATTRIBUTE_ALIGN(32) = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,

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