Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;===============================================================
- GetKey:
- ;===============================================================
- ;Outputs:
- ; bc is a value from 0 to 56 that is the keypress
- ; d has a bit reset, the rest are set (this is the last key group tested)
- ; e is a with a mask of %11111000
- ; hl is not modified
- ;===============================================================
- ld de,$7FF8 ;11F87F
- ld bc,0 ;010000
- KeyLoop:
- rlc d ;CB02
- ld a,d ;7A
- out (1),a ;D301
- ret p ;F0
- ld a,8 ;3E08
- add a,e ;83
- ld e,a ;5F
- in a,(1) ;DB01
- inc a ;3C
- jr z,KeyLoop ;28EC
- dec a ;3D
- inc c ;0C
- rra ;1F
- jr c,$-2 ;38FB
- ld a,e ;83
- add a,c ;81
- ld c,a ;4F
- ret ;C9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement