Closed rerrahkr closed 5 years ago
I'm going to check it, feel free to assign me this one. Apologies for the delay noticing, my mail provider had some trouble during this week.
Hi @nukeykt, I believe @rerrahkr has possibly discovered some very strange behavior in Nuked OPN2. Here are sound samples and VGM. nukedfm3ch.zip
(for a short introduction, Bambootracker is an OPNA tracker, and NukedOPN-Mod is a work over NukedOPN2 which added some OPNA features and raised channel clipping levels ; but, I have also checked in VGMPlay where Nuked is vanilla)
For comparison, we have YM2612 and YM2608 recordings of one note played.
We have (1) as comparison reference.
In VGMPlay, (4) and (5) output similar waveform (clipping of YM2612 aside), which suggest correct operation.
Nuked (2) and (3) generate completely different tone. (The OPN2 makes a ton of clipping also)
Do you have an idea about this?
VGM writes 0x80 to 0x27 register which enables CSM mode, so may be this is reason of weird sound? Neither MAME nor Gens emulate CSM mode accurately AFAIK. Also according to YM2608 datasheet YM2608 CSM mode is activated a bit differently: you need to write 0x40 to 0x27 register. Anyway i'm going to test this VGM on real MegaDrive to make sure later today
Hm, according to MAME YM2608 code CSM mode is enabled using 0x80 data just like YM2612, so i guess datasheet is wrong. Would be nice if someone could verify this on real YM2608 as well
Sample from real YM2612, aside from tonal difference it's matches to Nuked OPN2 sample. I guess your VGM sets YM2612 rate at 8 MHz? realym2612.zip
Oh you are correct about CSM, it's an accidental CSM Enable. Thanks.
I came to the same conclusion as you looking at MAME and YM2608 manual. It's likely specification of register $27 has data bits 6-7 mixed.
The MAME source notes
/* b7 = CSM MODE */
/* b6 = 3 slot mode */
Judging from this, probably BT needs to set $40 not $80 for FM3ch.
@rerrahkr can you check behavior on real chip?
Sample from real YM2612, aside from tonal difference it's matches to Nuked OPN2 sample. I guess your VGM sets YM2612 rate at 8 MHz?
Yes BambooTracker uses clock defined as 3993600 * 2
.
wav.zip I checked on real YM2608 and found Nuked is right (real_0x80.wav). I'm sorry I didn't try it with real chips.
I also check the sounds in setting 0x40 to 0x27 register, and they sound the same. (mame_0x40.wav, nuked_0x40.wav, real_0x40.wav)
I did not know the datasheet is wrong, I will fix it soon. Thanks @nukeykt and @jpcima!
I fixed it at 729c56cf86a5fc86853afb93cc8b0832a5987923. Closed.
Hi @rerrahkr , could you please attach the VGM file you to produce this effect to MiSTer issue https://github.com/MiSTer-devel/Genesis_MiSTer/issues/85, please?
@jpcima I find that the tone of FM 3ch is different from the tone of other channels when using Nuked OPN-Mod added at #94. fm3chex.zip
Changing some envelope parameters, I also notice that it will not update TL in 3ch, so there may be a mistake in writing to the register.