Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

WDC

An all-in-one Wolfenstein 3D editor. · By adambiser

Changing digital sounds in Corridor 7 Sticky

A topic by adambiser created Nov 10, 2016 Views: 657
Viewing posts 1 to 1
Developer (9 edits)

Instead of keeping all textures, sprites, and digital sounds in a VSWAP file like Wolfenstein 3D, Corridor 7 keeps its textures and sprites in GFXTILES.CO7 and its digital sounds in AUDIOMUS.CO7. If you change some of the sounds using WDC you may notice that the game no longer loads them correctly.

Whereas Wolfenstein 3D read the digital sound page header information from the last page in the file, Corridor 7 instead has hard-coded values in its EXE that need to be changed to match the AUDIOMUS offset.

EXE Filename Offset Original Byte Values Original AUDIOMUS Offset
CORR7CD.EXE 0x3B66A 44 01 00 40 14 00 0x00144000
C7.EXE (Floppy Version) 0x2FE38 B9 00 00 90 0B 00 0x000B9000

The first two bytes at the offset represent an int16 for the number of pages in the file. (Remember, these bytes are little-endian.)

The next four bytes are an int32 for the page header offset within AUDIOMUS. Since each page is 0x1000 (4096) bytes, the number of pages in the file is the same as the header offset divided by 0x1000 (or simply remove the last 3 zeroes).

So if you compile the "VSWAP" (as WDC calls it) for your Corridor 7 project, you will get new GFXTILES and AUDIOMUS files. To make sure the sounds work as they should:

  1. Check the size of AUDIOMUS (ex: 1,331,200 bytes).
  2. Convert that to hexadecimal (0x145000).
  3. Since we want the last page in the file, subtract 4096 (0x1000) from the size (result: 0x144000).
  4. Replace the bytes in the EXE at the offset listed above. Drop the last three zeroes to get the number of pages (44 01), then add the offset itself (00 40 14 00).

I used DOSBox to record sounds from the game and then compared them to sounds extracted from the data while adjusting their sample rate to determine that the sample rate used for digital sounds in Corridor 7 is 9009 Hz instead of 7042 Hz as Wolfenstein 3D uses. This rate corresponds to Sound Blaster frequency divisor value of 145.