mamedev / mame

MAME
https://www.mamedev.org/
Other
7.94k stars 1.98k forks source link

Sound CPU periodic interrupt speed in Namco's "Universal System 16" #6631

Open gcielniak opened 4 years ago

gcielniak commented 4 years ago

The sound CPU's periodic updates in drivers/toypop.cpp are set to 60 Hz which is not the same as the screen's vblank frequency (MASTER_CLOCK/(384*264) = 60.6060606061). Is the current setting correct?

Tafoid commented 4 years ago

The driver had to be rewritten (ground up) due to re-licensing of source code package to GPL-2.0 back in 2016 and there may be parts of emulation that are inaccurate now. I suppose the best way to know for sure is to compare to how other driver's Namco 15xx sound was handled. Libble Rabble (liblrabl) is also in the same driver.

angelosa commented 4 years ago

periodic_int = n*60 implicitly means it's not officially measured. And in this specific case it's not guaranteed that it really runs at 60.606060 Hz or even if the vblank signal is tied to multiple destinations.

gcielniak commented 4 years ago

Many thanks, @Tafoid and @angelosa! In the mappy driver, vblank fires the interrupts on all CPUs which seems to be reflecting the Mappy's schematics on page 36 where VBLANK clocks the sound CPU's IRQ. Unfortunately, I cannot confirm if the same is true for US16 as I could not find any references to its hardware. The sound hardware implementation is likely to be quite similar but without the schematics, it is impossible to say for sure.

It is a minor thing but I noticed that the sound drivers on mappy and toypop play tunes at a slightly different speed.