msinger / dmg-schematics

Reverse engineered schematics of the Game Boy's DMG-CPU B chip
Creative Commons Attribution Share Alike 4.0 International
15 stars 14 forks source link

*_PHI signals #148

Closed msinger closed 2 years ago

msinger commented 2 years ago

Since the PHI IO pin itself is inverting the signal that goes through it, the net CPU_PHI1 should be called /CPU_PHI1 to be logically correct. And as a consequence, all other *_PHI signals that are derived from that need to be inverted too.

I think we should find another name for CPU_PHI2, because it looks different than the clock that comes out of the PHI pin. PHI is symmetric, CPU_PHI2 is not. I find if someone sees a signal called *_PHI in the schematics, they should be allowed to safely assume that it is related to what comes out of the PHI pin. One could argue, well, if the name ends with a number 2, then it is a different PHI, but this argument falls apart when looking at /DMA_PHI2, which is derived from DMA_PHI, which comes from /DMA_PHI, which comes from the symmetric CPU_PHI1.

rgalland commented 2 years ago

This is a fair point. I'll invert the signals for now.

rgalland commented 2 years ago

How about CPU_T4. This is quite a good name as we know that each CPU cycle takes 4 clock cycles. I'll commit now so you can have a look.

msinger commented 2 years ago

Yes, I think this makes sense, because CPU_T4 is high during the 4th tick.

Still two things left here: CPU_PHI1 can now be called just CPU_PHI, without the 1, because CPU_PHI2 is gone. You forgot to remove the inversion from DMA_PHI and APU_PHI after inverting CPU_PHI1.

msinger commented 2 years ago

Now ~DMA_PHI2 is wrong. Needs to be inverted as well. On clock and reset sheet, the comment about the wave diagram still contains CPU_PHI1 two times.

rgalland commented 2 years ago

I fixed phi2 and at the same time reordered the sheets + export a pdf. Please let me know what you think.

msinger commented 2 years ago

Yes, very good. I'm finally happy with this.