EXXO: Dreamcast .KAT sound bank extractor v0.1b [Archived]

If you're working on a project that involves hacking the games, or making a new Ecco game, post it here!
Post Reply
User avatar
Moduvator
Site Admin
Posts: 46
Joined: 16 Dec 2025, 22:10
Location: Atlantis
Contact:

EXXO: Dreamcast .KAT sound bank extractor v0.1b [Archived]

Post by Moduvator »

This is a small tool that I wrote back in the beginning of 2020 as a result of poking through the .KAT sound bank files of Defender of The Future.
There were plenty of tools available for PS2 version already, but as far as I was aware, there were none for Dreamcast so I took it upon myself to work that out.
Development was stopped as soon as the tool was good enough for my needs, so some of the features, like command line flags and support for Star Wars Racer specific version of the format were planned but ultimately never implemented.

Most of the hints came from the original Katana SDK as there was actually a tool for creating such banks and showing information on already existing ones. There was none for unpacking those but the rest was fairly straightforward to figure out.

Regular .KAT bank contains at its first 4 bytes the number of files stored within. 18 in this case:
image.png
Immediately after that there is a series of structures, each describing those files and where to find them:

Code: Select all

/* KAT as per SEGA specs */
typedef struct {
	uint32_t m_dataType;	// File type
	uint32_t m_FileOffset;	// Chunk offset from file start
	uint32_t m_FileSize;	// Data size
	uint32_t m_SampleRate;
	uint32_t m_Loop;	// Looping flag if music
	uint32_t m_SampleSize;	// 4 - Yamaha ADPCM, 16 - PCM
	uint8_t m_unk3[20];	// Unidentified
} kat_t;
Note how this format does not contain actual filenames anywhere: those are instead stored inside .GDE resource files, making the data a bit awkward to extract. The game likely loads the entire bank into memory using standard libraries provided by Sega and then uses it to reference whatever actual sound effect names that are required. This was then changed in Sentinels of The Universe where PCM data is stored inside .GDE alongside with the actual filename, but the overall principle had remained the same. Most likely back when development was only started on DoTF, programmers at Appaloosa would prefer to use regular tools provided by Sega for this new console and began implementing their own solutions as they gained more experience. Incidentally, Star Wars Racer uses a custom variation on this where additionally they store a file's index as well as its name which illustrates another approach to this.

It's important to note that data at given offsets is a raw PCM stream with no header data as it's meant to be passed through to the console's sound chip. This means that in order to convert this into a regular .WAV file that would play back in a media player, we also need to construct all the missing chunks that are described in RIFF standards.
Some of the audio used in DoTF is in Dreamcast's native ADPCM which is a lossy 4 bits per sample compressed format, some of the sounds are regular 16-bit PCM that's generally used where higher quality is needed. The tool builds this data automatically based on the header information. Note that some audio players may not have native support for ADPCM and can require additional codecs to be present in the system.

Below is the actual tool one can find useful. Program takes 2 arguments, the first one being the actual .KAT bank and an optional output directory. If the latter does not exist, the program will attempt to create it. If no second argument is supplied, files will be extracted into the same directory containing the original bank.

Code: Select all

> .\exxo.exe .\ATLANTIS.KAT testnewdir

-----------       EXXO       -----------
 Dreamcast .KAT asset extractor program
    Copyright (C) 2020 by Moduvator
----------------------------------------
File ./ATLANTIS.KAT contains 18 records

Directory testnewdir doesn't exist, creating it.

Entry 1:
Size: 4936 bytes.
Type: 1 (ADPCM sound file). Sample Rate: 22050 Hz
Written to testnewdir/ATLANTIS_01.wav
----------
Entry 2:
Size: 17084 bytes.
Type: 1 (ADPCM sound file). Sample Rate: 22050 Hz
Written to testnewdir/ATLANTIS_02.wav
----------
Attachments
exxo.zip
(64.15 KiB) Downloaded 25 times
Post Reply