Finished adding c128 internal/external function ram emd's.

This commit is contained in:
Marco van den Heuvel
2015-11-30 20:14:45 -08:00
parent 7df35cac94
commit 2e2f19ba79
4 changed files with 359 additions and 3 deletions

View File

@@ -44,7 +44,7 @@
; Constants
BASE = $8000
PAGES = 128
PAGES = 127 ; Do not touch MMU
; ------------------------------------------------------------------------
; Data.
@@ -64,11 +64,40 @@ window: .res 256 ; Memory "window"
;
INSTALL:
sei
ldx #0
stx ptr1
ldx #$80
stx ptr1+1
ldx #<ptr1
stx FETVEC
stx STAVEC
ldy #0
ldx #MMU_CFG_INT_FROM
jsr FETCH
tax
inx
txa
sta tmp1
ldx #MMU_CFG_INT_FROM
jsr STASH
ldx #MMU_CFG_INT_FROM
jsr FETCH
cmp tmp1
beq @ram_present
lda #<EM_ERR_NO_DEVICE
ldx #>EM_ERR_NO_DEVICE
cli
rts
@ram_present:
ldx #$FF
stx curpage
stx curpage+1 ; Invalidate the current page
inx
txa ; A = X = EM_ERR_OK
cli
; rts ; Run into UNINSTALL instead
; ------------------------------------------------------------------------
; UNINSTALL routine. Is called before the driver is removed from memory.