]> git.sur5r.net Git - cc65/blob - libsrc/mouse/mouse_unload.s
Remove trailings spaces from CBM-related asm files
[cc65] / libsrc / mouse / mouse_unload.s
1 ;
2 ; Ullrich von Bassewitz, 2004-03-21
3 ;
4 ; unsigned char mouse_unload (void);
5 ; /* Uninstall, then unload the currently loaded driver. */
6
7
8         .include        "mouse-kernel.inc"
9         .include        "modload.inc"
10
11         .import         return0
12
13
14
15 _mouse_unload:
16         lda     _mouse_drv
17         pha                             ; Save pointer to driver
18         ora     _mouse_drv+1
19         beq     no_driver               ; No driver
20         lda     _mouse_drv+1
21         pha
22
23         jsr     _mouse_uninstall        ; Uninstall the driver
24
25         pla
26         tax
27         pla                             ; Get pointer to driver
28         jsr     _mod_free               ; Free the driver
29         jmp     return0                 ; Return MOUSE_ERR_OK
30
31 no_driver:
32         tax                             ; X = 0
33         pla                             ; Remove pushed junk
34         lda     #<MOUSE_ERR_NO_DRIVER
35         rts