]> git.sur5r.net Git - cc65/commitdiff
mouse_unload didn't return a valid erro code on success.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 4 Jun 2006 10:29:13 +0000 (10:29 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 4 Jun 2006 10:29:13 +0000 (10:29 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3753 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/mouse/mouse_unload.s

index 352ec12a2d4210be0387c9b0c1d95fcfc2e54492..59ec94949ab488f674662413ee557542e14eb980 100644 (file)
@@ -8,26 +8,29 @@
         .include        "mouse-kernel.inc"
         .include        "modload.inc"
 
+        .import         return0
+
+
 
 _mouse_unload:
        lda     _mouse_drv
+        pha                             ; Save pointer to driver
        ora     _mouse_drv+1
                beq     no_driver               ; No driver
-
-       lda     _mouse_drv
-       pha
        lda     _mouse_drv+1
-       pha                             ; Save pointer to driver
+               pha
 
                jsr     _mouse_uninstall        ; Uninstall the driver
 
        pla
        tax
        pla                             ; Get pointer to driver
-        jmp    _mod_free               ; Free the driver
+        jsr     _mod_free               ; Free the driver
+        jmp     return0                 ; Return MOUSE_ERR_OK
 
 no_driver:
                tax                             ; X = 0
+        pla                             ; Remove pushed junk
        lda     #<MOUSE_ERR_NO_DRIVER
        rts