]> git.sur5r.net Git - cc65/blobdiff - libsrc/c128/c128-ram.s
Return 0 if color not found
[cc65] / libsrc / c128 / c128-ram.s
index 806192edfc87505e5b4a4cf4a3fe0a80a42a1367..99a571be5be2270b8a8d81a44f69ef10903507e8 100644 (file)
@@ -30,6 +30,7 @@
         .word   DEINSTALL
         .word   PAGECOUNT
         .word   MAP
+        .word   USE
         .word   COMMIT
        .word   COPYFROM
         .word   COPYTO
@@ -114,6 +115,15 @@ MAP:    sta     curpage
         ldx     #>window                ; Return the window address
         rts
 
+; ------------------------------------------------------------------------
+; USE: Tell the driver that the window is now associated with a given page.
+
+USE:    sta     curpage
+        stx     curpage+1               ; Remember the page
+        lda     #<window
+        ldx     #>window                ; Return the window
+        rts
+
 ; ------------------------------------------------------------------------
 ; COMMIT: Commit changes in the memory window to extended storage.
 
@@ -196,6 +206,7 @@ COPYFROM:
         beq     @L4
         sta     tmp1
 
+        ldy     #$00
 @L3:    ldx     #MMU_CFG_RAM1
         jsr     FETCH
         sta    (ptr2),y
@@ -259,7 +270,8 @@ COPYTO: sta     ptr3
         lda     (ptr3),y                ; Get bytes in last page
         beq     @L4
         sta     tmp1
-
+                    
+        ldy     #$00
 @L3:    lda     (ptr2),y
         ldx     #MMU_CFG_RAM1
         jsr     STASH