
Spectrum Timings
Development talk ...
Background for those that need it...
Each operation performed on the spectrum will take a length of time ( counted in T states, Cycles ) its widely documented how long each op will take allowing programmers to create time critical code.. simple enough.. But that's not the whole story the lower part of the memory is used as the video memory and is accessed by the ULA - thus when displaying to the screen the Z80 process is halted if it needs to access this area of memory causing a greater number of Tstates to pass and dependent on what cycle in the frame we are we experience a differing delay
for more info. see Contended Memory
As we need to emulate this behavior thankfully some dedicated individuals have spent a lots of their time discovering how these delays break down on each operation! Its a lovely large table of values and gives us a great deal of opportunity to get a few wrong...
So ( after ripping Woody's code, don't tell him. ) I wrote a set of tests to run each op across contended memory although this wont give the actual contended value at a given point it will however become a checksum to compare a real Spectrums against one another and against the emulator.
In order to get the correct results we ran the tests on real Spectrums, Additionally there is a case known as "late/early timing" in which is thought some Spectrums are 1Tstate later, Although what causes isn't clearly understood and the effects to date this has is also unknown. So whilst building these test we thought it could be beneficial to ask the public to run the code on their own Spectrums and send in the results this way we can get a little closer to the effects and a snapshot ratio of late/early machines... So if you have a spectrum run the tests! . . . . . . please.

How do the tests work?
At present there are a set of 35 tests each test contains a group of OPs ( to cover all documented OP's ).
Before running a test a section of memory is set up to catch the interrupt and redirect the execution to a compare routine against known values. The idea of each test is to run the batch of OPs as many times as possible before the next interrupt fires, a loop count, a running memory fetch R value and the memory location reached when the interrupt happened.
For the early/late (type1/type2) detection the test loop is the simplest tightest loop possible JP (HL) back to itself which is only broken once an interrupt fires, running in non contended memory causing (1R, 4T) on each execute.
Initial finds...
Firstly: When these tests were wrote no emulator which gives an option to emulate late timings matched timing we generated from our late machine! So there's a project!
Secondly: We rewrote a quick check for late/early timing using the known values of our test, this showed some interesting results when run on a cold early machine could initially report late and then early after warming up, so after some changes we wrote the test to stream the results on the screen this way you could see the values wavering when cold!
The Tests
Download The Tests Here
Important: When running the test please remove any additional hardware, Also press enter and run all tests, If any should fail wait until Spectrum has fully warmed up before re-trying.
Submit Your Results Here
Important: Only submit results from genuine hardware no emulators!
View The Results Here
If you like the site, emulator or any of the tools or just the ZX Spectrum then please link to us, help us climb the Googles
Thanks for reading, please if you can help out do so - Enjoy ZXSpectrum4.net Team.
Key Points
we need your help!
ZX Spectrum Cassette Database
In order to maximise the database we need to find as many cassettes as possible, from unknown ones to ones known but we are unable to locate.
If you can help us with any old cassettes you may have in the loft you no longer want or know someone that has then please contact us and give them to a good home, If we can't get there in person we can get them collected by courier - please don't throw them!
Don't worry if you have no old cassettes please register your copy of the emulator by doing so helps us obtain further hardware and software for the project, and plus gives you full functionality of the emulator.
Help by donating or registering
A big "THANK YOU!" to everyone the has donated, time, money, knowledge, tapes and hardware we are truly grateful - ZXSpectrum4.net Team.
emulator
ZX Spectrum Emulator for Microsoft Windows, developed under Microsoft .net framework.
It emulates all known ZX Spectrum behaviour, Inc.models 16/48k, 128k, +2, tzx tape files and tape deck emulation, Sound, Border (loading borders), Basic, Snapshot saving and more ...other supported file formats include sna, z80, tap
The ZX Spectrum emulator was the result of getting to know the .net environment a little better, and since staring have found ourselves up against barriers within the environment leaving no choice but to use some existing native windows calls, thanks Microsoft.
GAMES!
We've now included a couple of games in different formats to help those non-techie get started.
Requirements
Microsoft Windows 7 , XP , Vista
( XP requires microsoft .net framework )
Latest Version 1.0.4281 Build: 15482 (11781)
