Raiden II Project Team
YOUR MISSIONS!

2010/12/24

A week of audio fun ends on a high note

Filed under: PGM Updates, Progress Update — austere @ 12:20

The ICS2115 audio chip was not perfectly emulated in MAME around the time the Cave PGM dumps were released, with good reason. There was a single datasheet flowing around which was extremely incomplete and even then it came along with some misleading information!

The first thing that really needed fixing was the tempo (i.e. timer control). The soundtracks were hilariously wrong. The initial fix was done by nimitz, trap15 and I, using a least squares fit and the OST as the reference. The results were good, but involved a bit of guess-work you see. As it turned out, we were close but it broke other games. Anyway, O. Galibert from the mamedev team then found the firmware for a soundcard that used the ICS2115 and was able to extract the actual formula, which was significantly more complex. Our method may have worked for the new games since they used a different timing “preset”, but it is time consuming and it is ALWAYS better to find out what is really happening instead of guessing, just to make sure you’re not off by any amount.

Anyway, as time went on, I couldn’t bear listening to the games — the flawed audio made them unplayable to me. The notes played too long, some notes were buried under the others, the volume was wrong, etc. etc. That’s when trap15 and I set about to rewrite the core. The first thing we did was try to find out if there were any chips similar enough to the ICS2115 to use as a reference. It turns out there was — the infamous Gravis Ultrasound (aka GUS), which used the GF1 wavetable synthesiser chip. Here’s what the chip looked like:

"Huy guize, I'm from ICS"

Yeah… it was the ICS11614 also made by ICS, as you may have guessed. ;) It turned out it was extremely similar as revealed by the SDK Gravis released for it, downloadable here. Unfortunately, reading the SDK revealed that they didn’t understand the chip too well themselves as it was dreadfully incomplete. By this time, trap15 had rewritten the core from MAME and I was working in parallel to implement it using MAME’s new C++ interface. Eventually he had to work on other stuff and so did I to some degree, but I’m pretty obsessive about these things so I persisted, merging his changes along the way. Eventually, I encountered patent 5809466, which is a clone of the GUS amongst other things. This helped me write a more accurate core, but unfortunately there is still ICS2115-specific information missing.

Here’s a sloppy run through Daioujou BL’s first four stages, demonstrating the new core:

As you can see, it’s almost there. In fact, it will become more difficult to detect whether it is improving soon, so if you own a PCB/port of any PGM game and are familiar with what it sounds like, feel free to leave your comment. I don’t have the port on me as I’m away from my regular “home” so I don’t really have a reference other than the OST.

Any further results will come from reverse engineering the uploaded Z80 code to find out which conditions the remaining mystery commands are sent under (and what the return values for reads should be). If you have any information that could help us (like the missing ICS2115 SDK, mentioned on some ancient websites) please let us know!

A patch against MAME 140u3 can be found here. Apply it as you would normally apply MAME patches.

Oh … and before I forget, be sure to have a peaceful death. =p

14 Comments »

  1. Excellent work, sounds much better now :)

    I think there is some sort of interpolation on the real hardware also, the singing on DOJ level one is noticabely missing it.

    Comment by RetroRepair — 2010/12/24 @ 15:13

  2. Yeah, the interpolation in my code is based on the one in the GUS chip. It’s actually not complete though, I need to combine the cases where the notes play faster than 1 sample per cycle and also the one that plays in reverse. I’d rather put this out there so people can test it rather than work on that as well. Also I’m really behind on my PhD project as a result of this work but it’s a sacrifice I’m willing to make for my two favourite games.

    Comment by austere — 2010/12/24 @ 19:48

  3. Here’s a video with full audio taken from an original PCB of Knights of Valour Plus (match set kovplusa in MAME):

    http://mametesters.org/view.php?id=4070

    and some videos with full audio from another original PCB of Demon Front (match set dmnfrnta in MAME):

    http://www.mametesters.org/view.php?id=4039

    I hope they can help you! :-)

    Comment by AIC — 2010/12/25 @ 02:14

  4. If it can help you, I was listening to the second video, and since I own the ps2 port, I was glad it was perfect ! Until the voices… It seems perfect except the voices which are extremely wrong but it might be obvious ^^
    Thanks for the great job !

    Comment by MsK` — 2010/12/25 @ 03:57

  5. Just got a fresh 140u3 source and tried to apply your diff file which gives out this error message and crashes the patch process:

    patching file src/emu/sound/ics2115.c
    Assertion failed: hunk, file patch-2.5.4/patch.c, line 343

    “insert generic runtime termination message”

    @MsK : What are you talking about ? The voices seem fine to me o_O

    Comment by Exo — 2010/12/28 @ 06:14

  6. Try getting a new source tree (140), patching up to u3 by using u1, u2 and u3.

    The patch has been tested with multiple version of the patch program on many platforms.

    Comment by austere — 2010/12/28 @ 12:01

  7. @austere: Thats exactly what i did. Clean source tree from mamedev, patched u1,u2 and u3 one by one and then patched your diff file on top of it.
    (I repeated everything from the beginning just now but i still get the same error :/)

    P.S.: After patching to u3 it compiles fine so the patching up to u3 seems to work fine. Only problem is your diff file for me :/
    Its 55,2 kb so i guess the download wasnt corrupted and the patch program works fine too :|

    Comment by Exo — 2010/12/28 @ 14:34

  8. I do have the same patching problem under linux…

    This has been done from 0140 patched to u1, u2, u3, and then after patching with austere7.diff.

    Here is the output :
    http://pastebin.com/R7dq0qrH

    Thanks for your great works (and the support :) )
    paxl

    Comment by paxl — 2010/12/29 @ 11:34

  9. I just had an illumination, the patch is in UNIX format and the MAME sourcecode is in DOS Format.
    unix2dos austere7.diff then patch -p0 -E –binary < austere7.diff and it worked !

    Thanks all,
    paxl

    Comment by paxl — 2010/12/29 @ 12:42

  10. Worked like a charm after that.
    Thanks paxl ! :D
    (and you did an awesome job austere <3)

    Comment by Exo — 2010/12/30 @ 03:39

  11. Hey, nimitz and I helped ;P

    Comment by trap15 — 2010/12/30 @ 05:41

  12. Sorry i meant thanks to the whole team of course <3 :P

    Comment by Exo — 2010/12/30 @ 14:15

  13. There’s an SDK for the AMD InterWave, based on the GF1 (iw_sdk20.zip), dunno how closely related it is to the ICS2115.
    The firmware Galibert found was probably from an “SDK” Turtle Beach published for their WaveFront cards (http://turtlebeach.com/support/index.php?View=file&EntryID=687). The archive contains the operating system for the on-board 68000 in s-rec format.

    Comment by asdf — 2011/04/01 @ 01:47

  14. I did look at this before, unfortunately it does not contain any iseful information besides the firmware itself. You have reminded me to take a second look at the operating system however, cheers.

    Comment by austere — 2011/04/20 @ 13:28

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress