Example code for reading paddles on a C64 ----------------------------------------- PADDLE_JOY_1 SEI ;disable interrupts (for example keyboard scanning) LDA $DC02 ;GET CURRENT VALUE OF DDR STA TEMPBUF ;SAVE IT AWAY LDA #$C0 ; STA $DC02 ;SET PORT A FOR INPUT LDA $DC00 ;Control-Port 1 selected (when bit6=1 and bit7=0) AND #%00111111 ;clear bit-6/7 ORA #%01000000 ;set bit-6 STA $DC00 ;now control-port 1 is selected for reading the POT registers LDY #$80 ;WAIT A WHILE (data aquisition time) PDLRD_J1 NOP ; DEY ; BPL PDLRD_J1 ; LDX #11 ; LDY #3 ; JSR SET_CURSOR ; LDA $D419 ;Paddle X value 0..255 STA PADDLE_1_X ;save to memory for later use... LDX #11 ; LDY #6 ; JSR SET_CURSOR ; LDA $D41A ;Paddle Y value 0..255 STA PADDLE_1_Y ;save to memory for later use... TEST_P1_02 LDA #%00000100 ;Paddle fire (BIT 2 is the X-fire button) BIT $DC01 ; BNE TEST_P1_02a ; DO SOMETHING HERE ;action when button is pressed TEST_P1_02a TEST_P1_03 LDA #%00001000 ;Paddle fire (BIT 3 is the Y-fire button) BIT $DC01 ; BNE TEST_P1_03a ; DO SOMETHING HERE ;action when button is pressed TEST_P1_03a LDA TEMPBUF ; STA $DC02 ;RESTORE PREVIOUS VALUE OF DDR CLI ;restore interrupts RTS ; TEMPBUF BYTE $0 PADDLE_1_X BYTE $0 PADDLE_1_Y BYTE $0