diff --git a/asminc/cbm_kernal.inc b/asminc/cbm_kernal.inc index 79edce06b..6e1e1604b 100644 --- a/asminc/cbm_kernal.inc +++ b/asminc/cbm_kernal.inc @@ -100,14 +100,26 @@ UDTIM := $FFEA ; --------------------------------------------------------------------------- ; Kernal routines, direct entries +; +; Unlike the above, these are not standard functions with entries in the jump +; table. They do not exist in all Kernals, and where they do the entry point is +; specific to that particular machine and possibly even Kernal version. +; +; This list is not comprehensive: missing items for particular machines +; should be added as needed. +; +; UPDCRAMPTR: Updates the color RAM pointer to match the screen RAM pointer. +; .if .def(__VIC20__) CLRSCR := $E55F KBDREAD := $E5CF + UPDCRAMPTR := $EAB2 .elseif .def(__C64__) CLRSCR := $E544 KBDREAD := $E5B4 NMIEXIT := $FEBC + UPDCRAMPTR := $EA24 .elseif .def(__C128__) CLRSCR := $C142 KBDREAD := $C006 diff --git a/libsrc/c64/kplot.s b/libsrc/c64/kplot.s index 2d60fd4a6..856bd148d 100644 --- a/libsrc/c64/kplot.s +++ b/libsrc/c64/kplot.s @@ -7,15 +7,16 @@ .export PLOT +.scope KERNAL + .include "cbm_kernal.inc" +.endscope .proc PLOT bcs @L1 - jsr $FFF0 ; Set cursor position - jmp $EA24 ; Set pointer to color RAM + jsr KERNAL::PLOT ; Set cursor position using original ROM PLOT + jmp KERNAL::UPDCRAMPTR ; Set pointer to color RAM to match new cursor position -@L1: jmp $FFF0 ; Get cursor position +@L1: jmp KERNAL::PLOT ; Get cursor position .endproc - - diff --git a/libsrc/plus4/kplot.s b/libsrc/plus4/kplot.s index 7035b05d5..7883c28a6 100644 --- a/libsrc/plus4/kplot.s +++ b/libsrc/plus4/kplot.s @@ -6,16 +6,17 @@ .export PLOT +.scope KERNAL + .include "cbm_kernal.inc" +.endscope + .include "plus4.inc" .segment "LOWCODE" ; Must go into low memory .proc PLOT sta ENABLE_ROM ; Enable the ROM - jsr $FFF0 ; Call the ROM routine + jsr KERNAL::PLOT ; Call the ROM routine sta ENABLE_RAM ; Switch back to RAM rts ; Return to caller .endproc - - - diff --git a/libsrc/vic20/kplot.s b/libsrc/vic20/kplot.s index f37ed8fce..1a943d374 100644 --- a/libsrc/vic20/kplot.s +++ b/libsrc/vic20/kplot.s @@ -7,14 +7,16 @@ .export PLOT +.scope KERNAL + .include "cbm_kernal.inc" +.endscope .proc PLOT bcs @L1 - jsr $FFF0 ; Set cursor position - jmp $EAB2 ; Set pointer to color RAM + jsr KERNAL::PLOT ; Set cursor position using original ROM PLOT + jmp KERNAL::UPDCRAMPTR ; Set pointer to color RAM to match new cursor position -@L1: jmp $FFF0 ; Get cursor position +@L1: jmp KERNAL::PLOT ; Get cursor position .endproc -