I would like an example of what you mean. Ie I use LASTK todo a quick test if Newline (but also H to Newline) is pressed with 191.MrVertigo wrote: ↑Thu Aug 04, 2022 6:04 pm Ah, I understood the keyboard stuff before, but I couldn’t understand where FE was coming from in the stuff I was reading. I didn’t realise it was the ULA.
I sometimes see programmes doing a compare for 191, from different half row scans, checking for ANY key from that half row. But I don’t understand why 191. What is the reason? I understand that a key press, any key press, will turn one of the 1s to a 0. But surely only one of the keys will give 1011111 (191)?
You can test a single key
with this code
Code: Select all
AGAIN:
LD A,%11111110 ; Shift to V
IN A,(254) ; read this row
AND %00000010 ; Test for Z
JR NZ,AGAIN ; Wait for Z is pressed
Select any row in the LD A,%11111110, just set 0 to bit to activate a row to read
IN the AND select the bit matching the key.
Advantage of using IN is that you can read diagonal move as well