-
Notifications
You must be signed in to change notification settings - Fork 31
oot support #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
briaguya0
wants to merge
161
commits into
HarbourMasters:main
Choose a base branch
from
briaguya0:oot-assets-torchonly
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
oot support #219
Changes from all commits
Commits
Show all changes
161 commits
Select commit
Hold shift + click to select a range
461385c
Add OoT asset support: factories, tooling, and scene/room export
briaguya0 d713580
Add recovered POC/draft notes document
briaguya0 34b76c0
add .gitignores that were lost
briaguya0 3385cda
Add ROM identification, DMA table extraction, and manifests directory
briaguya0 5e70571
Move config.yml to soh/assets/yml/ and add scaffolding
briaguya0 b4f3506
Implement Yaz0 decompression and fix missing definitions
briaguya0 27cefa8
Fix segment 0x80 handling for OoT code-section assets
briaguya0 20e8dee
Fix crash on zero-size blobs (e.g. OoT LimbTable)
briaguya0 7ee15ea
Fix empty blob export, add test logging and compare tool
briaguya0 512df41
Add *.o2r and torch.hash.yml to gitignore
briaguya0 7ba1eb5
Optimize test_assets.sh: batch hashing and log torch output to file
briaguya0 e31b7cc
Replace test_assets.sh with Python version (60x faster)
briaguya0 4069ced
Add BUILD_OOT CMake option and stub OoTTextFactory
briaguya0 1a516be
Fix limb DList auto-discovery and naming (574 → 1 object failure)
briaguya0 cbb9328
Auto-create SkelLimbs 0-byte blob for skeleton limb tables
briaguya0 50ede2d
Fix MTX binary export to write raw int32 values
briaguya0 ccf13c6
Fix PatchVirtualAddr to prefer segment 0x80 for overlay textures
briaguya0 67bf3d1
Skip DList entries in scene/room XMLs during YAML conversion
briaguya0 525ec56
Skip all DList entries in room XML files during YAML conversion
briaguya0 a40e4f6
Add deferred alternate header processing for scenes
briaguya0 8a88bc6
Fix alternate header sub-asset naming and cutscene suffix
briaguya0 7cfbbfd
Fix sub-asset naming for scene alternate headers
briaguya0 4f13d32
Use neighbor-based size for pathway count inference
briaguya0 b0c8968
Create 0-byte ActorEntry companion files for SetActorList
briaguya0 80d3352
Add asset alias mechanism for Set_ DList duplicates
briaguya0 ee6afd7
Add command-aware cutscene size calculation
briaguya0 9b46d7e
Update cutscene plan with re-serialization details
briaguya0 59eb03f
Implement cutscene re-serialization with macro packing
briaguya0 15ec464
Fix actor cue rotY/rotZ packing in cutscene re-serialization
briaguya0 d893d54
Document remaining OoT asset work
briaguya0 70a3576
Fix cutscene command ID remapping (ROM IDs vs OTR output IDs)
briaguya0 bc51929
Revert incorrect command ID remapping, keep bounds checking
briaguya0 5499945
Skip unimplemented cutscene commands matching OTRExporter behavior
briaguya0 4145d78
Document spot04 pathway edge case in scene factory
briaguya0 7dd60dd
Add comprehensive ZPath bug analysis for spot04 pathway edge case
briaguya0 b6e64a8
Fix pathway count for alternate headers without YAML declarations
briaguya0 dbb3666
Fix CRC double byte-swap in version file
briaguya0 9414e26
Add plan for 135 missing scene sub-assets
briaguya0 2657542
Add OOT:CUTSCENE factory for standalone YAML-declared cutscenes
briaguya0 462bcde
Remove duplicated cutscene code from SetCutscenes handler
briaguya0 d77adf8
Add OOT:PATH factory for standalone YAML-declared paths
briaguya0 b90c58e
Extract SerializePathways to eliminate pathway code duplication
briaguya0 dd5265a
Create background companion files for mesh type 1 rooms
briaguya0 e13234d
Extract CreateBackgroundCompanion to deduplicate background code
briaguya0 5cad83d
Document scene DList investigation — YAML approach doesn't work
briaguya0 f64e691
Update scene DList plan with conflict analysis
briaguya0 ebd634d
Fix 18 missing scene-level DLists via YAML entry ordering
briaguya0 ab8fedb
Keep all DLists from room files, rely on YAML ordering
briaguya0 1d3bb23
Add verified OoT audio factory plan (598 assets)
briaguya0 349fb6c
Break down audio plan into incremental verifiable steps
briaguya0 7fb4799
Add audio metadata extraction to zapd_to_torch.py (Step 0)
briaguya0 db03b5d
Add OOT:AUDIO factory skeleton (Step 1)
briaguya0 376927b
Extract sequences from audio segment (Steps 2+3)
briaguya0 8f94549
Fix aliased sequences (size==0 means ptr is index to another seq)
briaguya0 0320fdd
Add detailed audio sample extraction plan with correct patterns
briaguya0 b153d2e
Extract 449 audio samples using safe BinaryReader pattern (Step 4)
briaguya0 bda2b48
Add audio sample dedup/naming analysis
briaguya0 99a2b20
Fix cross-bank audio sample naming to match ZAPDTR behavior
briaguya0 c5694cc
Add audio font extraction plan (Step 5)
briaguya0 ca2c5ec
Extract 38 audio fonts (OSFT companion files, Step 5)
briaguya0 9d3a285
Fix last 2 font failures via drum→instrument stack residue mapping
briaguya0 2e86358
Implement OoTTextFactory for message_data_static assets
briaguya0 4886150
Add portVersion analysis documenting Shipwright lifecycle
briaguya0 f76a38f
Fix portVersion: add endianness byte and pass version to Torch
briaguya0 7ace490
Document VTX YAML dependency on reference O2R
briaguya0 969d03a
Remove reference O2R dependency from YAML generation
briaguya0 c859a3f
Add VTX directory README with per-version status table
briaguya0 44a2335
Fix Shipwright build reference: b48e5f7 not 8c4d473
briaguya0 5833d66
Add VTX JSON files for all 11 unique ROM configurations
briaguya0 9a5a4ac
Reorganize O2R directory with reference/ subdirectory
briaguya0 5586487
Add manifests for all 14 unique ROM configurations
briaguya0 a9704be
Add F3DEX2_OoT GBI minor version for OoT-specific DList hacks
briaguya0 5ba22b2
Add shared code isolation plan and GBI minor plan docs
briaguya0 71c42c0
Isolate OoT-specific changes from shared Torch code
briaguya0 a76ab7c
Add performance profiling findings and isolation pass 2 plan
briaguya0 3cbdfdb
Update performance findings with perf profiler results
briaguya0 914a4c4
Add AssetLookup plan to eliminate YAML::Node from lookup infrastructure
briaguya0 073ddfb
Add YAML enrichment plan for eliminating auto-discovery overhead
briaguya0 9f9dba1
Add YAML enrichment tooling: catalog_undeclared + zapd_to_torch injec…
briaguya0 b8ef560
Document enrichment results: 4s savings, scene enrichment blocked
briaguya0 f7fd406
Add plan: full YAML enrichment to remove auto-discovery from Torch
briaguya0 cba4fef
Update plan: make AddAsset throw to surface enrichment gaps
briaguya0 591de6b
PoC: YAML enrichment reduces O2R generation from 35s to 8s
briaguya0 dbc7316
Add plan to fix 3,099 missing Set_ scene variant assets
briaguya0 d44ea29
Fix 3,068 missing Set_ assets: pre-declare rooms, parse for aliases
briaguya0 4e95417
Fix Set_ assets: let OOT:ROOM/OOT:SCENE through AddAsset
briaguya0 b0381ea
Eliminate BLOB auto-discovery: extract limb table offsets from skeletons
briaguya0 28bc461
WIP: ROM-based extraction for Set_ headers and MTX (not yet integrated)
briaguya0 b88322b
Add plan: consolidate supplemental.json for YAML generation
briaguya0 5bf56e4
Add generate_supplemental.py: single JSON for YAML enrichment
briaguya0 c5df76b
Fix BLOB resolution in supplemental pipeline
briaguya0 bb88cce
Eliminate MTX auto-discovery: recursive DList walking in ROM
briaguya0 eaba1e3
Add recursive DList MTX extraction, revert Set_ pre-declaration
briaguya0 c95fae2
Document Set_ alternate headers: why deferred, proposed solution
briaguya0 bff0f2f
Eliminate Set_ auto-discovery: separate YAML files with per-file segm…
briaguya0 86e1563
Zero AddAsset: eliminate last VTX, fix scene Set_ directory and exter…
briaguya0 ec71880
Add simplification plan: audit of all OoT Torch changes
briaguya0 ae51ed7
Split OoTSceneFactory: extract Path, Cutscene, shared utils
briaguya0 588562f
Split OoTSkeletonFactory: extract Limb factory and shared types
briaguya0 95e12ab
Split OoTAnimationFactory: extract Curve and Player animation factories
briaguya0 faac170
Create OoTMtxFactory with OOT:MTX type, revert shared MtxFactory
briaguya0 daeea34
Remove dead AddAsset auto-discovery from OoT factories
briaguya0 619c94f
Simplify DeferredVtx::FlushDeferred: remove AddAsset, use GetNodeByAddr
briaguya0 cab16ec
Make AddAsset throw for OoT to catch enrichment regressions
briaguya0 9cfed7e
Small cleanups: extract helpers in Text, Array, Collision factories
briaguya0 86964d9
Extract AliasManager from Companion
briaguya0 4f2e897
Extract ProcessFile setup into named methods
briaguya0 540e3a6
Clean up PatchVirtualAddr and GetNodeByAddr
briaguya0 740b462
Add primary_virtual_segment to OoT config
briaguya0 d6e1be1
Add PORT_VERSION_ENDIANNESS compile flag for portVersion endianness byte
briaguya0 b4dd082
Move ParseNode back to original position to reduce diff noise
briaguya0 15c7676
Make empty blob behavior YAML-driven instead of implicit
briaguya0 8f06c36
Document BSWAP32 CRC investigation for Cartridge.cpp
briaguya0 92d3bef
Collapse duplicate YAZ0 AutoDecode case into shared fallthrough
briaguya0 de56cca
Clean up TranslateAddr to use IS_VIRTUAL_SEGMENT macro
briaguya0 aeee732
Move shared skeleton helpers from OoTSkeletonFactory to OoTSkeletonTy…
briaguya0 4a23d48
Move OoTSceneUtils helper implementations to .cpp file
briaguya0 d5fe8d4
Clean up OoTSceneFactory: move helpers to private methods, extract Co…
briaguya0 a7568fe
Extract SceneCommandWriter from OoTSceneFactory
briaguya0 100c00a
Clean up OoTSceneFactory deferred alt header block and command writer
briaguya0 dc048d2
Remove test scaffolding and coverage option from CMakeLists
briaguya0 9b471fb
Clean up OoTAnimationFactory: remove debug logging, reorder reads
briaguya0 ca79b3b
Replace per-read BinaryReader helpers with SafeAudioBankReader class
briaguya0 ba86a7c
Clean up OoTAudioFactory: extract methods, move types to header
briaguya0 09876bb
Refactor OoTAudioFactory sequence extraction
briaguya0 3d4a888
Extract sample discovery and writing into ExtractSamples method
briaguya0 d58ef42
Extract font writing into ExtractFonts method
briaguya0 dfb2648
Extract ParseSample/ParseSFESample methods with AudioParseContext
briaguya0 e4c5678
Add Size() to SafeAudioBankReader, extract ParseSampleNames
briaguya0 082bd87
Add ReadU8 to SafeAudioBankReader, remove audioBankData from ExtractF…
briaguya0 5bee712
Make SafeAudioBankReader own its data, extract LoadAudioBank
briaguya0 1473fa9
Split OoTAudioFactory into separate writer files
briaguya0 f64e604
Extract DiscoverSamples and WriteCompanionFiles in AudioSampleWriter
briaguya0 1e832db
Extract ParseDrums, ParseSFX, ParseInstruments from AudioFontWriter
briaguya0 008ab46
Encapsulate font stack residue in FontResidue class
briaguya0 235c481
Extract WriteDrums, WriteInstruments, WriteSFXEntries from AudioFontW…
briaguya0 d6c2081
Introduce FontWriteContext and extract WriteFontCompanion
briaguya0 73426c4
Clean up SerializeCutscene first pass readability
briaguya0 c2ae984
Introduce CutsceneSerializer class, extract Write method
briaguya0 34b010b
Clean up CutsceneSerializer Write method readability
briaguya0 831ce3e
Add end marker comment, update checklist
briaguya0 65b26c5
Clean up OoTLimbFactory: extract GetLimbDataSize, remove dead params
briaguya0 b98740c
Extract per-type limb parsers from OoTLimbFactory
briaguya0 a21da27
Extract skin limb parsing helpers from OoTLimbFactory
briaguya0 c34d5ee
Clean up OoTPathFactory readability
briaguya0 22115a8
Clean up OoTTextFactory readability
briaguya0 a27bf9d
Add missing #ifdef OOT_SUPPORT guards
briaguya0 538b02f
Add DisplayListFactory cleanup plan and update checklist
briaguya0 06969df
Update checklist: docs removal note
briaguya0 912a2e6
Move RemapSegmentedAddr to OoTDListHelpers
briaguya0 619a575
Move OoT SearchVtx to OoTDListHelpers
briaguya0 d04263b
Move gSunDL VTX override to OoTDListHelpers
briaguya0 8d25085
Move OoT G_VTX export handling to OoTDListHelpers
briaguya0 c1aa3c5
Move OoT G_DL export handling to OoTDListHelpers
briaguya0 a7acc65
Move OoT G_SETTIMG and gSunDL texture fixups to OoTDListHelpers
briaguya0 38f3496
Move OoT G_MTX export handling to OoTDListHelpers
briaguya0 13ba29b
Move OoT opcode fixups to OoTDListHelpers
briaguya0 75d07df
Move OoT parse handlers to OoTDListHelpers
briaguya0 5d258ce
Minimize DisplayListFactory diff by not indenting OoT wrapper blocks
briaguya0 47d7052
Refactor OoT DList helpers to method-level replacements
briaguya0 de68e4b
Remove docs and soh tooling/data from Torch-only branch
briaguya0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| #include "yaz0.h" | ||
| #include "libmio0/utils.h" | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
|
|
||
| uint8_t* yaz0_decode(const uint8_t* in, uint32_t* out_size) { | ||
| if (strncmp((const char*)in, "Yaz0", 4) != 0) { | ||
| return NULL; | ||
| } | ||
|
|
||
| uint32_t decompressed_size = read_u32_be(in + 4); | ||
| uint8_t* out = malloc(decompressed_size); | ||
| if (!out) { | ||
| return NULL; | ||
| } | ||
|
|
||
| uint32_t src = YAZ0_HEADER_LENGTH; | ||
| uint32_t dst = 0; | ||
| uint8_t group_head = 0; | ||
| int bits_left = 0; | ||
|
|
||
| while (dst < decompressed_size) { | ||
| if (bits_left == 0) { | ||
| group_head = in[src++]; | ||
| bits_left = 8; | ||
| } | ||
|
|
||
| if (group_head & 0x80) { | ||
| /* literal byte */ | ||
| out[dst++] = in[src++]; | ||
| } else { | ||
| /* back-reference */ | ||
| uint8_t b1 = in[src++]; | ||
| uint8_t b2 = in[src++]; | ||
|
|
||
| uint32_t dist = ((b1 & 0x0F) << 8) | b2; | ||
| uint32_t copy_src = dst - (dist + 1); | ||
| uint32_t count; | ||
|
|
||
| if (b1 >> 4) { | ||
| count = (b1 >> 4) + 2; | ||
| } else { | ||
| count = in[src++] + 0x12; | ||
| } | ||
|
|
||
| for (uint32_t i = 0; i < count; i++) { | ||
| out[dst++] = out[copy_src + i]; | ||
| } | ||
| } | ||
|
|
||
| group_head <<= 1; | ||
| bits_left--; | ||
| } | ||
|
|
||
| *out_size = decompressed_size; | ||
| return out; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #define YAZ0_HEADER_LENGTH 16 | ||
|
|
||
| extern uint8_t* yaz0_decode(const uint8_t* in, uint32_t* out_size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #include "AliasManager.h" | ||
| #include "utils/TorchUtils.h" | ||
|
|
||
| static AliasManager sAliasManagerInstance; | ||
| AliasManager* AliasManager::Instance = &sAliasManagerInstance; | ||
|
|
||
| void AliasManager::Register(const std::string& primaryPath, const std::string& aliasPath) { | ||
| mAliases[primaryPath].push_back(aliasPath); | ||
| } | ||
|
|
||
| void AliasManager::WriteAliases(const std::string& primaryPath, BinaryWrapper* wrapper, | ||
| const std::vector<char>& data) { | ||
| if (!Torch::contains(mAliases, primaryPath)) return; | ||
|
|
||
| for (auto& alias : mAliases[primaryPath]) { | ||
| wrapper->AddFile(alias, data); | ||
| } | ||
| mAliases.erase(primaryPath); | ||
| } | ||
|
|
||
| void AliasManager::Clear() { | ||
| mAliases.clear(); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #pragma once | ||
|
|
||
| #include <string> | ||
| #include <vector> | ||
| #include <unordered_map> | ||
| #include "archive/BinaryWrapper.h" | ||
|
|
||
| class AliasManager { | ||
| public: | ||
| static AliasManager* Instance; | ||
|
|
||
| void Register(const std::string& primaryPath, const std::string& aliasPath); | ||
| void WriteAliases(const std::string& primaryPath, BinaryWrapper* wrapper, | ||
| const std::vector<char>& data); | ||
| void Clear(); | ||
|
|
||
| private: | ||
| std::unordered_map<std::string, std::vector<std::string>> mAliases; | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick question about this system, is this a way for one file's data to be written to multiple locations in the output binary, and if so what is the use case for it?