BFASD (File Format)

From Wexos's Wiki
(Redirected from BFASD)
Jump to navigationJump to search

A BFASD file (Binary caFe Animation Sound Data) contains information related to how certain models produce sound based on their skeleton animation on Wii U. It is a direct update of the Wii format BRASD.

File Format

File Header

This is the structure for a BFASD header.

Offset Type Description
0x00 Char[4] File magic. Always FASD in ASCII.
0x04 UInt16 Byte-order-mark. FE FF for big endian, FF FE for little endian.
0x06 UInt16 Header size. Always 00 14.
0x08 UInt32 Version. Always 01 00 00 00.
0x0C UInt32 Length of the file in bytes.
0x10 UInt16 Number of sections. Always 00 01.
0x12 UInt16 Unknown. Always 00 00.
0x14 UInt32 Section 1 flag. Always 80 00 00 00.
0x18 UInt32 Offset to DATA section.
0x1C UInt32 Length of DATA section.

DATA

The DATA section starts with a section header.

Offset Type Description
0x00 Char[4] Section magic. Always DATA in ASCII.
0x04 UInt32 Length of this section.

Event Header

After the DATA header comes the header for the event.

Offset Type Description
0x00 UInt32 Number of frames in corresponding animation.
0x04 UInt16 Event reference flag. Always 0x8100.
0x06 UInt16 Padding.
0x08 Int32 Offset to the events, relative to 0x04 in this structure. Always 0x0C.
0x0C UInt32 Number of events.

Event

An event is split up into two structures. The first event structure contains information about the frames and the second event structure contains information about the sound. In a file all the event structure 1 comes first, and after that, all the event structure 2. It is the event that controls the info about the animation sound and stores a reference to a BFSAR sound effect.

Event structure 1
Offset Type Description
0x00 UInt32 Start frame.
0x04 Int32 End frame. If no end frame is used, this is set to -1.
0x08 Byte Flags. 1 means that the event is a trigger, 2 means that the end frame is positive infitie and 4 means that the start frame is negative infinite.
0x09 SByte Number of loops.
0x0A Byte Playback loop interval after the number of loops.
0x0B Byte Padding.
0x0C UInt16 Offset to structure 2 flag.
0x0E UInt16 Padding.
0x10 Int32 Offset to start of the event structure 2 used in this event. Relative to the start of this event entry.

Event structure 2 stores some more information about the sound. It has a string reference stored to a BFSAR sound effect and some sound settings.

Event structure 2
Offset Type Description
0x00 UInt32 Option flags. xxxx xxAB:
  • A is set if the sound should continue after the animation has stopped.
  • B is set if sequence variable is enabled.
0x04 UInt32 Placeholder for sound index. Always 0xFFFFFFFF.
0x08 UInt16 Offset flag.
0x0A UInt16 Padding.
0x0C Int32 Sound label offset.
0x10 Byte Sound volume.
0x11 Byte Playback direction. 0 = both, 1 = forward and 2 = backward
0x12 Byte Sequence variable index. 0 - 15 are local variables and 16 - 31 global variables.
0x13 Byte Padding.
0x14 Float Pitch.
0x18 UInt32 Padding.
0x1C UInt32 User Parameter. Unknown meaning.
0x20 String Sound Name. This string is null-terminated ASCII string and refers to a BFSAR sound effect.

Tools

The following tools can handle BFASD files: