]> git.sur5r.net Git - cc65/commitdiff
Added em_use
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 5 Dec 2002 18:57:53 +0000 (18:57 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 5 Dec 2002 18:57:53 +0000 (18:57 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1719 b7a2c559-68d2-44c3-8de9-860c34a00d81

12 files changed:
asminc/em-kernel.inc
include/em.h
include/em/em-kernel.h
libsrc/c128/c128-georam.s
libsrc/c128/c128-ram.s
libsrc/c128/c128-reu.s
libsrc/c64/c64-georam.s
libsrc/c64/c64-ram.s
libsrc/c64/c64-reu.s
libsrc/em/Makefile
libsrc/em/em-kernel.s
libsrc/em/em_use.s [new file with mode: 0644]

index ab17cc2ccd09c21e619d2804110e3b38f02be6df..22fcfa4c07171962a695570724fb8968c4640634 100644 (file)
@@ -44,11 +44,12 @@ EMD_HDR_INSTALL         = EMD_HDR_JUMPTAB+0     ; INSTALL routine
 EMD_HDR_DEINSTALL       = EMD_HDR_JUMPTAB+2     ; DEINSTALL routine
 EMD_HDR_PAGECOUNT       = EMD_HDR_JUMPTAB+4     ; PAGECOUNT routine
 EMD_HDR_MAP             = EMD_HDR_JUMPTAB+6     ; MAP routine
-EMD_HDR_MAPCLEAN        = EMD_HDR_JUMPTAB+8     ; MAPCLEAN routine
-EMD_HDR_COPYFROM        = EMD_HDR_JUMPTAB+10    ; COPYFROM routine
-EMD_HDR_COPYTO          = EMD_HDR_JUMPTAB+12    ; COPYTO routine
+EMD_HDR_USE             = EMD_HDR_JUMPTAB+8     ; USE routine
+EMD_HDR_MAPCLEAN        = EMD_HDR_JUMPTAB+10    ; MAPCLEAN routine
+EMD_HDR_COPYFROM        = EMD_HDR_JUMPTAB+12    ; COPYFROM routine
+EMD_HDR_COPYTO          = EMD_HDR_JUMPTAB+14    ; COPYTO routine
 
-EMD_HDR_JUMPCOUNT       = 7                     ; Number of jump vectors
+EMD_HDR_JUMPCOUNT       = 8                     ; Number of jump vectors
 
 ;------------------------------------------------------------------------------
 ; Offsets into the em_copy structure
@@ -69,7 +70,8 @@ EM_COPY_COUNT           = 5
         .global emd_install
         .global emd_deinstall
         .global emd_pagecount
-        .global emd_map
+        .global emd_map    
+        .global emd_use
         .global emd_commit
        .global emd_copyfrom
         .global emd_copyto
@@ -81,6 +83,7 @@ EM_COPY_COUNT           = 5
        .global _em_deinstall
        .global _em_pagecount
        .global _em_map
+        .global _em_use
        .global _em_commit
        .global _em_copyfrom
        .global _em_copyto
index a69c9598dd2502c18e9573abb94a4e7120519c62..5064d137f1574abc5ca0871fb59b1684b42545fc 100644 (file)
@@ -90,6 +90,15 @@ void* __fastcall__ em_map (unsigned page);
  * em_commit, the old contents of the memory window may be lost!
  */
 
+void* __fastcall__ em_use (unsigned page);
+/* Tell the driver that the memory window is associated with a given page. 
+ * This call is very similar to em_map. The difference is that the driver
+ * does not necessarily transfer the current contents of the extended
+ * memory into the returned window. If you're going to just write to the
+ * window and the current contents of the window are invalid or no longer
+ * use, this call may perform better than em_map.
+ */
+
 void __fastcall__ em_commit (void);
 /* Commit changes in the memory window to extended storage. If the contents
  * of the memory window have been changed, these changes may be lost if
index 63939e04fe5c22923a95fa0d7a21405cf7da18f2..8a3938fb6631b35741558adf94b98d05c9e13b11 100644 (file)
@@ -58,6 +58,7 @@ typedef struct {
     void*               deinstall;      /* DEINSTALL routine */
     void*               pagecount;      /* PAGECOUNT routine */
     void*               map;            /* MAP routine */
+    void*               use;            /* USE routine */
     void*               mapclean;       /* MAPCLEAN routine */
     void*              copyfrom;       /* COPYFROM routine */
     void*               copyto;         /* COPYTO routine */
index dee4eaa1e5e743b3e700d4750abf676b36952713..bc98f6101594af78c40248c0cb8df73886619727 100644 (file)
@@ -29,6 +29,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -79,6 +80,13 @@ PAGECOUNT:
         ldx     pagecount+1
         rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+; The GeoRAM cartridge does not copy but actually map the window, so USE is
+; identical to MAP.
+
+USE     = MAP
+
 ; ------------------------------------------------------------------------
 ; MAP: Map the page in a/x into memory and return a pointer to the page in
 ; a/x. The contents of the currently mapped page (if any) may be discarded
index 806192edfc87505e5b4a4cf4a3fe0a80a42a1367..ebb1beecc3039e849aa1d008e9b0d8b14f9ec81d 100644 (file)
@@ -30,6 +30,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -114,6 +115,15 @@ MAP:    sta     curpage
         ldx     #>window                ; Return the window address
         rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+
+USE:    sta     curpage
+        stx     curpage+1               ; Remember the page
+        lda     #<window
+        ldx     #>window                ; Return the window
+        rts
+
 ; ------------------------------------------------------------------------
 ; COMMIT: Commit changes in the memory window to extended storage.
 
index 358b9a4271c7fc0f0d8a74a91da1c75c0cd4ef2a..a812fa85deaf0fac1e036ec5c8e42201c06f8b56 100644 (file)
@@ -30,6 +30,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -138,6 +139,15 @@ MAP:    sta     curpage
         ldx     #>window                ; Return the window address
 done:   rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+
+USE:    sta     curpage
+        stx     curpage+1               ; Remember the page
+        lda     #<window
+        ldx     #>window                ; Return the window
+        rts
+
 ; ------------------------------------------------------------------------
 ; COMMIT: Commit changes in the memory window to extended storage.
 
index dee4eaa1e5e743b3e700d4750abf676b36952713..bc98f6101594af78c40248c0cb8df73886619727 100644 (file)
@@ -29,6 +29,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -79,6 +80,13 @@ PAGECOUNT:
         ldx     pagecount+1
         rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+; The GeoRAM cartridge does not copy but actually map the window, so USE is
+; identical to MAP.
+
+USE     = MAP
+
 ; ------------------------------------------------------------------------
 ; MAP: Map the page in a/x into memory and return a pointer to the page in
 ; a/x. The contents of the currently mapped page (if any) may be discarded
index f1ece72f381bb1679439dc7e01edf159a0a6a086..023f86529eabc4c67f4f642015dd824b5d340d22 100644 (file)
@@ -29,6 +29,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -109,6 +110,14 @@ MAP:    sta     curpage                    ; Remember the new page
         ldx     #>window                ; Return the window address
         rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+
+USE:    sta     curpage                 ; Remember the page
+        lda     #<window
+        ldx     #>window                ; Return the window
+        rts
+
 ; ------------------------------------------------------------------------
 ; COMMIT: Commit changes in the memory window to extended storage.
 
@@ -249,7 +258,7 @@ common: ldy     #EM_COPY_COUNT+1
 
 ; Done
 
-@L4:    rts          
+@L4:    rts
 
 ; ------------------------------------------------------------------------
 ; COPYTO: Copy from linear into extended memory. A pointer to a structure
index 96a6ebebc5bf44860ad1866b6194c6e721d92a57..2c8238078a74a5e4be973146ecd25e0b2e2ca598 100644 (file)
@@ -29,6 +29,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -137,6 +138,15 @@ MAP:    sta     curpage
         ldx     #>window                ; Return the window address
 done:   rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+
+USE:    sta     curpage
+        stx     curpage+1               ; Remember the page
+        lda     #<window
+        ldx     #>window                ; Return the window
+        rts
+
 ; ------------------------------------------------------------------------
 ; COMMIT: Commit changes in the memory window to extended storage.
 
index 7766183c3db2dd3fd9879fc173f2c2d3340a2318..714010ee8b944c426caecab5c25ea2e733dfb920 100644 (file)
@@ -20,6 +20,7 @@ S_OBJS =              em-kernel.o     \
                em_map.o        \
                em_pagecount.o  \
                em_unload.o     \
+                em_use.o        
 
 
 all:   $(C_OBJS) $(S_OBJS)
index d2920b354a123f0eace09e7c18262001c1018864..473cbb55c83198baa17278bd28923eab2fde9004 100644 (file)
@@ -23,13 +23,14 @@ _em_drv:        .res    2                   ; Pointer to driver
 ; Jump table for the driver functions.
 .data
 emd_vectors:
-emd_install:           jmp     $0000
-emd_deinstall:         jmp     $0000
-emd_pagecount:  jmp     $0000
-emd_map:        jmp     $0000
-emd_commit:     jmp     $0000
-emd_copyfrom:  jmp     $0000
-emd_copyto:     jmp     $0000
+emd_install:           jmp     return0
+emd_deinstall:         jmp     return0
+emd_pagecount:  jmp     return0
+emd_map:        jmp     return0
+emd_use:        jmp     return0
+emd_commit:     jmp     return0
+emd_copyfrom:          jmp     return0
+emd_copyto:     jmp     return0
 
 ; Driver header signature
 .rodata
diff --git a/libsrc/em/em_use.s b/libsrc/em/em_use.s
new file mode 100644 (file)
index 0000000..3f07a51
--- /dev/null
@@ -0,0 +1,17 @@
+;
+; Ullrich von Bassewitz, 2002-11-29
+;
+; void* __fastcall__ em_use (unsigned page);
+; /* Tell the driver that the memory window is associated with a given page.
+;  * This call is very similar to em_map. The difference is that the driver
+;  * does not necessarily transfer the current contents of the extended
+;  * memory into the returned window. If you're going to just write to the
+;  * window and the current contents of the window are invalid or no longer
+;  * use, this call may perform better than em_map.
+;  */
+
+
+        .include        "em-kernel.inc"
+
+               _em_use         = emd_use               ; Use driver entry
+