First I recorded the output of a simple noise filter sweep from a random selection of emulators I had installed, and put it through a frequency analyser.
Here AY_Emul and Fuse give similar looking output, and the graphs from the other emulators also match up with each other. (For some reason the output isn't very clear, but the ZEsarUX graph seems to match up with the Fuse and AY_Emul graphs.)
When I compared the differing frequencies of the graphs, a suspicious-looking pattern began to emerge. Here I've stretched the output from AY_Emul to double width, and then overlaid the Spectaculator graph on the left hand side at regular size.
They match up perfectly! So it looks like Spectaculator and the other emulators are using half the noise period of Fuse and AY_Emul. To test this, I modified the PT3 player code found here to double all the noise periods before outputting them, thus reducing the frequency to compensate:
Code: Select all
pl2: ld ix,ChanA ld hl,(AYREGS+AR_TonA) call chregs ld (AYREGS+AR_TonA),hl ld a,(Ampl) ld (AYREGS+AR_AmplA),a ld ix,ChanB ld hl,(AYREGS+AR_TonB) call chregs ld (AYREGS+AR_TonB),hl ld a,(Ampl) ld (AYREGS+AR_AmplB),a ld ix,ChanC ld hl,(AYREGS+AR_TonC) call chregs ld (AYREGS+AR_TonC),hl ld hl,(ns_base_AddToNs) ld a,h add a,l ; add this bit to double the noise period add a,a cp $20 jr c, skip_noise_cap ld a, $1f skip_noise_cap: ; rest of code ld (AYREGS+AR_Noise),a
What's the reason for the discrepancies between emulators? I thought it might have something to do with how the chip divides the clock internally, but I'm just guessing here. I don't own a 128 so I can't test this to see which implementation is correct. Does anyone have any measurements from real hardware to confirm?
If anyone's interested, here's the program I used to test. You can use BREAK and RUN 40 to restart it when it stops.