Skip to content

ZX Spectrum AY8912 clock rate

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • dgw Offline
  • Posts: 6
  • Joined: 2024-05-18, 12:09:27

ZX Spectrum AY8912 clock rate

Post by dgw »

I notice some files have clock rate set as 3546895 Hz for AY8912. Datasheet for AY891x maximum clock rate is 2.5MHz (YM2149 is 4MHz). The ZX Spectrum 128 AY8912 clock is 1/10th of system clock which is 1.77345MHz. I am :?
  • User avatar
  • ValleyBell Offline
  • Posts: 4826
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: ZX Spectrum AY8912 clock rate

Post by ValleyBell »

Please define "some files".
  • dgw Offline
  • Posts: 6
  • Joined: 2024-05-18, 12:09:27

Re: ZX Spectrum AY8912 clock rate

Post by dgw »

https://vgmrips.net/files/Computers/ZX_ ... m_128).zip
https://vgmrips.net/files/Computers/ZX_ ... m_128).zip

Just a couple I've encountered so far whilst having a quick look at AY891x files. Wasn't sure whether they had been resampled suitable for 4Mhz YM SSGs.
  • User avatar
  • ValleyBell Offline
  • Posts: 4826
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: ZX Spectrum AY8912 clock rate

Post by ValleyBell »

Since these are "Sonic Of 8!" rips, I assume that they were done using "nezplug".
And when I look at the file header, I assume that nezplug ripped them as YM2149 (with the flag for "/2 clock divider" being set) and the ripper edited them to say "AY8912".
It is probably a faulty rip.

The music seems to be pitched higher than what I hear in some videos. It is possible that the rips used to work and some VGMPlay update broke them. (The "/2 divider" flag is only valid for the YM2149 and its derivates, but in VGMPlay 0.40.x, the EMU2149 core apparently accepted that flag for the AY8910 as well.)
  • dgw Offline
  • Posts: 6
  • Joined: 2024-05-18, 12:09:27

Re: ZX Spectrum AY8912 clock rate

Post by dgw »

OK that makes sense, thanks. If /2 flag (b4 0x79) is set then clock rate 0x74 should be halved for either AY or YM.
  • User avatar
  • ValleyBell Offline
  • Posts: 4826
  • Joined: 2011-12-01, 20:20:07
  • Location: Germany

Re: ZX Spectrum AY8912 clock rate

Post by ValleyBell »

The /2 flag is actually only valid for the YM2149, because that chip has a separate pin that enables the /2 clock divider.
In AY-mode, the sound cores are supposed to ignore the flag. (and they all do so since VGMPlay 0.50, I think)
"/2 divider" + AY mode is actually an invalid combination.

The VGMs were originally "YM2149 @ 3.5 MHz + /2 clock divider", but during the "change chip type from YM2149 to AY8912" process, the clock + divider setting was incorrectly kept.
Post Reply