Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
03754 Sound Minor Always Feb 27, 2010, 18:56 Nov 17, 2016, 15:42
Tester Ace View Status Public Platform
Assigned To Resolution Open OS
Status [?] Confirmed Driver thunderx.cpp
Version 0.136u3 Fixed in Version Build
Summary 03754: scontra, scontraj: Flaws in sound emulation
Description There are some flaws in Super Contra's sound emulation:

1) Sound is WAY too slow
2) Volume balance between the different sound chips is off(YM2151 is too silent)
3) Some notes from the YM2151 appear to come out wrong

I've provided a recording of "What Is This Place?" from Super Contra on MAMEUI v0.136u3. Compare that to this video of the original Super Contra arcade board(focus only on the part where "What Is This Place?" plays, as the rest is muffled by the sounds of button mashing):

Steps To Reproduce
Additional Information (Attached movie moved to YouTube)
scontra_fix_overclock_refresh.avi May 13, 2012, 19:08 by Mamesick
Z80 Overclocked + Refresh at 57 Hz

Flags Verified with Original
Regression Version
Affected Sets / Systems scontra, scontraj
Attached Files
ogg file icon What Is This Place - MAMEUI.ogg (1,316,664 bytes) Feb 27, 2010, 18:56
Relationships
related to 04825Confirmed vendetta: In MAME the music tempo is slower than real PCB 
related to 01232Confirmed aliens: Comparing to the pcb, the music in mame is slower. 
related to 00413Confirmed crimfght: The speed of the music is playing ever so slightly too slowly. 
related to 03737Confirmed salamand, lifefrce: Music speed is slow. 
Notes
15
User avatar
No.05784
Canim
Senior Tester
Feb 27, 2010, 22:40
I can hear that the music is a little bit to late when the "What is this place?" is said.
Maybe the sound cpu should be a liitle faster, but the osci is unreadable in the video and on the pcb pics I found.
User avatar
No.05789
Ace
Tester
Feb 28, 2010, 04:03
Got a clear image for you: http://arcade.ym2149.com/pcb/konami/supercontra_mainboard_pcb_partside.jpg

There are 2 oscillators on the motherboard: one rated 3.579545MHz, the other rated 24MHz. What does each oscillator do?
User avatar
No.05790
Canim
Senior Tester
Feb 28, 2010, 07:01
Mame gives a 3MHz for the maincpu. This seems not fast enough cause the rom and screen check is with 3MHz too slow. It should be 24MHz / 6 = 4MHz that gives the right timing for the checks like the video.
The next one is the audiocpu. I don't know if it uses the 24MHz osci or the 3.5...MHz one, but overclocking the audiocpu by around 40MHz gives a nearly perfect timing for the sound. First of all it's now fast enough and second the audio FX are now triggert correct. See the second alien scream. It should be direcly after the shooting but it's a few secs after that. Maybe it's more an IRQ trigger prob.
User avatar
No.05791
Kold666
Developer
Feb 28, 2010, 07:58
edited on: Feb 28, 2010, 08:05
i checked the clocks and they are good.

3.57mhz is for the ym2151 and 3mhz is the clock of the konami cpu

I don't hear from my pcb anything wrong comparing to mame.

User avatar
No.05792
Mamesick
Senior Tester
Feb 28, 2010, 08:57
The intro in MAME is too slow. If you want to match the video provided, audiocpu have to be overclocked and refresh rate set to 57Hz (which is really weird).
User avatar
No.05806
Kold666
Developer
Feb 28, 2010, 21:50
I'll measure the vsync asap
User avatar
No.05812
Machone
Tester
Mar 1, 2010, 19:44
Pretty sure the vsync is 59.1856Hz on all 80s and early 90s Konami pcbs that use the 24MHz crystal. As for the sound issues on this game, it's the same problem as 01232. Rock n Rage also suffers from this problem btw - seems to affect many Konami games that use the YM2151.
User avatar
No.05859
R. Belmont
Developer
Mar 12, 2010, 20:16
The music tempo on this is actually governed by the YM2151 clock, but changing it also changes the pitch of the FM (as expected, but which is clearly undesirable since the tuning matches the video as-is).
User avatar
No.05877
Kold666
Developer
Mar 14, 2010, 08:44
edited on: Mar 14, 2010, 08:52
Vsync is 59.17hz

User avatar
No.08580
Mamesick
Senior Tester
May 13, 2012, 18:45
This is the same issue that affects ALIENS, VENDETTA, CRIME FIGHTERS and maybe others konami games with KONAMI + Z80 + YM2151 chips.
User avatar
No.08581
Ace
Tester
May 13, 2012, 19:49
It seems the main source of the music speed problem comes not from the Z80, but rather from the YM2151. This line of code in ym2151.c may have something to do with it:

pom= attotime::from_hz(chip->clock) * (1024 * (256 - i));

If I change the line to this:

pom= attotime::from_hz(chip->clock*1.07) * (1024 * (256 - i));

The music speed is correct. This also fixes Salamander, which suffers from the same problem (and overclocking the Z80 in this one results in incorrect notes). At the same time, however, the music in some other games will become too fast, in particular R-Type II. This may be a possible solution to the slow music in several Konami games, though I'm not sure if this is actually how the YM2151 behaves in those games (probably not seeing as how the music in some other games using the YM2151 becomes too fast).
User avatar
No.08584
Fujix
Administrator
May 14, 2012, 03:42
Better proportion will be YM2151: around 160%, K007232: 100%
User avatar
No.08585
Mamesick
Senior Tester
May 14, 2012, 06:59
@ACE: you are "hacking" the internal YM2151 timings, which is not a good thing. You'll break hundreds of other games.

I'm investigating the source of YM2151 IRQs in Konami games, because they are performed but where they go is beyond me...
User avatar
No.08592
Ace
Tester
May 16, 2012, 04:49
Yeah, I figured it wasn't the right way to fix the speed issues. As of right now, my compiled and modified version of MAME v0.144u4 runs on two different emulated YM2151s because of this, but I know this is not desirable for the emulator.

Now, what exactly are said YM2151 IRQs? With a good explanation, I may be able to help figure out where those IRQs go.
User avatar
No.13380
Fujix
Administrator
Nov 17, 2016, 15:42
Moved the attached movie posted by Mamesick to YouTube.