Work in progress. Super Mario Galaxy JSYSTEM animation files reader.

Isaac 6dbbe20cf2 some functions for both BMD/BDL and a memory leak fix 1 week ago
includes 6dbbe20cf2 some functions for both BMD/BDL and a memory leak fix 1 week ago
.gitignore 50fc266377 smth 1 month ago
main.c 7acc7c68ea hrub 1 month ago
readme ff65bba4e4 real 2 months ago

readme

Compiling (from linux):

Linux (32 bits): gcc -m32 -std=c99 main.c -o bean
Windows (32 bits): i686-w64-mingw32-gcc -std=c99 main.c -o bean.exe


Usage:

bean [-anim/-model] [JSYSTEM animation file] [-model/-check/--extract-bti] [BMD/BDL model] [-read/-convert/-check] [csv/bin]


Commands:

"-anim" --> after this command a CSV or binary JSYSTEM file path supported by the program is to be put.
"-model" --> after this command a BDL file path is to be put (has to be the one related to the animation file).
"-read" --> this command indicates to the program to read the contents of an anim file and/or a model file
(information will be printed on terminal). The information going to be read in the BDL is only the necessary to understand better the animation file.
"-convert" --> this command indicates to the program that a conversion to CSV or binary JSYSTEM animation file is to
be done. Add "csv" to convert a binary JSYSTEM file to its CSV equivalent or add "bin" to convert a CSV animation file to its binary JSYSTEM equivalent. "-convert" will only work for CSV animation files if the model to which the CSV is to be applied is supplied to the program.
"-check" --> this command tells the program to check if an animation/model file is valid for reading. If stated
providing an animation file and a model file, the program will check if the anim file is compatible with the model file.
"--extract-bti" --> this command tells the program to extract the BTI textures inside a BMD/BDL model.


Examples:

- extract BTI images from a BMD/BDL file
bean -model mario.bdl --extract-bti

- check an anim file
bean -anim iceflick.btp -model mario.bdl -check

- command to read iceflick.btp.csv
bean -anim iceflick.btp.csv -read

- command to read mario.bdl
bean -model mario.bdl -read

- command to read iceflick.btp and mario.bdl
bean -anim iceflick.btp -model mario.bdl -read

- command to convert iceflick.btp to its CSV equivalent
bean -anim iceflick.btp -model mario.bdl -convert csv

- command to convert iceflick.btp.csv to its binary JSYSTEM file equivalent
bean -anim iceflick.btp.csv -model mario.bdl -convert bin


Support:

- Read BTP files (little/big endian).
- Convert BTP (little/big endian) to CSV BTP.
- Convert CSV BTP to BTP (little/big endian).
- Partially read BMD/BDL files information.
- Extract BMD/BDL BTI textures.
- ...


Information:

- It will be focused only on JSYSTEM file formats from Super Mario Galaxy.
- Output CSV files will follow the J3D Animation Editor CSV exports for each animation type.
- Binary files built from CSV files are written in memory for better reading.
- This program will assume that the system in which is being executed has 1 byte equal to 8 bits and that the method to store information on said system is little endian.
- Nintendo Wii's JSYSTEM files are Big Endian so the functions in the program will read the files in that mode. As 3DAS files are also intended to be read the functions will also read files in Little Endian.
- A "Pointer Table" will be defined for each file type, specifying (after reading) the important sections of the file read. As far as I can tell, it helps with flexibility.


To do:

- Hecking do a better organization of my functions and improve them somehow (always).
- Add BCK support (New Format!, but first *huge* research).
- Decide to add color to terminal output.
- Probably add other file formats from SMG as well that aren't JSYSTEM related.


Changelog:

14/01/23 - Updated bean: reading big/little endian BMDs, BTI extraction from BMD/BDLs, reading little endian (3DAS) BDLs and reading 3DAS BTPs is now supported (MEGA UPDATE).

05/01/24 - Updated bean logic when converting BTP files since better information about BTPs was found. Mate this file format is mega epic.