aaronsgiles / ymfm

BSD-licensed Yamaha FM sound cores (OPM, OPN, OPL, and others)
BSD 3-Clause "New" or "Revised" License
259 stars 40 forks source link

YM2151 Noise Freq is reversed #36

Closed ZeroByteOrg closed 2 years ago

ZeroByteOrg commented 2 years ago

For OPM, register 0x0F is noise frequency (bits 0-5) and noise_enable (bit 7) In YMFM, the noise frequency output is highest when this value = 0 and lowest when this value = 1F. The real hardware behaves in the reverse of this. (1F = highest freq, 00 = lowest freq)

We did a test using the same VGM data on two emulators and a real chip. The emulator(s) using YMFM get the pitch backwards. The real HW and emulators using either Nuked OPM or the previous MAME core produce the expected results (1F = lowest, 00 = highest)

VGM attached Noise Sweep VGMs.zip

aaronsgiles commented 2 years ago

Ooo, nice catch. I will look into it.

ZeroByteOrg commented 2 years ago

I had two different people with real YM2151 verify the behavior of real HW = pitch max = 1F, min = 00 - just to make sure I and the first person weren't crazy.

aaronsgiles commented 2 years ago

Thanks for the confirmation. I'm sure you're right, I am just distracted with another project ATM and will get back to this (and a couple of other pending issues) when I have some time.

aaronsgiles commented 2 years ago

FIxed this a while back in ba16cd77385a758ca9c0e01ee9c9d9576a26924e, forgot to close this out.