Next Page

Resident Evil 4 / Biohazard 4 DSP Analysis by unknownfile at 11:57 AM EDT on April 7, 2007
I am doing research into the subject of the DSP format used in Biohazard 4 (or Resident Evil 4). Here is what I have so far. Nontechies may not look as this contains dreaded TECHNICAL INFORMATION.

RE4 DSP extract notes:

The "You Are Dead" stream starts at 0x60 in BIO4BGM.SBB. It apparenly has no header.
Checking BIO4STR.HED gives us some numbers, and what appear to be headers:

00000140 0000 0001 0004 3509 0004 CEE7 0000 7D00 ......5.......}.
00000150 0000 0002 0000 0002 0004 CEE6 0000 0000 ................
00000160 0491 0F02 0DA6 0F37 0BCD 0F81 0D81 0EDD .......7........
00000170 0211 F85D F9A0 F8AC FB39 F841 FA49 F919 ...].....9.A.I..
00000180 0895 0F12 0DC8 0F2A 0C9F 0F89 0D6D 0EF4 .......*.....m..
00000190 FDB2 F857 F997 F8B8 FA49 F83C FA5A F903 ...W.....I.<.Z..

This header is pointed to by 0x00, which is part of a container. Pointers to the headers are thus:

00000000 0000 0110 0000 0190 0000 0210 0000 0290 ................
00000010 0000 0310 0000 0390 0000 0410 0000 0490 ................
00000020 0000 0510 0000 0590 0000 0610 0000 0690 ................
00000030 0000 0710 0000 0790 0000 0810 0000 0890 ................
00000040 0000 0910 0000 0990 0000 0A10 0000 0A90 ................
00000050 0000 0B10 0000 0B90 0000 0C10 0000 0C90 ................
00000060 0000 0D10 0000 0D90 0000 0E10 0000 0E90 ................
00000070 0000 0F10 0000 0F90 0000 1010 0000 1090 ................
00000080 0000 1110 0000 1190 0000 1210 0000 1290 ................
00000090 0000 1310 0000 1390 0000 1410 0000 1490 ................
000000A0 0000 1510 0000 1590 0000 1610 0000 1690 ................
000000B0 0000 1710 0000 1790 0000 1810 0000 1890 ................
000000C0 0000 1910 0000 1990 0000 1A10 0000 1A90 ................
000000D0 0000 1B10 0000 1B90 0000 1C10 0000 1C90 ................
000000E0 0000 1D10 0000 1D90 0000 1E10 0000 1E90 ................
000000F0 0000 1F10 0000 1F90 0000 2010 0000 2090 .......... ... .


So to determine the number of stremas, we count the words on the left and multiply them by 4.
There are 64 tracks -- there are 62 on the OST, but this doesn't matter and some tracks are
probably sequenced or streamed elsewhere.

Let's get to analysing the header:

0x0-0x3 dunno
0x4-0x7 not sure
0x8-0xB ditto
0xC-0xF sample rate (which is set to 32000 Hz in this sample)
0x10-0x13 not sure
0x14-0x17 not sure
0x18-0x1B duplicate of some information
the rest of the header looks like some sort of table

Let's compare this to hcs's analysis of the devkit dsp format.

0x00-0x03: number of samples
0x04-0x07: number of ADPCM nibbles (including frame headers)
0x08-0x0b: sample rate (Hz)
0x0c-0x0d: loop flag (1=looped, 0=not looped)
0x0e-0x0f: format (0 for ADPCM)
0x10-0x13: loop start offset
0x14-0x17: loop end offset
0x18-0x1b: ca (always zero)
0x1c-0x3b: decode coefficients
0x3c-0x3d: gain (zero)
0x3e-0x3f: initial predictor/scale
0x40-0x41: initial sample history 1
0x42-0x43: initial sample history 2
0x44-0x45: loop predictor/scale
0x46-0x47: loop sample history 1
0x48-0x49: loop sample history 2
0x4a-0x5f: padding

Let's take another look at the headers:

00000110 0000 0001 0004 3509 0004 CEE7 0000 7D00 ......5.......}.
00000120 0000 0002 0000 0002 0004 CEE6 0000 0000 ................
00000130 0491 0F02 0DA6 0F37 0BCD 0F81 0D81 0EDD .......7........
00000140 0211 F85D F9A0 F8AC FB39 F841 FA49 F919 ...].....9.A.I..
00000150 0895 0F12 0DC8 0F2A 0C9F 0F89 0D6D 0EF4 .......*.....m..
00000160 FDB2 F857 F997 F8B8 FA49 F83C FA5A F903 ...W.....I.<.Z..
00000170 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000180 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000190 0000 0005 0019 3F72 001C DACC 0000 7D00 ......?r......}.
000001A0 0000 0002 0006 7BE8 001C DACB 0005 0000 ......{.........
000001B0 08B9 0DD6 0AB6 0E4C 0B0A 0EDD 0BB5 0E59 .......L.......Y
000001C0 FB73 F920 FC3F F96D FAEB F8A2 FBE4 F98E .s. .?.m........
000001D0 09DC 0E74 0B9B 0E88 0C8C 0F22 0C78 0E8F ...t.......".x..
000001E0 FB82 F8B0 FB93 F940 F9E2 F87B FB30 F95F .......@...{.0._
by unknownfile at 9:52 PM EDT on April 10, 2007
OST track 101 "End of Umbrella" is streamed in the opening video
by valiant at 8:41 PM EDT on April 14, 2007
You can get all of the music from Biohazard 4 in wonderful 48khz ADXs from the PlayStation 2 version of the game unless you just wanted to look into it for having the good feeling of cracking something. :-) Would be interesting to use this for the betas though, since they use the exact same format...
by unknownfile at 12:20 PM EDT on April 15, 2007
upload them to megaupload plx
by MarkGrass at 7:05 PM EDT on April 15, 2007
http://markgrass.the-horror.com/Media/ADX/index.html

You can find an archive at the above link.

Excellent work, UNKNOWNFILE. I hope you continue with this project; as Farramenta mentioned, it would be great to listen to the DSP variants from Bio4 trials and betas :)
by valiant at 11:02 AM EDT on April 16, 2007
Back in 2005 I did a complete rip with all missing tracks and cutscene audio. This is the Original Soundtrack plus converted tracks from the PlayStation 2 version (ADX to VBR MP3s):

Resident Evil 4 Complete OST

Also: Nice to see you still having some involvement with the community, Mark. :-)
by unknownfile at 11:29 AM EDT on April 16, 2007
Thanks MarkGrass, I'm a bit bogged down with school work and other crap. Hopefully I'll be able to write an extractor which can convert the archive into dual-file DSPs, as it's a pretty screwy header format.

Possible solutions to finding decode coefs:

- Brute-force using bytes from the headers provided
- Add support for RE4 DSP format in in_cube
- Get hcs to do it (hardest possible solution)

PS: The ADX archive is in the same order as the GC SBB archive: first track in the SBB is "Game Over" followed by "Ganado I"

edited 11:40 AM EDT April 16, 2007
by MarkGrass at 3:24 PM EDT on April 16, 2007
No problem. I will keep checking back here until the project is either complete or abandoned.

EDIT: I probably couldn't help with the DSP Headers until I learn more about the format, but after messing areound with bio4str.hed for a little while, I came up with this, I will be looking into bgmtbl.dat soon.

Resident Evil 4 (NTSC/US):
0x00-0x03    Music DSP Offset
0x04-0x07    Misc DSP Offset
0x08-0x1F    Pad

Music\Misc DSP:
0x00-0x03    Amount Of Streams In SBB*
0x04-0x07    Header String Offset
0x08-0x0B    File String Offset

*Matches correctly with Misc Header, but Music's Header indicates there's 3 more than there should be?

Header String:
0x00-0x03    DSP Header 01 Offset
0x04-0x07    DSP Header 02 Offset
0x08-0x0B    DSP Header 03 Offset
... ...
... ...
... ...
...and so on until all Headers are accounted for.

File String:
0x00-0x01    File Number (Music_00.DSP, Music_01.DSP, etc.)*
0x02-0x05    ???
0x06-0x07    System Reserved
0x08-0x0F    ???
... ...
... ...
... ...
...and so on until all Files are accounted for.

*Some DSPs seem to have been removed from the SBB bank before final production. Ones that have been deleted all have the same 16-btye value in the File String:
0000 0000 0000 0000 0000 0000 8000 7FFF

EDIT2: After studying the Standard DSP format, I believe I may have figured out the DSP Header (Guess Work):

DSP Header:
0x00-0x01 Format
0x02-0x03 Loop Amount
0x04-0x07 Number Of ADPCM Nibbles
0x08-0x0B Number Of Samples
0x0C-0x0F Sample Rate
0x10-0x13 CA
0x14-0x17 Loop Start Offset
0x18-0x1B Loop End Offset
0x1C-0x1F ???
0x20-0x3F Channel 1 Decode Coefficients
0x40-0x5F Channel 2 Decode Coefficients
0x60-0x6F Padding

edited 10:04 PM EDT April 16, 2007
by unknownfile at 7:57 PM EDT on April 16, 2007
yippee

*fires up VC++6*

bah, your details are a bit inaccurate

edited 8:23 PM EDT April 16, 2007
by MarkGrass at 8:53 PM EDT on April 16, 2007
Eh well, I tried.

I'm positve that the overall file structure of bio4str.hed has been documented properly, but the DSP header is a different story, i'm definitely no expert with the format.

Next Page
Go to Page 0 1 2

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=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source