LibT2FS 0.1
C API for accessing TEngine data in memory.
Loading...
Searching...
No Matches
Home

This project is work in progress and far from complete.

t2fs.h is the core of this project, it is responsible for navigating the data tree, decompression and deinterleaving.

To get some use out of the data that can be accessed with t2fs.h we provide some higher level APIs in models/*.h

Gettings started

Core basics

#include "t2fs.h"
int main() {
t_t2fs lib;
const char *filepath = "/home/user/games/Seeds of Evil.lss";
t2fs_init(&lib);
// Auto detect needed config for the given input file based
// on the filename. This to handle endianness and other
// differences between files.
if (t2fs_config_auto_detect(&lib.config, filepath) != 0) {
return 1;
}
if (t2fs_open(&lib, filepath, NULL, 1) != T2FS_OK) {
// error .. do not use the lib object after this, calling t2fs_close()
// would be ok as long as it's inited.
return 1;
}
// do stuff
// ..
// free all nodes, their data and close the file.
t2fs_close(&lib);
return 0;
}
int t2fs_config_auto_detect(T2FSFileConfig *dest, const char *const filepath)
Auto detect the needed config based on filename.
T2FSFileConfig config
We might need different config for different files, these configs are pre-defined and contain info li...
Definition t2fs.h:296
void t2fs_close(t_t2fs *lib)
Close opened file and free all allocated node/data memory.
void t2fs_init(t_t2fs *lib)
Always initialize your t_t2fs object.
@ T2FS_OK
Definition t2fs.h:282
t2fsStatus t2fs_open(t_t2fs *lib, const char *const filepath, const char *const schemaPath, uint8_t searchSchema)
Open .dat/.lss/.lsm file.
struct s_t2fs t_t2fs
This is the core LibT2FS object that you will be passing around.
Definition t2fs.h:53

Target files

filename date schema sha256 link
demodata.dat 1997-09-02 CARTDATA.json 600e1a0ec96f81244cdbc6e186267d3785f51fc454a39a3019025fcbaf41364d link
CARTDATA.DAT 1997-09-29 CARTDATA.json 17e638afa1a8689caaa100976d06641d9c770edf73053245d7dee719ad5c9571 link
Cartdata.dat 1997-11-06 CARTDATA.json 69feb318fae294e5d34d15eb942cf53be5520fc12e6aaaee633f000b4129c063 link
demodata.dat 1997-12-19 CARTDATA.json a2f54dff7e5d692283ac9274bbb70cb03a3f7253a3a6ac29fb20f5fffd9e9bb6 link
Seeds of Evil.lss 1999-01-11 Seeds of Evil.json 9ec578cffed6df96e9ff53844932e6d3ff39a43f176792bbf8bcdf209637f8c3 link
Rok Match Levels.lsm 1999-01-15 Seeds of Evil.json 4c22900227b1a387ed527ac6c90f2973bf6bed8a67900154acdb0fa633a8a88e link
CTF Levels.lsm 1999-01-15 Seeds of Evil.json 280d73d942c439d9c247016518b9a6cb75a27a5d13247b493fdeabc216afa327 link
Arena Levels.lsm 1999-01-15 Seeds of Evil.json 6aa792b84e7491219cce218677c0bceb2b9f7057edb329431e94c94963011c15 link
win32.dat 1999-01-18 win32.json 8d5c88dd233cbd88a9a9feebe58784f828841fa2598ca593941fac1f4773d9fe link
Seeds of Evil.lss 1999-02-05 Seeds of Evil.json 845d860af600b0d7a685359aafde0572f6e775c34853ccaaff85f46bce4e47c4 link
Turok2Demo.lss 1999-02-10 Seeds of Evil.json 22b1e183396e92b0b5330e6ecaaa474e64ff8cef81ed0f29900d80524d4d36e8 link
Rok Match Demo.lsm 1999-02-10 Seeds of Evil.json 498aa4a06649c5bcd42513f60463efc9537f1666f12c744e9f73a60df187edaa link

Also initial work has been done on writing the schema for the data of N64 Rage Wars and N64 Shadow of Oblivion, extracted from N64 roms. Textures are already working, they have the same data structs, the rest still needs to be looked into.

Issues