First post, by sinuspi
I've been playing around with Sierra AGI games, hacking tools to produce advanced Tandy-sound compatible tunes... and came upon a quirk.
The SN76496 chip can supposedly match the channel 3's periodic noise ("buzz") to channel 2's frequency, producing buzzes in tune with the regular notes. Not so in DOSBox 0.74-3, at least - I had to significantly retune the buzz notes in my music files to make them match the rest of the channels. The frequencies simply did not match at all.
So, I went digging in sources. And in the file dosbox/trunk/src/hardware/mame/sn76496.cpp, I found something totally unexpected. In line 358, m_period[3] = ((n&3) == 3)? (m_period[2]<<1) : (1 << (5+(n&3))); channel 3 nicely borrows channel 2's period... but that happens on setting of said period, in sn76496_base_device::write, on a new note. However, in a running DOSBox 0.74-3, I can easily demonstrate that it's enough to set that value on channel 3 once, early, and play more notes on channel 2, and channel 3 will adapt (with its weird frequency response). Looking at this code, it can't possibly do that.
In Lance Ewing's SN76396 emulation, the period is (correctly?) reset to match channel 2 on every cycle, not on a new note.
What's DOSBox 0.74-3 based on, then? Not SourceForge SVN rev 4300? And why on Earth does it do something weird with the frequencies..?