Now it is possible to generate code for ZX 81 or ZX Spectrum by commenting/uncommenting a directive.
#define ZXMODEL ZX81
//#define ZXMODEL ZXSPECTRUM
Other models can be implemented as long by creating a pair of files:
- A map of keyboard matrix
/* Mapa dos bits da matriz de teclado do ZX81 bit 7 6 5 4 3 2 1 0 SH - c2 c1 c0 l2 l1 l0 c0..c2: column [0..4] l0..l2: line [0..7] SH: flag for SHIFT in composed keys (directionals) */ // Keyboard matrix map // Key column line #define _KEY_1 (0<<3) + 0 #define _KEY_2 (1<<3) + 0 #define _KEY_3 (2<<3) + 0 #define _KEY_4 (3<<3) + 0 #define _KEY_5 (4<<3) + 0 #define _KEY_6 (4<<3) + 3 #define _KEY_7 (3<<3) + 3 #define _KEY_8 (2<<3) + 3 #define _KEY_9 (1<<3) + 3 #define _KEY_0 (0<<3) + 3 ...
- A table to associate a PS/2 scancode to a bit (or more) to be activated in the matrix
const PROGMEM unsigned char PS2Keymap_KEY_ABNT[] = {
_KEY_NONE, // 0x00
_SHIFT + _KEY_9, // 0x01 F9 (GRAPHICS)
_KEY_NONE, // 0x02
_KEY_NONE, // 0x03 F5
_KEY_NONE, // 0x04 F3
_SHIFT + _KEY_1, // 0x05 F1 (EDIT)
_KEY_NONE, // 0x06 F2
_KEY_NONE, // 0x07 F12
_KEY_NONE, // 0x08
_KEY_NONE, // 0x09 F10
...
...
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.