Skip to content

Instantly share code, notes, and snippets.

@Dobby233Liu
Last active June 10, 2023 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dobby233Liu/97eb58069557837ae2aaed0f50adcec3 to your computer and use it in GitHub Desktop.
Save Dobby233Liu/97eb58069557837ae2aaed0f50adcec3 to your computer and use it in GitHub Desktop.
# Team Shanghai Alice "thbgm"/"ZWAV" music data
# Header is stored in thXX(tr).dat/thbgm(_tr).fmt
# See: https://github.com/thpatch/thtypes/blob/master/bgm_types.h#L38
header_file = *.fmt
subsong_spacing = (0x20 + 0x10) + (0x02 + 0x02)
name_offset = 0x00
name_size = 0x10
base_offset = 0x20 # WAVEFORMATEX structure
id_value = 1 # WAVE_FORMAT_PCM
id_check = @0x00$2 # wFormatTag
id_value = 16
id_check = @0x0E$2 # wBitsPerSample
codec = PCM16LE
channels = @0x02$2 # nChannels
sample_rate = @0x04$4 # nSamplesPerSec
interleave = @0x0C$2/channels # nBlockAlign
base_offset = 0
start_offset = @0x10$4
data_size = @0x1C$4
num_samples = data_size
sample_type = bytes
loop_start_sample = @0x18$4
sample_type = samples
loop_end_sample = num_samples
# Defines "thbgm" music data properties specific to
# Bulletphilia-tachi no Yami-Ichiba ~ 100th Black Market
multi_txth = .dat.txth
subsong_count = 10
@Dobby233Liu
Copy link
Author

Dobby233Liu commented Apr 22, 2023

0x14 seems to be always invalid for th08

Specifically always > data_size

No problem using data_size as the default anyway as ZUN likes to have end of file as the the loop ending

NTS 0x14 is not a data size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment