ReadPaddle: -: in a,($dc) ; Wait for TR input to be 0 bit 5,a jr nz,- and $0f ; Save RLDU bits in e ld e,a -: in a,($dc) ; Wait for TR input to be 1 bit 5,a jr z,- rrca ; Get low 4 bits into 4 high bits rrca rrca rrca and $f0 or e ; Merge with e ret ; result in a (position 0..255)