Keyboard

Key scan routine from game Party Worms get_key ld c, 254 ld b, c	ld hl, key_table get_key3 in a, (c) push bc	ld b, 5 get_key2 rrca jr c, get_key1

ld a, (hl) ld (key), a	pop bc	ret get_key1 inc hl	djnz get_key2 pop bc	rlc b	bit 7, b	jr nz, get_key3

xor a	ld (key), a	ret key_table ;FEFEh .BYTE "cZXCV"  ; c CAPS ;FDFEh .BYTE "ASDFG" ;FBFEh .BYTE "QWERT" ;F7FEh .BYTE "12345" ;EFFEh .BYTE "09876" ;DFFEh .BYTE "POIUY" ;BFFEh .BYTE "eLKJH"	; e ENTER ;7FFE .BYTE " sMNB"  ; s SYMBOL SHIFT

key    .BYTE 0