Fixing the mixing music in SR2

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Fixing the mixing music in SR2

Postby Spindizzi » Thu Nov 17, 2016 10:33 am

Hello,
New here :)
I'm trying to correct the mixing music sound on sega rally 2
May be I'm wrong...and I Hope I'm not broken anything else with this little modification of the source code
I based myself on the findings of MDashK
https://www.supermodel3.com/Forum/viewtopic.php?f=2&t=1164#p8382

So I'm logging CDSB2 state and I've compared with different settings in game (eur/jap and intro game/riviera stage)

The key was to detect correct state that indicates what we want
normal stereo (intro jap) or mono channel0 (intro eur) or mono channel1 (riviera stage) and after, set the right volume to the right channels

With Eur/intro sound: (music mixed) we've got
st_gotB0 = 4f (volume left)
st_gotA0 = 4f (channel 0)
st_gotB4 = 4f
st_gotA4 = 4f

With Eur/rivera stage: (no music)
st_gotB1 = 4f (channel 1)
st_gotA1 = 4f (volume right)
st_gotB5 = 4f
st_gotA5 = 4f

With Jap/intro sound: (music OK)
st_gotB0 = 4f (volume left)
st_gotA1 = 4f (volume right)

With Jap/riviera stage: (no music)
st_gotB1 = 4f (channel 1)
st_gotA1 = 4f (volume right)
st_gotB5 = 4f
st_gotA5 = 4f

I just modified a little bit 2 fonctions in dsb.cpp
CDSB2::WriteMPEGFIFO and CDSB2::RunFrame
and add a single variable in the CDSB2 class (dsb.h)
https://www.dropbox.com/s/u5izmzipjn5nh6v/dsb-mod.rar?dl=0
and the compiled exe x64
https://www.dropbox.com/s/r7gzkfo9wngfsjn/test-r500.rar?dl=0
x32 test version
https://www.dropbox.com/s/e73lhxhr8mj688o/test32-r500.rar?dl=0
++

edit : add link for test x32 and all files have been modifed with new version <- you need to redownload (27/11/2016 8h00 gmt+1)

Final edit : Since links are down, I repost sr2 patch and vf3 patch (09-04-2017)
sr2 music patch:
https://yadi.sk/d/imDUntEt3GQfCz
vf3 2players cave stage sound patch (off topic but also a sound patch):
https://yadi.sk/d/le_cI5103GQfFN
Last edited by Spindizzi on Sun Apr 09, 2017 2:11 am, edited 2 times in total.
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Fixing the mixing music in SR2

Postby Bart » Fri Nov 18, 2016 12:28 pm

This sounds very promising! You are indeed on the right track! I've suspected that the DSB board has some way of configuring channel mixing. Have you tried testing your changes with other games? IIRC, only Scud Race uses DSB1 -- all other games with MPEG audio use DSB2. It would be good to test Daytona USA 2, Star Wars Trilogy, etc.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Fixing the mixing music in SR2

Postby Cel_da » Fri Nov 18, 2016 1:39 pm

Great...i will try this, thanks for the effort! I did noticed some sound gliches in SR2 (besides the track mixing in riviera that was fixed by adding the right sound track in some compiled version way back) hope it will get even better since graphically it´s near perfection! Just hoping someone who has the skills will just look to some tuning in the dive board and have some improvements in the ffb...(and ffb to some games that still doesn´t have the feature emulated).
Thx, i will replay when i test it!
Cel_da
 
Posts: 52
Joined: Thu Apr 16, 2015 2:51 am
Location: Portugal

Re: Fixing the mixing music in SR2

Postby Spindizzi » Sat Nov 19, 2016 1:46 am

Hi,
I tested a minimum before posting, daytona2 and sw seem to be ok with this mod
I'm not a gamer, so I didn't go to far in game :lol:
I noticed a volume change and a little mix at the end of the intro in sr2 just before the loop. maybe be a bad lenght of the music or bad start-end loop but same trouble in original version

little optimisation :
move the monochannel variable from public: to protected: there is no need to access it from outside of the class
++
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Fixing the mixing music in SR2

Postby Ian » Sat Nov 19, 2016 4:03 pm

I'll test this out when I have a few :) never really looked at the audio code before
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Fixing the mixing music in SR2

Postby luisfcorreia » Mon Nov 21, 2016 1:38 pm

Great news!

I've tested it and it does indeed sound a lot better now!
luisfcorreia
 
Posts: 13
Joined: Tue Aug 09, 2016 1:13 am

Re: Fixing the mixing music in SR2

Postby Shekel » Mon Nov 21, 2016 5:55 pm

Haven't tried it yet but good find, great work.
User avatar
Shekel
 
Posts: 345
Joined: Wed Mar 16, 2016 12:45 pm

Re: Fixing the mixing music in SR2

Postby Cel_da » Thu Nov 24, 2016 4:44 pm

Hey Spindizzi i was going to try your mod, but my system is 32bit...can u compile an .exe in 32bit?

Thx!
Cel_da
 
Posts: 52
Joined: Thu Apr 16, 2015 2:51 am
Location: Portugal

Re: Fixing the mixing music in SR2

Postby Spindizzi » Fri Nov 25, 2016 8:17 am

Hi,
for Cel_da, svn500 x32 test version here
https://www.dropbox.com/s/e73lhxhr8mj688o/test32-r500.rar?dl=0
I hope I do not make mistake compiling x32 version with the right options in vs2015, I can't test because I no longer have old x32 computer
Replace the sdl.dll include in the archive because it's a 32bit dll (I think) otherwise risk of a 0xc000007b error or something like that
++
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Fixing the mixing music in SR2

Postby terminento » Sat Nov 26, 2016 6:06 am

Hi, Spindizzi!
Thanks a lot for providing that compilation. No need to change the dll, it worked just fine in my 32x vista. I tried it with Sega Rally 2 (set to japanese) and Star Wars.
The music sounds crisp and clear, with no noticeable crackling during the songs. However, in Sega Rally 2 both tracks still play during Riviera. I don't know if this is meant to solve the clearness of music sound or also fix the mixing as well.
User avatar
terminento
 
Posts: 193
Joined: Fri Jun 15, 2012 8:08 am

Next

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron