mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2024-12-22 13:30:38 +00:00
31 lines
531 B
C
31 lines
531 B
C
#ifndef KEYBOARD_H
|
|
#define KEYBOARD_H
|
|
|
|
/* keyboard defititions */
|
|
#define KEY_LEFT 'J'
|
|
#define KEY_RIGHT 'L'
|
|
#define KEY_DOWN 'K'
|
|
#define KEY_DROP ' '
|
|
#define KEY_ROTATE 'I'
|
|
#define KEY_RETURN 0x0d
|
|
|
|
byte test_key(byte key);
|
|
byte read_keyboard();
|
|
byte player_input();
|
|
|
|
// test a specific key
|
|
byte test_key(byte key) {
|
|
return read_keyboard() == key ? 1 : 0;
|
|
}
|
|
|
|
// reads the keyboard and return the key pressed
|
|
byte read_keyboard() {
|
|
return apple1_readkey();
|
|
}
|
|
|
|
byte player_input() {
|
|
return read_keyboard();
|
|
}
|
|
|
|
#endif
|