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.

GRY files [Twisted Metal 2, Jet Moto, and Outwars]

Featured Replies

  • Author
  • Localization

ultradumb, posted Thu Apr 23, 2020 6:08 pm (56235)


I am new to bms scripts, but I managed to create a bms script for GRY files that hold sound effects for the old PC games Twisted Metal 2, Jet Moto, and Outwars.

Code:
# Script to extract the sound effects in GRY files from
# the PC games Twisted Metal2, Jet Moto, and Outwars

# Modified from the "WAVE format scanner" script by AlphaTwentyThree
# https://forum.xentax.com/viewtopic.php?f=13&p=74664#p74664

IDString "\x27\x70\x06\x03"

For i = 1
   FindLoc OFFSET binary "\xA0\xB9\xB7\x00" 0
   if OFFSET == ""
      cleanexit
   endif
   GOTO OFFSET

   FindLoc OFFSET2 binary "\x2E\x3E\x9D\x00" 0
   if OFFSET2 == ""
      cleanexit
   endif
   GOTO OFFSET2

   get NAME basename
   string NAME = "_"
   if i < 10
      string NAME = 0
      string NAME = i
   else
      string NAME = i
   endif
   string NAME = "_"
   string NAME = OFFSET
   string NAME = ".vgmstream"

   get DUMMY long
   get STREAMSIZE long

   SAVEPOS MYOFF

   set HEADERSIZE MYOFF
   math HEADERSIZE -= OFFSET
   set SIZE HEADERSIZE
   math SIZE = STREAMSIZE

   log NAME OFFSET SIZE

   set SEARCH OFFSET
   math SEARCH = SIZE
   if SEARCH == FSIZE
      cleanexit
   endif
   GOTO SEARCH
Next i


Then you can play the extracted files with Foobar2000 and vgmstream with the following .txth files.

Code:
# PC Twisted Metal 2 and Jet Moto

id_value = 0xA0B9B700
id_offset = @0x00:BE

codec = PCM16LE

channels = @0x06$1
sample_rate = @0x08

start_offset = 0x1c
data_size = @0x18
num_samples = data_size


Not too sure if the ADPCM plays correctly, because they play in mono, but interleave has to be set.

Code:
# Outwars ADPCM - all except O5

id_value = 0xA0B9B700
id_offset = @0x00:BE

codec = MSADPCM
interleave = @0x14$2

channels = @0x0a$1
sample_rate = @0x0c

start_offset = 0x4e
data_size = @0x4a
num_samples = data_size


Code:
# Outwars PCM from O5

id_value = 0xA0B9B700
id_offset = @0x00:BE

codec = PCM16LE

channels = @0x0a$1
sample_rate = @0x0c

start_offset = 0x20
data_size = @0x1c
num_samples = data_size
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.