ReadPaddle: -:ina,($dc); Wait for TR input to be 0 bit5,a jr nz,- and$0f; Save RLDU bits in e lde,a -:ina,($dc); Wait for TR input to be 1 bit5,a jr z,- rrca; Get low 4 bits into 4 high bits rrca rrca rrca and$f0 ore; Merge with e ret; result in a (position 0..255)
Some games use a "weighted history" to smooth out any noise or abrupt changes; this is achieved by adding the latest "raw" position to the last smoothed position and dividing by two. This will however introduce a small control lag.