Vital Constants
In designing your ZX Spectrum emulator, there are several constants that represent key aspects of the ZX Spectrum hardware. These constants help define when various things happen in the ZX Spectrum's operation, and other key aspects of the ZX Spectrum's hardware.
The following resources provide information on the ZX Spectrum's hardware and how it works:
- ZX Spectrum 48K Reference — This is perhaps the most comprehensive reference on the ZX Spectrum's hardware.
- PAL TV Timing — This background information on the PAL TV standard is useful for understanding how the analog TV signal worked (see also this page for similar information).
Timing and Dimensions
Screen Dimensions
A Contradition and a Choice
Note that according to the technical documentation, there are 64 scan lines in the top border area (of which only 48 may be visible), 192 scan lines in the screen area, and 56 scan lines in the bottom border area. This adds up to 312 scan lines, which is the total number of scan lines in a frame. However, if you check the PAL documentation above, you'll find that the final three scan lines of a PAL frame are used to send the vertical sync pulse, which is not visible on the screen. Thus there cannot be 56 border lines visible in the bottom border area.
In practice, you have an aesthetic choice to make regarding how much of the border to show. Actual PAL TVs had a property called "overscan" where the edges of the screen were not visible. Thus you probably want not to show some of the border that might technically be visible according to the PAL standard.
Memory Organization
Interrupts and Timing
A Visualization
These numbers may seem a bit abstact, so here's a visualization of the ZX Spectrum's screen layout:
(When logged in, completion status appears here.)