; Data.
.bss
-curpage: .res 1 ; Current page number
+curpage: .res 2 ; Current page number
window: .res 256 ; Memory "window"
; by the driver.
;
-MAP: sta curpage
+MAP: sei
+ sta curpage
stx curpage+1 ; Remember the new page
clc
lda #<window
ldx #>window ; Return the window address
+ cli
rts
; ------------------------------------------------------------------------
; ------------------------------------------------------------------------
; COMMIT: Commit changes in the memory window to extended storage.
-COMMIT: lda curpage ; Get the current page
+COMMIT: sei
+ lda curpage ; Get the current page
ldx curpage+1
bmi done ; Jump if no page mapped
; Done
-done: rts
+done: cli
+ rts
; ------------------------------------------------------------------------
; COPYFROM: Copy from extended into linear memory. A pointer to a structure
;
COPYFROM:
+ sei
sta ptr3
stx ptr3+1 ; Save the passed em_copy pointer
; Done
-@L4: rts
+@L4: cli
+ rts
; ------------------------------------------------------------------------
; COPYTO: Copy from linear into extended memory. A pointer to a structure
; The function must not return anything.
;
-COPYTO: sta ptr3
+COPYTO: sei
+ sta ptr3
stx ptr3+1 ; Save the passed em_copy pointer
ldy #EM_COPY::OFFS
; Done
-@L4: rts
-
+@L4: cli
+ rts