drhelius / Gearsystem

Sega Master System / Game Gear / SG-1000 emulator and debugger for macOS, Windows, Linux, BSD and RetroArch.
https://x.com/drhelius
GNU General Public License v3.0
266 stars 48 forks source link

SG-1000 PAL CPU Clock #99

Open siriokds opened 7 months ago

siriokds commented 7 months ago

Hi, SG-1000 PAL machines uses TMS9929 VDP (instead of TMS9918) which doesn't have any clock out pin connected to the CPU. The cpu clock is external and its freq isn't 3546893Hz but 3580000Hz (3.58MHz).

drhelius commented 7 months ago

Thanks for reporting. Do you know any title where there is a noticiable difference?

drhelius commented 7 months ago

It's quite odd that PAL SG-1000 runs at 3.58 MHz, the same freq that NTSC. I need to understand this better.

siriokds commented 7 months ago

SG-1000 had different revisions:

1) SG-1000 (Mark I) is only NTSC, VDP is TMS9918. CPU Clock signal is derived/generated by the VDP clock and outputs from the VDP. Its frequency is 3.579545 MHz (same as NTSC color burst).

2) SG-1000 (Mark II rev 1) is both NTSC and PAL. NTSC version works like Mark I. PAL version (vdp is TMS9929) cannot generate CPU Clock. VDP composite signal is generated by a small daughterboard. The clock is external and it is 3.58MHz (not 3.579545 MHz and not 3.546893 MHz).

3) SG-1000 (Mark II rev 2) is both NTSC and probably PAL. The VDP and PSG are now replaced by a custom chip Sega 315-5066/Yamaha YM2217. The CPU Clock is generated by this custom chip and it's 3.579545MHz for the NTSC but I don't have any info about the PAL version.