mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2024-11-17 14:11:16 +00:00
31 lines
528 B
C
31 lines
528 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 woz_readkey();
|
||
|
}
|
||
|
|
||
|
byte player_input() {
|
||
|
return read_keyboard();
|
||
|
}
|
||
|
|
||
|
#endif
|