BAS (File Format): Difference between revisions

From Luma's Workshop
Jump to navigation Jump to search
(Initial BAS page (still very WIP))
 
(damn you TMC I wanted to write that page. But good job)
 
Line 1: Line 1:
[[Category:File formats]]
[[Category:File formats]]
{{WIP}}


'''BAS''' stands for (presumably) '''B'''inary '''A'''udio '''S'''equence. It is used in several JSystem games, including Super Mario Galaxy and Super Mario Galaxy 2.
'''BAS''' ('''B'''inary '''A'''nimation '''S'''ound) files play [[List of Sounds (SMG2)|Sound Effects]] when a defined frame of a [[BCK (File Format)|BCK]] animation is reached. They only work with a BCK file of the same filename. ''Super Mario Galaxy'' and ''Super Mario Galaxy 2'' each contain BAS files in many ObjectData files.


== Header ==
== File specifications ==
=== Header ===
Every BAS starts with this header. It is 0x8 in size.
Every BAS starts with this header. It is 0x8 in size.
{|class="wikitable"
{|class="wikitable"
Line 27: Line 27:
|}
|}


== Sound Entry ==
=== Sound Entry ===
0x20 in size, including padding.
0x20 in size, including padding.
{|class="wikitable"
{|class="wikitable"

Latest revision as of 13:00, 11 February 2026


BAS (Binary Animation Sound) files play Sound Effects when a defined frame of a BCK animation is reached. They only work with a BCK file of the same filename. Super Mario Galaxy and Super Mario Galaxy 2 each contain BAS files in many ObjectData files.

File specifications

Header

Every BAS starts with this header. It is 0x8 in size.

Offset Type Description
0x00 UInt16 Entry Count
0x02 UInt16 Unused
0x04 UInt32 * Pointer (in memory) to a class that implements virtual methods for:
  • void doNothing(); // you can put anything here, just make sure one virtual function comes first.
  • u32 *getSound(JAUSoundAnimation *);
  • u32 getNumSounds(JAUSoundAnimation *);

in that order. Put 0 for default behavior. Always 0 in SMG/SMG2.

It is then followed by an array of sound entries:

Offset Type Description
0x08 SoundEntry[Entry Count] Array of sound entries.

Sound Entry

0x20 in size, including padding.

Offset Type Description
0x00 UInt32 Sound ID
0x04 Single Start Frame
0x08 Single End Frame
0x0C Single Pitch
0x10 UInt32 Flags:

bool useEndFrame(?) = (flags >> 6) & 0x01
(Still unknown/unused but set: 32, 16, 4)

0x14 UInt8 Volume
0x15 UInt8 Pitch Factor
0x16 UInt8 Loop Count
0x17 UInt8 Panning
0x18 UInt8 Volume Factor
0x19 UInt8[7] Padding

(References: Hack.io.BAS, bastool, pyjaubas)