The ZX Spectrum Reverse Engineering and Clone Desgin Blog


A site dedicated to the reverse engineering of the ZX Spectrum and related projects.

< 48 of 68 >

Contention Test Success

Jul 28, 2007

The reworked contention WAIT generator and clock generator were quite easy to implement as they only involved a couple of changes to the existing circuit. The real test was to load up floatspy and Aquaplane....

Floatspy shows the first floating bus attribute byte read at T-state 14346, which is excellent, and several full auto-tests completed successfully!

Secondly I examined the contended floating bus. The timing exhibited by the Harlequin is very slightly different to a real ZX Spectrum:

  • A spectrum returns an attribute byte at T-states 14344, 14346, 14354, 14362, 14370 ...
  • The Harlequin returns attribute bytes at T-states 14345, 14347, 14353, 14361, 14369 ...
The difference in timing being between the second and third attribute bytes of a row. The T-state offset differences for a Spectrum are 2, 8, 8, 8, 8 .... whereas the Harlequin shows 2, 6, 8, 8, 8, 8 .....

I'm not 100% sure why this is, but suspect it is related to the timing of the IO contention to the memory contention to the video byte fetches. Adjusting these timings will be complicated, and may not be worth it given that the Harlequin is just 1 T-state out every couple of hundred!

Okay, the pivotal test! Aquaplane:

Hurrah! The horizontal border is perfect! I am very pleased with this.

Working out the contention timing of the Spectrum and producing an implementation of that has been the most complicated and difficult part of this whole project!

I am very satisfied with the results so far.

For a photo of the full development board, click here.

If anyone has any programs that will test the accuracy of the memory contention (something that runs in the bottom 16K and visibly shows when the contention is even slightly off), then please send me an email! See contact for email address.

There are just a few things to tidy up, like sound and the FLASH attribute mode....