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

SSG: fixed output when both tone & noise are disabled #30

Closed hyano closed 2 years ago

hyano commented 2 years ago

This is a patch to fix incorrect behavior of the mixer-control register in SSG.

ch_noise_enable_n()/ch_tone_enable_n() are not good names, but I couldn't have a better one.

aaronsgiles commented 2 years ago

Interesting. Can you point me to some examples I can look at to see this behavior?

hyano commented 2 years ago

@aaronsgiles Thanks for your reply.

I'm not sure if it is good example for you, but you can confirm with "SPACE HARRIER" for NEC PC-8801mkII SR (Japanese retro PC). Game starting voice "Welcome to..." is not played with original code.

This technique is used for playing PCM sounds on SSG/PSG by controling volume by CPU in retro PC and chiptune scene. Also HW envelopes can be used for playing triangle wave and saw wave.

One of the another reference on twitter (in Japanese) is: https://twitter.com/gorry5/status/1132210257642397696 https://twitter.com/gorry5/status/1132229707456401408/photo/1 You can see the DC output from the chip.

aaronsgiles commented 2 years ago

Thanks for the reference. Your implementation also agrees with MAME's AY-8910, so I believe it.