]> git.sur5r.net Git - cc65/blob - libsrc/geos/mousesprite/readjoy.s
added dio interface, standard mouse and joystick functions, osmaperrno
[cc65] / libsrc / geos / mousesprite / readjoy.s
1 ;
2 ; Ullrich von Bassewitz, 23.09.1998
3 ;
4 ; unsigned readjoy (unsigned char joy);
5 ;
6
7         .export         _readjoy
8
9         .include        "../inc/geossym.inc"
10
11 .proc   _readjoy
12
13         tax                     ; Joystick number into X
14         bne     joy2
15
16 ; Read joystick 1
17
18 joy1:   lda     #$7F
19         sei
20         sta     cia1base
21         lda     cia1base+1
22         cli
23         and     #$1F
24         eor     #$1F
25         rts
26
27 ; Read joystick 2
28
29 joy2:   ldx     #0
30         lda     #$E0
31         ldy     #$FF
32         sta     cia1base+2
33         lda     cia1base+1
34         sty     cia1base+2
35         and     #$1F
36         eor     #$1F
37         rts
38
39 .endproc
40