ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Fri Dec 15, 2017 4:34 am

All times are UTC




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Wii SDF to playable GENH
PostPosted: Tue Jul 25, 2017 11:36 pm 

Joined: Sat Aug 09, 2014 11:21 am
Posts: 616
Hi folks,

this is no request, I just wanted to post my little conversion script here. I found several Wii games that use sdf as audio format, which is currently unsupported. The following script converts these files to something playable.
This could also be a template for a generic script.
Have fun! :)

Code:
# converts Wii SDF audio files to playable GENH streams
# written by AlphaTwentyThree of Zenhax
# script for QuickBMS http://quickbms.aluigi.org

idstring "SDF"
set OFFSET 0x84
set OFF_COEFF1 0x28
set OFF_COEFF2 0x56
set OFF_NOS 0x20
set OFF_FREQ 0x10
set OFF_CH 0x14
set OFF_INTERLEAVE 0x18
set REVERSE 1

goto OFF_NOS
get NOS long
goto OFF_FREQ
get FREQ long
goto OFF_CH
get CH byte
goto OFF_INTERLEAVE
get INTERLEAVE long

get SIZE asize
math SIZE -= OFFSET
xmath PRE_SIZE "SIZE + 0xc0"
putVarChr MEMORY_FILE SIZE 0
log MEMORY_FILE 0 0

putVarChr MEMORY_FILE 0 0x484e4547 long # "GENH"
putVarChr MEMORY_FILE 4 CH long # ch
putVarChr MEMORY_FILE 8 INTERLEAVE long # interleave
putVarChr MEMORY_FILE 0xc FREQ long
putVarChr MEMORY_FILE 0x10 0xffffffff long
putVarChr MEMORY_FILE 0x14 NOS long # number of samples
putVarChr MEMORY_FILE 0x18 0xc long # ?
putVarChr MEMORY_FILE 0x1c 0xc0 long # stream start
putVarChr MEMORY_FILE 0x20 0xc0 long # stream start
putVarChr MEMORY_FILE 0x24 0x80 long # coeff1
putVarChr MEMORY_FILE 0x28 0xa0 long # coeff2
putVarChr MEMORY_FILE 0x2c 1 long
putVarChr MEMORY_FILE 0x34 0x80 long # coeff1
putVarChr MEMORY_FILE 0x38 0xa0 long # coeff2
putVarChr MEMORY_FILE 0x7f 0 byte
append
log MEMORY_FILE OFF_COEFF1 0x20
log MEMORY_FILE OFF_COEFF2 0x20
log MEMORY_FILE OFFSET SIZE
append
get SIZE asize MEMORY_FILE
get NAME basename
string NAME += ".genh"
if REVERSE == 1
   callfunction rev
endif
log NAME 0 SIZE MEMORY_FILE

startfunction rev
   goto 0x80 MEMORY_FILE
   for i = 1 <= 32
      savepos OFF MEMORY_FILE
      get DUMMY short MEMORY_FILE
      reverseshort DUMMY
      putVarChr MEMORY_FILE OFF DUMMY short
   next i
endfunction


Top
   
PostPosted: Tue Jul 25, 2017 11:42 pm 

Joined: Mon Oct 27, 2014 1:49 pm
Posts: 653
..


Last edited by Mygoshi on Wed Jul 26, 2017 7:46 pm, edited 1 time in total.

Top
   
PostPosted: Wed Jul 26, 2017 12:40 am 
User avatar

Joined: Tue Feb 02, 2016 2:35 am
Posts: 981
Welcome back, AlphaTwentyThree!

_________________
Expect my username to be everywhere, whether you're using the internet or not.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC


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:
Powered by phpBB® Forum Software © phpBB Limited