|  b2747aa8b4 * git subrepo pull tools/asm-differ --force subrepo: subdir: "tools/asm-differ" merged: "d218cdf0" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "d218cdf0" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "f5fe93d7" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "f5fe93d7" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "e7a8a48c" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "e7a8a48c" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "d14ea084" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "d14ea084" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "e243634e" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "e243634e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/decomp-permuter --force subrepo: subdir: "tools/decomp-permuter" merged: "d1294dfa0" upstream: origin: "https://github.com/simonlindholm/decomp-permuter.git" branch: "main" commit: "d1294dfa0" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/graphovl --force subrepo: subdir: "tools/graphovl" merged: "f5fe93d75" upstream: origin: "https://github.com/AngheloAlf/graphovl.git" branch: "master" commit: "f5fe93d75" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull tools/ZAPD --force subrepo: subdir: "tools/ZAPD" merged: "d0cd6b397" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "d0cd6b397" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * add ExternalXMLFolder config * git subrepo pull --force tools/decomp-permuter subrepo: subdir: "tools/decomp-permuter" merged: "a20bac942" upstream: origin: "https://github.com/simonlindholm/decomp-permuter.git" branch: "main" commit: "a20bac942" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull --force tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "4f7b8393e" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "4f7b8393e" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * git subrepo pull --force tools/asm-differ subrepo: subdir: "tools/asm-differ" merged: "f30d43ace" upstream: origin: "https://github.com/simonlindholm/asm-differ.git" branch: "main" commit: "f30d43ace" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "2f68596" * Remove Segment="128" | ||
|---|---|---|
| .. | ||
| ExporterTest | ||
| ZAPD | ||
| ZAPDUtils | ||
| docs | ||
| lib | ||
| .clang-format | ||
| .gitignore | ||
| .gitrepo | ||
| Jenkinsfile | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| ZAPD.sln | ||
| copycheck.py | ||
		
			
				
				README.md
			
		
		
			
			
		
	
	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:
sudo apt install libpng-dev
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- 0optimizations 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.
 
- Debugging symbols enabled (
- LLD=1: builds with the LLVM linker- ld.lldinstead 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:
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.
 
 
- 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_tC array.
 
- In this mode, ZAPD expects a PNG file as input, a filename as ouput and a texture type parameter (
- 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_tC 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_tC array.
 
- bovl: "Build overlay" mode.- In this mode, ZAPD expects an overlay C file as input, a filename as ouput and an overlay configuration path (-cfg).
- ZAPD will generate a reloc .sfile.
 
- In this mode, ZAPD expects an overlay C file as input, a filename as ouput and an overlay configuration path (
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 eorbsfmodes.
 
- Can be used only in 
- -osf PATH: Set source output path. This is the path where the- .cand- .hfiles will be extracted to. If omitted, it will use the value passed to- --outputpathparameter.
- -gsf MODE: Generate source file during extraction. If- MODEis- 1, C source files will be generated.- Can be used only in emode.
 
- Can be used only in 
- -crc/- --output-crc: Outputs a CRC file for each extracted texture.- Can be used only in eorbsfmodes.
 
- Can be used only in 
- -ulzdl MODE: Use "Legacy ZDisplayList" instead of- libgfxd. Set- MODEto- 1to enable it.- Can be used only in eorbsfmodes.
 
- Can be used only in 
- -profile MODE: Enable profiling. Set- MODEto- 1to enable it.
- -uer MODE: Split resources into their individual components (enabled by default). Set- MODEto non-- 1to 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
 
 
- Can be used only in mode 
- -cfg PATH: Set cfg path (for overlays).- Can be used only in bovlmode.
 
- Can be used only in 
- -rconf PATHRead 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 eorbsfmodes.
 
- Can be used only in 
- -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 eorbsfmodes.
 
- -tm MODE: Test Mode (enables certain experimental features). To enable it, set- MODEto- 1.
- -wno/- --warn-no-offsets: Enable warnings for nodes that dont have offsets specified. Takes priority over- -eno/- --error-no-offsets.
- -eno/- --error-no-offsets: Enable errors for nodes that dont have offsets specified.
- -se/- --set-exporter: Sets which exporter to use.
- --gcc-compat: Enables GCC compatible mode. Slower.
- -s/- --static: Mark every asset as- static.- This behaviour can be overridden per asset using Static=in the respective XML node.
 
- This behaviour can be overridden per asset using 
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.