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
532 changed files with 82070 additions and 6596 deletions
+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
+1 -4
View File
@@ -1,6 +1,3 @@
[submodule "extern/aurora"] [submodule "extern/aurora"]
path = extern/aurora path = extern/aurora
url = https://github.com/Lurs/aurora.git url = https://github.com/encounter/aurora.git
[submodule "extern/borealis"]
path = extern/borealis
url = https://github.com/encounter/borealis.git
+148 -15
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,22 +334,66 @@ 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 ZLIB::ZLIB) 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)
@@ -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})
@@ -468,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)
@@ -552,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"
@@ -586,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 -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()
+1 -1
View File
@@ -4,7 +4,7 @@ include_guard(GLOBAL)
get_filename_component(_game_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) get_filename_component(_game_root "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
# PARTIAL_DEBUG makes debug and release share one struct/vtable ABI so a mod binary loads into either # PARTIAL_DEBUG makes debug and release share one struct/vtable ABI so a mod binary loads into either
set(_game_compile_defs TARGET_PC=1 WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1 PARTIAL_DEBUG=1 DUSK_TPHD=1) set(_game_compile_defs TARGET_PC=1 WIDESCREEN_SUPPORT=1 AVOID_UB=1 VERSION=0 MTX_USE_PS=1 PARTIAL_DEBUG=1)
if (ANDROID) if (ANDROID)
list(APPEND _game_compile_defs TARGET_ANDROID=1) list(APPEND _game_compile_defs TARGET_ANDROID=1)
endif () endif ()
+8 -68
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).
@@ -381,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,
@@ -633,9 +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`.
--- ---
## Hooking Game Functions ## Hooking Game Functions
@@ -938,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 -14
View File
@@ -1421,21 +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/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/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
@@ -1449,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
@@ -1495,11 +1506,7 @@ set(DUSK_FILES
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
@@ -1517,6 +1524,8 @@ set(DUSK_FILES
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
@@ -1575,20 +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
src/dusk/tphd/TphdPack.hpp )
src/dusk/tphd/TphdPack.cpp
src/dusk/tphd/GtxParser.hpp set(DUSK_HTTP_BACKEND_FILES
src/dusk/tphd/GtxParser.cpp src/dusk/http/no_backend.cpp
src/dusk/tphd/AddrLib.hpp src/dusk/http/curl.cpp
src/dusk/tphd/AddrLib.cpp src/dusk/http/winhttp.cpp
src/dusk/tphd/HdAssetLayer.hpp src/dusk/http/url_session.mm
src/dusk/tphd/HdAssetLayer.cpp
src/dusk/tphd/LosTable.hpp
src/dusk/tphd/LosTable.cpp
) )
+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"
+5 -4
View File
@@ -46,6 +46,11 @@ 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;
@@ -158,10 +163,6 @@ enum Z2Scene {
/* 0x4E */ Z2SCENE_GROTTO_ROCK_2, /* 0x4E */ Z2SCENE_GROTTO_ROCK_2,
/* 0x4F */ Z2SCENE_GROTTO_POND, /* 0x4F */ Z2SCENE_GROTTO_POND,
/* 0x50 */ Z2SCENE_FARON_WOODS_CAVE, /* 0x50 */ Z2SCENE_FARON_WOODS_CAVE,
#if TARGET_PC
/* 0x51 */ Z2SCENE_CAVE_OF_SHADOWS,
#endif
}; };
#endif /* Z2SCENEMGR_H */ #endif /* Z2SCENEMGR_H */
+14 -4
View File
@@ -3913,6 +3913,16 @@ public:
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];
static DUSK_GAME_DATA daAlink_BckData const m_mainBckFishing[28]; static DUSK_GAME_DATA daAlink_BckData const m_mainBckFishing[28];
@@ -4560,8 +4570,6 @@ public:
void onIronBallChainInterpCallback(); void onIronBallChainInterpCallback();
f32 mLosStickValue;
static const int IRON_BALL_CHAIN_COUNT = 102; static const int IRON_BALL_CHAIN_COUNT = 102;
cXyz mIBChainInterpPrevPos[IRON_BALL_CHAIN_COUNT]; cXyz mIBChainInterpPrevPos[IRON_BALL_CHAIN_COUNT];
cXyz mIBChainInterpCurrPos[IRON_BALL_CHAIN_COUNT]; cXyz mIBChainInterpCurrPos[IRON_BALL_CHAIN_COUNT];
@@ -6393,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 {
@@ -6467,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 {
+1 -9
View File
@@ -18,24 +18,16 @@ public:
TGXTexObj& getTexObj() { return mTexObj; } TGXTexObj& getTexObj() { return mTexObj; }
cXyz* getQuad() { return mQuad; } cXyz* getQuad() { return mQuad; }
#if TARGET_PC
// TP HD reflects across N floor quads (F_SP117 room 2 uses 6); GC uses 1.
static const int MAX_QUADS = 6;
#endif
/* 0x010 */ TGXTexObj mTexObj; /* 0x010 */ TGXTexObj mTexObj;
/* 0x030 */ u8 mModelCount; /* 0x030 */ u8 mModelCount;
/* 0x034 */ J3DModel* mModels[0x40]; /* 0x034 */ J3DModel* mModels[0x40];
/* 0x134 */ cXyz mQuad[DUSK_IF_ELSE(MAX_QUADS*4, 4)]; /* 0x134 */ cXyz mQuad[4];
/* 0x164 */ cXyz mMinVal; /* 0x164 */ cXyz mMinVal;
/* 0x170 */ cXyz mMaxVal; /* 0x170 */ cXyz mMaxVal;
/* 0x17C */ cXyz mViewScale; /* 0x17C */ cXyz mViewScale;
#if TARGET_PC #if TARGET_PC
bool mbReset = false; bool mbReset = false;
bool mbHadEntry = false; bool mbHadEntry = false;
cXyz mQuadBoxMin[MAX_QUADS];
cXyz mQuadBoxMax[MAX_QUADS];
int mQuadCount = 1;
#endif #endif
}; };
+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;
+4 -4
View File
@@ -142,12 +142,12 @@ namespace daObjSwpush {
int Mthd_Execute(); int Mthd_Execute();
int Mthd_Draw(); int Mthd_Draw();
static DUSK_GAME_DATA s16 const M_bmd[DUSK_IF_ELSE(4, 3)]; static DUSK_GAME_DATA s16 const M_bmd[3];
static DUSK_GAME_DATA s16 const M_dzb[DUSK_IF_ELSE(4, 3)]; static DUSK_GAME_DATA s16 const M_dzb[3];
static DUSK_GAME_DATA u32 const M_heap_size[DUSK_IF_ELSE(4, 3)]; static DUSK_GAME_DATA u32 const M_heap_size[3];
static DUSK_GAME_DATA Hio_c::Attr_c const M_attr[5]; static DUSK_GAME_DATA Hio_c::Attr_c const M_attr[5];
static DUSK_GAME_DATA u8 const M_op_vtx[4]; static DUSK_GAME_DATA u8 const M_op_vtx[4];
static DUSK_GAME_DATA DUSK_CONST char* M_arcname[DUSK_IF_ELSE(4, 3)]; static DUSK_GAME_DATA DUSK_CONST char* M_arcname[3];
/* 0x568 */ request_of_phase_process_class mPhase; /* 0x568 */ request_of_phase_process_class mPhase;
/* 0x570 */ dBgWSv* mpBgW; /* 0x570 */ dBgWSv* mpBgW;
+3
View File
@@ -64,6 +64,9 @@ 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); }
+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;
+5
View File
@@ -7,4 +7,9 @@ class fopAc_ac_c;
int CheckFieldItemCreateHeap(fopAc_ac_c* actor); int CheckFieldItemCreateHeap(fopAc_ac_c* actor);
int CheckItemCreateHeap(fopAc_ac_c* i_this); int CheckItemCreateHeap(fopAc_ac_c* i_this);
#if TARGET_PC
// 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 /* D_A_D_A_ITEMBASE_STATIC_H */ #endif /* D_A_D_A_ITEMBASE_STATIC_H */
+10
View File
@@ -74,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 {
+68
View File
@@ -474,6 +474,9 @@ public:
s8 getNextStageRoomNo() { return mNextStage.getRoomNo(); } s8 getNextStageRoomNo() { return mNextStage.getRoomNo(); }
s8 getNextStageLayer() { return mNextStage.getLayer(); } s8 getNextStageLayer() { return mNextStage.getLayer(); }
BOOL isEnableNextStage() { return mNextStage.isEnable(); } BOOL isEnableNextStage() { return mNextStage.isEnable(); }
#if TARGET_PC
void setEnableNextStage() { return mNextStage.setEnable(); }
#endif
void offEnableNextStage() { mNextStage.offEnable(); } void offEnableNextStage() { mNextStage.offEnable(); }
s8 getNextStageWipe() { return mNextStage.getWipe(); } s8 getNextStageWipe() { return mNextStage.getWipe(); }
u8 getNextStageWipeSpeed() { return mNextStage.getWipeSpeed(); } u8 getNextStageWipeSpeed() { return mNextStage.getWipeSpeed(); }
@@ -1276,6 +1279,10 @@ int dComIfGd_setShadow(u32 param_0, s8 param_1, J3DModel* param_2, cXyz* param_3
f32 param_5, f32 param_6, f32 param_7, cBgS_PolyInfo& param_8, f32 param_5, f32 param_6, f32 param_7, cBgS_PolyInfo& param_8,
dKy_tevstr_c* param_9, s16 param_10, f32 param_11, TGXTexObj* param_12); dKy_tevstr_c* param_9, s16 param_10, f32 param_11, TGXTexObj* param_12);
#if TARGET_PC
void dComIfGs_setupRandomizerSave();
#endif
inline dSv_info_c* dComIfGs_getSaveInfo() { inline dSv_info_c* dComIfGs_getSaveInfo() {
return &g_dComIfG_gameInfo.info; return &g_dComIfG_gameInfo.info;
} }
@@ -1336,9 +1343,13 @@ inline u8 dComIfGs_getSelectEquipShield() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SHIELD); return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SHIELD);
} }
#if TARGET_PC
u8 dComIfGs_getCollectSmell();
#else
inline u8 dComIfGs_getCollectSmell() { inline u8 dComIfGs_getCollectSmell() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SMELL); return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().getSelectEquip(COLLECT_SMELL);
} }
#endif
inline void dComIfGs_setCollectSmell(u8 smell) { inline void dComIfGs_setCollectSmell(u8 smell) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setSelectEquip(COLLECT_SMELL, smell); g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusA().setSelectEquip(COLLECT_SMELL, smell);
@@ -1428,6 +1439,12 @@ inline BOOL dComIfGs_isDarkClearLV(int i_no) {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isDarkClearLV(i_no); return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().isDarkClearLV(i_no);
} }
#if TARGET_PC
inline u8 dComIfGs_getDarkClearLV() {
return g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().getDarkClearLV();
}
#endif
inline void dComIfGs_onTransformLV(int i_no) { inline void dComIfGs_onTransformLV(int i_no) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().onTransformLV(i_no); g_dComIfG_gameInfo.info.getPlayer().getPlayerStatusB().onTransformLV(i_no);
} }
@@ -1505,6 +1522,12 @@ inline void dComIfGs_onRegionBit(int i_region) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().onRegionBit(i_region); g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().onRegionBit(i_region);
} }
#if TARGET_PC
inline void dComIfGs_setRegionBit(u8 i_region) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().setRegionBit(i_region);
}
#endif
inline void dComIfGs_setPlayerFieldLastStayInfo(const char* i_stage, cXyz& i_pos, s16 i_angle, inline void dComIfGs_setPlayerFieldLastStayInfo(const char* i_stage, cXyz& i_pos, s16 i_angle,
s8 i_point, u8 i_region) { s8 i_point, u8 i_region) {
g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().set(i_stage, i_pos, i_angle, g_dComIfG_gameInfo.info.getPlayer().getPlayerFieldLastStayInfo().set(i_stage, i_pos, i_angle,
@@ -1656,6 +1679,16 @@ inline void dComIfGs_setPachinkoNum(u8 i_num) {
g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setPachinkoNum(i_num); g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setPachinkoNum(i_num);
} }
#if TARGET_PC
inline u8 dComIfGs_getAncientDocumentNum() {
return g_dComIfG_gameInfo.info.getPlayer().getItemRecord().getAncientDocumentNum();
}
inline void dComIfGs_setAncientDocumentNum(u8 i_num) {
g_dComIfG_gameInfo.info.getPlayer().getItemRecord().setAncientDocumentNum(i_num);
}
#endif
inline u8 dComIfGs_getPachinkoMax() { inline u8 dComIfGs_getPachinkoMax() {
return 50; return 50;
} }
@@ -1828,7 +1861,16 @@ inline u8 dComIfGs_getGetNumber(int i_no) {
inline void dComIfGs_setGetNumber(int i_no, u8 i_value) { inline void dComIfGs_setGetNumber(int i_no, u8 i_value) {
g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setGetNumber(i_no, i_value); g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setGetNumber(i_no, i_value);
} }
#if TARGET_PC
// For rando
inline void dComIfGs_setAllLetterGet() {
g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setAllLetterGet();
}
inline void dComIfGs_setAllLetterRead() {
g_dComIfG_gameInfo.info.getPlayer().getLetterInfo().setAllLetterRead();
}
#endif
inline void dComIfGs_addFishNum(u8 param_0) { inline void dComIfGs_addFishNum(u8 param_0) {
g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().addFishCount(param_0); g_dComIfG_gameInfo.info.getPlayer().getFishingInfo().addFishCount(param_0);
} }
@@ -1944,6 +1986,16 @@ inline u8 dComIfGs_getPalLanguage() {
return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPalLanguage(); return g_dComIfG_gameInfo.info.getPlayer().getConfig().getPalLanguage();
} }
#if TARGET_PC
// Kinda hacky, but will do for now
inline void dComIfGs_onRegionFlag(int i_stageNo, int i_no) {
auto regionFlags = reinterpret_cast<u8*>(&g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit());
const int offset = i_no / 8;
const int shift = i_no % 8;
regionFlags[offset] |= (0x80 >> shift);
}
#endif
inline BOOL dComIfGs_isSaveTbox(int i_stageNo, int i_no) { inline BOOL dComIfGs_isSaveTbox(int i_stageNo, int i_no) {
return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isTbox(i_no); return g_dComIfG_gameInfo.info.getSavedata().getSave(i_stageNo).getBit().isTbox(i_no);
} }
@@ -2028,6 +2080,10 @@ inline void dComIfGs_setKeyNum(u8 i_keyNum) {
g_dComIfG_gameInfo.info.getMemory().getBit().setKeyNum(i_keyNum); g_dComIfG_gameInfo.info.getMemory().getBit().setKeyNum(i_keyNum);
} }
#if TARGET_PC
u8 dComIfGs_getKeyNum(int i_stageNo);
#endif
inline void dComIfGs_onDungeonItemMap() { inline void dComIfGs_onDungeonItemMap() {
g_dComIfG_gameInfo.info.getMemory().getBit().onDungeonItemMap(); g_dComIfG_gameInfo.info.getMemory().getBit().onDungeonItemMap();
} }
@@ -2460,6 +2516,12 @@ inline s8 dComIfGp_getStartStageRoomNo() {
return g_dComIfG_gameInfo.play.getStartStageRoomNo(); return g_dComIfG_gameInfo.play.getStartStageRoomNo();
} }
#if TARGET_PC
inline s8 dComIfGp_getLayerNo() {
return g_dComIfG_gameInfo.play.getLayerNo(0);
}
#endif
inline s8 dComIfGp_getStartStageLayer() { inline s8 dComIfGp_getStartStageLayer() {
return g_dComIfG_gameInfo.play.getStartStageLayer(); return g_dComIfG_gameInfo.play.getStartStageLayer();
} }
@@ -2504,6 +2566,12 @@ inline void dComIfGp_offEnableNextStage() {
g_dComIfG_gameInfo.play.offEnableNextStage(); g_dComIfG_gameInfo.play.offEnableNextStage();
} }
#if TARGET_PC
inline void dComIfGp_setEnableNextStage() {
g_dComIfG_gameInfo.play.setEnableNextStage();
}
#endif
inline s8 dComIfGp_getNextStageWipe() { inline s8 dComIfGp_getNextStageWipe() {
return g_dComIfG_gameInfo.play.getNextStageWipe(); return g_dComIfG_gameInfo.play.getNextStageWipe();
} }
-5
View File
@@ -27,11 +27,6 @@ public:
void setSaveDate(dSv_save_c*); void setSaveDate(dSv_save_c*);
void setPlayTime(dSv_save_c*); void setPlayTime(dSv_save_c*);
void modeWait(); void modeWait();
#if TARGET_PC
void fileSelectWide();
#endif
void modeMove(); void modeMove();
void _draw(); void _draw();
+12 -1
View File
@@ -203,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,
@@ -331,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();
@@ -732,7 +738,12 @@ public:
/* 0x2378 */ J2DPicture* mpFadePict; /* 0x2378 */ J2DPicture* mpFadePict;
#endif #endif
#ifdef TARGET_PC #ifdef TARGET_PC
struct mDusk {
dDlst_FileSelFade_c mFadeDlst; dDlst_FileSelFade_c mFadeDlst;
bool mStartNameAnm;
bool mBackToFileSelect;
int mPendingRmlCloseFrames{0};
} mDusk;
#endif #endif
#if PLATFORM_WII || PLATFORM_SHIELD #if PLATFORM_WII || PLATFORM_SHIELD
@@ -743,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
+134 -4
View File
@@ -32,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();
@@ -65,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();
@@ -81,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();
@@ -133,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();
@@ -147,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();
@@ -177,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();
@@ -221,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();
@@ -254,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();
@@ -270,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();
@@ -322,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();
@@ -336,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();
@@ -366,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();
@@ -395,13 +526,12 @@ 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);
BOOL isInsect(u8 i_itemNo); BOOL isInsect(u8 i_itemNo);
#if TARGET_PC
void item_func_WALLET_LV4();
#endif
#endif /* D_D_ITEM_H */ #endif /* D_D_ITEM_H */
+322 -6
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; }
@@ -58,11 +116,7 @@ struct dItem_data {
static s16 getTexture(u8 index) { return item_resource[index].mTexture; } static s16 getTexture(u8 index) { return item_resource[index].mTexture; }
#if TARGET_PC
static u8 getTexScale(u8 index);
#else
static u8 getTexScale (u8 index) { return item_resource[index].mTexScale; } static u8 getTexScale (u8 index) { return item_resource[index].mTexScale; }
#endif
static const char* getFieldArc(u8 index) { return field_item_res[index].mFieldArc; } static const char* getFieldArc(u8 index) { return field_item_res[index].mFieldArc; }
@@ -89,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 {
@@ -355,9 +415,265 @@ enum {
}; };
#if TARGET_PC #if TARGET_PC
// HD item mappings // Randomizer item ids. Mostly the same, but we use most unused
// entries for custom portals and keys
enum { enum {
dItemNo_WALLET_LV4_e = 0xDA, /* 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
+1 -1
View File
@@ -57,7 +57,7 @@ public:
return &mpTypeGroupData[i_typeGroupNo]; return &mpTypeGroupData[i_typeGroupNo];
} }
/* 0x0 */ fmpTresTypeGroupDataList_c mpTypeGroupData[DUSK_IF_ELSE(35, 17)]; /* 0x0 */ fmpTresTypeGroupDataList_c mpTypeGroupData[17];
}; };
class dMenu_Fmap_data_c { class dMenu_Fmap_data_c {
+2
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
@@ -219,6 +220,7 @@ private:
bool mCursorInterpCurrAngular; bool mCursorInterpCurrAngular;
bool mCursorInterpInit; bool mCursorInterpInit;
bool mPointerTouchPressHoveredCurrent; bool mPointerTouchPressHoveredCurrent;
J2DPicture* mDpadIcon;
#endif #endif
}; };
+3 -1
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; }
+23
View File
@@ -41,6 +41,26 @@ public:
/* 0x12 */ BE(u16) unk_0x12; /* 0x12 */ BE(u16) unk_0x12;
}; };
#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
@@ -48,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;
+22 -6
View File
@@ -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,14 +179,13 @@ 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 #if TARGET_PC
// HD additions // events for rando
u16 query054(mesg_flow_node_branch*, fopAc_ac_c*, int);
u16 query055(mesg_flow_node_branch*, fopAc_ac_c*, int);
int event043(mesg_flow_node_event*, fopAc_ac_c*); int event043(mesg_flow_node_event*, fopAc_ac_c*);
int event044(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 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 #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**);
@@ -194,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[DUSK_IF_ELSE(55, 53)]; static DUSK_GAME_DATA queryFunc mQueryList[DUSK_IF_ELSE(56, 53)];
static DUSK_GAME_DATA eventFunc mEventList[DUSK_IF_ELSE(46, 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;
+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 -5
View File
@@ -1292,6 +1292,9 @@ 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; }
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; }
@@ -1416,11 +1419,6 @@ dStage_KeepDoorInfo* dStage_GetKeepDoorInfo();
dStage_KeepDoorInfo* dStage_GetRoomKeepDoorInfo(); dStage_KeepDoorInfo* dStage_GetRoomKeepDoorInfo();
void dStage_dt_c_fieldMapLoader(void* i_data, dStage_dt_c* i_stage); void dStage_dt_c_fieldMapLoader(void* i_data, dStage_dt_c* i_stage);
#if TARGET_PC
// TP HD Cave of Shadows (D_SB11): reveal the los next-floor when a descent gate opens.
void dStage_showLOSNextFloor(int fromRoom);
#endif
#if DEBUG #if DEBUG
void dStage_DebugDisp(); void dStage_DebugDisp();
#endif #endif
+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 */
+6 -2
View File
@@ -67,6 +67,10 @@ 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;
@@ -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; }
@@ -1761,16 +1761,6 @@ public:
virtual ~J3DIndBlockNull() {} virtual ~J3DIndBlockNull() {}
}; };
#ifdef DUSK_TPHD
struct PolygonOffset {
BE(f32) mFrontOffset;
BE(f32) mFrontScale;
BE(f32) mBackOffset;
BE(f32) mBackScale;
BE(f32) mClamp;
};
#endif
/** /**
* @ingroup jsystem-j3d * @ingroup jsystem-j3d
* *
@@ -1803,10 +1793,6 @@ public:
virtual void setDither(u8 const*) {} virtual void setDither(u8 const*) {}
virtual void setDither(u8) {} virtual void setDither(u8) {}
virtual u8 getDither() const { return 0; } virtual u8 getDither() const { return 0; }
#ifdef DUSK_TPHD
virtual void setPolygonOffset(const PolygonOffset&) {}
virtual PolygonOffset* getPolygonOffset() { return NULL; }
#endif
virtual u32 getFogOffset() const { return 0; } virtual u32 getFogOffset() const { return 0; }
virtual void setFogOffset(u32) {} virtual void setFogOffset(u32) {}
virtual ~J3DPEBlock() {} virtual ~J3DPEBlock() {}
@@ -1970,25 +1956,12 @@ public:
virtual void setFogOffset(u32 fogOffset) { mFogOffset = fogOffset; } virtual void setFogOffset(u32 fogOffset) { mFogOffset = fogOffset; }
virtual ~J3DPEBlockFull() {} virtual ~J3DPEBlockFull() {}
#ifdef DUSK_TPHD
virtual void setPolygonOffset(const PolygonOffset& offset) {
mPolygonOffset = offset;
}
virtual PolygonOffset* getPolygonOffset() {
return &mPolygonOffset;
}
#endif
/* 0x04 */ J3DFog mFog; /* 0x04 */ J3DFog mFog;
/* 0x30 */ J3DAlphaComp mAlphaComp; /* 0x30 */ J3DAlphaComp mAlphaComp;
/* 0x34 */ J3DBlend mBlend; /* 0x34 */ J3DBlend mBlend;
/* 0x38 */ J3DZMode mZMode; /* 0x38 */ J3DZMode mZMode;
/* 0x3A */ u8 mZCompLoc; /* 0x3A */ u8 mZCompLoc;
/* 0x3B */ u8 mDither; /* 0x3B */ u8 mDither;
#ifdef DUSK_TPHD
PolygonOffset mPolygonOffset;
#endif
/* 0x3C */ u32 mFogOffset; /* 0x3C */ u32 mFogOffset;
}; // Size: 0x40 }; // Size: 0x40
@@ -46,13 +46,6 @@ struct J3DMaterialInitData {
/* 0x14A */ BE(u16) mNBTScaleIdx; /* 0x14A */ BE(u16) mNBTScaleIdx;
}; // size 0x14C }; // size 0x14C
#ifdef DUSK_TPHD
struct J3DMaterialInitData_MAT4 : public J3DMaterialInitData {
/* 0x14C */ BE(u16) mPolygonOffsetIdx;
}; // size 0x14E
#endif
/** /**
* @ingroup jsystem-j3d * @ingroup jsystem-j3d
* *
@@ -150,29 +143,10 @@ public:
J3DNBTScale newNBTScale(int) const; J3DNBTScale newNBTScale(int) const;
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; } u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
#ifdef DUSK_TPHD
u8 getMaterialMode(int idx) const { return getMatInitData(idx)->mMaterialMode; }
#else
u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; } u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; }
#endif
#if DUSK_TPHD
const PolygonOffset newPolygonOffset(int) const;
J3DMaterialInitData* getMatInitData(int idx) const {
static const u32 sInitDataSizes[] = {0, 0, 0x138, 0x14C, 0x14E};
return (J3DMaterialInitData*)((u8*)mpMaterialInitData + sInitDataSizes[mBlockType] * getMaterialID(idx));
}
u16 mBlockType;
#endif
/* 0x00 */ u16 mMaterialNum; /* 0x00 */ u16 mMaterialNum;
#if DUSK_TPHD
/* 0x04 */ void* mpMaterialInitData;
#else
/* 0x04 */ J3DMaterialInitData* mpMaterialInitData; /* 0x04 */ J3DMaterialInitData* mpMaterialInitData;
#endif
/* 0x08 */ BE(u16)* mpMaterialID; /* 0x08 */ BE(u16)* mpMaterialID;
/* 0x0C */ J3DIndInitData* mpIndInitData; /* 0x0C */ J3DIndInitData* mpIndInitData;
/* 0x10 */ GXColor* mpMatColor; /* 0x10 */ GXColor* mpMatColor;
@@ -201,9 +175,6 @@ public:
/* 0x6C */ u8* mpZCompLoc; /* 0x6C */ u8* mpZCompLoc;
/* 0x70 */ u8* mpDither; /* 0x70 */ u8* mpDither;
/* 0x74 */ J3DNBTScaleInfo* mpNBTScaleInfo; /* 0x74 */ J3DNBTScaleInfo* mpNBTScaleInfo;
#ifdef DUSK_TPHD
PolygonOffset* mpPolygonOffsets;
#endif
/* 0x78 */ J3DDisplayListInit* mpDisplayListInit; /* 0x78 */ J3DDisplayListInit* mpDisplayListInit;
/* 0x7C */ J3DPatchingInfo* mpPatchingInfo; /* 0x7C */ J3DPatchingInfo* mpPatchingInfo;
/* 0x80 */ J3DCurrentMtxInfo* mpCurrentMtxInfo; /* 0x80 */ J3DCurrentMtxInfo* mpCurrentMtxInfo;
@@ -169,12 +169,6 @@ struct J3DMaterialBlock_v21 : public J3DModelBlock {
/* 0x74 */ OFFSET_PTR_V0 mpNBTScaleInfo; /* 0x74 */ OFFSET_PTR_V0 mpNBTScaleInfo;
}; };
#ifdef DUSK_TPHD
struct J3DMaterialBlock_MAT4 : public J3DMaterialBlock {
/* 0x84 */ OFFSET_PTR_V0 mpPolygonOffsets;
};
#endif
/** /**
* @ingroup jsystem-j3d * @ingroup jsystem-j3d
* *
@@ -7,9 +7,6 @@
#include "JSystem/J3DGraphBase/J3DMaterial.h" #include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/JMath/JMath.h" #include "JSystem/JMath/JMath.h"
#include "m_Do/m_Do_mtx.h" #include "m_Do/m_Do_mtx.h"
#if TARGET_PC
#include "dusk/settings.h"
#endif
void J3DMtxCalcJ3DSysInitBasic::init(Vec const& scale, Mtx const& mtx) { void J3DMtxCalcJ3DSysInitBasic::init(Vec const& scale, Mtx const& mtx) {
J3DSys::mCurrentS = scale; J3DSys::mCurrentS = scale;
@@ -181,23 +178,7 @@ void J3DJoint::entryIn() {
matPacket->setMaterialAnmID(mesh->getMaterialAnm()); matPacket->setMaterialAnmID(mesh->getMaterialAnm());
matPacket->setShapePacket(shapePacket); matPacket->setShapePacket(shapePacket);
bool isDrawModeOpaTexEdge = mesh->isDrawModeOpaTexEdge() == FALSE; bool isDrawModeOpaTexEdge = mesh->isDrawModeOpaTexEdge() == FALSE;
#if TARGET_PC
// TP HD J3DJoint::entryIn (FUN_02b57690):
J3DDrawBuffer* drawBuffer = j3dSys.getDrawBuffer(isDrawModeOpaTexEdge);
u8 r24;
if (dusk::tphd_active() && (mesh->mMaterialID & 0x80000000) != 0 &&
(mesh->getMaterialMode() & 0x20) != 0 &&
drawBuffer->getSortMode() == J3DDrawBufSortMode_Mat)
{
matPacket->drawClear();
shapePacket->drawClear();
r24 = drawBuffer->entryImm(matPacket, 1);
} else {
r24 = matPacket->entry(drawBuffer);
}
#else
u8 r24 = matPacket->entry(j3dSys.getDrawBuffer(isDrawModeOpaTexEdge)); u8 r24 = matPacket->entry(j3dSys.getDrawBuffer(isDrawModeOpaTexEdge));
#endif
if (r24) { if (r24) {
j3dSys.setMatPacket(matPacket); j3dSys.setMatPacket(matPacket);
J3DDrawBuffer::entryNum++; J3DDrawBuffer::entryNum++;
@@ -230,13 +230,6 @@ void J3DMatPacket::draw() {
#endif #endif
packet->getShape()->loadPreDrawSetting(); packet->getShape()->loadPreDrawSetting();
#if DUSK_TPHD
{
const auto* offs = mpMaterial->getPEBlock()->getPolygonOffset();
GX2SetPolygonOffset(offs->mFrontOffset, offs->mFrontScale, offs->mBackOffset, offs->mBackScale, offs->mClamp);
}
#endif
while (packet != NULL) { while (packet != NULL) {
if (packet->getDisplayListObj() != NULL) { if (packet->getDisplayListObj() != NULL) {
packet->getDisplayListObj()->callDL(); packet->getDisplayListObj()->callDL();
+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 = {
@@ -12,9 +12,6 @@
#include "dusk/logging.h" #include "dusk/logging.h"
J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) { J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) {
#ifdef DUSK_TPHD
mBlockType = (i_block.mBlockType & 0xFF) - 0x30; // get number at last byte of block name
#endif
mMaterialNum = i_block.mMaterialNum; mMaterialNum = i_block.mMaterialNum;
mpMaterialInitData = JSUConvertOffsetToPtr<J3DMaterialInitData>(&i_block, i_block.mpMaterialInitData); mpMaterialInitData = JSUConvertOffsetToPtr<J3DMaterialInitData>(&i_block, i_block.mpMaterialInitData);
mpMaterialID = JSUConvertOffsetToPtr<BE(u16)>(&i_block, i_block.mpMaterialID); mpMaterialID = JSUConvertOffsetToPtr<BE(u16)>(&i_block, i_block.mpMaterialID);
@@ -49,11 +46,6 @@ J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) {
mpZCompLoc = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpZCompLoc); mpZCompLoc = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpZCompLoc);
mpDither = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpDither); mpDither = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpDither);
mpNBTScaleInfo = JSUConvertOffsetToPtr<J3DNBTScaleInfo>(&i_block, i_block.mpNBTScaleInfo); mpNBTScaleInfo = JSUConvertOffsetToPtr<J3DNBTScaleInfo>(&i_block, i_block.mpNBTScaleInfo);
#ifdef DUSK_TPHD
if(mBlockType >= 4) {
mpPolygonOffsets = JSUConvertOffsetToPtr<PolygonOffset>(&i_block, reinterpret_cast<const J3DMaterialBlock_MAT4&>(i_block).mpPolygonOffsets);
}
#endif
mpDisplayListInit = NULL; mpDisplayListInit = NULL;
mpPatchingInfo = NULL; mpPatchingInfo = NULL;
mpCurrentMtxInfo = NULL; mpCurrentMtxInfo = NULL;
@@ -82,11 +74,7 @@ u16 J3DMaterialFactory::countUniqueMaterials() {
} }
u32 J3DMaterialFactory::countTexGens(int i_idx) const { u32 J3DMaterialFactory::countTexGens(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTexGenNumIdx != 0xff) { if (mtl_init_data->mTexGenNumIdx != 0xff) {
return mpTexGenNum[mtl_init_data->mTexGenNumIdx]; return mpTexGenNum[mtl_init_data->mTexGenNumIdx];
} }
@@ -94,11 +82,7 @@ u32 J3DMaterialFactory::countTexGens(int i_idx) const {
} }
u32 J3DMaterialFactory::countStages(int i_idx) const { u32 J3DMaterialFactory::countStages(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
u32 count1 = 0; u32 count1 = 0;
u32 count2 = 0; u32 count2 = 0;
if (mtl_init_data->mTevStageNumIdx != 0xff) { if (mtl_init_data->mTevStageNumIdx != 0xff) {
@@ -173,9 +157,6 @@ J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* i_material, i
i_material->mPEBlock->setZMode(newZMode(i_idx)); i_material->mPEBlock->setZMode(newZMode(i_idx));
i_material->mPEBlock->setZCompLoc(newZCompLoc(i_idx)); i_material->mPEBlock->setZCompLoc(newZCompLoc(i_idx));
i_material->mPEBlock->setDither(newDither(i_idx)); i_material->mPEBlock->setDither(newDither(i_idx));
#ifdef DUSK_TPHD
i_material->mPEBlock->setPolygonOffset(newPolygonOffset(i_idx));
#endif
i_material->mTevBlock->setTevStageNum(newTevStageNum(i_idx)); i_material->mTevBlock->setTevStageNum(newTevStageNum(i_idx));
for (u8 i = 0; i < tex_num; i++) { for (u8 i = 0; i < tex_num; i++) {
i_material->mTevBlock->setTexNo(i, newTexNo(i_idx, i)); i_material->mTevBlock->setTexNo(i, newTexNo(i_idx, i));
@@ -184,11 +165,7 @@ J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* i_material, i
i_material->mTevBlock->setTevOrder(i, newTevOrder(i_idx, i)); i_material->mTevBlock->setTevOrder(i, newTevOrder(i_idx, i));
} }
for (u8 i = 0; i < tev_stage_num_max; i++) { for (u8 i = 0; i < tev_stage_num_max; i++) {
#ifdef DUSK_TPHD
J3DMaterialInitData* material_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
i_material->mTevBlock->setTevStage(i, newTevStage(i_idx, i)); i_material->mTevBlock->setTevStage(i, newTevStage(i_idx, i));
if (material_init_data->mTevSwapModeIdx[i] != 0xffff) { if (material_init_data->mTevSwapModeIdx[i] != 0xffff) {
i_material->mTevBlock->getTevStage(i)->setTexSel( i_material->mTevBlock->getTevStage(i)->setTexSel(
@@ -223,11 +200,7 @@ J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* i_material, i
for (u8 i = 0; i < 8; i++) { for (u8 i = 0; i < 8; i++) {
i_material->mTexGenBlock->setTexMtx(i, newTexMtx(i_idx, i)); i_material->mTexGenBlock->setTexMtx(i, newTexMtx(i_idx, i));
} }
#ifdef DUSK_TPHD
J3DMaterialInitData* material_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
for (u8 i = 0; i < tev_stage_num_max; i++) { for (u8 i = 0; i < tev_stage_num_max; i++) {
if (material_init_data->mTevKColorSel[i] != 0xff) { if (material_init_data->mTevKColorSel[i] != 0xff) {
i_material->mTevBlock->setTevKColorSel(i, material_init_data->mTevKColorSel[i]); i_material->mTevBlock->setTevKColorSel(i, material_init_data->mTevKColorSel[i]);
@@ -300,11 +273,7 @@ J3DMaterial* J3DMaterialFactory::createPatchedMaterial(J3DMaterial* i_material,
i_material->mTevBlock->setTevColor(i, newTevColor(i_idx, i)); i_material->mTevBlock->setTevColor(i, newTevColor(i_idx, i));
} }
for (u8 i = 0; i < tev_stage_num; i++) { for (u8 i = 0; i < tev_stage_num; i++) {
#ifdef DUSK_TPHD
J3DMaterialInitData* material_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
i_material->mTevBlock->setTevStage(i, newTevStage(i_idx, i)); i_material->mTevBlock->setTevStage(i, newTevStage(i_idx, i));
if (material_init_data->mTevSwapModeIdx[i] != 0xffff) { if (material_init_data->mTevSwapModeIdx[i] != 0xffff) {
i_material->mTevBlock->getTevStage(i)->setTexSel( i_material->mTevBlock->getTevStage(i)->setTexSel(
@@ -313,11 +282,7 @@ J3DMaterial* J3DMaterialFactory::createPatchedMaterial(J3DMaterial* i_material,
mpTevSwapModeInfo[material_init_data->mTevSwapModeIdx[i]].mRasSel); mpTevSwapModeInfo[material_init_data->mTevSwapModeIdx[i]].mRasSel);
} }
} }
#ifdef DUSK_TPHD
J3DMaterialInitData* init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
for (u8 i = 0; i < tev_stage_num; i++) { for (u8 i = 0; i < tev_stage_num; i++) {
if (init_data->mTevKColorSel[i] != 0xff) { if (init_data->mTevKColorSel[i] != 0xff) {
i_material->mTevBlock->setTevKColorSel(i, init_data->mTevKColorSel[i]); i_material->mTevBlock->setTevKColorSel(i, init_data->mTevKColorSel[i]);
@@ -458,11 +423,7 @@ u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial* i_material, int i_id
size += J3DMaterial::calcSizeTevBlock((u16)tev_stage_num_max); size += J3DMaterial::calcSizeTevBlock((u16)tev_stage_num_max);
size += J3DMaterial::calcSizeIndBlock(ind_flag); size += J3DMaterial::calcSizeIndBlock(ind_flag);
size += J3DMaterial::calcSizePEBlock(pe_flag, getMaterialMode(i_idx)); size += J3DMaterial::calcSizePEBlock(pe_flag, getMaterialMode(i_idx));
#ifdef DUSK_TPHD
J3DMaterialInitData* init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
for (u32 i = 0; i < 8; i++) { for (u32 i = 0; i < 8; i++) {
if (init_data->mTexMtxIdx[i] != 0xffff) { if (init_data->mTexMtxIdx[i] != 0xffff) {
size += sizeof(J3DTexMtx); size += sizeof(J3DTexMtx);
@@ -483,11 +444,7 @@ u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* i_material, int i_i
size += sizeof(J3DTevBlockPatched); size += sizeof(J3DTevBlockPatched);
size += J3DMaterial::calcSizeIndBlock(ind_flag); size += J3DMaterial::calcSizeIndBlock(ind_flag);
size += J3DMaterial::calcSizePEBlock(0x10000000, getMaterialMode(i_idx)); size += J3DMaterial::calcSizePEBlock(0x10000000, getMaterialMode(i_idx));
#ifdef DUSK_TPHD
J3DMaterialInitData* init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
for (u32 i = 0; i < 8; i++) { for (u32 i = 0; i < 8; i++) {
if (init_data->mTexMtxIdx[i] != 0xffff) { if (init_data->mTexMtxIdx[i] != 0xffff) {
size += sizeof(J3DTexMtx); size += sizeof(J3DTexMtx);
@@ -517,11 +474,7 @@ J3DGXColor J3DMaterialFactory::newMatColor(int i_idx, int i_no) const {
#else #else
J3DGXColor dflt = GXColor{0xff, 0xff, 0xff, 0xff}; J3DGXColor dflt = GXColor{0xff, 0xff, 0xff, 0xff};
#endif #endif
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mMatColorIdx[i_no] != 0xffff) { if (mtl_init_data->mMatColorIdx[i_no] != 0xffff) {
return (GXColor) mpMatColor[mtl_init_data->mMatColorIdx[i_no]]; return (GXColor) mpMatColor[mtl_init_data->mMatColorIdx[i_no]];
} else { } else {
@@ -530,11 +483,7 @@ J3DGXColor J3DMaterialFactory::newMatColor(int i_idx, int i_no) const {
} }
const u8 J3DMaterialFactory::newColorChanNum(int i_idx) const { const u8 J3DMaterialFactory::newColorChanNum(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mColorChanNumIdx != 0xff) { if (mtl_init_data->mColorChanNumIdx != 0xff) {
return mpColorChanNum[mtl_init_data->mColorChanNumIdx]; return mpColorChanNum[mtl_init_data->mColorChanNumIdx];
} else { } else {
@@ -544,11 +493,7 @@ const u8 J3DMaterialFactory::newColorChanNum(int i_idx) const {
J3DColorChan J3DMaterialFactory::newColorChan(int i_idx, int i_no) const { J3DColorChan J3DMaterialFactory::newColorChan(int i_idx, int i_no) const {
u32 r29 = 0; u32 r29 = 0;
#ifdef DUSK_TPHD
J3DMaterialInitData* init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (init_data->mColorChanIdx[i_no] != 0xffff) { if (init_data->mColorChanIdx[i_no] != 0xffff) {
return J3DColorChan(mpColorChanInfo[init_data->mColorChanIdx[i_no]]); return J3DColorChan(mpColorChanInfo[init_data->mColorChanIdx[i_no]]);
} else { } else {
@@ -562,11 +507,7 @@ J3DGXColor J3DMaterialFactory::newAmbColor(int i_idx, int i_no) const {
#else #else
J3DGXColor dflt = GXColor{0x32, 0x32, 0x32, 0x32}; J3DGXColor dflt = GXColor{0x32, 0x32, 0x32, 0x32};
#endif #endif
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mAmbColorIdx[i_no] != 0xffff) { if (mtl_init_data->mAmbColorIdx[i_no] != 0xffff) {
return (GXColor) mpAmbColor[mtl_init_data->mAmbColorIdx[i_no]]; return (GXColor) mpAmbColor[mtl_init_data->mAmbColorIdx[i_no]];
} else { } else {
@@ -576,11 +517,7 @@ J3DGXColor J3DMaterialFactory::newAmbColor(int i_idx, int i_no) const {
u32 J3DMaterialFactory::newTexGenNum(int i_idx) const { u32 J3DMaterialFactory::newTexGenNum(int i_idx) const {
u32 r30 = 0; u32 r30 = 0;
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTexGenNumIdx != 0xff) { if (mtl_init_data->mTexGenNumIdx != 0xff) {
return mpTexGenNum[mtl_init_data->mTexGenNumIdx]; return mpTexGenNum[mtl_init_data->mTexGenNumIdx];
} else { } else {
@@ -589,11 +526,7 @@ u32 J3DMaterialFactory::newTexGenNum(int i_idx) const {
} }
J3DTexCoord J3DMaterialFactory::newTexCoord(int i_idx, int i_no) const { J3DTexCoord J3DMaterialFactory::newTexCoord(int i_idx, int i_no) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTexCoordIdx[i_no] != 0xffff) { if (mtl_init_data->mTexCoordIdx[i_no] != 0xffff) {
return J3DTexCoord(mpTexCoordInfo[mtl_init_data->mTexCoordIdx[i_no]]); return J3DTexCoord(mpTexCoordInfo[mtl_init_data->mTexCoordIdx[i_no]]);
} else { } else {
@@ -603,11 +536,7 @@ J3DTexCoord J3DMaterialFactory::newTexCoord(int i_idx, int i_no) const {
J3DTexMtx* J3DMaterialFactory::newTexMtx(int i_idx, int i_no) const { J3DTexMtx* J3DMaterialFactory::newTexMtx(int i_idx, int i_no) const {
J3DTexMtx* tex_mtx = NULL; J3DTexMtx* tex_mtx = NULL;
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTexMtxIdx[i_no] != 0xffff) { if (mtl_init_data->mTexMtxIdx[i_no] != 0xffff) {
#if TARGET_LITTLE_ENDIAN #if TARGET_LITTLE_ENDIAN
auto tex_mtx_info = mpTexMtxInfo[mtl_init_data->mTexMtxIdx[i_no]]; auto tex_mtx_info = mpTexMtxInfo[mtl_init_data->mTexMtxIdx[i_no]];
@@ -629,11 +558,7 @@ J3DTexMtx* J3DMaterialFactory::newTexMtx(int i_idx, int i_no) const {
u8 J3DMaterialFactory::newCullMode(int i_idx) const { u8 J3DMaterialFactory::newCullMode(int i_idx) const {
u32 r30 = 0; u32 r30 = 0;
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mCullModeIdx != 0xff) { if (mtl_init_data->mCullModeIdx != 0xff) {
return mpCullMode[mtl_init_data->mCullModeIdx]; return mpCullMode[mtl_init_data->mCullModeIdx];
} else { } else {
@@ -642,11 +567,7 @@ u8 J3DMaterialFactory::newCullMode(int i_idx) const {
} }
u16 J3DMaterialFactory::newTexNo(int i_idx, int i_no) const { u16 J3DMaterialFactory::newTexNo(int i_idx, int i_no) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTexNoIdx[i_no] != 0xffff) { if (mtl_init_data->mTexNoIdx[i_no] != 0xffff) {
return mpTexNo[mtl_init_data->mTexNoIdx[i_no]]; return mpTexNo[mtl_init_data->mTexNoIdx[i_no]];
} else { } else {
@@ -655,11 +576,7 @@ u16 J3DMaterialFactory::newTexNo(int i_idx, int i_no) const {
} }
J3DTevOrder J3DMaterialFactory::newTevOrder(int i_idx, int i_no) const { J3DTevOrder J3DMaterialFactory::newTevOrder(int i_idx, int i_no) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTevOrderIdx[i_no] != 0xffff) { if (mtl_init_data->mTevOrderIdx[i_no] != 0xffff) {
return J3DTevOrder(mpTevOrderInfo[mtl_init_data->mTevOrderIdx[i_no]]); return J3DTevOrder(mpTevOrderInfo[mtl_init_data->mTevOrderIdx[i_no]]);
} else { } else {
@@ -670,11 +587,7 @@ J3DTevOrder J3DMaterialFactory::newTevOrder(int i_idx, int i_no) const {
J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const { J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const {
GXColorS10 _dflt = {0, 0, 0, 0}; GXColorS10 _dflt = {0, 0, 0, 0};
J3DGXColorS10 dflt = _dflt; J3DGXColorS10 dflt = _dflt;
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) { if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) {
return (GXColorS10) mpTevColor[mtl_init_data->mTevColorIdx[i_no]]; return (GXColorS10) mpTevColor[mtl_init_data->mTevColorIdx[i_no]];
} else { } else {
@@ -688,11 +601,7 @@ J3DGXColor J3DMaterialFactory::newTevKColor(int i_idx, int i_no) const {
#else #else
J3DGXColor dflt = GXColor{0xff, 0xff, 0xff, 0xff}; J3DGXColor dflt = GXColor{0xff, 0xff, 0xff, 0xff};
#endif #endif
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTevKColorIdx[i_no] != 0xffff) { if (mtl_init_data->mTevKColorIdx[i_no] != 0xffff) {
return (GXColor) mpTevKColor[mtl_init_data->mTevKColorIdx[i_no]]; return (GXColor) mpTevKColor[mtl_init_data->mTevKColorIdx[i_no]];
} else { } else {
@@ -701,11 +610,7 @@ J3DGXColor J3DMaterialFactory::newTevKColor(int i_idx, int i_no) const {
} }
const u8 J3DMaterialFactory::newTevStageNum(int i_idx) const { const u8 J3DMaterialFactory::newTevStageNum(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTevStageNumIdx != 0xff) { if (mtl_init_data->mTevStageNumIdx != 0xff) {
return mpTevStageNum[mtl_init_data->mTevStageNumIdx]; return mpTevStageNum[mtl_init_data->mTevStageNumIdx];
} else { } else {
@@ -714,11 +619,7 @@ const u8 J3DMaterialFactory::newTevStageNum(int i_idx) const {
} }
J3DTevStage J3DMaterialFactory::newTevStage(int i_idx, int i_no) const { J3DTevStage J3DMaterialFactory::newTevStage(int i_idx, int i_no) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTevStageIdx[i_no] != 0xffff) { if (mtl_init_data->mTevStageIdx[i_no] != 0xffff) {
return J3DTevStage(mpTevStageInfo[mtl_init_data->mTevStageIdx[i_no]]); return J3DTevStage(mpTevStageInfo[mtl_init_data->mTevStageIdx[i_no]]);
} else { } else {
@@ -727,11 +628,7 @@ J3DTevStage J3DMaterialFactory::newTevStage(int i_idx, int i_no) const {
} }
J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int i_idx, int i_no) const { J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int i_idx, int i_no) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mTevSwapModeTableIdx[i_no] != 0xffff) { if (mtl_init_data->mTevSwapModeTableIdx[i_no] != 0xffff) {
return J3DTevSwapModeTable(mpTevSwapModeTableInfo[mtl_init_data->mTevSwapModeTableIdx[i_no]]); return J3DTevSwapModeTable(mpTevSwapModeTableInfo[mtl_init_data->mTevSwapModeTableIdx[i_no]]);
} else { } else {
@@ -792,11 +689,7 @@ J3DIndTexCoordScale J3DMaterialFactory::newIndTexCoordScale(int i_idx, int i_no)
J3DFog J3DMaterialFactory::newFog(int i_idx) const { J3DFog J3DMaterialFactory::newFog(int i_idx) const {
J3DFog fog; J3DFog fog;
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mFogIdx != 0xffff) { if (mtl_init_data->mFogIdx != 0xffff) {
#if TARGET_LITTLE_ENDIAN #if TARGET_LITTLE_ENDIAN
J3DFogInfo fogInfo = mpFogInfo[mtl_init_data->mFogIdx]; J3DFogInfo fogInfo = mpFogInfo[mtl_init_data->mFogIdx];
@@ -816,11 +709,7 @@ J3DFog J3DMaterialFactory::newFog(int i_idx) const {
} }
J3DAlphaComp J3DMaterialFactory::newAlphaComp(int i_idx) const { J3DAlphaComp J3DMaterialFactory::newAlphaComp(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mAlphaCompIdx != 0xffff) { if (mtl_init_data->mAlphaCompIdx != 0xffff) {
return J3DAlphaComp(mpAlphaCompInfo[mtl_init_data->mAlphaCompIdx]); return J3DAlphaComp(mpAlphaCompInfo[mtl_init_data->mAlphaCompIdx]);
} else { } else {
@@ -829,11 +718,7 @@ J3DAlphaComp J3DMaterialFactory::newAlphaComp(int i_idx) const {
} }
J3DBlend J3DMaterialFactory::newBlend(int i_idx) const { J3DBlend J3DMaterialFactory::newBlend(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mBlendIdx != 0xffff) { if (mtl_init_data->mBlendIdx != 0xffff) {
return J3DBlend(mpBlendInfo[mtl_init_data->mBlendIdx]); return J3DBlend(mpBlendInfo[mtl_init_data->mBlendIdx]);
} else { } else {
@@ -843,11 +728,7 @@ J3DBlend J3DMaterialFactory::newBlend(int i_idx) const {
J3DZMode J3DMaterialFactory::newZMode(int i_idx) const { J3DZMode J3DMaterialFactory::newZMode(int i_idx) const {
u32 r29 = 0; u32 r29 = 0;
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mZModeIdx != 0xff) { if (mtl_init_data->mZModeIdx != 0xff) {
return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]); return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]);
} else { } else {
@@ -856,11 +737,7 @@ J3DZMode J3DMaterialFactory::newZMode(int i_idx) const {
} }
const u8 J3DMaterialFactory::newZCompLoc(int i_idx) const { const u8 J3DMaterialFactory::newZCompLoc(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mZCompLocIdx != 0xff){ if (mtl_init_data->mZCompLocIdx != 0xff){
return mpZCompLoc[mtl_init_data->mZCompLocIdx]; return mpZCompLoc[mtl_init_data->mZCompLocIdx];
} else { } else {
@@ -869,11 +746,7 @@ const u8 J3DMaterialFactory::newZCompLoc(int i_idx) const {
} }
const u8 J3DMaterialFactory::newDither(int i_idx) const { const u8 J3DMaterialFactory::newDither(int i_idx) const {
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mDitherIdx != 0xff){ if (mtl_init_data->mDitherIdx != 0xff){
return mpDither[mtl_init_data->mDitherIdx]; return mpDither[mtl_init_data->mDitherIdx];
} else { } else {
@@ -881,24 +754,9 @@ const u8 J3DMaterialFactory::newDither(int i_idx) const {
} }
} }
#ifdef DUSK_TPHD
const PolygonOffset J3DMaterialFactory::newPolygonOffset(int i_idx) const {
J3DMaterialInitData_MAT4* mtl_init_data = (J3DMaterialInitData_MAT4*)getMatInitData(i_idx);
if (mBlockType >= 4 && mtl_init_data->mPolygonOffsetIdx != 0xffff){
return mpPolygonOffsets[mtl_init_data->mPolygonOffsetIdx];
} else {
return PolygonOffset{0.0f, 0.0f, 0.0f, 0.0f, 0.0f};
}
}
#endif
J3DNBTScale J3DMaterialFactory::newNBTScale(int i_idx) const { J3DNBTScale J3DMaterialFactory::newNBTScale(int i_idx) const {
J3DNBTScale dflt(j3dDefaultNBTScaleInfo); J3DNBTScale dflt(j3dDefaultNBTScaleInfo);
#ifdef DUSK_TPHD
J3DMaterialInitData* mtl_init_data = getMatInitData(i_idx);
#else
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]]; J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
#endif
if (mtl_init_data->mNBTScaleIdx != 0xffff) { if (mtl_init_data->mNBTScaleIdx != 0xffff) {
return J3DNBTScale(mpNBTScaleInfo[mtl_init_data->mNBTScaleIdx]); return J3DNBTScale(mpNBTScaleInfo[mtl_init_data->mNBTScaleIdx]);
} else { } else {
@@ -103,9 +103,6 @@ J3DModelData* J3DModelLoader::load(void const* i_data, u32 i_flags) {
readJoint((J3DJointBlock*)block); readJoint((J3DJointBlock*)block);
break; break;
case 'MAT3': case 'MAT3':
#if DUSK_TPHD
case 'MAT4':
#endif
readMaterial((J3DMaterialBlock*)block, (s32)i_flags); readMaterial((J3DMaterialBlock*)block, (s32)i_flags);
break; break;
case 'MAT2': case 'MAT2':
@@ -150,9 +147,6 @@ J3DMaterialTable* J3DModelLoader::loadMaterialTable(void const* i_data) {
for (u32 block_no = 0; block_no < data->mBlockNum; block_no++) { for (u32 block_no = 0; block_no < data->mBlockNum; block_no++) {
switch (block->mBlockType) { switch (block->mBlockType) {
case 'MAT3': case 'MAT3':
#if DUSK_TPHD
case 'MAT4':
#endif
readMaterialTable((J3DMaterialBlock*)block, flags); readMaterialTable((J3DMaterialBlock*)block, flags);
break; break;
case 'MAT2': case 'MAT2':
@@ -218,9 +212,6 @@ J3DModelData* J3DModelLoader::loadBinaryDisplayList(void const* i_data, u32 i_fl
modifyMaterial(i_flags); modifyMaterial(i_flags);
break; break;
case 'MAT3': case 'MAT3':
#if DUSK_TPHD
case 'MAT4':
#endif
flags = 0x50100000; flags = 0x50100000;
flags |= (i_flags & 0x3000000); flags |= (i_flags & 0x3000000);
mpMaterialBlock = (J3DMaterialBlock*)block; mpMaterialBlock = (J3DMaterialBlock*)block;
@@ -317,22 +308,8 @@ static GXVtxAttrFmtList getFmt(GXVtxAttrFmtList* i_fmtList, GXAttr i_attr) {
return *i_fmtList; return *i_fmtList;
} }
} }
#if DUSK_TPHD
// HD BMDs occasionally have vertex arrays without a format entry. Mirror
// the GC runtime: fall back to J3DSys::initGX defaults.
GXVtxAttrFmtList def{};
def.attr = i_attr;
def.frac = 0;
if (i_attr == GX_VA_POS) { def.cnt = GX_POS_XYZ; def.type = GX_F32; }
else if (i_attr == GX_VA_NRM) { def.cnt = GX_NRM_XYZ; def.type = GX_F32; }
else if (i_attr == GX_VA_NBT) { def.cnt = GX_NRM_NBT; def.type = GX_F32; }
else if (i_attr >= GX_VA_CLR0 &&
i_attr <= GX_VA_CLR1) { def.cnt = GX_CLR_RGBA; def.type = GX_RGBA8; }
else { def.cnt = GX_TEX_ST; def.type = GX_F32; }
return def;
#else
OSPanic(__FILE__, __LINE__, "Unable to find vertex attribute format!"); OSPanic(__FILE__, __LINE__, "Unable to find vertex attribute format!");
#endif
} }
#endif #endif
@@ -16,7 +16,7 @@ u16 J3DModelLoader::countMaterialNum(const void* stream) {
const J3DModelBlock* block = header->mBlocks; const J3DModelBlock* block = header->mBlocks;
for (int i = 0; i < header->mBlockNum; i++) for (int i = 0; i < header->mBlockNum; i++)
{ {
if (block->mBlockType == 'MAT3' || block->mBlockType == 'MAT4') { if (block->mBlockType == 'MAT3') {
const J3DMaterialBlock* materialBlock = (const J3DMaterialBlock*)block; const J3DMaterialBlock* materialBlock = (const J3DMaterialBlock*)block;
return materialBlock->mMaterialNum; return materialBlock->mMaterialNum;
} }
@@ -45,7 +45,6 @@ u32 J3DModelLoader::calcLoadSize(void const* stream, u32 flags_) {
size += calcSizeJoint((const J3DJointBlock*)nextBlock); size += calcSizeJoint((const J3DJointBlock*)nextBlock);
break; break;
case 'MAT3': case 'MAT3':
case 'MAT4':
size += calcSizeMaterial((const J3DMaterialBlock*)nextBlock, flags); size += calcSizeMaterial((const J3DMaterialBlock*)nextBlock, flags);
break; break;
case 'SHP1': case 'SHP1':
@@ -87,7 +86,6 @@ u32 J3DModelLoader::calcLoadMaterialTableSize(const void* stream) {
for (u32 i = 0; i < header->mBlockNum; i++) { for (u32 i = 0; i < header->mBlockNum; i++) {
switch (nextBlock->mBlockType) { switch (nextBlock->mBlockType) {
case 'MAT3': case 'MAT3':
case 'MAT4':
size += calcSizeMaterialTable((const J3DMaterialBlock*)nextBlock, flags); size += calcSizeMaterialTable((const J3DMaterialBlock*)nextBlock, flags);
break; break;
case 'TEX1': case 'TEX1':
@@ -137,8 +135,7 @@ u32 J3DModelLoader::calcLoadBinaryDisplayListSize(const void* stream, u32 flags)
case 'MDL3': case 'MDL3':
size += calcSizeMaterialDL((const J3DMaterialDLBlock*)nextBlock, flags); size += calcSizeMaterialDL((const J3DMaterialDLBlock*)nextBlock, flags);
break; break;
case 'MAT3': case 'MAT3': {
case 'MAT4': {
u32 flags2 = (J3DMLF_21 | J3DMLF_Material_PE_Full | J3DMLF_Material_Color_LightOn); u32 flags2 = (J3DMLF_21 | J3DMLF_Material_PE_Full | J3DMLF_Material_Color_LightOn);
flags2 |= (u32)flags & (J3DMLF_Material_UseIndirect | J3DMLF_26); flags2 |= (u32)flags & (J3DMLF_Material_UseIndirect | J3DMLF_26);
mpMaterialBlock = (const J3DMaterialBlock*)nextBlock; mpMaterialBlock = (const J3DMaterialBlock*)nextBlock;
+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,
+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();
+2 -2
View File
@@ -452,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,
@@ -11,11 +11,6 @@
#include <cstring> #include <cstring>
#include "os_report.h" #include "os_report.h"
#if DUSK_TPHD
#include "dusk/settings.h"
#include "dusk/tphd/HdAssetLayer.hpp"
#endif
JKRAramArchive::JKRAramArchive() {} JKRAramArchive::JKRAramArchive() {}
JKRAramArchive::JKRAramArchive(s32 entryNumber, JKRArchive::EMountDirection mountDirection) JKRAramArchive::JKRAramArchive(s32 entryNumber, JKRArchive::EMountDirection mountDirection)
@@ -222,13 +217,6 @@ void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) {
if (compression == COMPRESSION_YAZ0) { if (compression == COMPRESSION_YAZ0) {
this->setExpandSize(pEntry, *pOutSize); this->setExpandSize(pEntry, *pOutSize);
} }
#if DUSK_TPHD
// ARAM mounts bypass register_mounted_hd_archive; hook the fresh per-file buffer here.
if (dusk::tphd_active() && mStringTable != NULL) {
dusk::tphd::register_copied_hd_resource(
mEntryNum, mStringTable + pEntry->getNameOffset(), outBuf, *pOutSize);
}
#endif
} else { } else {
if (compression == COMPRESSION_YAZ0) { if (compression == COMPRESSION_YAZ0) {
*pOutSize = this->getExpandSize(pEntry); *pOutSize = this->getExpandSize(pEntry);
@@ -9,24 +9,6 @@
#include "JSystem/JKernel/JKRMemArchive.h" #include "JSystem/JKernel/JKRMemArchive.h"
#include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JUtility/JUTAssert.h"
#if DUSK_TPHD
#include "dusk/tphd/HdAssetLayer.hpp"
namespace {
void register_copied_hd_resource(
JKRArchive* archive, JKRArchive::SDIFileEntry* fileEntry, void* buffer, u32 resourceSize) {
if (archive == NULL || fileEntry == NULL || buffer == NULL || resourceSize == 0 ||
archive->mStringTable == NULL)
{
return;
}
dusk::tphd::register_copied_hd_resource(archive->mEntryNum,
archive->mStringTable + fileEntry->getNameOffset(), buffer, resourceSize);
}
} // namespace
#endif
JKRArchive* JKRArchive::check_mount_already(s32 entryNum, JKRHeap* heap) { JKRArchive* JKRArchive::check_mount_already(s32 entryNum, JKRHeap* heap) {
if (heap == NULL) { if (heap == NULL) {
heap = JKRGetCurrentHeap(); heap = JKRGetCurrentHeap();
@@ -214,9 +196,6 @@ u32 JKRArchive::readResource(void* buffer, u32 bufferSize, u32 type, const char*
if (fileEntry) { if (fileEntry) {
u32 resourceSize; u32 resourceSize;
fetchResource(buffer, bufferSize, fileEntry, &resourceSize); fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
#if DUSK_TPHD
register_copied_hd_resource(this, fileEntry, buffer, resourceSize);
#endif
return resourceSize; return resourceSize;
} }
@@ -235,9 +214,6 @@ u32 JKRArchive::readResource(void* buffer, u32 bufferSize, const char* path) {
if (fileEntry) { if (fileEntry) {
u32 resourceSize; u32 resourceSize;
fetchResource(buffer, bufferSize, fileEntry, &resourceSize); fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
#if DUSK_TPHD
register_copied_hd_resource(this, fileEntry, buffer, resourceSize);
#endif
return resourceSize; return resourceSize;
} }
@@ -250,9 +226,6 @@ u32 JKRArchive::readIdxResource(void* buffer, u32 bufferSize, u32 index) {
if (fileEntry) { if (fileEntry) {
u32 resourceSize; u32 resourceSize;
fetchResource(buffer, bufferSize, fileEntry, &resourceSize); fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
#if DUSK_TPHD
register_copied_hd_resource(this, fileEntry, buffer, resourceSize);
#endif
return resourceSize; return resourceSize;
} }
@@ -265,9 +238,6 @@ u32 JKRArchive::readResource(void* buffer, u32 bufferSize, u16 id) {
if (fileEntry) { if (fileEntry) {
u32 resourceSize; u32 resourceSize;
fetchResource(buffer, bufferSize, fileEntry, &resourceSize); fetchResource(buffer, bufferSize, fileEntry, &resourceSize);
#if DUSK_TPHD
register_copied_hd_resource(this, fileEntry, buffer, resourceSize);
#endif
return resourceSize; return resourceSize;
} }
@@ -10,10 +10,6 @@
#include <stdint.h> #include <stdint.h>
#include "os_report.h" #include "os_report.h"
#if DUSK_TPHD
#include "dusk/tphd/HdAssetLayer.hpp"
#endif
JKRMemArchive::JKRMemArchive(s32 entryNum, JKRArchive::EMountDirection mountDirection) JKRMemArchive::JKRMemArchive(s32 entryNum, JKRArchive::EMountDirection mountDirection)
: JKRArchive(entryNum, MOUNT_MEM) { : JKRArchive(entryNum, MOUNT_MEM) {
mIsMounted = false; mIsMounted = false;
@@ -71,13 +67,8 @@ bool JKRMemArchive::open(s32 entryNum, JKRArchive::EMountDirection mountDirectio
mIsOpen = false; mIsOpen = false;
mMountDirection = mountDirection; mMountDirection = mountDirection;
#ifdef TARGET_PC
u32 loadedSize = 0;
#endif
if (mMountDirection == JKRArchive::MOUNT_DIRECTION_HEAD) { if (mMountDirection == JKRArchive::MOUNT_DIRECTION_HEAD) {
#ifndef TARGET_PC
u32 loadedSize; u32 loadedSize;
#endif
mArcHeader = (SArcHeader *)JKRDvdToMainRam( mArcHeader = (SArcHeader *)JKRDvdToMainRam(
entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, JKRDvdRipper::ALLOC_DIRECTION_FORWARD, entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, JKRDvdRipper::ALLOC_DIRECTION_FORWARD,
0, (int *)&mCompression, &loadedSize); 0, (int *)&mCompression, &loadedSize);
@@ -86,9 +77,7 @@ bool JKRMemArchive::open(s32 entryNum, JKRArchive::EMountDirection mountDirectio
} }
} }
else { else {
#ifndef TARGET_PC
u32 loadedSize; u32 loadedSize;
#endif
mArcHeader = (SArcHeader *)JKRDvdToMainRam( mArcHeader = (SArcHeader *)JKRDvdToMainRam(
entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap, entryNum, NULL, EXPAND_SWITCH_UNKNOWN1, 0, mHeap,
JKRDvdRipper::ALLOC_DIRECTION_BACKWARD, 0, (int *)&mCompression, &loadedSize); JKRDvdRipper::ALLOC_DIRECTION_BACKWARD, 0, (int *)&mCompression, &loadedSize);
@@ -101,9 +90,6 @@ bool JKRMemArchive::open(s32 entryNum, JKRArchive::EMountDirection mountDirectio
mMountMode = UNKNOWN_MOUNT_MODE; mMountMode = UNKNOWN_MOUNT_MODE;
} }
else { else {
#if DUSK_TPHD
dusk::tphd::register_mounted_hd_archive(entryNum, mArcHeader, loadedSize);
#endif
JUT_ASSERT(438, mArcHeader->signature == 'RARC'); JUT_ASSERT(438, mArcHeader->signature == 'RARC');
mArcInfoBlock = (SArcDataInfo *)((u8 *)mArcHeader + mArcHeader->header_length); mArcInfoBlock = (SArcDataInfo *)((u8 *)mArcHeader + mArcHeader->header_length);
mNodes = (SDIDirEntry *)((u8 *)&mArcInfoBlock->num_nodes + mArcInfoBlock->node_offset); mNodes = (SDIDirEntry *)((u8 *)&mArcInfoBlock->num_nodes + mArcInfoBlock->node_offset);
+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
+25
View File
@@ -7,6 +7,11 @@
#include "JSystem/JMessage/control.h" #include "JSystem/JMessage/control.h"
#if TARGET_PC
#include "dusk/randomizer/game/custom_flow_ids.hpp"
#include "dusk/randomizer/game/messages.hpp"
#endif
JMessage::TControl::TControl() JMessage::TControl::TControl()
: pSequenceProcessor_(NULL), : pSequenceProcessor_(NULL),
pRenderingProcessor_(NULL), pRenderingProcessor_(NULL),
@@ -71,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;
} }
@@ -80,6 +91,16 @@ 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) {
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;
} }
@@ -90,6 +111,10 @@ bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const*
JUT_ASSERT(155, pResourceCache_!=NULL); JUT_ASSERT(155, pResourceCache_!=NULL);
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
pMessageText_current_ = pMessageText_begin_; pMessageText_current_ = pMessageText_begin_;
oStack_renderingProcessor_.clear(); oStack_renderingProcessor_.clear();
return true; return true;
+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,
@@ -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,
+1 -1
View File
@@ -43,7 +43,7 @@ void* __piReg;
GXBool __GXinBegin; GXBool __GXinBegin;
#endif #endif
ATTRIBUTE_ALIGN(32) static u16 DefaultTexData[] = { static u16 DefaultTexData[] ATTRIBUTE_ALIGN(32) = {
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
}; };
+5 -5
View File
@@ -7,11 +7,11 @@ const char* __MCCVersion = "<< Dolphin SDK - MCC\tdebug build: Apr 5 2004 03:57
const char* __MCCVersion = "<< Dolphin SDK - MCC\trelease build: Apr 5 2004 04:15:49 (0x2301) >>"; const char* __MCCVersion = "<< Dolphin SDK - MCC\trelease build: Apr 5 2004 04:15:49 (0x2301) >>";
#endif #endif
ATTRIBUTE_ALIGN(32) static MCC_ChannelInfo gChannelInfo[16]; static MCC_ChannelInfo gChannelInfo[16] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static char gStreamWork[32]; static char gStreamWork[32] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static char m_szAdapterMode[32]; static char m_szAdapterMode[32] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static char m_szInitCode[32]; static char m_szInitCode[32] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static MCC_Info channelInfo[16]; static MCC_Info channelInfo[16] ATTRIBUTE_ALIGN(32);
volatile static BOOL gIsChannelinfoDirty = TRUE; volatile static BOOL gIsChannelinfoDirty = TRUE;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "__os.h" #include "__os.h"
ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static SramControl Scb; static SramControl Scb ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT);
// prototypes // prototypes
static int GetRTC(u32* rtc); static int GetRTC(u32* rtc);
+1 -1
View File
@@ -3,7 +3,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,
+5 -5
View File
@@ -44,7 +44,7 @@ static u32 LastError;
static BOOL ResetRequired; static BOOL ResetRequired;
static u32 MotorState; static u32 MotorState;
static volatile OSTime LastResetEnd; static volatile OSTime LastResetEnd;
ATTRIBUTE_ALIGN(32) static u32 __DVDNumTmdBytes; static u32 __DVDNumTmdBytes ATTRIBUTE_ALIGN(32);
static DVDGameTOC* GameToc; static DVDGameTOC* GameToc;
static DVDPartitionInfo* PartInfo; static DVDPartitionInfo* PartInfo;
static DVDPartitionInfo* BootGameInfo; static DVDPartitionInfo* BootGameInfo;
@@ -80,10 +80,10 @@ static DVDCommandBlock DummyCommandBlock;
static OSAlarm ResetAlarm; static OSAlarm ResetAlarm;
static OSAlarm CoverAlarm; static OSAlarm CoverAlarm;
ATTRIBUTE_ALIGN(32) static u8 __DVDGameTocBuffer[OSRoundUp32B(sizeof(DVDGameTOC) * 4)]; static u8 __DVDGameTocBuffer[OSRoundUp32B(sizeof(DVDGameTOC) * 4)] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 __DVDPartInfoBuffer[OSRoundUp32B(sizeof(DVDPartitionInfo) * 4)]; static u8 __DVDPartInfoBuffer[OSRoundUp32B(sizeof(DVDPartitionInfo) * 4)] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 __DVDTmdBuffer[OSRoundUp32B(sizeof(ESTitleMeta))]; static u8 __DVDTmdBuffer[OSRoundUp32B(sizeof(ESTitleMeta))] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 __DVDTicketViewBuffer[OSRoundUp32B(sizeof(ESTicketView))]; static u8 __DVDTicketViewBuffer[OSRoundUp32B(sizeof(ESTicketView))] ATTRIBUTE_ALIGN(32);
static OSAlarm FatalAlarm; static OSAlarm FatalAlarm;
DVDCommandBlock __DVDStopMotorCommandBlock; DVDCommandBlock __DVDStopMotorCommandBlock;
+1 -1
View File
@@ -5,7 +5,7 @@
#include "__os.h" #include "__os.h"
#include "__dvd.h" #include "__dvd.h"
ATTRIBUTE_ALIGN(32) static u8 CheckBuffer[32]; static u8 CheckBuffer[32] ATTRIBUTE_ALIGN(32);
static volatile BOOL lowDone = TRUE; static volatile BOOL lowDone = TRUE;
static volatile u32 lowIntType = 0; static volatile u32 lowIntType = 0;
+7 -7
View File
@@ -8,15 +8,15 @@ static volatile u8 requestInProgress = FALSE;
static u8 breakRequested; static u8 breakRequested;
static u8 callbackInProgress; static u8 callbackInProgress;
ATTRIBUTE_ALIGN(32) static u32 registerBuf[8]; static u32 registerBuf[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 statusRegister[8]; static u32 statusRegister[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 controlRegister[8]; static u32 controlRegister[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static s32 lastTicketError[8]; static s32 lastTicketError[8] ATTRIBUTE_ALIGN(32);
static u32 readLength; static u32 readLength;
static u32 spinUpValue; static u32 spinUpValue;
ATTRIBUTE_ALIGN(32) static diRegVals_t diRegValCache; static diRegVals_t diRegValCache ATTRIBUTE_ALIGN(32);
static u8 DVDLowInitCalled = FALSE; static u8 DVDLowInitCalled = FALSE;
@@ -42,8 +42,8 @@ typedef struct dvdContext {
static int freeDvdContext = 0; static int freeDvdContext = 0;
static u8 dvdContextsInited = FALSE; static u8 dvdContextsInited = FALSE;
ATTRIBUTE_ALIGN(32) static dvdContext_t dvdContexts[4]; static dvdContext_t dvdContexts[4] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static IOSIoVector ioVec[10]; static IOSIoVector ioVec[10] ATTRIBUTE_ALIGN(32);
static void* ddrAllocAligned32(const int size) { static void* ddrAllocAligned32(const int size) {
void* low, *high; void* low, *high;
+2 -2
View File
@@ -11,8 +11,8 @@ static NANDCommandBlock NandCb;
static NANDFileInfo NandInfo; static NANDFileInfo NandInfo;
static DVDCBCallback Callback; static DVDCBCallback Callback;
static u32 NextOffset; static u32 NextOffset;
ATTRIBUTE_ALIGN(32) DVDErrorInfo __ErrorInfo; DVDErrorInfo __ErrorInfo ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) DVDErrorInfo __FirstErrorInfo; DVDErrorInfo __FirstErrorInfo ATTRIBUTE_ALIGN(32);
void cbForNandClose(s32 result, NANDCommandBlock* block) { void cbForNandClose(s32 result, NANDCommandBlock* block) {
if (Callback) { if (Callback) {
+8 -8
View File
@@ -33,7 +33,7 @@ s32 ESP_CloseLib(void) {
s32 ESP_LaunchTitle(u64 titleID, ESTicketView* pTicketView) { s32 ESP_LaunchTitle(u64 titleID, ESTicketView* pTicketView) {
s32 ret = 0; s32 ret = 0;
ATTRIBUTE_ALIGN(32) u8 buf[256]; u8 buf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* vec = (IOSIoVector*)(buf + 208); IOSIoVector* vec = (IOSIoVector*)(buf + 208);
u64* id = (u64*)buf; u64* id = (u64*)buf;
@@ -63,7 +63,7 @@ out:
s32 ESP_GetTicketViews(ESTitleId titleId, ESTicketView* ticketViewList, u32* ticketViewCnt) { s32 ESP_GetTicketViews(ESTitleId titleId, ESTicketView* ticketViewList, u32* ticketViewCnt) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
ESTitleId* p1 = (ESTitleId*)__esBuf; ESTitleId* p1 = (ESTitleId*)__esBuf;
u32* p2 = (u32*)(__esBuf + 32); u32* p2 = (u32*)(__esBuf + 32);
@@ -111,7 +111,7 @@ out:
s32 ESP_DiGetTicketView(const void* ticket, ESTicketView* ticketView) { s32 ESP_DiGetTicketView(const void* ticket, ESTicketView* ticketView) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
if (__esFd < 0 || ticketView == NULL) { if (__esFd < 0 || ticketView == NULL) {
@@ -142,7 +142,7 @@ out:
s32 ESP_DiGetTmd(ESTitleMeta* tmd, u32* tmdSize) { s32 ESP_DiGetTmd(ESTitleMeta* tmd, u32* tmdSize) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
u32* p1 = (u32*)__esBuf; u32* p1 = (u32*)__esBuf;
@@ -184,7 +184,7 @@ out:
s32 ESP_GetTmdView(ESTitleId titleId, ESTmdView* tmdView, u32* size) { s32 ESP_GetTmdView(ESTitleId titleId, ESTmdView* tmdView, u32* size) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
ESTitleId* p1 = (ESTitleId*)__esBuf; ESTitleId* p1 = (ESTitleId*)__esBuf;
u32* p2 = (u32*)(__esBuf + 32); u32* p2 = (u32*)(__esBuf + 32);
@@ -233,7 +233,7 @@ out:
s32 ESP_GetDataDir(ESTitleId titleId, char* dataDir) { s32 ESP_GetDataDir(ESTitleId titleId, char* dataDir) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
ESTitleId* p1 = (ESTitleId*)__esBuf; ESTitleId* p1 = (ESTitleId*)__esBuf;
@@ -260,7 +260,7 @@ out:
s32 ESP_GetTitleId(ESTitleId* titleId) { s32 ESP_GetTitleId(ESTitleId* titleId) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
if (__esFd < 0 || titleId == NULL) { if (__esFd < 0 || titleId == NULL) {
@@ -283,7 +283,7 @@ out:
s32 ESP_GetConsumption(ESTicketId ticketId, ESLpEntry* entries, u32* nEntries) { s32 ESP_GetConsumption(ESTicketId ticketId, ESLpEntry* entries, u32* nEntries) {
s32 rv = 0; s32 rv = 0;
ATTRIBUTE_ALIGN(32) u8 __esBuf[256]; u8 __esBuf[256] ATTRIBUTE_ALIGN(32);
IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector)); IOSIoVector* v = (IOSIoVector*)(__esBuf + 256 - 6 * sizeof(IOSIoVector));
ESTicketId* p1 = (ESTicketId*)__esBuf; ESTicketId* p1 = (ESTicketId*)__esBuf;
u32* p2 = (u32*)(__esBuf + 32); u32* p2 = (u32*)(__esBuf + 32);
+1 -1
View File
@@ -25,7 +25,7 @@ typedef struct isfs_GetUsage {
} isfs_GetUsage; } isfs_GetUsage;
typedef struct __isfsCtxt { typedef struct __isfsCtxt {
ATTRIBUTE_ALIGN(32) u8 ioBuf[ROUNDUP(256)]; u8 ioBuf[ROUNDUP(256)] ATTRIBUTE_ALIGN(32);
ISFSCallback cb; ISFSCallback cb;
void* ctxt; void* ctxt;
u32 func; u32 func;
+1 -1
View File
@@ -49,7 +49,7 @@ volatile void* __piReg;
GXBool __GXinBegin; GXBool __GXinBegin;
#endif #endif
ATTRIBUTE_ALIGN(32) static u16 DefaultTexData[] = { static u16 DefaultTexData[] ATTRIBUTE_ALIGN(32) = {
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF,
}; };
@@ -34,7 +34,7 @@ namespace nw4hbm {
private: private:
/* 0x00 (base) */ /* 0x00 (base) */
/* 0xD4 */ ATTRIBUTE_ALIGN(4) ut::Color mVtxColors[VERTEXCOLOR_MAX]; /* 0xD4 */ ut::Color mVtxColors[VERTEXCOLOR_MAX] ATTRIBUTE_ALIGN(4);
/* 0xE4 */ detail::TexCoordAry mTexCoordAry; /* 0xE4 */ detail::TexCoordAry mTexCoordAry;
}; };
@@ -58,7 +58,7 @@ namespace nw4hbm {
public: public:
/* 0x14 */ ut::LinkListNode mLinkNode; /* 0x14 */ ut::LinkListNode mLinkNode;
ATTRIBUTE_ALIGN(32) static u8 mMramBuf[LOAD_BUFFER_SIZE]; static u8 mMramBuf[LOAD_BUFFER_SIZE] ATTRIBUTE_ALIGN(32);
}; };
typedef ut::LinkList<LoadCommand, offsetof(LoadCommand, mLinkNode)> LoadCommandList; typedef ut::LinkList<LoadCommand, offsetof(LoadCommand, mLinkNode)> LoadCommandList;
+2 -2
View File
@@ -24,7 +24,7 @@ static u32 __relnchFl = 0;
typedef struct IOSRpcRequest { typedef struct IOSRpcRequest {
IOSResourceRequest request; IOSResourceRequest request;
ATTRIBUTE_ALIGN(32) IOSIpcCb cb; // I am assuming this is aligned due to where cbArg is stored, and I see nothing between cb and callback_arg? IOSIpcCb cb ATTRIBUTE_ALIGN(32); // I am assuming this is aligned due to where cbArg is stored, and I see nothing between cb and callback_arg?
void* callback_arg; void* callback_arg;
u32 relaunch_flag; u32 relaunch_flag;
OSThreadQueue thread_queue; OSThreadQueue thread_queue;
@@ -37,7 +37,7 @@ static IOSRpcRequest* __relnchRpcSave = 0;
#define ROUNDUP(sz) (((u32)(sz) + (IPC_BUF_CNT / 2 - 1)) & ~(u32)(IPC_BUF_CNT / 2 - 1)) #define ROUNDUP(sz) (((u32)(sz) + (IPC_BUF_CNT / 2 - 1)) & ~(u32)(IPC_BUF_CNT / 2 - 1))
ATTRIBUTE_ALIGN(32) static u8 __rpcBuf[ROUNDUP(sizeof(IOSRpcRequest))]; static u8 __rpcBuf[ROUNDUP(sizeof(IOSRpcRequest))] ATTRIBUTE_ALIGN(32);
static struct { static struct {
u32 rcount; u32 rcount;
+4 -4
View File
@@ -33,8 +33,8 @@ enum LibState {
}; };
static enum LibState s_libState = STATE_NOT_INITIALIZED; static enum LibState s_libState = STATE_NOT_INITIALIZED;
ATTRIBUTE_ALIGN(32) static char s_currentDir[64] = "/"; static char s_currentDir[64] ATTRIBUTE_ALIGN(32) = "/";
ATTRIBUTE_ALIGN(32) static char s_homeDir[64] = ""; static char s_homeDir[64] ATTRIBUTE_ALIGN(32) = "";
static BOOL nandOnShutdown(BOOL final, u32 event); static BOOL nandOnShutdown(BOOL final, u32 event);
void nandConvertPath(char* abspath, const char* wd, const char* relpath); void nandConvertPath(char* abspath, const char* wd, const char* relpath);
@@ -262,7 +262,7 @@ s32 nandConvertErrorCode(const ISFSError err) {
for (; i < sizeof(ERRMAP) / 4; i = i + 2) { for (; i < sizeof(ERRMAP) / 4; i = i + 2) {
if (ERRMAP[i] == err) { if (ERRMAP[i] == err) {
if (err == ISFS_ERROR_ECC_CRIT || err == ISFS_ERROR_HMAC || err == ISFS_ERROR_UNKNOWN || err == IOS_ERROR_UNKNOWN || err == IOS_ERROR_ECC_CRIT) { if (err == ISFS_ERROR_ECC_CRIT || err == ISFS_ERROR_HMAC || err == ISFS_ERROR_UNKNOWN || err == IOS_ERROR_UNKNOWN || err == IOS_ERROR_ECC_CRIT) {
ATTRIBUTE_ALIGN(64) char buf[128]; char buf[128] ATTRIBUTE_ALIGN(64);
sprintf(buf, "ISFS error code: %d", err); sprintf(buf, "ISFS error code: %d", err);
NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf); NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf);
} }
@@ -279,7 +279,7 @@ s32 nandConvertErrorCode(const ISFSError err) {
OSReport("CAUTION! Unexpected error code [%d] was found.\n", err); OSReport("CAUTION! Unexpected error code [%d] was found.\n", err);
{ {
ATTRIBUTE_ALIGN(64) char buf[128]; char buf[128] ATTRIBUTE_ALIGN(64);
sprintf(buf, "ISFS unexpected error code: %d", err); sprintf(buf, "ISFS unexpected error code: %d", err);
NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf); NANDLoggingAddMessageAsync(nandLoggingCallback, err, buf);
} }
+3 -3
View File
@@ -7,7 +7,7 @@
static IOSFd s_fd = -255; static IOSFd s_fd = -255;
static IOSError s_err = ISFS_ERROR_UNKNOWN; static IOSError s_err = ISFS_ERROR_UNKNOWN;
static int s_stage; static int s_stage;
ATTRIBUTE_ALIGN(64) static char s_message[256]; static char s_message[256] ATTRIBUTE_ALIGN(64);
static NANDLoggingCallback s_callback = 0; static NANDLoggingCallback s_callback = 0;
static void asyncRoutine(ISFSError, void*); static void asyncRoutine(ISFSError, void*);
@@ -70,8 +70,8 @@ static void callbackRoutine(BOOL result) {
static void asyncRoutine(ISFSError result, void *ctxt) { static void asyncRoutine(ISFSError result, void *ctxt) {
ISFSError ret = ISFS_ERROR_UNKNOWN; ISFSError ret = ISFS_ERROR_UNKNOWN;
ATTRIBUTE_ALIGN(64) static char s_rBuf[256]; static char s_rBuf[256] ATTRIBUTE_ALIGN(64);
ATTRIBUTE_ALIGN(64) static char s_wBuf[256]; static char s_wBuf[256] ATTRIBUTE_ALIGN(64);
++s_stage; ++s_stage;
if (s_stage == 2) { if (s_stage == 2) {
+1 -1
View File
@@ -293,7 +293,7 @@ s32 NANDMove(const char* path, const char* destDir) {
} }
static ISFSError nandGetFileStatus(IOSFd fd, u32* length, u32* pos) { static ISFSError nandGetFileStatus(IOSFd fd, u32* length, u32* pos) {
ATTRIBUTE_ALIGN(32) ISFSFileStats fstat; ISFSFileStats fstat ATTRIBUTE_ALIGN(32);
ISFSError result = ISFS_GetFileStats(fd, &fstat); ISFSError result = ISFS_GetFileStats(fd, &fstat);
if (result == ISFS_ERROR_OK) { if (result == ISFS_ERROR_OK) {
if (length) { if (length) {
+1 -1
View File
@@ -8,7 +8,7 @@ void __OSRelaunchTitle(u32 resetCode) {
s32 rc = 0; s32 rc = 0;
u32 ticketCnt = 1; u32 ticketCnt = 1;
ESTicketView* tik = NULL; ESTicketView* tik = NULL;
ATTRIBUTE_ALIGN(32) ESTitleId titleId; ESTitleId titleId ATTRIBUTE_ALIGN(32);
__OSPlayTimeType type = OSPLAYTIME_PERMANENT; __OSPlayTimeType type = OSPLAYTIME_PERMANENT;
u32 remain = 0; u32 remain = 0;
u8* bi2 = NULL; u8* bi2 = NULL;
+1 -1
View File
@@ -85,7 +85,7 @@ NWC24Err NWC24iSynchronizeRtcCounter(BOOL param_0) {
} }
NWC24Err NWC24SuspendScheduler(void) { NWC24Err NWC24SuspendScheduler(void) {
ATTRIBUTE_ALIGN(32) static u8 susResult[0x20]; static u8 susResult[0x20] ATTRIBUTE_ALIGN(32);
NWC24Err rt = NWC24_OK; NWC24Err rt = NWC24_OK;
NWC24Err closeRt = NWC24_OK; NWC24Err closeRt = NWC24_OK;
IOSFd fd; IOSFd fd;
+1 -1
View File
@@ -2,7 +2,7 @@
#include <revolution/nand.h> #include <revolution/nand.h>
static BOOL PlayRecordGet = FALSE; static BOOL PlayRecordGet = FALSE;
ATTRIBUTE_ALIGN(32) static OSPlayRecord PlayRecord; static OSPlayRecord PlayRecord ATTRIBUTE_ALIGN(32);
static NANDFileInfo FileInfo; static NANDFileInfo FileInfo;
static NANDCommandBlock Block; static NANDCommandBlock Block;
static s32 PlayRecordState = 9; static s32 PlayRecordState = 9;
+6 -6
View File
@@ -7,7 +7,7 @@
#include "__os.h" #include "__os.h"
ATTRIBUTE_ALIGN(32) OSAlarm __OSExpireAlarm; OSAlarm __OSExpireAlarm ATTRIBUTE_ALIGN(32);
OSTime __OSExpireTime; OSTime __OSExpireTime;
OSPlayTimeCallbackFunc __OSExpireCallback; OSPlayTimeCallbackFunc __OSExpireCallback;
BOOL __OSExpireSetExpiredFlag; BOOL __OSExpireSetExpiredFlag;
@@ -103,7 +103,7 @@ BOOL __OSWriteExpiredFlag(void) {
s32 rv = 0; s32 rv = 0;
NANDFileInfo nInfo; NANDFileInfo nInfo;
BOOL openNInfo = FALSE; BOOL openNInfo = FALSE;
ATTRIBUTE_ALIGN(32) u8 titleId[32]; u8 titleId[32] ATTRIBUTE_ALIGN(32);
rv = NANDPrivateCreate("/shared2/expired", 63, 0); rv = NANDPrivateCreate("/shared2/expired", 63, 0);
@@ -162,7 +162,7 @@ BOOL __OSWriteExpiredFlagIfSet(void) {
void* __OSPlayTimeRebootThread(void* args) { void* __OSPlayTimeRebootThread(void* args) {
BOOL enabled; BOOL enabled;
u32 frames, fadeShift = 1; u32 frames, fadeShift = 1;
ATTRIBUTE_ALIGN(32) __OSExpireAIFadeStruct aiFade; __OSExpireAIFadeStruct aiFade ATTRIBUTE_ALIGN(32);
__OSExpireAIFade = &aiFade; __OSExpireAIFade = &aiFade;
memset(__OSExpireAIFade, 0, sizeof(__OSExpireAIFadeStruct)); memset(__OSExpireAIFade, 0, sizeof(__OSExpireAIFadeStruct));
@@ -227,9 +227,9 @@ out:
s32 __OSGetPlayTime(ESTicketView* ticket, __OSPlayTimeType* type, u32* playTime) { s32 __OSGetPlayTime(ESTicketView* ticket, __OSPlayTimeType* type, u32* playTime) {
s32 rv; s32 rv;
u32 i; u32 i;
ATTRIBUTE_ALIGN(32) ESLpEntry lpEntry[8]; ESLpEntry lpEntry[8] ATTRIBUTE_ALIGN(32);
u32 numCc = 0, seenOther = 0; u32 numCc = 0, seenOther = 0;
ATTRIBUTE_ALIGN(32) ESTicketView ticketAligned; ESTicketView ticketAligned ATTRIBUTE_ALIGN(32);
ASSERTLINE(601, ticket && type && playTime); ASSERTLINE(601, ticket && type && playTime);
@@ -288,7 +288,7 @@ out:
s32 __OSGetPlayTimeCurrent(__OSPlayTimeType* type, u32* playTime) { s32 __OSGetPlayTimeCurrent(__OSPlayTimeType* type, u32* playTime) {
s32 rv; s32 rv;
ATTRIBUTE_ALIGN(32) ESTicketView ticket; ESTicketView ticket ATTRIBUTE_ALIGN(32);
ASSERTLINE(676, type && playTime); ASSERTLINE(676, type && playTime);
+1 -1
View File
@@ -3,7 +3,7 @@
#include "__os.h" #include "__os.h"
ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static SramControl Scb; static SramControl Scb ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT);
// prototypes // prototypes
static int GetRTC(u32* rtc); static int GetRTC(u32* rtc);
+1 -1
View File
@@ -2,7 +2,7 @@
#include <revolution/nand.h> #include <revolution/nand.h>
#include <cstring> #include <cstring>
ATTRIBUTE_ALIGN(32) static OSStateFlags StateFlags; static OSStateFlags StateFlags ATTRIBUTE_ALIGN(32);
static u32 CheckSum(OSStateFlags* flags) { static u32 CheckSum(OSStateFlags* flags) {
u32* ptr, i, sum; u32* ptr, i, sum;
+6 -6
View File
@@ -5,14 +5,14 @@
#include <revolution/private/iosrestypes.h> #include <revolution/private/iosrestypes.h>
ATTRIBUTE_ALIGN(32) static u32 StmImInBuf[8]; static u32 StmImInBuf[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 StmImOutBuf[8]; static u32 StmImOutBuf[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 StmVdInBuf[8]; static u32 StmVdInBuf[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 StmVdOutBuf[8]; static u32 StmVdOutBuf[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 StmEhInBuf[8]; static u32 StmEhInBuf[8] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u32 StmEhOutBuf[8]; static u32 StmEhOutBuf[8] ATTRIBUTE_ALIGN(32);
static OSResetCallback ResetCallback; static OSResetCallback ResetCallback;
static OSPowerCallback PowerCallback; static OSPowerCallback PowerCallback;
+1 -1
View File
@@ -873,4 +873,4 @@ void* OSGetThreadSpecific(s32 index) {
#include "global.h" #include "global.h"
extern u8 Debug_BBA_804516D0; extern u8 Debug_BBA_804516D0;
ATTRIBUTE_ALIGN(8) u8 Debug_BBA_804516D0; u8 Debug_BBA_804516D0 ATTRIBUTE_ALIGN(8);
+2 -2
View File
@@ -75,8 +75,8 @@ static const char ConfDirName[] = "/shared2/sys";
static const char ConfFileName[] = "/shared2/sys/SYSCONF"; static const char ConfFileName[] = "/shared2/sys/SYSCONF";
static const char ProductInfoFileName[] = "/title/00000001/00000002/data/setting.txt"; static const char ProductInfoFileName[] = "/title/00000001/00000002/data/setting.txt";
ATTRIBUTE_ALIGN(32) static u8 ConfBuf[0x4000]; static u8 ConfBuf[0x4000] ATTRIBUTE_ALIGN(32);
ATTRIBUTE_ALIGN(32) static u8 ConfBufForFlush[0x4000]; static u8 ConfBufForFlush[0x4000] ATTRIBUTE_ALIGN(32);
static u8 Initialized; static u8 Initialized;
static u8 DirtyFlag; static u8 DirtyFlag;
+1 -1
View File
@@ -262,7 +262,7 @@ void WPADiManageHandler(OSAlarm*, OSContext*) {
BTA_HhGetAclQueueInfo(); BTA_HhGetAclQueueInfo();
} }
ATTRIBUTE_ALIGN(32) u8 __WPADiManageHandlerStack[4096]; u8 __WPADiManageHandlerStack[4096] ATTRIBUTE_ALIGN(32);
void WPADiManageHandler0(OSAlarm* alarm, OSContext* context) { void WPADiManageHandler0(OSAlarm* alarm, OSContext* context) {
OSSwitchFiberEx((u32)alarm, (u32)context, 0, 0, (u32)WPADiManageHandler, (u32)(__WPADiManageHandlerStack + sizeof(__WPADiManageHandlerStack))); OSSwitchFiberEx((u32)alarm, (u32)context, 0, 0, (u32)WPADiManageHandler, (u32)(__WPADiManageHandlerStack + sizeof(__WPADiManageHandlerStack)));
+1 -1
View File
@@ -41,7 +41,7 @@ WUDControlBlock _wcb;
WUDDevInfo _work; WUDDevInfo _work;
static WUDDiscResp _discResp; static WUDDiscResp _discResp;
SCBtDeviceInfoArray _scArray; SCBtDeviceInfoArray _scArray;
ATTRIBUTE_ALIGN(32) u8 __WUDHandlerStack[0x1000]; u8 __WUDHandlerStack[0x1000] ATTRIBUTE_ALIGN(32);
extern u8 _scFlush; extern u8 _scFlush;
+14 -12
View File
@@ -1,6 +1,6 @@
# Android Shell # Android Shell
This directory contains Dusklight's Android shell built on top of Borealis. This directory contains a minimal SDLActivity-based Android app wrapper for Dusklight.
## Prerequisites ## Prerequisites
@@ -25,19 +25,24 @@ cmake --build --preset android-arm64
This build produces `build/android-arm64/libmain.so` This build produces `build/android-arm64/libmain.so`
## Refresh SDL Java Shim (Optional)
If you update SDL and want to refresh the embedded Java shim files:
```bash
./android/scripts/sync-sdl-java.sh
```
## Build APK ## Build APK
```bash ```bash
cd platforms/android cd android
./gradlew :app:assembleDebug ./gradlew :app:assembleDebug
``` ```
Output APK: Output APK:
- `app/build/outputs/apk/debug/app-arm64-v8a-debug.apk` - `android/app/build/outputs/apk/debug/app-debug.apk`
Aurora needs a hardware-backed graphics adapter. If an AVD has GPU
acceleration disabled, launch it with `-gpu host`.
## Launch With Runtime Args (adb) ## Launch With Runtime Args (adb)
@@ -45,13 +50,10 @@ You can pass command-line args through the activity intent:
```bash ```bash
adb shell am start -n dev.twilitrealm.dusk/.DuskActivity \ adb shell am start -n dev.twilitrealm.dusk/.DuskActivity \
--es borealis_args "--backend vulkan" --es dusk_args "--backend vulkan"
``` ```
Supported extras: Supported extras:
- `borealis_args`: single shell-like argument string - `dusk_args`: single shell-like argument string
- `borealis_argv`: string-array argv - `dusk_argv`: string-array argv
The legacy `dusk_args` and `dusk_argv` names remain accepted during the shell
transition.
+153 -22
View File
@@ -2,32 +2,163 @@ plugins {
id 'com.android.application' id 'com.android.application'
} }
def versionNameStr = (System.getenv("DUSK_VERSION") ?: "v0.1.0").replaceFirst("^v", "")
def versionCodeInt = (System.getenv("DUSK_VERSION_CODE") ?: "100000").toInteger()
def duskRepoDir = rootProject.projectDir.parentFile.parentFile def duskRepoDir = rootProject.projectDir.parentFile.parentFile
def borealisDir = new File(duskRepoDir, 'extern/borealis') def androidNativeBuildDir = new File(duskRepoDir, 'build/android-arm64')
def nativeLibrary = new File(androidNativeBuildDir, 'libmain.so')
def stageStripValue = providers.gradleProperty('ANDROID_STAGE_STRIP')
.orElse(providers.gradleProperty('androidStageStrip'))
.orElse(providers.environmentVariable('ANDROID_STAGE_STRIP'))
.orElse('1')
def androidHome = {
def sdkPath = System.getenv('ANDROID_HOME')
if (!sdkPath) {
throw new GradleException('ANDROID_HOME is not available')
}
def sdkDir = new File(sdkPath)
if (!sdkDir.isDirectory()) {
throw new GradleException("ANDROID_HOME points to a missing directory: ${sdkDir}")
}
sdkDir
}.memoize()
ext.borealisAndroid = [ def androidNdkVersion = {
borealisDir: borealisDir, def ndkVersion = System.getenv('ANDROID_NDK_VERSION')
propertiesFile: new File(duskRepoDir, 'build/android-arm64/borealis-android.properties'), if (!ndkVersion) {
namespace: 'dev.twilitrealm.dusk', throw new GradleException('ANDROID_NDK_VERSION is not available')
applicationId: 'dev.twilitrealm.dusk', }
abis: ['arm64-v8a'], ndkVersion
assets: [ }.memoize()
[
from: new File(duskRepoDir, 'res'),
into: 'res',
excludes: ['**/.DS_Store']
],
[
from: new File(duskRepoDir, 'build/android-arm64/bundled_mods'),
into: 'mods',
includes: ['*.dusk']
]
],
proguardRules: file('proguard-rules.pro')
]
apply from: new File(borealisDir, 'platforms/android/gradle/borealis-application.gradle') def androidNdkDir = {
def ndkDir = new File(androidHome(), "ndk/${androidNdkVersion()}")
if (!new File(ndkDir, 'build/cmake/android.toolchain.cmake').isFile()) {
throw new GradleException(
"Android NDK ${androidNdkVersion()} is missing or invalid at ${ndkDir}"
)
}
ndkDir
}.memoize()
def llvmPrebuiltDir = {
def prebuiltRoot = new File(androidNdkDir(), 'toolchains/llvm/prebuilt')
def prebuiltDir = (prebuiltRoot.listFiles()?.findAll { it.isDirectory() } ?: [])
.sort { it.name }
.find { candidate ->
new File(
candidate,
'sysroot/usr/lib/aarch64-linux-android/libc++_shared.so'
).isFile()
}
if (!prebuiltDir) {
throw new GradleException("Cannot find NDK libc++_shared.so under ${prebuiltRoot}")
}
prebuiltDir
}.memoize()
def stlLibrary = {
def library = new File(
llvmPrebuiltDir(),
'sysroot/usr/lib/aarch64-linux-android/libc++_shared.so'
)
if (!library.isFile()) {
throw new GradleException("libc++_shared.so is missing")
}
library
}.memoize()
def stagedJniLibsDir = layout.buildDirectory.dir('generated/jniLibs/dusklight')
def stageJniLibs = tasks.register('stageJniLibs', Sync) {
group = 'build'
from(nativeLibrary) {
rename { 'libmain.so' }
into 'arm64-v8a'
}
from(providers.provider { stlLibrary() }) {
rename { 'libc++_shared.so' }
into 'arm64-v8a'
}
into(stagedJniLibsDir)
doFirst {
if (!nativeLibrary.isFile()) {
throw new GradleException("Native library is missing")
}
}
}
def duskGeneratedAssetsDir = layout.buildDirectory.dir('generated/assets/dusklight')
def syncDuskAssets = tasks.register('syncDuskAssets', Sync) {
from(new File(duskRepoDir, 'res')) {
into 'res'
exclude '**/.DS_Store'
}
from(new File(androidNativeBuildDir, 'bundled_mods')) {
into 'mods'
include '*.dusk'
}
into(duskGeneratedAssetsDir)
}
android {
namespace 'dev.twilitrealm.dusk'
compileSdk 36
ndkVersion androidNdkVersion()
defaultConfig {
applicationId 'dev.twilitrealm.dusk'
minSdk 26
targetSdk 36
versionCode versionCodeInt
versionName versionNameStr
}
buildTypes {
debug {
minifyEnabled false
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = [stagedJniLibsDir]
assets.srcDirs = [duskGeneratedAssetsDir]
}
}
packaging {
jniLibs {
if (stageStripValue.get() == '0') {
keepDebugSymbols += '**/libmain.so'
}
}
}
splits {
abi {
enable true
reset()
include 'arm64-v8a'
universalApk false
}
}
lint {
abortOnError false
}
}
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
} }
tasks.named('preBuild').configure {
dependsOn(stageJniLibs, syncDuskAssets)
}
+4 -1
View File
@@ -1 +1,4 @@
-keep class dev.twilitrealm.dusk.DuskActivity { *; } # Keep SDL activity and related JNI bridge methods.
-keep class org.libsdl.app.** { *; }
-keep class dev.twilitrealm.dusk.DuskHttpClient { *; }
-keep class dev.twilitrealm.dusk.DuskHttpClient$Response { *; }
@@ -26,8 +26,8 @@
android:resource="@xml/game_mode_config" /> android:resource="@xml/game_mode_config" />
<provider <provider
android:name="dev.encounter.borealis.BorealisDocumentsProvider" android:name="dev.twilitrealm.dusk.DuskDocumentsProvider"
android:authorities="${applicationId}.documents" android:authorities="dev.twilitrealm.dusk.documents"
android:exported="true" android:exported="true"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:permission="android.permission.MANAGE_DOCUMENTS"> android:permission="android.permission.MANAGE_DOCUMENTS">
@@ -1,23 +1,102 @@
package dev.twilitrealm.dusk; package dev.twilitrealm.dusk;
import android.app.ActionBar;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.OpenableColumns;
import android.provider.Settings;
import android.util.Log; import android.util.Log;
import android.view.Display;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.View;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import dev.encounter.borealis.BorealisActivity; import org.libsdl.app.SDLActivity;
import org.libsdl.app.SDLSurface;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
public class DuskActivity extends BorealisActivity { public class DuskActivity extends SDLActivity {
private static final String TAG = "DuskActivity"; private static final String TAG = "DuskActivity";
private static final float DEFAULT_SURFACE_FRAME_RATE = 60.0f;
private static final int FOLDER_DIALOG_REQUEST_CODE = 0x4455;
private static final int MANAGE_STORAGE_REQUEST_CODE = 0x4456;
private static final String EXTERNAL_STORAGE_AUTHORITY =
"com.android.externalstorage.documents";
private long folderDialogUserdata = 0;
private boolean awaitingManageStoragePermission = false;
private static native void nativeFolderDialogResult(long userdata, String path, String error);
private static String[] splitArgs(String raw) {
List<String> out = new ArrayList<>();
StringBuilder current = new StringBuilder();
boolean inSingle = false;
boolean inDouble = false;
boolean escaped = false;
for (int i = 0; i < raw.length(); ++i) {
char c = raw.charAt(i);
if (escaped) {
current.append(c);
escaped = false;
continue;
}
if (c == '\\' && !inSingle) {
escaped = true;
continue;
}
if (c == '"' && !inSingle) {
inDouble = !inDouble;
continue;
}
if (c == '\'' && !inDouble) {
inSingle = !inSingle;
continue;
}
if (!inSingle && !inDouble && Character.isWhitespace(c)) {
if (current.length() > 0) {
out.add(current.toString());
current.setLength(0);
}
continue;
}
current.append(c);
}
if (escaped) {
current.append('\\');
}
if (current.length() > 0) {
out.add(current.toString());
}
return out.toArray(new String[0]);
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
extractBundledMods(); extractBundledMods();
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
hideSystemBars();
} }
// Bundled mod packages ship as APK assets, which the native loader cannot read directly; // Bundled mod packages ship as APK assets, which the native loader cannot read directly;
@@ -65,22 +144,458 @@ public class DuskActivity extends BorealisActivity {
} }
@Override @Override
protected String[] getArguments() { protected SDLSurface createSDLSurface(Context context) {
String[] arguments = super.getArguments(); return new DuskSurface(context);
if (arguments.length > 0) {
return arguments;
} }
Intent intent = getIntent(); @Override
if (intent == null) { protected void onResume() {
return arguments; super.onResume();
hideSystemBars();
if (awaitingManageStoragePermission) {
resumeFolderDialogAfterPermissionGrant();
} }
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
hideSystemBars();
}
}
private void hideSystemBars() {
Window window = getWindow();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
window.setDecorFitsSystemWindows(false);
WindowInsetsController ctrl = window.getDecorView().getWindowInsetsController();
if (ctrl != null) {
ctrl.setSystemBarsBehavior(
WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
ctrl.hide(WindowInsets.Type.systemBars());
}
} else {
View decorView = window.getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(uiOptions);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.hide();
}
}
}
@Override
protected String[] getLibraries() {
// SDL3 is statically linked into libmain.so in this build.
return new String[] {
"main"
};
}
public void setPreferredSurfaceFrameRate(float frameRate) {
runOnUiThread(() -> {
if (mSurface instanceof DuskSurface) {
((DuskSurface)mSurface).setPreferredFrameRate(frameRate);
}
});
}
private static final class DuskSurface extends SDLSurface {
private float preferredFrameRate = DEFAULT_SURFACE_FRAME_RATE;
DuskSurface(Context context) {
super(context);
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
super.surfaceChanged(holder, format, width, height);
setTargetFrameRate(holder);
}
void setPreferredFrameRate(float frameRate) {
preferredFrameRate = frameRate;
setTargetFrameRate(getHolder());
}
private void setTargetFrameRate(SurfaceHolder holder) {
if (!mIsSurfaceReady || Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
return;
}
Surface surface = holder != null ? holder.getSurface() : getHolder().getSurface();
if (surface == null || !surface.isValid()) {
return;
}
float targetFrameRate = getMaxSupportedFrameRate();
if (preferredFrameRate > 0.0f) {
targetFrameRate = preferredFrameRate;
}
if (targetFrameRate <= 0.0f) {
return;
}
try {
surface.setFrameRate(
targetFrameRate, Surface.FRAME_RATE_COMPATIBILITY_DEFAULT);
Log.v(TAG, "Requested surface frame rate " + targetFrameRate + " fps");
} catch (RuntimeException e) {
Log.w(TAG, "Failed to request surface frame rate", e);
}
}
private float getMaxSupportedFrameRate() {
if (mDisplay == null) {
return 0.0f;
}
float maxFrameRate = mDisplay.getRefreshRate();
Display.Mode[] modes = mDisplay.getSupportedModes();
if (modes == null) {
return maxFrameRate;
}
for (Display.Mode mode : modes) {
maxFrameRate = Math.max(maxFrameRate, mode.getRefreshRate());
}
return maxFrameRate;
}
}
@Override
protected String[] getArguments() {
Intent intent = getIntent();
if (intent != null) {
String[] argv = intent.getStringArrayExtra("dusk_argv"); String[] argv = intent.getStringArrayExtra("dusk_argv");
if (argv != null && argv.length > 0) { if (argv != null && argv.length > 0) {
return argv; return argv;
} }
String rawArgs = intent.getStringExtra("dusk_args"); String rawArgs = intent.getStringExtra("dusk_args");
return rawArgs == null ? arguments : splitArguments(rawArgs.trim()); if (rawArgs != null) {
String trimmed = rawArgs.trim();
if (!trimmed.isEmpty()) {
return splitArgs(trimmed);
}
}
}
return new String[0];
} }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
persistUriPermissions(data);
}
if (requestCode == FOLDER_DIALOG_REQUEST_CODE) {
finishFolderDialog(resultCode, data);
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
public boolean showFolderDialog(long userdata) {
if (userdata == 0 || folderDialogUserdata != 0) {
return false;
}
folderDialogUserdata = userdata;
if (requiresManageStoragePermission() && !hasManageStoragePermission()) {
if (!requestManageStoragePermission()) {
finishFolderDialogWithError("Unable to request Android file access permission");
return false;
}
return true;
}
openFolderDialog();
return true;
}
private void openFolderDialog() {
runOnUiThread(() -> {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION |
Intent.FLAG_GRANT_WRITE_URI_PERMISSION |
Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION |
Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
try {
startActivityForResult(intent, FOLDER_DIALOG_REQUEST_CODE);
} catch (ActivityNotFoundException e) {
Log.w(TAG, "Unable to open folder dialog.", e);
finishFolderDialog(Activity.RESULT_CANCELED, null);
}
});
}
private boolean requiresManageStoragePermission() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R;
}
private boolean hasManageStoragePermission() {
return !requiresManageStoragePermission() || Environment.isExternalStorageManager();
}
private boolean requestManageStoragePermission() {
if (!requiresManageStoragePermission()) {
return true;
}
awaitingManageStoragePermission = true;
runOnUiThread(() -> {
if (tryStartManageStorageIntent(
new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION)
.setData(Uri.parse("package:" + getPackageName()))) ||
tryStartManageStorageIntent(
new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)))
{
return;
}
finishFolderDialogWithError("Unable to request Android file access permission");
});
return true;
}
private boolean tryStartManageStorageIntent(Intent intent) {
try {
startActivityForResult(intent, MANAGE_STORAGE_REQUEST_CODE);
return true;
} catch (ActivityNotFoundException e) {
Log.w(TAG, "Unable to open all-files access settings.", e);
return false;
}
}
private void resumeFolderDialogAfterPermissionGrant() {
awaitingManageStoragePermission = false;
if (folderDialogUserdata == 0) {
return;
}
if (hasManageStoragePermission()) {
openFolderDialog();
return;
}
finishFolderDialogWithError(
"Allow \"All files access\" for Dusklight before choosing a custom data folder");
}
private void finishFolderDialogWithError(String error) {
long userdata = folderDialogUserdata;
folderDialogUserdata = 0;
awaitingManageStoragePermission = false;
if (userdata != 0) {
nativeFolderDialogResult(userdata, null, error);
}
}
private void finishFolderDialog(int resultCode, Intent data) {
long userdata = folderDialogUserdata;
folderDialogUserdata = 0;
if (userdata == 0) {
return;
}
if (resultCode == RESULT_OK && data != null && data.getData() != null) {
String path = getRealPathForUri(data.getData());
if (path != null && !path.isEmpty()) {
nativeFolderDialogResult(userdata, path, null);
} else {
nativeFolderDialogResult(
userdata, null, "Selected folder is not available as a filesystem path");
}
return;
}
nativeFolderDialogResult(userdata, null, null);
}
private String getRealPathForUri(Uri uri) {
if (uri == null) {
return null;
}
String scheme = uri.getScheme();
if ("file".equals(scheme)) {
return uri.getPath();
}
if (!"content".equals(scheme) ||
!EXTERNAL_STORAGE_AUTHORITY.equals(uri.getAuthority()) ||
Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
{
return null;
}
try {
return getExternalStoragePathForDocumentId(getExternalStorageDocumentId(uri));
} catch (IllegalArgumentException e) {
Log.w(TAG, "Unable to resolve URI: " + uri, e);
return null;
}
}
private static String getExternalStorageDocumentId(Uri uri) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && isTreeDocumentUri(uri)) {
return DocumentsContract.getTreeDocumentId(uri);
}
return DocumentsContract.getDocumentId(uri);
}
private static boolean isTreeDocumentUri(Uri uri) {
List<String> segments = uri.getPathSegments();
return segments.size() >= 2 && "tree".equals(segments.get(0));
}
private String getExternalStoragePathForDocumentId(String documentId) {
if (documentId == null || documentId.isEmpty()) {
return null;
}
if (documentId.startsWith("raw:")) {
return documentId.substring("raw:".length());
}
String[] parts = documentId.split(":", 2);
String volumeId = parts[0];
String relativePath = parts.length > 1 ? parts[1] : "";
File root = getExternalStorageRoot(volumeId);
if (root == null) {
return null;
}
return relativePath.isEmpty()
? root.getAbsolutePath()
: new File(root, relativePath).getAbsolutePath();
}
private File getExternalStorageRoot(String volumeId) {
if ("primary".equalsIgnoreCase(volumeId)) {
return Environment.getExternalStorageDirectory();
}
if ("home".equalsIgnoreCase(volumeId)) {
return new File(
Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DOCUMENTS);
}
File[] externalFilesDirs = getExternalFilesDirs(null);
if (externalFilesDirs != null) {
for (File externalFilesDir : externalFilesDirs) {
File root = getStorageRootForExternalFilesDir(externalFilesDir);
if (root != null && volumeId.equalsIgnoreCase(root.getName())) {
return root;
}
}
}
File fallback = new File("/storage", volumeId);
return fallback.exists() ? fallback : null;
}
private File getStorageRootForExternalFilesDir(File externalFilesDir) {
if (externalFilesDir == null) {
return null;
}
String path = externalFilesDir.getAbsolutePath();
int androidDir = path.indexOf("/Android/");
if (androidDir <= 0) {
return null;
}
return new File(path.substring(0, androidDir));
}
private void persistUriPermissions(Intent data) {
if (data == null) {
return;
}
int permissionFlags =
data.getFlags() & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
if (permissionFlags == 0) {
return;
}
Uri uri = data.getData();
if (uri != null) {
persistUriPermission(uri, permissionFlags);
}
ClipData clipData = data.getClipData();
if (clipData == null) {
return;
}
for (int i = 0; i < clipData.getItemCount(); ++i) {
Uri itemUri = clipData.getItemAt(i).getUri();
if (itemUri != null) {
persistUriPermission(itemUri, permissionFlags);
}
}
}
private void persistUriPermission(Uri uri, int permissionFlags) {
if ((permissionFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {
persistUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION, "read");
}
if ((permissionFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {
persistUriPermission(uri, Intent.FLAG_GRANT_WRITE_URI_PERMISSION, "write");
}
}
private void persistUriPermission(Uri uri, int permissionFlag, String permissionName) {
try {
getContentResolver().takePersistableUriPermission(uri, permissionFlag);
} catch (SecurityException | IllegalArgumentException e) {
Log.w(TAG, "Unable to persist " + permissionName + " URI permission for " + uri, e);
}
}
public String getDisplayNameForUri(String uriString) {
if (uriString == null || uriString.isEmpty()) {
return "";
}
Uri uri = Uri.parse(uriString);
if ("content".equals(uri.getScheme())) {
try (Cursor cursor = getContentResolver().query(
uri, new String[] { OpenableColumns.DISPLAY_NAME }, null, null, null))
{
if (cursor != null && cursor.moveToFirst()) {
int displayNameColumn = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
if (displayNameColumn >= 0) {
String displayName = cursor.getString(displayNameColumn);
if (displayName != null && !displayName.isEmpty()) {
return displayName;
}
}
}
} catch (SecurityException | IllegalArgumentException e) {
Log.w(TAG, "Unable to query display name for " + uri, e);
}
} else if ("file".equals(uri.getScheme())) {
String path = uri.getPath();
if (path != null && !path.isEmpty()) {
String name = new File(path).getName();
if (!name.isEmpty()) {
return name;
}
}
}
String lastSegment = uri.getLastPathSegment();
return lastSegment != null ? lastSegment : "";
}
} }
@@ -0,0 +1,467 @@
package dev.twilitrealm.dusk;
import android.content.ContentResolver;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.database.MatrixCursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.provider.DocumentsContract;
import android.provider.DocumentsContract.Document;
import android.provider.DocumentsContract.Root;
import android.provider.DocumentsProvider;
import android.webkit.MimeTypeMap;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class DuskDocumentsProvider extends DocumentsProvider {
public static final String AUTHORITY = "dev.twilitrealm.dusk.documents";
private static final String ROOT_ID = "dusk";
private static final String ROOT_DOCUMENT_ID = "root";
private static final String LOCATION_DESCRIPTOR_NAME = "data_location.json";
private static final String DIRECTORY_MIME_TYPE = Document.MIME_TYPE_DIR;
private static final String[] DEFAULT_ROOT_PROJECTION = new String[] {
Root.COLUMN_ROOT_ID,
Root.COLUMN_FLAGS,
Root.COLUMN_TITLE,
Root.COLUMN_DOCUMENT_ID,
Root.COLUMN_ICON,
Root.COLUMN_AVAILABLE_BYTES,
Root.COLUMN_SUMMARY
};
private static final String[] DEFAULT_DOCUMENT_PROJECTION = new String[] {
Document.COLUMN_DOCUMENT_ID,
Document.COLUMN_DISPLAY_NAME,
Document.COLUMN_FLAGS,
Document.COLUMN_MIME_TYPE,
Document.COLUMN_LAST_MODIFIED,
Document.COLUMN_SIZE
};
@Override
public boolean onCreate() {
if (!isCustomDataPathEnabled()) {
ensureUserDirectories();
}
return true;
}
@Override
public Cursor queryRoots(String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveRootProjection(projection));
if (isCustomDataPathEnabled()) {
return result;
}
final File root = getRootDirectory();
final MatrixCursor.RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, ROOT_ID);
row.add(Root.COLUMN_FLAGS,
Root.FLAG_LOCAL_ONLY |
Root.FLAG_SUPPORTS_CREATE |
Root.FLAG_SUPPORTS_IS_CHILD);
row.add(Root.COLUMN_TITLE, getContext().getString(R.string.app_name));
row.add(Root.COLUMN_DOCUMENT_ID, ROOT_DOCUMENT_ID);
row.add(Root.COLUMN_ICON, R.mipmap.icon);
row.add(Root.COLUMN_AVAILABLE_BYTES, root.getFreeSpace());
row.add(Root.COLUMN_SUMMARY, getContext().getString(R.string.documents_provider_summary));
return result;
}
@Override
public Cursor queryDocument(String documentId, String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
includeDocument(result, documentId, getFileForDocumentId(documentId));
return result;
}
@Override
public Cursor queryChildDocuments(String parentDocumentId, String[] projection, String sortOrder)
throws FileNotFoundException
{
return queryChildDocumentsInternal(parentDocumentId, projection);
}
@Override
public Cursor queryChildDocuments(String parentDocumentId, String[] projection, Bundle queryArgs)
throws FileNotFoundException
{
return queryChildDocumentsInternal(parentDocumentId, projection);
}
private Cursor queryChildDocumentsInternal(String parentDocumentId, String[] projection)
throws FileNotFoundException
{
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
final File parent = getFileForDocumentId(parentDocumentId);
final File[] files = parent.listFiles();
result.setNotificationUri(getContext().getContentResolver(), getChildDocumentsUri(parentDocumentId));
if (files == null) {
return result;
}
for (File file : files) {
includeDocument(result, getDocumentIdForFile(file), file);
}
return result;
}
@Override
public boolean isChildDocument(String parentDocumentId, String documentId) {
try {
final File parent = getFileForDocumentId(parentDocumentId);
final File child = getFileForDocumentId(documentId);
return isInside(parent, child);
} catch (FileNotFoundException e) {
return false;
}
}
@Override
public String createDocument(String parentDocumentId, String mimeType, String displayName)
throws FileNotFoundException
{
final File parent = getFileForDocumentId(parentDocumentId);
if (!parent.isDirectory()) {
throw new FileNotFoundException("Parent is not a directory: " + parentDocumentId);
}
final String safeDisplayName = sanitizeDisplayName(displayName);
final File file = buildUniqueFile(parent, safeDisplayName);
final boolean created;
if (DIRECTORY_MIME_TYPE.equals(mimeType)) {
created = file.mkdir();
} else {
try {
created = file.createNewFile();
} catch (IOException e) {
throw asFileNotFound("Unable to create document", e);
}
}
if (!created) {
throw new FileNotFoundException("Unable to create document: " + displayName);
}
notifyChildrenChanged(parentDocumentId);
return getDocumentIdForFile(file);
}
@Override
public String renameDocument(String documentId, String displayName) throws FileNotFoundException {
final File file = getFileForDocumentId(documentId);
if (ROOT_DOCUMENT_ID.equals(documentId)) {
throw new FileNotFoundException("Cannot rename root document");
}
final File target = buildUniqueFile(file.getParentFile(), sanitizeDisplayName(displayName));
final String parentDocumentId = getDocumentIdForFile(file.getParentFile());
if (!file.renameTo(target)) {
throw new FileNotFoundException("Unable to rename document: " + documentId);
}
notifyDocumentChanged(documentId);
notifyDocumentChanged(getDocumentIdForFile(target));
notifyChildrenChanged(parentDocumentId);
return getDocumentIdForFile(target);
}
@Override
public void deleteDocument(String documentId) throws FileNotFoundException {
if (ROOT_DOCUMENT_ID.equals(documentId)) {
throw new FileNotFoundException("Cannot delete root document");
}
final File file = getFileForDocumentId(documentId);
final String parentDocumentId = getDocumentIdForFile(file.getParentFile());
deleteRecursively(file);
notifyDocumentChanged(documentId);
notifyChildrenChanged(parentDocumentId);
}
@Override
public ParcelFileDescriptor openDocument(String documentId, String mode, CancellationSignal signal)
throws FileNotFoundException
{
return ParcelFileDescriptor.open(getFileForDocumentId(documentId), modeToParcelMode(mode));
}
@Override
public AssetFileDescriptor openDocumentThumbnail(String documentId, android.graphics.Point sizeHint,
CancellationSignal signal) throws FileNotFoundException
{
throw new FileNotFoundException("Thumbnails are not supported");
}
private void includeDocument(MatrixCursor result, String documentId, File file) throws FileNotFoundException {
final MatrixCursor.RowBuilder row = result.newRow();
final boolean isDirectory = file.isDirectory();
final String displayName = ROOT_DOCUMENT_ID.equals(documentId)
? getContext().getString(R.string.documents_provider_root_name)
: file.getName();
int flags = Document.FLAG_SUPPORTS_DELETE | Document.FLAG_SUPPORTS_RENAME;
if (isDirectory) {
flags |= Document.FLAG_DIR_SUPPORTS_CREATE;
} else if (file.canWrite()) {
flags |= Document.FLAG_SUPPORTS_WRITE;
}
if (ROOT_DOCUMENT_ID.equals(documentId)) {
flags &= ~(Document.FLAG_SUPPORTS_DELETE | Document.FLAG_SUPPORTS_RENAME);
}
row.add(Document.COLUMN_DOCUMENT_ID, documentId);
row.add(Document.COLUMN_DISPLAY_NAME, displayName);
row.add(Document.COLUMN_FLAGS, flags);
row.add(Document.COLUMN_MIME_TYPE, isDirectory ? DIRECTORY_MIME_TYPE : getMimeType(file));
row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified());
row.add(Document.COLUMN_SIZE, isDirectory ? null : file.length());
}
private File getRootDirectory() throws FileNotFoundException {
if (isCustomDataPathEnabled()) {
throw new FileNotFoundException(
"Dusk DocumentsProvider is disabled while a custom data path is configured");
}
final File root = getContext().getFilesDir();
if (root == null) {
throw new FileNotFoundException("Dusklight files directory is unavailable");
}
return root;
}
private File getFileForDocumentId(String documentId) throws FileNotFoundException {
final File root = getRootDirectory();
if (ROOT_DOCUMENT_ID.equals(documentId)) {
return root;
}
if (!documentId.startsWith(ROOT_DOCUMENT_ID + "/")) {
throw new FileNotFoundException("Invalid document id: " + documentId);
}
final String relativePath = documentId.substring(ROOT_DOCUMENT_ID.length() + 1);
final File file = new File(root, relativePath);
if (!isInside(root, file)) {
throw new FileNotFoundException("Document escapes Dusklight files directory: " + documentId);
}
if (!file.exists()) {
throw new FileNotFoundException("Document does not exist: " + documentId);
}
return file;
}
private String getDocumentIdForFile(File file) throws FileNotFoundException {
final File root = getRootDirectory();
if (sameFile(root, file)) {
return ROOT_DOCUMENT_ID;
}
if (!isInside(root, file)) {
throw new FileNotFoundException("File escapes Dusklight files directory: " + file);
}
final String rootPath = canonicalPath(root);
final String filePath = canonicalPath(file);
return ROOT_DOCUMENT_ID + "/" + filePath.substring(rootPath.length() + 1);
}
private void ensureUserDirectories() {
final File root = getContext().getFilesDir();
if (root == null) {
return;
}
new File(root, "texture_replacements").mkdirs();
new File(root, "USA/Card A").mkdirs();
new File(root, "EUR/Card A").mkdirs();
}
private boolean isCustomDataPathEnabled() {
if (getContext() == null) {
return false;
}
final File filesDir = getContext().getFilesDir();
if (filesDir == null) {
return false;
}
final File descriptor = new File(filesDir, LOCATION_DESCRIPTOR_NAME);
if (!descriptor.isFile()) {
return false;
}
try {
final JSONObject json = new JSONObject(readText(descriptor));
return "custom".equals(json.optString("mode", "default"));
} catch (IOException | JSONException e) {
return false;
}
}
private static String readText(File file) throws IOException {
try (FileInputStream input = new FileInputStream(file);
ByteArrayOutputStream output = new ByteArrayOutputStream())
{
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = input.read(buffer)) != -1) {
output.write(buffer, 0, bytesRead);
}
return output.toString(StandardCharsets.UTF_8.name());
}
}
private static String[] resolveRootProjection(String[] projection) {
return projection != null ? projection : DEFAULT_ROOT_PROJECTION;
}
private static String[] resolveDocumentProjection(String[] projection) {
return projection != null ? projection : DEFAULT_DOCUMENT_PROJECTION;
}
private static String sanitizeDisplayName(String displayName) throws FileNotFoundException {
if (displayName == null) {
throw new FileNotFoundException("Document name is empty");
}
final String sanitized = displayName.trim();
if (sanitized.isEmpty() || ".".equals(sanitized) || "..".equals(sanitized) ||
sanitized.contains("/") || sanitized.contains("\\"))
{
throw new FileNotFoundException("Invalid document name: " + displayName);
}
return sanitized;
}
private static File buildUniqueFile(File parent, String displayName) {
File file = new File(parent, displayName);
if (!file.exists()) {
return file;
}
final int dot = displayName.lastIndexOf('.');
final String baseName = dot > 0 ? displayName.substring(0, dot) : displayName;
final String extension = dot > 0 ? displayName.substring(dot) : "";
for (int i = 1; i < 100; ++i) {
file = new File(parent, baseName + " (" + i + ")" + extension);
if (!file.exists()) {
return file;
}
}
return new File(parent, baseName + " (" + System.currentTimeMillis() + ")" + extension);
}
private static int modeToParcelMode(String mode) {
if ("r".equals(mode)) {
return ParcelFileDescriptor.MODE_READ_ONLY;
}
if ("w".equals(mode) || "wt".equals(mode)) {
return ParcelFileDescriptor.MODE_WRITE_ONLY |
ParcelFileDescriptor.MODE_CREATE |
ParcelFileDescriptor.MODE_TRUNCATE;
}
if ("wa".equals(mode)) {
return ParcelFileDescriptor.MODE_WRITE_ONLY |
ParcelFileDescriptor.MODE_CREATE |
ParcelFileDescriptor.MODE_APPEND;
}
if ("rw".equals(mode)) {
return ParcelFileDescriptor.MODE_READ_WRITE |
ParcelFileDescriptor.MODE_CREATE;
}
if ("rwt".equals(mode)) {
return ParcelFileDescriptor.MODE_READ_WRITE |
ParcelFileDescriptor.MODE_CREATE |
ParcelFileDescriptor.MODE_TRUNCATE;
}
return ParcelFileDescriptor.MODE_READ_ONLY;
}
private static String getMimeType(File file) {
final int dot = file.getName().lastIndexOf('.');
if (dot >= 0) {
final String extension = file.getName().substring(dot + 1).toLowerCase();
final String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if (mimeType != null) {
return mimeType;
}
}
return "application/octet-stream";
}
private Uri getChildDocumentsUri(String parentDocumentId) {
return DocumentsContract.buildChildDocumentsUri(AUTHORITY, parentDocumentId);
}
private void notifyChildrenChanged(String parentDocumentId) {
final ContentResolver resolver = getContext().getContentResolver();
resolver.notifyChange(getChildDocumentsUri(parentDocumentId), null, false);
}
private void notifyDocumentChanged(String documentId) {
final ContentResolver resolver = getContext().getContentResolver();
resolver.notifyChange(DocumentsContract.buildDocumentUri(AUTHORITY, documentId), null, false);
}
private static void deleteRecursively(File file) throws FileNotFoundException {
if (file.isDirectory()) {
final File[] children = file.listFiles();
if (children != null) {
for (File child : children) {
deleteRecursively(child);
}
}
}
if (!file.delete()) {
throw new FileNotFoundException("Unable to delete document: " + file);
}
}
private static boolean isInside(File parent, File child) {
try {
final String parentPath = canonicalPath(parent);
final String childPath = canonicalPath(child);
return childPath.equals(parentPath) || childPath.startsWith(parentPath + File.separator);
} catch (FileNotFoundException e) {
return false;
}
}
private static boolean sameFile(File a, File b) {
try {
return canonicalPath(a).equals(canonicalPath(b));
} catch (FileNotFoundException e) {
return false;
}
}
private static String canonicalPath(File file) throws FileNotFoundException {
try {
return file.getCanonicalPath();
} catch (IOException e) {
throw asFileNotFound("Unable to resolve path", e);
}
}
private static FileNotFoundException asFileNotFound(String message, IOException cause) {
final FileNotFoundException exception = new FileNotFoundException(message + ": " + cause.getMessage());
exception.initCause(cause);
return exception;
}
}
@@ -0,0 +1,237 @@
package dev.twilitrealm.dusk;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
public final class DuskHttpClient {
public static final int ERROR_NONE = 0;
public static final int ERROR_INVALID_URL = 1;
public static final int ERROR_UNSUPPORTED_SCHEME = 2;
public static final int ERROR_TIMEOUT = 3;
public static final int ERROR_TOO_LARGE = 4;
public static final int ERROR_NETWORK = 5;
private static final int MAX_REDIRECTS = 5;
public static final class Response {
public int error;
public String message;
public int statusCode;
public String[] headerNames;
public String[] headerValues;
public byte[] body;
Response(int error, String message, int statusCode, String[] headerNames,
String[] headerValues, byte[] body) {
this.error = error;
this.message = message;
this.statusCode = statusCode;
this.headerNames = headerNames != null ? headerNames : new String[0];
this.headerValues = headerValues != null ? headerValues : new String[0];
this.body = body != null ? body : new byte[0];
}
}
private DuskHttpClient() {
}
public static Response get(String url, String[] headerNames, String[] headerValues,
int timeoutMs, long maxBodyBytes) {
if (url == null || url.isEmpty()) {
return fail(ERROR_INVALID_URL, "URL is empty");
}
try {
URL currentUrl = new URL(url);
if (!isHttps(currentUrl)) {
return fail(ERROR_UNSUPPORTED_SCHEME, "Only https:// URLs are supported");
}
for (int redirect = 0; redirect <= MAX_REDIRECTS; ++redirect) {
HttpsURLConnection connection =
(HttpsURLConnection) currentUrl.openConnection();
try {
connection.setRequestMethod("GET");
connection.setConnectTimeout(timeoutMs);
connection.setReadTimeout(timeoutMs);
connection.setUseCaches(false);
connection.setInstanceFollowRedirects(false);
applyHeaders(connection, headerNames, headerValues);
int statusCode = connection.getResponseCode();
if (isRedirect(statusCode)) {
String location = connection.getHeaderField("Location");
if (location == null || location.isEmpty()) {
return fail(ERROR_NETWORK, "Redirect response did not include Location",
statusCode, connection, new byte[0]);
}
URL nextUrl = new URL(currentUrl, location);
if (!isHttps(nextUrl)) {
return fail(ERROR_UNSUPPORTED_SCHEME,
"Only https:// redirects are supported", statusCode,
connection, new byte[0]);
}
currentUrl = nextUrl;
continue;
}
byte[] body = readBody(connection, statusCode, maxBodyBytes);
return success(statusCode, connection, body);
} catch (ResponseTooLargeException e) {
return fail(ERROR_TOO_LARGE, "Response body exceeded the configured limit",
safeStatusCode(connection), connection, e.partialBody);
} finally {
connection.disconnect();
}
}
return fail(ERROR_NETWORK, "Too many redirects");
} catch (MalformedURLException e) {
return fail(ERROR_INVALID_URL, "Failed to parse URL");
} catch (SocketTimeoutException e) {
return fail(ERROR_TIMEOUT, "Request timed out");
} catch (IOException e) {
String message = e.getMessage();
return fail(ERROR_NETWORK, message != null ? message : e.toString());
} catch (ClassCastException e) {
return fail(ERROR_UNSUPPORTED_SCHEME, "Only https:// URLs are supported");
}
}
private static void applyHeaders(HttpsURLConnection connection, String[] names,
String[] values) {
if (names == null || values == null) {
return;
}
int count = Math.min(names.length, values.length);
for (int i = 0; i < count; ++i) {
if (names[i] != null && values[i] != null) {
connection.setRequestProperty(names[i], values[i]);
}
}
}
private static boolean isHttps(URL url) {
return "https".equalsIgnoreCase(url.getProtocol());
}
private static boolean isRedirect(int statusCode) {
return statusCode == HttpURLConnection.HTTP_MOVED_PERM ||
statusCode == HttpURLConnection.HTTP_MOVED_TEMP ||
statusCode == HttpURLConnection.HTTP_SEE_OTHER ||
statusCode == 307 ||
statusCode == 308;
}
private static byte[] readBody(HttpsURLConnection connection, int statusCode,
long maxBodyBytes) throws IOException,
ResponseTooLargeException {
InputStream stream = statusCode >= HttpURLConnection.HTTP_BAD_REQUEST ?
connection.getErrorStream() : connection.getInputStream();
if (stream == null) {
return new byte[0];
}
try (InputStream bodyStream = stream;
ByteArrayOutputStream out = new ByteArrayOutputStream()) {
byte[] buffer = new byte[8192];
long total = 0;
while (true) {
int read = bodyStream.read(buffer);
if (read < 0) {
return out.toByteArray();
}
if (read == 0) {
continue;
}
if (read > maxBodyBytes || total > maxBodyBytes - read) {
throw new ResponseTooLargeException(out.toByteArray());
}
out.write(buffer, 0, read);
total += read;
}
}
}
private static int safeStatusCode(HttpsURLConnection connection) {
try {
return connection.getResponseCode();
} catch (IOException e) {
return 0;
}
}
private static Response success(int statusCode, HttpsURLConnection connection, byte[] body) {
HeaderLists headers = readHeaders(connection);
return new Response(ERROR_NONE, "", statusCode, headers.names, headers.values, body);
}
private static Response fail(int error, String message) {
return new Response(error, message, 0, null, null, null);
}
private static Response fail(int error, String message, int statusCode,
HttpsURLConnection connection, byte[] body) {
HeaderLists headers = readHeaders(connection);
return new Response(error, message, statusCode, headers.names, headers.values, body);
}
private static HeaderLists readHeaders(HttpsURLConnection connection) {
List<String> names = new ArrayList<>();
List<String> values = new ArrayList<>();
Map<String, List<String>> headerFields = connection.getHeaderFields();
if (headerFields == null) {
return new HeaderLists(new String[0], new String[0]);
}
for (Map.Entry<String, List<String>> entry : headerFields.entrySet()) {
String name = entry.getKey();
if (name == null) {
continue;
}
List<String> entryValues = entry.getValue();
if (entryValues == null || entryValues.isEmpty()) {
names.add(name);
values.add("");
continue;
}
for (String value : entryValues) {
names.add(name);
values.add(value != null ? value : "");
}
}
return new HeaderLists(names.toArray(new String[0]), values.toArray(new String[0]));
}
private static final class HeaderLists {
final String[] names;
final String[] values;
HeaderLists(String[] names, String[] values) {
this.names = names;
this.values = values;
}
}
private static final class ResponseTooLargeException extends Exception {
final byte[] partialBody;
ResponseTooLargeException(byte[] partialBody) {
this.partialBody = partialBody;
}
}
}
@@ -0,0 +1,21 @@
package org.libsdl.app;
import android.hardware.usb.UsbDevice;
interface HIDDevice
{
public int getId();
public int getVendorId();
public int getProductId();
public String getSerialNumber();
public int getVersion();
public String getManufacturerName();
public String getProductName();
public UsbDevice getDevice();
public boolean open();
public int writeReport(byte[] report, boolean feature);
public boolean readReport(byte[] report, boolean feature);
public void setFrozen(boolean frozen);
public void close();
public void shutdown();
}

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