        .CR     6502
        .TF     getkey.hex,INT
        .LF     getkey.list
;
; FROM THE BOOK '6502 GAMES', EXPECTS THE SAME HARDWARE AS DECRIBED WITHIN IT.
; THIS PART WAS NOT MEANT TO BE RUN DIRECTLY, SO I'VE JUST KEPT THE ADDRESS
; DEFINITIONS GIVEN IN THAT CHAPTER.
;
VIA1    .EQ     $C000
VIA3    .EQ     $CC00
DDR3A   .EQ     VIA3+3      ; USING RC-ONE ADDRESS DECODING SCHEME, PLACING
DDR3B   .EQ     VIA3+2      ;  VIA3 AT $CC00 BY DEFAULT (INSTEAD OF $AC00)
PORT3A  .EQ     VIA3+1      ;  TO FIT RC-ONE ADDRESS DECODING THOUGH ORIGINAL
PORT3B  .EQ     VIA3        ;  CAN BE JUMPERED IF NEEDED/WANTED.    

        .OR     $0100       ; NOTE: BOOK PLACES $0100 INSIDE STACK, MEANING
        .TA     $0100       ;  THAT ROUTINE MAY EASILY GET OVERWRITTEN.
START   LDA     #0
        STA     DDR3A       ; SET KEY STROBE PORT FOR INPUT
        LDA     #$FF
        STA     DDR3B       ; SET KEYS FOR OUTPUT
        .IN     getkey_routine.asm