BCWAV File Format
Note that this Docs are based on Current State of development and are very unfinished
This file can be very incorect due to copying from bcstm_doku.md
Contents
Offset |
Size |
Datatype |
Description |
0x00 |
4 |
u32 |
Magic 'CWAV' 0x56415743 |
0x04 |
2 |
u16 |
Endianness Big == 0xfffe Little == 0xfeff |
0x06 |
2 |
u16 |
Header Size 0x40 |
0x08 |
4 |
u32 |
Version |
0x0c |
4 |
u32 |
File Size |
0x10 |
2 |
u16 |
Num Blocks (Should be 2) |
0x12 |
2 |
u16 |
Reserved |
0x14 |
12 |
Sized Reference |
Info Block Sized Reference |
0x20 |
12 |
Sized Reference |
Data Block Sized Reference |
Reference
Offset |
Size |
Datatype |
Description |
0x00 |
2 |
Reference Type |
TypeID |
0x02 |
2 |
u16 |
Padding |
0x04 |
4 |
u32 |
Offset (0xffffffff represents null) |
Sized Reference
Offset |
Size |
Datatype |
Description |
0x00 |
8 |
Reference |
Reference |
0x08 |
4 |
u32 |
Size |
Reference Table
Offset |
Size |
Datatype |
Description |
0x00 |
4 |
u32 |
Count |
0x04 |
Count*8 |
Reference |
References |
Reference Types
Offset |
Size |
Datatype |
Description |
0x00 |
4 |
u32 |
Magic |
0x04 |
4 |
u32 |
Size |
Info Block
All Reference Offsets at the beginning of Info Block are Relative to the Infoblock + 0x08 (size of Block Header) Position
Offset |
Size |
Datatype |
Description |
0x00 |
8 |
Block Header |
Block Header |
0x08 |
1 |
u8 |
Encoding |
0x09 |
1 |
u8 |
Loop 1 == true -- 0 == false |
0x0a |
1 |
u16 |
Padding |
0x0c |
4 |
u32 |
Sample Rate |
0x10 |
4 |
u32 |
Loop Start |
0x14 |
4 |
u32 |
Loop End |
0x18 |
4 |
u32 |
Reserved |
0x18 |
8 |
Reference Table |
Channel Info Reference Table |
Stream Info
Offset |
Size |
Datatype |
Description |
0x00 |
1 |
u8 |
Encoding |
0x01 |
1 |
u8 |
Loop 1 == true -- 0 == false |
0x02 |
1 |
u8 |
Num Channels |
0x03 |
1 |
u8 |
Padding |
0x04 |
4 |
u32 |
Sample Rate |
0x04 |
4 |
u32 |
Loop Start |
0x04 |
4 |
u32 |
Loop End |
0x04 |
4 |
u32 |
Sample Blocks |
0x04 |
4 |
u32 |
Sample Block Size |
0x04 |
4 |
u32 |
Sample Block Samples |
0x04 |
4 |
u32 |
Last Sample Block Size |
0x04 |
4 |
u32 |
Last Sample Block Samples |
0x04 |
4 |
u32 |
Last Sample Block Padded Size |
0x04 |
4 |
u32 |
Seek Data Size |
0x04 |
4 |
u32 |
Seek Interval Samples |
0x04 |
4 |
Reference |
Sample Data Reference |
Channel Info
Offset |
Size |
Datatype |
Description |
0x00 |
8 |
Reference |
Reference to DSP ADPCM Info !!! The Offsets are Relative to the start Pos of the Channel Info Object !!! |
DSP ADPCM Info
DSP ADPCM Param
Offset |
Size |
Datatype |
Description |
0x00 |
32 |
u16 |
16 Bit Coefficients |
DSP ADPCM Context
Offset |
Size |
Datatype |
Description |
0x00 |
1 |
u8 |
4Bit Predictor and 4Bit Scale |
0x01 |
1 |
u8 |
Reserved |
0x02 |
2 |
16 |
Previous Sample |
0x02 |
2 |
16 |
Second Previous Sample |
Basic Datatypes
u32
using u32 = unsigned int; // or uint32_t
u16
using u16 = unsigned short; // or uint16_t
u8
using u8 = unsigned char; // or uint8_t
Tools / Devices / File SOurces used for research
Name |
Description |
Visual Studio Code |
Used for creating ctrff c++ code for bcstm |
ImHex |
Used to Analyze the Hex Code of the bcstm Files |
Citra |
Fast way to generate Log files when developing ctrff |
ctrff-cli |
Tool to generate Debug Output on Desktop OS like seen in BCSTM-Player File inspector |
New 3ds XL |
Testing on Real Hardware (BCSTM-Player) |
Mario Kart 7 (Cartridge) |
Used to get Test files |
CTGP 7 |
Used to get Test files |
Super Mario Maker 3ds (Cartridge) |
Used to get Test files |
Mario and Luigi Bowsers inside story (Cartridge) |
Used to get Test files |
Donkey Kong Country Returns 3D |
Used to get Test files |