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
.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
.global _em_deinstall
.global _em_pagecount
.global _em_map
+ .global _em_use
.global _em_commit
.global _em_copyfrom
.global _em_copyto
* 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
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 */
.word DEINSTALL
.word PAGECOUNT
.word MAP
+ .word USE
.word COMMIT
.word COPYFROM
.word COPYTO
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
.word DEINSTALL
.word PAGECOUNT
.word MAP
+ .word USE
.word COMMIT
.word COPYFROM
.word COPYTO
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.
.word DEINSTALL
.word PAGECOUNT
.word MAP
+ .word USE
.word COMMIT
.word COPYFROM
.word COPYTO
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.
.word DEINSTALL
.word PAGECOUNT
.word MAP
+ .word USE
.word COMMIT
.word COPYFROM
.word COPYTO
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
.word DEINSTALL
.word PAGECOUNT
.word MAP
+ .word USE
.word COMMIT
.word COPYFROM
.word COPYTO
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.
; Done
-@L4: rts
+@L4: rts
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
.word DEINSTALL
.word PAGECOUNT
.word MAP
+ .word USE
.word COMMIT
.word COPYFROM
.word COPYTO
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.
em_map.o \
em_pagecount.o \
em_unload.o \
+ em_use.o
all: $(C_OBJS) $(S_OBJS)
; 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
--- /dev/null
+;
+; 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
+