Previous Page | Next Page

by hcs at 8:27 AM EDT on October 16, 2007
It is possible that the sample banks are set up differently between the different tracks, and when an unloaded sample is hit the playback engine chokes. Z2Sound.baa controls this relationship, I think. At least it has names for all the BGM sequences (not file names, identifiers like Z2BGM_FIELD_LINK).
I think this would more likely be the best place to make any swaps, as it'd swap at a higher level. And no recompression would be necessary.

edited 8:30 AM EDT October 16, 2007

I think we're looking at the WSYS files, pointed at by the "ws " chunks in the header. The WSYS format was used in the Wind Waker aaf as well, though I didn't examine it too thoroughly. As there are two WSYS files I think it can be assumed that one is for sfx and the other for bgm.

As the second one (starting at 0x1931d4) contains references to the bgm .aws while the other does not, I think aforementioned assumption was correct.

edited 8:57 AM EDT October 16, 2007

Regarding WSYS format:
0x0-0x3: "WSYS"
0x4-0x7: size of the WSYS file
0x8-0xb: 0
0xc-0xf: a smallish number, but seemingly not an offset
0x10-0x13: WINF offset (within WSYS)
0x14-0x17: WBCT offset (within WSYS)
0x18-0x1f: 0
the rest of the file is referenced through these.

WINF, lists .aw entries (expanding on what I got out of WW, where every WSYS had only one .aw):
0x0-0x3: "WINF"
0x4-0x7: .aw count
0x8-0xb: offset (within WSYS) of .aw info
... more .aw info offsets

.aw info:
0x0-0x6f: file name
0x70-0x73: wave info count
0x74: wave info offset (within WSYS)
... more wave info offsets

wave info (this only includes what I used in wwsnddump, stereo flag and loop point are in there somewhere, these chunks of data tend to be the first in the WSYS file after the header):
0x0-0x4: unknown
0x5-0x6: sample rate
0x7: unknown
0x8-0xb: wave data offset (within actual .aw file)
0xc-0xf: wave data length
0x10-0x13: unknown (loop point?)
0x14-0x2b: unknown

To be amended as I get more information, specifically the structure of the WBCT.
I'm getting the feeling that the WSYS isn't going to help with the relationship between the waves and the sequences, though.

edited 9:47 AM EDT October 16, 2007

0x0-0x3: "WBCT"
0x4-0x7: -1
0x8-0xb: count (same count as in WINF)
0xc-0xf: SCNE offset (within WSYS)
... more SCNE offsets

0x0-0x3: "SCNE"
0x4-0xb: 0
0xc-0xf: C-DF offset (within WSYS)
0x10-0x13: C-EX offset (within WSYS)
0x14-0x17: C-ST offset (within WSYS)

0x0-0x3: "C-DF"
0x4-0xb: count
0xc-0xf: offset within WSYS of some structure 0x38 in size
... more offsets

0x0-0x3: "C-EX"
0x4-0x1f: unknown (not always 0)

0x0-0x3: "C-ST"
0x4-0x1f: unknown (not always 0)

and I think that covers it, the details of the individual instrument informations are uninteresting at the moment.

So I'll continue working at the other chunks in the .baa. For those who aren't following along at home, these are 1 "bst " and 1 "bstn" (these seem to be , or at least largely consist of, string tables), 2 "ws " (the WSYS as seen here, with information about individual waves/samples), 8 "bnk " (sections marked with IBNK, probably details about sets of instruments), 1 "bsc " (marked with "SC") and 1 "bfca" (a RARC containing .bfc files).

I think I will look at the bst/bstn, as at least the bstn has the names of BGM sequences in it. I also think I'll make another post if I have anything to add.

edited 10:16 AM EDT October 16, 2007
by hcs at 10:37 AM EDT on October 16, 2007
I am betting at the moment that the BST section is responsible for linking all audio.

Aha, BST has the lookup info (including the names of the stream files) for sounds, while BSTN has the names of the sounds. They have an identical tree structure at the top!

edited 10:49 AM EDT October 16, 2007
by unknownfile at 10:54 AM EDT on October 16, 2007
I can help rip Pikmin and SMS if you want, I've studied how the sequence format is stored. The DOL executable contains the header to the PikiSeqs.arc file so ripping that sort of data would be easy. I can't say the same for the .aw files, I can't find headers anywhere.
by ugetab at 11:25 AM EDT on October 16, 2007
Since that simple offset/size change didn't work, try this out:

Twilight Princess (hiding_village modification)
06DE = 8645
06E2 = 03FB
06E4 = 000B4040
06E8 = 00001180

With that change in place, try the hiding village again.

If it still fails to play the forest theme, then I guess it really would be easier to mute samples than to try to arrange 2 files simultaneously.
by hcs at 12:21 PM EDT on October 16, 2007
Ok, BST/BSTN dump complete.
Format is
[offset from start of BST (0xb4)]="BST entry" "filename"

The nice bits are the BGM near the end.
Take for instance the lines:
[0000439c]=60004858    /BGM/SEQ_BGM/Z2BGM_DUNGEON
[000043a0]=6000485c    /BGM/SEQ_BGM/Z2BGM_HORSE_BATTLE

If you wanted to set the "DUNGEON" music to the "HORSE_BATTLE" music you'd set 0x439c+0xb4 (0x4450 in Z2Sound.baa) to 6000485c.
These addresses are references further within the BST to provide more of the specifics, and things go all over the .baa from there. I think this is the highest level at which the sound lookup is performed, so this should work for exchanging songs. You might be able to substitute a sequenced song for a sound effect, or a streamed song, for that matter...

Let me know if it works, or not.
And here's the dumping utility in case you should care to look at how it works.

edited 12:46 PM EDT October 16, 2007
by ugetab at 1:04 PM EDT on October 16, 2007
alright. At this point, the only thing preventing me from trying to automate replacing music is the connection between individual seqences in the .arc, and the data in the .baa file. The rest seems to be something I can automate. I expect to be able to generate accurate replacement data at this point, but I'm not sure how to connect the data from 1 file to another when switching stuff around.

nevermind. I see how it works now.

edited 1:09 PM EDT October 16, 2007
by hcs at 1:12 PM EDT on October 16, 2007
ugetab, does your understanding agree with my understanding? It looks like the BST entry points to another location in the BST which refers to those indexes you listed earlier.
For instance:
[00004434]=600048f0    /BGM/SEQ_BGM/Z2BGM_RODEO
[0x48f0]=0x40640085 <-85

edited 1:17 PM EDT October 16, 2007

would also explain why switching filone_forest and hiding_village would not work:


[0000441c]=600048d8    /BGM/SEQ_BGM/Z2BGM_FILONE_FOREST
[000044ec]=600049a8    /BGM/SEQ_BGM/Z2BGM_HIDDEN_VILLAGE

so while the 49<->53 switch in the 4th byte would be made by switching the sequences, there is still a difference in the 2nd byte (50 vs 46) which probably affects the sample bank.

edited 1:25 PM EDT October 16, 2007
by ugetab at 1:20 PM EDT on October 16, 2007
It does.

0x08 = 0xB4
0xB4 = "BST "

[00004634]=60004af0 /BGM/SEQ_BGM/Z2BGM_MENU_SELECT:
0x4634 + 0xB4 = 60004AF0
0x4AF0 + 0xB4 = 407600A7

0x00A7 = 0x0D6C (A7.
by hcs at 1:26 PM EDT on October 16, 2007
Heh, I was editing mine as you typed yours up. So hopefully this will work, now...
by valiant at 5:40 PM EDT on October 16, 2007
Damn, I was hoping that would be it. Unfortunately, your new method doesn't work either, hcs. I tried swapping "RANCH" with "TWILIGHT", but all it gives me is total silence when entering the farm at Ordon.

ugetab's earlier post gave me the same result I had with the Hidden Village. The first few notes of the Faron Woods theme played, then it's muted. After waiting a minute or so, the the strings set in. So it's indeed a sample loading problem.
Using both methods at the same time has the exact same effect which is kind of strange: shouldn't the strings and guitar samples be muted alltogether, like the Twilight theme at the ranch? o_O

Previous Page | Next Page
Go to Page 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=]Link[/url]


HCS Forum Index
Halley's Comet Software
forum source