]> git.sur5r.net Git - cc65/blob - libsrc/atari/readjoy.s
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / libsrc / atari / readjoy.s
1 ;
2 ; Christian Groessler
3 ;
4 ; unsigned readjoy (unsigned char joy);
5 ;
6
7         .export         _readjoy
8
9         .include        "atari.inc"
10
11
12 .proc   _readjoy
13
14         and     #3              ; fix joystick number
15         tax                     ; Joystick number (0-3) into X
16
17 ; Read joystick
18
19         lda     STRIG0,x        ; get button
20         asl     a
21         asl     a
22         asl     a
23         asl     a
24         ora     STICK0,x        ; add position information
25         eor     #$1F
26         ldx     #0              ; fix X
27         rts
28
29 .endproc
30