Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Space Invaders 1999 ZSNDWIN files

Featured Replies

  • Author
  • Localization

DeevDaRabbit, posted Thu Jan 12, 2023 11:56 pm (74972)


I would like to know if QuickBMS has a script that can detect ZSNDWIN (.zsd) files from the 1999 Space Invaders for PC.
If not, I hope I can request for there to be a script made at some point in time, as I'm working on a remake of the game.
  • Author
  • Localization

BloodRaynare, posted Fri Jan 13, 2023 12:15 am (74973)


ZSD (ZSND***) is a Z-Axis' audio resource format. Depending the type of it, creating a BMS script should be doable.
Anyway, send a sample file please.
  • Author
  • Localization

BloodRaynare, posted Sat Jan 14, 2023 12:34 am (75001)


Here's a BMS script to extract the raw PCM audio inside the ZSD file to WAV

Code:
IDString "ZSND"
getDstring PLATFORM 4
get ZSD_SZ long
get HEADER_SZ long

## Set the variable for the resulting WAV files
math CODEC_ID = 1
math CHAN = 1
math WAVEFORMATEX_SZ = 16
math BITS = 16

## Populate the entry offsets and their number of entries for each of them

for i = 0 < 7
   get ENTRY_NUM long
   get ENTRY_OFF long
   
   putarray 0 i ENTRY_NUM
   putarray 1 i ENTRY_OFF
next i


## Obtain the audio frequency info

getarray ENTRY_NUM  0 1
getarray ENTRY_OFF  1 1
getarray TMP        1 2

xmath ENTRY_SZ "(TMP - ENTRY_OFF) / ENTRY_NUM"
xmath PAD "ENTRY_SZ - 8"

goto ENTRY_OFF

for i = 0 < ENTRY_NUM
   get NUM short
   get UNK short
   get FREQ long
   getDstring ZERO PAD
   
   putarray 2 NUM FREQ
next i

## Obtain the offset and the size of the audio data

getarray ENTRY_NUM  0 2
getarray ENTRY_OFF  1 2
getarray TMP        1 3

goto ENTRY_OFF

for i = 0 < ENTRY_NUM
   get OFFSET long
   get SIZE long
   
   putarray 3 i OFFSET
   putarray 4 i SIZE
next i

## Add the RIFF header to the audio data then extract it to WAV
getarray ENTRY_NUM  0 2

for i = 0 < ENTRY_NUM
   getarray FREQ     2 i
   getarray OFFSET   3 i
   getarray SIZE     4 i
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction WAVHeader 1
   get WAV_SZ asize MEMORY_FILE3
   string NAME p "d.wav" i
   log NAME 0 WAV_SZ MEMORY_FILE3
next i

startfunction WAVHeader
   log MEMORY_FILE2 0 0
   log MEMORY_FILE3 0 0

   append
   
   putDstring "WAVEfmt " 8 MEMORY_FILE2
   put WAVEFORMATEX_SZ long MEMORY_FILE2
   put CODEC_ID short MEMORY_FILE2
   put CHAN short MEMORY_FILE2
   put FREQ long MEMORY_FILE2
   xmath BYTE_RATE "(FREQ * CHAN * BITS) / 8"
   put BYTE_RATE long MEMORY_FILE2
   xmath BLOCK_ALIGN "BITS / 8"
   put BLOCK_ALIGN short MEMORY_FILE2
   put BITS short MEMORY_FILE2
   putDstring "data" 4 MEMORY_FILE2
   put SIZE long MEMORY_FILE2
   log MEMORY_FILE2 0 SIZE MEMORY_FILE
   
   get TMP_SZ asize MEMORY_FILE2
   
   putDstring "RIFF" 4 MEMORY_FILE3
   put TMP_SZ long MEMORY_FILE3
   log MEMORY_FILE3 0 TMP_SZ MEMORY_FILE2
   
   append
endfunction


?N?o?t?e?:? ?M?i?g?h?t? ?f?a?i?l? ?w?i?t?h? ?s?o?m?e? ?f?i?l?e?s?,? ?s?p?e?c?i?f?i?c?a?l?l?y? ?t?h?e? ?o?n?e? ?w?h?e?r?e? ?t?h?e? ?n?u?m?b?e?r? ?o?f? ?e?n?t?r?i?e?s? ?d?o?e?s?n?'?t? ?m?a?t?c?h? ?b?e?t?w?e?e?n? ?t?h?e? ?s?a?m?p?l?e? ?r?a?t?e? ?a?n?d? ?o?f?f?s?e?t?/?s?i?z?e? ?i?n?f?o? ?(?I? ?h?a?v?e? ?f?e?w? ?o?f? ?t?h?o?s?e? ?f?i?l?e?s? ?f?r?o?m? ?P?C? ?p?o?r?t? ?o?f? ?D?a?v?e? ?M?i?r?r?a? ?F?r?e?e?s?t?y?l?e? ?B?M?X?,? ?w?h?i?c?h? ?a?l?s?o? ?d?e?v?e?l?o?p?e?d? ?b?y? ?Z?-?A?x?i?s?)?.? ?

EDIT: I've updated the script. Shouldn't fail with the ZSD files that has the number of entries mismatch between the sample rate and offset/size info.

EDIT2: Updated the scripts again, to clean the WAV parsing a little bit.

Streamed audios (usually named Music.zsd or something similar) will require a separate script, since the audio codec and how the header are constructed were different.
  • Author
  • Localization

DeevDaRabbit, posted Sun Jan 15, 2023 12:12 am (75007)


Thank you for your help.

Though I assume that you don't have the knowledge on how to extract the music data?
No worries if not. I can just remake the soundtrack from scratch as I'm doing currently.
  • Author
  • Localization

BloodRaynare, posted Sun Jan 15, 2023 12:28 am (75008)


DeevDaRabbit wrote:
Thank you for your help.

Though I assume that you don't have the knowledge on how to extract the music data?
No worries if not. I can just remake the soundtrack from scratch as I'm doing currently.


That would be doable too, it's just the differences is the header is much simpler and the codec data is different (Mono IMA ADPCM, at least with Freestyle BMX). Just send the file here.
  • Author
  • Localization

DeevDaRabbit, posted Sun Jan 15, 2023 1:10 am (75010)


By the way, I thought I'd mention I found some interesting sound effects I don't think are used in the game that also aren't present in the N64 version's files.
Another discovery, though a disappointing one, is that all the sounds were resampled to 22kHz... Even the ones that were higher than that, making the music sound worse than it did on consoles.
  • Author
  • Localization

BloodRaynare, posted Sun Jan 15, 2023 2:44 am (75012)


Unfortunately, I couldn't make the bms script for the streamed files, specifically I can't extract it to the WAV files due to differences in the codec data. But at least, you can use this TXTH script and play it with vgmstream (with the test.exe or the foobar2000/winamp plugins).

Code:
subsong_count = @0x20
base_offset = @0x24
subsong_spacing = 8

start_offset = @0x00
data_size = @0x04

codec = DVI_IMA
channels = 1
sample_rate = 44100
num_samples = data_size


Save the text above as "sndmus.zsd.txth" and put it on the same directory as the sndmus.zsd file. Then, just drag the ZSD file (not the TXTH file!) on foobar/winamp playlist or drop the files to test.exe.
If foobar/winamp shows no duration/question mark, make sure "Enable unknown exts" are checked in the preferences.

But, if you still want to use this script anyway...

Code:
IDString "ZSND"
getDstring PLATFORM 4
get ZSD_SZ long
get HEADER_SZ long

## Set the variable for the resulting WAV files
math CODEC_ID = 17
math CHAN = 1
math FREQ = 44100
math WAVEFORMATEX_SZ = 20
math BITS = 4

## Populate the entry offsets and their number of entries for each of them

for i = 0 < 7
   get ENTRY_NUM long
   get ENTRY_OFF long
   
   putarray 0 i ENTRY_NUM
   putarray 1 i ENTRY_OFF
next i

## Obtain the offset and the size of the audio data

getarray ENTRY_NUM  0 2
getarray ENTRY_OFF  1 2
getarray TMP        1 3

goto ENTRY_OFF

for i = 0 < ENTRY_NUM
   get OFFSET long
   get SIZE long
   
   putarray 2 i OFFSET
   putarray 3 i SIZE
next i

## Add the RIFF header to the audio data then extract it to WAV
getarray ENTRY_NUM  0 2

for i = 0 < ENTRY_NUM
   getarray OFFSET   2 i
   getarray SIZE     3 i
   log MEMORY_FILE 0 0
   log MEMORY_FILE OFFSET SIZE
   callfunction WAVHeader 1
   get WAV_SZ asize MEMORY_FILE3
   string NAME p "d.wav" i
   log NAME 0 WAV_SZ MEMORY_FILE3
next i

startfunction WAVHeader
   log MEMORY_FILE2 0 0
   log MEMORY_FILE3 0 0

   append
   
   putDstring "WAVEfmt " 8 MEMORY_FILE2
   put WAVEFORMATEX_SZ long MEMORY_FILE2
   put CODEC_ID short MEMORY_FILE2
   put CHAN short MEMORY_FILE2
   put FREQ long MEMORY_FILE2
   put 0x5647 long MEMORY_FILE2
   put 0x800 short MEMORY_FILE2
   put BITS short MEMORY_FILE2
   put 2 short MEMORY_FILE2
   put 4089 short MEMORY_FILE2
   putDstring "fact" 4 MEMORY_FILE2
   put 4 long MEMORY_FILE2
   xmath SMP_LEN "SIZE * 2"
   put SMP_LEN long MEMORY_FILE2
   putDstring "data" 4 MEMORY_FILE2
   put SIZE long MEMORY_FILE2
   log MEMORY_FILE2 0 SIZE MEMORY_FILE
   
   get TMP_SZ asize MEMORY_FILE2
   
   putDstring "RIFF" 4 MEMORY_FILE3
   put TMP_SZ long MEMORY_FILE3
   log MEMORY_FILE3 0 TMP_SZ MEMORY_FILE2
   
   append
endfunction


Please note, that the resulting WAV file is pretty unplayable due to encoding differences between Intel DVI and Microsoft IMA ADPCM.
  • Author
  • Localization

DeevDaRabbit, posted Sun Jan 15, 2023 4:30 am (75015)


Unfortunately, most of the soundtrack consists of sequenced music which I guess must be played back in-engine and therefore cannot be converted over to a playable file.
Thank you for trying though.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.