]> git.sur5r.net Git - cc65/commitdiff
Make the code somewhat smaller
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 19 Sep 2001 09:57:56 +0000 (09:57 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 19 Sep 2001 09:57:56 +0000 (09:57 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@950 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/c128/mouse.s

index 7f2dea918e3a500b3e8f0a0a10b9b61ee38c30e3..05628a54d043f270b5bd9aa398d788d0bb41d051 100644 (file)
@@ -99,24 +99,26 @@ AlreadyInitialized:
 ; void mouse_done (void);
 ;
 
-.proc  _mouse_done
-
+_mouse_done:
                lda     Initialized             ; Initialized?
-               beq     @L1                     ; Jump if no
+               beq     mddone                  ; Jump if no
        lda     #0
                sta     Initialized             ; Reset the initialized flag
        lda     OldInitStatus           ; Load the old BASIC int bit
        and     #$01                    ; Mask it
-       sei                             ; Disable interrupts
        ora     INIT_STATUS             ; Restore the old state
        sta     INIT_STATUS
+
+; Disable the mouse sprite
+
+DisableSprite:
        lda     #$FE                    ; Clear bit for sprite #0
+       sei                             ; Disable interrupts
        and     VIC_SPR_ENA
        sta     VIC_SPR_ENA             ; Disable sprite
        cli                             ; Enable interrupts
-@L1:   rts
+mddone: rts
 
-.endproc
 
 ; --------------------------------------------------------------------------
 ;
@@ -127,13 +129,7 @@ AlreadyInitialized:
 
                lda     Invisible               ; Get the flag
        bne     @L1                     ; Jump if already invisible
-
-       lda     #$FE                    ; Clear bit for sprite #0
-       sei                             ; Disable interrupts
-       and     VIC_SPR_ENA
-       sta     VIC_SPR_ENA             ; Disable sprite
-       cli                             ; Enable interrupts
-
+       jsr     DisableSprite           ; Disable the mouse sprite
 @L1:   inc     Invisible               ; Set the flag to invisible
        rts