Replaced em_mapclean by em_commit
git-svn-id: svn://svn.cc65.org/cc65/trunk@1682 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -53,9 +53,9 @@ EMD_HDR_JUMPCOUNT = 7 ; Number of jump vectors
|
|||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; Offsets into the em_copy structure
|
; Offsets into the em_copy structure
|
||||||
|
|
||||||
EM_COPY_PAGE = 0
|
EM_COPY_BUF = 0
|
||||||
EM_COPY_OFFS = 2
|
EM_COPY_OFFS = 2
|
||||||
EM_COPY_BUF = 3
|
EM_COPY_PAGE = 3
|
||||||
EM_COPY_COUNT = 5
|
EM_COPY_COUNT = 5
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
@@ -70,7 +70,7 @@ EM_COPY_COUNT = 5
|
|||||||
.global emd_deinstall
|
.global emd_deinstall
|
||||||
.global emd_pagecount
|
.global emd_pagecount
|
||||||
.global emd_map
|
.global emd_map
|
||||||
.global emd_mapclean
|
.global emd_commit
|
||||||
.global emd_copyfrom
|
.global emd_copyfrom
|
||||||
.global emd_copyto
|
.global emd_copyto
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ EM_COPY_COUNT = 5
|
|||||||
.global _em_deinstall
|
.global _em_deinstall
|
||||||
.global _em_pagecount
|
.global _em_pagecount
|
||||||
.global _em_map
|
.global _em_map
|
||||||
.global _em_mapclean
|
.global _em_commit
|
||||||
.global _em_copyfrom
|
.global _em_copyfrom
|
||||||
.global _em_copyto
|
.global _em_copyto
|
||||||
|
|
||||||
|
|||||||
26
include/em.h
26
include/em.h
@@ -54,11 +54,15 @@
|
|||||||
#define EM_ERR_INV_DRIVER 3 /* Invalid driver */
|
#define EM_ERR_INV_DRIVER 3 /* Invalid driver */
|
||||||
#define EM_ERR_NO_DEVICE 4 /* Device (hardware) not found */
|
#define EM_ERR_NO_DEVICE 4 /* Device (hardware) not found */
|
||||||
|
|
||||||
/* Parameters for the em_copy_... functions */
|
/* Parameters for the em_copy_... functions. NOTE: The first seven bytes
|
||||||
|
* have the same order and alignment as needed for the Commodore REU, so
|
||||||
|
* don't change the order without changing the assembler file that defines
|
||||||
|
* the struct offsets and the code in the REU driver.
|
||||||
|
*/
|
||||||
struct em_copy {
|
struct em_copy {
|
||||||
unsigned page; /* Starting page to copy from or to */
|
|
||||||
unsigned char offs; /* Offset into page */
|
|
||||||
void* buf; /* Memory buffer to copy from or to */
|
void* buf; /* Memory buffer to copy from or to */
|
||||||
|
unsigned char offs; /* Offset into page */
|
||||||
|
unsigned page; /* Starting page to copy from or to */
|
||||||
unsigned count; /* Number of bytes to copy */
|
unsigned count; /* Number of bytes to copy */
|
||||||
unsigned char unused; /* Make the size 8 bytes */
|
unsigned char unused; /* Make the size 8 bytes */
|
||||||
};
|
};
|
||||||
@@ -82,16 +86,16 @@ unsigned em_pagecount (void);
|
|||||||
|
|
||||||
void* __fastcall__ em_map (unsigned page);
|
void* __fastcall__ em_map (unsigned page);
|
||||||
/* Unmap the current page from memory and map a new one. The function returns
|
/* Unmap the current page from memory and map a new one. The function returns
|
||||||
* a pointer to the location of the page in memory.
|
* a pointer to the location of the page in memory. Note: Without calling
|
||||||
|
* em_commit, the old contents of the memory window may be lost!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void* __fastcall__ em_mapclean (unsigned page);
|
void __fastcall__ em_commit (void);
|
||||||
/* Unmap the current page from memory and map a new one. The function returns
|
/* Commit changes in the memory window to extended storage. If the contents
|
||||||
* a pointer to the location of the page in memory. This function differs from
|
* of the memory window have been changed, these changes may be lost if
|
||||||
* em_map_page() in that it will discard the contents of the currently mapped
|
* em_map, em_copyfrom or em_copyto are called without calling em_commit
|
||||||
* page, assuming that the page has not been modified or that the modifications
|
* first. Note: Not calling em_commit does not mean that the changes are
|
||||||
* are no longer needed, if this leads to better performance. NOTE: This does
|
* discarded, it does just mean that some drivers will discard the changes.
|
||||||
* NOT mean that the contents of currently mapped page are always discarded!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void __fastcall__ em_copyfrom (const struct em_copy* copy_data);
|
void __fastcall__ em_copyfrom (const struct em_copy* copy_data);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
.word DEINSTALL
|
.word DEINSTALL
|
||||||
.word PAGECOUNT
|
.word PAGECOUNT
|
||||||
.word MAP
|
.word MAP
|
||||||
.word MAPCLEAN
|
.word COMMIT
|
||||||
.word COPYFROM
|
.word COPYFROM
|
||||||
.word COPYTO
|
.word COPYTO
|
||||||
|
|
||||||
@@ -81,8 +81,8 @@ PAGECOUNT:
|
|||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; MAP: Map the page in a/x into memory and return a pointer to the page in
|
; 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) are assumed to be
|
; a/x. The contents of the currently mapped page (if any) may be discarded
|
||||||
; dirty and must be saved into secondary storage if this is necessary.
|
; by the driver.
|
||||||
;
|
;
|
||||||
|
|
||||||
MAP: sta tmp1
|
MAP: sta tmp1
|
||||||
@@ -100,16 +100,13 @@ MAP: sta tmp1
|
|||||||
|
|
||||||
lda #<GR_WINDOW
|
lda #<GR_WINDOW
|
||||||
ldx #>GR_WINDOW
|
ldx #>GR_WINDOW
|
||||||
rts
|
|
||||||
|
; Use the RTS from COMMIT below to save a precious byte of storage
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; MAPCLEAN: Map the page in a/x into memory and return a pointer to the page
|
; COMMIT: Commit changes in the memory window to extended storage.
|
||||||
; in a/x. The contents of the currently mapped page (if any) are assumed to
|
|
||||||
; be clean, so if this is an advantage for the driver, the current contents
|
|
||||||
; may be discarded.
|
|
||||||
|
|
||||||
MAPCLEAN = MAP ; Identical for GEORAM
|
|
||||||
|
|
||||||
|
COMMIT: rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; COPYFROM: Copy from extended into linear memory. A pointer to a structure
|
; COPYFROM: Copy from extended into linear memory. A pointer to a structure
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
C_OBJS = em_load.o
|
C_OBJS = em_load.o
|
||||||
|
|
||||||
S_OBJS = em-kernel.o \
|
S_OBJS = em-kernel.o \
|
||||||
|
em_commit.o \
|
||||||
em_copyto.o \
|
em_copyto.o \
|
||||||
em_copyfrom.o \
|
em_copyfrom.o \
|
||||||
em_map.o \
|
em_map.o \
|
||||||
em_mapclean.o \
|
|
||||||
em_pagecount.o \
|
em_pagecount.o \
|
||||||
em_unload.o \
|
em_unload.o \
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ emd_install: jmp $0000
|
|||||||
emd_deinstall: jmp $0000
|
emd_deinstall: jmp $0000
|
||||||
emd_pagecount: jmp $0000
|
emd_pagecount: jmp $0000
|
||||||
emd_map: jmp $0000
|
emd_map: jmp $0000
|
||||||
emd_mapclean: jmp $0000
|
emd_commit: jmp $0000
|
||||||
emd_copyfrom: jmp $0000
|
emd_copyfrom: jmp $0000
|
||||||
emd_copyto: jmp $0000
|
emd_copyto: jmp $0000
|
||||||
|
|
||||||
|
|||||||
16
libsrc/em/em_commit.s
Normal file
16
libsrc/em/em_commit.s
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 2002-12-01
|
||||||
|
;
|
||||||
|
; 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
|
||||||
|
; * em_map, em_copyfrom or em_copyto are called without calling em_commit
|
||||||
|
; * first. Note: Not calling em_commit does not mean that the changes are
|
||||||
|
; * discarded, it does just mean that some drivers will discard the changes.
|
||||||
|
; */
|
||||||
|
|
||||||
|
.include "em-kernel.inc"
|
||||||
|
|
||||||
|
_em_commit = emd_commit ; Use driver entry
|
||||||
|
|
||||||
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
;
|
|
||||||
; Ullrich von Bassewitz, 2002-11-29
|
|
||||||
;
|
|
||||||
; void* __fastcall__ em_mapclean (unsigned page);
|
|
||||||
; /* Unmap the current page from memory and map a new one. The function returns
|
|
||||||
; * a pointer to the location of the page in memory. This function differs from
|
|
||||||
; * em_map_page() in that it will discard the contents of the currently mapped
|
|
||||||
; * page, assuming that the page has not been modified or that the modifications
|
|
||||||
; * are no longer needed, if this leads to better performance. NOTE: This does
|
|
||||||
; * NOT mean that the contents of currently mapped page are always discarded!
|
|
||||||
; */
|
|
||||||
|
|
||||||
|
|
||||||
.include "em-kernel.inc"
|
|
||||||
|
|
||||||
_em_mapclean = emd_mapclean ; Use driver entry
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user