- C++ 61.4%
- C 29.4%
- Python 7.3%
- Shell 0.8%
- Nix 0.8%
- Other 0.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
/ check (push) Successful in 1m11s
The layout, the seven blobs it was derived from, and the differential against the beta's PSX build of the same asset. |
||
| .forgejo/workflows | ||
| brender@9cfeb24510 | ||
| cJSON | ||
| contrib | ||
| croctool | ||
| docs/formats | ||
| libcroc | ||
| research | ||
| resources | ||
| tests | ||
| vsclib@9746c7fc99 | ||
| .clang-format | ||
| .gitignore | ||
| .gitmodules | ||
| CMakeLists.txt | ||
| convert.sh | ||
| COPYING | ||
| default.nix | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| research.nix | ||
CrocUtils
A small collection of utilities for Croc.
For encoding/decoding of Argonaut ASF and BRP files, please see FFmpeg.
- ASF decoding is supported as of d84a30e1238b9feed1c957809108fc5e39d80629.
- ASF encoding is supported as of 6fdf3cc53b5e90524ccfde534ae4a91ee87814aa.
- BRP decoding is supported as of a3a6b56200e2899769175291837a178f20e1e95a.
croctool
Usage
Usage: croctool version|-v|--version
croctool map decompile <input-file.map> [output-file.json|-]
croctool map compile <input-file.json|-> <output-file.map>
croctool map convert [--rebase [-]<000-899>] <input-file.map> <output-file.map>
croctool map unwad <input-file.wad> <base-name>
croctool crocfile dump <CROCFILE.DIR> [output-file.json|-]
croctool crocfile extract <CROCFILE.DIR> <CROCFILE.DAT|CROCFILE.1> [output-dir]
croctool crocfile build <CROCFILE.DIR> <CROCFILE.DAT|CROCFILE.1> <input-file1> [input-file2 [...]]
croctool strun dump <STRUN.BIN> [output-file.json]
croctool mod burst2obj [--type auto|pc|psx|saturn] <input-file.mod> [output-dir]
croctool wad extract <base-name> <file-name> [output-dir|-]
croctool wad extract-all <base-name> [output-dir]
croctool wad dump-index <index-name.idx> [output-file.json]
croctool music dump <MUSIC.BIN> [output-file.json|-]
croctool tex convert <input-file.pix> [base-name]
croctool tex tpage <input-file.bin> [output-dir]
croctool tex tpage-info <input-file.bin> [output-file.json|-]
croctool tex scrn <input-file.bin> [output-dir]
map decompile
Convert a Croc .MAP file into a JSON file for human editing.
map compile
Compile a JSON file into a version 21 Croc .MAP file.
map convert
Convert a Croc .MAP file into version 21, readable by Croc DE.
--rebasewill offset the door targets by the specified number.
map unwad
Split a PSX MAP%d.wad file into individual .MAP files.
- Will NOT work with the
MP%03d_%02d.WADfiles.
crocfile dump
Dump a CROCFILE.DIR to JSON for human reading.
crocfile extract
Extract a CROCFILE.DIR and CROCFILE.{DAT,1} pair into the given directory.
The directory must exist beforehand. A manifest.json describing the
directory is written alongside the files.
crocfile build
Build a CROCFILE.DIR and CROCFILE.{DAT,1} pair from a list of files. File names are truncated to eight characters and upper-cased, matching the directory entry format.
strun dump
Dump a STRUN.BIN to JSON for human reading.
mod burst2obj
"Burst" a MOD file into separate Wavefront Alias OBJ meshes.
The layout is detected from the file, including the big-endian Saturn variant;
--type overrides the guess. Material handling isn't supported yet.
wad extract
Extract a named file from a given WAD/IDX pair.
base-nameshould be given as the WAD/IDX path WITHOUT the extension.- If
output-dirisn't specified, it will write to the current working directory. - If
output-diris-, then the file contents will be written to stdout. - Otherwise, the file will be placed in
output-dir.
wad extract-all
Extract all files from a given WAD/IDX pair.
base-nameshould be given as the WAD/IDX path WITHOUT the extension.- If
output-dirisn't specified, the files will be written to the current working directory. - Otherwise, the files will be placed in
output-dir.
wad dump-index
Dump an IDX file to JSON.
music dump
Dump a MUSIC.BIN or MAGMUS.BIN music table to JSON.
tex convert
Convert a BRender PIX file (texture) to PNG. If multiple textures are contained within the same file, the three-digit index is appended to the file name.
tex tpage
Convert a PSX texture page (TPAGE*.BIN) to one PNG per rectangle.
The output directory must exist beforehand.
A retail page stores each rectangle's 256-colour palette as the row named by
its clut_y field, starting at x = 0; an early page has no palette and is
written as greyscale indices.
tex tpage-info
Dump a texture page's rectangle table to JSON.
tex scrn
Convert a Saturn SCRN bitmap to PNG: the plane as <name>.png and a sheet
of its character cells as <name>_cells.png. The output directory must exist
beforehand.
Notes
-
Odd padding in PSX maps
- Some PSX map dumps carry stray
0x0D 0x0Apairs; they are an artefact of the dump, not part of the format.
- Some PSX map dumps carry stray
-
The extracted trees under
research/are built withbchunkand7z; seeresearch.nix. -
All 0.12 beta maps convert fine and are either
v12_oldorv12_old_noambient. -
The .MAP files on SLUS-00530, SLPS-01055 and SLES-00593 are identical (
normalformat). -
There are differences between the PSX and PC maps. Don't be alarmed if things look slightly different.
$ jq .point_lights[0] resources/maps/json/slus00530/MP010_03.json { "position": [ 0.1999969482421875, -0.28570556640625, 2.1999969482421875 ], "colour": [ 255, 3, 3 ], "fade_from": 1, "fade_to": 1.5 } $ jq .point_lights[0] resources/maps/json/pc/MP010_03.json { "position": [ 0, -0.4571380615234375, 2 ], "colour": [ 255, 83, 3 ], "fade_from": 1, "fade_to": 1.5 }
Format references
- PSX-SPX: CDROM File Archive Croc 1 (DIR, WAD, etc.)
describes the PlayStation file formats, including
CROCFILE.DIR, the map/WAD containers,.MOD, texture pages and.ANI.
License
Copyright © 2020 Zane van Iperen
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, and only version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3rd-party Licenses
| Project | License | License URL |
|---|---|---|
| cJSON | MIT | https://github.com/DaveGamble/cJSON/blob/master/LICENSE |