mirror of
https://github.com/cc65/cc65.git
synced 2025-08-10 04:25:21 +00:00
Merge pull request #240 from blackystardust/fix-c128-ram-rts
Fixed the c128 bank 1 emd.
This commit is contained in:
@@ -51,7 +51,7 @@ PAGES = (TOPMEM - BASE) / 256
|
|||||||
; Data.
|
; Data.
|
||||||
|
|
||||||
.bss
|
.bss
|
||||||
curpage: .res 1 ; Current page number
|
curpage: .res 2 ; Current page number
|
||||||
|
|
||||||
window: .res 256 ; Memory "window"
|
window: .res 256 ; Memory "window"
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ INSTALL:
|
|||||||
stx curpage+1 ; Invalidate the current page
|
stx curpage+1 ; Invalidate the current page
|
||||||
inx
|
inx
|
||||||
txa ; A = X = EM_ERR_OK
|
txa ; A = X = EM_ERR_OK
|
||||||
rts
|
; rts ; Run into UNINSTALL instead
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; UNINSTALL routine. Is called before the driver is removed from memory.
|
; UNINSTALL routine. Is called before the driver is removed from memory.
|
||||||
@@ -107,6 +107,7 @@ MAP: sta curpage
|
|||||||
|
|
||||||
lda #<ptr1
|
lda #<ptr1
|
||||||
sta FETVEC
|
sta FETVEC
|
||||||
|
sei
|
||||||
|
|
||||||
; Transfer one page
|
; Transfer one page
|
||||||
|
|
||||||
@@ -115,6 +116,7 @@ MAP: sta curpage
|
|||||||
sta window,y
|
sta window,y
|
||||||
iny
|
iny
|
||||||
bne @L1
|
bne @L1
|
||||||
|
cli
|
||||||
|
|
||||||
; Return the memory window
|
; Return the memory window
|
||||||
|
|
||||||
@@ -146,6 +148,7 @@ COMMIT: lda curpage ; Get the current page
|
|||||||
|
|
||||||
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
|
||||||
|
|
||||||
@@ -154,6 +157,7 @@ COMMIT: lda curpage ; Get the current page
|
|||||||
jsr STASH
|
jsr STASH
|
||||||
iny
|
iny
|
||||||
bne @L1
|
bne @L1
|
||||||
|
cli
|
||||||
|
|
||||||
; Done
|
; Done
|
||||||
|
|
||||||
@@ -196,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
|
||||||
@@ -223,7 +228,8 @@ COPYFROM:
|
|||||||
|
|
||||||
; Done
|
; Done
|
||||||
|
|
||||||
@L4: rts
|
@L4: cli
|
||||||
|
rts
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; COPYTO: Copy from linear into extended memory. A pointer to a structure
|
; COPYTO: Copy from linear into extended memory. A pointer to a structure
|
||||||
@@ -261,6 +267,7 @@ COPYTO: sta ptr3
|
|||||||
; 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
|
||||||
@@ -288,5 +295,5 @@ COPYTO: sta ptr3
|
|||||||
|
|
||||||
; Done
|
; Done
|
||||||
|
|
||||||
@L4: rts
|
@L4: cli
|
||||||
|
rts
|
||||||
|
2
testcode/lib/.gitignore
vendored
Normal file
2
testcode/lib/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*.o
|
||||||
|
em-test-*
|
Reference in New Issue
Block a user