Compare commits

...

226 Commits

Author SHA1 Message Date
Tom Lube 9f0d89473a typo (cannot) 2026-08-24 18:59:28 -04:00
gymnast86 adaa52aa9d Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-24 02:20:36 -07:00
gymnast86 3dd9430576 implement goron shop checks 2026-08-24 02:20:28 -07:00
Luke Street 6facff1297 Implement foolish items 2026-08-23 23:46:07 -06:00
Luke Street ba324dfdf6 Merge remote-tracking branch 'origin/main' into rando-mod 2026-08-23 22:40:06 -06:00
Luke Street a775418c66 ItemService v2.1: Support display_item (#2344)
* ItemService: Support display_item

* Add goron_springwater_rush constant

* Commit f_op_actor_mng.h
2026-08-23 21:51:49 -06:00
Luke Street 48b5c2e8c1 Restore focus to re-enabled elements 2026-08-23 20:26:26 -06:00
Luke Street 705e7f058b Un-inline d_meter2_info functions 2026-08-23 20:26:26 -06:00
Luke Street e30e0fe062 Update symgen to v1.3.3 2026-08-23 20:26:26 -06:00
Luke Street c4f4712d0e Minor svc/flow.hpp updates 2026-08-23 20:26:26 -06:00
Luke Street 2d70c24b37 Improve mod hook compatibility (inlines) 2026-08-23 20:26:26 -06:00
Luke Street 72ccb14d35 Guard against null stag_info 2026-08-23 20:25:41 -06:00
Luke Street c53f3f774b Add Golden Wolf item checks 2026-08-23 20:25:41 -06:00
Luke Street 5a8622c6b2 Fix forced Poe item demo 2026-08-23 20:25:24 -06:00
Luke Street 29b86f938f Fix group lookup for custom flows 2026-08-23 20:22:12 -06:00
Luke Street e02638ac6d Fix custom flow entry nodes 2026-08-23 20:22:10 -06:00
Luke Street 622b782614 Excluded locations using virtualized list 2026-08-23 14:37:09 -06:00
Luke Street 9a4b1edfe5 Merge remote-tracking branch 'origin/main' into rando-mod 2026-08-23 14:37:04 -06:00
Luke Street 1db2a74192 UiService v2.1: Virtualized lists (#2342)
* UiService: Add `pane_add_list`

* Fix CSS scoping
2026-08-23 14:33:36 -06:00
gymnast86 595c621173 add fused shadow and mirror shard item icons 2026-08-23 00:42:34 -07:00
gymnast86 ba95fdd4ab fix arg index in hookPostReadItemTexture 2026-08-23 00:01:14 -07:00
Luke Street a39c272985 Restore focus to re-enabled elements 2026-08-23 00:09:44 -06:00
gymnast86 f3bbde4b7d Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-22 23:05:08 -07:00
TakaRikka 46a2ac2c46 Merge remote-tracking branch 'origin/rando-mod' into rando-mod 2026-08-22 23:01:39 -07:00
TakaRikka 2885c7d9d8 disable OK button while seed is generating 2026-08-22 23:01:09 -07:00
Luke Street 19b8f7ede0 Link dusklight_mod_api to generator 2026-08-23 00:00:10 -06:00
gymnast86 b138735cbe Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-22 22:50:44 -07:00
gymnast86 1a6775eab1 add support for JP iso 2026-08-22 22:50:06 -07:00
TakaRikka dd5da64332 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-22 22:48:00 -07:00
TakaRikka d281c34a65 Merge pull request #2338 from encounter/ui-v2
UiService v2: UiDialogAction is_disabled
2026-08-22 22:46:21 -07:00
Luke Street a6813841b8 Use full color extensions 2026-08-22 23:44:55 -06:00
Luke Street 39a84e67b7 Merge remote-tracking branch 'origin/main' into rando-mod 2026-08-22 23:36:24 -06:00
Luke Street 788700daa6 UiService v2: UiDialogAction is_disabled 2026-08-22 23:17:51 -06:00
Luke Street 3aa54ca170 UiService: Add is_selected for buttons (#2337) 2026-08-22 23:16:32 -06:00
TakaRikka 81dfe701e9 Merge pull request #2336 from encounter/full-color
Add full color extension to messages
2026-08-22 21:35:55 -07:00
Luke Street 16f2b954fa Add full color extension to messages 2026-08-22 21:55:14 -06:00
gymnast86 a8a7513710 recolor dungeon map screen A and B buttons 2026-08-22 16:14:05 -07:00
gymnast86 797d264a71 don't allow deleting seeds which are currently saved to files 2026-08-22 10:36:43 -07:00
TakaRikka c0293b1f52 redesign delete seeds option 2026-08-22 05:00:18 -07:00
TakaRikka a9ea8aa935 redesign preset load option 2026-08-22 03:56:34 -07:00
TakaRikka 7240c19566 preset options added 2026-08-22 02:41:07 -07:00
TakaRikka dbc56da290 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-22 00:21:56 -07:00
Luke Street 41d5148793 UiService: Dialog controls (#2332) 2026-08-21 23:31:35 -06:00
doop 14f9b6c762 Add setting for UI scale (#2326) 2026-08-21 23:29:43 -06:00
doop 44e02a9d53 Fix Clang builds crashing at launch (#2325)
Closes #2323.
2026-08-21 23:28:52 -06:00
Luke Street 63d431d058 Guard against null stag_info 2026-08-21 23:24:09 -06:00
Luke Street 87d96c2696 Fix progressive item lookup 2026-08-21 23:24:09 -06:00
Luke Street 8f5ecdba1c Fix Golden Wolf item persistence 2026-08-21 23:24:09 -06:00
Luke Street 42805210df Fix forced Poe item handoff 2026-08-21 23:24:09 -06:00
gymnast86 df522f1abb add hooks for custom text colors 2026-08-21 18:46:47 -07:00
gymnast86 c475d72110 fix line width calculation in breakLines 2026-08-21 18:30:48 -07:00
gymnast86 3606ec64e3 fix lag on play tab 2026-08-21 18:29:59 -07:00
gymnast86 1b51fa0112 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-21 15:53:02 -07:00
Luke Street 1e8d72c3ed Fix group lookup for custom flows 2026-08-21 16:50:09 -06:00
gymnast86 28479314c2 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-21 14:56:28 -07:00
Luke Street 89a8384c7c Fix custom flow entry nodes 2026-08-21 15:55:38 -06:00
gymnast86 d9cac5befa Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-21 14:53:46 -07:00
gymnast86 3cd1f46e7b add additional descirpiton info to Skip Midna's Desperate Hour 2026-08-21 14:52:58 -07:00
Luke Street 0b26cee96d Fix hookPreGetLayerNo not writing the layerNo 2026-08-21 15:46:29 -06:00
gymnast86 42bba9c9a8 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-21 13:17:23 -07:00
Luke Street 3869ac6423 Un-inline d_meter2_info functions 2026-08-21 14:14:12 -06:00
Luke Street 54bed771ee Update symgen to v1.3.3 2026-08-21 14:14:03 -06:00
gymnast86 83b10681c3 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-21 11:24:38 -07:00
Luke Street 641855e49e Fix randomizer seed serialization 2026-08-21 12:15:33 -06:00
Luke Street 9977e78758 Improve game function hook compatibility 2026-08-21 12:15:33 -06:00
gymnast86 9a62d8c86f Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-21 10:49:27 -07:00
Luke Street 2cee0db91f Fix randomizer seed generation and activation 2026-08-21 11:16:26 -06:00
Luke Street 932c3aaba7 Rework flow impl on top of FlowService 2026-08-21 01:43:22 -06:00
Luke Street 5d1dda7e94 Bundle randomizer mod 2026-08-21 01:07:26 -06:00
Luke Street 75ae2767e9 Rework to use updated ItemService 2026-08-21 00:54:00 -06:00
Luke Street 829b0de69c Merge origin/main into rando-mod
# Conflicts:
#	src/d/actor/d_a_b_ds.cpp
2026-08-21 00:52:11 -06:00
Luke Street 5f0f3d4ebe ItemService improvements (#2322)
* ItemService improvements

* Move Poe increment to item
2026-08-21 00:50:51 -06:00
gymnast86 283b3704bb Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-20 19:59:19 -07:00
gymnast86 6cc22e71a9 fix boomerang collision field model radius and height 2026-08-20 19:58:59 -07:00
gymnast86 54ecdfe4d3 fix hookPreObjLifeCalcScale 2026-08-20 19:53:41 -07:00
TakaRikka 618eb90392 layer handling fix 2026-08-20 19:09:33 -07:00
TakaRikka 72ea47b973 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-20 18:15:25 -07:00
gymnast86 172d06f38d Add Built-In Cosmetics Mod (#2291)
* template setup

* get most colors working

* add lantern, midna, and heart colors

* fix PaneCache naming conflict

* add UI colors

* fix pane cache again

* override colors for items on other models

* recolor heart piece models

* cleanup

* add support for ordon sword recoloring

* recolor epona's eyelids

* move option descriptions

* fix mod.json

* constexpr descriptions

* gx.h instead of dolphin/gx/GXstruct.h

* fix default midna hair color

* use TextureService instead of overwriting model file data on load

* update descriptions

* manual cleanup

* fix includes

* remove unneeded include and const qualifier

* UI: Add Popover, ColorInput & more; mod cleanup

* Make it a bundled mod

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-08-20 17:49:26 -06:00
doop 338995ebe0 Fix interpretation of needed in audio callback (#2312) 2026-08-20 17:18:07 -06:00
ZipoLabs b5724fb6fd Add "Button Fishing" casting when lure fishing (#2226) 2026-08-20 17:13:00 -06:00
TakaRikka 05a1fe4485 some cleanup 2026-08-20 03:16:26 -07:00
TakaRikka 6f06a33926 only register ui changes during game mode 2026-08-20 02:37:31 -07:00
gymnast86 4d5fc47252 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-20 01:38:17 -07:00
TakaRikka 97d742a96a forgot to include tex oops 2026-08-20 01:26:05 -07:00
TakaRikka 80c93957e9 Merge remote-tracking branch 'origin/rando-mod' into rando-mod 2026-08-20 01:23:10 -07:00
TakaRikka dc716329d8 rando logo tex replacement 2026-08-20 01:22:49 -07:00
gymnast86 62bf0fbeb1 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-20 01:19:27 -07:00
gymnast86 ce4682fd89 Z2SceneMgr hooks 2026-08-20 01:19:19 -07:00
jdflyer acc8cc2e6d Fix signature on dMenu_Ring_c__destructor, Add play menu sound 2026-08-20 00:50:30 -07:00
TakaRikka c86d6918d6 hook up game mode service 2026-08-20 00:22:01 -07:00
jdflyer 5a4e6f3254 Mod SDK: Arc Overlays (#2280)
* Mod SDK: Arc Overlays

* Use DVD Functions for Arc overlays

* Re-add Fetchcontent for json.hpp

* Fix build for actions

* Make sure buffer usues aligned length

* Add include so msvc compiles

* Arc Overlays fixes: remove _arc suffix, handle getting overlayed file size from arcs, copy data correctly, etc.

* Reload overlayed data during loading screens

* Rename sync function

* Free overlayed files on load instead of re-loading them

* Rework arc overlays & load overlay files into host memory

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-08-20 00:47:57 -06:00
TakaRikka 5d5c3d5c5f Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-19 22:52:32 -07:00
TakaRikka 386d2f964b Merge pull request #2230 from jdflyer/main
Mod SDK: Game Mode Service
2026-08-19 22:51:24 -07:00
TakaRikka 04b915d8c7 castle barrier / big key requirement settings 2026-08-19 22:50:28 -07:00
Luke Street fd4a5f0cfb Use carousel button on prelaunch; more cleanup 2026-08-19 22:58:43 -06:00
TakaRikka 33abcbfbe1 maybe fix 2026-08-19 20:44:50 -07:00
Luke Street 3ecd785ac2 Rework UI lifecycle, finish renaming & cleanup 2026-08-19 21:43:41 -06:00
Luke Street fd0e33460f Gamemode -> GameMode 2026-08-19 20:49:58 -06:00
TakaRikka 6f840b050e permalink copy/paste working 2026-08-19 19:49:26 -07:00
TakaRikka 88c6e28179 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-19 19:37:57 -07:00
TakaRikka f13f0319ec Merge pull request #2318 from TwilitRealm/uisvc-clipboard
ui service: clipboard setter/getter functions
2026-08-19 19:36:36 -07:00
TakaRikka 06735d1369 c++ wrappers 2026-08-19 19:14:07 -07:00
TakaRikka 8525b0b40c enc's suggestions 2026-08-19 19:06:53 -07:00
TakaRikka e40506dfeb actually set outLength 2026-08-19 18:17:07 -07:00
TakaRikka ff3dbfa8d5 couple fixes 2026-08-19 18:15:42 -07:00
TakaRikka 5456d98fde add clipboard setter/getter functions 2026-08-19 16:18:00 -07:00
jdflyer 2f0cb26ceb Small fixes 2026-08-19 00:19:11 -07:00
jdflyer 21bc055552 Merge with origin/main 2026-08-19 00:16:37 -07:00
TakaRikka 3a2dbf9fba fix new build issues 2026-08-18 23:47:53 -07:00
TakaRikka 2d1487aefd Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-18 23:39:05 -07:00
Luke Street f6b7448de3 FlowService & MessageService (#2313) 2026-08-19 00:32:23 -06:00
jdflyer edfb93440c Prelaunch UI Fixes. Create Prelaunch after mod init. 2026-08-18 21:04:41 -07:00
gymnast86 f4f564b1b1 rework phase_1 hooks 2026-08-18 17:56:39 -07:00
gymnast86 4ba25932de remove unecessary setLineUpItem check 2026-08-18 16:30:54 -07:00
gymnast86 d4868ea81a dEvt_control_c::skipper hook 2026-08-18 16:13:30 -07:00
gymnast86 cd6c82d0ff forgot uninstall 2026-08-18 11:49:46 -07:00
gymnast86 355ea73510 getCollectSmell hook 2026-08-18 11:21:46 -07:00
jdflyer c0d44d4a21 Gamemode service improvements. Disable achievements on custom gamemodes (for now) 2026-08-18 00:33:15 -07:00
TakaRikka f0f7031b3d ui: basic excluded locations tab 2026-08-18 00:24:15 -07:00
jdflyer 85c2ddd8ff Merge with origin/main 2026-08-17 22:52:28 -07:00
jdflyer de7f09a6a4 Entrance Rando Fixes 2026-08-17 20:05:39 -07:00
TakaRikka 7129605035 forgot sound effect 2026-08-17 18:44:08 -07:00
TakaRikka 0c09d71c0a ui: starting inventory implemented 2026-08-17 18:32:10 -07:00
TakaRikka 947fb5b5a5 fix demo item gives and add obj item hooks 2026-08-17 02:12:25 -07:00
gymnast86 4c673eb04b dMenu_Ring_c hooks 2026-08-17 01:54:00 -07:00
gymnast86 9090ee80ab fix building in debug on windows 2026-08-17 01:49:44 -07:00
jdflyer 8953532fe7 OnNewSaveSelectFunction fix (Don't show name anm) 2026-08-16 18:41:07 -07:00
gymnast86 f1dc848ea5 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-16 17:58:06 -07:00
TakaRikka 548c843a9b remove unneeded mode dialog 2026-08-16 14:53:03 -07:00
TakaRikka 34a753ed85 make save_slot_written update current slot id 2026-08-16 14:08:09 -07:00
TakaRikka 08e51f83f3 item func changes 2026-08-15 23:38:29 -07:00
TakaRikka b4ba0b5755 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-15 16:54:35 -07:00
jdflyer 7c4338d7b3 Merge with origin/rando-mod 2026-08-15 16:43:10 -07:00
jdflyer 85a1a2901c Improve Entrance Coupling Logic, Improve Entrance Shuffle Data, fix seed name 2026-08-15 16:42:46 -07:00
TakaRikka a13932e901 partial ms check fix 2026-08-15 15:32:09 -07:00
Irastris c880d46fb5 d_menu_option bugfix (#2294) 2026-08-15 11:58:24 -06:00
Irastris 27d27e6d94 Add support for playing Dusklight using Wii disc images (#2296)
* Add offsets for Wii USA R0/R2, JPN, and PAL
Also fix an oopsie where l_pos and l_normal's offsets were swapped

* Allow loading Wii discs

* Change GameVersion::GcnJpn checks to isRegionJpn()

* Change GameVersion::GcnPal checks to isRegionPal()

* Add platformSelect and regionSelect templates, simplify a ton of code

* Add *_get() macros to simplify REL loads

* Actually accept Wii USA Rev. 2 discs

* Show the Wii USA revision in prelaunch's disc status

* l_normal isn't in Wii RELs, so I'll just hardcode it

* Account for various BLO differences

Fix crash when opening the map on Wii USA Rev 0 and Wii PAL

* Use the streamed version of the file select music

* Update language selection

* Fix the d-pad/cross button text for Wii PAL
Resizing panes that are already 120.0f wide is harmless, so I didn't bother with a GameVersion check

* Fix brightness check discrepancy, use IF_DUSK_BLOCK macros when ideal

* Update docs and the issue template
2026-08-15 11:58:09 -06:00
Irastris ac45cac56e Fix Graphics Backend option value (#2295)
* Graphics backend setting bugfix

* Better solution
2026-08-15 11:52:54 -06:00
Luke Street 9d38af22ee GfxService v1.2 + fixes (#2305)
* GfxService v1.2 + fixes

* gfx::synchronize before mod_shutdown
2026-08-15 11:50:13 -06:00
gymnast86 7cac8284d7 Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-15 05:24:56 -07:00
TakaRikka aa3db8f949 more hooks 2026-08-15 04:57:14 -07:00
TakaRikka 9f7360b359 mg_rod hooks 2026-08-15 03:20:06 -07:00
TakaRikka d319bb1049 demo item / bosswarp hooks 2026-08-15 02:00:10 -07:00
TakaRikka 1f43e16e2d more hooks wip 2026-08-14 23:41:12 -07:00
TakaRikka 2a67d6800e Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-14 19:17:16 -07:00
TakaRikka 4cbb8762f6 update aurora 2026-08-14 19:16:49 -07:00
TakaRikka c722cb1be0 update aurora 2026-08-14 19:12:14 -07:00
TakaRikka c2dbdd385d Merge remote-tracking branch 'origin/rando-mod' into rando-mod 2026-08-14 18:57:21 -07:00
TakaRikka 9c52a059bd alink demo and uzr portal hooks 2026-08-14 18:56:55 -07:00
jdflyer 33a9db2e49 Finish Implementing Entrance Rando 2026-08-14 18:26:37 -07:00
jdflyer e5a4323056 Merge with origin/rando-mod 2026-08-14 12:57:26 -07:00
jdflyer 08cda98337 Basic Entrance Rando 2026-08-14 12:56:40 -07:00
TakaRikka b0d4c62903 more hooks wip 2026-08-14 03:26:49 -07:00
TakaRikka a2cd701203 ykm/ykw/fairy hooks 2026-08-13 23:32:21 -07:00
Luke Street 0f5a248401 Time revamp (#2304)
* Don't Use OSCalendarTime for Speedrun Timing

- Shouldn't rely on OSTicksToCalendarTime since it will be changed to handle time zone conversion, and that doesn't make sense on elapsed time

* Use OSGetSystemTime Extension

- Fixes desyncing issues with save file time and a couple other odd instances, particularly on mobile platforms that suspend apps

* Time revamp

* Update aurora

* Split IGT/RTA calculations

* Shift-Turbo to slow down

---------

Co-authored-by: SuperDude88 <82904174+SuperDude88@users.noreply.github.com>
2026-08-14 00:07:54 -06:00
matthewdavidrichardanderson 045fbd9b46 request presentation sync for all captures (#2293)
Co-authored-by: matthewdavidrichardanderson <matthewdavidrichardanderson@mfb.com>
2026-08-13 23:54:29 -06:00
doop 46da33be37 Use texture replacement API for HQ minimap textures (#2303) 2026-08-13 23:44:36 -06:00
TakaRikka 8143de6bbb more hooks 2026-08-13 20:10:44 -07:00
TakaRikka 162829a8cf hook up randomizerState 2026-08-13 16:28:42 -07:00
TakaRikka c65b8a42b8 add handful of missing hooks 2026-08-13 14:50:39 -07:00
TakaRikka abbcb5a6b9 location name overrides for item service 2026-08-13 03:41:39 -07:00
TakaRikka 8229879aab refactor seed load/save and add file info hook 2026-08-13 02:04:41 -07:00
TakaRikka 11055282ff hook up item check overriding 2026-08-12 19:42:57 -07:00
TakaRikka 839d8fdb63 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-08-12 16:35:16 -07:00
TakaRikka 008a18c142 Merge pull request #2292 from TwilitRealm/item-svc
initial item service implementation
2026-08-12 15:34:45 -07:00
TakaRikka 5b4def820a couple fixes 2026-08-12 15:02:33 -07:00
TakaRikka 635901d3bd update game service major version 2026-08-12 13:59:01 -07:00
TakaRikka 5abc956448 daTbox2 handling 2026-08-11 14:45:53 -07:00
TakaRikka 5830c41547 couple ui fixes 2026-08-10 20:33:25 -07:00
TakaRikka 0c3bbbaba0 standardize some check names 2026-08-10 12:35:08 -07:00
gymnast86 1e39c5e1be Merge branch 'rando-mod' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-10 06:21:38 -07:00
gymnast86 2f1375297a Merge branch 'main' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-10 06:13:43 -07:00
baxlek 0fc05028cc Add Aiming Reticle for Bow and Slingshot (#2290)
* Change sight drawing flag to on in arrow logic

* Refactor setBowSight for PC targeting and reticle logic

* Add Aiming Reticle option to settings

Add option for Aiming Reticle in settings.

* Add aiming reticle setting to game preferences

* Add aiming reticle to user settings registration

* Add aimingReticle configuration variable

* Fix syntax error in settings.cpp

* Add aiming reticle check to bow charge condition

* Refactor bow charge sight position logic

Removed redundant sight position handling when aiming reticle is not displayed.

* Refactor setBowSight for Dusk targeting

* Clarify aiming reticle option description

* Refactor bow sight logic in setBowSight function

Removed dusk condition from bow sight check and adjusted sight drawing logic.

* Refactor sight drawing logic in d_a_alink_bow.inc

Remove redundant call to offDrawFlg() when aiming reticle is enabled.
2026-08-10 00:14:17 -04:00
TakaRikka 71b2eedc82 initial item service implementation 2026-08-09 16:40:26 -07:00
jdflyer 315897e45a Gamemode service fixes 2026-08-08 17:12:38 -07:00
Giorgio Mendieta 7434a0f834 Enable color diagnostics for CMake (#2273) 2026-08-08 16:14:52 -06:00
TakaRikka 25a736b9dc getLayerNo hook 2026-08-08 13:27:12 -07:00
TakaRikka a8089f1204 couple small fixes 2026-08-08 11:25:00 -07:00
TakaRikka 1f28fd1ca5 sky character blob and stage edit registration 2026-08-08 05:38:42 -07:00
TakaRikka e16c05211b seed selection + rando file setup working 2026-08-07 19:42:50 -07:00
jdflyer 8be95d3aa3 Allow Gamemodes to interrupt flow on file creation 2026-08-07 18:46:52 -07:00
jdflyer ce6850acd3 Fix small issues, update example in modding.md to show scoped hooks 2026-08-07 15:27:23 -07:00
jdflyer 4aa3b647a3 Merge with origin/main 2026-08-07 13:57:48 -07:00
TakaRikka a9767ad3e8 use persistent data directory 2026-08-07 11:35:50 -07:00
TakaRikka 2f4d8a06d8 remove unnecessary hooks 2026-08-07 11:15:36 -07:00
TakaRikka 769f83db25 add in hooks 2026-08-07 07:46:43 -07:00
TakaRikka 48cf860467 Merge branch 'main' of https://www.github.com/TwilitRealm/dusklight into rando-mod 2026-08-07 03:49:10 -07:00
TakaRikka 82e2fd4bea Merge pull request #2283 from encounter/camera-operator
Add camera operator API to CameraService
2026-08-07 03:44:59 -07:00
TakaRikka fcd9dd0f70 Merge pull request #2282 from encounter/mods-data-dir
Add HostService.data_dir
2026-08-07 03:42:53 -07:00
TakaRikka 8afe479d0f Merge pull request #2281 from encounter/hook-uninstall
Add mods::hook::uninstall
2026-08-07 03:39:24 -07:00
Luke Street c5933be631 Add camera operator API to CameraService 2026-08-07 00:34:57 -06:00
Luke Street 928e9b4bc7 Add HostService.data_dir 2026-08-07 00:20:09 -06:00
Luke Street 3ac0fcb156 Add mods::hook::uninstall 2026-08-06 23:59:26 -06:00
TakaRikka cb564f7465 ui: initial file select gate implementation 2026-08-06 18:00:16 -07:00
TakaRikka 2c7ab755a0 Merge pull request #2276 from encounter/align
Fix ATTRIBUTE_ALIGN placement
2026-08-06 08:58:15 -07:00
TakaRikka cd2ed2843c ui: begin hooking up some menu controls 2026-08-06 03:49:26 -07:00
Luke Street cf8ab52f55 Fix ATTRIBUTE_ALIGN placement 2026-08-05 21:16:06 -06:00
TakaRikka c853934a24 Merge branch 'main' of https://www.github.com/TwilitRealm/dusklight into rando-mod 2026-08-05 16:32:21 -07:00
TakaRikka 8c4ad273b8 ui: blocking in seed options and hints tabs 2026-08-05 16:02:40 -07:00
TakaRikka 2a0cd87246 ui: start implementing menu tabs and controls 2026-08-05 14:27:59 -07:00
Luke Street 13b3b68fe5 Migrate to Borealis (#2266) 2026-08-05 07:54:31 -06:00
TakaRikka 8d677bf517 ui: wip porting main ui 2026-08-05 04:43:55 -07:00
TakaRikka 3160d1c370 ui: config_store/seed_generation 2026-08-05 03:04:06 -07:00
TakaRikka 0ed984a863 use new log fmt wrappers 2026-08-05 00:43:23 -07:00
TakaRikka 027e23d2e7 include save/stage services 2026-08-05 00:19:28 -07:00
TakaRikka 105413360e Merge branch 'main' of https://www.github.com/TwilitRealm/dusklight into rando-mod 2026-08-05 00:13:24 -07:00
TakaRikka 4604304305 mods: stage service (#2268)
* initial stage service ported from encounter's original impl

* Review cleanup

* initial stage service ported from encounter's original impl

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-08-04 21:51:52 -06:00
Pwootage 794bb130e2 Fix for Linux distributions that use lib64: force libturbojpeg to use 'lib' (#2269) 2026-08-04 21:49:33 -06:00
gymnast86 d82cb08353 another include 2026-08-04 08:47:00 -07:00
gymnast86 572e9633ab fix more includes 2026-08-04 08:21:23 -07:00
gymnast86 67a511a131 fix includes 2026-08-04 08:00:25 -07:00
gymnast86 0ff615f991 more code -> flow changes 2026-08-04 07:56:05 -07:00
gymnast86 2191b38c1d Merge branch 'main' of https://github.com/TwilitRealm/dusk into rando-mod 2026-08-04 07:13:08 -07:00
gymnast86 36d31e2bb8 update data for flow node usage 2026-08-03 14:15:35 -07:00
gymnast86 2b489e1a7d add logic tests executable 2026-08-02 01:48:58 -07:00
gymnast86 e93a720d8f update src files with hint stuff 2026-08-02 01:37:12 -07:00
gymnast86 66f6942dbb update generator with hint stuff 2026-08-02 01:25:06 -07:00
gymnast86 631cb99208 add standalone generator for easier generator testing 2026-08-02 00:58:52 -07:00
TakaRikka a53b363905 Merge branch 'main' of ssh://github.com/TwilitRealm/dusklight into rando-mod 2026-07-30 05:45:18 -07:00
TakaRikka fae9add351 generator / basic mod structure building 2026-07-27 22:33:03 -07:00
jdflyer f22bfcd9ba Add restart to prelaunch button to settings, remove gamemodeStub functions 2026-07-26 00:25:59 -07:00
jdflyer 9c2e0e9331 Fix typo on std::tolower 2026-07-20 23:22:46 -07:00
jdflyer ecbec503dc Merge with origin/main 2026-07-20 17:24:48 -07:00
jdflyer 91c6c5c137 Fix Issues with mod resetting, make gamemode ids lowercase, update modding.md 2026-07-20 17:18:23 -07:00
jdflyer 449a8408ab Correctly unregister gamemodes from the service 2026-07-19 20:01:46 -07:00
jdflyer 61a4ab3117 Mod SDK: Gamemode Service, Change Speedrun mode to a gamemode, Allow prelaunch to be restarted 2026-07-19 00:50:49 -07:00
643 changed files with 101250 additions and 16177 deletions
+10 -5
View File
@@ -68,13 +68,18 @@ body:
required: true required: true
- type: dropdown - type: dropdown
id: game-region id: game-disc
attributes: attributes:
label: Game Region label: Game Disc
description: The game region you are playing on description: The game disc you are playing on
options: options:
- NTSC-U (North America) - GameCube NTSC-U (North America)
- PAL (Europe) - GameCube PAL (Europe)
- GameCube NTSC-J (Japan)
- Wii NTSC-U (North America) Revision 0
- Wii NTSC-U (North America) Revision 2
- Wii PAL (Europe)
- Wii NTSC-J (Japan)
validations: validations:
required: true required: true
+4 -4
View File
@@ -76,7 +76,7 @@ jobs:
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: dusklight-${{env.DUSK_VERSION}}-linux-${{matrix.preset}}-${{matrix.artifact_arch}} name: dusklight-${{env.APP_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.DUSK_VERSION}}-${{matrix.artifact_name}} name: dusklight-${{env.APP_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.DUSK_VERSION}}-android-${{matrix.artifact_arch}} name: dusklight-${{env.APP_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.DUSK_VERSION}}-win32-msvc-${{matrix.artifact_arch}} name: dusklight-${{env.APP_VERSION}}-win32-msvc-${{matrix.artifact_arch}}
path: | path: |
build/install/*.exe build/install/*.exe
build/install/*.dll build/install/*.dll
+3
View File
@@ -1,3 +1,6 @@
[submodule "extern/aurora"] [submodule "extern/aurora"]
path = extern/aurora path = extern/aurora
url = https://github.com/encounter/aurora.git url = https://github.com/encounter/aurora.git
[submodule "extern/borealis"]
path = extern/borealis
url = https://github.com/encounter/borealis.git
+61 -131
View File
@@ -5,10 +5,11 @@ if (NOT CMAKE_BUILD_TYPE)
"Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE) "Build type options: Debug Release RelWithDebInfo MinSizeRel" FORCE)
endif () endif ()
include(cmake/DetectVersion.cmake) include(extern/borealis/cmake/DetectVersion.cmake)
detect_version() borealis_detect_version()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
project(dusklight LANGUAGES C CXX VERSION ${DUSK_VERSION_STRING}) project(dusklight LANGUAGES C CXX VERSION ${BOREALIS_APP_VERSION})
if (APPLE) if (APPLE)
enable_language(OBJC OBJCXX) enable_language(OBJC OBJCXX)
endif () endif ()
@@ -32,6 +33,7 @@ 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
@@ -74,6 +76,8 @@ 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")
@@ -85,8 +89,6 @@ 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)
@@ -150,6 +152,7 @@ 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}")
@@ -234,18 +237,6 @@ 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
@@ -253,7 +244,7 @@ FetchContent_Declare(miniz
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
) )
set(_fetch_content_deps cxxopts json miniz) set(_fetch_content_deps 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
@@ -288,40 +279,12 @@ 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
@@ -334,67 +297,23 @@ 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} ${DUSK_HTTP_BACKEND_FILES}) source_group("dusklight" FILES ${DUSK_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 freeverb cxxopts::cxxopts absl::flat_hash_map nlohmann_json::nlohmann_json TracyClient fmt::fmt 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
Threads::Threads zstd::libzstd dusklight_game_headers) Threads::Threads zstd::libzstd dusklight_game_headers)
if (DUSK_HAS_FUNCHOOK) if (DUSK_HAS_FUNCHOOK)
list(APPEND GAME_LIBS funchook-static) list(APPEND GAME_LIBS funchook-static)
endif () endif ()
if (DUSK_ENABLE_SENTRY_NATIVE)
list(APPEND GAME_LIBS sentry)
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_SENTRY_NATIVE=1 SENTRY_BUILD_STATIC=1)
endif ()
if (WIN32) if (WIN32)
list(APPEND GAME_LIBS Ws2_32) list(APPEND GAME_LIBS Ws2_32)
if (CMAKE_BUILD_TYPE STREQUAL Debug)
list(APPEND GAME_LIBS dbghelp)
list(APPEND GAME_COMPILE_DEFS DUSK_CRASH_DBGHELP=1)
endif ()
endif () endif ()
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/no_backend.cpp)
if (DUSK_ENABLE_UPDATE_CHECKER)
list(APPEND GAME_COMPILE_DEFS DUSK_ENABLE_UPDATE_CHECKER=1)
if (WIN32)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/winhttp.cpp)
list(APPEND GAME_LIBS winhttp)
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_WINHTTP=1)
message(STATUS "dusklight: Enabled update checker (WinHTTP)")
elseif (ANDROID)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/android.cpp)
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_ANDROID=1)
message(STATUS "dusklight: Enabled update checker (Android)")
elseif (APPLE)
find_library(FOUNDATION_FRAMEWORK Foundation REQUIRED)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/url_session.mm)
set_source_files_properties(src/dusk/http/url_session.mm PROPERTIES COMPILE_FLAGS -fobjc-arc)
list(APPEND GAME_LIBS ${FOUNDATION_FRAMEWORK})
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_URLSESSION=1)
message(STATUS "dusklight: Enabled update checker (NSURLSession)")
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
find_package(CURL QUIET OPTIONAL_COMPONENTS HTTPS SSL)
if (CURL_FOUND AND CURL_HTTPS_FOUND AND CURL_SSL_FOUND)
set(DUSK_HTTP_BACKEND_SOURCE src/dusk/http/curl.cpp)
list(APPEND GAME_LIBS CURL::libcurl)
list(APPEND GAME_COMPILE_DEFS DUSK_HTTP_BACKEND_LIBCURL=1)
message(STATUS "dusklight: Enabled update checker (libcurl)")
else ()
message(STATUS "dusklight: Disabled update checker (libcurl + HTTPS/SSL not found)")
endif ()
else ()
message(STATUS "dusklight: Disabled update checker (unsupported platform)")
endif ()
endif ()
list(APPEND DUSK_FILES ${DUSK_HTTP_BACKEND_SOURCE})
if (DUSK_MOVIE_SUPPORT) if (DUSK_MOVIE_SUPPORT)
if (TARGET libjpeg-turbo::turbojpeg-static) if (TARGET libjpeg-turbo::turbojpeg-static)
list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static) list(APPEND GAME_LIBS libjpeg-turbo::turbojpeg-static)
@@ -404,15 +323,6 @@ if (DUSK_MOVIE_SUPPORT)
list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1) list(APPEND GAME_COMPILE_DEFS MOVIE_SUPPORT=1)
endif () endif ()
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 ()
@@ -477,10 +387,10 @@ 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 ()
@@ -501,7 +411,47 @@ if (DUSK_ENABLE_CODE_MODS)
setup_symbol_manifest(dusklight) setup_symbol_manifest(dusklight)
endif () endif ()
# Hook reliability: guaranteed patchable entries on the game ABI surface, and no identical-code folding. # Hook reliability: prevent auto-inlining, guarantee patchable function entries,
# and disable identical-code folding for game functions.
set(DUSK_GAME_ABI_INLINE_OPTIONS)
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND DUSK_GAME_ABI_INLINE_OPTIONS
$<$<COMPILE_LANGUAGE:CXX>:-finline-hint-functions>)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND DUSK_GAME_ABI_INLINE_OPTIONS
$<$<COMPILE_LANGUAGE:CXX>:-flive-patching=inline-clone>
$<$<COMPILE_LANGUAGE:CXX>:-fno-inline-functions>
$<$<COMPILE_LANGUAGE:CXX>:-fno-inline-small-functions>
$<$<COMPILE_LANGUAGE:CXX>:-fno-inline-functions-called-once>
$<$<COMPILE_LANGUAGE:CXX>:-fno-early-inlining>
$<$<COMPILE_LANGUAGE:CXX>:-fno-ipa-cp>
$<$<COMPILE_LANGUAGE:CXX>:-fno-ipa-cp-clone>
$<$<COMPILE_LANGUAGE:CXX>:-fno-ipa-sra>
$<$<COMPILE_LANGUAGE:CXX>:-fno-partial-inlining>)
endif ()
endif ()
if (DUSK_GAME_ABI_INLINE_OPTIONS)
set(_game_abi_files ${GAME_BASE_FILES} ${GAME_DEBUG_FILES})
list(FILTER _game_abi_files EXCLUDE REGEX "^src/dusk/")
set_property(SOURCE ${_game_abi_files} APPEND PROPERTY
COMPILE_OPTIONS ${DUSK_GAME_ABI_INLINE_OPTIONS})
foreach(jsystem_lib IN LISTS JSYSTEM_LIBRARIES)
target_compile_options(${jsystem_lib} PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS})
endforeach()
foreach(_sdk_lib aurora_card aurora_core aurora_dvd aurora_gd aurora_gx aurora_mtx
aurora_os aurora_pad aurora_si aurora_vi)
if (TARGET ${_sdk_lib})
get_target_property(_sdk_lib_imported ${_sdk_lib} IMPORTED)
if (NOT _sdk_lib_imported)
target_compile_options(${_sdk_lib} PRIVATE ${DUSK_GAME_ABI_INLINE_OPTIONS})
endif ()
endif ()
endforeach ()
endif ()
if (MSVC) if (MSVC)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:/hotpatch>) set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:/hotpatch>)
@@ -511,11 +461,11 @@ if (MSVC)
else () else ()
target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF) target_link_options(dusklight PRIVATE /FUNCTIONPADMIN /OPT:NOICF)
endif () endif ()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "^(AppleClang|Clang)$") elseif (CMAKE_CXX_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU)$")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64") if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)$" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=2,1>) set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=2,1>)
else () else ()
set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=10,5>) set(DUSK_PATCHABLE_ENTRY_FLAG $<$<COMPILE_LANGUAGE:C,CXX>:-fpatchable-function-entry=10,4>)
endif () endif ()
endif () endif ()
@@ -558,17 +508,9 @@ 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)
@@ -617,6 +559,9 @@ if (DUSK_ENABLE_CODE_MODS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR
add_subdirectory(mods/ao_mod) add_subdirectory(mods/ao_mod)
add_subdirectory(mods/shadow_mod) add_subdirectory(mods/shadow_mod)
add_subdirectory(mods/window_demo) add_subdirectory(mods/window_demo)
add_subdirectory(mods/flow_demo)
add_subdirectory(mods/basic_cosmetics_mod)
add_subdirectory(mods/randomizer)
endif () endif ()
if (APPLE) if (APPLE)
@@ -650,8 +595,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 ${DUSK_VERSION_STRING} MACOSX_BUNDLE_BUNDLE_VERSION ${BOREALIS_APP_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${DUSK_SHORT_VERSION_STRING} MACOSX_BUNDLE_SHORT_VERSION_STRING ${BOREALIS_APP_SHORT_VERSION}
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"
@@ -684,21 +629,6 @@ 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",
"DUSK_ENABLE_SENTRY_NATIVE": { "BOREALIS_ENABLE_SENTRY": {
"type": "BOOL", "type": "BOOL",
"value": true "value": true
}, },
"DUSK_SENTRY_DSN": "$env{SENTRY_DSN}", "BOREALIS_SENTRY_DSN": "$env{SENTRY_DSN}",
"DUSK_SENTRY_ENVIRONMENT": "production", "BOREALIS_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": {
"DUSK_ENABLE_SENTRY_NATIVE": { "BOREALIS_ENABLE_SENTRY": {
"type": "BOOL", "type": "BOOL",
"value": false "value": false
} }
+4 -1
View File
@@ -26,7 +26,10 @@ It aims to be as accurate as possible to the original while also providing new o
You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space. You must dump your own copy of the game. Please see [this article](https://wiki.dolphin-emu.org/index.php?title=Ripping_Games) for instructions. After dumping, you can use a program like [Dolphin](https://dolphin-emu.org/) or [nodtool](https://github.com/encounter/nod/releases) to convert the `.iso` to `.rvz` to save space.
Currently, only the GameCube releases are supported. Support for other versions of the game is planned in the future. Dusklight currently supports all commercial discs except for Wii's Korean release.
> [!NOTE]
> Dusklight is based on the [Twilight Princess decompilation](https://github.com/zeldaret/tp), which is currently only matching for GameCube. As a result, even when playing Dusklight with a Wii disc, you will be presented with the GameCube version's HUD and certain other specificities.
### 2. Install Dusklight ### 2. Install Dusklight
+1 -1
View File
@@ -23,5 +23,5 @@ cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,102
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
cd build/install cd build/install
VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \ VERSION="$APP_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
@@ -1,121 +0,0 @@
# Version detection shared by the main build and the mod SDK (sdk/CMakeLists.txt)
include_guard(GLOBAL)
get_filename_component(_DUSK_VERSION_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
set(DUSK_SENTRY_DSN "" CACHE STRING "Sentry DSN")
set(DUSK_SENTRY_ENVIRONMENT "development" CACHE STRING "Sentry environment")
set(DUSK_VERSION_OVERRIDE "" CACHE STRING "Override version string (skips git detection and format validation)")
macro(detect_version)
if (DUSK_VERSION_OVERRIDE)
set(DUSK_WC_DESCRIBE "${DUSK_VERSION_OVERRIDE}")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
set(DUSK_VERSION_CODE "1")
set(DUSK_WC_REVISION "")
set(DUSK_WC_BRANCH "")
set(DUSK_WC_DATE "")
message(STATUS "Dusklight version overridden to ${DUSK_WC_DESCRIBE}")
else ()
# obtain revision info from git
find_package(Git)
if (GIT_FOUND)
# make sure version information gets re-run when the current Git HEAD changes
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --git-path HEAD
OUTPUT_VARIABLE dusk_git_head_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(dusk_git_head_filename "${dusk_git_head_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_filename}")
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --symbolic-full-name HEAD
OUTPUT_VARIABLE dusk_git_head_symbolic
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT}
COMMAND ${GIT_EXECUTABLE} rev-parse --git-path ${dusk_git_head_symbolic}
OUTPUT_VARIABLE dusk_git_head_symbolic_filename
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(dusk_git_head_symbolic_filename "${dusk_git_head_symbolic_filename}" ABSOLUTE BASE_DIR "${_DUSK_VERSION_ROOT}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${dusk_git_head_symbolic_filename}")
# defines DUSK_WC_REVISION
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE DUSK_WC_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DESCRIBE
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} describe --tags --long --dirty --match "v*"
OUTPUT_VARIABLE DUSK_WC_DESCRIBE
OUTPUT_STRIP_TRAILING_WHITESPACE)
# remove the git hash, then collapse a clean "-0" suffix only
string(REGEX REPLACE "-[^-]+(-dirty|)$" "\\1" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
string(REGEX REPLACE "-0$" "" DUSK_WC_DESCRIBE "${DUSK_WC_DESCRIBE}")
# defines DUSK_WC_BRANCH
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE DUSK_WC_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DUSK_WC_DATE
execute_process(WORKING_DIRECTORY ${_DUSK_VERSION_ROOT} COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad
OUTPUT_VARIABLE DUSK_WC_DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
message(STATUS "Unable to find git, commit information will not be available")
endif ()
if (DUSK_WC_DESCRIBE MATCHES "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)([-+].*)?$")
set(DUSK_SHORT_VERSION_STRING "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
set(_ver_major ${CMAKE_MATCH_1})
set(_ver_minor ${CMAKE_MATCH_2})
set(_ver_patch ${CMAKE_MATCH_3})
set(DUSK_VERSION_TWEAK "0")
if (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
elseif (DUSK_WC_DESCRIBE MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+-([0-9]+)(-dirty)?$")
set(DUSK_VERSION_TWEAK "${CMAKE_MATCH_1}")
endif ()
set(DUSK_VERSION_STRING "${DUSK_SHORT_VERSION_STRING}.${DUSK_VERSION_TWEAK}")
if (DUSK_VERSION_TWEAK GREATER 999)
set(_tweak 999)
else ()
set(_tweak ${DUSK_VERSION_TWEAK})
endif ()
# encoding: major*1e7 + minor*1e5 + patch*1e3 + tweak; collision-free for major<210, minor<100, patch<100, tweak<=999
math(EXPR DUSK_VERSION_CODE
"${_ver_major} * 10000000 + ${_ver_minor} * 100000 + ${_ver_patch} * 1000 + ${_tweak}")
else ()
set(DUSK_WC_DESCRIBE "UNKNOWN-VERSION")
set(DUSK_VERSION_STRING "0.0.0.0")
set(DUSK_SHORT_VERSION_STRING "0.0.0")
set(DUSK_VERSION_CODE "1")
endif ()
endif ()
# Add version information to CI environment variables
if (DEFINED ENV{GITHUB_ENV})
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION=${DUSK_WC_DESCRIBE}\n")
file(APPEND "$ENV{GITHUB_ENV}" "DUSK_VERSION_CODE=${DUSK_VERSION_CODE}\n")
endif ()
message(STATUS "Dusklight version set to ${DUSK_WC_DESCRIBE}")
endmacro()
# Sets PLATFORM_NAME and configures version.h into the caller's binary dir.
macro(configure_version_header)
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
set(PLATFORM_NAME win32)
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
if (IOS)
set(PLATFORM_NAME ios)
elseif (TVOS)
set(PLATFORM_NAME tvos)
else ()
set(PLATFORM_NAME macos)
endif ()
else ()
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
endif ()
configure_file(${_DUSK_VERSION_ROOT}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
endmacro()
+9 -9
View File
@@ -2,7 +2,7 @@ include_guard(GLOBAL)
get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY) get_filename_component(_SYMBOL_MANIFEST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
set(_SYMGEN_VERSION "1.3.2") set(_SYMGEN_VERSION "1.3.3")
set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}") set(_SYMGEN_RELEASE_BASE_URL "https://github.com/encounter/symgen/releases/download/v${_SYMGEN_VERSION}")
set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release") set(SYMGEN_PATH "" CACHE FILEPATH "Path to a symgen executable; empty downloads the pinned release")
mark_as_advanced(SYMGEN_PATH) mark_as_advanced(SYMGEN_PATH)
@@ -15,32 +15,32 @@ function(symgen_host_asset out_name out_hash)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
if (_host_processor MATCHES "^(arm64|aarch64)$") if (_host_processor MATCHES "^(arm64|aarch64)$")
set(_asset "symgen-macos-arm64") set(_asset "symgen-macos-arm64")
set(_asset_hash "SHA256=0344838d1674df09c17c3eeddcf26eb89c333fdb85dfd78f68adc436070eccbe") set(_asset_hash "SHA256=e8420df1160242c83bd0e5197efeeb25ceb9fecc69dbc82bdc4927476381e948")
elseif (_host_processor MATCHES "^(x86_64|amd64)$") elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-macos-x86_64") set(_asset "symgen-macos-x86_64")
set(_asset_hash "SHA256=ae0674f4a1e9d0dedfa02d35939ac28cdd229276b331c1f507df5df809cbec7e") set(_asset_hash "SHA256=e51d13bbf0e982d1519f56850ff3c7b5910ca5a7095dd5a82cd8e59750e2d013")
endif () endif ()
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
if (_host_processor MATCHES "^(aarch64|arm64)$") if (_host_processor MATCHES "^(aarch64|arm64)$")
set(_asset "symgen-linux-aarch64") set(_asset "symgen-linux-aarch64")
set(_asset_hash "SHA256=af766de2bfaeb0a06f6d7bc17bb2510b4a9c40f44a56e49bc4a4b798a6223042") set(_asset_hash "SHA256=331190dd21ecee12a52e857b7f90a8b3e0a114608173813f7df74a31cf783f70")
elseif (_host_processor MATCHES "^(x86_64|amd64)$") elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-linux-x86_64") set(_asset "symgen-linux-x86_64")
set(_asset_hash "SHA256=ebd62fb9623acc942b6295609e2306f85a73043b0a8a117f2072b761dd08e68f") set(_asset_hash "SHA256=d727e0ba43242f92a92865af1b69c47aa9d81a0242c4570ce53b90e1ecd15e84")
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
set(_asset "symgen-linux-i686") set(_asset "symgen-linux-i686")
set(_asset_hash "SHA256=07780a4513fd29726578efc4ff2d88736b22f407ed821b32a68e35ff1e9af5f4") set(_asset_hash "SHA256=0c9f94d36b7fa46d15a199c9d0f1a633b73eb7d9c02621a6a76a676b83a135c7")
endif () endif ()
elseif (CMAKE_HOST_WIN32) elseif (CMAKE_HOST_WIN32)
if (_host_processor MATCHES "^(arm64|aarch64)$") if (_host_processor MATCHES "^(arm64|aarch64)$")
set(_asset "symgen-windows-arm64.exe") set(_asset "symgen-windows-arm64.exe")
set(_asset_hash "SHA256=5bb22b4a4a9b5ad45646af411bfb09b8321a732ff3a077eb4c9de1feaef27d2b") set(_asset_hash "SHA256=c699192957e2086ed68912ed39fa77858e1ae894476ab8b557711804cf2aa7cb")
elseif (_host_processor MATCHES "^(x86_64|amd64)$") elseif (_host_processor MATCHES "^(x86_64|amd64)$")
set(_asset "symgen-windows-x86_64.exe") set(_asset "symgen-windows-x86_64.exe")
set(_asset_hash "SHA256=1d1ac087f991a96932d108969e15998becfec643e88f3e7d182ca97ebfc6a46f") set(_asset_hash "SHA256=6d56a45617c75065ab7a3192d09ca52ff735baf5637b0899f446138d46acc310")
elseif (_host_processor MATCHES "^(i[3-6]86|x86)$") elseif (_host_processor MATCHES "^(i[3-6]86|x86)$")
set(_asset "symgen-windows-x86.exe") set(_asset "symgen-windows-x86.exe")
set(_asset_hash "SHA256=c113f4cd05f813efe2b1878dbfcf44d6302aee3974271736e0036430b0cced78") set(_asset_hash "SHA256=6cccc3a8d29e7525a4d1ade1dc4d89327b7c3002a604ab1c7decb43eea6fd4ab")
endif () endif ()
endif () endif ()
+7 -1
View File
@@ -5,7 +5,13 @@
- A Windows, Linux, or macOS device - A Windows, Linux, or macOS device
- iOS device connected to computer via USB - iOS device connected to computer via USB
- Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases)) - Dusklight IPA file (download the latest `Dusklight-vX.X.X-ios-arm64.ipa` from the [releases page](https://github.com/TwilitRealm/dusklight/releases))
- Legally acquired game disc - `GZ2E01` (Gamecube USA) or `GZ2PE01` (Gamecube PAL) - Legally acquired game disc:
- `GZ2E01` (GameCube USA)
- `GZ2P01` (GameCube PAL)
- `GZ2J01` (GameCube JPN)
- `RZDE01` (Wii USA Rev. 0 *or* Rev. 2)
- `RZDP01` (Wii PAL)
- `RZDJ01` (Wii JPN)
## 1. Install iloader ## 1. Install iloader
+281 -19
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`. Note that the bundle is read-only; for writable Missing files return `MOD_UNAVAILABLE`. Always `free` what you `load`. The bundle is read-only; use
storage, use the directory from `svc_host->mod_dir(mod_ctx)`. `HostService::data_dir` for persistent storage.
### HostService (`mods/svc/host.h`) ### HostService (`mods/svc/host.h`)
@@ -219,9 +219,17 @@ Mod metadata and runtime interaction with the loader:
```cpp ```cpp
IMPORT_SERVICE(HostService, svc_host); IMPORT_SERVICE(HostService, svc_host);
const char* id = svc_host->mod_id(mod_ctx); // Temporary mod data directory, wiped on startup
const char* dir = svc_host->mod_dir(mod_ctx); // writable per-mod directory const char* cacheDir = svc_host->mod_dir(mod_ctx);
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).
@@ -254,14 +262,16 @@ Installs hooks on game functions and resolves symbols by name. You'll rarely cal
### OverlayService (`mods/svc/overlay.h`) ### OverlayService (`mods/svc/overlay.h`)
Registers DVD file overlays at runtime: the dynamic counterpart to the static `overlay/` directory (see Registers DVD file overlays at runtime: the dynamic counterpart to the static `overlay/` directory (see
[Asset Overlays](#asset-overlays)). Overlay a disc path with a file from your bundle, or with a caller-owned buffer [Asset Overlays](#asset-overlays)). Overlay a disc path with a file from your bundle, a file within an archive,
or with a caller-owned buffer
(copied on registration): (copied on registration):
```cpp ```cpp
IMPORT_SERVICE(OverlayService, svc_overlay); IMPORT_SERVICE(OverlayService, svc_overlay);
OverlayHandle handle = 0; OverlayHandle handle = 0;
svc_overlay->add_file(mod_ctx, "/res/Msgus.arc", "res/replacement.arc", &handle); svc_overlay->add_file(mod_ctx, "/Movie/demo_movie98_00.thp", "res/replacement.thp", &handle); // Replaces the demo movie
svc_overlay->add_file(mod_ctx, "/res/Object/Kmdl/archive/bmwr/al.bmd", "res/link_model.bmd", &handle); // Replaces link's model
svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr); svc_overlay->add_buffer(mod_ctx, "/generated.txt", data, size, nullptr);
svc_overlay->remove(mod_ctx, handle); svc_overlay->remove(mod_ctx, handle);
``` ```
@@ -270,6 +280,9 @@ svc_overlay->remove(mod_ctx, handle);
on the disc are added as new files. Changes are applied at the next frame boundary, and data the game already read on the disc are added as new files. Changes are applied at the next frame boundary, and data the game already read
stays in memory until the file is re-read: sometimes a scene reload, and in the worst case, a full restart. stays in memory until the file is re-read: sometimes a scene reload, and in the worst case, a full restart.
Dusklight reloads core archive files during scene transitions so modifications to Link, Midna or other globally-loaded
data get refreshed without a full restart.
See [Asset Overlays](#asset-overlays) for priority and conflict handling. See [Asset Overlays](#asset-overlays) for priority and conflict handling.
### TextureService (`mods/svc/texture.h`) ### TextureService (`mods/svc/texture.h`)
@@ -373,6 +386,55 @@ 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,
@@ -412,8 +474,8 @@ per-window RCSS. A non-`MOD_OK` result from `build`/`update` fails your mod, as
callback. callback.
**Controls:** `pane_add_control` adds an input row described by a `UiControlDesc`: `UI_CONTROL_BUTTON`, **Controls:** `pane_add_control` adds an input row described by a `UiControlDesc`: `UI_CONTROL_BUTTON`,
`UI_CONTROL_TOGGLE`, `UI_CONTROL_NUMBER`, `UI_CONTROL_STRING`, or `UI_CONTROL_SELECT`. Values bind with callbacks or `UI_CONTROL_GROUP`, `UI_CONTROL_TOGGLE`, `UI_CONTROL_NUMBER`, `UI_CONTROL_STRING`, `UI_CONTROL_SELECT`, or
directly to a config var. `UI_CONTROL_COLOR`. Values bind with callbacks or directly to a config var.
```cpp ```cpp
UiControlDesc control = UI_CONTROL_DESC_INIT; UiControlDesc control = UI_CONTROL_DESC_INIT;
@@ -426,9 +488,56 @@ svc_ui->pane_add_control(mod_ctx, leftPane, &control, nullptr);
``` ```
`UI_BINDING_CONFIG_VAR` wires persistence, change notifications, and the modified indicator automatically. The var `UI_BINDING_CONFIG_VAR` wires persistence, change notifications, and the modified indicator automatically. The var
type must match the control: `TOGGLE` = bool, `NUMBER` and `SELECT` = int, `STRING` = string. Float vars are not type must match the control: `TOGGLE` = bool, `NUMBER` and `SELECT` = int, `STRING` and `COLOR` = string. Float vars
bindable; use callbacks and convert. `help_rml` and `SELECT` option lists render in a help pane, so `SELECT` controls are not bindable; use callbacks and convert. `help_rml` and `SELECT` option lists render in a help pane, so `SELECT`
are only available inside window tabs. controls are only available inside window tabs.
`pane_add_group` adds a category button to a window tab's left pane. Focusing the button clears the paired right pane
and calls the group's build callback with that pane, which is useful for organizing related controls without adding
more tabs.
**Lists:** `pane_add_list` adds a scrollable virtualized list of items that can be efficiently updated and filtered.
Keys must be unique and remain stable across replacements.
```cpp
UiListHandle locationList = 0;
void replace_locations(std::string_view query) {
std::vector<UiListItem> items;
for (uint64_t i = 0; i < locations.size(); ++i) {
if (matches(locations[i], query)) {
UiListItem item = UI_LIST_ITEM_INIT;
item.key = i;
item.label = locations[i].c_str();
items.push_back(item);
}
}
svc_ui->list_set_items(mod_ctx, locationList, items.data(), items.size());
}
void set_filter(ModContext*, void*, const UiControlValue* value) {
replace_locations(value->string_value);
}
bool location_selected(ModContext*, UiListHandle, uint64_t key, void*) {
return selected_locations.contains(key);
}
UiControlDesc filter = UI_CONTROL_DESC_INIT;
filter.kind = UI_CONTROL_STRING;
filter.label = "Filter";
filter.get = get_filter;
filter.set = set_filter;
filter.string_set_mode = UI_STRING_SET_ON_CHANGE; /* invoke `set` while typing */
svc_ui->pane_add_control(mod_ctx, pane, &filter, nullptr);
UiListDesc list = UI_LIST_DESC_INIT;
/* items may be passed as a part of list creation, or set afterwards */
list.on_pressed = location_pressed;
list.is_selected = location_selected;
svc_ui->pane_add_list(mod_ctx, pane, &list, &locationList);
replace_locations(""); /* calls `list_set_items` */
```
**Windows:** `window_push` pushes a tabbed two-pane window onto the document stack and shows it. Each tab's `build` **Windows:** `window_push` pushes a tabbed two-pane window onto the document stack and shows it. Each tab's `build`
receives the window handle plus fresh left and right pane handles on every activation. The optional per-tab `update` receives the window handle plus fresh left and right pane handles on every activation. The optional per-tab `update`
@@ -450,10 +559,36 @@ svc_ui->window_push(mod_ctx, &desc, &window);
``` ```
**Dialogs:** `dialog_push` shows a modal dialog. `variant` picks the style, `icon` optionally overrides the variant's **Dialogs:** `dialog_push` shows a modal dialog. `variant` picks the style, `icon` optionally overrides the variant's
default icon, and actions become buttons. After an action's `on_pressed` returns, the dialog closes unless the action default icon, and actions become buttons. The optional `build` callback allows you to add controls to a pane between
sets `keep_open`. A `keep_open` action can close it later (or immediately) with `dialog_close`. Cancel fires the body and actions. It uses the same text, progress, and control builders as panels.
`on_dismiss` if present and always closes. `dialog_set_body`, `dialog_set_icon`, and `dialog_add_action` mutate a live
dialog. ```cpp
ModResult build_dialog(ModContext*, UiElementHandle pane, void*, ModError*) {
UiControlDesc input = UI_CONTROL_DESC_INIT;
input.kind = UI_CONTROL_STRING;
input.label = "Name";
input.get = get_name;
input.set = set_name;
return svc_ui->pane_add_control(mod_ctx, pane, &input, nullptr);
}
UiDialogAction action = UI_DIALOG_ACTION_INIT;
action.label = "Save";
action.on_pressed = save;
action.is_disabled = is_save_disabled;
UiDialogDesc dialog = UI_DIALOG_DESC_INIT;
dialog.title = "New Preset";
dialog.body_rml = "Choose a name for the preset.";
dialog.actions = &action;
dialog.action_count = 1;
dialog.build = build_dialog;
svc_ui->dialog_push(mod_ctx, &dialog, nullptr);
```
After an action's `on_pressed`, the dialog closes unless the action sets `keep_open`. It can then be closed later
(or immediately) with `dialog_close`. Cancel fires `on_dismiss` and always closes. `dialog_set_body` and
`dialog_set_icon` mutate a live dialog.
**Toasts:** `push_toast` enqueues a notification. Titles and bodies accept RML. The optional `type` is applied as an **Toasts:** `push_toast` enqueues a notification. Titles and bodies accept RML. The optional `type` is applied as an
RCSS class; `warning` uses the built-in warning appearance, and mods can define their own types. A duration of 0 uses RCSS class; `warning` uses the built-in warning appearance, and mods can define their own types. A duration of 0 uses
@@ -576,6 +711,128 @@ if (svc_camera->get_camera(mod_ctx, game_view, &camera) == MOD_OK) {
first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention first in-game frame. Projection matrices match the renderer's WebGPU clip convention and renderer depth convention
(reversed-Z by default). (reversed-Z by default).
Camera operators allow overriding the main camera. When an operator callback returns true, its values replace the camera
state for the current frame. Register and unregister using `register_camera_operator` / `unregister_camera_operator`.
### GameModeService (`mods/svc/game_mode.h`)
Allows a mod to register a game mode with callbacks for key gameplay and save lifecycle events. Registered game modes
appear in the prelaunch menu. Game modes may use a unique set of saves by configuring `save_name`; leave it empty to use
the vanilla `gczelda2` save.
```cpp
IMPORT_SERVICE(LogService, svc_log);
IMPORT_SERVICE(HookService, svc_hook);
IMPORT_SERVICE(GameModeService, svc_game_mode);
DEFINE_HOOK(fopAcM_createItem, CreateItem);
#define MY_GAME_MODE_ID "game-mode-id"
static HookAction my_function_hook(ModContext* ctx, void* args, void*, void*) {
// If we wish to have this hook only run while the gamemode is registered, we need to hook the function from the
// gamemode's onActivatedFunction, and uninstall the hook during the onDeactivatedFunction. Example below.
// Alternatively, check with `svc_game_mode->is_active(mod_ctx, MY_GAME_MODE_ID, &active) == MOD_OK && active`.
return HOOK_CONTINUE;
}
ModResult on_game_mode_activated(void*, ModError* outError) {
// Setup the gamemode, Add any hooks that are gamemode specific
// Overlay any files that are gamemode specific
ModResult result = mods::hook_add_pre<CreateItem>(svc_hook, my_function_hook);
if (result != MOD_OK) {
return mods::set_error(outError, result, "failed to install fopAcM_createItem hook");
}
return MOD_OK;
}
ModResult on_game_mode_deactivated(void*, ModError* outError) {
// Uninstall any hooks that are gamemode specific
// Remove any file overlays that are gamemode specific
ModResult result = mods::hook_uninstall<CreateItem>();
if (result != MOD_OK) {
return mods::set_error(outError, result, "failed to uninstall fopAcM_createItem hook");
}
return MOD_OK;
}
ModResult on_save_loaded(void*, ModError*) {
// This function will be invoked by the game as a save is loaded
return MOD_OK;
}
const GameModeDesc gameModeDesc = {
.struct_size = sizeof(GameModeDesc),
.game_mode_id = MY_GAME_MODE_ID,
.full_name = "My Game Mode",
.save_name = "my-unique-save",
.user_data = nullptr,
.on_activated = on_game_mode_activated,
.on_deactivated = on_game_mode_deactivated,
.on_save_loaded = on_save_loaded,
};
svc_game_mode->register_game_mode(mod_ctx, &gameModeDesc);
```
A game mode can also open UI for per-save settings when creating a new file. The state begins as
`GAME_MODE_STATE_PENDING` and remains valid until the mod selects `PROCEED` or `RETURN`.
```cpp
IMPORT_SERVICE(GameModeService, svc_game_mode);
IMPORT_SERVICE(UiService, svc_ui);
ModResult on_new_save_select(void*, GameModeNewSaveState* state, ModError* outError) {
static GameModeNewSaveState* newSaveState;
static UiWindowHandle windowHandle;
newSaveState = state;
UiTabDesc tabs[1]{};
tabs[0].struct_size = sizeof(UiTabDesc);
tabs[0].title = "Play";
tabs[0].build = [](ModContext* ctx, UiWindowHandle, UiElementHandle leftPane, UiElementHandle rightPane, void*, ModError*) {
UiControlDesc desc = UI_CONTROL_DESC_INIT;
desc.kind = UI_CONTROL_BUTTON;
desc.label = "Play";
desc.help_rml = "Play Button";
desc.on_pressed = [](ModContext* ctx, void* userdata) {
*newSaveState = GAME_MODE_STATE_PROCEED;
svc_ui->window_close(ctx, *static_cast<UiWindowHandle*>(userdata));
};
desc.user_data = &windowHandle;
svc_ui->pane_add_control(mod_ctx, leftPane, &desc, nullptr);
return MOD_OK;
};
UiWindowDesc desc = UI_WINDOW_DESC_INIT;
desc.tabs = tabs;
desc.tab_count = 1;
desc.on_closed = [](ModContext *, UiWindowHandle, void *userdata) {
// If closing the window through backing out, return to file select
if (*newSaveState == GAME_MODE_STATE_PENDING) {
*newSaveState = GAME_MODE_STATE_RETURN;
}
};
ModResult result = svc_ui->window_push(mod_ctx, &desc, &windowHandle);
if (result != MOD_OK) {
return mods::set_error(outError, result, "failed to open new-save settings");
}
return MOD_OK;
}
const GameModeDesc gameModeDesc = {
.struct_size = sizeof(GameModeDesc),
.game_mode_id = "my-game-mode-id",
.full_name = "My Game Mode",
.save_name = "my-unique-save",
.on_new_save_select = on_new_save_select,
};
svc_game_mode->register_game_mode(mod_ctx, &gameModeDesc);
```
--- ---
## Hooking Game Functions ## Hooking Game Functions
@@ -703,6 +960,11 @@ For reference parameters (e.g. `const cXyz& pos`), `arg_ref<cXyz>` yields a dire
Files placed under `overlay/` in the `.dusk` archive override game files at the corresponding path, equivalent to Files placed under `overlay/` in the `.dusk` archive override game files at the corresponding path, equivalent to
replacing files in the .iso. This requires no code: an archive with just `mod.json` and `overlay/` is a complete mod. replacing files in the .iso. This requires no code: an archive with just `mod.json` and `overlay/` is a complete mod.
To replace a file within an `.arc` archive, replace the archive suffix with a directory and place the replacement at
its path within the archive.
- `overlay/Audiores/Stream/menu_select.ast` replaces the main title's audio stream.
- `overlay/res/Layout/main2D/main2d/timg/midona64.bti` replaces Midna's UI icon inside `main2D.arc`.
Files placed under `textures/` register as texture replacements, and act just like the user's general Files placed under `textures/` register as texture replacements, and act just like the user's general
`texture_replacements/` directory: Dolphin-style naming, matched by texture hash `texture_replacements/` directory: Dolphin-style naming, matched by texture hash
@@ -878,6 +1140,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 `mod_dir` for writable state. Native library namespaces are `mod_shutdown`. Do not write into `native_dir`; use `data_dir` for persistent storage or `mod_dir` for temporary
process-wide on some platforms, so two mods cannot safely assume that incompatible libraries with the same filename (session) storage. Native library namespaces are process-wide on some platforms, so two mods cannot safely assume that
will remain isolated. incompatible libraries with the same filename will remain isolated.
+1 -1
Vendored Submodule
+1
Submodule extern/borealis added at 6fd955e7e6
+26 -18
View File
@@ -1412,6 +1412,7 @@ set(DOLPHIN_FILES
set(DUSK_FILES set(DUSK_FILES
include/helpers/batch.hpp include/helpers/batch.hpp
include/helpers/bits.hpp
include/helpers/endian_gx.hpp include/helpers/endian_gx.hpp
src/d/actor/d_a_alink_dusk.cpp src/d/actor/d_a_alink_dusk.cpp
src/dusk/OSContext.cpp src/dusk/OSContext.cpp
@@ -1421,30 +1422,23 @@ set(DUSK_FILES
src/dusk/achievements.cpp src/dusk/achievements.cpp
src/dusk/action_bindings.cpp src/dusk/action_bindings.cpp
src/dusk/action_bindings.h src/dusk/action_bindings.h
src/dusk/android_frame_rate.cpp
src/dusk/android_frame_rate.hpp
src/dusk/asserts.cpp src/dusk/asserts.cpp
src/dusk/autosave.cpp src/dusk/autosave.cpp
src/dusk/config.cpp src/dusk/config.cpp
src/dusk/config.hpp src/dusk/config.hpp
src/dusk/crash_handler.cpp
src/dusk/crash_reporting.cpp
src/dusk/data.cpp src/dusk/data.cpp
src/dusk/data.hpp src/dusk/data.hpp
src/dusk/discord.cpp
src/dusk/discord.hpp
src/dusk/discord_presence.cpp src/dusk/discord_presence.cpp
src/dusk/dvd_asset.cpp src/dusk/dvd_asset.cpp
src/dusk/dvd_asset.hpp src/dusk/dvd_asset.hpp
src/dusk/extras.c src/dusk/extras.c
src/dusk/file_select.cpp
src/dusk/file_select.hpp
src/dusk/frame_interpolation.cpp src/dusk/frame_interpolation.cpp
src/dusk/game_clock.cpp src/dusk/game_clock.cpp
src/dusk/game_mode.cpp
src/dusk/gamepad_color.cpp src/dusk/gamepad_color.cpp
src/dusk/globals.cpp src/dusk/globals.cpp
src/dusk/gyro.cpp src/dusk/gyro.cpp
src/dusk/http/http.hpp src/dusk/hq_minimap.cpp
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
@@ -1465,6 +1459,8 @@ set(DUSK_FILES
src/dusk/imgui/ImGuiStubLog.cpp src/dusk/imgui/ImGuiStubLog.cpp
src/dusk/io.cpp src/dusk/io.cpp
src/dusk/iso_validate.cpp src/dusk/iso_validate.cpp
src/dusk/language.cpp
src/dusk/language.hpp
src/dusk/layout.cpp src/dusk/layout.cpp
src/dusk/livesplit.cpp src/dusk/livesplit.cpp
src/dusk/logging.cpp src/dusk/logging.cpp
@@ -1481,6 +1477,9 @@ set(DUSK_FILES
src/dusk/mods/loader/native_module.hpp src/dusk/mods/loader/native_module.hpp
src/dusk/mods/loader/prepatch.cpp src/dusk/mods/loader/prepatch.cpp
src/dusk/mods/loader/prepatch.hpp src/dusk/mods/loader/prepatch.hpp
src/dusk/mods/item.hpp
src/dusk/mods/item_checks.cpp
src/dusk/mods/item_gives.cpp
src/dusk/mods/log_buffer.cpp src/dusk/mods/log_buffer.cpp
src/dusk/mods/log_buffer.hpp src/dusk/mods/log_buffer.hpp
src/dusk/mods/manifest.cpp src/dusk/mods/manifest.cpp
@@ -1490,8 +1489,11 @@ set(DUSK_FILES
src/dusk/mods/svc/config.hpp src/dusk/mods/svc/config.hpp
src/dusk/mods/svc/game.cpp src/dusk/mods/svc/game.cpp
src/dusk/mods/svc/gfx.cpp src/dusk/mods/svc/gfx.cpp
src/dusk/mods/svc/flow.cpp
src/dusk/mods/svc/hook.cpp src/dusk/mods/svc/hook.cpp
src/dusk/mods/svc/host.cpp src/dusk/mods/svc/host.cpp
src/dusk/mods/svc/item.cpp
src/dusk/mods/svc/item.hpp
src/dusk/mods/svc/log.cpp src/dusk/mods/svc/log.cpp
src/dusk/mods/svc/overlay.cpp src/dusk/mods/svc/overlay.cpp
src/dusk/mods/svc/registry.cpp src/dusk/mods/svc/registry.cpp
@@ -1500,11 +1502,16 @@ set(DUSK_FILES
src/dusk/mods/svc/texture.cpp src/dusk/mods/svc/texture.cpp
src/dusk/mods/svc/ui.cpp src/dusk/mods/svc/ui.cpp
src/dusk/mods/svc/ui.hpp src/dusk/mods/svc/ui.hpp
src/dusk/mods/svc/game_mode.cpp
src/dusk/mods/svc/window.cpp src/dusk/mods/svc/window.cpp
src/dusk/mods/svc/window.hpp src/dusk/mods/svc/window.hpp
src/dusk/mods/svc/save.cpp src/dusk/mods/svc/save.cpp
src/dusk/mods/svc/save.hpp src/dusk/mods/svc/save.hpp
src/dusk/mods/svc/stage.cpp
src/dusk/mods/svc/stage.hpp
src/dusk/mouse.cpp src/dusk/mouse.cpp
src/dusk/presentation.cpp
src/dusk/presentation.hpp
src/dusk/scope_guard.hpp src/dusk/scope_guard.hpp
src/dusk/settings.cpp src/dusk/settings.cpp
src/dusk/speedrun.cpp src/dusk/speedrun.cpp
@@ -1518,6 +1525,8 @@ set(DUSK_FILES
src/dusk/ui/bool_button.hpp src/dusk/ui/bool_button.hpp
src/dusk/ui/button.cpp src/dusk/ui/button.cpp
src/dusk/ui/button.hpp src/dusk/ui/button.hpp
src/dusk/ui/color_input.cpp
src/dusk/ui/color_input.hpp
src/dusk/ui/component.cpp src/dusk/ui/component.cpp
src/dusk/ui/component.hpp src/dusk/ui/component.hpp
src/dusk/ui/controller_config.cpp src/dusk/ui/controller_config.cpp
@@ -1531,12 +1540,16 @@ set(DUSK_FILES
src/dusk/ui/event.hpp src/dusk/ui/event.hpp
src/dusk/ui/graphics_tuner.cpp src/dusk/ui/graphics_tuner.cpp
src/dusk/ui/graphics_tuner.hpp src/dusk/ui/graphics_tuner.hpp
src/dusk/ui/group_button.cpp
src/dusk/ui/group_button.hpp
src/dusk/ui/icon_provider.cpp src/dusk/ui/icon_provider.cpp
src/dusk/ui/icon_provider.hpp src/dusk/ui/icon_provider.hpp
src/dusk/ui/input.cpp src/dusk/ui/input.cpp
src/dusk/ui/input.hpp src/dusk/ui/input.hpp
src/dusk/ui/logs_window.cpp src/dusk/ui/logs_window.cpp
src/dusk/ui/logs_window.hpp src/dusk/ui/logs_window.hpp
src/dusk/ui/list.cpp
src/dusk/ui/list.hpp
src/dusk/ui/menu_bar.cpp src/dusk/ui/menu_bar.cpp
src/dusk/ui/menu_bar.hpp src/dusk/ui/menu_bar.hpp
src/dusk/ui/mod_texture_provider.cpp src/dusk/ui/mod_texture_provider.cpp
@@ -1548,12 +1561,16 @@ set(DUSK_FILES
src/dusk/ui/mods_window.cpp src/dusk/ui/mods_window.cpp
src/dusk/ui/mods_window.hpp src/dusk/ui/mods_window.hpp
src/dusk/ui/nav_types.hpp src/dusk/ui/nav_types.hpp
src/dusk/ui/nav_group.cpp
src/dusk/ui/nav_group.hpp
src/dusk/ui/number_button.cpp src/dusk/ui/number_button.cpp
src/dusk/ui/number_button.hpp src/dusk/ui/number_button.hpp
src/dusk/ui/overlay.cpp src/dusk/ui/overlay.cpp
src/dusk/ui/overlay.hpp src/dusk/ui/overlay.hpp
src/dusk/ui/pane.cpp src/dusk/ui/pane.cpp
src/dusk/ui/pane.hpp src/dusk/ui/pane.hpp
src/dusk/ui/popover.cpp
src/dusk/ui/popover.hpp
src/dusk/ui/prelaunch.cpp src/dusk/ui/prelaunch.cpp
src/dusk/ui/prelaunch.hpp src/dusk/ui/prelaunch.hpp
src/dusk/ui/preset.cpp src/dusk/ui/preset.cpp
@@ -1580,8 +1597,6 @@ 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/update_check.cpp
src/dusk/update_check.hpp
src/dusk/version.cpp src/dusk/version.cpp
src/dusk/utilities.cpp src/dusk/utilities.cpp
src/helpers/batch.cpp src/helpers/batch.cpp
@@ -1589,10 +1604,3 @@ set(DUSK_FILES
src/helpers/offset_ptr.cpp src/helpers/offset_ptr.cpp
src/helpers/string.cpp src/helpers/string.cpp
) )
set(DUSK_HTTP_BACKEND_FILES
src/dusk/http/no_backend.cpp
src/dusk/http/curl.cpp
src/dusk/http/winhttp.cpp
src/dusk/http/url_session.mm
)
+1 -1
View File
@@ -228,7 +228,7 @@
ninjaFlags = [ "dusklight" ]; ninjaFlags = [ "dusklight" ];
cmakeFlags = [ cmakeFlags = [
"-DDUSK_VERSION_OVERRIDE=${versionSuffix}" "-DBOREALIS_APP_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"
+1 -1
View File
@@ -47,7 +47,7 @@ public:
s32 getBgmLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 1); } s32 getBgmLoadStatus(u32 wave) { return getWaveLoadStatus(wave, 1); }
u8 getDemoSeWaveNum() { return loadedDemoWave; } u8 getDemoSeWaveNum() { return loadedDemoWave; }
private: // private:
/* 0x00 */ JAISoundID BGM_ID; /* 0x00 */ JAISoundID BGM_ID;
/* 0x04 */ int sceneNum; /* 0x04 */ int sceneNum;
/* 0x08 */ int timer; /* 0x08 */ int timer;
+2
View File
@@ -8449,8 +8449,10 @@ struct daAlink_cutHorseParamTbl {
/* 0xA */ u8 m_cutType; /* 0xA */ u8 m_cutType;
}; // Size: 0xC }; // Size: 0xC
#if !TARGET_PC
inline BOOL dComIfGs_isTransformLV(int i_no); inline BOOL dComIfGs_isTransformLV(int i_no);
inline BOOL dComIfGs_isEventBit(const u16); inline BOOL dComIfGs_isEventBit(const u16);
#endif
static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* i_actor, void* i_data); static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* i_actor, void* i_data);
static fopAc_ac_c* daAlink_searchCanoe(fopAc_ac_c* i_actor, void* i_data); static fopAc_ac_c* daAlink_searchCanoe(fopAc_ac_c* i_actor, void* i_data);
+1 -1
View File
@@ -123,7 +123,7 @@ public:
bool checkFlag(u16 flag) { return field_0x68e & flag; } bool checkFlag(u16 flag) { return field_0x68e & flag; }
void setAction(u8 action) { mAction = action; } void setAction(u8 action) { mAction = action; }
private: // private:
/* 0x56C */ request_of_phase_process_class mPhase1; /* 0x56C */ request_of_phase_process_class mPhase1;
/* 0x574 */ request_of_phase_process_class mPhase2; /* 0x574 */ request_of_phase_process_class mPhase2;
/* 0x57C */ J3DModel* mModel1; /* 0x57C */ J3DModel* mModel1;
+3
View File
@@ -96,6 +96,9 @@ public:
/* 0xDE0 */ cXyz field_0xde0; /* 0xDE0 */ cXyz field_0xde0;
/* 0xDEC */ u8 field_0xdec[0xdf9 - 0xdec]; /* 0xDEC */ u8 field_0xdec[0xdf9 - 0xdec];
/* 0xDF9 */ u8 field_0xdf9; /* 0xDF9 */ u8 field_0xdf9;
#if TARGET_PC
bool mItemCheckHandled;
#endif
}; };
STATIC_ASSERT(sizeof(daE_HP_c) == 0xdfc); STATIC_ASSERT(sizeof(daE_HP_c) == 0xdfc);
+9
View File
@@ -32,6 +32,12 @@ struct daItemBase_data {
class daItemBase_c : public fopAc_ac_c { class daItemBase_c : public fopAc_ac_c {
public: public:
u8 getItemNo(); u8 getItemNo();
#if TARGET_PC
u8 getDisplayItemNo() const {
return mDisplayItemNo != 0xFF ? mDisplayItemNo : m_itemNo;
}
void setDisplayItemNo(u8 itemNo) { mDisplayItemNo = itemNo; }
#endif
void hide(); void hide();
void show(); void show();
void changeDraw(); void changeDraw();
@@ -79,6 +85,9 @@ public:
/* 0x928 */ s16 m_get_timer; /* 0x928 */ s16 m_get_timer;
/* 0x92A */ u8 m_itemNo; /* 0x92A */ u8 m_itemNo;
/* 0x92B */ u8 field_0x92b; /* 0x92B */ u8 field_0x92b;
#if TARGET_PC
u8 mDisplayItemNo = 0xFF;
#endif
}; };
#endif /* D_A_D_A_ITEMBASE_H */ #endif /* D_A_D_A_ITEMBASE_H */
+1 -1
View File
@@ -423,7 +423,7 @@ public:
static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21]; static DUSK_GAME_DATA daMidna_texData_s const m_texDataTable[21];
static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53]; static DUSK_GAME_DATA daMidna_anmData_s const m_anmDataTable[53];
private: // private:
/* 0x568 */ request_of_phase_process_class mPhase; /* 0x568 */ request_of_phase_process_class mPhase;
/* 0x570 */ J3DModel* mpModel; /* 0x570 */ J3DModel* mpModel;
/* 0x574 */ J3DModel* mpShadowModel; /* 0x574 */ J3DModel* mpShadowModel;
+1 -1
View File
@@ -296,7 +296,7 @@ public:
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[18]; static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[18];
static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[18]; static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[18];
private: // private:
/* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO; /* 0x0E40 */ NPC_FAIRY_HIO_CLASS* mHIO;
/* 0x0E44 */ dCcD_Cyl mCyl; /* 0x0E44 */ dCcD_Cyl mCyl;
/* 0x0F80 */ u8 mType; /* 0x0F80 */ u8 mType;
+1 -1
View File
@@ -287,7 +287,7 @@ public:
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[10]; static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mCutNameList[10];
static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[10]; static DUSK_GAME_DATA cutFunc DUSK_CONST mCutList[10];
private: // private:
/* 0x0E40 */ mDoExt_McaMorfSO* mFishModelMorf; /* 0x0E40 */ mDoExt_McaMorfSO* mFishModelMorf;
/* 0x0E44 */ mDoExt_McaMorfSO* mLeafModelMorf; /* 0x0E44 */ mDoExt_McaMorfSO* mLeafModelMorf;
/* 0x0E48 */ NPC_YKM_HIO_CLASS* mpHIO; /* 0x0E48 */ NPC_YKM_HIO_CLASS* mpHIO;
+1 -1
View File
@@ -96,7 +96,7 @@ public:
static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2]; static DUSK_GAME_DATA char DUSK_CONST* DUSK_CONST mEvtCutNameList[2];
static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[2]; static DUSK_GAME_DATA EventFn DUSK_CONST mEvtCutList[2];
private: // private:
/* 0xB48 */ Z2Creature mCreatureSound; /* 0xB48 */ Z2Creature mCreatureSound;
/* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0xBD8 */ daNpcF_MatAnm_c* mpMatAnm;
/* 0xBDC */ daNpcF_Lookat_c mLookat; /* 0xBDC */ daNpcF_Lookat_c mLookat;
+1 -1
View File
@@ -114,7 +114,7 @@ public:
void himoCalc(); void himoCalc();
void adjustShapeAngle() {} void adjustShapeAngle() {}
private: // private:
/* 0x0B48 */ Z2Creature mCreatureSound; /* 0x0B48 */ Z2Creature mCreatureSound;
/* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm; /* 0x0BD8 */ daNpcF_MatAnm_c* mpMatAnm;
/* 0x0BDC */ mDoExt_invisibleModel mInvisibleModel; /* 0x0BDC */ mDoExt_invisibleModel mInvisibleModel;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
bool isFirst() { return fopAcM_GetParamBit(this, 0x1b, 1); } bool isFirst() { return fopAcM_GetParamBit(this, 0x1b, 1); }
void setAction(u8 action) { mAction = action; } void setAction(u8 action) { mAction = action; }
private: // private:
/* 0x568 */ request_of_phase_process_class mPhaseReq; /* 0x568 */ request_of_phase_process_class mPhaseReq;
/* 0x570 */ J3DModel* mpModel; /* 0x570 */ J3DModel* mpModel;
/* 0x574 */ mDoExt_btkAnm* mpBtkAnm[2]; /* 0x574 */ mDoExt_btkAnm* mpBtkAnm[2];
+7 -1
View File
@@ -64,7 +64,7 @@ public:
current.pos = new_pos; current.pos = new_pos;
} }
private: // private:
/* 0x92C */ fpc_ProcID mItemId; /* 0x92C */ fpc_ProcID mItemId;
/* 0x930 */ int mCounter; /* 0x930 */ int mCounter;
/* 0x934 */ u8 mStatus; /* 0x934 */ u8 mStatus;
@@ -88,6 +88,12 @@ private:
/* 0x99C */ dPa_followEcallBack mEffect2; /* 0x99C */ dPa_followEcallBack mEffect2;
/* 0x9B0 */ Z2SoundObjSimple mSound; /* 0x9B0 */ Z2SoundObjSimple mSound;
/* 0x9D0 */ u8 mIsHookCarry; /* 0x9D0 */ u8 mIsHookCarry;
#if TARGET_PC
u8 mOriginalItemNo;
bool mItemOverridden;
bool mOverrideHover;
bool mGoldenWolfItem;
#endif
}; };
STATIC_ASSERT(sizeof(daObjLife_c) == 0x9d4); STATIC_ASSERT(sizeof(daObjLife_c) == 0x9d4);
+1 -1
View File
@@ -51,7 +51,7 @@ public:
static DUSK_GAME_DATA daObjMasterSword_Attr_c const mAttr; static DUSK_GAME_DATA daObjMasterSword_Attr_c const mAttr;
static DUSK_GAME_DATA actionFunc ActionTable[]; static DUSK_GAME_DATA actionFunc ActionTable[];
private: // private:
/* 0x568 */ J3DModel* mpModel; /* 0x568 */ J3DModel* mpModel;
/* 0x56C */ request_of_phase_process_class mPhase; /* 0x56C */ request_of_phase_process_class mPhase;
/* 0x574 */ mDoExt_btkAnm mBtk; /* 0x574 */ mDoExt_btkAnm mBtk;
+2
View File
@@ -311,9 +311,11 @@ private:
class daMidna_c; class daMidna_c;
class daSpinner_c; class daSpinner_c;
class daPy_py_c; class daPy_py_c;
#if !TARGET_PC
inline daPy_py_c* dComIfGp_getLinkPlayer(); inline daPy_py_c* dComIfGp_getLinkPlayer();
inline BOOL dComIfGs_isEventBit(const u16); inline BOOL dComIfGs_isEventBit(const u16);
inline u32 dComIfGs_getLastSceneMode(); inline u32 dComIfGs_getLastSceneMode();
#endif
class daPy_py_c : public fopAc_ac_c { class daPy_py_c : public fopAc_ac_c {
public: public:
+3
View File
@@ -194,6 +194,9 @@ private:
/* 0x9FC */ u8 field_0x9fc; /* 0x9FC */ u8 field_0x9fc;
/* 0x9FD */ u8 field_0x9fd; /* 0x9FD */ u8 field_0x9fd;
/* 0xA00 */ Mtx mDrawMtx; /* 0xA00 */ Mtx mDrawMtx;
#if TARGET_PC
u8 mOriginalItemNo;
#endif
}; };
STATIC_ASSERT(sizeof(daTbox_c) == 0xA30); STATIC_ASSERT(sizeof(daTbox_c) == 0xA30);
+5 -1
View File
@@ -67,7 +67,7 @@ public:
u8 getModelType() { return fopAcM_GetParamBit(this, 8, 4); } u8 getModelType() { return fopAcM_GetParamBit(this, 8, 4); }
u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); } u8 getItemNo() { return fopAcM_GetParamBit(this, 0, 8); }
private: // private:
/* 0x718 */ u8 mReturnRupee; /* 0x718 */ u8 mReturnRupee;
/* 0x71C */ request_of_phase_process_class mPhase; /* 0x71C */ request_of_phase_process_class mPhase;
/* 0x724 */ J3DModel* mpModel; /* 0x724 */ J3DModel* mpModel;
@@ -83,6 +83,10 @@ private:
/* 0xAC0 */ u8 field_0xAC0[0xAC4 - 0xAC0]; /* 0xAC0 */ u8 field_0xAC0[0xAC4 - 0xAC0];
/* 0xAC4 */ int mStaffIdx; /* 0xAC4 */ int mStaffIdx;
/* 0xAC8 */ dBgW* mBoxBgW; /* 0xAC8 */ dBgW* mBoxBgW;
#if TARGET_PC
bool mParamsInit;
u8 mOriginalItemNo;
#endif
}; };
STATIC_ASSERT(sizeof(daTbox2_c) == 0xACC); STATIC_ASSERT(sizeof(daTbox2_c) == 0xACC);
+4
View File
@@ -145,6 +145,10 @@ public:
/* 0x9BC */ u8 field_0x9bc[4]; /* 0x9BC */ u8 field_0x9bc[4];
/* 0x9C0 */ u8 field_0x9c0; /* 0x9C0 */ u8 field_0x9c0;
/* 0x9C1 */ u8 field_0x9c1; /* 0x9C1 */ u8 field_0x9c1;
#if TARGET_PC
u8 mOriginalItemNo;
bool mItemOverridden;
#endif
}; // Size: 0x9C4 }; // Size: 0x9C4
#endif /* D_A_D_A_ITEM_STATIC_H */ #endif /* D_A_D_A_ITEM_STATIC_H */
+5
View File
@@ -1,10 +1,15 @@
#ifndef D_A_D_A_ITEMBASE_STATIC_H #ifndef D_A_D_A_ITEMBASE_STATIC_H
#define D_A_D_A_ITEMBASE_STATIC_H #define D_A_D_A_ITEMBASE_STATIC_H
#include "dolphin/types.h"
class fopAc_ac_c; class fopAc_ac_c;
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
const char* dItem_fieldModelArc(u8 itemNo);
#endif
#endif /* D_A_D_A_ITEMBASE_STATIC_H */ #endif /* D_A_D_A_ITEMBASE_STATIC_H */
+7
View File
@@ -50,6 +50,9 @@ public:
csXyz* getRotateP(); csXyz* getRotateP();
cXyz* getPosP(); cXyz* getPosP();
const char* getShopArcname(); const char* getShopArcname();
#if TARGET_PC
const ResourceData& getResourceData() const;
#endif
u16 getHeapSize(); u16 getHeapSize();
void CreateInit(); void CreateInit();
void set_mtx(); void set_mtx();
@@ -110,6 +113,10 @@ private:
/* 0x960 */ s16 mAngleX; /* 0x960 */ s16 mAngleX;
/* 0x962 */ s16 mAngleY; /* 0x962 */ s16 mAngleY;
/* 0x964 */ u8 mShopItemID; /* 0x964 */ u8 mShopItemID;
#if TARGET_PC
ResourceData mOverrideData;
bool mItemOverridden;
#endif
}; };
int CheckShopItemCreateHeap(fopAc_ac_c* i_this); int CheckShopItemCreateHeap(fopAc_ac_c* i_this);
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -37,7 +37,7 @@ public:
CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; } CPaneMgrAlpha* getNoDatBase() { return mNoDatBase; }
void draw() { _draw(); } void draw() { _draw(); }
private: // private:
/* 0x04 */ JKRArchive* mArchive; /* 0x04 */ JKRArchive* mArchive;
/* 0x08 */ dDlst_FileInfo_c mFileInfo; /* 0x08 */ dDlst_FileInfo_c mFileInfo;
/* 0x1C */ u8 field_0x1c[4]; /* 0x1C */ u8 field_0x1c[4];
+13 -33
View File
@@ -9,42 +9,13 @@
#include "JSystem/J3DGraphLoader/J3DModelLoader.h" #include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h" #include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
#if TARGET_PC
#include "mods/svc/game_mode.h"
#endif
class dFile_info_c; class dFile_info_c;
class J2DPicture; class J2DPicture;
#if TARGET_PC
static PaneCache mSelDtPanes[] = {
{MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false},
{MULTI_CHAR('gray_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('b_base'), 0.0f, 0.0f, false},
{MULTI_CHAR('b_base1'), 0.0f, 0.0f, false},
};
static PaneCache fileSelPanes[] = {
{MULTI_CHAR('w_uzu00'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu01'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu02'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu03'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu04'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu05'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu06'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu07'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu08'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_uzu09'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_msg'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_msE'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_msR'), 0.0f, 0.0f, false},
{MULTI_CHAR('er_for0'), 0.0f, 0.0f, false},
{MULTI_CHAR('er_for1'), 0.0f, 0.0f, false},
};
#endif
class dDlst_FileSel_c : public dDlst_base_c { class dDlst_FileSel_c : public dDlst_base_c {
public: public:
void draw(); void draw();
@@ -420,6 +391,13 @@ public:
bool pointerMenuSelect(); bool pointerMenuSelect();
bool pointerCopyDataToSelect(); bool pointerCopyDataToSelect();
bool pointerYesNoSelect(bool errorSelect); bool pointerYesNoSelect(bool errorSelect);
void backToDataSelectMove() {
headerTxtSet(0x43, 1, 0);
fileRecScaleAnmInitSet2(0.0f, 1.0f);
nameMoveAnmInitSet(0xd29, 0xd1f);
modoruTxtDispAnmInit(0);
mDataSelProc = DATASELPROC_NAME_TO_DATA_SELECT_MOVE;
}
#endif #endif
void _draw(); void _draw();
void errorMoveAnmInitSet(int, int); void errorMoveAnmInitSet(int, int);
@@ -733,6 +711,8 @@ public:
#endif #endif
#ifdef TARGET_PC #ifdef TARGET_PC
dDlst_FileSelFade_c mFadeDlst; dDlst_FileSelFade_c mFadeDlst;
bool mGameModeSaveStartBuildUi = true;
GameModeNewSaveState mGameModeNewSaveState = GAME_MODE_STATE_PENDING;
#endif #endif
#if PLATFORM_WII || PLATFORM_SHIELD #if PLATFORM_WII || PLATFORM_SHIELD
+3 -1
View File
@@ -11,7 +11,9 @@ public:
static DUSK_GAME_DATA u8* mData; static DUSK_GAME_DATA u8* mData;
}; };
void execItemGet(u8 item_id); class fopAc_ac_c;
void execItemGet(
u8 item_id IF_DUSK_ARG(u32 item_give_tag = 0) IF_DUSK_ARG(fopAc_ac_c* giver = NULL));
void item_func_HEART(); void item_func_HEART();
void item_func_GREEN_RUPEE(); void item_func_GREEN_RUPEE();
+5
View File
@@ -142,7 +142,12 @@ enum {
/* 0x2F */ dItemNo_WEAR_KOKIRI_e, /* 0x2F */ dItemNo_WEAR_KOKIRI_e,
/* 0x30 */ dItemNo_ARMOR_e, /* 0x30 */ dItemNo_ARMOR_e,
/* 0x31 */ dItemNo_WEAR_ZORA_e, /* 0x31 */ dItemNo_WEAR_ZORA_e,
#if TARGET_PC
/* 0x32 */ dItemNo_MAGIC_LV1_e, /* 0x32 */ dItemNo_MAGIC_LV1_e,
dItemNo_SHADOW_CRYSTAL_e = dItemNo_MAGIC_LV1_e,
#else
/* 0x32 */ dItemNo_MAGIC_LV1_e,
#endif
/* 0x33 */ dItemNo_DUNGEON_EXIT_2_e, /* 0x33 */ dItemNo_DUNGEON_EXIT_2_e,
/* 0x34 */ dItemNo_WALLET_LV1_e, /* 0x34 */ dItemNo_WALLET_LV1_e,
/* 0x35 */ dItemNo_WALLET_LV2_e, /* 0x35 */ dItemNo_WALLET_LV2_e,
+1 -1
View File
@@ -30,7 +30,7 @@ public:
void drawSelf() { mpKanteraIcon->draw(); } void drawSelf() { mpKanteraIcon->draw(); }
private: // private:
/* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon; /* 0x04 */ dDlst_KanteraIcon_c* mpKanteraIcon;
/* 0x08 */ CPaneMgr* mpParent; /* 0x08 */ CPaneMgr* mpParent;
/* 0x0C */ CPaneMgr* mpGauge; /* 0x0C */ CPaneMgr* mpGauge;
+1 -44
View File
@@ -15,49 +15,6 @@ class dMenu_Fishing_c;
class dMenu_Skill_c; class dMenu_Skill_c;
class dMenu_Insect_c; class dMenu_Insect_c;
class dSelect_cursor_c; class dSelect_cursor_c;
#if TARGET_PC
struct PaneCache {
u64 tag;
f32 origTransX;
f32 origTransY;
bool cached;
};
static PaneCache mpScreenPanes[] = {
{MULTI_CHAR('sa_tex_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('op_tex_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('heart_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('wolf_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('item_0_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('item_1_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('item_2_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('fish_3_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('lett_4_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('maki_5_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('fuku_n2'), 0.0f, 0.0f, false},
{MULTI_CHAR('tate_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('tate_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n0'), 0.0f, 0.0f, false},
{MULTI_CHAR('ken_n1'), 0.0f, 0.0f, false},
{MULTI_CHAR('kabu_6n'), 0.0f, 0.0f, false},
{MULTI_CHAR('t_t00'), 0.0f, 0.0f, false},
{MULTI_CHAR('f_t00'), 0.0f, 0.0f, false},
{MULTI_CHAR('itemn_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('infotxtn'), 0.0f, 0.0f, false},
{MULTI_CHAR('sa_op_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('title_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('menu_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('w_er_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('center_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('info_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('lavel_n'), 0.0f, 0.0f, false},
{MULTI_CHAR('modelbgn'), 0.0f, 0.0f, false},
};
#endif
class dMenu_Collect2D_c; class dMenu_Collect2D_c;
class dMenu_Collect2DTop_c : public dDlst_base_c { class dMenu_Collect2DTop_c : public dDlst_base_c {
public: public:
@@ -172,7 +129,7 @@ public:
J2DPicture* getBlackTex() { return mpBlackTex; } J2DPicture* getBlackTex() { return mpBlackTex; }
u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; } u8 getSubWindowOpenCheck() { return mSubWindowOpenCheck; }
private: // private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRExpHeap* mpSubHeap; /* 0x008 */ JKRExpHeap* mpSubHeap;
/* 0x00C */ void* field_0xc; /* 0x00C */ void* field_0xc;
+1 -1
View File
@@ -43,7 +43,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
private: // private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRArchive* mpArchive; /* 0x008 */ JKRArchive* mpArchive;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -270,7 +270,7 @@ public:
static DUSK_GAME_DATA dMenu_Fmap_c* MyClass; static DUSK_GAME_DATA dMenu_Fmap_c* MyClass;
private: // private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRExpHeap* mpTalkHeap; /* 0x008 */ JKRExpHeap* mpTalkHeap;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -60,7 +60,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
private: // private:
/* 0x04 */ JKRExpHeap* mpHeap; /* 0x04 */ JKRExpHeap* mpHeap;
/* 0x08 */ JKRArchive* mpArchive; /* 0x08 */ JKRArchive* mpArchive;
/* 0x0C */ STControl* mpStick; /* 0x0C */ STControl* mpStick;
+1 -1
View File
@@ -64,7 +64,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
private: // private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRArchive* mpArchive; /* 0x008 */ JKRArchive* mpArchive;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -117,7 +117,7 @@ public:
return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false; return ((u8)mUseFlag & (u8)i_flag) != 0 ? true : false;
} }
private: // private:
/* 0x004 */ J2DScreen* mpBackScreen; /* 0x004 */ J2DScreen* mpBackScreen;
/* 0x008 */ J2DScreen* mpScreen; /* 0x008 */ J2DScreen* mpScreen;
/* 0x00C */ J2DScreen* mpClipScreen; /* 0x00C */ J2DScreen* mpClipScreen;
+1 -1
View File
@@ -84,7 +84,7 @@ public:
void drawFlag0() { mDrawFlag = 0; } void drawFlag0() { mDrawFlag = 0; }
void setStatus(u8 i_status) { mStatus = i_status; } void setStatus(u8 i_status) { mStatus = i_status; }
private: // private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ STControl* mpStick; /* 0x008 */ STControl* mpStick;
/* 0x00C */ CSTControl* mpCStick; /* 0x00C */ CSTControl* mpCStick;
+1 -1
View File
@@ -278,7 +278,7 @@ public:
u8 getEndStatus() { return mEndStatus; } u8 getEndStatus() { return mEndStatus; }
void setUseType(u8 type) { mUseType = type; } void setUseType(u8 type) { mUseType = type; }
private: // private:
/* 0x0004 */ JKRArchive* mpArchive; /* 0x0004 */ JKRArchive* mpArchive;
/* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount; /* 0x0008 */ mDoDvdThd_mountArchive_c* mpMount;
/* 0x000C */ STControl* stick; /* 0x000C */ STControl* stick;
+1 -1
View File
@@ -58,7 +58,7 @@ public:
u8 getStatus() { return mStatus; } u8 getStatus() { return mStatus; }
private: // private:
/* 0x004 */ JKRExpHeap* mpHeap; /* 0x004 */ JKRExpHeap* mpHeap;
/* 0x008 */ JKRArchive* mpArchive; /* 0x008 */ JKRArchive* mpArchive;
/* 0x00C */ STControl* mpStick; /* 0x00C */ STControl* mpStick;
+1 -1
View File
@@ -154,7 +154,7 @@ public:
} }
#endif #endif
private: // private:
/* 0x004 */ item_params mItemParams[4]; /* 0x004 */ item_params mItemParams[4];
/* 0x074 */ JKRExpHeap* heap; /* 0x074 */ JKRExpHeap* heap;
/* 0x078 */ J2DScreen* mpScreen; /* 0x078 */ J2DScreen* mpScreen;
+146
View File
@@ -328,6 +328,150 @@ void dMeter2Info_onWide2D();
void dMeter2Info_offWide2D(); void dMeter2Info_offWide2D();
#endif #endif
#if TARGET_PC
DUSK_NOINLINE void dMeter2Info_Initialize();
DUSK_NOINLINE dMeterMap_c* dMeter2Info_getMeterMapClass();
DUSK_NOINLINE dMw_c* dMeter2Info_getMenuWindowClass();
DUSK_NOINLINE void dMeter2Info_setWindowStatus(u8 i_status);
DUSK_NOINLINE CPaneMgr* dMeter2Info_getMeterItemPanePtr(s32 i_idx);
DUSK_NOINLINE void dMeter2Info_getString(
u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
DUSK_NOINLINE void dMeter2Info_getStringKanji(
u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
DUSK_NOINLINE void dMeter2Info_getStringKana(
u32 i_stringID, TEXT_SPAN o_string, JMSMesgEntry_c* i_msgEntry);
DUSK_NOINLINE f32 dMeter2Info_getStringLength(
JUTFont* i_font, f32 param_2, f32 param_3, char* i_string);
DUSK_NOINLINE f32 dMeter2Info_getStringLength(J2DTextBox* i_textbox, char* i_string);
DUSK_NOINLINE void dMeter2Info_setHotSpringTimer(u8 i_slotNo);
DUSK_NOINLINE u16 dMeter2Info_getOilGaugeBackUp();
DUSK_NOINLINE void dMeter2Info_setOilGaugeBackUp(u16 param_1);
DUSK_NOINLINE void dMeter2Info_setSaveStageName(const char* i_stageName);
DUSK_NOINLINE u8 dMeter2Info_getInsectSelectType();
DUSK_NOINLINE void dMeter2Info_setInsectSelectType(u8 i_type);
DUSK_NOINLINE u8 dMeter2Info_getWarpStatus();
DUSK_NOINLINE void dMeter2Info_setWarpStatus(u8 i_status);
DUSK_NOINLINE int dMeter2Info_readItemTexture(u8 i_itemNo, void* i_texBuf1, J2DPicture* i_pic1,
void* i_texBuf2, J2DPicture* i_pic2, void* i_texBuf3, J2DPicture* i_pic3, void* i_texBuf4,
J2DPicture* i_pic4, int param_9);
DUSK_NOINLINE void dMeter2Info_setItemColor(
u8 i_itemNo, J2DPicture* i_pic1, J2DPicture* i_pic2, J2DPicture* i_pic3, J2DPicture* i_pic4);
DUSK_NOINLINE u8 dMeter2Info_getWarpRoomNo();
DUSK_NOINLINE u8 dMeter2Info_getWarpPlayerNo();
DUSK_NOINLINE cXyz& dMeter2Info_getWarpPos();
DUSK_NOINLINE const char* dMeter2Info_getWarpStageName();
DUSK_NOINLINE void dMeter2Info_setNowCount(u8 i_count);
DUSK_NOINLINE void dMeter2Info_setMaxCount(u8 i_count);
DUSK_NOINLINE BOOL dMeter2Info_isDirectUseItem(int param_0);
DUSK_NOINLINE bool dMeter2Info_isUseButton(int i_buttonBit);
DUSK_NOINLINE void dMeter2Info_setMeterMapClass(dMeterMap_c* i_map);
DUSK_NOINLINE void dMeter2Info_decHotSpringTimer();
DUSK_NOINLINE void dMeter2Info_allUseButton();
DUSK_NOINLINE void dMeter2Info_offUseButton(int i_buttonBit);
DUSK_NOINLINE void dMeter2Info_resetGameStatus();
DUSK_NOINLINE void dMeter2Info_onGameStatus(int i_status);
DUSK_NOINLINE void dMeter2Info_setMapStatus(u8 i_status);
DUSK_NOINLINE u8 dMeter2Info_getMapStatus();
DUSK_NOINLINE void dMeter2Info_setPauseStatus(u8 i_status);
DUSK_NOINLINE void dMeter2Info_resetPauseStatus();
DUSK_NOINLINE u8 dMeter2Info_getPauseStatus();
DUSK_NOINLINE bool dMeter2Info_isGameStatus(int i_status);
DUSK_NOINLINE bool dMeter2Info_isTouchKeyCheck(int i_status);
DUSK_NOINLINE void dMeter2Info_setMapKeyDirection(u16 i_direction);
DUSK_NOINLINE bool dMeter2Info_isSub2DStatus(int i_flag);
DUSK_NOINLINE void dMeter2Info_offMenuInForce(int i_flag);
DUSK_NOINLINE bool dMeter2Info_isMenuInForce(int i_flag);
DUSK_NOINLINE void dMeter2Info_setMenuWindowClass(dMw_c* i_menu);
DUSK_NOINLINE void dMeter2Info_resetWarpStatus();
DUSK_NOINLINE u16 dMeter2Info_getMapKeyDirection();
DUSK_NOINLINE u8 dMeter2Info_getWindowStatus();
DUSK_NOINLINE void dMeter2Info_setMsgResource(void* i_res);
DUSK_NOINLINE void dMeter2Info_setStageMsgResource(void* i_res);
DUSK_NOINLINE void dMeter2Info_setMsgUnitResource(void* i_res);
DUSK_NOINLINE void* dMeter2Info_getMsgResource();
DUSK_NOINLINE void* dMeter2Info_getStageMsgResource();
DUSK_NOINLINE void* dMeter2Info_getMsgUnitResource();
DUSK_NOINLINE u8 dMeter2Info_getLightDropGetFlag(int i_no);
DUSK_NOINLINE s32 dMeter2Info_getMeterStringType();
DUSK_NOINLINE void dMeter2Info_setMeterClass(dMeter2_c* i_meter);
DUSK_NOINLINE void dMeter2Info_onLifeGaugeSE();
DUSK_NOINLINE void dMeter2Info_offLifeGaugeSE();
DUSK_NOINLINE u8 dMeter2Info_getLifeGaugeSE();
DUSK_NOINLINE const char* dMeter2Info_getSaveStageName();
DUSK_NOINLINE void dMeter2Info_onShopTalkFlag();
DUSK_NOINLINE void dMeter2Info_setLightDropGetFlag(int i_no, u8 i_flag);
DUSK_NOINLINE u8 dMeter2Info_getRentalBombBag();
DUSK_NOINLINE u8 dMeter2Info_getMiniGameItemSetFlag();
DUSK_NOINLINE void dMeter2Info_setMiniGameItem(u8 i_minigameFlag);
DUSK_NOINLINE void dMeter2Info_resetMiniGameItem(bool i_saveItem);
DUSK_NOINLINE void dMeter2Info_setTableMapRegionNo(u8 i_regionNo);
DUSK_NOINLINE void dMeter2Info_setGoldWolfMapType(u8 i_mapType);
DUSK_NOINLINE void dMeter2Info_changeWater(u8 i_slotNo);
DUSK_NOINLINE void dMeter2Info_warpInProc();
DUSK_NOINLINE void dMeter2Info_warpOutProc();
DUSK_NOINLINE dMeter2_c* dMeter2Info_getMeterClass();
DUSK_NOINLINE s16 dMeter2Info_getMsgKeyWaitTimer();
DUSK_NOINLINE void dMeter2Info_onDirectUseItem(int param_0);
DUSK_NOINLINE void dMeter2Info_setFloatingFlow(u16 i_flowID, s16 i_msgTimer, bool i_wakuVisible);
DUSK_NOINLINE u8 dMeter2Info_getGameOverType();
DUSK_NOINLINE void dMeter2Info_setGameOverType(u8 i_gameoverType);
DUSK_NOINLINE void dMeter2Info_setMsgKeyWaitTimer(s16 i_waitTimer);
DUSK_NOINLINE s32 dMeter2Info_getMsgTimeMs();
DUSK_NOINLINE s32 dMeter2Info_getTimeMs();
DUSK_NOINLINE void dMeter2Info_setMsgTimeMs(s32 i_msgTime);
DUSK_NOINLINE void dMeter2Info_setTimeMs(s32 i_time);
DUSK_NOINLINE u8 dMeter2Info_getNowCount();
DUSK_NOINLINE u8 dMeter2Info_getMaxCount();
DUSK_NOINLINE void dMeter2Info_setScopeZoomPointer(u8 param_0);
DUSK_NOINLINE void dMeter2Info_decMsgKeyWaitTimer();
DUSK_NOINLINE bool dMeter2Info_isFloatingMessageVisible();
DUSK_NOINLINE u8 dMeter2Info_getItemExplainWindowStatus();
DUSK_NOINLINE void dMeter2Info_setItemExplainWindowStatus(u8 i_value);
DUSK_NOINLINE void dMeter2Info_resetDirectUseItem();
DUSK_NOINLINE u16 dMeter2Info_getFloatingFlowID();
DUSK_NOINLINE u8 dMeter2Info_getCollectCursorPosX();
DUSK_NOINLINE u8 dMeter2Info_getCollectCursorPosY();
DUSK_NOINLINE void dMeter2Info_setCollectCursorPosXY(u8 x, u8 y);
DUSK_NOINLINE void dMeter2Info_onBlinkButton(int i_flag);
DUSK_NOINLINE bool dMeter2Info_isFloatingMessageWakuVisible();
DUSK_NOINLINE bool dMeter2Info_isBlinkButton(int i_flag);
DUSK_NOINLINE void dMeter2Info_resetBlinkButton();
DUSK_NOINLINE void dMeter2Info_resetFloatingMessage();
DUSK_NOINLINE s16 dMeter2Info_decFloatingMessageTimer();
DUSK_NOINLINE s16 dMeter2Info_getFloatingMessageTimer();
DUSK_NOINLINE u16 dMeter2Info_getFloatingMessageID();
DUSK_NOINLINE s16 dMeter2Info_getHorseLifeCount();
DUSK_NOINLINE void dMeter2Info_setMeterString(s32 i_string);
DUSK_NOINLINE void dMeter2Info_resetMeterString();
DUSK_NOINLINE void dMeter2Info_setMeterItemPanePtr(int i_no, CPaneMgr* i_pane);
DUSK_NOINLINE bool dMeter2Info_isShopTalkFlag();
DUSK_NOINLINE void dMeter2Info_setMapDrugFlag(bool i_flag);
DUSK_NOINLINE bool dMeter2Info_isTempBit(int i_bit);
DUSK_NOINLINE void dMeter2Info_offSub2DStatus(int i_bit);
DUSK_NOINLINE void dMeter2Info_onSub2DStatus(int i_bit);
DUSK_NOINLINE void dMeter2Info_set2DWidth(f32 i_width);
DUSK_NOINLINE void dMeter2Info_set2DHeight(f32 i_height);
DUSK_NOINLINE void dMeter2Info_set2DPosH(f32 i_posH);
DUSK_NOINLINE void dMeter2Info_set2DPosV(f32 i_posV);
DUSK_NOINLINE void dMeter2Info_offShopTalkFlag();
DUSK_NOINLINE void dMeter2Info_onUseButton(int i_button);
DUSK_NOINLINE f32 dMeter2Info_get2DWidth();
DUSK_NOINLINE f32 dMeter2Info_get2DHeight();
DUSK_NOINLINE void dMeter2Info_setWarpInfo(const char* i_stageName, const cXyz& i_position,
s16 i_angle, u8 i_roomNo, u8 param_4, u8 i_warpPlayerNo);
DUSK_NOINLINE u8 dMeter2Info_getTableMapRegionNo();
DUSK_NOINLINE u8 dMeter2Info_getGoldWolfMapType();
DUSK_NOINLINE bool dMeter2Info_isWindowAccept(int param_0);
DUSK_NOINLINE void dMeter2Info_setHorseLifeCount(s16 i_count);
DUSK_NOINLINE void dMeter2Info_offTempBit(int i_bit);
DUSK_NOINLINE void dMeter2Info_onTempBit(int i_bit);
DUSK_NOINLINE void dMeter2Info_setFloatingMessage(u16 i_msgID, s16 i_msgTimer, bool i_wakuVisible);
DUSK_NOINLINE void dMeter2Info_setMiniGameCount(s8 i_count);
DUSK_NOINLINE void dMeter2Info_onWindowAccept(int param_0);
DUSK_NOINLINE void dMeter2Info_offWindowAccept(int param_0);
DUSK_NOINLINE void dMeter2Info_onMenuInForce(int param_0);
#else
inline void dMeter2Info_Initialize() { inline void dMeter2Info_Initialize() {
g_meter2_info.init(); g_meter2_info.init();
} }
@@ -865,4 +1009,6 @@ inline void dMeter2Info_onMenuInForce(int param_0) {
g_meter2_info.onMenuInForce(param_0); g_meter2_info.onMenuInForce(param_0);
} }
#endif
#endif /* D_METER_D_METER2_INFO_H */ #endif /* D_METER_D_METER2_INFO_H */
+47 -12
View File
@@ -27,18 +27,20 @@ public:
// Attributes // Attributes
/* 0x04 */ BE(u16) message_id; /* 0x04 */ BE(u16) message_id;
/* 0x06 */ BE(u16) event_label_id; /* 0x06 */ BE(u16) event_label_id; // saveBitLabels index set when the message displays
/* 0x08 */ u8 se_speaker; /* 0x08 */ u8 speaker; // Z2SpeechMgr2 voice bank ID
/* 0x09 */ u8 fuki_kind; /* 0x09 */ u8 box_kind; // screen class, see dMsgObject_c::talkStartInit
/* 0x0A */ u8 output_type; /* 0x0A */ u8 draw_type; // text pacing, see jmessage_tSequenceProcessor::do_begin
/* 0x0B */ u8 fuki_pos_type; /* 0x0B */ u8 box_position; // see dMsgObject_c::fukiPosCalc
/* 0x0C */ u8 unk_0xc; /* 0x0C */ u8 item_no; // unused; legacy dItemNo, 0xFF = none
/* 0x0D */ u8 unk_0xd; /* 0x0D */ u8 line_alignment; // 0 centered (JP only), 1 left; also copied to
/* 0x0E */ u8 se_mood; // jmessage_tReference::mForm
/* 0x0F */ u8 camera_id; /* 0x0E */ u8 speaker_mood; // grunt emotion index for the voice bank
/* 0x10 */ u8 base_anm_id; /* 0x0F */ u8 camera_attr; // 1-10 talk-actor slot, >=11 talk-camera style
/* 0x11 */ u8 face_anm_id; /* 0x10 */ u8 talk_anim; // NPC talk motion attribute
/* 0x12 */ BE(u16) unk_0x12; /* 0x11 */ u8 face_anim; // NPC talk face attribute
/* 0x12 */ u8 lines_per_page; // unused; runtime uses getLineMax()
/* 0x13 */ u8 _pad;
}; };
class JMSMesgInfo_c { class JMSMesgInfo_c {
@@ -119,6 +121,25 @@ struct jmessage_tReference : public JMessage::TReference {
void setDemoFrame(u32 i_frame) { mDemoFrame = i_frame; } void setDemoFrame(u32 i_frame) { mDemoFrame = i_frame; }
void setTopColorType(u8 i_colorType) { mTopColorType = i_colorType; } void setTopColorType(u8 i_colorType) { mTopColorType = i_colorType; }
void setNowColorType(u8 i_colorType) { mNowColorType = i_colorType; } void setNowColorType(u8 i_colorType) { mNowColorType = i_colorType; }
#if TARGET_PC
void resetColors() {
mNowCCColor = 0xFFFFFFFF;
mNowGCColor = 0xFFFFFFFF;
mTopCCColor = 0xFFFFFFFF;
mTopGCColor = 0xFFFFFFFF;
mNowFullColor = false;
mTopFullColor = false;
}
void setFullColor(u32 ccColor, u32 gcColor) {
mNowCCColor = ccColor;
mNowGCColor = gcColor;
mNowFullColor = true;
}
void clearNowFullColor() { mNowFullColor = false; }
bool hasTopFullColor() { return mTopFullColor; }
u32 getTopCCColor() { return mTopCCColor; }
u32 getTopGCColor() { return mTopGCColor; }
#endif
void setTopTagScale(u16 i_tagScale) { mTopTagScale = i_tagScale; } void setTopTagScale(u16 i_tagScale) { mTopTagScale = i_tagScale; }
void setNowTagScale(u16 i_tagScale) { mNowTagScale = i_tagScale; } void setNowTagScale(u16 i_tagScale) { mNowTagScale = i_tagScale; }
void setRevoMessageID(u32 i_msgID) { mRevoMessageID = i_msgID; } void setRevoMessageID(u32 i_msgID) { mRevoMessageID = i_msgID; }
@@ -363,6 +384,14 @@ struct jmessage_tReference : public JMessage::TReference {
/* 0x1274 */ bool mSelectSetCancelFlag; /* 0x1274 */ bool mSelectSetCancelFlag;
/* 0x1275 */ bool mBombNameUseFlag; /* 0x1275 */ bool mBombNameUseFlag;
/* 0x1276 */ u8 mBatchColorFlag; /* 0x1276 */ u8 mBatchColorFlag;
#if TARGET_PC
u32 mNowCCColor;
u32 mNowGCColor;
u32 mTopCCColor;
u32 mTopGCColor;
bool mNowFullColor;
bool mTopFullColor;
#endif
}; // Size: 0x1278 }; // Size: 0x1278
struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor { struct jmessage_tMeasureProcessor : public JMessage::TRenderingProcessor {
@@ -460,6 +489,9 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor {
void do_selwidthcenter(int); void do_selwidthcenter(int);
void do_heightcenter(); void do_heightcenter();
void do_color(u8); void do_color(u8);
#if TARGET_PC
void do_fullcolor(u32 ccColor, u32 gcColor);
#endif
void do_scale(f32); void do_scale(f32);
void do_linedown(s16); void do_linedown(s16);
void do_transY(s16, bool); void do_transY(s16, bool);
@@ -638,6 +670,9 @@ struct jmessage_string_tRenderingProcessor : public JMessage::TRenderingProcesso
void do_rubystrcat(char*); void do_rubystrcat(char*);
void do_outfont(u8); void do_outfont(u8);
void do_color(u8); void do_color(u8);
#if TARGET_PC
void do_fullcolor(u32 ccColor, u32 gcColor);
#endif
void do_scale(f32); void do_scale(f32);
void do_linedown(s16); void do_linedown(s16);
void do_numset(s16); void do_numset(s16);
+2 -2
View File
@@ -22,7 +22,7 @@ struct msg_class;
// all mesg_flow_node structs members might be wrong // all mesg_flow_node structs members might be wrong
struct mesg_flow_node { struct mesg_flow_node {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x01 */ u8 field_0x1; /* 0x01 */ u8 subtype;
/* 0x02 */ BE(u16) msg_index; /* 0x02 */ BE(u16) msg_index;
/* 0x04 */ BE(u16) next_node_idx; /* 0x04 */ BE(u16) next_node_idx;
/* 0x06 */ BE(u16) unk_0x6; /* 0x06 */ BE(u16) unk_0x6;
@@ -30,7 +30,7 @@ struct mesg_flow_node {
struct mesg_flow_node_branch { struct mesg_flow_node_branch {
/* 0x00 */ u8 type; /* 0x00 */ u8 type;
/* 0x01 */ u8 field_0x1; /* 0x01 */ u8 result_count;
/* 0x02 */ BE(u16) query_idx; /* 0x02 */ BE(u16) query_idx;
/* 0x04 */ BE(u16) param; /* 0x04 */ BE(u16) param;
/* 0x06 */ BE(u16) next_node_idx; /* 0x06 */ BE(u16) next_node_idx;
+2 -2
View File
@@ -280,13 +280,13 @@ public:
/* 0x150 */ f32 field_0x150; /* 0x150 */ f32 field_0x150;
/* 0x154 */ u32 mMessageID; /* 0x154 */ u32 mMessageID;
/* 0x158 */ u32 field_0x158; /* 0x158 */ u32 field_0x158;
/* 0x15C */ u32 field_0x15c; /* 0x15C */ u32 mSelectMessageID; // message ID of the selection options message; 1000 = none
/* 0x160 */ int mIdx; /* 0x160 */ int mIdx;
/* 0x164 */ u16 mNodeIdx; /* 0x164 */ u16 mNodeIdx;
/* 0x166 */ u16 field_0x166; /* 0x166 */ u16 field_0x166;
/* 0x168 */ u16 field_0x168; /* 0x168 */ u16 field_0x168;
/* 0x16A */ s16 field_0x16a; /* 0x16A */ s16 field_0x16a;
/* 0x16C */ s16 field_0x16c; /* 0x16C */ s16 mCurrentGroupID; // group whose BMG is parsed; -1 none, 0 common, 1-8 stage
/* 0x16E */ s16 field_0x16e; /* 0x16E */ s16 field_0x16e;
/* 0x170 */ s16 mNowTalkFlowNo; /* 0x170 */ s16 mNowTalkFlowNo;
/* 0x172 */ s16 field_0x172; /* 0x172 */ s16 field_0x172;
+2 -2
View File
@@ -25,7 +25,7 @@ public:
void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; } void setTextBoxPtr(J2DTextBox* p_textBox) { mpTextBoxPtr = p_textBox; }
void resetType() { mType = 0x47; } void resetType() { mType = 0x47; }
private: // private:
/* 0x04 */ J2DTextBox* mpTextBoxPtr; /* 0x04 */ J2DTextBox* mpTextBoxPtr;
/* 0x08 */ f32 mPosX; /* 0x08 */ f32 mPosX;
/* 0x0C */ f32 mPosY; /* 0x0C */ f32 mPosY;
@@ -53,7 +53,7 @@ public:
void setRupeeColor(u8 color) { mRupeeColor = color; } void setRupeeColor(u8 color) { mRupeeColor = color; }
private: // private:
/* 0x004 */ COutFontSet_c* mpOfs[35]; /* 0x004 */ COutFontSet_c* mpOfs[35];
/* 0x090 */ J2DPicture* mpPane[70]; /* 0x090 */ J2DPicture* mpPane[70];
/* 0x1A8 */ f32 mAlphaRatio; /* 0x1A8 */ f32 mAlphaRatio;
-28
View File
@@ -12,34 +12,6 @@ class J2DTextBox;
class JUTFont; class JUTFont;
class STControl; class STControl;
#if TARGET_PC
struct PaneCache {
u64 tag;
f32 origTransX;
f32 origTransY;
bool cached;
};
static PaneCache l_tagName[] = {
{MULTI_CHAR('m_00_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_00_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_01_3'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_01_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_02_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_2'), 0.0f, 0.0f, false},
{MULTI_CHAR('m03_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m03_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_04_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_1'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_05_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_05_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_06_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_0'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_07_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_07_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_08_4'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_09_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_09_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_10_3'), 0.0f, 0.0f, false},
{MULTI_CHAR('m_10_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m_11_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_0'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_2'), 0.0f, 0.0f, false},
{MULTI_CHAR('m12_3'), 0.0f, 0.0f, false}, {MULTI_CHAR('m12_4'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_2'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_1'), 0.0f, 0.0f, false}, {MULTI_CHAR('p_end_0'), 0.0f, 0.0f, false},
};
static PaneCache l_nameTagName[] = {
{MULTI_CHAR('name_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('name_07'), 0.0f, 0.0f, false},
};
static PaneCache l_nameCurTagName[] = {
{MULTI_CHAR('s__n_00'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_01'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_02'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_03'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_04'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_05'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_06'), 0.0f, 0.0f, false}, {MULTI_CHAR('s__n_07'), 0.0f, 0.0f, false},
};
#endif
class dNm_HIO_c { class dNm_HIO_c {
public: public:
dNm_HIO_c(); dNm_HIO_c();
+1
View File
@@ -1291,6 +1291,7 @@ public:
} }
void set(const char*, s8, s16, s8, s8, u8); void set(const char*, s8, s16, s8, s8, u8);
void offEnable() { enabled = 0; } void offEnable() { enabled = 0; }
void onEnable() { enabled = 1; }
BOOL isEnable() const { return enabled; } BOOL isEnable() const { return enabled; }
s8 getWipe() const { return wipe; } s8 getWipe() const { return wipe; }
u8 getWipeSpeed() const { return wipe_speed; } u8 getWipeSpeed() const { return wipe_speed; }
+5
View File
@@ -318,6 +318,11 @@ public:
/* 0x566 */ s8 field_0x566; /* 0x566 */ s8 field_0x566;
/* 0x567 */ s8 field_0x567; /* 0x567 */ s8 field_0x567;
#if TARGET_PC
u32 mItemGiveTag;
u8 mItemGiveOriginalNo;
#endif
#if !__MWERKS__ #if !__MWERKS__
s8 actor_last_base_field; s8 actor_last_base_field;
#endif #endif
+22 -13
View File
@@ -79,6 +79,10 @@ struct fopAcM_prm_class {
/* 0x1C */ fpc_ProcID parent_id; /* 0x1C */ fpc_ProcID parent_id;
/* 0x20 */ s8 argument; /* 0x20 */ s8 argument;
/* 0x21 */ s8 room_no; /* 0x21 */ s8 room_no;
#if TARGET_PC
u32 mItemGiveTag;
u8 mItemGiveOriginalNo;
#endif
}; };
struct fopAcM_search4ev_prm { struct fopAcM_search4ev_prm {
@@ -516,8 +520,9 @@ s32 fopAcM_SearchByName(s16 i_procName, fopAc_ac_c** i_outActor);
fopAcM_prm_class* fopAcM_CreateAppend(); fopAcM_prm_class* fopAcM_CreateAppend();
fopAcM_prm_class* createAppend(u16 i_setId, u32 i_parameters, const cXyz* i_pos, int i_roomNo, fopAcM_prm_class* createAppend(u16 i_setId, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
fpc_ProcID i_parentId); fpc_ProcID i_parentId IF_DUSK_ARG(u32 i_itemGiveTag = 0)
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
void fopAcM_Log(fopAc_ac_c const* i_actor, char const* i_message); void fopAcM_Log(fopAc_ac_c const* i_actor, char const* i_message);
@@ -526,19 +531,22 @@ s32 fopAcM_delete(fopAc_ac_c* i_actor);
s32 fopAcM_delete(fpc_ProcID i_actorID); s32 fopAcM_delete(fpc_ProcID i_actorID);
fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cXyz* i_pos, fpc_ProcID fopAcM_create(s16 i_procName, u16 i_setId, u32 i_parameters, const cXyz* i_pos,
int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument,
createFunc i_createFunc); createFunc i_createFunc IF_DUSK_ARG(u32 i_itemGiveTag = 0)
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo, fpc_ProcID fopAcM_create(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument); const csXyz* i_angle, const cXyz* i_scale, s8 i_argument IF_DUSK_ARG(u32 i_itemGiveTag = 0)
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* params) { inline fpc_ProcID fopAcM_Create(s16 i_procName, createFunc i_createFunc, void* params) {
return fpcM_Create(i_procName, i_createFunc,params); return fpcM_Create(i_procName, i_createFunc,params);
} }
fopAc_ac_c* fopAcM_fastCreate(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo, fopAc_ac_c* fopAcM_fastCreate(s16 i_procName, u32 i_parameters, const cXyz* i_pos, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, const csXyz* i_angle, const cXyz* i_scale, s8 i_argument, createFunc i_createFunc,
createFunc i_createFunc, void* i_createFuncData); void* i_createFuncData IF_DUSK_ARG(u32 i_itemGiveTag = 0)
IF_DUSK_ARG(u8 i_itemOriginalNo = 0xFF));
fopAc_ac_c* fopAcM_fastCreate(const char* i_actorname, u32 i_parameters, const cXyz* i_pos, fopAc_ac_c* fopAcM_fastCreate(const char* i_actorname, u32 i_parameters, const cXyz* i_pos,
int i_roomNo, const csXyz* i_angle, const cXyz* i_scale, int i_roomNo, const csXyz* i_angle, const cXyz* i_scale,
@@ -623,11 +631,11 @@ fopAc_ac_c* fopAcM_getItemEventPartner(const fopAc_ac_c*);
fopAc_ac_c* fopAcM_getEventPartner(const fopAc_ac_c*); fopAc_ac_c* fopAcM_getEventPartner(const fopAc_ac_c*);
fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 param_2, fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 param_2,
int i_itemBitNo, int i_roomNo, csXyz const* i_angle, int i_itemBitNo, int i_roomNo, csXyz const* i_angle,
cXyz const* i_scale); cXyz const* i_scale IF_DUSK_ARG(u32 i_itemGiveTag = 0));
fpc_ProcID fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_itemBitNo, fpc_ProcID fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_itemBitNo,
int i_roomNo, csXyz const* i_angle, cXyz const* i_scale); int i_roomNo, csXyz const* i_angle, cXyz const* i_scale IF_DUSK_ARG(u32 i_itemGiveTag = 0));
u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo); u8 fopAcM_getItemNoFromTableNo(u8 i_tableNo);
@@ -641,11 +649,12 @@ fpc_ProcID fopAcM_createItemFromTable(cXyz const* i_pos, int i_tableNo, int i_it
bool i_createDirect); bool i_createDirect);
fpc_ProcID fopAcM_createDemoItem(const cXyz* i_pos, int i_itemNo, int i_itemBitNo, fpc_ProcID fopAcM_createDemoItem(const cXyz* i_pos, int i_itemNo, int i_itemBitNo,
const csXyz* i_angle, int i_roomNo, const cXyz* scale, u8 param_7); const csXyz* i_angle, int i_roomNo, const cXyz* scale,
u8 param_7 IF_DUSK_ARG(u32 i_itemGiveTag = 0));
fpc_ProcID fopAcM_createItemForBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo, fpc_ProcID fopAcM_createItemForBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF, const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF, f32 i_speedY,
f32 i_speedY, int param_8); int param_8 IF_DUSK_ARG(const char* i_itemCheckName = NULL));
fpc_ProcID fopAcM_createItemForMidBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo, fpc_ProcID fopAcM_createItemForMidBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, int param_6, const csXyz* i_angle, const cXyz* i_scale, int param_6,
+1 -1
View File
@@ -30,7 +30,7 @@ struct msg_class {
/* 0xDC */ fopAc_ac_c* talk_actor; /* 0xDC */ fopAc_ac_c* talk_actor;
/* 0xE0 */ cXyz pos; /* 0xE0 */ cXyz pos;
/* 0xEC */ u32 msg_idx; /* 0xEC */ u32 msg_idx;
/* 0xF0 */ u32 field_0xf0; /* 0xF0 */ u32 select_msg_idx; // selection options message ID; 1000 = none
/* 0xF4 */ u32 field_0xf4; /* 0xF4 */ u32 field_0xf4;
/* 0xF8 */ u16 mode; /* 0xF8 */ u16 mode;
/* 0xFA */ u8 select_idx; /* 0xFA */ u8 select_idx;
+3 -3
View File
@@ -19,7 +19,7 @@ struct fopMsg_prm_class {
/* 0x00 */ fopAc_ac_c* talk_actor; /* 0x00 */ fopAc_ac_c* talk_actor;
/* 0x04 */ cXyz pos; /* 0x04 */ cXyz pos;
/* 0x10 */ u32 msg_idx; /* 0x10 */ u32 msg_idx;
/* 0x14 */ u32 field_0x14; /* 0x14 */ u32 select_msg_idx; // selection options message ID; 1000 = none
/* 0x18 */ fpc_ProcID field_0x18; /* 0x18 */ fpc_ProcID field_0x18;
}; // Size: 0x1C }; // Size: 0x1C
@@ -46,8 +46,8 @@ void fopMsgM_setMessageID(fpc_ProcID msg_id);
void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap); void fopMsgM_destroyExpHeap(JKRExpHeap* i_heap);
f32 fopMsgM_valueIncrease(int param_0, int param_1, u8 i_type); f32 fopMsgM_valueIncrease(int param_0, int param_1, u8 i_type);
s32 fopMsgM_setStageLayer(void* i_process); s32 fopMsgM_setStageLayer(void* i_process);
fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_talkActor, u32 param_2); fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, fopAc_ac_c* i_talkActor, u32 i_selectMsgIdx);
fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, u32 param_1); fpc_ProcID fopMsgM_messageSet(u32 i_msgIdx, u32 i_selectMsgIdx);
fpc_ProcID fopMsgM_messageSetDemo(u32 i_msgidx); fpc_ProcID fopMsgM_messageSetDemo(u32 i_msgidx);
msg_class* fopMsgM_SearchByID(fpc_ProcID i_id); msg_class* fopMsgM_SearchByID(fpc_ProcID i_id);
TEXT_SPAN fopMsgM_messageGet(TEXT_SPAN i_stringBuf, u32 i_msgId); TEXT_SPAN fopMsgM_messageGet(TEXT_SPAN i_stringBuf, u32 i_msgId);
+27
View File
@@ -123,6 +123,14 @@ inline int __builtin_clz(unsigned int v) {
#endif #endif
#define DUSK_GAME_EXTERN extern DUSK_GAME_DATA #define DUSK_GAME_EXTERN extern DUSK_GAME_DATA
#if defined(_MSC_VER)
#define DUSK_NOINLINE __declspec(noinline)
#elif defined(__GNUC__)
#define DUSK_NOINLINE __attribute__((noinline))
#else
#define DUSK_NOINLINE
#endif
#define FAST_DIV(x, n) (x >> (n / 2)) #define FAST_DIV(x, n) (x >> (n / 2))
#define SQUARE(x) ((x) * (x)) #define SQUARE(x) ((x) * (x))
@@ -256,4 +264,23 @@ using std::isnan;
#define DUSK_CONST IF_DUSK(const) #define DUSK_CONST IF_DUSK(const)
#define DUSK_CONSTEXPR IF_DUSK(constexpr) #define DUSK_CONSTEXPR IF_DUSK(constexpr)
#if TARGET_PC && defined(DUSK_BUILDING_GAME)
#include "dusk/mods/item.hpp"
#define DUSK_ITEM_CHECK(name, item_no, giver) \
(item_no) = ::dusk::mods::item_check_commit(name, (item_no), giver).itemNo
#define DUSK_ITEM_CHECK_EXPR(name, item_no, giver) \
(::dusk::mods::item_check_commit(name, (item_no), giver).itemNo)
#define DUSK_ITEM_CHECK_PREVIEW(name, item_no, giver) \
(item_no) = ::dusk::mods::item_check(name, (item_no), giver)
#define DUSK_ITEM_CHECK_PREVIEW_EXPR(name, item_no, giver) \
(::dusk::mods::item_check(name, (item_no), giver))
#define DUSK_GIVE_TAG(name) IF_DUSK_ARG(::dusk::mods::item_give_tag(name))
#else
#define DUSK_ITEM_CHECK(name, item_no, giver)
#define DUSK_ITEM_CHECK_EXPR(name, item_no, giver) (item_no)
#define DUSK_ITEM_CHECK_PREVIEW(name, item_no, giver)
#define DUSK_ITEM_CHECK_PREVIEW_EXPR(name, item_no, giver) (item_no)
#define DUSK_GIVE_TAG(name)
#endif
#endif #endif
+178
View File
@@ -0,0 +1,178 @@
#pragma once
#include <bit>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <type_traits>
namespace dusk {
namespace detail {
template <size_t Size>
struct uint_of_size;
template <>
struct uint_of_size<1> {
using type = uint8_t;
};
template <>
struct uint_of_size<2> {
using type = uint16_t;
};
template <>
struct uint_of_size<4> {
using type = uint32_t;
};
template <>
struct uint_of_size<8> {
using type = uint64_t;
};
template <size_t Size>
using uint_of_size_t = uint_of_size<Size>::type;
template <typename T>
requires(std::is_trivially_copyable_v<T>)
T unaligned_load(const void* source) noexcept {
T value;
std::memcpy(&value, source, sizeof(value));
return value;
}
template <typename T>
requires(std::is_trivially_copyable_v<T>)
void unaligned_store(void* destination, T value) noexcept {
std::memcpy(destination, &value, sizeof(value));
}
} // namespace detail
template <typename T>
requires(std::is_unsigned_v<T>)
constexpr T bswap(T value) noexcept {
if constexpr (sizeof(T) == 1) {
return value;
} else if constexpr (sizeof(T) == 2) {
return static_cast<T>((value << 8) | (value >> 8));
} else if constexpr (sizeof(T) == 4) {
return static_cast<T>(((value & 0x000000ffU) << 24) | ((value & 0x0000ff00U) << 8) |
((value & 0x00ff0000U) >> 8) | ((value & 0xff000000U) >> 24));
} else {
static_assert(sizeof(T) == 8);
return static_cast<T>(
((value & 0x00000000000000ffULL) << 56) | ((value & 0x000000000000ff00ULL) << 40) |
((value & 0x0000000000ff0000ULL) << 24) | ((value & 0x00000000ff000000ULL) << 8) |
((value & 0x000000ff00000000ULL) >> 8) | ((value & 0x0000ff0000000000ULL) >> 24) |
((value & 0x00ff000000000000ULL) >> 40) | ((value & 0xff00000000000000ULL) >> 56));
}
}
/// Reads an unaligned integral value in the specified byte order.
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
T read_bits(const void* source, std::endian endian = std::endian::big) noexcept {
using Bits = std::make_unsigned_t<T>;
Bits value = detail::unaligned_load<Bits>(source);
if constexpr (sizeof(Bits) > 1) {
if (endian != std::endian::native) {
value = bswap(value);
}
}
return std::bit_cast<T>(value);
}
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
constexpr T read_bits(const uint8_t* source, std::endian endian = std::endian::big) noexcept {
if (!std::is_constant_evaluated()) {
return read_bits<T>(static_cast<const void*>(source), endian);
}
using Bits = std::make_unsigned_t<T>;
Bits value{};
if (endian == std::endian::big) {
for (size_t i = 0; i < sizeof(Bits); ++i) {
value = static_cast<Bits>((value << 8) | source[i]);
}
} else {
for (size_t i = 0; i < sizeof(Bits); ++i) {
value |= static_cast<Bits>(source[i]) << (i * 8);
}
}
return std::bit_cast<T>(value);
}
/// Reads an unaligned floating-point value in the specified byte order.
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
T read_bits(const void* source, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
return std::bit_cast<T>(read_bits<Bits>(source, endian));
}
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
constexpr T read_bits(const uint8_t* source, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
return std::bit_cast<T>(read_bits<Bits>(source, endian));
}
/// Writes an unaligned integral value in the specified byte order.
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
void write_bits(void* destination, T value, std::endian endian = std::endian::big) noexcept {
using Bits = std::make_unsigned_t<T>;
Bits bits = std::bit_cast<Bits>(value);
if constexpr (sizeof(Bits) > 1) {
if (endian != std::endian::native) {
bits = bswap(bits);
}
}
detail::unaligned_store(destination, bits);
}
template <typename T>
requires(std::is_integral_v<T> && !std::is_same_v<T, bool>)
constexpr void write_bits(
uint8_t* destination, T value, std::endian endian = std::endian::big) noexcept {
if (!std::is_constant_evaluated()) {
write_bits(static_cast<void*>(destination), value, endian);
return;
}
using Bits = std::make_unsigned_t<T>;
const Bits bits = std::bit_cast<Bits>(value);
if (endian == std::endian::big) {
for (size_t i = 0; i < sizeof(Bits); ++i) {
destination[sizeof(Bits) - i - 1] = static_cast<uint8_t>(bits >> (i * 8));
}
} else {
for (size_t i = 0; i < sizeof(Bits); ++i) {
destination[i] = static_cast<uint8_t>(bits >> (i * 8));
}
}
}
/// Writes an unaligned floating-point value in the specified byte order.
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
void write_bits(void* destination, T value, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
write_bits(destination, std::bit_cast<Bits>(value), endian);
}
template <typename T>
requires(
std::is_floating_point_v<T> && requires { typename detail::uint_of_size_t<sizeof(T)>; })
constexpr void write_bits(
uint8_t* destination, T value, std::endian endian = std::endian::big) noexcept {
using Bits = detail::uint_of_size_t<sizeof(T)>;
write_bits(destination, std::bit_cast<Bits>(value), endian);
}
} // namespace dusk
+20
View File
@@ -112,6 +112,11 @@ public:
mSerialNo = serial_no; mSerialNo = serial_no;
} }
#ifdef TARGET_PC
void setFileName(const std::string& fileName);
const char* getFileName();
#endif
/* 0x0000 */ u8 mData[SAVEFILE_SIZE]; /* 0x0000 */ u8 mData[SAVEFILE_SIZE];
/* 0x1FBC */ u8 mChannel; /* 0x1FBC */ u8 mChannel;
/* 0x1FBD */ u8 mCopyToPos; /* 0x1FBD */ u8 mCopyToPos;
@@ -124,6 +129,11 @@ public:
/* 0x1FEC */ s32 mNandState; /* 0x1FEC */ s32 mNandState;
/* 0x1FF0 */ u64 mSerialNo; /* 0x1FF0 */ u64 mSerialNo;
/* 0x1FF8 */ u32 mDataVersion; /* 0x1FF8 */ u32 mDataVersion;
#ifdef TARGET_PC
bool mInitialized;
std::string mFileName;
#endif
}; // Size: 0x2000 }; // Size: 0x2000
STATIC_ASSERT(sizeof(mDoMemCd_Ctrl_c) == 8192); STATIC_ASSERT(sizeof(mDoMemCd_Ctrl_c) == 8192);
@@ -230,4 +240,14 @@ inline s32 mDoMemCd_checkNANDFile() {
} }
#endif #endif
#ifdef TARGET_PC
inline void mDoMemCd_SetFileName(const std::string& fileName) {
g_mDoMemCd_control.setFileName(fileName);
}
inline const char* mDoMemCd_GetFileName() {
return g_mDoMemCd_control.getFileName();
}
#endif
#endif /* M_DO_M_DO_MEMCARD_H */ #endif /* M_DO_M_DO_MEMCARD_H */
+3 -3
View File
@@ -68,7 +68,7 @@ public:
JKRMemArchive* getArchive() const { return mArchive; } JKRMemArchive* getArchive() const { return mArchive; }
JKRHeap* getHeap() const { return mHeap; } JKRHeap* getHeap() const { return mHeap; }
private: // private:
/* 0x14 */ u8 mMountDirection; /* 0x14 */ u8 mMountDirection;
/* 0x18 */ s32 mEntryNumber; /* 0x18 */ s32 mEntryNumber;
/* 0x1C */ JKRMemArchive* mArchive; /* 0x1C */ JKRMemArchive* mArchive;
@@ -130,8 +130,8 @@ private:
}; // Size = 0x28 }; // Size = 0x28
struct mDoDvdThdStack { struct mDoDvdThdStack {
u8 stack[4096]; ATTRIBUTE_ALIGN(16) u8 stack[4096];
} ATTRIBUTE_ALIGN(16); };
struct mDoDvdThd { struct mDoDvdThd {
static s32 main(void*); static s32 main(void*);
@@ -9,6 +9,7 @@
class J3DModelData; class J3DModelData;
class J3DMaterialTable; class J3DMaterialTable;
struct J3DModelHierarchy; struct J3DModelHierarchy;
class J3DVertexData;
#if TARGET_PC #if TARGET_PC
#define OFFSET_PTR_V0 BE(u32) #define OFFSET_PTR_V0 BE(u32)
@@ -6,11 +6,17 @@
#include "global.h" #include "global.h"
#include "helpers/endian.h" #include "helpers/endian.h"
#if TARGET_PC
#include <atomic>
#include <string>
#include <unordered_map>
#endif
class JKRHeap; class JKRHeap;
/** /**
* @ingroup jsystem-jkernel * @ingroup jsystem-jkernel
* *
*/ */
struct SArcHeader { struct SArcHeader {
/* 0x00 */ BE(u32) signature; /* 0x00 */ BE(u32) signature;
@@ -25,7 +31,7 @@ struct SArcHeader {
/** /**
* @ingroup jsystem-jkernel * @ingroup jsystem-jkernel
* *
*/ */
struct SArcDataInfo { struct SArcDataInfo {
/* 0x00 */ BE(u32) num_nodes; /* 0x00 */ BE(u32) num_nodes;
@@ -59,7 +65,7 @@ extern u32 sCurrentDirID__10JKRArchive; // JKRArchive::sCurrentDirID
/** /**
* @ingroup jsystem-jkernel * @ingroup jsystem-jkernel
* *
*/ */
class JKRArchive : public JKRFileLoader { class JKRArchive : public JKRFileLoader {
public: public:
@@ -192,9 +198,7 @@ public:
u32 countFile() const { return mArcInfoBlock->num_file_entries; } u32 countFile() const { return mArcInfoBlock->num_file_entries; }
s32 countDirectory() const { return mArcInfoBlock->num_nodes; } s32 countDirectory() const { return mArcInfoBlock->num_nodes; }
u8 getMountMode() const { return mMountMode; } u8 getMountMode() const { return mMountMode; }
bool isFileEntry(u32 param_0) const { bool isFileEntry(u32 param_0) const { return getFileAttribute(param_0) & 1; }
return getFileAttribute(param_0) & 1;
}
public: public:
/* 0x00 */ // vtable /* 0x00 */ // vtable
@@ -210,7 +214,36 @@ public:
/* 0x54 */ const char* mStringTable; /* 0x54 */ const char* mStringTable;
#if TARGET_PC #if TARGET_PC
u32 getFileSize(SDIFileEntry* entry) const;
void* getOverlayData(SDIFileEntry* entry, u32* outSize);
bool getOverlayFileSize(SDIFileEntry* entry, u32* outSize) const;
static void notifyOverlayFilesChanged();
protected:
void** mFileData; void** mFileData;
struct ArcOverlayResource {
u32 entryIndex;
u32 size;
u64 generation;
};
// Resource pointers remain valid until removed through the JKR resource APIs.
// That way, any pointers to old overlay data remain valid even when the overlay changed.
std::unordered_map<void*, ArcOverlayResource> mArcOverlayResources;
mutable std::unordered_map<u32, void*> mActiveArcOverlayResources;
mutable std::string mArcOverlaysPath;
mutable std::unordered_map<u32, std::string> mIdxToPathMap;
mutable bool mArcOverlaysPathResolved = false;
bool buildArcOverlaysPath() const;
void buildIndexToPathMap(u32 dirIndex, const std::string& currentPath) const;
bool getOverlayPath(SDIFileEntry* entry, std::string& path) const;
void* getActiveOverlayData(SDIFileEntry* entry, u32* outSize) const;
bool copyOverlayData(void* buffer, u32 bufferSize, SDIFileEntry* entry, u32* outSize);
bool getOverlayResourceSize(const void* data, u32* outSize) const;
bool removeOverlayResource(void* resource, bool freeResource);
void removeAllOverlayResources();
#endif #endif
protected: protected:
@@ -234,7 +267,7 @@ public:
} else if (attr & JKRARCHIVE_ATTR_YAZ0) { } else if (attr & JKRARCHIVE_ATTR_YAZ0) {
return COMPRESSION_YAZ0; return COMPRESSION_YAZ0;
} else { } else {
return COMPRESSION_YAY0; return COMPRESSION_YAY0;
} }
} }
@@ -243,6 +276,9 @@ public:
protected: protected:
static DUSK_GAME_DATA u32 sCurrentDirID; static DUSK_GAME_DATA u32 sCurrentDirID;
#if TARGET_PC
static std::atomic<u64> sArcOverlayGeneration;
#endif
}; };
inline JKRCompression JKRConvertAttrToCompressionType(int attr) { inline JKRCompression JKRConvertAttrToCompressionType(int attr) {
@@ -261,8 +297,8 @@ inline bool JKRRemoveResource(void* resource, JKRFileLoader* fileLoader) {
return JKRFileLoader::removeResource(resource, fileLoader); return JKRFileLoader::removeResource(resource, fileLoader);
} }
inline JKRArchive* JKRMountArchive(void* ptr, JKRHeap* heap, inline JKRArchive* JKRMountArchive(
JKRArchive::EMountDirection mountDirection) { void* ptr, JKRHeap* heap, JKRArchive::EMountDirection mountDirection) {
return JKRArchive::mount(ptr, heap, mountDirection); return JKRArchive::mount(ptr, heap, mountDirection);
} }
@@ -7,6 +7,7 @@
#include <new> #include <new>
#include <utility> #include <utility>
#include <cstdint> #include <cstdint>
#include <type_traits>
class JKRHeap; class JKRHeap;
typedef void (*JKRErrorHandler)(void*, u32, int); typedef void (*JKRErrorHandler)(void*, u32, int);
@@ -174,10 +174,14 @@ struct TProcessor {
} }
void on_character(int iCharacter) { do_character(iCharacter); } void on_character(int iCharacter) { do_character(iCharacter); }
#if TARGET_PC
const char* on_message_limited(u16 u16Index) const;
#else
const char* on_message_limited(u16 u16Index) const { const char* on_message_limited(u16 u16Index) const {
JUT_ASSERT(482, pResourceCache_!=NULL); JUT_ASSERT(482, pResourceCache_!=NULL);
return pResourceCache_->getMessageText_messageIndex(u16Index); return pResourceCache_->getMessageText_messageIndex(u16Index);
} }
#endif
bool on_setBegin_isReady_() const { return do_setBegin_isReady_(); } bool on_setBegin_isReady_() const { return do_setBegin_isReady_(); }
@@ -195,6 +199,10 @@ struct TProcessor {
return 1; return 1;
} }
#if TARGET_PC
void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const;
const char* getMessageText_messageCode(u16 u16Code, u16 u16Index) const;
#else
void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const { void* getMessageEntry_messageCode(u16 u16Code, u16 u16Index) const {
const TResource* pResource = getResource_groupID(u16Code); const TResource* pResource = getResource_groupID(u16Code);
@@ -214,6 +222,7 @@ struct TProcessor {
return pResourceCache_->getMessageText_messageEntry(pEntry); return pResourceCache_->getMessageText_messageEntry(pEntry);
} }
#endif
void stack_pushCurrent_(const char* pszText) { void stack_pushCurrent_(const char* pszText) {
oStack_.push(getCurrent()); oStack_.push(getCurrent());
+2 -2
View File
@@ -23,9 +23,9 @@ DUSK_GAME_DATA Vec J3DSys::mParentS;
DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8]; DUSK_GAME_DATA J3DTexCoordScaleInfo J3DSys::sTexCoordScaleTable[8];
#if TARGET_PC // Original game bug, array is too small. #if TARGET_PC // Original game bug, array is too small.
static u8 NullTexData[0x20] ATTRIBUTE_ALIGN(32) = {0}; ATTRIBUTE_ALIGN(32) static u8 NullTexData[0x20] = {0};
#else #else
static u8 NullTexData[0x10] ATTRIBUTE_ALIGN(32) = {0}; ATTRIBUTE_ALIGN(32) static u8 NullTexData[0x10] = {0};
#endif #endif
static Mtx j3dIdentityMtx = { static Mtx j3dIdentityMtx = {
+2 -2
View File
@@ -99,14 +99,14 @@ void JASDsp::invalChannelAll() {
DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS); DCInvalidateRange(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
} }
DUSK_GAME_DATA u8 const ATTRIBUTE_ALIGN(32) JASDsp::DSPADPCM_FILTER[64] = { ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u8 const 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,
}; };
DUSK_GAME_DATA u32 const ATTRIBUTE_ALIGN(32) JASDsp::DSPRES_FILTER[320] = { ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u32 const JASDsp::DSPRES_FILTER[320] = {
0x0C3966AD, 0x0C3966AD,
0x0D46FFDF, 0x0D46FFDF,
0x0B396696, 0x0B396696,
+8 -1
View File
@@ -17,7 +17,7 @@ size_t JASResArcLoader::getResSize(JKRArchive const* i_archiveP, u16 i_resourceI
return 0; return 0;
} }
return file->data_size; return DUSK_IF_ELSE(i_archiveP->getFileSize(file), file->data_size);
} }
size_t JASResArcLoader::getResMaxSize(JKRArchive const* i_archiveP) { size_t JASResArcLoader::getResMaxSize(JKRArchive const* i_archiveP) {
@@ -27,9 +27,16 @@ size_t JASResArcLoader::getResMaxSize(JKRArchive const* i_archiveP) {
for (index = 0; index < fileEntries; index++) { for (index = 0; index < fileEntries; index++) {
JKRArchive::SDIFileEntry* file = i_archiveP->findIdxResource(index); JKRArchive::SDIFileEntry* file = i_archiveP->findIdxResource(index);
if (file) { if (file) {
#if TARGET_PC
const u32 fileSize = i_archiveP->getFileSize(file);
if (maxSize < fileSize) {
maxSize = fileSize;
}
#else
if (maxSize < file->data_size) { if (maxSize < file->data_size) {
maxSize = file->data_size; maxSize = file->data_size;
} }
#endif
} }
} }
+3 -3
View File
@@ -25,7 +25,7 @@ void DspHandShake(void*) {
Dsp_Running_Start(); Dsp_Running_Start();
} }
static u8 jdsp[7936] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) static u8 jdsp[7936] = {
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 @@ static u8 jdsp[7936] ATTRIBUTE_ALIGN(32) = {
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,
}; };
static DSPTaskInfo audio_task ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static DSPTaskInfo audio_task;
static u8 AUDIO_YIELD_BUFFER[8192] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static u8 AUDIO_YIELD_BUFFER[8192];
void DspBoot(void (*requestCallback)(void*)) { void DspBoot(void (*requestCallback)(void*)) {
DspInitWork(); DspInitWork();
+9 -14
View File
@@ -38,7 +38,7 @@ void JFWDisplay::ctor_subroutine(bool enableAlpha) {
mTickRate = 0; mTickRate = 0;
mCombinationRatio = 0.0f; mCombinationRatio = 0.0f;
field_0x30 = 0; field_0x30 = 0;
field_0x2c = OSGetTick(); field_0x2c = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick());
field_0x34 = 0; field_0x34 = 0;
field_0x48 = 0; field_0x48 = 0;
field_0x4a = 0; field_0x4a = 0;
@@ -258,7 +258,7 @@ void JFWDisplay::beginRender() {
waitForTick(mTickRate, mFrameRate); waitForTick(mTickRate, mFrameRate);
JUTVideo::getManager()->waitRetraceIfNeed(); JUTVideo::getManager()->waitRetraceIfNeed();
OSTick tick = OSGetTick(); OSTick tick = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick());
field_0x30 = tick - field_0x2c; field_0x30 = tick - field_0x2c;
field_0x2c = tick; field_0x2c = tick;
field_0x34 = field_0x2c - JUTVideo::getVideoLastTick(); field_0x34 = field_0x2c - JUTVideo::getVideoLastTick();
@@ -371,7 +371,7 @@ constexpr auto FRAME_PERIOD = std::chrono::duration_cast<std::chrono::nanosecond
constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2; constexpr auto RETRACE_PERIOD = FRAME_PERIOD / 2;
static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) { static void waitPrecise(Limiter& limiter, Limiter::duration_t targetNs) {
const auto sleepTime = limiter.Sleep(targetNs); const auto sleepTime = limiter.Sleep(targetNs);
dusk::frameUsagePct = dusk::frameUsagePct =
100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs)); 100.0f * (1.0f - static_cast<float>(sleepTime) / static_cast<float>(targetNs));
} }
@@ -381,15 +381,12 @@ static void waitForTick(u32 p1, u16 p2) {
#if TARGET_PC #if TARGET_PC
static Limiter limiter; static Limiter limiter;
if (dusk::frame_interp::is_enabled() && !dusk::getTransientSettings().skipFrameRateLimit) { if (dusk::frame_interp::is_enabled() || dusk::getTransientSettings().turboMode) {
dusk::frameUsagePct = 0.f; limiter.Reset();
return; dusk::frameUsagePct = 0.f;
return;
} }
if (dusk::getTransientSettings().skipFrameRateLimit) {
p1 = OS_TIMER_CLOCK / 120;
}
if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) { if (fopOvlpM_IsPeek() && dusk::getTransientSettings().stateShareLoadActive) {
return; return;
} }
@@ -399,7 +396,6 @@ static void waitForTick(u32 p1, u16 p2) {
if (p1 != 0) { if (p1 != 0) {
#if TARGET_PC #if TARGET_PC
static Limiter limiter;
waitPrecise(limiter, static_cast<Uint64>(OSTicksToMicroseconds(p1)) * 1000ULL); waitPrecise(limiter, static_cast<Uint64>(OSTicksToMicroseconds(p1)) * 1000ULL);
#else #else
static OSTime nextTick = OSGetTime(); static OSTime nextTick = OSGetTime();
@@ -413,7 +409,6 @@ static void waitForTick(u32 p1, u16 p2) {
} else { } else {
u32 uVar1 = (p2 == 0) ? 1 : p2; u32 uVar1 = (p2 == 0) ? 1 : p2;
#if TARGET_PC #if TARGET_PC
static Limiter limiter;
waitPrecise(limiter, static_cast<Uint64>((RETRACE_PERIOD * uVar1).count())); waitPrecise(limiter, static_cast<Uint64>((RETRACE_PERIOD * uVar1).count()));
#else #else
static u32 nextCount = VIGetRetraceCount(); static u32 nextCount = VIGetRetraceCount();
@@ -452,13 +447,13 @@ static void dummy() {
JUTXfb::getManager()->setDisplayingXfbIndex(0); JUTXfb::getManager()->setDisplayingXfbIndex(0);
} }
static Mtx e_mtx ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) static Mtx e_mtx = {
{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},
}; };
static u8 clear_z_TX[64] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) static u8 clear_z_TX[64] = {
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -196,6 +196,13 @@ cleanup:
void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) { void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) {
JUT_ASSERT(442, isMounted()); JUT_ASSERT(442, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(pEntry, pOutSize); data != nullptr) {
return data;
}
#endif
u32 outSize; u32 outSize;
u8* outBuf; u8* outBuf;
if (pOutSize == NULL) { if (pOutSize == NULL) {
@@ -231,6 +238,13 @@ void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) {
void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* pEntry, void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* pEntry,
u32* resourceSize) { u32* resourceSize) {
JUT_ASSERT(515, isMounted()); JUT_ASSERT(515, isMounted());
#if TARGET_PC
if (copyOverlayData(buffer, bufferSize, pEntry, resourceSize)) {
return buffer;
}
#endif
u32 size = pEntry->data_size; u32 size = pEntry->data_size;
if (size > bufferSize) { if (size > bufferSize) {
size = bufferSize; size = bufferSize;
@@ -337,6 +351,12 @@ u32 JKRAramArchive::getExpandedResSize(const void* ptr) const {
return this->getResSize(ptr); return this->getResSize(ptr);
} }
#if TARGET_PC
if (u32 size; getOverlayResourceSize(ptr, &size)) {
return size;
}
#endif
JKRArchive::SDIFileEntry* entry = this->findPtrResource(ptr); JKRArchive::SDIFileEntry* entry = this->findPtrResource(ptr);
if (entry == NULL) { if (entry == NULL) {
return 0xFFFFFFFF; return 0xFFFFFFFF;
+268
View File
@@ -7,6 +7,37 @@
#if TARGET_PC #if TARGET_PC
#include <cassert> #include <cassert>
#include <cstddef>
#include <cstdlib>
#include <limits>
#include <ranges>
#include <string_view>
#include "JSystem/JKernel/JKRDvdRipper.h"
#if _WIN32
#include <malloc.h>
#endif
std::atomic<u64> JKRArchive::sArcOverlayGeneration{0};
namespace {
void* alloc_overlay_buffer(u32 size) {
#if _WIN32
return _aligned_malloc(size, alignof(std::max_align_t));
#else
return std::malloc(size);
#endif
}
void free_overlay_buffer(void* data) {
#if _WIN32
_aligned_free(data);
#else
std::free(data);
#endif
}
} // namespace
#endif #endif
DUSK_GAME_DATA u32 JKRArchive::sCurrentDirID; DUSK_GAME_DATA u32 JKRArchive::sCurrentDirID;
@@ -42,6 +73,7 @@ JKRArchive::JKRArchive(s32 entryNumber, JKRArchive::EMountMode mountMode) {
JKRArchive::~JKRArchive() { JKRArchive::~JKRArchive() {
#if TARGET_PC #if TARGET_PC
removeAllOverlayResources();
if (mFileData != nullptr) { if (mFileData != nullptr) {
JKRHeap::getSystemHeap()->free(mFileData); JKRHeap::getSystemHeap()->free(mFileData);
mFileData = nullptr; mFileData = nullptr;
@@ -270,4 +302,240 @@ void JKRArchive::initFileDataPointers() {
mFiles[i].index = i; mFiles[i].index = i;
} }
} }
void JKRArchive::notifyOverlayFilesChanged() {
sArcOverlayGeneration.fetch_add(1, std::memory_order_release);
}
bool JKRArchive::buildArcOverlaysPath() const {
if (mArcOverlaysPathResolved) {
return !mArcOverlaysPath.empty();
}
mArcOverlaysPathResolved = true;
if (mEntryNum < 0) {
return false;
}
char pathBuffer[1024];
if (!DVDConvertEntrynumToPath(mEntryNum, pathBuffer, sizeof(pathBuffer))) {
return false;
}
std::string path{pathBuffer};
constexpr std::string_view extension{".arc"};
if (path.size() < extension.size() ||
path.compare(path.size() - extension.size(), extension.size(), extension) != 0)
{
return false;
}
path.resize(path.size() - extension.size());
path.push_back('/');
mArcOverlaysPath = std::move(path);
return true;
}
void JKRArchive::buildIndexToPathMap(u32 dirIndex, const std::string& currentPath) const {
const SDIDirEntry& dir = mNodes[dirIndex];
for (int i = 0; i < dir.num_entries; i++) {
const SDIFileEntry& entry = mFiles[dir.first_file_index + i];
std::string entryName{&mStringTable[entry.getNameOffset()]};
if (entryName == "." || entryName == "..") {
continue;
}
if (entry.isDirectory()) {
buildIndexToPathMap(entry.data_offset, currentPath + entryName + "/");
} else {
mIdxToPathMap[entry.index] = currentPath + entryName;
}
}
}
bool JKRArchive::getOverlayPath(SDIFileEntry* entry, std::string& path) const {
if (entry == nullptr || !buildArcOverlaysPath()) {
return false;
}
if (mIdxToPathMap.empty()) {
buildIndexToPathMap(0, std::string{&mStringTable[mNodes[0].name_offset]} + "/");
}
const auto pathIt = mIdxToPathMap.find(entry->index);
if (pathIt == mIdxToPathMap.end()) {
return false;
}
path = mArcOverlaysPath + pathIt->second;
return true;
}
void* JKRArchive::getActiveOverlayData(SDIFileEntry* entry, u32* outSize) const {
const auto activeIt = mActiveArcOverlayResources.find(entry->index);
if (activeIt == mActiveArcOverlayResources.end()) {
return nullptr;
}
const auto resourceIt = mArcOverlayResources.find(activeIt->second);
const u64 generation = sArcOverlayGeneration.load(std::memory_order_acquire);
if (resourceIt == mArcOverlayResources.end() || resourceIt->second.generation != generation) {
// Keep the allocation owned so raw pointers returned by earlier fetches remain valid.
mActiveArcOverlayResources.erase(activeIt);
return nullptr;
}
if (outSize != nullptr) {
*outSize = resourceIt->second.size;
}
return resourceIt->first;
}
void* JKRArchive::getOverlayData(SDIFileEntry* entry, u32* outSize) {
if (entry == nullptr) {
return nullptr;
}
if (void* data = getActiveOverlayData(entry, outSize)) {
return data;
}
std::string path;
if (!getOverlayPath(entry, path)) {
return nullptr;
}
constexpr u32 alignmentMask = 0x1f;
const u64 generation = sArcOverlayGeneration.load(std::memory_order_acquire);
DVDFileInfo fileInfo{};
if (!DVDOpen(path.c_str(), &fileInfo)) {
return nullptr;
}
const u32 logicalSize = fileInfo.length;
if (logicalSize > static_cast<u32>(std::numeric_limits<s32>::max()) - alignmentMask) {
DVDClose(&fileInfo);
return nullptr;
}
const u32 readSize = ALIGN_NEXT(logicalSize, 0x20);
const u32 allocationSize = readSize == 0 ? 1 : readSize;
void* data = alloc_overlay_buffer(allocationSize);
if (data == nullptr) {
DVDClose(&fileInfo);
return nullptr;
}
const s32 status = DVDReadPrio(&fileInfo, data, readSize, 0, 2);
DVDClose(&fileInfo);
if (status < DVD_RESULT_GOOD || static_cast<u32>(status) != logicalSize) {
free_overlay_buffer(data);
return nullptr;
}
mArcOverlayResources.emplace(data, ArcOverlayResource{
.entryIndex = entry->index,
.size = logicalSize,
.generation = generation,
});
mActiveArcOverlayResources[entry->index] = data;
if (outSize != nullptr) {
*outSize = logicalSize;
}
return data;
}
bool JKRArchive::copyOverlayData(void* buffer, u32 bufferSize, SDIFileEntry* entry, u32* outSize) {
u32 overlaySize;
const void* overlayData = getOverlayData(entry, &overlaySize);
if (overlayData == nullptr) {
return false;
}
const u32 copySize = overlaySize < bufferSize ? overlaySize : bufferSize;
if (copySize != 0) {
memcpy(buffer, overlayData, copySize);
}
if (outSize != nullptr) {
*outSize = copySize;
}
return true;
}
bool JKRArchive::getOverlayResourceSize(const void* data, u32* outSize) const {
const auto resourceIt = mArcOverlayResources.find(const_cast<void*>(data));
if (resourceIt == mArcOverlayResources.end()) {
return false;
}
if (outSize != nullptr) {
*outSize = resourceIt->second.size;
}
return true;
}
bool JKRArchive::getOverlayFileSize(SDIFileEntry* entry, u32* outSize) const {
if (entry == nullptr) {
return false;
}
u32 activeSize;
if (getActiveOverlayData(entry, &activeSize) != nullptr) {
if (outSize != nullptr) {
*outSize = activeSize;
}
return true;
}
std::string path;
if (!getOverlayPath(entry, path)) {
return false;
}
DVDFileInfo fileInfo{};
if (!DVDOpen(path.c_str(), &fileInfo)) {
return false;
}
if (outSize != nullptr) {
*outSize = fileInfo.length;
}
DVDClose(&fileInfo);
return true;
}
u32 JKRArchive::getFileSize(SDIFileEntry* entry) const {
u32 size;
if (getOverlayFileSize(entry, &size)) {
return size;
}
return entry != nullptr ? entry->getSize() : 0;
}
bool JKRArchive::removeOverlayResource(void* resource, bool freeResource) {
const auto resourceIt = mArcOverlayResources.find(resource);
if (resourceIt == mArcOverlayResources.end()) {
return false;
}
const auto activeIt = mActiveArcOverlayResources.find(resourceIt->second.entryIndex);
if (activeIt != mActiveArcOverlayResources.end() && activeIt->second == resource) {
mActiveArcOverlayResources.erase(activeIt);
}
if (freeResource) {
free_overlay_buffer(resource);
}
mArcOverlayResources.erase(resourceIt);
return true;
}
void JKRArchive::removeAllOverlayResources() {
mActiveArcOverlayResources.clear();
for (const auto& key : mArcOverlayResources | std::views::keys) {
free_overlay_buffer(key);
}
mArcOverlayResources.clear();
}
#endif #endif
@@ -246,6 +246,7 @@ u32 JKRArchive::readResource(void* buffer, u32 bufferSize, u16 id) {
void JKRArchive::removeResourceAll() { void JKRArchive::removeResourceAll() {
if (mArcInfoBlock && mMountMode != MOUNT_MEM) { if (mArcInfoBlock && mMountMode != MOUNT_MEM) {
IF_DUSK(removeAllOverlayResources();)
SDIFileEntry* fileEntry = mFiles; SDIFileEntry* fileEntry = mFiles;
for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) { for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) {
if (JKAR_DATA(fileEntry)) { if (JKAR_DATA(fileEntry)) {
@@ -259,6 +260,13 @@ void JKRArchive::removeResourceAll() {
bool JKRArchive::removeResource(void* resource) { bool JKRArchive::removeResource(void* resource) {
JUT_ASSERT(678, resource != NULL); JUT_ASSERT(678, resource != NULL);
#if TARGET_PC
if (removeOverlayResource(resource, true)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return false; return false;
@@ -270,6 +278,13 @@ bool JKRArchive::removeResource(void* resource) {
bool JKRArchive::detachResource(void* resource) { bool JKRArchive::detachResource(void* resource) {
JUT_ASSERT(707, resource != NULL); JUT_ASSERT(707, resource != NULL);
#if TARGET_PC
if (removeOverlayResource(resource, false)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return false; return false;
@@ -280,6 +295,13 @@ bool JKRArchive::detachResource(void* resource) {
u32 JKRArchive::getResSize(const void* resource) const { u32 JKRArchive::getResSize(const void* resource) const {
JUT_ASSERT(732, resource != NULL); JUT_ASSERT(732, resource != NULL);
#if TARGET_PC
if (u32 size; getOverlayResourceSize(resource, &size)) {
return size;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return -1; return -1;
@@ -226,6 +226,13 @@ bool JKRCompArchive::open(s32 entryNum) {
void* JKRCompArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) { void* JKRCompArchive::fetchResource(SDIFileEntry *fileEntry, u32 *pSize) {
JUT_ASSERT(597, isMounted()); JUT_ASSERT(597, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(fileEntry, pSize); data != nullptr) {
return data;
}
#endif
u32 ptrSize; u32 ptrSize;
u32 size = fileEntry->data_size; u32 size = fileEntry->data_size;
int compression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 0x18)); int compression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 0x18));
@@ -274,6 +281,13 @@ void *JKRCompArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry
{ {
u32 size = 0; u32 size = 0;
JUT_ASSERT(708, isMounted()); JUT_ASSERT(708, isMounted());
#if TARGET_PC
if (copyOverlayData(data, compressedSize, fileEntry, pSize)) {
return data;
}
#endif
u32 fileSize = fileEntry->data_size; u32 fileSize = fileEntry->data_size;
u32 alignedSize = ALIGN_NEXT(fileSize, 32); u32 alignedSize = ALIGN_NEXT(fileSize, 32);
u32 fileFlag = fileEntry->type_flags_and_name_offset >> 0x18; u32 fileFlag = fileEntry->type_flags_and_name_offset >> 0x18;
@@ -319,6 +333,7 @@ void *JKRCompArchive::fetchResource(void *data, u32 compressedSize, SDIFileEntry
void JKRCompArchive::removeResourceAll() { void JKRCompArchive::removeResourceAll() {
if (mArcInfoBlock != NULL && mMountMode != MOUNT_MEM) { if (mArcInfoBlock != NULL && mMountMode != MOUNT_MEM) {
IF_DUSK(removeAllOverlayResources();)
SDIFileEntry* fileEntry = mFiles; SDIFileEntry* fileEntry = mFiles;
for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) { for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) {
int tmp = fileEntry->type_flags_and_name_offset >> 0x18; int tmp = fileEntry->type_flags_and_name_offset >> 0x18;
@@ -336,6 +351,12 @@ void JKRCompArchive::removeResourceAll() {
} }
bool JKRCompArchive::removeResource(void* resource) { bool JKRCompArchive::removeResource(void* resource) {
#if TARGET_PC
if (removeOverlayResource(resource, true)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (!fileEntry) if (!fileEntry)
return false; return false;
@@ -356,6 +377,12 @@ u32 JKRCompArchive::getExpandedResSize(const void *resource) const
return getResSize(resource); return getResSize(resource);
} }
#if TARGET_PC
if (u32 size; getOverlayResourceSize(resource, &size)) {
return size;
}
#endif
SDIFileEntry *fileEntry = findPtrResource(resource); SDIFileEntry *fileEntry = findPtrResource(resource);
if(!fileEntry) { if(!fileEntry) {
return 0xffffffff; return 0xffffffff;
@@ -147,6 +147,13 @@ cleanup:
void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) { void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) {
JUT_ASSERT(428, isMounted()); JUT_ASSERT(428, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(fileEntry, returnSize); data != nullptr) {
return data;
}
#endif
u32 tempReturnSize; u32 tempReturnSize;
if (returnSize == NULL) { if (returnSize == NULL) {
returnSize = &tempReturnSize; returnSize = &tempReturnSize;
@@ -181,6 +188,13 @@ void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) {
void* JKRDvdArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry, void* JKRDvdArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry,
u32* returnSize) { u32* returnSize) {
JUT_ASSERT(504, isMounted()); JUT_ASSERT(504, isMounted());
#if TARGET_PC
if (copyOverlayData(buffer, bufferSize, fileEntry, returnSize)) {
return buffer;
}
#endif
u32 size = fileEntry->data_size; u32 size = fileEntry->data_size;
JKRCompression fileCompression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 24)); JKRCompression fileCompression = JKRConvertAttrToCompressionType(u8(fileEntry->type_flags_and_name_offset >> 24));
@@ -344,6 +358,12 @@ u32 JKRDvdArchive::getExpandedResSize(const void* resource) const {
return getResSize(resource); return getResSize(resource);
} }
#if TARGET_PC
if (u32 size; getOverlayResourceSize(resource, &size)) {
return size;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (!fileEntry) { if (!fileEntry) {
return -1; return -1;
@@ -135,6 +135,13 @@ bool JKRMemArchive::open(void* buffer, u32 bufferSize, JKRMemBreakFlag flag) {
void* JKRMemArchive::fetchResource(SDIFileEntry* fileEntry, u32* resourceSize) { void* JKRMemArchive::fetchResource(SDIFileEntry* fileEntry, u32* resourceSize) {
JUT_ASSERT(555, isMounted()); JUT_ASSERT(555, isMounted());
#if TARGET_PC
if (void* data = getOverlayData(fileEntry, resourceSize); data != nullptr) {
return data;
}
#endif
if (!JKAR_DATA(fileEntry)) { if (!JKAR_DATA(fileEntry)) {
JKAR_DATA(fileEntry) = mArchiveData + fileEntry->data_offset; JKAR_DATA(fileEntry) = mArchiveData + fileEntry->data_offset;
} }
@@ -149,6 +156,13 @@ void* JKRMemArchive::fetchResource(SDIFileEntry* fileEntry, u32* resourceSize) {
void* JKRMemArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry, void* JKRMemArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry,
u32* resourceSize) { u32* resourceSize) {
JUT_ASSERT(595, isMounted()); JUT_ASSERT(595, isMounted());
#if TARGET_PC
if (copyOverlayData(buffer, bufferSize, fileEntry, resourceSize)) {
return buffer;
}
#endif
u32 srcLength = fileEntry->data_size; u32 srcLength = fileEntry->data_size;
if (srcLength > bufferSize) { if (srcLength > bufferSize) {
srcLength = bufferSize; srcLength = bufferSize;
@@ -173,6 +187,8 @@ void* JKRMemArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* f
void JKRMemArchive::removeResourceAll(void) { void JKRMemArchive::removeResourceAll(void) {
JUT_ASSERT(642, isMounted()); JUT_ASSERT(642, isMounted());
IF_DUSK(removeAllOverlayResources();)
if (mArcInfoBlock == NULL) if (mArcInfoBlock == NULL)
return; return;
if (mMountMode == MOUNT_MEM) if (mMountMode == MOUNT_MEM)
@@ -192,6 +208,12 @@ void JKRMemArchive::removeResourceAll(void) {
bool JKRMemArchive::removeResource(void* resource) { bool JKRMemArchive::removeResource(void* resource) {
JUT_ASSERT(673, isMounted()); JUT_ASSERT(673, isMounted());
#if TARGET_PC
if (removeOverlayResource(resource, true)) {
return true;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (!fileEntry) if (!fileEntry)
return false; return false;
@@ -231,6 +253,12 @@ u32 JKRMemArchive::fetchResource_subroutine(u8* src, u32 srcLength, u8* dst, u32
} }
u32 JKRMemArchive::getExpandedResSize(const void* resource) const { u32 JKRMemArchive::getExpandedResSize(const void* resource) const {
#if TARGET_PC
if (u32 overlaySize; getOverlayResourceSize(resource, &overlaySize)) {
return overlaySize;
}
#endif
SDIFileEntry* fileEntry = findPtrResource(resource); SDIFileEntry* fileEntry = findPtrResource(resource);
if (fileEntry == NULL) if (fileEntry == NULL)
return -1; return -1;
+3 -3
View File
@@ -16,10 +16,10 @@ inline f64 getConst2() {
return 9.765625E-4; return 9.765625E-4;
} }
DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_ ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TSinCosTable<13, f32> sincosTable_;
DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_ ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TAtanTable<1024, f32> atanTable_;
DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_ ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA TAsinAcosTable<1024, f32> asinAcosTable_;
} // namespace JMath } // namespace JMath
+53 -3
View File
@@ -7,6 +7,10 @@
#include "JSystem/JMessage/control.h" #include "JSystem/JMessage/control.h"
#if TARGET_PC
#include "dusk/mods/svc/flow.hpp"
#endif
JMessage::TControl::TControl() JMessage::TControl::TControl()
: pSequenceProcessor_(NULL), : pSequenceProcessor_(NULL),
pRenderingProcessor_(NULL), pRenderingProcessor_(NULL),
@@ -19,9 +23,16 @@ JMessage::TControl::TControl()
pMessageText_current_(NULL) pMessageText_current_(NULL)
{} {}
JMessage::TControl::~TControl() {} JMessage::TControl::~TControl() {
#if TARGET_PC
dusk::flow::release_message_control(this);
#endif
}
void JMessage::TControl::reset() { void JMessage::TControl::reset() {
#if TARGET_PC
dusk::flow::release_message_control(this);
#endif
pEntry_ = NULL; pEntry_ = NULL;
pMessageText_begin_ = NULL; pMessageText_begin_ = NULL;
pszText_update_current_ = NULL; pszText_update_current_ = NULL;
@@ -78,18 +89,57 @@ int JMessage::TControl::setMessageID(u32 uMsgID, u32 param_1, bool* pbValid) {
} }
bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* pProcessor, u16 u16GroupID, u16 u16Index) { bool JMessage::TControl::setMessageCode_inSequence_(JMessage::TProcessor const* pProcessor, u16 u16GroupID, u16 u16Index) {
#if TARGET_PC
const TResource* resource = NULL;
const void* resolvedEntry = NULL;
const char* resolvedText = NULL;
if (u16Index >= dusk::flow::kCustomMessageMin) {
if (!dusk::flow::custom_message_for_processor(
this, pProcessor, u16Index, resource, resolvedEntry, resolvedText))
{
return false;
}
const_cast<TProcessor*>(pProcessor)->setResourceCache(const_cast<TResource*>(resource));
} else {
resource = pProcessor->getResource_groupID(u16GroupID);
if (resource == NULL) {
return false;
}
const void* nativeEntry = resource->getMessageEntry_messageIndex(u16Index);
const char* nativeText =
nativeEntry != NULL ? resource->getMessageText_messageEntry(nativeEntry) : NULL;
resolvedEntry = nativeEntry;
resolvedText = nativeText;
dusk::flow::resolve_message_for_control(this, resource->oParse_THeader_.getRaw(), u16Index,
nativeEntry, nativeText, resolvedEntry, resolvedText);
}
pEntry_ = const_cast<void*>(resolvedEntry);
if (pEntry_ == NULL || resolvedText == NULL) {
return false;
}
#else
pEntry_ = pProcessor->getMessageEntry_messageCode(u16GroupID, u16Index); pEntry_ = pProcessor->getMessageEntry_messageCode(u16GroupID, u16Index);
if (pEntry_ == NULL) { if (pEntry_ == NULL) {
return false; return false;
} }
#endif
#if TARGET_PC
uMessageGroupID_ = resource->getGroupID();
pResourceCache_ = resource;
#else
uMessageGroupID_ = u16GroupID; uMessageGroupID_ = u16GroupID;
uMessageID_ = u16Index;
pResourceCache_ = pProcessor->getResourceCache(); pResourceCache_ = pProcessor->getResourceCache();
#endif
uMessageID_ = u16Index;
JUT_ASSERT(155, pResourceCache_!=NULL); JUT_ASSERT(155, pResourceCache_!=NULL);
#if TARGET_PC
pMessageText_begin_ = resolvedText;
#else
pMessageText_begin_ = pResourceCache_->getMessageText_messageEntry(pEntry_); pMessageText_begin_ = pResourceCache_->getMessageText_messageEntry(pEntry_);
#endif
pMessageText_current_ = pMessageText_begin_; pMessageText_current_ = pMessageText_begin_;
oStack_renderingProcessor_.clear(); oStack_renderingProcessor_.clear();
return true; return true;
+89 -1
View File
@@ -5,15 +5,26 @@
#include "JSystem/JUtility/JUTAssert.h" #include "JSystem/JUtility/JUTAssert.h"
#include <cstdint> #include <cstdint>
#if TARGET_PC
#include "dusk/mods/svc/flow.hpp"
#endif
JMessage::TReference::~TReference() {} JMessage::TReference::~TReference() {}
const char* JMessage::TReference::do_word(u32 param_0) const { const char* JMessage::TReference::do_word(u32 param_0) const {
return NULL; return NULL;
} }
JMessage::TProcessor::~TProcessor() {} JMessage::TProcessor::~TProcessor() {
#if TARGET_PC
dusk::flow::release_message_processor(this);
#endif
}
void JMessage::TProcessor::reset() { void JMessage::TProcessor::reset() {
#if TARGET_PC
dusk::flow::release_message_processor(this);
#endif
on_resetStatus_(NULL); on_resetStatus_(NULL);
do_reset(); do_reset();
} }
@@ -44,6 +55,15 @@ const JMessage::TResource* JMessage::TProcessor::getResource_groupID(u16 u16Grou
} }
u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool* pbValid) const { u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool* pbValid) const {
#if TARGET_PC
u32 customCode = 0;
if (dusk::flow::message_code_for_id(this, uMsgID, customCode)) {
if (pbValid != NULL) {
*pbValid = true;
}
return customCode;
}
#endif
const TResource* pResourceCache = (const TResource*)getResourceCache(); const TResource* pResourceCache = (const TResource*)getResourceCache();
if (pResourceCache != NULL) { if (pResourceCache != NULL) {
u16 u16Index = pResourceCache->toMessageIndex_messageID(uMsgID, param_1, pbValid); u16 u16Index = pResourceCache->toMessageIndex_messageID(uMsgID, param_1, pbValid);
@@ -73,6 +93,74 @@ u32 JMessage::TProcessor::toMessageCode_messageID(u32 uMsgID, u32 param_1, bool*
return 0xFFFFFFFF; return 0xFFFFFFFF;
} }
#if TARGET_PC
void* JMessage::TProcessor::getMessageEntry_messageCode(u16 groupId, u16 index) const {
if (index >= dusk::flow::kCustomMessageMin) {
const TResource* customResource = NULL;
const void* customEntry = NULL;
const char* customText = NULL;
if (!dusk::flow::custom_message_for_processor(
NULL, this, index, customResource, customEntry, customText))
{
return NULL;
}
const_cast<TProcessor*>(this)->setResourceCache(const_cast<TResource*>(customResource));
return const_cast<void*>(customEntry);
}
const TResource* resource = getResource_groupID(groupId);
if (resource == NULL) {
return NULL;
}
void* nativeEntry = resource->getMessageEntry_messageIndex(index);
const char* nativeText =
nativeEntry != NULL ? resource->getMessageText_messageEntry(nativeEntry) : NULL;
const void* resolvedEntry = nativeEntry;
const char* resolvedText = nativeText;
dusk::flow::resolve_message(this, resource->oParse_THeader_.getRaw(), index, nativeEntry,
nativeText, resolvedEntry, resolvedText);
return const_cast<void*>(resolvedEntry);
}
const char* JMessage::TProcessor::getMessageText_messageCode(u16 groupId, u16 index) const {
if (index >= dusk::flow::kCustomMessageMin) {
const TResource* customResource = NULL;
const void* customEntry = NULL;
const char* customText = NULL;
if (!dusk::flow::custom_message_for_processor(
NULL, this, index, customResource, customEntry, customText))
{
return NULL;
}
const_cast<TProcessor*>(this)->setResourceCache(const_cast<TResource*>(customResource));
return customText;
}
const TResource* resource = getResource_groupID(groupId);
if (resource == NULL) {
return NULL;
}
const void* nativeEntry = resource->getMessageEntry_messageIndex(index);
const char* nativeText =
nativeEntry != NULL ? resource->getMessageText_messageEntry(nativeEntry) : NULL;
const void* resolvedEntry = nativeEntry;
const char* resolvedText = nativeText;
dusk::flow::resolve_message(this, resource->oParse_THeader_.getRaw(), index, nativeEntry,
nativeText, resolvedEntry, resolvedText);
return resolvedText;
}
const char* JMessage::TProcessor::on_message_limited(u16 index) const {
JUT_ASSERT(482, pResourceCache_!=NULL);
const void* nativeEntry = pResourceCache_->getMessageEntry_messageIndex(index);
const char* nativeText =
nativeEntry != NULL ? pResourceCache_->getMessageText_messageEntry(nativeEntry) : NULL;
const void* resolvedEntry = nativeEntry;
const char* resolvedText = nativeText;
dusk::flow::resolve_message(this, pResourceCache_->oParse_THeader_.getRaw(), index,
nativeEntry, nativeText, resolvedEntry, resolvedText);
return resolvedText;
}
#endif
void JMessage::TProcessor::on_select_begin(char const* (*pfn)(JMessage::TProcessor*), void JMessage::TProcessor::on_select_begin(char const* (*pfn)(JMessage::TProcessor*),
void const* pOffset, char const* pcBase, u32 uNumber) { void const* pOffset, char const* pcBase, u32 uNumber) {
JUT_ASSERT(191, uNumber>0); JUT_ASSERT(191, uNumber>0);
+2 -2
View File
@@ -46,7 +46,7 @@ JPAResource::JPAResource() {
mUsrIdx = fldNum = keyNum = texNum = mpCalcEmitterFuncListNum = mpDrawEmitterFuncListNum = mpDrawEmitterChildFuncListNum = mpCalcParticleFuncListNum = mpDrawParticleFuncListNum = mpCalcParticleChildFuncListNum = mpDrawParticleChildFuncListNum = 0; mUsrIdx = fldNum = keyNum = texNum = mpCalcEmitterFuncListNum = mpDrawEmitterFuncListNum = mpDrawEmitterChildFuncListNum = mpCalcParticleFuncListNum = mpDrawParticleFuncListNum = mpCalcParticleChildFuncListNum = mpDrawParticleChildFuncListNum = 0;
} }
static u8 jpa_pos[324] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) static u8 jpa_pos[324] = {
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 @@ static u8 jpa_pos[324] ATTRIBUTE_ALIGN(32) = {
0x00, 0x00, 0x00, 0xCE, 0x00, 0x00, 0x00, 0xCE,
}; };
static u8 jpa_crd[32] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) static u8 jpa_crd[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"
DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) DUSK_GAME_DATA u8 const JUTResFONT_Ascfont_fix12[] = {
0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04, 0x46, 0x4F, 0x4E, 0x54, 0x62, 0x66, 0x6E, 0x31, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x49, 0x4E, 0x46, 0x31, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C,
+1 -1
View File
@@ -71,7 +71,7 @@ void JUTResFont::initJoinedTexture() {
int pageCount = 0; int pageCount = 0;
u32 pageNumCells = block.numRows * block.numColumns; u32 pageNumCells = block.numRows * block.numColumns;
if (dusk::version::getGameVersion() == dusk::version::GameVersion::GcnJpn) { if (dusk::version::isRegionJpn()) {
pageCount = 1; pageCount = 1;
if (pageNumCells > 0 && block.endCode > block.startCode) { if (pageNumCells > 0 && block.endCode > block.startCode) {
pageCount = (block.endCode - block.startCode + pageNumCells - 1) / pageNumCells; pageCount = (block.endCode - block.startCode + pageNumCells - 1) / pageNumCells;
+7 -2
View File
@@ -42,7 +42,7 @@ JUTVideo::JUTVideo(GXRenderModeObj const* param_0) {
mRetraceCount = VIGetRetraceCount(); mRetraceCount = VIGetRetraceCount();
field_0x10 = 1; field_0x10 = 1;
field_0x18 = 0; field_0x18 = 0;
sVideoLastTick = OSGetTick(); sVideoLastTick = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick());
sVideoInterval = 670000; sVideoInterval = 670000;
mPreRetraceCallback = VISetPreRetraceCallback(preRetraceProc); mPreRetraceCallback = VISetPreRetraceCallback(preRetraceProc);
mPostRetraceCallback = VISetPostRetraceCallback(postRetraceProc); mPostRetraceCallback = VISetPostRetraceCallback(postRetraceProc);
@@ -68,8 +68,13 @@ void JUTVideo::preRetraceProc(u32 retrace_count) {
(*sManager->mPreCallback)(retrace_count); (*sManager->mPreCallback)(retrace_count);
} }
OSTick tick = OSGetTick(); OSTick tick = DUSK_IF_ELSE(static_cast<OSTick>(OSGetNativeTime()), OSGetTick());
sVideoInterval = tick - sVideoLastTick; sVideoInterval = tick - sVideoLastTick;
#if TARGET_PC
if (sVideoInterval <= 0) {
sVideoInterval = 1;
}
#endif
sVideoLastTick = tick; sVideoLastTick = tick;
JUTXfb* xfb = JUTXfb::getManager(); JUTXfb* xfb = JUTXfb::getManager();
@@ -136,7 +136,7 @@ void TRK__read_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
} }
void TRK__write_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) { void TRK__write_aram(__REGISTER int c, __REGISTER u32 p2, void* p3) {
u8 buff[32] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) u8 buff[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) {
u8 buf[0x820] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) u8 buf[0x820];
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) {
u8 buf[0x820] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) u8 buf[0x820];
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"
static s32 __AXBufferAuxA[3][480] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static s32 __AXBufferAuxA[3][480];
static s32 __AXBufferAuxB[3][480] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static s32 __AXBufferAuxB[3][480];
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"
static AXSPB __AXStudio ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static AXSPB __AXStudio;
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
}; };
static AXPB __AXPB[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static AXPB __AXPB[AX_MAX_VOICES];
static AXPBITDBUFFER __AXITD[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static AXPBITDBUFFER __AXITD[AX_MAX_VOICES];
static AXPBU __AXUpdates[AX_MAX_VOICES] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static AXPBU __AXUpdates[AX_MAX_VOICES];
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);
u16 axDspSlave[AX_DSP_SLAVE_LENGTH] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) u16 axDspSlave[AX_DSP_SLAVE_LENGTH] = {
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"
static u8 CardData[352] ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) = { ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static u8 CardData[352] = {
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"
static s16 __AVX_internal_buffer[3200] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static s16 __AVX_internal_buffer[3200];
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>
u32 DEMOFontBitmap[768] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) u32 DEMOFontBitmap[768] = {
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
+1 -1
View File
@@ -43,7 +43,7 @@ void* __piReg;
GXBool __GXinBegin; GXBool __GXinBegin;
#endif #endif
static u16 DefaultTexData[] ATTRIBUTE_ALIGN(32) = { ATTRIBUTE_ALIGN(32) static u16 DefaultTexData[] = {
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
static MCC_ChannelInfo gChannelInfo[16] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static MCC_ChannelInfo gChannelInfo[16];
static char gStreamWork[32] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static char gStreamWork[32];
static char m_szAdapterMode[32] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static char m_szAdapterMode[32];
static char m_szInitCode[32] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static char m_szInitCode[32];
static MCC_Info channelInfo[16] ATTRIBUTE_ALIGN(32); ATTRIBUTE_ALIGN(32) static MCC_Info channelInfo[16];
volatile static BOOL gIsChannelinfoDirty = TRUE; volatile static BOOL gIsChannelinfoDirty = TRUE;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "__os.h" #include "__os.h"
static SramControl Scb ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT); ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static SramControl Scb;
// 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"
static u8 CardData[352] ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) = { ATTRIBUTE_ALIGN(DOLPHIN_ALIGNMENT) static u8 CardData[352] = {
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,

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