]> git.sur5r.net Git - cc65/commitdiff
Renamed _em_deinstall -> _em_uninstall, emd_deinstall -> emd_uninstall.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 10 Feb 2003 23:01:13 +0000 (23:01 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 10 Feb 2003 23:01:13 +0000 (23:01 +0000)
Make _em_install and _em_uninstall user callable.

git-svn-id: svn://svn.cc65.org/cc65/trunk@1962 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/em/em-kernel.s
libsrc/em/em_load.c
libsrc/em/em_unload.s

index 473cbb55c83198baa17278bd28923eab2fde9004..bf4455e4b4541f151e29b912e3bff4503ca20930 100644 (file)
@@ -4,8 +4,7 @@
 ; Common functions of the extended memory API.
 ;
 
-        .export         _em_install, _em_deinstall
-
+        .export         em_clear_ptr
         .import         return0
         .importzp       ptr1
 
@@ -24,7 +23,7 @@ _em_drv:        .res    2                     ; Pointer to driver
 .data
 emd_vectors:
 emd_install:           jmp     return0
-emd_deinstall:         jmp     return0
+emd_uninstall:         jmp     return0
 emd_pagecount:  jmp     return0
 emd_map:        jmp     return0
 emd_use:        jmp     return0
@@ -86,23 +85,19 @@ set:    sta     emd_vectors,x
         rts
 
 ;----------------------------------------------------------------------------
-; void __fastcall__ em_deinstall (void);
-; /* Deinstall the driver before unloading it */
-
-_em_deinstall:
-        jsr     emd_deinstall           ; Call driver routine
+; unsigned char __fastcall__ em_uninstall (void);
+; /* Uninstall the currently loaded driver and return an error code.
+;  * Note: This call does not free allocated memory.
+;  */
 
-; Point all jump vectors to return0
+_em_uninstall:
+        jsr     emd_uninstall           ; Call driver routine
 
-        ldx     #0
-@L1:    inx                             ; Skip JMP opcode
-        lda     #<return0
-        jsr     set
-        lda     #>return0
-        jsr     set
-        cpx     #(EMD_HDR_JUMPCOUNT*3)
-        bne     @L1
-
-        rts
+em_clear_ptr:                           ; External entry point
+        lda     #0
+        sta     _em_drv
+        sta     _em_drv+1               ; Clear the driver pointer
 
+        tax
+        rts                             ; Return zero
 
index ff9a234a91025ede0c04d5264986c3b52d7be9e8..b3610bb32d40fa3bd1a98db982fa982bbc93c798 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002      Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* (C) 2002-2003 Ullrich von Bassewitz                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -51,7 +51,7 @@ unsigned char __fastcall__ em_load_driver (const char* name)
 
     /* Check if we do already have a driver loaded. If so, remove it. */
     if (em_drv != 0) {
-        em_deinstall ();
+        em_uninstall ();
     }
 
     /* Now open the file */
index 8c47ef061cac420919025b7652ffef1046e53b95..d5ce35e9e67571ff74108385eff665a020841664 100644 (file)
@@ -5,6 +5,8 @@
 ; /* Unload the currently loaded driver. */
 
 
+        .import         em_clear_ptr
+
         .include        "em-kernel.inc"
         .include        "em-error.inc"
         .include        "modload.inc"
@@ -14,18 +16,13 @@ _em_unload:
        ora     _em_drv+1
                beq     no_driver               ; No driver
 
-       jsr     _em_deinstall           ; Deinstall the driver
+       jsr     emd_uninstall           ; Deinstall the driver
 
         lda     _em_drv
         ldx     _em_drv+1
         jsr     _mod_free               ; Free the driver
 
-        lda     #0
-        sta     _em_drv
-        sta     _em_drv+1               ; Clear the driver pointer
-
-        tax
-        rts                             ; Return zero
+        jmp     em_clear_ptr            ; Clear the driver pointer, return zero
 
 no_driver:
        tax                             ; X = 0