Compare commits

...

617 Commits

Author SHA1 Message Date
Pepe20129 08ad16e750
Add path XML parser (#4115)
* Add path XML parser

* Update SetPathwaysFactory.cpp
2024-05-10 00:17:50 -05:00
Ted Newman 844413b391
Add Modifier buttons to input viewer and support individual button outline modes (#3966)
* Add Modifier buttons to input viewer and support individual button outline modes

* Clearer naming

* Remove hardcoded indent values

* clean up diff

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-05-09 23:57:31 -04:00
Eric Hoey 65b18d61cf
Fix modifiers crash when obtaining underwater item (#4110)
* NULL check

* Update soh/src/overlays/actors/ovl_player_actor/z_player.c

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* Update soh/src/overlays/actors/ovl_player_actor/z_player.c

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-05-09 22:02:50 -05:00
Eric Hoey 63bc2aff59
Frogs Ocarina Game Difficulty Options (#3373)
* Frog actor edits, menu, presets

* Block off vanilla code + comments

* fix logic + formatting

* new documentation format

* Update for CVAR changes

* Fix alignment

* Conditions cleanup

* Update soh/soh/SohMenuBar.cpp

Oops, added

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>

---------

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
2024-05-09 20:55:53 -05:00
briaguya 23f9654940
update `BUILDING.md` (#4128) 2024-05-09 20:49:32 -05:00
briaguya 5530ce2e61
simplify ci (#4129) 2024-05-09 20:45:21 -05:00
Archez 47b690fb1e
Bump LUS and restore guMtx in collision viewer (#4137) 2024-05-09 01:26:58 -04:00
Lywx 1231b8f9fa
Fixed macos/ios errors (#4138) 2024-05-08 19:30:22 -04:00
briaguya 22c9d53985
bump lus (gfx debugger fix, stormlib optimizations) (#4135) 2024-05-08 11:23:43 -04:00
Kenix3 3c87c1ec98
Lus window bump (#4131) 2024-05-08 02:25:50 -04:00
briaguya 0976198f2c
get soh working with latest lus (#4132) 2024-05-08 00:13:47 -04:00
briaguya 52fad95a2c
support lus thread_pool changes (#4127) 2024-05-06 22:08:11 -04:00
Malkierian 8d3902a256
Remove unnecessary and redundant checks and references. (#4111)
Stop passing checksByArea to functions in the same namespace.
Only get value of `HideFilteredAreas` once per frame.
Gate area and check evaluations behind checks being visible and search filter size greater than 0.
Proper function capitalization.
2024-05-06 19:27:35 -05:00
Malkierian b3d51441eb
Rando Enhancement: Mysterious Shuffled Items (#3227)
* Add rando enhancement "Mysterious Shuffled Items", which obfuscates shuffled freestanding/drawn-in-world items (PoH, tokens, shop items) with a custom question mark model (thanks Hato), and uses the "mysterious item" functionality of `GetMerchantMessage` for everything that supports it, regardless of hint status on generation.

* Reverted back to rando enhancement, but added condition for Mysterious Shuffle not being on for the gem rotation fix to apply.

* First attempt at changing to fake GetItemEntry instead of directly calling the mystery draw function. Needs more work.

* Updated CVar to reflect CVar rework values.

Added `IsCheckShuffled` as preliminary function for checking *only* if a check is shuffled, not necessarily if it is just visible on the tracker. This accounts for the difference between tokensanity and "Always Show GS On Tracker", where you don't want to obfuscate the latter.

* Bit of cleanup.

* Cross-platform building edits. If anyone has a better idea of how to handle this fake GIE, I'm all ears.

* Update to CVar macros.

* Fix freestanding item gives.
Fix mysterious item model colors.

* Fix bombchu bowling mystery.

* Remove bowling bomchus check obfuscation (unused, removed in v3).
2024-05-06 19:17:08 -05:00
Lywx f3b948226b
Bump lus and fixed PatchGfx (#4125)
* Bump lus and fixed PatchGfx

* Bump libultraship to main
2024-05-06 19:19:15 -04:00
Malkierian 438dede792
Change "AnubixFix" back to "AnubisFix". (#4124) 2024-05-06 17:10:06 -05:00
Eric Hoey 27dd303a57
Limit crawl speed to modifier to 4 (#4113) 2024-05-06 19:10:22 +00:00
Archez a860a7ea39
Merge pull request #4122 from Archez/merge-macready-may6
Merge macready -> develop
2024-05-06 14:51:24 -04:00
Adam Bird 439574d0d9 Merge remote-tracking branch 'origin/develop' into merge-macready-may6 2024-05-06 12:22:48 -04:00
Malkierian 6443a986d9
Final Step of CVar macro/sectionalizing (#4107)
* p

* Missed the prefix renames.

* More missed ones.

* Mostly finished cleanup.
Removed a few CVars and some related functionality.

* Bit more (prepping non-existent title card color editing).

* Resolve gCrowdControl.

* Final cleanup.

* Universal constant, not acceleration...

* Preset CVars.
2024-05-05 14:14:55 -05:00
briaguya b6fc54ad8b
support lus `dr_libs` removal (#4108) 2024-05-03 12:55:38 -04:00
briaguya e02e4ead02
support lus fetching stb (#4105) 2024-05-03 11:07:07 -04:00
briaguya 725670d998
support lus strhash64 change (#4102) 2024-05-02 14:43:52 -04:00
briaguya bcf5a0c307
support lus factories no longer being registered in `RegisterGlobalResourceFactories` (#4099) 2024-05-02 00:14:36 -04:00
briaguya 345cef9b78
detangle zapdutils (#4096) 2024-05-01 22:47:40 -04:00
Archez fd9cd9c5eb
Fix: add workaround for boost versions >=1.84.0 (#4098) 2024-05-01 16:41:17 -04:00
Malkierian 715bf39d43
Incorporate LUS CMake CVar system (#4093)
* Incorporate LUS CMake CVar system.
Customize all LUS CMake CVars to align with plans for preset system.
Swap "gOverlayFont" usage back to LUS CVar macro.

* Change CMake sets to use the cache to allow for including LUS's file for the add_compile_defines and remove the duplication on SoH's side.

* Move SoH CMake CVars to `soh-cvars.cmake` for clarity.
2024-05-01 14:48:51 -04:00
briaguya 56fe449689
fetchcontent stormlib (#4095) 2024-05-01 12:53:33 -04:00
briaguya 8480f37f77
fetch imgui (#4094) 2024-04-30 22:49:54 -04:00
briaguya c70e6d280a
spdlog from package managers (#4088) 2024-04-30 18:50:06 -04:00
briaguya 4ecb76b117
tinyxml from package manager (#4073) 2024-04-30 01:19:02 -04:00
briaguya 8b3f1f1868
bump LUS, remove switch and wii u from CI (#4087) 2024-04-29 20:26:03 -04:00
briaguya 552bb2886f
support lus renamespacing (#4075) 2024-04-28 21:36:44 -04:00
Pepe20129 92467b87b5
Add scene command XML parsers (#4054)
* Add scene command parsers

* Move logging & add logging cvar

* Use new CVAR_DEVELOPER_TOOLS macro

* Update soh/soh/resource/logging/SceneCommandLoggers.h

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-04-28 20:58:12 -04:00
Malkierian 303fe7d906
Swap all cosmetics CVars to macros. (#4065)
Lots of renames.

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-04-26 02:41:55 +00:00
Malkierian 56d8dd6d8b
All MenuBar enhancement CVars done. (#4064) 2024-04-26 00:31:28 +00:00
briaguya a4fb67745a
nlohmann from package managers (#4071) 2024-04-25 13:55:16 -04:00
briaguya 3070fb4746
support lus gameoverlay changes (and bump LUS) (#4067) 2024-04-22 22:57:33 -04:00
briaguya 49f891f2e5
move `RawJson` to LUS (#4063) 2024-04-21 21:16:59 -04:00
Malkierian 33aef87907
CVar Macro Cleanup (#4062)
* Standardized CVar macros to have `CVAR_` at the front instead of the end.
Removed excluded and replaced sequence macros.

* Missed a few developer CVars outside of `SohMenuBar.cpp`

* 1 more.
2024-04-21 10:25:06 -05:00
Malkierian e2622af004
Step 3 of CVar macro/sectionalizing: Dev Tools, Cheats, Audio Editor, Remote (#4030)
* Swapped Audio Editor CVars.

* Swapped Cheat CVars.

* Swapped Developer Tools CVars. Also a couple General CVars.

* Added REMOTE_CVAR.
Swapped Remote CVars.

* Missed an include.
2024-04-20 18:56:32 +00:00
Malkierian 694a876a70
Step 2 of CVar macro/sectionalizing: Trackers/Windows (#3238)
* Add all macros.

Replace all randomizer seed setting CVars with appropriate macro.

Cleaned up non-gameplay-critical things that are part of Spock Race rando presets (like RTA timing, displaying timer, displaying the glitch lineup tick, or Fast File Select).

* Wrong slash...

* Fix DEVELOPER_CVAR macro.
Add GENERAL_CVAR macro.

* Change Item Tracker CVars, including open window CVar.

* Swapped open window CVars.

* Swapped Entrance Tracker CVars.

* Swapped Check Tracker CVars.
Changed Item Tracker "HudEditMode" to "Draggable".

* Renamed `RANDOMIZER_CVAR` to `RANDO_ENHANCEMENT_CVAR`.
Swapped rando enhancement CVars.

* Mirroring last commit from part 1 in randomizer.cpp

* Another mirror from pt 1
2024-04-20 18:34:02 +00:00
Ted Newman 16bf03a9bd
Add console commands for randomizing sfx and cosmetic groups (#3962)
* Add console commands for randomizing sfx and cosmetic groups

* Update naming and use constexpr

* Update soh/soh/Enhancements/debugconsole.cpp

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-04-20 12:33:59 -04:00
briaguya 2accfc3c9b
ci: bump macports version (#4039) 2024-04-20 11:31:05 -04:00
Archez e6798d9861
bump lus and create fb call (#4060) 2024-04-20 11:04:11 -04:00
Archez 067782fa91
clean up cmake configure files (#4002) 2024-04-20 11:03:41 -04:00
inspectredc d08d5a54c9
Fix Pause Warp Enhancement (#4036) 2024-04-20 11:01:16 -04:00
inspectredc 4a576f45ee
Fix and Clean Up Swap Age Logic (#4061)
* Split and clean up swap age logic

* reorganise conditions into one statement
2024-04-20 10:43:35 -04:00
Malkierian b045689df1
Step 1 of CVar macro/sectionalizing: Randomizer Settings (#3206)
* Add all macros.

Replace all randomizer seed setting CVars with appropriate macro.

Cleaned up non-gameplay-critical things that are part of Spock Race rando presets (like RTA timing, displaying timer, displaying the glitch lineup tick, or Fast File Select).

* Wrong slash...

* Forgot "gManualSeedEntry".

* Renamed CVars from "Mq..." to "MQ...".
2024-04-20 09:29:19 -05:00
Jamie Klassen 2aa2092c27
filter randomizer checks in tracker (#4021)
* filter randomizer checks in tracker

Co-authored-by: Michael Stergianis <michael.stergianis@gmail.com>

* Adds an option to hide empty areas

Co-authored-by: Jamie Klassen <jamie@tenkeylabs.com>
Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>

* Removes extra whitespace

Co-authored-by: Jamie Klassen <jamie@tenkeylabs.com>
Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>

* Changes gCheckTrackerHideFilteredAreas to default to true

Refactors the for loop in shouldHideArea

Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>

* Addresses PR feedback

* https://github.com/HarbourMasters/Shipwright/pull/4021#discussion_r1538377614
* https://github.com/HarbourMasters/Shipwright/pull/4021#discussion_r1538381310

Co-authored-by: Jamie Klassen <jamie@tenkeylabs.com>
Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>

* Updates config variable to gTrackers.CheckTracker.HideFilteredAreas

Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>

* Adds check visibility guard to shouldHideArea

Refactors rcObject to check in passesTextFilter

Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>

---------

Signed-off-by: Michael Stergianis <michael.stergianis@gmail.com>
Co-authored-by: Michael Stergianis <michael.stergianis@gmail.com>
2024-04-20 10:27:13 -04:00
briaguya 3e32d05173
macready -> dev 2024-04-19 11:27:05 -04:00
briaguya 2216b68111 fix: add include missed in merge conflict resolution 2024-04-19 11:06:52 -04:00
briaguya 9696f74b5c Merge branch 'develop-macready' into macready-to-dev 2024-04-19 09:57:29 -04:00
briaguya 32bf8cc53c
fix wii u ci (#4056) 2024-04-19 09:42:41 -04:00
Malkierian 02f7310c16
Add keyring to check for placing Gerudo Fortess Keys in Any Dungeon or Overworld. (#4055) 2024-04-19 09:42:26 -04:00
inspectredc bfe13906e9
Make equip swap work on pause any cursor (#4052) 2024-04-19 09:42:12 -04:00
Amaro Martínez 32288be744
Save in-game language setting (#4026) 2024-04-19 09:41:55 -04:00
Malkierian 19be6e9b99
Trackers MQ Cleanup (#4009)
* Clean up grayed out items in file select.
Tie personal notes saving to `OnExitGame()` to account for save scum resets.
Hide text input box (but not window) for personal notes when a save isn't loaded to prevent saving over a save's notes while in file select.

* Allow check tracker window to be visible and show the "Waiting for file load..." text in file select (ease of positioning).

* Fix key label text placement.

* Persist `areasSpoiled`, change trigger to `OnSceneTransition`.
Add `IsAreaSpoiled` for tie-in to Item Tracker.
Add `SetAreaSpoiled` to unify bitmagic.

* Add proper spoiling evaluation based on specific entrance IDs, or first check collection.
Add light yellow color for vanilla dungeon abbreviations to match the purple for MQ.

* Initialize `areasSpoiled` to 0, so 0 gets saved on file create.

* All new conditional statements around `GameInteractor::IsSaveLoaded()` were inverted. Fixed that.

* Change some c-style casts to `static_cast`.

* Few more cleanups, plus clarifying comment.
2024-04-19 09:41:46 -04:00
Archez 0b8cc71d0d
fix actor init flow with object loading (#3987) 2024-04-19 09:41:04 -04:00
inspectredc ced34ab68a
[Fix] Disable Lod Applies To Everything (Macready) (#4034)
* make lod cvar affect everything

* add to more functions

* re-add to player

* only add to necessary funcs
2024-04-15 12:00:04 -04:00
inspectredc e163d5bc3d
Fix switch puzzle locking issues (#4027) 2024-04-07 17:28:20 -04:00
briaguya 897d3efbd0
rip out unused types (#4041) 2024-04-07 17:02:57 -04:00
briaguya 168323ebc9
bump LUS (#4042) 2024-04-07 14:27:50 -04:00
Archez fd7dfd8b6f
Support for new ucode loading patterns (#4038) 2024-04-04 12:26:14 -04:00
Archez 86c6013888
Remove macports upgrading (#4035) 2024-04-04 11:23:18 -04:00
briaguya fb29c827ad
Update BUILDING.md (#4029) 2024-04-03 22:17:32 -04:00
briaguya 0f43d5de2d
bump lus (gfx refactor) (#4031) 2024-04-03 22:16:17 -04:00
Garrett Cox 8b3cfdb84f
Merge pull request #3986 from Archez/merge-macready-805
Merge MacReady 8.0.5 -> Develop
2024-03-06 04:12:02 +00:00
briaguya ef690e2ceb
support `LUS::Archive::LoadFileRaw` no longer being exposed (#3999) 2024-03-05 23:09:05 -05:00
briaguya 9fb2f26f1b
tts: use `RawJson` resource + add `SpeechLogger` (#3998)
* moved `tts.cpp` away from using `LoadFileRaw` by creating a new `RawJson` resource type
* added `SpeechLogger`
2024-03-05 22:21:15 -05:00
briaguya 402a4db593
Bump LUS (#3996) 2024-03-04 23:56:26 -05:00
briaguya 375349e4f7
Support font as resource LUS changes (#3993) 2024-03-04 23:36:23 -05:00
briaguya ebde648c59
`.o2r` support (#3955) 2024-03-02 20:51:32 -05:00
Adam Bird 7bd2a7c3a6 Merge remote-tracking branch 'origin/develop' into merge-macready-805 2024-02-28 23:49:06 -05:00
Garrett Cox 612da023f0
Bump version to MacReady Foxtrot 8.0.5 (#3982) 2024-02-28 22:46:55 -05:00
Malkierian 368a9015ac
Add Unix timestamp to renamed corrupted file to prevent trying to copy over existing file. (#3984) 2024-02-28 22:46:32 -05:00
Malkierian ed9cb1dfd2
Fix CVar evaluation for scummed checks being hidden. (#3985) 2024-02-28 22:45:16 -05:00
Archez fb6ea42560
prevent remember save location in dungeons/boss rooms (#3983) 2024-02-28 22:33:51 -05:00
Malkierian b26f2b21da
[UX Improvement] Catch save loading errors and notify user (#3979)
* Add `SohModalWindow` and `SohModal`. Runs as window, always "visible", but not drawing if no popups are registered.

Adds error catching for save file corruption (malformed json) that renames the file in question to prevent future loading issues and uses `SohModalWindow` to inform the user of the error.

* Apply suggestions from code review

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-02-28 21:12:23 -06:00
Archez 358dd47da7
remove zapd extraction from mac launch script (#3981) 2024-02-28 21:03:08 -06:00
Malkierian ea1ffdd041
Adds messageboxes to `no_ui` handling so they don't show if you have it on. (#3977) 2024-02-28 20:04:44 -06:00
briaguya bcbe4cb1c3
we crash if we try to SPDLOG in the destructors (#3951)
* we crash if we try to SPDLOG in the destructors

* rip em out

* newline

* add to destroy

* Revert "rip em out"

This reverts commit 738a9b80f3.

* Revert "we crash if we try to SPDLOG in the destructors"

This reverts commit 327d305e00.
2024-02-21 00:21:26 -05:00
Archez cd25f1d3c1
Fix performance of dlist viewer (#3961) 2024-02-21 00:20:25 -05:00
Archez cd5d2589f7
Merge pull request #3958 from HarbourMasters/develop-macready
macready -> develop
2024-02-20 10:32:28 -05:00
Archez ef9fc0a9ec
fix endianess issue with camera setting data (#3950) 2024-02-20 08:38:10 -06:00
Archez 19af4481c0
fix object unload using wrong index (#3949) 2024-02-20 08:31:24 -06:00
Archez d0b09743b9
Fix missing ImGui::EndDisabled (#3946) 2024-02-15 23:25:16 -05:00
Patrick12115 c484ea227b
[Difficulty Options] Leever Spawn Rate (#3460)
* Spawn Rate

* Update z_en_reeba.c

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* gEnhancements

* Merging issues

* Added preset entry and changed timer value math

* Update soh/src/overlays/actors/ovl_En_Reeba/z_en_reeba.c

* this should do it

* Update soh/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c

* move out of loop

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-15 22:12:09 -06:00
Patrick12115 4599212546
[Fixes] Fix Raised Floor Switches (#3851)
* Lower by 1

* gEnhancements.

* Update z_obj_switch.c

Co-authored-by: Archez <Archez@users.noreply.github.com>

* Moved to Hook

* Properly this time

* Added to presets

* Added a Return;

* Use Hex

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-15 22:02:58 -06:00
Garrett Cox a8d3724a53
Add missing cvars mostly that patrick forgot because he likes ranch dressing but also some that I missed oops (#3944) 2024-02-15 21:28:06 -06:00
Garrett Cox 10b6f8cf80
Merge pull request #3945 from HarbourMasters/develop-macready
macready -> develop
2024-02-15 21:21:18 -06:00
briaguya e0d502b696
resource refactory (#3926)
* animation

* playeranimation

* stop putting things in the LUS namespace from SoH

* get all the factories out of the namespace

* LUS::

* start on scene command stuff

* i think that's the rest of scene

* reduce copypasta

* collision header

* skeleton

* skeletonlimb

* fix

* path

* cutscene

* text

* audio sample

* sound font

* audiosequence

* background

* Revert "stop putting things in the LUS namespace from SoH"

This reverts commit 0ead6056e6.

* namespace shanans

* wrap all factories in namespace soh

* it's trying to link now

* lus

* scene command override etc

* fix audio loading

* slightly less logspam

* get past the cutscene problem

* in game!

* exporter cleanup

* more exporter cleanup

* clang formatted lus

* msvc

* itny lus change

* variant

* formatty

* fix of some sort i guess?

* use latest lus main

* fix name to enum/factory mapping

* otrexporter
2024-02-15 21:06:52 -06:00
Miles Acquaviva 7f4fc8dc4a
Abstracted repeated code into functions (#3116)
* Abstracted repeated code into functions

* Apply suggestions from code review

* Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-02-15 21:03:19 -06:00
Patrick12115 db57581d6f
[Cosmetics] Add Vanilla GS DL for Cosmetics Editor (#3937)
* Add Vanilla DL

* Fixed egregious spacing error
2024-02-15 20:51:23 -06:00
Pepe20129 7319e4db57
More player documentation from decomp (#3819)
* FallImpactInfo & AnimSfx stuff

* IA function naming & Player_UseItem

* ActionChange

* Speed modes

* Fix build

* Misc cleanup

* Name Player_Action funcs

* PlayerAgeProperties

* Most of the Player struct

* Update z_player.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-15 20:44:46 -06:00
Malkierian 30a063b75d
[Tweak] Move Personal Notes to Save File (#3909)
* Moves personal notes to the save file under a new itemTracker save section.

* Update soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-02-15 20:44:40 -06:00
DeusVexus 4797c9ad35
Adds the Keese and Guay don't target you cheat (#3267)
* Adds the Keese and Guay don't target you cheat
that makes keese and guay ignore you as if
you are wearing the skull mask

* changed instances of CVar_GetS32 to CVarGetInteger
added the cvar to presets.h

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-15 20:29:09 -06:00
inspectredc 457a75e9f8
More Sword Toggle Options (#3889)
* Sword Unequipping Toggle

* better macro

* less ugly format

* cvar prefix

* Update soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c

* Update soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-15 20:15:44 -06:00
briaguya 1bc15d5bf3
document dependencies per distro (#3933)
* start on arch

* noconfirm

* git

* noconfirm

* just skip cache

* cmake

* ninja

* gcc

* lsb

* sdl2

* png

* sdl net

* boost

* imagemagick and add opensuse

* non interactive

* git

* cmake

* add a bunch

* things

* more

* try to matrix

* soh otr i guess

* needs

* trying to figure out how matrix include works

* make the matrix?

* matrix debug

* install?

* echo?

* yuck

* cannot locate package false

* parens for good measure

* lsb

* libsdl2

* suse

* i forgot opensuse uses gcc-c++ instead of g++ for the package name

* png

* sdl

* more

* suse packages....

* fedora cmake

* 2?

* png

* handle old sdl2 net

* apt

* not sure if this is a problem for both clang and gcc on opensuse or just clang

* devel

* cmake min version

* def don't want this here but it's here for now

* does this do anything

* mantic because cmake version

* libopengl?

* fedora ninja

* fedora g++

* lsb

* fedora sdl

* libpng

* do a build

* clang fix

* give early returns values

* ImageMagick

* Update BUILDING.md

* something

* plain boost instead of devel?

* not packing so we don't need this part

* base?

* don't have it can't need it

* just use boost download on opensuse i guess

* move workflow

* bring back the file

* lus main?

* detach
2024-02-15 20:13:49 -06:00
Garrett Cox e05f558ef3
Fix issue with bombchus always showing as major (#3303) 2024-02-15 20:12:19 -06:00
Garrett Cox a84227cbbb
Support hook unregistration (#3538) 2024-02-15 20:08:31 -06:00
Pepper0ni cf6101f4da
Logic bug: child cannot climb forest temple to the straight hallway either (#3934) 2024-02-15 20:03:58 -06:00
Ted Newman bdfcf39e56
Add a link to ship.equipment to the CRC error message box during extraction (#3939)
* Add a link to ship.equipment to the CRC error message box during extraction

* Improve message and add to ShowCrcErrorBox

* Change 'known good roms' to 'known compatible roms'
2024-02-15 19:55:01 -06:00
Archez 3d3b8bfc5b
Allow IsSaveLoaded to consider debug saves (#3929) 2024-02-15 19:54:35 -06:00
Malkierian 0cb4cd158a
Adds reset function to z_en_si (GS Token) to set getItemId to vanilla after resetting SoH. (#3925) 2024-02-15 19:53:18 -06:00
Ted Newman bbac8f8da4
[Fixes] Fix for Zora hint dialogue condition with an inverted flag check (#3920)
* [Fixes] Fix for Zora hint dialogue condition with an inverted flag check

* Base dialogue off of ruto's letter flag

* simplify condition
2024-02-15 19:52:46 -06:00
briaguya 43fed2d77e
ci: pin switch docker image to known working version (#3917) 2024-02-15 19:51:31 -06:00
Malkierian 11a0a00633
Add `CVarClear` to appropriate sections of randomizer Locations and Tricks tabs to get around issue with saving blank CVar strings. (#3916) 2024-02-15 19:50:31 -06:00
mckinlee 2c5cb58ef6
Rename func_80853148 to Player_StartTalking (#3915)
-In PR #3498 I renamed this function for clarity and decided to make a
quick seperate PR for this change.
2024-02-15 19:49:56 -06:00
Tina H. (sheepytina) 7ccc816772
Cosmetics Editor fixes for icons in z_message_PAL.c (#3914)
* Fix resetting button icon colours in message boxes.

* Fix type/math error for custom color in textbox icon pulsing.

* Fix type error for custom color in ocarina icon pulsing.

* Make custom env colour math more closely match vanilla equivalents.

* Make comments presentable.
2024-02-15 19:49:13 -06:00
Tina H. (sheepytina) eeb6c7faaa
Fix Cosmetics Editor getting stuck on weapon trails (#3913)
* Partially fix cosmetics editor getting stuck on sword trails.

* No reason for "reset" to be static.

* bombchu
2024-02-15 19:47:13 -06:00
Ted Newman e68b281b18
[Enhancement] Preserve minimap toggle state between areas (#3906)
* Add enhancement to preserve minimap toggle state between areas

* add map toggle enhancement to presets
2024-02-15 19:39:24 -06:00
inspectredc 107a365b71
Add safety measure to Scene_CommandObjectList to prevent crash (#3904)
* dont let k overflow

* Update soh/soh/z_scene_otr.cpp

Co-authored-by: Archez <Archez@users.noreply.github.com>

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-02-15 19:38:54 -06:00
Josh Bodner a7b8c1dbca
Fix neck slider (#3902) 2024-02-15 19:38:28 -06:00
Garrett Cox f7e746e295
Tweaks to coloridoscope (#3901) 2024-02-15 19:37:55 -06:00
Ted Newman db958ab3f4
New input viewer (#3890)
* Move input viewer into SoH

* Remove unnecessary comments

* Update button outline mode to match default viewer

* Fix ambiguous call

* CVar name changes and minor fixes

* Two more cvars

* Separate C-buttons into individual toggles

* Account for text height regardless of scale

* A few extra comments

* Use new LoadTextureFromRawImage to load layer textures
2024-02-15 19:37:19 -06:00
Pepe20129 7cdd33a01d
Better ammo rendering (#3844)
* Better ammo rendering

* Update soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c

Co-authored-by: Archez <Archez@users.noreply.github.com>

* Update z_kaleido_scope_PAL.c

* Rename gBetterAmmoRendering to gEnhancements.BetterAmmoRendering

---------

Co-authored-by: Archez <Archez@users.noreply.github.com>
2024-02-15 19:32:17 -06:00
Patrick12115 c1365b3263
[Time Savers] Shops and Games always open (#3789)
* Shops and Games always open

* Added comment  for scene reload requirement

* Prefix

* Spacing

Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>

* I'm bad at merging

* Refined by Archez

---------

Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>
2024-02-15 19:27:26 -06:00
Giantblargg 458970816f
Fix Check Tracker Vanilla/MQ Dungeon Spoilers (#3723)
* Fix Dungeon Spoilers

* Update soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp

* Update soh/soh/Enhancements/randomizer/randomizer_check_tracker.cpp

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-02-15 19:26:27 -06:00
Christopher Leggett 3514954ad1
Adds Message Viewer Window to Developer Tools (#3486)
* Adds a MessageViewer window to Developer Tools.

* Properly destroys message viewer window.

* Adds missing ImGui::End()

* Fixes an oopsie crashing non-windows builds after first run.

* Adds C ABI for displaying a custom message

* Fixes a crash and an issue with messages with SFX.

* Remove some osSyncPrintf's that aren't very useful for this case.
2024-02-15 19:23:12 -06:00
Pepper0ni 0932e1e504
Make the final Magic Bean cost 99 rupees in randomiser when it is not shuffled (#3392)
* Make rando final eban cost 99 and clean up Text IDs

* Remove Text ID changes

* Add french translation, All credit to Purple hato

Co-authored-by: Purple Hato <linkvssangoku.jr@gmail.com>

---------

Co-authored-by: Purple Hato <linkvssangoku.jr@gmail.com>
2024-02-15 19:20:12 -06:00
inspectredc 46aea3aa7c
Player State Docs (#3280)
* state flags 1

* state flags 2

* state flags 3

* fill array
2024-02-15 19:17:28 -06:00
Spodi 460ec1bb03
Use manifest for windows DPI awareness (#3270) 2024-02-15 19:17:03 -06:00
Archez 13fce8258d
[Rando] Add Mix and Decouple support to Boss Entrances (#3261)
* initial support for mixing boss entrances in the mixed pool

* support decouple for boss entrances

* missed decouple change

* add blue warp exits to boss rooms in location access

* add entrance get helper methods

* fix assumed targets not using root in entrance name

* add dedicated blue warp entrances and handle blue warp changes during generation

* change bluewarp handling in game to use unique blue warp entrances

* handle blue warps in entrance tracker

* fix overriding all jabu and water temple rooms

* fix grotto returns when exiting boss rooms/dungeons

* fix blue warp logic by tracking original connected region key

* use entrance enums

* remove unneeded entrance values

* fix decouple generation crash

* fix jabu mq backwards logic
2024-02-15 19:14:24 -06:00
mckinlee 3187564f5b
Pause Warp Enhancement (#3223)
* Pause Warp Enhancement

This commit introduces the PauseWarp mod, a feature that allows players to warp to different locations in the game directly from the pause menu.

- Add PauseWarpState structure to manage flags and cooldowns for the pause warp feature.
- Implement IsStateValid function for state validation.
- Implement ResetStateFlags function to reset all state flags to default values.
- Add InitiateWarp function to handle the initiation of warp sequences.
- Implement HandleWarpConfirmation function to confirm and execute warp actions.
- Implement HandleCooldowns function to manage various cooldown timers.
- Add PauseWarp_Main function as the main logic, called every frame to handle pause warp functionality.
- Map warp song messages to in-game text messages.

* Warp Song Check

-Now if you do not have a warp song you won't be able to select the empty slot and still teleport.

* Added Audio Fanfares and Changed stateFlag1 to PLAYER_STATE1_IN_CUTSCENE

-When selecting a warp song the audio for the applicable warp song will now play for a extra vanilla feel.
-Changed the stateFlag1 because previously it just disabled input allowing enemies to harm you. Now that won't happen because the game is put into a cutscene state.

* Feedback Update

-A new hook was created 'OnPauseMenu' so now PauseWarp_Main is only called when the pause menu is open
-Moved pauswarp.c to the Enhancements folder
-Removed from graph.c

PR Change:
Changing to the main branch instead of sulu

* Feedback Update #2

-Introduced new function 'PauseWarp_Idle' now that 'PauseWarp_Main' is no longer called every frame
-Added C wrapper to access 'GameInteractor::IsSaveLoaded' and scrapped the 'IsStateValid' function
-Added 'PauseWarp_Idle' to the the 'RegisterPauseWarp' function
-Refactored the code some

* Linux Compile Issue

-Added a missing header that was causing a compile issue for linux
-Hopefully, it won't crash

* Minor Bug Fix

-Now link won't get soft locked when warping to the same location twice

* Update libultraship

* Revert "Update libultraship"

This reverts commit 746fc23479.

* Bug Fix
-Added more checks to ensure vanilla behavior when a Ocarina is not in the players inventory.

* WIP

* Done unless I'm missing headers

* now we done

* clean up, these arn't needed anymore

* Rename OnPauseMenu to OnKaleidoUpdate
2024-02-15 19:13:54 -06:00
Archez c1eb0a8970
Bump latest LUS and Fix ship menu bar icon (#3935)
* fix ship menu bar icon

* update cmake in wiiu/switch

* different cmake install

* wrong arch
2024-02-13 19:55:33 -06:00
briaguya 8a14fea94c
support LUS archivemanager refactor (#3912) 2024-02-08 20:28:02 -05:00
Ted Newman be8dcfda05
Fix Internal Resolution format to use %.1f instead of %d (#3899) 2024-02-02 07:38:24 -06:00
Garrett Cox 83da5ee677
Moar caching (#3896) 2024-02-02 00:22:44 -06:00
Garrett Cox 8cac9b4264
Merge pull request #3897 from briaguya-ai/macready-to-dev-2-2
macready -> dev (2024/2/2)
2024-02-01 23:45:44 -06:00
briaguya a9d57a95ec Merge branch 'develop-macready' into macready-to-dev-2-2 2024-02-02 00:19:13 -05:00
briaguya 41c2933619
sccache for windows builds (#3385)
* cache vcpkg on windows ci

* try sccache as variant

* missed a spot

* see if we're checking here

* does this do it?

* trying to make minimal changes and have this work

* hopefully these z7s do something

* we were almost at the max already bump to double

* Apply suggestions from code review

* sc

* latest from soh-macready branch of otrexporter
2024-02-01 23:11:31 -06:00
briaguya aff9f40933
gc controllers via sdl on linux (#3869)
* try gc via sdl

basing this idea on this comment https://github.com/Ryujinx/Ryujinx/issues/2425#issuecomment-1269658650

* libusb?

* fix

* use latest lus main

* don't bump lus yet
2024-02-01 22:55:53 -06:00
Patrick12115 f88343839e
Item Tracker Text Size Slider (#3856)
* Adds Slider and Functionality

* prefix

* Changed values

* HELLO

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 22:47:55 -06:00
Pepe20129 961b2626ad
Merge controller menus (#3860)
* Merge controller menus

* Re-run Build

* Update SohInputEditorWindow.h

* Update soh/soh/Enhancements/controls/SohInputEditorWindow.cpp

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* pin switch devkit docker image

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-02-01 22:10:46 -06:00
Patrick12115 775d3e68b7
[Graphics] Show Equipment Regardless of Age (#3830)
* Hookshot, Hammer, & Boomerang

* Added the remainder of equipment and DL Patching for hands

* Removed Mirror Shield Patch

Messed with the front texture of shield

* Child Hylian Shield Cheat

Adds a cheat that allows Child Link to hold Hylian Shield as adult. Added to this since it uses the same way to render the shield

* Debugging

* Adds Scaling to Child Link with Adult Equipment

* Fix Merge Conflict Blunders

* More cleanup

* Added Scaling checkbox and some clean up

* Added an || ITEM_NONE

* More cleanup and simplification

* Accidently added spacer

* Replace B_BTN_ITEM

* Spacing

Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>

* Added most sheath functionality

* Updated tooltips

* removed child hylian shield and tweaked bow/slingshot

Made child hylian shield cheat into a separate branch and hooked into existing bow/slingshot enhancement for drawing those

* Prefixes

* ()

---------

Co-authored-by: Pepe20129 <72659707+Pepe20129@users.noreply.github.com>
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 21:11:49 -06:00
Tina H. (sheepytina) a6457599f9
Clarify descriptions of Graphics Settings (#3881)
* Rewrite tooltips: Internal Resolution, Anti-Aliasing.

+ Tweak others.

* MSAA slider will display 1x as Off.

* Rename setting and tweak tooltips: FPS (to Framerate)

+ Code style formatting.

* Add tooltip: Texture Filtering. + Small tooltip changes.

+ Tidy up comments/newlines.

* Add internal resolution advisory for Apple users.

(Because this setting being missing keeps getting reported as a bug.)

* Small text tweaks.

* Code review suggestion

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>

* Missed one of the buttons + correct spelling of "frame rate"

---------

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
2024-02-01 20:52:53 -06:00
skyyoshi86 351a511dc7
Cosmetics Editor entry for Ivan the Fairy (#3718)
* First commit

* Reverted MODDING.md

Reverted a correction to MODDING.md (case-sensitive broken link?) as this is not a change related to this PR

* Delete CMakeSettings.json

Deleted CMakeSettings.json as this is not a change related to this PR.

* checks for cosmetic changes ONCE for both body and sparles

Please review carefully. I made these changes blindly as I figure out why I can't compile it in my machine anymore. Sorry!

* correctly updates OUTER color when it's changed in Cosmetics Editor

* Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp

* Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp

* Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp

* Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp

* Update soh/soh/Enhancements/cosmetics/CosmeticsEditor.cpp

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Update soh/src/overlays/actors/ovl_En_Partner/z_en_partner.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-02-01 20:44:16 -06:00
Garrett Cox ddf0392100
Add gShowDoorLocksOnBothSides (#3787)
* Add gShowDoorLocksOnBothSides

* Update soh/src/overlays/actors/ovl_En_Door/z_en_door.c

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-02-01 20:43:45 -06:00
Patrick12115 c49908caa6
Item Tracker Hookshot/Longshot Identifiers (#3848)
* H & L

Adds an H and L for Hookshot and Longshot to be able to tell more clearly which one you have.

* Added Toggle and Refined

Adds a toggle if players don't want it on. Also scales the letter to stay constant with the icons, both size and position. Also now hides the letter if you don't have a hookshot yet.

* Clean up some of the comments

* prefix
2024-02-01 20:30:48 -06:00
Chris 81eb6de42e
Audio Editor UI Improvements and Scene Init Randomization (#3388)
* Audio Editor UI Improvements and Scene Init Randomization

* Update soh/soh/Enhancements/audio/AudioEditor.cpp

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Update soh/soh/Enhancements/audio/AudioEditor.cpp

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2024-02-01 20:20:35 -06:00
Eric Hoey f7bd626162
change default value + scale offset by icon size appropriately (#3861) 2024-02-01 20:15:25 -06:00
Josh Bodner f8b0e586bb
Fix +/- buttons on float sliders not working at certain values (#3865) 2024-02-01 20:14:17 -06:00
Patrick12115 ed85a1b0e2
[Time Saver] Reset Navi Timer (#3818)
* Reset Navi Timer

* Force Rebuild

* Prefix
2024-02-01 20:12:28 -06:00
Chris 270d0b836e
Randomize cosmetics on new scene (#3342)
* Randomize cosmetics on new scene

* Code review feedback

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 20:10:49 -06:00
aMannus e4948d9ce4
Triforce Hunt GI Model Blender source files (#3478)
* Triforce Hunt GI model source files

* Move assets to different path
2024-02-01 20:01:38 -06:00
louist103 4bdb5098b0
Colors 1 (#3463) 2024-02-01 20:01:18 -06:00
Rozelette bb1078e99c
Account for removed object dependency in Deku Scrub Leader (#3878)
* Account for removed object dependency in Deku Scrub Leader

* Update soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 19:58:22 -06:00
inspectredc 2529dc59bd
Increase Door Cull range (#3888)
* cullzone

* better cvar name

* Update soh/src/code/z_actor.c

* Update soh/src/code/z_actor.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 19:58:08 -06:00
Caladius 695ab6c6ee
Hurt Container Mode (#3336)
* Each Heart Container or full Heart Piece reduces Links hearts by 1

* Based on Briaguya's suggested Code but modified slightly as some parts were missing.

* Static Bool

* The episode without Captain Hook's Hook

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 19:57:12 -06:00
Eric Hoey be948339b9
Lost Woods Ocarina Game Difficulty Options (#3371)
* Menu options, note speed, unlimited playback time

* Instant win

* Add custom ocarina game cvar to all options and presets

* Extra spaces

* Add starting note count, ending note count by round, more presets

* Block out vanilla code + comments

* finish blocking out vanilla code

* new documentation formatting

* add starting notes to randomizer preset
2024-02-01 19:52:10 -06:00
Eric Hoey 7ff46ba1a7
Increase Crawl Speed (#3366)
* Increase animation speeds, crawl speed, add magic numbers for camera timer, add to menu and presets

* Remove extra space, reformat comments

* Initialilze CVar at 0, Initialize default timer, set default case for timer, change all CVarGets to 1, reorg logic

* Fix remaining CVars + unify logic

* block out vanilla code + comments

* new documentation formatting

* Simplify camera swing fix

* Remove redundant multiplication

* Update soh/src/code/z_onepointdemo.c

reduce code duplication

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2024-02-01 19:38:54 -06:00
Eric Hoey 4d5adbc80f
Fisherman asks for fishing rod when leaving (#3347)
* CVar, presets, custom message, fishing actor

* Add placeholder translations for French/German

* Fix for MS Shuffle change

* Rename function to match

* Missing comma in presets

* Change description, CVar name, add'l function name, edit custom message

* Actual whitespace fix

* re-order custom message

* Fix message formatting

* Add enhancement comments

* yeet if (play) {} from enhancement

* new documentation format
2024-02-01 19:36:57 -06:00
Eric Hoey d9310e4543
Swim Speed Modifiers (#3308)
* Add CVars for swimming, apply to swim speed calc

* Prevent modifer from working underwater

* Re-enable swim speed mod when underwater, use new (orig) function for y-velocity while diving

* Add to presets list

* Fix spacing

* block out vanilla + comments

* re-org vanilla code block in a sane way

* new documentation format

* rename Surface function + comment for usage

* handle merge conflicts, but like an adult this time
2024-02-01 19:32:50 -06:00
Malkierian 61cf2bd323
No Magic Numbers for Preset Location Exclusions (#3801)
* Adds `FormatLocations` and `PRESET_ENTRY_TYPE_CPP_STRING` to allow for feeding `RandomizerCheck` values directly in presets instead of a string with magic numbers.

* Switch to concatenation with `std::to_string`.

* Forgot to remove <format> include XD
2024-02-01 19:29:24 -06:00
Malkierian 16ee20c2a8
Renames Freecam to Free Look. (#3771)
Adds helper info for invert, distance, and transition speed options.
2024-02-01 19:26:36 -06:00
Archez 7ef6a434f9
fix timestamp truncation (#3874) 2024-02-01 19:25:57 -06:00
Malkierian e3825ec263
Unify defaults for reward count sliders with Greg As Reward so they need to register changes. (#3875) 2024-02-01 19:23:06 -06:00
Pepper0ni cb82e77e40
fix bombchu logic bugs (#3720) 2024-02-01 19:15:13 -06:00
Archez a19056cd3d
Merge pull request #3894 from Archez/mergeDevelopMacreadyJan31
Merge develop-macready -> develop
2024-02-01 10:56:45 -05:00
Adam Bird 5db4ce0b53 Merge remote-tracking branch 'origin/develop-macready' into mergeDevelopMacreadyJan31 2024-01-31 18:12:06 -05:00
Ted Newman 3e91d5565a
Fix disabled icon for Easy Input Buffering checkbox when Easy Frame Advancing is enabled (#3859) 2024-01-15 19:46:36 -05:00
Archez 63cf3610e5
Fix: Move Ruto earring fix to graphic patch and fix Ganon fight rubble DL reference (#3810)
* move ruto earing fix to real patch

* use stringpath for ganon rubble
2024-01-15 10:31:33 -06:00
inspectredc dd5d8088f6
Revert actor uncullZone related checks back to match decomp (#3828) 2024-01-15 10:31:06 -06:00
Archez 1da1b1a2bb
Tweak: Improve pause menu dungeon map performance (#3773)
* add map palettes per pulse to leverage shader caching

* use unregister blended with kaleido maps

* use Gfx_TextureCacheDelete for KD lava

* bump lus

* add miss tex clears for KD
2024-01-15 09:39:54 -06:00
Pepe20129 db2ccd95b7
Add Collision Header XML parser (#3396)
* Add Collision Header XML parser

* Update CollisionHeaderFactory.cpp

* Remove "Num" attributes

* Fix crashes

Prevent crash when the camera setting is negative
Change some IntAttributes to UnsignedAttributes
2024-01-15 09:33:21 -06:00
inspectredc db02870a05
Restore Original Scene Command Object List Behaviour (MacReady) (#3827)
* Restore Original Scene_CommandObjectList Behaviour

* remove some vrom stuff

* add some comments
2024-01-15 09:30:20 -06:00
Tina H. (sheepytina) ecdf74161b
Add a tooltip to "Restore old Gold Skulltula cutscene" enhancement. (#3849) 2024-01-15 09:28:59 -06:00
Malkierian 861bd09848
Adds a log statement to show the SoH version at startup, in case crashes don't produce a stack trace from which to glean that information. (#3786) 2024-01-15 09:26:19 -06:00
Archez 8426cc93e5
Fix: Tektite texture not loading for death animation (#3808)
* fix tektite death texture loading

* add string header
2024-01-15 09:25:57 -06:00
Patrick12115 31623a93ab
Remove OpenMenu Bar Check (#3817)
Having it set to just -6 makes the Glitch Tick stay in the same spot in game. when the F1 menu bar is open. At least on Windows
2024-01-15 09:24:57 -06:00
Amaro Martínez bfe2f58feb
Custom message loading (#3713)
* Add custom text message loading

* Use "override" folder for text mods

* Replace only existing messages

* Use std::find_if to check for existing messages
2024-01-15 09:24:08 -06:00
Josh Bodner 01529126ba
Imgui polish (#3481)
* Rearrange menus for better layout on smaller screens.

* Automatically calculate +/- increments for float sliders

* Add needed header

* Use stringstream instead of format since apparently most platforms don't actually support all of c++20 yet boooooo

* Add header that only Mac complained about for some reason

* Theoretical performance improvement

* Actual performance improvement
2024-01-15 09:22:56 -06:00
Amaro Martínez 21796367a0
Use temporary mirror for Boost download URL (#3822) 2024-01-08 12:39:49 -06:00
Eric Hoey a0258f0fca
Add Invert Y-Axis and Apply Right-Stick Aiming to Z-Weapon Aiming (#3304)
* Add right-stick aiming to third-person aim

* Add Z-aiming CVar and inversion to Z-aiming

* Create calculation for rel.right_stick and apply it in Z-aiming

* Move option to First-Person section to match shield

* Fix max/min aiming heights

* Expand min/max + comment

* block out vanilla + comments

* block vanilla code better

* Remove extra space

* new documentation formatting

* rewrite ==0 and !=0
2024-01-08 12:21:18 -06:00
inspectredc 321c258d69
Fix Fire Temple Boss Door Logic (#3774)
* Fix Fire Temple Boss Door Logic

* Update soh/soh/Enhancements/randomizer/3drando/location_access/locacc_fire_temple.cpp

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>

---------

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
2024-01-05 20:55:09 -05:00
Malkierian 02938cfba2
Fix Starting Triforce Piece Count (#3797)
* Move zeroing of triforcePiecesCollected to the beginning of `Randomizer_InitSaveFile()` to fix starting TFP count issues.
2024-01-05 20:53:18 -05:00
Garrett Cox 37b2fc0745
Make noclip only effect player (#3788) 2024-01-05 20:51:48 -05:00
Amaro Martínez 6cb3a830bd
Restore previous Boost download URL (#3809)
This reverts commit 96abadd904.
2024-01-05 18:41:09 -05:00
briaguya 9064897736
fix compatibility nightly.link in README.md (#3768) 2024-01-04 20:24:08 -05:00
Pepe20129 1699eea009
Remove special IAs (#3453)
* Remove special IAs

* Add clarifying comment
2024-01-02 00:29:47 -05:00
Garrett Cox 03d907b843
Merge pull request #3778 from HarbourMasters/develop-macready
macready -> develop
2024-01-01 16:23:58 +00:00
Amaro Martínez 96abadd904
Update Boost download URL (#3776) 2023-12-31 16:06:47 -05:00
Malkierian fa8a0e2a76
[Rando] Fix Check Tracker Area Totals (#3758)
* Fix the calculation of `areaChecksGotten` to account for flags functionality setting invisible checks.
Change `areaChecksTotal` to dynamic calculation based on tracker visibility, now that all checks are being added to `checksByArea`.
Both are updated in realtime when either "Show all GS locations" or "Hide right side shop items" are toggled.
Reformat all remaining unencapsulated if statements.

* Changed helper variable change and call to `RecalculateAreaTotals()` to when the options are toggled instead of checking every frame.
Removed redundant if...else.
Clarified areaChecksGotten increment/decrement functionality based on current status and incoming status change.

* Removed unused code.
2023-12-31 13:58:31 -05:00
shinra-electric b7342a7847
[macOS] Add Architecture Priority to Info.plist (#3727)
* Add Architecture Priority to  Info.plist

This allows the app bundle to be launched natively on Arm without the need for Rosetta.

* Remove arch shenanigans in soh-macos.sh.in

Shouldn't be necessary now...

* Add back launching the binary in soh-macos.sh.in

Accidentally removed launching the binary from the script.
2023-12-29 18:02:22 -05:00
Jérémy Lugand a08943edc8
Fix typos in scenes_fra.json (#3732)
* Update scenes_fra.json
2023-12-29 18:00:06 -05:00
Sarge-117 bedb0a1768
Add LLR entrance from silo to the better debug warp screen (#3424)
* Add silo exit

* Back Tower
2023-12-29 17:57:31 -05:00
Pepe20129 807b00a058
Fix crashing when creating a new file (#3764) 2023-12-29 13:36:56 -05:00
Patrick12115 81ec2805ee
scaling (#3393) 2023-12-28 12:04:30 -05:00
Patrick12115 b80452b2b8
Multiplier (#3395) 2023-12-28 12:04:20 -05:00
Garrett Cox f6a6b880c9
Only emit changed flags (#3489) 2023-12-28 08:23:03 -06:00
PurpleHato 1fff15753a
ADD: Enhancement-->Graphics-->Colour Temple of Time's Medallions (#3514)
* First dirty testing process

* Forgot a 2 for the second Dlist patching of Shadow

* TWEAK: GI integration

* DEL: Unucessary includes + whitespace

* TWEAK: No stones refactor for now, sorry I'm kinda lazy right now, don't hate me, please! T_T

* Stone removal part 2, sometime I forget to save the changes :derp:

* Tiny last tweaks, hopefully

* Add to rando preset

* Tweak: typo

* TWEAK: Trigger on toggling on/off

* TWEAK: adressed reviews 💯

* Please mate, excuse my British typing
2023-12-27 23:46:00 -05:00
pirate486743186 3f61fbc5f6
use SHIP_BIN_DIR instead of HERE (#3469) 2023-12-27 13:37:11 -05:00
Pepe20129 dc4347253d
Item cycling improvements (#3456)
* Simplify item cycling

* Simplify selection variables

* Fix adult bunny hood and gray appropriate items

* Don't go into cycling mode when there's no items to cycle to

* Restore updating c buttons

This was previously done with `Inventory_ReplaceItem` but that led to problems when another slot had the same item as the one that's being cycled.

* Address review
2023-12-27 12:55:09 -05:00
mattman107 9b74dc2892
Update linux/appimage script to use symlinked rom files (#3483)
* Update soh.sh.in

Added support for symlinked rom files in linux/appimage script.

* Update scripts/linux/appimage/soh.sh.in

Updated to be less confusing as per Archez

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>

---------

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
2023-12-27 12:51:36 -05:00
Garrett Cox a6bb6cf0a3
Hardcore mode v1 (#3540) 2023-12-27 12:50:56 -05:00
Pepe20129 e8096a2d94
Better actor viewer (#3544)
* Update actorViewer.cpp

* Add more actors

* Add a search function

* Update actorViewer.cpp

* Add advanced mode for params
2023-12-26 19:09:04 -05:00
Garrett Cox 70e1017923
Add frame advance option to developer tools (#3435) 2023-12-26 19:08:37 -05:00
Adam Bird 6a7bcc4a5e
add more commands to dl viewer (#3504) 2023-12-26 17:13:48 -05:00
briaguya 99194a75f1
docs: update `func_800FADF8` to `Audio_ResetActiveSequences` (#3471) 2023-12-26 13:30:49 -05:00
briaguya 776c3a51ee
stick sensitivity (#3725) 2023-12-23 18:48:06 -05:00
briaguya 0a59ce6d99
upgrade to docking imgui 1.90.0 (#3402)
ce0d0ac829
2023-12-23 18:12:52 -05:00
Tina H. (sheepytina) e0930809d4
Advanced controls for aspect ratio, resolution, and integer scaling. (#3130)
* Advanced Resolution Settings

first working version with most features implemented

* Update advancedResolutionEditor.cpp

Added auto-resizing logic for Pixel Perfect Mode.
Minor fixes.

* Tweaks and tidying up.

Disable integer scale slider if automatic sizing is overriding it.
Don't offer these UI options on Apple.
Removed unused code.
Updated LUS.

* Update libultraship

* Filenames and style fixes

Filenames and folders now more closely match rest of project.
Tidied newlines/comments.
(SohMenuBar.cpp) Label of button changed to fit menu.
(ResolutionEditor.cpp) Default window size improved.

* Update libultraship

(However, I still need to make the GUI controls acknowledge the new constraints.)

* Update libultraship

(and changed the name of some cvars)

* Added constraints to the inputs. Added a fps drop warning.

* Tweaks based on feedback

* Update libultraship

* Enabled on Apple - For currently ongoing Retina DPI troubleshooting.

(Also removed the duplicated N64 Mode toggle.)

* Update libultraship

* Update LUS, update CVar names, small tweaks

And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off.

* Add Additional Settings and the accursed horizontal resolution field.

There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got.

(This is honestly causing more problems than it solves, but i'm tired of getting questions about it.)

* Resolved many of the lingering bugs with the previous commit

* Horizontal Resolution field now properly acknowledges resolution bounds.

* Don't show "Horiz. pixel count" field if not enforcing aspect ratio.

Additionally:
* Don't change settings if selecting "Custom" from preset dropdowns.
* Added a missing horizontal pixel count clamp check.
* Tidied up redundant behaviour.

* Additional comments, and a checkbox to disable aspect correction on consoles.

* Change how frame rate threshold is calculated.

* More minor UI tweaks.

* Added missing CVarSave() calls where needed.

Added a short update countdown for the numerical CVars. This is intended to prevent CVarSave() from being called too often.

* Added a helpful button to cover a potential support issue.

* "Fit Automatically" has been moved to LUS and is now smarter.

This will require another PR in LUS to be opened by me.

* Swap to new branch for libultraship

* Even more clever integer scaling behavior.

"IntegerScale" is itself now a CVar group.

* Tidy up comments.

* Fix a typo that prevented `IsDroppingFrames()` from working

(Maybe more than a mere typo, but a typo was involved.)

* Remove unused and unnecessary variables.

* Group "Integer Scaling" under its own collapsing header

* Changed label for the Enabled advanced settings checkbox.

* Update libultraship + Formatting pass on ResolutionEditor.cpp

* Add `(Select "Off" to disable.)` help text for the aspect ratio setting and hide UI elements accordingly.

Only show the fields if user chooses Custom.
Padding has been shifted accordingly too.

Also fixed a long standing error with the Y field disappearing when modifying X.

* Well I suppose that's no-longer necessary.

* Update libultraship with commits from main branch (up to e5df3a9)

* Tweak comments.

* Save current ImGui Combo items as a console variable

to improve user experience.

* Change language of NeverExceedBounds checkbox description

to be more affirmative, so it makes more sense.

Add tooltip for NeverExceedBounds checkbox.
Tweak some comments related to additional settings.

* Add list of colours to use with TextColored elements.

* Move some UI elements around.

Add an extra MSAA slider to the editor window.

* Integer Scaling header is DefaultOpen if player has Pixel Perfect Mode active upon window creation.

+ Amend tooltips.

* Fix a minor oversight with default configuration.

Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship.
The default values are now 16:9, matching LUS.
Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom".

(Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.)

* Make resolution slider `disabled` condition a variable, for readability.

* Small tweak to combo item saving

* Use `SCREEN_HEIGHT` and `SCREEN_WIDTH` for constraints

* Simplify "Show a horizontal resolution field" logic

by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway.

* Correct aspect ratio visualiser to be un-inverted

+ actually display it as a ratio.

* Remove update flags from combo boxes + remove update countdown

+ remove non-functioning 'IsBoolArrayTrue' function.

(The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.)

* Code review suggestion: disable UI elements conditionally

 (+ tweaks to code style)

* Invisible tweaks to the Integer Scaling-related Additional Settings

This looks like a lot but it's mostly just re-arranging a cluttered area of the code for clarity.
Actual changes to functionality are:
* Help text now "disabled" along with the checkbox.
* The NeverExceedBounds checkbox will now reset the unused ExceedBoundsBy cvar if it's been changed.

* Assorted small tweaks to comments and variable declarations.

* Code review suggestion: tweak "Window exceeded" warning condition

* Missed a thingy.
2023-12-23 16:19:41 -05:00
Garrett Cox 2cb3a3664e Implement gMoveWhileFirstPerson 2023-12-20 20:26:07 +00:00
Garrett Cox 66c41a8012 Clean up func_8084ABD8 2023-12-20 20:26:07 +00:00
Adam Bird 1d7ad52222
fix remote control define when flag not set in windows (#3534) 2023-12-19 00:55:32 -05:00
briaguya 9b947615bc
Merge pull request #3539 from Archez/merge-echo-develop
Merge (8.0.4) develop-macready -> develop
2023-12-17 21:56:11 -08:00
Adam Bird 03da69d7b7 Merge tag '8.0.4' into HEAD
MacReady Echo
2023-12-18 00:34:59 -05:00
Garrett Cox 60faf3f750
Bump version to MacReady Echo 8.0.4 (#3537) 2023-12-17 22:47:39 -06:00
Garrett Cox ef910a02f7
Remove use of static variable in en_box (#3536) 2023-12-17 21:47:02 -06:00
inspectredc f607afc754
Add player state dead check to Player_UseTunicBoots (#3530)
* Add player state dead check to Player_UseTunicBoots

* Update soh/src/overlays/actors/ovl_player_actor/z_player.c

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-12-17 21:46:35 -06:00
inspectredc 865bcc57a7
Fix Logical Error With Darunias Door Entrance (#3529) 2023-12-17 21:20:09 -06:00
Garrett Cox b5caf33a9b
Initialize GameInteractor before SaveManager so it can correctly set up a hook (#3535) 2023-12-17 21:19:30 -06:00
Adam Bird f655ab592d
Re-implement Pause menu Dungeon map texture effects (#3496)
* first pass implement dungeon maps

* wrap up map dungeon implementation

* add comments and enums, rename vars

* bump lus
2023-12-17 15:42:34 -05:00
Garrett Cox 86044a1c50
Remote GI Work (#3073)
Co-authored-by: David Chavez <david@dcvz.io>
2023-12-17 13:41:33 -06:00
briaguya e6fc34e4c2
bump lus to latest 1.x (#3528) 2023-12-17 13:36:38 -05:00
Adam Bird d370ca93fd
[Tweak] Improve KD lava effect performance and stability (#3501)
* improve kd lava performance and stability

* enum typo

* account for rock tex size
2023-12-17 13:23:07 -05:00
Adam Bird a6b4e0b7fd
Fix entrance tracker crash (#3502) 2023-12-17 11:06:01 -05:00
Garrett Cox fcf2141266
Fix JSON parsing every frame on file select (#3513)
* Fix JSON parsing every frame on file select

* string (#73)

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-12-16 21:40:09 -05:00
Adam Bird e2f1cebfb5
fix condition causing enemies to always be small (#3512) 2023-12-16 20:56:36 -05:00
Adam Bird 907b770676
more swordless fixes when time traveling (#3510) 2023-12-16 20:56:14 -05:00
Adam Bird ea49196bae
retain gameplay stats window size (#3508) 2023-12-16 20:52:36 -05:00
Adam Bird f65b711376
fix led crash when set to health (#3507) 2023-12-16 20:52:07 -05:00
Adam Bird 269e9faa46
change adult shooting gallery reward and add message (#3506) 2023-12-16 20:51:44 -05:00
Malkierian 35301556d9
Added "Always show gold skulltula" to check tracker options. Toggleable without restart. (#3505)
Made "Hide right-side shop checks" toggleable without restart.
2023-12-16 20:51:25 -05:00
Adam Bird fb0f7169d7
fix jabu mq minimap mark points (#3494) 2023-12-16 20:50:32 -05:00
Garrett Cox 2d22a3ebcc
Add vanilla logic option (#2191) 2023-12-04 11:29:48 -06:00
Garrett Cox a8c18882f0
Merge pull request #3487 from HarbourMasters/develop-macready
develop-macready -> develop
2023-12-04 14:31:58 +00:00
aMannus 6297df98e9
Fix GBK check for vanilla (#3473) 2023-12-04 08:22:35 -06:00
Garrett Cox 365afe7833
Add tableId to getItemEntry (#3064) 2023-12-04 07:52:39 -06:00
Adam Bird fbc397a131
Tweak skeleton limbs to use OTR path strings for loading DList and improve Alt toggling (#3479)
* set otr string paths for DList on skeleton limbs

* delay toggling alt assets cvar to end of frame
2023-12-04 07:33:14 -06:00
Garrett Cox 1fea642f33
Fix OnItemReceive hook for items in the extendedVanillaGetItem table (#3063) 2023-12-04 07:26:55 -06:00
aMannus 19cede44c3
Merge pull request #3468 from briaguya-ai/delta-to-dev
MacReady Delta -> develop
2023-11-30 00:07:38 +01:00
briaguya b39e6ec5af bump to latest lus main 2023-11-29 02:27:19 -05:00
briaguya 351f896cfa Merge branch 'develop' into delta-to-dev 2023-11-29 02:16:54 -05:00
briaguya 818addfdda
delta bump (#3465) 2023-11-29 01:32:15 -05:00
Malkierian f14c390364
[Vanilla Fix] Slow Down Darunia's Dance (#3438)
* Fix Darunia's dancing animation speed (static for now; needs toggle later).

* Moved previous code to toggleable fix in enhancements. Tweaked speed factors, partially successful.
2023-11-29 00:38:48 -05:00
Adam Bird dd5e72a023
limit entrance discovered saving to end of operation (#3459) 2023-11-29 00:29:25 -05:00
rozlette d523b104d8 Change declaration of Morpha tentacle verts to combine them all and avoid overlaps that result in dropped verts 2023-11-28 21:09:34 -08:00
Garrett Cox fdcd9a7508
Race Integrity QoL (#3445)
* Add gDisableChangingSettings

* Add support for dropping a config file to overwrite CVars
2023-11-28 23:42:37 -05:00
Malkierian c4f34624ba
Flag tracker (#3447)
* Hook into flagset hooks for processing check tracking. Has some manual workarounds (some breaks still need to be found).
Remove areaChecks and looping functionality as redundant.

* Additional vanilla handling.

* Fix tracker not showing MQ checks in MQ non-rando.
Fix tracker marking non-MQ variants of dungeon checks (e.g. map chest, etc) when collecting in MQ.

* Set all areas to spoiled if not rando.

* Revert attempt to spoil in randomizer based on MQ dungeon count as I don't know how that works at the moment.

* Restore and update spoiling based on MQ dungeon settings (none, selection, or count of 12).
Fix Anju As Adult check.

* Remove Anchor-specific code :baguette:

* Use `ClearAreaTotals()` in `Teardown()` instead of the duplicate code there.

* Update to `ClearAreaChecksAndTotals()` with `vec.clear()` added.

* Fix type spoiling again. Now spoils on 0 MQ dungeons, not rando, if the option is enabled in check tracker settings, selection, or set number of 12.
Fix vanilla checks being marked collected in MQ dungeons.

* Fix 100 GS check.

* ACTUALLY fix 100 GS: change flag type to `RandomizerInf()` in `item_location.cpp`, add RC to RandoInf for it to the table. Also don't send GI for flag if father, falsely triggers ZR frogs minigame.

* Fix gravedigging tour tracking.

* Fix membership card check tracking.
Change scene and flag values to any existing enums.
Clarifying formatting for the checking loop vOrMQ conditions.

* Fix Gravedigging Tour tracking.
Simplify Always Win Gravedigging Tour and Fix Gravedigging Tour Glitch applications.
Modified all necessary paths to use vanilla GDT PoH collection flag instead of randomizer variant.

* Fix Kak Potion Shop being "seen" when entering as child.
2023-11-28 21:25:48 -05:00
Adam Bird 33fe8776bb
Fix bugs dont despawn cheat to work with soil patches (#3457) 2023-11-29 02:02:45 +01:00
briaguya 02256fac66
bump LUS to 1.4.0 (#3461) 2023-11-29 01:37:54 +01:00
briaguya 621afc99f0
sort patch otrs (#3430) 2023-11-29 01:34:00 +01:00
inspectredc 9d215b6dce
Separate Arrows Equip Dupe Fix (#3450)
* add gseparatearrow check for equip dupe fix

* update gseparatearrows tooltip
2023-11-28 22:13:00 +01:00
aMannus 420bdab328
Random Enemy Sizes fixes (#3452) 2023-11-28 14:30:36 -05:00
Adam Bird 717074ff86
Fix: Missing TextIDs for MQ PAL and change lava size (#3449)
* Fix text offset for MQ pal and add text ID asserts

* correct lava texture size
2023-11-28 20:11:03 +01:00
Malkierian 3ab16b70c2
Changed all checks for `!gPlayState` to `!GameInteractor::IsSaveLoaded()` in mods.cpp for all the cheats, and added the same full check to others that really didn't need to be running outside of a game (like infinite rupees, magic, health, etc), and clear any triggering CVars. (#3441)
Changed `RegisterSwitchAge()` to clear the CVar instead of setting it to 0.
2023-11-27 23:00:25 +01:00
Pepe20129 5b81964ea5
Bring over some player documentation from decomp (#3380)
* Document static variables

* Document enums and structs

* Document some functions

* Document more functions

* actionParam to itemAction and fix build

* Document some local variables and a define

* General cleanup

* Use PlayerMeleeWeaponAnimation enum when appropiate

* Document some function parameters and local variables

* Document some of player struct
2023-11-26 11:54:54 -05:00
Malkierian 3cf9d655a7
Disable Fix Vine Fall when Climb Everything is enabled (#3439)
* Disable Fix Vine Fall when Climb Everything is enabled.

* Remove option disabling.
2023-11-26 11:34:54 -05:00
Garrett Cox d0d1d9c487
Merge pull request #3312 from quellen-sol/develop
Add Geo rupee name (Hollow Knight)
2023-11-24 12:27:49 -06:00
Garrett Cox 360b6b88be
Merge pull request #3310 from Pepper0ni/NoSwimAnim
Port Faster Swim animations, full credit to kimimaru4000
2023-11-24 12:27:32 -06:00
Garrett Cox 1e4784af8f
Merge pull request #3302 from inspectredc/toggle-strength
Toggle Strength Option
2023-11-24 12:26:34 -06:00
Garrett Cox bdc6fad0a9
Merge pull request #3208 from garrettjoecox/valueViewer
MVP ValueViewer
2023-11-24 12:25:39 -06:00
inspectredc 95f27ace2e
Fix kokiri sword unequipping when using switch age cheat/enhancements (#3415)
* test fix for ks unequip

* remove unnecessary brackets
2023-11-24 09:40:42 -05:00
Salt d50ad4779d
Fix #3417 Symlinks to Directories in Mods Dir Aren't Traversed (#3418) 2023-11-24 09:40:30 -05:00
Adam Bird f2df029efa
fix: skybox crash for mask shop (#3427) 2023-11-24 09:38:45 -05:00
Garrett Cox bdb201201e
Fix audio cutoff issues (#3428) 2023-11-24 09:38:13 -05:00
Adam Bird f4e4545180
Re-implement King Dodongo's Lava texture effects (#3434)
* fix alt backgrounds not always loading

* include gfx lookup with the original unload

* Add hook for alt toggle

* handle cpu modified texture for kd lava

* malloc array instead of illegal initialize
2023-11-23 09:07:30 -05:00
Garrett Cox c3ae829370
Add enhancement for removing explosive limit (#3242) 2023-11-20 13:25:22 -05:00
briaguya 76e90c0928
Controllers (#3378)
* lay some groundwork

* use custom window (which is currently identical to the LUS window)

* start making it shippy

* start moving stuff out of gamecontroleditor

* clean up shouldrumble

* include the other way

* wii u

* latest lus main

* notch snap angle buttons

* buttons on all the sliders

* just use a hidden id

* handle debug for port 2 and rename tabs so everything fits

* button line buttons look better

* padding fixed

* clang format

* bump to latest LUS main

* big buttons

* just default the analog stick options to open for now

* fix wii u build

* bonus: make it all scale-aware

* clang format

* fix horizontal scrolling

* fix all +/- buttons

* keyboard set defaults

* axis threshold helper text

* bonus: test rumble button

* clang format

* fix otrexporter submodule

* bump to latest lus main
2023-11-20 08:02:15 -05:00
aMannus 34556e40d6
Clean up Triforce Hunt U16's and GBK (#3355)
* Clean up Triforce Hunt U16's and GBK

* Apply suggestions from code review
2023-11-19 14:45:09 -05:00
inspectredc 80ef399c52
Entrance Docs (#3332)
* transition variables renamed

* transition circle

* transition wipe

* sand storm

* remaining sceneloadflag rename

* transition trigger macros

* transition mode enum

* transition type enum

* tc set params

* creg debug transitions

* introduce entrance table + return entrance indices + entrance info macros

* randomizer entrance pass through

* cleanup some missing scene enums

* randomizer entrance tracker pass through

* randomizer grotto pass through

* gSaveContext.entranceIndex

* misc lists

* z_select pass through

* respawn entrance index

* nextEntranceIndex

* add missing include
2023-11-19 14:29:56 -05:00
briaguya 8dbf738128
macready (charlie) -> dev 2023-11-19 05:52:26 -08:00
inspectredc 2b1327c41a
Transition docs (#3322)
* transition variables renamed

* transition circle

* transition wipe

* sand storm

* remaining sceneloadflag rename

* transition trigger macros

* transition mode enum

* transition type enum

* tc set params

* creg debug transitions
2023-11-19 02:38:07 -05:00
briaguya a8e387b949
cache vcpkg on windows ci (#3384) 2023-11-18 21:11:44 -05:00
briaguya 0ddb0711ad
Version bump to MacReady Charlie (#3406) 2023-11-15 23:22:09 -05:00
briaguya 3234256b03
bump lus (#3405) 2023-11-15 22:45:09 -05:00
inspectredc d8a7a6c764
Use Correct Player Boot Enums in CC (#3403) 2023-11-15 20:38:21 -05:00
Garrett Cox 2075213544
Merge pull request #3399 from HarbourMasters/develop-macready
macready -> dev
2023-11-14 22:24:48 -06:00
Garrett Cox 2dfbbc63e3
Version bump to MacReady Bravo (#3398) 2023-11-14 21:14:47 -05:00
Garrett Cox 044d32a46f
Add gFixEyesOpenWhileSleeping (#3365) 2023-11-14 20:47:07 -05:00
Malkierian afe032ea21
[Feature/fix] Save to temp file first (#3376)
* Add temp file flow to `SaveManager::SaveFileThreaded`.
Add "Save finish" info log message.

* Fix WiiU/Switch
2023-11-14 20:46:50 -05:00
Josh Bodner fb45b66903
Fix magic being zeroed out when using fast file select (#3389)
* Move to frame counter init to a place that fast file select also touches

* Undo removing old fix

* Reset on gameover
2023-11-14 17:08:45 -05:00
Malkierian ba987c49e2
SaveManager cleanup (#3386)
* Move threadpool initialization and `OnExitGame` registration from `SaveManager::Init` to SM's constructor.
Comment on `Init` to mention it's not an initializer for `SaveManager`.
Added check for `SaveManager::SaveSection` to prevent firing a save worker if the game is already exited from a reset.

* Removed `IsSaveLoaded` check in favor of another `ThreadPoolWait()` at the start of `SaveManager::Init()`.
2023-11-14 16:46:38 -05:00
AltoXorg bd0672767a
Use substr method to determine file extension (#3390)
See https://github.com/HarbourMasters/OTRExporter/pull/12
2023-11-14 16:37:54 -05:00
Adam Bird e66eb8756d
Fix: Prevent patching custom models (#3367)
* fix prevent patching custom models

* prevent patching chests textures for custom chest models

* add tooltip for cosmetic editor about custom models

* chest texture handling for alt toggles
2023-11-14 16:37:03 -05:00
Garrett Cox bf31f2b330
Stop hardcoding skeleton type to flex (#3397) 2023-11-14 16:36:05 -05:00
Malkierian 4e9040d761
[Feature] Remove `performDelayedSave` functionality from Autosave (#3387)
* Removes delayed save functionality, making autosave work everywhere except Ganon and Chamber of Sages scenes.

* Change AutoSave comment to remove the scenarios we no longer block autosave in.

* handle temp B on saving outside of kaleido

---------

Co-authored-by: Adam Bird <archez39@me.com>
2023-11-14 16:35:19 -05:00
Malkierian 304016ddd2
[Feature Fix] Tunics stolen by like likes now removed from the item buttons (#3375)
* Extends `Assignable Boots and Tunics` functionality to check for and remove Goron and Zora tunics from item buttons when like likes steal them.

* Comment documentation.
2023-11-14 00:12:08 -05:00
briaguya fe9c0fa4f7
bump lus (#3394) 2023-11-14 00:10:56 -05:00
Malkierian 384403edb5
Rename all instances of Desert Wasteland to Haunted Wasteland. (#3372) 2023-11-13 23:45:52 -05:00
Malkierian 60687aff0d
Move everything in `RandomizerCheckTracker::LoadFile()` except the block to load the "trackerData" section to a new `OnLoadGame` hook function to fix crashes on transferred saves. (#3368) 2023-11-13 23:45:41 -05:00
Ralphie Morell cf88b3d2bf
Fix edge case of MS shuffle (#3364) 2023-11-13 23:45:15 -05:00
PurpleHato dd6271ecae
ADD: No HUD Heart animation (#3348)
* ADD: No HUD Heart Animation

I've seen this requested multiple times for modding purposes for the case of using "lifebars" instead of hearts

* TWEAK: Move it under the the mods

* REM: Whitespace

* REM: Whitespace2

* Tweak: Cvar Oppsie
2023-11-13 18:13:46 -05:00
Malkierian 78ffb41cd2
Moved the check for `!seqInfo.canBeUsedAsReplacement` in `InitializeShufflePool` to exclude them before modifying either shuffle pool. (#3370) 2023-11-13 18:11:29 -05:00
Adam Bird 30ab8e9ed7
version bump to MacReady Alfa (#3363) 2023-11-06 20:55:50 -05:00
Adam Bird b6a3ed93a2
bump lus (#3361) 2023-11-06 20:05:18 -05:00
Pepe20129 1d3e7d4be9
Add MS shuffle to the hell mode preset (#3360) 2023-11-06 16:48:20 -06:00
Adam Bird 959b307b9e
Fix: Repair working directory on Mac and use app directory for extractor search paths (#3359)
* fix otr regen on mac release

* linux args
2023-11-06 16:46:48 -06:00
Adam Bird 460b3d02f5
[OTR Archive] Move shared scenes out of nonmq/mq folders (#3191)
* share common scenes between mq and nonmq

* move shared scenes under shared folder and bring back thieves hideout mq handling

* update headers for shared scenes

* bump submodules

* remove mq handling for mirror world song patch

* only have unique dungeons be nomq/mq variants

* bump submodules
2023-11-06 16:44:49 -06:00
inspectredc 8b78cb832a
items tied to items rather than slots + dpad items now work (#2884) 2023-11-05 22:33:51 -06:00
Malkierian 8e00265ff8
Add checks to Windows for running in temp directory (running from archive), and proper file permissions (write/modify, to prevent things like Program Files or Windows, or other folders we couldn't know about that don't have proper file permissions). Instructs users as to what it discovered and how to fix, then exits. (#3097) 2023-11-05 22:04:21 -05:00
Malkierian 8745881815
Add UI scaling combobox with 4 options (one smaller than default, two larger) and experimental tag. (#3037) 2023-11-05 21:21:44 -05:00
Caladius ecafa87195
Updates from Feedback, Wallet size affects reduction rate and wider range of interval options. (#3335) 2023-11-05 19:53:46 -05:00
krm01 127f2651df
vanilla bugfix for wall climbing on edge of polys (#3358)
* vanilla bugfix for wall climbing on edge of polys

* rename missed vars

* add CVar toggle
2023-11-05 12:07:44 -06:00
Adam Bird f1f04a5583
Add TTS for Game Over menu (#3338) 2023-11-05 12:06:21 -06:00
Adam Bird 7e9efeeadb
[OTR Archive] Store soh version in OTR files and verify on launch/ask to regenerate (#3218)
* parse sohver arg and store version file in otr

* parse args for soh.otr gen only

* pass soh version from built in extractor

* update launch scripts, cmake and extract steps to pass soh version

* check otr versions and error or ask to regenerate

* add wiiu core header for osfatal

* review feedback

* remove soh dummy version for lus change instead

* only configure linux script for linux

* change lus commit

* rename soh version to port version

* fix submodules

* bump OTRExporter

* clean up error messages for switch/wiiu

* strings not char array

* typo

* init wiiu before otr detection

* Add message for mac/linux extraction

* remove unneeded exits

* change version number types to u16 to fix 32bit devices

* bump otrexporter
2023-11-05 12:34:39 -05:00
aMannus 13a8a1a5cc
Randomized Enemy Sizes (#3321) 2023-11-05 07:54:23 -06:00
Malkierian 39a7437fc8
[Bugfix] Prevent crash in audio editor when shuffling over old CVar format (#3337)
* Add a `CVarClear` inside the check for a sequence's lock to get rid of old data.

* Rework all replacement and lock `CVarSetInteger` calls to call a function which checks for previous format with `CVarGet` to know if it needs clearing before setting either the lock or the sequence

* Swapped everything over to a migrator where it loops through the `sequenceMap` and just clears everything from there in "gAudioEditor.ReplacedSequences"
2023-11-05 08:57:59 +01:00
aMannus e60761eb61
Fix audio editor mistake (#3356) 2023-11-04 23:30:01 +01:00
Adam Bird 6d8dfe7933
Fix: MQ logic for Ganons Castle main area (#3275)
* fix mq logic for ganons castle main area

* update logic to use logic helpers

* add hammer check

* grouping
2023-11-04 23:08:09 +01:00
Pepper0ni 02afac704e
Force the Sarias Song magic hint to replace all other Sarias Song text. (#3296) 2023-11-04 22:56:03 +01:00
Malkierian e88c8e68b6
[Bugfix] Fixes check tracker crash on max debug file creation (#3309)
* Change initialization of `areasSpoiled` to improve utilization and fix crash during max debug file creation.

* Renamed `RCAreaFromSceneID` to `DungeonRCAreasBySceneID` for clarification.
2023-11-04 22:53:29 +01:00
Adam Bird 44ee6da0aa
fix quest assignment (#3343) 2023-11-04 22:52:09 +01:00
Adam Bird 25f05e68b3
fix entrance rando validation missing edge cases (#3344) 2023-11-04 22:50:28 +01:00
Eric Hoey 678578823f
Fix preset strings for spocks (#3349) 2023-11-04 22:49:41 +01:00
Adam Bird 36617cb77d
fix master sword check not being behind door of time and some other logic checks (#3353) 2023-11-04 22:48:43 +01:00
Caladius ff7fa77427
Addresses Forest Temple Poes and NPC Dialogue issues. (#3334) 2023-10-30 11:00:24 -05:00
Pepper0ni 2810996475
Fix Entrance hubs having no HintKey, causing hints to No Item (#3295)
* Fix Entrance hubs having no HintKey, causing hints to No Item

* Add castle grounds hint area to cover the OGC/HC to market entrence
2023-10-30 10:57:36 -05:00
inspectredc 5dd82f59e2
Player Equip Docs (#3282)
* hopefully everything

* update docs for MS shuffle sections
2023-10-30 10:56:36 -05:00
Tina H. (sheepytina) a04ee354d4
Add "Navi Targeting Colors" options to Controller LED Color (#3254)
* Add a (not yet functional) "Navi" option.

* It works!

* Slightly better name for this menu option.

* Revert accidental commit of comments in z_en_elf.c

* Renaming and tweaks.

* Temporary fix(?) for compile error on non-Windows platforms.

* … Just pretend this particular commit doesn't exist. :OHYEAH:

* A more suitable fix. + Partial suggestions from review.

In-progress implementation of Cosmetics Navi colours.

* Convert relevant code to use Color_RGB8 sans alpha, matching the controller LED.

Defaults are now labeled for clarity.

* Revert back to Color_RGBA8. + Implement Cosmetics Navi colours.

Add Color conversion functions.

* Tidy comments.

* Changed mind yet a third time. Uses Color_RGB8 sans alpha again.

Uses CVarGetColor24 instead of CVarGetColor to drop alpha from cosmetics editor values, like how Tunic Colors does it.
This of course does require me to go with the prior idea of storing the Navi colours without alpha channels.

* Color type conversion functions removed

as they're no longer needed.

* Tidy up commented out code once more.

* Fix a typo

* Suggestion from code review. (Yeah nah you're totally right though.)

* Correct indentation.

* A minor goof in the comments was bothering me.
2023-10-30 10:55:53 -05:00
Adam Bird 671ce062d0
improve free camera reset (#3225) 2023-10-30 10:55:26 -05:00
Andrew Van Caem dab070a8a1
Added 'Fix enemies not spawning near water' checkbox to Fixes (#3179) 2023-10-30 10:55:02 -05:00
Pepe20129 e4cfc8852d
Add gRegEditEnabled (#3173)
* Add gRegEditEnabled

* Remove TCRF link
2023-10-30 10:54:53 -05:00
Adam Bird fd09a12fff
String copy util method and fix Save Manager string copy overflows (#3274)
* add safe string copy method

* use string copy for save manager

* use string copy in spoiler log hint parsing

* remove intermediate string vars

* more string copy use in randomizer methods

* use string copy in gameplay stats

* add load char array method to remove string intermediate var

* try string.h import instead
2023-10-27 15:18:56 -04:00
louist103 837072f80f
Check for compressed files in the extractor (#3292)
* Check for zip/rar header in the extractor.

* 7z
2023-10-26 19:39:26 -05:00
Eric Hoey 7d120a021f
Apply Goron Neck Length to Goron City Shopkeeper (#3289)
* Add limb override for Goron shopkeep

* Remove extra line breaks

* Fix bug with goron neck length

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-10-26 19:39:18 -05:00
inspectredc a6de59e09f
model docs (#3281) 2023-10-26 19:38:43 -05:00
Malkierian de430dc256
Fix for "Fewer Tunic Requirements" allowing child access to Fire Temple Boulder Maze (#3273)
* Add `IsAdult` to Fewer Tunic Requirements check for `FireTimer` in rando logic to preven placing items in lower maze expecting child to get them.

* After discussion, decided to change it to lock access only to lower maze so child access with dungeon shuffle remains intact.
Also changed the tooltip for Fewer Tunic Requirements to reflect the current status of what the trick enables.

* Further update to tooltip.
2023-10-26 19:38:10 -05:00
DeusVexus 743be7b684
Adds the easy Quick Put Away (QPA) cheat (#3268)
* Adds an easy qpa cheat that gives the
glitched damage value of the quick put away glitch

* Adds RegisterEzQPA(); under InitMods()
2023-10-26 19:38:02 -05:00
Pepe20129 c031edae98
Add no rando generated warning (#3263)
* Add no rando generated warning

* Update texts

* Randomizer warning messages (#4)

* Fix french typo

---------

Co-authored-by: aMannus <mannusmenting@gmail.com>
2023-10-26 19:37:51 -05:00
inspectredc 2cbbaba9cc draw a button 2023-10-26 18:41:45 +01:00
Malkierian b47164a110
Fixes custom sequences not being listed in Audio Manager dropdowns, and adds a check to the shuffle function to make sure sequences with `canBeUsedAsReplacement = false` can't be shuffled in. (#3324) 2023-10-25 13:14:26 -05:00
Adam Bird 4fc0d5a753
Fix CMake extract targets to not use absolute path for xml root (#3330)
* extract using a relative path to xmls

* pass xml root for header generation
2023-10-25 02:36:15 -04:00
Adam Bird e369ad4c86
Pass in custom assets to OTRExporter (#3328)
* bump submodules and use custom assets dir

* bump submodules
2023-10-24 20:51:54 -07:00
Adam Bird 3558a32222
Merge pull request #3315 from Archez/move-soh-assets
Move SoH custom assets out of OTRExporter
2023-10-24 20:12:14 -07:00
Garrett Cox 02f61bc3fa
Fix two missing changes after ms GI enum was changed & hint fix (#3319)
* Fix two missing changes after ms GI enum was changed

* Remove unnecessary line break from hint, and fix infinite loop within AutoFormatHintTextString

* Update soh/soh/Enhancements/randomizer/3drando/hints.cpp
2023-10-22 20:08:56 +00:00
inspectredc 77c8c832c0
Use correct save context for triforce piece collected save data (#3301)
* gSaveContext->saveContext for triforce piece save manager save

* use an arrow..
2023-10-21 20:55:55 -05:00
Adam Bird 3516b4443d
fix triforce transition offset values (#3285) 2023-10-21 20:55:41 -05:00
Ralphie Morell 2eaed8d81e
Rando: Master Sword Shuffle (#2981)
* The mother of all commits

* Removed `GI_SWORD_MASTER`;
"Master Sword" Items now actually give MS

* Removed dupe MS entries in item pool;
updated GIMESSAGE (should stop crashing on non-Windows);
re-added MS in item list

* Give Adult Link a freebie with shuffle MS on;
cihld -> adult no longer gives MS;
ToT Master Sword now gives correct item

* add master sword GI draw func based on ToT MS object

* Force `MasterSword` logic var to only update upon getting MS

* Dorf funny line now activates with LA and MS in inv

* Apply suggestions

* Updated RAND_INF;
Check Tracker changes;
Gave RAND_INF and ice trap logic to ToT MS check;
Fixed swordless behavior for HBA/fishing

* ToT MS Check now works in check tracker;
Visual bug where box hovers over non-existent MS gone;
Fixed RAND_INF check with ToT MS pedestal;
Ganon no longer gives free MS

* adult equips no longer reset in MS shuffle

* Apply (most) locacc review suggestions

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>

* Reorganized swordless check for interface to fit edge cases;
getting master sword no longer highlights box

* Edge case for BGS but no bow

* Fix implicit declaration error for GI hooks (#9)

* Adjusted `CanAdultAttack/Damage`; applied logic suggestions

* Fixed build errors (hopefully)

* Cleanup merge

* get shit working again

* Tidied up remaining uses of DD flag as rando indicator

* make master sword invisible and fix ms flag (#10)

* Add text to sheik if go mode is obtained but barrier is still up

* overhaul swordless behavior in `func_80083108`

* reworked ToT MS Check to have an actual GI

* suggestions

* Apply suggestions

* Better swordless handling with temp B (#11)

* better swordless handling with temp B

* prevent auto save in fishing pond

* prevent auto save during bombchu bowling

* enum fix

---------

Co-authored-by: Adam Bird <archez39@me.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: RaelCappra <rael.cappra@gmail.com>
Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
2023-10-21 20:51:37 -05:00
Adam Bird 12c09ecc3d Merge remote-tracking branch 'origin/develop' into move-soh-assets 2023-10-20 21:09:32 -04:00
Adam Bird c61f519f17 move soh assets out of otrexporter 2023-10-20 20:23:41 -04:00
inspectredc e6445e0ce3
Age Requirement Docs (#3277)
* age req docs

* move macros

* use decomp names
2023-10-20 18:40:10 -05:00
quellen-sol f56e839480
Add Geo rupee name (Hollow Knight) 2023-10-20 15:40:28 -07:00
Pepper0ni b294188782 Faster Swim animations, full credit to kimimaru4000
Co-authored-by: kimimaru4000 <kimimaru@posteo.net>
2023-10-20 12:35:05 +01:00
Malkierian 35b4357776
Moved `Heaps_Free` outside `Main` after DeinitOTR, and mirrored `Heaps_Alloc` before and outside of `Main`. (#3279) 2023-10-20 03:36:52 +00:00
inspectredc c3784b9758
Fix greg as reward logic (#3297) 2023-10-19 18:14:23 -05:00
inspectredc 9d581f10e7
magic (#3278) 2023-10-19 18:13:33 -05:00
inspectredc 38d70dd12f update tooltip to mention glitch use 2023-10-18 23:04:55 +01:00
inspectredc 1b2a31e34b Add success sound for toggle and equipping delay 2023-10-18 22:11:04 +01:00
inspectredc 9950c02fb2 Strength name un-greyed out and apply zoom regardless of strength disabled 2023-10-18 21:39:04 +01:00
inspectredc c22d1e724d No longer grey out bracelet as adult when toggle option is on and strength enabled 2023-10-18 21:29:00 +01:00
inspectredc 03ea465251 Toggle Strength 2023-10-18 21:21:50 +01:00
inspectredc cff2e37287
Restoration: RBA Values (#2672)
* Restore RBA Values

Matches all rba scenarios achievable in game to their original outcomes. This only ends up affecting certain trade items.

* tooltip rewrite

* rba cases generalised

* re-add to menu bar

* better byteswap and checks for endianness

* remove leftover defines
2023-10-17 09:25:09 -05:00
Garrett Cox f30e76e7b1 MVP ValueViewer 2023-10-17 08:54:52 -05:00
aMannus da92ac6a37
Audio Editor clean-up (#3256)
* Progress on SFX cleanup/sorting

* Fix crash after dev merge

* Rename vars
2023-10-17 08:29:13 -05:00
louist103 4a70fea67f
Move ZAPDTR and OTRExporter to sub modules (#3298) 2023-10-17 00:32:42 -04:00
inspectredc fe90ad0268
MM Bunny Hood effect separated from ability to equip as adult (#3253)
* adult separator

* use cross instead of checkmark

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* suggested load fix

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-10-15 18:10:24 -05:00
PurpleHato 3ed976e6af
TWEAK: Add transition to the Time Travel feature (#3276)
* ADD/ Proper Transition

* REM: Dupe
2023-10-15 18:09:55 -05:00
Adam Bird 42f6cfe66b
add save editor field for current b button item (#3262) 2023-10-15 17:25:52 -05:00
aMannus a3c52626e6
Randomizer - Colored hints (#3259)
* Colored hints

* Missed 2 french translations
2023-10-15 17:25:43 -05:00
Patrick12115 784737dc7b
[Difficulty Options] All Dogs are Richard (#3243)
* Oops, all Richards!

* Sure is
2023-10-15 17:22:47 -05:00
inspectredc 041a3792fc
Equip Tunic and Boots while performing most actions (#3239)
* tunics and boot equips initial

todo: find an appropriate place to first put Player_AssignTunicBoots

* move to more appropriate place

* assign -> use
2023-10-15 17:22:31 -05:00
Adam Bird 5ddc418777
redicle -> reticle (#3257) 2023-10-13 23:14:18 +00:00
Patrick12115 260078c871
[Cosmetic] Adds Bunny Hood to Cosmetic Editor (#3245)
* Color and Invisible Checkbox

GI model crashes when talking to mask salesman

* Update z_player.c

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* Update z_player.c

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* Move bunny hood coloring to patch

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-10-13 23:13:17 +00:00
Adam Bird 57d4d1ae20
typo on asset attribute for pal1.1 (#3264)
* typo on asset attribute

* base address fix
2023-10-13 23:12:16 +00:00
inspectredc 8c7786d4bb
Replace Race Preset Magic Numbers and Remove gPreset1 from No Logic Preset (#3255)
* magic

* Remove gpreset1
2023-10-11 15:11:04 +00:00
Adam Bird 2a356b6e9a
bump lus to latest main (#3249) 2023-10-11 15:10:47 +00:00
Adam Bird 1829a6a154
Update buildBUILDING.md and adjust cpack for Windows (#3229) 2023-10-09 15:28:22 +00:00
briaguya 7e0cb66c58
Create GAME_CONTROLLER_DB.md (#3219) 2023-10-09 15:27:31 +00:00
Julian Garritano bb23fbc143
Fix Warp Song Hints option (#3260) 2023-10-07 10:33:35 -05:00
inspectredc 095fd8b625
done (#3248) 2023-10-07 10:32:02 -05:00
Adam Bird e66be83eb7
Fix quest type bleeding through saves (#3241) 2023-10-05 15:35:49 -04:00
Christopher Leggett 85432ce496
Adds option for Lost Woods leading music to be disabled. (#3233)
In the Audio Editor Options tab, useful for hearing Custom Sequences more clearly in the Lost Woods.
2023-10-04 10:09:37 -05:00
inspectredc a92844fa92
Remove rando specific getitemid check (#3237) 2023-10-04 10:09:00 -05:00
Adam Bird b70837f5ea
N64 PAL 1.0 support (#3182)
* initial n64 pal 1.0 support - hashes and rominfo

* initial xml copy pal 1.0

* initial offset fixes

* update title copyright to be platform based

* bump lus for clearMtx

* add scripted xml definitions

* offset fixes and xml fixups

* rename and sort pal mq definition

* more offset fixes
2023-10-04 10:05:02 -05:00
Malkierian 70a83f647f
Check Tracker Update (#2668)
* Initial commit. What works so far:

Data file loads, saves, deletes, and is created properly.
 - Need to run `HasItemBeenCollected` when creating in case of mid-seed regen.
Organized checks into maps set by area.
Areas show in tracker.

 - Checks pulled from checkObjectsByArea are not currently listed.
 - Areas are being assumed completed and hidden at the start.

* Checks now populate. Still not counting area totals properly.

* Don't track RC_LINKS_POCKET in the data file, and instead manually add it in every time a save is load. rcObjects doesn't contain Link's Pocket location (duh).

* Moved ItemReceive hook to randomizer_check_tracker.cpp.

Skipped items are properly sorted and formatted.

Saved items contribute to an area's gotten/skipped checks on load.

Changed skipped items default main color to gray.

General code cleanup.

* Skipped checks now contribute to area totals for area completion logic.

* Mid-menu rework transfer.

* Started check lookup on item receive.
Tried to enable scum checking on save.

* Fixed scum check on save.

* More code cleanup, which revealed some issues with loading and saving. Loading now works 100%, but entries in checkTrackerData are disappearing in code somewhere, causing issues with later checks.

Scummed color now displays properly.

Collected but unsaved displays properly.

Unchecked, Skipped, Seen and Scummed checks all have arrows for skipping/unskipping.

Counts a little messed up, probably double adding skips.

* Fixed item counts being off across resets. Restarts were fine.

* Beginning of rework for individual check updates. Adds `Actor lastCheck` to PlayState to allow assigning of last actor to give an item. This allows precise tracking of GS, freestanding PoH, etc. Works for chests too. Currently does not work for shops, unknown for normal NPC gives. Doesn't track last gives for non-checks, like drops from grass, pots, crates, etc.

* Actor-based checks fully fleshed out, but can't help with sale-based checks. Implemented `pendingSaleCheck` to back out of an RC check cycle if `gSaveContext->pendingSale` is not NONE when `OnItemReceive` is called, processed through `OnSaleEnd`. This should be the final change necessary to streamline the checks.

* Temporary hook to message box close to tie in trackers for non-gs/chest actors that aren't added to `GetCheckFromActor`. This triggers a 2-frame countdown to check with `HasItemBeenCollected` since half of the methods in there aren't updated until after a text box closes.

Added scene tracking to get last scene so that checks in scenes that span several overworld areas could be tied to their areas properly.

Modified tracker data creation to apply Link's Pocket and Song from Impa conditionally based on randomizer settings instead of just being assumed to be done. May need modification for checking click and drag spoiler loading.

Removed the scene equivalence check from CheckChecks so that an entire area is checked each time to avoid issues with, e.g., leaving a shop before a pending sale finishes.

* Changed check data creation to use RSKs from gRandomizer to account for settings loaded from drag and drop spoilers.

* Beginning of tracker code organization.

Changed check color defaults.

* Reverted moving tracker colors to header.

Some individual check fixes.

* Missed something from previous merge?

* Removed last remnant of removed performance mode.

* Better handle checking when skullsanity is off.

* Song checks sceneIDs don't match the scenes they're actually in for some reason. Removed that check.

* SaleEnd checks don't need the GetItemEntry parameter. Also set a flag that should prevent the check tracker from running during vanilla saves should that not be resolved by the time it's merged.

* Attempting to have only the relevant checks added to the tracker data, as well as showing vanilla checks for non-rando saves. Not working yet (everything is displayed in vanilla).

* Added vanilla check tracker population via `vanillaCheck` bool in `RandomizerCheckObject`. This is also added to `IsVisibleInImGui` to handle file loading and saving to eliminate checks that aren't part of vanilla or the rando seed.

Implemented deleted tracker data file recreation.

Added some extra item name text checks. Songs are still... tricky, so they stay blank.

Utilize local copies of the randomizer check objects that are applicable for performance purposes.

Fixed vanilla item-giving cutscene crashes when triggered mid-transition.

* Apparently not all toolchains can handle macro instantiation without all parameters, like VS can.

* Fixed scummed detail color not showing properly on tracker.

* Fixed dungeon area totals and GS checks not functioning properly.

* Major revamp of checking code. Doesn't rely on `GetCheckFromActor` at all anymore, but instead simply sets a flag to evaluate a number of checks in an area every frame until the check that was gotten is identified. With the new setup, it's much less hardware intensive, and at 60fps 6 checks per frame shows no noticeable effect on framerate. I can envision needing to add a collectedCount in order to account for times when two checks are gotten one right after the other.

Changed area scroll to happen from `OnTransitionEnd`, and allow for scrolling in bazaar (was disabled previously because it would jump back and forth between Kak and Market while you were in one).

Also setup area check order updating by area instead of all at the same time.

* Fixed shooting gallery not reporting proper area.

Prevent checks from actually happening if area is RCAREA_INVALID, now that all areas are reporting something if they have checks.

Fixed `GetCheckArea()` not updating checks for standard scenes.

Lots of vanilla tracking updates, mainly manual checks for gems, medallions and songs, since the often don't have proper scenes in the data.

Prevent vanilla from triggering check loops if junk items are collected.

Fixed sorting based on saved vs collected.

Prevent item name display for vanilla runs.

Change coloring of checks so the check name reflects status in vanilla runs.

* Fixed "Recheck Area" button erroneously adding to an area's check totals?

* Fix DMC vanilla checks.

* Fix check tracker data recreation on data file loss.

Removed redundant file exists check from SaveTrackerDataHook, as it doesn't matter if it exists or not at that point.

Limited check loops to 3 to avoid infinite check loops on non-check/junk item pickup.

Added more checks to disable tracker operations if a save is not running.

Changed check ordering to put boss reward and heart container checks at the end of whatever RCSHOW group they belong to.

* Fixed IsRunning calculation.

Further improving vanilla checking.

Starting framework for checking medallions, stones, and songs on data file recreation.

Fixed medallion check collection.

Added GIFT_FROM_SAGES to check list for vanilla file for tracking light medallion.

Added check loop limitation to prevent infinite checking after picking up junk item from the ground.

* Finished vanilla file recreation and recheck (songs and dungeon rewards all check properly now). This includes deku shield with KF shop item 3.

Finished Gift from Raoru light medallion tracking for vanilla.

Commented all CheckByScene functionality for now.

* Fixed new save data file creation.

Disabled entrance area calculation for now, as it only tracks the previous entrance for some reason.

Fixed area detection for ToT checks.

* GetCheckArea() now utilizes EntranceData almost exclusively, via either `gSaveContext.entranceIndex` or the entrance tracker's `currentGrottoId` in the case of grottos.

This also means that EVERYTHING CAN AUTOSCROLL NOW. Entrance shuffles are now much easier to track.

Autoscroll is now also triggered on save, just in case someone isn't autosaving and has a lot of checks that get converted to saved.

* Fixed missing GS check in LW.

* Added area scroll on toggling Show Hidden Items. May configure differently later.

Fixed area detection for entrances in Gerudo Fortress/Valley and Collossus. Haunted wasteland doesn't autoscroll due to a bug in `OnTransitionEnd` hook, but checks still evaluate properly there.

Rely on scene-based area detection if scene is a main overworld or dungeon scene.

* Fixed grotto detection when shuffle is off.

* Small code cleanup.

Fixed Colossus hand chest checks.

* Missing lus bump from merge conflict resolution

* Fixed Colossus Grotto making `GetCheckArea` return Wasteland.

* Improved OnItemReceive processing for non-token GS checks, since they can sometimes take long enough for the checking process to time out before the item is registered as received.

* First attempt at thread safety for tracker data file writing. Seems to work, but might need more testing.

* Fixed Recheck Area not unskipping items that register as saved.

Improved delayed saving with autosaving, as the autosave triggered quite often before the tracker data save, making things not properly register as saved.

* merge cleanup

* Converted check tracker data to the sectional saves, adding `CheckTrackerData` to `SaveContext`.

Implemented section ID returning and fullSave boolean passing to section functions from my PR temporarily for it to work properly.

Moved `RandomizerCheckTrackerData` enum to `randomizerTypes.h` to accommodate that.

Changed `Randomizer_SaveInit` to a `SaveManager::InitFunc` to allow for other randomizer-dependent sections to be initialized after that. Required a little refactoring to maintain intro cutscene skip when starting a randomizer file.

* Revert section index return and randomizer init changes. Will need to wait on yet more changes to main.

* Fixed check tracker initialization (shouldn't be tied to window initialization), restored saving/loading functionality.

* Removed `CheckTracker::Init` and put SaveManager calls in `CheckTrackerWindow::InitElement`. Also a bit of cleanup from transition back to save file use.

* Fixed tracker displaying check categories while file not loaded.

* Fix Darunia's Joy check not marking in vanilla.

* Fix autosave not triggering change from collected to saved in tracker data.

* Changed default colors for scummed and collected display.

* Merge upgrade code cleanup.

* Add `OnTransitionEnd` calls to sandstorm transitions both to and from Wasteland. Also improved `gSaveContext.lastScene` assignment for both transition types. Allowed a bit of cleanup in `GetCheckArea`.

* Added `StateButton`, a button like `ArrowButton` but that allows text instead of arrow icons. Apparently the changes from ArrowButton to StateButton happened in a previous commit...

* Changed section name to `trackerDataCheck` to force SoH to load it after the randomizer section, as it required some randoSettings to be loaded first, and nothing else I tried to make the randomizer section load before it worked. This hacks a solution to checks not displaying on fast file load to a specific slot.

F*** you, SaveManager, and f*** you too, JSON.

* Forgot to change the section string for loading with the name change.

* Fix check ordering for checks that trigger the autosave.

* Adds option to remove right-side shop items (slots 1-4) from the tracker list. Enabled by default.

* Fix default state of Hide Shop Right Checks checkbox.

* Fixes grotto and great fairy scrolling and checks.

Fixes array overflow from `checkTrackerData` which was creating the issue trying to load the base and randomizer sections first, among other things.

That also fixed the massive file loads that were being exhibited in debug mode.

* Fix shooting galleries being set as collected again when being played a second time after getting the checks.

* Fix Bazaar autoscroll.

* Add Saria's Song to `GetCheckFromActor` and removed some limitations from the messageCloseCheck function to make that check track properly.

* Fix Song from Impa check.

Implemented prevention for multiple "collections" of great fairies, just in case getting the health refill would trigger it with the previous setup.

* Fix ice traps on GS tokens not triggering OnItemReceive.

* Complete fix for ice trap collection from GS.

Add autoscroll when clicking "Expand All".

* Add `OnShopSlotChange` with cursorSlot and basePrice parameters.

* Fixed include in en_ossan for shop slot hook.

Added registration for `OnShopSlotChange` in the tracker, storing the price in a new `price` field in `CheckTrackerData`.

Added "seen" functionality to shop checks. Displays the model item name upon first entering a shop, adding the price and switching to trickName (if it's an ice trap) upon navigating to the slot in buy mode, triggered by an invisible "identified" status that mirrors "seen" in every other way.

Added tooltips to most options for check tracker color picking to describe what each status actually means.

* `std::format` pls

* So apparently std::format just decided to break with the latest merge from develop, but fmt::format exists and works?

* Removed the last vestiges of `locationsSkipped`. Other general code and formatting cleanups.

Moved `IsGameRunning` to `OTRGlobals` so the item tracker could also access it.

Used preceding to "fix" item and bottle display in the item tracker on startup.

* Some more code cleanup.

Removed "Recheck Area" button and relevant code.

Backported changes to Anchor branch applicable for single-player, including making a checkAreas vector and structuring the frame by frame checks around that. Also includes fix for Silver Gauntlets and Mirror Shield check collection crash associated with those changes.

Fixed Kakariko Bazaar "seen" updates.

Fixed tracker window not showing on initial load like it should.

* Forgot 1 formatting fix.

* Removed conditions for showing Song from Impa (isn't junk under certain conditions, so should show all the time).

* Fix vanilla checks, add Zelda's Letter and Malon's Egg to manual check collection.

Fix autoscroll while in child stealth section.

* Fix crash in Happy Mask Shop in OnSlotChange (referenced non-existent shop id in a tracker-specific enum).

* General code cleanup.

* Missed one reversion.

* One more.

* Fix column alignment in `randomizer_check_objects`.

* Fix file encoding on `randomizer_check_tracker`. Again.

* Fix indentation for `actualItemtrackerItemMap`. Also removed unnecessary parts of the map.

* Rename `HasEqItem` to `HasEquipment`.

* Slightly better indentation for `actualItemTrackerItemMap`.

* Add magic bean salesman to vanilla check tracking, and genericized deku shield to trigger KF shop item 3 wherever you get the shield.

Renamed `vanillaCheck` to `vanillaHundoCheck` to (supposedly) clarify the meaning of the usage.

* One more rename to `vanillaCompletion` to avoid possible confusion with 100% speedrun conditions.

* give me a break XD

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Changes suggested by briaguya (rename `RandomizerCheckShow` to `Status`, unused code, newline formatting)

* Remove unused `itemNames` table.

* Remove `IsGameRunning` in favor of `GameInteractor::IsSaveLoaded`.

* Restore anti-spoiler functionality for dungeons with dungeon maps.

* Review cleanup.

* Fix prices not showing for Kak bazaar items.

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-10-04 10:03:36 -05:00
inspectredc b1f0c964d2
Item Tracker Combo Button Fix (#3231)
* let words be small

* change >=1 to >0
2023-10-02 14:34:37 +00:00
inspectredc 82d87ff680
Clear Cutscene Pointer Button/Cheat (#2837)
* clear custcene pointer button

* now use RawAction for button

* add button to new menu bar
2023-10-02 14:28:27 +00:00
Malkierian ebfd14974f
Modify arrow buttons in Audio Shuffle Pool Manager to be FA times and plus instead of the ImguiArrow to make the difference between "Exclude" and "Play Preview" clearer. (#3226) 2023-09-30 08:55:51 -05:00
Malkierian 6e50d7110a
Open App Files Folder (#3221)
* Add "Open App Files Folder" menu item to Ship menu on desktop platforms to open the folder where mods, logs, etc, are found.

* Change to `GetAppDirectoryPath` to get config location instead of executable/bundle path.

Also unified the absolute path creation across all platforms by using `std::filesystem::absolute`. It manages to even expand the "." returned for portable Windows mode.

* Removed unnecessary platform define check.
2023-09-30 08:55:43 -05:00
briaguya 56deb1cf64
unbreakable/always on fire deku stick (#3192)
* Adds Ultra Deku Stick Cheat

Author:    Vexus <vdfk94@gmail.com>

* implement the stuff

* move enum to a resonable spot

* Apply suggestions from code review

* Update soh/src/overlays/actors/ovl_player_actor/z_player.c

* i thought i could do everything through the gh web ui but fine i'll fix it locally

---------

Co-authored-by: Vexus <vdfk94@gmail.com>
2023-09-30 08:55:11 -05:00
Adam Bird af19645a88
Fixup remaining n64ddflag after IS_RANDO merge (#3240) 2023-09-29 16:28:16 -04:00
Pepe20129 d63c9d1774
Quest Cleanup (#3178)
* Change most n64ddFlag checks to IS_RANDO checks

* Change most isMasterQuest checks to IS_MASTER_QUEST checks

* Change most isBossRush checks to IS_BOSS_RUSH checks

* Replace isMasterQuest & isBossRush with questId

* Replace n64ddFlag with questId

Also restore authentic n64ddFlag behavior except savefile saving/loading

* Move quest enum from file_choose.h to z64save.h

* Update macros to not take gSaveContext
2023-09-26 09:20:33 -05:00
briaguya 6dd3437ad4
Update README.md (#3228)
* Update README.md

* Update README.md
2023-09-26 08:48:15 -05:00
briaguya 4c693db224
tweak shuffle pool tab to better fit voice option (#3216) 2023-09-26 08:47:18 -05:00
Adam Bird c6356853ae
fix better debug warp deku tree entrance (#3195) 2023-09-26 08:47:08 -05:00
aMannus 5d3429e04f
CrowdControl bypass voidout/die crash in pre-rendered background areas (#3186)
* Bypass camera crash when voiding/dying in fixed camera areas

* Update comment
2023-09-26 08:46:10 -05:00
Garrett Cox db10864e95
Add flag set/unset hooks and GI actions (#3065) 2023-09-26 08:45:51 -05:00
aMannus bae6cf4203
Randomizer feature: Triforce Hunt (#3062)
* Initial work to make triforce pieces their own rando item

* Disable triforce greyscaling

* Better triforce model, finish adding triforce pieces to logic

* Triforce model is now a shard

* Credits warp + start of item tracker

* Initial item tracker stuff

* Completed triangle on triforce completion

* Completed triforce model on GI done

* Multiple triforce piece models

* Triforce pieces in save editor & fix build

* Finish item tracker

* Gameplaystats timestamp

* Revert parts of logic

* More reverting

* Start of making Triforce Hunt the win condition

* Bit of cleanup

* Triforce pieces can show up as icetraps

* Grant GBK to player after hunt is completed

* Better text boxes

* Disable GBK option in ImGui with Triforce Hunt on

* Clean-up

* Forced save on completion improvements

* Update Item Tracker Settings initial size

* Small ImGui adjustments

* French translation and update defaults

* Finish translations

* Fix timer completion & 50+ triforce pieces

* Remove GI_ and ITEM_ enum usage, add french ice trap names

* Fix build & small fixes

* Review comments

* Comment clarification
2023-09-26 08:45:37 -05:00
Nicholas Estelami ccd05d8e58
Removed hardcoded skeleton types in actor draw code. (#2979)
* Initial PAL 1.1 support

* Misc fixes

* Updated game to remove hardcoded skeleton types when rendering

* Fixed weird rebase issue

* Replaced remaining skeleton calls

* lus submodule fix

* Remove OTRGui
2023-09-26 08:45:10 -05:00
PoorPockets McNewHold 098d5a8044
Add pulseaudio-libs to the necessaries dependencies (#2928)
Create a crash on extraction for systems using pipewire *(and possibly other sounds systems)*.

Co-authored-by: aMannus <mannusmenting@gmail.com>
2023-09-26 08:44:18 -05:00
briaguya 8fdee66610
[ci] silently continue when trying to delete ccache.exe if it doesn't exist (#3222) 2023-09-22 07:19:33 -05:00
Adam Bird bb643661f6
GC PAL MQ Retail support (#3167)
* initial pal mq retail support

* more mq pal support

* pal mq support in the launch scripts

* more offset fixes

* match tluts with mq debug

* update support hashes doc

* target lus commit for playtesting

* more offset fixes

* add hashes for other formats

* decomp name sync

* add scripted texture definitions

* fix up from other xml changes

* update name
2023-09-19 09:30:48 -05:00
briaguya df6c01732a
docs: remove outdated docs from BUILDING.md (#3213) 2023-09-19 09:05:37 -05:00
Ralphie Morell c3a1eb2315
Rando: More Misc. Hints (#2930)
* commit constipation

* fix inconsistencies between 3d and soh settings

* Add RSK check for Saria; Sheik now tells you other reqs for ganon

* Translations (thanks Purple and Timmy_GamerNepgear);
Retain Saria's "face-to-face" text in rando if you're too close

* fix scene renames for sheik

* whoops

* Undo LA hint setting erasure from conflict

* Clarified Sheik text IDs; Clarified final frogs hint

* Fixed Sheik text ID assignment; Fixed Saria's messages in `OTRGlobals`

* Added hint locs for sheik and saria

* Set up hook for Sheik spawn;
Sheik no longer cheats with room transitions;
Enforced text IDs on saria msg function

* Set up hook for Sheik spawn;
Sheik no longer cheats with room transitions;
Enforced text IDs on saria msg function

* Update soh/soh/SaveManager.cpp

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* nice.gif

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* got ahead of myself

* Conquered and divided; simplified stuff

* nitpicking

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* the little things i stg

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-09-18 21:02:51 -05:00
Garrett Cox 18e21e12c8
Use randomizerInf for fishing and big poes (#3088) 2023-09-18 21:34:25 +00:00
Malkierian 356e305bd3
Fixes erroneous formatting in `randomizer.cpp`. (#3194) 2023-09-16 15:59:20 -05:00
Malkierian 533f29bce9
Update to RCObjects (#3193)
* Add `vanillaCheck` to `RandomizerCheckObjects` and update the `RCObjects` table and macro.

Update `ogItemId` for many checks.

* Rename `vanillaCheck` to `vanillaHundoCheck`.

* baguette

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* Bean Salesman should be true for `vanillaHundoCheck`

* One more rename to `vanillaCompletion` to avoid possible confusion with 100% speedrun conditions.

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-09-16 15:59:03 -05:00
Garrett Cox c11a6a17e9
Some documentation changes for zplayer (#3172)
* Documentation changes for zplayer

* Update soh/include/z64player.h

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>

---------

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
2023-09-15 18:39:46 +00:00
Adam Bird a4b5d569b1
bump lus 1.2.2 (#3189) 2023-09-14 23:24:31 -05:00
Malkierian 328e6da46b
Fix warp song hints setting not loading and the check being inverted. (#3197) 2023-09-14 23:19:06 -05:00
Garrett Cox b6ce810d36
Store seed string in the save, and use it for mirror mode & enemy rando (#3175) 2023-09-14 22:15:21 -05:00
aMannus d32d8836f8
Disable CC knockback while crawling (#3187) 2023-09-14 21:54:04 -05:00
aMannus 3235f88ef6
Update CC .cs file (#3183) 2023-09-14 21:53:42 -05:00
Patrick12115 0132d3b5e2
[Difficulty Enhancement] Tree Stick Drops (#3171)
* Tree Stick Drops

* Removed Unneeded i

* formatting blunder

* Stick Lottery

* Change rand functions

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-09-14 21:52:14 -05:00
Pepe20129 3116a9c8b5
Add gDebugSaveFileMode (#3170)
* Add gDebugSaveFileMode

* Don't apply gDebugSaveFileMode on the title screen

* Re-run build

* Re-run build

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-09-14 21:51:49 -05:00
aMannus 8d3adb4c6f
Rotation options for bombs and grottos (#3146)
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-09-14 21:51:38 -05:00
Garrett Cox 7dffd63c39
Initial pass on some logging that would be helpful for debugging crashes/problems (#1457) 2023-09-14 21:31:05 -05:00
Malkierian 0a1e70ebaa
Test Tracker Rework Breakout (#3180)
* Fix indentation for `actualItemtrackerItemMap`.

Abstract equipment, quest item, and song checking for the item tracker.

* Simplify `HasSong`

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Rename `HasEqItem` to `HasEquipment`.

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-09-13 10:09:45 +02:00
Malkierian 79b5301165
[Tweak] Better GS Ice Trap Collection Handling (#3077)
* Make ice traps kick the player out of first person when collecting with the hookshot.

* Forgot the `extern`s XD
2023-09-10 12:54:18 -05:00
Caladius 023654f617
Update No Logic for previous rule set (#3159) 2023-09-10 12:53:05 -05:00
inspectredc e31b2fd9a4
Bunny hood Equip Swap Fix in Scene Transition (#3152)
* test?

no clue why this section was added

* committing to commit the commit
2023-09-10 12:52:46 -05:00
Malkierian 3d0075e6ef
Audio Editor Lock Button and Cleanup (#3140)
* Changed Audio Editor buttons to use FontAwesome icons instead of words.

Added the locked/unlocked button.

* Added functionality to lock button. "Randomize All" respects the lock, individual shuffle buttons bypass and the lock and unlock the sound.

Added tooltips to all the FA buttons.

Shrunk right side of Audio Editor window to match width of new buttons.

Unified all references to the randomized value and lock to two functions that automatically applied prefix and suffix.

Changed "Reset All" to clear the cvars instead of changing them to default.

* Fixed bug where individual randomize button didn't change the BGM if randomizing current sequence.

* Added check for unchanged BGM in Reset All and Randomize All to account for lock button blocking changes.
2023-09-10 12:48:34 -05:00
inspectredc 0f41b25918
bush drop fix (#3148) 2023-09-10 12:48:17 -05:00
Pepe20129 ccc933c59a
Rando cleanup (#3157)
* Remove 3drando setting descriptions

* Remove 3drando cosmetics

* Remove part of 3drando's menu

* Remove 3drando's music & sfx randomizers

* Remove 3drando's patch system

* Remove 3drando's citra logging

* Remove some of 3drando's custom messages

Some can't be removed (like the ganon la hint) as they are used

* Remove useless params in item_location.cpp

These types of SpoilerCollectionCheck just checked the rand inf corresponding to check and ignored the scene & flags params.

* Remove 3drando's unused check categories

* Remove some of 3drando's menu system

* Remove 3drando's preset system

* Remove some unused settings code

* Remove some unused settings

* Remove some unused ItemLocation params

* Remove SpoilerCollectionCheck::Fishing param
2023-09-10 12:46:35 -05:00
Pepe20129 5cf0eeef52
Add OnActorKill & OnEnemyDefeat hooks (#3112)
* Add OnActorKill & OnEnemyDefeat hooks

* Remove commented out code

* Re-run build

* Add missing include statements
2023-09-10 12:23:43 -05:00
Adam Bird bba0a54dbf
[Tweak] Update Rando save warning message for new file info screen (#3163)
* tweak rando save warning message

* french typo
2023-09-10 12:22:45 -05:00
Adam Bird 90af84601a
add xml definitions for all textures (#3161) 2023-09-10 12:22:24 -05:00
Adam Bird 024c5e0b5f
Sync asset names with decomp documentation (#3153)
* sync asset names with decomp

* whitespace and tweak
2023-09-10 12:21:56 -05:00
Adam Bird c3d32182a5
fix hookshot texture for hd and alt assets (#3149) 2023-09-10 12:21:38 -05:00
Adam Bird 1d9adcd5a5
fix remaining unaligned assets for mac (#3138) 2023-09-10 12:21:26 -05:00
Adam Bird b2ad348508
support for pal 1.1 change language option (#3124) 2023-09-10 12:21:13 -05:00
Adam Bird a129371923
Add extraction support for ByteSwapped and LittleEndian formats (#3042)
* add extraction support for byteswapped and littleendian formats

* update linux/mac scripts to handle v64 and n64
2023-09-10 12:20:58 -05:00
Malkierian 644ab7f498
Added a 2-second timer to autosave personal notes, based on frames idle after editing and ticked by `OnGameFrameUpdate`. (#3155) 2023-09-01 13:43:25 -05:00
Adam Bird dd37d4f9b8
regenerate asset headers with include guards (#3132) 2023-09-01 11:47:51 -05:00
Pepe20129 45b7520dcb
Add scene table (#3131)
* Add scene table

* Re-add accidentally deleted entry

* Update CrashHandlerExt.cpp

* Update CrashHandlerExt.cpp
2023-09-01 11:46:19 -05:00
Caladius 0e7c658523
V1 - Chestapalooza (#2922)
* V1- Adds additional trap variants to Chests

* Create and use OnTrapProcessed hook

* Update naming for Traps, extends to NPC and Token Rewards.

New Hook for Rando traps.

Restore Vanilla code for ice traps.

* Update soh/src/overlays/actors/ovl_player_actor/z_player.c

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* More tweaks, remove processed trap hook

---------

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-08-30 17:34:06 +00:00
Adam Bird bea24fcde7
fix audio crash when trying to detect BGM_DISABLED (#3150) 2023-08-30 17:07:21 +00:00
aMannus 7c31eafc1e
Fix ice trap message (#3158) 2023-08-30 17:05:48 +00:00
inspectredc c00ac9b878
fix mistake (#3147) 2023-08-30 17:05:08 +00:00
aMannus 8ab9346f76
Fix bombs not showing up (#3145) 2023-08-30 17:04:51 +00:00
Adam Bird f6c6bd0bec
Fix: Check for debug mode when watching cutscene debug inputs (#3133)
* fix check for debug mode when watching cutscene debug inputs

* update other cvar to debug enabled
2023-08-30 17:04:21 +00:00
louist103 4aadf4c14c
Fix more warnings. (#3101)
* Fix warnings

* Submodule
2023-08-30 17:02:07 +00:00
PhysicBerry 738172d9ed
Add Shield Aim Invert X & Y Axis Options (#3055)
* Added Shield Aim Invert Y Axis Option

Adds an option in the menu that allows players to invert the shield aiming across the Y Axis. Defaults as checked to replicate original behavior.

* Shield Aiming Improvements

Added an option to invert X Axis Shield Aiming and corrected the default value for Y Axis Shield Aiming.
2023-08-25 13:00:11 -05:00
LuigiXHero 188ec26f5a
Fix the preview in voice tab (#3142)
I forgot to add seq_voice to a line also fixed voice count and fixed the capitalization on voice

Co-authored-by: LuigiXHero <LuigiXHero@gmail.com>
2023-08-25 12:59:16 -05:00
louist103 f0035e3090
Fix hookshot dot (#3137) 2023-08-21 19:20:17 -04:00
LuigiXHero 3fb698bab8
Selection for Vanilla/MQ dungeons (#3058)
* Selection for Vanilla/MQ dungeons

* Match names to exclude location list

---------

Co-authored-by: LuigiXHero <LuigiXHero@gmail.com>
2023-08-20 13:24:08 -05:00
Adam Bird 0ce2d30605
add visualization for pause menu item cycling (#3118) 2023-08-20 13:00:43 -05:00
louist103 155f5e165a
Use a different color when aiming at hookshotable collision (#3105)
* Colors

* Use VTX data in OTR file

* Move to equipment
2023-08-20 13:00:28 -05:00
Malkierian 61eba0efad
Add toggle option for save states (#3095)
* Add toggle option for save states, off by default, with significant warning about what they actually do before enabling (double checkbox confirmation).

Add overlay text notification when attempting to use any of the state hotkeys if save states aren't enabled. Stays up for 6 seconds.

* Added coloration (yellow and orange) to the warning header.

* A little more clarification in the warning.
2023-08-20 13:00:04 -05:00
aMannus b040a894d1
Remove debug elements and visual SoA (#3086) 2023-08-20 12:59:39 -05:00
Adam Bird f19f303651
Actor Nametag System (#3083)
* initial nametag system

* add debug name tags in actor viewer
2023-08-20 12:59:23 -05:00
LuigiXHero 2da8be331b
Add voice tab to Audio Editor (#3080)
* Work on Voice rando

Todo: rename rest of entries and reorganize it into a new tab

* Finish going through voices for audio editor

Also make it, it's own tab. Added the option.

* Fixed adult link voices and recounted sound effects/voices

* Remove option

* Update soh/soh/Enhancements/audio/AudioCollection.h

Co-authored-by: Garrett Cox <garrettjcox@gmail.com>

* Remove commented out voices from sfx section

* fix spacing

---------

Co-authored-by: LuigiXHero <LuigiXHero@gmail.com>
Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
2023-08-20 12:59:10 -05:00
Adam Bird ff4d1b9f77
Tweak: Refactor 3D drops handling (#3071)
* tweak: refactor 3d drops handling

* cleanup

* add 2d bombchu drop support
2023-08-20 12:58:39 -05:00
LuigiXHero d12592377c
Change GTG to Gerudo Training Grounds in key ring settings (#3059)
Sorry it was bugging me too much

Co-authored-by: LuigiXHero <LuigiXHero@gmail.com>
2023-08-20 12:58:24 -05:00
inspectredc 55cd8c1539
Update z_kaleido_item.c to include additional bow swapping scenario on equip (#2655) 2023-08-20 12:57:27 -05:00
Pepe20129 d06e6af306
Add glitch practice cheats (#2570)
* Add fish don't despawn cheat

* Add bugs don't despawn cheat

* Add bomb timer multiplier cheat

* Only do float logic when multiplier isn't 1

* Move don't despawn cheats and fix capitalization

* Fix LUS commit change

* Re-add the bomb timer multiplier slider

* Add cvars to cheatCvars
2023-08-20 12:57:09 -05:00
Pepe20129 8872a59284
Add "More info in file select" enhancement (#3053)
* Initial attempt

* Fix rendering for most items

* Fixed icon sizes and reorganized icons

* Fix equipment, quest & upgrade icons

* Add colors to the song icons

* Remove box, clean up code & move seed hash icons to top

* Start with counters, fix copy & erase and show spoiler log hash icons

* Add icons for upgrades

* Draw icons for counters

* Initial counter work

* Fix counter digits positioning

* Prevent crashes when over 999 deaths (save editor)

* Add greg to tracker when in a rando save

* Fix color for counter digits using the wrong buffer

* Add double defense icon

* Addressed code review

* Remove unneeded checks against 0
2023-08-15 19:26:43 -05:00
AltoXorg 6923c2d3c0
Opt-in for an easy-way CMake target to create soh.otr file (#3057)
* use a convenient cmake target for gen soh otr

* Update generate-builds.yml

* Apply for all conditions

* grandma change
2023-08-15 19:26:23 -05:00
Adam Bird 74d6678543
Merge pull request #3121 from Archez/mergeSuluBravo
Merge Sulu Bravo -> develop
2023-08-14 22:01:36 -04:00
Adam Bird 633bec3a1c Merge remote-tracking branch 'origin/develop' into mergeSuluBravo 2023-08-13 20:50:59 -04:00
Christopher Leggett 8bc3077529
version bump to Sulu Bravo (#3120) 2023-08-13 20:41:57 -04:00
Christopher Leggett b94d7f135d
#3040 give em to the distro packagers + LUS submodule bump (#3119)
* implement for install method packagers

* use std::filesystem::temp_directory_path

* absolutely impeccable

* include libultraship proof

* fix windows compilation

* rename "Installation" back to "Bundle"

---------

Co-authored-by: Alto1772 <56553686+Alto1772@users.noreply.github.com>
2023-08-13 18:45:45 -04:00
Spodi fafd35cbeb
Update libultraship (OpenGL window position fix) (#3113) 2023-08-13 11:41:43 -04:00
Adam Bird 91c6eba0d0
tweak: easy pause buffer to track inputs better (#3054) 2023-08-13 11:41:19 -04:00
Adam Bird 78790fe8aa
[Accessibility] Tweak Pause menu TTS functions (#3098)
* tweak kaleido tts

* tts announce what items are assigned to buttons; announce page on open
2023-08-13 11:41:04 -04:00
Malkierian 05dde45a75
Update AudioEditor.cpp (#3115) 2023-08-13 11:40:44 -04:00
Adam Bird 535157ce00
Fix: Various Rando generation crashes (#3108)
* fix rando gen crash when not enough remaining items to place

* fix rando gen crash due to missing granny shop hint

* add error sound if rando gen fails
2023-08-11 23:06:38 -04:00
Adam Bird b2e9d547ba
fix anju rando item gives when performing an action (#3107) 2023-08-11 23:05:54 -04:00
Adam Bird 325c7fe365
fix dark links input in mirror mode (#3109) 2023-08-11 23:05:26 -04:00
louist103 d22ca3cfc3
Rewrite the logic to check for CRC32 at runtime (#3072)
* rewrite the logic to check for CRC32 at runtime

* fix include for windows

* fix pragmas

* more clang fixes

* MORE

* Please apple

* I hate this

* MAC AGAIN

* Clarify the ifdefs

* ARM64 fixes
2023-08-11 23:02:05 -04:00
Garrett Cox b2aa24b8b0
Always use dungeon specific items in randomizer, replace message on the fly (#3041) 2023-08-06 20:58:01 -05:00
Garrett Cox 1fe8835d8b
Add first draft of MODDING.md (#2954)
Co-authored-by: Ralphie Morell <rafael.morell@techfield.us>
Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
2023-08-06 20:53:52 -05:00
Pepper0ni 06548b3ceb
Fix various randomiser text issues and related improvments. (#3066)
* Reduce length of overflow prone item names

* Overhaul Trick Names and change Desert Waterfall to Valley waterfall

* Readd some old Trick names, Change Trick name table to a vector, improve french translations.

* Resolve #2682
2023-08-06 12:11:14 -04:00
Adam Bird f5ab1a9b5d
fix: disable Idle camera re-center no longer stuck on level geometry (#3094) 2023-08-06 12:05:34 -04:00
Adam Bird 04bef2d600
Fix enemy healthbar crashing on Linux (#3092) 2023-08-06 12:02:54 -04:00
Malkierian f68a4e930d
[Bugfix] Add check for animation count to prevent continuing final saw textbox while putaway is happening (#3103)
* Add check for animation count to prevent continuing final saw textbox while putaway is happening.

* Added Fix toggle for it. Enabling Skip Text forces the behavior, regardless of previous selection for the Fix toggle itself (so it works if you have the Fix toggle enabled, or if you have Skip Text enabled).

* Clarified the comment in `z_en_toryo`.
2023-08-06 12:01:19 -04:00
Adam Bird 63f61023d4
Fix: Carpet merchant rando item give distance requirement (#3102) 2023-08-06 11:56:43 -04:00
Adam Bird 855e7442ea
fix granny not checking for bottle properly (#3068) 2023-07-23 18:13:51 -04:00
Christopher Leggett 861003a093
Update LUS submodule to 1.2.0 (#3087) 2023-07-22 23:23:27 -04:00
Malkierian 93ab9f0072
[Fix] Merchant Check Fixes (#3067)
* Change Granny's Shop collection type to RandomizerInf with proper scene and inf IDs so the tracker tracks it properly.

* Changed pendingSale code to be checked outside of decrementing if block.
2023-07-12 22:03:43 -04:00
Adam Bird 423e8b96b1
fix: add missing hashes in mac and linux launch scripts (#3070) 2023-07-12 21:58:43 -04:00
aMannus 22e4020265
Fix Market Sneak with masks (#3047) 2023-07-12 21:57:43 -04:00
Adam Bird e90c8af452
Enhancement: Enemy Health Bar (#3035)
* add enemy health bar

* add more cosmetic editor options to health bar

* add tooltip

* fix enemy health texture when no magic bar
2023-07-12 21:55:24 -04:00
Adam Bird 360a97ecfd
fix: various pal gc asset offset issues (#3052) 2023-07-03 10:29:21 -04:00
Adam Bird b7dca5d5a8
Fix: Various PAL1.1 asset offsets and Main Menu options screen (#3045)
* fix pal11 ganondorf falling platform offsets

* fix pal11 dins fire offsets

* add game region and platform methods

* fix pal11 file menu options

* move
2023-07-03 10:29:06 -04:00
Pepper0ni 531b346fc9
Add exact item and check to the spoiler log for WotH hints (#3043) 2023-07-02 14:50:51 -04:00
briaguya 37f9c895d6
update hash docs (#3039) 2023-06-29 16:32:31 -04:00
briaguya def7a15354
handle random mq dungeon count better (#3036)
Co-authored-by: briaguya <briaguya@alice>
2023-06-27 19:58:36 -04:00
louist103 acfc04d0ac
Add an error for implicit functions (#3017)
* Add the flag and fix errors

* switch assert and skin matrix

* new LUS

* Use normal assert

* hopefully fix WiiU

Signed-off-by: Louis <louist103@pop-os.localdomain>

---------

Signed-off-by: Louis <louist103@pop-os.localdomain>
Co-authored-by: Louis <louist103@pop-os.localdomain>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-06-27 19:53:35 -04:00
Adam Bird a05d8131ec
invert culling for collision viewer (#3021) 2023-06-20 22:05:52 -04:00
briaguya a5c2bacfe0
fix: restore internal resolution and msaa slider functionality (#3026)
Co-authored-by: briaguya <briaguya@alice>
2023-06-20 22:04:32 -04:00
Garrett Cox 7c5efb2785
Flags stuff (#3014)
* Manual adjustments to flags

* Script run to adjust flags
2023-06-20 11:54:02 -04:00
Christopher Leggett 83ebaa2fce
Version Bump to Sulu (#3020) 2023-06-18 21:04:09 -04:00
Adam Bird 39349d8512
fix warp override mq mode room loads (#3019) 2023-06-18 18:23:06 -04:00
Adam Bird d4ff05f51d
update mac and linux launch scripts to make mods dir (#3013) 2023-06-17 13:27:59 -04:00
Adam Bird 6fdfcd2a61
More mirror mode fixes and additions (#3009)
* mirror fishing rod

* mirror ivan fairy controls

* add mirror dungeons only option

* mirror sold out GI texture

* update dungeons mirror mode for more options

* maybe don't include that
2023-06-17 13:08:20 -04:00
Malkierian 5daf5a14ac
Section Save Modification (#2947)
* Modified `SaveManager::AddSaveFunction` to return the section index assigned to the section name for ease of remembering it on the other end. Also added a clarifying comment.

* Modified SaveFunc to accept a boolean for whether the section is being saved individually or as part of a game save (fullSave == true means game save, so all sections registered for game save sync).
2023-06-14 23:39:14 -04:00
Bytenex 279c40cb7d
added option to choose between OoT and any ocarina (#2944) 2023-06-14 23:29:07 -04:00
Garrett Cox f85b04336c
Add option to prevent speed modifier from affecting jump velocity (#2874) 2023-06-14 23:25:48 -04:00
Garrett Cox 170c8ce16e
Extra modes tweaks (#2985)
* Tweaks to extra modes menu

* Update soh/soh/config/ConfigUpdaters.cpp

Co-authored-by: Christopher Leggett <chris@leggett.dev>

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-06-14 23:24:50 -04:00
Adam Bird 6dc227b5ed
order spoiler log print out to match insertion order (#3006) 2023-06-14 23:23:12 -04:00
briaguya ccfc2a84bc
hide menu bar from menu bar (#2988)
* hide menu bar from menu bar

* show `-` on switch/wii u

* actually show `-`

* actually put the thing in a place where it works

* spacers

* reorder and use `[-]` instead of `-`

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-14 23:22:48 -04:00
briaguya af33897e4c
caps for locations in altar text (#3004)
Co-authored-by: briaguya <briaguya@alice>
2023-06-14 23:22:22 -04:00
Adam Bird a842894d0d
Add Mirror World gfx patches and patch Royal Grave Sun Song etching (#3005)
* add mirror world gfx patches and patch royal grave sun song

* simplify nonmq vs mq
2023-06-14 23:22:04 -04:00
briaguya ef6227d8be
fully remove OTRGui (#2982)
* linux local debug working

* built in extraction working on linux

* try a thing

* one more thing to try

* try using dir

* does this get the subdirectories?

* component before pattern

* loop i guess

* maybe component was the issue?

* zapd stuff i guess

* maybe this

* this feels promising

* g != q

* appimage is working, try fixing glfw issue on windows

* don't copy zapd.exe

* hopefully this gets the things we need in the assets dir

* is that where those went?

* try another thing

* another thing to try

* grasping at straws

* cmake makes no sense sometimes

* really just trying anything here now

* this is what i was expecting to work

* ls

* try doing it without the cmake again

* i think this might do the trick

* try with a slash

* one more thing to try

* pal_oot.txt

* maybe this makes things work on mac

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-13 09:29:36 -04:00
AltoXorg 621aab3e05
fix ExtractAssets for N64 PAL 1.1 (#2963) 2023-06-13 08:48:31 -04:00
Garrett Cox 7a41bd3878
Mirrored world enhancement (#1569)
* Mirrored world PoC

* invert culling for health meter and A button action

* A few more fixes

* Fix for item equip animations

* Fix for pause triforce

* Mirror scenes with static backgrounds

* mirror minimap for mirror world

* mirror dungeon maps and icons on the pause menu

* mirror overworld map and icons on the pause menu

* mirror debug world movement

* mirror shops cursor and movement

* use flip flag

* Reverse crouch stab x axis for mirror mode

* use invert culling command and clean up culling logic

* Move mirror mode handler to mods and support random modes

* Small cvar tweaks

* mirror billboard score numbers and fix gyro horse mirrored inputs

---------

Co-authored-by: Adam Bird <archez39@me.com>
2023-06-13 08:46:15 -04:00
Garrett Cox 90d45d4397
Rename gDirtPathFix to gZFightingMode (#2959)
* Rename gDirtPathFix to gZFightingMode

* Add config migration
2023-06-12 20:40:29 -04:00
Garrett Cox a6ecb77599
Add spock race preset (#2977) 2023-06-12 19:26:46 -04:00
Adam Bird 90bd072f9b
fix string usage for cosmetic hud placement reset corrupting ship json (#2961) 2023-06-12 19:16:39 -04:00
briaguya 6de0d8b69d
properly set imgui invert aiming y default (#2956)
Co-authored-by: briaguya <briaguya@alice>
2023-06-12 19:14:42 -04:00
Adam Bird e6e7618b92
fix crash when resetting links scale without a playstate (#2970) 2023-06-12 19:06:41 -04:00
aMannus 971aaeac23
Disable greying out RTA timer in boss rush (#2973) 2023-06-12 19:01:54 -04:00
aMannus daadef5211
Fix missing goron bracelet (#2974) 2023-06-12 19:01:24 -04:00
briaguya 16eb211102
fullscreen with f11 not f9 (#2955)
* fullscreen with f11 not f9

* update readme

* use latest lus main

* latest lus

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-12 18:59:30 -04:00
Christopher Leggett 430d5cddf2
Config versioning to fix the Fullscreen Shortcut debacle (#2966)
* WIP adding new config version.

* Implements a ConfigVersionUpdater

* Updates to account for new LUS-side changes.

* Change `ConfigVersionUpdater` to store `toVersion`

* fix typo
2023-06-12 18:59:23 -04:00
briaguya eba0b4c146
only green the greg bridge not everything else (#2962)
* only green the greg bridge not everything else

* another option

* do it the branch way

* tabs spaces blarg

* new dir

* use latest lus main

* latest lus main

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-12 17:48:26 -04:00
Adam Bird ca9b1614af
Fix: Minimap dungeon entrance placement (#2958)
* use correct minimaps in randomizer

* fix minimap dungeon entrance placement

* rework topLeft0 check to be more readable

* who needs topLeft0 anyways

* move minimap hidden checks up higher
2023-06-12 17:10:53 -04:00
Christopher Leggett 21560ecf65
bump up to latest LUS. (#2984) 2023-06-12 16:58:31 -04:00
briaguya d69c07cd75
numbers aren't magic (#2976)
* numbers aren't magic

* chest style matches contents

renamed everything except the cvar itself at this point
(waiting for versioned configs for that)

* tracker as part of names

* finish the tracker rename

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-09 17:22:25 -04:00
Amaro Martínez e46c60a7a1
Fix copyright position for PAL 1.1 (#2952) 2023-06-07 13:02:45 -04:00
Nicholas Estelami 7e1ee6e23e
N64 PAL 1.1 Support (#2773)
* Initial PAL 1.1 support

* 1.1 Asset Fixes

* Fixed issue where N64 builds were being flagged as MQ

* Misc fixes

* Updated LUS submodule

* Fixed up logo strings

* Updated readme and linux/mac scripts with new hash
2023-06-05 19:11:22 -04:00
Adam Bird 820fdf78cc
Improve TTS for file select menus (#2950)
* improve TTS for file select menus

* french translation change recommendation
2023-06-05 17:18:18 -04:00
Kenix3 451ce8b107
Fixes collision viewer (#2949) 2023-06-05 16:19:42 -04:00
Christopher Leggett f3672a480f
Re-adds Wii U nightly build link (#2951)
Now that we have Wii U building again, re-add the nightly link for it to the README.
2023-06-05 15:59:02 -04:00
briaguya a49f197f06
build for wii u (#2946)
* reimplement stuff from 2879

* header include to fix build hopefully

* another header

* fix error

* remove header includes we don't have

* more error things

* a

* b

* c

* d

* e

* f

* g

* h

* use latest lus

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-05 14:16:56 -04:00
briaguya 2308ab8823
build soh with LUS 1.0.0 (#2881)
* Bump LUS

* Ship -> LUS namespace change

* z_scene_otr Ship -> LUS namespace

* Starting to get SoH to build with LUS imgui changes.

* start stuff

* gamecontroleditor build issues resolved maybe

* cosmetics editor and what not

* console

* actor viewer

* more stuff

* more stuff

* on to errors that make sense

* putting this down for a bit

* no idea what these errors mean now

* some kind of progress maybe

* latest lus main

* more

* back to linker errors and being lost

* Fixes command function signature.

* More fixes

* Even more fixes

* Bump LUS

* More Fixes.

* Fixes even more errors.

* lus bump

* input editor as var

* audio editor working

* it builds with this

* bump lus

* it opens

* bump lus to latest main again

* make sure to do all the command registering in debugconsole

* lus and what not

* switch type stuff plz

* undo

* do the thing that fixes the thing

* fix mac?

* correctly show/hide menubar on boot

* bump lus

* input blocking updates

* bump lus

* Bump LUS

* Press F1 to open enhancement menus moved to SoH

* lus and rendering backend stuff

* audio backend and lus

* Bump LUS

* Fixes WindowBackend dropdown

* Bump LUS

* misc -> utils and moves binarytools to utils.

* Window refactor

* bump lus

* make it work

* Fixes for moved files again

* Bump LUS

* Mercury -> Config

* Bump LUS

* Reacts to removed LUS hooks and bump LUS

* Remove Hook: GfxInit

* Removes debug audio_setgamevolume to 1

* use non-crashing branch of lus

* fix: make audio init work without hooks

* game icon stuff

* multifix bmp

* use input viewer class branch for now

* just "Ship" it's cleaner

* Bump LUS

* Removed ExitGame hook.

* Bump LUS

* Hook system removed from LUS.

* More LUS updates

* Changes to make window position saving.

* Bump LUS

* Bump LUS (for real)

* LUS resources now return a specialized pointer.

* Bump LUS

* Fixes issue in SetPathways::GetPointerSize

* Bump LUS to 1.0.0

* builds but crashes

* fix crash

* better macro names in debug console

* remove commeted out line

* remove redundant check tracker settings window logic

* remove commented out line

* move the *

* remove extra seqplayers enum def

* this sneaky little guy was hiding behind a wii u ifdef

* remove extra check tracker header

---------

Co-authored-by: Kenix <kenixwhisperwind@gmail.com>
Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
inspectredc d922b91e15
Trick logic (#2681)
* Trick and Glitch Rando UI implemented

* initial temp connection between ui and backend trick logic

Hacky way to connect the logic for testing. Ran into 1 crash but cannot reproduce

* UI overhaul to look more like AudioEditor tag section

* Mapped 3d tricks to enums and save cvar bug fixes

* Trick Logic Complete

Testing on whether the logic works as expected needs to be done

* Releasable trick version, tricks match text fixes also

* Remove 3D glitch logic location access

Easier to clean it up now than get confused

* Variable typo fix & initial trick enum reorganisation

* Removal of oot3d glitches

* bongo logic fix

* UI includes difficulty tags + cleanup and removal of glitched logic interface

* Bug fixes

* added enabled tricks to spoiler log

* comment clean up

* completed once over through logic

* merge fix

* update sohimgui to LUS

* Remove redundant 3d rando trick options

* Comment clean up

* Central GS Irons Logic Fix

* Farores wind central logic fix

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-06-02 16:53:07 -04:00
Malkierian c9bcd64beb
Improvement: Additional Spoiler Hint Info (#2727)
* First attempt at tracking hinted locations. Not looking promising for more than a hint tracker.

* Spoiler log now generates with human-readable hinted area, type, and item for gossip stone hints.

* Hints now only output location if their hint text specifically states the check. Any overworld or dungeon region hint no longer does.

* Expanded gossip stone hints to include item, hinted location and area, and `RandomizerGet` names. Currently only English names.

Part of this required changing `HintType` into a `typedef enum` instead of an `enum class` to allow usage in a .c filespace, and consolidating types from `randomizer_check_objects.h` to `randomizerTypes.h`.

* Beginning of alter rewards information.

* Step 2 of altar reward info.

* Altar reward info (location and area) now writes to and reads from the spoiler log. Added a few entries to `SpoilerfileAreaNameToEnum` to accommodate area name variants from region hint names.

* Streamlined altar data (only needed location name for `RandomizerCheck` translation. `RandomizerCheck` provides access to `RandomizerCheckArea` via `RandomizerCheckObject`).

Added Light Arrows, Greg, and Dampe's Hookshot hint locations to write and read of the spoiler.

* Fix attempts to lookup values in `hintTypeNames` as array, now uses map's `find()`.
2023-06-02 12:10:25 -04:00
Christopher Leggett f976003563
Randomizer: Fixes defaults for LACS and Rainbow Bridge. (#2937)
* Fixes incompatible default rando settings around Greg as reward.

* Fixes defaults for LACS.
2023-06-02 08:28:32 -04:00
briaguya 598566a556
Update generate-builds.yml (#2941) 2023-06-02 01:09:18 -04:00
Adam Bird c9d24f2e98
Fix: Better debug warp MQ detection and other warp menu bugs (#2932)
* fix: add mq detection to better debug warp

* replace special characters for debug warp translations

* reorder better debug warp printing

* adjust french translation
2023-06-01 22:00:45 -04:00
Josh Bodner 6bf42fd018
Fix order of auto equip message (#2931)
French text was being displayed in English and vice versa due to incorrectly ordered parameters.
2023-06-01 21:40:58 -04:00
aMannus 2957dc61c3
[Feature] Boss Rush (#2923)
* Ganon(dorf) cutscene skips

* Remove leftover code

* Load into chamber of sages

* Fix loading into chamber without fast file select

* Boss warps in chamber done

* Change warps back to chamber

* Initial proof of concept done

* ganon(dorf) cutscene skips

* Code cleanup & auto age equipment

* Gameplay stats timer + tweaks

* Scuffed timer

* Better timer

* remove arena props + fix arena exits

* Fix blue warps

* Attempt to fix build

* Fix build again

* And again..

* Try no. 9001

* Handle dying and saving

* Child link face fire medallion

* Fix build

* Fix warps after reset/death

* Disable doors and move player spawns in boss rooms

* Fix boss rush logo rendering

* Start of ingame options menu

* File Select cleanup

* Fix build

* Render char text PoC

* Move functions to be more generic

* Fix build

* Fix other builds

* Initial text scaling/kerning

* Special characters prep

* All special characters work now

* Attempt to fix build

* Fix build question mark

* Finish all kerning

* Start of ingame options menu with vertical scrolling

* Barebones functional options menu

* More options menu progress

* More visual elements for options menu

* Options menu visual changes, implement all options, tons of cleanup

* Cleanup and comments

* Shorter enums

* More options

* Change default heart count

* Finish French translations

* Implement timer in cosmetics editor

* Uncomment timer requirement

* Variable name change

* German translation & small UI tweaks

* Animated up/down arrows in options UI

* Better arrows in options UI

* Cleaner timer + make it usable for general gameplay

* More cleanup + ganon & ganondorf boss option

* Implement never heal option

* Slight up arrow in options UI tweak

* Add BGS option

* Reintroduce ganondorf cutscene skip

* Change encoding to UTF on bossrush.cpp

* Fix build hopefully

* Fixed static variables leading to options not properly resetting

* Fix BR completed timestamp

* Change timer to render on top of everything

* Offset final BR time by 0.1 second from boss timestamps

* Add missing check for boss rush

* Implement soh_assets.h

* Revert merge mistake

* Fix special characters with UTF-8

* Fix build

* here's the fix you can merge from your phone

* Fix quest select crash with oot.otr only

* Use OoT's kerning

* Fix HD textures on options menu

* Fix special character kerning

* "Heal every boss" fixes

* Seperate headers + bunny hood option

* Remove GetUnixTimestamp() externing

* Clean up extern "C"'s

* Address review comments

* Fix build question mark

* Remove accidental styling change

---------

Co-authored-by: briaguya <briaguya@alice>
2023-06-01 21:40:10 -04:00
Rozelette fdf9086b2a
Dynamic Actor IDs (#1729)
* Add dynamic actor IDs

* Convert Ivan to use new actor system

* attempt to fix linux build

* attempt to fix linux build

* merge

* Cleanup

* Fix missing math functions on Windows.

* Removes a stubbed function to fix non-windows builds.

* Update soh/soh/ActorDB.cpp

Co-authored-by: Adam Bird <Archez@users.noreply.github.com>

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
2023-06-01 21:39:50 -04:00
MoriyaFaith 26d934541a
main commit (#2918) 2023-06-01 21:38:43 -04:00
aMannus b25e4d4f26
[Feature] In-game gameplay stats timer (#2910)
* Implement in-game gameplay stats timer

* Change timer to render on top of everything
2023-05-30 18:57:45 -04:00
inspectredc e8eaac4d77
Fix: Switch Age with Enchancements giving kokiri sword (#2929)
* fix sword

* separated flow path for switch age enhancements

* Added comments
2023-05-30 18:44:58 -04:00
Ralphie Morell 71662c56b5
Docs: Update Player/Actor Flags (#2765)
* Actor Flags update

* player state1 flags; cleanup; prep for state2 and state3

* Player state2

* player state3

* Rename flags in Player tab
2023-05-30 15:05:04 -04:00
Patrick12115 f544aba647
[Rando] Adds Greg options to the Bridge and LACS reward options (#2663)
* Some reason not working

* Fixes and formatting

Moved the LACS Stones to be before the Medallions in all instances to line up with the Bridge requirements and because it just makes sense

* Removed unnecessary space

* Missed one
2023-05-30 14:25:59 -04:00
Ralphie Morell 507387f618
Enhancement: Better Debug Warp MQ toggle (#2876)
* Implement MQ select on better debug warp

* remove unused macro

* Add sound when selecting MQ; only change if highlighting MQ-able map

* Handles map select from MQ file
2023-05-30 14:01:04 -04:00
Christopher Leggett 700fba28dd
Fixes regression in random rupee names (#2927)
Technically was a CustomMessageManager bug but it was in a function that I believe is only used for random rupee names.
2023-05-30 08:45:33 -04:00
Caladius edc5e8f7d4
ShadowTag (7.0.1) (#2825)
* Add Checkbox in Extra Modes
Spawn Code in mods.cpp
Category Change for Clear Room Exclusion
Kill Actor if Mode is Disabled

* Fix non door scene changes and adds a delay to avoid misfiring or not firing on quick room changes like falling to B1 in Tree and Lost Woods loading triggers.

* Requested Updates
2023-05-28 18:46:18 -04:00
Garrett Cox 3ab547c69d
Update cvar clear lists and add cheatCvars clear list(not currently used) (#2869) 2023-05-28 18:42:34 -04:00
Malkierian 0c7e80a190
Improve Controller LED Control (#2864)
* Add brightness control and on/off toggle for tunic LED colors.

* Removed toggle, mentioned brightness of 0% for turning off LEDs.

* Set up grabbing tunic color values from Cosmetics Editor for cosmetics sync.

* Why these stupid differences between Windows and Linux compilers?

* Fix Mac build errors? Also try to move the color fetching back into the switch statements to lessen potential computational load.

* Real fix?

* Move "Customize Game Controls" button under "Controller Configuration" button under Settings -> Controller. Renamed "Controller Configuration" to "Configure Controller" and "Customize Game Controls" to "Customize In-game Controls"

* Added LEDColor and LEDColorSource enums for code clarity.

Moved controller LED brightness to new LED Colors group in "Customize In-game Controls" menu.

Added combobox to choose between vanilla tunics, cosmetics tunics, health, and custom as color sources.

Added critical health override checkbox to allow display of red when health is low even when other sources are selected.

Port color pickers have not been implemented yet, default color is white.

* Moved LED control to OTRControllerCallback and wrapped it in a check to `CanSetLed()`.

* Move settings to Port 1 tab in Customize In-game Controls and limited application of colors in `OTRControllerCallback` to port 1.

* UI clarity updates.

* Removed unnecessary LED color enum.

Added custom color picker to port 1 color settings.

* Changed Critical Health Override default to true.

* Modified logic to not do color fetching and instead default to {0,0,0,0} when brightness is off.

* Fix bad cvar string for custom color.

* Cleaning up some post-merge artifacts.

* Update soh/soh/Enhancements/controls/GameControlEditor.h

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>

* Some name changes.

* idea for cleaning up controller callback stuff

* Rearranged color source checks to make sure criticalOverride is applied regardless of other settings.

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
Co-authored-by: briaguya <briaguya@alice>
2023-05-28 18:40:53 -04:00
aMannus cebfcd1d88
Hyper enemies (#2887) 2023-05-28 18:14:07 -04:00
Garrett Cox b9c2640671
Use gBuildVersion instead of sohStats.buildVersion for gameplay stats (#2913)
Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-05-27 18:09:24 -04:00
Christopher Leggett f4fbc79b5d
Merge pull request #2889 from Malkierian/sectional-saves
Sectional Saves
2023-05-27 16:22:36 -04:00
Christopher Leggett a1d22abc1b
Merge pull request #2919 from Bytenex/patch-1
Update README to include tools
2023-05-27 15:18:52 -04:00
Christopher Leggett f9a4070225
Merge pull request #2920 from Archez/fix-granny-unshuffled
Fix: Use blue potion refill for Granny Shop item when unshuffled
2023-05-27 15:18:33 -04:00
Christopher Leggett f25c200526
Merge pull request #2890 from Archez/support-thieves-hideout-keyring
Expose Thieves' Hideout selection for keyrings in randomizer settings
2023-05-25 21:06:52 -04:00
Malkierian cab90e9ac6 Removed unused variable. 2023-05-25 16:59:53 -07:00
Malkierian d0c09394ca Re-added removal of empty `sceneTimestmps` objects for saving and loading, significantly reducing `sohStats` size. 2023-05-25 16:57:27 -07:00
Adam Bird 015c30d3b6
Merge pull request #2 from leggettc18/gf-keyring
Adds validation to GF Key Ring and Key Ring Count settings
2023-05-25 15:57:56 -04:00
Adam Bird 718ded7c44 fix: use blue potion refill for granny shop item when unshuffled 2023-05-25 15:47:51 -04:00
Christopher Leggett f6b9c227d7
Fixes bad Key Ring Count under certain conditions. 2023-05-25 15:42:22 -04:00
Christopher Leggett 13513345bf
Remove magic numbers and fix formatting. 2023-05-25 15:35:38 -04:00
Christopher Leggett 8f5538a700
Adds validation to GF Key Ring and Key Ring Count settings. 2023-05-25 14:50:28 -04:00
Malkierian 1fa99fd50a What a nightmare that was. 2023-05-24 13:00:35 -07:00
Bytenex b46d6e2d19
Update README.md 2023-05-24 16:35:38 +02:00
Bytenex ab4ad42486
Update README.md 2023-05-24 10:34:10 +02:00
Christopher Leggett fe6705cc4d
Merge pull request #2906 from HarbourMasters/develop-spock
Spock -> develop
2023-05-23 09:18:15 -04:00
Christopher Leggett e88adbe672
Version Bump (#2916) 2023-05-22 21:34:18 -04:00
aMannus dddd3b14aa
Add back missing Greg timestamp (#2911) 2023-05-22 10:56:44 -04:00
briaguya f34df2f064
remove what i assume to be accidentally copied stuff from a diff (#2909) 2023-05-22 09:33:31 -04:00
Rozelette f005bd3b7f
add skeleton unregistration to actors that manage their own skeletons (#2908) 2023-05-22 09:20:06 -04:00
Garrett Cox 5de1240391
Cleanup gameplay stats code/UI and support RTA timing (#2862) 2023-05-21 18:35:56 -04:00
Patrick12115 7962e0e6d6
Add Scene Specific Checks to Dirt Path Fixes (#2907)
* Move from Dev to Dev-Spock

* Moved to mod.h

* Update GameInteractor.h
2023-05-21 18:12:25 -04:00
Malkierian cf711d9164
Initialize `gSlotAgeReqs[SLOT_TRADE_CHILD]` and `gItemAgeReqs[ITEM_MASK_BUNNY]` on load initialization according to `gMMBunnyHood` and `gTimelessEquipment` to prevent bunny hood from being unequipped from adult equips on first load. (#2904)
Move the code to change those values based on the child trade slot item to the selecting mask loop to not be setting them every frame just because you're in the inventory.
2023-05-21 12:13:38 -04:00
Adam Bird cf42057842
Fix: seed srand on launch and fix spoiler log for seed testing generation (#2902) 2023-05-20 16:25:29 -04:00
Malkierian 0b47a19c2c
Mask Sale Fix (#2900) 2023-05-20 12:05:47 -04:00
Christopher Leggett 4d02d89e03
Fixes buying songs crash on Switch (#2899) 2023-05-20 09:24:02 -04:00
Malkierian 8d0b83b691
Merge branch 'HarbourMasters:develop' into sectional-saves 2023-05-19 14:56:19 -07:00
Christopher Leggett f2f5a75cb0
Custom message improvements (#2892)
* Adds const specifiers to some appropriate functions.

* Implements move semantics for ReplaceStringInMessage.

Should result in much fewer allocations when rendering custom messages during a Randomizer playthrough.

* Implements some more move semantics.

* First pass on improved Custom Messages API.

This should allow for fewer allocations during randomizer seed generation and runtime, plus a couple of other enhancements that utilize custom messages. It does this by taking advantage of move semantics to prevent extraneous allocations when string literals are passed in. It also takes advantage of OOP to hopefully end up with a cleaner API.

* Additional API/allocation related improvements.

* Removes an unnecessary destructor and constructor.

* Updates documentation

* Adds a bit more documentation.

* Fixes switch build problem and minor syntax error

* Renames slightly unclear operator parameter

* Replaces magic numbers with LANGUAGE_MAX
2023-05-17 22:24:24 -04:00
AltoXorg 30cc61abce
fix search rom extension oversight (#2891)
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-05-17 22:22:57 -04:00
Amaro Martínez b361d5ede1
Use UTF-8 for MSVC and enable visual styles for Windows (#2888)
* Add proper manifest for Windows

* MSVC: Use UTF-8 encoding compile option
2023-05-17 22:21:26 -04:00
Malkierian 099d9cd0fd
Threaded save was causing issues for old `oot-save.sav` conversion. Added an option just for that instance to run `SaveManager::SaveFileThreaded` outside of a thread. Everything else still runs threaded. (#2894) 2023-05-17 15:51:17 -04:00
Adam Bird 5244cda90e expose thieves hideout selection for keyrings in randomizer settings 2023-05-16 17:40:50 -04:00
Malkierian 4cf3172a3d Fixed trying to emplace in `sectionRegistry` without index. 2023-05-15 17:40:10 -07:00
Malkierian 1a9ef29ac5 Added function to get sectionID for a specified section name, returning -1 if section name not registered. 2023-05-15 17:32:49 -07:00
Malkierian 50fbe5d00c Modified sectional saving to utilize an integer ID for calling specific sections to cut down on string copying. Utilizes enum values for non-mod sections to allow for cross-project use of those IDs, and sets up `AddSaveFunction` to add mod sections after that using max value enum. 2023-05-15 17:21:14 -07:00
Malkierian 4bc0d7d60d v3 >:( 2023-05-13 18:41:10 -07:00
Malkierian b5740bc878 v2 2023-05-13 18:35:27 -07:00
Malkierian 374301db9b Formatting and whitespace cleanup. 2023-05-13 18:29:05 -07:00
Malkierian 7861b4c092 Missed `baseBlock` -> `saveBlock` change in WiiU/Switch file writing block XD. 2023-05-13 12:33:10 -07:00
Malkierian 22531fed27 A little more code clarification. 2023-05-13 11:47:22 -07:00
Malkierian e2177d7392 Added sanity check to clearing `sectionBlock["data"]` to only be for randomizer and only when the save file is not randomizer (to clear the existing structure from the loaded spoiler log). 2023-05-13 11:45:20 -07:00
Malkierian 550c10b1c3 Little bit of code clarification. 2023-05-13 11:41:28 -07:00
Malkierian dbe672444c Changed string paramaters for save functions to proper const pointer type.
Implemented subsectional saving (handled in the section's save function, and passed to the save function by & pointer). Default of "all" passed in from SaveFile for game saves.

Implemented subsectional saving for sohStats and entrances/scenes discovered.

Fixed check for game save registry by putting the check against the registry in the "all" section save code.
2023-05-13 11:26:30 -07:00
Malkierian 42b35634a5 Fixed residual values in global save block causing new files to save all sections previously loaded for metadata initialization, regardless of that section's execution during the save process.
Fixed loading and saving of blank sceneTimestamps due to default construction of data structures during JSON loading making all "empty" entries have scene and room of 0.

Moved SoH stats initialization to `gameplaystats.cpp` via `SaveManager::AddInitFunction`.
2023-05-12 15:18:26 -07:00
Malkierian 685925cbb8 Moved `sohStats` to its own section, and moved the saving and loading to its own registered load and save functions within `gameplaystats.cpp`. Required making a new loader version for `base` without `sohStats` loading code.
Improved save file efficiency by adding code to not write any "empty" entries in `sceneTimestamps` (as determined by room and scene being 254) when saving, and initializing them to 254 if not loaded from the save file.
2023-05-12 13:23:50 -07:00
Malkierian 2ae713464d Moved sohStats to separate section, load and save code now in `gameplaystats.cpp`. Still needs new load version for base? 2023-05-11 12:02:04 -07:00
Malkierian 2a8810d6a5
Merge branch 'HarbourMasters:develop' into sectional-saves 2023-05-11 09:56:08 -07:00
briaguya 7dff8b6efc
Spock Bravo -> Develop 2023-05-11 00:15:37 -04:00
Christopher Leggett d8891f1fe4
Version Bump (#2867) 2023-05-10 21:57:22 -04:00
Garrett Cox 85385db099
Use OnGameFrameUpdate for rainbow tick instead of relying on ImGui hidden window (#2872) 2023-05-10 21:48:01 -04:00
briaguya d1c930b5e5
reserved thread count (#2868)
* reserved thread count

* add comment, use latest main

---------

Co-authored-by: briaguya <briaguya@alice>
2023-05-10 21:32:15 -04:00
aMannus 6d4761f349
Fix several enemy ID's for Hyper Rush (#2871) 2023-05-10 20:44:40 -04:00
Malkierian 07bfba0162 Preliminary work on persistent save data json block.
Added autosaveRegistry to set section to save with overall autosave triggers.
2023-05-10 14:10:13 -07:00
aMannus 23d89122b3
CC: No longer rely on received parameter to be 0 (#2870) 2023-05-10 09:15:33 -04:00
Garrett Cox 2ea72f835a
Cleanup cvars that are set on boot (#2863) 2023-05-10 09:08:35 -04:00
Christopher Leggett a72997f12b
RANDO: Fix logic with OGC and mixed entrance pools (#2830)
* RANDO: Fix logic with OGC and mixed entrance pools

Adds a `GANONS_CASTLE_LEDGE` area and a `BuiltRainbowBridge` logic var. Added an event to `GANONS_CASTLE_GROUNDS` that sets `BuiltRainbowBridge` to true. Adds Entrances for `GANONS_CASTLE_LEDGE` to `GANONS_CASTLE_GROUNDS` when `IsAdult` and `BuiltRainbowBridge` (or the glitched logic that lets you skip the rainbow bridge) are true, `HYRULE_CASTLE_GROUNDS` when `IsChild` is true, and `GANONS_CASTLE_ENTRYWAY` When IsAdult is true (if child enters `GANONS_CASTLE_LEDGE` in game they are in `HYRULE_CASTLE_GROUNDS` and thus cannot go back into GANONS_CASTLE_ENTRYWAY). Adds Entrance for `GANONS_CASTLE_GROUNDS` to `GANONS_CASTLE_LEDGE` when `BuiltRainbowBridge` is true, or when the glitched logic that lets you skip the Rainbow Bridge is true.

* Adds intermediate area for age-gating

* Fixes the logic for actually killing the skulltula

* Adds hammer crouch stab as a way to kill OGC_GS
2023-05-09 23:41:45 -04:00
Adam Bird c70bdb7700
improve built in extraction detection (#2865) 2023-05-09 23:39:57 -04:00
briaguya 72358eb4d7
fix for day/night textures (#2853)
* hacky fix for deku tree entrance

* lonlon windows

* only hack in one place instead of everywhere

* dehack deku

* goron city entrance

* gerudo cell, zd entrance

* kak windows

* fix pot house

* back to the hacks

* back back

* space

* globals

* just hack it together to fix em all

---------

Co-authored-by: briaguya <briaguya@alice>
2023-05-09 23:33:27 -04:00
briaguya b887d38f5f
bump LUS for thread stuff (#2866)
* bump for threads

* use latest lus main

---------

Co-authored-by: briaguya <briaguya@alice>
2023-05-09 23:04:02 -04:00
aMannus 23d40c1ca5
Fixed small error in CC .cs file (#2858) 2023-05-08 20:58:42 -04:00
Adam Bird caf8f1badc
fix own dungeon items not using rando GI item when boss rooms are shuffled (#2859) 2023-05-08 15:44:50 -04:00
Kenix3 77987a42cf
Bump LUS (#2855)
* Bump LUS

* Ship -> LUS namespace change

* z_scene_otr Ship -> LUS namespace
2023-05-07 23:01:12 -04:00
Christopher Leggett b166bdd3fc
Reverts part of PR #2851 that required OTR regen. (#2856) 2023-05-07 22:54:54 -04:00
briaguya f5aacaf38b
fix build (#2852)
Co-authored-by: briaguya <briaguya@alice>
2023-05-07 20:48:55 -04:00
Lutzx fac898d759
Add stdint headers (#1) (#2832)
* Add stdint header

* Add stdint header

Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-05-07 20:23:12 -04:00
Kenix3 91bd693ff6
Bump LUS version (#2849)
* Bump LUS version

* Removes the "now" boolean from the LUS resource bridge functions.

* Bump LUS

* More LUS bump

* Update soh/soh/resource/importer/AudioSampleFactory.cpp

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-05-07 20:18:54 -04:00
louist103 f31a841789
ZAPD Update (#2851)
* git subrepo clone --force --branch=rebase2 C:/ZeldaStuff/ZAPDTR ZAPDTR/

subrepo:
  subdir:   "ZAPDTR"
  merged:   "6aa54a551"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR"
  branch:   "rebase2"
  commit:   "6aa54a551"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* git subrepo clone --force --branch=rebase2 C:/ZeldaStuff/ZAPDTR ZAPDTR/

subrepo:
  subdir:   "ZAPDTR"
  merged:   "88b012240"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR"
  branch:   "rebase2"
  commit:   "88b012240"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Update (its broken)

* fix the enum

* git subrepo push --remote=C:/ZeldaStuff/ZAPDTR/ ZAPDTR

subrepo:
  subdir:   "ZAPDTR"
  merged:   "b7b6e1c82"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR/"
  branch:   "rebase2"
  commit:   "b7b6e1c82"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* New names for LUS actions

* git subrepo push --remote=C:/ZeldaStuff/ZAPDTR/ ZAPDTR

subrepo:
  subdir:   "ZAPDTR"
  merged:   "c5cfebeee"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR/"
  branch:   "rebase2"
  commit:   "c5cfebeee"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* git subrepo clone (merge) --force --branch=rebase2 C:/ZeldaStuff/ZAPDTR ZAPDTR/

subrepo:
  subdir:   "ZAPDTR"
  merged:   "d5f4769b8"
upstream:
  origin:   "C:/ZeldaStuff/ZAPDTR"
  branch:   "rebase2"
  commit:   "d5f4769b8"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Fix missing commands in the exporter.

* Cleanups.

* git subrepo pull --force --remote=https://github.com/harbourmasters/ZAPDTR --branch=master ZAPDTR

subrepo:
  subdir:   "ZAPDTR"
  merged:   "d4c35b90a"
upstream:
  origin:   "https://github.com/harbourmasters/ZAPDTR"
  branch:   "master"
  commit:   "d4c35b90a"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"

* Add unordered_map include to fix MacOS

* fix string_view

* Update Main.cpp

* fix string view

* So close I can almost taste it

* So close

* Fix missed git marker.

* Fix surface types and

* Update ZFile.cpp

* Delete Jenkinsfile

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-05-07 19:58:50 -04:00
briaguya dd43719a14
Spock -> develop 2023-05-06 16:38:50 -04:00
Malkierian 778f548b01
Move Game Saving to Separate Thread (#2820)
* Refactor `Vec2f`, `Vec3f`, `Vec3s` in `z64math` to avoid reserved identifiers.

* Include `z64save` in SaveManager, which requires encapsulating `#include gameplaystats.h` and `InitStatTracker` in the cpp to fix compile issues.

Adds SaveContext reference parameters to SaveFunc and existing implementations in preparation for threaded saves.

* Threaded saves fully implemented.

Platform-specific save code removed.

Thread safety added. Will wait for thread pool tasks to finish before resetting or closing.

* Converted gSaveContext copy for save threads to the heap with `new`, deleted at the end of the threaded function to prevent possible issues with the stack.

* Turns out leaving the call to `ThreadPoolWait` in a `GameInteractor::OnExitGame` hook seems to be just fine.

* Removed unnecessary references to `SaveManager::ThreadPoolWait()`, game hooks are the only places it's called now.

* Re-added WiiU/Switch performance save code.

* Added call to `SaveManager::ThreadPoolWait` in `Sram_InitSave` to prevent trying to load a newly "created" save before the save file was actually written.

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-05-05 17:20:34 -04:00
aMannus 81372c092d
CrowdControl 2.0 compatibility & category tweak (#2814)
* Updated CC 2.0 .cs file and small category fix

* Remove old comments

* Prepare prices and descriptions in .cs file

* Finalize 2.0 files
2023-05-05 17:18:29 -04:00
Adam Bird 79a10c62ef
remove tts hotkey for linux and update readme (#2833) 2023-05-05 02:38:54 -04:00
Adam Bird 5f0f2731ee
udpate mac launch script to set SHIP_HOME (#2831) 2023-05-05 02:34:07 -04:00
Kenix3 f9cfcde627
Lus updates (#2835)
* Changes for LUS renames in ResourceManager and Archive.

* Moves WriteSaveFile and ReadSaveFile to SaveManager.

* Removes ImGui namespace.

* Bump LUS

* Updates gitignore for intellij projects.

* Controller usage is now up to date with newest LUS.

* Adapters for removal of Controller.WriteToSource from LUS.

* Uses correct capitalization on Controller.GetProfile()

* Bump LUS

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-05-04 23:56:57 -04:00
Christopher Leggett 1fbec4c69c
Merge pull request #2829 from HarbourMasters/develop-spock
Spock -> Develop
2023-05-04 08:52:50 -04:00
briaguya c3ba15ed57
fix: don't crash when changing margins (#2828)
for some reason we were getting garbage data in cvarNameMargins when doing things the `const char *` way. i wasn't able to figure out why that was getting garbage but this makes it so we don't get garbage in there

Co-authored-by: briaguya <briaguya@alice>
2023-05-04 00:35:56 -04:00
PurpleHato d025ca0d90
TWEAK: Rupee dash duplication (#2815)
* TWEAK: Rupee dash duplication

Rupee dash was duplicated while being moved over the EXTRA MODES, so this fixes the duplication and put it only there

* Update soh/soh/GameMenuBar.cpp

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-05-04 00:31:52 -04:00
Christopher Leggett 071a2d0418
Merge pull request #2826 from HarbourMasters/develop-spock
Spock -> Develop
2023-05-03 23:00:45 -04:00
briaguya c02dcb598a
fix: properly load textures for debug text (#2775)
Co-authored-by: briaguya <briaguya@alice>
2023-05-03 22:23:50 -04:00
GaryOderNichts 176650cb3a
GCC 13 support (#2780) 2023-05-03 21:55:49 -04:00
briaguya 7d0515c501
fix: properly load custom models on scene transition (#2779)
* hack that makes it so custom models still work on scene transition

* Update soh/soh/OTRGlobals.cpp

Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com>

* naming/formatting

---------

Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com>
2023-05-03 21:54:23 -04:00
Adam Bird f81b042843
Tweak: Reset trade item cycling when pausing or changing pages (#2808)
* reset trade select when unpausing

* move trade select reset to kaleido init and handle when changing pages
2023-05-03 21:45:41 -04:00
Adam Bird 2845a29e28
more mq only texture lookup fixes (#2803) 2023-05-03 21:35:08 -04:00
AltoXorg f27ef0ec3b
fix: extractor dialog No selection (#2798) 2023-05-03 21:29:50 -04:00
Adam Bird f9a696e9bd
add back missing early break/return for bottle filling (#2817) 2023-05-03 21:26:03 -04:00
Adam Bird c3c97f207f
Fix: add header to align soh.otr file assets and fix asset crash for Mac (#2819)
* add header for aligned assets for soh files

* remove debug statements

* update more string asset usage to aligned vars
2023-05-03 20:58:41 -04:00
Kenix3 4980ae8dcc
Lus updates (#2822)
* Changes for LUS renames in ResourceManager and Archive.

* Moves WriteSaveFile and ReadSaveFile to SaveManager.

* Removes ImGui namespace.

* Bump LUS

* Update soh/soh/GameMenuBar.cpp

* Bump LUS

---------

Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com>
2023-05-03 20:46:26 -04:00
AltoXorg 859bf856b8
remove 100 character limit to baseRomPath (#2801) 2023-04-30 19:52:37 -04:00
Adam Bird dac90bb9eb
fix mq dungeons crashing by not using mq textures (#2764) 2023-04-27 23:30:14 -04:00
5656 changed files with 170672 additions and 637190 deletions

View File

@ -1 +1 @@
libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev ninja-build
libusb-dev libusb-1.0-0-dev libsdl2-dev libsdl2-net-dev libpng-dev libglew-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev ninja-build

View File

@ -7,105 +7,117 @@ concurrency:
cancel-in-progress: true
jobs:
generate-soh-otr:
runs-on: ${{ (vars.LINUX_RUNNER && fromJSON(vars.LINUX_RUNNER)) || 'ubuntu-latest' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
uses: hendrikmuhs/ccache-action@v1.2.11
with:
key: ${{ runner.os }}-soh-otr-ccache
key: ${{ runner.os }}-otr-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-otr-ccache-${{ github.ref }}
${{ runner.os }}-otr-ccache-
- name: Install dependencies
if: ${{ !vars.LINUX_RUNNER }}
run: |
sudo apt-get update
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
- name: Cache build folders
uses: actions/cache@v4
with:
key: ${{ runner.os }}-otr-build-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-otr-build-${{ github.ref }}
${{ runner.os }}-otr-build-
path: |
build-cmake
SDL2-2.28.5
- name: Install latest SDL
if: ${{ !vars.LINUX_RUNNER }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/release/SDL2-2.26.1.tar.gz
tar -xzf SDL2-2.26.1.tar.gz
cd SDL2-2.26.1
./configure
if [ ! -d "SDL2-2.28.5" ]; then
wget https://www.libsdl.org/release/SDL2-2.28.5.tar.gz
tar -xzf SDL2-2.28.5.tar.gz
fi
cd SDL2-2.28.5
./configure --enable-hidapi-libusb
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
- name: Install latest SDL_net
if: ${{ !vars.LINUX_RUNNER }}
- name: Install latest tinyxml2
run: |
sudo apt-get remove libtinyxml2-dev
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
tar -xzf SDL2_net-2.2.0.tar.gz
cd SDL2_net-2.2.0
./configure
make -j 10
if [ ! -d "tinyxml2-10.0.0" ]; then
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
tar -xzf 10.0.0.tar.gz
fi
cd tinyxml2-10.0.0
mkdir build
cd build
cmake ..
make
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
- name: Generate soh.otr
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
cmake --build build-cmake --config Release --target ZAPD
mkdir Extract
cp -r OTRExporter/assets/ ./Extract/assets
./build-cmake/ZAPD/ZAPD.out botr -se OTR --norom
- uses: actions/upload-artifact@v3
cmake --build build-cmake --config Release --target GenerateSohOtr
- uses: actions/upload-artifact@v4
with:
name: soh.otr
path: soh.otr
retention-days: 1
build-macos:
needs: generate-soh-otr
runs-on: ${{ (vars.MAC_RUNNER && fromJSON(vars.MAC_RUNNER)) || 'macos-12' }}
runs-on: macos-14
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
uses: hendrikmuhs/ccache-action@v1.2.13
with:
key: ${{ runner.os }}-ccache
create-symlink: true
key: ${{ runner.os }}-14-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-14-ccache-${{ github.ref }}
${{ runner.os }}-14-ccache-
- name: Install gtar wrapper
if: ${{ !vars.MAC_RUNNER }}
run: |
sudo mv /usr/local/bin/gtar /usr/local/bin/gtar.orig
sudo cp .github/workflows//gtar /usr/local/bin/gtar
sudo chmod +x /usr/local/bin/gtar
sudo mv /opt/homebrew/bin/gtar /opt/homebrew/bin/gtar.orig
sudo cp .github/workflows//gtar /opt/homebrew/bin/gtar
sudo chmod +x /opt/homebrew/bin/gtar
- name: Cache MacPorts
id: cache-macports
if: ${{ !vars.MAC_RUNNER }}
uses: actions/cache@v2
with:
path: /opt/local/
key: ${{ runner.os }}-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
key: ${{ runner.os }}-14-macports-${{ hashFiles('.github/workflows/macports-deps.txt') }}
restore-keys: |
${{ runner.os }}-macports-
${{ runner.os }}-14-macports-
- name: Install MacPorts (if necessary)
if: ${{ !vars.MAC_RUNNER }}
run: |
if [ -d /opt/local/ ]; then
echo "MacPorts already installed"
else
wget https://github.com/macports/macports-base/releases/download/v2.7.2/MacPorts-2.7.2-12-Monterey.pkg
sudo installer -pkg ./MacPorts-2.7.2-12-Monterey.pkg -target /
wget https://github.com/macports/macports-base/releases/download/v2.9.3/MacPorts-2.9.3-14-Sonoma.pkg
sudo installer -pkg ./MacPorts-2.9.3-14-Sonoma.pkg -target /
fi
echo "/opt/local/bin:/opt/local/sbin" >> $GITHUB_PATH
- name: Install dependencies
if: ${{ !vars.MAC_RUNNER }}
run: |
brew uninstall --ignore-dependencies libpng
sudo port install $(cat .github/workflows/macports-deps.txt)
brew install ninja
- name: Download soh.otr
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: soh.otr
- name: Build SoH
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DBUILD_REMOTE_CONTROL=1
cmake --build build-cmake --config Release --parallel 10
mv soh.otr build-cmake/soh
(cd build-cmake && cpack)
@ -113,7 +125,7 @@ jobs:
mv _packages/*.dmg SoH.dmg
mv README.md readme.txt
- name: Upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: soh-mac
path: |
@ -121,156 +133,93 @@ jobs:
readme.txt
build-linux:
needs: generate-soh-otr
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-20.04
gcc: 10
archive-suffix: compatibility
- os: ubuntu-22.04
gcc: 12
archive-suffix: performance
runs-on: ${{ (matrix.os == 'ubuntu-20.04' && ((vars.LINUX_COMPATIBILITY_RUNNER && fromJSON(vars.LINUX_COMPATIBILITY_RUNNER)) || matrix.os)) || (matrix.os == 'ubuntu-22.04' && ((vars.LINUX_PERFORMANCE_RUNNER && fromJSON(vars.LINUX_PERFORMANCE_RUNNER)) || matrix.os)) }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
if: ${{ (matrix.os == 'ubuntu-20.04' && !vars.LINUX_COMPATIBILITY_RUNNER) || (matrix.os == 'ubuntu-22.04' && !vars.LINUX_PERFORMANCE_RUNNER) }}
run: |
sudo apt-get update
sudo apt-get install -y $(cat .github/workflows/apt-deps.txt)
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
uses: hendrikmuhs/ccache-action@v1.2.11
with:
key: ${{ matrix.os }}-ccache
key: linux-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
linux-ccache-${{ github.ref }}
linux-ccache-
- name: Cache build folders
uses: actions/cache@v4
with:
key: linux-build-${{ github.ref }}-${{ github.sha }}
restore-keys: |
linux-build-${{ github.ref }}
linux-build-
path: |
SDL2-2.28.5
SDL2_net-2.2.0
- name: Install latest SDL
if: ${{ (matrix.os == 'ubuntu-20.04' && !vars.LINUX_COMPATIBILITY_RUNNER) || (matrix.os == 'ubuntu-22.04' && !vars.LINUX_PERFORMANCE_RUNNER) }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/release/SDL2-2.26.1.tar.gz
tar -xzf SDL2-2.26.1.tar.gz
cd SDL2-2.26.1
./configure
if [ ! -d "SDL2-2.28.5" ]; then
wget https://www.libsdl.org/release/SDL2-2.28.5.tar.gz
tar -xzf SDL2-2.28.5.tar.gz
fi
cd SDL2-2.28.5
./configure --enable-hidapi-libusb
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
- name: Install latest tinyxml2
run: |
sudo apt-get remove libtinyxml2-dev
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
if [ ! -d "tinyxml2-10.0.0" ]; then
wget https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
tar -xzf 10.0.0.tar.gz
fi
cd tinyxml2-10.0.0
mkdir build
cd build
cmake ..
make
sudo make install
- name: Install latest SDL_net
if: ${{ (matrix.os == 'ubuntu-20.04' && !vars.LINUX_COMPATIBILITY_RUNNER) || (matrix.os == 'ubuntu-22.04' && !vars.LINUX_PERFORMANCE_RUNNER) }}
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
tar -xzf SDL2_net-2.2.0.tar.gz
if [ ! -d "SDL2_net-2.2.0" ]; then
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
tar -xzf SDL2_net-2.2.0.tar.gz
fi
cd SDL2_net-2.2.0
./configure
make -j 10
sudo make install
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
- name: Download soh.otr
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: soh.otr
- name: Build SoH
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1
cmake --build build-cmake --config Release -j3
(cd build-cmake && cpack -G External)
mv README.md readme.txt
mv build-cmake/*.appimage soh.appimage
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
CC: gcc-12
CXX: g++-12
- name: Upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: soh-linux-${{ matrix.archive-suffix }}
name: soh-linux
path: |
soh.appimage
readme.txt
build-switch:
needs: generate-soh-otr
runs-on: ${{ (vars.LINUX_RUNNER && fromJSON(vars.LINUX_RUNNER)) || 'ubuntu-latest' }}
container:
image: devkitpro/devkita64:latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build
- name: Fix dubious ownership error
if: ${{ vars.LINUX_RUNNER }}
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v3
with:
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ runner.os }}-switch-ccache
- name: Build SoH
run: |
cmake -H. -Bbuild-switch -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
cmake --build build-switch --target soh_nro -j3
mv build-switch/soh/*.nro soh.nro
mv README.md readme.txt
- name: Download soh.otr
uses: actions/download-artifact@v3
with:
name: soh.otr
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: soh-switch
path: |
soh.nro
soh.otr
readme.txt
# build-wiiu:
# needs: generate-soh-otr
# runs-on: ${{ (vars.LINUX_RUNNER && fromJSON(vars.LINUX_RUNNER)) || 'ubuntu-latest' }}
# container:
# image: devkitpro/devkitppc:latest
# steps:
# - name: Install dependencies
# if: ${{ !vars.LINUX_RUNNER }}
# run: |
# sudo apt-get update
# sudo apt-get install -y ninja-build
# - uses: actions/checkout@v3
# with:
# submodules: true
# - name: ccache
# uses: hendrikmuhs/ccache-action@v1.2
# with:
# key: ${{ runner.os }}-wiiu-ccache
# - name: Build SoH
# run: |
# cmake -H. -Bbuild-wiiu -GNinja -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/WiiU.cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
# cmake --build build-wiiu --target soh_wuhb --config Release -j3
# mv build-wiiu/soh/*.rpx soh.rpx
# mv build-wiiu/soh/*.wuhb soh.wuhb
# mv README.md readme.txt
# env:
# DEVKITPRO: /opt/devkitpro
# DEVKITPPC: /opt/devkitpro/devkitPPC
# - name: Download soh.otr
# uses: actions/download-artifact@v3
# with:
# name: soh.otr
# - name: Upload build
# uses: actions/upload-artifact@v3
# with:
# name: soh-wiiu
# path: |
# soh.rpx
# soh.wuhb
# soh.otr
# readme.txt
build-windows:
needs: generate-soh-otr
runs-on: ${{ (vars.WINDOWS_RUNNER && fromJSON(vars.WINDOWS_RUNNER)) || 'windows-latest' }}
@ -279,19 +228,38 @@ jobs:
if: ${{ !vars.WINDOWS_RUNNER }}
run: |
choco install ninja
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
- uses: actions/checkout@v3
with:
submodules: true
- name: ccache
uses: dcvz/ccache-action@27b9f33213c0079872f064f6b6ba0233dfa16ba2
uses: hendrikmuhs/ccache-action@v1.2.11
with:
key: ${{ runner.os }}-ccache
- uses: ilammy/msvc-dev-cmd@v1
variant: sccache
max-size: "1G"
key: ${{ runner.os }}-ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-ccache-${{ github.ref }}
${{ runner.os }}-ccache-
- name: Cache build folder
uses: actions/cache@v4
with:
save-always: true
key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-${{ github.ref }}
${{ runner.os }}-build-
path: |
build-windows
vcpkg
- name: Configure Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Build SoH
env:
VCPKG_ROOT: ${{github.workspace}}/vcpkg
run: |
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake -S . -B build-windows -G Ninja -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DBUILD_REMOTE_CONTROL=1
cmake --build build-windows --config Release --parallel 10
mkdir soh-windows
@ -302,15 +270,14 @@ jobs:
mv ./x64/Release/soh.pdb ./soh-windows/debug/soh.pdb
mv ./README.md ./soh-windows/readme.txt
mv ./build-windows/gamecontrollerdb.txt ./soh-windows/gamecontrollerdb.txt
mv ./build-windows/OTRGui/assets ./soh-windows
mv ./build-windows/ZAPD/ZAPD.exe ./soh-windows/assets/extractor/ZAPD.exe
mv ./x64/Release/assets ./soh-windows
- name: Download soh.otr
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: soh.otr
path: soh-windows
- name: Upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: soh-windows
path: soh-windows

View File

@ -1,2 +1,2 @@
#!/bin/sh
exec sudo /usr/local/bin/gtar.orig "$@"
exec sudo /opt/homebrew/bin/gtar.orig "$@"

View File

@ -1 +1 @@
libsdl2 +universal libpng +universal glew +universal
libsdl2 +universal libsdl2_net +universal libpng +universal glew +universal libzip +universal nlohmann-json +universal tinyxml2 +universal

View File

@ -0,0 +1,72 @@
name: test-builds-on-distros
on:
workflow_dispatch: # by request
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
image: ["archlinux:base", "opensuse/tumbleweed:latest", "ubuntu:mantic", "debian:bookworm", "fedora:39"]
cc: ["gcc", "clang"]
include:
- cxx: g++
cc: gcc
- cxx: clang++
cc: clang
runs-on: ${{ (vars.LINUX_RUNNER && fromJSON(vars.LINUX_RUNNER)) || 'ubuntu-latest' }}
container:
image: ${{ matrix.image }}
steps:
- name: Install dependencies (pacman)
if: ${{ matrix.image == 'archlinux:base' }}
run: |
echo arch
echo pacman -S ${{ matrix.cc }} git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
pacman -Syu --noconfirm
pacman -S --noconfirm ${{ matrix.cc }} git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net boost
- name: Install dependencies (dnf)
if: ${{ matrix.image == 'fedora:39' }}
run: |
echo fedora
echo dnf install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} wget git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools tinyxml2-devel spdlog-devel boost-devel
dnf -y upgrade
dnf -y install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} wget git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools tinyxml2-devel spdlog-devel boost-devel
- name: Install dependencies (apt)
if: ${{ matrix.image == 'ubuntu:mantic' || matrix.image == 'debian:bookworm' }}
run: |
echo debian based
echo apt-get install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'g++') || '' }} git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
apt-get update
apt-get -y full-upgrade
apt-get -y install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'g++') || '' }} git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libboost-dev libopengl-dev
- name: Install dependencies (zypper)
if: ${{ matrix.image == 'opensuse/tumbleweed:latest' }}
run: |
echo openSUSE
echo zypper in ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} ${{ matrix.cc == 'clang' && 'libstdc++-devel' || '' }} git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
zypper --non-interactive dup
zypper --non-interactive in ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} ${{ matrix.cc == 'clang' && 'libstdc++-devel' || '' }} git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
- name: Install latest nlohmann
if: ${{ matrix.image == 'fedora:39' }}
run: |
wget https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz
tar -xzvf v3.11.3.tar.gz
cd json-3.11.3
mkdir build
cd build
cmake ..
make
sudo make install
- uses: actions/checkout@v3
with:
submodules: true
- name: Build SoH
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1
cmake --build build-cmake --config Release -j3
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

5
.gitignore vendored
View File

@ -7,7 +7,7 @@ __pycache__/
.vscode/
.vs/
.idea/
cmake-build-debug
cmake-build-**
venv/
.cache/
@ -444,8 +444,9 @@ install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
_packages
*/extract_assets_cmake*
/build*
soh/build.c
soh/src/boot/build.c
soh/properties.h

6
.gitmodules vendored
View File

@ -1,3 +1,9 @@
[submodule "libultraship"]
path = libultraship
url = https://github.com/kenix3/libultraship.git
[submodule "ZAPDTR"]
path = ZAPDTR
url = https://github.com/harbourmasters/ZAPDTR
[submodule "OTRExporter"]
path = OTRExporter
url = https://github.com/harbourmasters/OTRExporter

View File

@ -8,5 +8,9 @@ if(MSVC)
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache")
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Z7")
else()
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
endif()
endif()

View File

@ -1,6 +1,6 @@
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_COMPONENTS_ALL "ship" "appimage")
set(CPACK_COMPONENTS_ALL "ship" "extractor" "appimage")
if (NOT CPACK_GENERATOR STREQUAL "External")
list(REMOVE_ITEM CPACK_COMPONENTS_ALL "appimage")
@ -24,7 +24,6 @@ if (CPACK_GENERATOR MATCHES "Bundle")
set(CPACK_BUNDLE_NAME "soh")
set(CPACK_BUNDLE_PLIST "macosx/Info.plist")
set(CPACK_BUNDLE_ICON "macosx/soh.icns")
set(CPACK_BUNDLE_STARTUP_COMMAND "../soh/macosx/soh-macos.sh")
set(CPACK_BUNDLE_STARTUP_COMMAND "macosx/soh-macos.sh")
set(CPACK_BUNDLE_APPLE_CERT_APP "-")
endif()

24
CMake/lus-cvars.cmake Normal file
View File

@ -0,0 +1,24 @@
set(CVAR_VSYNC_ENABLED "${CVAR_PREFIX_SETTING}.VsyncEnabled" CACHE STRING "")
set(CVAR_Z_FIGHTING_MODE "${CVAR_PREFIX_SETTING}.ZFightingMode" CACHE STRING "")
set(CVAR_NEW_FILE_DROPPED "${CVAR_PREFIX_GENERAL}.NewFileDropped" CACHE STRING "")
set(CVAR_DROPPED_FILE "${CVAR_PREFIX_GENERAL}.DroppedFile" CACHE STRING "")
set(CVAR_INTERNAL_RESOLUTION "${CVAR_PREFIX_SETTING}.InternalResolution" CACHE STRING "")
set(CVAR_MSAA_VALUE "${CVAR_PREFIX_SETTING}.MSAAValue" CACHE STRING "")
set(CVAR_SDL_WINDOWED_FULLSCREEN "${CVAR_PREFIX_SETTING}.SdlWindowedFullscreen" CACHE STRING "")
set(CVAR_TEXTURE_FILTER "${CVAR_PREFIX_SETTING}.TextureFilter" CACHE STRING "")
set(CVAR_IMGUI_CONTROLLER_NAV "${CVAR_PREFIX_SETTING}.ControlNav" CACHE STRING "")
set(CVAR_CONSOLE_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.Console" CACHE STRING "")
set(CVAR_CONTROLLER_CONFIGURATION_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.ControllerConfiguration" CACHE STRING "")
set(CVAR_CONTROLLER_DISCONNECTED_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.ControllerDisconnected" CACHE STRING "")
set(CVAR_CONTROLLER_REORDERING_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.ControllerReordering" CACHE STRING "")
set(CVAR_GFX_DEBUGGER_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.GfxDebugger" CACHE STRING "")
set(CVAR_STATS_WINDOW_OPEN "${CVAR_PREFIX_WINDOW}.Stats" CACHE STRING "")
set(CVAR_ENABLE_MULTI_VIEWPORTS "${CVAR_PREFIX_SETTING}.EnableMultiViewports" CACHE STRING "")
set(CVAR_LOW_RES_MODE "${CVAR_PREFIX_SETTING}.LowResMode" CACHE STRING "")
set(CVAR_SIMULATED_INPUT_LAG "${CVAR_PREFIX_SETTING}.SimulatedInputLag" CACHE STRING "")
set(CVAR_ALT_ASSETS "${CVAR_PREFIX_ENHANCEMENT}.AltAssets" CACHE STRING "")
set(CVAR_GAME_OVERLAY_FONT "${CVAR_PREFIX_SETTING}.OverlayFont" CACHE STRING "")
set(CVAR_MENU_BAR_OPEN "${CVAR_PREFIX_SETTING}.OpenMenuBar" CACHE STRING "")
set(CVAR_PREFIX_CONTROLLERS "${CVAR_PREFIX_SETTING}.Controllers" CACHE STRING "")
set(CVAR_PREFIX_ADVANCED_RESOLUTION "${CVAR_PREFIX_SETTING}.AdvancedResolution" CACHE STRING "")
include("libultraship/cmake/cvars.cmake")

26
CMake/soh-cvars.cmake Normal file
View File

@ -0,0 +1,26 @@
set(CVAR_PREFIX_RANDOMIZER_ENHANCEMENT "gRandoEnhancements")
set(CVAR_PREFIX_RANDOMIZER_SETTING "gRandoSettings")
set(CVAR_PREFIX_COSMETIC "gCosmetics")
set(CVAR_PREFIX_AUDIO "gAudioEditor")
set(CVAR_PREFIX_CHEAT "gCheats")
set(CVAR_PREFIX_ENHANCEMENT "gEnhancements")
set(CVAR_PREFIX_SETTING "gSettings")
set(CVAR_PREFIX_WINDOW "gOpenWindows")
set(CVAR_PREFIX_TRACKER "gTrackers")
set(CVAR_PREFIX_DEVELOPER_TOOLS "gDeveloperTools")
set(CVAR_PREFIX_GENERAL "gGeneral")
set(CVAR_PREFIX_REMOTE "gRemote")
add_compile_definitions(
CVAR_PREFIX_RANDOMIZER_ENHANCEMENT="${CVAR_PREFIX_RANDOMIZER_ENHANCEMENT}"
CVAR_PREFIX_RANDOMIZER_SETTING="${CVAR_PREFIX_RANDOMIZER_SETTING}"
CVAR_PREFIX_COSMETIC="${CVAR_PREFIX_COSMETIC}"
CVAR_PREFIX_AUDIO="${CVAR_PREFIX_AUDIO}"
CVAR_PREFIX_CHEAT="${CVAR_PREFIX_CHEAT}"
CVAR_PREFIX_ENHANCEMENT="${CVAR_PREFIX_ENHANCEMENT}"
CVAR_PREFIX_SETTING="${CVAR_PREFIX_SETTING}"
CVAR_PREFIX_WINDOW="${CVAR_PREFIX_WINDOW}"
CVAR_PREFIX_TRACKER="${CVAR_PREFIX_TRACKER}"
CVAR_PREFIX_DEVELOPER_TOOLS="${CVAR_PREFIX_DEVELOPER_TOOLS}"
CVAR_PREFIX_GENERAL="${CVAR_PREFIX_GENERAL}"
CVAR_PREFIX_REMOTE="${CVAR_PREFIX_REMOTE}"
)

View File

@ -5,27 +5,28 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
project(Ship VERSION 7.0.0 LANGUAGES C CXX)
set(PROJECT_BUILD_NAME "Spock Alfa" CACHE STRING "")
project(Ship VERSION 8.0.5 LANGUAGES C CXX)
include(CMake/soh-cvars.cmake)
include(CMake/lus-cvars.cmake)
set(PROJECT_BUILD_NAME "MacReady Foxtrot" CACHE STRING "")
set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
if (CMAKE_SYSTEM_NAME MATCHES "Windows|Linux")
if(NOT DEFINED BUILD_CROWD_CONTROL)
set(BUILD_CROWD_CONTROL ON)
endif()
endif()
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
include(CMake/automate-vcpkg.cmake)
include(CMake/automate-vcpkg.cmake)
set(VCPKG_TRIPLET x64-windows-static)
set(VCPKG_TARGET_TRIPLET x64-windows-static)
set(VCPKG_TRIPLET x64-windows-static)
set(VCPKG_TARGET_TRIPLET x64-windows-static)
vcpkg_bootstrap()
vcpkg_install_packages(zlib bzip2 libpng sdl2 sdl2-net glew glfw3)
vcpkg_bootstrap()
vcpkg_install_packages(zlib bzip2 libzip libpng sdl2 sdl2-net glew glfw3 nlohmann-json tinyxml2 spdlog)
if (CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache|sccache")
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded)
endif()
endif()
################################################################################
@ -90,17 +91,30 @@ add_subdirectory(libultraship ${CMAKE_BINARY_DIR}/libultraship)
add_subdirectory(ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
add_subdirectory(OTRExporter)
add_subdirectory(soh)
if(CMAKE_SYSTEM_NAME MATCHES "Windows|Linux")
add_subdirectory(OTRGui)
endif()
set_property(TARGET soh PROPERTY APPIMAGE_DESKTOP_FILE_TERMINAL YES)
set_property(TARGET soh PROPERTY APPIMAGE_DESKTOP_FILE "${CMAKE_SOURCE_DIR}/scripts/linux/appimage/soh.desktop")
set_property(TARGET soh PROPERTY APPIMAGE_ICON_FILE "${CMAKE_BINARY_DIR}/sohIcon.png")
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
install(PROGRAMS "${CMAKE_SOURCE_DIR}/scripts/linux/appimage/soh.sh" DESTINATION . COMPONENT appimage)
install(FILES "${CMAKE_SOURCE_DIR}/soh.otr" DESTINATION . COMPONENT appimage)
install(PROGRAMS "${CMAKE_BINARY_DIR}/linux/soh.sh" DESTINATION . COMPONENT appimage)
install(FILES "${CMAKE_SOURCE_DIR}/soh.otr" DESTINATION . COMPONENT ship)
install(TARGETS ZAPD DESTINATION ./assets/extractor COMPONENT extractor)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor COMPONENT extractor)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT extractor)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/filelists/" DESTINATION ./assets/extractor/filelists COMPONENT extractor)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols COMPONENT extractor)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols COMPONENT extractor)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols COMPONENT extractor)
endif()
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor COMPONENT ship)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls COMPONENT ship)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/filelists/" DESTINATION ./assets/extractor/filelists COMPONENT ship)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols COMPONENT ship)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols COMPONENT ship)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols COMPONENT ship)
endif()
find_package(Python3 COMPONENTS Interpreter)
@ -110,7 +124,7 @@ add_custom_target(
ExtractAssets
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f oot.otr oot-mq.otr soh.otr
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --xml-root ../soh/assets/xml --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
COMMENT "Running asset extraction..."
@ -121,12 +135,24 @@ add_custom_target(
# Target to generate headers
add_custom_target(
ExtractAssetHeaders
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --gen-headers
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --xml-root ../soh/assets/xml --gen-headers
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
COMMENT "Generating asset headers..."
DEPENDS ZAPD
)
# Target to generate only soh.otr
add_custom_target(
GenerateSohOtr
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f soh.otr
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --norom --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom --port-ver "${CMAKE_PROJECT_VERSION}"
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
COMMENT "Generating soh.otr..."
DEPENDS ZAPD
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(ImageMagick COMPONENTS convert)
if (ImageMagick_FOUND)
@ -156,17 +182,17 @@ add_custom_target(CreateOSXIcons
)
add_dependencies(soh CreateOSXIcons)
add_custom_target(Assets ALL
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/OTRGui/assets/extractor" -Ddst_dir="${CMAKE_BINARY_DIR}/assets/extractor" -P "${CMAKE_SOURCE_DIR}/OTRGui/Overwrite.cmake"
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/OTRExporter/assets" -Ddst_dir="${CMAKE_BINARY_DIR}/assets/game" -P "${CMAKE_SOURCE_DIR}/OTRGui/Overwrite.cmake"
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_SOURCE_DIR}/soh/assets/xml" -Ddst_dir="${CMAKE_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_SOURCE_DIR}/OTRGui/Overwrite.cmake"
)
add_dependencies(soh Assets)
install(TARGETS ZAPD DESTINATION ${CMAKE_BINARY_DIR}/assets/extractor)
set(PROGRAM_PERMISSIONS_EXECUTE OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/extractor/" DESTINATION ./assets/extractor)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/soh/assets/xml/" DESTINATION ./assets/extractor/xmls)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/filelists/" DESTINATION ./assets/extractor/filelists)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols)
install(FILES "${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt" DESTINATION ./assets/extractor/symbols)
install(DIRECTORY ${CMAKE_BINARY_DIR}/assets
DESTINATION .
PATTERN ZAPD.out

1
OTRExporter Submodule

@ -0,0 +1 @@
Subproject commit 3cea9ee7c017d842aa4d9ceeb8d3ffbf29c6effb

353
OTRExporter/.gitignore vendored
View File

@ -1,353 +0,0 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
*.out
*.o
*.d
lib/libgfxd/libgfxd.a
ExporterTest/ExporterTest.a
ZAPDUtils/ZAPDUtils.a
.vscode/
build/
ZAPDUtils/build/
ZAPD/BuildInfo.h
baserom/
baserom_ntsc/
*.vtx.inc
*.otr
*.swp
*.a
*.z64
*.n64
Extract/
tmp.txt

View File

@ -1,12 +0,0 @@
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/HarbourMasters/OTRExporter.git
branch = master
commit = 1503d3eefa0b51164371c60c2aae8ad057678319
parent = d24c8453db1035f382e1b0853be00ebd281bbbdd
method = rebase
cmdver = 0.4.1

View File

@ -1,472 +0,0 @@
ACTOR_PLAYER
ACTOR_UNSET_1
ACTOR_EN_TEST
ACTOR_UNSET_3
ACTOR_EN_GIRLA
ACTOR_UNSET_5
ACTOR_UNSET_6
ACTOR_EN_PART
ACTOR_EN_LIGHT
ACTOR_EN_DOOR
ACTOR_EN_BOX
ACTOR_BG_DY_YOSEIZO
ACTOR_BG_HIDAN_FIREWALL
ACTOR_EN_POH
ACTOR_EN_OKUTA
ACTOR_BG_YDAN_SP
ACTOR_EN_BOM
ACTOR_EN_WALLMAS
ACTOR_EN_DODONGO
ACTOR_EN_FIREFLY
ACTOR_EN_HORSE
ACTOR_EN_ITEM00
ACTOR_EN_ARROW
ACTOR_UNSET_17
ACTOR_EN_ELF
ACTOR_EN_NIW
ACTOR_UNSET_1A
ACTOR_EN_TITE
ACTOR_EN_REEBA
ACTOR_EN_PEEHAT
ACTOR_EN_BUTTE
ACTOR_UNSET_1F
ACTOR_EN_INSECT
ACTOR_EN_FISH
ACTOR_UNSET_22
ACTOR_EN_HOLL
ACTOR_EN_SCENE_CHANGE
ACTOR_EN_ZF
ACTOR_EN_HATA
ACTOR_BOSS_DODONGO
ACTOR_BOSS_GOMA
ACTOR_EN_ZL1
ACTOR_EN_VIEWER
ACTOR_EN_GOMA
ACTOR_BG_PUSHBOX
ACTOR_EN_BUBBLE
ACTOR_DOOR_SHUTTER
ACTOR_EN_DODOJR
ACTOR_EN_BDFIRE
ACTOR_UNSET_31
ACTOR_EN_BOOM
ACTOR_EN_TORCH2
ACTOR_EN_BILI
ACTOR_EN_TP
ACTOR_UNSET_36
ACTOR_EN_ST
ACTOR_EN_BW
ACTOR_EN_A_OBJ
ACTOR_EN_EIYER
ACTOR_EN_RIVER_SOUND
ACTOR_EN_HORSE_NORMAL
ACTOR_EN_OSSAN
ACTOR_BG_TREEMOUTH
ACTOR_BG_DODOAGO
ACTOR_BG_HIDAN_DALM
ACTOR_BG_HIDAN_HROCK
ACTOR_EN_HORSE_GANON
ACTOR_BG_HIDAN_ROCK
ACTOR_BG_HIDAN_RSEKIZOU
ACTOR_BG_HIDAN_SEKIZOU
ACTOR_BG_HIDAN_SIMA
ACTOR_BG_HIDAN_SYOKU
ACTOR_EN_XC
ACTOR_BG_HIDAN_CURTAIN
ACTOR_BG_SPOT00_HANEBASI
ACTOR_EN_MB
ACTOR_EN_BOMBF
ACTOR_EN_ZL2
ACTOR_BG_HIDAN_FSLIFT
ACTOR_EN_OE2
ACTOR_BG_YDAN_HASI
ACTOR_BG_YDAN_MARUTA
ACTOR_BOSS_GANONDROF
ACTOR_UNSET_53
ACTOR_EN_AM
ACTOR_EN_DEKUBABA
ACTOR_EN_M_FIRE1
ACTOR_EN_M_THUNDER
ACTOR_BG_DDAN_JD
ACTOR_BG_BREAKWALL
ACTOR_EN_JJ
ACTOR_EN_HORSE_ZELDA
ACTOR_BG_DDAN_KD
ACTOR_DOOR_WARP1
ACTOR_OBJ_SYOKUDAI
ACTOR_ITEM_B_HEART
ACTOR_EN_DEKUNUTS
ACTOR_BG_MENKURI_KAITEN
ACTOR_BG_MENKURI_EYE
ACTOR_EN_VALI
ACTOR_BG_MIZU_MOVEBG
ACTOR_BG_MIZU_WATER
ACTOR_ARMS_HOOK
ACTOR_EN_FHG
ACTOR_BG_MORI_HINERI
ACTOR_EN_BB
ACTOR_BG_TOKI_HIKARI
ACTOR_EN_YUKABYUN
ACTOR_BG_TOKI_SWD
ACTOR_EN_FHG_FIRE
ACTOR_BG_MJIN
ACTOR_BG_HIDAN_KOUSI
ACTOR_DOOR_TOKI
ACTOR_BG_HIDAN_HAMSTEP
ACTOR_EN_BIRD
ACTOR_UNSET_73
ACTOR_UNSET_74
ACTOR_UNSET_75
ACTOR_UNSET_76
ACTOR_EN_WOOD02
ACTOR_UNSET_78
ACTOR_UNSET_79
ACTOR_UNSET_7A
ACTOR_UNSET_7B
ACTOR_EN_LIGHTBOX
ACTOR_EN_PU_BOX
ACTOR_UNSET_7E
ACTOR_UNSET_7F
ACTOR_EN_TRAP
ACTOR_EN_AROW_TRAP
ACTOR_EN_VASE
ACTOR_UNSET_83
ACTOR_EN_TA
ACTOR_EN_TK
ACTOR_BG_MORI_BIGST
ACTOR_BG_MORI_ELEVATOR
ACTOR_BG_MORI_KAITENKABE
ACTOR_BG_MORI_RAKKATENJO
ACTOR_EN_VM
ACTOR_DEMO_EFFECT
ACTOR_DEMO_KANKYO
ACTOR_BG_HIDAN_FWBIG
ACTOR_EN_FLOORMAS
ACTOR_EN_HEISHI1
ACTOR_EN_RD
ACTOR_EN_PO_SISTERS
ACTOR_BG_HEAVY_BLOCK
ACTOR_BG_PO_EVENT
ACTOR_OBJ_MURE
ACTOR_EN_SW
ACTOR_BOSS_FD
ACTOR_OBJECT_KANKYO
ACTOR_EN_DU
ACTOR_EN_FD
ACTOR_EN_HORSE_LINK_CHILD
ACTOR_DOOR_ANA
ACTOR_BG_SPOT02_OBJECTS
ACTOR_BG_HAKA
ACTOR_MAGIC_WIND
ACTOR_MAGIC_FIRE
ACTOR_UNSET_A0
ACTOR_EN_RU1
ACTOR_BOSS_FD2
ACTOR_EN_FD_FIRE
ACTOR_EN_DH
ACTOR_EN_DHA
ACTOR_EN_RL
ACTOR_EN_ENCOUNT1
ACTOR_DEMO_DU
ACTOR_DEMO_IM
ACTOR_DEMO_TRE_LGT
ACTOR_EN_FW
ACTOR_BG_VB_SIMA
ACTOR_EN_VB_BALL
ACTOR_BG_HAKA_MEGANE
ACTOR_BG_HAKA_MEGANEBG
ACTOR_BG_HAKA_SHIP
ACTOR_BG_HAKA_SGAMI
ACTOR_UNSET_B2
ACTOR_EN_HEISHI2
ACTOR_EN_ENCOUNT2
ACTOR_EN_FIRE_ROCK
ACTOR_EN_BROB
ACTOR_MIR_RAY
ACTOR_BG_SPOT09_OBJ
ACTOR_BG_SPOT18_OBJ
ACTOR_BOSS_VA
ACTOR_BG_HAKA_TUBO
ACTOR_BG_HAKA_TRAP
ACTOR_BG_HAKA_HUTA
ACTOR_BG_HAKA_ZOU
ACTOR_BG_SPOT17_FUNEN
ACTOR_EN_SYATEKI_ITM
ACTOR_EN_SYATEKI_MAN
ACTOR_EN_TANA
ACTOR_EN_NB
ACTOR_BOSS_MO
ACTOR_EN_SB
ACTOR_EN_BIGOKUTA
ACTOR_EN_KAREBABA
ACTOR_BG_BDAN_OBJECTS
ACTOR_DEMO_SA
ACTOR_DEMO_GO
ACTOR_EN_IN
ACTOR_EN_TR
ACTOR_BG_SPOT16_BOMBSTONE
ACTOR_UNSET_CE
ACTOR_BG_HIDAN_KOWARERUKABE
ACTOR_BG_BOMBWALL
ACTOR_BG_SPOT08_ICEBLOCK
ACTOR_EN_RU2
ACTOR_OBJ_DEKUJR
ACTOR_BG_MIZU_UZU
ACTOR_BG_SPOT06_OBJECTS
ACTOR_BG_ICE_OBJECTS
ACTOR_BG_HAKA_WATER
ACTOR_UNSET_D8
ACTOR_EN_MA2
ACTOR_EN_BOM_CHU
ACTOR_EN_HORSE_GAME_CHECK
ACTOR_BOSS_TW
ACTOR_EN_RR
ACTOR_EN_BA
ACTOR_EN_BX
ACTOR_EN_ANUBICE
ACTOR_EN_ANUBICE_FIRE
ACTOR_BG_MORI_HASHIGO
ACTOR_BG_MORI_HASHIRA4
ACTOR_BG_MORI_IDOMIZU
ACTOR_BG_SPOT16_DOUGHNUT
ACTOR_BG_BDAN_SWITCH
ACTOR_EN_MA1
ACTOR_BOSS_GANON
ACTOR_BOSS_SST
ACTOR_UNSET_EA
ACTOR_UNSET_EB
ACTOR_EN_NY
ACTOR_EN_FR
ACTOR_ITEM_SHIELD
ACTOR_BG_ICE_SHELTER
ACTOR_EN_ICE_HONO
ACTOR_ITEM_OCARINA
ACTOR_UNSET_F2
ACTOR_UNSET_F3
ACTOR_MAGIC_DARK
ACTOR_DEMO_6K
ACTOR_EN_ANUBICE_TAG
ACTOR_BG_HAKA_GATE
ACTOR_BG_SPOT15_SAKU
ACTOR_BG_JYA_GOROIWA
ACTOR_BG_JYA_ZURERUKABE
ACTOR_UNSET_FB
ACTOR_BG_JYA_COBRA
ACTOR_BG_JYA_KANAAMI
ACTOR_FISHING
ACTOR_OBJ_OSHIHIKI
ACTOR_BG_GATE_SHUTTER
ACTOR_EFF_DUST
ACTOR_BG_SPOT01_FUSYA
ACTOR_BG_SPOT01_IDOHASHIRA
ACTOR_BG_SPOT01_IDOMIZU
ACTOR_BG_PO_SYOKUDAI
ACTOR_BG_GANON_OTYUKA
ACTOR_BG_SPOT15_RRBOX
ACTOR_BG_UMAJUMP
ACTOR_UNSET_109
ACTOR_ARROW_FIRE
ACTOR_ARROW_ICE
ACTOR_ARROW_LIGHT
ACTOR_UNSET_10D
ACTOR_UNSET_10E
ACTOR_ITEM_ETCETERA
ACTOR_OBJ_KIBAKO
ACTOR_OBJ_TSUBO
ACTOR_EN_WONDER_ITEM
ACTOR_EN_IK
ACTOR_DEMO_IK
ACTOR_EN_SKJ
ACTOR_EN_SKJNEEDLE
ACTOR_EN_G_SWITCH
ACTOR_DEMO_EXT
ACTOR_DEMO_SHD
ACTOR_EN_DNS
ACTOR_ELF_MSG
ACTOR_EN_HONOTRAP
ACTOR_EN_TUBO_TRAP
ACTOR_OBJ_ICE_POLY
ACTOR_BG_SPOT03_TAKI
ACTOR_BG_SPOT07_TAKI
ACTOR_EN_FZ
ACTOR_EN_PO_RELAY
ACTOR_BG_RELAY_OBJECTS
ACTOR_EN_DIVING_GAME
ACTOR_EN_KUSA
ACTOR_OBJ_BEAN
ACTOR_OBJ_BOMBIWA
ACTOR_UNSET_128
ACTOR_UNSET_129
ACTOR_OBJ_SWITCH
ACTOR_OBJ_ELEVATOR
ACTOR_OBJ_LIFT
ACTOR_OBJ_HSBLOCK
ACTOR_EN_OKARINA_TAG
ACTOR_EN_YABUSAME_MARK
ACTOR_EN_GOROIWA
ACTOR_EN_EX_RUPPY
ACTOR_EN_TORYO
ACTOR_EN_DAIKU
ACTOR_UNSET_134
ACTOR_EN_NWC
ACTOR_EN_BLKOBJ
ACTOR_ITEM_INBOX
ACTOR_EN_GE1
ACTOR_OBJ_BLOCKSTOP
ACTOR_EN_SDA
ACTOR_EN_CLEAR_TAG
ACTOR_EN_NIW_LADY
ACTOR_EN_GM
ACTOR_EN_MS
ACTOR_EN_HS
ACTOR_BG_INGATE
ACTOR_EN_KANBAN
ACTOR_EN_HEISHI3
ACTOR_EN_SYATEKI_NIW
ACTOR_EN_ATTACK_NIW
ACTOR_BG_SPOT01_IDOSOKO
ACTOR_EN_SA
ACTOR_EN_WONDER_TALK
ACTOR_BG_GJYO_BRIDGE
ACTOR_EN_DS
ACTOR_EN_MK
ACTOR_EN_BOM_BOWL_MAN
ACTOR_EN_BOM_BOWL_PIT
ACTOR_EN_OWL
ACTOR_EN_ISHI
ACTOR_OBJ_HANA
ACTOR_OBJ_LIGHTSWITCH
ACTOR_OBJ_MURE2
ACTOR_EN_GO
ACTOR_EN_FU
ACTOR_UNSET_154
ACTOR_EN_CHANGER
ACTOR_BG_JYA_MEGAMI
ACTOR_BG_JYA_LIFT
ACTOR_BG_JYA_BIGMIRROR
ACTOR_BG_JYA_BOMBCHUIWA
ACTOR_BG_JYA_AMISHUTTER
ACTOR_BG_JYA_BOMBIWA
ACTOR_BG_SPOT18_BASKET
ACTOR_UNSET_15D
ACTOR_EN_GANON_ORGAN
ACTOR_EN_SIOFUKI
ACTOR_EN_STREAM
ACTOR_UNSET_161
ACTOR_EN_MM
ACTOR_EN_KO
ACTOR_EN_KZ
ACTOR_EN_WEATHER_TAG
ACTOR_BG_SST_FLOOR
ACTOR_EN_ANI
ACTOR_EN_EX_ITEM
ACTOR_BG_JYA_IRONOBJ
ACTOR_EN_JS
ACTOR_EN_JSJUTAN
ACTOR_EN_CS
ACTOR_EN_MD
ACTOR_EN_HY
ACTOR_EN_GANON_MANT
ACTOR_EN_OKARINA_EFFECT
ACTOR_EN_MAG
ACTOR_DOOR_GERUDO
ACTOR_ELF_MSG2
ACTOR_DEMO_GT
ACTOR_EN_PO_FIELD
ACTOR_EFC_ERUPC
ACTOR_BG_ZG
ACTOR_EN_HEISHI4
ACTOR_EN_ZL3
ACTOR_BOSS_GANON2
ACTOR_EN_KAKASI
ACTOR_EN_TAKARA_MAN
ACTOR_OBJ_MAKEOSHIHIKI
ACTOR_OCEFF_SPOT
ACTOR_END_TITLE
ACTOR_UNSET_180
ACTOR_EN_TORCH
ACTOR_DEMO_EC
ACTOR_SHOT_SUN
ACTOR_EN_DY_EXTRA
ACTOR_EN_WONDER_TALK2
ACTOR_EN_GE2
ACTOR_OBJ_ROOMTIMER
ACTOR_EN_SSH
ACTOR_EN_STH
ACTOR_OCEFF_WIPE
ACTOR_OCEFF_STORM
ACTOR_EN_WEIYER
ACTOR_BG_SPOT05_SOKO
ACTOR_BG_JYA_1FLIFT
ACTOR_BG_JYA_HAHENIRON
ACTOR_BG_SPOT12_GATE
ACTOR_BG_SPOT12_SAKU
ACTOR_EN_HINTNUTS
ACTOR_EN_NUTSBALL
ACTOR_BG_SPOT00_BREAK
ACTOR_EN_SHOPNUTS
ACTOR_EN_IT
ACTOR_EN_GELDB
ACTOR_OCEFF_WIPE2
ACTOR_OCEFF_WIPE3
ACTOR_EN_NIW_GIRL
ACTOR_EN_DOG
ACTOR_EN_SI
ACTOR_BG_SPOT01_OBJECTS2
ACTOR_OBJ_COMB
ACTOR_BG_SPOT11_BAKUDANKABE
ACTOR_OBJ_KIBAKO2
ACTOR_EN_DNT_DEMO
ACTOR_EN_DNT_JIJI
ACTOR_EN_DNT_NOMAL
ACTOR_EN_GUEST
ACTOR_BG_BOM_GUARD
ACTOR_EN_HS2
ACTOR_DEMO_KEKKAI
ACTOR_BG_SPOT08_BAKUDANKABE
ACTOR_BG_SPOT17_BAKUDANKABE
ACTOR_UNSET_1AA
ACTOR_OBJ_MURE3
ACTOR_EN_TG
ACTOR_EN_MU
ACTOR_EN_GO2
ACTOR_EN_WF
ACTOR_EN_SKB
ACTOR_DEMO_GJ
ACTOR_DEMO_GEFF
ACTOR_BG_GND_FIREMEIRO
ACTOR_BG_GND_DARKMEIRO
ACTOR_BG_GND_SOULMEIRO
ACTOR_BG_GND_NISEKABE
ACTOR_BG_GND_ICEBLOCK
ACTOR_EN_GB
ACTOR_EN_GS
ACTOR_BG_MIZU_BWALL
ACTOR_BG_MIZU_SHUTTER
ACTOR_EN_DAIKU_KAKARIKO
ACTOR_BG_BOWL_WALL
ACTOR_EN_WALL_TUBO
ACTOR_EN_PO_DESERT
ACTOR_EN_CROW
ACTOR_DOOR_KILLER
ACTOR_BG_SPOT11_OASIS
ACTOR_BG_SPOT18_FUTA
ACTOR_BG_SPOT18_SHUTTER
ACTOR_EN_MA3
ACTOR_EN_COW
ACTOR_BG_ICE_TURARA
ACTOR_BG_ICE_SHUTTER
ACTOR_EN_KAKASI2
ACTOR_EN_KAKASI3
ACTOR_OCEFF_WIPE4
ACTOR_EN_EG
ACTOR_BG_MENKURI_NISEKABE
ACTOR_EN_ZO
ACTOR_OBJ_MAKEKINSUTA
ACTOR_EN_GE3
ACTOR_OBJ_TIMEBLOCK
ACTOR_OBJ_HAMISHI
ACTOR_EN_ZL4
ACTOR_EN_MM2
ACTOR_BG_JYA_BLOCK
ACTOR_OBJ_WARP2BLOCK
ACTOR_ID_MAX

View File

@ -1,8 +0,0 @@
<Root>
<SymbolMap File="SymbolMap_OoTMqDbg.txt"/>
<ActorList File="ActorList_OoTMqDbg.txt"/>
<ObjectList File="ObjectList_OoTMqDbg.txt"/>
<ExternalXMLFolder Path="../soh/assets/xml/GC_NMQ_PAL_F/"/>
<TexturePool File="TexturePool.xml"/>
<ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="objects/gameplay_keep/"/>
</Root>

View File

@ -1,402 +0,0 @@
OBJECT_INVALID
OBJECT_GAMEPLAY_KEEP
OBJECT_GAMEPLAY_FIELD_KEEP
OBJECT_GAMEPLAY_DANGEON_KEEP
OBJECT_UNSET_4
OBJECT_UNSET_5
OBJECT_HUMAN
OBJECT_OKUTA
OBJECT_CROW
OBJECT_POH
OBJECT_DY_OBJ
OBJECT_WALLMASTER
OBJECT_DODONGO
OBJECT_FIREFLY
OBJECT_BOX
OBJECT_FIRE
OBJECT_UNSET_10
OBJECT_UNSET_11
OBJECT_BUBBLE
OBJECT_NIW
OBJECT_LINK_BOY
OBJECT_LINK_CHILD
OBJECT_TITE
OBJECT_REEBA
OBJECT_PEEHAT
OBJECT_KINGDODONGO
OBJECT_HORSE
OBJECT_ZF
OBJECT_GOMA
OBJECT_ZL1
OBJECT_GOL
OBJECT_DODOJR
OBJECT_TORCH2
OBJECT_BL
OBJECT_TP
OBJECT_OA1
OBJECT_ST
OBJECT_BW
OBJECT_EI
OBJECT_HORSE_NORMAL
OBJECT_OB1
OBJECT_O_ANIME
OBJECT_SPOT04_OBJECTS
OBJECT_DDAN_OBJECTS
OBJECT_HIDAN_OBJECTS
OBJECT_HORSE_GANON
OBJECT_OA2
OBJECT_SPOT00_OBJECTS
OBJECT_MB
OBJECT_BOMBF
OBJECT_SK2
OBJECT_OE1
OBJECT_OE_ANIME
OBJECT_OE2
OBJECT_YDAN_OBJECTS
OBJECT_GND
OBJECT_AM
OBJECT_DEKUBABA
OBJECT_UNSET_3A
OBJECT_OA3
OBJECT_OA4
OBJECT_OA5
OBJECT_OA6
OBJECT_OA7
OBJECT_JJ
OBJECT_OA8
OBJECT_OA9
OBJECT_OB2
OBJECT_OB3
OBJECT_OB4
OBJECT_HORSE_ZELDA
OBJECT_OPENING_DEMO1
OBJECT_WARP1
OBJECT_B_HEART
OBJECT_DEKUNUTS
OBJECT_OE3
OBJECT_OE4
OBJECT_MENKURI_OBJECTS
OBJECT_OE5
OBJECT_OE6
OBJECT_OE7
OBJECT_OE8
OBJECT_OE9
OBJECT_OE10
OBJECT_OE11
OBJECT_OE12
OBJECT_VALI
OBJECT_OA10
OBJECT_OA11
OBJECT_MIZU_OBJECTS
OBJECT_FHG
OBJECT_OSSAN
OBJECT_MORI_HINERI1
OBJECT_BB
OBJECT_TOKI_OBJECTS
OBJECT_YUKABYUN
OBJECT_ZL2
OBJECT_MJIN
OBJECT_MJIN_FLASH
OBJECT_MJIN_DARK
OBJECT_MJIN_FLAME
OBJECT_MJIN_ICE
OBJECT_MJIN_SOUL
OBJECT_MJIN_WIND
OBJECT_MJIN_OKA
OBJECT_HAKA_OBJECTS
OBJECT_SPOT06_OBJECTS
OBJECT_ICE_OBJECTS
OBJECT_RELAY_OBJECTS
OBJECT_PO_FIELD
OBJECT_PO_COMPOSER
OBJECT_MORI_HINERI1A
OBJECT_MORI_HINERI2
OBJECT_MORI_HINERI2A
OBJECT_MORI_OBJECTS
OBJECT_MORI_TEX
OBJECT_SPOT08_OBJ
OBJECT_WARP2
OBJECT_HATA
OBJECT_BIRD
OBJECT_UNSET_78
OBJECT_UNSET_79
OBJECT_UNSET_7A
OBJECT_UNSET_7B
OBJECT_WOOD02
OBJECT_UNSET_7D
OBJECT_UNSET_7E
OBJECT_UNSET_7F
OBJECT_UNSET_80
OBJECT_LIGHTBOX
OBJECT_PU_BOX
OBJECT_UNSET_83
OBJECT_UNSET_84
OBJECT_TRAP
OBJECT_VASE
OBJECT_IM
OBJECT_TA
OBJECT_TK
OBJECT_XC
OBJECT_VM
OBJECT_BV
OBJECT_HAKACH_OBJECTS
OBJECT_EFC_CRYSTAL_LIGHT
OBJECT_EFC_FIRE_BALL
OBJECT_EFC_FLASH
OBJECT_EFC_LGT_SHOWER
OBJECT_EFC_STAR_FIELD
OBJECT_GOD_LGT
OBJECT_LIGHT_RING
OBJECT_TRIFORCE_SPOT
OBJECT_BDAN_OBJECTS
OBJECT_SD
OBJECT_RD
OBJECT_PO_SISTERS
OBJECT_HEAVY_OBJECT
OBJECT_GNDD
OBJECT_FD
OBJECT_DU
OBJECT_FW
OBJECT_MEDAL
OBJECT_HORSE_LINK_CHILD
OBJECT_SPOT02_OBJECTS
OBJECT_HAKA
OBJECT_RU1
OBJECT_SYOKUDAI
OBJECT_FD2
OBJECT_DH
OBJECT_RL
OBJECT_EFC_TW
OBJECT_DEMO_TRE_LGT
OBJECT_GI_KEY
OBJECT_MIR_RAY
OBJECT_BROB
OBJECT_GI_JEWEL
OBJECT_SPOT09_OBJ
OBJECT_SPOT18_OBJ
OBJECT_BDOOR
OBJECT_SPOT17_OBJ
OBJECT_SHOP_DUNGEN
OBJECT_NB
OBJECT_MO
OBJECT_SB
OBJECT_GI_MELODY
OBJECT_GI_HEART
OBJECT_GI_COMPASS
OBJECT_GI_BOSSKEY
OBJECT_GI_MEDAL
OBJECT_GI_NUTS
OBJECT_SA
OBJECT_GI_HEARTS
OBJECT_GI_ARROWCASE
OBJECT_GI_BOMBPOUCH
OBJECT_IN
OBJECT_TR
OBJECT_SPOT16_OBJ
OBJECT_OE1S
OBJECT_OE4S
OBJECT_OS_ANIME
OBJECT_GI_BOTTLE
OBJECT_GI_STICK
OBJECT_GI_MAP
OBJECT_OF1D_MAP
OBJECT_RU2
OBJECT_GI_SHIELD_1
OBJECT_DEKUJR
OBJECT_GI_MAGICPOT
OBJECT_GI_BOMB_1
OBJECT_OF1S
OBJECT_MA2
OBJECT_GI_PURSE
OBJECT_HNI
OBJECT_TW
OBJECT_RR
OBJECT_BXA
OBJECT_ANUBICE
OBJECT_GI_GERUDO
OBJECT_GI_ARROW
OBJECT_GI_BOMB_2
OBJECT_GI_EGG
OBJECT_GI_SCALE
OBJECT_GI_SHIELD_2
OBJECT_GI_HOOKSHOT
OBJECT_GI_OCARINA
OBJECT_GI_MILK
OBJECT_MA1
OBJECT_GANON
OBJECT_SST
OBJECT_NY_UNUSED
OBJECT_UNSET_E4
OBJECT_NY
OBJECT_FR
OBJECT_GI_PACHINKO
OBJECT_GI_BOOMERANG
OBJECT_GI_BOW
OBJECT_GI_GLASSES
OBJECT_GI_LIQUID
OBJECT_ANI
OBJECT_DEMO_6K
OBJECT_GI_SHIELD_3
OBJECT_GI_LETTER
OBJECT_SPOT15_OBJ
OBJECT_JYA_OBJ
OBJECT_GI_CLOTHES
OBJECT_GI_BEAN
OBJECT_GI_FISH
OBJECT_GI_SAW
OBJECT_GI_HAMMER
OBJECT_GI_GRASS
OBJECT_GI_LONGSWORD
OBJECT_SPOT01_OBJECTS
OBJECT_MD_UNUSED
OBJECT_MD
OBJECT_KM1
OBJECT_KW1
OBJECT_ZO
OBJECT_KZ
OBJECT_UMAJUMP
OBJECT_MASTERKOKIRI
OBJECT_MASTERKOKIRIHEAD
OBJECT_MASTERGOLON
OBJECT_MASTERZOORA
OBJECT_AOB
OBJECT_IK
OBJECT_AHG
OBJECT_CNE
OBJECT_GI_NIWATORI
OBJECT_SKJ
OBJECT_GI_BOTTLE_LETTER
OBJECT_BJI
OBJECT_BBA
OBJECT_GI_OCARINA_0
OBJECT_DS
OBJECT_ANE
OBJECT_BOJ
OBJECT_SPOT03_OBJECT
OBJECT_SPOT07_OBJECT
OBJECT_FZ
OBJECT_BOB
OBJECT_GE1
OBJECT_YABUSAME_POINT
OBJECT_GI_BOOTS_2
OBJECT_GI_SEED
OBJECT_GND_MAGIC
OBJECT_D_ELEVATOR
OBJECT_D_HSBLOCK
OBJECT_D_LIFT
OBJECT_MAMENOKI
OBJECT_GOROIWA
OBJECT_UNSET_120
OBJECT_TORYO
OBJECT_DAIKU
OBJECT_UNSET_123
OBJECT_NWC
OBJECT_BLKOBJ
OBJECT_GM
OBJECT_MS
OBJECT_HS
OBJECT_INGATE
OBJECT_LIGHTSWITCH
OBJECT_KUSA
OBJECT_TSUBO
OBJECT_GI_GLOVES
OBJECT_GI_COIN
OBJECT_KANBAN
OBJECT_GJYO_OBJECTS
OBJECT_OWL
OBJECT_MK
OBJECT_FU
OBJECT_GI_KI_TAN_MASK
OBJECT_GI_REDEAD_MASK
OBJECT_GI_SKJ_MASK
OBJECT_GI_RABIT_MASK
OBJECT_GI_TRUTH_MASK
OBJECT_GANON_OBJECTS
OBJECT_SIOFUKI
OBJECT_STREAM
OBJECT_MM
OBJECT_FA
OBJECT_OS
OBJECT_GI_EYE_LOTION
OBJECT_GI_POWDER
OBJECT_GI_MUSHROOM
OBJECT_GI_TICKETSTONE
OBJECT_GI_BROKENSWORD
OBJECT_JS
OBJECT_CS
OBJECT_GI_PRESCRIPTION
OBJECT_GI_BRACELET
OBJECT_GI_SOLDOUT
OBJECT_GI_FROG
OBJECT_MAG
OBJECT_DOOR_GERUDO
OBJECT_GT
OBJECT_EFC_ERUPC
OBJECT_ZL2_ANIME1
OBJECT_ZL2_ANIME2
OBJECT_GI_GOLONMASK
OBJECT_GI_ZORAMASK
OBJECT_GI_GERUDOMASK
OBJECT_GANON2
OBJECT_KA
OBJECT_TS
OBJECT_ZG
OBJECT_GI_HOVERBOOTS
OBJECT_GI_M_ARROW
OBJECT_DS2
OBJECT_EC
OBJECT_FISH
OBJECT_GI_SUTARU
OBJECT_GI_GODDESS
OBJECT_SSH
OBJECT_BIGOKUTA
OBJECT_BG
OBJECT_SPOT05_OBJECTS
OBJECT_SPOT12_OBJ
OBJECT_BOMBIWA
OBJECT_HINTNUTS
OBJECT_RS
OBJECT_SPOT00_BREAK
OBJECT_GLA
OBJECT_SHOPNUTS
OBJECT_GELDB
OBJECT_GR
OBJECT_DOG
OBJECT_JYA_IRON
OBJECT_JYA_DOOR
OBJECT_UNSET_16E
OBJECT_SPOT11_OBJ
OBJECT_KIBAKO2
OBJECT_DNS
OBJECT_DNK
OBJECT_GI_FIRE
OBJECT_GI_INSECT
OBJECT_GI_BUTTERFLY
OBJECT_GI_GHOST
OBJECT_GI_SOUL
OBJECT_BOWL
OBJECT_DEMO_KEKKAI
OBJECT_EFC_DOUGHNUT
OBJECT_GI_DEKUPOUCH
OBJECT_GANON_ANIME1
OBJECT_GANON_ANIME2
OBJECT_GANON_ANIME3
OBJECT_GI_RUPY
OBJECT_SPOT01_MATOYA
OBJECT_SPOT01_MATOYAB
OBJECT_MU
OBJECT_WF
OBJECT_SKB
OBJECT_GJ
OBJECT_GEFF
OBJECT_HAKA_DOOR
OBJECT_GS
OBJECT_PS
OBJECT_BWALL
OBJECT_COW
OBJECT_COB
OBJECT_GI_SWORD_1
OBJECT_DOOR_KILLER
OBJECT_OUKE_HAKA
OBJECT_TIMEBLOCK
OBJECT_ZL4

View File

@ -1 +0,0 @@
8012DB20 gMtxClear

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
################################################################################
# Command for variable_watch. This command issues error message, if a variable
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens
# variable_watch(<variable> property_reader_guard)
################################################################################
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK)
if("${PROPERTY_READER_GUARD_DISABLED}")
return()
endif()
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS")
message(FATAL_ERROR
" Variable ${VARIABLE} is not supposed to be changed.\n"
" It is used only for reading target property ${VARIABLE}.\n"
" Use\n"
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n"
" or\n"
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n"
" instead.\n")
endif()
endfunction()
################################################################################
# Create variable <name> with generator expression that expands to value of
# target property <name>_<CONFIG>. If property is empty or not set then property
# <name> is used instead. Variable <name> has watcher property_reader_guard that
# doesn't allow to edit it.
# create_property_reader(<name>)
# Input:
# name - Name of watched property and output variable
################################################################################
function(create_property_reader NAME)
set(PROPERTY_READER_GUARD_DISABLED TRUE)
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>")
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>")
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>")
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE)
variable_watch("${NAME}" property_reader_guard)
endfunction()
################################################################################
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value>
# set_config_specific_property(<name> <value>)
# Input:
# name - Prefix of property name
# value - New value
################################################################################
function(set_config_specific_property NAME VALUE)
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}")
endfunction()
################################################################################
create_property_reader("TARGET_NAME")
create_property_reader("OUTPUT_DIRECTORY")
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}")
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")

View File

@ -1,12 +0,0 @@
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake")
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}")
if(MSVC)
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING")
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT")
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
endif()

View File

@ -1,233 +0,0 @@
# utils file for projects came from visual studio solution with cmake-converter.
################################################################################
# Wrap each token of the command with condition
################################################################################
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW)
macro(prepare_commands)
unset(TOKEN_ROLE)
unset(COMMANDS)
foreach(TOKEN ${ARG_COMMANDS})
if("${TOKEN}" STREQUAL "COMMAND")
set(TOKEN_ROLE "KEYWORD")
elseif("${TOKEN_ROLE}" STREQUAL "KEYWORD")
set(TOKEN_ROLE "CONDITION")
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
set(TOKEN_ROLE "COMMAND")
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
set(TOKEN_ROLE "ARG")
endif()
if("${TOKEN_ROLE}" STREQUAL "KEYWORD")
list(APPEND COMMANDS "${TOKEN}")
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
set(CONDITION ${TOKEN})
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
list(APPEND COMMANDS "$<$<NOT:${CONDITION}>:${DUMMY}>$<${CONDITION}:${TOKEN}>")
elseif("${TOKEN_ROLE}" STREQUAL "ARG")
list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>")
endif()
endforeach()
endmacro()
cmake_policy(POP)
################################################################################
# Transform all the tokens to absolute paths
################################################################################
macro(prepare_output)
unset(OUTPUT)
foreach(TOKEN ${ARG_OUTPUT})
if(IS_ABSOLUTE ${TOKEN})
list(APPEND OUTPUT "${TOKEN}")
else()
list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}")
endif()
endforeach()
endmacro()
################################################################################
# Parse add_custom_command_if args.
#
# Input:
# PRE_BUILD - Pre build event option
# PRE_LINK - Pre link event option
# POST_BUILD - Post build event option
# TARGET - Target
# OUTPUT - List of output files
# DEPENDS - List of files on which the command depends
# COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND
# condition2 commannd2 args2 ...)
# Output:
# OUTPUT - Output files
# DEPENDS - Files on which the command depends
# COMMENT - Comment
# PRE_BUILD - TRUE/FALSE
# PRE_LINK - TRUE/FALSE
# POST_BUILD - TRUE/FALSE
# TARGET - Target name
# COMMANDS - Prepared commands(every token is wrapped in CONDITION)
# NAME - Unique name for custom target
# STEP - PRE_BUILD/PRE_LINK/POST_BUILD
################################################################################
function(add_custom_command_if_parse_arguments)
cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN})
if(WIN32)
set(DUMMY "cd.")
elseif(UNIX)
set(DUMMY "true")
endif()
prepare_commands()
prepare_output()
set(DEPENDS "${ARG_DEPENDS}")
set(COMMENT "${ARG_COMMENT}")
set(PRE_BUILD "${ARG_PRE_BUILD}")
set(PRE_LINK "${ARG_PRE_LINK}")
set(POST_BUILD "${ARG_POST_BUILD}")
set(TARGET "${ARG_TARGET}")
if(PRE_BUILD)
set(STEP "PRE_BUILD")
elseif(PRE_LINK)
set(STEP "PRE_LINK")
elseif(POST_BUILD)
set(STEP "POST_BUILD")
endif()
set(NAME "${TARGET}_${STEP}")
set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
set(DEPENDS "${DEPENDS}" PARENT_SCOPE)
set(COMMENT "${COMMENT}" PARENT_SCOPE)
set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE)
set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE)
set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE)
set(TARGET "${TARGET}" PARENT_SCOPE)
set(COMMANDS "${COMMANDS}" PARENT_SCOPE)
set(STEP "${STEP}" PARENT_SCOPE)
set(NAME "${NAME}" PARENT_SCOPE)
endfunction()
################################################################################
# Add conditional custom command
#
# Generating Files
# The first signature is for adding a custom command to produce an output:
# add_custom_command_if(
# <OUTPUT output1 [output2 ...]>
# <COMMANDS>
# <COMMAND condition command1 [args1...]>
# [COMMAND condition command2 [args2...]]
# [DEPENDS [depends...]]
# [COMMENT comment]
#
# Build Events
# add_custom_command_if(
# <TARGET target>
# <PRE_BUILD | PRE_LINK | POST_BUILD>
# <COMMAND condition command1 [args1...]>
# [COMMAND condition command2 [args2...]]
# [COMMENT comment]
#
# Input:
# output - Output files the command is expected to produce
# condition - Generator expression for wrapping the command
# command - Command-line(s) to execute at build time.
# args - Command`s args
# depends - Files on which the command depends
# comment - Display the given message before the commands are executed at
# build time.
# PRE_BUILD - Run before any other rules are executed within the target
# PRE_LINK - Run after sources have been compiled but before linking the
# binary
# POST_BUILD - Run after all other rules within the target have been
# executed
################################################################################
function(add_custom_command_if)
add_custom_command_if_parse_arguments(${ARGN})
if(OUTPUT AND TARGET)
message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.")
endif()
if(OUTPUT)
add_custom_command(OUTPUT ${OUTPUT}
${COMMANDS}
DEPENDS ${DEPENDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${COMMENT})
elseif(TARGET)
if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio")
add_custom_target(
${NAME}
${COMMANDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${COMMENT})
add_dependencies(${TARGET} ${NAME})
else()
add_custom_command(
TARGET ${TARGET}
${STEP}
${COMMANDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${COMMENT})
endif()
else()
message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.")
endif()
endfunction()
################################################################################
# Use props file for a target and configs
# use_props(<target> <configs...> <props_file>)
# Inside <props_file> there are following variables:
# PROPS_TARGET - <target>
# PROPS_CONFIG - One of <configs...>
# PROPS_CONFIG_U - Uppercase PROPS_CONFIG
# Input:
# target - Target to apply props file
# configs - Build configurations to apply props file
# props_file - CMake script
################################################################################
macro(use_props TARGET CONFIGS PROPS_FILE)
set(PROPS_TARGET "${TARGET}")
foreach(PROPS_CONFIG ${CONFIGS})
string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U)
get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
if(EXISTS "${ABSOLUTE_PROPS_FILE}")
include("${ABSOLUTE_PROPS_FILE}")
else()
message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist")
endif()
endforeach()
endmacro()
################################################################################
# Add compile options to source file
# source_file_compile_options(<source_file> [compile_options...])
# Input:
# source_file - Source file
# compile_options - Options to add to COMPILE_FLAGS property
################################################################################
function(source_file_compile_options SOURCE_FILE)
if("${ARGC}" LESS_EQUAL "1")
return()
endif()
get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS)
if(COMPILE_OPTIONS)
list(APPEND COMPILE_OPTIONS ${ARGN})
else()
set(COMPILE_OPTIONS "${ARGN}")
endif()
set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}")
endfunction()
################################################################################
# Default properties of visual studio projects
################################################################################
set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake")

View File

@ -1,96 +0,0 @@
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
#set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
set(CMAKE_C_STANDARD 11)
project(OTRExporter C CXX)
################################################################################
# Set target arch type if empty. Visual studio solution generator provides it.
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(NOT CMAKE_VS_PLATFORM_NAME)
set(CMAKE_VS_PLATFORM_NAME "x64")
endif()
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
endif()
endif()
################################################################################
# Global configuration types
################################################################################
set(CMAKE_CONFIGURATION_TYPES
"Debug"
"Release"
CACHE STRING "" FORCE
)
################################################################################
# Global compiler options
################################################################################
if(MSVC)
# remove default flags provided with CMake for MSVC
set(CMAKE_C_FLAGS "")
set(CMAKE_C_FLAGS_DEBUG "")
set(CMAKE_C_FLAGS_RELEASE "")
set(CMAKE_CXX_FLAGS "")
set(CMAKE_CXX_FLAGS_DEBUG "")
set(CMAKE_CXX_FLAGS_RELEASE "")
endif()
################################################################################
# Global linker options
################################################################################
if(MSVC)
# remove default flags provided with CMake for MSVC
set(CMAKE_EXE_LINKER_FLAGS "")
set(CMAKE_MODULE_LINKER_FLAGS "")
set(CMAKE_SHARED_LINKER_FLAGS "")
set(CMAKE_STATIC_LINKER_FLAGS "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}")
endif()
################################################################################
# Common utils
################################################################################
include(CMake/Utils.cmake)
################################################################################
# Additional Global Settings(add specific info there)
################################################################################
include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
################################################################################
# Use solution folders feature
################################################################################
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
################################################################################
# Sub-projects
################################################################################
if (NOT TARGET libultraship)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship ${CMAKE_BINARY_DIR}/libultraship)
endif()
if (NOT TARGET ZAPD)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
endif()
if (NOT TARGET ZAPDUtils)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
endif()
add_subdirectory(OTRExporter)

View File

@ -1,9 +0,0 @@
Copyright (c) 2022 Harbour Masters
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,70 +0,0 @@
#include "AnimationExporter.h"
#include <resource/type/Animation.h>
void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZAnimation* anim = (ZAnimation*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Animation);
ZNormalAnimation* normalAnim = dynamic_cast<ZNormalAnimation*>(anim);
ZCurveAnimation* curveAnim = dynamic_cast<ZCurveAnimation*>(anim);
ZLinkAnimation* linkAnim = dynamic_cast<ZLinkAnimation*>(anim);
if (linkAnim != nullptr)
{
writer->Write((uint32_t)Ship::AnimationType::Link);
writer->Write((uint16_t)linkAnim->frameCount);
writer->Write((uint32_t)linkAnim->segmentAddress);
}
else if (curveAnim != nullptr)
{
writer->Write((uint32_t)Ship::AnimationType::Curve);
writer->Write((uint16_t)curveAnim->frameCount);
writer->Write((uint32_t)curveAnim->refIndexArr.size());
for (auto val : curveAnim->refIndexArr)
writer->Write(val);
writer->Write((uint32_t)curveAnim->transformDataArr.size());
for (auto val : curveAnim->transformDataArr)
{
writer->Write(val.unk_00);
writer->Write(val.unk_02);
writer->Write(val.unk_04);
writer->Write(val.unk_06);
writer->Write(val.unk_08);
}
writer->Write((uint32_t)curveAnim->copyValuesArr.size());
for (auto val : curveAnim->copyValuesArr)
writer->Write(val);
}
else if (normalAnim != nullptr)
{
writer->Write((uint32_t)Ship::AnimationType::Normal);
writer->Write((uint16_t)normalAnim->frameCount);
writer->Write((uint32_t)normalAnim->rotationValues.size());
for (size_t i = 0; i < normalAnim->rotationValues.size(); i++)
writer->Write(normalAnim->rotationValues[i]);
writer->Write((uint32_t)normalAnim->rotationIndices.size());
for (size_t i = 0; i < normalAnim->rotationIndices.size(); i++)
{
writer->Write(normalAnim->rotationIndices[i].x);
writer->Write(normalAnim->rotationIndices[i].y);
writer->Write(normalAnim->rotationIndices[i].z);
}
writer->Write(normalAnim->limit);
}
else
{
writer->Write((uint32_t)Ship::AnimationType::Legacy);
}
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZTexture.h"
#include "ZAnimation.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Animation : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,108 +0,0 @@
#include "ArrayExporter.h"
#include "VtxExporter.h"
#include <ZVector.h>
void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZArray* arr = (ZArray*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Array);
writer->Write((uint32_t)arr->resList[0]->GetResourceType());
writer->Write((uint32_t)arr->arrayCnt);
for (size_t i = 0; i < arr->arrayCnt; i++)
{
if (arr->resList[i]->GetResourceType() == ZResourceType::Vertex)
{
ZVtx* vtx = (ZVtx*)arr->resList[i];
writer->Write(vtx->x);
writer->Write(vtx->y);
writer->Write(vtx->z);
writer->Write(vtx->flag);
writer->Write(vtx->s);
writer->Write(vtx->t);
writer->Write(vtx->r);
writer->Write(vtx->g);
writer->Write(vtx->b);
writer->Write(vtx->a);
}
else if (arr->resList[i]->GetResourceType() == ZResourceType::Vector)
{
ZVector* vec = (ZVector*)arr->resList[i];
writer->Write((uint32_t)vec->scalarType);
writer->Write((uint32_t)vec->dimensions);
for (size_t k = 0; k < vec->dimensions; k++)
{
// OTRTODO: Duplicate code here. Cleanup at a later date...
switch (vec->scalarType)
{
case ZScalarType::ZSCALAR_U8:
writer->Write(vec->scalars[k].scalarData.u8);
break;
case ZScalarType::ZSCALAR_S8:
writer->Write(vec->scalars[k].scalarData.s8);
break;
case ZScalarType::ZSCALAR_U16:
writer->Write(vec->scalars[k].scalarData.u16);
break;
case ZScalarType::ZSCALAR_S16:
writer->Write(vec->scalars[k].scalarData.s16);
break;
case ZScalarType::ZSCALAR_S32:
writer->Write(vec->scalars[k].scalarData.s32);
break;
case ZScalarType::ZSCALAR_U32:
writer->Write(vec->scalars[k].scalarData.u32);
break;
case ZScalarType::ZSCALAR_S64:
writer->Write(vec->scalars[k].scalarData.s64);
break;
case ZScalarType::ZSCALAR_U64:
writer->Write(vec->scalars[k].scalarData.u64);
break;
// OTRTODO: ADD OTHER TYPES
default:
break;
}
}
}
else
{
ZScalar* scal = (ZScalar*)arr->resList[i];
writer->Write((uint32_t)scal->scalarType);
switch (scal->scalarType)
{
case ZScalarType::ZSCALAR_U8:
writer->Write(scal->scalarData.u8);
break;
case ZScalarType::ZSCALAR_S8:
writer->Write(scal->scalarData.s8);
break;
case ZScalarType::ZSCALAR_U16:
writer->Write(scal->scalarData.u16);
break;
case ZScalarType::ZSCALAR_S16:
writer->Write(scal->scalarData.s16);
break;
case ZScalarType::ZSCALAR_S32:
writer->Write(scal->scalarData.s32);
break;
case ZScalarType::ZSCALAR_U32:
writer->Write(scal->scalarData.u32);
break;
case ZScalarType::ZSCALAR_S64:
writer->Write(scal->scalarData.s64);
break;
case ZScalarType::ZSCALAR_U64:
writer->Write(scal->scalarData.u64);
break;
// OTRTODO: ADD OTHER TYPES
default:
break;
}
}
}
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZArray.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Array : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,191 +0,0 @@
#include "AudioExporter.h"
#include "Main.h"
#include <Utils/MemoryStream.h>
#include <Globals.h>
#include <Utils/File.h>
#include "DisplayListExporter.h"
void OTRExporter_Audio::WriteSampleEntryReference(ZAudio* audio, SampleEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer)
{
writer->Write((uint8_t)(entry != nullptr ? 1 : 0));
if (entry != nullptr)
{
if (audio->sampleOffsets[entry->bankId].find(entry->sampleLoopOffset) != audio->sampleOffsets[entry->bankId].end())
{
if (audio->sampleOffsets[entry->bankId][entry->sampleLoopOffset].find(entry->sampleDataOffset) != audio->sampleOffsets[entry->bankId][entry->sampleLoopOffset].end())
{
writer->Write(StringHelper::Sprintf("audio/samples/%s", audio->sampleOffsets[entry->bankId][entry->sampleLoopOffset][entry->sampleDataOffset].c_str()));
}
else
writer->Write(entry->fileName);
}
else
writer->Write(entry->fileName);
}
else
writer->Write("");
}
void OTRExporter_Audio::WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer)
{
WriteHeader(nullptr, "", writer, Ship::ResourceType::SOH_AudioSample, Ship::Version::Rachael);
writer->Write(entry->codec);
writer->Write(entry->medium);
writer->Write(entry->unk_bit26);
writer->Write(entry->unk_bit25);
writer->Write((uint32_t)entry->data.size());
writer->Write((char*)entry->data.data(), entry->data.size());
writer->Write((uint32_t)(entry->loop.start));
writer->Write((uint32_t)(entry->loop.end));
writer->Write((uint32_t)(entry->loop.count));
writer->Write((uint32_t)entry->loop.states.size());
for (size_t i = 0; i < entry->loop.states.size(); i++)
writer->Write((entry->loop.states[i]));
writer->Write((uint32_t)(entry->book.order));
writer->Write((uint32_t)(entry->book.npredictors));
writer->Write((uint32_t)entry->book.books.size());
for (size_t i = 0; i < entry->book.books.size(); i++)
writer->Write((entry->book.books[i]));
}
void OTRExporter_Audio::WriteSoundFontEntry(ZAudio* audio, SoundFontEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer)
{
writer->Write((uint8_t)(entry != nullptr ? 1 : 0));
if (entry != nullptr)
{
WriteSampleEntryReference(audio, entry->sampleEntry, samples, writer);
writer->Write(entry->tuning);
}
}
void OTRExporter_Audio::WriteEnvData(std::vector<AdsrEnvelope*> envelopes, BinaryWriter* writer)
{
writer->Write((uint32_t)envelopes.size());
for (auto env : envelopes)
{
writer->Write(env->delay);
writer->Write(env->arg);
}
}
void OTRExporter_Audio::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZAudio* audio = (ZAudio*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Audio, Ship::Version::Rachael);
// Write Samples as individual files
for (auto pair : audio->samples)
{
MemoryStream* sampleStream = new MemoryStream();
BinaryWriter sampleWriter = BinaryWriter(sampleStream);
writer->Write((uint32_t)pair.first);
WriteSampleEntry(pair.second, &sampleWriter);
std::string basePath = "";
if (audio->sampleOffsets[pair.second->bankId].find(pair.second->sampleLoopOffset) != audio->sampleOffsets[pair.second->bankId].end())
{
if (audio->sampleOffsets[pair.second->bankId][pair.second->sampleLoopOffset].find(pair.second->sampleDataOffset) != audio->sampleOffsets[pair.second->bankId][pair.second->sampleLoopOffset].end())
basePath = StringHelper::Sprintf("samples/%s", audio->sampleOffsets[pair.second->bankId][pair.second->sampleLoopOffset][pair.second->sampleDataOffset].c_str());
else
basePath = StringHelper::Sprintf("samples/sample_%08X", pair.first);
}
else
basePath = StringHelper::Sprintf("samples/sample_%08X", pair.first);
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, basePath);
AddFile(fName, sampleStream->ToVector());
}
// Write the soundfont table
for (size_t i = 0; i < audio->soundFontTable.size(); i++)
{
MemoryStream* fntStream = new MemoryStream();
BinaryWriter fntWriter = BinaryWriter(fntStream);
WriteHeader(nullptr, "", &fntWriter, Ship::ResourceType::SOH_AudioSoundFont, Ship::Version::Rachael);
fntWriter.Write((uint32_t)i);
fntWriter.Write(audio->soundFontTable[i].medium);
fntWriter.Write(audio->soundFontTable[i].cachePolicy);
fntWriter.Write(audio->soundFontTable[i].data1);
fntWriter.Write(audio->soundFontTable[i].data2);
fntWriter.Write(audio->soundFontTable[i].data3);
fntWriter.Write((uint32_t)audio->soundFontTable[i].drums.size());
fntWriter.Write((uint32_t)audio->soundFontTable[i].instruments.size());
fntWriter.Write((uint32_t)audio->soundFontTable[i].soundEffects.size());
for (size_t k = 0; k < audio->soundFontTable[i].drums.size(); k++)
{
fntWriter.Write(audio->soundFontTable[i].drums[k].releaseRate);
fntWriter.Write(audio->soundFontTable[i].drums[k].pan);
fntWriter.Write(audio->soundFontTable[i].drums[k].loaded);
WriteEnvData(audio->soundFontTable[i].drums[k].env, &fntWriter);
WriteSampleEntryReference(audio, audio->soundFontTable[i].drums[k].sample, audio->samples, &fntWriter);
fntWriter.Write(audio->soundFontTable[i].drums[k].tuning);
}
for (size_t k = 0; k < audio->soundFontTable[i].instruments.size(); k++)
{
fntWriter.Write((uint8_t)audio->soundFontTable[i].instruments[k].isValidInstrument);
fntWriter.Write(audio->soundFontTable[i].instruments[k].loaded);
fntWriter.Write(audio->soundFontTable[i].instruments[k].normalRangeLo);
fntWriter.Write(audio->soundFontTable[i].instruments[k].normalRangeHi);
fntWriter.Write(audio->soundFontTable[i].instruments[k].releaseRate);
WriteEnvData(audio->soundFontTable[i].instruments[k].env, &fntWriter);
WriteSoundFontEntry(audio, audio->soundFontTable[i].instruments[k].lowNotesSound, audio->samples, &fntWriter);
WriteSoundFontEntry(audio, audio->soundFontTable[i].instruments[k].normalNotesSound, audio->samples, &fntWriter);
WriteSoundFontEntry(audio, audio->soundFontTable[i].instruments[k].highNotesSound, audio->samples, &fntWriter);
}
for (size_t k = 0; k < audio->soundFontTable[i].soundEffects.size(); k++)
{
WriteSoundFontEntry(audio, audio->soundFontTable[i].soundEffects[k], audio->samples, &fntWriter);
}
//std::string fName = OTRExporter_DisplayList::GetPathToRes(res, StringHelper::Sprintf("fonts/font_%02X", i));
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, StringHelper::Sprintf("fonts/%s", audio->soundFontNames[i].c_str()));
AddFile(fName, fntStream->ToVector());
}
// Write Sequences
for (size_t i = 0; i < audio->sequences.size(); i++)
{
auto seq = audio->sequences[i];
MemoryStream* seqStream = new MemoryStream();
BinaryWriter seqWriter = BinaryWriter(seqStream);
WriteHeader(nullptr, "", &seqWriter, Ship::ResourceType::SOH_AudioSequence, Ship::Version::Rachael);
seqWriter.Write((uint32_t)seq.size());
seqWriter.Write(seq.data(), seq.size());
seqWriter.Write((uint8_t)i);
seqWriter.Write((uint8_t)audio->sequenceTable[i].medium);
seqWriter.Write((uint8_t)audio->sequenceTable[i].cachePolicy);
seqWriter.Write((uint32_t)audio->fontIndices[i].size());
for (size_t k = 0; k < audio->fontIndices[i].size(); k++)
seqWriter.Write((uint8_t)audio->fontIndices[i][k]);
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, StringHelper::Sprintf("sequences/%s", audio->seqNames[i].c_str()));
AddFile(fName, seqStream->ToVector());
}
}

View File

@ -1,16 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZAudio.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Audio : public OTRExporter
{
public:
void WriteSampleEntry(SampleEntry* entry, BinaryWriter* writer);
void WriteSampleEntryReference(ZAudio* audio, SampleEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer);
void WriteSoundFontEntry(ZAudio* audio, SoundFontEntry* entry, std::map<uint32_t, SampleEntry*> samples, BinaryWriter* writer);
void WriteEnvData(std::vector<AdsrEnvelope*> envelopes, BinaryWriter* writer);
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,14 +0,0 @@
#include "BackgroundExporter.h"
#include "../ZAPD/ZFile.h"
void OTRExporter_Background::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZBackground* bg = (ZBackground*)res;
WriteHeader(bg, outPath, writer, Ship::ResourceType::SOH_Background);
writer->Write((uint32_t)bg->GetRawDataSize());
auto data = bg->parent->GetRawData();
writer->Write((char*)data.data() + bg->GetRawDataIndex(), bg->GetRawDataSize());
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZBackground.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Background : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,21 +0,0 @@
#include "BlobExporter.h"
#include "../ZAPD/ZFile.h"
void OTRExporter_Blob::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZBlob* blob = (ZBlob*)res;
WriteHeader(blob, outPath, writer, Ship::ResourceType::Blob);
auto start = std::chrono::steady_clock::now();
writer->Write((uint32_t)blob->GetRawDataSize());
auto data = blob->parent->GetRawData();
for (size_t i = blob->GetRawDataIndex(); i < blob->GetRawDataIndex() + blob->GetRawDataSize(); i++)
writer->Write(data[i]);
auto end = std::chrono::steady_clock::now();
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZBlob.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Blob : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,245 +0,0 @@
set(PROJECT_NAME OTRExporter)
################################################################################
# Source groups
################################################################################
set(Header_Files
"AnimationExporter.h"
"ArrayExporter.h"
"AudioExporter.h"
"BackgroundExporter.h"
"BlobExporter.h"
"CollisionExporter.h"
"command_macros_base.h"
"CutsceneExporter.h"
"DisplayListExporter.h"
"Exporter.h"
"Main.h"
"MtxExporter.h"
"PathExporter.h"
"PlayerAnimationExporter.h"
"RoomExporter.h"
"SkeletonExporter.h"
"SkeletonLimbExporter.h"
"TextExporter.h"
"TextureExporter.h"
"VersionInfo.h"
"VtxExporter.h"
"z64cutscene.h"
"z64cutscene_commands.h"
)
source_group("Header Files" FILES ${Header_Files})
set(Source_Files
"AnimationExporter.cpp"
"ArrayExporter.cpp"
"AudioExporter.cpp"
"BackgroundExporter.cpp"
"BlobExporter.cpp"
"CollisionExporter.cpp"
"CutsceneExporter.cpp"
"DisplayListExporter.cpp"
"Exporter.cpp"
"Main.cpp"
"MtxExporter.cpp"
"PathExporter.cpp"
"PlayerAnimationExporter.cpp"
"RoomExporter.cpp"
"SkeletonExporter.cpp"
"SkeletonLimbExporter.cpp"
"TextExporter.cpp"
"TextureExporter.cpp"
"VersionInfo.cpp"
"VtxExporter.cpp"
)
source_group("Source Files" FILES ${Source_Files})
set(ALL_FILES
${Header_Files}
${Source_Files}
)
################################################################################
# Target
################################################################################
add_library(${PROJECT_NAME} STATIC ${ALL_FILES})
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
endif()
set(ROOT_NAMESPACE OTRExporter)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
set_target_properties(${PROJECT_NAME} PROPERTIES
VS_GLOBAL_KEYWORD "Win32Proj"
)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
set_target_properties(${PROJECT_NAME} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
)
endif()
endif()
################################################################################
# MSVC runtime library
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
$<$<CONFIG:Debug>:
MultiThreadedDebug
>
$<$<CONFIG:Release>:
MultiThreaded
>
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
)
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
endif()
################################################################################
# Compile definitions
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"_CONSOLE;"
"_CRT_SECURE_NO_WARNINGS;"
"UNICODE;"
"_UNICODE"
STORMLIB_NO_AUTO_LINK
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG;"
"_CRT_SECURE_NO_WARNINGS"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"WIN32;"
"_CONSOLE;"
"UNICODE;"
"_UNICODE"
STORMLIB_NO_AUTO_LINK
)
endif()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
">"
"_CONSOLE;"
"_CRT_SECURE_NO_WARNINGS;"
"UNICODE;"
"_UNICODE"
)
endif()
################################################################################
# Compile and link options
################################################################################
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/ZAPD/
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/include
# TODO: these should no longer be necessary if we were to link against LUS
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/Mercury
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/tinyxml2
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/StormLib/src
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/nlohmann-json/include
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
${CMAKE_CURRENT_SOURCE_DIR}/../../soh/soh
.
)
if(MSVC)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/Oi;
/Gy
>
/permissive-;
/sdl;
/W3;
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
${DEFAULT_CXX_EXCEPTION_HANDLING}
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/Oi;
/Gy
>
/permissive-;
/sdl;
/W3;
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
${DEFAULT_CXX_EXCEPTION_HANDLING}
)
endif()
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_link_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/OPT:REF;
/OPT:ICF
>
/SUBSYSTEM:CONSOLE
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
target_link_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
/DEBUG;
/OPT:REF;
/OPT:ICF;
/INCREMENTAL:NO
>
/SUBSYSTEM:CONSOLE
)
endif()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
target_compile_options(${PROJECT_NAME} PRIVATE
-Wall -Wextra -Wno-error
-Wno-unused-parameter
-Wno-unused-function
-Wno-unused-variable
-Wno-missing-field-initializers
-Wno-parentheses
-Wno-narrowing
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
)
endif()
################################################################################
# Dependencies
################################################################################
add_dependencies(${PROJECT_NAME}
libultraship
)
# Link with other targets.
target_link_libraries(${PROJECT_NAME} PUBLIC "${ADDITIONAL_LIBRARY_DEPENDENCIES}")

View File

@ -1,82 +0,0 @@
#include "CollisionExporter.h"
#include <libultraship/bridge.h>
void OTRExporter_Collision::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZCollisionHeader* col = (ZCollisionHeader*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_CollisionHeader);
writer->Write(col->absMinX);
writer->Write(col->absMinY);
writer->Write(col->absMinZ);
writer->Write(col->absMaxX);
writer->Write(col->absMaxY);
writer->Write(col->absMaxZ);
writer->Write((uint32_t)col->vertices.size());
for (uint16_t i = 0; i < col->vertices.size(); i++)
{
writer->Write(col->vertices[i].scalars[0].scalarData.s16);
writer->Write(col->vertices[i].scalars[1].scalarData.s16);
writer->Write(col->vertices[i].scalars[2].scalarData.s16);
}
writer->Write((uint32_t)col->polygons.size());
for (uint16_t i = 0; i < col->polygons.size(); i++)
{
writer->Write(col->polygons[i].type);
writer->Write(col->polygons[i].vtxA);
writer->Write(col->polygons[i].vtxB);
writer->Write(col->polygons[i].vtxC);
writer->Write(col->polygons[i].a);
writer->Write(col->polygons[i].b);
writer->Write(col->polygons[i].c);
writer->Write(col->polygons[i].d);
}
writer->Write((uint32_t)col->polygonTypes.size());
for (uint16_t i = 0; i < col->polygonTypes.size(); i++)
writer->Write(col->polygonTypes[i]);
writer->Write((uint32_t)col->camData->entries.size());
for (auto entry : col->camData->entries)
{
auto camPosDecl = col->parent->GetDeclarationRanged(Seg2Filespace(entry->cameraPosDataSeg, col->parent->baseAddress));
int idx = 0;
if (camPosDecl != nullptr)
idx = ((entry->cameraPosDataSeg & 0x00FFFFFF) - camPosDecl->address) / 6;
writer->Write(entry->cameraSType);
writer->Write(entry->numData);
writer->Write((uint32_t)idx);
}
writer->Write((uint32_t)col->camData->cameraPositionData.size());
for (auto entry : col->camData->cameraPositionData)
{
writer->Write(entry->x);
writer->Write(entry->y);
writer->Write(entry->z);
}
writer->Write((uint32_t)col->waterBoxes.size());
for (auto waterBox : col->waterBoxes)
{
writer->Write(waterBox.xMin);
writer->Write(waterBox.ySurface);
writer->Write(waterBox.zMin);
writer->Write(waterBox.xLength);
writer->Write(waterBox.zLength);
writer->Write(waterBox.properties);
}
}

View File

@ -1,11 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZCollision.h"
#include "Exporter.h"
class OTRExporter_Collision : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,431 +0,0 @@
#include "CutsceneExporter.h"
#include <libultraship/bridge.h>
void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZCutscene* cs = (ZCutscene*)res;
WriteHeader(cs, outPath, writer, Ship::ResourceType::SOH_Cutscene);
//writer->Write((uint32_t)cs->commands.size() + 2 + 2);
writer->Write((uint32_t)0);
int currentStream = writer->GetBaseAddress();
writer->Write(CS_BEGIN_CUTSCENE(cs->numCommands, cs->endFrame));
for (size_t i = 0; i < cs->commands.size(); i++)
{
switch (cs->commands[i]->commandID)
{
case (uint32_t)CutsceneCommands::SetCameraPos:
{
CutsceneCommandSetCameraPos* cmdCamPos = (CutsceneCommandSetCameraPos*)cs->commands[i];
writer->Write(CS_CMD_CAM_EYE);
writer->Write(CMD_HH(0x0001, ((CutsceneCommandSetCameraPos*)cs->commands[i])->startFrame));
writer->Write(CMD_HH(cmdCamPos->endFrame, 0x0000));
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
}
break;
case (uint32_t)CutsceneCommands::SetCameraFocus:
{
CutsceneCommandSetCameraPos* cmdCamPos = (CutsceneCommandSetCameraPos*)cs->commands[i];
writer->Write(CS_CMD_CAM_AT);
writer->Write(CMD_HH(0x0001, cmdCamPos->startFrame));
writer->Write(CMD_HH(cmdCamPos->endFrame, 0x0000));
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
break;
}
case (uint32_t)CutsceneCommands::SpecialAction:
{
writer->Write(CS_CMD_MISC);
writer->Write((uint32_t)CMD_W(((CutsceneCommandSpecialAction*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandSpecialAction*)cs->commands[i])->entries) //All in OOT seem to only have 1 entry
{
writer->Write(CMD_HH(e->base, e->startFrame));
writer->Write(CMD_HH(e->endFrame, e->unused0));
writer->Write(CMD_W(e->unused1));
writer->Write(CMD_W(e->unused2));
writer->Write(CMD_W(e->unused3));
writer->Write(CMD_W(e->unused4));
writer->Write(CMD_W(e->unused5));
writer->Write(CMD_W(e->unused6));
writer->Write(CMD_W(e->unused7));
writer->Write(CMD_W(e->unused8));
writer->Write(CMD_W(e->unused9));
writer->Write(CMD_W(e->unused10));
}
break;
}
case (uint32_t)CutsceneCommands::SetLighting:
{
writer->Write(CS_CMD_SET_LIGHTING);
writer->Write((uint32_t)CMD_W(((CutsceneCommandEnvLighting*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandEnvLighting*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(e->setting, e->startFrame));
writer->Write(CMD_HH(e->endFrame, e->unused0));
writer->Write(CMD_W(e->unused1));
writer->Write(CMD_W(e->unused2));
writer->Write(CMD_W(e->unused3));
writer->Write(CMD_W(e->unused4));
writer->Write(CMD_W(e->unused5));
writer->Write(CMD_W(e->unused6));
writer->Write(CMD_W(e->unused7));
writer->Write((uint32_t)0x0);
writer->Write((uint32_t)0x0);
writer->Write((uint32_t)0x0);
}
break;
}
case (uint32_t)CutsceneCommands::SetCameraPosLink:
{
CutsceneCommandSetCameraPos* cmdCamPos = (CutsceneCommandSetCameraPos*)cs->commands[i];
writer->Write(CS_CMD_CAM_EYE_REL_TO_PLAYER);
writer->Write(CMD_HH(0x0001, ((CutsceneCommandSetCameraPos*)cs->commands[i])->startFrame));
writer->Write(CMD_HH(cmdCamPos->endFrame, 0x0000));
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
break;
}
case (uint32_t)CutsceneCommands::SetCameraFocusLink:
{
CutsceneCommandSetCameraPos* cmdCamPos = (CutsceneCommandSetCameraPos*)cs->commands[i];
writer->Write(CS_CMD_CAM_AT_REL_TO_PLAYER);
writer->Write(CMD_HH(0x0001, ((CutsceneCommandSetCameraPos*)cs->commands[i])->startFrame));
writer->Write(CMD_HH(cmdCamPos->endFrame, 0x0000));
for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries)
{
writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame));
writer->Write(e->viewAngle);
writer->Write(CMD_HH(e->posX, e->posY));
writer->Write(CMD_HH(e->posZ, e->unused));
}
break;
}
case (uint32_t)CutsceneCommands::Cmd07: // Not used in OOT
break;
case (uint32_t)CutsceneCommands::Cmd08: // Not used in OOT
break;
case (uint32_t)CutsceneCommands::Cmd09:
{
writer->Write(CS_CMD_09);
writer->Write((uint32_t)CMD_W(((CutsceneCommandUnknown9*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandUnknown9*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(e->base, e->startFrame));
writer->Write(CMD_HBB(e->endFrame, e->unk2, e->unk3));
writer->Write(CMD_BBH(e->unk4, e->unused0, e->unused1));
}
break;
}
case 0x15:
case (uint32_t)CutsceneCommands::Unknown:
{
CutsceneCommandUnknown* cmdUnk = (CutsceneCommandUnknown*)cs->commands[i];
writer->Write((uint32_t)cs->commands[i]->commandID);
writer->Write((uint32_t)cmdUnk->entries.size());
for (auto e : cmdUnk->entries)
{
writer->Write(CMD_W(e->unused0));
writer->Write(CMD_W(e->unused1));
writer->Write(CMD_W(e->unused2));
writer->Write(CMD_W(e->unused3));
writer->Write(CMD_W(e->unused4));
writer->Write(CMD_W(e->unused5));
writer->Write(CMD_W(e->unused6));
writer->Write(CMD_W(e->unused7));
writer->Write(CMD_W(e->unused8));
writer->Write(CMD_W(e->unused9));
writer->Write(CMD_W(e->unused10));
writer->Write(CMD_W(e->unused11));
}
}
break;
case (uint32_t)CutsceneCommands::Textbox:
{
writer->Write(CS_CMD_TEXTBOX);
writer->Write((uint32_t)CMD_W(((CutsceneCommandTextbox*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandTextbox*)cs->commands[i])->entries)
{
if (e->base == 0xFFFF) // CS_TEXT_NONE
{
writer->Write(CMD_HH(0xFFFF, e->startFrame));
writer->Write(CMD_HH(e->endFrame, 0xFFFF));
writer->Write(CMD_HH(0xFFFF, 0xFFFF));
}
else // CS_TEXT_DISPLAY_TEXTBOX
{
writer->Write(CMD_HH(e->base, e->startFrame));
writer->Write(CMD_HH(e->endFrame, e->type));
writer->Write(CMD_HH(e->textID1, e->textID2));
}
}
break;
}
case (uint32_t)CutsceneCommands::SetActorAction0:
case (uint32_t)CutsceneCommands::SetActorAction1:
case 17:
case 18:
case 23:
case 34:
case 39:
case 46:
case 76:
case 85:
case 93:
case 105:
case 107:
case 110:
case 119:
case 123:
case 138:
case 139:
case 144:
case (uint32_t)CutsceneCommands::SetActorAction2:
case 16:
case 24:
case 35:
case 40:
case 48:
case 64:
case 68:
case 70:
case 78:
case 80:
case 94:
case 116:
case 118:
case 120:
case 125:
case 131:
case 141:
case (uint32_t)CutsceneCommands::SetActorAction3:
case 36:
case 41:
case 50:
case 67:
case 69:
case 72:
case 74:
case 81:
case 106:
case 117:
case 121:
case 126:
case 132:
case (uint32_t)CutsceneCommands::SetActorAction4:
case 37:
case 42:
case 51:
case 53:
case 63:
case 65:
case 66:
case 75:
case 82:
case 108:
case 127:
case 133:
case (uint32_t)CutsceneCommands::SetActorAction5:
case 38:
case 43:
case 47:
case 54:
case 79:
case 83:
case 128:
case 135:
case (uint32_t)CutsceneCommands::SetActorAction6:
case 55:
case 77:
case 84:
case 90:
case 129:
case 136:
case (uint32_t)CutsceneCommands::SetActorAction7:
case 52:
case 57:
case 58:
case 88:
case 115:
case 130:
case 137:
case (uint32_t)CutsceneCommands::SetActorAction8:
case 60:
case 89:
case 111:
case 114:
case 134:
case 142:
case (uint32_t)CutsceneCommands::SetActorAction9:
case (uint32_t)CutsceneCommands::SetActorAction10:
{
writer->Write((uint32_t)(CutsceneCommands)cs->commands[i]->commandID);
writer->Write((uint32_t)CMD_W(((CutsceneCommandActorAction*)cs->commands[i])->entries.size()));
for (auto& actorAct : ((CutsceneCommandActorAction*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(actorAct->action, actorAct->startFrame));
writer->Write(CMD_HH(actorAct->endFrame, actorAct->rotX));
writer->Write(CMD_HH(actorAct->rotY, actorAct->rotZ));
writer->Write(CMD_W(actorAct->startPosX));
writer->Write(CMD_W(actorAct->startPosY));
writer->Write(CMD_W(actorAct->startPosZ));
writer->Write(CMD_W(actorAct->endPosX));
writer->Write(CMD_W(actorAct->endPosY));
writer->Write(CMD_W(actorAct->endPosZ));
writer->Write(CMD_W(actorAct->normalX));
writer->Write(CMD_W(actorAct->normalY));
writer->Write(CMD_W(actorAct->normalZ));
}
break;
}
case (uint32_t)CutsceneCommands::SetSceneTransFX:
{
CutsceneCommandSceneTransFX* cmdTFX = (CutsceneCommandSceneTransFX*)cs->commands[i];
writer->Write(CS_CMD_SCENE_TRANS_FX);
writer->Write((uint32_t)1);
writer->Write(CMD_HH((((CutsceneCommandSceneTransFX*)cs->commands[i])->base), ((CutsceneCommandSceneTransFX*)cs->commands[i])->startFrame));
writer->Write(CMD_HH((((CutsceneCommandSceneTransFX*)cs->commands[i])->endFrame), ((CutsceneCommandSceneTransFX*)cs->commands[i])->endFrame));
break;
}
case (uint32_t)CutsceneCommands::Nop: //Not used in OOT
break;
case (uint32_t)CutsceneCommands::PlayBGM:
{
writer->Write(CS_CMD_PLAYBGM);
writer->Write((uint32_t)CMD_W(((CutsceneCommandPlayBGM*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandPlayBGM*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(e->sequence, e->startFrame));
writer->Write(CMD_HH(e->endFrame, e->unknown0));
writer->Write(CMD_W(e->unknown1));
writer->Write(CMD_W(e->unknown2));
writer->Write(CMD_W(e->unknown3));
writer->Write(CMD_W(e->unknown4));
writer->Write(CMD_W(e->unknown5));
writer->Write(CMD_W(e->unknown6));
writer->Write(CMD_W(e->unknown7));
writer->Write((uint32_t)0);
writer->Write((uint32_t)0);
writer->Write((uint32_t)0);
}
break;
}
case (uint32_t)CutsceneCommands::StopBGM:
{
writer->Write(CS_CMD_STOPBGM);
writer->Write((uint32_t)CMD_W(((CutsceneCommandStopBGM*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandStopBGM*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(e->sequence, e->startFrame));
writer->Write(CMD_HH(e->endFrame, e->unknown0));
writer->Write(CMD_W(e->unknown1));
writer->Write(CMD_W(e->unknown2));
writer->Write(CMD_W(e->unknown3));
writer->Write(CMD_W(e->unknown4));
writer->Write(CMD_W(e->unknown5));
writer->Write(CMD_W(e->unknown6));
writer->Write(CMD_W(e->unknown7));
writer->Write((uint32_t)0);
writer->Write((uint32_t)0);
writer->Write((uint32_t)0);
}
break;
}
case (uint32_t)CutsceneCommands::FadeBGM:
{
writer->Write(CS_CMD_FADEBGM);
writer->Write((uint32_t)CMD_W(((CutsceneCommandFadeBGM*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandFadeBGM*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(e->base, e->startFrame));
writer->Write(CMD_HH(e->endFrame, e->unknown0));
writer->Write(CMD_W(e->unknown1));
writer->Write(CMD_W(e->unknown2));
writer->Write(CMD_W(e->unknown3));
writer->Write(CMD_W(e->unknown4));
writer->Write(CMD_W(e->unknown5));
writer->Write(CMD_W(e->unknown6));
writer->Write(CMD_W(e->unknown7));
writer->Write((uint32_t)0);
writer->Write((uint32_t)0);
writer->Write((uint32_t)0);
}
break;
}
case (uint32_t)CutsceneCommands::SetTime:
{
writer->Write(CS_CMD_SETTIME);
writer->Write((uint32_t)CMD_W(((CutsceneCommandDayTime*)cs->commands[i])->entries.size()));
for (auto& e : ((CutsceneCommandDayTime*)cs->commands[i])->entries)
{
writer->Write(CMD_HH(e->base, e->startFrame));
writer->Write(CMD_HBB(e->endFrame, e->hour, e->minute));
writer->Write((uint32_t)CMD_W(e->unused));
}
break;
}
case (uint32_t)CutsceneCommands::Terminator:
{
writer->Write(CS_CMD_TERMINATOR);
writer->Write((uint32_t)1);
writer->Write(CMD_HH(((CutsceneCommandTerminator*)cs->commands[i])->base, ((CutsceneCommandTerminator*)cs->commands[i])->startFrame));
writer->Write(CMD_HH(((CutsceneCommandTerminator*)cs->commands[i])->endFrame, ((CutsceneCommandTerminator*)cs->commands[i])->endFrame));
break;
}
default:
{
//writer->Write((uint32_t)cs->commands[i]->commandID);
printf("Undefined CS Opcode: %04X\n", cs->commands[i]->commandID);
}
break;
}
}
//CS_END
writer->Write(0xFFFFFFFF);
writer->Write((uint32_t)0);
int endStream = writer->GetBaseAddress();
writer->Seek(currentStream - 4, SeekOffsetType::Start);
writer->Write((uint32_t)((endStream - currentStream) / 4));
writer->Seek(endStream, SeekOffsetType::Start);
}

View File

@ -1,11 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZCutscene.h"
#include "z64cutscene_commands.h"
#include "Exporter.h"
class OTRExporter_Cutscene : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,907 +0,0 @@
#include "DisplayListExporter.h"
#include "Main.h"
#include "../ZAPD/ZFile.h"
#include <Utils/MemoryStream.h>
#include <Utils/BitConverter.h>
#include "StrHash64/StrHash64.h"
#include "spdlog/spdlog.h"
#include <libultraship/libultra/gbi.h>
#include <Globals.h>
#include <iostream>
#include <string>
#include "MtxExporter.h"
#include <Utils/File.h>
#include "VersionInfo.h"
#define GFX_SIZE 8
#define gsDPSetCombineLERP_NoMacros(a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \
a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \
{ \
_SHIFTL(G_SETCOMBINE, 24, 8) | \
_SHIFTL(GCCc0w0(a0, c0, \
Aa0, Ac0) | \
GCCc1w0(a1, c1), 0, 24), \
(unsigned int)(GCCc0w1(b0, d0, \
Ab0, Ad0) | \
GCCc1w1(b1, Aa1, \
Ac1, d1, \
Ab1, Ad1)) \
}
#define gsSPBranchLessZraw2(dl, vtx, zval) \
{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\
(unsigned int)(zval), }
#define gsSPBranchLessZraw3(dl) \
{ _SHIFTL(G_RDPHALF_1,24,8), \
(unsigned int)(dl), }
#define gsDPWordLo(wordlo) \
gsImmp1(G_RDPHALF_2, (unsigned int)(wordlo))
#define gsSPTextureRectangle2(xl, yl, xh, yh, tile) \
{ (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\
(_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)) }
void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZDisplayList* dList = (ZDisplayList*)res;
//printf("Exporting DList %s\n", dList->GetName().c_str());
WriteHeader(res, outPath, writer, Ship::ResourceType::DisplayList);
while (writer->GetBaseAddress() % 8 != 0)
writer->Write((uint8_t)0xFF);
// DEBUG: Write in a marker
Declaration* dbgDecl = dList->parent->GetDeclaration(dList->GetRawDataIndex());
std::string dbgName = StringHelper::Sprintf("%s/%s", GetParentFolderName(res).c_str(), dbgDecl->varName.c_str());
uint64_t hash = CRC64(dbgName.c_str());
writer->Write((uint32_t)(G_MARKER << 24));
writer->Write((uint32_t)0xBEEFBEEF);
writer->Write((uint32_t)(hash >> 32));
writer->Write((uint32_t)(hash & 0xFFFFFFFF));
auto dlStart = std::chrono::steady_clock::now();
//for (auto data : dList->instructions)
for (size_t dataIdx = 0; dataIdx < dList->instructions.size(); dataIdx++)
{
auto data = dList->instructions[dataIdx];
uint32_t word0 = 0;
uint32_t word1 = 0;
uint8_t opcode = (uint8_t)(data >> 56);
F3DZEXOpcode opF3D = (F3DZEXOpcode)opcode;
if ((int)opF3D == G_DL)// || (int)opF3D == G_BRANCH_Z)
opcode = (uint8_t)G_DL_OTR_HASH;
if ((int)opF3D == G_MTX)
opcode = (uint8_t)G_MTX_OTR;
if ((int)opF3D == G_BRANCH_Z)
opcode = (uint8_t)G_BRANCH_Z_OTR;
if ((int)opF3D == G_VTX)
opcode = (uint8_t)G_VTX_OTR_HASH;
if ((int)opF3D == G_SETTIMG)
opcode = (uint8_t)G_SETTIMG_OTR_HASH;
word0 += (opcode << 24);
switch ((int)opF3D)
{
case G_NOOP:
{
Gfx value = {gsDPNoOp()};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_ENDDL:
{
Gfx value = {gsSPEndDisplayList()};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_MODIFYVTX:
{
int32_t ww = (data & 0x00FF000000000000ULL) >> 48;
int32_t nnnn = (data & 0x0000FFFF00000000ULL) >> 32;
int32_t vvvvvvvv = (data & 0x00000000FFFFFFFFULL);
Gfx value = {gsSPModifyVertex(nnnn / 2, ww, vvvvvvvv)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
default:
{
printf("Undefined opcode: %02X\n", opcode);
//word0 = _byteswap_ulong((uint32_t)(data >> 32));
//word1 = _byteswap_ulong((uint32_t)(data & 0xFFFFFFFF));
}
break;
case G_GEOMETRYMODE:
{
int32_t cccccc = (data & 0x00FFFFFF00000000) >> 32;
int32_t ssssssss = (data & 0xFFFFFFFF);
Gfx value = {gsSPGeometryMode(~cccccc, ssssssss)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_RDPPIPESYNC:
{
Gfx value = {gsDPPipeSync()};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_RDPLOADSYNC:
{
Gfx value = {gsDPLoadSync()};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_RDPTILESYNC:
{
Gfx value = {gsDPTileSync()};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_RDPFULLSYNC:
{
Gfx value = {gsDPFullSync()};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_RDPSETOTHERMODE:
{
int32_t hhhhhh = (data & 0x00FFFFFF00000000) >> 32;
int32_t llllllll = (data & 0x00000000FFFFFFFF);
Gfx value = {gsDPSetOtherMode(hhhhhh, llllllll)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_POPMTX:
{
Gfx value = {gsSPPopMatrix(data)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETENVCOLOR:
{
uint8_t r = (uint8_t)((data & 0xFF000000) >> 24);
uint8_t g = (uint8_t)((data & 0x00FF0000) >> 16);
uint8_t b = (uint8_t)((data & 0xFF00FF00) >> 8);
uint8_t a = (uint8_t)((data & 0x000000FF) >> 0);
Gfx value = {gsDPSetEnvColor(r, g, b, a)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_MTX:
{
if ((!Globals::Instance->HasSegment(GETSEGNUM(data), res->parent->workerID)) || ((data & 0xFFFFFFFF) == 0x07000000)) // En_Zf and En_Ny place a DL in segment 7
{
uint32_t pp = (data & 0x000000FF00000000) >> 32;
uint32_t mm = (data & 0x00000000FFFFFFFF);
pp ^= G_MTX_PUSH;
mm = (mm & 0x0FFFFFFF) + 1;
Gfx value = {gsSPMatrix(mm, pp)};
word0 = value.words.w0;
word1 = value.words.w1;
}
else
{
uint32_t pp = (data & 0x000000FF00000000) >> 32;
uint32_t mm = (data & 0x00000000FFFFFFFF);
pp ^= G_MTX_PUSH;
Gfx value = {gsSPMatrix(mm, pp)};
word0 = value.words.w0;
word1 = value.words.w1;
word0 = (word0 & 0x00FFFFFF) + (G_MTX_OTR << 24);
Declaration* mtxDecl = dList->parent->GetDeclaration(GETSEGOFFSET(mm));
int bp = 0;
writer->Write(word0);
writer->Write(word1);
if (mtxDecl != nullptr)
{
std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), mtxDecl->varName.c_str());
uint64_t hash = CRC64(vName.c_str());
word0 = hash >> 32;
word1 = hash & 0xFFFFFFFF;
}
else
{
word0 = 0;
word1 = 0;
spdlog::error(StringHelper::Sprintf("dListDecl == nullptr! Addr = {:08X}", GETSEGOFFSET(data)));
}
}
}
break;
case G_LOADBLOCK:
{
int32_t sss = (data & 0x00FFF00000000000) >> 48;
int32_t ttt = (data & 0x00000FFF00000000) >> 36;
int32_t i = (data & 0x000000000F000000) >> 24;
int32_t xxx = (data & 0x0000000000FFF000) >> 12;
int32_t ddd = (data & 0x0000000000000FFF);
Gfx value = {gsDPLoadBlock(i, sss, ttt, xxx, ddd)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_CULLDL:
{
int32_t vvvv = (data & 0xFFFF00000000) >> 32;
int32_t wwww = (data & 0x0000FFFF);
Gfx value = {gsSPCullDisplayList(vvvv / 2, wwww / 2)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_RDPHALF_1:
{
auto data2 = dList->instructions[dataIdx + 1];
if ((data2 >> 56) != G_BRANCH_Z)
{
uint32_t a = (data & 0x00FFF00000000000) >> 44;
uint32_t b = (data & 0x00000FFF00000000) >> 32;
uint32_t z = (data & 0x00000000FFFFFFFF) >> 0;
uint32_t h = (data & 0xFFFFFFFF);
Gfx value = {gsSPBranchLessZraw3(h & 0x00FFFFFF)};
word0 = value.words.w0;
word1 = value.words.w1;
}
else
{
word0 = (G_NOOP << 24);
word1 = 0;
}
}
break;
case G_RDPHALF_2:
{
Gfx value = {gsDPWordLo(data & 0xFFFFFFFF)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_TEXRECT:
{
int32_t xxx = (data & 0x00FFF00000000000) >> 44;
int32_t yyy = (data & 0x00000FFF00000000) >> 32;
int32_t i = (data & 0x000000000F000000) >> 24;
int32_t XXX = (data & 0x0000000000FFF000) >> 12;
int32_t YYY = (data & 0x0000000000000FFF);
Gfx value = {gsSPTextureRectangle2(XXX, YYY, xxx, yyy, i)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_BRANCH_Z:
{
uint32_t a = (data & 0x00FFF00000000000) >> 44;
uint32_t b = (data & 0x00000FFF00000000) >> 32;
uint32_t z = (data & 0x00000000FFFFFFFF) >> 0;
uint32_t h = (data & 0xFFFFFFFF);
auto data2 = dList->instructions[dataIdx - 1];
uint32_t dListPtr = GETSEGOFFSET(data2);
Declaration* dListDecl = dList->parent->GetDeclaration(dListPtr);
int bp = 0;
Gfx value = {gsSPBranchLessZraw2(0xDEADABCD, (a / 5) | (b / 2), z)};
word0 = (value.words.w0 & 0x00FFFFFF) + (G_BRANCH_Z_OTR << 24);
word1 = value.words.w1;
writer->Write(word0);
writer->Write(word1);
if (dListDecl != nullptr)
{
std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str());
uint64_t hash = CRC64(vName.c_str());
word0 = hash >> 32;
word1 = hash & 0xFFFFFFFF;
}
else
{
word0 = 0;
word1 = 0;
spdlog::error(StringHelper::Sprintf("dListDecl == nullptr! Addr = {:08X}", GETSEGOFFSET(data)));
}
for (size_t i = 0; i < dList->otherDLists.size(); i++)
{
Declaration* dListDecl2 = dList->parent->GetDeclaration(GETSEGOFFSET(dList->otherDLists[i]->GetRawDataIndex()));
if (dListDecl2 != nullptr)
{
//std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str());
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str());
if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName))
{
MemoryStream* dlStream = new MemoryStream();
BinaryWriter dlWriter = BinaryWriter(dlStream);
Save(dList->otherDLists[i], outPath, &dlWriter);
AddFile(fName, dlStream->ToVector());
}
}
else
{
spdlog::error(StringHelper::Sprintf("dListDecl2 == nullptr! Addr = {:08X}", GETSEGOFFSET(data)));
}
}
//Gfx value = gsSPBranchLessZraw2(h & 0x00FFFFFF, (a / 5) | (b / 2), z);
//word0 = value.words.w0;
//word1 = value.words.w1;
}
break;
//case G_BRANCH_Z:
case G_DL:
{
if ((!Globals::Instance->HasSegment(GETSEGNUM(data), res->parent->workerID) && (int)opF3D != G_BRANCH_Z)
|| ((data & 0xFFFFFFFF) == 0x07000000)) // En_Zf and En_Ny place a DL in segment 7
{
int32_t pp = (data & 0x00FF000000000000) >> 56;
Gfx value;
u32 dListVal = (data & 0x0FFFFFFF) + 1;
if (pp != 0)
value = {gsSPBranchList(dListVal)};
else
value = {gsSPDisplayList(dListVal)};
word0 = value.words.w0;
word1 = value.words.w1;
}
else
{
uint32_t dListPtr = GETSEGOFFSET(data);
if ((int)opF3D == G_BRANCH_Z)
{
auto data2 = dList->instructions[dataIdx - 1];
dListPtr = GETSEGOFFSET(data2);
}
else
{
int bp = 0;
}
Declaration* dListDecl = dList->parent->GetDeclaration(dListPtr);
int bp = 0;
writer->Write(word0);
writer->Write(word1);
if (dListDecl != nullptr)
{
std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str());
uint64_t hash = CRC64(vName.c_str());
word0 = hash >> 32;
word1 = hash & 0xFFFFFFFF;
}
else
{
word0 = 0;
word1 = 0;
spdlog::error(StringHelper::Sprintf("dListDecl == nullptr! Addr = {:08X}", GETSEGOFFSET(data)));
}
for (size_t i = 0; i < dList->otherDLists.size(); i++)
{
Declaration* dListDecl2 = dList->parent->GetDeclaration(GETSEGOFFSET(dList->otherDLists[i]->GetRawDataIndex()));
if (dListDecl2 != nullptr)
{
//std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str());
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str());
if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName))
{
MemoryStream* dlStream = new MemoryStream();
BinaryWriter dlWriter = BinaryWriter(dlStream);
Save(dList->otherDLists[i], outPath, &dlWriter);
AddFile(fName, dlStream->ToVector());
}
}
else
{
spdlog::error(StringHelper::Sprintf("dListDecl2 == nullptr! Addr = {:08X}", GETSEGOFFSET(data)));
}
}
}
}
break;
case G_TEXTURE:
{
int32_t ____ = (data & 0x0000FFFF00000000) >> 32;
int32_t ssss = (data & 0x00000000FFFF0000) >> 16;
int32_t tttt = (data & 0x000000000000FFFF);
int32_t lll = (____ & 0x3800) >> 11;
int32_t ddd = (____ & 0x700) >> 8;
int32_t nnnnnnn = (____ & 0xFE) >> 1;
Gfx value = {gsSPTexture(ssss, tttt, lll, ddd, nnnnnnn)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_TRI1:
{
int32_t aa = ((data & 0x00FF000000000000ULL) >> 48) / 2;
int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2;
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
Gfx test = {gsSP1Triangle(aa, bb, cc, 0)};
word0 = test.words.w0;
word1 = test.words.w1;
}
break;
case G_TRI2:
{
int32_t aa = ((data & 0x00FF000000000000ULL) >> 48) / 2;
int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2;
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
int32_t dd = ((data & 0x00000000FF0000ULL) >> 16) / 2;
int32_t ee = ((data & 0x0000000000FF00ULL) >> 8) / 2;
int32_t ff = ((data & 0x000000000000FFULL) >> 0) / 2;
Gfx test = {gsSP2Triangles(aa, bb, cc, 0, dd, ee, ff, 0)};
word0 = test.words.w0;
word1 = test.words.w1;
}
break;
case G_QUAD:
{
int32_t aa = ((data & 0x00FF000000000000ULL) >> 48) / 2;
int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2;
int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2;
int32_t dd = ((data & 0x000000000000FFULL)) / 2;
Gfx test = {gsSP1Quadrangle(aa, bb, cc, dd, 0)};
word0 = test.words.w0;
word1 = test.words.w1;
}
break;
case G_SETPRIMCOLOR:
{
int32_t mm = (data & 0x0000FF0000000000) >> 40;
int32_t ff = (data & 0x000000FF00000000) >> 32;
int32_t rr = (data & 0x00000000FF000000) >> 24;
int32_t gg = (data & 0x0000000000FF0000) >> 16;
int32_t bb = (data & 0x000000000000FF00) >> 8;
int32_t aa = (data & 0x00000000000000FF) >> 0;
Gfx value = {gsDPSetPrimColor(mm, ff, rr, gg, bb, aa)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETOTHERMODE_L:
{
int32_t ss = (data & 0x0000FF0000000000) >> 40;
int32_t len = ((data & 0x000000FF00000000) >> 32) + 1;
int32_t sft = 32 - (len)-ss;
int32_t dd = (data & 0xFFFFFFFF);
// TODO: Output the correct render modes in data
Gfx value = {gsSPSetOtherMode(0xE2, sft, len, dd)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETOTHERMODE_H:
{
int32_t ss = (data & 0x0000FF0000000000) >> 40;
int32_t nn = (data & 0x000000FF00000000) >> 32;
int32_t dd = (data & 0xFFFFFFFF);
int32_t sft = 32 - (nn + 1) - ss;
Gfx value;
if (sft == 14) // G_MDSFT_TEXTLUT
{
const char* types[] = { "G_TT_NONE", "G_TT_NONE", "G_TT_RGBA16", "G_TT_IA16" };
value = {gsDPSetTextureLUT(dd >> 14)};
}
else
{
value = {gsSPSetOtherMode(0xE3, sft, nn + 1, dd)};
}
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETTILE:
{
int32_t fff = (data & 0b0000000011100000000000000000000000000000000000000000000000000000) >> 53;
int32_t ii = (data & 0b0000000000011000000000000000000000000000000000000000000000000000) >> 51;
int32_t nnnnnnnnn =
(data & 0b0000000000000011111111100000000000000000000000000000000000000000) >> 41;
int32_t mmmmmmmmm =
(data & 0b0000000000000000000000011111111100000000000000000000000000000000) >> 32;
int32_t ttt = (data & 0b0000000000000000000000000000000000000111000000000000000000000000) >> 24;
int32_t pppp =
(data & 0b0000000000000000000000000000000000000000111100000000000000000000) >> 20;
int32_t cc = (data & 0b0000000000000000000000000000000000000000000011000000000000000000) >> 18;
int32_t aaaa =
(data & 0b0000000000000000000000000000000000000000000000111100000000000000) >> 14;
int32_t ssss =
(data & 0b0000000000000000000000000000000000000000000000000011110000000000) >> 10;
int32_t dd = (data & 0b0000000000000000000000000000000000000000000000000000001100000000) >> 8;
int32_t bbbb = (data & 0b0000000000000000000000000000000000000000000000000000000011110000) >> 4;
int32_t uuuu = (data & 0b0000000000000000000000000000000000000000000000000000000000001111);
Gfx value = {gsDPSetTile(fff, ii, nnnnnnnnn, mmmmmmmmm, ttt, pppp, cc, aaaa, ssss, dd, bbbb, uuuu)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETCOMBINE:
{
int32_t a0 = (data & 0b000000011110000000000000000000000000000000000000000000000000000) >> 52;
int32_t c0 = (data & 0b000000000001111100000000000000000000000000000000000000000000000) >> 47;
int32_t aa0 = (data & 0b00000000000000011100000000000000000000000000000000000000000000) >> 44;
int32_t ac0 = (data & 0b00000000000000000011100000000000000000000000000000000000000000) >> 41;
int32_t a1 = (data & 0b000000000000000000000011110000000000000000000000000000000000000) >> 37;
int32_t c1 = (data & 0b000000000000000000000000001111100000000000000000000000000000000) >> 32;
int32_t b0 = (data & 0b000000000000000000000000000000011110000000000000000000000000000) >> 28;
int32_t b1 = (data & 0b000000000000000000000000000000000001111000000000000000000000000) >> 24;
int32_t aa1 = (data & 0b00000000000000000000000000000000000000111000000000000000000000) >> 21;
int32_t ac1 = (data & 0b00000000000000000000000000000000000000000111000000000000000000) >> 18;
int32_t d0 = (data & 0b000000000000000000000000000000000000000000000111000000000000000) >> 15;
int32_t ab0 = (data & 0b00000000000000000000000000000000000000000000000111000000000000) >> 12;
int32_t ad0 = (data & 0b00000000000000000000000000000000000000000000000000111000000000) >> 9;
int32_t d1 = (data & 0b000000000000000000000000000000000000000000000000000000111000000) >> 6;
int32_t ab1 = (data & 0b00000000000000000000000000000000000000000000000000000000111000) >> 3;
int32_t ad1 = (data & 0b00000000000000000000000000000000000000000000000000000000000111) >> 0;
Gfx value = { gsDPSetCombineLERP_NoMacros(a0, b0, c0, d0, aa0, ab0, ac0, ad0, a1, b1, c1, d1, aa1, ab1, ac1, ad1)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETTILESIZE:
{
int32_t sss = (data & 0x00FFF00000000000) >> 44;
int32_t ttt = (data & 0x00000FFF00000000) >> 32;
int32_t uuu = (data & 0x0000000000FFF000) >> 12;
int32_t vvv = (data & 0x0000000000000FFF);
int32_t i = (data & 0x000000000F000000) >> 24;
Gfx value = {gsDPSetTileSize(i, sss, ttt, uuu, vvv)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_LOADTLUT:
{
int32_t t = (data & 0x0000000007000000) >> 24;
int32_t ccc = (data & 0x00000000003FF000) >> 14;
Gfx value = {gsDPLoadTLUTCmd(t, ccc)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_LOADTILE:
{
int sss = (data & 0x00FFF00000000000) >> 44;
int ttt = (data & 0x00000FFF00000000) >> 32;
int i = (data & 0x000000000F000000) >> 24;
int uuu = (data & 0x0000000000FFF000) >> 12;
int vvv= (data & 0x0000000000000FFF);
Gfx value = {gsDPLoadTile(i, sss, ttt, uuu, vvv)};
word0 = value.words.w0;
word1 = value.words.w1;
}
break;
case G_SETTIMG:
{
uint32_t seg = data & 0xFFFFFFFF;
int32_t texAddress = Seg2Filespace(data, dList->parent->baseAddress);
if (!Globals::Instance->HasSegment(GETSEGNUM(seg), res->parent->workerID) || (res->GetName() == "sShadowMaterialDL"))
{
if (res->GetName() == "sShadowMaterialDL") {
// sShadowMaterialDL (In ovl_En_Jsjutan) has a texture in bss. This is a hack to override the reference to one
// to segment C. The actor has been modified to load the texture into segment C.
seg = 0x0C000000;
}
int32_t __ = (data & 0x00FF000000000000) >> 48;
int32_t www = (data & 0x00000FFF00000000) >> 32;
uint32_t fmt = (__ & 0xE0) >> 5;
uint32_t siz = (__ & 0x18) >> 3;
Gfx value = {gsDPSetTextureImage(fmt, siz, www + 1, (seg & 0x0FFFFFFF) + 1)};
word0 = value.words.w0;
word1 = value.words.w1;
writer->Write(word0);
writer->Write(word1);
}
else
{
std::string texName = "";
bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, dList->parent, "", texName, res->parent->workerID);
int32_t __ = (data & 0x00FF000000000000) >> 48;
int32_t www = (data & 0x00000FFF00000000) >> 32;
uint32_t fmt = (__ & 0xE0) >> 5;
uint32_t siz = (__ & 0x18) >> 3;
Gfx value = {gsDPSetTextureImage(fmt, siz, www + 1, __)};
word0 = value.words.w0 & 0x00FFFFFF;
word0 += (G_SETTIMG_OTR_HASH << 24);
//word1 = value.words.w1;
word1 = 0;
writer->Write(word0);
writer->Write(word1);
if (foundDecl)
{
ZFile* assocFile = Globals::Instance->GetSegment(GETSEGNUM(seg), res->parent->workerID);
std::string assocFileName = assocFile->GetName();
std::string fName = "";
if (GETSEGNUM(seg) == SEGMENT_SCENE || GETSEGNUM(seg) == SEGMENT_ROOM)
fName = GetPathToRes(res, texName.c_str());
else
fName = GetPathToRes(assocFile->resources[0], texName.c_str());
uint64_t hash = CRC64(fName.c_str());
word0 = hash >> 32;
word1 = hash & 0xFFFFFFFF;
}
else
{
word0 = 0;
word1 = 0;
spdlog::error("texDecl == nullptr! PTR = 0x{:08X}", texAddress);
}
}
}
break;
case G_VTX:
{
if (GETSEGNUM(data) == 0xC || GETSEGNUM(data) == 0x8)
{
// hack for dynamic verticies used in en_ganon_mant and en_jsjutan
// TODO is there a better way?
int32_t aa = (data & 0x000000FF00000000ULL) >> 32;
int32_t nn = (data & 0x000FF00000000000ULL) >> 44;
Gfx value = {gsSPVertex(data & 0xFFFFFFFF, nn, ((aa >> 1) - nn))};
word0 = value.words.w0;
word1 = value.words.w1 | 1;
}
else
{
// Write CRC64 of vtx file name
uint32_t addr = data & 0xFFFFFFFF;
if (GETSEGNUM(data) == 0x80)
addr -= dList->parent->baseAddress;
auto segOffset = GETSEGOFFSET(addr);
Declaration* vtxDecl = dList->parent->GetDeclarationRanged(segOffset);
int32_t aa = (data & 0x000000FF00000000ULL) >> 32;
int32_t nn = (data & 0x000FF00000000000ULL) >> 44;
if (vtxDecl != nullptr && vtxDecl->varType != "Gfx")
{
uint32_t diff = segOffset - vtxDecl->address;
Gfx value = {gsSPVertex(diff, nn, ((aa >> 1) - nn))};
word0 = value.words.w0;
word0 &= 0x00FFFFFF;
word0 += (G_VTX_OTR_HASH << 24);
word1 = value.words.w1;
writer->Write(word0);
writer->Write(word1);
std::string fName = OTRExporter_DisplayList::GetPathToRes(res, vtxDecl->varName);
uint64_t hash = CRC64(fName.c_str());
word0 = hash >> 32;
word1 = hash & 0xFFFFFFFF;
if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName))
{
// Write vertices to file
MemoryStream* vtxStream = new MemoryStream();
BinaryWriter vtxWriter = BinaryWriter(vtxStream);
int arrCnt = 0;
auto split = StringHelper::Split(vtxDecl->text, "\n");
for (size_t i = 0; i < split.size(); i++)
{
std::string line = split[i];
if (StringHelper::Contains(line, "VTX("))
arrCnt++;
}
// OTRTODO: Once we aren't relying on text representations, we should call ArrayExporter...
OTRExporter::WriteHeader(nullptr, "", &vtxWriter, Ship::ResourceType::Array);
vtxWriter.Write((uint32_t)ZResourceType::Vertex);
vtxWriter.Write((uint32_t)arrCnt);
auto start = std::chrono::steady_clock::now();
// God dammit this is so dumb
for (size_t i = 0; i < split.size(); i++)
{
std::string line = split[i];
if (StringHelper::Contains(line, "VTX("))
{
auto split2 = StringHelper::Split(StringHelper::Split(StringHelper::Split(line, "VTX(")[1], ")")[0], ",");
vtxWriter.Write((int16_t)std::stoi(split2[0], nullptr, 10)); // v.x
vtxWriter.Write((int16_t)std::stoi(split2[1], nullptr, 10)); // v.y
vtxWriter.Write((int16_t)std::stoi(split2[2], nullptr, 10)); // v.z
vtxWriter.Write((int16_t)0); // v.flag
vtxWriter.Write((int16_t)std::stoi(split2[3], nullptr, 10)); // v.s
vtxWriter.Write((int16_t)std::stoi(split2[4], nullptr, 10)); // v.t
vtxWriter.Write((uint8_t)std::stoi(split2[5], nullptr, 10)); // v.r
vtxWriter.Write((uint8_t)std::stoi(split2[6], nullptr, 10)); // v.g
vtxWriter.Write((uint8_t)std::stoi(split2[7], nullptr, 10)); // v.b
vtxWriter.Write((uint8_t)std::stoi(split2[8], nullptr, 10)); // v.a
}
}
AddFile(fName, vtxStream->ToVector());
auto end = std::chrono::steady_clock::now();
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
}
}
else
{
spdlog::error("vtxDecl == nullptr!");
}
}
}
break;
}
writer->Write(word0);
writer->Write(word1);
}
auto dlEnd = std::chrono::steady_clock::now();
size_t dlDiff = std::chrono::duration_cast<std::chrono::milliseconds>(dlEnd - dlStart).count();
//printf("Display List Gen in %zums\n", dlDiff);
}
std::string OTRExporter_DisplayList::GetPathToRes(ZResource* res, std::string varName)
{
std::string prefix = GetPrefix(res);
std::string fName = StringHelper::Sprintf("%s/%s", GetParentFolderName(res).c_str(), varName.c_str());
return fName;
}
std::string OTRExporter_DisplayList::GetParentFolderName(ZResource* res)
{
std::string prefix = GetPrefix(res);
std::string oName = res->parent->GetOutName();
if (StringHelper::Contains(oName, "_scene"))
{
auto split = StringHelper::Split(oName, "_");
oName = "";
for (size_t i = 0; i < split.size() - 1; i++)
oName += split[i] + "_";
oName += "scene";
}
else if (StringHelper::Contains(oName, "_room"))
{
oName = StringHelper::Split(oName, "_room")[0] + "_scene";
}
if (prefix != "")
oName = prefix + "/" + oName;
return oName;
}
std::string OTRExporter_DisplayList::GetPrefix(ZResource* res)
{
std::string oName = res->parent->GetOutName();
std::string prefix = "";
std::string xmlPath = StringHelper::Replace(res->parent->GetXmlFilePath().string(), "\\", "/");
if (StringHelper::Contains(oName, "_scene") || StringHelper::Contains(oName, "_room")) {
prefix = "scenes";
if (Globals::Instance->rom->IsMQ()) {
prefix += "/mq";
} else {
prefix += "/nonmq";
}
}
else if (StringHelper::Contains(xmlPath, "objects/"))
prefix = "objects";
else if (StringHelper::Contains(xmlPath, "textures/"))
prefix = "textures";
else if (StringHelper::Contains(xmlPath, "overlays/"))
prefix = "overlays";
else if (StringHelper::Contains(xmlPath, "misc/"))
prefix = "misc";
else if (StringHelper::Contains(xmlPath, "text/"))
prefix = "text";
else if (StringHelper::Contains(xmlPath, "code/"))
prefix = "code";
return prefix;
}

View File

@ -1,17 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZTexture.h"
#include "ZDisplayList.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_DisplayList : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
static std::string GetParentFolderName(ZResource* res);
static std::string GetPathToRes(ZResource* res, std::string varName);
static std::string GetPrefix(ZResource* res);
};

View File

@ -1,21 +0,0 @@
#include "Exporter.h"
#include "VersionInfo.h"
void OTRExporter::WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, Ship::Version resVersion)
{
writer->Write((uint8_t)Endianness::Little); // 0x00
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write((uint32_t)resType); // 0x04
//writer->Write((uint32_t)MAJOR_VERSION); // 0x08
writer->Write((uint32_t)resVersion); // 0x08
writer->Write((uint64_t)0xDEADBEEFDEADBEEF); // id, 0x0C
writer->Write((uint32_t)resourceVersions[resType]); // 0x10
writer->Write((uint64_t)0); // ROM CRC, 0x14
writer->Write((uint32_t)0); // ROM Enum, 0x1C
while (writer->GetBaseAddress() < 0x40)
writer->Write((uint32_t)0); // To be used at a later date!
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZArray.h"
//#include "OTRExporter.h"
#include <Utils/BinaryWriter.h>
#include <libultraship/bridge.h>
#include "VersionInfo.h"
class OTRExporter : public ZResourceExporter
{
protected:
static void WriteHeader(ZResource* res, const fs::path& outPath, BinaryWriter* writer, Ship::ResourceType resType, Ship::Version resVersion = MAJOR_VERSION);
};

View File

@ -1,325 +0,0 @@
#include "Main.h"
#include "Exporter.h"
#include "BackgroundExporter.h"
#include "TextureExporter.h"
#include "RoomExporter.h"
#include "CollisionExporter.h"
#include "DisplayListExporter.h"
#include "PlayerAnimationExporter.h"
#include "SkeletonExporter.h"
#include "SkeletonLimbExporter.h"
#include "ArrayExporter.h"
#include "VtxExporter.h"
#include "AnimationExporter.h"
#include "CutsceneExporter.h"
#include "PathExporter.h"
#include "TextExporter.h"
#include "BlobExporter.h"
#include "MtxExporter.h"
#include "AudioExporter.h"
#include <Globals.h>
#include <Utils/File.h>
#include <Utils/Directory.h>
#include <Utils/MemoryStream.h>
#include <Utils/BinaryWriter.h>
#include <bit>
#include <mutex>
std::string otrFileName = "oot.otr";
std::shared_ptr<Ship::Archive> otrArchive;
BinaryWriter* fileWriter;
std::chrono::steady_clock::time_point fileStart, resStart;
std::map<std::string, std::vector<char>> files;
std::mutex fileMutex;
void InitVersionInfo();
enum class ExporterFileMode
{
BuildOTR = (int)ZFileMode::Custom + 1,
};
static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileMode)
{
if (buildMode == "botr")
{
fileMode = (ZFileMode)ExporterFileMode::BuildOTR;
printf("BOTR: Generating OTR Archive...\n");
if (File::Exists(otrFileName))
otrArchive = std::shared_ptr<Ship::Archive>(new Ship::Archive(otrFileName, true));
else
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
auto lst = Directory::ListFiles("Extract");
for (auto item : lst)
{
auto fileData = File::ReadAllBytes(item);
otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
}
}
}
static void ExporterProgramEnd()
{
uint32_t crc = 0xFFFFFFFF;
const uint8_t endianness = (uint8_t)Endianness::Big;
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
{
std::string romPath = Globals::Instance->baseRomPath.string();
const std::vector<uint8_t>& romData = File::ReadAllBytes(romPath);
crc = BitConverter::ToUInt32BE(romData, 0x10);
printf("Creating version file...\n");
// Get crc from rom
MemoryStream *versionStream = new MemoryStream();
BinaryWriter writer(versionStream);
writer.SetEndianness(Endianness::Big);
writer.Write(endianness);
writer.Write(crc);
writer.Close();
printf("Created version file.\n");
printf("Generating OTR Archive...\n");
otrArchive = Ship::Archive::CreateArchive(otrFileName, 40000);
otrArchive->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
for (const auto& item : files)
{
std::string fName = item.first;
if (fName.find("gTitleZeldaShieldLogoMQTex") != std::string::npos && !ZRom(romPath).IsMQ())
{
size_t pos = 0;
if ((pos = fName.find("gTitleZeldaShieldLogoMQTex", 0)) != std::string::npos)
{
fName.replace(pos, 27, "gTitleZeldaShieldLogoTex");
}
}
const auto& fileData = item.second;
otrArchive->AddFile(fName, (uintptr_t)fileData.data(),
fileData.size());
}
}
otrArchive = nullptr;
delete fileWriter;
files.clear();
// Add any additional files that need to be manually copied...
if (File::Exists("soh.otr")) {
return;
}
const auto& lst = Directory::ListFiles("Extract");
std::shared_ptr<Ship::Archive> sohOtr = Ship::Archive::CreateArchive("soh.otr", 4096);
//sohOtr->AddFile("version", (uintptr_t)versionStream->ToVector().data(), versionStream->GetLength());
for (const auto& item : lst)
{
std::vector<std::string> splitPath = StringHelper::Split(item, ".");
if (splitPath.size() >= 3)
{
const std::string extension = splitPath.at(splitPath.size() - 1);
const std::string format = splitPath.at(splitPath.size() - 2);
splitPath.pop_back();
splitPath.pop_back();
std::string afterPath = std::accumulate(splitPath.begin(), splitPath.end(), std::string(""));
if (extension == "png" && (format == "rgba32" || format == "rgb5a1" || format == "i4" || format == "i8" || format == "ia4" || format == "ia8" || format == "ia16" || format == "ci4" || format == "ci8"))
{
ZTexture tex(nullptr);
Globals::Instance->buildRawTexture = true;
tex.FromPNG(item, ZTexture::GetTextureTypeFromString(format));
printf("sohOtr->AddFile(%s)\n", StringHelper::Split(afterPath, "Extract/")[1].c_str());
OTRExporter_Texture exporter;
MemoryStream* stream = new MemoryStream();
BinaryWriter writer(stream);
exporter.Save(&tex, "", &writer);
std::string src = tex.GetBodySourceCode();
writer.Write((char *)src.c_str(), src.size());
std::vector<char> fileData = stream->ToVector();
sohOtr->AddFile(StringHelper::Split(afterPath, "Extract/assets/")[1], (uintptr_t)fileData.data(), fileData.size());
continue;
}
}
if (item.find("accessibility") != std::string::npos)
{
std::string extension = splitPath.at(splitPath.size() - 1);
splitPath.pop_back();
if (extension == "json")
{
const auto &fileData = File::ReadAllBytes(item);
printf("Adding accessibility texts %s\n", StringHelper::Split(item, "texts/")[1].c_str());
sohOtr->AddFile(StringHelper::Split(item, "Extract/assets/")[1], (uintptr_t)fileData.data(), fileData.size());
}
continue;
}
const auto& fileData = File::ReadAllBytes(item);
printf("sohOtr->AddFile(%s)\n", StringHelper::Split(item, "Extract/")[1].c_str());
sohOtr->AddFile(StringHelper::Split(item, item.find("Extract/assets/") != std::string::npos ? "Extract/assets/" : "Extract/")[1], (uintptr_t)fileData.data(), fileData.size());
}
sohOtr = nullptr;
}
static void ExporterParseArgs(int argc, char* argv[], int& i)
{
std::string arg = argv[i];
if (arg == "--otrfile")
{
otrFileName = argv[i + 1];
i++;
}
}
static bool ExporterProcessFileMode(ZFileMode fileMode)
{
// Do whatever work is associated with these custom file modes...
// Return true to indicate one of our own file modes is being processed
if (fileMode == (ZFileMode)ExporterFileMode::BuildOTR)
return true;
return false;
}
static void ExporterFileBegin(ZFile* file)
{
fileStart = std::chrono::steady_clock::now();
MemoryStream* stream = new MemoryStream();
fileWriter = new BinaryWriter(stream);
}
static void ExporterFileEnd(ZFile* file)
{
// delete fileWriter;
}
static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer)
{
auto streamShared = writer.GetStream();
MemoryStream* strem = (MemoryStream*)streamShared.get();
auto start = std::chrono::steady_clock::now();
if (res->GetName() != "")
{
std::string oName = res->parent->GetOutName();
std::string rName = res->GetName();
std::string prefix = OTRExporter_DisplayList::GetPrefix(res);
//auto xmlFilePath = res->parent->GetXmlFilePath();
//prefix = StringHelper::Split(StringHelper::Split(xmlFilePath.string(), "xml\\")[1], ".xml")[0];
if (StringHelper::Contains(oName, "_scene"))
{
auto split = StringHelper::Split(oName, "_");
oName = "";
for (size_t i = 0; i < split.size() - 1; i++)
oName += split[i] + "_";
oName += "scene";
}
else if (StringHelper::Contains(oName, "_room"))
{
oName = StringHelper::Split(oName, "_room")[0] + "_scene";
}
std::string fName = "";
if (prefix != "")
fName = StringHelper::Sprintf("%s/%s/%s", prefix.c_str(), oName.c_str(), rName.c_str());
else
fName = StringHelper::Sprintf("%s/%s", oName.c_str(), rName.c_str());
if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory)
{
std::unique_lock Lock(fileMutex);
files[fName] = strem->ToVector();
}
else
File::WriteAllBytes("Extract/" + fName, strem->ToVector());
}
auto end = std::chrono::steady_clock::now();
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
//if (diff > 10)
//printf("Exported Resource End %s in %zums\n", res->GetName().c_str(), diff);
}
static void ExporterProcessCompilable(tinyxml2::XMLElement* reader)
{
std::string nodeName = reader->Name();
}
static void ExporterXMLBegin()
{
}
static void ExporterXMLEnd()
{
}
void AddFile(std::string fName, std::vector<char> data)
{
if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory)
File::WriteAllBytes("Extract/" + fName, data);
else
{
std::unique_lock Lock(fileMutex);
files[fName] = data;
}
}
void ImportExporters()
{
// In this example we set up a new exporter called "EXAMPLE".
// By running ZAPD with the argument -se EXAMPLE, we tell it that we want to use this exporter for our resources.
ExporterSet* exporterSet = new ExporterSet();
exporterSet->processFileModeFunc = ExporterProcessFileMode;
exporterSet->parseFileModeFunc = ExporterParseFileMode;
exporterSet->processCompilableFunc = ExporterProcessCompilable;
exporterSet->parseArgsFunc = ExporterParseArgs;
exporterSet->beginFileFunc = ExporterFileBegin;
exporterSet->endFileFunc = ExporterFileEnd;
exporterSet->beginXMLFunc = ExporterXMLBegin;
exporterSet->endXMLFunc = ExporterXMLEnd;
exporterSet->resSaveFunc = ExporterResourceEnd;
exporterSet->endProgramFunc = ExporterProgramEnd;
exporterSet->exporters[ZResourceType::Background] = new OTRExporter_Background();
exporterSet->exporters[ZResourceType::Texture] = new OTRExporter_Texture();
exporterSet->exporters[ZResourceType::Room] = new OTRExporter_Room();
exporterSet->exporters[ZResourceType::AltHeader] = new OTRExporter_Room();
exporterSet->exporters[ZResourceType::Scene] = new OTRExporter_Room();
exporterSet->exporters[ZResourceType::CollisionHeader] = new OTRExporter_Collision();
exporterSet->exporters[ZResourceType::DisplayList] = new OTRExporter_DisplayList();
exporterSet->exporters[ZResourceType::PlayerAnimationData] = new OTRExporter_PlayerAnimationExporter();
exporterSet->exporters[ZResourceType::Skeleton] = new OTRExporter_Skeleton();
exporterSet->exporters[ZResourceType::Limb] = new OTRExporter_SkeletonLimb();
exporterSet->exporters[ZResourceType::Animation] = new OTRExporter_Animation();
exporterSet->exporters[ZResourceType::Cutscene] = new OTRExporter_Cutscene();
exporterSet->exporters[ZResourceType::Vertex] = new OTRExporter_Vtx();
exporterSet->exporters[ZResourceType::Array] = new OTRExporter_Array();
exporterSet->exporters[ZResourceType::Path] = new OTRExporter_Path();
exporterSet->exporters[ZResourceType::Text] = new OTRExporter_Text();
exporterSet->exporters[ZResourceType::Blob] = new OTRExporter_Blob();
exporterSet->exporters[ZResourceType::Mtx] = new OTRExporter_MtxExporter();
exporterSet->exporters[ZResourceType::Audio] = new OTRExporter_Audio();
Globals::AddExporter("OTR", exporterSet);
InitVersionInfo();
}

View File

@ -1,8 +0,0 @@
#pragma once
#include <libultraship/bridge.h>
extern std::shared_ptr<Ship::Archive> otrArchive;
extern std::map<std::string, std::vector<char>> files;
void AddFile(std::string fName, std::vector<char> data);

View File

@ -1,13 +0,0 @@
#include "MtxExporter.h"
void OTRExporter_MtxExporter::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZMtx* mtx = (ZMtx*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Matrix);
for (size_t i = 0; i < 4; i++)
for (size_t j = 0; j < 4; j++)
//TODO possibly utilize the array class better
writer->Write(mtx->mtx[i][j]);
}

View File

@ -1,10 +0,0 @@
#include "ZResource.h"
#include "ZMtx.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_MtxExporter : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,23 +0,0 @@
#include "PathExporter.h"
#include "../ZAPD/ZFile.h"
void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZPath* path = (ZPath*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Path);
writer->Write((uint32_t)path->pathways.size());
for (size_t k = 0; k < path->pathways.size(); k++)
{
writer->Write((uint32_t)path->pathways[k].points.size());
for (size_t i = 0; i < path->pathways[k].points.size(); i++)
{
writer->Write(path->pathways[k].points[i].scalars[0].scalarData.s16);
writer->Write(path->pathways[k].points[i].scalars[1].scalarData.s16);
writer->Write(path->pathways[k].points[i].scalars[2].scalarData.s16);
}
}
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZPath.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Path : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,21 +0,0 @@
#include "PlayerAnimationExporter.h"
#include <libultraship/bridge.h>
void OTRExporter_PlayerAnimationExporter::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZPlayerAnimationData* anim = (ZPlayerAnimationData*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_PlayerAnimation);
auto start = std::chrono::steady_clock::now();
writer->Write((uint32_t)anim->limbRotData.size());
for (size_t i = 0; i < anim->limbRotData.size(); i++)
writer->Write(anim->limbRotData[i]);
auto end = std::chrono::steady_clock::now();
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
//printf("Exported Player Anim %s in %zums\n", anim->GetName().c_str(), diff);
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZTexture.h"
#include "ZPlayerAnimationData.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_PlayerAnimationExporter : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,523 +0,0 @@
#include "RoomExporter.h"
#include "Utils/BinaryWriter.h"
#include "Utils/MemoryStream.h"
#include "Utils/File.h"
#include <ZRoom/Commands/SetMesh.h>
#include <ZRoom/Commands/SetWind.h>
#include <ZRoom/Commands/SetTimeSettings.h>
#include <ZRoom/Commands/SetSkyboxModifier.h>
#include <ZRoom/Commands/SetSoundSettings.h>
#include <ZRoom/Commands/SetCameraSettings.h>
#include <ZRoom/Commands/SetRoomBehavior.h>
#include <ZRoom/Commands/SetCsCamera.h>
#include <ZRoom/Commands/SetRoomList.h>
#include <ZRoom/Commands/SetCollisionHeader.h>
#include <ZRoom/Commands/SetEntranceList.h>
#include <ZRoom/Commands/SetSpecialObjects.h>
#include <ZRoom/Commands/SetStartPositionList.h>
#include <ZRoom/Commands/SetSkyboxSettings.h>
#include <ZRoom/Commands/SetLightingSettings.h>
#include <ZRoom/Commands/SetLightList.h>
#include <ZRoom/Commands/SetEchoSettings.h>
#include <ZRoom/Commands/SetObjectList.h>
#include <ZRoom/Commands/SetAlternateHeaders.h>
#include "CollisionExporter.h"
#include "DisplayListExporter.h"
#include <libultraship/bridge.h>
#include <Globals.h>
#include <ZRoom/Commands/SetExitList.h>
#include <ZRoom/Commands/SetPathways.h>
#include "TextureExporter.h"
#include "Main.h"
#include <ZRoom/Commands/SetCutscenes.h>
#include "CutsceneExporter.h"
#include <ZRoom/Commands/SetTransitionActorList.h>
#include "PathExporter.h"
#undef FindResource
void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZRoom* room = (ZRoom*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Room);
writer->Write((uint32_t)room->commands.size());
for (size_t i = 0; i < room->commands.size(); i++)
{
ZRoomCommand* cmd = room->commands[i];
writer->Write((uint32_t)cmd->cmdID);
switch (cmd->cmdID)
{
case RoomCommand::SetTransitionActorList:
{
SetTransitionActorList* cmdTrans = (SetTransitionActorList*)cmd;
writer->Write((uint32_t)cmdTrans->transitionActors.size());
for (const TransitionActorEntry& entry : cmdTrans->transitionActors)
{
writer->Write(entry.frontObjectRoom);
writer->Write(entry.frontTransitionReaction);
writer->Write(entry.backObjectRoom);
writer->Write(entry.backTransitionReaction);
writer->Write(entry.actorNum);
writer->Write(entry.posX);
writer->Write(entry.posY);
writer->Write(entry.posZ);
writer->Write(entry.rotY);
writer->Write(entry.initVar);
}
}
break;
case RoomCommand::SetActorList:
{
SetActorList* cmdSetActorList = (SetActorList*)cmd;
// There are instance of the amount of actors in the file differing from the size listed in the command.
// This can cause issues if we export actors with garbage data, so let's trust the command size
writer->Write((uint32_t)cmdSetActorList->numActors);
for (int i = 0; i < cmdSetActorList->numActors; i++)
{
const ActorSpawnEntry& entry = cmdSetActorList->actors[i];
writer->Write(entry.actorNum);
writer->Write(entry.posX);
writer->Write(entry.posY);
writer->Write(entry.posZ);
writer->Write(entry.rotX);
writer->Write(entry.rotY);
writer->Write(entry.rotZ);
writer->Write(entry.initVar);
}
}
break;
case RoomCommand::SetWind:
{
SetWind* cmdSetWind = (SetWind*)cmd;
writer->Write(cmdSetWind->windWest); // 0x04
writer->Write(cmdSetWind->windVertical); // 0x05
writer->Write(cmdSetWind->windSouth); // 0x06
writer->Write(cmdSetWind->clothFlappingStrength); // 0x07
}
break;
case RoomCommand::SetTimeSettings:
{
SetTimeSettings* cmdTime = (SetTimeSettings*)cmd;
writer->Write(cmdTime->hour); // 0x04
writer->Write(cmdTime->min); // 0x05
writer->Write(cmdTime->unk); // 0x06
}
break;
case RoomCommand::SetSkyboxModifier:
{
SetSkyboxModifier* cmdSkybox = (SetSkyboxModifier*)cmd;
writer->Write(cmdSkybox->disableSky); // 0x04
writer->Write(cmdSkybox->disableSunMoon); // 0x05
}
break;
case RoomCommand::SetEchoSettings:
{
SetEchoSettings* cmdEcho = (SetEchoSettings*)cmd;
writer->Write((uint8_t)cmdEcho->echo); // 0x07
}
break;
case RoomCommand::SetSoundSettings:
{
SetSoundSettings* cmdSound = (SetSoundSettings*)cmd;
writer->Write((uint8_t)cmdSound->reverb); // 0x01
writer->Write(cmdSound->nightTimeSFX); // 0x06
writer->Write(cmdSound->musicSequence); // 0x07
}
break;
case RoomCommand::SetSkyboxSettings:
{
SetSkyboxSettings* cmdSkybox = (SetSkyboxSettings*)cmd;
writer->Write((uint8_t)cmdSkybox->unk1); // 0x01
writer->Write((uint8_t)cmdSkybox->skyboxNumber); // 0x04
writer->Write((uint8_t)cmdSkybox->cloudsType); // 0x05
writer->Write((uint8_t)cmdSkybox->isIndoors); // 0x06
}
break;
case RoomCommand::SetRoomBehavior:
{
SetRoomBehavior* cmdRoom = (SetRoomBehavior*)cmd;
writer->Write((uint8_t)cmdRoom->gameplayFlags); // 0x01
writer->Write(cmdRoom->gameplayFlags2); // 0x04
}
break;
case RoomCommand::SetCsCamera:
{
SetCsCamera* cmdCsCam = (SetCsCamera*)cmd;
writer->Write((uint32_t)cmdCsCam->cameras.size());
for (size_t i = 0; i < cmdCsCam->cameras.size(); i++)
{
writer->Write(cmdCsCam->cameras[i].baseOffset);
writer->Write(cmdCsCam->cameras[i].type);
writer->Write(cmdCsCam->cameras[i].numPoints);
}
writer->Write((uint32_t)cmdCsCam->points.size());
for (size_t i = 0; i < cmdCsCam->points.size(); i++)
{
writer->Write(cmdCsCam->points[i].scalars[0].scalarData.s16);
writer->Write(cmdCsCam->points[i].scalars[1].scalarData.s16);
writer->Write(cmdCsCam->points[i].scalars[2].scalarData.s16);
}
}
break;
case RoomCommand::SetMesh:
{
SetMesh* cmdMesh = (SetMesh*)cmd;
writer->Write((uint8_t)cmdMesh->data); // 0x01
writer->Write(cmdMesh->meshHeaderType);
if (cmdMesh->meshHeaderType == 0 || cmdMesh->meshHeaderType == 2)
{
PolygonType2* poly = (PolygonType2*)cmdMesh->polyType.get();
writer->Write(poly->num);
for (int i = 0; i < poly->num; i++)
WritePolyDList(writer, room, &poly->polyDLists[i]);
}
else if (cmdMesh->meshHeaderType == 1)
{
PolygonType1* poly = (PolygonType1*)cmdMesh->polyType.get();
writer->Write(poly->format);
auto test = (PolygonDlist*)&poly->polyDLists[0];
Declaration* dListDeclOpa = poly->parent->GetDeclaration(GETSEGOFFSET(test->opa));
Declaration* dListDeclXlu = poly->parent->GetDeclaration(GETSEGOFFSET(test->xlu));
if (test->opa != 0)
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str()));
else
writer->Write("");
if (test->xlu != 0)
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclXlu->varName.c_str()));
else
writer->Write("");
if (poly->format == 2)
{
writer->Write((uint32_t)poly->count);
for (int i = 0; i < poly->count; i++)
{
writer->Write(poly->multiList[i].unk_00);
writer->Write(poly->multiList[i].id);
Declaration* bgDecl = poly->parent->GetDeclarationRanged(GETSEGOFFSET(poly->multiList[i].source));
writer->Write(OTRExporter_DisplayList::GetPathToRes(poly->multiList[i].sourceBackground, bgDecl->varName));
writer->Write(poly->multiList[i].unk_0C);
writer->Write(poly->multiList[i].tlut);
writer->Write(poly->multiList[i].width);
writer->Write(poly->multiList[i].height);
writer->Write(poly->multiList[i].fmt);
writer->Write(poly->multiList[i].siz);
writer->Write(poly->multiList[i].mode0);
writer->Write(poly->multiList[i].tlutCount);
}
}
else
{
writer->Write((uint32_t)1);
writer->Write(poly->single.unk_00);
writer->Write(poly->single.id);
Declaration* bgDecl = poly->parent->GetDeclarationRanged(GETSEGOFFSET(poly->single.source));
writer->Write(OTRExporter_DisplayList::GetPathToRes(poly->single.sourceBackground, bgDecl->varName));
writer->Write(poly->single.unk_0C);
writer->Write(poly->single.tlut);
writer->Write(poly->single.width);
writer->Write(poly->single.height);
writer->Write(poly->single.fmt);
writer->Write(poly->single.siz);
writer->Write(poly->single.mode0);
writer->Write(poly->single.tlutCount);
}
if (poly->dlist != 0)
WritePolyDList(writer, room, &poly->polyDLists[0]);
}
}
break;
case RoomCommand::SetCameraSettings:
{
SetCameraSettings* cmdCam = (SetCameraSettings*)cmd;
writer->Write((uint8_t)cmdCam->cameraMovement); // 0x01
writer->Write(cmdCam->mapHighlight); // 0x04
}
break;
case RoomCommand::SetLightList:
{
SetLightList* cmdLight = (SetLightList*)cmd;
writer->Write((uint32_t)cmdLight->lights.size());
for (size_t i = 0; i < cmdLight->lights.size(); i++)
{
writer->Write(cmdLight->lights[i].type);
writer->Write(cmdLight->lights[i].x);
writer->Write(cmdLight->lights[i].y);
writer->Write(cmdLight->lights[i].z);
writer->Write(cmdLight->lights[i].r);
writer->Write(cmdLight->lights[i].g);
writer->Write(cmdLight->lights[i].b);
writer->Write(cmdLight->lights[i].drawGlow);
writer->Write(cmdLight->lights[i].radius);
}
}
break;
case RoomCommand::SetLightingSettings:
{
SetLightingSettings* cmdLight = (SetLightingSettings*)cmd;
writer->Write((uint32_t)cmdLight->settings.size()); // 0x01
for (const LightingSettings& setting : cmdLight->settings)
{
writer->Write(setting.ambientClrR);
writer->Write(setting.ambientClrG);
writer->Write(setting.ambientClrB);
writer->Write(setting.diffuseClrA_R);
writer->Write(setting.diffuseClrA_G);
writer->Write(setting.diffuseClrA_B);
writer->Write(setting.diffuseDirA_X);
writer->Write(setting.diffuseDirA_Y);
writer->Write(setting.diffuseDirA_Z);
writer->Write(setting.diffuseClrB_R);
writer->Write(setting.diffuseClrB_G);
writer->Write(setting.diffuseClrB_B);
writer->Write(setting.diffuseDirB_X);
writer->Write(setting.diffuseDirB_Y);
writer->Write(setting.diffuseDirB_Z);
writer->Write(setting.fogClrR);
writer->Write(setting.fogClrG);
writer->Write(setting.fogClrB);
writer->Write(setting.unk);
writer->Write(setting.drawDistance);
}
}
break;
case RoomCommand::SetRoomList:
{
SetRoomList* cmdRoom = (SetRoomList*)cmd;
writer->Write((uint32_t)cmdRoom->romfile->numRooms); // 0x01
for (size_t i = 0;i < cmdRoom->romfile->numRooms; i++)
{
//std::string roomName = StringHelper::Sprintf("%s/%s_room_%i", (StringHelper::Split(room->GetName(), "_")[0] + "_scene").c_str(), StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i);
std::string roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%i", StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i));
writer->Write(roomName);
writer->Write(cmdRoom->romfile->rooms[i].virtualAddressStart);
writer->Write(cmdRoom->romfile->rooms[i].virtualAddressEnd);
}
}
break;
case RoomCommand::SetCollisionHeader:
{
SetCollisionHeader* cmdCollHeader = (SetCollisionHeader*)cmd;
Declaration* colHeaderDecl = room->parent->GetDeclaration(cmdCollHeader->segmentOffset);
std::string path = OTRExporter_DisplayList::GetPathToRes(room, colHeaderDecl->varName);
writer->Write(path);
}
break;
case RoomCommand::SetEntranceList:
{
SetEntranceList* cmdEntrance = (SetEntranceList*)cmd;
writer->Write((uint32_t)cmdEntrance->entrances.size());
for (EntranceEntry entry : cmdEntrance->entrances)
{
writer->Write((uint8_t)entry.startPositionIndex);
writer->Write((uint8_t)entry.roomToLoad);
}
}
break;
case RoomCommand::SetSpecialObjects:
{
SetSpecialObjects* cmdSpecObj = (SetSpecialObjects*)cmd;
writer->Write((uint8_t)cmdSpecObj->elfMessage); // 0x01
writer->Write((uint16_t)cmdSpecObj->globalObject); // 0x06
}
break;
case RoomCommand::SetStartPositionList:
{
SetStartPositionList* cmdStartPos = (SetStartPositionList*)cmd;
uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
writer->Write((uint32_t)cmdStartPos->actors.size()); // 0x01
for (const ActorSpawnEntry& entry : cmdStartPos->actors)
{
writer->Write(entry.actorNum);
writer->Write(entry.posX);
writer->Write(entry.posY);
writer->Write(entry.posZ);
writer->Write(entry.rotX);
writer->Write(entry.rotY);
writer->Write(entry.rotZ);
writer->Write(entry.initVar);
}
}
break;
case RoomCommand::SetAlternateHeaders:
{
SetAlternateHeaders* cmdHeaders = (SetAlternateHeaders*)cmd;
writer->Write((uint32_t)cmdHeaders->headers.size());
for (size_t i = 0; i < cmdHeaders->headers.size(); i++)
{
uint32_t seg = cmdHeaders->headers[i] & 0xFFFFFFFF;
std::string headerName = "";
bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, room->parent, "", headerName, res->parent->workerID);
if (headerName == "NULL")
writer->Write("");
else
{
std::string name = OTRExporter_DisplayList::GetPathToRes(room, headerName);
writer->Write(name);
}
}
}
break;
case RoomCommand::SetExitList:
{
SetExitList* cmdExit = (SetExitList*)cmd;
writer->Write((uint32_t)cmdExit->exits.size());
for (size_t i = 0; i < cmdExit->exits.size(); i++)
writer->Write(cmdExit->exits[i]);
}
break;
case RoomCommand::SetObjectList:
{
SetObjectList* cmdSetObjectList = (SetObjectList*)cmd;
writer->Write((uint32_t)cmdSetObjectList->objects.size());
for (size_t i = 0; i < cmdSetObjectList->objects.size(); i++)
writer->Write(cmdSetObjectList->objects[i]);
}
break;
case RoomCommand::SetCutscenes:
{
SetCutscenes* cmdSetCutscenes = (SetCutscenes*)cmd;
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdSetCutscenes->cmdArg2, room->parent, "CutsceneData", listName, res->parent->workerID);
std::string fName = OTRExporter_DisplayList::GetPathToRes(room, listName);
//std::string fName = StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), listName.c_str());
writer->Write(fName);
MemoryStream* csStream = new MemoryStream();
BinaryWriter csWriter = BinaryWriter(csStream);
OTRExporter_Cutscene cs;
cs.Save(cmdSetCutscenes->cutscenes[0], "", &csWriter);
AddFile(fName, csStream->ToVector());
}
break;
case RoomCommand::SetPathways:
{
SetPathways* cmdSetPathways = (SetPathways*)cmd;
writer->Write((uint32_t)cmdSetPathways->pathwayList.pathways.size());
for (size_t i = 0; i < cmdSetPathways->pathwayList.pathways.size(); i++)
{
Declaration* decl = room->parent->GetDeclaration(GETSEGOFFSET(cmdSetPathways->pathwayList.pathways[i].listSegmentAddress));
//std::string path = StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), decl->varName.c_str());
std::string path = OTRExporter_DisplayList::GetPathToRes(room, decl->varName);
writer->Write(path);
MemoryStream* pathStream = new MemoryStream();
BinaryWriter pathWriter = BinaryWriter(pathStream);
OTRExporter_Path pathExp;
pathExp.Save(&cmdSetPathways->pathwayList, outPath, &pathWriter);
AddFile(path, pathStream->ToVector());
}
}
break;
case RoomCommand::EndMarker:
break;
default:
printf("UNIMPLEMENTED COMMAND: 0x%02X\n", (int)cmd->cmdID);
break;
}
}
}
void OTRExporter_Room::WritePolyDList(BinaryWriter* writer, ZRoom* room, PolygonDlist* dlist)
{
writer->Write(dlist->polyType);
switch (dlist->polyType)
{
case 2:
writer->Write(dlist->x);
writer->Write(dlist->y);
writer->Write(dlist->z);
writer->Write(dlist->unk_06);
[[fallthrough]];
default:
//writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str()));
if (dlist->opaDList != nullptr)
{
auto opaDecl = room->parent->GetDeclaration(GETSEGOFFSET(dlist->opaDList->GetRawDataIndex()));
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), opaDecl->varName.c_str()));
}
else
writer->Write("");
if (dlist->xluDList != nullptr)
{
auto xluDecl = room->parent->GetDeclaration(GETSEGOFFSET(dlist->xluDList->GetRawDataIndex()));
writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), xluDecl->varName.c_str()));
}
else
writer->Write("");
break;
}
}

View File

@ -1,14 +0,0 @@
#pragma once
#include "ZResource.h"
#include "Exporter.h"
#include "ZRoom/ZRoom.h"
class PolygonDlist;
class OTRExporter_Room : public OTRExporter
{
public:
void WritePolyDList(BinaryWriter* writer, ZRoom* room, PolygonDlist* dlist);
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,39 +0,0 @@
#include "SkeletonExporter.h"
#include <libultraship/bridge.h>
#include <Globals.h>
#include "DisplayListExporter.h"
void OTRExporter_Skeleton::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZSkeleton* skel = (ZSkeleton*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_Skeleton);
writer->Write((uint8_t)skel->type);
writer->Write((uint8_t)skel->limbType);
writer->Write((uint32_t)skel->limbCount);
writer->Write((uint32_t)skel->dListCount);
writer->Write((uint8_t)skel->limbsTable.limbType);
writer->Write((uint32_t)skel->limbsTable.count);
for (size_t i = 0; i < skel->limbsTable.count; i++)
{
Declaration* skelDecl = skel->parent->GetDeclarationRanged(GETSEGOFFSET(skel->limbsTable.limbsAddresses[i]));
std::string name;
bool foundDecl = Globals::Instance->GetSegmentedPtrName(skel->limbsTable.limbsAddresses[i], skel->parent, "", name, res->parent->workerID);
if (foundDecl)
{
if (name.at(0) == '&')
name.erase(0, 1);
writer->Write(OTRExporter_DisplayList::GetPathToRes(res, name));
}
else
{
writer->Write("");
}
}
}

View File

@ -1,14 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZTexture.h"
#include "ZDisplayList.h"
#include "ZSkeleton.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Skeleton : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,176 +0,0 @@
#include "SkeletonLimbExporter.h"
#include "DisplayListExporter.h"
#include <libultraship/bridge.h>
#include <Globals.h>
void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZLimb* limb = (ZLimb*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::SOH_SkeletonLimb);
writer->Write((uint8_t)limb->type);
writer->Write((uint8_t)limb->skinSegmentType);
if (limb->skinSegmentType == ZLimbSkinType::SkinType_DList && limb->type == ZLimbType::Skin)
{
auto childDecl = limb->parent->GetDeclaration(GETSEGOFFSET(limb->skinSegment));
if (childDecl != nullptr)
writer->Write(OTRExporter_DisplayList::GetPathToRes(limb, childDecl->varName));
else
writer->Write("");
}
else
{
writer->Write("");
}
writer->Write((uint16_t)limb->segmentStruct.unk_0);
writer->Write((uint32_t)limb->segmentStruct.unk_4_arr.size());
for (auto item : limb->segmentStruct.unk_4_arr)
{
writer->Write(item.unk_4);
writer->Write((uint32_t)item.unk_8_arr.size());
for (auto item2 : item.unk_8_arr)
{
writer->Write(item2.unk_0);
writer->Write(item2.unk_2);
writer->Write(item2.unk_4);
writer->Write(item2.unk_6);
writer->Write(item2.unk_7);
writer->Write(item2.unk_8);
writer->Write(item2.unk_9);
}
writer->Write((uint32_t)item.unk_C_arr.size());
for (auto item2 : item.unk_C_arr)
{
writer->Write(item2.unk_0);
writer->Write(item2.x);
writer->Write(item2.y);
writer->Write(item2.z);
writer->Write(item2.unk_8);
}
}
if (limb->segmentStruct.unk_8 != 0)
{
auto skinGfxDecl = limb->parent->GetDeclaration(GETSEGOFFSET(limb->segmentStruct.unk_8));
if (skinGfxDecl != nullptr)
{
writer->Write(OTRExporter_DisplayList::GetPathToRes(limb, skinGfxDecl->varName));
}
else
{
writer->Write("");
}
}
else
{
writer->Write("");
}
writer->Write(limb->legTransX);
writer->Write(limb->legTransY);
writer->Write(limb->legTransZ);
writer->Write(limb->rotX);
writer->Write(limb->rotY);
writer->Write(limb->rotZ);
if (limb->childPtr != 0)
{
std::string name;
bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->childPtr, limb->parent, "", name, res->parent->workerID);
if (foundDecl)
{
if (name.at(0) == '&')
name.erase(0, 1);
writer->Write(OTRExporter_DisplayList::GetPathToRes(limb, name));
}
else
{
writer->Write("");
}
}
else
{
writer->Write("");
}
if (limb->siblingPtr != 0)
{
std::string name;
bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->siblingPtr, limb->parent, "", name, res->parent->workerID);
if (foundDecl)
{
if (name.at(0) == '&')
name.erase(0, 1);
writer->Write(OTRExporter_DisplayList::GetPathToRes(limb, name));
}
else
{
writer->Write("");
}
}
else
{
writer->Write("");
}
if (limb->dListPtr != 0)
{
std::string name;
bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->dListPtr, limb->parent, "", name, res->parent->workerID);
if (foundDecl)
{
if (name.at(0) == '&')
name.erase(0, 1);
writer->Write(OTRExporter_DisplayList::GetPathToRes(limb, name));
}
else
{
writer->Write("");
}
}
else
{
writer->Write("");
}
if (limb->dList2Ptr != 0)
{
std::string name;
bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->dList2Ptr, limb->parent, "", name, res->parent->workerID);
if (foundDecl)
{
if (name.at(0) == '&')
name.erase(0, 1);
writer->Write(OTRExporter_DisplayList::GetPathToRes(limb, name));
}
else
{
writer->Write("");
}
}
else
{
writer->Write("");
}
writer->Write(limb->transX);
writer->Write(limb->transY);
writer->Write(limb->transZ);
writer->Write(limb->childIndex);
writer->Write(limb->siblingIndex);
}

View File

@ -1,15 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZTexture.h"
#include "ZDisplayList.h"
#include "ZSkeleton.h"
#include "ZLimb.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_SkeletonLimb : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,19 +0,0 @@
#include "TextExporter.h"
#include "../ZAPD/ZFile.h"
void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZText* txt = (ZText*)res;
WriteHeader(txt, outPath, writer, Ship::ResourceType::SOH_Text);
writer->Write((uint32_t)txt->messages.size());
for (size_t i = 0; i < txt->messages.size(); i++)
{
writer->Write(txt->messages[i].id);
writer->Write(txt->messages[i].textboxType);
writer->Write(txt->messages[i].textboxYPos);
writer->Write(txt->messages[i].msg);
}
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZText.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Text : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,32 +0,0 @@
#include "TextureExporter.h"
#include "../ZAPD/ZFile.h"
void OTRExporter_Texture::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZTexture* tex = (ZTexture*)res;
WriteHeader(tex, outPath, writer, Ship::ResourceType::Texture);
auto start = std::chrono::steady_clock::now();
//printf("Exporting Texture %s\n", tex->GetName().c_str());
writer->Write((uint32_t)tex->GetTextureType());
writer->Write((uint32_t)tex->GetWidth());
writer->Write((uint32_t)tex->GetHeight());
writer->Write((uint32_t)tex->GetRawDataSize());
if (tex->parent != nullptr) {
auto data = tex->parent->GetRawData();
writer->Write((char*)data.data() + tex->GetRawDataIndex(), tex->GetRawDataSize());
}
auto end = std::chrono::steady_clock::now();
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
//printf("Exported Texture %s in %zums\n", tex->GetName().c_str(), diff);
//if (diff > 2)
//printf("Export took %lms\n", diff);
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZTexture.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Texture : public OTRExporter
{
public:
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,25 +0,0 @@
#include "VersionInfo.h"
#include <libultraship/bridge.h>
std::map<Ship::ResourceType, uint32_t> resourceVersions;
void InitVersionInfo()
{
resourceVersions = std::map<Ship::ResourceType, uint32_t> {
{ Ship::ResourceType::SOH_Animation, 0 },
{ Ship::ResourceType::Texture, 0 },
{ Ship::ResourceType::SOH_PlayerAnimation, 0 },
{ Ship::ResourceType::DisplayList, 0 },
{ Ship::ResourceType::SOH_Room, 0 },
{ Ship::ResourceType::SOH_CollisionHeader, 0 },
{ Ship::ResourceType::SOH_Skeleton, 0 },
{ Ship::ResourceType::SOH_SkeletonLimb, 0 },
{ Ship::ResourceType::Matrix, 0 },
{ Ship::ResourceType::SOH_Path, 0 },
{ Ship::ResourceType::Vertex, 0 },
{ Ship::ResourceType::SOH_Cutscene, 0 },
{ Ship::ResourceType::Array, 0 },
{ Ship::ResourceType::SOH_Text, 0 },
{ Ship::ResourceType::Blob, 0 },
};
}

View File

@ -1,9 +0,0 @@
#pragma once
#include <map>
#include <vector>
#include "src/resource/Resource.h"
#define MAJOR_VERSION Ship::Version::Deckard
extern std::map<Ship::ResourceType, uint32_t> resourceVersions;

View File

@ -1,44 +0,0 @@
#include "VtxExporter.h"
#include <libultraship/bridge.h>
#include "VersionInfo.h"
void OTRExporter_Vtx::SaveArr(ZResource* res, const fs::path& outPath, const std::vector<ZResource*>& vec, BinaryWriter* writer)
{
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
for (auto& res: vec) {
ZVtx* vtx = (ZVtx*)res;
writer->Write(vtx->x);
writer->Write(vtx->y);
writer->Write(vtx->z);
writer->Write(vtx->flag);
writer->Write(vtx->s);
writer->Write(vtx->t);
writer->Write(vtx->r);
writer->Write(vtx->g);
writer->Write(vtx->b);
writer->Write(vtx->a);
}
}
void OTRExporter_Vtx::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZVtx* vtx = (ZVtx*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
writer->Write((uint32_t)1); //Yes I'm hard coding it to one, it *should* be fine.
writer->Write(vtx->x);
writer->Write(vtx->y);
writer->Write(vtx->z);
writer->Write(vtx->flag);
writer->Write(vtx->s);
writer->Write(vtx->t);
writer->Write(vtx->r);
writer->Write(vtx->g);
writer->Write(vtx->b);
writer->Write(vtx->a);
}

View File

@ -1,13 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZVtx.h"
#include "Exporter.h"
#include <Utils/BinaryWriter.h>
class OTRExporter_Vtx : public OTRExporter
{
public:
void SaveArr(ZResource* res, const fs::path& outPath, const std::vector<ZResource*>&, BinaryWriter* writer);
virtual void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,36 +0,0 @@
#ifndef COMMAND_MACROS_BASE_H
#define COMMAND_MACROS_BASE_H
/**
* Command Base macros intended for use in designing of more specific command macros
* Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word
*/
#define _SHIFTL(v, s, w) \
((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s)))
#define _SHIFTR(v, s, w) \
((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1)))
//#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
#define CMD_BBBB(a, b, c, d) (_SHIFTL(d, 24, 8) | _SHIFTL(c, 16, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))
//#define CMD_BBH(a, b, c) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16))
#define CMD_BBH(a, b, c) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 16))
//#define CMD_HBB(a, b, c) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 0, 8))
#define CMD_HBB(a, b, c) (_SHIFTL(c, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(a, 0, 16))
//#define CMD_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16))
#define CMD_HH(a, b) (_SHIFTL(b, 16, 16) | _SHIFTL(a, 0, 16))
#define CMD_W(a) (a)
#if defined(__GNUC__)
#define CMD_F(a) {.f = (a)}
#else
#define CMD_F(a) {(a)}
#endif
#define CMD_PTR(a) (u32)(a)
#endif

View File

@ -1,290 +0,0 @@
#ifndef Z64CUTSCENE_H
#define Z64CUTSCENE_H
#if 0
#include <libultraship/libultra.h>
typedef struct {
/* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger
/* 0x02 */ u8 ageRestriction; // 0 for adult only, 1 for child only, 2 for both ages
/* 0x03 */ u8 flag; // eventChkInf flag bound to the entrance cutscene
/* 0x04 */ void* segAddr; // segment offset location of the cutscene
} EntranceCutscene; // size = 0x8
typedef struct {
/* 0x00 */ s8 continueFlag;
/* 0x01 */ s8 cameraRoll;
/* 0x02 */ u16 nextPointFrame;
/* 0x04 */ f32 viewAngle; // in degrees
/* 0x08 */ Vec3s pos;
} CutsceneCameraPoint; // size = 0x10
typedef struct {
/* 0x00 */ Vec3f at;
/* 0x0C */ Vec3f eye;
/* 0x18 */ s16 roll;
/* 0x1A */ s16 fov;
} CutsceneCameraAngle; // size = 0x1C
typedef struct {
/* 0x0 */ CutsceneCameraPoint* atPoints;
/* 0x4 */ CutsceneCameraPoint* eyePoints;
/* 0x8 */ s16 relativeToPlayer;
} CutsceneCameraMove; // size = 0xC
typedef struct {
/* 0x00 */ u16 base;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdBase; // size = 0x6
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 setting;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdEnvLighting; // size = 0x6
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 sequence;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdMusicChange; // size = 0x6
typedef struct {
/* 0x00 */ u16 type;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdMusicFade; // size = 0x6
typedef struct {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
/* 0x06 */ u8 unk_06;
/* 0x07 */ u8 unk_07;
/* 0x08 */ u8 unk_08;
} CsCmdUnknown9; // size = 0xA
typedef struct {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
/* 0x06 */ u8 hour;
/* 0x07 */ u8 minute;
} CsCmdDayTime; // size = 0x8
typedef struct {
/* 0x00 */ u16 base;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
/* 0x06 */ u16 type;
/* 0x08 */ u16 textId1;
/* 0x0A */ u16 textId2;
} CsCmdTextbox; // size = 0xC
typedef struct {
/* 0x00 */ u16 action; // "dousa"
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
union {
/* 0x06 */ Vec3s rot;
/* 0x06 */ Vec3us urot;
};
/* 0x0C */ Vec3i startPos;
/* 0x18 */ Vec3i endPos;
/* 0x24 */ Vec3i normal;
} CsCmdActorAction; // size = 0x30
#endif
typedef enum {
CS_STATE_IDLE,
CS_STATE_SKIPPABLE_INIT,
CS_STATE_SKIPPABLE_EXEC,
CS_STATE_UNSKIPPABLE_INIT,
CS_STATE_UNSKIPPABLE_EXEC
} CutsceneState;
typedef enum {
CS_CMD_00 = 0x0000,
CS_CMD_CAM_EYE = 0x0001,
CS_CMD_CAM_AT = 0x0002,
CS_CMD_MISC = 0x0003,
CS_CMD_SET_LIGHTING = 0x0004,
CS_CMD_CAM_EYE_REL_TO_PLAYER = 0x0005,
CS_CMD_CAM_AT_REL_TO_PLAYER = 0x0006,
CS_CMD_07 = 0x0007,
CS_CMD_08 = 0x0008,
CS_CMD_09 = 0x0009,
CS_CMD_TEXTBOX = 0x0013,
CS_CMD_SET_PLAYER_ACTION = 0x000A,
CS_CMD_SET_ACTOR_ACTION_1 = 0x000F,
CS_CMD_SET_ACTOR_ACTION_2 = 0x000E,
CS_CMD_SET_ACTOR_ACTION_3 = 0x0019,
CS_CMD_SET_ACTOR_ACTION_4 = 0x001D,
CS_CMD_SET_ACTOR_ACTION_5 = 0x001E,
CS_CMD_SET_ACTOR_ACTION_6 = 0x002C,
CS_CMD_SET_ACTOR_ACTION_7 = 0x001F,
CS_CMD_SET_ACTOR_ACTION_8 = 0x0031,
CS_CMD_SET_ACTOR_ACTION_9 = 0x003E,
CS_CMD_SET_ACTOR_ACTION_10 = 0x008F,
CS_CMD_SCENE_TRANS_FX = 0x002D,
CS_CMD_NOP = 0x000B,
CS_CMD_PLAYBGM = 0x0056,
CS_CMD_STOPBGM = 0x0057,
CS_CMD_FADEBGM = 0x007C,
CS_CMD_SETTIME = 0x008C,
CS_CMD_TERMINATOR = 0x03E8,
CS_CMD_END = 0xFFFF
} CutsceneCmd;
/**
* Special type for blocks of cutscene data, asm-processor checks
* arrays for CutsceneData type and converts floats within the array
* to their IEEE-754 representation. The array must close with };
* on its own line.
*
* Files that contain this type that are included in other C files
* must include an 'EARLY' qualifier to inform asm-processor that it
* must recursively process that include.
*
* Example: #include "file.c" EARLY
*/
typedef union CutsceneData {
int i;
float f;
short s[2];
char b[4];
} CutsceneData;
#define CS_CMD_CONTINUE 0
#define CS_CMD_STOP -1
// TODO confirm correctness, clarify names
typedef enum {
/* 0x00 */ INVALID_DESTINATION_0,
/* 0x01 */ CUTSCENE_MAP_GANON_HORSE,
/* 0x02 */ CUTSCENE_MAP_THREE_GODESSES_POST_DEKU_TREE,
/* 0x03 */ GERUDO_VALLEY_DIN,
/* 0x04 */ DEATH_MOUNTAIN_TRAIL_NAYRU,
/* 0x05 */ KOKIRI_FOREST_FARORE,
/* 0x06 */ CUTSCENE_MAP_TRIFORCE_CREATION,
/* 0x07 */ KOKIRI_FOREST_RECEIVE_KOKIRI_EMERALD,
/* 0x08 */ TEMPLE_OF_TIME_AFTER_USE_MS,
/* 0x09 */ GERUDO_VALLEY_DIN_2,
/* 0x0A */ LINKS_HOUSE_INTRO,
/* 0x0B */ KOKIRI_FOREST_INTRO,
/* 0x0C */ DEATH_MOUNTAIN_TRAIL_AFTER_GORON_RUBY,
/* 0x0D */ ZORAS_FOUNTAIN_AFTER_ZORAS_SAPPHIRE,
/* 0x0E */ KOKIRI_FOREST_AFTER_KOKIRI_EMERALD,
/* 0x0F */ TEMPLE_OF_TIME_KOKIRI_EMERALD, //unused
/* 0x10 */ TEMPLE_OF_TIME_GORON_RUBY, //unused
/* 0x11 */ TEMPLE_OF_TIME_ZORAS_SAPPHIRE, //unused
/* 0x12 */ TEMPLE_OF_TIME_AFTER_USE_MS_FIRST,
/* 0x13 */ DEATH_MOUNTAIN_TRAIL_AFTER_INTRO,
/* 0x14 */ INVALID_DESTINATION_14,
/* 0x15 */ LAKE_HYLIA_WATER_RISES,
/* 0x16 */ DESERT_COLOSSUS_REQUIEM,
/* 0x17 */ CUTSCENE_MAP_CURSE_YOU,
/* 0x18 */ JABU_JABU_INTRO,
/* 0x19 */ CHAMBER_OF_SAGES_LIGHT_MEDALLION,
/* 0x1A */ TEMPLE_OF_TIME_KOKIRI_EMERALD_2, //duplicate of 0x000F
/* 0x1B */ TEMPLE_OF_TIME_GORON_RUBY_2, //duplicate of 0x0010
/* 0x1C */ TEMPLE_OF_TIME_ZORAS_SAPPHIRE_2, //duplicate of 0x0011
/* 0x1D */ CHAMBER_OF_SAGES_FOREST_MEDALLION,
/* 0x1E */ CHAMBER_OF_SAGES_FIRE_MEDALLION,
/* 0x1F */ CHAMBER_OF_SAGES_WATER_MEDALLION,
/* 0x20 */ HYRULE_FIELD_FLASHBACK, //lacs part 4
/* 0x21 */ HYRULE_FIELD_AFTER_LAKE_HYLIA_OWL,
/* 0x22 */ CUTSCENE_MAP_GANON_AFTER_USE_MS,
/* 0x23 */ HYRULE_FIELD_INTRO_ZELDA_ESCAPE,
/* 0x24 */ INVALID_DESTINATION_24,
/* 0x25 */ INVALID_DESTINATION_25,
/* 0x26 */ CUTSCENE_MAP_SHEIKAH_LEGEND, //lacs part 2
/* 0x27 */ TEMPLE_OF_TIME_ZELDA_REVEAL, //lacs part 3
/* 0x28 */ TEMPLE_OF_TIME_GET_LIGHT_ARROWS, //lacs part 5
/* 0x29 */ LAKE_HYLIA_AFTER_BLUE_WARP,
/* 0x2A */ KAKARIKO_VILLAGE_DRAIN_WELL,
/* 0x2B */ WINDMILL_AFTER_DRAIN_WELL,
/* 0x2C */ TEMPLE_OF_TIME_AFTER_DOOR_OF_TIME_OPENS,
/* 0x2D */ INVALID_DESTINATION_2D,
/* 0x2E */ TEMPLE_OF_TIME_AFTER_USE_MS_FIRST_2, // duplicate of 0x0012
/* 0x2F */ KAKARIKO_VILLAGE_NOCTURNE_PART_2,
/* 0x30 */ DESERT_COLOSSUS_AFTER_REQUIEM,
/* 0x31 */ TEMPLE_OF_TIME_AFTER_LIGHT_ARROWS,
/* 0x32 */ KAKARIKO_VILLAGE_AFTER_NOCTURNE,
/* 0x33 */ HYRULE_FIELD_IMPA_ESCORT_CS,
/* 0x34 */ TEMPLE_OF_TIME_SONG_OF_TIME,
/* 0x35 */ HYRULE_FIELD_AFTER_SONG_OF_TIME,
/* 0x36 */ GERUDO_VALLEY_CREDITS,
/* 0x37 */ GERUDO_FORTRESS_CREDITS,
/* 0x38 */ KAKARIKO_VILLAGE_CREDITS,
/* 0x39 */ DEATH_MOUNTAIN_TRAIL_CREDITS_1,
/* 0x3A */ GORON_CITY_CREDITS, // unused?
/* 0x3B */ LAKE_HYLIA_CREDITS,
/* 0x3C */ ZORAS_FOUNTAIN_CREDITS, // unused
/* 0x3D */ ZORAS_DOMAIN_CREDITS,
/* 0x3E */ KOKIRI_FOREST_CREDITS_1,
/* 0x3F */ KOKIRI_FOREST_CREDITS_2,
/* 0x40 */ HYRULE_FIELD_CREDITS,
/* 0x41 */ LON_LON_RANCH_CREDITS_1,
/* 0x42 */ KAKARIKO_VILLAGE_AFTER_TRAIL_OWL,
/* 0x43 */ HTRULE_FIELD_UNUSED_ENTRANCE,
/* 0x44 */ CUTSCENE_MAP_FIRE,
/* 0x45 */ KOKIRI_FOREST_POST_FOREST_MEDALLION,
/* 0x46 */ DEATH_MOUNTAIN_TRAIL_CREDITS_2,
/* 0x47 */ TEMPLE_OF_TIME_CREDITS,
/* 0x48 */ ZELDAS_COURTYARD_CREDITS,
/* 0x49 */ LON_LON_RANCH_CREDITS_1_2, // duplicate of 0x0041
/* 0x4A */ LON_LON_RANCH_CREDITS_2,
/* 0x4B */ LON_LON_RANCH_CREDITS_3,
/* 0x4C */ LON_LON_RANCH_CREDITS_4,
/* 0x4D */ LON_LON_RANCH_CREDITS_5,
/* 0x4E */ LON_LON_RANCH_CREDITS_6,
/* 0x4F */ LON_LON_RANCH_NO_CS_1,
/* 0x50 */ LON_LON_RANCH_NO_CS_2,
/* 0x51 */ LON_LON_RANCH_NO_CS_3,
/* 0x52 */ LON_LON_RANCH_NO_CS_4,
/* 0x53 */ LON_LON_RANCH_NO_CS_5,
/* 0x54 */ LON_LON_RANCH_NO_CS_6,
/* 0x55 */ LON_LON_RANCH_NO_CS_7,
/* 0x56 */ LON_LON_RANCH_NO_CS_8,
/* 0x57 */ LON_LON_RANCH_NO_CS_9,
/* 0x58 */ LON_LON_RANCH_NO_CS_10,
/* 0x59 */ LON_LON_RANCH_NO_CS_11,
/* 0x5A */ LON_LON_RANCH_NO_CS_12,
/* 0x5B */ LON_LON_RANCH_NO_CS_13,
/* 0x5C */ LON_LON_RANCH_NO_CS_14,
/* 0x5D */ LON_LON_RANCH_NO_CS_15,
/* 0x5E */ LON_LON_RANCH_NO_CS_EPONAS_SONG,
/* 0x5F */ CONDITIONAL_DESTINATION, // TODO more descriptive name?
/* 0x60 */ DESERT_COLOSSUS_SPIRIT_BLUE_WARP,
/* 0x61 */ GRAVEYARD_AFTER_SHADOW_BLUE_WARP,
/* 0x62 */ DEATH_MOUNTAIN_CRATER_AFTER_FIRE_BLUE_WARP,
/* 0x63 */ SACRED_FOREST_MEADOW_AFTER_FOREST_BLUE_WARP,
/* 0x64 */ KOKIRI_FOREST_AFTER_FOREST_BLUE_WARP,
/* 0x65 */ DESERT_COLOSSUS_AFTER_SILVER_GAUNTLETS,
/* 0x66 */ TEMPLE_OF_TIME_FRONT_OF_PEDESTAL,
/* 0x67 */ HYRULE_FIELD_TITLE_SCREEN,
/* 0x68 */ SPIRIT_TEMPLE_BOSS_TITLE_SCREEN,
/* 0x69 */ GRAVEYARD_SUNS_SONG,
/* 0x6A */ ROYAL_FAMILYS_TOMB_SUNS_SONG,
/* 0x6B */ GANONS_CASTLE_AFTER_FOREST_TRIAL,
/* 0x6C */ GANONS_CASTLE_AFTER_WATER_TRIAL,
/* 0x6D */ GANONS_CASTLE_AFTER_SHADOW_TRIAL,
/* 0x6E */ GANONS_CASTLE_AFTER_FIRE_TRIAL,
/* 0x6F */ GANONS_CASTLE_AFTER_LIGHT_TRIAL,
/* 0x70 */ GANONS_CASTLE_AFTER_SPIRIT_TRIAL,
/* 0x71 */ GANONS_CASTLE_DISPEL_BARRIER_IF_CONDITIONS,
/* 0x72 */ HYRULE_FIELD_INTRO,
/* 0x73 */ HYRULE_FIELD_AFTER_IMPA_ESCORT,
/* 0x74 */ DESERT_COLOSSUS_SPIRIT_BLUE_WARP_2,
/* 0x75 */ HYRULE_FIELD_SKY,
/* 0x76 */ GANON_BATTLE_TOWER_COLLAPSE,
/* 0x77 */ ZELDAS_COURTYARD_RECEIVE_LETTER
} CutsceneTerminatorDestination;
#endif

View File

@ -1,448 +0,0 @@
#ifndef Z64CUTSCENE_COMMANDS_H
#define Z64CUTSCENE_COMMANDS_H
#include "command_macros_base.h"
#include "z64cutscene.h"
/**
* ARGS
* s32 totalEntries (e), s32 endFrame (n)
* FORMAT
* eeeeeeee nnnnnnnn
* size = 0x8
*/
#define CS_BEGIN_CUTSCENE(totalEntries, endFrame) CMD_W(totalEntries), CMD_W(endFrame)
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* 00000001 0001ssss eeee0000
* size = 0xC
*/
#define CS_CAM_POS_LIST CS_CAM_EYE_LIST
#define CS_CAM_EYE_LIST(startFrame, endFrame) \
CS_CMD_CAM_EYE, CMD_HH(0x0001, startFrame), CMD_HH(endFrame, 0x0000)
/**
* ARGS
* s8 continueFlag (c), s8 roll (r), s16 frame (f), f32 viewAngle (a),
* s16 xPos (x), s16 yPos (y), s16 zPos (z)
* FORMAT
* Capital U is Unused
* ccrrffff aaaaaaaa xxxxyyyy zzzzUUUU
* size = 0x10
*/
#define CS_CAM_POS CS_CAM_EYE
#define CS_CAM_EYE(continueFlag, roll, frame, viewAngle, xPos, yPos, zPos, unused) \
CMD_BBH(continueFlag, roll, frame), CMD_F(viewAngle), CMD_HH(xPos, yPos), CMD_HH(zPos, unused)
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* 00000002 0001ssss eeee0000
* size = 0xC
*/
#define CS_CAM_FOCUS_POINT_LIST CS_CAM_AT_LIST
#define CS_CAM_AT_LIST(startFrame, endFrame) \
CS_CMD_CAM_AT, CMD_HH(0x0001, startFrame), CMD_HH(endFrame, 0x0000)
/**
* ARGS
* s8 continueFlag (c), s8 roll (r), s16 frame (f), f32 viewAngle (a),
* s16 xPos (x), s16 yPos (y), s16 zPos (z)
* FORMAT
* Capital U is Unused
* ccrrffff aaaaaaaa xxxxyyyy zzzzUUUU
* size = 0x10
*/
#define CS_CAM_FOCUS_POINT CS_CAM_AT
#define CS_CAM_AT(continueFlag, roll, frame, viewAngle, xPos, yPos, zPos, unused) \
CMD_BBH(continueFlag, roll, frame), CMD_F(viewAngle), CMD_HH(xPos, yPos), CMD_HH(zPos, unused)
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000003 eeeeeeee
* size = 0x8
*/
#define CS_MISC_LIST(entries) CS_CMD_MISC, CMD_W(entries)
/**
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* uuuussss eeeeUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU
* size = 0x30
*/
#define CS_MISC(unk, startFrame, endFrame, unused0, unused1, unused2, unused3, unused4, unused5, unused6, unused7, unused8, unused9, unused10) \
CMD_HH(unk, startFrame), CMD_HH(endFrame, unused0), \
CMD_W(unused1), CMD_W(unused2), CMD_W(unused3), CMD_W(unused4), CMD_W(unused5), \
CMD_W(unused6), CMD_W(unused7), CMD_W(unused8), CMD_W(unused9), CMD_W(unused10)
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000004 eeeeeeee
* size = 0x8
*/
#define CS_LIGHTING_LIST(entries) CS_CMD_SET_LIGHTING, CMD_W(entries)
/**
* ARGS
* s16 setting (m), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* mmmmssss eeeeUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU 00000000 00000000 00000000
* size = 0x30
*/
#define CS_LIGHTING(setting, startFrame, endFrame, unused0, unused1, unused2, unused3, unused4, unused5, unused6, unused7) \
CMD_HH(setting, startFrame), CMD_HH(endFrame, unused0), \
CMD_W(unused1), CMD_W(unused2), CMD_W(unused3), CMD_W(unused4), CMD_W(unused5), \
CMD_W(unused6), CMD_W(unused7), 0x00000000, 0x00000000, 0x00000000
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused , may be consistently zero
* 00000005 0001ssss eeee0000
* size = 0xC
*/
#define CS_CAM_POS_PLAYER_LIST CS_CAM_EYE_REL_TO_PLAYER_LIST
#define CS_CAM_EYE_REL_TO_PLAYER_LIST(startFrame, endFrame) \
CS_CMD_CAM_EYE_REL_TO_PLAYER, CMD_HH(0x0001, startFrame), CMD_HH(endFrame, 0x0000)
/**
* ARGS
* s8 continueFlag (c), s8 roll (r), s16 frame (f), f32 viewAngle (a),
* s16 xPos (x), s16 yPos (y), s16 zPos (z)
* FORMAT
* Capital U is Unused
* ccrrffff aaaaaaaa xxxxyyyy zzzzUUUU
* size = 0x10
*/
#define CS_CAM_POS_PLAYER CS_CAM_EYE_REL_TO_PLAYER
#define CS_CAM_EYE_REL_TO_PLAYER(continueFlag, roll, frame, viewAngle, xPos, yPos, zPos, unused) \
CMD_BBH(continueFlag, roll, frame), CMD_F(viewAngle), CMD_HH(xPos, yPos), CMD_HH(zPos, unused)
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused , may be consistently zero
* 00000006 0001ssss eeee0000
* size = 0xC
*/
#define CS_CAM_FOCUS_POINT_PLAYER_LIST CS_CAM_AT_REL_TO_PLAYER_LIST
#define CS_CAM_AT_REL_TO_PLAYER_LIST(startFrame, endFrame) \
CS_CMD_CAM_AT_REL_TO_PLAYER, CMD_HH(0x0001, startFrame), CMD_HH(endFrame, 0x0000)
/**
* ARGS
* s8 continueFlag (c), s8 roll (r), s16 frame (f), f32 viewAngle (a),
* s16 xPos (x), s16 yPos (y), s16 zPos (z)
* FORMAT
* Capital U is Unused
* ccrrffff aaaaaaaa xxxxyyyy zzzzUUUU
* size = 0x10
*/
#define CS_CAM_FOCUS_POINT_PLAYER CS_CAM_AT_REL_TO_PLAYER
#define CS_CAM_AT_REL_TO_PLAYER(continueFlag, roll, frame, viewAngle, xPos, yPos, zPos, unused) \
CMD_BBH(continueFlag, roll, frame), CMD_F(viewAngle), CMD_HH(xPos, yPos), CMD_HH(zPos, unused)
/**
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* 00000007 uuuussss eeeeUUUU
* size = 0xC
*/
#define CS_CMD_07_LIST(unk, startFrame, endFrame, unused) \
CS_CMD_07, CMD_HH(unk, startFrame), CMD_HH(endFrame, unused)
/**
* ARGS
* s8 continueFlag (c), s8 roll (r), s16 frame (f), f32 viewAngle (a),
* s16 xPos (x), s16 yPos (y), s16 zPos (z)
* FORMAT
* Capital U is Unused
* ccrrffff aaaaaaaa xxxxyyyy zzzzUUUU
* size = 0x10
*/
#define CS_CMD_07(continueFlag, roll, frame, viewAngle, xPos, yPos, zPos, unused) \
CMD_BBH(continueFlag, roll, frame), CMD_F(viewAngle), CMD_HH(xPos, yPos), CMD_HH(zPos, unused)
/**
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* 00000008 uuuussss eeeeUUUU
* size = 0xC
*/
#define CS_CMD_08_LIST(unk, startFrame, endFrame, unused) \
CS_CMD_08, CMD_HH(unk, startFrame), CMD_HH(endFrame, unused)
/**
* ARGS
* s8 continueFlag (c), s8 roll (r), s16 frame (f), f32 viewAngle (a),
* s16 xPos (x), s16 yPos (y), s16 zPos (z)
* FORMAT
* Capital U is Unused
* ccrrffff aaaaaaaa xxxxyyyy zzzzUUUU
* size = 0x10
*/
#define CS_CMD_08(continueFlag, roll, frame, viewAngle, xPos, yPos, zPos, unused) \
CMD_BBH(continueFlag, roll, frame), CMD_F(viewAngle), CMD_HH(xPos, yPos), CMD_HH(zPos, unused)
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000009 eeeeeeee
* size = 0x8
*/
#define CS_CMD_09_LIST(entries) CS_CMD_09, CMD_W(entries)
/**
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e), s16 unk2 (v), s16 unk3 (w), s16 unk4 (x)
* FORMAT
* Capital U is Unused
* uuuussss eeeevvww xxUUUUUU
* size = 0xC
*/
#define CS_CMD_09(unk, startFrame, endFrame, unk2, unk3, unk4, unused0, unused1) \
CMD_HH(unk, startFrame), CMD_HBB(endFrame, unk2, unk3), CMD_BBH(unk4, unused0, unused1)
/**
* ARGS
* s32 cmdType (c), s32 entries (e)
* FORMAT
* cccccccc eeeeeeee
* size = 0x8
*/
#define CS_UNK_DATA_LIST(cmdType, entries) CMD_W(cmdType), CMD_W(entries)
/**
* ARGS
* s32 unk1 (a), s32 unk2 (b), s32 unk3 (c), s32 unk4 (d), s32 unk5 (e), s32 unk6 (f),
* s32 unk7 (g), s32 unk8 (h), s32 unk9 (i), s32 unk10 (j), s32 unk11 (k), s32 unk12 (l)
* FORMAT
* aaaaaaaa bbbbbbbb cccccccc dddddddd eeeeeeee ffffffff gggggggg hhhhhhhh iiiiiiii jjjjjjjj kkkkkkkk llllllll
* size = 0x30
*/
#define CS_UNK_DATA(unk1, unk2, unk3, unk4, unk5, unk6, unk7, unk8, unk9, unk10, unk11, unk12) \
CMD_W(unk1), CMD_W(unk2), CMD_W(unk3), CMD_W(unk4), CMD_W(unk5), CMD_W(unk6), \
CMD_W(unk7), CMD_W(unk8), CMD_W(unk9), CMD_W(unk10), CMD_W(unk11), CMD_W(unk12)
/**
* ARGS
* s32 cmdType (c), s32 entries (e)
* FORMAT
* cccccccc eeeeeeee
* size = 0x8
*/
#define CS_NPC_ACTION_LIST(cmdType, entries) CMD_W(cmdType), CMD_W(entries)
/**
* ARGS
* s16 npcAction (a), s16 startFrame (s), s16 endFrame (e),
* s16 rotX (u), s16 rotY (v), s16 rotZ (w),
* s32 startX (i), s32 startY (j), s32 startZ (k),
* s32 endX (l), s32 endY (m), s32 endZ (n),
* f32 normX (x), f32 normY (y), f32 normZ (z),
* FORMAT
* aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz
* size = 0x30
*/
#define CS_NPC_ACTION(npcAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
CMD_HH(npcAction, startFrame), CMD_HH(endFrame, rotX), CMD_HH(rotY, rotZ), \
CMD_W(startX), CMD_W(startY), CMD_W(startZ), \
CMD_W(endX), CMD_W(endY), CMD_W(endZ), \
CMD_F(normX), CMD_F(normY), CMD_F(normZ)
/**
* ARGS
* s32 cmdType (c), s32 entries (e)
* FORMAT
* cccccccc eeeeeeee
* size = 0x8
*/
#define CS_PLAYER_ACTION_LIST(entries) CS_CMD_SET_PLAYER_ACTION, CMD_W(entries)
/**
* ARGS
* s16 linkAction (a), s16 startFrame (s), s16 endFrame (e),
* s16 rotX (u), s16 rotY (v), s16 rotZ (w),
* s32 startX (i), s32 startY (j), s32 startZ (k),
* s32 endX (l), s32 endY (m), s32 endZ (n),
* f32 normX (x), f32 normY (y), f32 normZ (z),
* FORMAT
* aaaassss eeeeuuuu vvvvwwww iiiiiiii jjjjjjjj kkkkkkkk llllllll mmmmmmmm nnnnnnnn xxxxxxxx yyyyyyyy zzzzzzzz
* size = 0x30
*/
#define CS_PLAYER_ACTION(linkAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ) \
CS_NPC_ACTION(linkAction, startFrame, endFrame, rotX, rotY, rotZ, startX, startY, startZ, endX, endY, endZ, normX, normY, normZ)
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000013 eeeeeeee
* size = 0x8
*/
#define CS_TEXT_LIST(entries) CS_CMD_TEXTBOX, CMD_W(entries)
/**
* ARGS
* s16 messageId (i), s16 startFrame (s), s16 endFrame (e), s16 type (o),
* s16 topOptionBranch (y), s16 bottomOptionBranch (n)
* FORMAT
* iiiissss eeeeoooo yyyynnnn
* size = 0xC
*/
#define CS_TEXT_DISPLAY_TEXTBOX(messageId, startFrame, endFrame, type, topOptionBranch, bottomOptionBranch) \
CMD_HH(messageId, startFrame), CMD_HH(endFrame, type), CMD_HH(topOptionBranch, bottomOptionBranch)
/**
* ARGS
* s16 startFrame (s), s16 endFrame (e)
* FORMAT
* FFFFssss eeeeFFFF FFFFFFFF
* size = 0xC
*/
#define CS_TEXT_NONE(startFrame, endFrame) \
CS_TEXT_DISPLAY_TEXTBOX(0xFFFF, startFrame, endFrame, 0xFFFF, 0xFFFF, 0xFFFF)
/**
* ARGS
* s16 ocarinaSongAction (o), s16 startFrame (s), s16 endFrame (e), s16 topOptionBranch (i)
* FORMAT
* oooossss eeee0002 iiiiFFFF
* size = 0xC
*/
#define CS_TEXT_LEARN_SONG(ocarinaSongAction, startFrame, endFrame, messageId) \
CS_TEXT_DISPLAY_TEXTBOX(ocarinaSongAction, startFrame, endFrame, 0x0002, messageId, 0xFFFF)
/**
* ARGS
* s16 transitionType (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused , endFrame duplicate
* 0000002D 00000001 ttttssss eeeeUUUU
* size = 0x10
*/
#define CS_SCENE_TRANS_FX(transitionType, startFrame, endFrame) \
CS_CMD_SCENE_TRANS_FX, 0x00000001, CMD_HH(transitionType, startFrame), CMD_HH(endFrame, endFrame)
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000056 eeeeeeee
* size = 0x8
*/
#define CS_PLAY_BGM_LIST(entries) CS_CMD_PLAYBGM, CMD_W(entries)
/**
* ARGS
* s16 sequence (q), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* qqqqssss eeeeUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU 00000000 00000000 00000000
* size = 0x30
*/
#define CS_PLAY_BGM(sequence, startFrame, endFrame, unused0, unused1, unused2, unused3, unused4, unused5, unused6, unused7) \
CMD_HH(sequence, startFrame), CMD_HH(endFrame, unused0), \
CMD_W(unused1), CMD_W(unused2), CMD_W(unused3), CMD_W(unused4), CMD_W(unused5), \
CMD_W(unused6), CMD_W(unused7), 0x00000000, 0x00000000, 0x00000000
/**
* ARGS
* s32 entries (e)
* FORMAT
* 00000057 eeeeeeee
* size = 0x8
*/
#define CS_STOP_BGM_LIST(entries) CS_CMD_STOPBGM, CMD_W(entries)
/**
* ARGS
* s16 sequence (q), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* uuqqssss eeeeUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU 00000000 00000000 00000000
* size = 0x30
*/
#define CS_STOP_BGM(sequence, startFrame, endFrame, unused0, unused1, unused2, unused3, unused4, unused5, unused6, unused7) \
CMD_HH(sequence, startFrame), CMD_HH(endFrame, unused0), \
CMD_W(unused1), CMD_W(unused2), CMD_W(unused3), CMD_W(unused4), CMD_W(unused5), \
CMD_W(unused6), CMD_W(unused7), 0x00000000, 0x00000000, 0x00000000
/**
* ARGS
* s32 entries (e)
* FORMAT
* 0000007C eeeeeeee
* size = 0x8
*/
#define CS_FADE_BGM_LIST(entries) CS_CMD_FADEBGM, CMD_W(entries)
/**
* ARGS
* s16 fadeType (t), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused
* ttttssss eeeeUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU UUUUUUUU 00000000 00000000 00000000
* size = 0x30
*/
#define CS_FADE_BGM(fadeType, startFrame, endFrame, unused0, unused1, unused2, unused3, unused4, unused5, unused6, unused7) \
CMD_HH(fadeType, startFrame), CMD_HH(endFrame, unused0), \
CMD_W(unused1), CMD_W(unused2), CMD_W(unused3), CMD_W(unused4), CMD_W(unused5), \
CMD_W(unused6), CMD_W(unused7), 0x00000000, 0x00000000, 0x00000000
/**
* ARGS
* s32 entries (e)
* FORMAT
* 0000008C eeeeeeee
* size = 0x8
*/
#define CS_TIME_LIST(entries) CS_CMD_SETTIME, CMD_W(entries)
/**
* ARGS
* s16 unk (u), s16 startFrame (s), s16 endFrame (e), s8 hour (h), s8 min (m)
* FORMAT
* Capital U is Unused
* uuuussss eeeehhmm UUUUUUUU
* size = 0xC
*/
#define CS_TIME(unk, startFrame, endFrame, hour, min, unused) \
CMD_HH(unk, startFrame), \
CMD_HBB(endFrame, hour, min), \
CMD_W(unused)
/**
* ARGS
* CutsceneTerminatorDestination dest (d), s16 startFrame (s), s16 endFrame (e)
* FORMAT
* Capital U is Unused , endFrame duplicate
* 000003E8 00000001 ddddssss eeeeUUUU
* size = 0x10
*/
#define CS_TERMINATOR(dest, startFrame, endFrame) \
CS_CMD_TERMINATOR, 0x00000001, CMD_HH(dest, startFrame), CMD_HH(endFrame, endFrame)
/**
* Marks the end of a cutscene
*/
#define CS_END() 0xFFFFFFFF, 0x00000000
#endif

View File

@ -1,16 +0,0 @@
{
"file1": "File 1",
"file2": "File 2",
"file3": "File 3",
"options": "Options",
"copy": "Copy",
"erase": "Erase",
"quit": "Quit",
"confirm": "Yes",
"audio_stereo": "Sound - Stereo",
"audio_mono": "Sound - Mono",
"audio_headset": "Sound - Headset",
"audio_surround": "Sound - Surround",
"target_switch": "Targetting Mode - Switch",
"target_hold": "Targetting Mode - Hold"
}

View File

@ -1,16 +0,0 @@
{
"file1": "Fichier 1",
"file2": "Fichier 2",
"file3": "Fichier 3",
"options": "Options",
"copy": "Copier",
"erase": "Effacer",
"quit": "Retour",
"confirm": "Oui",
"audio_stereo": "Son - Stéréo",
"audio_mono": "Son - Mono",
"audio_headset": "Son - Casque",
"audio_surround": "Son - Surround",
"target_switch": "Visée - Fixe",
"target_hold": "Visée - Maintenue"
}

View File

@ -1,16 +0,0 @@
{
"file1": "Datei 1",
"file2": "Datei 2",
"file3": "Datei 3",
"options": "Optionen",
"copy": "Kopieren",
"erase": "Löschen",
"quit": "Zurück",
"confirm": "Ja",
"audio_stereo": "Sound - Stereo",
"audio_mono": "Sound - Mono",
"audio_headset": "Sound - Kopfhörer",
"audio_surround": "Sound - Surround",
"target_switch": "Zielerfassung - Einmal drücken",
"target_hold": "Zielerfassung - Trigger halten"
}

View File

@ -1,18 +0,0 @@
{
"minutes_plural" : "$0 minutes",
"minutes_singular" : "$0 minute",
"seconds_plural" : "$0 seconds",
"seconds_singular" : "$0 second",
"input_button_a": "the A button",
"input_button_b": "the B button",
"input_button_c": "the C button",
"input_button_l": "the L button",
"input_button_r": "the R button",
"input_button_z": "the Z button",
"input_button_c_up": "C Up",
"input_button_c_down": "C Down",
"input_button_c_left": "C Left",
"input_button_c_right": "C Right",
"input_analog_stick": "the Analog Stick",
"input_d_pad": "the D-Pad"
}

View File

@ -1,18 +0,0 @@
{
"minutes_plural" : "$0 minutes",
"minutes_singular" : "$0 minute",
"seconds_plural" : "$0 secondes",
"seconds_singular" : "$0 seconde",
"input_button_a": "le bouton A",
"input_button_b": "le bouton B",
"input_button_c": "le bouton C",
"input_button_l": "le bouton L",
"input_button_r": "le bouton R",
"input_button_z": "le bouton Z",
"input_button_c_up": "C Haut",
"input_button_c_down": "C Bas",
"input_button_c_left": "C Gauche",
"input_button_c_right": "C Droit",
"input_analog_stick": "le Stick Analogique",
"input_d_pad": "D-Pad"
}

View File

@ -1,18 +0,0 @@
{
"minutes_plural" : "$0 Minuten",
"minutes_singular" : "eine Minute",
"seconds_plural" : "$0 Sekunden",
"seconds_singular" : "eine Sekunde",
"input_button_a": "den A-Knopf",
"input_button_b": "den B-Knopf",
"input_button_c": "den C-Knopf",
"input_button_l": "den L-Knopf",
"input_button_r": "den R-Knopf",
"input_button_z": "den Z-Knopf",
"input_button_c_up": "C Oben",
"input_button_c_down": "C Unten",
"input_button_c_left": "C Links",
"input_button_c_right": "C Rechts",
"input_analog_stick": "den Analog-Stick",
"input_d_pad": "das Steuerkreuz"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,54 +0,0 @@
#!/usr/bin/env python3
import os, sys, shutil
import shutil
from rom_info import Z64Rom
import rom_chooser
import struct
import subprocess
import argparse
def BuildOTR(xmlPath, rom, zapd_exe=None, genHeaders=None):
shutil.copytree("assets", "Extract/assets")
if not zapd_exe:
zapd_exe = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out"
exec_cmd = [zapd_exe, "ed", "-i", xmlPath, "-b", rom, "-fl", "CFG/filelists",
"-o", "placeholder", "-osf", "placeholder", "-rconf", "CFG/Config.xml"]
# generate headers, but not otrs by excluding the otr exporter
if genHeaders:
exec_cmd.extend(["-gsf", "1"])
else:
# generate otrs, but not headers
exec_cmd.extend(["-gsf", "0", "-se", "OTR", "--otrfile",
"oot-mq.otr" if Z64Rom.isMqRom(rom) else "oot.otr"])
print(exec_cmd)
exitValue = subprocess.call(exec_cmd)
if exitValue != 0:
print("\n")
print("Error when building the OTR file...", file=os.sys.stderr)
print("Aborting...", file=os.sys.stderr)
print("\n")
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-z", "--zapd", help="Path to ZAPD executable", dest="zapd_exe", type=str)
parser.add_argument("rom", help="Path to the rom", type=str, nargs="?")
parser.add_argument("--non-interactive", help="Runs the script non-interactively for use in build scripts.", dest="non_interactive", action="store_true")
parser.add_argument("-v", "--verbose", help="Display rom's header checksums and their corresponding xml folder", dest="verbose", action="store_true")
parser.add_argument("--gen-headers", help="Generate source headers to be checked in", dest="gen_headers", action="store_true")
args = parser.parse_args()
roms = [ Z64Rom(args.rom) ] if args.rom else rom_chooser.chooseROM(args.verbose, args.non_interactive)
for rom in roms:
if (os.path.exists("Extract")):
shutil.rmtree("Extract")
BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom.file_path, zapd_exe=args.zapd_exe, genHeaders=args.gen_headers)
if __name__ == "__main__":
main()

View File

@ -1,53 +0,0 @@
#!/usr/bin/python3
import os
import sys
import struct
from multiprocessing import Pool, cpu_count
from rom_info import Z64Rom
import rom_chooser
rom = None
def initialize_worker(input_rom):
global rom
rom = input_rom
def ExtractFunc(i):
dma_file = rom.getDmaEntryByIndex(i)
dma_data = rom.readDmaEntry(dma_file)
filename = '../soh/baserom/' + rom.version.file_table[i]
print('extracting ' + filename + " (0x%08X, 0x%08X)" % (dma_file.virtStart, dma_file.virtEnd))
try:
with open(filename, 'wb') as f:
f.write(dma_data)
except IOError:
print('failed to write file ' + filename)
# TODO: handle this better
if dma_file.compressed:
os.system('tools/yaz0 -d ' + filename + ' ' + filename)
#####################################################################
def main():
try:
os.mkdir('../soh/baserom')
except:
pass
rom_path = rom_chooser.chooseROM()
input_rom = Z64Rom(rom_path)
# extract files
num_cores = cpu_count()
print("Extracting baserom with " + str(num_cores) + " CPU cores.")
with Pool(num_cores, initialize_worker, (input_rom,)) as p:
p.map(ExtractFunc, range(len(input_rom.version.file_table)))
if __name__ == "__main__":
main()

View File

@ -1,8 +0,0 @@
{
"MQDebug": {
"bankdefs": [1281424, 128],
"fontdefs": [1278576, 624],
"fontmaps": [1279200, 448],
"seqdefs": [1279648, 1776]
}
}

View File

@ -1,54 +0,0 @@
import os, sys, glob
from rom_info import Z64Rom
def chooseROM(verbose=False, non_interactive=False):
roms = []
for file in glob.glob("*.z64"):
rom = Z64Rom(file)
if rom.is_valid:
roms.append(rom)
if not (roms):
print("Error: No roms located, place one in the OTRExporter directory", file=os.sys.stderr)
sys.exit(1)
if (len(roms) == 1):
return roms
if non_interactive:
mq_rom = None
non_mq_rom = None
for rom in roms:
if rom.isMq and mq_rom is None:
mq_rom = rom
elif not rom.isMq and non_mq_rom is None:
non_mq_rom = rom
return [rom for rom in [non_mq_rom, mq_rom] if rom is not None]
print(f"{len(roms)} roms found, please select one by pressing 1-{len(roms)}")
print()
for i in range(len(roms)):
print(f"[{i+1:>2d}] {roms[i].file_path}")
if verbose:
print(f" Checksum: {roms[i].checksum.value}, Version XML: {roms[i].version.xml_ver}")
print()
while(1):
try:
selection = int(input())
except KeyboardInterrupt:
sys.exit(1)
except:
print("Bad input. Try again with the number keys.")
continue
if (selection < 1 or selection > len(roms)):
print("Bad input. Try again.")
continue
else: break
return [ roms[selection - 1] ]

View File

@ -1,97 +0,0 @@
from enum import Enum
from tabnanny import check
import struct
class Checksums(Enum):
OOT_NTSC_10 = "EC7011B7"
OOT_NTSC_11 = "D43DA81F"
OOT_NTSC_12 = "693BA2AE"
OOT_PAL_10 = "B044B569"
OOT_PAL_11 = "B2055FBD"
OOT_NTSC_JP_GC_CE = "F7F52DB8"
OOT_NTSC_JP_GC = "F611F4BA"
OOT_NTSC_US_GC = "F3DD35BA"
OOT_PAL_GC = "09465AC3"
OOT_NTSC_JP_MQ = "F43B45BA"
OOT_NTSC_US_MQ = "F034001A"
OOT_PAL_MQ = "1D4136F3"
OOT_PAL_GC_DBG1 = "871E1C92"
OOT_PAL_GC_DBG2 = "87121EFE"
OOT_PAL_GC_MQ_DBG = "917D18F6"
OOT_IQUE_TW = "3D81FB3E"
OOT_IQUE_CN = "B1E1E07B"
OOT_UNKNOWN = "FFFFFFFF"
@classmethod
def has_value(self, value):
return value in self._value2member_map_
class RomVersion:
def __init__(self, file_table_path, file_table_off, xml_ver):
self.file_table_off = file_table_off
self.xml_ver = xml_ver
with open(file_table_path, 'r') as f:
self.file_table = [line.strip('\n') for line in f]
ROM_INFO_TABLE = dict()
ROM_INFO_TABLE[Checksums.OOT_PAL_GC] = RomVersion("CFG/filelists/gamecube_pal.txt", 0x7170, "GC_NMQ_PAL_F")
ROM_INFO_TABLE[Checksums.OOT_PAL_GC_DBG1] = RomVersion("CFG/filelists/dbg.txt", 0x12F70, "GC_NMQ_D")
ROM_INFO_TABLE[Checksums.OOT_PAL_GC_MQ_DBG] = RomVersion("CFG/filelists/dbg.txt", 0x12F70, "GC_MQ_D")
class RomDmaEntry:
def __init__(self, rom, i):
off = rom.version.file_table_off + 16 * i
(self.virtStart, \
self.virtEnd, \
self.physStart, \
self.physEnd) = struct.unpack('>IIII', rom.rom_data[off:off+4*4])
self.compressed = self.physEnd != 0
self.size = self.physEnd - self.physStart \
if self.compressed \
else self.virtEnd - self.virtStart
self.name = rom.version.file_table[i]
class Z64Rom:
def __init__(self, file_path):
self.file_path = file_path
with open(file_path, 'rb') as f:
self.rom_data = f.read()
self.is_valid = len(self.rom_data) > 20 * 1024 * 1024
if not self.is_valid:
return
# get checkum
checksum_str = self.rom_data[16:16+4].hex().upper()
self.checksum = Checksums(checksum_str) if Checksums.has_value(checksum_str) else Checksums.OOT_UNKNOWN
if self.checksum == Checksums.OOT_UNKNOWN:
self.is_valid = False
return
if self.checksum in [Checksums.OOT_NTSC_JP_MQ, Checksums.OOT_NTSC_US_MQ, Checksums.OOT_PAL_GC_MQ_DBG, Checksums.OOT_PAL_MQ]:
self.isMq = True
else:
self.isMq = False
# get rom version
self.version = ROM_INFO_TABLE[self.checksum]
def getDmaEntryByIndex(self, i):
return RomDmaEntry(self, i)
def readDmaEntry(self, entry):
return self.rom_data[entry.physStart:entry.physStart + entry.size]
@staticmethod
def isValidRom(rom_path):
return Z64Rom(rom_path).is_valid
@staticmethod
def isMqRom(rom_path):
return Z64Rom(rom_path).isMq

26
OTRGui/.gitignore vendored
View File

@ -1,26 +0,0 @@
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
bin/
build/assets/
build/Debug
build/.vs
build/x64
build/libs/raylib/raylib
build/packages
*.vcxproj.user
build/OTRGui.dir
.vscode/
assets/extractor/xmls/
x64/
packages/
.vs/
build/

View File

@ -1,12 +0,0 @@
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/HarbourMasters/otrgui.git
branch = master
commit = a6066a25197b308d427139277f66529a35c3bd47
parent = 442a88f03bcb406dfcf693b4948412ab10d2cf08
method = rebase
cmdver = 0.4.1

View File

@ -1,65 +0,0 @@
################################################################################
# Command for variable_watch. This command issues error message, if a variable
# is changed. If variable PROPERTY_READER_GUARD_DISABLED is TRUE nothing happens
# variable_watch(<variable> property_reader_guard)
################################################################################
function(property_reader_guard VARIABLE ACCESS VALUE CURRENT_LIST_FILE STACK)
if("${PROPERTY_READER_GUARD_DISABLED}")
return()
endif()
if("${ACCESS}" STREQUAL "MODIFIED_ACCESS")
message(FATAL_ERROR
" Variable ${VARIABLE} is not supposed to be changed.\n"
" It is used only for reading target property ${VARIABLE}.\n"
" Use\n"
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}\" \"<value>\")\n"
" or\n"
" set_target_properties(\"<target>\" PROPERTIES \"${VARIABLE}_<CONFIG>\" \"<value>\")\n"
" instead.\n")
endif()
endfunction()
################################################################################
# Create variable <name> with generator expression that expands to value of
# target property <name>_<CONFIG>. If property is empty or not set then property
# <name> is used instead. Variable <name> has watcher property_reader_guard that
# doesn't allow to edit it.
# create_property_reader(<name>)
# Input:
# name - Name of watched property and output variable
################################################################################
function(create_property_reader NAME)
set(PROPERTY_READER_GUARD_DISABLED TRUE)
set(CONFIG_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}_$<UPPER_CASE:$<CONFIG>>>>")
set(IS_CONFIG_VALUE_EMPTY "$<STREQUAL:${CONFIG_VALUE},>")
set(GENERAL_VALUE "$<TARGET_GENEX_EVAL:${PROPS_TARGET},$<TARGET_PROPERTY:${PROPS_TARGET},${NAME}>>")
set("${NAME}" "$<IF:${IS_CONFIG_VALUE_EMPTY},${GENERAL_VALUE},${CONFIG_VALUE}>" PARENT_SCOPE)
variable_watch("${NAME}" property_reader_guard)
endfunction()
################################################################################
# Set property $<name>_${PROPS_CONFIG_U} of ${PROPS_TARGET} to <value>
# set_config_specific_property(<name> <value>)
# Input:
# name - Prefix of property name
# value - New value
################################################################################
function(set_config_specific_property NAME VALUE)
set_target_properties("${PROPS_TARGET}" PROPERTIES "${NAME}_${PROPS_CONFIG_U}" "${VALUE}")
endfunction()
################################################################################
create_property_reader("TARGET_NAME")
create_property_reader("OUTPUT_DIRECTORY")
set_config_specific_property("TARGET_NAME" "${PROPS_TARGET}")
set_config_specific_property("OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("ARCHIVE_OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("LIBRARY_OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("RUNTIME_OUTPUT_NAME" "${TARGET_NAME}")
set_config_specific_property("ARCHIVE_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
set_config_specific_property("LIBRARY_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")
set_config_specific_property("RUNTIME_OUTPUT_DIRECTORY" "${OUTPUT_DIRECTORY}")

View File

@ -1,12 +0,0 @@
include("${CMAKE_CURRENT_LIST_DIR}/Default.cmake")
set_config_specific_property("OUTPUT_DIRECTORY" "${CMAKE_SOURCE_DIR}$<$<NOT:$<STREQUAL:${CMAKE_VS_PLATFORM_NAME},Win32>>:/${CMAKE_VS_PLATFORM_NAME}>/${PROPS_CONFIG}")
if(MSVC)
create_property_reader("DEFAULT_CXX_EXCEPTION_HANDLING")
create_property_reader("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT")
set_target_properties("${PROPS_TARGET}" PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
set_config_specific_property("DEFAULT_CXX_EXCEPTION_HANDLING" "/EHsc")
set_config_specific_property("DEFAULT_CXX_DEBUG_INFORMATION_FORMAT" "/Zi")
endif()

View File

@ -1,234 +0,0 @@
# utils file for projects came from visual studio solution with cmake-converter.
################################################################################
# Wrap each token of the command with condition
################################################################################
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW)
macro(prepare_commands)
unset(TOKEN_ROLE)
unset(COMMANDS)
foreach(TOKEN ${ARG_COMMANDS})
if("${TOKEN}" STREQUAL "COMMAND")
set(TOKEN_ROLE "KEYWORD")
elseif("${TOKEN_ROLE}" STREQUAL "KEYWORD")
set(TOKEN_ROLE "CONDITION")
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
set(TOKEN_ROLE "COMMAND")
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
set(TOKEN_ROLE "ARG")
endif()
if("${TOKEN_ROLE}" STREQUAL "KEYWORD")
list(APPEND COMMANDS "${TOKEN}")
elseif("${TOKEN_ROLE}" STREQUAL "CONDITION")
set(CONDITION ${TOKEN})
elseif("${TOKEN_ROLE}" STREQUAL "COMMAND")
list(APPEND COMMANDS "$<$<NOT:${CONDITION}>:${DUMMY}>$<${CONDITION}:${TOKEN}>")
elseif("${TOKEN_ROLE}" STREQUAL "ARG")
list(APPEND COMMANDS "$<${CONDITION}:${TOKEN}>")
endif()
endforeach()
endmacro()
cmake_policy(POP)
################################################################################
# Transform all the tokens to absolute paths
################################################################################
macro(prepare_output)
unset(OUTPUT)
foreach(TOKEN ${ARG_OUTPUT})
if(IS_ABSOLUTE ${TOKEN})
list(APPEND OUTPUT "${TOKEN}")
else()
list(APPEND OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/${TOKEN}")
endif()
endforeach()
endmacro()
################################################################################
# Parse add_custom_command_if args.
#
# Input:
# PRE_BUILD - Pre build event option
# PRE_LINK - Pre link event option
# POST_BUILD - Post build event option
# TARGET - Target
# OUTPUT - List of output files
# DEPENDS - List of files on which the command depends
# COMMANDS - List of commands(COMMAND condition1 commannd1 args1 COMMAND
# condition2 commannd2 args2 ...)
# Output:
# OUTPUT - Output files
# DEPENDS - Files on which the command depends
# COMMENT - Comment
# PRE_BUILD - TRUE/FALSE
# PRE_LINK - TRUE/FALSE
# POST_BUILD - TRUE/FALSE
# TARGET - Target name
# COMMANDS - Prepared commands(every token is wrapped in CONDITION)
# NAME - Unique name for custom target
# STEP - PRE_BUILD/PRE_LINK/POST_BUILD
################################################################################
function(add_custom_command_if_parse_arguments)
cmake_parse_arguments("ARG" "PRE_BUILD;PRE_LINK;POST_BUILD" "TARGET;COMMENT" "DEPENDS;OUTPUT;COMMANDS" ${ARGN})
if(WIN32)
set(DUMMY "cd.")
elseif(UNIX)
set(DUMMY "true")
endif()
prepare_commands()
prepare_output()
set(DEPENDS "${ARG_DEPENDS}")
set(COMMENT "${ARG_COMMENT}")
set(PRE_BUILD "${ARG_PRE_BUILD}")
set(PRE_LINK "${ARG_PRE_LINK}")
set(POST_BUILD "${ARG_POST_BUILD}")
set(TARGET "${ARG_TARGET}")
if(PRE_BUILD)
set(STEP "PRE_BUILD")
elseif(PRE_LINK)
set(STEP "PRE_LINK")
elseif(POST_BUILD)
set(STEP "POST_BUILD")
endif()
set(NAME "${TARGET}_${STEP}")
set(OUTPUT "${OUTPUT}" PARENT_SCOPE)
set(DEPENDS "${DEPENDS}" PARENT_SCOPE)
set(COMMENT "${COMMENT}" PARENT_SCOPE)
set(PRE_BUILD "${PRE_BUILD}" PARENT_SCOPE)
set(PRE_LINK "${PRE_LINK}" PARENT_SCOPE)
set(POST_BUILD "${POST_BUILD}" PARENT_SCOPE)
set(TARGET "${TARGET}" PARENT_SCOPE)
set(COMMANDS "${COMMANDS}" PARENT_SCOPE)
set(STEP "${STEP}" PARENT_SCOPE)
set(NAME "${NAME}" PARENT_SCOPE)
endfunction()
################################################################################
# Add conditional custom command
#
# Generating Files
# The first signature is for adding a custom command to produce an output:
# add_custom_command_if(
# <OUTPUT output1 [output2 ...]>
# <COMMANDS>
# <COMMAND condition command1 [args1...]>
# [COMMAND condition command2 [args2...]]
# [DEPENDS [depends...]]
# [COMMENT comment]
#
# Build Events
# add_custom_command_if(
# <TARGET target>
# <PRE_BUILD | PRE_LINK | POST_BUILD>
# <COMMAND condition command1 [args1...]>
# [COMMAND condition command2 [args2...]]
# [COMMENT comment]
#
# Input:
# output - Output files the command is expected to produce
# condition - Generator expression for wrapping the command
# command - Command-line(s) to execute at build time.
# args - Command`s args
# depends - Files on which the command depends
# comment - Display the given message before the commands are executed at
# build time.
# PRE_BUILD - Run before any other rules are executed within the target
# PRE_LINK - Run after sources have been compiled but before linking the
# binary
# POST_BUILD - Run after all other rules within the target have been
# executed
################################################################################
function(add_custom_command_if)
add_custom_command_if_parse_arguments(${ARGN})
if(OUTPUT AND TARGET)
message(FATAL_ERROR "Wrong syntax. A TARGET and OUTPUT can not both be specified.")
endif()
if(OUTPUT)
add_custom_command(OUTPUT ${OUTPUT}
${COMMANDS}
DEPENDS ${DEPENDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${COMMENT})
elseif(TARGET)
if(PRE_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio")
add_custom_target(
${NAME}
${COMMANDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${COMMENT})
add_dependencies(${TARGET} ${NAME})
else()
add_custom_command(
TARGET ${TARGET}
${STEP}
${COMMANDS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${COMMENT})
endif()
else()
message(FATAL_ERROR "Wrong syntax. A TARGET or OUTPUT must be specified.")
endif()
endfunction()
################################################################################
# Use props file for a target and configs
# use_props(<target> <configs...> <props_file>)
# Inside <props_file> there are following variables:
# PROPS_TARGET - <target>
# PROPS_CONFIG - One of <configs...>
# PROPS_CONFIG_U - Uppercase PROPS_CONFIG
# Input:
# target - Target to apply props file
# configs - Build configurations to apply props file
# props_file - CMake script
################################################################################
macro(use_props TARGET CONFIGS PROPS_FILE)
set(PROPS_TARGET "${TARGET}")
foreach(PROPS_CONFIG ${CONFIGS})
string(TOUPPER "${PROPS_CONFIG}" PROPS_CONFIG_U)
get_filename_component(ABSOLUTE_PROPS_FILE "${PROPS_FILE}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
if(EXISTS "${ABSOLUTE_PROPS_FILE}")
include("${ABSOLUTE_PROPS_FILE}")
else()
message(WARNING "Corresponding cmake file from props \"${ABSOLUTE_PROPS_FILE}\" doesn't exist")
endif()
endforeach()
endmacro()
################################################################################
# Add compile options to source file
# source_file_compile_options(<source_file> [compile_options...])
# Input:
# source_file - Source file
# compile_options - Options to add to COMPILE_FLAGS property
################################################################################
function(source_file_compile_options SOURCE_FILE)
if("${ARGC}" LESS_EQUAL "1")
return()
endif()
get_source_file_property(COMPILE_OPTIONS "${SOURCE_FILE}" COMPILE_OPTIONS)
if(COMPILE_OPTIONS)
list(APPEND COMPILE_OPTIONS ${ARGN})
else()
set(COMPILE_OPTIONS "${ARGN}")
endif()
set_source_files_properties("${SOURCE_FILE}" PROPERTIES COMPILE_OPTIONS "${COMPILE_OPTIONS}")
endfunction()
################################################################################
# Default properties of visual studio projects
################################################################################
set(DEFAULT_CXX_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultCXX.cmake")
set(DEFAULT_Fortran_PROPS "${CMAKE_CURRENT_LIST_DIR}/DefaultFortran.cmake")

View File

@ -1,68 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(OTRGui)
set(PLATFORM "Desktop")
set(CMAKE_CXX_STANDARD 20)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build)
set(APP_ICON_RESOURCE_WINDOWS ${CMAKE_CURRENT_SOURCE_DIR}/appicon.rc)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(OpenGL_GL_PREFERENCE "GLVND")
endif()
include(CMake/Utils.cmake)
add_subdirectory(libs/raylib EXCLUDE_FROM_ALL)
include_directories(src)
include_directories(src/game)
include_directories(include)
if (NOT TARGET libultraship)
add_subdirectory(../libultraship ${CMAKE_BINARY_DIR}/libultraship)
endif()
if (NOT TARGET ZAPD)
add_subdirectory(../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
endif()
if (NOT TARGET ZAPDUtils)
add_subdirectory(../libultraship/extern/ZAPDUtils ${CMAKE_BINARY_DIR}/ZAPDUtils)
endif()
if (NOT TARGET OTRExporter)
add_subdirectory(../OTRExporter/OTRExporter ${CMAKE_BINARY_DIR}/OTRExporter)
endif()
if (NOT TARGET storm)
add_subdirectory(../libultraship/extern/StormLib ${CMAKE_BINARY_DIR}/StormLib)
endif()
file(GLOB_RECURSE HEADERS src/*.h)
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE C_SOURCES src/*.c)
add_executable(${PROJECT_NAME} EXCLUDE_FROM_ALL ${SOURCES} ${C_SOURCES} ${HEADERS} ${APP_ICON_RESOURCE_WINDOWS})
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
endif()
add_custom_target(Assets ALL
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/../OTRExporter/assets" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/game" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
COMMAND ${CMAKE_COMMAND} -Dsrc_dir="${CMAKE_CURRENT_SOURCE_DIR}/../soh/assets/xml" -Ddst_dir="${CMAKE_CURRENT_BINARY_DIR}/assets/extractor/xmls" -P "${CMAKE_CURRENT_SOURCE_DIR}/Overwrite.cmake"
)
add_dependencies(OTRGui Assets)
target_link_libraries(${PROJECT_NAME} PUBLIC raylib)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship
.
)
INSTALL(TARGETS OTRGui DESTINATION . COMPONENT ship OPTIONAL)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/assets
DESTINATION .
COMPONENT ship
)
INSTALL(TARGETS ZAPD DESTINATION assets/extractor COMPONENT ship)

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2022 Harbour Masters
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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