MiSTer-devel / MSX_MiSTer

MSX for MiSTer
41 stars 22 forks source link

Port T80 changes from ZX Spectrum/Amstrad, remove async clocks driving CPU #8

Closed MP2E closed 4 years ago

MP2E commented 4 years ago

Thank you for your comments, I reworked all my changes from last time, and spent some time porting the T80 changes over from the ZX Spectrum core. I made sure to preserve R800 support, which is still working from my testing.

I think I correctly made the CPU clocks synchronous this time, but it's possible I misunderstood something again

MP2E commented 4 years ago

Oh I forgot to mention: there are async clocks left for me to remove, and I still am doing that. Just wanted to make sure I'm not doing something wrong first

sorgelig commented 4 years ago

Although i've merged the PR, all CEs are wrong! Every CE must be active only ONE master clock cycle. If there is 5MHz CE, then only every 4th cycle must be active.

My T80pa wrapper has protection against CE being active more than 1 cycle - that's why it may be still work (i didn't test), but overall logic is now wrong because i see trueClk is used in other places.

MP2E commented 4 years ago

Ahh, in hindsight, that does seem obvious. It seems to work, but I will fix the CEs so that they only stay enabled one cycle

sorgelig commented 4 years ago

and those CPU ce_p/ce_n must be shifted against each other. for example CE_p is active at cycles 0,4,8,12... and CE_n is active 2,6,10,14...

sorgelig commented 4 years ago

Btw, now MSX got compiled in 8mins. Before it was 33mins! So you can see how much easier now the project for Quartus to compile.

MP2E commented 4 years ago

Yes it's much better to develop on with the faster compile times :D

sorgelig commented 4 years ago

Converting async clocks to CE won't exactly will work the same. So after you fix CE signals you need to test the core against the possible new bugs.

MP2E commented 4 years ago

Will do! I'll make sure to test many programs after converting each clock

gyurco commented 4 years ago

It would be cool if you can cooperate with Luca (KdL) in this change. He knows the best what needs to be tested.

MP2E commented 4 years ago

I agree, thank you for the suggestion!