The Spectrum keyboard with its rubber keys, which each could have up to five different functions was unique. It was an improvement on its predecessor the ZX80/ZX81 which had a flat keyboard, but it was not made for fast typing. Anyway, with an emulator you can have any keyboard you like - it only needs to be mapped to the Spectrum keyboard.
The spectrum keyboard is connected to the Z80 via IO-port 0xFE, with groups of five keys (half-rows) each connected to a port address. When a key is pressed, the bit with the same index as the key has within the half-row is reset, and then set when the key is released. Read more about this here. In SoftSpectrum 48 this is handled in the InPort class where there are variables for every possible keyboard IN-port address. These variables are modified every time a key is pressed or released. When the Z80 queries the IN-port it is directed here and provided with the current value for the port address in question. In this way, the Spectrum keyboard is mapped to a PC keyboard, but since the Spectrum commands and special characters are not painted on the PC keyboard it is a bit difficult to work with it. To make things easier I have included the Gosh Wonderful ROM, which allows for entering ZX BASIC commands letter by letter. I have also mapped most special characters on the PC keyboard, accessible via the right shift key, to the Spectrum, as well as the arrow keys. This means that you can probably work with the emulator without having to consult the Spectrum keyboard layout too much.
2 Comments
|
Archives
November 2020
Categories
All
|