Kuribo64
Views: 19,852,572 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
03-28-24 10:16 PM
Guest:

0 users reading How to edit sound effect tables and other stuff | 1 bot

Main - General SM64DS hacking - How to edit sound effect tables and other stuff Hide post layouts | New reply


skawo
Posted on 01-18-14 02:03 PM (rev. 8 of 01-18-14 02:10 PM) Link | #37717
So, semi-music documentation here.

1. We have 3 bytes editable in the editor. Byte 1, byte 2 and byte 3 (which we know is the SSEQ ID, where eg. 10 (Decimal ID 16) = NCS_BGM_MINIVOCAL)
These values are loaded into the ARM9 memory at 0x02143C1C (US ROM v1) if you need to find some specific configuration or something.

2. Byte 1 is multiplied by 4, then 4 is added to it, and that is added to 11A4. Out comes the address in info.bin, which is in the SDAT. Look there, you get a reversed address (i.e if "441A" is there, the address is "0x1A44") of the SWAR entries table, also in info.bin

So, the SWAR entries table consists of values like this:

0a 00 00 00
02 04 00 00
31 00 00 00
02 04 00 00
29 00 00 00
02 04 00 00
2a 00 00 00
02 04 00 00
2b 00 00 00

0a is the beginning of a new entry table. Seems like this can be 0d and others too, not sure what this does. Next line we have...also not sure. "02 04" That's most likely the SSAR IDs or something, but honestly, no clue.

Next line, however is the SWAR ID (where, eg. 31 (So decimal ID 50) = CS_WAVE_BGM_RESIDENT). Then, it repeats.

To have music playing in a level, you need to make Byte 1 point to a table in the info.bin which contains ALL of the "dependencies" a particular music piece has. For instance, for the Peach's Castle (NCS_BGM_SHIRO), that would be NCS_WAVE_BGM_SHIRO and NCS_WAVE_BGM_RESIDENT (You can find this out with VGMTrans or something).

If both of those are not in the SWAR table pointed at by Byte 1, you get silence. And indeed, if we look at the SWAR table in the info.bin (Byte 1 = 3, 3*4+4=16, info.bin at 11B4 has "6c 13", so the SWAR table is at 0x136c), it contains (as the two first entries, no less), well, this:

0d 00 00 00
02 04 00 00
31 00 00 00 = NCS_WAVE_BGM_RESIDENT [Decimal ID 50]
02 04 00 00
3d 00 00 00 = NCS_WAVE_BGM_SHIRO [Decimal ID 61]
02 04 00 00
(etc)



And, indeed, this same table also loads in sound effects. So there. So, you can have it load whatever you want. It seems to be really, really picky when it comes to Sound effects, though, so be careful there. Perhaps SFX also depends on...

3. Byte 2 is the SBNK ID. This allows further control of SFX, but no idea exactly how.




Yay.



Gota7
Posted on 07-27-17 04:45 AM Link | #85279
Btw, the decimal ID for BGM_Resident is 49, not 50.




Join the SM64DS Hacking Discord: https://discord.gg/PhpA9Wt


Main - General SM64DS hacking - How to edit sound effect tables and other stuff Hide post layouts | New reply

Page rendered in 0.018 seconds. (2048KB of memory used)
MySQL - queries: 26, rows: 198/198, time: 0.009 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.