![]() so far, all the files in the game loop from the loop start point to the end so what's missing from this is which value indicates the loop end offset and some unknown alignment (or just a fixed amount of padding) at the end of the file there appears to be 32 byte alignment between the adpcm data blocks if there's a second channel, then you must seek to the adpcmData2Offset to get the data for the second channel right after that the adpcm data of the first channel starts after this numChannels * standard dspadpcm header follows U32 adpcmLoopStartOffsetAux2 // 0x1C, same as adpcmData2OffsetAux1 U32 adpcmLoopStartOffsetAux1 // 0x18, if adpcmLoopOffset != 0xFFFFFFFF then same value else value is 0 U32 adpcmData2OffsetAux2 // 0x14, same value as adpcmData2Offset U32 adpcmData2OffsetAux1 // 0x10, same value as adpcmData2Offset U32 adpcmLoopStartOffset // 0x0C, byte loop start offset, equal to 0xFFFFFFFF if not used (relative to the start of the data itself, not the headers) U32 adpcmData2Offset // 0x08, byte offset to the adpcm data of the second channel (relative to the end of the this header + all channel headers) U32 numChannels // 0x04, usually 2 (could also be initial offset) U16 field00 // 0x00, always 512, possibly a version number of 2.00 The encoder can easily be applied to layouts used by other games as well, so long as they derive from DSPADPCM: dsp format includes metadata for a loop-region as well this is visualized as a label-track in Audacity. To make the encoding process easier, I've created a fork of Audacity to import/export. I'm pleased with the results! Generated streams sound great when injected into actual game images. I spent much time trying to grok the algorithms, identifying the mathematical basis and transforming the reverse-engineered code into something more readable and optimized: A mono 16-bit PCM stream ends up being ~28.5% the original size in pointed me to this implementation in BrawlTools which appears to contain reverse-engineered versions of the original algorithms: The result is 8-byte ADPCM frames with 1-byte header at 4 bits-per-sample. The codec is based on an IEEE-defined ADPCM predictor combined with 8 coefficient-pairs selected via filtered discrete-fourier-transform. This tool and codec is available for GameCube, Wii and Wii U systems. Nintendo provides developers with DSPADPCM.EXE and dsptool.dll to perform the encoding. For some time, I've been wanting to insert custom music and SFX by implementing a DSPADPCM encoder (which many titles seem to use for audio compression). the Metroid Prime games and recent Donkey Kong titles). I'm a game reverse-engineering and modding enthusiast focusing on games by Retro Studios (i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |