|
2 | 2 | ; Title: BBC Basic for AGON
|
3 | 3 | ; Author: Dean Belfield
|
4 | 4 | ; Created: 03/05/2022
|
5 |
| -; Last Updated: 28/03/2023 |
| 5 | +; Last Updated: 02/04/2023 |
6 | 6 | ;
|
7 | 7 | ; Modinfo:
|
8 | 8 | ; 24/07/2022: OSWRCH and OSRDCH now execute code in MOS
|
|
24 | 24 | ; 21/03/2023: Added FX/OSBYTE functions for keyboard control, STAR_FX fixed to accept a single 16-bit parameter
|
25 | 25 | ; 25/03/2023: Fixed range error in OSBYTE, now calls VBLANK_INIT in OSINIT, improved keyboard handling
|
26 | 26 | ; 28/03/2023: Improved BYE command
|
| 27 | +; 02/04/2023: Various keyboard tweaks |
27 | 28 |
|
28 | 29 | .ASSUME ADL = 0
|
29 | 30 |
|
@@ -123,7 +124,10 @@ OSLINE1: PUSH IY
|
123 | 124 | LD A, (FLAGS) ; Otherwise
|
124 | 125 | RES 7, A ; Clear the escape flag
|
125 | 126 | LD (FLAGS), A
|
126 |
| - XOR A ; Return A = 0 |
| 127 | + CALL WAIT_VBLANK ; Wait a frame |
| 128 | + XOR A ; Return A = 0 |
| 129 | + LD (KEYDOWN), A |
| 130 | + LD (KEYASCII), A |
127 | 131 | RET
|
128 | 132 |
|
129 | 133 | ; PUTIME: set current time to DE:HL, in centiseconds.
|
@@ -234,7 +238,10 @@ OSKEY: CALL READKEY ; Read the keyboard
|
234 | 238 | CALL WAIT_VBLANK ; Wait a frame
|
235 | 239 | DEC HL ; Decrement
|
236 | 240 | JR OSKEY ; And loop
|
237 |
| -$$: CP 1BH ; If we are not pressing ESC, |
| 241 | +; |
| 242 | +$$: LD HL, KEYDOWN ; We have a key, so |
| 243 | + LD (HL), 0 ; clear the keydown flag |
| 244 | + CP 1BH ; If we are not pressing ESC, |
238 | 245 | SCF ; then flag we've got a character
|
239 | 246 | RET NZ
|
240 | 247 | ;
|
|
0 commit comments