]> git.sur5r.net Git - cc65/commitdiff
Changed the solution for the PLOT problem with old -02 kernals to that used
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 27 Sep 2009 18:45:08 +0000 (18:45 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sun, 27 Sep 2009 18:45:08 +0000 (18:45 +0000)
for the VIC20: PLOT is not an kernal entry but a library function that will
do the right stuff. This makes it work with other stuff that calls PLOT, too.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4249 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/c64/Makefile
libsrc/c64/cputc.s
libsrc/c64/kernal.s
libsrc/c64/kplot.s [new file with mode: 0644]

index bfce3e8f934b7407e071be3fa51f056891695922..eb0d4122696d6908d26c7d5f4298d8e56974987e 100644 (file)
@@ -58,6 +58,7 @@ OBJS =        _scrsize.o              \
        joy_stddrv.o            \
                kbhit.o                 \
         kernal.o                \
+        kplot.o                 \
         mainargs.o              \
         mcbdefault.o            \
         mouse_stddrv.o          \
index 6df02b4050a51fae1273cdb629d121967b8cc3b6..d5ba79ed79b8cdf634b58dffdafecef7d590ccf8 100644 (file)
@@ -84,20 +84,12 @@ L11:        ora     #$40
 
 
 
-; Set cursor position, calculate RAM pointers. Because kernal -02 doesn't
-; update the color RAM pointer, we have to do that manually here.
+; Set cursor position, calculate RAM pointers.
 
 plot:  ldy     CURS_X
        ldx     CURS_Y
        clc
-               jsr     PLOT            ; Set the new cursor
-        lda     SCREEN_PTR      ; Low byte of color RAM ...
-        sta     CRAM_PTR        ; ... is same as text screen pointer
-        lda     SCREEN_PTR+1    ; While high byte of color RAM
-        and     #$03
-        ora     #$D8            ; ... needs to be adjusted
-        sta     CRAM_PTR+1
-        rts
+               jmp     PLOT            ; Set the new cursor
 
 
 
index ac39779a370e6e0f95c299776e140115ca395781..22160c911865850d336f88f6fdb14062e9391902 100644 (file)
@@ -41,7 +41,6 @@
         .export         CLALL
         .export         UDTIM
         .export         SCREEN
-        .export         PLOT
         .export         IOBASE
 
 
@@ -85,6 +84,5 @@ GETIN         = $FFE4
 CLALL          = $FFE7
 UDTIM          = $FFEA
 SCREEN         = $FFED
-PLOT           = $FFF0
 IOBASE         = $FFF3
 
diff --git a/libsrc/c64/kplot.s b/libsrc/c64/kplot.s
new file mode 100644 (file)
index 0000000..2d60fd4
--- /dev/null
@@ -0,0 +1,21 @@
+;
+; Ullrich von Bassewitz, 2002-12-09, 2009-09-27
+;
+; PLOT replacement function for the C64. The kernal function in the -02 kernals
+; does not set the pointer to the color RAM correctly, so we need to fix that.
+;
+
+        .export         PLOT
+
+
+.proc   PLOT
+
+        bcs     @L1
+        jsr     $FFF0                   ; Set cursor position
+        jmp     $EA24                   ; Set pointer to color RAM
+
+@L1:    jmp     $FFF0                   ; Get cursor position
+
+.endproc
+
+