;; #LAYOUT# STD * #TAKE ;; #LAYOUT# * KERNAL_0 #TAKE ;; #LAYOUT# * * #IGNORE ; ; Official Kernal routine, described in: ; ; - [RG64] C64 Programmers Reference Guide - page 290 ; - [CM64] Computes Mapping the Commodore 64 - page 215 ; ; CPU registers that has to be preserved (see [RG64]): none ; PLOT: bcs plot_get ; Note: the 'set' part has to start from $E50C, as this is a known address ; - https://www.lemon64.com/forum/viewtopic.php?t=3296&%3Bstart=15 ; - https://sys64738.org/2019/05/c64-bedtime-coding-eng-printing-08/ ; - 'Duotris' game calls $E50C during startup screen initialization plot_set: sty PNTR stx TBLX !ifndef CONFIG_ARNITECH_BLADE { jsr screen_calculate_pointers } else { ; On a Blade the cursor is the Terminal Card's, which clamps it to the 80x25 screen; ; PNTR and TBLX keep the last place set or read, which is all there is without a Card jsr terminal_find bcs plot_get_kept lda PNTR sta TERMINAL_COLUMN, x lda TBLX sta TERMINAL_ROW, x } ; FALLTROUGH to save one byte on RTS plot_get: !ifdef CONFIG_ARNITECH_BLADE { jsr terminal_find bcs plot_get_kept lda TERMINAL_COLUMN, x sta PNTR lda TERMINAL_ROW, x sta TBLX plot_get_kept: } ldy PNTR ldx TBLX rts