BAS (File Format)

From Luma's Workshop
Revision as of 13:00, 11 February 2026 by SY24 (talk | contribs) (damn you TMC I wanted to write that page. But good job)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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)