Tanked Up Trouble Platform SFX oddity

Talk about the original Donkey Kong Country for SNES and VC.
The ports can be discussed in the DKC Ports (GBC, GBA) subforum.

Tanked Up Trouble Platform SFX oddity

Postby Geno » August 8th, 2012, 4:05 am

Does anybody know why the platform in Tanked Up Trouble sometimes has different SFX? Sometimes it's a "beeping" sound, but other times, it's some sort of "glass breaking" sound.
Does anybody know why that happens? :|
Treasure Hunter
Bananas received 57
Posts: 420
Joined: 2012

Re: Tanked Up Trouble Platform SFX oddity

Postby Simion32 » August 12th, 2012, 5:02 pm

This is probably some really weird sound-font related bug where the real sound effect is supposed to be BOTH of them playing and at least one of the sounds always fails to load/play (which one does get in, is essentially random).

It definitely sounds to me like both of the SFX were intended to be played at approximately the same time.
Sage of Discovery
Bananas received 332
Posts: 2738
Joined: 2008

Re: Tanked Up Trouble Platform SFX oddity

Postby Mattrizzle » August 13th, 2012, 11:38 am

@Simion32: You are correct in assuming that it is a sound-font related issue, but the real sound effect is supposed to use neither of those source files. The platform sound effect data references a source file (a.k.a. BRR sample) that isn't even loaded in the Life in the Mines sound-font. Thus the sound engine grabs a "random" (well, not exactly) source file from the ones loaded, and plays the sound effect using that one instead.

Relevant ROM Addresses:
92D95-93BBE Sound effect data block (Byte 0x00: Size of block (0xE26), Byte 0x1: SPC RAM Destination (2380), Bytes 0x04-0xF1: Sound effect pointers (in SPC RAM), Bytes 0xF2 and beyond: Sound effect data)
9FF00-9FFD1 BRR source data pointers (3 bytes per pointer; 0x46 source waveforms)
AB245-AB280 Global source set (a.k.a. sound-font) data (Two bytes per source ID; values are offsets to the pointer table above, divided by three; #$FFFF tells the CPU to stop uploading source files)
AB20D-AB244 Song-specific sound-font pointers (2 bytes per pointer; 0x1C songs)

Here is the platform sound effect (sound #$2C) data as it appears at 2C07 in SPC RAM:
Code: Select all
2C07: 01 19 02 40 40 10 8F FA 0D 06 01 08 A0 03 80 01 A0 04 B1 04 02 22 22 B1 04 00
The very first byte in the data, #$01, is a control code telling the sound to use the source file with the identifier value immediately following it. In this case, it is #$19.

In all three DKC games, there are some BRR source files that are always loaded into memory, and others that change depending on which music track is loaded. Let's look at the global set of source files:

Code: Select all
AB245: 01 00 02 00 03 00 06 00 07 00 08 00 09 00 0A 00 0B 00 0E 00 0F 00 1F 00 20 00 21 00 22 00 23 00 24 00 25 00 44 00 26 00 27 00 28 00 29 00 2A 00 2B 00 11 00 1D 00 16 00 36 00 FF FF
No value #$0019 here...

Now for the set specific to Life in the Mines:
Code: Select all
AB305: 0C 00 00 00 12 00 15 00 35 00 38 00 04 00 1B 00 FF FF
#$0019 isn't here either. Hmmm...

Similar issues exist in one of the sound effects played when Dumb Drum slams into the ground, and the steel keg sound in the snow levels. Source file #$12 isn't loaded for Bad Boss Boogie or Northern Hemispheres.

This is where I would normally place a link to a patch that fixes these problems, but I ran into problems trying to create it.

EDIT: I found what the problem was, so here's the patch:

DKC Audio Source Data Fix.ips
(717 Bytes) Downloaded 1199 times
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008

Re: Tanked Up Trouble Platform SFX oddity

Postby VideoViking » August 13th, 2012, 1:55 pm

WARNING: Do not apply this patch to a ROM that is being used as the basis for your resource editing needs. DKCRE will refuse to load any DKC ROM which contains Mattress's audio fix.

I was hoping DKCRE would accept your applied patch as the resource ROM, but it doesn't.
Treasure Hunter
Bananas received 41
Posts: 329
Joined: 2009

Re: Tanked Up Trouble Platform SFX oddity

Postby Mattrizzle » August 13th, 2012, 2:27 pm

Well, shoot! That kind of defeats the purpose of the patch...

I replaced the IPS with one that doesn't fix the ROM's checksum. This should work in DKCRE.
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008

Re: Tanked Up Trouble Platform SFX oddity

Postby VideoViking » August 13th, 2012, 2:48 pm

Thanks for the fix, Mattrizzle. Boy, this sound patch works great.
Treasure Hunter
Bananas received 41
Posts: 329
Joined: 2009

Re: Tanked Up Trouble Platform SFX oddity

Postby Simion32 » August 13th, 2012, 5:48 pm

Hey Mattrizzle, would you happen to have any solid documentation on the sound effects data? I found one of your earlier posts but I'm sort of left in the dust as to how I could possibly work with the data.

In short, I want to code a program to take the decompressed BRRs and assemble them into the actual sound effects heard during play.

I already found some code online that can decompress the BRR data into its raw 16bit mono audio - but what the **** am I supposed do once I have the PCMs? :scratch:
Sage of Discovery
Bananas received 332
Posts: 2738
Joined: 2008

Re: Tanked Up Trouble Platform SFX oddity

Postby Mattrizzle » August 14th, 2012, 2:26 am

Nope. The most extensive documents I've seen on the audio formats (in plural because DKC1's format differs from the one used in DKC2 and 3) are written in Japanese... :headache:

...and I'm in the dark when it comes to the meaning of several of the musical/audio terms used to describe the control bytes.

EDIT 05/25/23: Here's some documentation on the music format in English: https://loveemu.hatenablog.com/entry/20130819/SNES_Rare_Music_Spec
Veteran Venturer
Bananas received 221
Posts: 545
Joined: 2008

Re: Tanked Up Trouble Platform SFX oddity

Postby Simion32 » August 14th, 2012, 5:45 am

Well that's a crying shame. :dixiecry:

I was thinking that if we could manage to extract the sounds in an automated manner, there would be no guessing whether the sound was played back correctly (that means no weird SNES buffering errors, which DO happen) and also recorded correctly. It would be a 100% perfect SFX rip.

I need this kind of thing at some point for DKCLB, whether done manually or automated.

Doing it via code sounds much easier, but only if we actually knew the format(s)! :facepalm:
Sage of Discovery
Bananas received 332
Posts: 2738
Joined: 2008

Re: Tanked Up Trouble Platform SFX oddity

Postby Geno » August 16th, 2012, 6:50 am

WHOA, I missed a lot of stuff!
Can't wait to hear the restored sounds!
(If only if I had an .srm file with the game complete.)
Treasure Hunter
Bananas received 57
Posts: 420
Joined: 2012


Return to Donkey Kong Country

Who is online

Users browsing this forum: No registered users and 4 guests