Difference between revisions of "BFASD (File Format)"

From MK8
Jump to navigation Jump to search
(Created page with "A '''BFASD''' file ('''B'''inary ca'''F'''e '''A'''nimation '''S'''ound '''D'''ata) contains information related to how certain models produce sound based on their skeleton an...")
 
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
A '''BFASD''' file ('''B'''inary ca'''F'''e '''A'''nimation '''S'''ound '''D'''ata) contains information related to how certain models produce sound based on their skeleton animation.
+
A '''BFASD''' file ('''B'''inary ca'''F'''e '''A'''nimation '''S'''ound '''D'''ata) contains information related to how certain models produce sound based on their skeleton animation. It is a direct update of the Wii format [[:mkw:BRASD (File Format)|BRASD]].
  
 
= File Format =
 
= File Format =
Line 11: Line 11:
 
| 0x00 || String || '''File magic'''. Always ''FASD'' in ASCII.
 
| 0x00 || String || '''File magic'''. Always ''FASD'' in ASCII.
 
|-
 
|-
| 0x04 || UInt16 || Byte order mark.
+
| 0x04 || UInt16 || {{BOM}}
 
|-
 
|-
 
| 0x06 || UInt16 || Header size. Always 00 14.
 
| 0x06 || UInt16 || Header size. Always 00 14.
Line 43: Line 43:
 
| 0x04 || UInt32 || Length of this section.
 
| 0x04 || UInt32 || Length of this section.
 
|-
 
|-
| 0x08 || UInt32 || Number of frames in corresponding animation.
+
| 0x08 || colspan=2 {{Unknown|Start of Event Header}}
|-
 
| 0x0C || UInt32 || '''Unknown'''. Always 01 00 00 00?
 
|-
 
| 0x10 || colspan=2 {{Unknown|Start of Event Header}}
 
 
|}
 
|}
  
Line 57: Line 53:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || '''Unknown'''. Always 0x0C.
+
| 0x00 || UInt32 || Number of frames in corresponding animation.
 
|-
 
|-
| 0x04 || UInt32 || Number of [[#Event|event]]s.
+
| 0x04 || UInt16 || '''Event reference flag'''. Always 0x8100.
 
|-
 
|-
| 0x08 || colspan=2 {{Unknown|Start of first event}}
+
| 0x06 || UInt16 || Padding.
 +
|-
 +
| 0x08 || Int32 || '''Offset to the [[#Event|events]]''', relative to 0x04 in this structure. Always 0x0C.
 +
|-
 +
| 0x0C || UInt32 || Number of [[#Event|event]]s.
 +
|-
 +
| 0x10 || colspan=2 {{Unknown|Start of first event}}
 
|}
 
|}
  
 
=== Event ===
 
=== 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 [[BRSAR]] sound effect.
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 76: Line 78:
 
| 0x04 || Int32 || '''End frame'''. If no end frame is used, this is set to -1.
 
| 0x04 || Int32 || '''End frame'''. If no end frame is used, this is set to -1.
 
|-
 
|-
| 0x08 || Byte || '''Type''' and '''Playback Interval'''. The first bit is Type (0 = Range, 1 = Trigger). The second bit is Playback Interval (0 = true, 1 = false).
+
| 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 || Byte || Padding?
+
| 0x09 || SByte || Number of loops.
 
|-
 
|-
| 0x0A || Byte || '''Unknown'''.
+
| 0x0A || Byte || Playback loop interval after the number of loops.
 
|-
 
|-
| 0x0B || Byte || Padding?
+
| 0x0B || Byte || Padding.
 
|-
 
|-
| 0x0C || UInt32 || '''Unknown'''.
+
| 0x0C || UInt16 || '''Offset to structure 2 flag'''.
 
|-
 
|-
| 0x10 || UInt32 || '''Offset''' to start of the event structure 2 used in this event. Relative to the start of this event entry.
+
| 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 is more unknown. It has a string reference stored to a [[BFSAR]] sound effect and some sound settings.
+
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.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 96: Line 100:
 
! Offset !! Type !! Description
 
! Offset !! Type !! Description
 
|-
 
|-
| 0x00 || UInt32 || '''Unknown'''.
+
| 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 || '''Unknown'''. Always 0xFFFFFFFF.
+
| 0x04 || UInt32 || Placeholder for sound index. Always 0xFFFFFFFF.
 
|-
 
|-
| 0x08 || Byte || '''Unknown'''.
+
| 0x08 || UInt16 || Offset flag.
 
|-
 
|-
| 0x09 || Byte || '''Unknown'''.
+
| 0x0A || UInt16 || Padding.
 
|-
 
|-
| 0x0A || Byte || '''Unknown'''.
+
| 0x0C || Int32 || Sound label offset.
 
|-
 
|-
| 0x0B || Byte || '''Unknown'''.
+
| 0x10 || Byte || Sound volume.
 
|-
 
|-
| 0x0C || UInt32 || '''Unknown'''.
+
| 0x11 || Byte || '''Playback direction'''. 0 = both, 1 = forward and 2 = backward
 
|-
 
|-
| 0x10 || Byte || Sound volume.
+
| 0x12 || Byte || '''Sequence variable index'''. 0 - 15 are local variables and 16 - 31 global variables.
 
|-
 
|-
| 0x11 || Byte[3] || Padding?
+
| 0x13 || Byte || Padding.
 
|-
 
|-
 
| 0x14 || Float || Pitch.
 
| 0x14 || Float || Pitch.
 
|-
 
|-
| 0x18 || Byte[4] || Padding?
+
| 0x18 || UInt32 || Padding.
 
|-
 
|-
 
| 0x1C || UInt32 || '''User Parameter'''. Unknown meaning.
 
| 0x1C || UInt32 || '''User Parameter'''. Unknown meaning.
Line 125: Line 131:
 
= Tools =
 
= Tools =
 
The following tools can handle BFASD files:  
 
The following tools can handle BFASD files:  
* (none)
+
* [[Wexos's Toolbox]], by [[Wexos]]
 +
 
 +
[[Category:File Format]]

Latest revision as of 15:19, 22 July 2017

A BFASD file (Binary caFe Animation Sound Data) contains information related to how certain models produce sound based on their skeleton animation. 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 String File magic. Always FASD in ASCII.
0x04 UInt16 Byte Order Mark (BOM): 0xFEFF for big endian and 0xFFFE 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.
0x20 End of this file header

DATA

The DATA section starts with a section header.

Offset Type Description
0x00 String Section magic. Always DATA in ASCII.
0x04 UInt32 Length of this section.
0x08 Start of Event Header

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.
0x10 Start of first event

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-termined ASCII string and refers to a BFSAR sound effect.

Tools

The following tools can handle BFASD files: