Merge remote-tracking branch 'upstream/develop-rando' into soulcalibur

This commit is contained in:
Ralphie Morell 2023-11-05 13:18:43 -05:00
commit f7b8e8ed65
519 changed files with 2963 additions and 59753 deletions

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

@ -124,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
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..."
@ -135,7 +135,7 @@ 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
@ -146,7 +146,7 @@ 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
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
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..."
@ -219,4 +219,4 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
endif()
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/CMake/Packaging-2.cmake)
include(CMake/Packaging.cmake)
include(CMake/Packaging.cmake)

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

View File

@ -1,952 +0,0 @@
<Root>
<Texture CRC="FD1D7A56" Path="assets/textures/shared/boss_key_item_name_unused_jpn_1"/>
<Texture CRC="1E03A717" Path="assets/textures/shared/object_blkobjTex_00A890"/>
<Texture CRC="EE47DD2D" Path="assets/textures/shared/tex_000165F0"/>
<Texture CRC="F39A58EB" Path="assets/textures/shared/object_blkobjTex_008090"/>
<Texture CRC="05355595" Path="assets/textures/shared/object_blkobjTex_008890"/>
<Texture CRC="E91E011C" Path="assets/textures/shared/gBotwTex_0040F0"/>
<Texture CRC="13CD3AC9" Path="assets/textures/shared/jyasinzou_room_0Tex_00F928"/>
<Texture CRC="E68D501C" Path="assets/textures/shared/object_blkobjTex_009090"/>
<Texture CRC="1749503F" Path="assets/textures/shared/gBotwTex_0048F0"/>
<Texture CRC="F3C7DB4B" Path="assets/textures/shared/gBotwTex_0060F0"/>
<Texture CRC="E7F3B78E" Path="assets/textures/shared/jyasinzou_room_0Tex_00DD28"/>
<Texture CRC="E692647D" Path="assets/textures/shared/fishing_aquarium_water"/>
<Texture CRC="ED0EC6BE" Path="assets/textures/shared/tex_0001CEB0"/>
<Texture CRC="19EFE2BC" Path="assets/textures/shared/jyasinzou_room_0Tex_00B128"/>
<Texture CRC="037B0BDD" Path="assets/textures/shared/object_blkobjTex_00D090"/>
<Texture CRC="F4A5CDD8" Path="assets/textures/shared/ddan_room_0Tex_01B498"/>
<Texture CRC="FC85B741" Path="assets/textures/shared/HIDAN_room_0Tex_005EC0"/>
<Texture CRC="07D322B0" Path="assets/textures/shared/jyasinzou_room_0Tex_00E128"/>
<Texture CRC="0D92FCD4" Path="assets/textures/shared/jyasinzou_room_10Tex_0051A0"/>
<Texture CRC="0921DF7B" Path="assets/textures/shared/object_blkobjTex_00B090"/>
<Texture CRC="08DD79E3" Path="assets/textures/shared/object_blkobjTex_00B890"/>
<Texture CRC="E5039D29" Path="assets/textures/shared/tex_000155F0"/>
<Texture CRC="07CF0466" Path="assets/textures/shared/lift_chain"/>
<Texture CRC="E701D6A2" Path="assets/textures/shared/ganontika_room_12Tex_007260"/>
<Texture CRC="F9B8D065" Path="assets/textures/shared/tex_000167F0"/>
<Texture CRC="E06BBB16" Path="assets/textures/shared/object_hidan_objectsTex_000240"/>
<Texture CRC="E85888C7" Path="assets/textures/shared/tex_00005D50"/>
<Texture CRC="0E2AA315" Path="assets/textures/shared/HIDAN_room_0Tex_005AC0"/>
<Texture CRC="19148C2A" Path="assets/textures/shared/HIDAN_room_10Tex_012298"/>
<Texture CRC="02A396D3" Path="assets/textures/shared/eff_unknown_2"/>
<Texture CRC="0E87B7F3" Path="assets/textures/shared/object_blkobjTex_00A090"/>
<Texture CRC="FFB7F7EB" Path="assets/textures/shared/object_demo_kekkaiTex_0089D0"/>
<Texture CRC="E8E230E3" Path="assets/textures/shared/object_demo_kekkaiTex_00C0B0"/>
<Texture CRC="FE9DF649" Path="assets/textures/shared/fishing_stream_splash_tile_1"/>
<Texture CRC="1964563B" Path="assets/textures/shared/tex_00019870"/>
<Texture CRC="085CDA77" Path="assets/textures/shared/ddan_room_0Tex_018498"/>
<Texture CRC="EB9122B3" Path="assets/textures/shared/HIDAN_room_0Tex_0052C0"/>
<Texture CRC="0BB1177F" Path="assets/textures/shared/jyasinboss_room_1Tex_006E38"/>
<Texture CRC="E51AACC5" Path="assets/textures/shared/jyasinboss_room_2Tex_0029C0"/>
<Texture CRC="1437E190" Path="assets/textures/shared/jyasinzou_room_0Tex_00A928"/>
<Texture CRC="FD7F0F21" Path="assets/textures/shared/object_blkobjTex_012090"/>
<Texture CRC="EAC88244" Path="assets/textures/shared/tex_000027F0"/>
<Texture CRC="E6FA3766" Path="assets/textures/shared/gBotwTex_0030F0"/>
<Texture CRC="E6EE37DC" Path="assets/textures/shared/object_hidan_objectsTex_005E40"/>
<Texture CRC="06E6313A" Path="assets/textures/shared/HAKAdan_room_21Tex_008F00"/>
<Texture CRC="F9299C24" Path="assets/textures/shared/jyasinzou_room_10Tex_007DA0"/>
<Texture CRC="05D9B7A3" Path="assets/textures/shared/ydan_room_0Tex_009160"/>
<Texture CRC="EA9CC59D" Path="assets/textures/shared/ydan_room_0Tex_00F160"/>
<Texture CRC="0D81F9C2" Path="assets/textures/shared/jabu_objects_1_tlut"/>
<Texture CRC="18FA875C" Path="assets/textures/shared/jabu_objects_tex_00000140"/>
<Texture CRC="FF137ACD" Path="assets/textures/shared/object_blkobjTex_00C090"/>
<Texture CRC="EC91F676" Path="assets/textures/shared/object_bvTex_019BB8"/>
<Texture CRC="1AB2D605" Path="assets/textures/shared/object_bvTLUT_0199B0"/>
<Texture CRC="0F30970D" Path="assets/textures/shared/web_tex"/>
<Texture CRC="1543A457" Path="assets/textures/shared/Bmori1_room_0Tex_007CC8"/>
<Texture CRC="FD65AC3E" Path="assets/textures/shared/ddan_room_10Tex_004E50"/>
<Texture CRC="E38D2C3B" Path="assets/textures/shared/ddan_room_11Tex_000C80"/>
<Texture CRC="EB2C6396" Path="assets/textures/shared/ddan_room_11Tex_001480"/>
<Texture CRC="19B3962B" Path="assets/textures/shared/ganontika_room_10Tex_004168"/>
<Texture CRC="F297A414" Path="assets/textures/shared/ganontika_room_12Tex_009370"/>
<Texture CRC="E41692EE" Path="assets/textures/shared/HAKAdan_room_10Tex_0073A0"/>
<Texture CRC="FD79012C" Path="assets/textures/shared/HIDAN_room_10Tex_011898"/>
<Texture CRC="1766570C" Path="assets/textures/shared/HIDAN_room_10Tex_011A98"/>
<Texture CRC="FE493504" Path="assets/textures/shared/HIDAN_room_13Tex_00C3D8"/>
<Texture CRC="0A5A144B" Path="assets/textures/shared/HIDAN_room_16Tex_00B170"/>
<Texture CRC="F89FB3AB" Path="assets/textures/shared/ice_doukutu_room_10Tex_003BD8"/>
<Texture CRC="EBB7AF44" Path="assets/textures/shared/men_room_0Tex_008938"/>
<Texture CRC="FC676B88" Path="assets/textures/shared/gBotwTex_0050F0"/>
<Texture CRC="0B77392E" Path="assets/textures/shared/tex_0001A070"/>
<Texture CRC="F0C936EE" Path="assets/textures/shared/hashira_gate"/>
<Texture CRC="FB929B87" Path="assets/textures/shared/tex_00005A48"/>
<Texture CRC="F035BB2D" Path="assets/textures/shared/Bmori1_room_0Tex_00A0C8"/>
<Texture CRC="1A44DDC7" Path="assets/textures/shared/ganontika_room_10Tex_004968"/>
<Texture CRC="ED895079" Path="assets/textures/shared/ganontika_room_11Tex_005150"/>
<Texture CRC="FFE381A7" Path="assets/textures/shared/ganontika_room_12Tex_005A60"/>
<Texture CRC="1A108172" Path="assets/textures/shared/ganontika_room_12TLUT_005240"/>
<Texture CRC="0A14B800" Path="assets/textures/shared/HIDAN_room_10Tex_017C98"/>
<Texture CRC="009F76D8" Path="assets/textures/shared/HIDAN_room_16Tex_00A970"/>
<Texture CRC="E119A079" Path="assets/textures/shared/HIDAN_room_17Tex_008138"/>
<Texture CRC="E9024823" Path="assets/textures/shared/jyasinzou_room_0Tex_00E928"/>
<Texture CRC="E45E3120" Path="assets/textures/shared/jyasinzou_room_13Tex_003048"/>
<Texture CRC="07C35EF3" Path="assets/textures/shared/ydan_room_0Tex_012EE8"/>
<Texture CRC="E6985582" Path="assets/textures/shared/bowling_sceneTex_008120"/>
<Texture CRC="0689B669" Path="assets/textures/shared/hakasitarelay_room_5Tex_003448"/>
<Texture CRC="03039DCB" Path="assets/textures/shared/spot00_sceneTex_024818"/>
<Texture CRC="F5581E37" Path="assets/textures/shared/spot00_sceneTLUT_013D70"/>
<Texture CRC="1ABC3F9F" Path="assets/textures/shared/eff_unknown_3"/>
<Texture CRC="E0C05022" Path="assets/textures/shared/object_blkobjTex_00D890"/>
<Texture CRC="FAD9324A" Path="assets/textures/shared/cell_door"/>
<Texture CRC="010DE1D3" Path="assets/textures/shared/tex_00016BF0"/>
<Texture CRC="F4E00E78" Path="assets/textures/shared/tex_00016DF0"/>
<Texture CRC="EB51725A" Path="assets/textures/shared/tex_000187F0"/>
<Texture CRC="F2EE5FA3" Path="assets/textures/shared/kanaami_middle"/>
<Texture CRC="1E60B593" Path="assets/textures/shared/object_spot09_objTex_00A490"/>
<Texture CRC="070FB26E" Path="assets/textures/shared/Bmori1_room_0Tex_00B0C8"/>
<Texture CRC="0FC10D68" Path="assets/textures/shared/Bmori1_room_0Tex_00B8C8"/>
<Texture CRC="F904FCB9" Path="assets/textures/shared/Bmori1_room_12Tex_0065F0"/>
<Texture CRC="09A94F23" Path="assets/textures/shared/Bmori1_room_14Tex_003530"/>
<Texture CRC="FF246A91" Path="assets/textures/shared/FIRE_bs_room_1Tex_004BD8"/>
<Texture CRC="0A019901" Path="assets/textures/shared/ganontika_room_10Tex_005968"/>
<Texture CRC="076B5ABF" Path="assets/textures/shared/ganontika_room_10Tex_005B68"/>
<Texture CRC="0EF19A0E" Path="assets/textures/shared/HIDAN_room_11Tex_0033B8"/>
<Texture CRC="0B9F067E" Path="assets/textures/shared/HIDAN_room_17Tex_005138"/>
<Texture CRC="E4379EFF" Path="assets/textures/shared/HIDAN_room_17Tex_005938"/>
<Texture CRC="1450BE5B" Path="assets/textures/shared/HIDAN_room_17Tex_006938"/>
<Texture CRC="E4C0C584" Path="assets/textures/shared/jyasinzou_room_15Tex_0043B8"/>
<Texture CRC="F4E2E220" Path="assets/textures/shared/men_room_0Tex_00ED38"/>
<Texture CRC="F76F5125" Path="assets/textures/shared/men_room_10Tex_004458"/>
<Texture CRC="F3E82477" Path="assets/textures/shared/ydan_room_0Tex_00CD60"/>
<Texture CRC="0C77CC92" Path="assets/textures/shared/ydan_room_3Tex_0094B0"/>
<Texture CRC="E2F531E7" Path="assets/textures/shared/hakasitarelay_room_0Tex_0062B8"/>
<Texture CRC="F7DA366C" Path="assets/textures/shared/hakasitarelay_room_1Tex_005720"/>
<Texture CRC="11B0F260" Path="assets/textures/shared/hakasitarelay_room_4Tex_003C80"/>
<Texture CRC="1CE49D25" Path="assets/textures/shared/eff_unknown_12"/>
<Texture CRC="E988267C" Path="assets/textures/shared/flash"/>
<Texture CRC="1D8E7A5B" Path="assets/textures/shared/unknown_stone_2"/>
<Texture CRC="09556A28" Path="assets/textures/shared/door_bars"/>
<Texture CRC="EE556A49" Path="assets/textures/shared/deku_nut"/>
<Texture CRC="02243AF1" Path="assets/textures/shared/object_fdTex_0056A8"/>
<Texture CRC="EE8FB60E" Path="assets/textures/shared/fishing_water_dust"/>
<Texture CRC="07120E67" Path="assets/textures/shared/gBotwTex_0058F0"/>
<Texture CRC="0338AD8D" Path="assets/textures/shared/object_hakach_objectsTex_0062F0"/>
<Texture CRC="F678762F" Path="assets/textures/shared/tex_0001A470"/>
<Texture CRC="1C5FB6BE" Path="assets/textures/shared/object_hidan_objectsTex_006E40"/>
<Texture CRC="0695CCC0" Path="assets/textures/shared/twisted_hall_ladder"/>
<Texture CRC="F08F4278" Path="assets/textures/shared/tex_00000170"/>
<Texture CRC="EE5176FB" Path="assets/textures/shared/tex_00014020"/>
<Texture CRC="10F072E0" Path="assets/textures/shared/maruta_unused_1"/>
<Texture CRC="076BF717" Path="assets/textures/shared/Bmori1_room_0Tex_00CB58"/>
<Texture CRC="0696FE07" Path="assets/textures/shared/Bmori1_room_10Tex_001250"/>
<Texture CRC="107EE843" Path="assets/textures/shared/Bmori1_room_11Tex_009118"/>
<Texture CRC="0E17A8DB" Path="assets/textures/shared/Bmori1_room_12Tex_0071F0"/>
<Texture CRC="F5467498" Path="assets/textures/shared/Bmori1_room_13Tex_004CC0"/>
<Texture CRC="E9EC151D" Path="assets/textures/shared/ddan_room_0Tex_011498"/>
<Texture CRC="EF5A64C2" Path="assets/textures/shared/ddan_room_0Tex_012C98"/>
<Texture CRC="0E597363" Path="assets/textures/shared/ddan_room_0Tex_013C98"/>
<Texture CRC="0DDC2AEF" Path="assets/textures/shared/ddan_room_12Tex_007730"/>
<Texture CRC="0472569F" Path="assets/textures/shared/ganontika_room_2Tex_0047D8"/>
<Texture CRC="06FD7C7C" Path="assets/textures/shared/HIDAN_room_0Tex_005CC0"/>
<Texture CRC="F684D94A" Path="assets/textures/shared/HIDAN_room_1Tex_0091E0"/>
<Texture CRC="103C2271" Path="assets/textures/shared/ice_doukutu_room_0Tex_002F30"/>
<Texture CRC="0093A3F4" Path="assets/textures/shared/ice_doukutu_room_11Tex_0031D8"/>
<Texture CRC="16A736BD" Path="assets/textures/shared/ice_doukutu_room_1Tex_00AB40"/>
<Texture CRC="F4561B9A" Path="assets/textures/shared/jyasinzou_room_0Tex_00D528"/>
<Texture CRC="EAC340AD" Path="assets/textures/shared/jyasinzou_room_10Tex_0079A0"/>
<Texture CRC="0194C678" Path="assets/textures/shared/jyasinzou_room_18Tex_0030C0"/>
<Texture CRC="E5EA84ED" Path="assets/textures/shared/men_room_0Tex_008138"/>
<Texture CRC="E57046CB" Path="assets/textures/shared/men_room_1Tex_007290"/>
<Texture CRC="0EBD6689" Path="assets/textures/shared/men_room_2Tex_004B78"/>
<Texture CRC="F60B9167" Path="assets/textures/shared/MIZUsin_room_12Tex_004128"/>
<Texture CRC="0F56933B" Path="assets/textures/shared/MIZUsin_room_22Tex_0044E8"/>
<Texture CRC="083D33DC" Path="assets/textures/shared/ydan_room_0Tex_009960"/>
<Texture CRC="FC1BD5AE" Path="assets/textures/shared/ydan_room_0Tex_00A560"/>
<Texture CRC="E01AC796" Path="assets/textures/shared/ydan_room_0Tex_010960"/>
<Texture CRC="E1CE4C08" Path="assets/textures/shared/ydan_room_11Tex_005CD8"/>
<Texture CRC="0D27D9E9" Path="assets/textures/shared/hairal_niwa_sceneTex_007390"/>
<Texture CRC="E9E18C29" Path="assets/textures/shared/hairal_niwa_sceneTex_008B90"/>
<Texture CRC="0017751E" Path="assets/textures/shared/hairal_niwa_sceneTex_00FB90"/>
<Texture CRC="0469FC0A" Path="assets/textures/shared/hakasitarelay_room_1Tex_005F20"/>
<Texture CRC="E0C3E40A" Path="assets/textures/shared/hylia_labo_sceneTex_009A90"/>
<Texture CRC="E6476EA0" Path="assets/textures/shared/kakusiana_room_0Tex_0022A0"/>
<Texture CRC="F49F6117" Path="assets/textures/shared/kakusiana_room_0Tex_0042A0"/>
<Texture CRC="1E8999E1" Path="assets/textures/shared/kakusiana_room_10Tex_003BE0"/>
<Texture CRC="0DC68B3C" Path="assets/textures/shared/spot00_sceneTex_01AB98"/>
<Texture CRC="11AE73DA" Path="assets/textures/shared/spot00_sceneTex_01B398"/>
<Texture CRC="1B5470D3" Path="assets/textures/shared/spot00_sceneTex_020018"/>
<Texture CRC="E000AFF1" Path="assets/textures/shared/spot00_sceneTex_024018"/>
<Texture CRC="11F90BE8" Path="assets/textures/shared/spot02_room_1Tex_011508"/>
<Texture CRC="E001D4EB" Path="assets/textures/shared/spot04_room_0Tex_014B08"/>
<Texture CRC="11CDA502" Path="assets/textures/shared/spot04_room_0Tex_015308"/>
<Texture CRC="16CCF21D" Path="assets/textures/shared/gameplay_dangeon_keepTex_000200"/>
<Texture CRC="1A276B01" Path="assets/textures/shared/eff_bubble_1"/>
<Texture CRC="F418FB62" Path="assets/textures/shared/ocarina_of_time_design"/>
<Texture CRC="EE75476B" Path="assets/textures/shared/unused_tree_stump_top"/>
<Texture CRC="0E448260" Path="assets/textures/shared/object_blkobjTex_00E090"/>
<Texture CRC="E0E2DE0B" Path="assets/textures/shared/object_demo_kekkaiTex_000800"/>
<Texture CRC="F0896343" Path="assets/textures/shared/object_demo_kekkaiTex_002450"/>
<Texture CRC="0B08107E" Path="assets/textures/shared/object_fdTex_00A050"/>
<Texture CRC="0586B026" Path="assets/textures/shared/tex_00008930"/>
<Texture CRC="09EF3B55" Path="assets/textures/shared/object_gjTex_003B20"/>
<Texture CRC="0B070D01" Path="assets/textures/shared/object_gjTex_003D20"/>
<Texture CRC="E8F7B7D2" Path="assets/textures/shared/tex_00016FF0"/>
<Texture CRC="10D84CDA" Path="assets/textures/shared/tex_0001C470"/>
<Texture CRC="09062785" Path="assets/textures/shared/gtg_6310"/>
<Texture CRC="05BB78C0" Path="assets/textures/shared/object_pohTex_004D10"/>
<Texture CRC="F35E1E32" Path="assets/textures/shared/object_po_composerTex_005AE0"/>
<Texture CRC="F460A18B" Path="assets/textures/shared/tex_0000"/>
<Texture CRC="1F3E7382" Path="assets/textures/shared/tex_0400"/>
<Texture CRC="08398602" Path="assets/textures/shared/object_spot09_objTex_008490"/>
<Texture CRC="F8CAD0BB" Path="assets/textures/shared/corral_fence"/>
<Texture CRC="ECC3AE58" Path="assets/textures/shared/metal_bar"/>
<Texture CRC="15754092" Path="assets/textures/shared/bdan_room_13Tex_001D88"/>
<Texture CRC="EC05BD1D" Path="assets/textures/shared/bdan_room_13Tex_002188"/>
<Texture CRC="E0A3A9B5" Path="assets/textures/shared/Bmori1_room_0Tex_005CC8"/>
<Texture CRC="E64F5E65" Path="assets/textures/shared/Bmori1_room_0Tex_0088C8"/>
<Texture CRC="15C10EF9" Path="assets/textures/shared/Bmori1_room_0Tex_00C2C8"/>
<Texture CRC="1BCC4F3E" Path="assets/textures/shared/Bmori1_room_17Tex_0088B8"/>
<Texture CRC="0FFF410A" Path="assets/textures/shared/ddan_room_0Tex_011898"/>
<Texture CRC="1410F5ED" Path="assets/textures/shared/ddan_room_0Tex_015C98"/>
<Texture CRC="E6F457E5" Path="assets/textures/shared/ddan_room_0Tex_017898"/>
<Texture CRC="FAB44CE6" Path="assets/textures/shared/ganon_room_0Tex_0076D0"/>
<Texture CRC="E377EBF4" Path="assets/textures/shared/ganon_room_1Tex_006770"/>
<Texture CRC="064B271A" Path="assets/textures/shared/ganon_room_6Tex_008B00"/>
<Texture CRC="F4FC78F4" Path="assets/textures/shared/ganontika_room_0Tex_007EF8"/>
<Texture CRC="F1F2F1FA" Path="assets/textures/shared/ganontika_room_12Tex_008660"/>
<Texture CRC="1DA32295" Path="assets/textures/shared/ganontika_room_1Tex_0119C0"/>
<Texture CRC="F19BC15B" Path="assets/textures/shared/ganontika_room_2Tex_004FD8"/>
<Texture CRC="160FC921" Path="assets/textures/shared/ganontika_room_6Tex_00CC90"/>
<Texture CRC="16601E00" Path="assets/textures/shared/ganontika_room_9Tex_00A888"/>
<Texture CRC="0A0235AF" Path="assets/textures/shared/ganon_demo_sceneTex_008870"/>
<Texture CRC="1B4711F7" Path="assets/textures/shared/gerudoway_room_0Tex_002FB0"/>
<Texture CRC="0176FF24" Path="assets/textures/shared/gerudoway_room_1Tex_005B10"/>
<Texture CRC="0B5B2427" Path="assets/textures/shared/HIDAN_room_10Tex_017898"/>
<Texture CRC="0EDFD923" Path="assets/textures/shared/HIDAN_room_1Tex_00B5E0"/>
<Texture CRC="E71EBF7C" Path="assets/textures/shared/ice_doukutu_room_2Tex_002720"/>
<Texture CRC="F2D8CCC3" Path="assets/textures/shared/jyasinboss_room_1Tex_005638"/>
<Texture CRC="E517951C" Path="assets/textures/shared/jyasinzou_room_13Tex_004448"/>
<Texture CRC="F3796950" Path="assets/textures/shared/jyasinzou_room_14Tex_003090"/>
<Texture CRC="FB1AAEE8" Path="assets/textures/shared/jyasinzou_room_15Tex_004BB8"/>
<Texture CRC="F9FA965A" Path="assets/textures/shared/jyasinzou_room_16Tex_004188"/>
<Texture CRC="0C21F5B9" Path="assets/textures/shared/jyasinzou_room_1Tex_006AF8"/>
<Texture CRC="F81085E7" Path="assets/textures/shared/men_room_0Tex_00B538"/>
<Texture CRC="06DDD075" Path="assets/textures/shared/men_room_0Tex_00DD38"/>
<Texture CRC="FD93304A" Path="assets/textures/shared/men_room_10Tex_002458"/>
<Texture CRC="EB85EB44" Path="assets/textures/shared/MIZUsin_room_0Tex_00DE48"/>
<Texture CRC="0A52B296" Path="assets/textures/shared/MIZUsin_room_0Tex_00E648"/>
<Texture CRC="03335399" Path="assets/textures/shared/MIZUsin_room_12Tex_003928"/>
<Texture CRC="15339444" Path="assets/textures/shared/MIZUsin_room_14Tex_005660"/>
<Texture CRC="EC94487D" Path="assets/textures/shared/ydan_room_0Tex_00B560"/>
<Texture CRC="E526D720" Path="assets/textures/shared/ydan_room_0Tex_00C560"/>
<Texture CRC="EE2A311A" Path="assets/textures/shared/ydan_room_0Tex_00D560"/>
<Texture CRC="F258216F" Path="assets/textures/shared/ydan_room_3Tex_00A8B0"/>
<Texture CRC="F995FF42" Path="assets/textures/shared/bowling_sceneTex_004720"/>
<Texture CRC="1580830E" Path="assets/textures/shared/daiyousei_izumi_sceneTex_00C000"/>
<Texture CRC="FB7677CD" Path="assets/textures/shared/daiyousei_izumi_sceneTex_00C800"/>
<Texture CRC="EC5691BA" Path="assets/textures/shared/daiyousei_izumi_sceneTex_00D800"/>
<Texture CRC="EFB16917" Path="assets/textures/shared/hairal_niwa_sceneTex_004B90"/>
<Texture CRC="0A735ADC" Path="assets/textures/shared/hairal_niwa_sceneTex_005390"/>
<Texture CRC="F812EC23" Path="assets/textures/shared/hairal_niwa_sceneTex_007B90"/>
<Texture CRC="043CE192" Path="assets/textures/shared/hairal_niwa_sceneTex_009390"/>
<Texture CRC="16CC49E3" Path="assets/textures/shared/hairal_niwa_sceneTex_00EB90"/>
<Texture CRC="15F37497" Path="assets/textures/shared/hairal_niwa_sceneTex_00F390"/>
<Texture CRC="E1CDE090" Path="assets/textures/shared/hakasitarelay_room_0Tex_003448"/>
<Texture CRC="0C3C11BD" Path="assets/textures/shared/hakasitarelay_room_0Tex_005448"/>
<Texture CRC="02DBC410" Path="assets/textures/shared/hakasitarelay_room_0Tex_005848"/>
<Texture CRC="15641343" Path="assets/textures/shared/hakasitarelay_room_1Tex_006320"/>
<Texture CRC="1B57EF18" Path="assets/textures/shared/hakasitarelay_room_2Tex_006CA8"/>
<Texture CRC="09603C55" Path="assets/textures/shared/hakasitarelay_sceneTex_00D880"/>
<Texture CRC="1B8179C3" Path="assets/textures/shared/hylia_labo_sceneTex_008590"/>
<Texture CRC="F41C6BA8" Path="assets/textures/shared/hylia_labo_sceneTex_009990"/>
<Texture CRC="ED602894" Path="assets/textures/shared/kakusiana_room_0Tex_005AA0"/>
<Texture CRC="1414C410" Path="assets/textures/shared/kakusiana_room_11Tex_004048"/>
<Texture CRC="1EF67D5E" Path="assets/textures/shared/spot00_sceneTex_01F818"/>
<Texture CRC="E9A72C25" Path="assets/textures/shared/night_entrance"/>
<Texture CRC="0805B7BD" Path="assets/textures/shared/spot10_room_1Tex_004FA0"/>
<Texture CRC="1147203B" Path="assets/textures/shared/spot18_room_0Tex_009960"/>
<Texture CRC="09CDB0D6" Path="assets/textures/shared/pause_save_1_1"/>
<Texture CRC="F41C8814" Path="assets/textures/shared/gameplay_dangeon_keepTex_000000"/>
<Texture CRC="F62DF8AC" Path="assets/textures/shared/field_door_knob_upper"/>
<Texture CRC="EDCD2438" Path="assets/textures/shared/eff_unknown_10"/>
<Texture CRC="19D3C674" Path="assets/textures/shared/eff_unknown_8"/>
<Texture CRC="E92D820F" Path="assets/textures/shared/biri_outer_hood"/>
<Texture CRC="1FDE7D92" Path="assets/textures/shared/object_blkobjTex_009890"/>
<Texture CRC="11C993FD" Path="assets/textures/shared/object_blkobjTex_00C890"/>
<Texture CRC="F9B0AE51" Path="assets/textures/shared/bowling_stone_wall"/>
<Texture CRC="FEF48320" Path="assets/textures/shared/object_bvTex_008F88"/>
<Texture CRC="E74E736D" Path="assets/textures/shared/tex_00002640"/>
<Texture CRC="1E4711B1" Path="assets/textures/shared/tex_000010D0"/>
<Texture CRC="EA0E81C8" Path="assets/textures/shared/object_demo_kekkaiTex_006140"/>
<Texture CRC="F4D9D35C" Path="assets/textures/shared/object_demo_kekkaiTex_007DB0"/>
<Texture CRC="FA474623" Path="assets/textures/shared/object_dnsTex_002F20"/>
<Texture CRC="03A97838" Path="assets/textures/shared/tex_00000800"/>
<Texture CRC="1C29E4A3" Path="assets/textures/shared/object_fdTex_0050A8"/>
<Texture CRC="FE05DC4E" Path="assets/textures/shared/object_fhgTex_004DA0"/>
<Texture CRC="E767A558" Path="assets/textures/shared/tex_00008570"/>
<Texture CRC="1B0E9FE6" Path="assets/textures/shared/tex_00008630"/>
<Texture CRC="F2165B27" Path="assets/textures/shared/tex_00008D30"/>
<Texture CRC="1BF0EDA3" Path="assets/textures/shared/tex_000091B0"/>
<Texture CRC="0F0AD674" Path="assets/textures/shared/tex_00009E20"/>
<Texture CRC="1E912266" Path="assets/textures/shared/tex_0000A020"/>
<Texture CRC="E0FAC473" Path="assets/textures/shared/tex_0000A260"/>
<Texture CRC="EC4ED225" Path="assets/textures/shared/object_geldbTex_002880"/>
<Texture CRC="EF58D91D" Path="assets/textures/shared/object_geldbTex_002B80"/>
<Texture CRC="F2AA7BB5" Path="assets/textures/shared/grass"/>
<Texture CRC="1C4EC8A1" Path="assets/textures/shared/blood_splatter"/>
<Texture CRC="1B21DD4A" Path="assets/textures/shared/tex_000173F0"/>
<Texture CRC="F27781B5" Path="assets/textures/shared/object_hidan_objectsTex_001A40"/>
<Texture CRC="0FEFAAB6" Path="assets/textures/shared/object_hidan_objectsTex_003A40"/>
<Texture CRC="13FDA83C" Path="assets/textures/shared/object_hidan_objectsTex_004A40"/>
<Texture CRC="035A45AE" Path="assets/textures/shared/tex_00003150"/>
<Texture CRC="E6F3F1FD" Path="assets/textures/shared/cobra_tooth"/>
<Texture CRC="F2034104" Path="assets/textures/shared/mirror_gradient"/>
<Texture CRC="1ECE2D10" Path="assets/textures/shared/gtg_rotating_ring_platform_inner_circle"/>
<Texture CRC="17448599" Path="assets/textures/shared/object_mizu_objectsTex_009520"/>
<Texture CRC="F8AF4212" Path="assets/textures/shared/twisted_hall_carpet"/>
<Texture CRC="EAAD42ED" Path="assets/textures/shared/metal_body"/>
<Texture CRC="F6673280" Path="assets/textures/shared/tex_000016A8"/>
<Texture CRC="FB55D32F" Path="assets/textures/shared/tex_00005E48"/>
<Texture CRC="1C960FEB" Path="assets/textures/shared/tex_00006688"/>
<Texture CRC="140B02AD" Path="assets/textures/shared/tex_00001D90"/>
<Texture CRC="041873FA" Path="assets/textures/shared/tex_00001F70"/>
<Texture CRC="0225074D" Path="assets/textures/shared/tex_00001FB0"/>
<Texture CRC="1E7E2033" Path="assets/textures/shared/tex_000020B0"/>
<Texture CRC="F1D5B861" Path="assets/textures/shared/tlut_00001D70"/>
<Texture CRC="0CB197B9" Path="assets/textures/shared/object_pohTex_003010"/>
<Texture CRC="EABA3AA1" Path="assets/textures/shared/tex_00013820"/>
<Texture CRC="1E269341" Path="assets/textures/shared/object_spot09_objTex_00B490"/>
<Texture CRC="1B2A1991" Path="assets/textures/shared/torch_flame_guard"/>
<Texture CRC="E761B6AC" Path="assets/textures/shared/bdan_room_14Tex_0045D8"/>
<Texture CRC="0D210C87" Path="assets/textures/shared/bdan_room_14Tex_004DD8"/>
<Texture CRC="0A940608" Path="assets/textures/shared/bdan_room_2Tex_006DC8"/>
<Texture CRC="FF71874B" Path="assets/textures/shared/Bmori1_room_0Tex_00C0C8"/>
<Texture CRC="E38C7D5F" Path="assets/textures/shared/Bmori1_room_10Tex_001A50"/>
<Texture CRC="0E15A329" Path="assets/textures/shared/Bmori1_room_10Tex_004BC8"/>
<Texture CRC="043639A2" Path="assets/textures/shared/Bmori1_room_11Tex_008118"/>
<Texture CRC="13386815" Path="assets/textures/shared/Bmori1_room_17Tex_0080B8"/>
<Texture CRC="102D8CFF" Path="assets/textures/shared/Bmori1_room_7Tex_008560"/>
<Texture CRC="16525216" Path="assets/textures/shared/Bmori1_room_7Tex_009160"/>
<Texture CRC="19351714" Path="assets/textures/shared/Bmori1_room_7Tex_009D60"/>
<Texture CRC="E2231A4E" Path="assets/textures/shared/Bmori1_room_7Tex_00A560"/>
<Texture CRC="FE12C8B7" Path="assets/textures/shared/Bmori1_room_7Tex_00B560"/>
<Texture CRC="F553680E" Path="assets/textures/shared/Bmori1_room_7Tex_011768"/>
<Texture CRC="E358CE7D" Path="assets/textures/shared/ddan_room_0Tex_011C98"/>
<Texture CRC="FE4D9245" Path="assets/textures/shared/ddan_room_0Tex_015498"/>
<Texture CRC="1B63F7AB" Path="assets/textures/shared/ddan_room_0TLUT_011290"/>
<Texture CRC="0042824F" Path="assets/textures/shared/ddan_room_10Tex_002A50"/>
<Texture CRC="F01A4518" Path="assets/textures/shared/ddan_room_10Tex_002E50"/>
<Texture CRC="08882A33" Path="assets/textures/shared/ddan_room_10Tex_003650"/>
<Texture CRC="EBB48258" Path="assets/textures/shared/ddan_room_10Tex_003A50"/>
<Texture CRC="E87EC430" Path="assets/textures/shared/ddan_room_10Tex_004250"/>
<Texture CRC="0CCFACB3" Path="assets/textures/shared/ddan_room_10Tex_004650"/>
<Texture CRC="FEA06378" Path="assets/textures/shared/ddan_room_3Tex_00D5B8"/>
<Texture CRC="F8E8F33E" Path="assets/textures/shared/FIRE_bs_room_1Tex_0065D8"/>
<Texture CRC="EF1C9597" Path="assets/textures/shared/ganon_room_0Tex_007068"/>
<Texture CRC="E60DFE8F" Path="assets/textures/shared/ganon_room_5Tex_006308"/>
<Texture CRC="0E142D1D" Path="assets/textures/shared/ganon_room_6Tex_008200"/>
<Texture CRC="FAAD8F7E" Path="assets/textures/shared/ganon_room_8Tex_004A20"/>
<Texture CRC="E73C495F" Path="assets/textures/shared/ganontika_room_12Tex_008260"/>
<Texture CRC="F7DA24EF" Path="assets/textures/shared/ganontika_room_17Tex_002A98"/>
<Texture CRC="F733905C" Path="assets/textures/shared/ganontika_room_17Tex_002E98"/>
<Texture CRC="E0D329EA" Path="assets/textures/shared/ganontika_room_17Tex_003E98"/>
<Texture CRC="FA9DCD71" Path="assets/textures/shared/ganontika_room_17Tex_004E98"/>
<Texture CRC="E610FE82" Path="assets/textures/shared/ganontika_room_6Tex_00CA90"/>
<Texture CRC="1BC21D2A" Path="assets/textures/shared/ganon_demo_sceneTex_007370"/>
<Texture CRC="1ED26725" Path="assets/textures/shared/ganon_sonogo_room_0Tex_005820"/>
<Texture CRC="E3C4E5C4" Path="assets/textures/shared/ganon_sonogo_room_0Tex_007020"/>
<Texture CRC="111EF595" Path="assets/textures/shared/ganon_sonogo_room_0Tex_007420"/>
<Texture CRC="1778E2AD" Path="assets/textures/shared/ganon_sonogo_room_0Tex_007820"/>
<Texture CRC="EB105C4F" Path="assets/textures/shared/gerudoway_room_0Tex_003FB0"/>
<Texture CRC="F81CD64C" Path="assets/textures/shared/HAKAdan_room_0Tex_0091A0"/>
<Texture CRC="14C7DE24" Path="assets/textures/shared/HAKAdan_room_10Tex_004FA0"/>
<Texture CRC="1E27F99A" Path="assets/textures/shared/HAKAdan_room_21Tex_008700"/>
<Texture CRC="E1E22A3C" Path="assets/textures/shared/HIDAN_room_0Tex_0056C0"/>
<Texture CRC="EB48A97D" Path="assets/textures/shared/HIDAN_room_1Tex_0087E0"/>
<Texture CRC="1AE75412" Path="assets/textures/shared/HIDAN_room_1Tex_00A5E0"/>
<Texture CRC="177FA69E" Path="assets/textures/shared/jyasinboss_room_1TLUT_002E18"/>
<Texture CRC="064E5E5B" Path="assets/textures/shared/jyasinzou_room_0Tex_00C128"/>
<Texture CRC="150A7E2B" Path="assets/textures/shared/jyasinzou_room_10Tex_005DA0"/>
<Texture CRC="F5CA5751" Path="assets/textures/shared/jyasinzou_room_10Tex_0065A0"/>
<Texture CRC="1F4EADD6" Path="assets/textures/shared/jyasinzou_room_23Tex_0043B8"/>
<Texture CRC="F7B3B208" Path="assets/textures/shared/jyasinzou_room_25Tex_00DE68"/>
<Texture CRC="ED9D7B96" Path="assets/textures/shared/men_room_0Tex_00D538"/>
<Texture CRC="FE977548" Path="assets/textures/shared/men_room_0Tex_00F538"/>
<Texture CRC="076C7EC4" Path="assets/textures/shared/men_room_10Tex_003C58"/>
<Texture CRC="E5D97CAC" Path="assets/textures/shared/MIZUsin_room_0Tex_00D648"/>
<Texture CRC="F1A0303A" Path="assets/textures/shared/MIZUsin_room_5Tex_0039F8"/>
<Texture CRC="F5965311" Path="assets/textures/shared/MIZUsin_room_5Tex_0041F8"/>
<Texture CRC="02B97BC3" Path="assets/textures/shared/ydan_room_0Tex_00A160"/>
<Texture CRC="F8D10B0D" Path="assets/textures/shared/ydan_room_0Tex_013EE8"/>
<Texture CRC="E7A1CC7A" Path="assets/textures/shared/ydan_room_3Tex_00B0B0"/>
<Texture CRC="EEF48CE3" Path="assets/textures/shared/hairal_niwa_sceneTex_003B90"/>
<Texture CRC="0B474C52" Path="assets/textures/shared/hairal_niwa_sceneTex_006390"/>
<Texture CRC="EA0E143E" Path="assets/textures/shared/hairal_niwa_sceneTex_00BB90"/>
<Texture CRC="1E1C7796" Path="assets/textures/shared/hairal_niwa_sceneTex_010390"/>
<Texture CRC="1CCCEC26" Path="assets/textures/shared/hakasitarelay_room_0Tex_003248"/>
<Texture CRC="18478671" Path="assets/textures/shared/hakasitarelay_room_1Tex_003F20"/>
<Texture CRC="14D633FC" Path="assets/textures/shared/hakasitarelay_room_1Tex_004320"/>
<Texture CRC="06696BA3" Path="assets/textures/shared/hakasitarelay_room_5Tex_002448"/>
<Texture CRC="F1A45E44" Path="assets/textures/shared/hakasitarelay_room_5TLUT_001C28"/>
<Texture CRC="FF4F05A2" Path="assets/textures/shared/hylia_labo_sceneTex_006090"/>
<Texture CRC="E3528291" Path="assets/textures/shared/hylia_labo_sceneTex_009790"/>
<Texture CRC="E77B7076" Path="assets/textures/shared/hylia_labo_sceneTex_00B090"/>
<Texture CRC="FAE07674" Path="assets/textures/shared/syatekijyou_sceneTex_00B0C0"/>
<Texture CRC="FE505C1C" Path="assets/textures/shared/tokinoma_sceneTex_00CFA0"/>
<Texture CRC="EDC94CC5" Path="assets/textures/shared/yousei_izumi_tate_sceneTex_005010"/>
<Texture CRC="097C6E09" Path="assets/textures/shared/hakaana_room_0Tex_004658"/>
<Texture CRC="F736B046" Path="assets/textures/shared/hakaana2_sceneTex_005090"/>
<Texture CRC="0A0840F8" Path="assets/textures/shared/hakaana_ouke_room_0Tex_008FF8"/>
<Texture CRC="F6B480C2" Path="assets/textures/shared/kakusiana_room_0Tex_0032A0"/>
<Texture CRC="0F7107B9" Path="assets/textures/shared/kakusiana_room_10Tex_002BE0"/>
<Texture CRC="00E1272F" Path="assets/textures/shared/kakusiana_room_11Tex_002848"/>
<Texture CRC="FE06E141" Path="assets/textures/shared/kakusiana_room_13Tex_004EC8"/>
<Texture CRC="FA36B5B5" Path="assets/textures/shared/kakusiana_room_13Tex_005EC8"/>
<Texture CRC="140B5908" Path="assets/textures/shared/kinsuta_room_0Tex_007910"/>
<Texture CRC="F731A2AE" Path="assets/textures/shared/souko_room_2Tex_006AE0"/>
<Texture CRC="05E13866" Path="assets/textures/shared/spot00_sceneTex_025018"/>
<Texture CRC="E2BB150D" Path="assets/textures/shared/spot00_sceneTex_026098"/>
<Texture CRC="FB3AB864" Path="assets/textures/shared/spot02_room_1Tex_01C690"/>
<Texture CRC="FE2A9339" Path="assets/textures/shared/spot03_sceneTex_007558"/>
<Texture CRC="E1E08BB8" Path="assets/textures/shared/spot07_room_1Tex_00A3D8"/>
<Texture CRC="F9602353" Path="assets/textures/shared/spot11_sceneTex_0104E0"/>
<Texture CRC="06C34E89" Path="assets/textures/shared/spot11_sceneTex_0184E0"/>
<Texture CRC="18A4B8DC" Path="assets/textures/shared/spot18_room_0Tex_005960"/>
<Texture CRC="0531CE00" Path="assets/textures/shared/spot18_room_0Tex_006960"/>
<Texture CRC="082100CB" Path="assets/textures/shared/spot18_room_0Tex_008160"/>
<Texture CRC="E27F3E02" Path="assets/textures/shared/spot18_room_0Tex_008960"/>
<Texture CRC="0204DD7E" Path="assets/textures/shared/spot18_room_0Tex_009160"/>
<Texture CRC="FE314AB1" Path="assets/textures/shared/spot18_room_0Tex_00A160"/>
<Texture CRC="1C5E4A08" Path="assets/textures/shared/spot18_room_0Tex_00A960"/>
<Texture CRC="13BEE958" Path="assets/textures/shared/spot18_room_0Tex_00B160"/>
<Texture CRC="F29CE795" Path="assets/textures/shared/spot18_room_0Tex_00B960"/>
<Texture CRC="1F8F607F" Path="assets/textures/shared/spot18_room_0Tex_00C160"/>
<Texture CRC="EF3A03C7" Path="assets/textures/shared/spot18_room_0Tex_00DFC8"/>
<Texture CRC="EA1D8AA9" Path="assets/textures/shared/spot18_room_0Tex_00EFC8"/>
<Texture CRC="F35E3461" Path="assets/textures/shared/spot18_room_0Tex_0107C8"/>
<Texture CRC="F654A517" Path="assets/textures/shared/spot18_room_0Tex_0117C8"/>
<Texture CRC="08F3B683" Path="assets/textures/shared/navi_unused_eng"/>
<Texture CRC="1B042EA2" Path="assets/textures/shared/num_1_eng"/>
<Texture CRC="FCC147EE" Path="assets/textures/shared/num_2_eng"/>
<Texture CRC="1BB7390D" Path="assets/textures/shared/num_3_eng"/>
<Texture CRC="1F1D58A1" Path="assets/textures/shared/num_4_eng"/>
<Texture CRC="EA5CE053" Path="assets/textures/shared/num_5_eng"/>
<Texture CRC="136F14C1" Path="assets/textures/shared/num_6_eng"/>
<Texture CRC="06307BDC" Path="assets/textures/shared/num_8_eng"/>
<Texture CRC="085D7D37" Path="assets/textures/shared/fire_medallion_item_name_unused_jpn_1"/>
<Texture CRC="1B0FF238" Path="assets/textures/shared/ice_medallion_item_name_unused_jpn_1"/>
<Texture CRC="ED2E3FA1" Path="assets/textures/shared/piece_of_heart_item_name_unused_jpn_1"/>
<Texture CRC="1F18A8B3" Path="assets/textures/shared/wind_medallion_item_name_unused_jpn_1"/>
<Texture CRC="025DF39F" Path="assets/textures/shared/deku_tree_pause_screen_map_basement_2_left"/>
<Texture CRC="0B27BD0E" Path="assets/textures/shared/fire_temple_room_11_floor_3_minimap"/>
<Texture CRC="07274951" Path="assets/textures/shared/jabu_room_11_minimap"/>
<Texture CRC="F928A833" Path="assets/textures/shared/dungeon_keep_tex_00F0A0"/>
<Texture CRC="1200E6E6" Path="assets/textures/shared/gameplay_dangeon_keepTex_0108A0"/>
<Texture CRC="0DF1B902" Path="assets/textures/shared/gameplay_dangeon_keepTex_0118A0"/>
<Texture CRC="1FC352FB" Path="assets/textures/shared/gameplay_dangeon_keepTex_011AA0"/>
<Texture CRC="ECF41E88" Path="assets/textures/shared/bomb_cap"/>
<Texture CRC="F1BAB6BD" Path="assets/textures/shared/eff_fire"/>
<Texture CRC="0DB371B0" Path="assets/textures/shared/eff_fleck"/>
<Texture CRC="EBF6984E" Path="assets/textures/shared/eff_hit_mark_8"/>
<Texture CRC="E010DCDC" Path="assets/textures/shared/eff_unknown_11"/>
<Texture CRC="F01FE9BF" Path="assets/textures/shared/eff_unknown_6"/>
<Texture CRC="1BFF3C77" Path="assets/textures/shared/hilite_4"/>
<Texture CRC="019C59D3" Path="assets/textures/shared/unknown_circle_6"/>
<Texture CRC="13369F31" Path="assets/textures/shared/unknown_stone_1"/>
<Texture CRC="F807D37A" Path="assets/textures/shared/withered_leaf"/>
<Texture CRC="0FE1897F" Path="assets/textures/shared/roof_man_trouser_pattern"/>
<Texture CRC="0DD9E65B" Path="assets/textures/shared/object_anubiceTex_0036A0"/>
<Texture CRC="FB2A77D8" Path="assets/textures/shared/tex_000014A0"/>
<Texture CRC="E9CDB700" Path="assets/textures/shared/tex_000015C0"/>
<Texture CRC="13328ED0" Path="assets/textures/shared/jabu_objects_11_tlut"/>
<Texture CRC="02148FD1" Path="assets/textures/shared/jabu_objects_tex_00006748"/>
<Texture CRC="1C7F411C" Path="assets/textures/shared/jabu_objects_tex_00006B48"/>
<Texture CRC="185E9456" Path="assets/textures/shared/jabu_objects_tex_00007348"/>
<Texture CRC="FD55F6CE" Path="assets/textures/shared/tex_00005D90"/>
<Texture CRC="F82BD47D" Path="assets/textures/shared/tex_00005E90"/>
<Texture CRC="0A90E8A9" Path="assets/textures/shared/object_blkobjTex_00E890"/>
<Texture CRC="F0FF55E7" Path="assets/textures/shared/object_blkobjTex_00F890"/>
<Texture CRC="E51D3728" Path="assets/textures/shared/object_blkobjTex_010890"/>
<Texture CRC="F5DA5F73" Path="assets/textures/shared/object_blkobjTex_011090"/>
<Texture CRC="F8A3D71A" Path="assets/textures/shared/object_blkobjTex_011890"/>
<Texture CRC="E4CADD69" Path="assets/textures/shared/tex_0000093C"/>
<Texture CRC="01ADC943" Path="assets/textures/shared/bowling_stripes"/>
<Texture CRC="0F544DB7" Path="assets/textures/shared/bowling_wood_panel"/>
<Texture CRC="113583CB" Path="assets/textures/shared/chest_front"/>
<Texture CRC="F1A2C69C" Path="assets/textures/shared/side_and_top"/>
<Texture CRC="19F1F86B" Path="assets/textures/shared/bubble"/>
<Texture CRC="FD8CBFB5" Path="assets/textures/shared/object_bvTex_000A40"/>
<Texture CRC="E698AB0D" Path="assets/textures/shared/tex_00001440"/>
<Texture CRC="E3010489" Path="assets/textures/shared/door_bars_bottom"/>
<Texture CRC="0227663A" Path="assets/textures/shared/falling_stairs_vines"/>
<Texture CRC="F13DA5C6" Path="assets/textures/shared/tex_6F60"/>
<Texture CRC="F5AAEE8F" Path="assets/textures/shared/eye"/>
<Texture CRC="012D961E" Path="assets/textures/shared/object_demo_kekkaiTex_003EA0"/>
<Texture CRC="0E1AAE61" Path="assets/textures/shared/object_demo_kekkaiTex_0092D0"/>
<Texture CRC="0595CE57" Path="assets/textures/shared/object_demo_kekkaiTex_00C8B0"/>
<Texture CRC="F5B75EE0" Path="assets/textures/shared/dnt_stage_eye_half"/>
<Texture CRC="1C09ADB5" Path="assets/textures/shared/dnt_stage_eye_open"/>
<Texture CRC="FC2D69AF" Path="assets/textures/shared/dnt_stage_eye_shut"/>
<Texture CRC="00D41621" Path="assets/textures/shared/object_dnsTex_002CA0"/>
<Texture CRC="048BB86F" Path="assets/textures/shared/object_dnsTex_002FA0"/>
<Texture CRC="F41C90BC" Path="assets/textures/shared/face"/>
<Texture CRC="FB823B8C" Path="assets/textures/shared/tooth"/>
<Texture CRC="183D598F" Path="assets/textures/shared/tex_00000390"/>
<Texture CRC="F059FBC4" Path="assets/textures/shared/crystal_light"/>
<Texture CRC="0F17154F" Path="assets/textures/shared/cloud_normal"/>
<Texture CRC="F4FA1662" Path="assets/textures/shared/enlivening_light"/>
<Texture CRC="F287124B" Path="assets/textures/shared/object_fdTex_0040A8"/>
<Texture CRC="0C795B93" Path="assets/textures/shared/object_fdTex_0048A8"/>
<Texture CRC="E6C9623B" Path="assets/textures/shared/object_fdTex_0052A8"/>
<Texture CRC="E7BD11F6" Path="assets/textures/shared/object_fdTex_0054A8"/>
<Texture CRC="0CF9DE4C" Path="assets/textures/shared/object_fdTex_005B60"/>
<Texture CRC="F4742896" Path="assets/textures/shared/object_fdTex_005F60"/>
<Texture CRC="EFDCEEAC" Path="assets/textures/shared/object_fdTex_009208"/>
<Texture CRC="EB468291" Path="assets/textures/shared/object_fdTLUT_0032A8"/>
<Texture CRC="136C6B3F" Path="assets/textures/shared/volvagia_eye_closed"/>
<Texture CRC="F7A991C6" Path="assets/textures/shared/volvagia_eye_half"/>
<Texture CRC="1C8D0382" Path="assets/textures/shared/volvagia_eye_open"/>
<Texture CRC="EBCDC470" Path="assets/textures/shared/object_fhgTex_003320"/>
<Texture CRC="F9B3E8F8" Path="assets/textures/shared/object_fhgTex_003520"/>
<Texture CRC="FC667630" Path="assets/textures/shared/object_fhgTex_003720"/>
<Texture CRC="032BD3FF" Path="assets/textures/shared/object_fhgTex_003920"/>
<Texture CRC="F8B6C1AC" Path="assets/textures/shared/object_fhgTex_003B20"/>
<Texture CRC="E39BEDB7" Path="assets/textures/shared/object_fhgTex_003BA0"/>
<Texture CRC="139A8DDE" Path="assets/textures/shared/object_fhgTex_003DA0"/>
<Texture CRC="E0F76E96" Path="assets/textures/shared/object_fhgTex_003FA0"/>
<Texture CRC="E2308C38" Path="assets/textures/shared/object_fhgTex_0043A0"/>
<Texture CRC="F16C5CE7" Path="assets/textures/shared/object_fhgTex_0044A0"/>
<Texture CRC="1DAA6D7D" Path="assets/textures/shared/object_fhgTex_004CA0"/>
<Texture CRC="052C37A1" Path="assets/textures/shared/object_fhgTex_00D040"/>
<Texture CRC="16ADB711" Path="assets/textures/shared/object_fhgTex_00D060"/>
<Texture CRC="E4F62E11" Path="assets/textures/shared/fishing_aquarium_glass"/>
<Texture CRC="F4E58988" Path="assets/textures/shared/fishing_rock"/>
<Texture CRC="F38B45BE" Path="assets/textures/shared/fishing_stream_splash_tile_2"/>
<Texture CRC="1EF4A4C7" Path="assets/textures/shared/tex_00007F10"/>
<Texture CRC="EF4478AE" Path="assets/textures/shared/tex_00008190"/>
<Texture CRC="1F9ED88C" Path="assets/textures/shared/tex_00009620"/>
<Texture CRC="120D4CEB" Path="assets/textures/shared/tex_0001E588"/>
<Texture CRC="1819C2E3" Path="assets/textures/shared/gerudo_white_eye_open"/>
<Texture CRC="187F5A07" Path="assets/textures/shared/inside"/>
<Texture CRC="F31B8EC6" Path="assets/textures/shared/outside"/>
<Texture CRC="E170B720" Path="assets/textures/shared/object_geldbTex_002A80"/>
<Texture CRC="F8726693" Path="assets/textures/shared/object_gi_ocarinaTex_000000"/>
<Texture CRC="11CD9560" Path="assets/textures/shared/object_gi_purseTex_000000"/>
<Texture CRC="11E41890" Path="assets/textures/shared/object_gjTex_003F20"/>
<Texture CRC="0FDEEF63" Path="assets/textures/shared/object_gjTex_004F20"/>
<Texture CRC="F027E6B8" Path="assets/textures/shared/object_gjTex_005F20"/>
<Texture CRC="1807BC33" Path="assets/textures/shared/object_gjTex_006F20"/>
<Texture CRC="0137C459" Path="assets/textures/shared/object_gjTex_007320"/>
<Texture CRC="0785F8B5" Path="assets/textures/shared/object_gjTex_007720"/>
<Texture CRC="F2B9D7ED" Path="assets/textures/shared/object_gjTex_007B20"/>
<Texture CRC="EE2D9AD3" Path="assets/textures/shared/phantom_ganon_limb_tex_00AF00"/>
<Texture CRC="F5D0FDB6" Path="assets/textures/shared/phantom_ganon_limb_tex_00B780"/>
<Texture CRC="E6E23524" Path="assets/textures/shared/phantom_ganon_limb_tex_00C080"/>
<Texture CRC="06D756C8" Path="assets/textures/shared/phantom_ganon_limb_tex_00C180"/>
<Texture CRC="EB790765" Path="assets/textures/shared/phantom_ganon_limb_tex_00C200"/>
<Texture CRC="0BDB84E9" Path="assets/textures/shared/object_gol_eye_white"/>
<Texture CRC="0C43D535" Path="assets/textures/shared/flame_smoke"/>
<Texture CRC="19A0E9DD" Path="assets/textures/shared/tomb"/>
<Texture CRC="1B078B44" Path="assets/textures/shared/tex_000131F0"/>
<Texture CRC="FB37D88F" Path="assets/textures/shared/tex_000145F0"/>
<Texture CRC="12FEBA33" Path="assets/textures/shared/tex_0001C270"/>
<Texture CRC="FA9405CB" Path="assets/textures/shared/flagpole_pole_tex"/>
<Texture CRC="F633B54C" Path="assets/textures/shared/horse_ingo_feathering"/>
<Texture CRC="1212D798" Path="assets/textures/shared/horse_ingo_mane"/>
<Texture CRC="0BBCBBD1" Path="assets/textures/shared/horse_ingo_neck"/>
<Texture CRC="E4AB09A4" Path="assets/textures/shared/horse_ingo_nose"/>
<Texture CRC="155B34AF" Path="assets/textures/shared/horse_ingo_nostrils"/>
<Texture CRC="1FDBCD04" Path="assets/textures/shared/horse_ingo_shoulder"/>
<Texture CRC="140B07C2" Path="assets/textures/shared/horse_ingo_thigh"/>
<Texture CRC="0E751A83" Path="assets/textures/shared/epona_eye_closed"/>
<Texture CRC="F7B57DC2" Path="assets/textures/shared/epona_eye_half"/>
<Texture CRC="EC3997C9" Path="assets/textures/shared/epona_eye_open"/>
<Texture CRC="E1917AE8" Path="assets/textures/shared/epona_eye_tlut"/>
<Texture CRC="FCBE0C85" Path="assets/textures/shared/eyebrow_normal"/>
<Texture CRC="E46E0EE9" Path="assets/textures/shared/eyebrow_sad"/>
<Texture CRC="E0D54C1B" Path="assets/textures/shared/eyebrow_surprised"/>
<Texture CRC="EDB600B6" Path="assets/textures/shared/eye_look_down_open"/>
<Texture CRC="E6AF1F5A" Path="assets/textures/shared/eye_look_forward_closed"/>
<Texture CRC="07357091" Path="assets/textures/shared/eye_look_forward_half"/>
<Texture CRC="F4CB241D" Path="assets/textures/shared/eye_look_forward_open"/>
<Texture CRC="EEE39B76" Path="assets/textures/shared/eye_look_left_half"/>
<Texture CRC="E6F6BA5D" Path="assets/textures/shared/eye_look_left_half_2"/>
<Texture CRC="F2FACFC8" Path="assets/textures/shared/eye_look_left_open"/>
<Texture CRC="1FD0ECF4" Path="assets/textures/shared/eye_look_left_open_2"/>
<Texture CRC="0143A162" Path="assets/textures/shared/eye_look_up_open"/>
<Texture CRC="09078953" Path="assets/textures/shared/tex_00002950"/>
<Texture CRC="FC6474FD" Path="assets/textures/shared/tex_00004950"/>
<Texture CRC="F801B290" Path="assets/textures/shared/tex_00006D50"/>
<Texture CRC="E5BD261B" Path="assets/textures/shared/tex_0113A0"/>
<Texture CRC="FFEF0898" Path="assets/textures/shared/adult_era_eyebrow_edge"/>
<Texture CRC="E08E20EF" Path="assets/textures/shared/basket"/>
<Texture CRC="0A7077A5" Path="assets/textures/shared/basket_inside"/>
<Texture CRC="0A1A35B0" Path="assets/textures/shared/pitchfork"/>
<Texture CRC="1A9DA002" Path="assets/textures/shared/unused_eye"/>
<Texture CRC="E707DAA5" Path="assets/textures/shared/cobra_mirror"/>
<Texture CRC="E1D92905" Path="assets/textures/shared/megami_tlut_4"/>
<Texture CRC="0171C9FC" Path="assets/textures/shared/object_jya_objTex_016140"/>
<Texture CRC="1146FA9F" Path="assets/textures/shared/object_jya_objTex_01B740"/>
<Texture CRC="0FBFEC52" Path="assets/textures/shared/tunic"/>
<Texture CRC="1F01FD5F" Path="assets/textures/shared/goron_mask_mouth"/>
<Texture CRC="1A624F3C" Path="assets/textures/shared/skull_mask_eye"/>
<Texture CRC="E639932A" Path="assets/textures/shared/skull_mask_nose"/>
<Texture CRC="045DCE7E" Path="assets/textures/shared/skull_mask_teeth"/>
<Texture CRC="F899C923" Path="assets/textures/shared/zora_mask_eye"/>
<Texture CRC="005CFA91" Path="assets/textures/shared/zora_mask_eye_boarder"/>
<Texture CRC="EAA073A4" Path="assets/textures/shared/zora_mask_mouth"/>
<Texture CRC="1014B94C" Path="assets/textures/shared/bowser"/>
<Texture CRC="14316ABE" Path="assets/textures/shared/ear"/>
<Texture CRC="E801DFF3" Path="assets/textures/shared/fingers"/>
<Texture CRC="F60A069B" Path="assets/textures/shared/hair"/>
<Texture CRC="13B967F5" Path="assets/textures/shared/hair_tlut"/>
<Texture CRC="F3DC387D" Path="assets/textures/shared/skin_gradient"/>
<Texture CRC="1AF86090" Path="assets/textures/shared/unk_circle"/>
<Texture CRC="06A0C03B" Path="assets/textures/shared/seedling"/>
<Texture CRC="FB6AD918" Path="assets/textures/shared/gtg_rotating_ring_platform_outer_circle"/>
<Texture CRC="E7C20460" Path="assets/textures/shared/gtg_statue"/>
<Texture CRC="10F378C1" Path="assets/textures/shared/object_mizu_objectsTex_009720"/>
<Texture CRC="0E732A63" Path="assets/textures/shared/object_mizu_objectsTex_009920"/>
<Texture CRC="E75A57B1" Path="assets/textures/shared/object_mizu_objectsTex_009B20"/>
<Texture CRC="E2BAA950" Path="assets/textures/shared/object_mizu_objectsTex_009D20"/>
<Texture CRC="124ED74F" Path="assets/textures/shared/side"/>
<Texture CRC="1813B52A" Path="assets/textures/shared/stalfos_platform_side"/>
<Texture CRC="1E93EE27" Path="assets/textures/shared/stalfos_platform_top"/>
<Texture CRC="EBF8A4AD" Path="assets/textures/shared/twisted_hall_brick"/>
<Texture CRC="E0917D9F" Path="assets/textures/shared/twisted_hall_design"/>
<Texture CRC="13FDCE5A" Path="assets/textures/shared/tex_00000650"/>
<Texture CRC="E7D33CD8" Path="assets/textures/shared/tex_2180"/>
<Texture CRC="00FBCA3D" Path="assets/textures/shared/tex_00002770"/>
<Texture CRC="0006AE17" Path="assets/textures/shared/tex_000027F0"/>
<Texture CRC="038A2B56" Path="assets/textures/shared/tex_00002930"/>
<Texture CRC="E1C4E71F" Path="assets/textures/shared/tex_00002D30"/>
<Texture CRC="E21FF7CE" Path="assets/textures/shared/tex_00001570"/>
<Texture CRC="FD50BCAB" Path="assets/textures/shared/tex_00004CB0"/>
<Texture CRC="E3CDCA43" Path="assets/textures/shared/tex_00004A08"/>
<Texture CRC="FF914E61" Path="assets/textures/shared/tex_00005808"/>
<Texture CRC="E20931B8" Path="assets/textures/shared/tex_00005848"/>
<Texture CRC="F2B987BA" Path="assets/textures/shared/tex_00005948"/>
<Texture CRC="073D94EE" Path="assets/textures/shared/tex_00006648"/>
<Texture CRC="E1B446AF" Path="assets/textures/shared/tex_00006708"/>
<Texture CRC="E40F4D10" Path="assets/textures/shared/tex_000029B0"/>
<Texture CRC="FDA245E8" Path="assets/textures/shared/tex_000031B0"/>
<Texture CRC="E3A80AEA" Path="assets/textures/shared/tex_00006E60"/>
<Texture CRC="FC019DD5" Path="assets/textures/shared/tex_00004BC8"/>
<Texture CRC="02FFEFD5" Path="assets/textures/shared/tex_00004CC8"/>
<Texture CRC="FFC0FAA2" Path="assets/textures/shared/tex_00004D48"/>
<Texture CRC="E2F47DEE" Path="assets/textures/shared/tex_00004DC8"/>
<Texture CRC="171C63B4" Path="assets/textures/shared/object_owlTLUT_006DA8"/>
<Texture CRC="EE3630F0" Path="assets/textures/shared/object_pohTex_003910"/>
<Texture CRC="0DABC1DA" Path="assets/textures/shared/object_pohTex_004F10"/>
<Texture CRC="E5FD0A28" Path="assets/textures/shared/object_po_composerTex_001450"/>
<Texture CRC="EF4412E4" Path="assets/textures/shared/big_poe_soul"/>
<Texture CRC="EA9487C5" Path="assets/textures/shared/object_po_sistersTex_0082C0"/>
<Texture CRC="0FFF96D2" Path="assets/textures/shared/object_psTex_001F78"/>
<Texture CRC="FBBDDEA3" Path="assets/textures/shared/object_psTex_002178"/>
<Texture CRC="046C7808" Path="assets/textures/shared/windmill_platform_2"/>
<Texture CRC="19A6198D" Path="assets/textures/shared/tex_00000000"/>
<Texture CRC="008CD893" Path="assets/textures/shared/stalfos_bone_detail"/>
<Texture CRC="02743674" Path="assets/textures/shared/stalfos_eye_socket"/>
<Texture CRC="F5B7A4E8" Path="assets/textures/shared/stalfos_nostril"/>
<Texture CRC="E362D972" Path="assets/textures/shared/barbed_wire_fence"/>
<Texture CRC="E1D1A4E5" Path="assets/textures/shared/tex_00000000"/>
<Texture CRC="120FC71C" Path="assets/textures/shared/tex_00000CD0"/>
<Texture CRC="165AEBCE" Path="assets/textures/shared/tex_00000EE0"/>
<Texture CRC="F4C507F2" Path="assets/textures/shared/tex_00004930"/>
<Texture CRC="1FE76F64" Path="assets/textures/shared/tlut_00000EC0"/>
<Texture CRC="E66C6343" Path="assets/textures/shared/bombable_wall"/>
<Texture CRC="17274055" Path="assets/textures/shared/bombable_wall_tlut"/>
<Texture CRC="FFF0BE45" Path="assets/textures/shared/iceberg_side"/>
<Texture CRC="E0DA021F" Path="assets/textures/shared/iceberg_tlut_1"/>
<Texture CRC="03B714A1" Path="assets/textures/shared/object_spot09_objTex_00CC90"/>
<Texture CRC="FB3D207E" Path="assets/textures/shared/object_spot09_objTex_013090"/>
<Texture CRC="FE6E176E" Path="assets/textures/shared/object_spot09_objTex_014090"/>
<Texture CRC="E5D71FA8" Path="assets/textures/shared/desert_colossus_oasis_water"/>
<Texture CRC="F32E094B" Path="assets/textures/shared/rock_tex"/>
<Texture CRC="1FC5A082" Path="assets/textures/shared/crater_rock"/>
<Texture CRC="E24A95E5" Path="assets/textures/shared/tex_00000360"/>
<Texture CRC="E298BE19" Path="assets/textures/shared/tex_000A30"/>
<Texture CRC="09142C41" Path="assets/textures/shared/tex_000C30"/>
<Texture CRC="FA88D2AE" Path="assets/textures/shared/tex_002DC0"/>
<Texture CRC="104A3A15" Path="assets/textures/shared/tex_0035C0"/>
<Texture CRC="E3F7787B" Path="assets/textures/shared/tex_0055C0"/>
<Texture CRC="096DC6FA" Path="assets/textures/shared/tex_000078D8"/>
<Texture CRC="12ABF7E4" Path="assets/textures/shared/tex_000080D8"/>
<Texture CRC="15342705" Path="assets/textures/shared/tex_000082D8"/>
<Texture CRC="EBBC47BE" Path="assets/textures/shared/tex_000084D8"/>
<Texture CRC="1F4A182F" Path="assets/textures/shared/tex_000086D8"/>
<Texture CRC="0955FF43" Path="assets/textures/shared/tex_00008AD8"/>
<Texture CRC="F091DE25" Path="assets/textures/shared/tex_00008B58"/>
<Texture CRC="EEDC8121" Path="assets/textures/shared/tex_00008B98"/>
<Texture CRC="14157980" Path="assets/textures/shared/tex_00008D98"/>
<Texture CRC="FCE55257" Path="assets/textures/shared/tex_00008DD8"/>
<Texture CRC="16DF5B0E" Path="assets/textures/shared/tex_00008E58"/>
<Texture CRC="09E8BCBA" Path="assets/textures/shared/tex_00008ED8"/>
<Texture CRC="FBB42BE9" Path="assets/textures/shared/tex_000092D8"/>
<Texture CRC="0AD02925" Path="assets/textures/shared/tex_00009458"/>
<Texture CRC="F6CB0912" Path="assets/textures/shared/tex_00009498"/>
<Texture CRC="0B37E721" Path="assets/textures/shared/tex_000094D8"/>
<Texture CRC="074E3F53" Path="assets/textures/shared/tex_000098D8"/>
<Texture CRC="E059933F" Path="assets/textures/shared/tex_0000C2D0"/>
<Texture CRC="E7476112" Path="assets/textures/shared/tex_0000EA30"/>
<Texture CRC="16A72FFA" Path="assets/textures/shared/tex_0000F230"/>
<Texture CRC="FECF43DD" Path="assets/textures/shared/tex_000114A8"/>
<Texture CRC="E44B8ECA" Path="assets/textures/shared/tlut_00007730"/>
<Texture CRC="F0C1DC20" Path="assets/textures/shared/tex_00BA38"/>
<Texture CRC="E6C06BA4" Path="assets/textures/shared/brick"/>
<Texture CRC="07B1453C" Path="assets/textures/shared/wolfos_normal_nostril"/>
<Texture CRC="0B6EBF87" Path="assets/textures/shared/back_of_hand"/>
<Texture CRC="1F851EBC" Path="assets/textures/shared/blue_undershirt_gradient_1"/>
<Texture CRC="EBF85021" Path="assets/textures/shared/blue_undershirt_gradient_2"/>
<Texture CRC="E29A9DA3" Path="assets/textures/shared/boot"/>
<Texture CRC="020ED164" Path="assets/textures/shared/boot_shaft"/>
<Texture CRC="0B45B75D" Path="assets/textures/shared/hair"/>
<Texture CRC="FAC9A306" Path="assets/textures/shared/pendant"/>
<Texture CRC="0AD23E74" Path="assets/textures/shared/skin_gradient"/>
<Texture CRC="F6D16BAA" Path="assets/textures/shared/ice_tex_1"/>
<Texture CRC="E32C05B9" Path="assets/textures/shared/ovl_Boss_GanonTex_00E748"/>
<Texture CRC="07F83D5D" Path="assets/textures/shared/ovl_Boss_GanonTex_01FFF8"/>
<Texture CRC="FFDB3A20" Path="assets/textures/shared/bdan_room_1Tex_004CD0"/>
<Texture CRC="E66ECCC5" Path="assets/textures/shared/bdan_room_2Tex_008DC8"/>
<Texture CRC="09658910" Path="assets/textures/shared/bdan_room_4Tex_002A80"/>
<Texture CRC="E0F4E7E2" Path="assets/textures/shared/bdan_room_4Tex_002E80"/>
<Texture CRC="1D736F3D" Path="assets/textures/shared/bdan_room_4Tex_003680"/>
<Texture CRC="122454CC" Path="assets/textures/shared/bdan_boss_room_0TLUT_001E38"/>
<Texture CRC="149D94A9" Path="assets/textures/shared/Bmori1_room_0Tex_0084C8"/>
<Texture CRC="E5FF0E61" Path="assets/textures/shared/Bmori1_room_10Tex_002250"/>
<Texture CRC="FB250BBA" Path="assets/textures/shared/Bmori1_room_12Tex_004DF0"/>
<Texture CRC="0C70CF5B" Path="assets/textures/shared/Bmori1_room_12Tex_0055F0"/>
<Texture CRC="055E0FD2" Path="assets/textures/shared/Bmori1_room_12Tex_005DF0"/>
<Texture CRC="FD68B889" Path="assets/textures/shared/Bmori1_room_15Tex_001290"/>
<Texture CRC="FE6EC2FC" Path="assets/textures/shared/Bmori1_room_3Tex_0037E8"/>
<Texture CRC="F7612ECC" Path="assets/textures/shared/Bmori1_room_3Tex_0038E8"/>
<Texture CRC="1868B444" Path="assets/textures/shared/Bmori1_room_7Tex_007D60"/>
<Texture CRC="EA698E6F" Path="assets/textures/shared/Bmori1_room_7Tex_008D60"/>
<Texture CRC="FF382349" Path="assets/textures/shared/Bmori1_room_7Tex_009560"/>
<Texture CRC="0E9B88C9" Path="assets/textures/shared/Bmori1_room_7Tex_00EF68"/>
<Texture CRC="FFC7C0B0" Path="assets/textures/shared/Bmori1_room_7Tex_010F68"/>
<Texture CRC="1BDC5AF4" Path="assets/textures/shared/night_entrance"/>
<Texture CRC="0FADEF53" Path="assets/textures/shared/ddan_room_0Tex_016898"/>
<Texture CRC="15CDC373" Path="assets/textures/shared/ddan_room_16Tex_002148"/>
<Texture CRC="E6314100" Path="assets/textures/shared/ddan_room_16Tex_003948"/>
<Texture CRC="ED19A083" Path="assets/textures/shared/ddan_room_2Tex_003A60"/>
<Texture CRC="177A387B" Path="assets/textures/shared/ddan_room_7Tex_004EC8"/>
<Texture CRC="16E7D8AD" Path="assets/textures/shared/ddan_room_7Tex_0056C8"/>
<Texture CRC="F056905E" Path="assets/textures/shared/FIRE_bs_room_0Tex_003468"/>
<Texture CRC="EFB00D73" Path="assets/textures/shared/FIRE_bs_room_0Tex_003868"/>
<Texture CRC="0A45A765" Path="assets/textures/shared/FIRE_bs_room_0Tex_003C68"/>
<Texture CRC="160F8D72" Path="assets/textures/shared/FIRE_bs_room_0Tex_004068"/>
<Texture CRC="16A2A385" Path="assets/textures/shared/FIRE_bs_room_0TLUT_002E28"/>
<Texture CRC="19492F7E" Path="assets/textures/shared/FIRE_bs_room_0TLUT_002E48"/>
<Texture CRC="FE67513B" Path="assets/textures/shared/FIRE_bs_sceneTex_004400"/>
<Texture CRC="E1112148" Path="assets/textures/shared/ganon_room_0Tex_004C68"/>
<Texture CRC="1D96DDC1" Path="assets/textures/shared/ganon_room_0Tex_005468"/>
<Texture CRC="FDD8FAFD" Path="assets/textures/shared/ganon_room_1Tex_006370"/>
<Texture CRC="F937B4ED" Path="assets/textures/shared/ganon_room_2Tex_003DF0"/>
<Texture CRC="F957C806" Path="assets/textures/shared/ganon_room_2Tex_0041F0"/>
<Texture CRC="039FAC53" Path="assets/textures/shared/ganon_room_4Tex_005A68"/>
<Texture CRC="1CE19C23" Path="assets/textures/shared/ganon_room_4Tex_006E68"/>
<Texture CRC="E1E99F5E" Path="assets/textures/shared/ganon_room_4Tex_007E68"/>
<Texture CRC="FAF99276" Path="assets/textures/shared/ganon_room_6Tex_007600"/>
<Texture CRC="EBCEEDDE" Path="assets/textures/shared/ganon_room_6Tex_009398"/>
<Texture CRC="F3198C9E" Path="assets/textures/shared/ganon_room_8Tex_005320"/>
<Texture CRC="EAEBAD1E" Path="assets/textures/shared/ganon_room_8Tex_005360"/>
<Texture CRC="F784855A" Path="assets/textures/shared/ganon_room_8Tex_0053E0"/>
<Texture CRC="03A1DE68" Path="assets/textures/shared/ganon_room_8Tex_005FE0"/>
<Texture CRC="F2D57B49" Path="assets/textures/shared/ganon_room_8Tex_0063E0"/>
<Texture CRC="1802D1C4" Path="assets/textures/shared/ganon_room_9Tex_002920"/>
<Texture CRC="EC6B7820" Path="assets/textures/shared/ganon_room_9Tex_002D20"/>
<Texture CRC="0B1F299C" Path="assets/textures/shared/ganon_room_9Tex_003120"/>
<Texture CRC="ED1D707D" Path="assets/textures/shared/ganon_room_9Tex_004520"/>
<Texture CRC="1EA95659" Path="assets/textures/shared/ganon_room_9Tex_004D20"/>
<Texture CRC="022E1BF9" Path="assets/textures/shared/ganon_room_9TLUT_001F18"/>
<Texture CRC="F7DA8D0D" Path="assets/textures/shared/ganontika_room_12Tex_006260"/>
<Texture CRC="FE1D6736" Path="assets/textures/shared/ganontika_room_12Tex_006A60"/>
<Texture CRC="1C850DC7" Path="assets/textures/shared/ganontika_room_14Tex_004F88"/>
<Texture CRC="EF1A2090" Path="assets/textures/shared/ganontika_room_14Tex_005F88"/>
<Texture CRC="133F3E79" Path="assets/textures/shared/ganontika_room_18Tex_009910"/>
<Texture CRC="F682F3AC" Path="assets/textures/shared/ganontika_room_1Tex_0109C0"/>
<Texture CRC="F473A5A6" Path="assets/textures/shared/ganontika_room_1Tex_0139C0"/>
<Texture CRC="F878F52F" Path="assets/textures/shared/ganontika_room_1Tex_0159C0"/>
<Texture CRC="E75EA0A6" Path="assets/textures/shared/ganontika_room_1Tex_0169C0"/>
<Texture CRC="0D45FFA1" Path="assets/textures/shared/ganontika_room_1Tex_0171C0"/>
<Texture CRC="EE0C8482" Path="assets/textures/shared/ganontika_room_2Tex_0037D8"/>
<Texture CRC="F14CEC9A" Path="assets/textures/shared/ganontika_room_2Tex_003FD8"/>
<Texture CRC="1DEB710D" Path="assets/textures/shared/ganontika_room_2Tex_0057D8"/>
<Texture CRC="17EB5C50" Path="assets/textures/shared/ganontika_room_5Tex_003B38"/>
<Texture CRC="0821EBAF" Path="assets/textures/shared/ganontika_sceneTex_020B70"/>
<Texture CRC="0C4C4E7A" Path="assets/textures/shared/ganon_boss_sceneTex_002C18"/>
<Texture CRC="E6E33F16" Path="assets/textures/shared/ganon_demo_sceneTex_006B70"/>
<Texture CRC="13FA05DA" Path="assets/textures/shared/ganon_demo_sceneTex_008770"/>
<Texture CRC="0573B813" Path="assets/textures/shared/ganon_final_sceneTex_00BD80"/>
<Texture CRC="0809C54B" Path="assets/textures/shared/ganon_final_sceneTex_010580"/>
<Texture CRC="EBFA2BF7" Path="assets/textures/shared/ganon_sonogo_room_0Tex_005020"/>
<Texture CRC="1E19EEF1" Path="assets/textures/shared/ganon_sonogo_room_1Tex_004148"/>
<Texture CRC="E6756E4F" Path="assets/textures/shared/ganon_tou_room_0Tex_0124F0"/>
<Texture CRC="1414164C" Path="assets/textures/shared/ganon_tou_room_0Tex_0125F0"/>
<Texture CRC="EC97AEDA" Path="assets/textures/shared/gerudoway_room_1Tex_003710"/>
<Texture CRC="FB2AED2A" Path="assets/textures/shared/gerudoway_room_1Tex_003F10"/>
<Texture CRC="0E483D71" Path="assets/textures/shared/gerudoway_room_3Tex_0092A0"/>
<Texture CRC="14136921" Path="assets/textures/shared/gerudoway_sceneTex_00A520"/>
<Texture CRC="0CBC57C1" Path="assets/textures/shared/gerudoway_sceneTex_00A920"/>
<Texture CRC="F54F1346" Path="assets/textures/shared/gerudoway_sceneTex_00D120"/>
<Texture CRC="F41A1D0A" Path="assets/textures/shared/HIDAN_room_0Tex_004EC0"/>
<Texture CRC="006E448A" Path="assets/textures/shared/HIDAN_room_10Tex_013298"/>
<Texture CRC="FA6AE3E5" Path="assets/textures/shared/HIDAN_room_10Tex_013498"/>
<Texture CRC="E34BC62B" Path="assets/textures/shared/HIDAN_room_10Tex_014498"/>
<Texture CRC="F1AF129D" Path="assets/textures/shared/HIDAN_room_10Tex_015A98"/>
<Texture CRC="F674F9BB" Path="assets/textures/shared/day_entrance"/>
<Texture CRC="EF7F4204" Path="assets/textures/shared/ice_doukutu_room_0Tex_003F30"/>
<Texture CRC="04A40EBE" Path="assets/textures/shared/ice_doukutu_room_0Tex_004730"/>
<Texture CRC="EEB1927B" Path="assets/textures/shared/ice_doukutu_room_0Tex_005730"/>
<Texture CRC="01ECCC43" Path="assets/textures/shared/night_entrance"/>
<Texture CRC="1C3B02D1" Path="assets/textures/shared/jyasinboss_room_1Tex_003E38"/>
<Texture CRC="E796DE50" Path="assets/textures/shared/jyasinboss_room_1Tex_004E38"/>
<Texture CRC="090FAFEA" Path="assets/textures/shared/jyasinboss_room_1Tex_006638"/>
<Texture CRC="F6A98667" Path="assets/textures/shared/jyasinboss_room_1Tex_007638"/>
<Texture CRC="FFAB371F" Path="assets/textures/shared/jyasinzou_room_0Tex_00C928"/>
<Texture CRC="1FBF47DF" Path="assets/textures/shared/jyasinzou_room_15Tex_005BB8"/>
<Texture CRC="EDB05DFB" Path="assets/textures/shared/jyasinzou_room_25Tex_00BA68"/>
<Texture CRC="1BCF4CB0" Path="assets/textures/shared/jyasinzou_room_25Tex_00DA68"/>
<Texture CRC="1283B73F" Path="assets/textures/shared/jyasinzou_room_25Tex_00EE68"/>
<Texture CRC="09E64C46" Path="assets/textures/shared/jyasinzou_room_25Tex_00F268"/>
<Texture CRC="E4C33C7E" Path="assets/textures/shared/jyasinzou_room_25Tex_00F668"/>
<Texture CRC="0A57EFD4" Path="assets/textures/shared/jyasinzou_room_25Tex_00FE68"/>
<Texture CRC="F8E488B4" Path="assets/textures/shared/jyasinzou_room_25Tex_00FF68"/>
<Texture CRC="F171C8C3" Path="assets/textures/shared/jyasinzou_room_25Tex_010368"/>
<Texture CRC="0E92690C" Path="assets/textures/shared/jyasinzou_room_25Tex_010768"/>
<Texture CRC="18CFA919" Path="assets/textures/shared/jyasinzou_room_25Tex_010B68"/>
<Texture CRC="04B37939" Path="assets/textures/shared/jyasinzou_room_25Tex_010F68"/>
<Texture CRC="E81726ED" Path="assets/textures/shared/men_room_0Tex_009138"/>
<Texture CRC="F87A617C" Path="assets/textures/shared/men_room_0Tex_009D38"/>
<Texture CRC="03159CBA" Path="assets/textures/shared/men_room_0Tex_00BD38"/>
<Texture CRC="FACF6006" Path="assets/textures/shared/men_room_10Tex_002C58"/>
<Texture CRC="E7CEF848" Path="assets/textures/shared/men_room_4Tex_005150"/>
<Texture CRC="084BE393" Path="assets/textures/shared/men_room_5Tex_002CD8"/>
<Texture CRC="E542ED36" Path="assets/textures/shared/MIZUsin_room_22Tex_0050E8"/>
<Texture CRC="F89A0650" Path="assets/textures/shared/MIZUsin_room_22Tex_0058E8"/>
<Texture CRC="0CE847B8" Path="assets/textures/shared/MIZUsin_room_22Tex_0060E8"/>
<Texture CRC="026E66BA" Path="assets/textures/shared/MIZUsin_room_22Tex_0080E8"/>
<Texture CRC="1B7FBFA8" Path="assets/textures/shared/ydan_room_0Tex_008160"/>
<Texture CRC="F3D559C7" Path="assets/textures/shared/ydan_room_0Tex_00AD60"/>
<Texture CRC="1CC34199" Path="assets/textures/shared/ydan_room_0Tex_00D960"/>
<Texture CRC="FBCEFFA1" Path="assets/textures/shared/ydan_room_0Tex_00E960"/>
<Texture CRC="102EAF3C" Path="assets/textures/shared/ydan_room_0Tex_00F960"/>
<Texture CRC="ECA63B5E" Path="assets/textures/shared/ydan_room_11Tex_0044D8"/>
<Texture CRC="E23C2118" Path="assets/textures/shared/ydan_room_3Tex_0084B0"/>
<Texture CRC="13A18146" Path="assets/textures/shared/ydan_room_3Tex_00B4B0"/>
<Texture CRC="EF1872E1" Path="assets/textures/shared/ydan_room_6Tex_003EC0"/>
<Texture CRC="04402BB2" Path="assets/textures/shared/bowling_sceneTex_009120"/>
<Texture CRC="FCCF8C69" Path="assets/textures/shared/daiyousei_izumi_sceneTex_004800"/>
<Texture CRC="0270DB33" Path="assets/textures/shared/daiyousei_izumi_sceneTex_005000"/>
<Texture CRC="E7D27EE8" Path="assets/textures/shared/daiyousei_izumi_sceneTex_005800"/>
<Texture CRC="1116A474" Path="assets/textures/shared/daiyousei_izumi_sceneTex_006000"/>
<Texture CRC="F47075BE" Path="assets/textures/shared/daiyousei_izumi_sceneTex_007000"/>
<Texture CRC="F25B1C97" Path="assets/textures/shared/daiyousei_izumi_sceneTex_008000"/>
<Texture CRC="1509487B" Path="assets/textures/shared/daiyousei_izumi_sceneTex_009000"/>
<Texture CRC="173118E0" Path="assets/textures/shared/daiyousei_izumi_sceneTex_00A800"/>
<Texture CRC="1031CF12" Path="assets/textures/shared/daiyousei_izumi_sceneTex_00B000"/>
<Texture CRC="EF1A97CD" Path="assets/textures/shared/hairal_niwa_sceneTex_005B90"/>
<Texture CRC="1A6C8EAA" Path="assets/textures/shared/hairal_niwa_sceneTex_009B90"/>
<Texture CRC="FA1FA822" Path="assets/textures/shared/hairal_niwa_sceneTex_00AB90"/>
<Texture CRC="E180113F" Path="assets/textures/shared/hairal_niwa_sceneTex_00B390"/>
<Texture CRC="15E347EF" Path="assets/textures/shared/hairal_niwa_sceneTex_00C390"/>
<Texture CRC="F243FDE6" Path="assets/textures/shared/hairal_niwa_sceneTex_00CB90"/>
<Texture CRC="1A6E654C" Path="assets/textures/shared/hairal_niwa_sceneTex_00DB90"/>
<Texture CRC="E2CCFF01" Path="assets/textures/shared/hakasitarelay_room_0Tex_004448"/>
<Texture CRC="F55F267A" Path="assets/textures/shared/hakasitarelay_room_0Tex_004C48"/>
<Texture CRC="1475DFC1" Path="assets/textures/shared/hakasitarelay_room_5Tex_001C48"/>
<Texture CRC="FE5FCC6C" Path="assets/textures/shared/hylia_labo_sceneTex_00A090"/>
<Texture CRC="E7B2C99B" Path="assets/textures/shared/hylia_labo_sceneTex_010090"/>
<Texture CRC="E709DC89" Path="assets/textures/shared/mahouya_sceneTex_008A20"/>
<Texture CRC="F95560D1" Path="assets/textures/shared/mahouya_sceneTex_009A20"/>
<Texture CRC="E97CF75C" Path="assets/textures/shared/syatekijyou_sceneTex_005CC0"/>
<Texture CRC="F5A93AC0" Path="assets/textures/shared/syatekijyou_sceneTex_00B2C0"/>
<Texture CRC="1431869F" Path="assets/textures/shared/takaraya_room_1Tex_0017F8"/>
<Texture CRC="ED4B9B85" Path="assets/textures/shared/takaraya_room_3Tex_001818"/>
<Texture CRC="065983BD" Path="assets/textures/shared/takaraya_room_3Tex_002018"/>
<Texture CRC="FBF2900E" Path="assets/textures/shared/takaraya_room_4Tex_002820"/>
<Texture CRC="04B5CAB9" Path="assets/textures/shared/takaraya_sceneTex_0069B0"/>
<Texture CRC="1EAD2B3F" Path="assets/textures/shared/yousei_izumi_tate_sceneTex_002810"/>
<Texture CRC="10AC997A" Path="assets/textures/shared/yousei_izumi_tate_sceneTex_004810"/>
<Texture CRC="FA386200" Path="assets/textures/shared/yousei_izumi_tate_sceneTex_005810"/>
<Texture CRC="F5588B60" Path="assets/textures/shared/yousei_izumi_tate_sceneTex_006010"/>
<Texture CRC="F1079CA6" Path="assets/textures/shared/hakaana_ouke_room_0Tex_005730"/>
<Texture CRC="15FF3E57" Path="assets/textures/shared/kakusiana_room_0Tex_004AA0"/>
<Texture CRC="074D1FBE" Path="assets/textures/shared/kakusiana_room_11Tex_003048"/>
<Texture CRC="026535FE" Path="assets/textures/shared/kakusiana_room_13Tex_001950"/>
<Texture CRC="EC4396CB" Path="assets/textures/shared/kakusiana_room_13Tex_002950"/>
<Texture CRC="032612AE" Path="assets/textures/shared/kakusiana_room_1Tex_002A18"/>
<Texture CRC="19060D66" Path="assets/textures/shared/kinsuta_room_0Tex_009D10"/>
<Texture CRC="051A2F57" Path="assets/textures/shared/turibori_sceneTex_006BE0"/>
<Texture CRC="164EE952" Path="assets/textures/shared/souko_room_0Tex_005CF8"/>
<Texture CRC="E5EA8DF4" Path="assets/textures/shared/souko_room_0Tex_006CF8"/>
<Texture CRC="FE9507F9" Path="assets/textures/shared/souko_room_0Tex_0078F8"/>
<Texture CRC="0B9E9000" Path="assets/textures/shared/souko_room_1Tex_005118"/>
<Texture CRC="0931555F" Path="assets/textures/shared/spot00_sceneTex_015E98"/>
<Texture CRC="19B89C1E" Path="assets/textures/shared/spot00_sceneTex_019B98"/>
<Texture CRC="EEDDBDB2" Path="assets/textures/shared/spot00_sceneTex_01C198"/>
<Texture CRC="F3FED154" Path="assets/textures/shared/night_window"/>
<Texture CRC="17AC7C31" Path="assets/textures/shared/spot01_sceneTex_015350"/>
<Texture CRC="0D064FC5" Path="assets/textures/shared/spot01_sceneTex_01AF50"/>
<Texture CRC="0DE5167D" Path="assets/textures/shared/spot02_room_1Tex_00CD08"/>
<Texture CRC="FA142018" Path="assets/textures/shared/spot02_room_1Tex_00DD08"/>
<Texture CRC="E4A977DC" Path="assets/textures/shared/spot02_room_1Tex_015D08"/>
<Texture CRC="E3942257" Path="assets/textures/shared/spot02_room_1Tex_017988"/>
<Texture CRC="F2CAD1EA" Path="assets/textures/shared/spot02_sceneTex_00B880"/>
<Texture CRC="0E74591F" Path="assets/textures/shared/spot03_sceneTex_007158"/>
<Texture CRC="00EADDE9" Path="assets/textures/shared/spot04_room_0Tex_00E108"/>
<Texture CRC="FA47E062" Path="assets/textures/shared/spot04_room_0Tex_011F08"/>
<Texture CRC="1678CB21" Path="assets/textures/shared/spot04_room_0Tex_012F08"/>
<Texture CRC="01683929" Path="assets/textures/shared/spot04_room_0Tex_013108"/>
<Texture CRC="067BB229" Path="assets/textures/shared/spot04_room_0Tex_013708"/>
<Texture CRC="03D87A4A" Path="assets/textures/shared/spot04_room_0Tex_013F08"/>
<Texture CRC="E58EA3E2" Path="assets/textures/shared/spot04_room_0Tex_014308"/>
<Texture CRC="EAE00973" Path="assets/textures/shared/spot04_room_0Tex_015B08"/>
<Texture CRC="F4ECF576" Path="assets/textures/shared/spot04_room_0Tex_017108"/>
<Texture CRC="0FC9BA00" Path="assets/textures/shared/spot04_room_0Tex_01A290"/>
<Texture CRC="ED61909F" Path="assets/textures/shared/spot05_sceneTex_012360"/>
<Texture CRC="095BF721" Path="assets/textures/shared/spot05_sceneTex_012B60"/>
<Texture CRC="18624125" Path="assets/textures/shared/day_entrance"/>
<Texture CRC="1E231A50" Path="assets/textures/shared/spot07_room_1Tex_009BD8"/>
<Texture CRC="11DAEF83" Path="assets/textures/shared/spot09_sceneTex_004460"/>
<Texture CRC="F1435125" Path="assets/textures/shared/spot10_room_1Tex_003FA0"/>
<Texture CRC="E1DD509D" Path="assets/textures/shared/spot10_room_1Tex_005FA0"/>
<Texture CRC="1670C796" Path="assets/textures/shared/spot10_room_1Tex_007C30"/>
<Texture CRC="E2117A16" Path="assets/textures/shared/spot10_room_2Tex_0023E8"/>
<Texture CRC="F6CD3EBE" Path="assets/textures/shared/spot10_room_2Tex_0033E8"/>
<Texture CRC="E07F7031" Path="assets/textures/shared/spot10_room_2Tex_0043E8"/>
<Texture CRC="093B9736" Path="assets/textures/shared/spot11_sceneTex_010CE0"/>
<Texture CRC="E1DE2499" Path="assets/textures/shared/gSpot12_00DE78Tex"/>
<Texture CRC="0C51F88C" Path="assets/textures/shared/spot12_room_0Tex_008AB0"/>
<Texture CRC="FC5268BF" Path="assets/textures/shared/spot12_room_0Tex_00C6B0"/>
<Texture CRC="06111A72" Path="assets/textures/shared/spot12_room_0Tex_00EAB0"/>
<Texture CRC="07DCC6CC" Path="assets/textures/shared/spot12_room_0TLUT_008A90"/>
<Texture CRC="19902C03" Path="assets/textures/shared/spot12_sceneTex_007678"/>
<Texture CRC="E1966A84" Path="assets/textures/shared/spot12_sceneTex_008E78"/>
<Texture CRC="EA5FB636" Path="assets/textures/shared/spot12_sceneTLUT_006650"/>
<Texture CRC="F406FE30" Path="assets/textures/shared/spot16_sceneTex_011798"/>
<Texture CRC="186ACD1D" Path="assets/textures/shared/spot17_room_1Tex_00F4D8"/>
<Texture CRC="1EDAC566" Path="assets/textures/shared/spot18_room_0Tex_004960"/>
<Texture CRC="0C1A5B4A" Path="assets/textures/shared/spot18_room_0Tex_005160"/>
<Texture CRC="F1D9EAA3" Path="assets/textures/shared/spot18_room_0Tex_005560"/>
<Texture CRC="1B64BF02" Path="assets/textures/shared/spot18_room_1Tex_002868"/>
<Texture CRC="1CAAD361" Path="assets/textures/shared/spot18_room_1Tex_003068"/>
<Texture CRC="10B77A2A" Path="assets/textures/shared/syotes_room_0Tex_0039E8"/>
<Texture CRC="1718FD0E" Path="assets/textures/shared/syotes_room_0Tex_00A9E8"/>
<Texture CRC="17FA6F46" Path="assets/textures/shared/know_it_all_bros_house2"/>
<Texture CRC="03FF772F" Path="assets/textures/shared/know_it_all_bros_house2_tlut"/>
<Texture CRC="F0A5349C" Path="assets/textures/shared/num_7_fra"/>
<Texture CRC="EE77493E" Path="assets/textures/shared/put_away_ger"/>
<Texture CRC="ED123044" Path="assets/textures/shared/stop_eng"/>
<Texture CRC="E93EBAAC" Path="assets/textures/shared/pause_save_2_0_ger"/>
<Texture CRC="E7A67A7F" Path="assets/textures/shared/cucco_icon"/>
<Texture CRC="0C1D4804" Path="assets/textures/shared/pocket_egg"/>
<Texture CRC="FAA79704" Path="assets/textures/shared/bomb_item_name_fra"/>
<Texture CRC="E8908EDA" Path="assets/textures/shared/haunted_wasteland_minimap"/>
<Texture CRC="FFBFEAD1" Path="assets/textures/shared/fire_temple_room_13_floor_3_minimap"/>
<Texture CRC="E17C45AB" Path="assets/textures/shared/fire_temple_room_5_floor_3_minimap"/>
<Texture CRC="19FCCE06" Path="assets/textures/shared/spirit_temple_room_19_minimap"/>
<Texture CRC="1194CF22" Path="assets/textures/shared/water_temple_room_12_basement_1_minimap"/>
<Texture CRC="117BE77F" Path="assets/textures/shared/water_temple_room_14_basement_1_minimap"/>
<Texture CRC="EE5421F6" Path="assets/textures/shared/water_temple_room_15_basement_1_minimap"/>
<Texture CRC="F089CFF3" Path="assets/textures/shared/water_temple_room_1_basement_1_minimap"/>
<Texture CRC="0E364878" Path="assets/textures/shared/water_temple_room_21_floor_1_minimap"/>
<Texture CRC="0698CC33" Path="assets/textures/shared/water_temple_room_5_floor_1_minimap"/>
<Texture CRC="13324501" Path="assets/textures/shared/water_temple_room_6_floor_2_minimap"/>
<Texture CRC="1B45A7DD" Path="assets/textures/shared/water_temple_room_9_basement_1_minimap"/>
<Texture CRC="12D4F84F" Path="assets/textures/shared/msg_char_20_space"/>
<Texture CRC="1DEA6483" Path="assets/textures/shared/name_eng"/>
<Texture CRC="095A9A1C" Path="assets/textures/shared/no_file_to_copy_ger"/>
<Texture CRC="00C03B39" Path="assets/textures/shared/which_file_1_ger"/>
</Root>

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

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, LUS::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)LUS::AnimationType::Link);
writer->Write((uint16_t)linkAnim->frameCount);
writer->Write((uint32_t)linkAnim->segmentAddress);
}
else if (curveAnim != nullptr)
{
writer->Write((uint32_t)LUS::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)LUS::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)LUS::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, LUS::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/DiskFile.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, LUS::ResourceType::SOH_AudioSample, 2);
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, LUS::ResourceType::SOH_Audio, 2);
// 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, LUS::ResourceType::SOH_AudioSoundFont, 2);
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, LUS::ResourceType::SOH_AudioSequence, 2);
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, LUS::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, LUS::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,84 +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, LUS::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].normX);
writer->Write(col->polygons[i].normY);
writer->Write(col->polygons[i].normZ);
writer->Write(col->polygons[i].dist);
}
writer->Write((uint32_t)col->PolygonTypes.size());
for (uint16_t i = 0; i < col->PolygonTypes.size(); i++) {
writer->Write(col->PolygonTypes[i].data[1]);
writer->Write(col->PolygonTypes[i].data[0]);
}
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,444 +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, LUS::ResourceType::SOH_Cutscene);
writer->Write((uint32_t)0);
const auto 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 (const auto& e : cs->commands[i]->entries)
{
CutsceneCameraPoint* point = (CutsceneCameraPoint*)e;
writer->Write(CMD_BBH(point->continueFlag, point->cameraRoll, point->nextPointFrame));
writer->Write(point->viewAngle);
writer->Write(CMD_HH(point->posX, point->posY));
writer->Write(CMD_HH(point->posZ, point->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 (const auto& e : cs->commands[i]->entries)
{
CutsceneCameraPoint* point = (CutsceneCameraPoint*)e;
writer->Write(CMD_BBH(point->continueFlag, point->cameraRoll, point->nextPointFrame));
writer->Write(point->viewAngle);
writer->Write(CMD_HH(point->posX, point->posY));
writer->Write(CMD_HH(point->posZ, point->unused));
}
break;
}
case (uint32_t)CutsceneCommands::Misc:
{
writer->Write(CS_CMD_MISC);
writer->Write((uint32_t)CMD_W((cs->commands[i])->entries.size()));
for (const auto& e : cs->commands[i]->entries) //All in OOT seem to only have 1 entry
{
CutsceneSubCommandEntry_GenericCmd* cmd = (CutsceneSubCommandEntry_GenericCmd*)e;
writer->Write(CMD_HH(cmd->base, cmd->startFrame));
writer->Write(CMD_HH(cmd->endFrame, cmd->pad));
writer->Write(CMD_W(cmd->unused1));
writer->Write(CMD_W(cmd->unused2));
writer->Write(CMD_W(cmd->unused3));
writer->Write(CMD_W(cmd->unused4));
writer->Write(CMD_W(cmd->unused5));
writer->Write(CMD_W(cmd->unused6));
writer->Write(CMD_W(cmd->unused7));
writer->Write(CMD_W(cmd->unused8));
writer->Write(CMD_W(cmd->unused9));
writer->Write(CMD_W(cmd->unused10));
}
break;
}
case (uint32_t)CutsceneCommands::SetLighting:
{
writer->Write(CS_CMD_SET_LIGHTING);
writer->Write((uint32_t)CMD_W((cs->commands[i])->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_GenericCmd* cmd = (CutsceneSubCommandEntry_GenericCmd*)e;
writer->Write(CMD_HH(cmd->base, cmd->startFrame));
writer->Write(CMD_HH(cmd->endFrame, cmd->pad));
writer->Write(CMD_W(cmd->unused1));
writer->Write(CMD_W(cmd->unused2));
writer->Write(CMD_W(cmd->unused3));
writer->Write(CMD_W(cmd->unused4));
writer->Write(CMD_W(cmd->unused5));
writer->Write(CMD_W(cmd->unused6));
writer->Write(CMD_W(cmd->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 (const auto& e : cs->commands[i]->entries)
{
CutsceneCameraPoint* point = (CutsceneCameraPoint*)e;
writer->Write(CMD_BBH(point->continueFlag, point->cameraRoll, point->nextPointFrame));
writer->Write(point->viewAngle);
writer->Write(CMD_HH(point->posX, point->posY));
writer->Write(CMD_HH(point->posZ, point->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 (const auto& e : cs->commands[i]->entries)
{
CutsceneCameraPoint* point = (CutsceneCameraPoint*)e;
writer->Write(CMD_BBH(point->continueFlag, point->cameraRoll, point->nextPointFrame));
writer->Write(point->viewAngle);
writer->Write(CMD_HH(point->posX, point->posY));
writer->Write(CMD_HH(point->posZ, point->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(((CutsceneCommand_Rumble*)cs->commands[i])->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_Rumble* r = (CutsceneSubCommandEntry_Rumble*)e;
writer->Write(CMD_HH(r->base, r->startFrame));
writer->Write(CMD_HBB(e->endFrame, r->unk_06, r->unk_07));
writer->Write(CMD_BBH(r->unk_08, r->unk_09, r->unk_0A));
}
break;
}
case 0x15://Both unused in OoT
case 0x1A://(uint32_t)CutsceneCommands::Unknown:
{
#if 0
CutsceneCommandUnknown* cmdUnk = (CutsceneCommandUnknown*)cs->commands[i];
writer->Write((uint32_t)cs->commands[i]->commandID);
writer->Write((uint32_t)cmdUnk->entries.size());
for (const 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));
}
#endif
}
break;
case (uint32_t)CutsceneCommands::Textbox:
{
writer->Write(CS_CMD_TEXTBOX);
writer->Write((uint32_t)CMD_W((cs->commands[i])->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_TextBox* textBox = (CutsceneSubCommandEntry_TextBox*)e;
if (textBox->base == 0xFFFF) // CS_TEXT_NONE
{
writer->Write(CMD_HH(0xFFFF, textBox->startFrame));
writer->Write(CMD_HH(textBox->endFrame, 0xFFFF));
writer->Write(CMD_HH(0xFFFF, 0xFFFF));
}
else // CS_TEXT_DISPLAY_TEXTBOX
{
writer->Write(CMD_HH(textBox->base, textBox->startFrame));
writer->Write(CMD_HH(textBox->endFrame, textBox->type));
writer->Write(CMD_HH(textBox->textId1, textBox->textId2));
}
}
break;
}
case 10: //ActorAction0
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(cs->commands[i]->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_ActorAction* actorAct = (CutsceneSubCommandEntry_ActorAction*)e;
writer->Write(CMD_HH(actorAct->base, 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::PlayBGM:
{
writer->Write(CS_CMD_PLAYBGM);
writer->Write((uint32_t)CMD_W(cs->commands[i]->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_GenericCmd* cmd = (CutsceneSubCommandEntry_GenericCmd*)e;
writer->Write(CMD_HH(cmd->base, cmd->startFrame));
writer->Write(CMD_HH(cmd->endFrame, cmd->pad));
writer->Write(CMD_W(cmd->unused1));
writer->Write(CMD_W(cmd->unused2));
writer->Write(CMD_W(cmd->unused3));
writer->Write(CMD_W(cmd->unused4));
writer->Write(CMD_W(cmd->unused5));
writer->Write(CMD_W(cmd->unused6));
writer->Write(CMD_W(cmd->unused7));
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(cs->commands[i]->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_GenericCmd* cmd = (CutsceneSubCommandEntry_GenericCmd*)e;
writer->Write(CMD_HH(cmd->base, cmd->startFrame));
writer->Write(CMD_HH(cmd->endFrame, cmd->pad));
writer->Write(CMD_W(cmd->unused1));
writer->Write(CMD_W(cmd->unused2));
writer->Write(CMD_W(cmd->unused3));
writer->Write(CMD_W(cmd->unused4));
writer->Write(CMD_W(cmd->unused5));
writer->Write(CMD_W(cmd->unused6));
writer->Write(CMD_W(cmd->unused7));
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(cs->commands[i]->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_GenericCmd* cmd = (CutsceneSubCommandEntry_GenericCmd*)e;
writer->Write(CMD_HH(cmd->base, cmd->startFrame));
writer->Write(CMD_HH(cmd->endFrame, cmd->pad));
writer->Write(CMD_W(cmd->unused1));
writer->Write(CMD_W(cmd->unused2));
writer->Write(CMD_W(cmd->unused3));
writer->Write(CMD_W(cmd->unused4));
writer->Write(CMD_W(cmd->unused5));
writer->Write(CMD_W(cmd->unused6));
writer->Write(CMD_W(cmd->unused7));
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(cs->commands[i]->entries.size()));
for (const auto& e : cs->commands[i]->entries)
{
CutsceneSubCommandEntry_SetTime* t = (CutsceneSubCommandEntry_SetTime*)e;
writer->Write(CMD_HH(t->base, t->startFrame));
writer->Write(CMD_HBB(t->endFrame, t->hour, t->minute));
writer->Write((uint32_t)CMD_W(t->unk_08));
}
break;
}
case (uint32_t)CutsceneCommands::Terminator:
{
CutsceneCommand_Terminator* t = (CutsceneCommand_Terminator*)cs->commands[i];
writer->Write(CS_CMD_TERMINATOR);
writer->Write((uint32_t)1);
writer->Write(CMD_HH(t->base, t->startFrame));
writer->Write(CMD_HH(t->endFrame, t->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);
const auto endStream = writer->GetBaseAddress();
writer->Seek((uint32_t)currentStream - 4, SeekOffsetType::Start);
writer->Write((uint32_t)((endStream - currentStream) / 4));
writer->Seek((uint32_t)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/DiskFile.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, LUS::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() && !DiskFile::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() && !DiskFile::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() && !DiskFile::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, LUS::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, LUS::ResourceType resType, int32_t 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,14 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZArray.h"
#include "stdint.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, LUS::ResourceType resType, int32_t resVersion = 0);
};

View File

@ -1,329 +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/DiskFile.h>
#include <Utils/Directory.h>
#include <Utils/MemoryStream.h>
#include <Utils/BinaryWriter.h>
#include <Utils/BitConverter.h>
#include <bit>
#include <mutex>
std::string otrFileName = "oot.otr";
std::shared_ptr<LUS::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 (DiskFile::Exists(otrFileName))
otrArchive = std::shared_ptr<LUS::Archive>(new LUS::Archive(otrFileName, true));
else
otrArchive = LUS::Archive::CreateArchive(otrFileName, 40000);
auto lst = Directory::ListFiles("Extract");
for (auto item : lst)
{
auto fileData = DiskFile::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();
std::vector<uint8_t> romData = DiskFile::ReadAllBytes(romPath);
BitConverter::RomToBigEndian(romData.data(), romData.size());
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 = LUS::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 (DiskFile::Exists("soh.otr")) {
return;
}
const auto& lst = Directory::ListFiles("Extract");
std::shared_ptr<LUS::Archive> sohOtr = LUS::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 = DiskFile::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 = DiskFile::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
DiskFile::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)
DiskFile::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<LUS::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, LUS::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, LUS::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, LUS::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,521 +0,0 @@
#include "RoomExporter.h"
#include "Utils/BinaryWriter.h"
#include "Utils/MemoryStream.h"
#include <Utils/DiskFile.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, LUS::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 (const auto& entry : cmdSetActorList->actorList->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.params);
}
}
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.params);
}
}
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, LUS::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, LUS::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, LUS::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, LUS::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<LUS::ResourceType, uint32_t> resourceVersions;
void InitVersionInfo()
{
resourceVersions = std::map<LUS::ResourceType, uint32_t> {
{ LUS::ResourceType::SOH_Animation, 0 },
{ LUS::ResourceType::Texture, 0 },
{ LUS::ResourceType::SOH_PlayerAnimation, 0 },
{ LUS::ResourceType::DisplayList, 0 },
{ LUS::ResourceType::SOH_Room, 0 },
{ LUS::ResourceType::SOH_CollisionHeader, 0 },
{ LUS::ResourceType::SOH_Skeleton, 0 },
{ LUS::ResourceType::SOH_SkeletonLimb, 0 },
{ LUS::ResourceType::Matrix, 0 },
{ LUS::ResourceType::SOH_Path, 0 },
{ LUS::ResourceType::Vertex, 0 },
{ LUS::ResourceType::SOH_Cutscene, 0 },
{ LUS::ResourceType::Array, 0 },
{ LUS::ResourceType::SOH_Text, 0 },
{ LUS::ResourceType::Blob, 0 },
};
}

View File

@ -1,7 +0,0 @@
#pragma once
#include <map>
#include <vector>
#include "src/resource/Resource.h"
extern std::map<LUS::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, LUS::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, LUS::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,78 +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 BuildSohOtr(zapd_exe=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, "botr", "-se", "OTR", "--norom"]
print(exec_cmd)
exitValue = subprocess.call(exec_cmd)
if exitValue != 0:
print("\n")
print("Error when building soh.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")
parser.add_argument("--norom", help="Generate only soh.otr to be bundled to the game", dest="norom", action="store_true")
args = parser.parse_args()
if args.norom:
if (os.path.exists("Extract")):
shutil.rmtree("Extract")
BuildSohOtr(args.zapd_exe)
return
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,100 +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_MQ] = RomVersion("CFG/filelists/gamecube_pal.txt", 0x7170, "GC_MQ_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")
ROM_INFO_TABLE[Checksums.OOT_PAL_10] = RomVersion("CFG/filelists/pal_oot.txt", 0x7950, "N64_PAL_10")
ROM_INFO_TABLE[Checksums.OOT_PAL_11] = RomVersion("CFG/filelists/pal_oot.txt", 0x7950, "N64_PAL_11")
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

1
ZAPDTR Submodule

@ -0,0 +1 @@
Subproject commit 9b8e224dac83aa8e47a688884ad48725f18fc293

View File

@ -1,84 +0,0 @@
---
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
CommentPragmas: '^ (IWYU pragma:|NOLINT)'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ ]
IncludeCategories:
- Regex: '^<[Ww]indows\.h>$'
Priority: 1
- Regex: '^<'
Priority: 2
- Regex: '^"'
Priority: 3
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
UseTab: AlignWithSpaces
...

341
ZAPDTR/.gitignore vendored
View File

@ -1,341 +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

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/ZAPDTR
branch = master
commit = d4c35b90aed66eeed61066b4b76e488bfab52b4d
parent = 9d17e19a1dcf2b5c6cef0d3c93816f98a280eb58
method = rebase
cmdver = 0.4.3

View File

@ -1,76 +0,0 @@
#include "CollisionExporter.h"
void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] const fs::path& outPath,
BinaryWriter* writer)
{
ZCollisionHeader* col = (ZCollisionHeader*)res;
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(col->numVerts);
writer->Write(col->vtxAddress);
writer->Write(col->numPolygons);
writer->Write(col->polyAddress);
writer->Write(col->polyTypeDefAddress);
writer->Write(col->camDataAddress);
writer->Write(col->numWaterBoxes);
writer->Write(col->waterBoxAddress);
writer->Write(col->vtxSegmentOffset);
writer->Write(col->polySegmentOffset);
writer->Write(col->polyTypeDefSegmentOffset);
writer->Write(col->camDataSegmentOffset);
writer->Write(col->waterBoxSegmentOffset);
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(col->vtxSegmentOffset, SeekOffsetType::Start);
for (uint16_t i = 0; i < col->vertices.size(); i++)
{
for (uint32_t j = 0; j < col->vertices[i].dimensions; j++)
{
writer->Write(col->vertices[i].scalars[j].scalarData.s16);
}
}
writer->Seek(col->polySegmentOffset, SeekOffsetType::Start);
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].normX);
writer->Write(col->polygons[i].normY);
writer->Write(col->polygons[i].normZ);
writer->Write(col->polygons[i].dist);
}
writer->Seek(col->polyTypeDefSegmentOffset, SeekOffsetType::Start);
for (const auto& poly : col->polygonTypes)
{
writer->Write(poly.data[0]);
writer->Write(poly.data[1]);
}
writer->Seek(col->camDataSegmentOffset, SeekOffsetType::Start);
for (auto entry : col->camData->entries)
{
writer->Write(entry->cameraSType);
writer->Write(entry->numData);
writer->Write(entry->cameraPosDataSeg);
}
writer->Seek(oldOffset, SeekOffsetType::Start);
}

View File

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

View File

@ -1,160 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{65608eb0-1a47-45ad-ab66-192fb64c762c}</ProjectGuid>
<RootNamespace>ExporterTest</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>ExporterExample</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\ZAPD\;$(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="CollisionExporter.h" />
<ClInclude Include="TextureExporter.h" />
<ClInclude Include="RoomExporter.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CollisionExporter.cpp" />
<ClCompile Include="TextureExporter.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="RoomExporter.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="TextureExporter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="RoomExporter.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="CollisionExporter.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="TextureExporter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="RoomExporter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="CollisionExporter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -1,79 +0,0 @@
#include "CollisionExporter.h"
#include "Globals.h"
#include "RoomExporter.h"
#include "TextureExporter.h"
enum class ExporterFileMode
{
ModeExample1 = (int)ZFileMode::Custom + 1,
ModeExample2 = (int)ZFileMode::Custom + 2,
ModeExample3 = (int)ZFileMode::Custom + 3,
};
static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileMode)
{
if (buildMode == "me1")
fileMode = (ZFileMode)ExporterFileMode::ModeExample1;
else if (buildMode == "me2")
fileMode = (ZFileMode)ExporterFileMode::ModeExample2;
else if (buildMode == "me3")
fileMode = (ZFileMode)ExporterFileMode::ModeExample3;
}
static void ExporterParseArgs([[maybe_unused]] int argc, char* argv[], int& i)
{
std::string arg = argv[i];
if (arg == "--do-x")
{
}
else if (arg == "--do-y")
{
}
}
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::ModeExample1)
return true;
else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample2)
return true;
else if (fileMode == (ZFileMode)ExporterFileMode::ModeExample3)
return true;
return false;
}
static void ExporterFileBegin(ZFile* file)
{
printf("ExporterFileBegin() called on ZFile %s.\n", file->GetName().c_str());
}
static void ExporterFileEnd(ZFile* file)
{
printf("ExporterFileEnd() called on ZFile %s.\n", file->GetName().c_str());
}
static 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->parseArgsFunc = ExporterParseArgs;
exporterSet->beginFileFunc = ExporterFileBegin;
exporterSet->endFileFunc = ExporterFileEnd;
exporterSet->exporters[ZResourceType::Texture] = new ExporterExample_Texture();
exporterSet->exporters[ZResourceType::Room] = new ExporterExample_Room();
exporterSet->exporters[ZResourceType::CollisionHeader] = new ExporterExample_Collision();
Globals::AddExporter("EXAMPLE", exporterSet);
}
// When ZAPD starts up, it will automatically call the below function, which in turn sets up our
// exporters.
REGISTER_EXPORTER(ImportExporters);

View File

@ -1,28 +0,0 @@
# Only used for standalone compilation, usually inherits these from the main makefile
CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17
SRC_DIRS := $(shell find . -type d -not -path "*build*")
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h))
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
LIB := ExporterTest.a
# create build directories
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
all: $(LIB)
clean:
rm -rf build $(LIB)
format:
clang-format-11 -i $(CPP_FILES) $(H_FILES)
.PHONY: all clean format
build/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD -I ../ZAPDUtils -I ../lib/tinyxml2 -c $(OUTPUT_OPTION) $<
$(LIB): $(O_FILES)
$(AR) rcs $@ $^

View File

@ -1,372 +0,0 @@
#include "RoomExporter.h"
#include "CollisionExporter.h"
#include "Utils/BinaryWriter.h"
#include <Utils/DiskFile.h>
#include "Utils/MemoryStream.h"
#include "ZRoom/Commands/SetCameraSettings.h"
#include "ZRoom/Commands/SetCollisionHeader.h"
#include "ZRoom/Commands/SetCsCamera.h"
#include "ZRoom/Commands/SetEchoSettings.h"
#include "ZRoom/Commands/SetEntranceList.h"
#include "ZRoom/Commands/SetLightingSettings.h"
#include "ZRoom/Commands/SetMesh.h"
#include "ZRoom/Commands/SetRoomBehavior.h"
#include "ZRoom/Commands/SetRoomList.h"
#include "ZRoom/Commands/SetSkyboxModifier.h"
#include "ZRoom/Commands/SetSkyboxSettings.h"
#include "ZRoom/Commands/SetSoundSettings.h"
#include "ZRoom/Commands/SetSpecialObjects.h"
#include "ZRoom/Commands/SetStartPositionList.h"
#include "ZRoom/Commands/SetTimeSettings.h"
#include "ZRoom/Commands/SetWind.h"
void ExporterExample_Room::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZRoom* room = dynamic_cast<ZRoom*>(res);
// MemoryStream* memStream = new MemoryStream();
// BinaryWriter* writer = new BinaryWriter(memStream);
for (size_t i = 0; i < room->commands.size() * 8; i++)
writer->Write((uint8_t)0);
for (size_t i = 0; i < room->commands.size(); i++)
{
ZRoomCommand* cmd = room->commands[i];
writer->Seek(i * 8, SeekOffsetType::Start);
writer->Write((uint8_t)cmd->cmdID);
switch (cmd->cmdID)
{
case RoomCommand::SetWind:
{
SetWind* cmdSetWind = (SetWind*)cmd;
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
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((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(cmdTime->hour); // 0x04
writer->Write(cmdTime->min); // 0x05
writer->Write(cmdTime->unk); // 0x06
writer->Write((uint8_t)0); // 0x07
}
break;
case RoomCommand::SetSkyboxModifier:
{
SetSkyboxModifier* cmdSkybox = (SetSkyboxModifier*)cmd;
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(cmdSkybox->disableSky); // 0x04
writer->Write(cmdSkybox->disableSunMoon); // 0x05
writer->Write((uint8_t)0); // 0x06
writer->Write((uint8_t)0); // 0x07
}
break;
case RoomCommand::SetEchoSettings:
{
SetEchoSettings* cmdEcho = (SetEchoSettings*)cmd;
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write((uint8_t)0); // 0x04
writer->Write((uint8_t)0); // 0x05
writer->Write((uint8_t)0); // 0x06
writer->Write((uint8_t)cmdEcho->echo); // 0x07
}
break;
case RoomCommand::SetSoundSettings:
{
SetSoundSettings* cmdSound = (SetSoundSettings*)cmd;
writer->Write((uint8_t)cmdSound->reverb); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write((uint8_t)0); // 0x04
writer->Write((uint8_t)0); // 0x05
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)0); // 0x02
writer->Write((uint8_t)0); // 0x03
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((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(cmdRoom->gameplayFlags2); // 0x04
}
break;
case RoomCommand::SetCsCamera:
{
SetCsCamera* cmdCsCam = (SetCsCamera*)cmd;
writer->Write((uint8_t)cmdCsCam->cameras.size()); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(cmdCsCam->segmentOffset); // 0x04
}
break;
case RoomCommand::SetMesh:
{
SetMesh* cmdMesh = (SetMesh*)cmd;
int baseStreamEnd = writer->GetStream().get()->GetLength();
writer->Write((uint8_t)cmdMesh->data); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(baseStreamEnd); // 0x04
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
// TODO: NOT DONE
writer->Write(cmdMesh->meshHeaderType);
if (cmdMesh->meshHeaderType == 0)
{
// writer->Write(cmdMesh->)
}
else if (cmdMesh->meshHeaderType == 1)
{
}
else if (cmdMesh->meshHeaderType == 2)
{
}
writer->Seek(oldOffset, SeekOffsetType::Start);
}
break;
case RoomCommand::SetCameraSettings:
{
SetCameraSettings* cmdCam = (SetCameraSettings*)cmd;
writer->Write((uint8_t)cmdCam->cameraMovement); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(cmdCam->mapHighlight); // 0x04
}
break;
case RoomCommand::SetLightingSettings:
{
SetLightingSettings* cmdLight = (SetLightingSettings*)cmd;
writer->Write((uint8_t)cmdLight->settings.size()); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(cmdLight->segmentOffset); // 0x04
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(cmdLight->segmentOffset, SeekOffsetType::Start);
for (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);
}
writer->Seek(oldOffset, SeekOffsetType::Start);
}
break;
case RoomCommand::SetRoomList:
{
SetRoomList* cmdRoom = (SetRoomList*)cmd;
writer->Write((uint8_t)cmdRoom->romfile->rooms.size()); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
auto baseStreamEnd = writer->GetLength();
writer->Write(baseStreamEnd); // 0x04
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
for (const auto& entry : cmdRoom->romfile->rooms)
{
writer->Write(entry.virtualAddressStart);
writer->Write(entry.virtualAddressEnd);
}
writer->Seek(oldOffset, SeekOffsetType::Start);
}
break;
case RoomCommand::SetCollisionHeader:
{
SetCollisionHeader* cmdCollHeader = (SetCollisionHeader*)cmd;
int streamEnd = writer->GetStream().get()->GetLength();
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(streamEnd); // 0x04
// TODO: NOT DONE
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(streamEnd, SeekOffsetType::Start);
ExporterExample_Collision colExp = ExporterExample_Collision();
colExp.Save(cmdCollHeader->collisionHeader, outPath, writer);
writer->Seek(oldOffset, SeekOffsetType::Start);
}
break;
case RoomCommand::SetEntranceList:
{
SetEntranceList* cmdEntrance = (SetEntranceList*)cmd;
uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(baseStreamEnd); // 0x04
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
for (EntranceEntry entry : cmdEntrance->entrances)
{
writer->Write((uint8_t)entry.startPositionIndex);
writer->Write((uint8_t)entry.roomToLoad);
}
writer->Seek(oldOffset, SeekOffsetType::Start);
}
break;
case RoomCommand::SetSpecialObjects:
{
SetSpecialObjects* cmdSpecObj = (SetSpecialObjects*)cmd;
writer->Write((uint8_t)cmdSpecObj->elfMessage); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write((uint8_t)0); // 0x04
writer->Write((uint8_t)0); // 0x05
writer->Write((uint16_t)cmdSpecObj->globalObject); // 0x06
}
break;
case RoomCommand::SetStartPositionList:
{
SetStartPositionList* cmdStartPos = (SetStartPositionList*)cmd;
uint32_t baseStreamEnd = writer->GetStream().get()->GetLength();
writer->Write((uint8_t)cmdStartPos->actors.size()); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write(baseStreamEnd); // 0x04
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
for (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.params);
}
writer->Seek(oldOffset, SeekOffsetType::Start);
}
break;
case RoomCommand::EndMarker:
{
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write((uint8_t)0); // 0x04
writer->Write((uint8_t)0); // 0x05
writer->Write((uint8_t)0); // 0x06
writer->Write((uint8_t)0); // 0x07
}
break;
default:
printf("UNIMPLEMENTED COMMAND: %i\n", (int)cmd->cmdID);
writer->Write((uint8_t)0); // 0x01
writer->Write((uint8_t)0); // 0x02
writer->Write((uint8_t)0); // 0x03
writer->Write((uint8_t)0); // 0x04
writer->Write((uint8_t)0); // 0x05
writer->Write((uint8_t)0); // 0x06
writer->Write((uint8_t)0); // 0x07
break;
}
}
// writer->Close();
// DiskFile::WriteAllBytes(StringHelper::Sprintf("%s", res->GetName().c_str()),
// memStream->ToVector());
}

View File

@ -1,10 +0,0 @@
#pragma once
#include "ZResource.h"
#include "ZRoom/ZRoom.h"
class ExporterExample_Room : public ZResourceExporter
{
public:
void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,14 +0,0 @@
#include "TextureExporter.h"
#include "../ZAPD/ZFile.h"
void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] const fs::path& outPath,
BinaryWriter* writer)
{
ZTexture* tex = (ZTexture*)res;
auto data = tex->parent->GetRawData();
for (offset_t i = tex->GetRawDataIndex(); i < tex->GetRawDataIndex() + tex->GetRawDataSize();
i++)
writer->Write(data[i]);
}

View File

@ -1,11 +0,0 @@
#pragma once
#include "Utils/BinaryWriter.h"
#include "ZResource.h"
#include "ZTexture.h"
class ExporterExample_Texture : public ZResourceExporter
{
public:
void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override;
};

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2020 Zelda Reverse Engineering Team
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,134 +0,0 @@
# use variables in submakes
export
OPTIMIZATION_ON ?= 1
ASAN ?= 0
DEPRECATION_ON ?= 1
DEBUG ?= 0
COPYCHECK_ARGS ?=
LLD ?= 0
WERROR ?= 0
# Use clang++ if available, else use g++
ifeq ($(shell command -v clang++ >/dev/null 2>&1; echo $$?),0)
CXX := clang++
else
CXX := g++
endif
INC := -I ZAPD -I lib/libgfxd -I lib/tinyxml2 -I ZAPDUtils
CXXFLAGS := -fpic -std=c++17 -Wall -Wextra -fno-omit-frame-pointer
OPTFLAGS :=
ifneq ($(DEBUG),0)
OPTIMIZATION_ON = 0
CXXFLAGS += -g3 -DDEVELOPMENT -D_DEBUG
COPYCHECK_ARGS += --devel
DEPRECATION_ON = 0
endif
ifneq ($(WERROR),0)
CXXFLAGS += -Werror
endif
ifeq ($(OPTIMIZATION_ON),0)
OPTFLAGS := -O0
else
OPTFLAGS := -O2
endif
ifneq ($(ASAN),0)
CXXFLAGS += -fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=undefined
endif
ifneq ($(DEPRECATION_ON),0)
CXXFLAGS += -DDEPRECATION_ON
endif
# CXXFLAGS += -DTEXTURE_DEBUG
LDFLAGS := -lm -ldl -lpng
# Use LLD if available. Set LLD=0 to not use it
ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0)
LLD := 1
endif
ifneq ($(LLD),0)
LDFLAGS += -fuse-ld=lld
endif
UNAME := $(shell uname)
UNAMEM := $(shell uname -m)
ifneq ($(UNAME), Darwin)
LDFLAGS += -Wl,-export-dynamic -lstdc++fs
EXPORTERS := -Wl,--whole-archive ExporterTest/ExporterTest.a -Wl,--no-whole-archive
else
EXPORTERS := -Wl,-force_load ExporterTest/ExporterTest.a
ifeq ($(UNAMEM),arm64)
ifeq ($(shell brew list libpng > /dev/null 2>&1; echo $$?),0)
LDFLAGS += -L $(shell brew --prefix)/lib
INC += -I $(shell brew --prefix)/include
else
$(error Please install libpng via Homebrew)
endif
endif
endif
ZAPD_SRC_DIRS := $(shell find ZAPD -type d)
SRC_DIRS = $(ZAPD_SRC_DIRS) lib/tinyxml2
ZAPD_CPP_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.cpp))
ZAPD_H_FILES := $(foreach dir,$(ZAPD_SRC_DIRS),$(wildcard $(dir)/*.h))
CPP_FILES += $(ZAPD_CPP_FILES) lib/tinyxml2/tinyxml2.cpp
O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f)
O_FILES += build/ZAPD/BuildInfo.o
# create build directories
$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir)))
# Main targets
all: ZAPD.out copycheck
build/ZAPD/BuildInfo.o:
python3 ZAPD/genbuildinfo.py $(COPYCHECK_ARGS)
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) build/ZAPD/BuildInfo.cpp
copycheck: ZAPD.out
python3 copycheck.py
clean:
rm -rf build ZAPD.out
$(MAKE) -C lib/libgfxd clean
$(MAKE) -C ZAPDUtils clean
$(MAKE) -C ExporterTest clean
rebuild: clean all
format:
clang-format-11 -i $(ZAPD_CPP_FILES) $(ZAPD_H_FILES)
$(MAKE) -C ZAPDUtils format
$(MAKE) -C ExporterTest format
.PHONY: all build/ZAPD/BuildInfo.o copycheck clean rebuild format
build/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(OPTFLAGS) $(INC) -c $(OUTPUT_OPTION) $<
# Submakes
lib/libgfxd/libgfxd.a:
$(MAKE) -C lib/libgfxd
.PHONY: ExporterTest
ExporterTest:
$(MAKE) -C ExporterTest
.PHONY: ZAPDUtils
ZAPDUtils:
$(MAKE) -C ZAPDUtils
# Linking
ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a ExporterTest ZAPDUtils
$(CXX) $(CXXFLAGS) $(O_FILES) lib/libgfxd/libgfxd.a ZAPDUtils/ZAPDUtils.a $(EXPORTERS) $(LDFLAGS) $(OUTPUT_OPTION)

View File

@ -1,163 +0,0 @@
# ZAPD: Zelda Asset Processor for Decomp
## Compiling
### Dependencies
ZAPD needs a compiler with C++17 support.
ZAPD has the following library dependencies:
- `libpng`
In a Debian/Ubuntu based environment, those could be installed with the following command:
```bash
sudo apt install libpng-dev
```
On a Mac, you will need to install libpng with Homebrew or MacPorts; we currently only support Homebrew. You can run
```bash
brew install libpng
```
to install it via Homebrew.
### Building
#### Linux / *nix
ZAPD uses the clasic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).
You can configure a bit your ZAPD build with the following options:
- `OPTIMIZATION_ON`: If set to `0` optimizations will be disabled (compile with `-O0`). Any other value compiles with `-O2`. Defaults to `1`.
- `ASAN`: If it is set to a non-zero then ZAPD will be compiled with Address Sanitizer enabled (`-fsanitize=address`). Defaults to `0`.
- `DEPRECATION_ON`: If it is set to a zero then deprecation warnings will be disabled. Defaults to `1`.
- `DEBUG`: If non-zero, ZAPD will be compiled in _development mode_. This implies the following:
- Debugging symbols enabled (`-g3`). They are disabled by default.
- `OPTIMIZATION_ON=0`: Disables optimizations (`-O0`).
- `DEPRECATION_ON=0`: Disables deprecation warnings.
- `LLD=1`: builds with the LLVM linker `ld.lld` instead of the system default.
As an example, if you want to build ZAPD with optimizations disabled and use the address sanitizer, you could use the following command:
```bash
make -j OPTIMIZATION_ON=0 ASAN=1
```
#### Windows
This repository contains `vcxproj` files for compiling under Visual Studio environments. See `ZAPD/ZAPD.vcxproj`.
## Invoking ZAPD
ZAPD needs a _File parsing mode_ to be passed as first parameter. The options are:
- `e`: "Extraction" mode.
- In this mode, ZAPD expects a XML file as input, a folder as ouput and a path to the baserom files.
- ZAPD will read the XML and use it as a guide to extract the contents of the specified asset file from the baserom folder.
- For more info of the format of those XMLs, see the [ZAPD extraction XML reference](docs/zapd_extraction_xml_reference.md).
- `bsf`: "Build source file" mode.
- This is an experimental mode.
- It was going to be used to let you have XMLs that aren't just for extraction. Might get used, might not. Still need to experiment on that.
- `btex`: "Build texture" mode.
- In this mode, ZAPD expects a PNG file as input, a filename as ouput and a texture type parameter (`-tt`).
- ZAPD will try to convert the given PNG into the contents of a `uint64_t` C array.
- `bren`: "Build (render) background" mode.
- In this mode, ZAPD expects a JPG file as input and a filename as ouput.
- ZAPD will try to convert the given JPG into the contents of a `uint64_t` C array.
- `blb`: "Build blob" mode.
- In this mode, ZAPD expects a BIN file as input and a filename as ouput.
- ZAPD will try to convert the given BIN into the contents of a `uint8_t` C array.
ZAPD also accepts the following list of extra parameters:
- `-i PATH` / `--inputpath PATH`: Set input path.
- `-o PATH` / `--outputpath PATH`: Set output path.
- `-b PATH` / `--baserompath`: Set baserom path.
- Can be used only in `e` or `bsf` modes.
- `-osf PATH`: Set source output path. This is the path where the `.c` and `.h` files will be extracted to. If omitted, it will use the value passed to `--outputpath` parameter.
- `-gsf MODE`: Generate source file during extraction. If `MODE` is `1`, C source files will be generated.
- Can be used only in `e` mode.
- `-crc` / `--output-crc`: Outputs a CRC file for each extracted texture.
- Can be used only in `e` or `bsf` modes.
- `-ulzdl MODE`: Use "Legacy ZDisplayList" instead of `libgfxd`. Set `MODE` to `1` to enable it.
- Can be used only in `e` or `bsf` modes.
- `-profile MODE`: Enable profiling. Set `MODE` to `1` to enable it.
- `-uer MODE`: Split resources into their individual components (enabled by default). Set `MODE` to non-`1` to disable it.
- `-tt TYPE`: Set texture type.
- Can be used only in mode `btex`.
- Valid values:
- `rgba32`
- `rgb5a1`
- `i4`
- `i8`
- `ia4`
- `ia8`
- `ia16`
- `ci4`
- `ci8`
- `-rconf PATH` Read Config File.
- `-eh`: Enable error handler.
- Only available in non-Windows environments.
- `-v MODE`: Enable verbosity. Currently there are 3 possible values:
- `0`: Default. Completely silent (except for warnings and errors).
- `1`: Information.
- `2` (and higher): Debug.
- `-wu` / `--warn-unaccounted`: Enable warnings for each unaccounted block of data found.
- Can be used only in `e` or `bsf` modes.
- `-vu` / `--verbose-unaccounted`: Changes how unaccounteds are outputted. Max 4 bytes per line (a word) and add a comment with the offset of each of those lines.
- Could be useful for looking at raw data or testing.
- Can be used only in `e` or `bsf` modes.
- `-tm MODE`: Test Mode (enables certain experimental features). To enable it, set `MODE` to `1`.
- `-se` / `--set-exporter` : Sets which exporter to use.
- `--gcc-compat` : Enables GCC compatibly mode. Slower.
- `-us` / `--unaccounted-static` : Mark unaccounted data as `static`
- `-s` / `--static` : Mark every asset as `static`.
- This behaviour can be overridden per asset using `Static=` in the respective XML node.
- `-W...`: warning flags, see below
Additionally, you can pass the flag `--version` to see the current ZAPD version. If that flag is passed, ZAPD will ignore any other parameter passed.
### Warning flags
ZAPD contains a variety of warning types, with similar syntax to GCC or Clang's compiler warnings. Warnings can have three levels:
- Off (does not display anything)
- Warn (print a warning but continue processing)
- Err (behave like an error, i.e. print and throw an exception to crash ZAPD when occurs)
Each warning type uses one of these by default, but can be modified with flags, similarly to GCC or Clang:
- `-Wfoo` enables warnings of type `foo`
- `-Wno-foo` disables warnings of type `foo`
- `-Werror=foo` escalates `foo` to behave like an error
- `-Weverything` enables all warnings (they may be turned off using `-Wno-` flags afterwards)
- `-Werror` escalates all enabled warnings to errors
All warning types currently implemented, with their default levels:
| Warning type | Default level | Description |
| --------------------------- | ------------- | ------------------------------------------------------------------------ |
| `-Wdeprecated` | Warn | Deprecated features |
| `-Whardcoded-pointer` | Warn | ZAPD lacks the info to make a symbol, so must output a hardcoded pointer |
| `-Wintersection` | Warn | Two assets intersect |
| `-Winvalid-attribute-value` | Err | Attribute declared in XML is wrong |
| `-Winvalid-extracted-data` | Err | Extracted data does not have correct form |
| `-Winvalid-jpeg` | Err | JPEG file does not conform to the game's format requirements |
| `-Winvalid-png` | Err | Issues arising when processing PNG data |
| `-Winvalid-xml` | Err | XML has syntax errors |
| `-Wmissing-attribute` | Warn | Required attribute missing in XML tag |
| `-Wmissing-offsets` | Warn | Offset attribute missing in XML tag |
| `-Wmissing-segment` | Warn | Segment not given in File tag in XML |
| `-Wnot-implemented` | Warn | ZAPD does not currently support this feature |
| `-Wunaccounted` | Off | Large blocks of unaccounted |
| `-Wunknown-attribute` | Warn | Unknown attribute in XML entry tag |
There are also errors that do not have a type, and cannot be disabled.
For example, here we have invoked ZAPD in the usual way to extract using a (rather badly-written) XML, but escalating `-Wintersection` to an error:
![ZAPD warnings example](docs/zapd_warning_example.png?raw=true)

View File

@ -1,497 +0,0 @@
set(PROJECT_NAME ZAPDLib)
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)
################################################################################
# Source groups
################################################################################
set(Header_Files
"../lib/tinyxml2/tinyxml2.h"
"CRC32.h"
"Declaration.h"
"FileWorker.h"
"GameConfig.h"
"Globals.h"
"ImageBackend.h"
"OutputFormatter.h"
"WarningHandler.h"
"CrashHandler.h"
)
source_group("Header Files" FILES ${Header_Files})
set(Header_Files__Libraries
"../../libultraship/extern/stb/stb_image.h"
"../../libultraship/extern/stb/stb_image_write.h"
"ctpl_stl.h"
)
source_group("Header Files\\Libraries" FILES ${Header_Files__Libraries})
set(Header_Files__Libraries__libgfxd
"../lib/libgfxd/gbi.h"
"../lib/libgfxd/gfxd.h"
"../lib/libgfxd/priv.h"
)
source_group("Header Files\\Libraries\\libgfxd" FILES ${Header_Files__Libraries__libgfxd})
set(Header_Files__Yaz0
"yaz0/readwrite.h"
"yaz0/yaz0.h"
)
source_group("Header Files\\Yaz0" FILES ${Header_Files__Yaz0})
set(Header_Files__Z64
"OtherStructs/SkinLimbStructs.h"
"OtherStructs/CutsceneMM_Commands.h"
"OtherStructs/Cutscene_Commands.h"
"ZAnimation.h"
"ZActorList.h"
"ZArray.h"
"ZAudio.h"
"ZBackground.h"
"ZBlob.h"
"ZCollision.h"
"ZCollisionPoly.h"
"ZCutscene.h"
"ZDisplayList.h"
"ZFile.h"
"ZLimb.h"
"ZMtx.h"
"ZPath.h"
"ZPlayerAnimationData.h"
"ZResource.h"
"ZRom.h"
"ZScalar.h"
"ZSkeleton.h"
"ZSurfaceType.h"
"ZString.h"
"ZSymbol.h"
"ZText.h"
"ZTexture.h"
"ZTextureAnimation.h"
"ZVector.h"
"ZVtx.h"
)
source_group("Header Files\\Z64" FILES ${Header_Files__Z64})
set(Header_Files__Z64__ZRoom
"ZRoom/ZRoom.h"
"ZRoom/ZRoomCommand.h"
)
source_group("Header Files\\Z64\\ZRoom" FILES ${Header_Files__Z64__ZRoom})
set(Header_Files__Z64__ZRoom__Commands
"ZRoom/Commands/EndMarker.h"
"ZRoom/Commands/SetActorCutsceneList.h"
"ZRoom/Commands/SetActorList.h"
"ZRoom/Commands/SetAlternateHeaders.h"
"ZRoom/Commands/SetAnimatedMaterialList.h"
"ZRoom/Commands/SetCameraSettings.h"
"ZRoom/Commands/SetCollisionHeader.h"
"ZRoom/Commands/SetCsCamera.h"
"ZRoom/Commands/SetCutscenes.h"
"ZRoom/Commands/SetEchoSettings.h"
"ZRoom/Commands/SetEntranceList.h"
"ZRoom/Commands/SetExitList.h"
"ZRoom/Commands/SetLightingSettings.h"
"ZRoom/Commands/SetLightList.h"
"ZRoom/Commands/SetMesh.h"
"ZRoom/Commands/SetMinimapChests.h"
"ZRoom/Commands/SetMinimapList.h"
"ZRoom/Commands/SetObjectList.h"
"ZRoom/Commands/SetPathways.h"
"ZRoom/Commands/SetRoomBehavior.h"
"ZRoom/Commands/SetRoomList.h"
"ZRoom/Commands/SetSkyboxModifier.h"
"ZRoom/Commands/SetSkyboxSettings.h"
"ZRoom/Commands/SetSoundSettings.h"
"ZRoom/Commands/SetSpecialObjects.h"
"ZRoom/Commands/SetStartPositionList.h"
"ZRoom/Commands/SetTimeSettings.h"
"ZRoom/Commands/SetTransitionActorList.h"
"ZRoom/Commands/SetWind.h"
"ZRoom/Commands/SetWorldMapVisited.h"
"ZRoom/Commands/Unused09.h"
"ZRoom/Commands/Unused1D.h"
"ZRoom/Commands/ZRoomCommandUnk.h"
)
source_group("Header Files\\Z64\\ZRoom\\Commands" FILES ${Header_Files__Z64__ZRoom__Commands})
set(Resource_Files
"../../OTRExporter/CFG/SymbolMap_OoTMqDbg.txt"
)
source_group("Resource Files" FILES ${Resource_Files})
set(Source_Files
"CrashHandler.cpp"
"Declaration.cpp"
"FileWorker.cpp"
"GameConfig.cpp"
"Globals.cpp"
"ImageBackend.cpp"
"Main.cpp"
"OutputFormatter.cpp"
"WarningHandler.cpp"
)
source_group("Source Files" FILES ${Source_Files})
set(Source_Files__Libraries__libgfxd
"../lib/libgfxd/gfxd.c"
"../lib/libgfxd/uc.c"
"../lib/libgfxd/uc_f3d.c"
"../lib/libgfxd/uc_f3db.c"
"../lib/libgfxd/uc_f3dex.c"
"../lib/libgfxd/uc_f3dex2.c"
"../lib/libgfxd/uc_f3dexb.c"
)
source_group("Source Files\\Libraries\\libgfxd" FILES ${Source_Files__Libraries__libgfxd})
set(Source_Files__Yaz0
"yaz0/yaz0.cpp"
)
source_group("Source Files\\Yaz0" FILES ${Source_Files__Yaz0})
set(Source_Files__Z64
"OtherStructs/SkinLimbStructs.cpp"
"OtherStructs/CutsceneMM_Commands.cpp"
"OtherStructs/Cutscene_Commands.cpp"
"ZAnimation.cpp"
"ZActorList.cpp"
"ZArray.cpp"
"ZAudio.cpp"
"ZAudioDecode.cpp"
"ZBackground.cpp"
"ZBlob.cpp"
"ZCollision.cpp"
"ZCollisionPoly.cpp"
"ZCutscene.cpp"
"ZDisplayList.cpp"
"ZFile.cpp"
"ZLimb.cpp"
"ZMtx.cpp"
"ZPath.cpp"
"ZPlayerAnimationData.cpp"
"ZResource.cpp"
"ZRom.cpp"
"ZScalar.cpp"
"ZSkeleton.cpp"
"ZSurfaceType.cpp"
"ZString.cpp"
"ZSymbol.cpp"
"ZText.cpp"
"ZTexture.cpp"
"ZTextureAnimation.cpp"
"ZVector.cpp"
"ZVtx.cpp"
)
source_group("Source Files\\Z64" FILES ${Source_Files__Z64})
set(Source_Files__Z64__ZRoom
"ZRoom/ZRoom.cpp"
"ZRoom/ZRoomCommand.cpp"
)
source_group("Source Files\\Z64\\ZRoom" FILES ${Source_Files__Z64__ZRoom})
set(Source_Files__Z64__ZRoom__Commands
"ZRoom/Commands/EndMarker.cpp"
"ZRoom/Commands/SetActorCutsceneList.cpp"
"ZRoom/Commands/SetActorList.cpp"
"ZRoom/Commands/SetAlternateHeaders.cpp"
"ZRoom/Commands/SetAnimatedMaterialList.cpp"
"ZRoom/Commands/SetCameraSettings.cpp"
"ZRoom/Commands/SetCollisionHeader.cpp"
"ZRoom/Commands/SetCsCamera.cpp"
"ZRoom/Commands/SetCutscenes.cpp"
"ZRoom/Commands/SetEchoSettings.cpp"
"ZRoom/Commands/SetEntranceList.cpp"
"ZRoom/Commands/SetExitList.cpp"
"ZRoom/Commands/SetLightingSettings.cpp"
"ZRoom/Commands/SetLightList.cpp"
"ZRoom/Commands/SetMesh.cpp"
"ZRoom/Commands/SetMinimapChests.cpp"
"ZRoom/Commands/SetMinimapList.cpp"
"ZRoom/Commands/SetObjectList.cpp"
"ZRoom/Commands/SetPathways.cpp"
"ZRoom/Commands/SetRoomBehavior.cpp"
"ZRoom/Commands/SetRoomList.cpp"
"ZRoom/Commands/SetSkyboxModifier.cpp"
"ZRoom/Commands/SetSkyboxSettings.cpp"
"ZRoom/Commands/SetSoundSettings.cpp"
"ZRoom/Commands/SetSpecialObjects.cpp"
"ZRoom/Commands/SetStartPositionList.cpp"
"ZRoom/Commands/SetTimeSettings.cpp"
"ZRoom/Commands/SetTransitionActorList.cpp"
"ZRoom/Commands/SetWind.cpp"
"ZRoom/Commands/SetWorldMapVisited.cpp"
"ZRoom/Commands/Unused09.cpp"
"ZRoom/Commands/Unused1D.cpp"
"ZRoom/Commands/ZRoomCommandUnk.cpp"
)
source_group("Source Files\\Z64\\ZRoom\\Commands" FILES ${Source_Files__Z64__ZRoom__Commands})
set(ALL_FILES
${Header_Files}
${Header_Files__Libraries}
${Header_Files__Libraries__libgfxd}
${Header_Files__Yaz0}
${Header_Files__Z64}
${Header_Files__Z64__ZRoom}
${Header_Files__Z64__ZRoom__Commands}
${Resource_Files}
${Source_Files}
${Source_Files__Libraries__libgfxd}
${Source_Files__Yaz0}
${Source_Files__Z64}
${Source_Files__Z64__ZRoom}
${Source_Files__Z64__ZRoom__Commands}
${any__any}
)
################################################################################
# Target
################################################################################
add_library(${PROJECT_NAME} STATIC ${ALL_FILES})
add_executable(ZAPD ExecutableMain.cpp)
target_link_libraries(ZAPD ${PROJECT_NAME})
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
use_props(ZAPD "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
endif()
################################################################################
# Includes for CMake from *.props
################################################################################
set(ROOT_NAMESPACE ZAPD)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
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()
elseif (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
set_target_properties(ZAPD PROPERTIES
OUTPUT_NAME "ZAPD.out"
)
endif()
################################################################################
# MSVC runtime library
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
foreach(ZTarget ${PROJECT_NAME} ZAPD)
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${ZTarget} 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(${ZTarget} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
endforeach()
endif()
################################################################################
# Compile definitions
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"_CRT_SECURE_NO_WARNINGS;"
"_MBCS"
STORMLIB_NO_AUTO_LINK
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_CRT_SECURE_NO_WARNINGS"
">"
"_MBCS"
STORMLIB_NO_AUTO_LINK
)
endif()
endif()
################################################################################
# Compile and link options
################################################################################
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_FIND_FRAMEWORK LAST)
endif()
find_package(PNG REQUIRED)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/extern/ZAPDUtils
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/src/resource
${CMAKE_CURRENT_SOURCE_DIR}/../../libultraship/include
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/tinyxml2
${CMAKE_CURRENT_SOURCE_DIR}/../../ZAPDTR/lib/libgfxd
${PNG_PNG_INCLUDE_DIR}/
.
)
if(MSVC)
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
target_compile_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
/Od;
/RTC1
>
$<$<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:Debug>:
/Od
>
$<$<CONFIG:Release>:
/O2;
/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:Debug>:
/PROFILE
>
$<$<CONFIG:Release>:
/OPT:REF;
/OPT:ICF
>
/DEBUG:FULL
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x86")
target_link_options(${PROJECT_NAME} PRIVATE
$<$<CONFIG:Debug>:
/PROFILE
>
$<$<CONFIG:Release>:
/OPT:REF;
/OPT:ICF
>
/DEBUG:FULL
)
endif()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
target_compile_options(${PROJECT_NAME} PUBLIC
-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>
-pthread
)
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_options(${PROJECT_NAME} PUBLIC
-pthread
)
else()
target_link_options(${PROJECT_NAME} PUBLIC
-pthread
-Wl,-export-dynamic
)
endif()
endif()
################################################################################
# Dependencies
################################################################################
add_dependencies(${PROJECT_NAME}
OTRExporter
ZAPDUtils
libultraship
)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"ZAPDUtils;"
"-WHOLEARCHIVE:$<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter>"
"libultraship;"
storm
PNG::PNG
)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"ZAPDUtils;"
-Wl,-force_load $<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter>
"libultraship;"
PNG::PNG
${CMAKE_DL_LIBS}
Threads::Threads
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"ZAPDUtils;"
-Wl,--whole-archive $<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter> -Wl,--no-whole-archive
"libultraship;"
PNG::PNG
Threads::Threads
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"ZAPDUtils;"
"libultraship;"
PNG::PNG
)
else()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"ZAPDUtils;"
-Wl,--whole-archive $<TARGET_LINKER_FILE_DIR:OTRExporter>/$<TARGET_LINKER_FILE_NAME:OTRExporter> -Wl,--no-whole-archive
"libultraship;"
PNG::PNG
${CMAKE_DL_LIBS}
Threads::Threads
)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
add_library(pathconf OBJECT pathconf.c)
target_link_libraries(${PROJECT_NAME} PUBLIC "${ADDITIONAL_LIBRARY_DEPENDENCIES}" $<TARGET_OBJECTS:pathconf> )
else()
target_link_libraries(${PROJECT_NAME} PUBLIC "${ADDITIONAL_LIBRARY_DEPENDENCIES}")
endif()

View File

@ -1,23 +0,0 @@
#pragma once
static uint32_t CRC32B(const unsigned char* message, int32_t size)
{
int32_t byte, crc;
int32_t mask;
crc = 0xFFFFFFFF;
for (int32_t i = 0; i < size; i++)
{
byte = message[i];
crc = crc ^ byte;
for (int32_t j = 7; j >= 0; j--)
{
mask = -(crc & 1);
crc = (crc >> 1) ^ (0xEDB88320 & mask);
}
}
return ~(uint32_t)(crc);
}

View File

@ -1,205 +0,0 @@
#include "CrashHandler.h"
#include "Utils/StringHelper.h"
#if __has_include(<unistd.h>)
#define HAS_POSIX 1
#else
#define HAS_POSIX 0
#endif
#include <array>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#if HAS_POSIX == 1
#include <csignal>
#include <cxxabi.h> // for __cxa_demangle
#include <dlfcn.h> // for dladdr
#include <execinfo.h>
#include <unistd.h>
#elif defined(_MSC_VER)
#include <Windows.h>
#include <DbgHelp.h>
#include <inttypes.h>
#pragma comment(lib, "Dbghelp.lib")
#endif
// Feel free to add more crash messages.
static std::array<const char* const, 14> crashEasterEgg = {
"\tYou've met with a terrible fate, haven't you?",
"\tSEA BEARS FOAM. SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY: CRASSSH!",
"\tZAPD has fallen and cannot get up.",
"\tIT'S A SECRET TO EVERYBODY. \n\tBut it shouldn't be, you'd better ask about it!",
"\tI AM ERROR.",
"\tGRUMBLE,GRUMBLE...",
"\tDODONGO DISLIKES SMOKE \n\tAnd ZAPD dislikes whatever you fed it.",
"\tMay the way of the Hero lead \n\tto the debugger.",
"\tTHE WIND FISH SLUMBERS LONG... \n\tTHE HERO'S LIFE GONE... ",
"\tSEA BEARS FOAM, SLEEP BEARS DREAMS. \n\tBOTH END IN THE SAME WAY CRASSSH!",
"\tYou've met with a terrible fate, haven't you?",
"\tMaster, I calculate a 100% probability that ZAPD has crashed. \n\tAdditionally, the "
"batteries in your Wii Remote are nearly depleted.",
"\t CONGRATURATIONS! \n"
"\tAll Pages are displayed.\n"
"\t THANK YOU! \n"
"\t You are great debugger!",
"\tRCP is HUNG UP!!\n"
"\tOh! MY GOD!!",
};
#if HAS_POSIX == 1
void ErrorHandler(int sig)
{
std::array<void*, 4096> arr;
constexpr size_t nMaxFrames = arr.size();
size_t size = backtrace(arr.data(), nMaxFrames);
char** symbols = backtrace_symbols(arr.data(), nMaxFrames);
fprintf(stderr, "\nZAPD crashed. (Signal: %i)\n", sig);
srand(time(nullptr));
auto easterIndex = rand() % crashEasterEgg.size();
fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
fprintf(stderr, "Traceback:\n");
for (size_t i = 1; i < size; i++)
{
Dl_info info;
uint32_t gotAddress = dladdr(arr[i], &info);
std::string functionName(symbols[i]);
if (gotAddress != 0 && info.dli_sname != nullptr)
{
int32_t status;
char* demangled = abi::__cxa_demangle(info.dli_sname, nullptr, nullptr, &status);
const char* nameFound = info.dli_sname;
if (status == 0)
{
nameFound = demangled;
}
functionName = StringHelper::Sprintf("%s (+0x%X)", nameFound,
(char*)arr[i] - (char*)info.dli_saddr);
free(demangled);
}
fprintf(stderr, "%-3zd %s\n", i, functionName.c_str());
}
fprintf(stderr, "\n");
free(symbols);
exit(1);
}
#elif defined(_MSC_VER)
void printStack(CONTEXT* ctx)
{
BOOL result;
HANDLE process;
HANDLE thread;
HMODULE hModule;
ULONG frame;
DWORD64 displacement;
DWORD disp;
srand(time(nullptr));
auto easterIndex = rand() % crashEasterEgg.size();
fprintf(stderr, "\n%s\n\n", crashEasterEgg[easterIndex]);
#if defined(_M_AMD64)
STACKFRAME64 stack;
memset(&stack, 0, sizeof(STACKFRAME64));
#else
STACKFRAME stack;
memset(&stack, 0, sizeof(STACKFRAME));
#endif
char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME + sizeof(TCHAR)];
char module[512];
PSYMBOL_INFO symbol = (PSYMBOL_INFO)buffer;
CONTEXT ctx2;
memcpy(&ctx2, ctx, sizeof(CONTEXT));
process = GetCurrentProcess();
thread = GetCurrentThread();
SymInitialize(process, nullptr, TRUE);
constexpr DWORD machineType =
#if defined(_M_AMD64)
IMAGE_FILE_MACHINE_AMD64;
#else
IMAGE_FILE_MACHINE_I386;
#endif
displacement = 0;
for (frame = 0;; frame++)
{
result = StackWalk(machineType, process, thread, &stack, &ctx2, nullptr,
SymFunctionTableAccess, SymGetModuleBase, nullptr);
if (!result)
{
break;
}
symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
symbol->MaxNameLen = MAX_SYM_NAME;
SymFromAddr(process, (ULONG64)stack.AddrPC.Offset, &displacement, symbol);
#if defined(_M_AMD64)
IMAGEHLP_LINE64 line;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
#else
IMAGEHLP_LINE line;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE);
#endif
if (SymGetLineFromAddr(process, stack.AddrPC.Offset, &disp, &line))
{
fprintf(stderr, "%u\t %s in %s: line: %lu: \n", frame, symbol->Name, line.FileName,
line.LineNumber);
}
else
{
fprintf(stderr, "%u\tat % s\n", frame, symbol->Name);
hModule = nullptr;
GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
(LPCTSTR)(stack.AddrPC.Offset), &hModule);
if (hModule != nullptr)
{
GetModuleFileNameA(hModule, module, 512 - 1);
}
fprintf(stderr, "%u\tIn %s\n", frame, module);
}
}
}
LONG seh_filter(_EXCEPTION_POINTERS* ex)
{
fprintf(stderr, "EXCEPTION 0x%x occured\n", ex->ExceptionRecord->ExceptionCode);
printStack(ex->ContextRecord);
return EXCEPTION_EXECUTE_HANDLER;
}
#endif
void CrashHandler_Init()
{
#if HAS_POSIX == 1
signal(SIGSEGV, ErrorHandler);
signal(SIGABRT, ErrorHandler);
#elif defined(_MSC_VER)
SetUnhandledExceptionFilter(seh_filter);
#else
HANDLE_WARNING(WarningType::Always,
"tried to set error handler, but this ZAPD build lacks support for one", "");
#endif
}

View File

@ -1,6 +0,0 @@
#ifndef CRASH_HANDLER_H
#define CRASH_HANDLER_H
void CrashHandler_Init();
#endif

View File

@ -1,236 +0,0 @@
#include "Declaration.h"
#include "Globals.h"
#include "ZVtx.h"
#include "Utils/StringHelper.h"
Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nText)
{
address = nAddress;
alignment = nAlignment;
size = nSize;
text = nText;
}
Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
const std::string& nText)
: Declaration(nAddress, nAlignment, nSize, nText)
{
varType = nVarType;
varName = nVarName;
isArray = nIsArray;
}
Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
size_t nArrayItemCnt, const std::string& nText)
: Declaration(nAddress, nAlignment, nSize, nText)
{
varType = nVarType;
varName = nVarName;
isArray = nIsArray;
arrayItemCnt = nArrayItemCnt;
}
Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
const std::string& nArrayItemCntStr, const std::string& nText)
: Declaration(nAddress, nAlignment, nSize, nText)
{
varType = nVarType;
varName = nVarName;
isArray = nIsArray;
arrayItemCntStr = nArrayItemCntStr;
}
Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
size_t nArrayItemCnt, const std::string& nText, bool nIsExternal)
: Declaration(nAddress, nAlignment, nSize, nVarType, nVarName, nIsArray, nArrayItemCnt, nText)
{
isExternal = nIsExternal;
}
Declaration::Declaration(offset_t nAddress, const std::string& nIncludePath, size_t nSize,
const std::string& nVarType, const std::string& nVarName)
: Declaration(nAddress, DeclarationAlignment::Align4, nSize, "")
{
includePath = nIncludePath;
varType = nVarType;
varName = nVarName;
}
Declaration::~Declaration()
{
//for (auto item : vertexHack)
//delete item;
}
bool Declaration::IsStatic() const
{
switch (staticConf)
{
case StaticConfig::Off:
return false;
case StaticConfig::Global:
return Globals::Instance->forceStatic;
case StaticConfig::On:
return true;
}
return false;
}
std::string Declaration::GetNormalDeclarationStr() const
{
std::string output;
if (preText != "")
output += preText + "\n";
if (IsStatic())
{
output += "static ";
}
if (isArray)
{
if (arrayItemCntStr != "" && (IsStatic() || forceArrayCnt))
{
output += StringHelper::Sprintf("%s %s[%s];\n", varType.c_str(), varName.c_str(),
arrayItemCntStr.c_str());
}
else if (arrayItemCnt != 0 && (IsStatic() || forceArrayCnt))
{
output += StringHelper::Sprintf("%s %s[%i] = {\n", varType.c_str(), varName.c_str(),
arrayItemCnt);
}
else
{
output += StringHelper::Sprintf("%s %s[] = {\n", varType.c_str(), varName.c_str());
}
output += text + "\n";
}
else
{
output += StringHelper::Sprintf("%s %s = { ", varType.c_str(), varName.c_str());
output += text;
}
if (output.back() == '\n')
output += "};";
else
output += " };";
if (rightText != "")
output += " " + rightText + "";
output += "\n";
if (postText != "")
output += postText + "\n";
output += "\n";
return output;
}
std::string Declaration::GetExternalDeclarationStr() const
{
std::string output;
if (preText != "")
output += preText + "\n";
if (IsStatic())
{
output += "static ";
}
if (arrayItemCntStr != "" && (IsStatic() || forceArrayCnt))
output += StringHelper::Sprintf("%s %s[%s] = ", varType.c_str(), varName.c_str(),
arrayItemCntStr.c_str());
else if (arrayItemCnt != 0 && (IsStatic() || forceArrayCnt))
output +=
StringHelper::Sprintf("%s %s[%i] = ", varType.c_str(), varName.c_str(), arrayItemCnt);
else
output += StringHelper::Sprintf("%s %s[] = ", varType.c_str(), varName.c_str());
output += StringHelper::Sprintf("{\n#include \"%s\"\n};", includePath.c_str());
if (rightText != "")
output += " " + rightText + "";
output += "\n";
if (postText != "")
output += postText + "\n";
output += "\n";
return output;
}
std::string Declaration::GetExternStr() const
{
if (IsStatic() || varType == "" || isUnaccounted)
{
return "";
}
if (Globals::Instance->otrMode) /* && (varType == "Gfx" || varType == "u64" || varType == "AnimationHeader" || varType == "LinkAnimationHeader" ||
varType == "StandardLimb" || varType == "JointIndex" || varType == "Vtx" || varType == "FlexSkeletonHeader" || varType == "SkeletonHeader") ||
varType == "CollisionHeader") */
return "";
if (isArray)
{
if (arrayItemCntStr != "" && (IsStatic() || forceArrayCnt))
{
return StringHelper::Sprintf("extern %s %s[%s];\n", varType.c_str(), varName.c_str(),
arrayItemCntStr.c_str());
}
else if (arrayItemCnt != 0 && (IsStatic() || forceArrayCnt))
{
return StringHelper::Sprintf("extern %s %s[%i];\n", varType.c_str(), varName.c_str(),
arrayItemCnt);
}
else
return StringHelper::Sprintf("extern %s %s[];\n", varType.c_str(), varName.c_str());
}
return StringHelper::Sprintf("extern %s %s;\n", varType.c_str(), varName.c_str());
}
std::string Declaration::GetStaticForwardDeclarationStr() const
{
if (!IsStatic() || isUnaccounted)
return "";
if (isArray)
{
if (arrayItemCntStr == "" && arrayItemCnt == 0)
{
// Forward declaring static arrays without specifying the size is not allowed.
return "";
}
if (arrayItemCntStr != "")
{
return StringHelper::Sprintf("static %s %s[%s];\n", varType.c_str(), varName.c_str(),
arrayItemCntStr.c_str());
}
else
{
return StringHelper::Sprintf("static %s %s[%i];\n", varType.c_str(), varName.c_str(),
arrayItemCnt);
}
}
return StringHelper::Sprintf("static %s %s;\n", varType.c_str(), varName.c_str());
}

View File

@ -1,87 +0,0 @@
#pragma once
#include <string>
#include <vector>
#include <cstdint>
// TODO: should we drop the `_t` suffix because of UNIX compliance?
typedef uint32_t segptr_t;
typedef uint32_t offset_t;
#define SEGMENTED_NULL ((segptr_t)0)
enum class DeclarationAlignment
{
Align4,
Align8
};
enum class StaticConfig
{
Off,
Global,
On
};
class ZVtx;
class Declaration
{
public:
offset_t address;
DeclarationAlignment alignment;
size_t size;
std::string preText;
std::string text;
std::string rightText;
std::string postText;
std::string preComment;
std::string postComment;
std::string varType;
std::string varName;
std::string includePath;
std::vector<ZVtx*> vertexHack;
bool isExternal = false;
bool isArray = false;
bool forceArrayCnt = false;
size_t arrayItemCnt = 0;
std::string arrayItemCntStr = "";
std::vector<segptr_t> references;
bool isUnaccounted = false;
bool isPlaceholder = false;
bool declaredInXml = false;
StaticConfig staticConf = StaticConfig::Global;
Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
const std::string& nText);
Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
size_t nArrayItemCnt, const std::string& nText);
Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
const std::string& nArrayItemCntStr, const std::string& nText);
Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nVarType, const std::string& nVarName, bool nIsArray,
size_t nArrayItemCnt, const std::string& nText, bool nIsExternal);
Declaration(offset_t nAddress, const std::string& nIncludePath, size_t nSize,
const std::string& nVarType, const std::string& nVarName);
~Declaration();
bool IsStatic() const;
std::string GetNormalDeclarationStr() const;
std::string GetExternalDeclarationStr() const;
std::string GetExternStr() const;
std::string GetStaticForwardDeclarationStr() const;
protected:
Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize,
const std::string& nText);
};

View File

@ -1,5 +0,0 @@
extern "C" int zapd_main(int argc, char* argv[]);
int main(int argc, char* argv[]) {
return zapd_main(argc, argv);
}

View File

@ -1,15 +0,0 @@
#pragma once
#include <map>
#include <string>
#include <vector>
#include "ZFile.h"
class FileWorker
{
public:
std::vector<ZFile*> files;
std::vector<ZFile*> externalFiles;
std::vector<int32_t> segments;
std::map<int32_t, std::vector<ZFile*>> segmentRefFiles;
};

View File

@ -1,207 +0,0 @@
#include "GameConfig.h"
#include <functional>
#include <string_view>
#include <unordered_map>
#include "Utils/Directory.h"
#include <Utils/DiskFile.h>
#include "Utils/Path.h"
#include "ZFile.h"
#include "tinyxml2.h"
using ConfigFunc = void (GameConfig::*)(const tinyxml2::XMLElement&);
GameConfig::~GameConfig()
{
for (auto& declPair : segmentRefFiles)
{
for (auto& file : declPair.second)
{
delete file;
}
}
}
void GameConfig::ReadTexturePool(const fs::path& texturePoolXmlPath)
{
tinyxml2::XMLDocument doc;
tinyxml2::XMLError eResult = doc.LoadFile(texturePoolXmlPath.string().c_str());
if (eResult != tinyxml2::XML_SUCCESS)
{
fprintf(stderr, "Warning: Unable to read texture pool XML with error code %i\n", eResult);
return;
}
tinyxml2::XMLNode* root = doc.FirstChild();
if (root == nullptr)
return;
for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != nullptr;
child = child->NextSiblingElement())
{
if (std::string_view(child->Name()) == "Texture")
{
std::string crcStr = child->Attribute("CRC");
fs::path texPath = child->Attribute("Path");
std::string texName;
uint32_t crc = strtoul(crcStr.c_str(), nullptr, 16);
texturePool[crc].path = texPath;
}
}
}
void GameConfig::GenSymbolMap(const fs::path& symbolMapPath)
{
auto symbolLines = DiskFile::ReadAllLines(symbolMapPath);
for (std::string& symbolLine : symbolLines)
{
auto split = StringHelper::Split(symbolLine, " ");
uint32_t addr = strtoul(split[0].c_str(), nullptr, 16);
std::string symbolName = split[1];
symbolMap[addr] = std::move(symbolName);
}
}
void GameConfig::ConfigFunc_SymbolMap(const tinyxml2::XMLElement& element)
{
std::string fileName = element.Attribute("File");
GenSymbolMap(Path::GetDirectoryName(configFilePath) / fileName);
}
void GameConfig::ConfigFunc_ActorList(const tinyxml2::XMLElement& element)
{
std::string fileName = element.Attribute("File");
std::vector<std::string> lines =
DiskFile::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
for (auto& line : lines)
actorList.emplace_back(std::move(line));
}
void GameConfig::ConfigFunc_ObjectList(const tinyxml2::XMLElement& element)
{
std::string fileName = element.Attribute("File");
std::vector<std::string> lines =
DiskFile::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
for (auto& line : lines)
objectList.emplace_back(std::move(line));
}
void GameConfig::ConfigFunc_EntranceList(const tinyxml2::XMLElement& element)
{
std::string fileName = element.Attribute("File");
std::vector<std::string> lines =
DiskFile::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
for (auto& line : lines)
entranceList.emplace_back(std::move(line));
}
void GameConfig::ConfigFunc_specialEntranceList(const tinyxml2::XMLElement& element)
{
std::string fileName = element.Attribute("File");
std::vector<std::string> lines =
DiskFile::ReadAllLines(Path::GetDirectoryName(configFilePath) / fileName);
for (auto& line : lines)
specialEntranceList.emplace_back(std::move(line));
}
void GameConfig::ConfigFunc_TexturePool(const tinyxml2::XMLElement& element)
{
std::string fileName = element.Attribute("File");
ReadTexturePool(Path::GetDirectoryName(configFilePath) / fileName);
}
void GameConfig::ConfigFunc_BGConfig(const tinyxml2::XMLElement& element)
{
bgScreenWidth = element.IntAttribute("ScreenWidth", 320);
bgScreenHeight = element.IntAttribute("ScreenHeight", 240);
}
void GameConfig::ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element)
{
const char* pathValue = element.Attribute("Path");
if (pathValue == nullptr)
{
throw std::runtime_error(
StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
"\t Missing 'Path' attribute in `ExternalXMLFolder` element.\n"));
}
if (externalXmlFolder != "")
{
throw std::runtime_error(StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
"\t `ExternalXMLFolder` is duplicated.\n"));
}
externalXmlFolder = pathValue;
}
void GameConfig::ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element)
{
const char* xmlPathValue = element.Attribute("XmlPath");
if (xmlPathValue == nullptr)
{
throw std::runtime_error(
StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
"\t Missing 'XmlPath' attribute in `ExternalFile` element.\n"));
}
const char* outPathValue = element.Attribute("OutPath");
if (outPathValue == nullptr)
{
throw std::runtime_error(
StringHelper::Sprintf("Parse: Fatal error in configuration file.\n"
"\t Missing 'OutPath' attribute in `ExternalFile` element.\n"));
}
externalFiles.push_back(ExternalFile(fs::path(xmlPathValue), fs::path(outPathValue)));
}
void GameConfig::ReadConfigFile(const fs::path& argConfigFilePath)
{
static const std::unordered_map<std::string, ConfigFunc> ConfigFuncDictionary = {
{"SymbolMap", &GameConfig::ConfigFunc_SymbolMap},
{"ActorList", &GameConfig::ConfigFunc_ActorList},
{"ObjectList", &GameConfig::ConfigFunc_ObjectList},
{"EntranceList", &GameConfig::ConfigFunc_EntranceList},
{"SpecialEntranceList", &GameConfig::ConfigFunc_specialEntranceList},
{"TexturePool", &GameConfig::ConfigFunc_TexturePool},
{"BGConfig", &GameConfig::ConfigFunc_BGConfig},
{"ExternalXMLFolder", &GameConfig::ConfigFunc_ExternalXMLFolder},
{"ExternalFile", &GameConfig::ConfigFunc_ExternalFile},
};
configFilePath = argConfigFilePath.string();
tinyxml2::XMLDocument doc;
tinyxml2::XMLError eResult = doc.LoadFile(configFilePath.c_str());
if (eResult != tinyxml2::XML_SUCCESS)
{
throw std::runtime_error("Error: Unable to read config file.");
}
tinyxml2::XMLNode* root = doc.FirstChild();
if (root == nullptr)
return;
for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != nullptr;
child = child->NextSiblingElement())
{
auto it = ConfigFuncDictionary.find(child->Name());
if (it == ConfigFuncDictionary.end())
{
fprintf(stderr, "Unsupported configuration variable: %s\n", child->Name());
continue;
}
std::invoke(it->second, *this, *child);
}
}

View File

@ -1,62 +0,0 @@
#pragma once
#include <cstdint>
#include <map>
#include <string>
#include <vector>
#include "Utils/Directory.h"
#include "tinyxml2.h"
struct TexturePoolEntry
{
fs::path path = ""; // Path to Shared Texture
};
class ExternalFile
{
public:
fs::path xmlPath, outPath;
ExternalFile(fs::path nXmlPath, fs::path nOutPath);
};
class ZFile;
class GameConfig
{
public:
std::string configFilePath;
std::map<int32_t, std::vector<ZFile*>> segmentRefFiles;
std::map<uint32_t, std::string> symbolMap;
std::vector<std::string> actorList;
std::vector<std::string> objectList;
std::vector<std::string> entranceList;
std::vector<std::string> specialEntranceList;
std::map<uint32_t, TexturePoolEntry> texturePool; // Key = CRC
// ZBackground
uint32_t bgScreenWidth = 320, bgScreenHeight = 240;
// ExternalFile
fs::path externalXmlFolder;
std::vector<ExternalFile> externalFiles;
GameConfig() = default;
~GameConfig();
void ReadTexturePool(const fs::path& texturePoolXmlPath);
void GenSymbolMap(const fs::path& symbolMapPath);
void ConfigFunc_SymbolMap(const tinyxml2::XMLElement& element);
void ConfigFunc_ActorList(const tinyxml2::XMLElement& element);
void ConfigFunc_ObjectList(const tinyxml2::XMLElement& element);
void ConfigFunc_EntranceList(const tinyxml2::XMLElement& element);
void ConfigFunc_specialEntranceList(const tinyxml2::XMLElement& element);
void ConfigFunc_TexturePool(const tinyxml2::XMLElement& element);
void ConfigFunc_BGConfig(const tinyxml2::XMLElement& element);
void ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element);
void ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element);
void ReadConfigFile(const fs::path& configFilePath);
};

View File

@ -1,325 +0,0 @@
#include "Globals.h"
#include <algorithm>
#include <string_view>
#include <Utils/DiskFile.h>
#include "Utils/Path.h"
#include "WarningHandler.h"
#include "tinyxml2.h"
Globals* Globals::Instance;
Globals::Globals()
{
Instance = this;
game = ZGame::OOT_RETAIL;
genSourceFile = true;
testMode = false;
profile = false;
useLegacyZDList = false;
useExternalResources = true;
singleThreaded = true;
verbosity = VerbosityLevel::VERBOSITY_SILENT;
outputPath = Directory::GetCurrentDirectory();
}
Globals::~Globals()
{
for (const auto& w : workerData)
{
delete w.second;
}
if (rom != nullptr)
{
delete rom;
}
}
void Globals::AddSegment(int32_t segment, ZFile* file, int workerID)
{
if (!Globals::Instance->singleThreaded)
{
auto worker = workerData[workerID];
if (std::find(worker->segments.begin(), worker->segments.end(), segment) ==
worker->segments.end())
worker->segments.push_back(segment);
if (worker->segmentRefFiles.find(segment) == worker->segmentRefFiles.end())
worker->segmentRefFiles[segment] = std::vector<ZFile*>();
worker->segmentRefFiles[segment].push_back(file);
}
else
{
if (std::find(segments.begin(), segments.end(), segment) == segments.end())
segments.push_back(segment);
if (cfg.segmentRefFiles.find(segment) == cfg.segmentRefFiles.end())
cfg.segmentRefFiles[segment] = std::vector<ZFile*>();
cfg.segmentRefFiles[segment].push_back(file);
}
}
bool Globals::HasSegment(int32_t segment, int workerID)
{
if (!Globals::Instance->singleThreaded)
return std::find(workerData[workerID]->segments.begin(),
workerData[workerID]->segments.end(), segment) != workerData[workerID]->segments.end();
else
return std::find(segments.begin(), segments.end(), segment) != segments.end();
}
ZFile* Globals::GetSegment(int32_t segment, int workerID)
{
if (!Globals::Instance->singleThreaded)
{
if (HasSegment(segment, workerID))
{
int idx = std::find(workerData[workerID]->segments.begin(),
workerData[workerID]->segments.end(), segment) -
workerData[workerID]->segments.begin();
return workerData[workerID]->files[idx];
}
else
return nullptr;
}
else
{
if (HasSegment(segment, workerID))
{
int idx = std::find(segments.begin(), segments.end(), segment) - segments.begin();
return files[idx];
}
else
return nullptr;
}
}
std::map<int32_t, std::vector<ZFile*>> Globals::GetSegmentRefFiles(int workerID)
{
if (!Globals::Instance->singleThreaded)
return workerData[workerID]->segmentRefFiles;
else
return cfg.segmentRefFiles;
}
void Globals::AddFile(ZFile* file, int workerID)
{
if (singleThreaded)
files.push_back(file);
else
workerData[workerID]->files.push_back(file);
}
void Globals::AddExternalFile(ZFile* file, int workerID)
{
if (singleThreaded)
externalFiles.push_back(file);
else
workerData[workerID]->externalFiles.push_back(file);
}
void Globals::BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath)
{
std::string name = outPath.stem().string();
ZTexture tex(nullptr);
if (name.find("u32") != std::string::npos)
tex.dWordAligned = false;
tex.FromPNG(pngFilePath.string(), texType);
std::string cfgPath = StringHelper::Split(pngFilePath.string(), ".")[0] + ".cfg";
if (DiskFile::Exists(cfgPath))
name = DiskFile::ReadAllText(cfgPath);
std::string src = tex.GetBodySourceCode();
DiskFile::WriteAllBytes(outPath.string(), src.c_str(), src.size());
}
std::map<std::string, ExporterSet*>& Globals::GetExporterMap()
{
static std::map<std::string, ExporterSet*> exporters;
return exporters;
}
void Globals::AddExporter(std::string exporterName, ExporterSet* exporterSet)
{
auto& exporters = GetExporterMap();
exporters[exporterName] = exporterSet;
}
ZResourceExporter* Globals::GetExporter(ZResourceType resType)
{
auto& exporters = GetExporterMap();
if (currentExporter != "" && exporters[currentExporter]->exporters.find(resType) !=
exporters[currentExporter]->exporters.end())
return exporters[currentExporter]->exporters[resType];
else
return nullptr;
}
ExporterSet* Globals::GetExporterSet()
{
auto& exporters = GetExporterMap();
if (currentExporter != "")
return exporters[currentExporter];
else
return nullptr;
}
std::vector<uint8_t> Globals::GetBaseromFile(std::string fileName)
{
if (fileMode == ZFileMode::ExtractDirectory)
{
if (StringHelper::Contains(fileName, "baserom/"))
fileName = StringHelper::Split(fileName, "baserom/")[1];
return rom->GetFile(fileName);
}
else
return DiskFile::ReadAllBytes(fileName);
}
bool Globals::GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile,
const std::string& expectedType, std::string& declName, int workerID)
{
if (segAddress == 0)
{
declName = "NULL";
return true;
}
uint8_t segment = GETSEGNUM(segAddress);
uint32_t offset = Seg2Filespace(segAddress, currentFile->baseAddress);
ZSymbol* sym;
sym = currentFile->GetSymbolResource(offset);
if (sym != nullptr)
{
if (expectedType == "" || expectedType == sym->GetSourceTypeName())
{
declName = sym->GetName();
return true;
}
}
sym = currentFile->GetSymbolResource(segAddress);
if (sym != nullptr)
{
if (expectedType == "" || expectedType == sym->GetSourceTypeName())
{
declName = sym->GetName();
return true;
}
}
if (currentFile->IsSegmentedInFilespaceRange(segAddress))
{
if (currentFile->GetDeclarationPtrName(segAddress, expectedType, declName))
return true;
}
else if (HasSegment(segment, workerID))
{
// OTRTODO: Multithreading
auto segs = GetSegmentRefFiles(workerID);
for (auto file : segs[segment])
{
offset = Seg2Filespace(segAddress, file->baseAddress);
sym = file->GetSymbolResource(offset);
if (sym != nullptr)
{
if (expectedType == "" || expectedType == sym->GetSourceTypeName())
{
declName = sym->GetName();
return true;
}
}
sym = file->GetSymbolResource(segAddress);
if (sym != nullptr)
{
if (expectedType == "" || expectedType == sym->GetSourceTypeName())
{
declName = sym->GetName();
return true;
}
}
if (file->IsSegmentedInFilespaceRange(segAddress))
{
if (file->GetDeclarationPtrName(segAddress, expectedType, declName))
return true;
}
}
}
const auto& symbolFromMap = Globals::Instance->cfg.symbolMap.find(segAddress);
if (symbolFromMap != Globals::Instance->cfg.symbolMap.end())
{
declName = "&" + symbolFromMap->second;
return true;
}
declName = StringHelper::Sprintf("0x%08X", segAddress);
return false;
}
bool Globals::GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSize,
ZFile* currentFile, const std::string& expectedType,
std::string& declName, int workerID)
{
if (segAddress == 0)
{
declName = "NULL";
return true;
}
uint8_t segment = GETSEGNUM(segAddress);
if (currentFile->IsSegmentedInFilespaceRange(segAddress))
{
bool addressFound = currentFile->GetDeclarationArrayIndexedName(segAddress, elementSize,
expectedType, declName);
if (addressFound)
return true;
}
else if (HasSegment(segment, workerID))
{
// OTRTODO: Multithreading
auto segs = GetSegmentRefFiles(workerID);
for (auto file : segs[segment])
{
if (file->IsSegmentedInFilespaceRange(segAddress))
{
bool addressFound = file->GetDeclarationArrayIndexedName(segAddress, elementSize,
expectedType, declName);
if (addressFound)
return true;
}
}
}
declName = StringHelper::Sprintf("0x%08X", segAddress);
return false;
}
ExternalFile::ExternalFile(fs::path nXmlPath, fs::path nOutPath)
: xmlPath{nXmlPath}, outPath{nOutPath}
{
}
ExporterSet::~ExporterSet()
{
for (auto& it : exporters)
{
delete it.second;
}
}

View File

@ -1,113 +0,0 @@
#pragma once
#include <map>
#include <string>
#include <vector>
#include "GameConfig.h"
#include "ZFile.h"
#include <ZRom.h>
#include <FileWorker.h>
class ZRoom;
enum class VerbosityLevel
{
VERBOSITY_SILENT,
VERBOSITY_INFO,
VERBOSITY_DEBUG
};
typedef void (*ExporterSetFunc)(ZFile*);
typedef bool (*ExporterSetFuncBool)(ZFileMode fileMode);
typedef void (*ExporterSetFuncVoid)(int argc, char* argv[], int& i);
typedef void (*ExporterSetFuncVoid2)(const std::string& buildMode, ZFileMode& fileMode);
typedef void (*ExporterSetFuncVoid3)();
typedef void (*ExporterSetFuncVoid4)(tinyxml2::XMLElement* reader);
typedef void (*ExporterSetResSave)(ZResource* res, BinaryWriter& writer);
class ExporterSet
{
public:
~ExporterSet();
std::map<ZResourceType, ZResourceExporter*> exporters;
ExporterSetFuncVoid parseArgsFunc = nullptr;
ExporterSetFuncVoid2 parseFileModeFunc = nullptr;
ExporterSetFuncBool processFileModeFunc = nullptr;
ExporterSetFunc beginFileFunc = nullptr;
ExporterSetFunc endFileFunc = nullptr;
ExporterSetFuncVoid3 beginXMLFunc = nullptr;
ExporterSetFuncVoid3 endXMLFunc = nullptr;
ExporterSetResSave resSaveFunc = nullptr;
ExporterSetFuncVoid3 endProgramFunc = nullptr;
ExporterSetFuncVoid4 processCompilableFunc = nullptr;
};
class Globals
{
public:
static Globals* Instance;
bool genSourceFile; // Used for extraction
bool useExternalResources;
bool testMode; // Enables certain experimental features
bool outputCrc = false;
bool profile; // Measure performance of certain operations
bool useLegacyZDList;
bool singleThreaded;
VerbosityLevel verbosity; // ZAPD outputs additional information
ZFileMode fileMode = ZFileMode::Invalid;
fs::path baseRomPath, inputPath, outputPath, sourceOutputPath, cfgPath, fileListPath;
TextureType texType;
ZGame game;
GameConfig cfg;
bool verboseUnaccounted = false;
bool gccCompat = false;
bool forceStatic = false;
bool forceUnaccountedStatic = false;
bool otrMode = true;
bool buildRawTexture = false;
bool onlyGenSohOtr = false;
ZRom* rom = nullptr;
std::vector<ZFile*> files;
std::vector<ZFile*> externalFiles;
std::vector<int32_t> segments;
std::map<int, FileWorker*> workerData;
std::string currentExporter;
static std::map<std::string, ExporterSet*>& GetExporterMap();
static void AddExporter(std::string exporterName, ExporterSet* exporterSet);
Globals();
~Globals();
void AddSegment(int32_t segment, ZFile* file, int workerID);
bool HasSegment(int32_t segment, int workerID);
ZFile* GetSegment(int32_t segment, int workerID);
std::map<int32_t, std::vector<ZFile*>> GetSegmentRefFiles(int workerID);
void AddFile(ZFile* file, int workerID);
void AddExternalFile(ZFile* file, int workerID);
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath);
ZResourceExporter* GetExporter(ZResourceType resType);
ExporterSet* GetExporterSet();
std::vector<uint8_t> GetBaseromFile(std::string fileName);
/**
* Search in every file (and the symbol map) for the `segAddress` passed as parameter.
* If the segment of `currentFile` is the same segment of `segAddress`, then that file will be
* used only, otherwise, the search will be performed in every other file.
* The name of that variable will be stored in the `declName` parameter.
* Returns `true` if the address is found. `false` otherwise,
* in which case `declName` will be set to the address formatted as a pointer.
*/
bool GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile,
const std::string& expectedType, std::string& declName, int workerID);
bool GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSize, ZFile* currentFile,
const std::string& expectedType, std::string& declName, int workerID);
};

View File

@ -1,506 +0,0 @@
#include "ImageBackend.h"
#include <cassert>
#include <cstdlib>
#include <png.h>
#include <stdexcept>
#include "Utils/StringHelper.h"
#include "WarningHandler.h"
/* ImageBackend */
ImageBackend::~ImageBackend()
{
FreeImageData();
}
void ImageBackend::ReadPng(const char* filename)
{
FreeImageData();
FILE* fp = fopen(filename, "rb");
if (fp == nullptr)
{
std::string errorHeader = StringHelper::Sprintf("could not open file '%s'", filename);
HANDLE_ERROR(WarningType::InvalidPNG, errorHeader, "");
}
png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (png == nullptr)
{
HANDLE_ERROR(WarningType::InvalidPNG, "could not create png struct", "");
}
png_infop info = png_create_info_struct(png);
if (info == nullptr)
{
HANDLE_ERROR(WarningType::InvalidPNG, "could not create png info", "");
}
if (setjmp(png_jmpbuf(png)))
{
// TODO: better warning explanation
HANDLE_ERROR(WarningType::InvalidPNG, "setjmp(png_jmpbuf(png))", "");
}
png_init_io(png, fp);
png_read_info(png, info);
width = png_get_image_width(png, info);
height = png_get_image_height(png, info);
colorType = png_get_color_type(png, info);
bitDepth = png_get_bit_depth(png, info);
#ifdef TEXTURE_DEBUG
printf("Width: %u\n", width);
printf("Height: %u\n", height);
printf("ColorType: ");
switch (colorType)
{
case PNG_COLOR_TYPE_RGBA:
printf("PNG_COLOR_TYPE_RGBA\n");
break;
case PNG_COLOR_TYPE_RGB:
printf("PNG_COLOR_TYPE_RGB\n");
break;
case PNG_COLOR_TYPE_PALETTE:
printf("PNG_COLOR_TYPE_PALETTE\n");
break;
default:
printf("%u\n", colorType);
break;
}
printf("BitDepth: %u\n", bitDepth);
printf("\n");
#endif
// Read any color_type into 8bit depth, RGBA format.
// See http://www.libpng.org/pub/png/libpng-manual.txt
if (bitDepth == 16)
png_set_strip_16(png);
if (colorType == PNG_COLOR_TYPE_PALETTE)
{
// png_set_palette_to_rgb(png);
isColorIndexed = true;
}
// PNG_COLOR_TYPE_GRAY_ALPHA is always 8 or 16bit depth.
if (colorType == PNG_COLOR_TYPE_GRAY && bitDepth < 8)
png_set_expand_gray_1_2_4_to_8(png);
/*if (png_get_valid(png, info, PNG_INFO_tRNS))
png_set_tRNS_to_alpha(png);*/
// These color_type don't have an alpha channel then fill it with 0xff.
/*if(*color_type == PNG_COLOR_TYPE_RGB ||
*color_type == PNG_COLOR_TYPE_GRAY ||
*color_type == PNG_COLOR_TYPE_PALETTE)
png_set_filler(png, 0xFF, PNG_FILLER_AFTER);*/
if (colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png);
png_read_update_info(png, info);
size_t rowBytes = png_get_rowbytes(png, info);
pixelMatrix = (uint8_t**)malloc(sizeof(uint8_t*) * height);
for (size_t y = 0; y < height; y++)
{
pixelMatrix[y] = (uint8_t*)malloc(rowBytes);
}
png_read_image(png, pixelMatrix);
#ifdef TEXTURE_DEBUG
printf("rowBytes: %zu\n", rowBytes);
size_t bytePerPixel = GetBytesPerPixel();
printf("imgData\n");
for (size_t y = 0; y < height; y++)
{
for (size_t x = 0; x < width; x++)
{
for (size_t z = 0; z < bytePerPixel; z++)
{
printf("%02X ", pixelMatrix[y][x * bytePerPixel + z]);
}
printf(" ");
}
printf("\n");
}
printf("\n");
#endif
fclose(fp);
png_destroy_read_struct(&png, &info, nullptr);
hasImageData = true;
}
void ImageBackend::ReadPng(const fs::path& filename)
{
ReadPng(filename.string().c_str());
}
void ImageBackend::WritePng(const char* filename)
{
assert(hasImageData);
FILE* fp = fopen(filename, "wb");
if (fp == nullptr)
{
std::string errorHeader =
StringHelper::Sprintf("could not open file '%s' in write mode", filename);
HANDLE_ERROR(WarningType::InvalidPNG, errorHeader, "");
}
png_structp png = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (png == nullptr)
{
HANDLE_ERROR(WarningType::InvalidPNG, "could not create png struct", "");
}
png_infop info = png_create_info_struct(png);
if (info == nullptr)
{
HANDLE_ERROR(WarningType::InvalidPNG, "could not create png info", "");
}
if (setjmp(png_jmpbuf(png)))
{
// TODO: better warning description
HANDLE_ERROR(WarningType::InvalidPNG, "setjmp(png_jmpbuf(png))", "");
}
png_init_io(png, fp);
png_set_IHDR(png, info, width, height,
bitDepth, // 8,
colorType, // PNG_COLOR_TYPE_RGBA,
PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
if (isColorIndexed)
{
png_set_PLTE(png, info, static_cast<png_color*>(colorPalette), paletteSize);
#ifdef TEXTURE_DEBUG
printf("palette\n");
png_color* aux = (png_color*)colorPalette;
for (size_t y = 0; y < paletteSize; y++)
{
printf("#%02X%02X%02X ", aux[y].red, aux[y].green, aux[y].blue);
if ((y + 1) % 8 == 0)
printf("\n");
}
printf("\n");
#endif
png_set_tRNS(png, info, alphaPalette, paletteSize, nullptr);
}
png_write_info(png, info);
// To remove the alpha channel for PNG_COLOR_TYPE_RGB format,
// Use png_set_filler().
// png_set_filler(png, 0, PNG_FILLER_AFTER);
#ifdef TEXTURE_DEBUG
size_t bytePerPixel = GetBytesPerPixel();
printf("imgData\n");
for (size_t y = 0; y < height; y++)
{
for (size_t x = 0; x < width * bytePerPixel; x++)
{
printf("%02X ", pixelMatrix[y][x]);
}
printf("\n");
}
printf("\n");
#endif
png_write_image(png, pixelMatrix);
png_write_end(png, nullptr);
fclose(fp);
png_destroy_write_struct(&png, &info);
}
void ImageBackend::WritePng(const fs::path& filename)
{
// Note: The .string() is necessary for MSVC, due to the implementation of std::filesystem
// differing from GCC. Do not remove!
WritePng(filename.string().c_str());
}
void ImageBackend::SetTextureData(const std::vector<std::vector<RGBAPixel>>& texData,
uint32_t nWidth, uint32_t nHeight, uint8_t nColorType,
uint8_t nBitDepth)
{
FreeImageData();
width = nWidth;
height = nHeight;
colorType = nColorType;
bitDepth = nBitDepth;
size_t bytePerPixel = GetBytesPerPixel();
pixelMatrix = static_cast<uint8_t**>(malloc(sizeof(uint8_t*) * height));
for (size_t y = 0; y < height; y++)
{
pixelMatrix[y] = static_cast<uint8_t*>(malloc(sizeof(uint8_t*) * width * bytePerPixel));
for (size_t x = 0; x < width; x++)
{
pixelMatrix[y][x * bytePerPixel + 0] = texData.at(y).at(x).r;
pixelMatrix[y][x * bytePerPixel + 1] = texData.at(y).at(x).g;
pixelMatrix[y][x * bytePerPixel + 2] = texData.at(y).at(x).b;
if (colorType == PNG_COLOR_TYPE_RGBA)
pixelMatrix[y][x * bytePerPixel + 3] = texData.at(y).at(x).a;
}
}
hasImageData = true;
}
void ImageBackend::InitEmptyRGBImage(uint32_t nWidth, uint32_t nHeight, bool alpha)
{
FreeImageData();
width = nWidth;
height = nHeight;
colorType = PNG_COLOR_TYPE_RGB;
if (alpha)
colorType = PNG_COLOR_TYPE_RGBA;
bitDepth = 8; // nBitDepth;
size_t bytePerPixel = GetBytesPerPixel();
pixelMatrix = static_cast<uint8_t**>(malloc(sizeof(uint8_t*) * height));
for (size_t y = 0; y < height; y++)
{
pixelMatrix[y] = static_cast<uint8_t*>(calloc(width * bytePerPixel, sizeof(uint8_t*)));
}
hasImageData = true;
}
void ImageBackend::InitEmptyPaletteImage(uint32_t nWidth, uint32_t nHeight)
{
FreeImageData();
width = nWidth;
height = nHeight;
colorType = PNG_COLOR_TYPE_PALETTE;
bitDepth = 8;
size_t bytePerPixel = GetBytesPerPixel();
pixelMatrix = (uint8_t**)malloc(sizeof(uint8_t*) * height);
for (size_t y = 0; y < height; y++)
{
pixelMatrix[y] = static_cast<uint8_t*>(calloc(width * bytePerPixel, sizeof(uint8_t*)));
}
colorPalette = calloc(paletteSize, sizeof(png_color));
alphaPalette = static_cast<uint8_t*>(calloc(paletteSize, sizeof(uint8_t)));
hasImageData = true;
isColorIndexed = true;
}
RGBAPixel ImageBackend::GetPixel(size_t y, size_t x) const
{
assert(y < height);
assert(x < width);
assert(!isColorIndexed);
RGBAPixel pixel;
size_t bytePerPixel = GetBytesPerPixel();
pixel.r = pixelMatrix[y][x * bytePerPixel + 0];
pixel.g = pixelMatrix[y][x * bytePerPixel + 1];
pixel.b = pixelMatrix[y][x * bytePerPixel + 2];
if (colorType == PNG_COLOR_TYPE_RGBA)
pixel.a = pixelMatrix[y][x * bytePerPixel + 3];
return pixel;
}
uint8_t ImageBackend::GetIndexedPixel(size_t y, size_t x) const
{
assert(y < height);
assert(x < width);
assert(isColorIndexed);
return pixelMatrix[y][x];
}
void ImageBackend::SetRGBPixel(size_t y, size_t x, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA)
{
assert(hasImageData);
assert(y < height);
assert(x < width);
size_t bytePerPixel = GetBytesPerPixel();
pixelMatrix[y][x * bytePerPixel + 0] = nR;
pixelMatrix[y][x * bytePerPixel + 1] = nG;
pixelMatrix[y][x * bytePerPixel + 2] = nB;
if (colorType == PNG_COLOR_TYPE_RGBA)
pixelMatrix[y][x * bytePerPixel + 3] = nA;
}
void ImageBackend::SetGrayscalePixel(size_t y, size_t x, uint8_t grayscale, uint8_t alpha)
{
assert(hasImageData);
assert(y < height);
assert(x < width);
size_t bytePerPixel = GetBytesPerPixel();
pixelMatrix[y][x * bytePerPixel + 0] = grayscale;
pixelMatrix[y][x * bytePerPixel + 1] = grayscale;
pixelMatrix[y][x * bytePerPixel + 2] = grayscale;
if (colorType == PNG_COLOR_TYPE_RGBA)
pixelMatrix[y][x * bytePerPixel + 3] = alpha;
}
void ImageBackend::SetIndexedPixel(size_t y, size_t x, uint8_t index, uint8_t grayscale)
{
assert(hasImageData);
assert(y < height);
assert(x < width);
size_t bytePerPixel = GetBytesPerPixel();
pixelMatrix[y][x * bytePerPixel + 0] = index;
assert(index < paletteSize);
png_color* pal = static_cast<png_color*>(colorPalette);
pal[index].red = grayscale;
pal[index].green = grayscale;
pal[index].blue = grayscale;
alphaPalette[index] = 255;
}
void ImageBackend::SetPaletteIndex(size_t index, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA)
{
assert(isColorIndexed);
assert(index < paletteSize);
png_color* pal = static_cast<png_color*>(colorPalette);
pal[index].red = nR;
pal[index].green = nG;
pal[index].blue = nB;
alphaPalette[index] = nA;
}
void ImageBackend::SetPalette(const ImageBackend& pal, uint32_t offset)
{
assert(isColorIndexed);
size_t bytePerPixel = pal.GetBytesPerPixel();
for (size_t y = 0; y < pal.height; y++)
{
for (size_t x = 0; x < pal.width; x++)
{
size_t index = y * pal.width + x;
if (index >= paletteSize)
{
/*
* Some TLUTs are bigger than 256 colors.
* For those cases, we will only take the first 256
* to colorize this CI texture.
*/
return;
}
uint8_t r = pal.pixelMatrix[y][x * bytePerPixel + 0];
uint8_t g = pal.pixelMatrix[y][x * bytePerPixel + 1];
uint8_t b = pal.pixelMatrix[y][x * bytePerPixel + 2];
uint8_t a = pal.pixelMatrix[y][x * bytePerPixel + 3];
SetPaletteIndex(index + offset, r, g, b, a);
}
}
}
uint32_t ImageBackend::GetWidth() const
{
return width;
}
uint32_t ImageBackend::GetHeight() const
{
return height;
}
uint8_t ImageBackend::GetColorType() const
{
return colorType;
}
uint8_t ImageBackend::GetBitDepth() const
{
return bitDepth;
}
double ImageBackend::GetBytesPerPixel() const
{
switch (colorType)
{
case PNG_COLOR_TYPE_RGBA:
return 4 * bitDepth / 8;
case PNG_COLOR_TYPE_RGB:
return 3 * bitDepth / 8;
case PNG_COLOR_TYPE_PALETTE:
return 1 * bitDepth / 8;
default:
HANDLE_ERROR(WarningType::InvalidPNG, "invalid color type", "");
}
}
void ImageBackend::FreeImageData()
{
if (hasImageData)
{
for (size_t y = 0; y < height; y++)
free(pixelMatrix[y]);
free(pixelMatrix);
pixelMatrix = nullptr;
}
if (isColorIndexed)
{
free(colorPalette);
free(alphaPalette);
colorPalette = nullptr;
alphaPalette = nullptr;
isColorIndexed = false;
}
hasImageData = false;
}
/* RGBAPixel */
void RGBAPixel::SetRGBA(uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA)
{
r = nR;
g = nG;
b = nB;
a = nA;
}
void RGBAPixel::SetGrayscale(uint8_t grayscale, uint8_t alpha)
{
r = grayscale;
g = grayscale;
b = grayscale;
a = alpha;
}

View File

@ -1,72 +0,0 @@
#pragma once
#include <cstdint>
#include <vector>
#include "Utils/Directory.h"
class RGBAPixel
{
public:
RGBAPixel() = default;
void SetRGBA(uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA);
void SetGrayscale(uint8_t grayscale, uint8_t alpha = 0);
uint8_t r = 0;
uint8_t g = 0;
uint8_t b = 0;
uint8_t a = 0;
};
class ImageBackend
{
public:
ImageBackend() = default;
~ImageBackend();
void ReadPng(const char* filename);
void ReadPng(const fs::path& filename);
void WritePng(const char* filename);
void WritePng(const fs::path& filename);
void SetTextureData(const std::vector<std::vector<RGBAPixel>>& texData, uint32_t nWidth,
uint32_t nHeight, uint8_t nColorType, uint8_t nBitDepth);
void InitEmptyRGBImage(uint32_t nWidth, uint32_t nHeight, bool alpha);
void InitEmptyPaletteImage(uint32_t nWidth, uint32_t nHeight);
RGBAPixel GetPixel(size_t y, size_t x) const;
uint8_t GetIndexedPixel(size_t y, size_t x) const;
void SetRGBPixel(size_t y, size_t x, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA = 0);
void SetGrayscalePixel(size_t y, size_t x, uint8_t grayscale, uint8_t alpha = 0);
void SetIndexedPixel(size_t y, size_t x, uint8_t index, uint8_t grayscale);
void SetIndexedPixel(size_t y, size_t x, uint8_t index, RGBAPixel pixel);
void SetPaletteIndex(size_t index, uint8_t nR, uint8_t nG, uint8_t nB, uint8_t nA);
void SetPalette(const ImageBackend& pal, uint32_t offset = 0);
uint32_t GetWidth() const;
uint32_t GetHeight() const;
uint8_t GetColorType() const;
uint8_t GetBitDepth() const;
protected:
uint8_t** pixelMatrix = nullptr; // height * [width * bytePerPixel]
void* colorPalette = nullptr;
uint8_t* alphaPalette = nullptr;
size_t paletteSize = 16 * 16;
uint32_t width = 0;
uint32_t height = 0;
uint8_t colorType = 0;
uint8_t bitDepth = 0;
bool hasImageData = false;
bool isColorIndexed = false;
double GetBytesPerPixel() const;
void FreeImageData();
};

View File

@ -1,594 +0,0 @@
#include "Globals.h"
#include "Utils/Directory.h"
#include <Utils/DiskFile.h>
#include "Utils/Path.h"
#include "WarningHandler.h"
#include "ZAnimation.h"
ZNormalAnimation nAnim(nullptr);
ZCurveAnimation cAnim(nullptr);
ZLinkAnimation lAnim(nullptr);
ZLegacyAnimation lAnim2(nullptr);
#include "ZArray.h"
ZArray arr(nullptr);
#include "ZAudio.h"
ZAudio audio(nullptr);
#include "ZBackground.h"
ZBackground back(nullptr);
#include "ZBlob.h"
ZBlob blob(nullptr);
#include "ZCollision.h"
ZCollisionHeader colHeader(nullptr);
#include "ZCutscene.h"
ZCutscene cs(nullptr);
#include "ZLimb.h"
ZLimb limb(nullptr);
#include "ZMtx.h"
ZMtx mtx(nullptr);
#include "ZPath.h"
ZPath path(nullptr);
#include "ZPlayerAnimationData.h"
ZPlayerAnimationData pAnimData(nullptr);
#include "ZScalar.h"
ZScalar scalar(nullptr);
#include "ZSkeleton.h"
ZLimbTable limbTbl(nullptr);
ZSkeleton skel(nullptr);
#include "ZString.h"
ZString str(nullptr);
#include "ZSymbol.h"
ZSymbol sym(nullptr);
#include "ZText.h"
ZText txt(nullptr);
#include "ZTexture.h"
ZTexture tex(nullptr);
#include "ZVector.h"
ZVector vec(nullptr);
#include "ZVtx.h"
ZVtx vtx(nullptr);
#include "ZRoom/ZRoom.h"
ZRoom room(nullptr);
#include "ZFile.h"
#include "ZTexture.h"
#include "CrashHandler.h"
#include <string>
#include <string_view>
#include "tinyxml2.h"
#include <ctpl_stl.h>
//extern const char gBuildHash[];
const char gBuildHash[] = "";
bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath,
ZFileMode fileMode, int workerID);
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath);
void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath);
void BuildAssetBlob(const fs::path& blobFilePath, const fs::path& outPath);
int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileMode fileMode);
volatile int numWorkersLeft = 0;
extern void ImportExporters();
extern "C" int zapd_main(int argc, char* argv[])
{
// Syntax: ZAPD.out [mode (btex/bovl/e)] (Arbritrary Number of Arguments)
if (argc < 2)
{
printf("ZAPD.out (%s) [mode (btex/bovl/bsf/bblb/bmdlintr/bamnintr/e)] ...\n", gBuildHash);
return 1;
}
Globals* g = new Globals();
WarningHandler::Init(argc, argv);
for (int i = 1; i < argc; i++)
{
if (!strcmp(argv[i], "--version"))
{
printf("ZAPD.out %s\n", gBuildHash);
return 0;
}
else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h"))
{
printf("Congratulations!\n");
printf("You just found the (unimplemented and undocumented) ZAPD's help message.\n");
printf("Feel free to implement it if you want :D\n");
WarningHandler::PrintHelp();
return 0;
}
}
// Parse other "commands"
for (int32_t i = 2; i < argc; i++)
{
std::string arg = argv[i];
if (arg == "-o" || arg == "--outputpath") // Set output path
{
Globals::Instance->outputPath = argv[++i];
if (Globals::Instance->sourceOutputPath == "")
Globals::Instance->sourceOutputPath = Globals::Instance->outputPath;
}
else if (arg == "-i" || arg == "--inputpath") // Set input path
{
Globals::Instance->inputPath = argv[++i];
}
else if (arg == "-b" || arg == "--baserompath") // Set baserom path
{
Globals::Instance->baseRomPath = argv[++i];
}
else if (arg == "-osf") // Set source output path
{
Globals::Instance->sourceOutputPath = argv[++i];
}
else if (arg == "-gsf") // Generate source file during extraction
{
Globals::Instance->genSourceFile = std::string_view(argv[++i]) == "1";
}
else if (arg == "-tm") // Test Mode (enables certain experimental features)
{
Globals::Instance->testMode = std::string_view(argv[++i]) == "1";
}
else if (arg == "-crc" ||
arg == "--output-crc") // Outputs a CRC file for each extracted texture.
{
Globals::Instance->testMode = std::string_view(argv[++i]) == "1";
}
else if (arg == "-ulzdl") // Use Legacy ZDisplay List
{
Globals::Instance->useLegacyZDList = std::string_view(argv[++i]) == "1";
}
else if (arg == "-profile") // Enable profiling
{
Globals::Instance->profile = std::string_view(argv[++i]) == "1";
}
else if (arg ==
"-uer") // Split resources into their individual components (enabled by default)
// TODO: We may wish to make this a part of the config file...
{
Globals::Instance->useExternalResources = std::string_view(argv[++i]) == "1";
}
else if (arg == "-tt") // Set texture type
{
Globals::Instance->texType = ZTexture::GetTextureTypeFromString(argv[++i]);
}
else if (arg == "-fl") // Set baserom filelist path
{
Globals::Instance->fileListPath = argv[++i];
}
else if (arg == "-rconf") // Read Config File
{
Globals::Instance->cfg.ReadConfigFile(argv[++i]);
}
else if (arg == "-eh") // Enable Error Handler
{
CrashHandler_Init();
}
else if (arg == "-v") // Verbose
{
Globals::Instance->verbosity = static_cast<VerbosityLevel>(strtol(argv[++i], NULL, 16));
}
else if (arg == "-vu" || arg == "--verbose-unaccounted") // Verbose unaccounted
{
Globals::Instance->verboseUnaccounted = true;
}
else if (arg == "-se" || arg == "--set-exporter") // Set Current Exporter
{
ImportExporters();
Globals::Instance->currentExporter = argv[++i];
}
else if (arg == "--gcc-compat") // GCC compatibility
{
Globals::Instance->gccCompat = true;
}
else if (arg == "-s" || arg == "--static")
{
Globals::Instance->forceStatic = true;
}
else if (arg == "-us" || arg == "--unaccounted-static")
{
Globals::Instance->forceUnaccountedStatic = true;
}
else if (arg == "-brt" || arg == "--build-raw-texture")
{
Globals::Instance->buildRawTexture = true;
}
else if (arg == "--norom")
{
Globals::Instance->onlyGenSohOtr = true;
}
}
// Parse File Mode
ExporterSet* exporterSet = Globals::Instance->GetExporterSet();
if(Globals::Instance->onlyGenSohOtr) {
exporterSet->endProgramFunc();
delete g;
return 0;
}
std::string buildMode = argv[1];
ZFileMode fileMode = ZFileMode::Invalid;
if (buildMode == "btex")
fileMode = ZFileMode::BuildTexture;
else if (buildMode == "bren")
fileMode = ZFileMode::BuildBackground;
else if (buildMode == "bsf")
fileMode = ZFileMode::BuildSourceFile;
else if (buildMode == "bblb")
fileMode = ZFileMode::BuildBlob;
else if (buildMode == "e")
fileMode = ZFileMode::Extract;
else if (buildMode == "ed")
fileMode = ZFileMode::ExtractDirectory;
else if (exporterSet != nullptr && exporterSet->parseFileModeFunc != nullptr)
exporterSet->parseFileModeFunc(buildMode, fileMode);
if (fileMode == ZFileMode::Invalid)
{
printf("Error: Invalid file mode '%s'\n", buildMode.c_str());
return 1;
}
Globals::Instance->fileMode = fileMode;
if (fileMode == ZFileMode::ExtractDirectory)
Globals::Instance->rom = new ZRom(Globals::Instance->baseRomPath.string());
// We've parsed through our commands once. If an exporter exists, it's been set by now.
// Now we'll parse through them again but pass them on to our exporter if one is available.
if (exporterSet != nullptr && exporterSet->parseArgsFunc != nullptr)
{
for (int32_t i = 2; i < argc; i++)
exporterSet->parseArgsFunc(argc, argv, i);
}
if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO)
printf("ZAPD: Zelda Asset Processor For Decomp: %s\n", gBuildHash);
if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_DEBUG)
{
WarningHandler::PrintWarningsDebugInfo();
}
// TODO: switch
if (fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile || fileMode == ZFileMode::ExtractDirectory)
{
bool procFileModeSuccess = false;
if (exporterSet != nullptr && exporterSet->processFileModeFunc != nullptr)
procFileModeSuccess = exporterSet->processFileModeFunc(fileMode);
if (!procFileModeSuccess)
{
if (fileMode == ZFileMode::ExtractDirectory)
{
std::vector<std::string> fileList =
Directory::ListFiles(Globals::Instance->inputPath.string());
const int num_threads = std::thread::hardware_concurrency();
ctpl::thread_pool pool(num_threads > 1 ? num_threads / 2 : 1);
bool parseSuccessful;
auto start = std::chrono::steady_clock::now();
int fileListSize = fileList.size();
Globals::Instance->singleThreaded = false;
for (int i = 0; i < fileListSize; i++)
Globals::Instance->workerData[i] = new FileWorker();
numWorkersLeft = fileListSize;
for (int i = 0; i < fileListSize; i++)
{
if (Globals::Instance->singleThreaded)
{
ExtractFunc(i, fileList.size(), fileList[i], fileMode);
}
else
{
std::string fileListItem = fileList[i];
pool.push([i, fileListSize, fileListItem, fileMode](int) {
ExtractFunc(i, fileListSize, fileListItem, fileMode);
});
}
}
if (!Globals::Instance->singleThreaded)
{
while (true)
{
if (numWorkersLeft <= 0)
break;
std::this_thread::sleep_for(std::chrono::milliseconds(250));
}
}
auto end = std::chrono::steady_clock::now();
auto diff =
std::chrono::duration_cast<std::chrono::seconds>(end - start).count();
printf("Generated OTR File Data in %i seconds\n", diff);
}
else
{
bool parseSuccessful;
for (auto& extFile : Globals::Instance->cfg.externalFiles)
{
fs::path externalXmlFilePath =
Globals::Instance->cfg.externalXmlFolder / extFile.xmlPath;
if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO)
{
printf("Parsing external file from config: '%s'\n",
externalXmlFilePath.c_str());
}
parseSuccessful = Parse(externalXmlFilePath, Globals::Instance->baseRomPath,
extFile.outPath, ZFileMode::ExternalFile, 0);
if (!parseSuccessful)
return 1;
}
parseSuccessful =
Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath,
Globals::Instance->outputPath, fileMode, 0);
if (!parseSuccessful)
return 1;
}
}
}
else if (fileMode == ZFileMode::BuildTexture)
{
TextureType texType = Globals::Instance->texType;
BuildAssetTexture(Globals::Instance->inputPath, texType, Globals::Instance->outputPath);
}
else if (fileMode == ZFileMode::BuildBackground)
{
BuildAssetBackground(Globals::Instance->inputPath, Globals::Instance->outputPath);
}
else if (fileMode == ZFileMode::BuildBlob)
{
BuildAssetBlob(Globals::Instance->inputPath, Globals::Instance->outputPath);
}
if (exporterSet != nullptr && exporterSet->endProgramFunc != nullptr)
exporterSet->endProgramFunc();
end:
delete exporterSet;
//Globals::Instance->GetExporterSet() = nullptr; //TODO NULL this out. Compiler complains about lvalue assignment.
delete g;
return 0;
}
int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileMode fileMode)
{
bool parseSuccessful;
printf("(%i / %i): %s\n", (workerID + 1), fileListSize, fileListItem.c_str());
for (auto& extFile : Globals::Instance->cfg.externalFiles)
{
fs::path externalXmlFilePath = Globals::Instance->cfg.externalXmlFolder / extFile.xmlPath;
if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO)
{
printf("Parsing external file from config: '%s'\n", externalXmlFilePath.c_str());
}
parseSuccessful = Parse(externalXmlFilePath, Globals::Instance->baseRomPath,
extFile.outPath, ZFileMode::ExternalFile, workerID);
if (!parseSuccessful)
return 1;
}
parseSuccessful = Parse(fileListItem, Globals::Instance->baseRomPath,
Globals::Instance->outputPath, fileMode, workerID);
if (!parseSuccessful)
return 1;
if (Globals::Instance->singleThreaded)
{
for (int i = 0; i < Globals::Instance->files.size(); i++)
{
delete Globals::Instance->files[i];
Globals::Instance->files.erase(Globals::Instance->files.begin() + i);
i--;
}
Globals::Instance->externalFiles.clear();
Globals::Instance->segments.clear();
Globals::Instance->cfg.segmentRefFiles.clear();
}
else
{
for (int i = 0; i < Globals::Instance->workerData[workerID]->files.size(); i++)
{
delete Globals::Instance->workerData[workerID]->files[i];
Globals::Instance->workerData[workerID]->files.erase(
Globals::Instance->workerData[workerID]->files.begin() +
i);
i--;
}
Globals::Instance->workerData[workerID]->externalFiles.clear();
Globals::Instance->workerData[workerID]->segments.clear();
Globals::Instance->workerData[workerID]->segmentRefFiles.clear();
numWorkersLeft--;
}
return 0;
}
bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath,
ZFileMode fileMode, int workerID)
{
tinyxml2::XMLDocument doc;
tinyxml2::XMLError eResult = doc.LoadFile(xmlFilePath.string().c_str());
if (eResult != tinyxml2::XML_SUCCESS)
{
// TODO: use XMLDocument::ErrorIDToName to get more specific error messages here
HANDLE_ERROR(WarningType::InvalidXML,
StringHelper::Sprintf("invalid XML file: '%s'", xmlFilePath.c_str()), "");
return false;
}
tinyxml2::XMLNode* root = doc.FirstChild();
if (root == nullptr)
{
HANDLE_WARNING(
WarningType::InvalidXML,
StringHelper::Sprintf("missing Root tag in xml file: '%s'", xmlFilePath.c_str()), "");
return false;
}
for (tinyxml2::XMLElement* child = root->FirstChildElement(); child != NULL;
child = child->NextSiblingElement())
{
if (std::string_view(child->Name()) == "File")
{
ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", xmlFilePath, workerID);
Globals::Instance->AddFile(file, workerID);
if (fileMode == ZFileMode::ExternalFile)
{
Globals::Instance->AddExternalFile(file, workerID);
file->isExternalFile = true;
}
}
else if (std::string(child->Name()) == "ExternalFile")
{
const char* xmlPathValue = child->Attribute("XmlPath");
if (xmlPathValue == nullptr)
{
throw std::runtime_error(StringHelper::Sprintf(
"Parse: Fatal error in '%s'.\n"
"\t Missing 'XmlPath' attribute in `ExternalFile` element.\n",
xmlFilePath.c_str()));
}
const char* outPathValue = child->Attribute("OutPath");
if (outPathValue == nullptr)
{
throw std::runtime_error(StringHelper::Sprintf(
"Parse: Fatal error in '%s'.\n"
"\t Missing 'OutPath' attribute in `ExternalFile` element.\n",
xmlFilePath.c_str()));
}
fs::path externalXmlFilePath =
Globals::Instance->cfg.externalXmlFolder / fs::path(xmlPathValue);
fs::path externalOutFilePath = fs::path(outPathValue);
if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO)
{
printf("Parsing external file: '%s'\n", externalXmlFilePath.c_str());
}
// Recursion. What can go wrong?
Parse(externalXmlFilePath, basePath, externalOutFilePath, ZFileMode::ExternalFile, workerID);
}
else
{
std::string errorHeader =
StringHelper::Sprintf("when parsing file '%s'", xmlFilePath.c_str());
std::string errorBody = StringHelper::Sprintf(
"Found a resource outside a File element: '%s'", child->Name());
HANDLE_ERROR(WarningType::InvalidXML, errorHeader, errorBody);
}
}
if (fileMode != ZFileMode::ExternalFile)
{
ExporterSet* exporterSet = Globals::Instance->GetExporterSet();
if (exporterSet != nullptr && exporterSet->beginXMLFunc != nullptr)
exporterSet->beginXMLFunc();
std::vector<ZFile*> files;
if (Globals::Instance->singleThreaded)
files = Globals::Instance->files;
else
files = Globals::Instance->workerData[workerID]->files;
for (ZFile* file : files)
{
if (fileMode == ZFileMode::BuildSourceFile)
file->BuildSourceFile();
else
file->ExtractResources();
}
if (exporterSet != nullptr && exporterSet->endXMLFunc != nullptr)
exporterSet->endXMLFunc();
}
return true;
}
void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath)
{
return Globals::Instance->BuildAssetTexture(pngFilePath, texType, outPath);
}
void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath)
{
ZBackground background(nullptr);
background.ParseBinaryFile(imageFilePath.string(), false);
DiskFile::WriteAllText(outPath.string(), background.GetBodySourceCode());
}
void BuildAssetBlob(const fs::path& blobFilePath, const fs::path& outPath)
{
ZBlob* blob = ZBlob::FromFile(blobFilePath.string());
std::string name = outPath.stem().string(); // filename without extension
std::string src = blob->GetBodySourceCode();
DiskFile::WriteAllText(outPath.string(), src);
delete blob;
}

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