
 1000  *--------------------------------
 1010  *      READ BOTH GAME PADDLES AT THE SAME TIME
 1020  *--------------------------------
 1030  MON.CH .EQ $24
 1040  PDL0   .EQ $C064
 1050  PDL1   .EQ $C065
 1060  PDL.S  .EQ $C070
 1070  KEYBOARD .EQ $C000
 1080  *--------------------------------
 1090  TEST   JSR READ.BOTH.PADDLES
 1100         TYA          (Y) = PDL 1 SETTING
 1110         JSR $FDDA    PRINT IN HEX ON SCREEN
 1120         INC MON.CH   SPACE BETWEEN VALUES
 1130         TXA          (X) = PDL 0 SETTING
 1140         JSR $FDDA    PRINT IN HEX ON SCREEN
 1150         LDA #0       HTAB 1
 1160         STA MON.CH
 1170         LDA KEYBOARD SEE IF ANY KEY PRESSED
 1180         BPL TEST     NO KEYPRESS, KEEP READING PADDLES
 1190         STA KEYBOARD+16   CLEAR KEYBOARD STROBE
 1200         RTS          RETURN
 1210  *--------------------------------
 1220  READ.BOTH.PADDLES
 1230         LDX #0       PADDLE 0 COUNT
 1240         LDY #0       PADDLE 1 COUNT
 1250         LDA PDL.S    START THE PADDLE TIMERS
 1260  .1     LDA PDL0     CHECK PADDLE 0 TIMER
 1270         BPL .2       TIMED OUT
 1280         INX          COUNT PDL0
 1290         LDA PDL1     CHECK PADDLE 1
 1300         BPL .4       TIMED OUT
 1310         INY          COUNT PDL1
 1320         BNE .1       AGAIN
 1330         LDX #255     MAX TIME FOR BOTH PADDLES
 1340         BNE .3       ...ALWAYS
 1350  *---PADDLE 0 TIMED OUT, KEEP LOOKING AT PADDLE 1
 1360  .2     LDA PDL1     CHECK PADDLE 1
 1370         BPL .5       TIMED OUT
 1380         INY          COUNT PDL1
 1390         NOP          EQUALIZE TIMING
 1400         NOP
 1410         NOP
 1420         NOP
 1430         BNE .2
 1440  .3     LDY #255     MAX TIME FOR PDL1
 1450         BNE .5       ...ALWAYS
 1460  *---PADDLE 1 TIMED OUT, KEEP LOOKING AT PADDLE 0
 1470  .4     LDA PDL0     CHECK PADDLE 0
 1480         BPL .5       TIMED OUT
 1490         INX          COUNT PDL0
 1500         NOP          EQUALIZE TIMING
 1510         NOP
 1520         NOP
 1530         NOP
 1540         BNE .4       KEEP CHECKING
 1550         LDX #255     MAX TIME FOR PDL0
 1560  .5     RTS          RETURN TO CALLER

