WSYS

From Luma's Workshop
Revision as of 06:15, 29 May 2025 by Xayrga (talk | contribs) (take casualness out)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WSYS Wave System

Internally, Wave System.

This section contains all of the information required for decoding the AW File as well as other information for melodic tuning, root key, and other various parts of JAudio.

WSYS format is consistent between engine versions, however some games do not make use of the waveCount bytes. If the wavecount int32 is missing in anything newer than twilight princess, the WSYS will not function correctly.

WSYS Structure

Offset Type Name Description
0x00
int32 0x57535953 'WSYS' Magic
0x04
int32 size WSYS Size
0x08
int32 wsysID WSYS ID (This is how insts select the wsys)
0x0C
int32 waveCount WSYS Wave Count
0x10
int32 WINF Pointer WBINF
0x14
int32 WBCT Pointer WBCT

WINF

WINF is a pointer container. They point to the Wave Groups.

The ID's for every wave group are controlled by the SCNE object. They line up, WaveGroup[1] uses WaveScenes[1]


Offset Type Name Description
0x00
int32 0x57494E46 'WINF' Magic
0x04
int32 waveGroupCount Count of wavegroups
0x08
WaveGroup*[] (int32) waveGroupPointers Pointers to the individual wavegroups.


SCNE

SCNE is a pointer container as well. They point to the C-DF objects.


Offset Type Name Description
0x00
int32 0x53434E45 'SCNE' Magic
0x04
int64 padding padding
0x0C
int32 C-DF* Pointer to C-DF
0x10
int32 C-DF* Pointer to C-EX
0x14
int32 C-DF* Pointer to C-ST

Scene Waves

Note: The other sections C-ST, and C-EX point to to this category as well. They remain empty. Code for parsing them isn't even in the executables.

Offset Type Name Description
0x00
int32 0x432D4446 ('C-DF') Magic
0x04
int32 wavesCount Wave Count
0x08
int32 WAVEID*[] Pointer array waveID's


WAVEID

Offset Type Name Description
0x00
int16 waveGroupID Wave Group ID (Current WSYS)
0x02
int16 waveID The ID assigned from this wave


WaveGroup

SCNE is a pointer container as well. They point to the C-DF objects.


Offset Type Name Description
0x00
char[0x70] archiveName File Path for .AW
0x70
int32 wavesCount Wave Count
0x74
int32 WAVE*[] Pointer array of Waves


WAVE

Container format for Wave Information. This tells you where the ADPCM / PCM / whatever data starts inside of the .AW file for the current group and for what wave.


Offset Type Name Description
0x00
byte 0x00 unknown
0x01
byte format WaveFormat
0x02
byte baseKey Base Key
0x03
byte 0x00 unknown
0x04
float sampleRate Sample Rate
0x08
int32 awOfsStart AW Offset Start
0x0C
int32 awOfsEnd AW Length
0x10
int32(bool) loop Loop flags?
0x14
int32 loopStartSample Loop Start Sample
0x18
int32 loopEndSample Loop End Sample
0x20
int32 sampleCount Samples Count
0x24
short pLast ADPCM Loop Last Sample
0x26
short pPenult ADPCM Loop Penult Sample