mirror of
https://github.com/cc65/cc65.git
synced 2025-01-10 19:29:45 +00:00
optimized the sei/cli pairing a bit.
This commit is contained in:
parent
18208f4d2e
commit
7cd80e7450
@ -96,8 +96,7 @@ PAGECOUNT:
|
|||||||
; by the driver.
|
; by the driver.
|
||||||
;
|
;
|
||||||
|
|
||||||
MAP: sei
|
MAP: sta curpage
|
||||||
sta curpage
|
|
||||||
stx curpage+1 ; Remember the new page
|
stx curpage+1 ; Remember the new page
|
||||||
|
|
||||||
clc
|
clc
|
||||||
@ -108,6 +107,7 @@ MAP: sei
|
|||||||
|
|
||||||
lda #<ptr1
|
lda #<ptr1
|
||||||
sta FETVEC
|
sta FETVEC
|
||||||
|
sei
|
||||||
|
|
||||||
; Transfer one page
|
; Transfer one page
|
||||||
|
|
||||||
@ -116,12 +116,12 @@ MAP: sei
|
|||||||
sta window,y
|
sta window,y
|
||||||
iny
|
iny
|
||||||
bne @L1
|
bne @L1
|
||||||
|
cli
|
||||||
|
|
||||||
; Return the memory window
|
; Return the memory window
|
||||||
|
|
||||||
lda #<window
|
lda #<window
|
||||||
ldx #>window ; Return the window address
|
ldx #>window ; Return the window address
|
||||||
cli
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
@ -136,8 +136,7 @@ USE: sta curpage
|
|||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; COMMIT: Commit changes in the memory window to extended storage.
|
; COMMIT: Commit changes in the memory window to extended storage.
|
||||||
|
|
||||||
COMMIT: sei
|
COMMIT: lda curpage ; Get the current page
|
||||||
lda curpage ; Get the current page
|
|
||||||
ldx curpage+1
|
ldx curpage+1
|
||||||
bmi done ; Jump if no page mapped
|
bmi done ; Jump if no page mapped
|
||||||
|
|
||||||
@ -149,6 +148,7 @@ COMMIT: sei
|
|||||||
|
|
||||||
lda #<ptr1
|
lda #<ptr1
|
||||||
sta STAVEC
|
sta STAVEC
|
||||||
|
sei
|
||||||
|
|
||||||
; Transfer one page. Y must be zero on entry
|
; Transfer one page. Y must be zero on entry
|
||||||
|
|
||||||
@ -157,11 +157,11 @@ COMMIT: sei
|
|||||||
jsr STASH
|
jsr STASH
|
||||||
iny
|
iny
|
||||||
bne @L1
|
bne @L1
|
||||||
|
cli
|
||||||
|
|
||||||
; Done
|
; Done
|
||||||
|
|
||||||
done: cli
|
done: rts
|
||||||
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
|
||||||
@ -170,7 +170,6 @@ done: cli
|
|||||||
;
|
;
|
||||||
|
|
||||||
COPYFROM:
|
COPYFROM:
|
||||||
sei
|
|
||||||
sta ptr3
|
sta ptr3
|
||||||
stx ptr3+1 ; Save the passed em_copy pointer
|
stx ptr3+1 ; Save the passed em_copy pointer
|
||||||
|
|
||||||
@ -201,6 +200,7 @@ COPYFROM:
|
|||||||
; Copy full pages
|
; Copy full pages
|
||||||
|
|
||||||
ldy #$00
|
ldy #$00
|
||||||
|
sei
|
||||||
@L1: ldx #MMU_CFG_RAM1
|
@L1: ldx #MMU_CFG_RAM1
|
||||||
jsr FETCH
|
jsr FETCH
|
||||||
sta (ptr2),y
|
sta (ptr2),y
|
||||||
@ -237,8 +237,7 @@ COPYFROM:
|
|||||||
; The function must not return anything.
|
; The function must not return anything.
|
||||||
;
|
;
|
||||||
|
|
||||||
COPYTO: sei
|
COPYTO: sta ptr3
|
||||||
sta ptr3
|
|
||||||
stx ptr3+1 ; Save the passed em_copy pointer
|
stx ptr3+1 ; Save the passed em_copy pointer
|
||||||
|
|
||||||
ldy #EM_COPY::OFFS
|
ldy #EM_COPY::OFFS
|
||||||
@ -268,6 +267,7 @@ COPYTO: sei
|
|||||||
; Copy full pages
|
; Copy full pages
|
||||||
|
|
||||||
ldy #$00
|
ldy #$00
|
||||||
|
sei
|
||||||
@L1: lda (ptr2),y
|
@L1: lda (ptr2),y
|
||||||
ldx #MMU_CFG_RAM1
|
ldx #MMU_CFG_RAM1
|
||||||
jsr STASH
|
jsr STASH
|
||||||
|
Loading…
x
Reference in New Issue
Block a user