2 ; Karri Kaksonen, Harry Dodgson 2006-01-06
4 ; unsigned char kbhit (void);
12 ; --------------------------------------------------------------------------
13 ; The Atari Lynx has a very small keyboard - only 3 keys
14 ; Opt1, Opt2 and Pause.
15 ; But the designers have decided that pressing Pause and Opt1 at the
16 ; same time means Restart and pressing Pause and Opt2 means Flip screen.
18 ; For "easter egg" use I have also included all three keys pressed '?'
19 ; and Opt1 + Opt2 pressed '3'.
20 ; So the keyboard returns '1', '2', '3', 'P', 'R', 'F' or '?'.
32 lda $FCB0 ; Read the Opt buttons
35 lda $FCB1 ; Read Pause
40 sta KBSTL ; for multibutton
43 sta KBEDG ; for just depressed
46 sta KBDEB ; for debouncing
49 sta KBNPR ; inverted previous ones pressed
55 @L1: tax ; No new keys hit