BAS (File Format)

From Luma's Workshop
Revision as of 08:01, 31 January 2025 by AwesomeTMC (talk | contribs) (Initial BAS page (still very WIP))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page is in progress and may contain incomplete information or editor's notes.

BAS stands for (presumably) Binary Audio Sequence. It is used in several JSystem games, including Super Mario Galaxy and Super Mario Galaxy 2.

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)