XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Sat Feb 16, 2019 6:03 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Anexenaumoon's Research + Tools
PostPosted: Tue Feb 05, 2019 10:00 pm 
Offline
advanced

Joined: Sat Apr 16, 2016 3:15 am
Posts: 70
Has thanked: 3 times
Have thanks: 17 times

Figured this would be the best place for this... I will be documenting some games I research over sometime (Mainly PS2 games, because the site I belong to does not have enough PS2 rips). So, enjoy, hopefully these will become of use....

To start:

This QuickBMS script extracts PS-ADPCM samples from Ice Age 2: The Meltdown's *.SFX banks. The music ones are playable in vgmstream, but the samples require a header. Here's the script:
Code:
#Ice Age 2: The Meltdown MUSX (PS2 ONLY)
#Extracts Raw PS-ADPCM Samples
#SFX files prefixed with "mus" can be re-named and played properly as MUSX in vgmstream.
idstring "MUSX"
get NULL short
get ID short

if ID == 0x2d50
   goto 0
   callfunction VERONE
elif ID == 0x2d40
   goto 0
   callfunction VERTWO
else
   print "Invalid ID."
endif

startfunction VERONE
   idstring "MUSX"
   get BASENAME basename   
   get FLAGS long
   get VER long
   get ARKSIZE long
   idstring "PS2_"
   get NULL long
   get NULL long
   get ZERO long
   get TB long
   get TBS long
   get INFO_OFF long
   get INFO_SIZE long
   getdstring SKIP 0x8
   get BASE_OFF long
   get BASE_SIZE long
   goto INFO_OFF
   get FCOUNT long
   for i = 0 < FCOUNT
      get NULL long
      get OFFSET long
      math OFFSET + BASE_OFF
      get SIZE long
      get SAMPLERATE long
      getdstring SKIP 0x10
      set NAME string BASENAME
      string NAME += "_"
      string NAME += i
      string NAME += ".iam"
      log MEMORY_FILE 0 0
      putvarchr MEMORY_FILE 0 SAMPLERATE long
      append
      log MEMORY_FILE OFFSET SIZE
      math SIZE + 4
      append
      log NAME 0 SIZE MEMORY_FILE
   next i
endfunction

startfunction VERTWO
   idstring "MUSX"
   get FLAGS long
   get ID long
   get NULL long
   idstring "PS2_"
   get NULL long
   get NULL long
   get ZERO long
   get OFFTABLE long
   get OFFSIZE long
   get BASE_OFF long
   xmath FCOUNT "OFFSIZE / 4"
   goto OFFTABLE
   for i = 0 < FCOUNT
      get OFFSET long
      set CHECK long FCOUNT
      math CHECK - 1
      if i == CHECK
         math OFFSET + BASE_OFF   
         get ENDSIZE asize
         xmath SIZE "ENDSIZE - OFFSET"
      else
         get OFFTWO long
         math OFFTWO + BASE_OFF
         math OFFSET + BASE_OFF
         xmath SIZE "OFFTWO - OFFSET"
      endif
      goto -4 0 SEEK_CUR
      get BASENAME basename
      set NAME string BASENAME
      string NAME += "_"
      string NAME += i
      string NAME += ".iam"
      log NAME OFFSET SIZE
   next i
endfunction


Just generate a vgmstream txth after the *.iam's are extracted. (The sample rate is put at 0x0 for ease as different files use sample sizes. Note: Version 2's txth will be different.)

You can make the ads go away by registering





Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group